@llmnative/react 0.1.1 → 1.1.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 (185) hide show
  1. package/README.md +397 -364
  2. package/bin/cli.js +117 -98
  3. package/dist/index.css +1 -1
  4. package/dist/index.js +21 -823
  5. package/dist/index.mjs +14984 -9345
  6. package/dist/style.css +1 -0
  7. package/dist/types/src/App.d.ts +75 -14
  8. package/dist/types/src/Config.d.ts +28 -5
  9. package/dist/types/src/Global.d.ts +2 -2
  10. package/dist/types/src/I18n.d.ts +186 -0
  11. package/dist/types/src/Theme.d.ts +153 -81
  12. package/dist/types/src/auth.d.ts +13 -1
  13. package/dist/types/src/components/Component.d.ts +13 -27
  14. package/dist/types/src/components/ErrorBoundary.d.ts +30 -0
  15. package/dist/types/src/components/blocks/Brand.d.ts +9 -4
  16. package/dist/types/src/components/blocks/Breadcrumbs.d.ts +50 -4
  17. package/dist/types/src/components/blocks/Carousel.d.ts +7 -5
  18. package/dist/types/src/components/blocks/Dropdown.d.ts +38 -20
  19. package/dist/types/src/components/blocks/ListCard.d.ts +38 -0
  20. package/dist/types/src/components/blocks/Menu.d.ts +15 -16
  21. package/dist/types/src/components/blocks/Notifications.d.ts +11 -3
  22. package/dist/types/src/components/blocks/ProviderSwitcher.d.ts +65 -0
  23. package/dist/types/src/components/blocks/Search.d.ts +3 -2
  24. package/dist/types/src/components/blocks/SideNav.d.ts +45 -0
  25. package/dist/types/src/components/blocks/ThemeSwitcher.d.ts +28 -0
  26. package/dist/types/src/components/blocks/Toolbar.d.ts +23 -0
  27. package/dist/types/src/components/index.d.ts +28 -7
  28. package/dist/types/src/components/types.d.ts +10 -3
  29. package/dist/types/src/components/ui/Alert.d.ts +20 -4
  30. package/dist/types/src/components/ui/Badge.d.ts +12 -5
  31. package/dist/types/src/components/ui/Buttons.d.ts +16 -12
  32. package/dist/types/src/components/ui/Card.d.ts +11 -7
  33. package/dist/types/src/components/ui/Code.d.ts +5 -1
  34. package/dist/types/src/components/ui/Gallery.d.ts +16 -16
  35. package/dist/types/src/components/ui/GridSystem.d.ts +5 -2
  36. package/dist/types/src/components/ui/Icon.d.ts +6 -1
  37. package/dist/types/src/components/ui/Image.d.ts +7 -1
  38. package/dist/types/src/components/ui/ImageAvatar.d.ts +4 -1
  39. package/dist/types/src/components/ui/Loader.d.ts +3 -1
  40. package/dist/types/src/components/ui/LocaleSwitcher.d.ts +14 -0
  41. package/dist/types/src/components/ui/Modal.d.ts +46 -15
  42. package/dist/types/src/components/ui/Pagination.d.ts +16 -3
  43. package/dist/types/src/components/ui/Percentage.d.ts +14 -5
  44. package/dist/types/src/components/ui/Repeat.d.ts +14 -6
  45. package/dist/types/src/components/ui/Tab.d.ts +29 -2
  46. package/dist/types/src/components/ui/TabDynamic.d.ts +4 -3
  47. package/dist/types/src/components/ui/Table.d.ts +18 -14
  48. package/dist/types/src/components/ui/fields/CodeEditor.d.ts +46 -0
  49. package/dist/types/src/components/ui/fields/ContextMenu.d.ts +87 -0
  50. package/dist/types/src/components/ui/fields/Crop.d.ts +4 -2
  51. package/dist/types/src/components/ui/fields/ImageField.d.ts +31 -0
  52. package/dist/types/src/components/ui/fields/Input.d.ts +43 -14
  53. package/dist/types/src/components/ui/fields/Prompt.d.ts +2 -31
  54. package/dist/types/src/components/ui/fields/RichText.d.ts +89 -0
  55. package/dist/types/src/components/ui/fields/Select.d.ts +13 -10
  56. package/dist/types/src/components/ui/fields/Upload.d.ts +50 -2
  57. package/dist/types/src/components/ui/fields/UploadCSV.d.ts +2 -0
  58. package/dist/types/src/components/ui/useRecordSelection.d.ts +1 -2
  59. package/dist/types/src/components/widgets/Form.d.ts +80 -43
  60. package/dist/types/src/components/widgets/ImageEditor.d.ts +4 -5
  61. package/dist/types/src/components/widgets/MarkdownReader.d.ts +4 -4
  62. package/dist/types/src/components/widgets/Prompt.d.ts +90 -22
  63. package/dist/types/src/components/widgets/TabDynamic.d.ts +4 -3
  64. package/dist/types/src/components/widgets/form-controller.d.ts +42 -0
  65. package/dist/types/src/components/widgets/grid-core/GridCore.d.ts +1 -1
  66. package/dist/types/src/components/widgets/grid-core/GridDB.d.ts +1 -1
  67. package/dist/types/src/components/widgets/grid-core/GridGalleryView.d.ts +1 -1
  68. package/dist/types/src/components/widgets/grid-core/GridTableView.d.ts +1 -1
  69. package/dist/types/src/components/widgets/grid-core/types.d.ts +77 -27
  70. package/dist/types/src/components/widgets/grid-core/useGridActions.d.ts +4 -8
  71. package/dist/types/src/components/widgets/grid-core/useGridColumns.d.ts +2 -2
  72. package/dist/types/src/components/widgets/grid-core/useGridDBRecords.d.ts +1 -2
  73. package/dist/types/src/components/widgets/grid-core/useGridPreparedRecords.d.ts +2 -2
  74. package/dist/types/src/components/widgets/grid-core/useGridSelection.d.ts +4 -5
  75. package/dist/types/src/components/widgets/grid-core/utils.d.ts +11 -3
  76. package/dist/types/src/conf/Prompt.d.ts +1 -1
  77. package/dist/types/src/conf/i18n/ar.d.ts +2 -0
  78. package/dist/types/src/conf/i18n/de.d.ts +2 -0
  79. package/dist/types/src/conf/i18n/en.d.ts +2 -0
  80. package/dist/types/src/conf/i18n/index.d.ts +6 -0
  81. package/dist/types/src/conf/i18n/it.d.ts +2 -0
  82. package/dist/types/src/conf/i18n/ru.d.ts +2 -0
  83. package/dist/types/src/conf/i18n/zh.d.ts +2 -0
  84. package/dist/types/src/constant.d.ts +1 -1
  85. package/dist/types/src/index.d.ts +48 -13
  86. package/dist/types/src/libs/converter.d.ts +4 -4
  87. package/dist/types/src/libs/editorHeight.d.ts +12 -0
  88. package/dist/types/src/libs/fetch.d.ts +4 -4
  89. package/dist/types/src/libs/imageBuilder.d.ts +63 -14
  90. package/dist/types/src/libs/imageVariants.d.ts +35 -0
  91. package/dist/types/src/libs/index.d.ts +1 -4
  92. package/dist/types/src/libs/promptUtils.d.ts +24 -0
  93. package/dist/types/src/libs/sanitizer.d.ts +2 -2
  94. package/dist/types/src/libs/utils.d.ts +9 -10
  95. package/dist/types/src/pages/index.d.ts +0 -2
  96. package/dist/types/src/providers/ProviderConfiguration.d.ts +6 -0
  97. package/dist/types/src/providers/ProviderDescriptor.d.ts +18 -0
  98. package/dist/types/src/providers/ProviderRegistryContext.d.ts +51 -0
  99. package/dist/types/src/providers/ProviderSession.d.ts +68 -0
  100. package/dist/types/src/providers/ai/AIProvider.d.ts +57 -0
  101. package/dist/types/src/providers/ai/AIProviderContext.d.ts +13 -0
  102. package/dist/types/src/providers/ai/anthropic.d.ts +2 -0
  103. package/dist/types/src/providers/ai/deepseek.d.ts +1 -0
  104. package/dist/types/src/providers/ai/gemini.d.ts +2 -0
  105. package/dist/types/src/providers/ai/glm.d.ts +1 -0
  106. package/dist/types/src/providers/ai/index.d.ts +20 -134
  107. package/dist/types/src/providers/ai/mistral.d.ts +1 -0
  108. package/dist/types/src/providers/ai/openai.d.ts +1 -0
  109. package/dist/types/src/providers/ai/openaiCompatible.d.ts +19 -0
  110. package/dist/types/src/providers/ai/opencode.d.ts +2 -0
  111. package/dist/types/src/providers/ai/openrouter.d.ts +1 -0
  112. package/dist/types/src/providers/ai/shared.d.ts +55 -0
  113. package/dist/types/src/providers/api/ApiProvider.d.ts +43 -0
  114. package/dist/types/src/providers/api/direct.d.ts +14 -0
  115. package/dist/types/src/providers/api/firebase.d.ts +14 -0
  116. package/dist/types/src/providers/api/mock.d.ts +7 -0
  117. package/dist/types/src/providers/api/supabase.d.ts +14 -0
  118. package/dist/types/src/providers/auth/AuthProvider.d.ts +10 -2
  119. package/dist/types/src/providers/auth/firebase/FirebaseAuthProvider.d.ts +49 -0
  120. package/dist/types/src/providers/auth/google/GoogleAuth.d.ts +2 -2
  121. package/dist/types/src/providers/auth/supabase/SupabaseAuthProvider.d.ts +48 -0
  122. package/dist/types/src/providers/credentials/CredentialsProvider.d.ts +3 -0
  123. package/dist/types/src/providers/credentials/CredentialsProviderContext.d.ts +12 -0
  124. package/dist/types/src/providers/credentials/google/GoogleServiceAccountProvider.d.ts +8 -0
  125. package/dist/types/src/providers/data/DataProvider.d.ts +27 -1
  126. package/dist/types/src/providers/data/firebase.d.ts +5 -4
  127. package/dist/types/src/providers/data/firestore.d.ts +45 -0
  128. package/dist/types/src/providers/data/mock.d.ts +8 -1
  129. package/dist/types/src/providers/data/supabase.d.ts +36 -10
  130. package/dist/types/src/providers/email/definitions.d.ts +3 -0
  131. package/dist/types/src/providers/firebase-init.d.ts +24 -7
  132. package/dist/types/src/providers/icon/PhosphorIconProvider.d.ts +1 -1
  133. package/dist/types/src/providers/manifest.d.ts +20 -14
  134. package/dist/types/src/providers/proxy/index.d.ts +7 -0
  135. package/dist/types/src/providers/proxy/vite.d.ts +3 -0
  136. package/dist/types/src/providers/publish/PublishProvider.d.ts +29 -0
  137. package/dist/types/src/providers/publish/definitions.d.ts +3 -0
  138. package/dist/types/src/providers/scrape/index.d.ts +2 -1
  139. package/dist/types/src/providers/seo/google/keyword.d.ts +6 -1
  140. package/dist/types/src/providers/storage/StorageProvider.d.ts +155 -4
  141. package/dist/types/src/providers/storage/dropbox.d.ts +3 -3
  142. package/dist/types/src/providers/storage/firebase.d.ts +44 -7
  143. package/dist/types/src/providers/storage/supabase.d.ts +47 -7
  144. package/dist/types/src/providers/supabase-init.d.ts +35 -0
  145. package/dist/types/src/types/FormFields.d.ts +4 -2
  146. package/dist/types/src/types/FormSchema.d.ts +29 -0
  147. package/dist/types/themes/tokyo-night-light.d.ts +3 -0
  148. package/dist/types/themes/tokyo-night.d.ts +3 -0
  149. package/dist/types/themes/vscode-dark-plus.d.ts +3 -0
  150. package/dist/types/themes/vscode-light-plus.d.ts +3 -0
  151. package/dist/vite.js +1 -0
  152. package/dist/vite.mjs +54 -0
  153. package/package.json +46 -8
  154. package/scripts/cli/proxy-templates/cloudflare.ts +34 -0
  155. package/scripts/cli/proxy-templates/express.ts +77 -0
  156. package/scripts/cli/proxy-templates/nextjs-app.ts +42 -0
  157. package/scripts/cli/proxy-templates/nextjs-pages.ts +41 -0
  158. package/scripts/cli/proxy-templates/scaffold.json +33 -0
  159. package/scripts/cli/setup-devtools.js +155 -85
  160. package/scripts/cli/setup-project.js +618 -484
  161. package/themes/cyber.ts +469 -405
  162. package/themes/default.ts +469 -405
  163. package/themes/flat.ts +469 -405
  164. package/themes/tokyo-night-light.ts +38 -0
  165. package/themes/tokyo-night.ts +38 -0
  166. package/themes/vscode-dark-plus.ts +29 -0
  167. package/themes/vscode-light-plus.ts +29 -0
  168. package/dist/index.js.map +0 -1
  169. package/dist/index.mjs.map +0 -1
  170. package/dist/types/src/components/FormEnhancer.d.ts +0 -26
  171. package/dist/types/src/components/Template.d.ts +0 -18
  172. package/dist/types/src/components/ui/fields/AssistantAI.d.ts +0 -23
  173. package/dist/types/src/components/ui/fields/Command.d.ts +0 -15
  174. package/dist/types/src/components/ui/fields/ImageUrl.d.ts +0 -7
  175. package/dist/types/src/libs/cache.d.ts +0 -9
  176. package/dist/types/src/libs/database.d.ts +0 -3
  177. package/dist/types/src/libs/log.d.ts +0 -2
  178. package/dist/types/src/libs/seo.d.ts +0 -8
  179. package/dist/types/src/libs/storage.d.ts +0 -2
  180. package/dist/types/src/pages/Blog.d.ts +0 -3
  181. package/dist/types/src/pages/BlogPost.d.ts +0 -16
  182. package/dist/types/src/pages/Helper.d.ts +0 -8
  183. package/dist/types/src/providers/auth/google/apis/auth.d.ts +0 -4
  184. package/dist/types/src/types/Block.d.ts +0 -4
  185. package/dist/types/src/types/Section.d.ts +0 -4
