@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
@@ -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
+ import{__rest as e,__assign as t}from"../_virtual/_tslib.js";import r from"react";import o from"clsx";import{Menu as a,MenuButton as i,MenuItems as l}from"@headlessui/react";import{navigation as n}from"@k8slens/lds-icons";import s from"./ContextMenuItem.js";import m from"./ContextMenu.module.css.js";var c=n.ContextMenuIcon,d=Object.assign((function(n){var s,d=n.children,u=n.icon,f=n.position,p=void 0===f?"right":f,b=n.disabled,x=void 0!==b&&b,v=n.className,E=e(n,["children","icon","position","disabled","className"]),N=u||c;return r.createElement("div",t({},E,{className:o(m.contextMenu,v)}),r.createElement(a,null,r.createElement(i,{className:m.trigger,disabled:x,"aria-label":E["aria-label"]||"Context menu"},r.createElement(N,null)),r.createElement(l,{transition:!0,className:o(m.dropdown,(s={},s[m.left]="left"===p,s))},d)))}),{Item:s});export{d as default};
@@ -0,0 +1 @@
1
+ var e={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"};export{e as default};
@@ -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
+ import e from"react";import t from"clsx";import{MenuItem as a}from"@headlessui/react";import m from"./ContextMenu.module.css.js";function l(l){var o=l.children,r=l.icon,s=l.onClick,c=l.disabled,i=void 0!==c&&c,n=l.className;return e.createElement(a,{disabled:i},e.createElement("button",{className:t(m.item,n),onClick:s,disabled:i,type:"button"},r&&e.createElement(r,{className:m.itemIcon}),e.createElement("span",{className:m.itemLabel},o)))}export{l as default};
@@ -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
  /**
@@ -1 +1 @@
1
- import{__rest as a,__assign as t}from"../_virtual/_tslib.js";import e from"react";import r from"./ProgressBar.module.css.js";import s from"clsx";function l(l){var m,o=l.value,i=l.type,u=void 0===i?"default":i,c=l.max,p=void 0===c?1:c,f=l.title,v=l.className,d=a(l,["value","type","max","title","className"]),n=isNaN(o)?0:Math.max(0,o),x=isNaN(p)||p<=0?1:p,N=Math.min(100,Math.round(n/x*100)),g=f||"".concat(N,"%");return e.createElement("progress",t({},d,{className:s(r.progressBar,v,(m={},m[r[u]]="default"!==u,m)),value:n,max:x,"aria-valuetext":g,title:f}),g)}export{l as default};
1
+ import{__rest as a,__assign as t}from"../_virtual/_tslib.js";import e from"react";import r from"clsx";import s from"./ProgressBar.module.css.js";function l(l){var m,o=l.value,i=l.type,u=void 0===i?"default":i,c=l.max,p=void 0===c?1:c,f=l.title,v=l.className,d=a(l,["value","type","max","title","className"]),n=isNaN(o)?0:Math.max(0,o),x=isNaN(p)||p<=0?1:p,N=Math.min(100,Math.round(n/x*100)),g=f||"".concat(N,"%");return e.createElement("progress",t({},d,{className:r(s.progressBar,v,(m={},m[s[u]]="default"!==u,m)),value:n,max:x,"aria-valuetext":g,title:f}),g)}export{l as default};
@@ -10,16 +10,33 @@ declare type ItemState = {
10
10
  selected?: boolean;
11
11
  disabled?: boolean;
12
12
  };
13
+ /** Props for the RadioCard component. */
13
14
  export interface RadioCardProps<T> {
15
+ /** HTML `id` attribute for the radio group. */
14
16
  id?: string;
17
+ /** Accessible label for the radio group. */
15
18
  "aria-label"?: string;
19
+ /** Array of options to render as radio cards. */
16
20
  options: Array<T>;
21
+ /** Currently selected option. */
17
22
  value: T | undefined;
23
+ /** Change handler receiving the selected option. */
18
24
  onChange(d: T): void;
25
+ /** Name attribute for the radio group. */
19
26
  name: string;
27
+ /** Optional class name for the radio group container. */
20
28
  className?: string;
29
+ /** Optional class name applied to each radio card item. */
21
30
  itemClassName?: string;
31
+ /**
32
+ * Whether the entire radio group is disabled.
33
+ * @default false
34
+ */
22
35
  disabled?: boolean;
36
+ /**
37
+ * Whether the radio group is in an invalid state.
38
+ * @default false
39
+ */
23
40
  invalid?: boolean;
24
41
  /**
25
42
  * Function to render the content of card item.
@@ -30,9 +47,18 @@ export interface RadioCardProps<T> {
30
47
  renderItem?(d: T | undefined, state: ItemState): ReactNode;
31
48
  }
32
49
  /**
33
- * A styled radio button component.
50
+ * A card-based radio group for visual option selection. Renders each option as a styled card with a radio indicator.
34
51
  *
35
52
  * Usage: `import { RadioCard } from "@k8slens/lds"`
53
+ *
54
+ * ```tsx
55
+ * <RadioCard
56
+ * name="plan"
57
+ * options={[{ id: "1", label: "Free" }, { id: "2", label: "Pro" }]}
58
+ * value={selected}
59
+ * onChange={setSelected}
60
+ * />
61
+ * ```
36
62
  */
37
63
  export default function RadioCard<T extends DefaultOption>({ id, "aria-label": ariaLabel, value, options, onChange, name, invalid, disabled, itemClassName, className, renderItem, ...radioGroupProps }: RadioCardProps<T>): React.JSX.Element;
38
64
  export {};
@@ -1,9 +1,19 @@
1
1
  import React, { type ReactNode } from "react";
2
- declare const MultiOption: React.ForwardRefExoticComponent<{
2
+ /** Props for the MultiOption component. */
3
+ interface MultiOptionProps {
4
+ /** Display text of the option, used for the accessible label. */
3
5
  label: string;
4
- className?: string | undefined;
6
+ /** Optional class name for the multi-option pill. */
7
+ className?: string;
8
+ /** Content rendered inside the option pill. */
5
9
  children: ReactNode;
10
+ /** Called when the remove button is clicked or activated via keyboard. */
6
11
  onRemove: (e: React.MouseEvent | React.KeyboardEvent) => void;
7
- onArrowNavigate?: ((direction: "next" | "prev") => void) | undefined;
8
- } & React.RefAttributes<HTMLSpanElement>>;
12
+ /** Called on arrow key press for keyboard navigation between pills. */
13
+ onArrowNavigate?: (direction: "next" | "prev") => void;
14
+ }
15
+ /**
16
+ * Removable pill for selected values in a multi-select. Supports keyboard navigation and accessible removal.
17
+ */
18
+ declare const MultiOption: React.ForwardRefExoticComponent<MultiOptionProps & React.RefAttributes<HTMLSpanElement>>;
9
19
  export default MultiOption;
@@ -1,7 +1,13 @@
1
1
  import React from "react";
2
2
  import { type DefaultOption, type SelectProps } from "./Select";
3
+ /** Props for the Option component. */
3
4
  export declare type OptionProps<T> = Pick<SelectProps<T>, "size" | "itemClassName" | "placeholder"> & NonNullable<Pick<SelectProps<T>, "renderContent">> & {
5
+ /** Currently selected values, used to determine selection state. */
4
6
  currentValues?: T[] | null;
7
+ /** The option data to render. */
5
8
  option: T;
6
9
  };
10
+ /**
11
+ * Individual option item rendered within a Select dropdown. Handles active, selected, and custom render states.
12
+ */
7
13
  export default function Option<T extends DefaultOption>({ option, currentValues, size, itemClassName, renderContent, placeholder, }: OptionProps<T>): React.JSX.Element;