@k8slens/lds 0.58.1 → 0.58.3

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 (86) hide show
  1. package/lib/cjs/Avatar/Avatar.d.ts +3 -1
  2. package/lib/cjs/Badge/Badge.d.ts +6 -4
  3. package/lib/cjs/Button/Button.d.ts +34 -6
  4. package/lib/cjs/Button/shared.d.ts +30 -1
  5. package/lib/cjs/ButtonBar/ButtonBar.d.ts +17 -0
  6. package/lib/cjs/Checkbox/Checkbox.d.ts +7 -0
  7. package/lib/cjs/ConfirmDialog/ConfirmDialog.d.ts +16 -0
  8. package/lib/cjs/ContextMenu/ContextMenu.d.ts +40 -0
  9. package/lib/cjs/ContextMenu/ContextMenu.js +1 -0
  10. package/lib/cjs/ContextMenu/ContextMenu.module.css.js +1 -0
  11. package/lib/cjs/ContextMenu/ContextMenuItem.d.ts +30 -0
  12. package/lib/cjs/ContextMenu/ContextMenuItem.js +1 -0
  13. package/lib/cjs/DrawerTransition/DrawerTransition.d.ts +20 -0
  14. package/lib/cjs/Input/Input.d.ts +8 -0
  15. package/lib/cjs/LinkButton/LinkButton.d.ts +7 -0
  16. package/lib/cjs/LoadingIndicator/LoadingIndicator.d.ts +8 -2
  17. package/lib/cjs/Lozenge/Lozenge.d.ts +4 -2
  18. package/lib/cjs/Modal/Modal.d.ts +26 -0
  19. package/lib/cjs/Notification/Notification.d.ts +18 -2
  20. package/lib/cjs/NumberBadge/NumberBadge.d.ts +1 -1
  21. package/lib/cjs/Panel/Panel.d.ts +28 -0
  22. package/lib/cjs/ProfileBlock/ProfileBlock.d.ts +8 -0
  23. package/lib/cjs/ProgressBar/ProgressBar.d.ts +11 -0
  24. package/lib/cjs/ProgressBar/ProgressBar.js +1 -1
  25. package/lib/cjs/RadioCard/RadioCard.d.ts +27 -1
  26. package/lib/cjs/Select/MultiOption.d.ts +14 -4
  27. package/lib/cjs/Select/Option.d.ts +6 -0
  28. package/lib/cjs/Select/Select.d.ts +39 -5
  29. package/lib/cjs/SideNav/SideNav.d.ts +9 -3
  30. package/lib/cjs/SideNav/SideNavGroup.d.ts +13 -5
  31. package/lib/cjs/SideNav/SideNavItem.d.ts +22 -5
  32. package/lib/cjs/Switch/Switch.d.ts +2 -0
  33. package/lib/cjs/Tooltip/Tooltip.d.ts +15 -3
  34. package/lib/cjs/UserMenu/UserMenu.d.ts +9 -2
  35. package/lib/cjs/UserMenu/UserMenuDropdown.d.ts +10 -6
  36. package/lib/cjs/UserMenu/UserMenuItem.d.ts +22 -1
  37. package/lib/cjs/components.d.ts +1 -0
  38. package/lib/cjs/index.css +1 -1
  39. package/lib/cjs/index.electron.js +1 -1
  40. package/lib/cjs/index.js +1 -1
  41. package/lib/es/Avatar/Avatar.d.ts +3 -1
  42. package/lib/es/Badge/Badge.d.ts +6 -4
  43. package/lib/es/Button/Button.d.ts +34 -6
  44. package/lib/es/Button/shared.d.ts +30 -1
  45. package/lib/es/ButtonBar/ButtonBar.d.ts +17 -0
  46. package/lib/es/Checkbox/Checkbox.d.ts +7 -0
  47. package/lib/es/ConfirmDialog/ConfirmDialog.d.ts +16 -0
  48. package/lib/es/ContextMenu/ContextMenu.d.ts +40 -0
  49. package/lib/es/ContextMenu/ContextMenu.js +1 -0
  50. package/lib/es/ContextMenu/ContextMenu.module.css.js +1 -0
  51. package/lib/es/ContextMenu/ContextMenuItem.d.ts +30 -0
  52. package/lib/es/ContextMenu/ContextMenuItem.js +1 -0
  53. package/lib/es/DrawerTransition/DrawerTransition.d.ts +20 -0
  54. package/lib/es/Input/Input.d.ts +8 -0
  55. package/lib/es/LinkButton/LinkButton.d.ts +7 -0
  56. package/lib/es/LoadingIndicator/LoadingIndicator.d.ts +8 -2
  57. package/lib/es/Lozenge/Lozenge.d.ts +4 -2
  58. package/lib/es/Modal/Modal.d.ts +26 -0
  59. package/lib/es/Notification/Notification.d.ts +18 -2
  60. package/lib/es/NumberBadge/NumberBadge.d.ts +1 -1
  61. package/lib/es/Panel/Panel.d.ts +28 -0
  62. package/lib/es/ProfileBlock/ProfileBlock.d.ts +8 -0
  63. package/lib/es/ProgressBar/ProgressBar.d.ts +11 -0
  64. package/lib/es/ProgressBar/ProgressBar.js +1 -1
  65. package/lib/es/RadioCard/RadioCard.d.ts +27 -1
  66. package/lib/es/Select/MultiOption.d.ts +14 -4
  67. package/lib/es/Select/Option.d.ts +6 -0
  68. package/lib/es/Select/Select.d.ts +39 -5
  69. package/lib/es/SideNav/SideNav.d.ts +9 -3
  70. package/lib/es/SideNav/SideNavGroup.d.ts +13 -5
  71. package/lib/es/SideNav/SideNavItem.d.ts +22 -5
  72. package/lib/es/Switch/Switch.d.ts +2 -0
  73. package/lib/es/Tooltip/Tooltip.d.ts +15 -3
  74. package/lib/es/UserMenu/UserMenu.d.ts +9 -2
  75. package/lib/es/UserMenu/UserMenuDropdown.d.ts +10 -6
  76. package/lib/es/UserMenu/UserMenuItem.d.ts +22 -1
  77. package/lib/es/components.d.ts +1 -0
  78. package/lib/es/index.css +1 -1
  79. package/lib/es/index.electron.js +1 -1
  80. package/lib/es/index.js +1 -1
  81. package/lib/web/{lds-v0-58-0 → lds-v0-58-2}/index.css +1 -1
  82. package/lib/web/lds-v0-58-2/index.js +28 -0
  83. package/llms.txt +290 -100
  84. package/package.json +3 -3
  85. package/lib/web/lds-v0-58-0/index.js +0 -28
  86. /package/lib/web/{lds-v0-58-0 → lds-v0-58-2}/typography.css +0 -0
