@llmnative/react 1.0.0 → 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 +10 -0
- package/dist/index.css +1 -1
- package/dist/index.js +19 -19
- package/dist/index.mjs +6926 -6237
- package/dist/style.css +1 -1
- package/dist/types/src/App.d.ts +4 -1
- package/dist/types/src/I18n.d.ts +1 -0
- package/dist/types/src/components/blocks/Brand.d.ts +5 -0
- package/dist/types/src/components/blocks/Carousel.d.ts +2 -0
- package/dist/types/src/components/blocks/Dropdown.d.ts +12 -0
- package/dist/types/src/components/blocks/ListCard.d.ts +7 -0
- package/dist/types/src/components/blocks/Menu.d.ts +2 -0
- package/dist/types/src/components/blocks/Notifications.d.ts +4 -1
- package/dist/types/src/components/blocks/ProviderSwitcher.d.ts +3 -1
- package/dist/types/src/components/blocks/Search.d.ts +1 -0
- package/dist/types/src/components/blocks/ThemeSwitcher.d.ts +6 -2
- package/dist/types/src/components/blocks/Toolbar.d.ts +4 -0
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/ui/Alert.d.ts +4 -0
- package/dist/types/src/components/ui/Badge.d.ts +6 -0
- package/dist/types/src/components/ui/Buttons.d.ts +5 -2
- package/dist/types/src/components/ui/Card.d.ts +3 -0
- package/dist/types/src/components/ui/Code.d.ts +4 -0
- package/dist/types/src/components/ui/Gallery.d.ts +3 -2
- package/dist/types/src/components/ui/GridSystem.d.ts +4 -1
- package/dist/types/src/components/ui/Icon.d.ts +3 -0
- package/dist/types/src/components/ui/Image.d.ts +6 -0
- package/dist/types/src/components/ui/ImageAvatar.d.ts +3 -0
- package/dist/types/src/components/ui/Loader.d.ts +2 -0
- package/dist/types/src/components/ui/Modal.d.ts +4 -0
- package/dist/types/src/components/ui/Pagination.d.ts +2 -0
- package/dist/types/src/components/ui/Percentage.d.ts +9 -0
- package/dist/types/src/components/ui/Repeat.d.ts +0 -1
- package/dist/types/src/components/ui/Table.d.ts +3 -0
- package/dist/types/src/components/ui/fields/CodeEditor.d.ts +3 -0
- package/dist/types/src/components/ui/fields/ContextMenu.d.ts +50 -1
- package/dist/types/src/components/ui/fields/RichText.d.ts +4 -1
- package/dist/types/src/components/ui/fields/Select.d.ts +2 -2
- package/dist/types/src/components/ui/fields/Upload.d.ts +16 -3
- package/dist/types/src/components/widgets/Prompt.d.ts +35 -15
- package/dist/types/src/index.d.ts +14 -4
- package/dist/types/src/providers/ProviderDescriptor.d.ts +18 -0
- package/dist/types/src/providers/ai/index.d.ts +12 -1
- package/dist/types/src/providers/ai/openaiCompatible.d.ts +3 -1
- package/dist/types/src/providers/ai/shared.d.ts +10 -1
- package/dist/types/src/providers/auth/AuthProvider.d.ts +8 -0
- package/dist/types/src/providers/auth/firebase/FirebaseAuthProvider.d.ts +23 -0
- package/dist/types/src/providers/data/firestore.d.ts +8 -1
- package/dist/types/src/providers/email/definitions.d.ts +3 -0
- package/dist/types/src/providers/firebase-init.d.ts +11 -5
- 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/storage/firebase.d.ts +7 -1
- package/package.json +14 -7
package/dist/types/src/I18n.d.ts
CHANGED
|
@@ -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,6 +1,7 @@
|
|
|
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;
|
|
@@ -8,16 +9,24 @@ interface DropdownTogglerProps {
|
|
|
8
9
|
}
|
|
9
10
|
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;
|
|
@@ -28,6 +37,7 @@ interface DropdownProps extends MotionUIProps {
|
|
|
28
37
|
interface DropdownButtonProps extends Pick<MotionUIProps, 'motion'> {
|
|
29
38
|
children: React.ReactNode;
|
|
30
39
|
badge?: BadgeProps;
|
|
40
|
+
/** `"static"` — always visible; `"dynamic"` — shows/hides with the menu. */
|
|
31
41
|
display?: "static" | "dynamic";
|
|
32
42
|
className?: string;
|
|
33
43
|
badgeClassName?: string;
|
|
@@ -38,10 +48,12 @@ interface DropdownButtonProps extends Pick<MotionUIProps, 'motion'> {
|
|
|
38
48
|
buttonRef?: React.RefObject<HTMLButtonElement>;
|
|
39
49
|
}
|
|
40
50
|
interface DropdownItemProps {
|
|
51
|
+
/** Link URL. When set, renders as `<a>`, otherwise as `<button>`. */
|
|
41
52
|
url?: string;
|
|
42
53
|
onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
|
|
43
54
|
className?: string;
|
|
44
55
|
children: React.ReactNode;
|
|
56
|
+
/** Leading icon name. */
|
|
45
57
|
icon?: string;
|
|
46
58
|
}
|
|
47
59
|
interface DropdownHeaderProps {
|
|
@@ -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,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
|
|
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)
|
|
@@ -16,8 +17,11 @@ export type AlertProps = {
|
|
|
16
17
|
placement?: "inline" | "fixed" | "sticky";
|
|
17
18
|
/** Required when placement="sticky": the scrollable container to anchor to. */
|
|
18
19
|
anchorRef?: React.RefObject<HTMLElement>;
|
|
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;
|
|
@@ -33,13 +33,14 @@ export interface GalleryProps extends UIProps {
|
|
|
33
33
|
records?: GalleryRecord[];
|
|
34
34
|
header?: string | React.ReactNode;
|
|
35
35
|
footer?: string | React.ReactNode;
|
|
36
|
+
/** Overlay badges rendered on each gallery item. */
|
|
36
37
|
overlays?: GalleryOverlay[];
|
|
37
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
|
-
|
|
42
|
-
scrollBehavior?: ScrollBehavior;
|
|
43
|
+
/** Grid gap size (Tailwind spacing scale). */
|
|
43
44
|
gap?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
44
45
|
columns?: 1 | 2 | 3 | 4 | 6;
|
|
45
46
|
groupBy?: string | string[];
|
|
@@ -5,7 +5,10 @@ type ContainerProps = {
|
|
|
5
5
|
style?: CSSProperties;
|
|
6
6
|
onClick?: () => void;
|
|
7
7
|
};
|
|
8
|
-
type ColProps =
|
|
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,8 +1,10 @@
|
|
|
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;
|
|
@@ -48,13 +48,17 @@ export interface ModalProps extends MotionUIProps {
|
|
|
48
48
|
*/
|
|
49
49
|
stackedBehind?: boolean;
|
|
50
50
|
}
|
|
51
|
+
/** Props for a confirm/deny modal dialog with Yes/No buttons. */
|
|
51
52
|
export interface ModalYesNoProps {
|
|
52
53
|
title?: React.ReactNode;
|
|
53
54
|
children: React.ReactNode;
|
|
55
|
+
/** Async handler for the Yes button. Return `true` to close. */
|
|
54
56
|
onYes?: (e: React.MouseEvent<HTMLElement>) => Promise<boolean>;
|
|
57
|
+
/** Async handler for the No button. Return `true` to close. */
|
|
55
58
|
onNo?: (e: React.MouseEvent<HTMLElement>) => Promise<boolean>;
|
|
56
59
|
onClose?: () => void;
|
|
57
60
|
}
|
|
61
|
+
/** Props for a simple acknowledgment modal with an OK button. */
|
|
58
62
|
export interface ModalOkProps {
|
|
59
63
|
children: React.ReactNode;
|
|
60
64
|
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;
|
|
@@ -26,7 +26,9 @@ export interface TableProps extends UIProps {
|
|
|
26
26
|
onRowClick?: (record: RecordProps) => void;
|
|
27
27
|
onReorder?: TableReorderHandler;
|
|
28
28
|
onSelectionChange?: TableSelectionChangeHandler;
|
|
29
|
+
/** Selection mode: `"single"` or `"multiple"`. */
|
|
29
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;
|
|
@@ -38,6 +40,7 @@ export interface TableProps extends UIProps {
|
|
|
38
40
|
heightClassName?: string;
|
|
39
41
|
scrollClassName?: string;
|
|
40
42
|
selectedClassName?: string;
|
|
43
|
+
/** Custom cell renderer. Receives the record, column key, and absolute row index. */
|
|
41
44
|
renderCell?: (record: RecordProps, key: string, absoluteIndex: number) => React.ReactNode;
|
|
42
45
|
}
|
|
43
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;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormFieldProps } from '../../widgets/Form';
|
|
3
3
|
import type { FieldValue } from '../../../providers/data/DataProvider';
|
|
4
|
+
import { type EditorCommand } from './ContextMenu';
|
|
4
5
|
export type CodeEditorLanguage = 'liquid' | 'html' | 'json' | 'js' | 'ts' | 'css';
|
|
5
6
|
export interface CodeSyntaxErrorDetails {
|
|
6
7
|
language: CodeEditorLanguage;
|
|
@@ -38,6 +39,8 @@ export interface CodeEditorProps extends FormFieldProps {
|
|
|
38
39
|
validateSyntax?: boolean;
|
|
39
40
|
validator?: (value: FieldValue) => string | undefined | Promise<string | undefined>;
|
|
40
41
|
extensions?: unknown[];
|
|
42
|
+
commands?: EditorCommand[];
|
|
43
|
+
commandsTrigger?: string;
|
|
41
44
|
}
|
|
42
45
|
export declare const CodeEditor: React.FC<CodeEditorProps>;
|
|
43
46
|
export default CodeEditor;
|
|
@@ -6,14 +6,52 @@ export interface ContextMenuItem {
|
|
|
6
6
|
icon?: string;
|
|
7
7
|
}
|
|
8
8
|
export interface EditorContext {
|
|
9
|
+
value: string;
|
|
9
10
|
textBeforeCaret: string;
|
|
10
11
|
textAfterCaret: string;
|
|
12
|
+
trigger: string;
|
|
13
|
+
query: string;
|
|
14
|
+
triggerRange: {
|
|
15
|
+
start: number;
|
|
16
|
+
end: number;
|
|
17
|
+
};
|
|
11
18
|
insert: (text: string) => void;
|
|
12
19
|
replace: (start: number, end: number, text: string) => void;
|
|
13
20
|
}
|
|
21
|
+
export interface TextCommandContext {
|
|
22
|
+
value: string;
|
|
23
|
+
textBeforeCaret: string;
|
|
24
|
+
textAfterCaret: string;
|
|
25
|
+
trigger: string;
|
|
26
|
+
query: string;
|
|
27
|
+
}
|
|
28
|
+
export interface EditorCommand {
|
|
29
|
+
name: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
icon?: string;
|
|
32
|
+
handler?: (context: TextCommandContext) => string | Promise<string>;
|
|
33
|
+
}
|
|
34
|
+
export interface ContextMenuControlledState {
|
|
35
|
+
open: boolean;
|
|
36
|
+
anchorPosition: {
|
|
37
|
+
top: number;
|
|
38
|
+
left: number;
|
|
39
|
+
} | null;
|
|
40
|
+
query: string;
|
|
41
|
+
editorContext: EditorContext;
|
|
42
|
+
onClose: () => void;
|
|
43
|
+
}
|
|
44
|
+
export interface ContextMenuHandle {
|
|
45
|
+
moveNext: () => void;
|
|
46
|
+
movePrev: () => void;
|
|
47
|
+
selectActive: () => void;
|
|
48
|
+
close: () => void;
|
|
49
|
+
}
|
|
50
|
+
export declare const CONTEXT_MENU_SEARCH_THRESHOLD = 10;
|
|
14
51
|
interface ContextMenuProps extends UIProps {
|
|
15
52
|
trigger: string;
|
|
16
53
|
searchable?: boolean;
|
|
54
|
+
controlled?: ContextMenuControlledState;
|
|
17
55
|
onSelect?: (item: ContextMenuItem, context: EditorContext) => void;
|
|
18
56
|
children: React.ReactNode;
|
|
19
57
|
}
|
|
@@ -29,10 +67,21 @@ interface ContextMenuHeadingProps {
|
|
|
29
67
|
interface ContextMenuSeparatorProps {
|
|
30
68
|
className?: string;
|
|
31
69
|
}
|
|
32
|
-
type ContextMenuComponent = React.
|
|
70
|
+
type ContextMenuComponent = React.ForwardRefExoticComponent<ContextMenuProps & React.RefAttributes<ContextMenuHandle>> & {
|
|
33
71
|
Item: React.FC<ContextMenuItemProps>;
|
|
34
72
|
Heading: React.FC<ContextMenuHeadingProps>;
|
|
35
73
|
Separator: React.FC<ContextMenuSeparatorProps>;
|
|
36
74
|
};
|
|
75
|
+
type QueryMatch = {
|
|
76
|
+
query: string;
|
|
77
|
+
start: number;
|
|
78
|
+
end: number;
|
|
79
|
+
};
|
|
80
|
+
type CommandTriggerMatchOptions = {
|
|
81
|
+
queryPattern?: RegExp;
|
|
82
|
+
requireWhitespacePrefix?: boolean;
|
|
83
|
+
};
|
|
84
|
+
export declare const matchCommandTrigger: (value: string, caret: number, trigger: string, options?: CommandTriggerMatchOptions) => QueryMatch | null;
|
|
85
|
+
export declare const buildTextCommandContext: (context: EditorContext) => TextCommandContext;
|
|
37
86
|
declare const ContextMenu: ContextMenuComponent;
|
|
38
87
|
export { ContextMenu };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormFieldProps } from '../../widgets/Form';
|
|
3
3
|
import type { FieldValue } from '../../../providers/data/DataProvider';
|
|
4
|
+
import { type EditorCommand } from './ContextMenu';
|
|
4
5
|
export type ToolbarCommand = 'bold' | 'italic' | 'underline' | 'strike' | 'headings' | 'heading1' | 'heading2' | 'heading3' | 'bulletList' | 'orderedList' | 'blockquote' | 'code' | 'codeBlock' | 'link' | 'table' | 'imageUpload' | 'documentUpload' | 'sourceCode' | 'undo' | 'redo' | 'clearFormat' | '|';
|
|
5
6
|
export interface StatusBarConfig {
|
|
6
7
|
/** Show the DOM ancestor tag breadcrumb at the cursor (e.g. p › strong). Default: true. */
|
|
@@ -81,6 +82,8 @@ export interface RichTextProps extends FormFieldProps {
|
|
|
81
82
|
documentUpload?: RichTextDocumentUploadConfig;
|
|
82
83
|
labelClassName?: string;
|
|
83
84
|
validator?: (value: FieldValue) => string | undefined;
|
|
85
|
+
commands?: EditorCommand[];
|
|
86
|
+
commandsTrigger?: string;
|
|
84
87
|
}
|
|
85
|
-
export declare const RichText: ({ name, onChange, defaultValue, label, required, placeholder, disabled, feedback, toolbar, toolbarCommands, outputFormat, statusBar, minHeight, maxHeight, imageUpload, documentUpload, labelClassName, inheritWrapperClassName, wrapperClassName, className, before, after, validator, }: RichTextProps) => React.JSX.Element;
|
|
88
|
+
export declare const RichText: ({ name, onChange, defaultValue, label, required, placeholder, disabled, feedback, toolbar, toolbarCommands, outputFormat, statusBar, minHeight, maxHeight, imageUpload, documentUpload, labelClassName, inheritWrapperClassName, wrapperClassName, className, before, after, validator, commands, commandsTrigger, }: RichTextProps) => React.JSX.Element;
|
|
86
89
|
export default RichText;
|
|
@@ -36,6 +36,6 @@ export interface ChecklistProps extends BaseProps {
|
|
|
36
36
|
itemClassName?: string;
|
|
37
37
|
}
|
|
38
38
|
export declare const Select: ({ name, onChange, defaultValue, required, readOnlyAfterSet, disabled, placeholderOption, label, title, before, after, feedback, options, optionsSource, order, inheritWrapperClassName, wrapperClassName, className, validator, }: SelectProps) => React.JSX.Element;
|
|
39
|
-
export declare const Autocomplete: ({ name, defaultValue, minItems, maxItems, onChange, required, readOnlyAfterSet, disabled, label, title, placeholder, before, after, feedback, options, optionsSource, order, inheritWrapperClassName, wrapperClassName, className, creatable, onCreate, }: AutocompleteProps) => React.JSX.Element;
|
|
40
|
-
export declare const Checklist: ({ name, defaultValue, onChange, required, readOnlyAfterSet, disabled, label, title, before, after, feedback, options, optionsSource, order, inheritWrapperClassName, wrapperClassName, className, itemClassName, }: ChecklistProps) => React.JSX.Element;
|
|
39
|
+
export declare const Autocomplete: ({ name, defaultValue, minItems, maxItems, onChange, required, readOnlyAfterSet, disabled, label, title, placeholder, before, after, feedback, options, optionsSource, order, inheritWrapperClassName, wrapperClassName, className, validator, creatable, onCreate, }: AutocompleteProps) => React.JSX.Element;
|
|
40
|
+
export declare const Checklist: ({ name, defaultValue, onChange, required, readOnlyAfterSet, disabled, label, title, before, after, feedback, options, optionsSource, order, inheritWrapperClassName, wrapperClassName, className, validator, itemClassName, }: ChecklistProps) => React.JSX.Element;
|
|
41
41
|
export {};
|