@@ -1,27 +1,34 @@
1
1
  import React from "react";
2
2
  import type { UIProps } from '../types';
3
+ /** Semantic color variant for `<Badge>` and any component that accepts a badge. */
3
4
  export type BadgeType = "info" | "success" | "warning" | "danger" | "primary" | "secondary" | "light" | "dark";
4
5
  export type BadgeDescriptor = {
5
6
  content: React.ReactNode;
6
- type?: BadgeType;
7
+ variant?: BadgeType;
7
8
  className?: string;
8
9
  };
9
10
  export type BadgeProps = React.ReactNode | BadgeDescriptor;
10
11
  export declare function isBadgeDescriptor(value: BadgeProps | undefined): value is BadgeDescriptor;
11
12
  export declare function normalizeBadgeProps(value: BadgeProps | undefined, fallbackType?: BadgeType, fallbackClassName?: string): BadgeDescriptor | undefined;
12
13
  export type BadgeOverlayProps = {
14
+ /** Shorthand badge descriptor (content + variant). */
13
15
  badge?: BadgeProps;
16
+ /** Badge content when not using the `badge` shorthand. */
14
17
  content?: React.ReactNode;
15
- type?: BadgeType;
18
+ /** Badge color variant. */
19
+ variant?: BadgeType;
20
+ /** Fallback variant when none is specified. */
16
21
  defaultType?: BadgeType;
17
22
  className?: string;
23
+ /** When `true` and no badge is provided, renders children without wrapping. */
18
24
  descriptorOnly?: boolean;
19
25
  children?: React.ReactNode;
20
26
  };
