@lettuceai/crisp 1.0.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/LICENSE +21 -0
- package/README.md +130 -0
- package/dist/components/Accordion.d.ts +15 -0
- package/dist/components/ActionBar.d.ts +25 -0
- package/dist/components/Alert.d.ts +19 -0
- package/dist/components/AppBar.d.ts +29 -0
- package/dist/components/AppShell.d.ts +42 -0
- package/dist/components/AudioItem.d.ts +22 -0
- package/dist/components/Avatar.d.ts +11 -0
- package/dist/components/AvatarGroup.d.ts +17 -0
- package/dist/components/AvatarPicker.d.ts +20 -0
- package/dist/components/Badge.d.ts +8 -0
- package/dist/components/Banner.d.ts +17 -0
- package/dist/components/Breadcrumb.d.ts +23 -0
- package/dist/components/Button.d.ts +15 -0
- package/dist/components/ButtonGroup.d.ts +21 -0
- package/dist/components/Card.d.ts +16 -0
- package/dist/components/Carousel.d.ts +16 -0
- package/dist/components/CharacterCard.d.ts +30 -0
- package/dist/components/Chart.d.ts +35 -0
- package/dist/components/Checkbox.d.ts +11 -0
- package/dist/components/Chip.d.ts +11 -0
- package/dist/components/ChoiceCard.d.ts +22 -0
- package/dist/components/CodeBlock.d.ts +16 -0
- package/dist/components/Collapsible.d.ts +20 -0
- package/dist/components/ColorPicker.d.ts +15 -0
- package/dist/components/Combobox.d.ts +30 -0
- package/dist/components/CommandPalette.d.ts +34 -0
- package/dist/components/Composer.d.ts +49 -0
- package/dist/components/ContextMenu.d.ts +18 -0
- package/dist/components/CopyButton.d.ts +13 -0
- package/dist/components/DatePicker.d.ts +23 -0
- package/dist/components/Dialog.d.ts +15 -0
- package/dist/components/Diff.d.ts +17 -0
- package/dist/components/Dock.d.ts +6 -0
- package/dist/components/DownloadItem.d.ts +28 -0
- package/dist/components/Dropzone.d.ts +21 -0
- package/dist/components/EmptyState.d.ts +24 -0
- package/dist/components/Field.d.ts +20 -0
- package/dist/components/FilterBar.d.ts +21 -0
- package/dist/components/Form.d.ts +44 -0
- package/dist/components/Highlight.d.ts +14 -0
- package/dist/components/HoverCard.d.ts +15 -0
- package/dist/components/Icon.d.ts +37 -0
- package/dist/components/IconButton.d.ts +14 -0
- package/dist/components/ImageViewer.d.ts +16 -0
- package/dist/components/InfiniteScroll.d.ts +14 -0
- package/dist/components/Input.d.ts +14 -0
- package/dist/components/Kbd.d.ts +5 -0
- package/dist/components/List.d.ts +25 -0
- package/dist/components/Masonry.d.ts +16 -0
- package/dist/components/MediaCard.d.ts +23 -0
- package/dist/components/MediaTile.d.ts +21 -0
- package/dist/components/Menu.d.ts +34 -0
- package/dist/components/Message.d.ts +76 -0
- package/dist/components/Meter.d.ts +20 -0
- package/dist/components/ModelSelect.d.ts +35 -0
- package/dist/components/MultiItemDownloadCard.d.ts +39 -0
- package/dist/components/NavRail.d.ts +37 -0
- package/dist/components/NumberInput.d.ts +19 -0
- package/dist/components/Page.d.ts +18 -0
- package/dist/components/Pagination.d.ts +10 -0
- package/dist/components/Panel.d.ts +18 -0
- package/dist/components/PartitionBar.d.ts +39 -0
- package/dist/components/Popover.d.ts +45 -0
- package/dist/components/Progress.d.ts +9 -0
- package/dist/components/Prose.d.ts +13 -0
- package/dist/components/Radio.d.ts +19 -0
- package/dist/components/ReorderableList.d.ts +21 -0
- package/dist/components/Resizable.d.ts +20 -0
- package/dist/components/ScrollArea.d.ts +17 -0
- package/dist/components/SearchField.d.ts +14 -0
- package/dist/components/SecretInput.d.ts +26 -0
- package/dist/components/Segmented.d.ts +16 -0
- package/dist/components/Select.d.ts +15 -0
- package/dist/components/SelectMenu.d.ts +48 -0
- package/dist/components/Sheet.d.ts +50 -0
- package/dist/components/Shelf.d.ts +17 -0
- package/dist/components/Skeleton.d.ts +12 -0
- package/dist/components/Slider.d.ts +11 -0
- package/dist/components/Spinner.d.ts +13 -0
- package/dist/components/StatTile.d.ts +33 -0
- package/dist/components/Stepper.d.ts +21 -0
- package/dist/components/Surface.d.ts +56 -0
- package/dist/components/Switch.d.ts +9 -0
- package/dist/components/TabBar.d.ts +12 -0
- package/dist/components/Table.d.ts +35 -0
- package/dist/components/Tabs.d.ts +31 -0
- package/dist/components/TagInput.d.ts +18 -0
- package/dist/components/Text.d.ts +293 -0
- package/dist/components/ThemeEditor.d.ts +8 -0
- package/dist/components/Timeline.d.ts +17 -0
- package/dist/components/TitleBar.d.ts +17 -0
- package/dist/components/Toast.d.ts +50 -0
- package/dist/components/ToggleGroup.d.ts +22 -0
- package/dist/components/Toolbar.d.ts +18 -0
- package/dist/components/Tooltip.d.ts +15 -0
- package/dist/components/Tour.d.ts +22 -0
- package/dist/components/Tree.d.ts +21 -0
- package/dist/components/VirtualList.d.ts +18 -0
- package/dist/components/WindowControls.d.ts +38 -0
- package/dist/components/Wizard.d.ts +33 -0
- package/dist/components/confirm.d.ts +24 -0
- package/dist/components/index.d.ts +103 -0
- package/dist/components/nav.d.ts +19 -0
- package/dist/components/primitives.d.ts +14 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +8035 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/Box.d.ts +6 -0
- package/dist/layout/Center.d.ts +2 -0
- package/dist/layout/Container.d.ts +8 -0
- package/dist/layout/Divider.d.ts +9 -0
- package/dist/layout/Flex.d.ts +16 -0
- package/dist/layout/Grid.d.ts +13 -0
- package/dist/layout/Spacer.d.ts +4 -0
- package/dist/layout/Stack.d.ts +13 -0
- package/dist/layout/index.d.ts +8 -0
- package/dist/lib/cn.d.ts +2 -0
- package/dist/lib/color.d.ts +16 -0
- package/dist/lib/format.d.ts +6 -0
- package/dist/lib/frame.d.ts +25 -0
- package/dist/lib/icon.d.ts +24 -0
- package/dist/lib/imageBrightness.d.ts +8 -0
- package/dist/lib/motion.d.ts +54 -0
- package/dist/lib/polymorphic.d.ts +12 -0
- package/dist/lib/tint.d.ts +9 -0
- package/dist/lib/useLongPress.d.ts +19 -0
- package/dist/lib/useMediaQuery.d.ts +8 -0
- package/dist/lib/useModal.d.ts +8 -0
- package/dist/theme/ThemeProvider.d.ts +19 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/theme.d.ts +36 -0
- package/package.json +81 -0
- package/src/styles.css +392 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type TimelineTone = "neutral" | "accent" | "info" | "warning" | "danger" | "secondary";
|
|
3
|
+
export interface TimelineItem {
|
|
4
|
+
id: string;
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
time?: ReactNode;
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
tone?: TimelineTone;
|
|
10
|
+
/** Still happening — the marker pulses. */
|
|
11
|
+
active?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** An ordered sequence of events: memory updates, sync stages, a generation's history. */
|
|
14
|
+
export declare function Timeline({ items, className }: {
|
|
15
|
+
items: readonly TimelineItem[];
|
|
16
|
+
className?: string;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface TitleBarProps {
|
|
3
|
+
title?: ReactNode;
|
|
4
|
+
/** macOS puts the traffic lights on the left and we leave room; Windows/Linux draw ours on the right. */
|
|
5
|
+
platform?: "macos" | "windows" | "linux";
|
|
6
|
+
onMinimize?: () => void;
|
|
7
|
+
onMaximize?: () => void;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
/** Slot in the drag region — a back button, a status chip. */
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Desktop window chrome. The whole bar is a drag region except the buttons,
|
|
15
|
+
* which opt out with `data-tauri-drag-region="false"`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function TitleBar({ title, platform, onMinimize, onMaximize, onClose, children, className }: TitleBarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Toasts are sonner underneath, rendered `unstyled` with our own body so they
|
|
4
|
+
* follow the tokens and the four text tiers.
|
|
5
|
+
*
|
|
6
|
+
* The call signature matches the app's existing `toast.*` helpers, so call sites
|
|
7
|
+
* migrate without edits. Tone naming follows the event (`error`), while Alert —
|
|
8
|
+
* which paints a colour — follows the token (`danger`).
|
|
9
|
+
*/
|
|
10
|
+
export type ToastTone = "info" | "success" | "warning" | "error";
|
|
11
|
+
export interface ToastAction {
|
|
12
|
+
label: string;
|
|
13
|
+
onClick: () => void;
|
|
14
|
+
}
|
|
15
|
+
export interface ToastOptions {
|
|
16
|
+
/** Sits under the text, never beside it. */
|
|
17
|
+
action?: ToastAction;
|
|
18
|
+
secondary?: ToastAction;
|
|
19
|
+
/** ms, or Infinity to keep it until dismissed. Default 5000. */
|
|
20
|
+
duration?: number;
|
|
21
|
+
/** Pass a stable id to update a toast in place instead of stacking a new one. */
|
|
22
|
+
id?: string | number;
|
|
23
|
+
}
|
|
24
|
+
export interface ProgressToastOptions {
|
|
25
|
+
id: string | number;
|
|
26
|
+
title: ReactNode;
|
|
27
|
+
description?: ReactNode;
|
|
28
|
+
/** 0–1. Omit for an indeterminate spinner. */
|
|
29
|
+
progress?: number;
|
|
30
|
+
duration?: number;
|
|
31
|
+
}
|
|
32
|
+
/** Long-running work that reports progress — model downloads, indexing. */
|
|
33
|
+
declare function progressToast({ id, title, description, progress, duration }: ProgressToastOptions): string | number;
|
|
34
|
+
export declare const toast: {
|
|
35
|
+
info: (title: ReactNode, description?: ReactNode, options?: ToastOptions) => string | number;
|
|
36
|
+
success: (title: ReactNode, description?: ReactNode, options?: ToastOptions) => string | number;
|
|
37
|
+
warning: (title: ReactNode, description?: ReactNode, options?: ToastOptions) => string | number;
|
|
38
|
+
error: (title: ReactNode, description?: ReactNode, options?: ToastOptions) => string | number;
|
|
39
|
+
progress: typeof progressToast;
|
|
40
|
+
dismiss: (id?: string | number) => string | number;
|
|
41
|
+
isVisible: (id: string | number) => boolean;
|
|
42
|
+
};
|
|
43
|
+
export interface ToasterProps {
|
|
44
|
+
position?: "top-center" | "bottom-center" | "top-right" | "bottom-right";
|
|
45
|
+
/** Extra bottom offset on phones — clear the TabBar. */
|
|
46
|
+
bottomInset?: number;
|
|
47
|
+
}
|
|
48
|
+
/** Mount once, at the app root. */
|
|
49
|
+
export declare function Toaster({ position, bottomInset }?: ToasterProps): import("react").JSX.Element;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface ToggleOption<T extends string> {
|
|
3
|
+
value: T;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ToggleGroupProps<T extends string> {
|
|
9
|
+
options: readonly ToggleOption<T>[];
|
|
10
|
+
value: readonly T[];
|
|
11
|
+
onChange: (value: T[]) => void;
|
|
12
|
+
/** Require at least one selection. */
|
|
13
|
+
min?: number;
|
|
14
|
+
size?: "sm" | "md";
|
|
15
|
+
"aria-label": string;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Multi-select toggles. Segmented picks exactly one; this picks any number —
|
|
20
|
+
* text formatting, which sources a filter includes, which providers to query.
|
|
21
|
+
*/
|
|
22
|
+
export declare function ToggleGroup<T extends string>({ options, value, onChange, min, size, className, ...aria }: ToggleGroupProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface ToolbarProps {
|
|
3
|
+
"aria-label": string;
|
|
4
|
+
/** `bar` sits flush in a layout; `floating` is a rounded pill over content. */
|
|
5
|
+
variant?: "bar" | "floating";
|
|
6
|
+
className?: string;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A row of icon buttons with dividers. Arrow keys move between the controls, so the
|
|
11
|
+
* whole group is one tab stop instead of nine.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Toolbar({ variant, className, children, ...aria }: ToolbarProps): import("react").JSX.Element;
|
|
14
|
+
export declare function ToolbarSeparator(): import("react").JSX.Element;
|
|
15
|
+
export declare function ToolbarGroup({ children, className }: {
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
export interface TooltipProps {
|
|
3
|
+
content: ReactNode;
|
|
4
|
+
placement?: "top" | "bottom" | "left" | "right";
|
|
5
|
+
/** ms before it shows on hover. */
|
|
6
|
+
delay?: number;
|
|
7
|
+
/** Keep it from opening — for a label that is already on screen. The wrapper stays,
|
|
8
|
+
so the trigger is not remounted when this flips. */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Classes for the wrapper, which is an inline-flex span by default. */
|
|
11
|
+
className?: string;
|
|
12
|
+
children: ReactElement<Record<string, unknown>>;
|
|
13
|
+
}
|
|
14
|
+
/** Hover / focus hint. Never the only place a label lives — icon buttons still need `label`. */
|
|
15
|
+
export declare function Tooltip({ content, placement, delay, disabled, className, children }: TooltipProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface TourStep {
|
|
3
|
+
/** CSS selector for the element to highlight. Omit for a centred, anchorless step. */
|
|
4
|
+
target?: string;
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
body: ReactNode;
|
|
7
|
+
/** Preferred side; it flips when there isn't room. */
|
|
8
|
+
side?: "top" | "bottom";
|
|
9
|
+
}
|
|
10
|
+
export interface TourProps {
|
|
11
|
+
steps: readonly TourStep[];
|
|
12
|
+
open: boolean;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
onFinish?: () => void;
|
|
15
|
+
finishLabel?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Coach marks over the real interface: a cut-out spotlight on the target and a card
|
|
19
|
+
* beside it. Replaces a 1,000-line bespoke tour. It scrolls the target into view and
|
|
20
|
+
* traps Escape, so it can always be left.
|
|
21
|
+
*/
|
|
22
|
+
export declare function Tour({ steps, open, onClose, onFinish, finishLabel }: TourProps): import("react").ReactPortal | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface TreeNode {
|
|
3
|
+
id: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
/** Right-aligned slot — a count, a badge, a menu. */
|
|
7
|
+
trailing?: ReactNode;
|
|
8
|
+
children?: readonly TreeNode[];
|
|
9
|
+
}
|
|
10
|
+
export interface TreeProps {
|
|
11
|
+
nodes: readonly TreeNode[];
|
|
12
|
+
selectedId?: string;
|
|
13
|
+
onSelect?: (id: string) => void;
|
|
14
|
+
defaultExpanded?: readonly string[];
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A nested list you can collapse — the chat tree, lorebook entries by category,
|
|
19
|
+
* a file bundle. Rows are buttons, so the whole tree is keyboard-operable.
|
|
20
|
+
*/
|
|
21
|
+
export declare function Tree({ nodes, selectedId, onSelect, defaultExpanded, className }: TreeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface VirtualListProps<T> {
|
|
3
|
+
items: readonly T[];
|
|
4
|
+
/** Rendered per row. Keep it cheap — it runs on every scroll frame. */
|
|
5
|
+
children: (item: T, index: number) => ReactNode;
|
|
6
|
+
/** Estimated row height in px; exact values are measured after mount. */
|
|
7
|
+
estimateSize?: number;
|
|
8
|
+
overscan?: number;
|
|
9
|
+
/** Stable key per row, so React reuses the right nodes. */
|
|
10
|
+
itemKey?: (item: T, index: number) => string | number;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Renders only the rows in view. `@tanstack/react-virtual` is already a dependency but
|
|
15
|
+
* only two of the app's long-list screens use it — chat memories, logs and the model
|
|
16
|
+
* browser all mount every row.
|
|
17
|
+
*/
|
|
18
|
+
export declare function VirtualList<T>({ items, children, estimateSize, overscan, itemKey, className }: VirtualListProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare const HANDLES: readonly [{
|
|
2
|
+
readonly dir: "North";
|
|
3
|
+
readonly className: "left-2 right-2 top-0 h-1 cursor-n-resize";
|
|
4
|
+
}, {
|
|
5
|
+
readonly dir: "South";
|
|
6
|
+
readonly className: "left-2 right-2 bottom-0 h-1 cursor-s-resize";
|
|
7
|
+
}, {
|
|
8
|
+
readonly dir: "West";
|
|
9
|
+
readonly className: "top-2 bottom-2 left-0 w-1 cursor-w-resize";
|
|
10
|
+
}, {
|
|
11
|
+
readonly dir: "East";
|
|
12
|
+
readonly className: "top-2 bottom-2 right-0 w-1 cursor-e-resize";
|
|
13
|
+
}, {
|
|
14
|
+
readonly dir: "NorthWest";
|
|
15
|
+
readonly className: "left-0 top-0 h-2.5 w-2.5 cursor-nw-resize";
|
|
16
|
+
}, {
|
|
17
|
+
readonly dir: "NorthEast";
|
|
18
|
+
readonly className: "right-0 top-0 h-2.5 w-2.5 cursor-ne-resize";
|
|
19
|
+
}, {
|
|
20
|
+
readonly dir: "SouthWest";
|
|
21
|
+
readonly className: "bottom-0 left-0 h-2.5 w-2.5 cursor-sw-resize";
|
|
22
|
+
}, {
|
|
23
|
+
readonly dir: "SouthEast";
|
|
24
|
+
readonly className: "bottom-0 right-0 h-2.5 w-2.5 cursor-se-resize";
|
|
25
|
+
}];
|
|
26
|
+
export type ResizeDirection = (typeof HANDLES)[number]["dir"];
|
|
27
|
+
export interface WindowResizeHandlesProps {
|
|
28
|
+
/** Start a native window resize — wire to Tauri's `startResizeDragging(dir)`. */
|
|
29
|
+
onResizeStart: (direction: ResizeDirection) => void;
|
|
30
|
+
/** Hidden when the window can't be resized: maximised, full screen, or native chrome. */
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Invisible grab strips around a frameless desktop window. macOS keeps its own chrome,
|
|
35
|
+
* so this is for Windows and Linux when the app draws its own title bar.
|
|
36
|
+
*/
|
|
37
|
+
export declare function WindowResizeHandles({ onResizeStart, disabled }: WindowResizeHandlesProps): import("react").JSX.Element | null;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type Step } from "./Stepper";
|
|
3
|
+
export interface WizardState {
|
|
4
|
+
index: number;
|
|
5
|
+
step: Step;
|
|
6
|
+
first: boolean;
|
|
7
|
+
last: boolean;
|
|
8
|
+
next: () => void;
|
|
9
|
+
back: () => void;
|
|
10
|
+
goTo: (index: number) => void;
|
|
11
|
+
}
|
|
12
|
+
/** Where you are in a stepped flow, and the two moves. */
|
|
13
|
+
export declare function useWizard(steps: readonly Step[], initial?: number): WizardState;
|
|
14
|
+
export interface WizardProps {
|
|
15
|
+
steps: readonly Step[];
|
|
16
|
+
index: number;
|
|
17
|
+
/** Jump back to a completed step from the stepper. */
|
|
18
|
+
onStepClick?: (index: number) => void;
|
|
19
|
+
/** Shown above the step's content; a title and a lead for this step. */
|
|
20
|
+
title?: ReactNode;
|
|
21
|
+
description?: ReactNode;
|
|
22
|
+
/** The stepper: the labelled bar, the compact dots, or nothing. */
|
|
23
|
+
progress?: "bar" | "dots" | "none";
|
|
24
|
+
className?: string;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The frame around a multi-step flow: the stepper, the step's heading, and the step's
|
|
29
|
+
* content sliding in the direction of travel. Character creation, onboarding, the
|
|
30
|
+
* lorebook generator and the engine wizard each drew their own; this is the one.
|
|
31
|
+
* Pair with `useWizard` for the state and `ActionBar` for the buttons.
|
|
32
|
+
*/
|
|
33
|
+
export declare function Wizard({ steps, index, onStepClick, title, description, progress, className, children }: WizardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface ConfirmOptions {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
/** What actually happens, in plain terms. Say what is lost and whether it can be undone. */
|
|
5
|
+
message?: ReactNode;
|
|
6
|
+
/** Names the action, matching the button that opened it — "Delete chat", not "OK". */
|
|
7
|
+
confirmLabel?: string;
|
|
8
|
+
cancelLabel?: string;
|
|
9
|
+
/** Paints the confirm button as destructive. */
|
|
10
|
+
destructive?: boolean;
|
|
11
|
+
/** An extra consequence the person should read before confirming. */
|
|
12
|
+
warning?: {
|
|
13
|
+
title: ReactNode;
|
|
14
|
+
body: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* `await confirm({...})` from anywhere — no local open state, no dialog JSX at the
|
|
19
|
+
* call site. Resolves false when nothing is mounted, so a missing host can never
|
|
20
|
+
* silently confirm a destructive action.
|
|
21
|
+
*/
|
|
22
|
+
export declare function confirm(options: ConfirmOptions): Promise<boolean>;
|
|
23
|
+
/** Mount once, at the app root, next to <Toaster />. */
|
|
24
|
+
export declare function ConfirmHost(): import("react").JSX.Element;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export * from "./Accordion";
|
|
2
|
+
export * from "./Alert";
|
|
3
|
+
export * from "./AppBar";
|
|
4
|
+
export * from "./AppShell";
|
|
5
|
+
export * from "./AudioItem";
|
|
6
|
+
export * from "./Avatar";
|
|
7
|
+
export * from "./AvatarGroup";
|
|
8
|
+
export * from "./Badge";
|
|
9
|
+
export * from "./Banner";
|
|
10
|
+
export * from "./Breadcrumb";
|
|
11
|
+
export * from "./Button";
|
|
12
|
+
export * from "./ButtonGroup";
|
|
13
|
+
export * from "./Card";
|
|
14
|
+
export * from "./Carousel";
|
|
15
|
+
export * from "./CharacterCard";
|
|
16
|
+
export * from "./Chart";
|
|
17
|
+
export * from "./Checkbox";
|
|
18
|
+
export * from "./Chip";
|
|
19
|
+
export * from "./CodeBlock";
|
|
20
|
+
export * from "./Collapsible";
|
|
21
|
+
export * from "./ColorPicker";
|
|
22
|
+
export * from "./Combobox";
|
|
23
|
+
export * from "./CommandPalette";
|
|
24
|
+
export * from "./Composer";
|
|
25
|
+
export * from "./confirm";
|
|
26
|
+
export * from "./ContextMenu";
|
|
27
|
+
export * from "./CopyButton";
|
|
28
|
+
export * from "./DatePicker";
|
|
29
|
+
export * from "./Dialog";
|
|
30
|
+
export * from "./Diff";
|
|
31
|
+
export * from "./Dock";
|
|
32
|
+
export * from "./DownloadItem";
|
|
33
|
+
export * from "./Dropzone";
|
|
34
|
+
export * from "./EmptyState";
|
|
35
|
+
export * from "./Field";
|
|
36
|
+
export * from "./FilterBar";
|
|
37
|
+
export * from "./Form";
|
|
38
|
+
export * from "./Highlight";
|
|
39
|
+
export * from "./HoverCard";
|
|
40
|
+
export * from "./Icon";
|
|
41
|
+
export * from "./IconButton";
|
|
42
|
+
export * from "./ImageViewer";
|
|
43
|
+
export * from "./InfiniteScroll";
|
|
44
|
+
export * from "./Input";
|
|
45
|
+
export * from "./Kbd";
|
|
46
|
+
export * from "./List";
|
|
47
|
+
export * from "./Masonry";
|
|
48
|
+
export * from "./MediaCard";
|
|
49
|
+
export * from "./MediaTile";
|
|
50
|
+
export * from "./Menu";
|
|
51
|
+
export * from "./Message";
|
|
52
|
+
export * from "./Meter";
|
|
53
|
+
export * from "./MultiItemDownloadCard";
|
|
54
|
+
export * from "./nav";
|
|
55
|
+
export * from "./NavRail";
|
|
56
|
+
export * from "./NumberInput";
|
|
57
|
+
export * from "./Pagination";
|
|
58
|
+
export * from "./Panel";
|
|
59
|
+
export * from "./PartitionBar";
|
|
60
|
+
export * from "./Popover";
|
|
61
|
+
export * from "./primitives";
|
|
62
|
+
export * from "./Progress";
|
|
63
|
+
export * from "./Prose";
|
|
64
|
+
export * from "./Radio";
|
|
65
|
+
export * from "./Resizable";
|
|
66
|
+
export * from "./ScrollArea";
|
|
67
|
+
export * from "./SearchField";
|
|
68
|
+
export * from "./Segmented";
|
|
69
|
+
export * from "./Select";
|
|
70
|
+
export * from "./SelectMenu";
|
|
71
|
+
export * from "./Sheet";
|
|
72
|
+
export * from "./Skeleton";
|
|
73
|
+
export * from "./Slider";
|
|
74
|
+
export * from "./Spinner";
|
|
75
|
+
export * from "./StatTile";
|
|
76
|
+
export * from "./Stepper";
|
|
77
|
+
export * from "./Surface";
|
|
78
|
+
export * from "./Switch";
|
|
79
|
+
export * from "./TabBar";
|
|
80
|
+
export * from "./Table";
|
|
81
|
+
export * from "./Tabs";
|
|
82
|
+
export * from "./TagInput";
|
|
83
|
+
export * from "./Text";
|
|
84
|
+
export * from "./ThemeEditor";
|
|
85
|
+
export * from "./Timeline";
|
|
86
|
+
export * from "./TitleBar";
|
|
87
|
+
export * from "./Toast";
|
|
88
|
+
export * from "./ToggleGroup";
|
|
89
|
+
export * from "./Toolbar";
|
|
90
|
+
export * from "./Tooltip";
|
|
91
|
+
export * from "./Tour";
|
|
92
|
+
export * from "./Tree";
|
|
93
|
+
export * from "./VirtualList";
|
|
94
|
+
export * from "./WindowControls";
|
|
95
|
+
export * from "./ActionBar";
|
|
96
|
+
export * from "./ChoiceCard";
|
|
97
|
+
export * from "./Shelf";
|
|
98
|
+
export * from "./Wizard";
|
|
99
|
+
export * from "./SecretInput";
|
|
100
|
+
export * from "./ReorderableList";
|
|
101
|
+
export * from "./AvatarPicker";
|
|
102
|
+
export * from "./Page";
|
|
103
|
+
export * from "./ModelSelect";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface NavDestination<T extends string = string> {
|
|
3
|
+
id: T;
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
label: string;
|
|
6
|
+
/** A number renders a count; `true` renders a dot. */
|
|
7
|
+
badge?: number | boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface NavProps<T extends string = string> {
|
|
10
|
+
items: readonly NavDestination<T>[];
|
|
11
|
+
value: T;
|
|
12
|
+
onChange: (id: T) => void;
|
|
13
|
+
/** Primary create action — the one accented control in the whole nav. */
|
|
14
|
+
onCreate?: () => void;
|
|
15
|
+
createLabel?: string;
|
|
16
|
+
/** Pinned to the far end, away from the destinations (settings, account). */
|
|
17
|
+
footerItems?: readonly NavDestination<T>[];
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Text for screen readers only. Use it to name a control whose meaning is carried
|
|
4
|
+
* visually — never to hide something a sighted user also needs.
|
|
5
|
+
*/
|
|
6
|
+
export declare function VisuallyHidden({ children }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export interface AspectRatioProps extends HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
/** width / height. 16/9, 1, 3/4. */
|
|
11
|
+
ratio?: number;
|
|
12
|
+
}
|
|
13
|
+
/** Reserves the right shape before an image loads, so the layout never jumps. */
|
|
14
|
+
export declare const AspectRatio: import("react").ForwardRefExoticComponent<AspectRatioProps & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./components";
|
|
2
|
+
export * from "./layout";
|
|
3
|
+
export * from "./theme";
|
|
4
|
+
export { cn } from "./lib/cn";
|
|
5
|
+
export { icon } from "./lib/icon";
|
|
6
|
+
export { motion } from "./lib/motion";
|
|
7
|
+
export { useLongPress } from "./lib/useLongPress";
|
|
8
|
+
export { useMediaQuery, useCompactLayout } from "./lib/useMediaQuery";
|
|
9
|
+
export { useModal } from "./lib/useModal";
|
|
10
|
+
export { useImageBrightness } from "./lib/imageBrightness";
|
|
11
|
+
export { FrameProvider, useFrame, usePortalTarget } from "./lib/frame";
|
|
12
|
+
export { tintFromName } from "./lib/tint";
|
|
13
|
+
export { hexToRgb, normaliseHex, luminance, contrastRatio, isLight, readableOn, mixHex } from "./lib/color";
|
|
14
|
+
export type { PolymorphicProps, PolymorphicRef, PolymorphicComponent } from "./lib/polymorphic";
|
|
15
|
+
export { relativeTime, compactNumber, fileSize } from "./lib/format";
|