@openwarelabs/ui 0.4.0 → 0.5.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 (31) hide show
  1. package/README.md +3 -2
  2. package/dist/components/ChainOfThought/ChainOfThought.d.cts +44 -0
  3. package/dist/components/ChainOfThought/ChainOfThought.d.ts +44 -0
  4. package/dist/components/Chat/ChatConversation.d.cts +48 -0
  5. package/dist/components/Chat/ChatConversation.d.ts +48 -0
  6. package/dist/components/Chat/ChatLoader.d.cts +21 -0
  7. package/dist/components/Chat/ChatLoader.d.ts +21 -0
  8. package/dist/components/Chat/ChatMessage.d.cts +93 -0
  9. package/dist/components/Chat/ChatMessage.d.ts +93 -0
  10. package/dist/components/ChatSource/ChatSource.d.cts +58 -0
  11. package/dist/components/ChatSource/ChatSource.d.ts +58 -0
  12. package/dist/components/ChatTool/ChatTool.d.cts +89 -0
  13. package/dist/components/ChatTool/ChatTool.d.ts +89 -0
  14. package/dist/components/PromptInput/PromptInput.d.cts +95 -0
  15. package/dist/components/PromptInput/PromptInput.d.ts +95 -0
  16. package/dist/components/PromptInput/PromptSuggestion.d.cts +36 -0
  17. package/dist/components/PromptInput/PromptSuggestion.d.ts +36 -0
  18. package/dist/components/Prose/Prose.d.cts +22 -0
  19. package/dist/components/Prose/Prose.d.ts +22 -0
  20. package/dist/components/TextShimmer/TextShimmer.d.cts +20 -0
  21. package/dist/components/TextShimmer/TextShimmer.d.ts +20 -0
  22. package/dist/components.css +2524 -0
  23. package/dist/index.cjs +1548 -73
  24. package/dist/index.cjs.map +4 -4
  25. package/dist/index.d.cts +20 -0
  26. package/dist/index.d.ts +20 -0
  27. package/dist/index.js +1573 -72
  28. package/dist/index.js.map +4 -4
  29. package/dist/openware-ui.iife.js +7 -6
  30. package/dist/styles.css +2524 -0
  31. package/package.json +1 -1