21
- export declare const BadgeOverlay: ({ badge, content, type, defaultType, className, descriptorOnly, children }: BadgeOverlayProps) => React.ReactNode;
27
+ export declare const BadgeOverlay: ({ badge, content, variant, defaultType, className, descriptorOnly, children }: BadgeOverlayProps) => React.ReactNode;
22
28
  export type BadgeComponentProps = {
23
29
  children: string | React.ReactNode;
24
- type?: BadgeType;
30
+ /** Semantic color variant. */
31
+ variant?: BadgeType;
25
32
  } & UIProps;
26
- declare const Badge: ({ children, type, pre, post, wrapClass, className }: BadgeComponentProps) => React.JSX.Element;
33
+ declare const Badge: ({ children, variant, before, after, wrapperClassName, className }: BadgeComponentProps) => React.JSX.Element;
27
34
  export default Badge;
@@ -2,14 +2,17 @@ import React from 'react';
2
2
  import type { MotionUIProps, UIProps } from '../types';
3
3
  import { BadgeProps } from './Badge';
4
4
  export interface IButton extends MotionUIProps {
5
- onClick?: (e: any) => any;
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. */
13
+ ariaLabel?: string;
10
14
  disabled?: boolean;
11
- showLoader?: boolean;
12
- iconClass?: string;
15
+ iconClassName?: string;
13
16
  style?: React.CSSProperties;
14
17
  variant?: "primary" | "secondary" | "danger" | "success" | "warning" | "info" | "light" | "dark" | "outline-primary" | "outline-secondary" | "outline-danger" | "outline-success" | "link";
15
18
  }
