@cloudwick/astral-ui 1.0.0 → 2.0.0

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.
Files changed (41) hide show
  1. package/README.md +4 -4
  2. package/dist/components/adpIcon/svgObjects.d.ts +4 -4
  3. package/dist/components/avatar/index.d.ts +27 -0
  4. package/dist/components/avatarGroup/index.d.ts +32 -0
  5. package/dist/components/badge/index.d.ts +20 -16
  6. package/dist/components/button/index.d.ts +42 -16
  7. package/dist/components/card/cardBody.d.ts +13 -0
  8. package/dist/components/card/cardFooter.d.ts +13 -0
  9. package/dist/components/card/cardHeader.d.ts +22 -0
  10. package/dist/components/card/index.d.ts +14 -4
  11. package/dist/components/checkbox/index.d.ts +2 -2
  12. package/dist/components/checkboxGroup/index.d.ts +9 -6
  13. package/dist/components/ctaGroup/index.d.ts +46 -0
  14. package/dist/components/dropdown/dropdownItem.d.ts +1 -3
  15. package/dist/components/dropdown/index.d.ts +1 -1
  16. package/dist/components/emptyState/index.d.ts +2 -1
  17. package/dist/components/modal/index.d.ts +1 -1
  18. package/dist/components/modal/modalBody.d.ts +1 -5
  19. package/dist/components/pagination/index.d.ts +1 -1
  20. package/dist/components/panel/index.d.ts +30 -0
  21. package/dist/components/panel/panelBody.d.ts +13 -0
  22. package/dist/components/panel/panelFooter.d.ts +13 -0
  23. package/dist/components/panel/panelHeader.d.ts +39 -0
  24. package/dist/components/panel/panelStoryHelpers.d.ts +7 -0
  25. package/dist/components/panelGroup/index.d.ts +23 -0
  26. package/dist/components/passwordField/index.d.ts +4 -0
  27. package/dist/components/scrollbar/index.d.ts +34 -0
  28. package/dist/components/scrollbar/storyUtils.d.ts +8 -0
  29. package/dist/components/select/index.d.ts +35 -8
  30. package/dist/components/select/utils.d.ts +3 -0
  31. package/dist/components/tabs/tab.d.ts +17 -10
  32. package/dist/components/textCopy/index.d.ts +29 -0
  33. package/dist/components/textField/index.d.ts +17 -13
  34. package/dist/components/toast/index.d.ts +4 -2
  35. package/dist/components/toggle/index.d.ts +1 -1
  36. package/dist/components/truncate/index.d.ts +21 -0
  37. package/dist/css/index.min.css +1 -1
  38. package/dist/index.cjs.js +2 -2
  39. package/dist/index.d.ts +9 -0
  40. package/dist/index.esm.js +2 -2
  41. package/package.json +3 -10