@@ -0,0 +1,89 @@
1
+ import { type HTMLAttributes, type ReactNode } from "react";
2
+ /**
3
+ * Where a tool call or a step has got to. `approval` waits for a person to approve it; `cancelled` didn't run or didn't
4
+ * finish because a person denied it or stopped the run.
5
+ */
6
+ export type ChatToolStatus = "pending" | "running" | "success" | "error" | "approval" | "cancelled";
7
+ /** The round mark before a tool call or a step: a spinner, a check, a cross, a "!", a slash or a hollow ring, with its status as words for screen readers. */
8
+ export declare function ChatStatusMarker({ status, icon }: {
9
+ status: ChatToolStatus;
10
+ icon?: ReactNode;
11
+ }): import("react").JSX.Element;
12
+ /** "380 ms", "4.2 s", "12 s", "1 min 12 s", "1 h 4 min": a duration as people say it, with the locale's digits. */
13
+ export declare function formatDuration(ms: number, locale?: string): string;
14
+ /** A duration in a <time> element, so it carries a machine-readable value too. */
15
+ export declare function ChatDuration({ ms, locale, className }: {
16
+ ms: number;
17
+ locale?: string;
18
+ className?: string;
19
+ }): import("react").JSX.Element;
20
+ /**
21
+ * Open state that follows a status: it opens when `wantsOpen` turns true (an error, a step under way) and closes again
22
+ * when it turns false, unless the person has opened or closed it themselves since. A controlled `expanded` is left alone.
23
+ */
24
+ export declare function useStatusExpansion({ expanded, defaultExpanded, onExpandedChange, wantsOpen, closeWhenSettled, initial, }: {
25
+ expanded: boolean | undefined;
26
+ defaultExpanded: boolean | undefined;
27
+ onExpandedChange: ((expanded: boolean) => void) | undefined;
28
+ wantsOpen: boolean;
29
+ closeWhenSettled?: boolean;
30
+ initial?: boolean;
31
+ }): [boolean, () => void];
32
+ /**
33
+ * A panel that opens and closes under a disclosure button, animating its height (a 0fr → 1fr grid row). Closed, it's
34
+ * inert: nothing in it can be tabbed to or read out. `bleed` lets focus rings at its edges show past the clip.
35
+ */
36
+ export declare function ChatCollapse({ id, open, bleed, className, children, }: {
37
+ id: string;
38
+ open: boolean;
39
+ bleed?: boolean;
40
+ className?: string;
41
+ children: ReactNode;
42
+ }): import("react").JSX.Element;
43
+ export interface ChatToolProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
44
+ /** What the agent is doing, in words: "Run the test suite". */
45
+ title: ReactNode;
46
+ /** The tool it calls, shown in code type beside the title: "run_tests". */
47
+ name?: string;
48
+ /** A 15px icon for the tool, before the title. */
49
+ icon?: ReactNode;
50
+ /** Where the call has got to. Running shows a spinner and a shimmering title; `approval` asks the person to approve it;
51
+ * `cancelled` is for a call they denied, or one the run stopped before it finished: say which in `summary`. */
52
+ status: ChatToolStatus;
53
+ /** The result in one line: "212 tests passed", "Read 3 files". */
54
+ summary?: ReactNode;
55
+ /** How long it took, or has taken so far, in milliseconds. Shown as "4.2 s". */
56
+ duration?: number;
57
+ /** What the tool was called with: a one-line string (a command) in a Snippet, a longer one in a code block, or an
58
+ * object as formatted JSON. Shown under "Input". */
59
+ input?: string | Record<string, unknown> | unknown[];
60
+ /** What the tool returned: a string in a code block, or any node (a list of files, a link). Shown under "Output". */
61
+ output?: ReactNode;
62
+ /** What went wrong, shown in the danger colour under "Error". */
63
+ error?: ReactNode;
64
+ /** Whether the input and output show. Leave out to let it follow the status: closed, opening for an error or an approval. */
65
+ expanded?: boolean;
66
+ /** Whether it starts open. Defaults to open for an error or an approval and closed otherwise. */
67
+ defaultExpanded?: boolean;
68
+ /** Called with the new state when it opens or closes, by the person or by a change of status. */
69
+ onExpandedChange?(expanded: boolean): void;
70
+ /** What it asks to do, while `status` is "approval". Defaults to "Wants to run" and the tool's name. */
71
+ approvalMessage?: ReactNode;
72
+ /** The approve button's label: name the action, e.g. "Approve and publish".
73
+ * @default "Approve" */
74
+ approveLabel?: string;
75
+ /** The deny button's label, e.g. "Don't publish".
76
+ * @default "Deny" */
77
+ denyLabel?: string;
78
+ /** Called when the person approves the call. Move `status` on from "approval" in response. */
79
+ onApprove?(): void;
80
+ /** Called when the person refuses the call. Move `status` on to "cancelled" in response. */
81
+ onDeny?(): void;
82
+ /** The locale for the duration's digits, e.g. "de-CH". Defaults to the browser's. */
83
+ locale?: string;
84
+ }
85
+ /**
86
+ * One tool call an agent makes: what it's doing, the tool, its status and result on one row, which opens to show the
87
+ * input and output. A failed call opens to its error, and a call that needs approval asks for it with Approve and Deny.
88
+ */
89
+ export declare const ChatTool: import("react").ForwardRefExoticComponent<ChatToolProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,89 @@
1
+ import { type HTMLAttributes, type ReactNode } from "react";
2
+ /**
3
+ * Where a tool call or a step has got to. `approval` waits for a person to approve it; `cancelled` didn't run or didn't
4
+ * finish because a person denied it or stopped the run.
5
+ */
6
+ export type ChatToolStatus = "pending" | "running" | "success" | "error" | "approval" | "cancelled";
7
+ /** The round mark before a tool call or a step: a spinner, a check, a cross, a "!", a slash or a hollow ring, with its status as words for screen readers. */
8
+ export declare function ChatStatusMarker({ status, icon }: {
9
+ status: ChatToolStatus;
10
+ icon?: ReactNode;
11
+ }): import("react").JSX.Element;
12
+ /** "380 ms", "4.2 s", "12 s", "1 min 12 s", "1 h 4 min": a duration as people say it, with the locale's digits. */
13
+ export declare function formatDuration(ms: number, locale?: string): string;
14
+ /** A duration in a <time> element, so it carries a machine-readable value too. */
15
+ export declare function ChatDuration({ ms, locale, className }: {
16
+ ms: number;
17
+ locale?: string;
18
+ className?: string;
19
+ }): import("react").JSX.Element;
20
+ /**
21
+ * Open state that follows a status: it opens when `wantsOpen` turns true (an error, a step under way) and closes again
22
+ * when it turns false, unless the person has opened or closed it themselves since. A controlled `expanded` is left alone.
23
+ */
24
+ export declare function useStatusExpansion({ expanded, defaultExpanded, onExpandedChange, wantsOpen, closeWhenSettled, initial, }: {
25
+ expanded: boolean | undefined;
26
+ defaultExpanded: boolean | undefined;
27
+ onExpandedChange: ((expanded: boolean) => void) | undefined;
28
+ wantsOpen: boolean;
29
+ closeWhenSettled?: boolean;
30
+ initial?: boolean;
31
+ }): [boolean, () => void];
32
+ /**
33
+ * A panel that opens and closes under a disclosure button, animating its height (a 0fr → 1fr grid row). Closed, it's
34
+ * inert: nothing in it can be tabbed to or read out. `bleed` lets focus rings at its edges show past the clip.
35
+ */
36
+ export declare function ChatCollapse({ id, open, bleed, className, children, }: {
37
+ id: string;
38
+ open: boolean;
39
+ bleed?: boolean;
40
+ className?: string;
41
+ children: ReactNode;
42
+ }): import("react").JSX.Element;
43
+ export interface ChatToolProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
44
+ /** What the agent is doing, in words: "Run the test suite". */
45
+ title: ReactNode;
46
+ /** The tool it calls, shown in code type beside the title: "run_tests". */
47
+ name?: string;
48
+ /** A 15px icon for the tool, before the title. */
49
+ icon?: ReactNode;
50
+ /** Where the call has got to. Running shows a spinner and a shimmering title; `approval` asks the person to approve it;
51
+ * `cancelled` is for a call they denied, or one the run stopped before it finished: say which in `summary`. */
52
+ status: ChatToolStatus;
53
+ /** The result in one line: "212 tests passed", "Read 3 files". */
54
+ summary?: ReactNode;
55
+ /** How long it took, or has taken so far, in milliseconds. Shown as "4.2 s". */
56
+ duration?: number;
57
+ /** What the tool was called with: a one-line string (a command) in a Snippet, a longer one in a code block, or an
58
+ * object as formatted JSON. Shown under "Input". */
59
+ input?: string | Record<string, unknown> | unknown[];
60
+ /** What the tool returned: a string in a code block, or any node (a list of files, a link). Shown under "Output". */
61
+ output?: ReactNode;
62
+ /** What went wrong, shown in the danger colour under "Error". */
63
+ error?: ReactNode;
64
+ /** Whether the input and output show. Leave out to let it follow the status: closed, opening for an error or an approval. */
65
+ expanded?: boolean;
66
+ /** Whether it starts open. Defaults to open for an error or an approval and closed otherwise. */
67
+ defaultExpanded?: boolean;
68
+ /** Called with the new state when it opens or closes, by the person or by a change of status. */
69
+ onExpandedChange?(expanded: boolean): void;
70
+ /** What it asks to do, while `status` is "approval". Defaults to "Wants to run" and the tool's name. */
71
+ approvalMessage?: ReactNode;
72
+ /** The approve button's label: name the action, e.g. "Approve and publish".
73
+ * @default "Approve" */
74
+ approveLabel?: string;
75
+ /** The deny button's label, e.g. "Don't publish".
76
+ * @default "Deny" */
77
+ denyLabel?: string;
78
+ /** Called when the person approves the call. Move `status` on from "approval" in response. */
79
+ onApprove?(): void;
80
+ /** Called when the person refuses the call. Move `status` on to "cancelled" in response. */
81
+ onDeny?(): void;
82
+ /** The locale for the duration's digits, e.g. "de-CH". Defaults to the browser's. */
83
+ locale?: string;
84
+ }
85
+ /**
86
+ * One tool call an agent makes: what it's doing, the tool, its status and result on one row, which opens to show the
87
+ * input and output. A failed call opens to its error, and a call that needs approval asks for it with Approve and Deny.
88
+ */
89
+ export declare const ChatTool: import("react").ForwardRefExoticComponent<ChatToolProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,95 @@
1
+ import { type KeyboardEvent, type ReactNode } from "react";
2
+ /** A file attached to the message, shown as a chip above the text. */
3
+ export interface PromptAttachment {
4
+ /** Identifies it to onRemoveAttachment, and keys its chip. */
5
+ id: string;
6
+ /** The file name, shown on the chip (a long one is cut short before its extension) and read out by its remove button. */
7
+ name: string;
8
+ /** Bytes, shown under the name: "48 kB". */
9
+ size?: number;
10
+ /** The MIME type, such as "image/png". With the name, it picks the chip's icon when there's no preview. */
11
+ type?: string;
12
+ /** An image to show as the chip's thumbnail: an object URL from URL.createObjectURL, or any image URL. */
13
+ previewUrl?: string;
14
+ }
15
+ export interface PromptInputProps {
16
+ /** The text, when controlled. Clear it yourself in onSubmit. */
17
+ value?: string;
18
+ /** The starting text when uncontrolled. The box clears itself after each send.
19
+ * @default "" */
20
+ defaultValue?: string;
21
+ /** Called with the text on every change. */
22
+ onChange?(value: string): void;
23
+ /**
24
+ * Called on Enter or the send button with the text (trimmed) and the attachments. It isn't called while there's
25
+ * nothing to send (no text and no attachments), while streaming, or while disabled.
26
+ */
27
+ onSubmit?(value: string, attachments: PromptAttachment[]): void;
28
+ /** The agent is replying: the send button becomes a Stop button and Escape in the box stops it. The next message can
29
+ * be typed meanwhile, but not sent.
30
+ * @default false */
31
+ isStreaming?: boolean;
32
+ /** Called by the Stop button, and by Escape in the box, while streaming. */
33
+ onStop?(): void;
34
+ /** The files attached so far, as chips above the text. You keep the list: add to it in onAttach and take from it in
35
+ * onRemoveAttachment. */
36
+ attachments?: PromptAttachment[];
37
+ /** Called with the files picked with the paperclip, pasted, or dropped on the box. Giving it shows the paperclip. */
38
+ onAttach?(files: File[]): void;
39
+ /** Called with an attachment's id when its remove button is pressed. Giving it shows the remove buttons. */
40
+ onRemoveAttachment?(id: string): void;
41
+ /** File types to accept, as for <input accept>: "image/*,.log,.txt". Other files are turned away with a message. */
42
+ accept?: string;
43
+ /** Lets several files be attached at once.
44
+ * @default true */
45
+ multiple?: boolean;
46
+ /** Controls at the start of the toolbar under the text, after the paperclip: a model Select, a toggle. Buttons here
47
+ * should be size sm. */
48
+ startActions?: ReactNode;
49
+ /** Controls at the end of the toolbar, before the send button. */
50
+ endActions?: ReactNode;
51
+ /** A muted line under the box, such as how to send: "Enter to send, Shift + Enter for a new line". The text box
52
+ * points to it with aria-describedby. */
53
+ hint?: ReactNode;
54
+ /** @default "Message the agent…" */
55
+ placeholder?: string;
56
+ /** Names the text box for screen readers. It's "Message" unless something else labels it: aria-labelledby, or an id
57
+ * that a <label> points to, as in a Field. */
58
+ "aria-label"?: string;
59
+ "aria-labelledby"?: string;
60
+ "aria-describedby"?: string;
61
+ /** The text box's id. Field sets it. */
62
+ id?: string;
63
+ /** Marks the box invalid: a danger border, and aria-invalid on the text box. Field sets it from its error.
64
+ * @default false */
65
+ isInvalid?: boolean;
66
+ /** Turns off the text box, its buttons and the controls in the toolbar, and fades the box.
67
+ * @default false */
68
+ disabled?: boolean;
69
+ /** Focuses the text box when it appears. Use it where typing is plainly the next step, such as a new chat.
70
+ * @default false */
71
+ autoFocus?: boolean;
72
+ /** The most characters the text can have. A quiet count shows once it's 80% full. */
73
+ maxLength?: number;
74
+ /** The rows of text the box shows when it's empty.
75
+ * @default 1 */
76
+ minRows?: number;
77
+ /** The most rows it grows to; past that, the text scrolls.
78
+ * @default 8 */
79
+ maxRows?: number;
80
+ /** md for a chat page, sm for a side panel or a reply box.
81
+ * @default "md" */
82
+ size?: "sm" | "md";
83
+ /** The locale for attachment sizes and the character count, such as "de-CH". Defaults to the browser's. */
84
+ locale?: string;
85
+ /** Called for each key in the text box before the box's own keys. Call event.preventDefault() to take a key over, for
86
+ * example the Up arrow to edit the last message. */
87
+ onKeyDown?(event: KeyboardEvent<HTMLTextAreaElement>): void;
88
+ /** Classes for the outer element, which holds the box and the hint. */
89
+ className?: string;
90
+ }
91
+ /**
92
+ * The box you write to the agent in. Enter sends and Shift+Enter starts a new line; it grows with the text, takes files
93
+ * from a picker, the clipboard or a drop, and turns its send button into Stop while the agent replies.
94
+ */
95
+ export declare const PromptInput: import("react").ForwardRefExoticComponent<PromptInputProps & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -0,0 +1,95 @@
1
+ import { type KeyboardEvent, type ReactNode } from "react";
2
+ /** A file attached to the message, shown as a chip above the text. */
3
+ export interface PromptAttachment {
4
+ /** Identifies it to onRemoveAttachment, and keys its chip. */
5
+ id: string;
6
+ /** The file name, shown on the chip (a long one is cut short before its extension) and read out by its remove button. */
7
+ name: string;
8
+ /** Bytes, shown under the name: "48 kB". */
9
+ size?: number;
10
+ /** The MIME type, such as "image/png". With the name, it picks the chip's icon when there's no preview. */
11
+ type?: string;
12
+ /** An image to show as the chip's thumbnail: an object URL from URL.createObjectURL, or any image URL. */
13
+ previewUrl?: string;
14
+ }
15
+ export interface PromptInputProps {
16
+ /** The text, when controlled. Clear it yourself in onSubmit. */
17
+ value?: string;
18
+ /** The starting text when uncontrolled. The box clears itself after each send.
19
+ * @default "" */
20
+ defaultValue?: string;
21
+ /** Called with the text on every change. */
22
+ onChange?(value: string): void;
23
+ /**
24
+ * Called on Enter or the send button with the text (trimmed) and the attachments. It isn't called while there's
25
+ * nothing to send (no text and no attachments), while streaming, or while disabled.
26
+ */
27
+ onSubmit?(value: string, attachments: PromptAttachment[]): void;
28
+ /** The agent is replying: the send button becomes a Stop button and Escape in the box stops it. The next message can
29
+ * be typed meanwhile, but not sent.
30
+ * @default false */
31
+ isStreaming?: boolean;
32
+ /** Called by the Stop button, and by Escape in the box, while streaming. */
33
+ onStop?(): void;
34
+ /** The files attached so far, as chips above the text. You keep the list: add to it in onAttach and take from it in
35
+ * onRemoveAttachment. */
36
+ attachments?: PromptAttachment[];
37
+ /** Called with the files picked with the paperclip, pasted, or dropped on the box. Giving it shows the paperclip. */
38
+ onAttach?(files: File[]): void;
39
+ /** Called with an attachment's id when its remove button is pressed. Giving it shows the remove buttons. */
40
+ onRemoveAttachment?(id: string): void;
41
+ /** File types to accept, as for <input accept>: "image/*,.log,.txt". Other files are turned away with a message. */
42
+ accept?: string;
43
+ /** Lets several files be attached at once.
44
+ * @default true */
45
+ multiple?: boolean;
46
+ /** Controls at the start of the toolbar under the text, after the paperclip: a model Select, a toggle. Buttons here
47
+ * should be size sm. */
48
+ startActions?: ReactNode;
49
+ /** Controls at the end of the toolbar, before the send button. */
50
+ endActions?: ReactNode;
51
+ /** A muted line under the box, such as how to send: "Enter to send, Shift + Enter for a new line". The text box
52
+ * points to it with aria-describedby. */
53
+ hint?: ReactNode;
54
+ /** @default "Message the agent…" */
55
+ placeholder?: string;
56
+ /** Names the text box for screen readers. It's "Message" unless something else labels it: aria-labelledby, or an id
57
+ * that a <label> points to, as in a Field. */
58
+ "aria-label"?: string;
59
+ "aria-labelledby"?: string;
60
+ "aria-describedby"?: string;
61
+ /** The text box's id. Field sets it. */
62
+ id?: string;
63
+ /** Marks the box invalid: a danger border, and aria-invalid on the text box. Field sets it from its error.
64
+ * @default false */
65
+ isInvalid?: boolean;
66
+ /** Turns off the text box, its buttons and the controls in the toolbar, and fades the box.
67
+ * @default false */
68
+ disabled?: boolean;
69
+ /** Focuses the text box when it appears. Use it where typing is plainly the next step, such as a new chat.
70
+ * @default false */
71
+ autoFocus?: boolean;
72
+ /** The most characters the text can have. A quiet count shows once it's 80% full. */
73
+ maxLength?: number;
74
+ /** The rows of text the box shows when it's empty.
75
+ * @default 1 */
76
+ minRows?: number;
77
+ /** The most rows it grows to; past that, the text scrolls.
78
+ * @default 8 */
79
+ maxRows?: number;
80
+ /** md for a chat page, sm for a side panel or a reply box.
81
+ * @default "md" */
82
+ size?: "sm" | "md";
83
+ /** The locale for attachment sizes and the character count, such as "de-CH". Defaults to the browser's. */
84
+ locale?: string;
85
+ /** Called for each key in the text box before the box's own keys. Call event.preventDefault() to take a key over, for
86
+ * example the Up arrow to edit the last message. */
87
+ onKeyDown?(event: KeyboardEvent<HTMLTextAreaElement>): void;
88
+ /** Classes for the outer element, which holds the box and the hint. */
89
+ className?: string;
90
+ }
91
+ /**
92
+ * The box you write to the agent in. Enter sends and Shift+Enter starts a new line; it grows with the text, takes files
93
+ * from a picker, the clipboard or a drop, and turns its send button into Stop while the agent replies.
94
+ */
95
+ export declare const PromptInput: import("react").ForwardRefExoticComponent<PromptInputProps & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -0,0 +1,36 @@
1
+ import { type ButtonHTMLAttributes, type HTMLAttributes, type ReactNode } from "react";
2
+ export interface PromptSuggestionProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
3
+ /** The suggested prompt, or a short title for it. Keep it to a few words on a pill. */
4
+ children: ReactNode;
5
+ /** A 16px lucide-react icon before the text. */
6
+ icon?: ReactNode;
7
+ /** A muted second line under the text, saying what the agent will do. Shown on cards. */
8
+ description?: ReactNode;
9
+ /** `pill` for a row of short prompts; `card` for a few larger starting points, each with a description.
10
+ * @default "card" with a description, otherwise "pill" */
11
+ variant?: "pill" | "card";
12
+ }
13
+ /**
14
+ * A suggested prompt to start from: a quiet pill, or a card with a second line. It's a button: what it does on click,
15
+ * filling the prompt box or sending at once, is up to you.
16
+ */
17
+ export declare const PromptSuggestion: import("react").ForwardRefExoticComponent<PromptSuggestionProps & import("react").RefAttributes<HTMLButtonElement>>;
18
+ export interface PromptSuggestionsProps extends HTMLAttributes<HTMLDivElement> {
19
+ /** PromptSuggestion buttons. */
20
+ children: ReactNode;
21
+ /** `wrap` runs pills along a line and onto the next; `grid` sets cards in equal columns that fold to one when
22
+ * there's no room.
23
+ * @default "wrap" */
24
+ layout?: "wrap" | "grid";
25
+ /** The most columns in a grid. Columns are at least 200px wide, so a narrow grid has fewer.
26
+ * @default 2 */
27
+ columns?: number;
28
+ /** Where wrapped pills line up.
29
+ * @default "start" */
30
+ align?: "start" | "center";
31
+ /** Names the set for screen readers.
32
+ * @default "Suggested prompts" */
33
+ "aria-label"?: string;
34
+ }
35
+ /** Suggested prompts, as a labelled group: pills that wrap, or cards in a grid. */
36
+ export declare function PromptSuggestions({ children, layout, columns, align, "aria-label": ariaLabel, className, style, ...props }: PromptSuggestionsProps): import("react").JSX.Element;
@@ -0,0 +1,36 @@
1
+ import { type ButtonHTMLAttributes, type HTMLAttributes, type ReactNode } from "react";
2
+ export interface PromptSuggestionProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
3
+ /** The suggested prompt, or a short title for it. Keep it to a few words on a pill. */
4
+ children: ReactNode;
5
+ /** A 16px lucide-react icon before the text. */
6
+ icon?: ReactNode;
7
+ /** A muted second line under the text, saying what the agent will do. Shown on cards. */
8
+ description?: ReactNode;
9
+ /** `pill` for a row of short prompts; `card` for a few larger starting points, each with a description.
10
+ * @default "card" with a description, otherwise "pill" */
11
+ variant?: "pill" | "card";
12
+ }
13
+ /**
14
+ * A suggested prompt to start from: a quiet pill, or a card with a second line. It's a button: what it does on click,
15
+ * filling the prompt box or sending at once, is up to you.
16
+ */
17
+ export declare const PromptSuggestion: import("react").ForwardRefExoticComponent<PromptSuggestionProps & import("react").RefAttributes<HTMLButtonElement>>;
18
+ export interface PromptSuggestionsProps extends HTMLAttributes<HTMLDivElement> {
19
+ /** PromptSuggestion buttons. */
20
+ children: ReactNode;
21
+ /** `wrap` runs pills along a line and onto the next; `grid` sets cards in equal columns that fold to one when
22
+ * there's no room.
23
+ * @default "wrap" */
24
+ layout?: "wrap" | "grid";
25
+ /** The most columns in a grid. Columns are at least 200px wide, so a narrow grid has fewer.
26
+ * @default 2 */
27
+ columns?: number;
28
+ /** Where wrapped pills line up.
29
+ * @default "start" */
30
+ align?: "start" | "center";
31
+ /** Names the set for screen readers.
32
+ * @default "Suggested prompts" */
33
+ "aria-label"?: string;
34
+ }
35
+ /** Suggested prompts, as a labelled group: pills that wrap, or cards in a grid. */
36
+ export declare function PromptSuggestions({ children, layout, columns, align, "aria-label": ariaLabel, className, style, ...props }: PromptSuggestionsProps): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { type HTMLAttributes, type ReactNode } from "react";
2
+ export interface ProseProps extends HTMLAttributes<HTMLElement> {
3
+ /** sm sets 14px interface text with a tight rhythm and modest headings, for chat answers and comments. md sets the prose
4
+ * style (16.5px, 1.7 leading) with headings from the type scale, for articles and docs.
5
+ * @default "md" */
6
+ size?: "sm" | "md";
7
+ /** Drops the readable width (about 68 characters a line at md) so the text runs the full width of its container. sm has no
8
+ * maximum width to drop.
9
+ * @default false */
10
+ fullWidth?: boolean;
11
+ /** The element: article for a post, section for part of a page.
12
+ * @default "div" */
13
+ as?: "div" | "article" | "section" | "main" | "aside";
14
+ /** Plain HTML elements to style: what a Markdown renderer, a CMS or a server gives back. */
15
+ children?: ReactNode;
16
+ }
17
+ /**
18
+ * Styles content you don't write element by element: Markdown rendered to HTML, a CMS body, an agent's answer. It sets
19
+ * the plain elements inside it (headings, paragraphs, lists, quotes, code, tables, images, details) in Openware's type
20
+ * and colours, and leaves Openware components inside it as they are.
21
+ */
22
+ export declare const Prose: import("react").ForwardRefExoticComponent<ProseProps & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,22 @@
1
+ import { type HTMLAttributes, type ReactNode } from "react";
2
+ export interface ProseProps extends HTMLAttributes<HTMLElement> {
3
+ /** sm sets 14px interface text with a tight rhythm and modest headings, for chat answers and comments. md sets the prose
4
+ * style (16.5px, 1.7 leading) with headings from the type scale, for articles and docs.
5
+ * @default "md" */
6
+ size?: "sm" | "md";
7
+ /** Drops the readable width (about 68 characters a line at md) so the text runs the full width of its container. sm has no
8
+ * maximum width to drop.
9
+ * @default false */
10
+ fullWidth?: boolean;
11
+ /** The element: article for a post, section for part of a page.
12
+ * @default "div" */
13
+ as?: "div" | "article" | "section" | "main" | "aside";
14
+ /** Plain HTML elements to style: what a Markdown renderer, a CMS or a server gives back. */
15
+ children?: ReactNode;
16
+ }
17
+ /**
18
+ * Styles content you don't write element by element: Markdown rendered to HTML, a CMS body, an agent's answer. It sets
19
+ * the plain elements inside it (headings, paragraphs, lists, quotes, code, tables, images, details) in Openware's type
20
+ * and colours, and leaves Openware components inside it as they are.
21
+ */
22
+ export declare const Prose: import("react").ForwardRefExoticComponent<ProseProps & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,20 @@
1
+ import type { JSX, ReactNode } from "react";
2
+ export interface TextShimmerProps {
3
+ /** The words that shimmer, usually a status ending in an ellipsis: "Thinking…", "Running tests…". */
4
+ children: ReactNode;
5
+ /** The element, so it can sit in a heading or a paragraph.
6
+ * @default "span" */
7
+ as?: keyof JSX.IntrinsicElements;
8
+ /** Seconds for the highlight to cross the text once.
9
+ * @default 2 */
10
+ duration?: number;
11
+ /** Stops the shimmer and shows the text plainly, e.g. once the step has finished.
12
+ * @default true */
13
+ active?: boolean;
14
+ className?: string;
15
+ }
16
+ /**
17
+ * Text with a highlight sweeping across it, for work in progress: "Thinking…", "Searching the codebase…". It's plain
18
+ * text to screen readers, and stands still when the person prefers reduced motion.
19
+ */
20
+ export declare function TextShimmer({ children, as, duration, active, className }: TextShimmerProps): JSX.Element;
@@ -0,0 +1,20 @@
1
+ import type { JSX, ReactNode } from "react";
2
+ export interface TextShimmerProps {
3
+ /** The words that shimmer, usually a status ending in an ellipsis: "Thinking…", "Running tests…". */
4
+ children: ReactNode;
5
+ /** The element, so it can sit in a heading or a paragraph.
6
+ * @default "span" */
7
+ as?: keyof JSX.IntrinsicElements;
8
+ /** Seconds for the highlight to cross the text once.
9
+ * @default 2 */
10
+ duration?: number;
11
+ /** Stops the shimmer and shows the text plainly, e.g. once the step has finished.
12
+ * @default true */
13
+ active?: boolean;
14
+ className?: string;
15
+ }
16
+ /**
17
+ * Text with a highlight sweeping across it, for work in progress: "Thinking…", "Searching the codebase…". It's plain
18
+ * text to screen readers, and stands still when the person prefers reduced motion.
19
+ */
20
+ export declare function TextShimmer({ children, as, duration, active, className }: TextShimmerProps): JSX.Element;