@llmnative/react 1.0.0 → 1.2.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 (74) hide show
  1. package/README.md +11 -1
  2. package/dist/index.css +3 -1
  3. package/dist/index.js +20 -23
  4. package/dist/index.mjs +18045 -16868
  5. package/dist/types/src/App.d.ts +4 -1
  6. package/dist/types/src/I18n.d.ts +4 -0
  7. package/dist/types/src/components/ErrorBoundary.d.ts +1 -1
  8. package/dist/types/src/components/blocks/Brand.d.ts +5 -0
  9. package/dist/types/src/components/blocks/Carousel.d.ts +2 -0
  10. package/dist/types/src/components/blocks/Dropdown.d.ts +39 -2
  11. package/dist/types/src/components/blocks/ListCard.d.ts +7 -0
  12. package/dist/types/src/components/blocks/Menu.d.ts +2 -0
  13. package/dist/types/src/components/blocks/Notifications.d.ts +4 -1
  14. package/dist/types/src/components/blocks/ProviderSwitcher.d.ts +3 -1
  15. package/dist/types/src/components/blocks/Search.d.ts +1 -0
  16. package/dist/types/src/components/blocks/ThemeSwitcher.d.ts +6 -2
  17. package/dist/types/src/components/blocks/Toolbar.d.ts +4 -0
  18. package/dist/types/src/components/index.d.ts +2 -2
  19. package/dist/types/src/components/ui/Alert.d.ts +5 -1
  20. package/dist/types/src/components/ui/Badge.d.ts +6 -0
  21. package/dist/types/src/components/ui/Buttons.d.ts +5 -2
  22. package/dist/types/src/components/ui/Card.d.ts +3 -0
  23. package/dist/types/src/components/ui/Code.d.ts +4 -0
  24. package/dist/types/src/components/ui/Gallery.d.ts +9 -2
  25. package/dist/types/src/components/ui/GridSystem.d.ts +4 -1
  26. package/dist/types/src/components/ui/Icon.d.ts +3 -0
  27. package/dist/types/src/components/ui/Image.d.ts +6 -0
  28. package/dist/types/src/components/ui/ImageAvatar.d.ts +3 -0
  29. package/dist/types/src/components/ui/Loader.d.ts +3 -1
  30. package/dist/types/src/components/ui/Modal.d.ts +22 -0
  31. package/dist/types/src/components/ui/Pagination.d.ts +2 -0
  32. package/dist/types/src/components/ui/Percentage.d.ts +9 -0
  33. package/dist/types/src/components/ui/Repeat.d.ts +0 -1
  34. package/dist/types/src/components/ui/Tab.d.ts +1 -1
  35. package/dist/types/src/components/ui/Table.d.ts +3 -0
  36. package/dist/types/src/components/ui/fields/CodeEditor.d.ts +9 -1
  37. package/dist/types/src/components/ui/fields/ContextMenu.d.ts +74 -1
  38. package/dist/types/src/components/ui/fields/RichText.d.ts +4 -1
  39. package/dist/types/src/components/ui/fields/Select.d.ts +2 -2
  40. package/dist/types/src/components/ui/fields/Upload.d.ts +17 -4
  41. package/dist/types/src/components/widgets/Form.d.ts +14 -3
  42. package/dist/types/src/components/widgets/Prompt.d.ts +35 -15
  43. package/dist/types/src/components/widgets/grid-core/GridCore.d.ts +1 -1
  44. package/dist/types/src/components/widgets/grid-core/GridGalleryView.d.ts +1 -1
  45. package/dist/types/src/components/widgets/grid-core/types.d.ts +79 -3
  46. package/dist/types/src/components/widgets/grid-core/useGridActions.d.ts +1 -1
  47. package/dist/types/src/index.d.ts +15 -5
  48. package/dist/types/src/libs/editorHeight.d.ts +11 -1
  49. package/dist/types/src/libs/fetch.d.ts +2 -0
  50. package/dist/types/src/providers/ProviderDescriptor.d.ts +18 -0
  51. package/dist/types/src/providers/ai/AIProvider.d.ts +54 -1
  52. package/dist/types/src/providers/ai/index.d.ts +13 -2
  53. package/dist/types/src/providers/ai/openaiCompatible.d.ts +25 -1
  54. package/dist/types/src/providers/ai/shared.d.ts +13 -4
  55. package/dist/types/src/providers/auth/AuthProvider.d.ts +8 -0
  56. package/dist/types/src/providers/auth/firebase/FirebaseAuthProvider.d.ts +23 -0
  57. package/dist/types/src/providers/auth/google/auth.d.ts +1 -1
  58. package/dist/types/src/providers/data/DataProvider.d.ts +8 -0
  59. package/dist/types/src/providers/data/firestore.d.ts +19 -1
  60. package/dist/types/src/providers/email/definitions.d.ts +3 -0
  61. package/dist/types/src/providers/firebase-init.d.ts +11 -5
  62. package/dist/types/src/providers/publish/PublishProvider.d.ts +29 -0
  63. package/dist/types/src/providers/publish/definitions.d.ts +3 -0
  64. package/dist/types/src/providers/storage/firebase.d.ts +7 -1
  65. package/dist/vite.js +1 -1
  66. package/dist/vite.mjs +62 -53
  67. package/package.json +58 -54
  68. package/scripts/cli/setup-devtools.js +8 -7
  69. package/scripts/cli/setup-project.js +23 -19
  70. package/themes/cyber.ts +8 -7
  71. package/themes/default.ts +22 -7
  72. package/themes/flat.ts +8 -7
  73. package/dist/style.css +0 -1
  74. package/dist/types/src/providers/email/google/apis/email.d.ts +0 -7