@@ -19,7 +22,8 @@ export type SetMessagePayload = {
19
22
  totalChunks?: number;
20
23
  };
21
24
  export interface LoadingButtonProps extends Omit<IButton, "onClick"> {
22
- onClick?: (e: any, setMessage?: (payload: SetMessagePayload) => any) => Promise<any>;
25
+ onClick?: (e: React.MouseEvent<HTMLElement>, setMessage?: (payload: SetMessagePayload) => void) => Promise<unknown>;
26
+ loading?: boolean;
23
27
  loadingLabel?: string | React.ReactNode;
24
28
  }
25
29
  export declare const buttonBaseClass = "btn";
@@ -36,22 +40,22 @@ export declare const buttonOutlineSecondaryClass = "btn-outline-secondary";
36
40
  export declare const buttonOutlineDangerClass = "btn-outline-danger";
37
41
  export declare const buttonOutlineSuccessClass = "btn-outline-success";
38
42
  export declare const buttonLinkClass = "btn-link";
39
- export declare const LoadingButton: ({ onClick, icon, label, badge, title, disabled, showLoader, pre, post, wrapClass, className, iconClass, style, loadingLabel, variant, motion: motionConfig }?: LoadingButtonProps) => React.JSX.Element;
40
- export declare const ActionButton: ({ onClick, icon, label, badge, title, disabled, pre, post, wrapClass, className, iconClass, style, variant, motion: motionConfig }?: IButton) => React.JSX.Element;
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;
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;
41
45
  interface BackLinkProps extends UIProps {
42
46
  label?: string;
43
47
  }
44
- export declare const BackLink: ({ label, pre, post, wrapClass, className }: BackLinkProps) => React.JSX.Element;
48
+ export declare const BackLink: ({ label, before, after, wrapperClassName, className }: BackLinkProps) => React.JSX.Element;
45
49
  interface GoSiteProps extends UIProps {
46
50
  label: string;
47
- url: string;
51
+ href: string;
48
52
  }
49
- export declare const GoSite: ({ label, url, pre, post, wrapClass, className }: GoSiteProps) => React.JSX.Element;
53
+ export declare const GoSite: ({ label, href, before, after, wrapperClassName, className }: GoSiteProps) => React.JSX.Element;
50
54
  interface ReferSiteProps extends UIProps {
51
55
  title: string;
52
- url: string;
53
- imageUrl: string;
56
+ href: string;
57
+ imageSrc: string;
54
58
  width?: number | string;
55
59
  }
56
- export declare const ReferSite: ({ title, url, imageUrl, width, pre, post, wrapClass, className }: ReferSiteProps) => React.JSX.Element;
60
+ export declare const ReferSite: ({ title, href, imageSrc, width, before, after, wrapperClassName, className }: ReferSiteProps) => React.JSX.Element;
57
61
  export {};
@@ -1,15 +1,19 @@
1
1
  import React from 'react';
2
2
  import { UIProps } from '../..';
3
- interface CardProps extends UIProps {
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
- headerClass?: string;
9
- bodyClass?: string;
10
- footerClass?: string;
11
- showLoader?: boolean;
12
- showArrow?: boolean;
10
+ headerClassName?: string;
11
+ bodyClassName?: string;
12
+ footerClassName?: string;
13
+ /** Show a loading skeleton instead of content. */
14
+ loading?: boolean;
15
+ before?: React.ReactNode;
16
+ after?: React.ReactNode;
13
17
  }
14
- declare const Card: ({ children, title, header, footer, showLoader, showArrow, wrapClass, className, headerClass, bodyClass, footerClass }: CardProps) => React.JSX.Element;
18
+ declare const Card: ({ children, title, header, footer, loading, wrapperClassName, className, headerClassName, bodyClassName, footerClassName, before, after, }: CardProps) => React.JSX.Element;
15
19
  export default Card;
@@ -16,10 +16,14 @@ 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
- declare const Code: ({ language, children, pre, post, wrapClass, className, showCopy, theme, background, }: CodeProps) => React.JSX.Element;
28
+ declare const Code: ({ language, children, before, after, wrapperClassName, className, showCopy, theme, background, }: CodeProps) => React.JSX.Element;
25
29
  export default Code;