@@ -1,5 +1,6 @@
1
1
  import React, { type HTMLAttributes } from "react";
2
2
  import { type Icon } from "@k8slens/lds-icons/lib/es/Icon/Icon";
3
+ /** Props for the Avatar component. */
3
4
  export interface AvatarProps extends Pick<HTMLAttributes<HTMLDivElement>, "aria-hidden" | "aria-label"> {
4
5
  /**
5
6
  * Full name of the user. Initials will be generated from this value and shown if no image is provided.
@@ -14,7 +15,8 @@ export interface AvatarProps extends Pick<HTMLAttributes<HTMLDivElement>, "aria-
14
15
  */
15
16
  image?: string | Icon | null;
16
17
  /**
17
- * Size of the avatar. Defaults to "md"
18
+ * Size of the avatar.
19
+ * @default "md"
18
20
  */
19
21
  size?: "sm" | "md" | "xl";
20
22
  }
@@ -1,16 +1,18 @@
1
1
  import React, { HTMLAttributes } from "react";
2
+ /** Props for the Badge component. */
2
3
  export interface BadgeProps extends Pick<HTMLAttributes<HTMLSpanElement>, "id" | "className" | "title" | "aria-label" | "aria-hidden" | "role"> {
3
4
  /**
4
- * If no title has not been provided, the badge will be hidden from screen readers.
5
+ * If no title is provided, the badge will be hidden from screen readers.
5
6
  */
6
7
  title?: string;
7
8
  /**
8
- * Defines the color of the lozenge.
9
- * @default secondary
9
+ * Defines the color of the badge.
10
+ * @default "secondary"
10
11
  */
11
12
  type?: "primary" | "secondary" | "success" | "error" | "warning";
12
13
  /**
13
- * @default sm
14
+ * Size of the badge.
15
+ * @default "sm"
14
16
  */
15
17
  size?: "sm" | "md" | "lg";
16
18
  }
@@ -1,41 +1,65 @@
1
1
  import React, { ButtonHTMLAttributes, ReactNode } from "react";
2
2
  import { Props } from "./shared";
