@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.
- package/README.md +397 -364
- package/bin/cli.js +117 -98
- package/dist/index.css +1 -1
- package/dist/index.js +21 -823
- package/dist/index.mjs +14984 -9345
- package/dist/style.css +1 -0
- package/dist/types/src/App.d.ts +75 -14
- package/dist/types/src/Config.d.ts +28 -5
- package/dist/types/src/Global.d.ts +2 -2
- package/dist/types/src/I18n.d.ts +186 -0
- package/dist/types/src/Theme.d.ts +153 -81
- package/dist/types/src/auth.d.ts +13 -1
- package/dist/types/src/components/Component.d.ts +13 -27
- package/dist/types/src/components/ErrorBoundary.d.ts +30 -0
- package/dist/types/src/components/blocks/Brand.d.ts +9 -4
- package/dist/types/src/components/blocks/Breadcrumbs.d.ts +50 -4
- package/dist/types/src/components/blocks/Carousel.d.ts +7 -5
- package/dist/types/src/components/blocks/Dropdown.d.ts +38 -20
- package/dist/types/src/components/blocks/ListCard.d.ts +38 -0
- package/dist/types/src/components/blocks/Menu.d.ts +15 -16
- package/dist/types/src/components/blocks/Notifications.d.ts +11 -3
- package/dist/types/src/components/blocks/ProviderSwitcher.d.ts +65 -0
- package/dist/types/src/components/blocks/Search.d.ts +3 -2
- package/dist/types/src/components/blocks/SideNav.d.ts +45 -0
- package/dist/types/src/components/blocks/ThemeSwitcher.d.ts +28 -0
- package/dist/types/src/components/blocks/Toolbar.d.ts +23 -0
- package/dist/types/src/components/index.d.ts +28 -7
- package/dist/types/src/components/types.d.ts +10 -3
- package/dist/types/src/components/ui/Alert.d.ts +20 -4
- package/dist/types/src/components/ui/Badge.d.ts +12 -5
- package/dist/types/src/components/ui/Buttons.d.ts +16 -12
- package/dist/types/src/components/ui/Card.d.ts +11 -7
- package/dist/types/src/components/ui/Code.d.ts +5 -1
- package/dist/types/src/components/ui/Gallery.d.ts +16 -16
- package/dist/types/src/components/ui/GridSystem.d.ts +5 -2
- package/dist/types/src/components/ui/Icon.d.ts +6 -1
- package/dist/types/src/components/ui/Image.d.ts +7 -1
- package/dist/types/src/components/ui/ImageAvatar.d.ts +4 -1
- package/dist/types/src/components/ui/Loader.d.ts +3 -1
- package/dist/types/src/components/ui/LocaleSwitcher.d.ts +14 -0
- package/dist/types/src/components/ui/Modal.d.ts +46 -15
- package/dist/types/src/components/ui/Pagination.d.ts +16 -3
- package/dist/types/src/components/ui/Percentage.d.ts +14 -5
- package/dist/types/src/components/ui/Repeat.d.ts +14 -6
- package/dist/types/src/components/ui/Tab.d.ts +29 -2
- package/dist/types/src/components/ui/TabDynamic.d.ts +4 -3
- package/dist/types/src/components/ui/Table.d.ts +18 -14
- package/dist/types/src/components/ui/fields/CodeEditor.d.ts +46 -0
- package/dist/types/src/components/ui/fields/ContextMenu.d.ts +87 -0
- package/dist/types/src/components/ui/fields/Crop.d.ts +4 -2
- package/dist/types/src/components/ui/fields/ImageField.d.ts +31 -0
- package/dist/types/src/components/ui/fields/Input.d.ts +43 -14
- package/dist/types/src/components/ui/fields/Prompt.d.ts +2 -31
- package/dist/types/src/components/ui/fields/RichText.d.ts +89 -0
- package/dist/types/src/components/ui/fields/Select.d.ts +13 -10
- package/dist/types/src/components/ui/fields/Upload.d.ts +50 -2
- package/dist/types/src/components/ui/fields/UploadCSV.d.ts +2 -0
- package/dist/types/src/components/ui/useRecordSelection.d.ts +1 -2
- package/dist/types/src/components/widgets/Form.d.ts +80 -43
- package/dist/types/src/components/widgets/ImageEditor.d.ts +4 -5
- package/dist/types/src/components/widgets/MarkdownReader.d.ts +4 -4
- package/dist/types/src/components/widgets/Prompt.d.ts +90 -22
- package/dist/types/src/components/widgets/TabDynamic.d.ts +4 -3
- package/dist/types/src/components/widgets/form-controller.d.ts +42 -0
- package/dist/types/src/components/widgets/grid-core/GridCore.d.ts +1 -1
- package/dist/types/src/components/widgets/grid-core/GridDB.d.ts +1 -1
- package/dist/types/src/components/widgets/grid-core/GridGalleryView.d.ts +1 -1
- package/dist/types/src/components/widgets/grid-core/GridTableView.d.ts +1 -1
- package/dist/types/src/components/widgets/grid-core/types.d.ts +77 -27
- package/dist/types/src/components/widgets/grid-core/useGridActions.d.ts +4 -8
- package/dist/types/src/components/widgets/grid-core/useGridColumns.d.ts +2 -2
- package/dist/types/src/components/widgets/grid-core/useGridDBRecords.d.ts +1 -2
- package/dist/types/src/components/widgets/grid-core/useGridPreparedRecords.d.ts +2 -2
- package/dist/types/src/components/widgets/grid-core/useGridSelection.d.ts +4 -5
- package/dist/types/src/components/widgets/grid-core/utils.d.ts +11 -3
- package/dist/types/src/conf/Prompt.d.ts +1 -1
- package/dist/types/src/conf/i18n/ar.d.ts +2 -0
- package/dist/types/src/conf/i18n/de.d.ts +2 -0
- package/dist/types/src/conf/i18n/en.d.ts +2 -0
- package/dist/types/src/conf/i18n/index.d.ts +6 -0
- package/dist/types/src/conf/i18n/it.d.ts +2 -0
- package/dist/types/src/conf/i18n/ru.d.ts +2 -0
- package/dist/types/src/conf/i18n/zh.d.ts +2 -0
- package/dist/types/src/constant.d.ts +1 -1
- package/dist/types/src/index.d.ts +48 -13
- package/dist/types/src/libs/converter.d.ts +4 -4
- package/dist/types/src/libs/editorHeight.d.ts +12 -0
- package/dist/types/src/libs/fetch.d.ts +4 -4
- package/dist/types/src/libs/imageBuilder.d.ts +63 -14
- package/dist/types/src/libs/imageVariants.d.ts +35 -0
- package/dist/types/src/libs/index.d.ts +1 -4
- package/dist/types/src/libs/promptUtils.d.ts +24 -0
- package/dist/types/src/libs/sanitizer.d.ts +2 -2
- package/dist/types/src/libs/utils.d.ts +9 -10
- package/dist/types/src/pages/index.d.ts +0 -2
- package/dist/types/src/providers/ProviderConfiguration.d.ts +6 -0
- package/dist/types/src/providers/ProviderDescriptor.d.ts +18 -0
- package/dist/types/src/providers/ProviderRegistryContext.d.ts +51 -0
- package/dist/types/src/providers/ProviderSession.d.ts +68 -0
- package/dist/types/src/providers/ai/AIProvider.d.ts +57 -0
- package/dist/types/src/providers/ai/AIProviderContext.d.ts +13 -0
- package/dist/types/src/providers/ai/anthropic.d.ts +2 -0
- package/dist/types/src/providers/ai/deepseek.d.ts +1 -0
- package/dist/types/src/providers/ai/gemini.d.ts +2 -0
- package/dist/types/src/providers/ai/glm.d.ts +1 -0
- package/dist/types/src/providers/ai/index.d.ts +20 -134
- package/dist/types/src/providers/ai/mistral.d.ts +1 -0
- package/dist/types/src/providers/ai/openai.d.ts +1 -0
- package/dist/types/src/providers/ai/openaiCompatible.d.ts +19 -0
- package/dist/types/src/providers/ai/opencode.d.ts +2 -0
- package/dist/types/src/providers/ai/openrouter.d.ts +1 -0
- package/dist/types/src/providers/ai/shared.d.ts +55 -0
- package/dist/types/src/providers/api/ApiProvider.d.ts +43 -0
- package/dist/types/src/providers/api/direct.d.ts +14 -0
- package/dist/types/src/providers/api/firebase.d.ts +14 -0
- package/dist/types/src/providers/api/mock.d.ts +7 -0
- package/dist/types/src/providers/api/supabase.d.ts +14 -0
- package/dist/types/src/providers/auth/AuthProvider.d.ts +10 -2
- package/dist/types/src/providers/auth/firebase/FirebaseAuthProvider.d.ts +49 -0
- package/dist/types/src/providers/auth/google/GoogleAuth.d.ts +2 -2
- package/dist/types/src/providers/auth/supabase/SupabaseAuthProvider.d.ts +48 -0
- package/dist/types/src/providers/credentials/CredentialsProvider.d.ts +3 -0
- package/dist/types/src/providers/credentials/CredentialsProviderContext.d.ts +12 -0
- package/dist/types/src/providers/credentials/google/GoogleServiceAccountProvider.d.ts +8 -0
- package/dist/types/src/providers/data/DataProvider.d.ts +27 -1
- package/dist/types/src/providers/data/firebase.d.ts +5 -4
- package/dist/types/src/providers/data/firestore.d.ts +45 -0
- package/dist/types/src/providers/data/mock.d.ts +8 -1
- package/dist/types/src/providers/data/supabase.d.ts +36 -10
- package/dist/types/src/providers/email/definitions.d.ts +3 -0
- package/dist/types/src/providers/firebase-init.d.ts +24 -7
- package/dist/types/src/providers/icon/PhosphorIconProvider.d.ts +1 -1
- package/dist/types/src/providers/manifest.d.ts +20 -14
- package/dist/types/src/providers/proxy/index.d.ts +7 -0
- package/dist/types/src/providers/proxy/vite.d.ts +3 -0
- package/dist/types/src/providers/publish/PublishProvider.d.ts +29 -0
- package/dist/types/src/providers/publish/definitions.d.ts +3 -0
- package/dist/types/src/providers/scrape/index.d.ts +2 -1
- package/dist/types/src/providers/seo/google/keyword.d.ts +6 -1
- package/dist/types/src/providers/storage/StorageProvider.d.ts +155 -4
- package/dist/types/src/providers/storage/dropbox.d.ts +3 -3
- package/dist/types/src/providers/storage/firebase.d.ts +44 -7
- package/dist/types/src/providers/storage/supabase.d.ts +47 -7
- package/dist/types/src/providers/supabase-init.d.ts +35 -0
- package/dist/types/src/types/FormFields.d.ts +4 -2
- package/dist/types/src/types/FormSchema.d.ts +29 -0
- package/dist/types/themes/tokyo-night-light.d.ts +3 -0
- package/dist/types/themes/tokyo-night.d.ts +3 -0
- package/dist/types/themes/vscode-dark-plus.d.ts +3 -0
- package/dist/types/themes/vscode-light-plus.d.ts +3 -0
- package/dist/vite.js +1 -0
- package/dist/vite.mjs +54 -0
- package/package.json +46 -8
- package/scripts/cli/proxy-templates/cloudflare.ts +34 -0
- package/scripts/cli/proxy-templates/express.ts +77 -0
- package/scripts/cli/proxy-templates/nextjs-app.ts +42 -0
- package/scripts/cli/proxy-templates/nextjs-pages.ts +41 -0
- package/scripts/cli/proxy-templates/scaffold.json +33 -0
- package/scripts/cli/setup-devtools.js +155 -85
- package/scripts/cli/setup-project.js +618 -484
- package/themes/cyber.ts +469 -405
- package/themes/default.ts +469 -405
- package/themes/flat.ts +469 -405
- package/themes/tokyo-night-light.ts +38 -0
- package/themes/tokyo-night.ts +38 -0
- package/themes/vscode-dark-plus.ts +29 -0
- package/themes/vscode-light-plus.ts +29 -0
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/types/src/components/FormEnhancer.d.ts +0 -26
- package/dist/types/src/components/Template.d.ts +0 -18
- package/dist/types/src/components/ui/fields/AssistantAI.d.ts +0 -23
- package/dist/types/src/components/ui/fields/Command.d.ts +0 -15
- package/dist/types/src/components/ui/fields/ImageUrl.d.ts +0 -7
- package/dist/types/src/libs/cache.d.ts +0 -9
- package/dist/types/src/libs/database.d.ts +0 -3
- package/dist/types/src/libs/log.d.ts +0 -2
- package/dist/types/src/libs/seo.d.ts +0 -8
- package/dist/types/src/libs/storage.d.ts +0 -2
- package/dist/types/src/pages/Blog.d.ts +0 -3
- package/dist/types/src/pages/BlogPost.d.ts +0 -16
- package/dist/types/src/pages/Helper.d.ts +0 -8
- package/dist/types/src/providers/auth/google/apis/auth.d.ts +0 -4
- package/dist/types/src/types/Block.d.ts +0 -4
- package/dist/types/src/types/Section.d.ts +0 -4
|
@@ -1,14 +1,19 @@
|
|
|
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;
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
logoClassName?: string;
|
|
16
|
+
labelClassName?: string;
|
|
12
17
|
};
|
|
13
|
-
declare const Brand: ({ url, label, logo, width, height,
|
|
18
|
+
declare const Brand: ({ url, label, logo, width, height, wrapperClassName, className, logoClassName, labelClassName }: BrandProps) => React.JSX.Element;
|
|
14
19
|
export default Brand;
|
|
@@ -1,8 +1,54 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/**
|
|
3
|
+
* A single breadcrumb item.
|
|
4
|
+
* - Provide `href` to render as a clickable link.
|
|
5
|
+
* - Omit `href` on the last item to mark it as the current page (not a link).
|
|
6
|
+
*/
|
|
7
|
+
export type BreadcrumbItem = {
|
|
8
|
+
label: string;
|
|
9
|
+
href?: string;
|
|
10
|
+
node?: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export type BreadcrumbsProps = {
|
|
13
|
+
/**
|
|
14
|
+
* The breadcrumb trail to render.
|
|
15
|
+
* - Pass a URL string to auto-parse into segments (e.g. "/products/shoes") - falls back to the current route when omitted.
|
|
16
|
+
* - Pass a BreadcrumbItem[] for explicit control over labels and links.
|
|
17
|
+
*/
|
|
18
|
+
trail?: string | BreadcrumbItem[];
|
|
19
|
+
/**
|
|
20
|
+
* Optional anchor item rendered before the trail (e.g. the site root).
|
|
21
|
+
* Pass a string for a plain label (e.g. "Home") or a BreadcrumbItem to also add a link (e.g. { label: "Home", href: "/" }).
|
|
22
|
+
*/
|
|
23
|
+
rootItem?: string | BreadcrumbItem;
|
|
24
|
+
/** Character or icon rendered between items. Use "chevron" for an SVG arrow. Default: "/" */
|
|
25
|
+
separator?: '/' | '>' | 'chevron' | string;
|
|
26
|
+
/** When true, renders a <script type="application/ld+json"> BreadcrumbList schema.org tag. Default: false */
|
|
27
|
+
jsonLd?: boolean;
|
|
28
|
+
/** Base URL prepended to item hrefs in the JSON-LD output only (e.g. "https://example.com"). Does not affect the visual links. Defaults to window.location.origin. */
|
|
29
|
+
baseUrl?: string;
|
|
5
30
|
className?: string;
|
|
6
31
|
};
|
|
7
|
-
|
|
32
|
+
/** Options for buildBreadcrumbSchema. */
|
|
33
|
+
export type BreadcrumbSchemaOptions = {
|
|
34
|
+
/** The breadcrumb item list. Items with `href` get an absolute URL in the schema; items without `href` (current page) do not. */
|
|
35
|
+
items: BreadcrumbItem[];
|
|
36
|
+
/** Optional anchor item prepended before the list (same shape as BreadcrumbItem - e.g. { label: "Home", href: "/" }). */
|
|
37
|
+
rootItem?: BreadcrumbItem;
|
|
38
|
+
/** Base URL prepended to all hrefs to produce the absolute URLs required by schema.org (e.g. "https://example.com"). */
|
|
39
|
+
baseUrl: string;
|
|
40
|
+
/** When true, returns a JSON string ready for `dangerouslySetInnerHTML` - no manual JSON.stringify needed. Default: false */
|
|
41
|
+
stringify?: boolean;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Builds a schema.org BreadcrumbList.
|
|
45
|
+
* Returns a plain object by default, or a ready-to-inject JSON string when `stringify: true`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function buildBreadcrumbSchema(options: BreadcrumbSchemaOptions & {
|
|
48
|
+
stringify: true;
|
|
49
|
+
}): string;
|
|
50
|
+
export declare function buildBreadcrumbSchema(options: BreadcrumbSchemaOptions & {
|
|
51
|
+
stringify?: false;
|
|
52
|
+
}): object;
|
|
53
|
+
export declare const Breadcrumbs: ({ trail, rootItem, separator, jsonLd, baseUrl, className, }: BreadcrumbsProps) => React.JSX.Element | null;
|
|
8
54
|
export default Breadcrumbs;
|
|
@@ -9,11 +9,13 @@ type CarouselProps = {
|
|
|
9
9
|
showIndicators?: boolean;
|
|
10
10
|
showControls?: boolean;
|
|
11
11
|
showCaption?: boolean;
|
|
12
|
-
|
|
12
|
+
/** Use dark variant indicators/controls. */
|
|
13
|
+
dark?: boolean;
|
|
13
14
|
autoPlay?: AutoPlayOptions;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
/** 0-based index of the initially visible slide. */
|
|
16
|
+
initialSlide?: number;
|
|
17
|
+
renderCaption?: (image: React.ReactElement) => React.ReactElement;
|
|
18
|
+
onSlideClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
17
19
|
};
|
|
18
|
-
declare const Carousel: ({ children, showIndicators, showControls, showCaption,
|
|
20
|
+
declare const Carousel: ({ children, showIndicators, showControls, showCaption, dark, autoPlay, initialSlide, renderCaption, onSlideClick, }: CarouselProps) => React.JSX.Element | null;
|
|
19
21
|
export default Carousel;
|
|
@@ -1,44 +1,59 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BadgeProps } from "../ui/Badge";
|
|
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;
|
|
8
|
+
title?: string;
|
|
7
9
|
}
|
|
8
|
-
interface DropdownProps extends
|
|
10
|
+
interface DropdownProps extends MotionUIProps {
|
|
9
11
|
children: React.ReactNode;
|
|
10
|
-
|
|
12
|
+
/** Dropdown trigger: string (label), React element, or `DropdownTogglerProps` object. */
|
|
13
|
+
trigger?: string | React.ReactNode | DropdownTogglerProps;
|
|
11
14
|
badge?: BadgeProps;
|
|
15
|
+
/** Fixed header rendered inside the dropdown menu. */
|
|
12
16
|
header?: React.ReactNode;
|
|
13
17
|
footer?: React.ReactNode;
|
|
18
|
+
/** Uncontrolled open state default. */
|
|
14
19
|
defaultOpen?: boolean;
|
|
20
|
+
/** Controlled open state. */
|
|
15
21
|
open?: boolean;
|
|
16
22
|
onOpenChange?: (open: boolean) => void;
|
|
17
|
-
|
|
23
|
+
/** When `true`, the menu stays open regardless of interaction. */
|
|
24
|
+
staticOpen?: boolean;
|
|
25
|
+
/** Horizontal alignment relative to the trigger. */
|
|
18
26
|
position?: "start" | "end";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
/** Drop direction. */
|
|
28
|
+
placement?: "auto" | "top" | "bottom";
|
|
29
|
+
/** CSS positioning strategy. */
|
|
30
|
+
strategy?: "fixed" | "absolute";
|
|
31
|
+
triggerClassName?: string;
|
|
32
|
+
badgeClassName?: string;
|
|
33
|
+
menuClassName?: string;
|
|
34
|
+
headerClassName?: string;
|
|
35
|
+
footerClassName?: string;
|
|
26
36
|
}
|
|
27
37
|
interface DropdownButtonProps extends Pick<MotionUIProps, 'motion'> {
|
|
28
38
|
children: React.ReactNode;
|
|
29
39
|
badge?: BadgeProps;
|
|
40
|
+
/** `"static"` — always visible; `"dynamic"` — shows/hides with the menu. */
|
|
30
41
|
display?: "static" | "dynamic";
|
|
31
42
|
className?: string;
|
|
32
|
-
|
|
43
|
+
badgeClassName?: string;
|
|
44
|
+
title?: string;
|
|
33
45
|
onToggle?: () => void;
|
|
34
46
|
open?: boolean;
|
|
35
47
|
menuId?: string;
|
|
48
|
+
buttonRef?: React.RefObject<HTMLButtonElement>;
|
|
36
49
|
}
|
|
37
50
|
interface DropdownItemProps {
|
|
51
|
+
/** Link URL. When set, renders as `<a>`, otherwise as `<button>`. */
|
|
38
52
|
url?: string;
|
|
39
53
|
onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
|
|
40
54
|
className?: string;
|
|
41
55
|
children: React.ReactNode;
|
|
56
|
+
/** Leading icon name. */
|
|
42
57
|
icon?: string;
|
|
43
58
|
}
|
|
44
59
|
interface DropdownHeaderProps {
|
|
@@ -48,17 +63,20 @@ interface DropdownHeaderProps {
|
|
|
48
63
|
interface DropdownDividerProps {
|
|
49
64
|
className?: string;
|
|
50
65
|
}
|
|
51
|
-
export declare const Dropdown: ({ children,
|
|
52
|
-
export declare const DropdownButton: ({ children, badge, display, className,
|
|
66
|
+
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;
|
|
67
|
+
export declare const DropdownButton: ({ children, badge, display, className, badgeClassName, motion: motionConfig, title, onToggle, open, menuId, buttonRef }: DropdownButtonProps) => React.JSX.Element;
|
|
53
68
|
export declare const DropdownItem: ({ children, url, onClick, icon, className }: DropdownItemProps) => React.JSX.Element;
|
|
54
69
|
export declare const DropdownHeader: ({ children, className }: DropdownHeaderProps) => React.JSX.Element;
|
|
55
70
|
export declare const DropdownDivider: ({ className }: DropdownDividerProps) => React.JSX.Element;
|
|
56
71
|
interface DropdownMenuProps {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
badges?: Record<string,
|
|
60
|
-
|
|
61
|
-
|
|
72
|
+
menuKey: string;
|
|
73
|
+
as?: 'ul' | 'ol';
|
|
74
|
+
badges?: Record<string, {
|
|
75
|
+
type?: BadgeType;
|
|
76
|
+
children: string;
|
|
77
|
+
}>;
|
|
78
|
+
before?: React.ReactNode;
|
|
79
|
+
after?: React.ReactNode;
|
|
62
80
|
}
|
|
63
|
-
export declare const DropdownMenu: ({
|
|
81
|
+
export declare const DropdownMenu: ({ menuKey, as, badges, before, after }: DropdownMenuProps) => React.JSX.Element;
|
|
64
82
|
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MotionUIProps } from '../types';
|
|
3
|
+
export interface ListCardProps extends MotionUIProps {
|
|
4
|
+
title?: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
/** Metadata displayed below the description. */
|
|
7
|
+
meta?: React.ReactNode;
|
|
8
|
+
badge?: React.ReactNode;
|
|
9
|
+
/** Leading icon or custom element. */
|
|
10
|
+
icon?: string | React.ReactNode;
|
|
11
|
+
/** Element displayed on the trailing edge. */
|
|
12
|
+
trailing?: React.ReactNode;
|
|
13
|
+
footer?: React.ReactNode;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
/** Navigate to this URL on click. */
|
|
16
|
+
href?: string;
|
|
17
|
+
/** Open link in a new tab. */
|
|
18
|
+
external?: boolean;
|
|
19
|
+
active?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** Show a dashed border style. */
|
|
22
|
+
dashed?: boolean;
|
|
23
|
+
/** Compact layout with less padding. */
|
|
24
|
+
compact?: boolean;
|
|
25
|
+
align?: 'start' | 'center';
|
|
26
|
+
style?: React.CSSProperties;
|
|
27
|
+
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
28
|
+
titleClassName?: string;
|
|
29
|
+
descriptionClassName?: string;
|
|
30
|
+
metaClassName?: string;
|
|
31
|
+
badgeClassName?: string;
|
|
32
|
+
leadingClassName?: string;
|
|
33
|
+
bodyClassName?: string;
|
|
34
|
+
headerClassName?: string;
|
|
35
|
+
trailingClassName?: string;
|
|
36
|
+
footerClassName?: string;
|
|
37
|
+
}
|
|
38
|
+
export default function ListCard({ title, description, meta, badge, icon, trailing, footer, children, href, external, active, disabled, dashed, compact, align, onClick, before, after, wrapperClassName, className, titleClassName, descriptionClassName, metaClassName, badgeClassName, leadingClassName, bodyClassName, headerClassName, trailingClassName, footerClassName, style, motion: motionConfig, }: ListCardProps): React.JSX.Element;
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BadgeType } from '../ui/Badge';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import type { UIProps } from '../types';
|
|
4
|
+
interface MenuProps extends UIProps {
|
|
5
|
+
/** Registry key used to look up menu items from `useMenu()`. */
|
|
6
|
+
menuKey: string;
|
|
7
|
+
as?: 'ul' | 'ol';
|
|
8
|
+
/** Badge overrides keyed by menu item ID. */
|
|
6
9
|
badges?: Record<string, {
|
|
7
10
|
type?: BadgeType;
|
|
8
11
|
children: string;
|
|
9
12
|
}>;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
textClass?: string;
|
|
19
|
-
badgeClass?: string;
|
|
20
|
-
arrowClass?: string;
|
|
21
|
-
submenuClass?: string;
|
|
13
|
+
headerClassName?: string;
|
|
14
|
+
itemClassName?: string;
|
|
15
|
+
linkClassName?: string;
|
|
16
|
+
iconClassName?: string;
|
|
17
|
+
textClassName?: string;
|
|
18
|
+
badgeClassName?: string;
|
|
19
|
+
arrowClassName?: string;
|
|
20
|
+
submenuClassName?: string;
|
|
22
21
|
}
|
|
23
|
-
declare const Menu: ({
|
|
22
|
+
declare const Menu: ({ menuKey, as, badges, before, after, wrapperClassName, className, headerClassName, itemClassName, linkClassName, iconClassName, textClassName, badgeClassName, arrowClassName, submenuClassName, }: MenuProps) => React.JSX.Element;
|
|
24
23
|
export default Menu;
|
|
@@ -1,15 +1,23 @@
|
|
|
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;
|
|
6
7
|
time: string;
|
|
7
8
|
icon: string;
|
|
9
|
+
read?: boolean;
|
|
8
10
|
}
|
|
9
11
|
interface NotificationsProps {
|
|
10
|
-
|
|
12
|
+
items?: NotificationItem[];
|
|
11
13
|
badge?: BadgeProps;
|
|
12
|
-
|
|
14
|
+
/** URL to a full notifications page — shown in the footer only when there are items */
|
|
15
|
+
seeAllUrl?: string;
|
|
16
|
+
/** Callback for "mark all as read" — shown in the header only when there are items */
|
|
17
|
+
onMarkAllRead?: () => void;
|
|
18
|
+
/** Named motion preset for notification items appearance. */
|
|
19
|
+
motion?: MotionReference;
|
|
20
|
+
className?: string;
|
|
13
21
|
}
|
|
14
|
-
declare function Notifications({
|
|
22
|
+
declare function Notifications({ items, badge, seeAllUrl, onMarkAllRead, motion, className, }: NotificationsProps): React.JSX.Element;
|
|
15
23
|
export default Notifications;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { UIProps } from '../types';
|
|
3
|
+
import type { ProviderSessionResponse } from '../../providers/ProviderSession';
|
|
4
|
+
export interface ProviderSwitcherItem {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
/** Rendered on the trailing side of the row, e.g. a role or a status. */
|
|
8
|
+
meta?: React.ReactNode;
|
|
9
|
+
/** Icon name (resolved via the icon provider) or a ready-made node. Falls back to the switcher's own `icon`. */
|
|
10
|
+
icon?: string | React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface ProviderSwitcherProps extends UIProps {
|
|
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;
|
|
16
|
+
activeId?: string | null;
|
|
17
|
+
/** Fires once the switch has actually succeeded — never optimistically on click. */
|
|
18
|
+
onSelect?: (id: string) => void;
|
|
19
|
+
/** Fires when the endpoint call or the provider switch itself throws. */
|
|
20
|
+
onError?: (id: string, error: unknown) => void;
|
|
21
|
+
/** Inspect or transform the raw session response before it's applied — e.g. inject an extra category, filter one out, forward it to an audit log. */
|
|
22
|
+
onResponse?: (response: ProviderSessionResponse) => ProviderSessionResponse | Promise<ProviderSessionResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* URL of the session endpoint (POSTed with `requestBody(id)` on selection), or a
|
|
25
|
+
* resolver called directly with the picked id — e.g. a mock/dev session provider,
|
|
26
|
+
* or a Firebase Callable Function invocation. No fetch happens in the resolver case.
|
|
27
|
+
*/
|
|
28
|
+
endpoint: string | ((id: string) => Promise<ProviderSessionResponse>);
|
|
29
|
+
/**
|
|
30
|
+
* Overrides the credential sent with the request. By default, ProviderSwitcher calls
|
|
31
|
+
* getAccessToken() on the app's own registered auth provider — the identity the user
|
|
32
|
+
* already negotiated at login — so most apps never need to set this. A function is
|
|
33
|
+
* called fresh on every switch, which matters because tokens expire/rotate.
|
|
34
|
+
*/
|
|
35
|
+
authorization?: string | (() => string | Promise<string>);
|
|
36
|
+
/** Builds the POST body for a string `endpoint`. Defaults to `{ id }`. */
|
|
37
|
+
requestBody?: (id: string) => unknown;
|
|
38
|
+
/** HTTP method for a string `endpoint`. Default: 'POST'. */
|
|
39
|
+
method?: string;
|
|
40
|
+
/** Leading icon shown in the trigger and as the default per-item icon. Name resolved via the icon provider, or a ready-made node. */
|
|
41
|
+
icon?: string | React.ReactNode;
|
|
42
|
+
/** Small caption under the active item's label in the trigger (e.g. "Workspace"). Also used as the list header unless `listLabel` is set. */
|
|
43
|
+
caption?: React.ReactNode;
|
|
44
|
+
/** Header shown above the item list. Defaults to `caption`. */
|
|
45
|
+
listLabel?: React.ReactNode;
|
|
46
|
+
/** Shown in the trigger when `activeId` matches nothing in `items`. Defaults to the framework's generic "Select..." string. */
|
|
47
|
+
placeholder?: React.ReactNode;
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
open?: boolean;
|
|
50
|
+
onOpenChange?: (open: boolean) => void;
|
|
51
|
+
/** Rendered below the item list, inside the dropdown — e.g. a "manage" action. Omit for a plain list. */
|
|
52
|
+
footer?: React.ReactNode;
|
|
53
|
+
triggerClassName?: string;
|
|
54
|
+
listClassName?: string;
|
|
55
|
+
itemClassName?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Generic named-item switcher — no domain vocabulary (tenant, workspace, session, ...).
|
|
59
|
+
* Given `items` and one `endpoint`, it performs the whole switch itself on selection:
|
|
60
|
+
* resolves a credential (the app's own auth provider by default), calls the endpoint
|
|
61
|
+
* for the picked id, and applies the response via useProviderSession().switchSession().
|
|
62
|
+
* The caller only finds out once it's actually done (`onSelect`) or failed (`onError`) —
|
|
63
|
+
* it never has to wire the request/loading/error plumbing itself.
|
|
64
|
+
*/
|
|
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,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface SearchProps {
|
|
3
|
-
|
|
3
|
+
/** Called on every keystroke with the current search input event. */
|
|
4
|
+
onQueryChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
4
5
|
}
|
|
5
6
|
export declare const SearchButton: () => React.JSX.Element;
|
|
6
|
-
declare function Search({
|
|
7
|
+
declare function Search({ onQueryChange }: SearchProps): React.JSX.Element;
|
|
7
8
|
export default Search;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SideNav — collapsible sidebar block.
|
|
3
|
+
*
|
|
4
|
+
* Accepts either `menuKey` (reads from App menuConfig via useMenu) or explicit `items`.
|
|
5
|
+
* Features: collapse to icon-only, hover-expand overlay, groups, active state, animated sub-menu, badges.
|
|
6
|
+
*
|
|
7
|
+
* Active state is computed manually via useLocation (not NavLink.isActive) to avoid
|
|
8
|
+
* React Router quirks with the "/" root path and the `end` flag.
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
export interface SideNavItemDef {
|
|
12
|
+
path: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
group?: string;
|
|
16
|
+
/** Match exact path only (needed for "/" to avoid matching everything). Default: false. */
|
|
17
|
+
end?: boolean;
|
|
18
|
+
/** Badge label shown next to the item title. Collapsed: dot indicator. */
|
|
19
|
+
badge?: string | number;
|
|
20
|
+
children?: SideNavItemDef[];
|
|
21
|
+
}
|
|
22
|
+
export interface SideNavProps {
|
|
23
|
+
/** Menu key registered in App menuConfig — calls useMenu() internally */
|
|
24
|
+
menuKey?: string;
|
|
25
|
+
/** Explicit items — alternative to menuKey */
|
|
26
|
+
items?: SideNavItemDef[];
|
|
27
|
+
defaultCollapsed?: boolean;
|
|
28
|
+
/** Show icon slot. Default true. */
|
|
29
|
+
showIcons?: boolean;
|
|
30
|
+
/** Show collapse/expand toggle button in the footer. Default true. */
|
|
31
|
+
showCollapseButton?: boolean;
|
|
32
|
+
/** Optional content rendered in the footer alongside the collapse button. */
|
|
33
|
+
footer?: React.ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Optional content rendered in a pinned header at the top of the sidebar.
|
|
36
|
+
* Hidden when empty (default).
|
|
37
|
+
*/
|
|
38
|
+
header?: React.ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* Embedded mode — renders only the nav items without the sidebar shell
|
|
41
|
+
* (no sticky wrapper, no collapse button). Use inside drawers or panels.
|
|
42
|
+
*/
|
|
43
|
+
embedded?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export default function SideNav({ menuKey, items: itemsProp, defaultCollapsed, showIcons, showCollapseButton, footer, header, embedded, }: SideNavProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ThemeSwitcherThemeOption {
|
|
3
|
+
label?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ThemeSwitcherProps {
|
|
7
|
+
/** Show the switcher panel. */
|
|
8
|
+
open?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
wrapperClassName?: string;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
/** Render as a flat panel or inside a Modal. */
|
|
13
|
+
surface?: 'flat' | 'modal';
|
|
14
|
+
showHeader?: boolean;
|
|
15
|
+
title?: React.ReactNode;
|
|
16
|
+
subtitle?: React.ReactNode;
|
|
17
|
+
headerActions?: React.ReactNode;
|
|
18
|
+
/** Per-theme label/description overrides. */
|
|
19
|
+
themeOptions?: Record<string, ThemeSwitcherThemeOption>;
|
|
20
|
+
showModeSection?: boolean;
|
|
21
|
+
showPrimarySection?: boolean;
|
|
22
|
+
showRadiusSection?: boolean;
|
|
23
|
+
showFontSection?: boolean;
|
|
24
|
+
showStatusSection?: boolean;
|
|
25
|
+
showThemeSection?: boolean;
|
|
26
|
+
showIconLibrarySection?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export default function ThemeSwitcher({ open, onClose, surface, showHeader, title, subtitle, headerActions, themeOptions, showModeSection, showPrimarySection, showRadiusSection, showFontSection, showStatusSection, showThemeSection, showIconLibrarySection, className, wrapperClassName, }: ThemeSwitcherProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type ScrollTarget = Window | HTMLElement | null | undefined | React.RefObject<HTMLElement | null>;
|
|
3
|
+
export interface ToolbarProps {
|
|
4
|
+
leading?: React.ReactNode;
|
|
5
|
+
center?: React.ReactNode;
|
|
6
|
+
trailing?: React.ReactNode;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/** Stick the toolbar to the top of the viewport on scroll. */
|
|
9
|
+
sticky?: boolean;
|
|
10
|
+
/** Add shadow on scroll when `sticky` is enabled. */
|
|
11
|
+
elevateOnScroll?: boolean;
|
|
12
|
+
/** Scroll container to observe for sticky threshold. Defaults to `window`. */
|
|
13
|
+
scrollTarget?: ScrollTarget;
|
|
14
|
+
/** Px threshold before sticky/elevate activates. */
|
|
15
|
+
scrollThreshold?: number;
|
|
16
|
+
className?: string;
|
|
17
|
+
innerClassName?: string;
|
|
18
|
+
leadingClassName?: string;
|
|
19
|
+
centerClassName?: string;
|
|
20
|
+
trailingClassName?: string;
|
|
21
|
+
}
|
|
22
|
+
export default function Toolbar({ leading, center, trailing, children, sticky, elevateOnScroll, scrollTarget, scrollThreshold, className, innerClassName, leadingClassName, centerClassName, trailingClassName, }: ToolbarProps): React.JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
export type { MotionUIProps, UIProps } from './types';
|
|
2
2
|
export { default as Brand } from './blocks/Brand';
|
|
3
|
-
export { default as Breadcrumbs } from './blocks/Breadcrumbs';
|
|
3
|
+
export { default as Breadcrumbs, buildBreadcrumbSchema } from './blocks/Breadcrumbs';
|
|
4
|
+
export type { BreadcrumbItem, BreadcrumbsProps, BreadcrumbSchemaOptions } from './blocks/Breadcrumbs';
|
|
4
5
|
export { default as Carousel } from './blocks/Carousel';
|
|
5
6
|
export * from './blocks/Dropdown';
|
|
6
7
|
export { default as Notifications } from './blocks/Notifications';
|
|
7
8
|
export { default as Search } from './blocks/Search';
|
|
9
|
+
export { default as Toolbar } from './blocks/Toolbar';
|
|
10
|
+
export type { ToolbarProps } from './blocks/Toolbar';
|
|
11
|
+
export { default as ThemeSwitcher } from './blocks/ThemeSwitcher';
|
|
12
|
+
export type { ThemeSwitcherProps, ThemeSwitcherThemeOption } from './blocks/ThemeSwitcher';
|
|
13
|
+
export { default as ProviderSwitcher } from './blocks/ProviderSwitcher';
|
|
14
|
+
export type { ProviderSwitcherProps, ProviderSwitcherItem } from './blocks/ProviderSwitcher';
|
|
8
15
|
export { default as Alert } from './ui/Alert';
|
|
16
|
+
export type { AlertProps } from './ui/Alert';
|
|
9
17
|
export { default as Badge } from './ui/Badge';
|
|
10
18
|
export * from './ui/Badge';
|
|
11
19
|
export * from './ui/Buttons';
|
|
12
20
|
export { default as Card } from './ui/Card';
|
|
21
|
+
export type { CardProps } from './ui/Card';
|
|
13
22
|
export { default as Code } from './ui/Code';
|
|
14
23
|
export { default as Gallery } from './ui/Gallery';
|
|
15
24
|
export * from './ui/Gallery';
|
|
@@ -18,14 +27,17 @@ export * from './ui/GridSystem';
|
|
|
18
27
|
export { default as Image } from './ui/Image';
|
|
19
28
|
export { default as ImageAvatar } from './ui/ImageAvatar';
|
|
20
29
|
export { default as Loader } from './ui/Loader';
|
|
30
|
+
export { default as LocaleSwitcher } from './ui/LocaleSwitcher';
|
|
31
|
+
export type { LocaleSwitcherProps } from './ui/LocaleSwitcher';
|
|
21
32
|
export { default as Modal } from './ui/Modal';
|
|
22
33
|
export * from './ui/Modal';
|
|
34
|
+
export { default as Pagination } from './ui/Pagination';
|
|
23
35
|
export { default as Percentage } from './ui/Percentage';
|
|
24
36
|
export { default as Repeat } from './ui/Repeat';
|
|
25
37
|
export { default as Tab } from './ui/Tab';
|
|
26
38
|
export * from './ui/Tab';
|
|
27
39
|
export { default as Table } from './ui/Table';
|
|
28
|
-
export type { TableHeaderProp, TableReorderHandler, TableReorderMeta, TableSelectionChangeHandler, TableSelectionState } from './ui/Table';
|
|
40
|
+
export type { TableProps, TableHeaderProp, TableReorderHandler, TableReorderMeta, TableSelectionChangeHandler, TableSelectionState } from './ui/Table';
|
|
29
41
|
export { default as Icon } from './ui/Icon';
|
|
30
42
|
export { LayoutBuilder } from './ui/LayoutBuilder';
|
|
31
43
|
export * from './ui/fields/Input';
|
|
@@ -33,11 +45,19 @@ export * from './ui/fields/Select';
|
|
|
33
45
|
export * from './ui/fields/Upload';
|
|
34
46
|
export * from './ui/fields/Crop';
|
|
35
47
|
export * from './ui/fields/UploadCSV';
|
|
36
|
-
export * from './ui/fields/
|
|
37
|
-
export
|
|
48
|
+
export * from './ui/fields/ImageField';
|
|
49
|
+
export * from './ui/fields/RichText';
|
|
50
|
+
export * from './ui/fields/CodeEditor';
|
|
51
|
+
export * from './ui/fields/ContextMenu';
|
|
38
52
|
export { default as Menu } from './blocks/Menu';
|
|
39
|
-
export { default as
|
|
40
|
-
export type {
|
|
53
|
+
export { default as ListCard } from './blocks/ListCard';
|
|
54
|
+
export type { ListCardProps } from './blocks/ListCard';
|
|
55
|
+
export { default as SideNav } from './blocks/SideNav';
|
|
56
|
+
export type { SideNavProps, SideNavItemDef } from './blocks/SideNav';
|
|
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
|
+
export { FormControllerContext, useFormActions, useFormController } from './widgets/form-controller';
|
|
60
|
+
export type { FormActionEvent, FormController, FormControllerActions, FormControllerState, FormDraftStatus } from './widgets/form-controller';
|
|
41
61
|
export { default as Grid } from './widgets/Grid';
|
|
42
62
|
export { GridArray, GridCore, GridDB, GridGalleryView, GridTableView } from './widgets/grid-core';
|
|
43
63
|
export type { GridAction, GridActions, GridAfterActionArgs, GridAfterActionHandler, GridArrayProps, GridColumn, GridCoreProps, GridDBQuery, GridDBProps, GridFooterContext, GridFormContext, GridGalleryViewProps, GridHeaderContext, GridLayout, GridMutationDeleteArgs, GridMutationDeleteHandler, GridMutationSaveArgs, GridMutationSaveHandler, GridReorderHandler, GridReorderMeta, GridRecordKey, GridProps, GridSelectionChangeHandler, GridSelectionMode, GridSelectionState, GridSticky, GridTableViewProps, } from './widgets/Grid';
|
|
@@ -48,5 +68,6 @@ export * from './widgets/Prompt';
|
|
|
48
68
|
export { default as TabDynamic } from './widgets/TabDynamic';
|
|
49
69
|
export { default as Component } from './Component';
|
|
50
70
|
export { ComponentBlock } from './Component';
|
|
51
|
-
export
|
|
71
|
+
export type { FieldAdapter, FieldFactory, ModelProps, FormTree } from './Component';
|
|
72
|
+
export type { ComponentFormSchemaMap } from '../types/FormSchema';
|
|
52
73
|
export type { ModalDeleteHandler, ModalSaveHandler } from './ui/Modal';
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { MotionReference } from '../motion';
|
|
3
|
+
/** Slot and class props shared by every UI component. */
|
|
3
4
|
export interface UIProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/** Content rendered immediately before the component's root element. */
|
|
6
|
+
before?: React.ReactNode;
|
|
7
|
+
/** Content rendered immediately after the component's root element. */
|
|
8
|
+
after?: React.ReactNode;
|
|
9
|
+
/** CSS classes applied to the outermost wrapper element. */
|
|
10
|
+
wrapperClassName?: string;
|
|
11
|
+
/** CSS classes applied to the component's primary element. */
|
|
7
12
|
className?: string;
|
|
8
13
|
}
|
|
14
|
+
/** UIProps extended with an optional motion animation reference. */
|
|
9
15
|
export interface MotionUIProps extends UIProps {
|
|
16
|
+
/** Named motion preset or inline MotionProps override. */
|
|
10
17
|
motion?: MotionReference;
|
|
11
18
|
}
|
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UIProps } from '../..';
|
|
3
|
-
type AlertProps = {
|
|
3
|
+
export type AlertProps = {
|
|
4
4
|
children: string | React.ReactNode;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/** Semantic color variant. */
|
|
6
|
+
variant?: "info" | "success" | "warning" | "danger" | "primary" | "secondary" | "light" | "dark";
|
|
7
|
+
/** Visual shell:
|
|
8
|
+
* - `"default"` - full alert box with background and border (default)
|
|
9
|
+
* - `"text"` - no background, no border, width fits content; ideal for inline status indicators
|
|
10
|
+
*/
|
|
11
|
+
appearance?: "default" | "text";
|
|
12
|
+
/** Rendering mode:
|
|
13
|
+
* - `"inline"` (default) - renders where declared, normal document flow
|
|
14
|
+
* - `"fixed"` - portal to document.body, viewport-fixed above all other content
|
|
15
|
+
* - `"sticky"` - portal prepended to `anchorRef`, sticky at the top of that container
|
|
16
|
+
*/
|
|
17
|
+
placement?: "inline" | "fixed" | "sticky";
|
|
18
|
+
/** Required when placement="sticky": the scrollable container to anchor to. */
|
|
19
|
+
anchorRef?: React.RefObject<HTMLElement>;
|
|
20
|
+
/** Auto-dismiss timeout in ms. */
|
|
7
21
|
timeout?: number;
|
|
22
|
+
/** Called when the alert is dismissed. */
|
|
8
23
|
onClose?: () => void;
|
|
24
|
+
/** Icon name, or `true` to show the default variant icon, or `false` to hide. */
|
|
9
25
|
icon?: string | boolean;
|
|
10
26
|
className?: string;
|
|
11
27
|
} & UIProps;
|
|
12
|
-
declare const Alert: ({ children,
|
|
28
|
+
declare const Alert: ({ children, variant, appearance, placement, anchorRef, timeout, onClose, icon, before, after, wrapperClassName, className }: AlertProps) => React.JSX.Element | null;
|
|
13
29
|
export default Alert;
|