@@ -90,6 +90,9 @@ export type AppProviderProps = {
90
90
  errorReportUrl?: string;
91
91
  /** Force debug mode in error boundaries (shows stack trace, component tree, browser context). Auto-enabled in DEV builds. */
92
92
  debug?: boolean;
93
+ /** Basename for BrowserRouter (e.g. '/llmnative-react/' for GH Pages). If set, only the
94
+ * pathname after this prefix is used for route matching. */
95
+ basename?: string;
93
96
  };
94
97
  /** Full App props: AppProviderProps + routing-specific config. */
95
98
  export type AppProps = AppProviderProps & {
@@ -116,7 +119,7 @@ export declare const getContextMenu: () => string[];
116
119
  * `App` uses `AppProvider` internally. Use `AppProvider` directly only when
117
120
  * you need the provider stack without the routing layer (e.g. tests, Storybook).
118
121
  */
119
- export declare function AppProvider({ contextProviders, providers, appName, scrapeConfig, iconProvider, themeProvider, i18n, children, errorReportUrl, debug, }: AppProviderProps): React.JSX.Element;
122
+ export declare function AppProvider({ contextProviders, providers, appName, scrapeConfig, iconProvider, themeProvider, i18n, children, errorReportUrl, debug, basename, }: AppProviderProps): React.JSX.Element;
120
123
  declare function App({ importPage, LayoutDefault, menuConfig, children, ...providerProps }: AppProps): React.JSX.Element;
121
124
  export declare const useMenu: (type: string) => UseMenuItem[];
122
125
  export default App;
@@ -50,12 +50,16 @@ export interface I18nDict {
50
50
  };
51
51
  select: {
52
52
  placeholder: string;
53
+ loading: string;
53
54
  };
54
55
  modal: {
55
56
  save: string;
56
57
  delete: string;
57
58
  cancel: string;
58
59
  close: string;
60
+ ok: string;
61
+ yes: string;
62
+ no: string;
59
63
  };
60
64
  upload: {
61
65
  clickOrDrag: string;
@@ -25,6 +25,6 @@ declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, State> {
25
25
  reset: () => void;
26
26
  copy: () => void;
27
27
  sendReport: () => void;
28
- render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
28
+ render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
29
29
  }
30
30
  export default ErrorBoundary;
@@ -1,9 +1,14 @@
1
1
  import React from 'react';
2
2
  type BrandProps = {
3
+ /** Link target URL for the brand. */
3
4
  url?: string;
5
+ /** Brand text label. */
4
6
  label?: string;
7
+ /** Logo image URL. */
5
8
  logo?: string;
9
+ /** Logo image width. */
6
10
  width?: number;
11
+ /** Logo image height. Defaults to `36`. */
7
12
  height?: number;
8
13
  wrapperClassName?: string;
9
14
  className?: string;
@@ -9,8 +9,10 @@ type CarouselProps = {
9
9
  showIndicators?: boolean;
10
10
  showControls?: boolean;
11
11
  showCaption?: boolean;
12
+ /** Use dark variant indicators/controls. */
12
13
  dark?: boolean;
13
14
  autoPlay?: AutoPlayOptions;
15
+ /** 0-based index of the initially visible slide. */
14
16
  initialSlide?: number;
15
17
  renderCaption?: (image: React.ReactElement) => React.ReactElement;
16
18
  onSlideClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
@@ -1,23 +1,32 @@
1
1
  import React from 'react';
2
2
  import { BadgeProps, BadgeType } from "../ui/Badge";
3
3
  import type { MotionUIProps } from '../types';
4
+ /** Shorthand config for the dropdown trigger when it renders as a button + icon. */
4
5
  interface DropdownTogglerProps {
5
6
  icon?: string;
6
7
  text?: string;
7
8
  title?: string;
8
9
  }
9
- interface DropdownProps extends MotionUIProps {
10
+ export interface DropdownProps extends MotionUIProps {
10
11
  children: React.ReactNode;
12
+ /** Dropdown trigger: string (label), React element, or `DropdownTogglerProps` object. */
11
13
  trigger?: string | React.ReactNode | DropdownTogglerProps;
12
14
  badge?: BadgeProps;
15
+ /** Fixed header rendered inside the dropdown menu. */
13
16
  header?: React.ReactNode;
14
17
  footer?: React.ReactNode;
18
+ /** Uncontrolled open state default. */
15
19
  defaultOpen?: boolean;
20
+ /** Controlled open state. */
16
21
  open?: boolean;
17
22
  onOpenChange?: (open: boolean) => void;
23
+ /** When `true`, the menu stays open regardless of interaction. */
18
24
  staticOpen?: boolean;
25
+ /** Horizontal alignment relative to the trigger. */
19
26
  position?: "start" | "end";
27
+ /** Drop direction. */
20
28
  placement?: "auto" | "top" | "bottom";
29
+ /** CSS positioning strategy. */
21
30
  strategy?: "fixed" | "absolute";
22
31
  triggerClassName?: string;
23
32
  badgeClassName?: string;
@@ -25,9 +34,30 @@ interface DropdownProps extends MotionUIProps {
25
34
  headerClassName?: string;
26
35
  footerClassName?: string;
27
36
  }
37
+ export type AsyncDropdownLoader<TItem> = (query: string, signal: AbortSignal) => Promise<TItem[]>;
38
+ export interface AsyncDropdownProps<TItem> extends Omit<DropdownProps, 'children' | 'header' | 'onOpenChange'> {
39
+ /** Loads results when the menu opens and whenever the query changes. */
40
+ loadItems: AsyncDropdownLoader<TItem>;
41
+ getItemId: (item: TItem) => string;
42
+ renderItem: (item: TItem) => React.ReactNode;
43
+ /** Return `false` to keep the menu open (for example after a declined confirmation). */
44
+ onSelect: (item: TItem) => void | boolean | Promise<void | boolean>;
45
+ selectedId?: string | null;
46
+ searchPlaceholder?: string;
47
+ emptyState?: React.ReactNode;
48
+ loadingState?: React.ReactNode;
49
+ errorState?: (error: unknown) => React.ReactNode;
50
+ debounceMs?: number;
51
+ closeOnSelect?: boolean;
52
+ inputClassName?: string;
53
+ selectedClassName?: string;
54
+ header?: React.ReactNode;
55
+ onOpenChange?: (open: boolean) => void;
56
+ }
28
57
  interface DropdownButtonProps extends Pick<MotionUIProps, 'motion'> {
29
58
  children: React.ReactNode;
30
59
  badge?: BadgeProps;
60
+ /** `"static"` — always visible; `"dynamic"` — shows/hides with the menu. */
31
61
  display?: "static" | "dynamic";
32
62
  className?: string;
33
63
  badgeClassName?: string;
@@ -35,13 +65,15 @@ interface DropdownButtonProps extends Pick<MotionUIProps, 'motion'> {
35
65
  onToggle?: () => void;
36
66
  open?: boolean;
37
67
  menuId?: string;
38
- buttonRef?: React.RefObject<HTMLButtonElement>;
68
+ buttonRef?: React.RefObject<HTMLButtonElement | null>;
39
69
  }
40
70
  interface DropdownItemProps {
71
+ /** Link URL. When set, renders as `<a>`, otherwise as `<button>`. */
41
72
  url?: string;
42
73
  onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
43
74
  className?: string;
44
75
  children: React.ReactNode;
76
+ /** Leading icon name. */
45
77
  icon?: string;
46
78
  }
47
79
  interface DropdownHeaderProps {
@@ -52,6 +84,11 @@ interface DropdownDividerProps {
52
84
  className?: string;
53
85
  }
54
86
  export declare const Dropdown: ({ children, trigger, badge, header, footer, defaultOpen, open: controlledOpen, onOpenChange, staticOpen, position, placement, strategy, wrapperClassName, className, before, after, triggerClassName, menuClassName, badgeClassName, headerClassName, footerClassName, motion: motionConfig, }: DropdownProps) => React.JSX.Element;
87
+ /**
88
+ * Async/searchable extension of Dropdown. It owns only the interaction model; applications
89
+ * supply their own data reader and selection action (site, tenant, entity, or any resource).
90
+ */
91
+ export declare function AsyncDropdown<TItem>({ loadItems, getItemId, renderItem, onSelect, selectedId, searchPlaceholder, emptyState, loadingState, errorState, debounceMs, closeOnSelect, inputClassName, selectedClassName, header, open: controlledOpen, defaultOpen, onOpenChange, footer, headerClassName, staticOpen, ...dropdownProps }: AsyncDropdownProps<TItem>): React.JSX.Element;
55
92
  export declare const DropdownButton: ({ children, badge, display, className, badgeClassName, motion: motionConfig, title, onToggle, open, menuId, buttonRef }: DropdownButtonProps) => React.JSX.Element;
56
93
  export declare const DropdownItem: ({ children, url, onClick, icon, className }: DropdownItemProps) => React.JSX.Element;
57
94
  export declare const DropdownHeader: ({ children, className }: DropdownHeaderProps) => React.JSX.Element;
@@ -3,17 +3,24 @@ import type { MotionUIProps } from '../types';
3
3
  export interface ListCardProps extends MotionUIProps {
4
4
  title?: React.ReactNode;
5
5
  description?: React.ReactNode;
6
+ /** Metadata displayed below the description. */
6
7
  meta?: React.ReactNode;
7
8
  badge?: React.ReactNode;
9
+ /** Leading icon or custom element. */
8
10
  icon?: string | React.ReactNode;
11
+ /** Element displayed on the trailing edge. */
9
12
  trailing?: React.ReactNode;
10
13
  footer?: React.ReactNode;
11
14
  children?: React.ReactNode;
15
+ /** Navigate to this URL on click. */
12
16
  href?: string;
17
+ /** Open link in a new tab. */
13
18
  external?: boolean;
14
19
  active?: boolean;
15
20
  disabled?: boolean;
21
+ /** Show a dashed border style. */
16
22
  dashed?: boolean;
23
+ /** Compact layout with less padding. */
17
24
  compact?: boolean;
18
25
  align?: 'start' | 'center';
19
26
  style?: React.CSSProperties;
@@ -2,8 +2,10 @@ import React from 'react';
2
2
  import { BadgeType } from '../ui/Badge';
3
3
  import type { UIProps } from '../types';
4
4
  interface MenuProps extends UIProps {
5
+ /** Registry key used to look up menu items from `useMenu()`. */
5
6
  menuKey: string;
6
7
  as?: 'ul' | 'ol';
8
+ /** Badge overrides keyed by menu item ID. */
7
9
  badges?: Record<string, {
8
10
  type?: BadgeType;
9
11
  children: string;
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import type { BadgeProps } from "../ui/Badge";
3
+ import type { MotionReference } from "../../motion";
3
4
  interface NotificationItem {
4
5
  title: string;
5
6
  url: string;
@@ -14,7 +15,9 @@ interface NotificationsProps {
14
15
  seeAllUrl?: string;
15
16
  /** Callback for "mark all as read" — shown in the header only when there are items */
16
17
  onMarkAllRead?: () => void;
18
+ /** Named motion preset for notification items appearance. */
19
+ motion?: MotionReference;
17
20
  className?: string;
18
21
  }
19
- declare function Notifications({ items, badge, seeAllUrl, onMarkAllRead, className, }: NotificationsProps): React.JSX.Element;
22
+ declare function Notifications({ items, badge, seeAllUrl, onMarkAllRead, motion, className, }: NotificationsProps): React.JSX.Element;
20
23
  export default Notifications;
@@ -11,6 +11,8 @@ export interface ProviderSwitcherItem {
11
11
  }
12
12
  export interface ProviderSwitcherProps extends UIProps {
13
13
  items: ProviderSwitcherItem[];
14
+ /** True while `items` itself is still being fetched — distinct from the switch-in-progress state. Shows a spinner in the trigger and disables opening the list, instead of rendering as if there were genuinely zero items. */
15
+ itemsLoading?: boolean;
14
16
  activeId?: string | null;
15
17
  /** Fires once the switch has actually succeeded — never optimistically on click. */
16
18
  onSelect?: (id: string) => void;
@@ -60,4 +62,4 @@ export interface ProviderSwitcherProps extends UIProps {
60
62
  * The caller only finds out once it's actually done (`onSelect`) or failed (`onError`) —
61
63
  * it never has to wire the request/loading/error plumbing itself.
62
64
  */
63
- export default function ProviderSwitcher({ items, activeId, onSelect, onError, onResponse, endpoint, authorization, requestBody, method, icon, caption, listLabel, placeholder, disabled, open, onOpenChange, footer, before, after, wrapperClassName, className, triggerClassName, listClassName, itemClassName, }: ProviderSwitcherProps): React.JSX.Element;
65
+ export default function ProviderSwitcher({ items, itemsLoading, activeId, onSelect, onError, onResponse, endpoint, authorization, requestBody, method, icon, caption, listLabel, placeholder, disabled, open, onOpenChange, footer, before, after, wrapperClassName, className, triggerClassName, listClassName, itemClassName, }: ProviderSwitcherProps): React.JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  interface SearchProps {
3
+ /** Called on every keystroke with the current search input event. */
3
4
  onQueryChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
4
5
  }
5
6
  export declare const SearchButton: () => React.JSX.Element;
@@ -1,17 +1,21 @@
1
1
  import React from 'react';
2
- import type { UIProps } from '../types';
3
2
  export interface ThemeSwitcherThemeOption {
4
3
  label?: string;
5
4
  description?: string;
6
5
  }
7
- export interface ThemeSwitcherProps extends UIProps {
6
+ export interface ThemeSwitcherProps {
7
+ /** Show the switcher panel. */
8
8
  open?: boolean;
9
+ className?: string;
10
+ wrapperClassName?: string;
9
11
  onClose?: () => void;
12
+ /** Render as a flat panel or inside a Modal. */
10
13
  surface?: 'flat' | 'modal';
11
14
  showHeader?: boolean;
12
15
  title?: React.ReactNode;
13
16
  subtitle?: React.ReactNode;
14
17
  headerActions?: React.ReactNode;
18
+ /** Per-theme label/description overrides. */
15
19
  themeOptions?: Record<string, ThemeSwitcherThemeOption>;
16
20
  showModeSection?: boolean;
17
21
  showPrimarySection?: boolean;
@@ -5,9 +5,13 @@ export interface ToolbarProps {
5
5
  center?: React.ReactNode;
6
6
  trailing?: React.ReactNode;
7
7
  children?: React.ReactNode;
8
+ /** Stick the toolbar to the top of the viewport on scroll. */
8
9
  sticky?: boolean;
10
+ /** Add shadow on scroll when `sticky` is enabled. */
9
11
  elevateOnScroll?: boolean;
12
+ /** Scroll container to observe for sticky threshold. Defaults to `window`. */
10
13
  scrollTarget?: ScrollTarget;
14
+ /** Px threshold before sticky/elevate activates. */
11
15
  scrollThreshold?: number;
12
16
  className?: string;
13
17
  innerClassName?: string;
@@ -54,8 +54,8 @@ export { default as ListCard } from './blocks/ListCard';
54
54
  export type { ListCardProps } from './blocks/ListCard';
55
55
  export { default as SideNav } from './blocks/SideNav';
56
56
  export type { SideNavProps, SideNavItemDef } from './blocks/SideNav';
57
- export { default as Form } from './widgets/Form';
58
- export type { FormProps, FormDeleteArgs, FormDeleteHandler, FormFinallyArgs, FormFinallyHandler, FormSaveArgs, FormSaveHandler } from './widgets/Form';
57
+ export { default as Form, useFormContext } from './widgets/Form';
58
+ export type { FormProps, FormDeleteArgs, FormDeleteHandler, FormFinallyArgs, FormFinallyHandler, FormSaveArgs, FormSaveHandler, ChangeHandler, FieldOnChange } from './widgets/Form';
59
59
  export { FormControllerContext, useFormActions, useFormController } from './widgets/form-controller';
60
60
  export type { FormActionEvent, FormController, FormControllerActions, FormControllerState, FormDraftStatus } from './widgets/form-controller';
61
61
  export { default as Grid } from './widgets/Grid';
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { UIProps } from '../..';
3
3
  export type AlertProps = {
4
4
  children: string | React.ReactNode;
5
+ /** Semantic color variant. */
5
6
  variant?: "info" | "success" | "warning" | "danger" | "primary" | "secondary" | "light" | "dark";
6
7
  /** Visual shell:
7
8
  * - `"default"` - full alert box with background and border (default)
@@ -15,9 +16,12 @@ export type AlertProps = {
15
16
  */
16
17
  placement?: "inline" | "fixed" | "sticky";
17
18
  /** Required when placement="sticky": the scrollable container to anchor to. */
18
- anchorRef?: React.RefObject<HTMLElement>;
19
+ anchorRef?: React.RefObject<HTMLElement | null>;
20
+ /** Auto-dismiss timeout in ms. */
19
21
  timeout?: number;
22
+ /** Called when the alert is dismissed. */
20
23
  onClose?: () => void;
24
+ /** Icon name, or `true` to show the default variant icon, or `false` to hide. */
21
25
  icon?: string | boolean;
22
26
  className?: string;
23
27
  } & UIProps;
@@ -11,17 +11,23 @@ export type BadgeProps = React.ReactNode | BadgeDescriptor;
11
11
  export declare function isBadgeDescriptor(value: BadgeProps | undefined): value is BadgeDescriptor;
12
12
  export declare function normalizeBadgeProps(value: BadgeProps | undefined, fallbackType?: BadgeType, fallbackClassName?: string): BadgeDescriptor | undefined;
13
13
  export type BadgeOverlayProps = {
14
+ /** Shorthand badge descriptor (content + variant). */
14
15
  badge?: BadgeProps;
16
+ /** Badge content when not using the `badge` shorthand. */
15
17
  content?: React.ReactNode;
18
+ /** Badge color variant. */
16
19
  variant?: BadgeType;
20
+ /** Fallback variant when none is specified. */
17
21
  defaultType?: BadgeType;
18
22
  className?: string;
23
+ /** When `true` and no badge is provided, renders children without wrapping. */
19
24
  descriptorOnly?: boolean;
20
25
  children?: React.ReactNode;
21
26
  };
22
27
  export declare const BadgeOverlay: ({ badge, content, variant, defaultType, className, descriptorOnly, children }: BadgeOverlayProps) => React.ReactNode;
23
28
  export type BadgeComponentProps = {
24
29
  children: string | React.ReactNode;
30
+ /** Semantic color variant. */
25
31
  variant?: BadgeType;
26
32
  } & UIProps;
27
33
  declare const Badge: ({ children, variant, before, after, wrapperClassName, className }: BadgeComponentProps) => React.JSX.Element;
@@ -3,13 +3,15 @@ import type { MotionUIProps, UIProps } from '../types';
3
3
  import { BadgeProps } from './Badge';
4
4
  export interface IButton extends MotionUIProps {
5
5
  onClick?: (e: React.MouseEvent<HTMLElement>) => unknown;
6
+ /** Icon name or path for a leading icon. */
6
7
  icon?: string;
7
8
  label?: string | React.ReactNode;
9
+ /** Badge descriptor shown as overlay on the button. */
8
10
  badge?: BadgeProps;
9
11
  title?: string;
12
+ /** Accessible label for screen readers. Required when the button is icon-only. */
10
13
  ariaLabel?: string;
11
14
  disabled?: boolean;
12
- loading?: boolean;
13
15
  iconClassName?: string;
14
16
  style?: React.CSSProperties;
15
17
  variant?: "primary" | "secondary" | "danger" | "success" | "warning" | "info" | "light" | "dark" | "outline-primary" | "outline-secondary" | "outline-danger" | "outline-success" | "link";
@@ -21,6 +23,7 @@ export type SetMessagePayload = {
21
23
  };
22
24
  export interface LoadingButtonProps extends Omit<IButton, "onClick"> {
23
25
  onClick?: (e: React.MouseEvent<HTMLElement>, setMessage?: (payload: SetMessagePayload) => void) => Promise<unknown>;
26
+ loading?: boolean;
24
27
  loadingLabel?: string | React.ReactNode;
25
28
  }
26
29
  export declare const buttonBaseClass = "btn";
@@ -38,7 +41,7 @@ export declare const buttonOutlineDangerClass = "btn-outline-danger";
38
41
  export declare const buttonOutlineSuccessClass = "btn-outline-success";
39
42
  export declare const buttonLinkClass = "btn-link";
40
43
  export declare const LoadingButton: ({ onClick, icon, label, badge, title, ariaLabel, disabled, loading, before, after, wrapperClassName, className, iconClassName, style, loadingLabel, variant, motion: motionConfig }?: LoadingButtonProps) => React.JSX.Element;
41
- export declare const ActionButton: ({ onClick, icon, label, badge, title, disabled, before, after, wrapperClassName, className, iconClassName, style, variant, motion: motionConfig }?: IButton) => React.JSX.Element;
44
+ export declare const ActionButton: ({ onClick, icon, label, badge, title, ariaLabel, disabled, before, after, wrapperClassName, className, iconClassName, style, variant, motion: motionConfig }?: IButton) => React.JSX.Element;
42
45
  interface BackLinkProps extends UIProps {
43
46
  label?: string;
44
47
  }
@@ -2,12 +2,15 @@ import React from 'react';
2
2
  import { UIProps } from '../..';
3
3
  export interface CardProps extends UIProps {
4
4
  children: React.ReactNode;
5
+ /** Card title shown in the header area. */
5
6
  title?: string;
7
+ /** Custom header content (replaces the default title row). */
6
8
  header?: string | React.ReactNode;
7
9
  footer?: string | React.ReactNode;
8
10
  headerClassName?: string;
9
11
  bodyClassName?: string;
10
12
  footerClassName?: string;
13
+ /** Show a loading skeleton instead of content. */
11
14
  loading?: boolean;
12
15
  before?: React.ReactNode;
13
16
  after?: React.ReactNode;
@@ -16,9 +16,13 @@ type PrismTheme = keyof typeof THEMES;
16
16
  export type PrismBackground = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark' | 'white' | 'black' | 'transparent' | 'default';
17
17
  interface CodeProps extends UIProps {
18
18
  children: string;
19
+ /** Syntax highlight language (e.g. `"tsx"`, `"python"`). */
19
20
  language?: PrismLanguage;
21
+ /** Show a copy-to-clipboard button. */
20
22
  showCopy?: boolean;
23
+ /** Prism color theme. */
21
24
  theme?: PrismTheme;
25
+ /** Background style variant. */
22
26
  background?: PrismBackground;
23
27
  }
24
28
  declare const Code: ({ language, children, before, after, wrapperClassName, className, showCopy, theme, background, }: CodeProps) => React.JSX.Element;
@@ -26,6 +26,12 @@ export type GalleryOverlay = {
26
26
  render?: (item: GalleryRecord, index: number) => React.ReactNode;
27
27
  when?: GalleryOverlayFilter;
28
28
  className?: string;
29
+ /**
30
+ * Inline style overrides, merged on top of the position's own offset styles (and, for
31
+ * `width`/`maxWidth`, on top of the default overlay lane width — a single-line badge's
32
+ * width, too narrow for e.g. a multi-line description meant to span most of the card).
33
+ */
34
+ style?: React.CSSProperties;
29
35
  };
30
36
  export type GallerySelectionState = RecordSelectionState<GalleryRecord>;
31
37
  export type GallerySelectionChangeHandler = (selection: GallerySelectionState) => void;
@@ -33,13 +39,14 @@ export interface GalleryProps extends UIProps {
33
39
  records?: GalleryRecord[];
34
40
  header?: string | React.ReactNode;
35
41
  footer?: string | React.ReactNode;
42
+ /** Overlay badges rendered on each gallery item. */
36
43
  overlays?: GalleryOverlay[];
37
44
  onRowClick?: (record: GalleryRecord) => void;
38
45
  onSelectionChange?: GallerySelectionChangeHandler;
46
+ /** Enable sorting, optionally with a default sort config. */
39
47
  sortable?: boolean | OrderConfig;
40
48
  pagination?: PaginationParams;
41
- scrollToTopOnChange?: boolean;
42
- scrollBehavior?: ScrollBehavior;
49
+ /** Grid gap size (Tailwind spacing scale). */
43
50
  gap?: 0 | 1 | 2 | 3 | 4 | 5;
44
51
  columns?: 1 | 2 | 3 | 4 | 6;
45
52
  groupBy?: string | string[];
@@ -5,7 +5,10 @@ type ContainerProps = {
5
5
  style?: CSSProperties;
6
6
  onClick?: () => void;
7
7
  };
8
- type ColProps = ContainerProps & {
8
+ type ColProps = {
9
+ children?: ReactNode;
10
+ className?: string;
11
+ style?: CSSProperties;
9
12
  defaultSize?: number;
10
13
  xxl?: number | 'auto';
11
14
  xl?: number | 'auto';
@@ -1,12 +1,15 @@
1
1
  import React from 'react';
2
2
  import type { IconProviderAdapter } from '../../providers/icon/IconProvider';
3
3
  interface IconProps {
4
+ /** Icon name (provider-specific identifier). */
4
5
  name?: string;
6
+ /** Icon size in px. Defaults to `16`. */
5
7
  size?: number;
6
8
  className?: string;
7
9
  style?: React.CSSProperties;
8
10
  /** Override the global icon provider for this instance only */
9
11
  provider?: IconProviderAdapter;
12
+ /** Accessible label for screen readers. */
10
13
  label?: string;
11
14
  /** Provider-specific variant — e.g. PhosphorWeight: 'thin'|'light'|'regular'|'bold'|'fill'|'duotone'. Ignored by providers that don't support it. */
12
15
  weight?: string;
@@ -3,15 +3,21 @@ import { UIProps } from '../..';
3
3
  export type ImageFit = 'cover' | 'contain' | 'fill' | 'scale-down' | 'none';
4
4
  export type ImagePosition = 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
5
5
  type ImageProps = {
6
+ /** Image source URL. */
6
7
  src: string;
8
+ /** Placeholder image URL shown while loading. */
7
9
  placeholder?: string;
8
10
  label?: string;
9
11
  title?: string;
12
+ /** Object-fit style for the image. */
10
13
  fit?: ImageFit;
14
+ /** Object-position for the image. */
11
15
  position?: ImagePosition;
16
+ /** Feedback element shown below the image (e.g. caption, error). */
12
17
  feedback?: React.ReactNode;
13
18
  width?: number;
14
19
  height?: number;
20
+ /** Responsive srcset attribute. */
15
21
  srcset?: string;
16
22
  sizes?: string;
17
23
  } & UIProps;
@@ -3,12 +3,15 @@ import type { UIProps } from '../types';
3
3
  import type { BadgeDescriptor } from './Badge';
4
4
  export type AvatarFit = 'cover' | 'contain' | 'fill' | 'scale-down' | 'none';
5
5
  interface ImageAvatarProps extends UIProps {
6
+ /** Avatar image URL. */
6
7
  src: string;
7
8
  width?: number;
8
9
  height?: number;
9
10
  title?: string;
10
11
  alt?: string;
12
+ /** Object-fit style for the avatar image. */
11
13
  fit?: AvatarFit;
14
+ /** Badge descriptor shown as an overlay on the avatar. */
12
15
  badge?: BadgeDescriptor;
13
16
  feedback?: React.ReactNode;
14
17
  }
@@ -1,11 +1,13 @@
1
1
  import React from 'react';
2
2
  import { UIProps } from '../..';
3
3
  interface LoaderProps extends UIProps {
4
+ /** When `true`, renders the loading indicator instead of children. */
4
5
  show?: boolean;
5
6
  children: React.ReactNode;
7
+ /** Icon name for the loading indicator. */
6
8
  icon?: string;
7
9
  title?: string;
8
10
  description?: string;
9
11
  }
10
- declare function Loader({ children, show, icon, title, description, before, after, wrapperClassName, className }: LoaderProps): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
12
+ declare function Loader({ children, show, icon, title, description, before, after, wrapperClassName, className }: LoaderProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
11
13
  export default Loader;
@@ -40,6 +40,15 @@ export interface ModalProps extends MotionUIProps {
40
40
  closeOnBackdrop?: boolean;
41
41
  /** CSS `z-index` override (useful when stacking modals). */
42
42
  zIndex?: number;
43
+ /**
44
+ * Px of screen space already reserved on the right edge (e.g. a persistent app-level
45
+ * side panel docked outside this Modal's own portal) — the backdrop/cover stop short of
46
+ * that space (so the reserved area stays undimmed and interactive) and, for
47
+ * `position="right"`, the dialog itself shifts left by the same amount instead of
48
+ * overlapping it. `0`/`undefined` = today's behaviour, flush against the real viewport
49
+ * edge.
50
+ */
51
+ rightInset?: number;
43
52
  /**
44
53
  * When `true` this modal is visually "behind" another modal stacked on top.
45
54
  * The panel becomes 10% wider (so its edge peeks out from behind the upper modal),
@@ -47,14 +56,27 @@ export interface ModalProps extends MotionUIProps {
47
56
  * modal's backdrop handles interaction blocking), and its cover becomes non-interactive.
48
57
  */
49
58
  stackedBehind?: boolean;
59
+ /**
60
+ * Replaces the default × close button with custom content, in the same header slot
61
+ * (still next to the fullscreen toggle, if any). Use this when the host app wants one
62
+ * consistent icon/action across every modal instead of the built-in × — e.g. an
63
+ * app-level "toggle side panel" icon that means the same thing whether a modal happens
64
+ * to be open or not. Backdrop click and Cancel/Save/Delete still call `onClose` as usual;
65
+ * this only swaps what's rendered in the × slot, not the close mechanics themselves.
66
+ */
67
+ closeSlot?: React.ReactNode;
50
68
  }
69
+ /** Props for a confirm/deny modal dialog with Yes/No buttons. */
51
70
  export interface ModalYesNoProps {
52
71
  title?: React.ReactNode;
53
72
  children: React.ReactNode;
73
+ /** Async handler for the Yes button. Return `true` to close. */
54
74
  onYes?: (e: React.MouseEvent<HTMLElement>) => Promise<boolean>;
75
+ /** Async handler for the No button. Return `true` to close. */
55
76
  onNo?: (e: React.MouseEvent<HTMLElement>) => Promise<boolean>;
56
77
  onClose?: () => void;
57
78
  }
79
+ /** Props for a simple acknowledgment modal with an OK button. */
58
80
  export interface ModalOkProps {
59
81
  children: React.ReactNode;
60
82
  title?: React.ReactNode;
@@ -22,7 +22,9 @@ export type PaginationParams = {
22
22
  };
23
23
  interface PaginationProps<T> extends UIProps, PaginationParams {
24
24
  records: T[];
25
+ /** Render function receiving paginated records and current page offset. */
25
26
  children: (pageRecords: T[], pageOffset: number) => React.ReactNode;
27
+ /** Portal target element — renders pagination bar outside the normal flow. */
26
28
  appendTo?: HTMLElement | null;
27
29
  }
28
30
  declare const Pagination: <T>({ records, children, limit, page, maxPageButtons, appendTo, before, after, className, wrapperClassName, scrollToTopOnChange, scrollBehavior, align, sticky }: PaginationProps<T>) => React.JSX.Element;
@@ -3,14 +3,23 @@ import { UIProps } from '../..';
3
3
  type ColorType = "info" | "success" | "warning" | "danger" | "primary" | "secondary" | "light" | "dark";
4
4
  type ShapeType = "bar" | "circle";
5
5
  interface PercentageProps extends UIProps {
6
+ /** Current value. */
6
7
  value?: number;
8
+ /** Maximum value (defaults to `100`). */
7
9
  max?: number;
10
+ /** Minimum value. */
8
11
  min?: number;
12
+ /** Visual shape: `"bar"` (default) or `"circle"`. */
9
13
  appearance?: ShapeType;
14
+ /** Progress bar color. */
10
15
  variant?: ColorType;
16
+ /** Track (background) color. */
11
17
  trackVariant?: ColorType;
18
+ /** Bar/circle thickness in px. */
12
19
  thickness?: number;
20
+ /** Show percentage text label. */
13
21
  showText?: boolean;
22
+ /** Circle diameter in px (circle mode only). */
14
23
  size?: number;
15
24
  fontSize?: number;
16
25
  label?: string;
@@ -10,7 +10,6 @@ export interface RepeatCallbackArgs {
10
10
  interface RepeatProps {
11
11
  name: string;
12
12
  children: React.ReactNode | ((args: RepeatCallbackArgs) => React.ReactNode);
13
- value?: RecordProps[];
14
13
  onChange?: FieldOnChange;
15
14
  onAdd?: (value: RecordProps[]) => void;
16
15
  onRemove?: (index: number) => void;
@@ -41,7 +41,7 @@ interface TabProps extends MotionUIProps {
41
41
  export declare function getTabLayoutConfig(layout: TabPosition): TabLayoutConfig;
42
42
  export declare function getTabTriggerClassName(layout: TabPosition, active: boolean, className?: string): string;
43
43
  export declare function getTabPaneClassName(className?: string): string;
44
- export declare const TabLayouts: Record<TabPosition, (props: TabLayoutProps) => JSX.Element>;
44
+ export declare const TabLayouts: Record<TabPosition, (props: TabLayoutProps) => React.ReactElement>;
45
45
  export declare const TabItem: React.FC<TabItemProps>;
46
46
  declare const Tab: React.FC<TabProps>;
47
47
  export default Tab;