@@ -29,27 +29,27 @@ export type GalleryOverlay = {
29
29
  };
30
30
  export type GallerySelectionState = RecordSelectionState<GalleryRecord>;
31
31
  export type GallerySelectionChangeHandler = (selection: GallerySelectionState) => void;
32
- interface GalleryProps extends UIProps {
33
- body?: GalleryRecord[];
34
- Header?: string | React.ReactNode;
35
- Footer?: string | React.ReactNode;
32
+ export interface GalleryProps extends UIProps {
33
+ records?: GalleryRecord[];
34
+ header?: string | React.ReactNode;
35
+ footer?: string | React.ReactNode;
36
+ /** Overlay badges rendered on each gallery item. */
36
37
  overlays?: GalleryOverlay[];
37
- onClick?: (record: GalleryRecord) => void;
38
+ onRowClick?: (record: GalleryRecord) => void;
38
39
  onSelectionChange?: GallerySelectionChangeHandler;
40
+ /** Enable sorting, optionally with a default sort config. */
39
41
  sortable?: boolean | OrderConfig;
40
42
  pagination?: PaginationParams;
41
- scrollToTopOnChange?: boolean;
42
- scrollBehavior?: ScrollBehavior;
43
- gutterSize?: 0 | 1 | 2 | 3 | 4 | 5;
44
- rowCols?: 1 | 2 | 3 | 4 | 6;
43
+ /** Grid gap size (Tailwind spacing scale). */
44
+ gap?: 0 | 1 | 2 | 3 | 4 | 5;
45
+ columns?: 1 | 2 | 3 | 4 | 6;
45
46
  groupBy?: string | string[];
46
47
  selectedKeys?: string[];
47
- selectedRowKeys?: string[];
48
- scrollClass?: string;
49
- headerClass?: string;
50
- bodyClass?: string;
51
- footerClass?: string;
52
- selectedClass?: string;
48
+ scrollClassName?: string;
49
+ headerClassName?: string;
50
+ bodyClassName?: string;
51
+ footerClassName?: string;
52
+ selectedClassName?: string;
53
53
  }
54
- declare const Gallery: ({ body, Header, Footer, overlays, onClick, onSelectionChange, sortable, pagination, gutterSize, rowCols, groupBy, selectedKeys, selectedRowKeys, pre, post, wrapClass, className, headerClass, scrollClass, bodyClass, footerClass, selectedClass }: GalleryProps) => React.JSX.Element;
54
+ declare const Gallery: ({ records, header, footer, overlays, onRowClick, onSelectionChange, sortable, pagination, gap, columns, groupBy, selectedKeys, before, after, wrapperClassName, className, headerClassName, scrollClassName, bodyClassName, footerClassName, selectedClassName }: GalleryProps) => React.JSX.Element;
55
55
  export default Gallery;
@@ -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';
@@ -17,5 +20,5 @@ type ColProps = ContainerProps & {
17
20
  export declare const Wrapper: ({ children, className, style, onClick, }: ContainerProps) => React.JSX.Element;
18
21
  export declare const Container: ({ children, className, style }: ContainerProps) => React.JSX.Element;
19
22
  export declare const Row: ({ children, className, style }: ContainerProps) => React.JSX.Element;
20
- export declare const Col: ({ children, className, style, xxl, xl, lg, md, sm, xs }: ColProps) => React.JSX.Element;
23
+ export declare const Col: ({ children, className, style, defaultSize, xxl, xl, lg, md, sm, xs }: ColProps) => React.JSX.Element;
21
24
  export {};
@@ -1,13 +1,18 @@
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;
14
+ /** Provider-specific variant — e.g. PhosphorWeight: 'thin'|'light'|'regular'|'bold'|'fill'|'duotone'. Ignored by providers that don't support it. */
15
+ weight?: string;
11
16
  }
12
- declare const Icon: ({ name, size, className, style, provider: overrideProvider, label }: IconProps) => React.JSX.Element | null;
17
+ declare const Icon: ({ name, size, className, style, provider: overrideProvider, label, weight }: IconProps) => React.JSX.Element | null;
13
18
  export default Icon;
@@ -3,17 +3,23 @@ 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;
18
- declare const Image: ({ src, placeholder, label, title, fit, position, feedback, width, height, srcset, sizes, pre, post, wrapClass, className }: ImageProps) => React.JSX.Element;
24
+ declare const Image: ({ src, placeholder, label, title, fit, position, feedback, width, height, srcset, sizes, before, after, wrapperClassName, className }: ImageProps) => React.JSX.Element;
19
25
  export default Image;
@@ -3,14 +3,17 @@ 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
  }
15
- declare const ImageAvatar: ({ src, width, height, title, alt, fit, badge, feedback, pre, post, wrapClass, className, }: ImageAvatarProps) => React.JSX.Element;
18
+ declare const ImageAvatar: ({ src, width, height, title, alt, fit, badge, feedback, before, after, wrapperClassName, className, }: ImageAvatarProps) => React.JSX.Element;
16
19
  export default ImageAvatar;