3
+ /** Props for the Button component. */
3
4
  export interface ButtonProps extends Props, Pick<ButtonHTMLAttributes<HTMLButtonElement>, "id" | "className" | "aria-label" | "title"> {
5
+ /**
6
+ * The HTML `type` attribute for the underlying `<button>` element.
7
+ * @default "button"
8
+ */
4
9
  buttonType?: ButtonHTMLAttributes<HTMLButtonElement>["type"];
5
10
  /**
6
- * Specify the the initial value of the button element, used when the button is inside a form.
11
+ * Specify the initial value of the button element, used when the button is inside a form.
7
12
  */
8
13
  buttonValue?: ButtonHTMLAttributes<HTMLButtonElement>["value"];
9
14
  /**
10
- * Specify the the name of the button element, used when the button is inside a form.
15
+ * Specify the name of the button element, used when the button is inside a form.
11
16
  */
12
17
  buttonName?: ButtonHTMLAttributes<HTMLButtonElement>["name"];
18
+ /**
19
+ * Whether to show the loading activity indicator.
20
+ * @default false
21
+ */
13
22
  loading?: boolean;
14
23
  /**
15
- * When set to true true, if the onClick callback returns a promise,
24
+ * When set to true, if the onClick callback returns a promise,
16
25
  * loading activity indicator will be shown until the promise has been resolved/rejected.
26
+ * @default false
17
27
  */
18
28
  loadingStateOnPromise?: boolean;
29
+ /** Click handler. May return a promise when used with `loadingStateOnPromise`. */
19
30
  onClick?(e: React.MouseEvent<HTMLButtonElement, MouseEvent>): Promise<unknown> | unknown;
20
31
  }
32
+ /** Props for the Button component when `label` is a ReactNode (requires explicit `aria-label`). */
21
33
  export interface ButtonPropsWithLabelNode extends Omit<Props, "label">, Pick<ButtonHTMLAttributes<HTMLButtonElement>, "id" | "className" | "title"> {
34
+ /**
35
+ * The HTML `type` attribute for the underlying `<button>` element.
36
+ * @default "button"
37
+ */
22
38
  buttonType?: ButtonHTMLAttributes<HTMLButtonElement>["type"];
23
39
  /**
24
- * Specify the the initial value of the button element, used when the button is inside a form.
40
+ * Specify the initial value of the button element, used when the button is inside a form.
25
41
  */
26
42
  buttonValue?: ButtonHTMLAttributes<HTMLButtonElement>["value"];
27
43
  /**
28
- * Specify the the name of the button element, used when the button is inside a form.
44
+ * Specify the name of the button element, used when the button is inside a form.
29
45
  */
30
46
  buttonName?: ButtonHTMLAttributes<HTMLButtonElement>["name"];
47
+ /**
48
+ * Whether to show the loading activity indicator.
49
+ * @default false
50
+ */
31
51
  loading?: boolean;
32
52
  /**
33
- * When set to true true, if the onClick callback returns a promise,
53
+ * When set to true, if the onClick callback returns a promise,
34
54
  * loading activity indicator will be shown until the promise has been resolved/rejected.
55
+ * @default false
35
56
  */
36
57
  loadingStateOnPromise?: boolean;
58
+ /** Required accessible label when `label` is a ReactNode. */
37
59
  "aria-label": string;
60
+ /** Button label content, accepts ReactNode. */
38
61
  label: ReactNode;
62
+ /** Click handler. May return a promise when used with `loadingStateOnPromise`. */
39
63
  onClick?(e: React.MouseEvent<HTMLButtonElement, MouseEvent>): Promise<unknown> | unknown;
40
64
  }
41
65
  /**
@@ -44,6 +68,10 @@ export interface ButtonPropsWithLabelNode extends Omit<Props, "label">, Pick<But
44
68
  * from `onClick` will show a loading indicator until the promise has been resolved/rejected.
45
69
  *
46
70
  * Usage: `import { Button } from "@k8slens/lds"`
71
+ *
72
+ * ```tsx
73
+ * <Button label="Save" type="primary" onClick={handleSave} />
74
+ * ```
47
75
  */
48
76
  declare const Button: React.ForwardRefExoticComponent<(ButtonProps | ButtonPropsWithLabelNode) & React.RefAttributes<HTMLButtonElement>>;
49
77
  export default Button;
@@ -4,17 +4,46 @@ export declare type Type = "default" | "primary" | "ok" | "danger" | "caution";
4
4
  export declare type Size = "xxs" | "xs" | "sm" | "md";
5
5
  export declare type IconPosition = "right" | "left";
6
6
  export declare type TextTransform = "uppercase" | "capitalize";
