@grasp-labs/ds-react-components 0.13.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 (104) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +52 -0
  3. package/dist/assets/fonts/Inter-VariableFont_opsz,wght.ttf +0 -0
  4. package/dist/components/advancedFilter/AdvancedFilter.d.ts +8 -0
  5. package/dist/components/advancedFilter/AdvancedFilterRow.d.ts +7 -0
  6. package/dist/components/advancedFilter/index.d.ts +4 -0
  7. package/dist/components/advancedFilter/types.d.ts +43 -0
  8. package/dist/components/advancedFilter/utils.d.ts +3 -0
  9. package/dist/components/alert/Alert.d.ts +19 -0
  10. package/dist/components/alert/index.d.ts +1 -0
  11. package/dist/components/animatedList/AnimatedList.d.ts +19 -0
  12. package/dist/components/animatedList/hooks/useLayoutAnimation.d.ts +9 -0
  13. package/dist/components/animatedList/index.d.ts +2 -0
  14. package/dist/components/animatedList/types.d.ts +19 -0
  15. package/dist/components/baseButton/BaseButton.d.ts +13 -0
  16. package/dist/components/baseButton/index.d.ts +1 -0
  17. package/dist/components/baseTextBox/BaseTextBox.d.ts +40 -0
  18. package/dist/components/baseTextBox/index.d.ts +1 -0
  19. package/dist/components/baseTextBox/useInputValidation.d.ts +3 -0
  20. package/dist/components/breadcrumb/Breadcrumb.d.ts +29 -0
  21. package/dist/components/breadcrumb/index.d.ts +1 -0
  22. package/dist/components/button/Button.d.ts +15 -0
  23. package/dist/components/button/index.d.ts +1 -0
  24. package/dist/components/card/Card.d.ts +27 -0
  25. package/dist/components/card/index.d.ts +1 -0
  26. package/dist/components/checkbox/Checkbox.d.ts +17 -0
  27. package/dist/components/checkbox/CheckboxIcon.d.ts +14 -0
  28. package/dist/components/checkbox/index.d.ts +4 -0
  29. package/dist/components/dialog/ConfirmationDialog.d.ts +36 -0
  30. package/dist/components/dialog/Dialog.d.ts +31 -0
  31. package/dist/components/dialog/index.d.ts +2 -0
  32. package/dist/components/dynamicIcon/DynamicIcon.d.ts +8 -0
  33. package/dist/components/dynamicIcon/index.d.ts +2 -0
  34. package/dist/components/field/Field.d.ts +82 -0
  35. package/dist/components/field/index.d.ts +16 -0
  36. package/dist/components/flow/FlowTile.d.ts +3 -0
  37. package/dist/components/flow/MetadataList.d.ts +6 -0
  38. package/dist/components/flow/StatusIcon.d.ts +5 -0
  39. package/dist/components/flow/TileHeader.d.ts +8 -0
  40. package/dist/components/flow/index.d.ts +2 -0
  41. package/dist/components/flow/types.d.ts +15 -0
  42. package/dist/components/iconButton/IconButton.d.ts +15 -0
  43. package/dist/components/iconButton/index.d.ts +1 -0
  44. package/dist/components/jsonEditor/JsonEditor.d.ts +7 -0
  45. package/dist/components/jsonEditor/index.d.ts +1 -0
  46. package/dist/components/list/List.d.ts +28 -0
  47. package/dist/components/list/ListItem.d.ts +20 -0
  48. package/dist/components/list/index.d.ts +2 -0
  49. package/dist/components/logo/Logo.d.ts +5 -0
  50. package/dist/components/logo/index.d.ts +2 -0
  51. package/dist/components/menu/Menu.d.ts +51 -0
  52. package/dist/components/menu/MenuEntry.d.ts +73 -0
  53. package/dist/components/menu/MenuFooter.d.ts +23 -0
  54. package/dist/components/menu/index.d.ts +11 -0
  55. package/dist/components/multiSelect/MultiSelect.d.ts +28 -0
  56. package/dist/components/multiSelect/index.d.ts +2 -0
  57. package/dist/components/popover/Popover.d.ts +60 -0
  58. package/dist/components/popover/index.d.ts +2 -0
  59. package/dist/components/radioButton/RadioButton.d.ts +29 -0
  60. package/dist/components/radioButton/index.d.ts +2 -0
  61. package/dist/components/select/Select.d.ts +30 -0
  62. package/dist/components/select/index.d.ts +1 -0
  63. package/dist/components/tabPanel/Tab.d.ts +22 -0
  64. package/dist/components/tabPanel/TabPanel.d.ts +20 -0
  65. package/dist/components/tabPanel/index.d.ts +2 -0
  66. package/dist/components/tabPanel/useTabKeyboard.d.ts +16 -0
  67. package/dist/components/table/Table.d.ts +33 -0
  68. package/dist/components/table/TableCell.d.ts +17 -0
  69. package/dist/components/table/TableHeaderCell.d.ts +17 -0
  70. package/dist/components/table/components/Pagination.d.ts +21 -0
  71. package/dist/components/table/components/index.d.ts +1 -0
  72. package/dist/components/table/index.d.ts +6 -0
  73. package/dist/components/tag/Tag.d.ts +18 -0
  74. package/dist/components/tag/index.d.ts +1 -0
  75. package/dist/components/tagList/TagList.d.ts +20 -0
  76. package/dist/components/tagList/index.d.ts +2 -0
  77. package/dist/components/tagList/utils.d.ts +2 -0
  78. package/dist/components/textBox/TextBox.d.ts +8 -0
  79. package/dist/components/textBox/index.d.ts +1 -0
  80. package/dist/components/toast/Toast.d.ts +2 -0
  81. package/dist/components/toast/Toaster.d.ts +10 -0
  82. package/dist/components/toast/index.d.ts +3 -0
  83. package/dist/components/toast/types.d.ts +22 -0
  84. package/dist/components/typography/Typography.d.ts +27 -0
  85. package/dist/components/typography/index.d.ts +2 -0
  86. package/dist/components/unstyledButton/UnstyledButton.d.ts +12 -0
  87. package/dist/components/unstyledButton/index.d.ts +1 -0
  88. package/dist/hooks/index.d.ts +1 -0
  89. package/dist/hooks/useArrowNavigation.d.ts +30 -0
  90. package/dist/hooks/useResizeObserver.d.ts +1 -0
  91. package/dist/hooks/useViewportCollision.d.ts +7 -0
  92. package/dist/icons/icons.d.ts +256 -0
  93. package/dist/icons/index.d.ts +1 -0
  94. package/dist/index-CQ7w5dl6.js +8258 -0
  95. package/dist/index.css +1 -0
  96. package/dist/index.d.ts +32 -0
  97. package/dist/index.esm-DgyjJxy1.js +786 -0
  98. package/dist/index.js +92 -0
  99. package/dist/tailwind-styles.css +229 -0
  100. package/dist/test/setup.d.ts +0 -0
  101. package/dist/types/BaseOption.d.ts +5 -0
  102. package/dist/types/IconComponent.d.ts +6 -0
  103. package/dist/types/index.d.ts +1 -0
  104. package/package.json +94 -0