@@ -0,0 +1,34 @@
1
+ import React, { ReactNode } from "react";
2
+ import type { TVoidElements } from "../../types/custom";
3
+ import "./scrollbar.styles.css";
4
+ export interface IScrollbarProps {
5
+ /**
6
+ * children to render inside the scroll container
7
+ */
8
+ children: ReactNode;
9
+ /**
10
+ * The type of tag to render for the scroll container, the default value is "div".
11
+ * @default div
12
+ */
13
+ as?: keyof Omit<JSX.IntrinsicElements, TVoidElements>;
14
+ /**
15
+ * Overwrite the scrollbar container styles by passing space separated class names.
16
+ * @optional
17
+ */
18
+ className?: string;
19
+ /**
20
+ * Pass a boolean value to set the visibility of the scroller, by default the scrollbar will be visible on content hover.
21
+ * @optional
22
+ * @default false
23
+ */
24
+ alwaysVisible?: boolean;
25
+ /**
26
+ * Set it to true if you want to directly scroll to the click position,
27
+ * by default the scroller will move in the direction of the click
28
+ * @default false
29
+ */
30
+ scrollToClickPosition?: boolean;
31
+ id?: string;
32
+ }
33
+ export declare const Scrollbar: React.ForwardRefExoticComponent<IScrollbarProps & React.RefAttributes<HTMLElement>>;
34
+ export default Scrollbar;
@@ -0,0 +1,8 @@
1
+ import React, { FunctionComponent } from "react";
2
+ export declare const Table: FunctionComponent<{
3
+ width?: number;
4
+ height?: number;
5
+ }>;
6
+ export declare const NewspaperArticle: FunctionComponent;
7
+ export declare const WideContent: FunctionComponent;
8
+ export declare const NestedScrollbars: () => React.JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from "react";
2
- import { Props as SelectProps } from "react-select";
2
+ import { Props as SelectProps, type GroupBase } from "react-select";
3
+ import { IconType } from "../adpIcon";
3
4
  export declare enum SelectSizes {
4
5
  MD = "md",
5
6
  LG = "lg"
@@ -10,7 +11,7 @@ export type Option = {
10
11
  value: any;
11
12
  isFixed?: boolean;
12
13
  };
13
- export interface Props extends Omit<SelectProps, "options" | "value" | "isDisabled"> {
14
+ export interface Props {
14
15
  /**
15
16
  * Accepts id for the select
16
17
  */
@@ -24,12 +25,12 @@ export interface Props extends Omit<SelectProps, "options" | "value" | "isDisabl
24
25
  */
25
26
  label?: ReactNode;
26
27
  /**
27
- * Size of the Selct field.
28
+ * Size of the Select field.
28
29
  * @default md
29
30
  */
30
31
  size?: SelectSize;
31
32
  /**
32
- * Selction option for the select field
33
+ * Selection option for the select field
33
34
  */
34
35
  options?: readonly (Option | {
35
36
  label: ReactNode;
@@ -63,10 +64,36 @@ export interface Props extends Omit<SelectProps, "options" | "value" | "isDisabl
63
64
  * Enables users to create new options along with choosing existing options.
64
65
  */
65
66
  creatable?: boolean;
67
+ touched?: boolean;
66
68
  /**
67
- * Enables multi-select
69
+ * @description When multi-select is enabled, this prop sets the maximum number of selected values that will be shown in the value container.
70
+ * @default 3
68
71
  */
69
- multiSelect?: boolean;
70
- touched?: boolean;
72
+ maxVisibleValues?: number;
73
+ /**
74
+ * A custom message that can be shown instead of the message '+[count] more' when the number of selected values is more than 'maxVisibleValues'.
75
+ * The message will be appended after '+[count]'
76
+ */
77
+ maxVisibleValuesMsg?: string;
78
+ /**
79
+ * Custom content to be displayed at the bottom of the dropdown menu.
80
+ */
81
+ menuFooter?: ReactNode;
82
+ /**
83
+ * Icon to be displayed before the value container.
84
+ * @description
85
+ * This prop accepts either an IconType (string) or a ReactNode.
86
+ * - If an IconType is provided, it will render an ADPIcon component.
87
+ * - If a ReactNode is provided, it will be rendered as-is.
88
+ */
89
+ prefixIcon?: IconType | ReactNode;
90
+ /**
91
+ * Icon to be displayed after the value container.
92
+ * @description
93
+ * This prop accepts either an IconType (string) or a ReactNode.
94
+ * - If an IconType is provided, it will render an ADPIcon component.
95
+ * - If a ReactNode is provided, it will be rendered as-is.
96
+ */
97
+ suffixIcon?: IconType | ReactNode;
71
98
  }
72
- export declare function Select({ id, className, label, size, options, value, helperText, error, multiSelect, creatable, disabled, ...restProps }: Props): JSX.Element;
99
+ export declare function Select<IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(selectProps: SelectProps<Option, IsMulti, Group> & Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { StylesConfig, GroupBase } from "react-select";
2
+ import { SelectSize, type Option } from "./index";
3
+ export declare const reactSelectCustomStyles: <IsMulti extends boolean, Group extends GroupBase<Option>>(error: boolean, size: SelectSize, multiSelect: boolean) => StylesConfig<Option, IsMulti, Group>;
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { ReactNode } from "react";
2
2
  import { IconType } from "../adpIcon";
3
3
  /**
4
4
  * Props for the Tab component.
@@ -28,19 +28,26 @@ export interface TabProps {
28
28
  * Content to be displayed within the tab.
29
29
  */
30
30
  children: React.ReactNode;
31
- /**
32
- * Optional icon to be displayed in the tab.
33
- */
34
- icon?: IconType;
35
- /**
36
- * Placement of the icon within the tab.
37
- * Can be either "start" or "end".
38
- */
39
- iconPlacement?: "start" | "end";
40
31
  /**
41
32
  * Indicates whether the tab is disabled.
42
33
  */
43
34
  disabled?: boolean;
35
+ /**
36
+ * Icon to be displayed before the title of the Tab.
37
+ * @description
38
+ * This prop accepts either an IconType (string) or a ReactNode.
39
+ * - If an IconType is provided, it will render an ADPIcon component.
40
+ * - If a ReactNode is provided, it will be rendered as-is.
41
+ */
42
+ prefixIcon?: IconType | ReactNode;
43
+ /**
44
+ * Icon to be displayed after the title of the Tab.
45
+ * @description
46
+ * This prop accepts either an IconType (string) or a ReactNode.
47
+ * - If an IconType is provided, it will render an ADPIcon component.
48
+ * - If a ReactNode is provided, it will be rendered as-is.
49
+ */
50
+ suffixIcon?: IconType | ReactNode;
44
51
  }
45
52
  export declare const Tab: ({ children, className }: TabProps) => React.ReactElement;
46
53
  export default Tab;
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ export interface ITextCopyProps {
3
+ /**
4
+ * Pass the text prop if you want to copy something other than children string
5
+ */
6
+ text?: string;
7
+ /**
8
+ * Pass comma separated classes to style the textCopy component
9
+ */
10
+ className?: string;
11
+ /**
12
+ * Pass the children to display the text or element to be copied.
13
+ * When passing children as non-string, make sure to pass text prop as well
14
+ */
15
+ children?: React.ReactElement | string;
16
+ /**
17
+ * To display icon on hover of the text
18
+ */
19
+ displayOnHover?: boolean;
20
+ /**
21
+ * Title for the copy button
22
+ */
23
+ copyButtonTitle?: string;
24
+ /**
25
+ * Confirmation message to be shown after the text gets copied
26
+ */
27
+ confirmationMessage?: string;
28
+ }
29
+ export declare const TextCopy: ({ text, className, children, displayOnHover, copyButtonTitle, confirmationMessage }: ITextCopyProps) => JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode } from "react";
2
- import { IconType } from "../adpIcon";
2
+ import { type IconType } from "../adpIcon";
3
3
  export declare enum sizes {
4
4
  MD = "md",
5
5
  LG = "lg"
@@ -10,23 +10,11 @@ export interface Props extends Omit<React.ComponentPropsWithoutRef<"input">, "cs
10
10
  * Regular static label.
11
11
  */
12
12
  label?: string | ReactNode;
13
- /**
14
- * Icon click handler
15
- */
16
- onIconClick?: () => void;
17
- /**
18
- * Placement of the icon
19
- */
20
- iconPlacement?: "start" | "end";
21
13
  /**
22
14
  * Size of the Textfield.
23
15
  * @default md
24
16
  */
25
17
  size?: Size;
26
- /**
27
- * Prefix the input with an icon.
28
- */
29
- icon?: IconType;
30
18
  /**
31
19
  * Pass a ref to the inner input element
32
20
  */
@@ -39,5 +27,21 @@ export interface Props extends Omit<React.ComponentPropsWithoutRef<"input">, "cs
39
27
  * Pass a boolean value to indicate if the text field is in an error state.
40
28
  */
41
29
  error?: boolean;
30
+ /**
31
+ * Icon to be displayed before the input.
32
+ * @description
33
+ * This prop accepts either an IconType (string) or a ReactNode.
34
+ * - If an IconType is provided, it will render an ADPIcon component.
35
+ * - If a ReactNode is provided, it will be rendered as-is.
36
+ */
37
+ prefixIcon?: IconType | ReactNode;
38
+ /**
39
+ * Icon to be displayed after the input.
40
+ * @description
41
+ * This prop accepts either an IconType (string) or a ReactNode.
42
+ * - If an IconType is provided, it will render an ADPIcon component.
43
+ * - If a ReactNode is provided, it will be rendered as-is.
44
+ */
45
+ suffixIcon?: IconType | ReactNode;
42
46
  }
43
47
  export declare const TextField: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -1,11 +1,12 @@
1
1
  import React, { ReactElement } from "react";
2
- export type TToastVariant = "success" | "info" | "warning" | "error";
2
+ export declare const variants: readonly ["success", "info", "warning", "error"];
3
+ type Variant = typeof variants[number];
3
4
  export interface IToastProps {
4
5
  /**
5
6
  * Accepts a variant value
6
7
  * @default info
7
8
  */
8
- variant: TToastVariant;
9
+ variant: Variant;
9
10
  /**
10
11
  * Show/hide the toast component
11
12
  * @default true
@@ -39,3 +40,4 @@ export interface IToastProps {
39
40
  className?: string;
40
41
  }
41
42
  export declare const Toast: ({ variant, display, children, autoHideDelay, hideCloseButton, onClose, condensed, className }: IToastProps) => ReactElement | null;
43
+ export {};
@@ -1,5 +1,5 @@
1
1
  import React, { RefObject } from "react";
2
- import { IconType } from "../adpIcon";
2
+ import { type IconType } from "../adpIcon";
3
3
  export interface ToggleProps extends Omit<React.HTMLProps<HTMLInputElement>, "label" | "size"> {
4
4
  /**
5
5
  * id for the Toggle
@@ -0,0 +1,21 @@
1
+ import type { TVoidElements } from "../../types/custom";
2
+ export type Props = {
3
+ /**
4
+ * The type of tag to render for the scroll container, the default value is "div".
5
+ * @default div
6
+ */
7
+ as?: keyof Omit<JSX.IntrinsicElements, TVoidElements>;
8
+ children?: string;
9
+ /**
10
+ * Maximum number of characters to display before truncating.
11
+ * If the text exceeds this limit, it will be truncated with an ellipsis,
12
+ * and a "Show more" button will be displayed.
13
+ * The full text can be viewed in a modal by clicking the "Show more" button.
14
+ */
15
+ limit: number;
16
+ /**
17
+ * Overwrite the styles for the Truncate component by passing space separated class names
18
+ */
19
+ className?: string;
20
+ };
21
+ export declare const Truncate: ({ as, children, limit, className }: Props) => JSX.Element | null;