7
+ /** Shared props for the Button component variants. */
7
8
  export interface Props {
9
+ /** Text label rendered inside the button. */
8
10
  label: string;
11
+ /** Icon component rendered alongside the label. */
9
12
  icon?: Icon;
13
+ /**
14
+ * Which side of the label the icon is rendered on.
15
+ * @default "left"
16
+ */
10
17
  iconPosition?: IconPosition;
18
+ /**
19
+ * Visual style variant of the button.
20
+ * @default "default"
21
+ */
11
22
  type?: Type;
23
+ /**
24
+ * Size of the button.
25
+ * @default "md"
26
+ */
12
27
  size?: Size;
28
+ /**
29
+ * Shorthand for `type="primary"`.
30
+ * @deprecated Use `type="primary"` instead.
31
+ */
13
32
  primary?: boolean;
33
+ /**
34
+ * Whether the button is disabled.
35
+ * @default false
36
+ */
14
37
  disabled?: boolean;
38
+ /** Whether the button uses the discreet (low-emphasis) style. */
15
39
  discreet?: boolean;
16
- /** @deprecated Use `case: "textTransform"` instead */
40
+ /**
41
+ * Text transform applied to the label.
42
+ * @deprecated Use `textTransform` instead.
43
+ */
17
44
  case?: TextTransform;
45
+ /** Text transform applied to the label. */
18
46
  textTransform?: TextTransform;
47
+ /** Additional content rendered after the label. */
19
48
  children?: React.ReactNode;
20
49
  }
@@ -3,15 +3,32 @@ declare type ExtractIntrinsicElementProps<Element extends keyof JSX.IntrinsicEle
3
3
  declare type ExtractComponentProps<TComponentOrTProps> = TComponentOrTProps extends React.ComponentType<infer TProps> ? TProps : TComponentOrTProps;
4
4
  declare type ExtractProps<TComponentOrTProps> = TComponentOrTProps extends keyof JSX.IntrinsicElements ? ExtractIntrinsicElementProps<TComponentOrTProps> : ExtractComponentProps<TComponentOrTProps>;
5
5
  export declare type Type = "default" | "centered" | "stacked" | "grid";
6
+ /** Props for the ButtonBar component. */
6
7
  export declare type ButtonBarProps<ElementType extends JSX.IntrinsicElements | React.ElementType<any>> = Partial<Omit<ExtractProps<ElementType>, "children" | "as" | "type" | "gridSize">> & {
8
+ /**
9
+ * Element or component to render as the container.
10
+ * @default "div"
11
+ */
7
12
  as?: keyof JSX.IntrinsicElements | React.ElementType<any> | undefined;
13
+ /**
14
+ * Layout type for the button arrangement.
15
+ * @default "default"
16
+ */
8
17
  type?: Type;
18
+ /** Override the grid column count (only used when `type` is `"grid"`). */
9
19
  gridSize?: Number;
10
20
  };
11
21
  /**
12
22
  * A container for buttons. Set `type` prop to change the layout of the buttons.
13
23
  *
14
24
  * Usage: `import { ButtonBar } from "@k8slens/lds"`
25
+ *
26
+ * ```tsx
27
+ * <ButtonBar>
28
+ * <Button label="Cancel" />
29
+ * <Button label="Save" type="primary" />
30
+ * </ButtonBar>
31
+ * ```
15
32
  */
16
33
  declare function ButtonBar<ElementType extends JSX.IntrinsicElements | React.ElementType<any>>({ as: Component, type, gridSize, children, ...props }: PropsWithChildren<ButtonBarProps<ElementType>>): React.JSX.Element;
17
34
  export default ButtonBar;
@@ -1,7 +1,14 @@
1
1
  import React from "react";
2
+ /** Props for the Checkbox component. */
2
3
  export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "onChange" | "value" | "disabled"> {
4
+ /** Whether the checkbox is checked. */
3
5
  value: boolean;
6
+ /** Change handler receiving the new value and the original event. */
4
7
  onChange(value: boolean, evt: React.ChangeEvent<HTMLInputElement>): void;
8
+ /**
9
+ * Whether the checkbox is disabled.
10
+ * @default false
11
+ */
5
12
  disabled?: boolean;
6
13
  }
7
14
  /**
@@ -1,15 +1,31 @@
1
1
  import React, { type ReactNode } from "react";
2
2
  import { type ButtonProps } from "../Button/Button";
3
3
  declare type AllowedButtonProps = Pick<ButtonProps, "type" | "size" | "discreet" | "icon" | "iconPosition" | "textTransform">;
4
+ /** Props for the ConfirmDialog component. */
4
5
  export declare type ConfirmDialogProps = {
6
+ /** Title displayed in the confirm dialog header. */
5
7
  title: string;
8
+ /** Optional message body rendered below the title. */
6
9
  message?: string | ReactNode;
10
+ /**
11
+ * Label for the confirm button.
12
+ * @default "Ok"
13
+ */
7
14
  confirmText?: string;
15
+ /**
16
+ * Label for the cancel button.
17
+ * @default "Cancel"
18
+ */
8
19
  cancelLabel?: string;
20
+ /** Additional Button props forwarded to the confirm button. */
9
21
  confirmButtonProps?: Partial<AllowedButtonProps>;
22
+ /** Additional Button props forwarded to the cancel button. */
10
23
  cancelButtonProps?: Partial<AllowedButtonProps>;
24
+ /** Called when the dialog is dismissed (overlay click or escape key). */
11
25
  handleClose: () => void;
26
+ /** Called when the user clicks the confirm button. */
12
27
  handleConfirm: () => void;
28
+ /** Called when the user clicks the cancel button. */
13
29
  handleCancel: () => void;
14
30
  };
