@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.
Files changed (135) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +130 -0
  3. package/dist/components/Accordion.d.ts +15 -0
  4. package/dist/components/ActionBar.d.ts +25 -0
  5. package/dist/components/Alert.d.ts +19 -0
  6. package/dist/components/AppBar.d.ts +29 -0
  7. package/dist/components/AppShell.d.ts +42 -0
  8. package/dist/components/AudioItem.d.ts +22 -0
  9. package/dist/components/Avatar.d.ts +11 -0
  10. package/dist/components/AvatarGroup.d.ts +17 -0
  11. package/dist/components/AvatarPicker.d.ts +20 -0
  12. package/dist/components/Badge.d.ts +8 -0
  13. package/dist/components/Banner.d.ts +17 -0
  14. package/dist/components/Breadcrumb.d.ts +23 -0
  15. package/dist/components/Button.d.ts +15 -0
  16. package/dist/components/ButtonGroup.d.ts +21 -0
  17. package/dist/components/Card.d.ts +16 -0
  18. package/dist/components/Carousel.d.ts +16 -0
  19. package/dist/components/CharacterCard.d.ts +30 -0
  20. package/dist/components/Chart.d.ts +35 -0
  21. package/dist/components/Checkbox.d.ts +11 -0
  22. package/dist/components/Chip.d.ts +11 -0
  23. package/dist/components/ChoiceCard.d.ts +22 -0
  24. package/dist/components/CodeBlock.d.ts +16 -0
  25. package/dist/components/Collapsible.d.ts +20 -0
  26. package/dist/components/ColorPicker.d.ts +15 -0
  27. package/dist/components/Combobox.d.ts +30 -0
  28. package/dist/components/CommandPalette.d.ts +34 -0
  29. package/dist/components/Composer.d.ts +49 -0
  30. package/dist/components/ContextMenu.d.ts +18 -0
  31. package/dist/components/CopyButton.d.ts +13 -0
  32. package/dist/components/DatePicker.d.ts +23 -0
  33. package/dist/components/Dialog.d.ts +15 -0
  34. package/dist/components/Diff.d.ts +17 -0
  35. package/dist/components/Dock.d.ts +6 -0
  36. package/dist/components/DownloadItem.d.ts +28 -0
  37. package/dist/components/Dropzone.d.ts +21 -0
  38. package/dist/components/EmptyState.d.ts +24 -0
  39. package/dist/components/Field.d.ts +20 -0
  40. package/dist/components/FilterBar.d.ts +21 -0
  41. package/dist/components/Form.d.ts +44 -0
  42. package/dist/components/Highlight.d.ts +14 -0
  43. package/dist/components/HoverCard.d.ts +15 -0
  44. package/dist/components/Icon.d.ts +37 -0
  45. package/dist/components/IconButton.d.ts +14 -0
  46. package/dist/components/ImageViewer.d.ts +16 -0
  47. package/dist/components/InfiniteScroll.d.ts +14 -0
  48. package/dist/components/Input.d.ts +14 -0
  49. package/dist/components/Kbd.d.ts +5 -0
  50. package/dist/components/List.d.ts +25 -0
  51. package/dist/components/Masonry.d.ts +16 -0
  52. package/dist/components/MediaCard.d.ts +23 -0
  53. package/dist/components/MediaTile.d.ts +21 -0
  54. package/dist/components/Menu.d.ts +34 -0
  55. package/dist/components/Message.d.ts +76 -0
  56. package/dist/components/Meter.d.ts +20 -0
  57. package/dist/components/ModelSelect.d.ts +35 -0
  58. package/dist/components/MultiItemDownloadCard.d.ts +39 -0
  59. package/dist/components/NavRail.d.ts +37 -0
  60. package/dist/components/NumberInput.d.ts +19 -0
  61. package/dist/components/Page.d.ts +18 -0
  62. package/dist/components/Pagination.d.ts +10 -0
  63. package/dist/components/Panel.d.ts +18 -0
  64. package/dist/components/PartitionBar.d.ts +39 -0
  65. package/dist/components/Popover.d.ts +45 -0
  66. package/dist/components/Progress.d.ts +9 -0
  67. package/dist/components/Prose.d.ts +13 -0
  68. package/dist/components/Radio.d.ts +19 -0
  69. package/dist/components/ReorderableList.d.ts +21 -0
  70. package/dist/components/Resizable.d.ts +20 -0
  71. package/dist/components/ScrollArea.d.ts +17 -0
  72. package/dist/components/SearchField.d.ts +14 -0
  73. package/dist/components/SecretInput.d.ts +26 -0
  74. package/dist/components/Segmented.d.ts +16 -0
  75. package/dist/components/Select.d.ts +15 -0
  76. package/dist/components/SelectMenu.d.ts +48 -0
  77. package/dist/components/Sheet.d.ts +50 -0
  78. package/dist/components/Shelf.d.ts +17 -0
  79. package/dist/components/Skeleton.d.ts +12 -0
  80. package/dist/components/Slider.d.ts +11 -0
  81. package/dist/components/Spinner.d.ts +13 -0
  82. package/dist/components/StatTile.d.ts +33 -0
  83. package/dist/components/Stepper.d.ts +21 -0
  84. package/dist/components/Surface.d.ts +56 -0
  85. package/dist/components/Switch.d.ts +9 -0
  86. package/dist/components/TabBar.d.ts +12 -0
  87. package/dist/components/Table.d.ts +35 -0
  88. package/dist/components/Tabs.d.ts +31 -0
  89. package/dist/components/TagInput.d.ts +18 -0
  90. package/dist/components/Text.d.ts +293 -0
  91. package/dist/components/ThemeEditor.d.ts +8 -0
  92. package/dist/components/Timeline.d.ts +17 -0
  93. package/dist/components/TitleBar.d.ts +17 -0
  94. package/dist/components/Toast.d.ts +50 -0
  95. package/dist/components/ToggleGroup.d.ts +22 -0
  96. package/dist/components/Toolbar.d.ts +18 -0
  97. package/dist/components/Tooltip.d.ts +15 -0
  98. package/dist/components/Tour.d.ts +22 -0
  99. package/dist/components/Tree.d.ts +21 -0
  100. package/dist/components/VirtualList.d.ts +18 -0
  101. package/dist/components/WindowControls.d.ts +38 -0
  102. package/dist/components/Wizard.d.ts +33 -0
  103. package/dist/components/confirm.d.ts +24 -0
  104. package/dist/components/index.d.ts +103 -0
  105. package/dist/components/nav.d.ts +19 -0
  106. package/dist/components/primitives.d.ts +14 -0
  107. package/dist/index.d.ts +15 -0
  108. package/dist/index.js +8035 -0
  109. package/dist/index.js.map +1 -0
  110. package/dist/layout/Box.d.ts +6 -0
  111. package/dist/layout/Center.d.ts +2 -0
  112. package/dist/layout/Container.d.ts +8 -0
  113. package/dist/layout/Divider.d.ts +9 -0
  114. package/dist/layout/Flex.d.ts +16 -0
  115. package/dist/layout/Grid.d.ts +13 -0
  116. package/dist/layout/Spacer.d.ts +4 -0
  117. package/dist/layout/Stack.d.ts +13 -0
  118. package/dist/layout/index.d.ts +8 -0
  119. package/dist/lib/cn.d.ts +2 -0
  120. package/dist/lib/color.d.ts +16 -0
  121. package/dist/lib/format.d.ts +6 -0
  122. package/dist/lib/frame.d.ts +25 -0
  123. package/dist/lib/icon.d.ts +24 -0
  124. package/dist/lib/imageBrightness.d.ts +8 -0
  125. package/dist/lib/motion.d.ts +54 -0
  126. package/dist/lib/polymorphic.d.ts +12 -0
  127. package/dist/lib/tint.d.ts +9 -0
  128. package/dist/lib/useLongPress.d.ts +19 -0
  129. package/dist/lib/useMediaQuery.d.ts +8 -0
  130. package/dist/lib/useModal.d.ts +8 -0
  131. package/dist/theme/ThemeProvider.d.ts +19 -0
  132. package/dist/theme/index.d.ts +2 -0
  133. package/dist/theme/theme.d.ts +36 -0
  134. package/package.json +81 -0
  135. package/src/styles.css +392 -0