@@ -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, pre, post, wrapClass, 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 | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
11
13
  export default Loader;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ export interface LocaleSwitcherProps {
3
+ /** Icon name passed to the Icon component. Default: 'Globe'. */
4
+ icon?: string;
5
+ /** Optional visible label rendered before the select. */
6
+ label?: string;
7
+ /** Override display names for locale codes. Merged with built-in defaults. */
8
+ labels?: Record<string, string>;
9
+ /** 'code' shows abbreviated codes (EN, IT). 'full' shows the full language name. Default: 'code'. */
10
+ appearance?: 'code' | 'full';
11
+ className?: string;
12
+ }
13
+ declare const LocaleSwitcher: ({ icon, label, labels, appearance, className }: LocaleSwitcherProps) => React.JSX.Element | null;
14
+ export default LocaleSwitcher;
@@ -1,34 +1,65 @@
1
1
  import React from 'react';
2
2
  import type { MotionUIProps } from '../types';
3
- export type ModalSaveHandler = (e: React.MouseEvent<HTMLButtonElement>) => Promise<boolean>;
4
- export type ModalDeleteHandler = (e: React.MouseEvent<HTMLButtonElement>) => Promise<boolean>;
5
- interface ModalProps extends MotionUIProps {
3
+ export type ModalSaveHandler = (e: React.MouseEvent<HTMLElement>) => Promise<boolean>;
4
+ export type ModalDeleteHandler = (e: React.MouseEvent<HTMLElement>) => Promise<boolean>;
5
+ /** Props for the `<Modal>` component. */
6
+ export interface ModalProps extends MotionUIProps {
7
+ /** Modal body content. */
6
8
  children: React.ReactNode;
9
+ /** Text or element rendered as the modal title in the header. */
7
10
  title?: React.ReactNode;
11
+ /** Fully custom header content (replaces the default title row). */
8
12
  header?: React.ReactNode;
13
+ /** Fully custom footer content. Pass `false` to hide the footer bar entirely. */
9
14
  footer?: React.ReactNode | false;
15
+ /** Called when the modal should close (×, backdrop click, Cancel). */
10
16
  onClose?: () => void;
17
+ /** Async save handler wired to the Save button. Return `true` to close. */
11
18
  onSave?: ModalSaveHandler;
19
+ /** Async delete handler wired to the Delete button. Return `true` to close. */
12
20
  onDelete?: ModalDeleteHandler;
13
- size?: "sm" | "md" | "lg" | "xl" | "fullscreen";
21
+ /** Modal width: `"sm"` · `"md"` · `"lg"` · `"xl"` · `"2xl"` · `"fullscreen"`. */
22
+ size?: "sm" | "md" | "lg" | "xl" | "2xl" | "fullscreen";
23
+ /** Anchor position: `"center"` (default) · `"top"` · `"left"` · `"right"` · `"bottom"`. */
14
24
  position?: "center" | "top" | "left" | "right" | "bottom";
15
- buttonFullscreen?: boolean;
16
- buttonCancel?: boolean;
17
- headerClass?: string;
18
- titleClass?: string;
19
- subTitleClass?: string;
20
- bodyClass?: string;
21
- footerClass?: string;
25
+ /** Show a fullscreen toggle button in the header. Defaults to `false`. */
26
+ allowFullscreen?: boolean;
27
+ /** Show the Cancel button in the footer. Defaults to `true`. */
28
+ showCancel?: boolean;
29
+ /** Extra CSS classes on the header container. */
30
+ headerClassName?: string;
31
+ /** Extra CSS classes on the title element. */
32
+ titleClassName?: string;
33
+ /** Extra CSS classes on the subtitle element. */
34
+ subtitleClassName?: string;
35
+ /** Extra CSS classes on the body container. */
36
+ bodyClassName?: string;
37
+ /** Extra CSS classes on the footer container. */
38
+ footerClassName?: string;
39
+ /** Close the modal when the user clicks the backdrop. Defaults to `true`. */
22
40
  closeOnBackdrop?: boolean;
41
+ /** CSS `z-index` override (useful when stacking modals). */
42
+ zIndex?: number;
43
+ /**
44
+ * When `true` this modal is visually "behind" another modal stacked on top.
45
+ * The panel becomes 10% wider (so its edge peeks out from behind the upper modal),
46
+ * gains a semi-transparent dimming overlay, its backdrop is suppressed (the upper
47
+ * modal's backdrop handles interaction blocking), and its cover becomes non-interactive.
48
+ */
49
+ stackedBehind?: boolean;
23
50
  }
24
- interface ModalYesNoProps {
51
+ /** Props for a confirm/deny modal dialog with Yes/No buttons. */
52
+ export interface ModalYesNoProps {
25
53
  title?: React.ReactNode;
26
54
  children: React.ReactNode;
27
- onYes?: (e: React.MouseEvent<HTMLButtonElement>) => Promise<boolean>;
28
- onNo?: (e: React.MouseEvent<HTMLButtonElement>) => Promise<boolean>;
55
+ /** Async handler for the Yes button. Return `true` to close. */
56
+ onYes?: (e: React.MouseEvent<HTMLElement>) => Promise<boolean>;
57
+ /** Async handler for the No button. Return `true` to close. */
58
+ onNo?: (e: React.MouseEvent<HTMLElement>) => Promise<boolean>;
29
59
  onClose?: () => void;
30
60
  }
31
- interface ModalOkProps {
61
+ /** Props for a simple acknowledgment modal with an OK button. */
62
+ export interface ModalOkProps {
32
63
  children: React.ReactNode;
33
64
  title?: React.ReactNode;
34
65
  onClose?: () => void;
@@ -1,18 +1,31 @@
1
1
  import React from 'react';
2
2
  import { UIProps } from "../index";
3
+ /**
4
+ * Pagination configuration shared between `<Pagination>` and `<Grid pagination={...}>`.
5
+ * All fields are optional — omit `limit` to disable pagination entirely.
6
+ */
3
7
  export type PaginationParams = {
8
+ /** Initial page (1-based). Defaults to `1`. */
4
9
  page?: number;
10
+ /** Records per page. Omit to show all records unpaginated. */
5
11
  limit?: number;
6
- navLimit?: number;
12
+ /** Maximum page-number buttons to render before collapsing to ellipsis. */
13
+ maxPageButtons?: number;
14
+ /** Scroll the page back to the top on page change. */
7
15
  scrollToTopOnChange?: boolean;
16
+ /** `scrollIntoView` scroll behavior when `scrollToTopOnChange` is enabled. */
8
17
  scrollBehavior?: ScrollBehavior;
18
+ /** Horizontal alignment of the page-button bar: `"start"`, `"center"`, or `"end"`. */
9
19
  align?: "start" | "center" | "end";
20
+ /** Stick the pagination bar to the bottom of the viewport while scrolling. */
10
21
  sticky?: boolean;
11
22
  };
12
23
  interface PaginationProps<T> extends UIProps, PaginationParams {
13
- recordSet: T[];
24
+ records: T[];
25
+ /** Render function receiving paginated records and current page offset. */
14
26
  children: (pageRecords: T[], pageOffset: number) => React.ReactNode;
27
+ /** Portal target element — renders pagination bar outside the normal flow. */
15
28
  appendTo?: HTMLElement | null;
16
29
  }
17
- declare const Pagination: <T>({ recordSet, children, limit, page, navLimit, appendTo, pre, post, className, wrapClass, scrollToTopOnChange, scrollBehavior, align, sticky }: PaginationProps<T>) => React.JSX.Element;
30
+ declare const Pagination: <T>({ records, children, limit, page, maxPageButtons, appendTo, before, after, className, wrapperClassName, scrollToTopOnChange, scrollBehavior, align, sticky }: PaginationProps<T>) => React.JSX.Element;
18
31
  export default Pagination;
@@ -3,17 +3,26 @@ 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
- val?: number;
6
+ /** Current value. */
7
+ value?: number;
8
+ /** Maximum value (defaults to `100`). */
7
9
  max?: number;
10
+ /** Minimum value. */
8
11
  min?: number;
9
- shape?: ShapeType;
10
- type?: ColorType;
11
- background?: ColorType;
12
+ /** Visual shape: `"bar"` (default) or `"circle"`. */
13
+ appearance?: ShapeType;
14
+ /** Progress bar color. */
15
+ variant?: ColorType;
16
+ /** Track (background) color. */
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;
17
26
  }
18
- declare const Percentage: ({ val, max, min, shape, type, background, thickness, showText, size, fontSize, label, pre, post, wrapClass, className }: PercentageProps) => React.JSX.Element;
27
+ declare const Percentage: ({ value, max, min, appearance, variant, trackVariant, thickness, showText, size, fontSize, label, before, after, wrapperClassName, className }: PercentageProps) => React.JSX.Element;
19
28
  export default Percentage;
@@ -1,18 +1,26 @@
1
1
  import React from 'react';
2
2
  import { FieldOnChange } from '../widgets/Form';
3
+ import { RecordProps } from '../../providers/data/DataProvider';
4
+ export interface RepeatCallbackArgs {
5
+ record: RecordProps;
6
+ records: RecordProps[];
7
+ index: number;
8
+ remove: () => void;
9
+ }
3
10
  interface RepeatProps {
4
11
  name: string;
5
- children: React.ReactNode | ((record: any) => React.ReactNode);
6
- value?: any[];
12
+ children: React.ReactNode | ((args: RepeatCallbackArgs) => React.ReactNode);
7
13
  onChange?: FieldOnChange;
8
- onAdd?: (value: any[]) => void;
14
+ onAdd?: (value: RecordProps[]) => void;
9
15
  onRemove?: (index: number) => void;
10
16
  className?: string;
11
17
  layout?: 'vertical' | 'horizontal' | 'inline';
12
- min?: number;
13
- max?: number;
18
+ minItems?: number;
19
+ maxItems?: number;
14
20
  label?: string;
21
+ labelPosition?: 'top' | 'bottom';
22
+ hideRemoveButton?: boolean;
15
23
  readOnly?: boolean;
16
24
  }
17
- declare const Repeat: ({ name, children, onChange, onAdd, onRemove, className, layout, min, max, label, readOnly, }: RepeatProps) => React.JSX.Element;
25
+ declare const Repeat: ({ name, children, onChange, onAdd, onRemove, className, layout, minItems, maxItems, label, labelPosition, hideRemoveButton, readOnly, }: RepeatProps) => React.JSX.Element;
18
26
  export default Repeat;
@@ -1,19 +1,46 @@
1
1
  import React from 'react';
2
2
  import type { MotionUIProps } from '../types';
3
3
  export type TabPosition = "default" | "top" | "left" | "right" | "bottom";
4
+ /** Props for a single `<TabItem>` inside a `<Tab>`. */
4
5
  interface TabItemProps {
6
+ /** Tab header label (text or ReactNode). */
5
7
  label: React.ReactNode;
8
+ /** Tab panel content. */
6
9
  children: React.ReactNode;
7
10
  }
8
11
  interface TabLayoutProps {
9
12
  menu: React.ReactNode;
10
13
  content: React.ReactNode;
14
+ menuClassName?: string;
15
+ contentClassName?: string;
11
16
  }
17
+ type TabLayoutConfig = {
18
+ shellClassName: string;
19
+ menuClassName: string;
20
+ contentClassName: string;
21
+ itemClassName: string;
22
+ triggerClassName: string;
23
+ activeTriggerClassName: string;
24
+ inactiveTriggerClassName: string;
25
+ };
26
+ /** Props for the `<Tab>` container. */
12
27
  interface TabProps extends MotionUIProps {
28
+ /** `<TabItem>` children that define the tabs. */
13
29
  children: React.ReactNode;
14
- defaultTab?: number;
15
- tabPosition?: TabPosition;
30
+ /** 0-based index of the initially selected tab. Defaults to `0`. */
31
+ defaultIndex?: number;
32
+ /** Called with the new index whenever the active tab changes. */
33
+ onChange?: (index: number) => void;
34
+ /** Spatial layout of the tab bar: `"default"` (underline top), `"top"`, `"left"`, `"right"`, `"bottom"`. */
35
+ layout?: TabPosition;
36
+ /** Additional classes applied to the tablist container. */
37
+ menuClassName?: string;
38
+ /** Additional classes applied to the active pane wrapper. */
39
+ contentClassName?: string;
16
40
  }
41
+ export declare function getTabLayoutConfig(layout: TabPosition): TabLayoutConfig;
42
+ export declare function getTabTriggerClassName(layout: TabPosition, active: boolean, className?: string): string;
43
+ export declare function getTabPaneClassName(className?: string): string;
17
44
  export declare const TabLayouts: Record<TabPosition, (props: TabLayoutProps) => JSX.Element>;
18
45
  export declare const TabItem: React.FC<TabItemProps>;
19
46
  declare const Tab: React.FC<TabProps>;
@@ -1,13 +1,14 @@
1
1
  import React from 'react';
2
2
  import { TabPosition } from './Tab';
3
3
  import { FieldOnChange } from '../widgets/Form';
4
+ import { RecordProps } from '../../providers/data/DataProvider';
4
5
  interface TabDynamicProps {
5
- children: React.ReactNode | ((record: any) => React.ReactNode);
6
+ children: React.ReactNode | ((record: RecordProps) => React.ReactNode);
6
7
  name: string;
7
8
  onChange?: FieldOnChange;
8
- onAdd?: (value: any[]) => void;
9
+ onAdd?: (value: RecordProps[]) => void;
9
10
  onRemove?: (index: number) => void;
10
- value?: any[];
11
+ value?: RecordProps[];
11
12
  label?: string;
12
13
  min?: number;
13
14
  max?: number;
@@ -19,25 +19,29 @@ export type TableSelectionState = RecordSelectionState<RecordProps>;
19
19
  export type TableSelectionMode = 'single' | 'multiple';
20
20
  export type TableSelectionChangeHandler = (selection: TableSelectionState) => void;
21
21
  export type TableReorderHandler = (reorderedRecords: RecordArray, meta: TableReorderMeta) => void;
22
- interface TableProps extends UIProps {
23
- header?: TableHeaderProp[];
24
- body?: RecordArray;
25
- Footer?: string | React.ReactNode;
26
- onClick?: (record: RecordProps) => void;
22
+ export interface TableProps extends UIProps {
23
+ columns?: TableHeaderProp[];
24
+ records?: RecordArray;
25
+ footer?: string | React.ReactNode;
26
+ onRowClick?: (record: RecordProps) => void;
27
27
  onReorder?: TableReorderHandler;
28
28
  onSelectionChange?: TableSelectionChangeHandler;
29
- selectionMode?: TableSelectionMode;
29
+ /** Selection mode: `"single"` or `"multiple"`. */
30
+ selection?: TableSelectionMode;
31
+ /** Enable sorting, optionally with a default sort config. */
30
32
  sortable?: boolean | OrderConfig;
31
33
  pagination?: PaginationParams;
32
34
  activeKey?: string | null;
33
35
  selectedKeys?: string[];
34
- selectedRowKeys?: string[];
35
- headerClass?: string;
36
- bodyClass?: string;
37
- footerClass?: string;
38
- heightClass?: string;
39
- scrollClass?: string;
40
- selectedClass?: string;
36
+ groupBy?: string | string[];
37
+ headerClassName?: string;
38
+ bodyClassName?: string;
39
+ footerClassName?: string;
40
+ heightClassName?: string;
41
+ scrollClassName?: string;
42
+ selectedClassName?: string;
43
+ /** Custom cell renderer. Receives the record, column key, and absolute row index. */
44
+ renderCell?: (record: RecordProps, key: string, absoluteIndex: number) => React.ReactNode;
41
45
  }
42
- declare function Table({ header, body, Footer, onClick, onReorder, onSelectionChange, selectionMode, sortable, pagination, activeKey, selectedKeys, selectedRowKeys, pre, post, wrapClass, className, headerClass, bodyClass, footerClass, heightClass, scrollClass, selectedClass }: TableProps): React.JSX.Element;
46
+ declare function Table({ columns, records, footer, onRowClick, onReorder, onSelectionChange, selection, sortable, pagination, activeKey, selectedKeys, groupBy, before, after, wrapperClassName, className, headerClassName, bodyClassName, footerClassName, heightClassName, scrollClassName, selectedClassName, renderCell }: TableProps): React.JSX.Element;
43
47
  export default Table;