15
31
  /**
@@ -0,0 +1,40 @@
1
+ import React, { HTMLAttributes, ReactNode } from "react";
2
+ import { type Icon } from "@k8slens/lds-icons/lib/es/Icon/Icon";
3
+ import ContextMenuItem from "./ContextMenuItem";
4
+ export type { ContextMenuItemProps } from "./ContextMenuItem";
5
+ /** Props for the ContextMenu component. */
6
+ export interface ContextMenuProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
7
+ /** Menu items rendered inside the dropdown. */
8
+ children: ReactNode;
9
+ /**
10
+ * Icon component for the trigger button.
11
+ * @default ContextMenuIcon
12
+ */
13
+ icon?: Icon;
14
+ /**
15
+ * Horizontal alignment of the dropdown relative to the trigger.
16
+ * @default "right"
17
+ */
18
+ position?: "left" | "right";
19
+ /**
20
+ * Whether the context menu is disabled.
21
+ * @default false
22
+ */
23
+ disabled?: boolean;
24
+ }
25
+ /**
26
+ * A dropdown context menu triggered by an icon button.
27
+ *
28
+ * Usage: `import { ContextMenu } from "@k8slens/lds"`
29
+ *
30
+ * ```tsx
31
+ * <ContextMenu>
32
+ * <ContextMenu.Item onClick={handleEdit}>Edit</ContextMenu.Item>
33
+ * <ContextMenu.Item onClick={handleDelete} disabled>Delete</ContextMenu.Item>
34
+ * </ContextMenu>
35
+ * ```
36
+ */
37
+ declare const ContextMenu: (({ children, icon: Icn, position, disabled, className, ...props }: ContextMenuProps) => React.JSX.Element) & {
38
+ Item: typeof ContextMenuItem;
39
+ };
40
+ export default ContextMenu;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("../_virtual/_tslib.js"),t=require("react"),a=require("clsx"),n=require("@headlessui/react"),l=require("@k8slens/lds-icons"),r=require("./ContextMenuItem.js"),i=require("./ContextMenu.module.css.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=s(t),o=s(a),c=l.navigation.ContextMenuIcon,d=Object.assign((function(t){var a,l=t.children,r=t.icon,s=t.position,d=void 0===s?"right":s,m=t.disabled,f=void 0!==m&&m,b=t.className,v=e.__rest(t,["children","icon","position","disabled","className"]),q=r||c;return u.default.createElement("div",e.__assign({},v,{className:o.default(i.contextMenu,b)}),u.default.createElement(n.Menu,null,u.default.createElement(n.MenuButton,{className:i.trigger,disabled:f,"aria-label":v["aria-label"]||"Context menu"},u.default.createElement(q,null)),u.default.createElement(n.MenuItems,{transition:!0,className:o.default(i.dropdown,(a={},a[i.left]="left"===d,a))},l)))}),{Item:r});module.exports=d;
@@ -0,0 +1 @@
1
+ "use strict";module.exports={contextMenu:"lds-context-menu",trigger:"lds-context-menu--trigger",dropdown:"lds-context-menu--dropdown",left:"lds-context-menu--left",item:"lds-context-menu--item",itemIcon:"lds-context-menu--item-icon",itemLabel:"lds-context-menu--item-label"};
@@ -0,0 +1,30 @@
1
+ import React, { ReactNode } from "react";
2
+ import { type Icon } from "@k8slens/lds-icons/lib/es/Icon/Icon";
3
+ /** Props for the ContextMenu.Item sub-component. */
4
+ export interface ContextMenuItemProps {
5
+ /** Content displayed inside the menu item. */
6
+ children: ReactNode;
7
+ /** Optional icon rendered before the content. */
8
+ icon?: Icon;
9
+ /** Click handler. */
10
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
11
+ /**
12
+ * Whether the item is disabled.
13
+ * @default false
14
+ */
15
+ disabled?: boolean;
16
+ /** Optional class name. */
17
+ className?: string;
18
+ }
19
+ /**
20
+ * A single item inside a ContextMenu dropdown. Renders a button with an optional icon.
21
+ *
22
+ * Usage: `import ContextMenu from "@k8slens/lds/ContextMenu"`
23
+ *
24
+ * ```tsx
25
+ * <ContextMenu.Item icon={EditIcon} onClick={handleEdit}>
26
+ * Edit
27
+ * </ContextMenu.Item>
28
+ * ```
29
+ */
30
+ export default function ContextMenuItem({ children, icon: Icn, onClick, disabled, className, }: ContextMenuItemProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("react"),t=require("clsx"),a=require("@headlessui/react"),l=require("./ContextMenu.module.css.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=r(e),n=r(t);module.exports=function(e){var t=e.children,r=e.icon,c=e.onClick,s=e.disabled,i=void 0!==s&&s,d=e.className;return u.default.createElement(a.MenuItem,{disabled:i},u.default.createElement("button",{className:n.default(l.item,d),onClick:c,disabled:i,type:"button"},r&&u.default.createElement(r,{className:l.itemIcon}),u.default.createElement("span",{className:l.itemLabel},t)))};
@@ -1,10 +1,30 @@
1
1
  import React, { PropsWithChildren } from "react";
2
+ /** Props for the DrawerTransition component. */
2
3
  export interface DrawerTransitionProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ /** Whether the drawer is open. */
3
5
  open: boolean;
6
+ /**
7
+ * Transition duration in milliseconds.
8
+ * @default 250
9
+ */
4
10
  duration?: number;
11
+ /** Callback fired after the enter transition completes. */
5
12
  afterEnter?: () => void;
13
+ /** Callback fired after the exit transition completes. */
6
14
  afterExit?: () => void;
15
+ /** Changes in dependencies trigger re-calculation of the drawer dimensions. */
7
16
  deps?: object;
8
17
  }
18
+ /**
19
+ * An animated drawer that expands and collapses content with a height transition.
20
+ *
21
+ * Usage: `import { DrawerTransition } from "@k8slens/lds"`
22
+ *
23
+ * ```tsx
24
+ * <DrawerTransition open={isOpen}>
25
+ * <p>Collapsible content here</p>
26
+ * </DrawerTransition>
27
+ * ```
28
+ */
9
29
  declare const DrawerTransition: React.FC<PropsWithChildren<DrawerTransitionProps>>;
10
30
  export default DrawerTransition;
@@ -1,15 +1,23 @@
1
1
  import React, { HTMLInputTypeAttribute } from "react";
2
2
  import { type Icon } from "@k8slens/lds-icons/lib/es/Icon/Icon";
3
3
  export declare type InputType = Exclude<HTMLInputTypeAttribute, "button" | "checkbox" | "radio" | "number">;
4
+ /** Props for the Input component. */
4
5
  export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
6
+ /** Icon component displayed on the right side of the input. */
5
7
  icon?: Icon;
8
+ /** HTML input type (excludes button, checkbox, radio, number). */
6
9
  type?: InputType;
10
+ /** Props forwarded to the wrapping `div` element. */
7
11
  wrapperProps?: React.HTMLAttributes<HTMLDivElement>;
8
12
  }
9
13
  /**
10
14
  * A simple input component. Set `icon` prop to show an icon on the right side of the input.
11
15
  *
12
16
  * Usage: `import { Input } from "@k8slens/lds"`
17
+ *
18
+ * ```tsx
19
+ * <Input placeholder="Enter text" onChange={handleChange} />
20
+ * ```
13
21
  */
14
22
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
15
23
  export default Input;
@@ -1,9 +1,16 @@
1
1
  import React, { type AnchorHTMLAttributes } from "react";
2
2
  export declare type Size = "sm" | "md";
3
3
  export declare type TextTransform = "uppercase" | "capitalize";
4
+ /** Props for the LinkButton component. */
4
5
  export interface LinkButtonProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "label"> {
6
+ /** Text label displayed in the link button. */
5
7
  label: string;
8
+ /**
9
+ * Size of the link button.
10
+ * @default "md"
11
+ */
6
12
  size?: Size;
13
+ /** Text transformation applied to the label. */
7
14
  textTransform?: TextTransform;
8
15
  /**
9
16
  * Leave `href` and `onClick` undefined to disable the button
@@ -1,17 +1,23 @@
1
1
  import React from "react";
2
2
  import { type Props as IconProps } from "@k8slens/lds-icons/lib/es/Icon/Icon.d";
3
+ /** Props for the LoadingIndicator component. */
3
4
  export interface LoadingIndicatorProps {
4
5
  /**
5
- *`IconProps.size`, see [SVGIcon](/?path=/docs/icon-svgicon--default) for details.
6
+ * `IconProps.size`, see [SVGIcon](/?path=/docs/icon-svgicon--default) for details.
6
7
  * @default "md"
7
8
  */
8
9
  size?: IconProps["size"];
10
+ /** Optional class name. */
9
11
  className?: string;
10
12
  }
11
13
  /**
12
- * A loading indicator component.
14
+ * Animated spinner for loading states. Wraps a SpinnerIcon with configurable size.
13
15
  *
14
16
  * Usage: `import { LoadingIndicator } from "@k8slens/lds"`
17
+ *
18
+ * ```tsx
19
+ * <LoadingIndicator size="md" />
20
+ * ```
15
21
  */
16
22
  declare const LoadingIndicator: React.FC<LoadingIndicatorProps>;
17
23
  export default LoadingIndicator;
@@ -1,9 +1,10 @@
1
1
  import React, { HTMLAttributes } from "react";
2
2
  export declare type TextTransform = "uppercase" | "capitalize";
3
+ /** Props for the Lozenge component. */
3
4
  export interface LozengeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "type" | "size" | "textTransform"> {
4
5
  /**
5
6
  * Defines the color of the lozenge.
6
- * @default secondary
7
+ * @default "secondary"
7
8
  */
8
9
  type?: "primary" | "secondary" | "success" | "error" | "warning";
9
10
  /**
@@ -11,7 +12,8 @@ export interface LozengeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "typ
11
12
  */
12
13
  textTransform?: TextTransform;
13
14
  /**
14
- * @default sm
15
+ * Size of the lozenge.
16
+ * @default "sm"
15
17
  */
16
18
  size?: "sm" | "md" | "lg";
17
19
  }
@@ -1,16 +1,36 @@
1
1
  import React, { PropsWithChildren, ReactNode } from "react";
2
2
  import { PanelProps } from "../Panel/Panel";
3
3
  import { ButtonBarProps } from "../ButtonBar/ButtonBar";
4
+ /** Props for the Modal component. */
4
5
  export interface ModalProps<Component extends keyof JSX.IntrinsicElements | React.ElementType> {
6
+ /** Title displayed in the modal header. */
5
7
  title: string;
8
+ /** Optional subtitle displayed below the title. */
6
9
  subTitle?: string;
10
+ /** Whether the modal is currently open. */
7
11
  isOpen: boolean;
12
+ /** Called when the modal is dismissed (overlay click or escape key). */
8
13
  onClose: () => void;
14
+ /**
15
+ * Size of the modal.
16
+ * @default "md"
17
+ */
9
18
  size: "sm" | "md" | "lg" | "xl";
19
+ /** Element type or component used as the content wrapper (passed to Panel). */
10
20
  contentComponent?: PanelProps<Component>["wrapperComponent"];
21
+ /** Props forwarded to the content wrapper component. */
11
22
  contentProps?: PanelProps<Component>["wrapperProps"];
23
+ /**
24
+ * Props forwarded to the footer ButtonBar component.
25
+ * @default {}
26
+ */
12
27
  buttonBarProps?: Omit<ButtonBarProps<"footer">, "as">;
28
+ /**
29
+ * Additional class name for the modal Panel.
30
+ * @default ""
31
+ */
13
32
  className?: string;
33
+ /** Content rendered in the modal footer, wrapped by ButtonBar. */
14
34
  footer?: ReactNode;
15
35
  }
16
36
  /**
@@ -24,6 +44,12 @@ export interface ModalProps<Component extends keyof JSX.IntrinsicElements | Reac
24
44
  * To pass props to `ButtonBar` use the `buttonBarProps` prop.
25
45
  *
26
46
  * Usage: `import { Modal } from "@k8slens/lds"`
47
+ *
48
+ * ```tsx
49
+ * <Modal isOpen={open} onClose={close} title="Confirm" size="sm">
50
+ * <p>Are you sure?</p>
51
+ * </Modal>
52
+ * ```
27
53
  */
28
54
  declare function Modal<Component extends keyof JSX.IntrinsicElements | React.ElementType>({ children, isOpen, onClose, title, subTitle, size, contentComponent, contentProps: _contentProps, buttonBarProps, className, footer, }: PropsWithChildren<ModalProps<Component>>): React.JSX.Element | null;
29
55
  export default Modal;
@@ -1,22 +1,38 @@
1
1
  import React, { ReactNode } from "react";
2
2
  export declare type Type = "flash" | "closable" | "inline" | "default";
3
3
  export declare type AlertLevel = "info" | "success" | "error" | "warning";
4
+ /** Props for the Notification component. */
4
5
  export interface NotificationProps {
6
+ /** The notification body content. */
5
7
  message: string | ReactNode;
8
+ /** Optional bold heading rendered above the message. */
6
9
  title?: string;
10
+ /**
11
+ * Behavior type of the notification.
12
+ * @default "default"
13
+ */
7
14
  type?: Type;
15
+ /**
16
+ * Visual severity level of the notification.
17
+ * @default "info"
18
+ */
8
19
  level?: AlertLevel;
20
+ /** @deprecated Use `type` prop instead. */
9
21
  inline?: false;
22
+ /** @deprecated Use `type` prop instead. */
10
23
  flash?: false;
11
24
  /**
12
- * Hide after `flashDuration` milliseconds, if type is set to "flash"
25
+ * Hide after `flashDuration` milliseconds, if type is set to "flash".
26
+ * @default 5000
13
27
  */
14
28
  flashDuration?: number;
15
29
  /**
16
- * Can be set closable if not inline
30
+ * Can be set closable if not inline.
17
31
  */
18
32
  closable?: boolean;
33
+ /** Called after the notification finishes its exit transition. */
19
34
  onClose?(): void;
35
+ /** Additional class name for the notification wrapper. */
20
36
  className?: string;
21
37
  }
22
38
  /**
@@ -4,7 +4,7 @@ export declare const formatNumber: (n: number) => string;
4
4
  interface BaseNumberBadgeProps extends Omit<LozengeProps, "role" | "children" | "title" | "textTransform" | "size"> {
5
5
  value: number | null | undefined;
6
6
  /**
7
- * If no title has not been provided, the badge will be hidden from screen readers.
7
+ * If no title is provided, the badge will be hidden from screen readers.
8
8
  */
9
9
  title?: string;
10
10
  /**
@@ -1,17 +1,45 @@
1
1
  import React, { Fragment, ReactNode } from "react";
2
2
  import type { ExtractProps } from "../types/ExtractProps.d";
3
+ /** Props for the Panel component. */
3
4
  export interface PanelProps<WrapperComponent extends keyof JSX.IntrinsicElements | React.ElementType = typeof Fragment, HeaderComponent extends keyof JSX.IntrinsicElements | React.ElementType = "header", ContentComponent extends keyof JSX.IntrinsicElements | React.ElementType = "div", FooterComponent extends keyof JSX.IntrinsicElements | React.ElementType = "footer"> {
5
+ /** Content rendered in the header section. */
4
6
  header?: ReactNode;
7
+ /** Content rendered in the footer section. */
5
8
  footer?: ReactNode;
9
+ /** Optional class name applied to header, content, and footer elements. */
6
10
  className?: string;
11
+ /**
12
+ * Component used to wrap the entire panel.
13
+ * @default Fragment
14
+ */
7
15
  wrapperComponent?: WrapperComponent;
16
+ /** Props forwarded to the wrapper component. */
8
17
  wrapperProps?: ExtractProps<WrapperComponent>;
18
+ /**
19
+ * Component used for the header section.
20
+ * @default "header"
21
+ */
9
22
  headerComponent?: HeaderComponent;
23
+ /** Props forwarded to the header component. */
10
24
  headerProps?: ExtractProps<HeaderComponent>;
25
+ /**
26
+ * Component used for the content section.
27
+ * @default "div"
28
+ */
11
29
  contentComponent?: ContentComponent | undefined;
30
+ /** Props forwarded to the content component. */
12
31
  contentProps?: ExtractProps<ContentComponent>;
32
+ /**
33
+ * Component used for the footer section.
34
+ * @default "footer"
35
+ */
13
36
  footerComponent?: FooterComponent;
37
+ /** Props forwarded to the footer component. */
14
38
  footerProps?: ExtractProps<FooterComponent>;
39
+ /**
40
+ * Whether to show a loading indicator overlay.
41
+ * @default false
42
+ */
15
43
  loading?: boolean;
16
44
  }
17
45
  /**
@@ -6,10 +6,18 @@ declare type Item = {
6
6
  avatar?: AvatarProps["image"];
7
7
  avatarTitle: string;
8
8
  };
9
+ /** Props for the ProfileBlock component. */
9
10
  export declare type ProfileBlockProps = HTMLProps<HTMLDivElement> & {
11
+ /**
12
+ * Whether to show a loading indicator instead of text content.
13
+ * @default false
14
+ */
10
15
  loading?: boolean;
16
+ /** User data to display (title, subtitle, avatar). */
11
17
  item: Item;
18
+ /** Custom formatter for the title text. */
12
19
  formatTitle?: (item: Item) => string | ReactElement;
20
+ /** Custom formatter for the subtitle text. */
13
21
  formatSubtitle?: (item: Item) => string | ReactElement;
14
22
  };
15
23
  /**
@@ -1,8 +1,19 @@
1
1
  import React from "react";
2
+ /** Props for the ProgressBar component. */
2
3
  export interface ProgressBarProps extends React.ProgressHTMLAttributes<HTMLProgressElement> {
4
+ /** Current progress value. */
3
5
  value: number;
6
+ /**
7
+ * Maximum value for the progress bar.
8
+ * @default 1
9
+ */
4
10
  max?: number;
11
+ /**
12
+ * Color of the progress bar.
13
+ * @default "default"
14
+ */
5
15
  type?: "default" | "ok" | "caution" | "danger";
16
+ /** Accessible title text. Falls back to percentage display if not provided. */
6
17
  title?: string;
7
18
  }
8
19
  /**