@@ -0,0 +1,34 @@
1
+ import { type ReactElement, type ReactNode } from "react";
2
+ export interface MenuProps {
3
+ children: ReactNode;
4
+ }
5
+ /**
6
+ * Dropdown menu. Compose: <Menu><MenuTrigger>…</MenuTrigger><MenuContent>…</MenuContent></Menu>
7
+ * Anchored to the trigger; use Sheet on touch when the list is long.
8
+ */
9
+ export declare function Menu({ children }: MenuProps): import("react").JSX.Element;
10
+ export declare function MenuTrigger({ children }: {
11
+ children: ReactElement<Record<string, unknown>>;
12
+ }): ReactElement<Record<string, unknown>, string | import("react").JSXElementConstructor<any>>;
13
+ export interface MenuContentProps {
14
+ align?: "start" | "end";
15
+ side?: "bottom" | "top";
16
+ className?: string;
17
+ children: ReactNode;
18
+ }
19
+ export declare function MenuContent({ align, side, className, children }: MenuContentProps): import("react").JSX.Element;
20
+ export interface MenuItemProps {
21
+ icon?: ReactNode;
22
+ shortcut?: string;
23
+ /** Paint it as destructive. */
24
+ danger?: boolean;
25
+ disabled?: boolean;
26
+ selected?: boolean;
27
+ onSelect?: () => void;
28
+ children: ReactNode;
29
+ }
30
+ export declare function MenuItem({ icon, shortcut, danger, disabled, selected, onSelect, children }: MenuItemProps): import("react").JSX.Element;
31
+ export declare function MenuSeparator(): import("react").JSX.Element;
32
+ export declare function MenuLabel({ children }: {
33
+ children: ReactNode;
34
+ }): import("react").JSX.Element;
@@ -0,0 +1,76 @@
1
+ import { type ReactNode } from "react";
2
+ export type MessageRole = "user" | "assistant" | "scene" | "system";
3
+ export type MessageState = "idle" | "streaming" | "typing";
4
+ /** User-facing chat appearance settings. Mirrors what the app already exposes. */
5
+ export interface MessageAppearance {
6
+ fontSize?: "small" | "medium" | "large" | "xlarge";
7
+ lineSpacing?: "tight" | "normal" | "relaxed";
8
+ radius?: "sharp" | "rounded" | "pill";
9
+ maxWidth?: "compact" | "normal" | "wide";
10
+ padding?: "compact" | "normal" | "spacious";
11
+ /** `filled` is a tinted bubble, `bordered` adds a hairline, `minimal` drops the bubble entirely. */
12
+ style?: "filled" | "bordered" | "minimal";
13
+ avatar?: "circle" | "rounded" | "hidden";
14
+ avatarSize?: "small" | "medium" | "large";
15
+ /** Where the byline sits. `below` puts it under the bubble with the timestamp. */
16
+ headerPlacement?: "below" | "outside" | "inside";
17
+ }
18
+ export interface MessageVariants {
19
+ index: number;
20
+ total: number;
21
+ onPrev: () => void;
22
+ onNext: () => void;
23
+ }
24
+ export interface MessageProps {
25
+ role: MessageRole;
26
+ children?: ReactNode;
27
+ author?: {
28
+ name: string;
29
+ avatar?: string | null;
30
+ };
31
+ timestamp?: string;
32
+ state?: MessageState;
33
+ /** The model's visible reasoning, collapsed by default. */
34
+ reasoning?: {
35
+ text: ReactNode;
36
+ label?: string;
37
+ };
38
+ /** Images and files sent with the message. */
39
+ attachments?: ReactNode;
40
+ /** Regeneration variants. Swipe the bubble sideways to move between them. */
41
+ variants?: MessageVariants;
42
+ /**
43
+ * Where this message sits in a run from the same author.
44
+ * The avatar is drawn once at the top of the run, the byline once at the bottom —
45
+ * so a three-message reply reads as one block instead of three headed cards.
46
+ */
47
+ group?: "only" | "start" | "middle" | "end";
48
+ pinned?: boolean;
49
+ /**
50
+ * Everything a person can do to this message, shown in a bottom menu on long-press
51
+ * or right-click. It is the only path, so it is the same path on every platform —
52
+ * no row of icons that a phone can never reveal.
53
+ */
54
+ menu?: ReactNode;
55
+ /** Title for that menu. */
56
+ menuTitle?: ReactNode;
57
+ /**
58
+ * Take the gesture instead of the menu: long-press and right-click call this, and the
59
+ * message draws no sheet of its own. For a screen that keeps one menu for every
60
+ * message — richer than a list of rows, and closed from the screen's own state.
61
+ * Pair with `held` so the bubble shows which message it is for.
62
+ */
63
+ onMenu?: () => void;
64
+ /** Force the held look — for a menu you control yourself. */
65
+ held?: boolean;
66
+ appearance?: MessageAppearance;
67
+ className?: string;
68
+ }
69
+ export declare function Message({ role, children, author, timestamp, state, reasoning, attachments, variants, group, pinned, held, menu, menuTitle, onMenu, appearance, className, }: MessageProps): import("react").JSX.Element;
70
+ export declare function TypingDots({ className }: {
71
+ className?: string;
72
+ }): import("react").JSX.Element;
73
+ /** Date separator between days of conversation. */
74
+ export declare function MessageDivider({ children }: {
75
+ children: ReactNode;
76
+ }): import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import type { ReactNode } from "react";
2
+ export interface MeterProps {
3
+ value: number;
4
+ max?: number;
5
+ label?: ReactNode;
6
+ /** Right of the label — "12.4k / 128k". */
7
+ valueLabel?: ReactNode;
8
+ /** Fractions where the bar changes tone. Default warns at 0.75, alarms at 0.9. */
9
+ thresholds?: {
10
+ warning: number;
11
+ danger: number;
12
+ };
13
+ size?: "sm" | "md";
14
+ className?: string;
15
+ }
16
+ /**
17
+ * A budget you are spending: context window, token allowance, disk quota.
18
+ * Progress says "how far along"; a Meter says "how much is left" and turns as it fills.
19
+ */
20
+ export declare function Meter({ value, max, label, valueLabel, thresholds, size, className, }: MeterProps): import("react").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { type ReactNode } from "react";
2
+ export interface ModelOption {
3
+ id: string;
4
+ name: string;
5
+ /** Who runs it — the group heading. */
6
+ provider: string;
7
+ /** Runs on this device. */
8
+ local?: boolean;
9
+ vision?: boolean;
10
+ audio?: boolean;
11
+ /** Small text after the name — a size, a price. */
12
+ meta?: string;
13
+ }
14
+ export interface ModelSelectProps {
15
+ models: readonly ModelOption[];
16
+ value: string | null;
17
+ onChange: (id: string | null) => void;
18
+ /** Shown when nothing is picked. Default "Choose a model". */
19
+ placeholder?: string;
20
+ /** Which one the app falls back to; drawn as "Default" in the list. */
21
+ defaultId?: string | null;
22
+ /** A row at the end — "Add a model…". */
23
+ footer?: ReactNode;
24
+ disabled?: boolean;
25
+ id?: string;
26
+ className?: string;
27
+ "aria-label"?: string;
28
+ }
29
+ /**
30
+ * Picking a model, grouped by who runs it, with what it can do on the row. A menu on
31
+ * the desktop; the bottom menu on the phone, where a dropdown would be a thumb's
32
+ * width. The chat header, a character's settings and the default-model setting all
33
+ * ask the same question.
34
+ */
35
+ export declare function ModelSelect({ models, value, onChange, placeholder, defaultId, footer, disabled, id, className, ...aria }: ModelSelectProps): import("react").JSX.Element;
@@ -0,0 +1,39 @@
1
+ import { type ReactNode } from "react";
2
+ import { type DownloadStatus } from "./DownloadItem";
3
+ export interface DownloadGroupItem {
4
+ id: string;
5
+ name: string;
6
+ detail?: ReactNode;
7
+ status: DownloadStatus;
8
+ /** 0–1. */
9
+ progress?: number;
10
+ /** Bytes. Needed for an honest overall percentage. */
11
+ size?: number;
12
+ speed?: number;
13
+ eta?: number;
14
+ error?: string;
15
+ }
16
+ export interface MultiItemDownloadCardProps {
17
+ title: string;
18
+ detail?: ReactNode;
19
+ items: readonly DownloadGroupItem[];
20
+ onPauseAll?: () => void;
21
+ onResumeAll?: () => void;
22
+ onCancelAll?: () => void;
23
+ onItemPause?: (id: string) => void;
24
+ onItemResume?: (id: string) => void;
25
+ onItemCancel?: (id: string) => void;
26
+ onItemRetry?: (id: string) => void;
27
+ defaultExpanded?: boolean;
28
+ className?: string;
29
+ }
30
+ /**
31
+ * One download made of several files — a model with its shards, tokenizer and config;
32
+ * a voice pack; an image-generation bundle. The parts are what actually transfer, but
33
+ * the bundle is what a person chose, so the card reports the bundle and keeps the parts
34
+ * a disclosure away.
35
+ *
36
+ * The overall figure is weighted by file size, not a mean of percentages: a 16 GB shard
37
+ * at 10% and a 2 KB config at 100% is not "55% done".
38
+ */
39
+ export declare function MultiItemDownloadCard({ title, detail, items, onPauseAll, onResumeAll, onCancelAll, onItemPause, onItemResume, onItemCancel, onItemRetry, defaultExpanded, className, }: MultiItemDownloadCardProps): import("react").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import { type ReactNode } from "react";
2
+ import type { NavProps } from "./nav";
3
+ export interface NavRailProps<T extends string> extends NavProps<T> {
4
+ side?: "left" | "right";
5
+ /** `rail` is a 64px icon column; `sidebar` is 224px with labels. */
6
+ variant?: "rail" | "sidebar";
7
+ /** Detach from the edge and float as a rounded pill column. */
8
+ floating?: boolean;
9
+ align?: "start" | "center" | "end";
10
+ /**
11
+ * Content between the destinations and the footer — the recent chats, on a desktop.
12
+ * It takes the leftover height and scrolls on its own, so the destinations and the
13
+ * footer never move.
14
+ */
15
+ section?: ReactNode;
16
+ /** Show a button that switches between the labelled sidebar and the icon rail. */
17
+ onToggle?: () => void;
18
+ }
19
+ /** Whether the side navigation this sits in is open — for content passed as `section`. */
20
+ export declare function useNavExpanded(): boolean;
21
+ /**
22
+ * A label that is uncovered rather than moved. It never wraps — a line breaking while
23
+ * the width changes is exactly the shift to avoid — and it fades on the way out at once,
24
+ * and on the way in only once there is room for it.
25
+ */
26
+ export declare function NavLabel({ children, className }: {
27
+ children: ReactNode;
28
+ className?: string;
29
+ }): import("react").JSX.Element;
30
+ /**
31
+ * Desktop navigation: an icon rail, or a labelled sidebar — the same element either
32
+ * way. Folding and unfolding animates the width and nothing else. Icons sit in one
33
+ * fixed slot in both states, so they never move; labels are revealed by the width, not
34
+ * laid out again; the section and the footer keep their rows. What changes is how much
35
+ * of each row you can see.
36
+ */
37
+ export declare function NavRail<T extends string>(props: NavRailProps<T>): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ export interface NumberInputProps {
2
+ value: number;
3
+ onChange: (value: number) => void;
4
+ min?: number;
5
+ max?: number;
6
+ step?: number;
7
+ /** Decimal places to display. Inferred from `step` when omitted. */
8
+ precision?: number;
9
+ /** Shown after the number — "tokens", "×", "s". */
10
+ suffix?: string;
11
+ disabled?: boolean;
12
+ id?: string;
13
+ className?: string;
14
+ }
15
+ /**
16
+ * A number field with real steppers. Arrow keys step, Shift+Arrow steps by ten,
17
+ * and the value is clamped on commit rather than silently accepting nonsense.
18
+ */
19
+ export declare function NumberInput({ value, onChange, min, max, step, precision, suffix, disabled, id, className, }: NumberInputProps): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import type { ReactNode, Ref } from "react";
2
+ import { type AppBarProps } from "./AppBar";
3
+ export interface PageProps extends AppBarProps {
4
+ /** Pinned under the content — an ActionBar, a composer. */
5
+ footer?: ReactNode;
6
+ /** The scrolling element, for AppBar's condensing title and scroll-to-top. */
7
+ mainRef?: Ref<HTMLElement>;
8
+ /** Padding around the content. `none` for lists that run edge to edge. */
9
+ padding?: "default" | "none";
10
+ contentClassName?: string;
11
+ children: ReactNode;
12
+ }
13
+ /**
14
+ * A screen of its own: the header, a scrolling body and, if there is one, a footer
15
+ * that stays put. On the desktop it sits inside AppShell like any page; on the phone
16
+ * it takes the whole screen — a sub-page has the back arrow, not the tab bar.
17
+ */
18
+ export declare function Page({ footer, mainRef, padding, contentClassName, className, children, ...bar }: PageProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ export interface PaginationProps {
2
+ page: number;
3
+ pageCount: number;
4
+ onChange: (page: number) => void;
5
+ /** How many numbers to show around the current page. */
6
+ siblings?: number;
7
+ className?: string;
8
+ }
9
+ /** Numbered paging, for lists where "load more" loses your place — logs, search results. */
10
+ export declare function Pagination({ page, pageCount, onChange, siblings, className }: PaginationProps): import("react").JSX.Element | null;
@@ -0,0 +1,18 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ export type PanelTone = "neutral" | "subtle" | "accent" | "info" | "warning" | "danger" | "secondary";
3
+ export interface PanelProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
4
+ title?: ReactNode;
5
+ description?: ReactNode;
6
+ tone?: PanelTone;
7
+ /** Right of the title — a switch, a badge, a link. */
8
+ action?: ReactNode;
9
+ /** Raise contrast for use over a photo or gradient. */
10
+ onSurface?: boolean;
11
+ children?: ReactNode;
12
+ }
13
+ /**
14
+ * A titled container with a tone. Alert is a notice you read and dismiss; Panel is a
15
+ * region you put things in — the chat widgets, a grouped set of settings, a callout
16
+ * with controls inside.
17
+ */
18
+ export declare function Panel({ title, description, tone, action, onSurface, className, children, ...rest }: PanelProps): import("react").JSX.Element;
@@ -0,0 +1,39 @@
1
+ import { type ReactNode } from "react";
2
+ export type PartitionTone = "accent" | "info" | "secondary" | "warning" | "danger" | "neutral";
3
+ export interface Partition {
4
+ id: string;
5
+ label: ReactNode;
6
+ value: number;
7
+ /** A semantic tone, or any CSS colour when the segment stands for something with its own. */
8
+ tone?: PartitionTone;
9
+ color?: string;
10
+ }
11
+ export interface PartitionBarProps {
12
+ segments: readonly Partition[];
13
+ /** Denominator. Defaults to the sum, making the bar a share-of-total. */
14
+ total?: number;
15
+ /** Format each value — bytes, tokens, a currency. Percentages by default. */
16
+ format?: (value: number, share: number) => string;
17
+ /** `below` labels each segment under the bar; `legend` wraps them into rows. */
18
+ labels?: "below" | "legend" | "none";
19
+ /**
20
+ * Under this share, a label is narrower than its own word. `below` falls back to
21
+ * `legend` for the whole row rather than truncating some labels and not others.
22
+ */
23
+ minLabelShare?: number;
24
+ size?: "sm" | "md" | "lg";
25
+ /** Leave the unused remainder visible as an empty track. */
26
+ showRemainder?: boolean;
27
+ "aria-label"?: string;
28
+ className?: string;
29
+ }
30
+ /**
31
+ * A bar split into named parts: where storage went, which providers answered, how a
32
+ * context window is spent. Progress answers "how far"; a Meter answers "how much is
33
+ * left"; this answers "of what it is made".
34
+ *
35
+ * Segments are separated by a real gap rather than a border, so two adjacent colours
36
+ * never read as one — and each keeps its own rounded ends, which is what makes the
37
+ * parts legible at 6px tall.
38
+ */
39
+ export declare function PartitionBar({ segments, total, format, labels, minLabelShare, size, showRemainder, className, ...aria }: PartitionBarProps): import("react").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { type ReactElement, type ReactNode } from "react";
2
+ export type PopoverSide = "top" | "bottom" | "left" | "right";
3
+ export type PopoverAlign = "start" | "center" | "end";
4
+ export interface PopoverProps {
5
+ open?: boolean;
6
+ onOpenChange?: (open: boolean) => void;
7
+ children: ReactNode;
8
+ }
9
+ /**
10
+ * An anchored floating panel, portalled to the body so it is never clipped by an
11
+ * ancestor's overflow — which is why the app's own pickers live inside their scroll
12
+ * containers and get cut off. Combobox, DatePicker, ColorPicker and HoverCard build on it.
13
+ */
14
+ export declare function Popover({ open: openProp, onOpenChange, children }: PopoverProps): import("react").JSX.Element;
15
+ export declare function PopoverTrigger({ children }: {
16
+ children: ReactElement<Record<string, unknown>>;
17
+ }): ReactElement<Record<string, unknown>, string | import("react").JSXElementConstructor<any>>;
18
+ /**
19
+ * The element the panel points at, when opening it is not that element's job — a
20
+ * hover card, or anything that opens on its own. Same anchoring, no click handler.
21
+ */
22
+ export declare function PopoverAnchor({ children }: {
23
+ children: ReactElement<Record<string, unknown>>;
24
+ }): ReactElement<Record<string, unknown>, string | import("react").JSXElementConstructor<any>>;
25
+ /** Anchors to the trigger and flips to the other side when it would leave the viewport. */
26
+ export declare function usePopoverPosition(anchorRef: React.MutableRefObject<HTMLElement | null>, panelRef: React.RefObject<HTMLElement | null>, { open, side, align, offset }: {
27
+ open: boolean;
28
+ side: PopoverSide;
29
+ align: PopoverAlign;
30
+ offset: number;
31
+ }): {
32
+ top: number;
33
+ left: number;
34
+ minWidth?: number;
35
+ };
36
+ export interface PopoverContentProps {
37
+ side?: PopoverSide;
38
+ align?: PopoverAlign;
39
+ offset?: number;
40
+ /** Stretch to the trigger's width — what a select-style dropdown wants. */
41
+ matchWidth?: boolean;
42
+ className?: string;
43
+ children: ReactNode;
44
+ }
45
+ export declare function PopoverContent({ side, align, offset, matchWidth, className, children }: PopoverContentProps): import("react").ReactPortal;
@@ -0,0 +1,9 @@
1
+ export interface ProgressProps {
2
+ /** 0–100. Omit for indeterminate. */
3
+ value?: number;
4
+ size?: "sm" | "md";
5
+ tone?: "accent" | "info" | "warning" | "danger";
6
+ label?: string;
7
+ className?: string;
8
+ }
9
+ export declare function Progress({ value, size, tone, label, className }: ProgressProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ export interface ProseProps {
2
+ children: string;
3
+ /** Message body vs. a full document (README, changelog). */
4
+ size?: "sm" | "md";
5
+ className?: string;
6
+ }
7
+ /**
8
+ * Markdown on our type scale. Replaces the app's MarkdownRenderer, HfReadmeRenderer and
9
+ * the ~90 lines of `.hf-html-block` CSS in App.css — three renderers with three scales.
10
+ *
11
+ * Raw HTML is not enabled: character definitions and remote READMEs are untrusted text.
12
+ */
13
+ export declare function Prose({ children, size, className }: ProseProps): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { type ReactNode } from "react";
2
+ export interface RadioGroupProps<T extends string> {
3
+ value: T;
4
+ onChange: (value: T) => void;
5
+ disabled?: boolean;
6
+ orientation?: "vertical" | "horizontal";
7
+ "aria-label"?: string;
8
+ className?: string;
9
+ children: ReactNode;
10
+ }
11
+ export declare function RadioGroup<T extends string>({ value, onChange, disabled, orientation, className, children, ...aria }: RadioGroupProps<T>): import("react").JSX.Element;
12
+ export interface RadioProps {
13
+ value: string;
14
+ label: ReactNode;
15
+ description?: ReactNode;
16
+ disabled?: boolean;
17
+ }
18
+ /** Uses a real <input type="radio"> so arrow-key group navigation comes from the browser. */
19
+ export declare function Radio({ value, label, description, disabled }: RadioProps): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { type ReactNode } from "react";
2
+ export interface ReorderableListProps<T> {
3
+ items: readonly T[];
4
+ onReorder: (items: T[]) => void;
5
+ keyOf: (item: T) => string;
6
+ /** Draw one item. `handle` is the grab handle; put it where the row wants it. */
7
+ children: (item: T, handle: ReactNode, index: number) => ReactNode;
8
+ /** `y` (default) stacks; `x` lays the items in a row. */
9
+ axis?: "x" | "y";
10
+ /** Only the handle starts a drag. Off, the whole row does. Default on. */
11
+ handleOnly?: boolean;
12
+ "aria-label": string;
13
+ className?: string;
14
+ itemClassName?: string;
15
+ }
16
+ /**
17
+ * A list whose order is the point: lorebook entries, starting scenes, widgets.
18
+ * Drag by the handle (or the row), or focus the handle and press Alt+↑/↓. The item
19
+ * being dragged lifts; the others slide out of its way.
20
+ */
21
+ export declare function ReorderableList<T>({ items, onReorder, keyOf, children, axis, handleOnly, className, itemClassName, ...aria }: ReorderableListProps<T>): import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { type ReactNode } from "react";
2
+ export interface ResizableProps {
3
+ /** Fixed-size pane. */
4
+ panel: ReactNode;
5
+ /** Fills whatever is left. */
6
+ children: ReactNode;
7
+ side?: "left" | "right";
8
+ defaultSize?: number;
9
+ minSize?: number;
10
+ maxSize?: number;
11
+ /** Persisted key, so a person's split survives a reload. */
12
+ storageKey?: string;
13
+ className?: string;
14
+ }
15
+ /**
16
+ * A draggable split, for desktop screens that pair a list with an inspector — the
17
+ * lorebook trigger preview does this with a hard-coded width. The handle is a real
18
+ * separator: arrow keys resize it, so it isn't mouse-only.
19
+ */
20
+ export declare function Resizable({ panel, children, side, defaultSize, minSize, maxSize, storageKey, className, }: ResizableProps): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { type ReactNode } from "react";
2
+ export interface ScrollAreaProps {
3
+ /** Which way it scrolls. */
4
+ axis?: "y" | "x";
5
+ /** Fade the edge that has more content behind it. */
6
+ fade?: boolean;
7
+ /** Show a thin scrollbar instead of hiding it. */
8
+ bar?: boolean;
9
+ className?: string;
10
+ children: ReactNode;
11
+ }
12
+ /**
13
+ * A scroll container that says when there is more. The fade is a mask on the content,
14
+ * not a gradient overlay — an overlay would have to know the parent's background colour,
15
+ * and over a photo or a gradient it never does.
16
+ */
17
+ export declare function ScrollArea({ axis, fade, bar, className, children }: ScrollAreaProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { type InputHTMLAttributes } from "react";
2
+ export interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "type" | "size"> {
3
+ value: string;
4
+ onChange: (value: string) => void;
5
+ loading?: boolean;
6
+ /** Hint the keyboard shortcut that focuses this field. Hidden once there is text. */
7
+ shortcut?: string;
8
+ size?: "sm" | "md";
9
+ }
10
+ /**
11
+ * Search with a clear button and Escape-to-clear. The app repeats this markup in the
12
+ * page header, the library, discovery and the model browser.
13
+ */
14
+ export declare const SearchField: import("react").ForwardRefExoticComponent<SearchFieldProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,26 @@
1
+ import { type InputHTMLAttributes, type ReactNode } from "react";
2
+ export type SecretStatus = {
3
+ state: "idle";
4
+ } | {
5
+ state: "checking";
6
+ } | {
7
+ state: "ok";
8
+ message?: ReactNode;
9
+ } | {
10
+ state: "error";
11
+ message: ReactNode;
12
+ };
13
+ export interface SecretInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onChange"> {
14
+ value: string;
15
+ onChange: (value: string) => void;
16
+ /** What a check of the key came back with — drawn under the field. */
17
+ status?: SecretStatus;
18
+ /** Offer a paste button (reads the clipboard on tap). Default on. */
19
+ paste?: boolean;
20
+ }
21
+ /**
22
+ * An API key or password: masked by default with a reveal toggle, a paste button
23
+ * where the clipboard is reachable, and room under it for what a connection test
24
+ * said. One field for onboarding, providers and settings alike.
25
+ */
26
+ export declare const SecretInput: import("react").ForwardRefExoticComponent<SecretInputProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,16 @@
1
+ import { type ReactNode } from "react";
2
+ export interface SegmentedOption<T extends string> {
3
+ value: T;
4
+ label: ReactNode;
5
+ icon?: ReactNode;
6
+ }
7
+ export interface SegmentedProps<T extends string> {
8
+ options: readonly SegmentedOption<T>[];
9
+ value: T;
10
+ onChange: (value: T) => void;
11
+ size?: "sm" | "md";
12
+ block?: boolean;
13
+ "aria-label"?: string;
14
+ className?: string;
15
+ }
16
+ export declare function Segmented<T extends string>({ options, value, onChange, size, block, className, ...aria }: SegmentedProps<T>): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { type SelectHTMLAttributes } from "react";
2
+ export interface SelectOption<T extends string = string> {
3
+ value: T;
4
+ label: string;
5
+ disabled?: boolean;
6
+ }
7
+ export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "size"> {
8
+ options: readonly SelectOption[];
9
+ placeholder?: string;
10
+ }
11
+ /**
12
+ * Native select with our surface. On phones this opens the OS picker, which beats any
13
+ * custom listbox for reach and accessibility. Use Menu for command-style lists.
14
+ */
15
+ export declare const Select: import("react").ForwardRefExoticComponent<SelectProps & import("react").RefAttributes<HTMLSelectElement>>;
@@ -0,0 +1,48 @@
1
+ import { type ReactNode } from "react";
2
+ export interface SelectMenuOption<T extends string = string> {
3
+ value: T;
4
+ label: string;
5
+ /** Second line under the label. */
6
+ description?: string;
7
+ icon?: ReactNode;
8
+ /** Right-aligned slot — a badge, a size, a shortcut. */
9
+ meta?: ReactNode;
10
+ group?: string;
11
+ disabled?: boolean;
12
+ }
13
+ interface BaseProps<T extends string> {
14
+ options: readonly SelectMenuOption<T>[];
15
+ placeholder?: string;
16
+ /** Show the chosen option's icon in the closed trigger. Default true. */
17
+ triggerIcon?: boolean;
18
+ disabled?: boolean;
19
+ id?: string;
20
+ className?: string;
21
+ /** Width of the open list. Defaults to the trigger's width. */
22
+ menuClassName?: string;
23
+ }
24
+ export interface SingleSelectMenuProps<T extends string> extends BaseProps<T> {
25
+ multiple?: false;
26
+ value: T | null;
27
+ onChange: (value: T | null) => void;
28
+ clearable?: boolean;
29
+ }
30
+ export interface MultiSelectMenuProps<T extends string> extends BaseProps<T> {
31
+ multiple: true;
32
+ value: readonly T[];
33
+ onChange: (value: T[]) => void;
34
+ /** Collapse to "3 selected" past this many. Default 2. */
35
+ maxLabels?: number;
36
+ }
37
+ export type SelectMenuProps<T extends string> = SingleSelectMenuProps<T> | MultiSelectMenuProps<T>;
38
+ /**
39
+ * Our own select. `Select` stays for the plain cases — it opens the OS picker on a
40
+ * phone, which nothing custom beats for reach. Use this one when the options need
41
+ * icons, descriptions, groups or multi-select.
42
+ *
43
+ * It keeps what a native select gives you for free: typeahead (type "ge" to jump to
44
+ * Gemma), Home/End, and the listbox pattern with aria-activedescendant, so focus never
45
+ * leaves the trigger and screen readers announce the active option.
46
+ */
47
+ export declare function SelectMenu<T extends string>(props: SelectMenuProps<T>): import("react").JSX.Element;
48
+ export {};