@gradeui/ui 1.1.0 → 1.2.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/components/ui/code.md +2 -1
- package/components/ui/composer.md +226 -0
- package/components/ui/message.md +229 -0
- package/dist/contracts.js +48 -4
- package/dist/contracts.js.map +1 -1
- package/dist/contracts.mjs +48 -4
- package/dist/contracts.mjs.map +1 -1
- package/dist/index.d.mts +698 -18
- package/dist/index.d.ts +698 -18
- package/dist/index.js +92 -48
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +92 -48
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +11 -1
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { DayPicker, DayButton, DateRange } from 'react-day-picker';
|
|
|
10
10
|
import { UseEmblaCarouselType } from 'embla-carousel-react';
|
|
11
11
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
12
12
|
import { Language } from 'prism-react-renderer';
|
|
13
|
+
import { LexicalEditor } from 'lexical';
|
|
13
14
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
14
15
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
15
16
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
@@ -173,14 +174,14 @@ declare const MediaSurfaceContract: _gradeui_contracts.ComponentContract<{
|
|
|
173
174
|
description: z.ZodOptional<z.ZodString>;
|
|
174
175
|
}, "strip", z.ZodTypeAny, {
|
|
175
176
|
kind: "book";
|
|
176
|
-
description?: string | undefined;
|
|
177
177
|
title?: string | undefined;
|
|
178
|
+
description?: string | undefined;
|
|
178
179
|
author?: string | undefined;
|
|
179
180
|
isbn?: string | undefined;
|
|
180
181
|
}, {
|
|
181
182
|
kind: "book";
|
|
182
|
-
description?: string | undefined;
|
|
183
183
|
title?: string | undefined;
|
|
184
|
+
description?: string | undefined;
|
|
184
185
|
author?: string | undefined;
|
|
185
186
|
isbn?: string | undefined;
|
|
186
187
|
}>, z.ZodObject<{
|
|
@@ -466,9 +467,37 @@ interface AppShellFooterProps extends React$1.HTMLAttributes<HTMLElement>, Varia
|
|
|
466
467
|
}
|
|
467
468
|
declare const AppShellFooter: React$1.ForwardRefExoticComponent<AppShellFooterProps & React$1.RefAttributes<HTMLElement>>;
|
|
468
469
|
|
|
469
|
-
|
|
470
|
+
/**
|
|
471
|
+
* Avatar — circular user/entity glyph. Wraps Radix's avatar primitive
|
|
472
|
+
* with two ergonomic additions over the base shadcn shape:
|
|
473
|
+
*
|
|
474
|
+
* size — t-shirt scale (xs / sm / md / lg / xl) so consumers pick a
|
|
475
|
+
* token instead of writing `h-7 w-7` every time. Defaults
|
|
476
|
+
* to md (40px) to preserve previous behaviour.
|
|
477
|
+
*
|
|
478
|
+
* tone — on AvatarFallback only. Picks a tinted bg/text colour
|
|
479
|
+
* pair (violet / amber / emerald / sky / rose / plum / lime /
|
|
480
|
+
* primary / muted). Default `muted` matches the previous
|
|
481
|
+
* `bg-muted` behaviour. Reach for explicit tones when each
|
|
482
|
+
* author needs a stable colour mapping (chat avatars, comment
|
|
483
|
+
* threads, member lists).
|
|
484
|
+
*
|
|
485
|
+
* Both additions are backwards compatible — code that passed className
|
|
486
|
+
* directly still works and overrides the variant defaults.
|
|
487
|
+
*/
|
|
488
|
+
declare const avatarSizes: (props?: ({
|
|
489
|
+
size?: "sm" | "md" | "lg" | "xs" | "xl" | null | undefined;
|
|
490
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
491
|
+
interface AvatarProps extends React$1.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>, VariantProps<typeof avatarSizes> {
|
|
492
|
+
}
|
|
493
|
+
declare const Avatar: React$1.ForwardRefExoticComponent<AvatarProps & React$1.RefAttributes<HTMLSpanElement>>;
|
|
470
494
|
declare const AvatarImage: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React$1.RefAttributes<HTMLImageElement>, "ref"> & React$1.RefAttributes<HTMLImageElement>>;
|
|
471
|
-
declare const
|
|
495
|
+
declare const avatarFallbackTones: (props?: ({
|
|
496
|
+
tone?: "muted" | "primary" | "violet" | "amber" | "emerald" | "sky" | "rose" | "plum" | "lime" | null | undefined;
|
|
497
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
498
|
+
interface AvatarFallbackProps extends React$1.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>, VariantProps<typeof avatarFallbackTones> {
|
|
499
|
+
}
|
|
500
|
+
declare const AvatarFallback: React$1.ForwardRefExoticComponent<AvatarFallbackProps & React$1.RefAttributes<HTMLSpanElement>>;
|
|
472
501
|
|
|
473
502
|
declare const badgeVariants: (props?: ({
|
|
474
503
|
variant?: "default" | "info" | "success" | "warning" | "destructive" | "outline" | "secondary" | "highlight" | "success-soft" | "warning-soft" | "destructive-soft" | "info-soft" | "highlight-soft" | "success-outline" | "warning-outline" | "destructive-outline" | "info-outline" | null | undefined;
|
|
@@ -538,7 +567,7 @@ type Surface = "solid" | "translucent" | "glass" | "glass-strong";
|
|
|
538
567
|
*/
|
|
539
568
|
declare const bannerVariants: (props?: ({
|
|
540
569
|
variant?: "default" | "info" | "success" | "warning" | "destructive" | "announcement" | null | undefined;
|
|
541
|
-
align?: "
|
|
570
|
+
align?: "center" | "start" | "between" | null | undefined;
|
|
542
571
|
sticky?: boolean | null | undefined;
|
|
543
572
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
544
573
|
interface BannerProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "title">, VariantProps<typeof bannerVariants> {
|
|
@@ -594,7 +623,7 @@ declare const Banner: React$1.ForwardRefExoticComponent<BannerProps & React$1.Re
|
|
|
594
623
|
* consistent across primitives.
|
|
595
624
|
*/
|
|
596
625
|
declare const buttonVariants: (props?: ({
|
|
597
|
-
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "
|
|
626
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "raised" | null | undefined;
|
|
598
627
|
size?: "default" | "icon" | "sm" | "md" | "lg" | null | undefined;
|
|
599
628
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
600
629
|
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -797,6 +826,7 @@ type CodeLanguage = Language;
|
|
|
797
826
|
type CodeReveal = "none" | "lines" | "typewriter" | "diff";
|
|
798
827
|
type CodeTrigger = "mount" | "inView" | "manual";
|
|
799
828
|
type CodeSpeed = "slow" | "normal" | "fast";
|
|
829
|
+
type CodeSize = "xs" | "sm" | "md";
|
|
800
830
|
/**
|
|
801
831
|
* Step shape for scripted terminal / CLI sessions. Lives on `<Code>`
|
|
802
832
|
* itself rather than a sibling `CodeSequence` so the theme bridge,
|
|
@@ -921,6 +951,17 @@ interface CodeProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "childr
|
|
|
921
951
|
* Overflowing content scrolls. Pair with `wrap` to break long lines
|
|
922
952
|
* instead of horizontal scroll.
|
|
923
953
|
*/
|
|
954
|
+
/**
|
|
955
|
+
* Type-scale preset. `xs` (12px) for dense changelog cards and inline
|
|
956
|
+
* code in tables; `sm` (14px, default) for marketing heroes and most
|
|
957
|
+
* docs blocks; `md` (16px) for "this is the focal point" displays
|
|
958
|
+
* like AI-output demos and large screen-capture replacements.
|
|
959
|
+
*
|
|
960
|
+
* Composes with `maxLines` correctly because the container height
|
|
961
|
+
* uses `1lh` which inherits whatever line-height the size class
|
|
962
|
+
* produces — switching size resizes the container automatically.
|
|
963
|
+
*/
|
|
964
|
+
size?: CodeSize;
|
|
924
965
|
height?: number | string | "auto";
|
|
925
966
|
/**
|
|
926
967
|
* Cap the visible line count — the container is fixed at exactly
|
|
@@ -935,6 +976,645 @@ interface CodeProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "childr
|
|
|
935
976
|
}
|
|
936
977
|
declare const Code: React$1.ForwardRefExoticComponent<CodeProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
937
978
|
|
|
979
|
+
/**
|
|
980
|
+
* Message — the canonical "avatar + author + timestamp + body" row.
|
|
981
|
+
*
|
|
982
|
+
* THE primitive for any chat message, comment, post-reply, activity-log
|
|
983
|
+
* entry, or notification row that follows the people-and-text shape.
|
|
984
|
+
* Surfaced after three scaffolds (chat, comments, hero preview) all
|
|
985
|
+
* re-rolled the same flex layout inline — that was the signal.
|
|
986
|
+
*
|
|
987
|
+
* Slot-based composition for the avatar so consumers pass whatever
|
|
988
|
+
* Avatar variant fits their surface (sized, toned, image, fallback).
|
|
989
|
+
* Message doesn't pick an Avatar shape for you — it just hosts.
|
|
990
|
+
*
|
|
991
|
+
* <Message
|
|
992
|
+
* author="alice"
|
|
993
|
+
* timestamp="11:24"
|
|
994
|
+
* avatar={
|
|
995
|
+
* <Avatar size="sm">
|
|
996
|
+
* <AvatarFallback tone="violet">A</AvatarFallback>
|
|
997
|
+
* </Avatar>
|
|
998
|
+
* }
|
|
999
|
+
* >
|
|
1000
|
+
* Post copy is in the doc.
|
|
1001
|
+
* </Message>
|
|
1002
|
+
*
|
|
1003
|
+
* For "your messages right-aligned" chat surfaces (iMessage / WhatsApp
|
|
1004
|
+
* / your own DM threads), pass `align="end"` and the row + content
|
|
1005
|
+
* mirror.
|
|
1006
|
+
*
|
|
1007
|
+
* Anti-patterns to avoid (caught from real scaffold use):
|
|
1008
|
+
*
|
|
1009
|
+
* - Don't roll a custom "AuthorDot" inline — Avatar with
|
|
1010
|
+
* <AvatarFallback tone="..."> covers the colored-initials case
|
|
1011
|
+
* cleanly and stays themable.
|
|
1012
|
+
* - Don't use Message for non-people activity (system events,
|
|
1013
|
+
* log lines). Reach for Callout or a plain Row.
|
|
1014
|
+
*/
|
|
1015
|
+
interface MessageProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
1016
|
+
/** Display name of the message author. */
|
|
1017
|
+
author: string;
|
|
1018
|
+
/**
|
|
1019
|
+
* Timestamp string ("11:24", "2 hours ago") OR any node for custom
|
|
1020
|
+
* formatting (tooltip-wrapped time, link to permalink, etc).
|
|
1021
|
+
*/
|
|
1022
|
+
timestamp?: React$1.ReactNode;
|
|
1023
|
+
/**
|
|
1024
|
+
* Avatar slot. Pass any `<Avatar>` composition. When omitted, the
|
|
1025
|
+
* row renders without an avatar column — handy for grouped messages
|
|
1026
|
+
* from the same author where only the first row shows the avatar.
|
|
1027
|
+
*/
|
|
1028
|
+
avatar?: React$1.ReactNode;
|
|
1029
|
+
/**
|
|
1030
|
+
* Small chip(s) next to the author name. Use for "OP", "Bot",
|
|
1031
|
+
* "Admin", or any role/state badge that belongs in the header
|
|
1032
|
+
* rhythm rather than the body.
|
|
1033
|
+
*/
|
|
1034
|
+
badge?: React$1.ReactNode;
|
|
1035
|
+
/**
|
|
1036
|
+
* Editing state — renders an "(edited)" hint next to the timestamp.
|
|
1037
|
+
* Pass a string to customise the label (e.g. "(edited 2 minutes ago)").
|
|
1038
|
+
*/
|
|
1039
|
+
edited?: boolean | string;
|
|
1040
|
+
/**
|
|
1041
|
+
* Pinned state — renders a small pin glyph at the top of the row.
|
|
1042
|
+
* Surfaces "this is a sticky / pinned message" in Slack-style feeds.
|
|
1043
|
+
*/
|
|
1044
|
+
pinned?: boolean;
|
|
1045
|
+
/**
|
|
1046
|
+
* End-of-header slot. Common use: a hover-revealed Row of small
|
|
1047
|
+
* icon buttons (reply / react / pin / more). Pushed to the right
|
|
1048
|
+
* with `ml-auto`.
|
|
1049
|
+
*/
|
|
1050
|
+
actions?: React$1.ReactNode;
|
|
1051
|
+
/**
|
|
1052
|
+
* Reactions slot — renders below the body. Typically a Row of
|
|
1053
|
+
* reaction chips (emoji + count). Hidden when no node is passed.
|
|
1054
|
+
*/
|
|
1055
|
+
reactions?: React$1.ReactNode;
|
|
1056
|
+
/**
|
|
1057
|
+
* Thread / reply count — renders a "N replies" link affordance
|
|
1058
|
+
* below the body. Click handler is the consumer's responsibility.
|
|
1059
|
+
* Wire `onThreadClick` if you want the built-in button to fire.
|
|
1060
|
+
*/
|
|
1061
|
+
threadCount?: number;
|
|
1062
|
+
/** Fires when the built-in "N replies" affordance is clicked. */
|
|
1063
|
+
onThreadClick?: () => void;
|
|
1064
|
+
/**
|
|
1065
|
+
* Visual alignment. `start` (default) puts the avatar on the left
|
|
1066
|
+
* — the standard chat / comment shape. `end` mirrors the row so the
|
|
1067
|
+
* avatar sits on the right and the content right-aligns — use for
|
|
1068
|
+
* "your messages" in DM threads.
|
|
1069
|
+
*/
|
|
1070
|
+
align?: "start" | "end";
|
|
1071
|
+
/**
|
|
1072
|
+
* Body content (the message text). Accepts any node so consumers
|
|
1073
|
+
* can embed rich content — Markdown-rendered prose, images,
|
|
1074
|
+
* embedded cards, etc. Plain text is the common case.
|
|
1075
|
+
*/
|
|
1076
|
+
children: React$1.ReactNode;
|
|
1077
|
+
}
|
|
1078
|
+
declare const Message: React$1.ForwardRefExoticComponent<MessageProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1079
|
+
|
|
1080
|
+
/**
|
|
1081
|
+
* Shared types + presets for scripted component demos.
|
|
1082
|
+
*
|
|
1083
|
+
* Lives at the bottom of the demo primitive stack so the hook, the
|
|
1084
|
+
* cursor, and any component that opts in (`<Code>`, `<Composer>`,
|
|
1085
|
+
* `<DemoStage>`) all read from one definition of "what slow / normal /
|
|
1086
|
+
* fast feels like" and one definition of "when do we start playing".
|
|
1087
|
+
*
|
|
1088
|
+
* If you ever want to retune the cadence of every demo on the marketing
|
|
1089
|
+
* site at once, this is the file to edit.
|
|
1090
|
+
*/
|
|
1091
|
+
/**
|
|
1092
|
+
* Animation feel. Maps onto a triple of timing values so authors can
|
|
1093
|
+
* pick a vibe (slow / normal / fast) instead of hand-tuning ms.
|
|
1094
|
+
* Components that need finer control can still override the resolved
|
|
1095
|
+
* values per-instance.
|
|
1096
|
+
*/
|
|
1097
|
+
type DemoSpeed = "slow" | "normal" | "fast";
|
|
1098
|
+
/**
|
|
1099
|
+
* What kicks the demo off:
|
|
1100
|
+
* - `mount` plays immediately on first paint
|
|
1101
|
+
* - `inView` waits for the container to cross the viewport threshold
|
|
1102
|
+
* - `manual` driven by the `play` prop or imperative ref
|
|
1103
|
+
*/
|
|
1104
|
+
type DemoTrigger = "mount" | "inView" | "manual";
|
|
1105
|
+
/**
|
|
1106
|
+
* Speed presets shared across every scripted-demo surface. Three
|
|
1107
|
+
* unambiguously distinct feels: `slow` is "I am being shown", `normal`
|
|
1108
|
+
* is "I am being told", `fast` is "I am being briefed".
|
|
1109
|
+
*
|
|
1110
|
+
* - `tokenStagger` per-character cadence for typing-style steps
|
|
1111
|
+
* - `lineStagger` per-line cadence for reveal-style demos
|
|
1112
|
+
* - `preDelay` pause after the trigger fires before the first tick
|
|
1113
|
+
* - `fadeMs` default enter-transition duration for revealed parts
|
|
1114
|
+
*/
|
|
1115
|
+
declare const DEMO_SPEED_PRESETS: Record<DemoSpeed, {
|
|
1116
|
+
tokenStagger: number;
|
|
1117
|
+
lineStagger: number;
|
|
1118
|
+
preDelay: number;
|
|
1119
|
+
fadeMs: number;
|
|
1120
|
+
}>;
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* Cancellable sleep + type helpers for scripted demos.
|
|
1124
|
+
*
|
|
1125
|
+
* The runner threads an `AbortSignal` through every step so a `stop()`
|
|
1126
|
+
* call (or an unmount) can short-circuit long waits and typing loops
|
|
1127
|
+
* cleanly. Consumers write `await sleep(ms, signal)` inside their
|
|
1128
|
+
* interpret callback and the cancellation is automatic.
|
|
1129
|
+
*
|
|
1130
|
+
* Note: this throws DOMException("Aborted", "AbortError") on cancel.
|
|
1131
|
+
* The runner's outer try/catch swallows that specific error and exits;
|
|
1132
|
+
* any other rejection bubbles up so authoring bugs aren't silenced.
|
|
1133
|
+
*/
|
|
1134
|
+
/**
|
|
1135
|
+
* Promisified setTimeout that resolves after `ms` milliseconds, or
|
|
1136
|
+
* rejects with an AbortError if the signal fires first. Resolves
|
|
1137
|
+
* immediately if `ms <= 0`.
|
|
1138
|
+
*/
|
|
1139
|
+
declare function sleep(ms: number, signal?: AbortSignal): Promise<void>;
|
|
1140
|
+
/**
|
|
1141
|
+
* Type `text` one character at a time, calling `onTick(partial)` for
|
|
1142
|
+
* each prefix. Stagger between ticks defaults to 22ms (the `normal`
|
|
1143
|
+
* speed preset's `tokenStagger`).
|
|
1144
|
+
*
|
|
1145
|
+
* `onTick` receives the cumulative typed text (not the new char), so
|
|
1146
|
+
* consumers can do `setBuffer(prefix + partial)` without tracking state
|
|
1147
|
+
* themselves. The final call fires with the complete text — there's no
|
|
1148
|
+
* separate "done" callback.
|
|
1149
|
+
*/
|
|
1150
|
+
declare function typeText(text: string, onTick: (partial: string) => void, stagger?: number, signal?: AbortSignal): Promise<void>;
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* useScriptedDemo — the shared step-machine hook behind every
|
|
1154
|
+
* scripted-demo surface in gradeui (`<Code>`, `<Composer>`,
|
|
1155
|
+
* `<DemoStage>`, anything else that wants the same play / stop / speed
|
|
1156
|
+
* semantics).
|
|
1157
|
+
*
|
|
1158
|
+
* Generic over the Step type. Each consumer defines its own verbs
|
|
1159
|
+
* (Code has `output`, Composer has `mention`, DemoStage has `reveal`)
|
|
1160
|
+
* and passes an `interpret(step, ctx)` callback that executes one
|
|
1161
|
+
* step. The hook owns: sequencing, cancellation, trigger detection
|
|
1162
|
+
* (mount / inView / manual), loop, pre-delay, completion signal, and
|
|
1163
|
+
* the imperative play() / stop() API.
|
|
1164
|
+
*
|
|
1165
|
+
* Authoring guide for `interpret`:
|
|
1166
|
+
* - `await sleep(ms, ctx.signal)` for any pause so stop() can short
|
|
1167
|
+
* a long wait cleanly.
|
|
1168
|
+
* - `await typeText(text, onTick, stagger, ctx.signal)` for typing
|
|
1169
|
+
* loops, again so stop() interrupts mid-character.
|
|
1170
|
+
* - Read `ctx.speed` to grab the resolved DEMO_SPEED_PRESETS entry
|
|
1171
|
+
* when a step doesn't pin its own cadence.
|
|
1172
|
+
* - Throw nothing on cancel — the helpers do it for you. Anything
|
|
1173
|
+
* else thrown is treated as a real bug and bubbles to the console.
|
|
1174
|
+
*/
|
|
1175
|
+
interface ScriptedDemoContext {
|
|
1176
|
+
/** Resolved speed preset for the current run. */
|
|
1177
|
+
speed: (typeof DEMO_SPEED_PRESETS)[DemoSpeed];
|
|
1178
|
+
/** AbortSignal that fires on stop() / unmount / steps change. */
|
|
1179
|
+
signal: AbortSignal;
|
|
1180
|
+
/** Live cancellation check for code paths that can't take a signal. */
|
|
1181
|
+
cancelled: () => boolean;
|
|
1182
|
+
}
|
|
1183
|
+
interface UseScriptedDemoOptions<TStep> {
|
|
1184
|
+
/** The steps to run. Undefined or empty means "no script". */
|
|
1185
|
+
steps?: TStep[];
|
|
1186
|
+
/**
|
|
1187
|
+
* Per-step interpreter. Receives one step + a context with timing
|
|
1188
|
+
* helpers, runs whatever the step means, and returns when done.
|
|
1189
|
+
* Synchronous or async — the runner awaits either.
|
|
1190
|
+
*/
|
|
1191
|
+
interpret: (step: TStep, ctx: ScriptedDemoContext) => Promise<void> | void;
|
|
1192
|
+
/** Animation feel. Defaults to `normal`. */
|
|
1193
|
+
speed?: DemoSpeed;
|
|
1194
|
+
/** What kicks the script off. Defaults to `mount`. */
|
|
1195
|
+
trigger?: DemoTrigger;
|
|
1196
|
+
/** For `trigger="manual"` — flip true to play. */
|
|
1197
|
+
play?: boolean;
|
|
1198
|
+
/** Loop the sequence forever after completion. Pause length controlled by `loopDelay`. */
|
|
1199
|
+
loop?: boolean;
|
|
1200
|
+
/**
|
|
1201
|
+
* Milliseconds to pause between loop cycles. Only applies when
|
|
1202
|
+
* `loop` is true. Defaults to 2000. Marketing surfaces that want
|
|
1203
|
+
* the demo to breathe between repeats bump this to 4000-6000; tight
|
|
1204
|
+
* inline demos drop it to 800.
|
|
1205
|
+
*/
|
|
1206
|
+
loopDelay?: number;
|
|
1207
|
+
/** Container ref for inView detection. Required when `trigger="inView"`. */
|
|
1208
|
+
containerRef?: React$1.RefObject<HTMLElement | null>;
|
|
1209
|
+
/**
|
|
1210
|
+
* Fires when one loop iteration completes (or the whole run, when
|
|
1211
|
+
* `loop` is false). Consumers can use this to reset their buffer or
|
|
1212
|
+
* fire a parent callback.
|
|
1213
|
+
*/
|
|
1214
|
+
onComplete?: () => void;
|
|
1215
|
+
/**
|
|
1216
|
+
* Fires before each loop iteration starts (after the 2s pause).
|
|
1217
|
+
* Use to reset per-iteration state in the consumer.
|
|
1218
|
+
*/
|
|
1219
|
+
onLoopReset?: () => void;
|
|
1220
|
+
}
|
|
1221
|
+
interface ScriptedDemoState {
|
|
1222
|
+
/** True while the runner is actively walking steps. */
|
|
1223
|
+
isPlaying: boolean;
|
|
1224
|
+
/** True after the last step has run (and stays true until reset). */
|
|
1225
|
+
isComplete: boolean;
|
|
1226
|
+
/** 0-indexed pointer to the currently executing step, or -1 idle. */
|
|
1227
|
+
currentIndex: number;
|
|
1228
|
+
/** Imperative trigger. Mostly for `trigger="manual"` ref handles. */
|
|
1229
|
+
play: () => void;
|
|
1230
|
+
/** Cancel the in-flight script. Idempotent. */
|
|
1231
|
+
stop: () => void;
|
|
1232
|
+
/**
|
|
1233
|
+
* One-shot replay. Cancels any in-flight run, then re-plays from
|
|
1234
|
+
* step 0. Pass a delay in ms to schedule the replay (useful for
|
|
1235
|
+
* "play, finish, breathe, play once more" cadences without the
|
|
1236
|
+
* commitment of `loop`).
|
|
1237
|
+
*/
|
|
1238
|
+
restart: (delayMs?: number) => void;
|
|
1239
|
+
}
|
|
1240
|
+
declare function useScriptedDemo<TStep>(opts: UseScriptedDemoOptions<TStep>): ScriptedDemoState;
|
|
1241
|
+
|
|
1242
|
+
/**
|
|
1243
|
+
* BlinkingCursor — the shared caret used by every scripted-demo
|
|
1244
|
+
* surface in gradeui. Styled via CSS variables so each host (Code's
|
|
1245
|
+
* terminal, Composer's inline caret, future surfaces) can tweak
|
|
1246
|
+
* dimensions and colour without forking the component.
|
|
1247
|
+
*
|
|
1248
|
+
* Tokens read from the cascade:
|
|
1249
|
+
* --gds-demo-cursor-color defaults to currentColor
|
|
1250
|
+
* --gds-demo-cursor-width defaults to 0.55ch (a hair narrower than
|
|
1251
|
+
* a monospace char so it reads as a caret
|
|
1252
|
+
* rather than a block)
|
|
1253
|
+
* --gds-demo-cursor-height defaults to 1.1em
|
|
1254
|
+
*
|
|
1255
|
+
* The animation lives in `styles/globals.css` as `.gds-demo-cursor`
|
|
1256
|
+
* (alongside the other demo primitives). Keeping it in CSS rather
|
|
1257
|
+
* than motion / framer keeps the cursor available in environments
|
|
1258
|
+
* that disable JS animation but still render the page.
|
|
1259
|
+
*/
|
|
1260
|
+
interface BlinkingCursorProps extends Omit<React$1.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
1261
|
+
/**
|
|
1262
|
+
* Visual variant. `inline` (default) is for caret-in-text demos
|
|
1263
|
+
* (Code, Composer). `block` is for terminal-style square cursors
|
|
1264
|
+
* that fill a character cell.
|
|
1265
|
+
*/
|
|
1266
|
+
variant?: "inline" | "block";
|
|
1267
|
+
}
|
|
1268
|
+
declare const BlinkingCursor: React$1.ForwardRefExoticComponent<BlinkingCursorProps & React$1.RefAttributes<HTMLSpanElement>>;
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* DemoStage + Reveal — staged appearance for whole-interface demos.
|
|
1272
|
+
*
|
|
1273
|
+
* Drop `<Reveal id="hero">…</Reveal>` around any subtree that should
|
|
1274
|
+
* appear on cue. Wrap a region in `<DemoStage steps={…}>` and the
|
|
1275
|
+
* script drives which targets become visible, in what order, with
|
|
1276
|
+
* what cadence. Same speed / trigger / loop / play semantics as
|
|
1277
|
+
* `<Code>` and `<Composer>`.
|
|
1278
|
+
*
|
|
1279
|
+
* Why a context-based pattern instead of one-component-per-region:
|
|
1280
|
+
* - Authoring stays declarative — the script reads as a storyboard,
|
|
1281
|
+
* not as a stack of imperative ref calls.
|
|
1282
|
+
* - Reveals can live deep in a subtree without prop-drilling.
|
|
1283
|
+
* - The same `<Reveal>` works whether or not a parent stage exists
|
|
1284
|
+
* (it just renders visible if there's no context, so the same
|
|
1285
|
+
* markup ships to production without the demo wrapper).
|
|
1286
|
+
*
|
|
1287
|
+
* Reduced motion: if the user has `prefers-reduced-motion`, every
|
|
1288
|
+
* Reveal renders immediately at its destination state — the stage's
|
|
1289
|
+
* script still walks, but the visual transitions are no-ops.
|
|
1290
|
+
*/
|
|
1291
|
+
type RevealStep = {
|
|
1292
|
+
type: "reveal";
|
|
1293
|
+
target: string;
|
|
1294
|
+
} | {
|
|
1295
|
+
type: "reveal-all";
|
|
1296
|
+
} | {
|
|
1297
|
+
type: "hide";
|
|
1298
|
+
target: string;
|
|
1299
|
+
} | {
|
|
1300
|
+
type: "wait";
|
|
1301
|
+
ms: number;
|
|
1302
|
+
} | {
|
|
1303
|
+
type: "reset";
|
|
1304
|
+
};
|
|
1305
|
+
type RevealAnimation = "fade" | "fade-up" | "fade-down" | "fade-left" | "fade-right" | "scale" | "none";
|
|
1306
|
+
interface DemoStageProps {
|
|
1307
|
+
/** Steps that drive which Reveals are visible at what time. */
|
|
1308
|
+
steps?: RevealStep[];
|
|
1309
|
+
/** Speed preset. Same vocabulary as Code / Composer. */
|
|
1310
|
+
speed?: DemoSpeed;
|
|
1311
|
+
/** When the stage starts running. Defaults to `mount`. */
|
|
1312
|
+
trigger?: DemoTrigger;
|
|
1313
|
+
/** For trigger="manual" — flip true to play. */
|
|
1314
|
+
play?: boolean;
|
|
1315
|
+
/** Loop the script forever. */
|
|
1316
|
+
loop?: boolean;
|
|
1317
|
+
/** Default enter animation for child Reveals that don't override. */
|
|
1318
|
+
defaultAnimation?: RevealAnimation;
|
|
1319
|
+
/**
|
|
1320
|
+
* Render content visible by default (every target shown) when the
|
|
1321
|
+
* stage has no steps. Useful for sharing the same JSX between live
|
|
1322
|
+
* production use and demo playback.
|
|
1323
|
+
*/
|
|
1324
|
+
visibleWhenIdle?: boolean;
|
|
1325
|
+
className?: string;
|
|
1326
|
+
children: React$1.ReactNode;
|
|
1327
|
+
}
|
|
1328
|
+
declare function DemoStage({ steps, speed, trigger, play, loop, defaultAnimation, visibleWhenIdle, className, children, }: DemoStageProps): React$1.JSX.Element;
|
|
1329
|
+
interface RevealProps {
|
|
1330
|
+
/** Stage target id. The matching `{ type: "reveal", target: id }` step shows this. */
|
|
1331
|
+
id: string;
|
|
1332
|
+
/** Enter animation. Falls back to the parent stage's `defaultAnimation`. */
|
|
1333
|
+
animation?: RevealAnimation;
|
|
1334
|
+
/** Override transition duration (ms). Defaults to the stage speed's fadeMs. */
|
|
1335
|
+
durationMs?: number;
|
|
1336
|
+
/**
|
|
1337
|
+
* When true and there's no parent DemoStage, render hidden anyway.
|
|
1338
|
+
* Default false — naked usage renders visible so production markup
|
|
1339
|
+
* matches demo markup.
|
|
1340
|
+
*/
|
|
1341
|
+
hideOutsideStage?: boolean;
|
|
1342
|
+
/**
|
|
1343
|
+
* Fires when this Reveal transitions from hidden to visible. Use to
|
|
1344
|
+
* kick off a nested scripted demo (Composer.restart(), Code.play(),
|
|
1345
|
+
* etc) at the moment the user actually sees the surface. Without
|
|
1346
|
+
* this hook, nested demos with `trigger="mount"` would run while
|
|
1347
|
+
* still hidden and the user would miss the animation entirely.
|
|
1348
|
+
*/
|
|
1349
|
+
onReveal?: () => void;
|
|
1350
|
+
/**
|
|
1351
|
+
* Fires when this Reveal transitions from visible to hidden (e.g.
|
|
1352
|
+
* because the stage script ran a `hide` step or looped via `reset`).
|
|
1353
|
+
* Use to pause/reset nested state.
|
|
1354
|
+
*/
|
|
1355
|
+
onHide?: () => void;
|
|
1356
|
+
className?: string;
|
|
1357
|
+
children: React$1.ReactNode;
|
|
1358
|
+
}
|
|
1359
|
+
declare function Reveal({ id, animation, durationMs, hideOutsideStage, onReveal, onHide, className, children, }: RevealProps): React$1.JSX.Element;
|
|
1360
|
+
|
|
1361
|
+
/**
|
|
1362
|
+
* Composer — the generic text composition surface for the design system.
|
|
1363
|
+
*
|
|
1364
|
+
* The answer wherever a user is composing a message: AI chat input,
|
|
1365
|
+
* comment thread reply, post-body editor, future copilot panels.
|
|
1366
|
+
* Replaces the textarea-with-buttons pattern that hosts kept rolling
|
|
1367
|
+
* by hand.
|
|
1368
|
+
*
|
|
1369
|
+
* Built on Lexical (Meta's React-first editor framework) so it can do:
|
|
1370
|
+
* - rich text formatting (B / I / U / S / code, headings, blockquote,
|
|
1371
|
+
* pullquote, lists)
|
|
1372
|
+
* - mentions and slash commands via lexical-beautiful-mentions, with
|
|
1373
|
+
* a typeahead popover and theme-able tokens
|
|
1374
|
+
* - image attachments (paperclip + clipboard paste) when opted in
|
|
1375
|
+
* - scripted demo playback for marketing surfaces (types text, opens
|
|
1376
|
+
* mention popovers, applies formatting, all via the same step
|
|
1377
|
+
* vocabulary as <Code>)
|
|
1378
|
+
*
|
|
1379
|
+
* Slot-based composition for the action row: hosts that need custom
|
|
1380
|
+
* affordances (template picker, voice button, attach-document) pass
|
|
1381
|
+
* `leftActions` / `rightActions`. Default Send / Stop / paperclip
|
|
1382
|
+
* render only when the host hasn't replaced the slot.
|
|
1383
|
+
*
|
|
1384
|
+
* Hosts that want the canned "chat composer with paperclip + send"
|
|
1385
|
+
* preset should reach for `<AIChatComposer>` instead, which configures
|
|
1386
|
+
* this Composer with the right slots wired up.
|
|
1387
|
+
*
|
|
1388
|
+
* Scripted demos: same `speed` / `trigger` / `play` / `loop` vocabulary
|
|
1389
|
+
* as `<Code>`, sharing the underlying `useScriptedDemo` hook from
|
|
1390
|
+
* `lib/demo/`. The Composer adds its own verbs (`mention`, `format`,
|
|
1391
|
+
* `select`, `submit`) on top of the universal `type` / `wait` / `clear`.
|
|
1392
|
+
*/
|
|
1393
|
+
type ComposerFormat = "bold" | "italic" | "underline" | "strikethrough" | "code" | "h1" | "h2" | "h3" | "blockquote" | "pullquote" | "ul" | "ol";
|
|
1394
|
+
interface ComposerMentionItem {
|
|
1395
|
+
id: string;
|
|
1396
|
+
/** Display value (without the trigger char). */
|
|
1397
|
+
value: string;
|
|
1398
|
+
/** Optional secondary label shown in the suggester. */
|
|
1399
|
+
label?: string;
|
|
1400
|
+
/** Avatar URL or initials for the suggester row. */
|
|
1401
|
+
avatar?: string;
|
|
1402
|
+
/** Arbitrary payload the host can attach to the mention. */
|
|
1403
|
+
data?: Record<string, unknown>;
|
|
1404
|
+
}
|
|
1405
|
+
interface ComposerTriggerConfig {
|
|
1406
|
+
/** The trigger character, eg. "@" or "/". */
|
|
1407
|
+
char: string;
|
|
1408
|
+
/**
|
|
1409
|
+
* Items to populate the suggester. Either a static array or a
|
|
1410
|
+
* resolver function (sync or async) that receives the typed query.
|
|
1411
|
+
* The plugin filters automatically when items is an array.
|
|
1412
|
+
*/
|
|
1413
|
+
items: ComposerMentionItem[] | ((query: string) => ComposerMentionItem[] | Promise<ComposerMentionItem[]>);
|
|
1414
|
+
/**
|
|
1415
|
+
* Whether to strip the trigger char on insert. Defaults: keep for
|
|
1416
|
+
* "@" (mentions read as "@alice"), strip for "/" (commands read as
|
|
1417
|
+
* "Insert image" not "/insert-image").
|
|
1418
|
+
*/
|
|
1419
|
+
stripTrigger?: boolean;
|
|
1420
|
+
}
|
|
1421
|
+
interface ComposerAttachmentConfig {
|
|
1422
|
+
/** Master enable. Set true on the prop to use defaults, or pass a config object. */
|
|
1423
|
+
enabled?: boolean;
|
|
1424
|
+
/** HTML accept attribute on the file input. Default "image/*". */
|
|
1425
|
+
accept?: string;
|
|
1426
|
+
/** Max number of attachments. Default 10. */
|
|
1427
|
+
maxItems?: number;
|
|
1428
|
+
/** Allow multiple selection in the file picker. Default true. */
|
|
1429
|
+
multiple?: boolean;
|
|
1430
|
+
}
|
|
1431
|
+
interface ComposerAttachment {
|
|
1432
|
+
id: string;
|
|
1433
|
+
file: File;
|
|
1434
|
+
/** Object URL owned by the composer. Hosts must NOT revoke it. */
|
|
1435
|
+
previewUrl: string;
|
|
1436
|
+
name: string;
|
|
1437
|
+
}
|
|
1438
|
+
interface ComposerContent {
|
|
1439
|
+
/** Plain text representation of the editor contents (whitespace preserved). */
|
|
1440
|
+
text: string;
|
|
1441
|
+
/** Lexical editor state serialised to JSON (for round-trip persistence). */
|
|
1442
|
+
json: string;
|
|
1443
|
+
/** Resolved mention tokens in document order. */
|
|
1444
|
+
mentions: Array<{
|
|
1445
|
+
trigger: string;
|
|
1446
|
+
value: string;
|
|
1447
|
+
data?: Record<string, unknown>;
|
|
1448
|
+
}>;
|
|
1449
|
+
}
|
|
1450
|
+
interface ComposerHandle {
|
|
1451
|
+
/** Run a demo script imperatively (vs. via `steps` + `trigger="manual"`). */
|
|
1452
|
+
play: (steps: ComposerStep[]) => void;
|
|
1453
|
+
/** Cancel an in-flight demo. Idempotent. */
|
|
1454
|
+
stop: () => void;
|
|
1455
|
+
/**
|
|
1456
|
+
* One-shot replay of the configured `steps`. Cancels any in-flight
|
|
1457
|
+
* run, clears the editor, replays from step 0. Pass a delay (ms) to
|
|
1458
|
+
* schedule the replay (useful for chaining demos). Requires `steps`
|
|
1459
|
+
* to be configured.
|
|
1460
|
+
*/
|
|
1461
|
+
restart: (delayMs?: number) => void;
|
|
1462
|
+
/** Move focus into the editor. */
|
|
1463
|
+
focus: () => void;
|
|
1464
|
+
/** Wipe the editor. */
|
|
1465
|
+
clear: () => void;
|
|
1466
|
+
/** Insert plain text at the current selection. */
|
|
1467
|
+
insert: (text: string) => void;
|
|
1468
|
+
/** Snapshot the current content + mentions. */
|
|
1469
|
+
getContent: () => ComposerContent;
|
|
1470
|
+
/** Direct access to the underlying Lexical editor (escape hatch). */
|
|
1471
|
+
getEditor: () => LexicalEditor | null;
|
|
1472
|
+
}
|
|
1473
|
+
/**
|
|
1474
|
+
* Demo step vocabulary for Composer scripts. Shares `type` / `wait` /
|
|
1475
|
+
* `clear` with the universal `lib/demo` verbs; adds composer-specific
|
|
1476
|
+
* `mention`, `format`, `select`, `newline`, `submit` on top.
|
|
1477
|
+
*/
|
|
1478
|
+
type ComposerStep = {
|
|
1479
|
+
type: "type";
|
|
1480
|
+
text: string;
|
|
1481
|
+
speed?: DemoSpeed;
|
|
1482
|
+
} | {
|
|
1483
|
+
type: "wait";
|
|
1484
|
+
ms: number;
|
|
1485
|
+
} | {
|
|
1486
|
+
type: "clear";
|
|
1487
|
+
} | {
|
|
1488
|
+
type: "newline";
|
|
1489
|
+
} | {
|
|
1490
|
+
type: "submit";
|
|
1491
|
+
} | {
|
|
1492
|
+
type: "mention";
|
|
1493
|
+
/** Trigger char (must match a registered ComposerTriggerConfig.char). */
|
|
1494
|
+
trigger: string;
|
|
1495
|
+
/** Value to insert (without the trigger). Looks up the matching item by `value`. */
|
|
1496
|
+
value: string;
|
|
1497
|
+
/** Optional pre-typed query — the demo types this after the trigger char before "selecting" the value, to show the typeahead in action. */
|
|
1498
|
+
query?: string;
|
|
1499
|
+
} | {
|
|
1500
|
+
type: "format";
|
|
1501
|
+
format: ComposerFormat;
|
|
1502
|
+
} | {
|
|
1503
|
+
type: "select";
|
|
1504
|
+
/** Substring to find and select. First match wins. */
|
|
1505
|
+
text: string;
|
|
1506
|
+
};
|
|
1507
|
+
interface ComposerProps {
|
|
1508
|
+
/** Placeholder copy shown when empty. */
|
|
1509
|
+
placeholder?: string;
|
|
1510
|
+
/** Initial plain text content. For richer initial state, use `initialJson`. */
|
|
1511
|
+
initialText?: string;
|
|
1512
|
+
/** Initial Lexical state JSON (from a previous `onSubmit` round-trip). */
|
|
1513
|
+
initialJson?: string;
|
|
1514
|
+
/**
|
|
1515
|
+
* Available formats. Pass false to disable rich text entirely
|
|
1516
|
+
* (plain text mode, half the bundle weight, no toolbar). Default
|
|
1517
|
+
* enables a sensible set for most chat / comment surfaces.
|
|
1518
|
+
*/
|
|
1519
|
+
formats?: ComposerFormat[] | false;
|
|
1520
|
+
/**
|
|
1521
|
+
* Render the formatting toolbar. Default false because most uses
|
|
1522
|
+
* are short-form. Set true (or "top") to show the toolbar above the
|
|
1523
|
+
* editor. "floating" is planned; not yet implemented.
|
|
1524
|
+
*/
|
|
1525
|
+
toolbar?: boolean | "top";
|
|
1526
|
+
/**
|
|
1527
|
+
* Mention / slash command configs. Each entry registers one trigger
|
|
1528
|
+
* char and its items. Pass `[{ char: "@", items: people }, { char: "/", items: commands }]`
|
|
1529
|
+
* for the common chat-app setup.
|
|
1530
|
+
*/
|
|
1531
|
+
triggers?: ComposerTriggerConfig[];
|
|
1532
|
+
/**
|
|
1533
|
+
* Image attachments (paperclip + clipboard paste). Pass true for
|
|
1534
|
+
* defaults, an object to customise, or omit/false to skip the
|
|
1535
|
+
* attachment plumbing entirely.
|
|
1536
|
+
*/
|
|
1537
|
+
attachments?: boolean | ComposerAttachmentConfig;
|
|
1538
|
+
/** Fires when the user submits (Enter, click Send, or scripted `submit` step). */
|
|
1539
|
+
onSubmit?: (content: ComposerContent, attachments?: ComposerAttachment[]) => void;
|
|
1540
|
+
/**
|
|
1541
|
+
* Fires on every editor change with the current plain text. Use for
|
|
1542
|
+
* length validation, controlled-value bridges (eg. AIChatComposer
|
|
1543
|
+
* forwarding to a host's `value`/`onChange` pair), or live preview
|
|
1544
|
+
* surfaces. Cheap, called frequently; debounce if you need the
|
|
1545
|
+
* Lexical state JSON (use `getContent()` via ref instead).
|
|
1546
|
+
*/
|
|
1547
|
+
onChange?: (text: string) => void;
|
|
1548
|
+
/**
|
|
1549
|
+
* Loading state — disables the editor + paperclip and swaps the
|
|
1550
|
+
* default Send button for Stop. Has no effect when `rightActions`
|
|
1551
|
+
* overrides the default Send.
|
|
1552
|
+
*/
|
|
1553
|
+
isLoading?: boolean;
|
|
1554
|
+
/** Stop handler — required for Stop to be active when loading. */
|
|
1555
|
+
onStop?: () => void;
|
|
1556
|
+
/** Hard character cap. */
|
|
1557
|
+
maxLength?: number;
|
|
1558
|
+
/** Auto-focus the editor on mount. Default false. */
|
|
1559
|
+
autoFocus?: boolean;
|
|
1560
|
+
/** Whether Enter submits. Default true (Shift-Enter still inserts a newline). */
|
|
1561
|
+
submitOnEnter?: boolean;
|
|
1562
|
+
/**
|
|
1563
|
+
* Custom content for the left action slot. Replaces the default
|
|
1564
|
+
* paperclip button when `attachments` is enabled.
|
|
1565
|
+
*/
|
|
1566
|
+
leftActions?: React$1.ReactNode;
|
|
1567
|
+
/**
|
|
1568
|
+
* Custom content for the right action slot. Replaces the default
|
|
1569
|
+
* Send / Stop button. Use the `useComposer()` hook inside to access
|
|
1570
|
+
* imperative methods.
|
|
1571
|
+
*/
|
|
1572
|
+
rightActions?: React$1.ReactNode;
|
|
1573
|
+
/** Hide the default Send button without replacing it. */
|
|
1574
|
+
hideSend?: boolean;
|
|
1575
|
+
/** Scripted demo steps. */
|
|
1576
|
+
steps?: ComposerStep[];
|
|
1577
|
+
/** What kicks the script off. Defaults to "mount". */
|
|
1578
|
+
trigger?: DemoTrigger;
|
|
1579
|
+
/** For trigger="manual" — flip true to play. */
|
|
1580
|
+
play?: boolean;
|
|
1581
|
+
/** Animation feel. */
|
|
1582
|
+
speed?: DemoSpeed;
|
|
1583
|
+
/** Loop the script forever. */
|
|
1584
|
+
loop?: boolean;
|
|
1585
|
+
/**
|
|
1586
|
+
* Pause between loop iterations (ms). Defaults to 2000. Marketing
|
|
1587
|
+
* heroes that want the demo to breathe between repeats bump this
|
|
1588
|
+
* higher; tight inline demos drop it.
|
|
1589
|
+
*/
|
|
1590
|
+
loopDelay?: number;
|
|
1591
|
+
/**
|
|
1592
|
+
* Fires once per loop cycle, AFTER the loopDelay pause and BEFORE
|
|
1593
|
+
* the script replays. Use to reset parent state that the script
|
|
1594
|
+
* mutated via onSubmit (e.g., wipe a messages list back to its
|
|
1595
|
+
* seed before the demo types into it again). The editor is cleared
|
|
1596
|
+
* automatically — you only need this hook if state outside the
|
|
1597
|
+
* Composer needs to reset too.
|
|
1598
|
+
*/
|
|
1599
|
+
onLoopReset?: () => void;
|
|
1600
|
+
/**
|
|
1601
|
+
* Bare mode — strip the card chrome (border / bg / rounding). Use
|
|
1602
|
+
* when embedding inside an existing card or column layout.
|
|
1603
|
+
*/
|
|
1604
|
+
bare?: boolean;
|
|
1605
|
+
/**
|
|
1606
|
+
* Read-only mode — disables editing AND focusability. Programmatic
|
|
1607
|
+
* updates (including scripted demo playback) still work. Use for
|
|
1608
|
+
* marketing surfaces that render a Composer purely for show, so the
|
|
1609
|
+
* scripted typing doesn't steal focus from other inputs on the page.
|
|
1610
|
+
* Hides the default Send / paperclip action row.
|
|
1611
|
+
*/
|
|
1612
|
+
readOnly?: boolean;
|
|
1613
|
+
className?: string;
|
|
1614
|
+
}
|
|
1615
|
+
declare const Composer: React$1.ForwardRefExoticComponent<ComposerProps & React$1.RefAttributes<ComposerHandle>>;
|
|
1616
|
+
declare const ComposerReply: React$1.ForwardRefExoticComponent<ComposerProps & React$1.RefAttributes<ComposerHandle>>;
|
|
1617
|
+
|
|
938
1618
|
/**
|
|
939
1619
|
* DatePicker + DateRangePicker
|
|
940
1620
|
*
|
|
@@ -1232,7 +1912,7 @@ declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupP
|
|
|
1232
1912
|
* </ResizablePanelGroup>
|
|
1233
1913
|
*/
|
|
1234
1914
|
declare const ResizablePanelGroup: ({ className, ...props }: React$1.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => React$1.JSX.Element;
|
|
1235
|
-
declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<
|
|
1915
|
+
declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLHeadElement | HTMLElement | HTMLLinkElement | HTMLDivElement | HTMLObjectElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLButtonElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadingElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLMapElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLParagraphElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
|
|
1236
1916
|
className?: string | undefined;
|
|
1237
1917
|
collapsedSize?: number | undefined;
|
|
1238
1918
|
collapsible?: boolean | undefined;
|
|
@@ -1272,8 +1952,8 @@ declare const ResizableHandle: ({ withHandle, className, ...props }: React$1.Com
|
|
|
1272
1952
|
*/
|
|
1273
1953
|
declare const rowVariants: (props?: ({
|
|
1274
1954
|
gap?: "none" | "sm" | "md" | "lg" | "xs" | "xl" | "2xl" | null | undefined;
|
|
1275
|
-
align?: "
|
|
1276
|
-
justify?: "
|
|
1955
|
+
align?: "center" | "start" | "end" | "stretch" | "baseline" | null | undefined;
|
|
1956
|
+
justify?: "center" | "start" | "between" | "end" | "around" | "evenly" | null | undefined;
|
|
1277
1957
|
wrap?: boolean | null | undefined;
|
|
1278
1958
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1279
1959
|
interface RowProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof rowVariants> {
|
|
@@ -1308,7 +1988,7 @@ declare const Row: React$1.ForwardRefExoticComponent<RowProps & React$1.RefAttri
|
|
|
1308
1988
|
declare const gridVariants: (props?: ({
|
|
1309
1989
|
cols?: "1" | "2" | "3" | "4" | "5" | "6" | "12" | null | undefined;
|
|
1310
1990
|
gap?: "none" | "sm" | "md" | "lg" | "xs" | "xl" | "2xl" | null | undefined;
|
|
1311
|
-
align?: "
|
|
1991
|
+
align?: "center" | "start" | "end" | "stretch" | null | undefined;
|
|
1312
1992
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1313
1993
|
interface GridProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof gridVariants> {
|
|
1314
1994
|
/** When true, render as the single child element via Radix Slot — lets
|
|
@@ -1340,10 +2020,10 @@ declare const Grid: React$1.ForwardRefExoticComponent<GridProps & React$1.RefAtt
|
|
|
1340
2020
|
* case. Flex is the escape hatch, not the default.
|
|
1341
2021
|
*/
|
|
1342
2022
|
declare const flexVariants: (props?: ({
|
|
1343
|
-
direction?: "
|
|
2023
|
+
direction?: "col" | "row" | "row-reverse" | "col-reverse" | null | undefined;
|
|
1344
2024
|
gap?: "none" | "sm" | "md" | "lg" | "xs" | "xl" | "2xl" | null | undefined;
|
|
1345
|
-
align?: "
|
|
1346
|
-
justify?: "
|
|
2025
|
+
align?: "center" | "start" | "end" | "stretch" | "baseline" | null | undefined;
|
|
2026
|
+
justify?: "center" | "start" | "between" | "end" | "around" | "evenly" | null | undefined;
|
|
1347
2027
|
wrap?: "wrap" | "nowrap" | "wrap-reverse" | null | undefined;
|
|
1348
2028
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1349
2029
|
interface FlexProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof flexVariants> {
|
|
@@ -1389,7 +2069,7 @@ declare const SheetClose: React$1.ForwardRefExoticComponent<DialogPrimitive.Dial
|
|
|
1389
2069
|
declare const SheetPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
1390
2070
|
declare const SheetOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1391
2071
|
declare const sheetVariants: (props?: ({
|
|
1392
|
-
side?: "
|
|
2072
|
+
side?: "bottom" | "top" | "right" | "left" | null | undefined;
|
|
1393
2073
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1394
2074
|
interface SheetContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
1395
2075
|
/**
|
|
@@ -1528,8 +2208,8 @@ declare const Sortable: SortableRootComponent;
|
|
|
1528
2208
|
*/
|
|
1529
2209
|
declare const stackVariants: (props?: ({
|
|
1530
2210
|
gap?: "none" | "sm" | "md" | "lg" | "xs" | "xl" | "2xl" | null | undefined;
|
|
1531
|
-
align?: "
|
|
1532
|
-
justify?: "
|
|
2211
|
+
align?: "center" | "start" | "end" | "stretch" | null | undefined;
|
|
2212
|
+
justify?: "center" | "start" | "between" | "end" | "around" | "evenly" | null | undefined;
|
|
1533
2213
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1534
2214
|
interface StackProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof stackVariants> {
|
|
1535
2215
|
/** When true, render as the single child element via Radix Slot — lets
|
|
@@ -1749,7 +2429,7 @@ declare const ToggleGroupItem: React$1.ForwardRefExoticComponent<Omit<ToggleGrou
|
|
|
1749
2429
|
* persistent footer toolbars on mobile-style layouts.
|
|
1750
2430
|
*/
|
|
1751
2431
|
declare const toolbarVariants: (props?: ({
|
|
1752
|
-
position?: "
|
|
2432
|
+
position?: "bottom" | "top" | "inline" | null | undefined;
|
|
1753
2433
|
variant?: "default" | "transparent" | "subtle" | null | undefined;
|
|
1754
2434
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
1755
2435
|
sticky?: boolean | null | undefined;
|
|
@@ -3076,4 +3756,4 @@ declare function GradeModeSwitcher({ className, variant }: GradeModeSwitcherProp
|
|
|
3076
3756
|
*/
|
|
3077
3757
|
declare function ThemeToggle(): React$1.JSX.Element;
|
|
3078
3758
|
|
|
3079
|
-
export { ALL_MODES, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AppShell, AppShellAside, type AppShellAsideProps, AppShellFooter, type AppShellFooterProps, AppShellHeader, type AppShellHeaderProps, AppShellMain, type AppShellMainProps, AppShellNav, type AppShellNavProps, type AppShellProps, Avatar, AvatarFallback, AvatarImage, BUILT_IN_INPUTS, Badge, Banner, type BannerProps, type BaseMediaProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, type BreadcrumbMenuItem, BreadcrumbMenuTrigger, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonShape, COMPONENT_CONTRACTS, Calendar, CalendarDayButton, Callout, CalloutDescription, CalloutTitle, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardStyle, CardTitle, Carousel, CarouselArrows, type CarouselArrowsProps, type AutoplayConfig as CarouselAutoplayConfig, CarouselDots, type CarouselDotsProps, type CarouselNavButtonProps, CarouselNext, CarouselPrev, type CarouselProps, CarouselSlide, type CarouselSlideProps, CarouselVideoSlide, type CarouselVideoSlideProps, type ChartPalette, Checkbox, Code, type CodeDiff, type CodeLanguage, type CodeProps, type CodeReveal, type CodeTrigger, type ColorIntensity, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FRAGMENT_HEADER, Flex, type FlexProps, type FontKey, GRADE_PRE_HYDRATION_SCRIPT, type GeneratedTheme, GradeModeSwitcher, GradeThemeProvider, type GradeThemeProviderProps, GradeThemeSwitcher, Grid, type GridProps, Input, type InputStyle, Label, LenisProvider, Map, MapHandle, MapMarker, MapMarkerProps, MapProps, type MediaAspect, type MediaRadius, MediaSurface, MediaSurfaceContract, type MediaSurfaceProps, type ModeName, MultiSelect, type MultiSelectOption, type MultiSelectProps, type OKLCHTriplet, type Palette, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, type PostPreset, Progress, RadioGroup, RadioGroupItem, type RadiusStyle, type Ramp, ResizableHandle, ResizablePanel, ResizablePanelGroup, RivePlayer, type RivePlayerProps, Row, type RowProps, type SceneContext, type SceneFactory, type SceneHandle, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, ShaderCompileError, type ShaderPreset, ShaderPresetPicker, type ShaderPresetPickerProps, ShaderPresetPreview, type ShaderPresetPreviewProps, type ShadowIntensity, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, type SidebarContentProps, SidebarFooter, type SidebarFooterProps, SidebarHeader, type SidebarHeaderProps, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, SidebarTreeItem, type SidebarTreeItemProps, Skeleton, Slider, Sortable, SortableGroup, type SortableGroupProps, SortableHandle, type SortableHandleProps, SortableItem, type SortableItemProps, type SortableProps, type SpacingDensity, Stack, type StackProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type ThemeInput, ThemeToggle, ThreeScene, type ThreeSceneProps, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, type ToolbarProps, ToolbarSlot, type ToolbarSlotProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TypeScalePreset, VideoPlayer, type VideoPlayerProps, asideVariants as appShellAsideVariants, footerVariants as appShellFooterVariants, headerVariants as appShellHeaderVariants, mainVariants as appShellMainVariants, navVariants as appShellNavVariants, applyThemeToRoot, badgeVariants, bannerVariants, buildFragmentShaderScene, builtInThemes, buttonVariants, calloutVariants, calmInput, cn, defaultPostPreset, defaultThemeId, deleteUserTheme, duplicateTheme, energyInput, flexVariants, generateTheme, getComponentContract, getTheme, gridVariants, listContractedComponents, listThemes, listUserThemes, loadUserThemeInput, postPresets, rowVariants, saveUserTheme, sceneRegistry, shaderPresetById, shaderPresets, shellVariants, stackVariants, themeToCSSVars, toggleVariants, useCarouselApi, useGradeTheme, useMaybeGradeTheme, usePrefersReducedMotion };
|
|
3759
|
+
export { ALL_MODES, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AppShell, AppShellAside, type AppShellAsideProps, AppShellFooter, type AppShellFooterProps, AppShellHeader, type AppShellHeaderProps, AppShellMain, type AppShellMainProps, AppShellNav, type AppShellNavProps, type AppShellProps, Avatar, AvatarFallback, AvatarImage, BUILT_IN_INPUTS, Badge, Banner, type BannerProps, type BaseMediaProps, BlinkingCursor, type BlinkingCursorProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, type BreadcrumbMenuItem, BreadcrumbMenuTrigger, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonShape, COMPONENT_CONTRACTS, Calendar, CalendarDayButton, Callout, CalloutDescription, CalloutTitle, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardStyle, CardTitle, Carousel, CarouselArrows, type CarouselArrowsProps, type AutoplayConfig as CarouselAutoplayConfig, CarouselDots, type CarouselDotsProps, type CarouselNavButtonProps, CarouselNext, CarouselPrev, type CarouselProps, CarouselSlide, type CarouselSlideProps, CarouselVideoSlide, type CarouselVideoSlideProps, type ChartPalette, Checkbox, Code, type CodeDiff, type CodeLanguage, type CodeProps, type CodeReveal, type CodeTrigger, type ColorIntensity, Composer, type ComposerAttachment, type ComposerAttachmentConfig, type ComposerContent, type ComposerFormat, type ComposerHandle, type ComposerMentionItem, type ComposerProps, ComposerReply, type ComposerStep, type ComposerTriggerConfig, DEMO_SPEED_PRESETS, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type DemoSpeed, DemoStage, type DemoStageProps, type DemoTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FRAGMENT_HEADER, Flex, type FlexProps, type FontKey, GRADE_PRE_HYDRATION_SCRIPT, type GeneratedTheme, GradeModeSwitcher, GradeThemeProvider, type GradeThemeProviderProps, GradeThemeSwitcher, Grid, type GridProps, Input, type InputStyle, Label, LenisProvider, Map, MapHandle, MapMarker, MapMarkerProps, MapProps, type MediaAspect, type MediaRadius, MediaSurface, MediaSurfaceContract, type MediaSurfaceProps, Message, type MessageProps, type ModeName, MultiSelect, type MultiSelectOption, type MultiSelectProps, type OKLCHTriplet, type Palette, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, type PostPreset, Progress, RadioGroup, RadioGroupItem, type RadiusStyle, type Ramp, ResizableHandle, ResizablePanel, ResizablePanelGroup, Reveal, type RevealAnimation, type RevealProps, type RevealStep, RivePlayer, type RivePlayerProps, Row, type RowProps, type SceneContext, type SceneFactory, type SceneHandle, type ScriptedDemoContext, type ScriptedDemoState, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, ShaderCompileError, type ShaderPreset, ShaderPresetPicker, type ShaderPresetPickerProps, ShaderPresetPreview, type ShaderPresetPreviewProps, type ShadowIntensity, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, type SidebarContentProps, SidebarFooter, type SidebarFooterProps, SidebarHeader, type SidebarHeaderProps, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, SidebarTreeItem, type SidebarTreeItemProps, Skeleton, Slider, Sortable, SortableGroup, type SortableGroupProps, SortableHandle, type SortableHandleProps, SortableItem, type SortableItemProps, type SortableProps, type SpacingDensity, Stack, type StackProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type ThemeInput, ThemeToggle, ThreeScene, type ThreeSceneProps, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, type ToolbarProps, ToolbarSlot, type ToolbarSlotProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TypeScalePreset, type UseScriptedDemoOptions, VideoPlayer, type VideoPlayerProps, asideVariants as appShellAsideVariants, footerVariants as appShellFooterVariants, headerVariants as appShellHeaderVariants, mainVariants as appShellMainVariants, navVariants as appShellNavVariants, applyThemeToRoot, badgeVariants, bannerVariants, buildFragmentShaderScene, builtInThemes, buttonVariants, calloutVariants, calmInput, cn, defaultPostPreset, defaultThemeId, deleteUserTheme, sleep as demoSleep, typeText as demoTypeText, duplicateTheme, energyInput, flexVariants, generateTheme, getComponentContract, getTheme, gridVariants, listContractedComponents, listThemes, listUserThemes, loadUserThemeInput, postPresets, rowVariants, saveUserTheme, sceneRegistry, shaderPresetById, shaderPresets, shellVariants, stackVariants, themeToCSSVars, toggleVariants, useCarouselApi, useGradeTheme, useMaybeGradeTheme, usePrefersReducedMotion, useScriptedDemo };
|