@@ -0,0 +1,31 @@
1
+ import { CardProps } from '../card/Card';
2
+ export type DialogProps = {
3
+ /** Whether the dialog is open */
4
+ isOpen: boolean;
5
+ /** Callback function called when the dialog should be closed */
6
+ onClose: () => void;
7
+ /** Whether clicking the backdrop should close the dialog */
8
+ closeOnBackdropClick?: boolean;
9
+ /** Whether pressing Escape should close the dialog */
10
+ closeOnEscape?: boolean;
11
+ /** Whether to show close button in header */
12
+ showClose?: boolean;
13
+ /** Additional CSS classes for the dialog backdrop */
14
+ backdropClassName?: string;
15
+ /** Size variant for the dialog */
16
+ size?: "sm" | "lg";
17
+ } & CardProps;
18
+ /**
19
+ * A modal dialog component built on top of the Card component.
20
+ *
21
+ * Features:
22
+ * - Backdrop click to close (optional)
23
+ * - Escape key to close (optional)
24
+ * - Prevents body scroll when open
25
+ * - Optional close button in header
26
+ * - Customizable backdrop and card styling
27
+ *
28
+ * @param props - The props for the Dialog component
29
+ * @returns A modal dialog with backdrop
30
+ */
31
+ export declare const Dialog: ({ isOpen, onClose, closeOnBackdropClick, closeOnEscape, showClose, backdropClassName, size, className, title, headerActions, footerActions, children, headerClassName, bodyClassName, footerClassName, }: DialogProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ export { Dialog, type DialogProps } from './Dialog';
2
+ export { ConfirmationDialog, type ConfirmationDialogProps, } from './ConfirmationDialog';
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ import { IconName } from '../../icons/icons';
3
+ import { IconProps } from '../../types/IconComponent';
4
+ export type DynamicIconProps = IconProps & {
5
+ name: IconName;
6
+ fallback?: ReactNode;
7
+ };
8
+ export declare function DynamicIcon({ name, fallback, ...props }: DynamicIconProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { DynamicIcon } from './DynamicIcon';
2
+ export type { DynamicIconProps } from './DynamicIcon';
@@ -0,0 +1,82 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export type FieldProps = HTMLAttributes<HTMLDivElement> & {
3
+ children: ReactNode;
4
+ disabled?: boolean;
5
+ ref?: React.Ref<HTMLDivElement>;
6
+ };
7
+ /**
8
+ * Field is the root component for form fields with inline label layout.
9
+ * The label is positioned on the left side inline with the input control.
10
+ *
11
+ * @example
12
+ * <Field>
13
+ * <FieldLabel>Email</FieldLabel>
14
+ * <FieldContent>
15
+ * <input type="email" />
16
+ * <FieldMessage error>Invalid email format</FieldMessage>
17
+ * </FieldContent>
18
+ * </Field>
19
+ */
20
+ export declare const Field: ({ disabled, className, children, ref, ...props }: FieldProps) => import("react/jsx-runtime").JSX.Element;
21
+ export type FieldLabelProps = HTMLAttributes<HTMLLabelElement> & {
22
+ children: ReactNode;
23
+ htmlFor: string;
24
+ required?: boolean;
25
+ ref?: React.Ref<HTMLLabelElement>;
26
+ };
27
+ /**
28
+ * FieldLabel renders a label for the field input, positioned on the left side inline.
29
+ */
30
+ export declare const FieldLabel: ({ className, children, required, htmlFor, ref, ...props }: FieldLabelProps) => import("react/jsx-runtime").JSX.Element;
31
+ export type FieldContentProps = HTMLAttributes<HTMLDivElement> & {
32
+ children: ReactNode;
33
+ ref?: React.Ref<HTMLDivElement>;
34
+ };
35
+ /**
36
+ * FieldContent wraps the control, description, and error message in a vertical layout.
37
+ * This is positioned to the right of the label in the inline layout.
38
+ */
39
+ export declare const FieldContent: ({ className, children, ref, ...props }: FieldContentProps) => import("react/jsx-runtime").JSX.Element;
40
+ export type FieldMessageProps = HTMLAttributes<HTMLParagraphElement> & {
41
+ children?: ReactNode;
42
+ error?: boolean;
43
+ ref?: React.Ref<HTMLParagraphElement>;
44
+ };
45
+ /**
46
+ * FieldMessage renders helper text or error messages below the input control.
47
+ * When error is true, it displays in red with appropriate ARIA attributes.
48
+ * When error is false (default), it displays as secondary text for descriptions.
49
+ */
50
+ export declare const FieldMessage: ({ className, children, error, ref, ...props }: FieldMessageProps) => import("react/jsx-runtime").JSX.Element | null;
51
+ export type FieldSetProps = HTMLAttributes<HTMLFieldSetElement> & {
52
+ children: ReactNode;
53
+ disabled?: boolean;
54
+ ref?: React.Ref<HTMLFieldSetElement>;
55
+ };
56
+ /**
57
+ * FieldSet is a semantic container for grouping related fields.
58
+ */
59
+ export declare const FieldSet: ({ className, children, disabled, ref, ...props }: FieldSetProps) => import("react/jsx-runtime").JSX.Element;
60
+ export type FieldLegendProps = HTMLAttributes<HTMLLegendElement> & {
61
+ children: ReactNode;
62
+ ref?: React.Ref<HTMLLegendElement>;
63
+ };
64
+ /**
65
+ * FieldLegend renders a title/legend for a group of related fields.
66
+ */
67
+ export declare const FieldLegend: ({ className, children, ref, ...props }: FieldLegendProps) => import("react/jsx-runtime").JSX.Element;
68
+ export type FieldGroupProps = HTMLAttributes<HTMLDivElement> & {
69
+ children: ReactNode;
70
+ ref?: React.Ref<HTMLDivElement>;
71
+ };
72
+ /**
73
+ * FieldGroup provides vertical spacing between multiple Field components.
74
+ */
75
+ export declare const FieldGroup: ({ className, children, ref, ...props }: FieldGroupProps) => import("react/jsx-runtime").JSX.Element;
76
+ export type FieldSeparatorProps = HTMLAttributes<HTMLHRElement> & {
77
+ ref?: React.Ref<HTMLHRElement>;
78
+ };
79
+ /**
80
+ * FieldSeparator renders a visual divider between field sections.
81
+ */
82
+ export declare const FieldSeparator: ({ className, ref, ...props }: FieldSeparatorProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ export { Field } from './Field';
2
+ export type { FieldProps } from './Field';
3
+ export { FieldLabel } from './Field';
4
+ export type { FieldLabelProps } from './Field';
5
+ export { FieldContent } from './Field';
6
+ export type { FieldContentProps } from './Field';
7
+ export { FieldMessage } from './Field';
8
+ export type { FieldMessageProps } from './Field';
9
+ export { FieldSet } from './Field';
10
+ export type { FieldSetProps } from './Field';
11
+ export { FieldLegend } from './Field';
12
+ export type { FieldLegendProps } from './Field';
13
+ export { FieldGroup } from './Field';
14
+ export type { FieldGroupProps } from './Field';
15
+ export { FieldSeparator } from './Field';
16
+ export type { FieldSeparatorProps } from './Field';
@@ -0,0 +1,3 @@
1
+ import { Node, NodeProps } from '@xyflow/react';
2
+ import { FlowData } from './types';
3
+ export declare const FlowTile: ({ data, selected }: NodeProps<Node<FlowData>>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ type MetadataListProps = {
3
+ metadata: Record<string, ReactNode>;
4
+ };
5
+ export declare function MetadataList({ metadata }: MetadataListProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,5 @@
1
+ import { FlowStatus } from './types';
2
+ export type StatusIconProps = {
3
+ status: FlowStatus | undefined;
4
+ };
5
+ export declare const StatusIcon: ({ status }: StatusIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ import { FlowStatus } from './types';
3
+ export type TileHeaderProps = {
4
+ title: string;
5
+ headerAction: ReactNode | undefined;
6
+ status: FlowStatus | undefined;
7
+ };
8
+ export declare const TileHeader: ({ title, status, headerAction, }: TileHeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './FlowTile';
2
+ export * from './types';
@@ -0,0 +1,15 @@
1
+ import { Position } from '@xyflow/system';
2
+ import { ReactNode } from 'react';
3
+ import { IconName } from '../../icons';
4
+ export type FlowStatus = "success" | "warning" | "error" | "pending" | "not-run";
5
+ export type FlowPosition = Position | "none";
6
+ export type FlowData = {
7
+ title: string;
8
+ status?: FlowStatus;
9
+ iconName?: IconName;
10
+ metadata?: Record<string, ReactNode>;
11
+ children?: ReactNode;
12
+ headerAction?: ReactNode;
13
+ targetPosition?: FlowPosition;
14
+ sourcePosition?: FlowPosition;
15
+ };
@@ -0,0 +1,15 @@
1
+ import { ComponentType, SVGProps } from 'react';
2
+ import { BaseButtonProps } from '../baseButton';
3
+ export type IconButtonProps = Omit<BaseButtonProps, "children"> & {
4
+ size?: "small" | "medium" | "large";
5
+ icon: ComponentType<SVGProps<SVGSVGElement>>;
6
+ "aria-label"?: string;
7
+ };
8
+ /**
9
+ * A circular icon-only button component for actions requiring minimal visual footprint.
10
+ * Requires an icon and aria-label for accessibility compliance.
11
+ *
12
+ * @param props - The props for the IconButton component.
13
+ * @returns The rendered circular icon button.
14
+ */
15
+ export declare const IconButton: ({ size, icon: Icon, className, ...props }: IconButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './IconButton';
@@ -0,0 +1,7 @@
1
+ import { JsonEditorProps as JsonEditorReactProps } from 'json-edit-react';
2
+ export type JsonEditorProps<T extends Record<string, unknown> | null> = JsonEditorReactProps & {
3
+ data: T;
4
+ loadingMessage?: string;
5
+ onUpdate: (newData: unknown) => void;
6
+ };
7
+ export declare function JsonEditor<T extends Record<string, unknown> | null>({ data, onUpdate, collapse, loadingMessage, ...rest }: JsonEditorProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { JsonEditor } from './JsonEditor';
@@ -0,0 +1,28 @@
1
+ import { BaseOption } from '../../types/BaseOption';
2
+ export type ListType = "single" | "multi";
3
+ export type ListProps = {
4
+ options: BaseOption[];
5
+ type: ListType;
6
+ disabled?: boolean;
7
+ error?: boolean;
8
+ listClassName?: string;
9
+ highlightedIndex?: number;
10
+ itemsClassName?: string;
11
+ label?: string;
12
+ } & ({
13
+ type: "single";
14
+ selected: string | number | null;
15
+ onChange: (selected: string | number | null) => void;
16
+ } | {
17
+ type: "multi";
18
+ selected: Array<string | number>;
19
+ onChange: (selected: Array<string | number>) => void;
20
+ });
21
+ /**
22
+ * A flexible list component supporting both single and multi-selection modes.
23
+ * Handles selection state changes with proper keyboard navigation and accessibility.
24
+ *
25
+ * @param props - The props for the List component.
26
+ * @returns The rendered list with selectable items.
27
+ */
28
+ export declare const List: ({ options, type, error, disabled, selected, onChange, listClassName, itemsClassName, highlightedIndex, }: ListProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { HTMLProps } from 'react';
2
+ import { BaseOption } from '../../types/BaseOption';
3
+ export type ListItemProps = HTMLProps<HTMLLIElement> & {
4
+ option: BaseOption;
5
+ type: "multi" | "single";
6
+ highlighted?: boolean;
7
+ selected?: boolean;
8
+ error?: boolean;
9
+ disabled?: boolean;
10
+ itemsClassName?: string;
11
+ };
12
+ export declare const EMPTY_OPTION_ID = "EMPTY";
13
+ /**
14
+ * A list item component that renders individual options within a List.
15
+ * Supports checkbox display for multi-select mode and various visual states.
16
+ *
17
+ * @param props - The props for the ListItem component.
18
+ * @returns The rendered list item element.
19
+ */
20
+ export declare const ListItem: ({ option, highlighted, selected, type, error, disabled, itemsClassName, ...rest }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { List, type ListProps, type ListType } from './List';
2
+ export { EMPTY_OPTION_ID, ListItem, type ListItemProps } from './ListItem';
@@ -0,0 +1,5 @@
1
+ import { IconProps } from '../../types/IconComponent';
2
+ export type LogoProps = IconProps & {
3
+ appName?: string;
4
+ };
5
+ export declare const Logo: ({ appName, ...rest }: LogoProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Logo } from './Logo';
2
+ export type { LogoProps } from './Logo';
@@ -0,0 +1,51 @@
1
+ import { JSX, ReactElement, ReactNode } from 'react';
2
+ /**
3
+ * Represents a single route in the menu.
4
+ */
5
+ export type MenuRoute = {
6
+ /** Unique path of the route, used as key and for navigation */
7
+ path: string;
8
+ /** Display title of the menu item */
9
+ title: string;
10
+ /** Optional icon element to render next to the title */
11
+ icon?: ReactNode;
12
+ /** Nested children entries for submenus */
13
+ children?: MenuRoute[];
14
+ /** Permissions required to display this route */
15
+ permissions?: string[];
16
+ /** Whether this route should be hidden from the menu */
17
+ hideMenu?: boolean;
18
+ };
19
+ /**
20
+ * Props for the `Menu` component.
21
+ */
22
+ export type MenuProps = {
23
+ /** React element to display as the menu logo (e.g. an SVG component or img element) */
24
+ logo: ReactElement;
25
+ /** Text to display in the footer */
26
+ footerText: string;
27
+ /** Array of routes to display in the menu */
28
+ routes: MenuRoute[];
29
+ /** Current user permissions used to filter routes */
30
+ permissions?: string[];
31
+ /** Optional additional class names for styling */
32
+ className?: string;
33
+ };
34
+ /**
35
+ * `Menu` is a vertical navigation component that displays a header with a logo,
36
+ * a list of navigable entries (filtered by permissions), and a footer.
37
+ *
38
+ * @example
39
+ * ```tsx
40
+ * <Menu
41
+ * logo={<MyLogo />}
42
+ * footerText="© 2025 My Company"
43
+ * routes={[
44
+ * { path: "/dashboard", title: "Dashboard", icon: <DashboardIcon /> },
45
+ * { path: "/settings", title: "Settings", icon: <SettingsIcon />, permissions: ["admin"] }
46
+ * ]}
47
+ * permissions={["admin"]}
48
+ * />
49
+ * ```
50
+ */
51
+ export declare const Menu: ({ logo, footerText, routes, permissions, className, }: MenuProps) => JSX.Element;
@@ -0,0 +1,73 @@
1
+ import { JSX, ReactNode } from 'react';
2
+ /**
3
+ * Represents a child route/entry in the menu hierarchy.
4
+ */
5
+ export type MenuChild = {
6
+ /** Unique path of the child entry (if navigable) */
7
+ path?: string;
8
+ /** Display title of the menu item */
9
+ title: string;
10
+ /** Optional icon for the menu item */
11
+ icon?: ReactNode;
12
+ /** Nested children for submenus */
13
+ children?: MenuChild[];
14
+ /** Required permissions for the entry */
15
+ permissions?: string[];
16
+ /** Whether this entry should be hidden from the menu */
17
+ hideMenu?: boolean;
18
+ };
19
+ /**
20
+ * Props for the `MenuEntry` component.
21
+ */
22
+ export type MenuEntryProps = {
23
+ /** Icon to display before the title */
24
+ icon?: ReactNode;
25
+ /** Title text of the menu item */
26
+ title: string;
27
+ /** Path used for navigation when clicked (ignored if it has children) */
28
+ path?: string;
29
+ /** Nested children menu entries */
30
+ childrenEntries?: MenuChild[];
31
+ /** Current user permissions for filtering children */
32
+ permissions?: string[];
33
+ /** The currently active path to highlight the entry */
34
+ activePath?: string;
35
+ /** Navigation handler function, typically from `useNavigate` */
36
+ onNavigate?: (path: string) => void;
37
+ /** className applied to root div element */
38
+ className?: string;
39
+ /** Depth level for recursive padding (internal prop, defaults to 0) */
40
+ depth?: number;
41
+ };
42
+ /**
43
+ * `MenuEntry` renders a single menu item.
44
+ *
45
+ * - If the entry has children, it can expand/collapse to reveal them.
46
+ * - If it has a `path`, clicking navigates to that path via `onNavigate`.
47
+ * - Entries are filtered by `permissions` and `hideMenu` before rendering.
48
+ *
49
+ * @example
50
+ * ```tsx
51
+ * <MenuEntry
52
+ * title="Settings"
53
+ * path="/settings"
54
+ * icon={<SettingsIcon />}
55
+ * activePath="/settings/profile"
56
+ * onNavigate={(path) => console.log("Navigate to:", path)}
57
+ * />
58
+ *
59
+ * <MenuEntry
60
+ * title="Admin"
61
+ * icon={<AdminIcon />}
62
+ * childrenEntries={[
63
+ * { title: "Users", path: "/admin/users" },
64
+ * { title: "Roles", path: "/admin/roles" }
65
+ * ]}
66
+ * permissions={["admin"]}
67
+ * activePath="/admin/users"
68
+ * onNavigate={navigate}
69
+ * />
70
+ * ```
71
+ */
72
+ declare const MenuEntry: ({ icon, title, path, childrenEntries, permissions, className, activePath, onNavigate, depth, }: MenuEntryProps) => JSX.Element;
73
+ export default MenuEntry;
@@ -0,0 +1,23 @@
1
+ import { JSX } from 'react';
2
+ /**
3
+ * Props for the `MenuFooter` component.
4
+ */
5
+ export type MenuFooterProps = {
6
+ /**
7
+ * Text to display in the footer.
8
+ * Typically used for copyright, branding, or version info.
9
+ */
10
+ text: string;
11
+ };
12
+ /**
13
+ * `MenuFooter` renders a simple text footer for the menu.
14
+ * It is always pinned to the bottom of the navigation container.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * <MenuFooter text="© 2025 My Company" />
19
+ * <MenuFooter text="v2.1.0" />
20
+ * ```
21
+ */
22
+ declare const MenuFooter: ({ text }: MenuFooterProps) => JSX.Element;
23
+ export default MenuFooter;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Barrel exports for the Menu system.
3
+ * Allows importing the main menu component.
4
+ *
5
+ * @example
6
+ * ```tsx
7
+ * import { Menu } from "@/components/Menu";
8
+ * ```
9
+ */
10
+ export { Menu } from './Menu';
11
+ export type { MenuProps, MenuRoute } from './Menu';
@@ -0,0 +1,28 @@
1
+ import { ReactElement } from 'react';
2
+ import { BaseOption } from '../../types/BaseOption';
3
+ export type MultiSelectProps<Option extends BaseOption> = {
4
+ value: Option[];
5
+ setValue: (value: Option[] | ((prevState: Option[]) => Option[])) => void;
6
+ prefixContent?: ReactElement;
7
+ suffixContent?: ReactElement;
8
+ options: Option[];
9
+ id?: string;
10
+ error?: boolean;
11
+ disabled?: boolean;
12
+ emptyPlaceholder?: string;
13
+ addMorePlaceholder?: string;
14
+ toggleAriaLabel?: string;
15
+ noOptionsText?: string;
16
+ ref?: React.Ref<HTMLInputElement>;
17
+ maxHeight?: number;
18
+ listClassName?: string;
19
+ };
20
+ /**
21
+ * A multi-selection dropdown component with tag-based display of selected items.
22
+ * Supports search filtering, tag removal, and keyboard navigation.
23
+ *
24
+ * @template Option - The option type extending BaseOption.
25
+ * @param props - The props for the MultiSelect component.
26
+ * @returns The rendered multi-select dropdown with tag list.
27
+ */
28
+ export declare const MultiSelect: <Option extends BaseOption>({ value, setValue, options, id, error, prefixContent, suffixContent, disabled, emptyPlaceholder, addMorePlaceholder, toggleAriaLabel, noOptionsText, ref, maxHeight, listClassName, }: MultiSelectProps<Option>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { MultiSelect } from './MultiSelect';
2
+ export type { MultiSelectProps } from './MultiSelect';
@@ -0,0 +1,60 @@
1
+ import { ReactNode, RefObject } from 'react';
2
+ export type PopoverPlacement = "top" | "bottom" | "left" | "right" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end";
3
+ export type PopoverProps = {
4
+ /** The element that triggers the popover */
5
+ children: ReactNode;
6
+ /** The content to display inside the popover */
7
+ content: ReactNode;
8
+ /** Whether the popover is open */
9
+ isOpen: boolean;
10
+ /** Callback function called when the popover should be closed */
11
+ onClose?: () => void;
12
+ /** Whether clicking outside should close the popover */
13
+ closeOnClickOutside?: boolean;
14
+ /** Whether pressing Escape should close the popover */
15
+ closeOnEscape?: boolean;
16
+ /** Preferred placement of the popover relative to the trigger */
17
+ placement?: PopoverPlacement;
18
+ /** Whether to show an arrow pointing to the trigger element */
19
+ showArrow?: boolean;
20
+ /** Additional CSS classes for the trigger wrapper */
21
+ triggerClassName?: string;
22
+ /** Additional CSS classes for the popover content */
23
+ className?: string;
24
+ /** Additional CSS classes for the arrow */
25
+ arrowClassName?: string;
26
+ /** Offset distance from the trigger element in pixels */
27
+ offset?: number;
28
+ /** Whether the popover should render via a React portal */
29
+ renderInPortal?: boolean;
30
+ /** Optional id applied to the popover panel */
31
+ id?: string;
32
+ /** ARIA role describing the type of popover */
33
+ role?: "dialog" | "menu" | "listbox" | "tooltip";
34
+ /** Accessible label for the popover panel */
35
+ ariaLabel?: string;
36
+ /** Id of the element labelling the popover panel */
37
+ ariaLabelledBy?: string;
38
+ /** Id of the element describing the popover panel */
39
+ ariaDescribedBy?: string;
40
+ /** Element to focus when the popover opens */
41
+ initialFocusRef?: RefObject<HTMLElement>;
42
+ /** Whether focus should return to the previously focused element on close */
43
+ returnFocusOnClose?: boolean;
44
+ };
45
+ /**
46
+ * A popover component that displays floating content relative to a trigger element.
47
+ * Uses Card-like styling and supports multiple placement options.
48
+ *
49
+ * Features:
50
+ * - Multiple placement options (top, bottom, left, right with start/end variants)
51
+ * - Optional arrow pointing to the trigger element
52
+ * - Click outside to close (optional)
53
+ * - Escape key to close (optional)
54
+ * - Automatic positioning with offset control
55
+ * - Card-like styling for consistency
56
+ *
57
+ * @param props - The props for the Popover component
58
+ * @returns A popover with trigger and floating content
59
+ */
60
+ export declare const Popover: ({ children, content, isOpen, onClose, closeOnClickOutside, closeOnEscape, placement, showArrow, triggerClassName, className, arrowClassName, offset, renderInPortal, id, role, ariaLabel, ariaLabelledBy, ariaDescribedBy, initialFocusRef, returnFocusOnClose, }: PopoverProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Popover } from './Popover';
2
+ export type { PopoverProps, PopoverPlacement } from './Popover';
@@ -0,0 +1,29 @@
1
+ import { ReactNode } from 'react';
2
+ export type RadioButtonProps = {
3
+ /** The value of the radio button */
4
+ value: string;
5
+ /** The visible label text for the radio */
6
+ label: string;
7
+ /** Whether the radio button is currently selected */
8
+ checked?: boolean;
9
+ /** Whether the radio is in an error state */
10
+ error?: boolean;
11
+ /** Callback fired when selection changes */
12
+ onChange?: (value: string) => void;
13
+ /** Whether the radio button is disabled */
14
+ disabled?: boolean;
15
+ /** Optional id (auto-generated if not provided) */
16
+ id?: string;
17
+ /** Name of the radio group */
18
+ name?: string;
19
+ /** Additional class names for the container */
20
+ className?: string;
21
+ /** Optional extra label content (e.g. tooltip, icon) */
22
+ children?: ReactNode;
23
+ /** Ref for the input element (React 19 style) */
24
+ ref?: React.Ref<HTMLInputElement>;
25
+ };
26
+ /**
27
+ * A custom radio button component with native input styling.
28
+ */
29
+ export declare const RadioButton: ({ value, label, error, checked, disabled, onChange, className, children, id, name, ref, }: RadioButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { RadioButton } from './RadioButton';
2
+ export type { RadioButtonProps } from './RadioButton';
@@ -0,0 +1,30 @@
1
+ import { ReactElement } from 'react';
2
+ import { BaseOption } from '../../types/BaseOption';
3
+ export type SelectProps<Option extends BaseOption> = {
4
+ value: Option | null;
5
+ setValue: (value: Option | null) => void;
6
+ prefixContent?: ReactElement;
7
+ suffixContent?: ReactElement;
8
+ options: Option[];
9
+ id?: string;
10
+ error?: boolean;
11
+ disabled?: boolean;
12
+ placeholder?: string;
13
+ toggleAriaLabel?: string;
14
+ noOptionsText?: string;
15
+ ref?: React.Ref<HTMLInputElement>;
16
+ disableSearch?: boolean;
17
+ className?: string;
18
+ containerClassName?: string;
19
+ listClassName?: string;
20
+ maxHeight?: number;
21
+ };
22
+ /**
23
+ * A dropdown select component with search functionality and keyboard navigation.
24
+ * Built with Downshift for accessibility and supports custom option filtering.
25
+ *
26
+ * @template Option - The option type extending BaseOption.
27
+ * @param props - The props for the Select component.
28
+ * @returns The rendered select dropdown component.
29
+ */
30
+ export declare const Select: <Option extends BaseOption>({ value, setValue, options, id, prefixContent, suffixContent, error, disabled, placeholder, toggleAriaLabel, noOptionsText, ref, disableSearch, className, containerClassName, listClassName, maxHeight, }: SelectProps<Option>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { Select, type SelectProps } from './Select';
@@ -0,0 +1,22 @@
1
+ import { ReactNode } from 'react';
2
+ export type TabProps = {
3
+ /** Tab label text */
4
+ label: string;
5
+ /** Unique name/key for the tab */
6
+ name: string;
7
+ /** Tab content to display when active */
8
+ children: ReactNode;
9
+ /** Whether the tab is active/selected */
10
+ isActive?: boolean;
11
+ /** Click handler for tab selection */
12
+ onClick?: () => void;
13
+ /** Additional CSS classes */
14
+ className?: string;
15
+ /** Icon to display before the text */
16
+ icon?: ReactNode;
17
+ };
18
+ /**
19
+ * A single tab component that can be used within a TabPanel.
20
+ * Contains both the tab button and the content to display when active.
21
+ */
22
+ export declare const Tab: import('react').ForwardRefExoticComponent<TabProps & import('react').RefAttributes<HTMLButtonElement>>;