@ciridae/ui 1.0.2 → 1.0.3
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/dist/app/auth.d.ts +10 -0
- package/dist/app/auth.js +60 -0
- package/dist/app/error-boundary.d.ts +18 -0
- package/dist/app/error-boundary.js +45 -0
- package/dist/app/feedback.d.ts +12 -0
- package/dist/app/feedback.js +128 -0
- package/dist/app/index.d.ts +8 -0
- package/dist/app/index.js +8 -0
- package/dist/app/request-errors.d.ts +63 -0
- package/dist/app/request-errors.js +172 -0
- package/dist/app/sentry.d.ts +18 -0
- package/dist/app/sentry.js +52 -0
- package/dist/app/telemetry.d.ts +7 -0
- package/dist/app/telemetry.js +28 -0
- package/dist/app/trail.d.ts +9 -0
- package/dist/app/trail.js +18 -0
- package/dist/chat/chat-query-keys.d.ts +3 -3
- package/dist/chat/contract.d.ts +15 -15
- package/dist/chat/conversation-items-query-options.d.ts +114 -114
- package/dist/chat/conversation-source.d.ts +75 -0
- package/dist/chat/conversation-source.js +1 -0
- package/dist/chat/message-text.d.ts +1 -1
- package/dist/chat/message-text.js +114 -46
- package/dist/chat/use-conversation-list.d.ts +6 -6
- package/dist/components/activity-feed.d.ts +2 -2
- package/dist/components/agent-work.d.ts +3 -3
- package/dist/components/app-frame.d.ts +79 -0
- package/dist/components/app-frame.js +92 -0
- package/dist/components/app-navigation.d.ts +3 -3
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/brand-icons.d.ts +3 -3
- package/dist/components/bulk-action-bar.d.ts +1 -1
- package/dist/components/button.d.ts +4 -4
- package/dist/components/calendar.d.ts +1 -1
- package/dist/components/centered-page.d.ts +1 -1
- package/dist/components/chart.d.ts +22 -2
- package/dist/components/chart.js +239 -44
- package/dist/components/chat-client-source.d.ts +16 -0
- package/dist/components/chat-client-source.js +256 -0
- package/dist/components/chat-page.d.ts +9 -8
- package/dist/components/chat-page.js +7 -11
- package/dist/components/chat-sheet-controller.d.ts +10 -14
- package/dist/components/chat-sheet-controller.js +2 -3
- package/dist/components/chat-sheet.d.ts +10 -11
- package/dist/components/chat-sheet.js +135 -273
- package/dist/components/chat.d.ts +22 -8
- package/dist/components/chat.js +128 -33
- package/dist/components/checkbox-item.d.ts +1 -1
- package/dist/components/checkbox-list.d.ts +1 -1
- package/dist/components/chip.d.ts +1 -1
- package/dist/components/collapsible.d.ts +1 -1
- package/dist/components/color-theme.d.ts +1 -1
- package/dist/components/column-settings.d.ts +1 -1
- package/dist/components/command-menu.d.ts +1 -1
- package/dist/components/command-palette.d.ts +3 -3
- package/dist/components/command-palette.js +1 -2
- package/dist/components/copyable-id.d.ts +22 -5
- package/dist/components/copyable-id.js +46 -6
- package/dist/components/data-display.d.ts +4 -4
- package/dist/components/data-grid.d.ts +10 -10
- package/dist/components/date-range-picker.d.ts +1 -1
- package/dist/components/date-time.d.ts +1 -1
- package/dist/components/dialog-height-context.d.ts +1 -1
- package/dist/components/document-viewer.d.ts +2 -2
- package/dist/components/drawer.d.ts +6 -6
- package/dist/components/dropzone.d.ts +4 -4
- package/dist/components/editable-field.d.ts +2 -2
- package/dist/components/email-input.d.ts +1 -1
- package/dist/components/environment-frame.d.ts +1 -1
- package/dist/components/expandable-text.d.ts +1 -1
- package/dist/components/feedback-screenshot.d.ts +1 -1
- package/dist/components/feedback-sheet.d.ts +18 -3
- package/dist/components/feedback-sheet.js +216 -55
- package/dist/components/field-context.d.ts +1 -1
- package/dist/components/filter-bar.d.ts +3 -3
- package/dist/components/filter-bar.js +4 -1
- package/dist/components/form-controls.d.ts +3 -3
- package/dist/components/form-layout.d.ts +7 -7
- package/dist/components/hotkeys.d.ts +2 -2
- package/dist/components/icon.d.ts +1 -1
- package/dist/components/input.d.ts +4 -4
- package/dist/components/input.js +3 -2
- package/dist/components/keyboard-shortcuts.d.ts +2 -2
- package/dist/components/keycap.d.ts +2 -2
- package/dist/components/layout.d.ts +13 -13
- package/dist/components/lightbox.d.ts +9 -3
- package/dist/components/lightbox.js +11 -8
- package/dist/components/link.d.ts +1 -1
- package/dist/components/locale.d.ts +32 -2
- package/dist/components/locale.js +25 -1
- package/dist/components/log-list.d.ts +3 -3
- package/dist/components/mention-input.d.ts +2 -2
- package/dist/components/menu.d.ts +2 -2
- package/dist/components/meter.d.ts +1 -1
- package/dist/components/navigation.d.ts +2 -2
- package/dist/components/notification-tray.d.ts +1 -1
- package/dist/components/overlays.d.ts +4 -4
- package/dist/components/page-frame.d.ts +4 -4
- package/dist/components/panel.d.ts +3 -3
- package/dist/components/profile-header.d.ts +1 -1
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/project-avatar.d.ts +1 -1
- package/dist/components/radio-card.d.ts +2 -2
- package/dist/components/record.d.ts +4 -4
- package/dist/components/resolved-file-url.d.ts +19 -0
- package/dist/components/resolved-file-url.js +49 -0
- package/dist/components/scroll-area.d.ts +1 -1
- package/dist/components/secret-dialog.d.ts +1 -1
- package/dist/components/segmented-bar.d.ts +1 -1
- package/dist/components/select.d.ts +4 -4
- package/dist/components/settings.d.ts +4 -4
- package/dist/components/shell-skeleton.d.ts +1 -1
- package/dist/components/shell.d.ts +19 -19
- package/dist/components/shell.js +3 -1
- package/dist/components/side-panel.d.ts +3 -3
- package/dist/components/sidebar.d.ts +6 -6
- package/dist/components/site-banner.d.ts +1 -1
- package/dist/components/skeleton.d.ts +1 -1
- package/dist/components/skeletons.d.ts +5 -5
- package/dist/components/stages.d.ts +5 -5
- package/dist/components/stat-card.d.ts +3 -3
- package/dist/components/status-banner.d.ts +1 -1
- package/dist/components/status.d.ts +2 -2
- package/dist/components/steps.d.ts +1 -1
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/tabs.d.ts +8 -8
- package/dist/components/theme-customizer.d.ts +2 -2
- package/dist/components/toast.d.ts +1 -1
- package/dist/components/use-new-version-available.d.ts +6 -0
- package/dist/components/use-new-version-available.js +29 -0
- package/dist/components/user-chip.d.ts +3 -3
- package/dist/components/wizard.d.ts +2 -2
- package/dist/feedback/contract.d.ts +136 -136
- package/dist/feedback/feedback-controller.d.ts +6 -6
- package/dist/feedback/generated/zod.gen.d.ts +28 -28
- package/dist/feedback/operator-contract.d.ts +11 -11
- package/dist/feedback/operator-controller.d.ts +32 -13
- package/dist/feedback/operator-controller.js +44 -11
- package/dist/styled-system/styles.css +203 -59
- package/package.json +32 -3
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ChatAttachment } from "../components/chat.js";
|
|
2
|
+
import type { ResolveFileUrl } from "../components/resolved-file-url.js";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
/**
|
|
5
|
+
* How the conversation's latest turn stands: `running` while the agent works on it, `failed` or
|
|
6
|
+
* `stopped` once it ended that way, `idle` otherwise, a turn waiting on the user included. The
|
|
7
|
+
* lib draws the ending of the latest turn, so the source leaves it out of `items`.
|
|
8
|
+
*/
|
|
9
|
+
export type ChatTurnStatus = "idle" | "running" | "failed" | "stopped";
|
|
10
|
+
/** One entry of the conversation, oldest first. `at` is epoch milliseconds. */
|
|
11
|
+
export type ChatConversationItem = {
|
|
12
|
+
id: string;
|
|
13
|
+
at: number;
|
|
14
|
+
} & ({
|
|
15
|
+
kind: "message";
|
|
16
|
+
role: "user" | "assistant";
|
|
17
|
+
/**
|
|
18
|
+
* The user's text as typed, mentions as `[@label](mention://kind/id)`; the assistant's as
|
|
19
|
+
* Markdown, its link reference definitions drawn as sources under it.
|
|
20
|
+
*/
|
|
21
|
+
text: string;
|
|
22
|
+
attachments?: readonly ChatAttachment[];
|
|
23
|
+
/** The service has not taken the user's message yet. */
|
|
24
|
+
sending?: boolean;
|
|
25
|
+
/** The user's message did not send: why, and how to send it again. */
|
|
26
|
+
failure?: {
|
|
27
|
+
message?: string;
|
|
28
|
+
retry: () => void;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/** A line about the conversation, such as how an earlier turn ended. */
|
|
32
|
+
| {
|
|
33
|
+
kind: "line";
|
|
34
|
+
text: ReactNode;
|
|
35
|
+
tone?: "muted" | "error";
|
|
36
|
+
}
|
|
37
|
+
/** Something of the source's own in the agent's flow, such as an approval it waits on. */
|
|
38
|
+
| {
|
|
39
|
+
kind: "card";
|
|
40
|
+
content: ReactNode;
|
|
41
|
+
});
|
|
42
|
+
/** A message the composer sends: its text and the files `upload` returned for it. */
|
|
43
|
+
export type ChatOutgoingMessage = {
|
|
44
|
+
text: string;
|
|
45
|
+
attachments: readonly ChatAttachment[];
|
|
46
|
+
};
|
|
47
|
+
export type ChatConversationSource = {
|
|
48
|
+
items: readonly ChatConversationItem[];
|
|
49
|
+
status: ChatTurnStatus;
|
|
50
|
+
/** The conversation is loading: its items are not there yet. */
|
|
51
|
+
loading?: boolean;
|
|
52
|
+
/** Why the latest turn failed, on its failure; the locale's "Failed" otherwise. */
|
|
53
|
+
failureMessage?: string;
|
|
54
|
+
/** Runs the failed latest turn again, as Retry on its failure. */
|
|
55
|
+
retry?: () => void;
|
|
56
|
+
/**
|
|
57
|
+
* Sends a message, creating the conversation with it when there is none yet. The composer
|
|
58
|
+
* clears as it sends; a rejection gives the text back and shows the error over it.
|
|
59
|
+
*/
|
|
60
|
+
send: (message: ChatOutgoingMessage) => Promise<void>;
|
|
61
|
+
/** Uploads a file to go with the next message; without it, the composer takes no files. */
|
|
62
|
+
upload?: (file: File) => Promise<ChatAttachment>;
|
|
63
|
+
/** Loads the link of an attachment with no `url`; see `ResolveFileUrl`. */
|
|
64
|
+
resolveAttachmentUrl?: ResolveFileUrl<ChatAttachment>;
|
|
65
|
+
};
|
|
66
|
+
/** A conversation in `ChatHistory`. `updatedAt` is epoch milliseconds. */
|
|
67
|
+
export type ChatConversationSummary = {
|
|
68
|
+
id: string;
|
|
69
|
+
title: string | null;
|
|
70
|
+
/** The latest message as one line, in place of a missing title. */
|
|
71
|
+
preview?: string | null;
|
|
72
|
+
updatedAt: number;
|
|
73
|
+
/** The agent is working in it: a spinner in place of its time. */
|
|
74
|
+
running?: boolean;
|
|
75
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -20,4 +20,4 @@ export type MessageTextProps = {
|
|
|
20
20
|
plain?: boolean;
|
|
21
21
|
className?: string;
|
|
22
22
|
};
|
|
23
|
-
export declare function MessageText({ content, onMentionSelect, mentionHref, plain, className, }: MessageTextProps): import("
|
|
23
|
+
export declare function MessageText({ content, onMentionSelect, mentionHref, plain, className, }: MessageTextProps): import("react").JSX.Element;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Markdown } from "@tanstack/markdown/react";
|
|
3
|
+
import { createContext, useContext, useMemo } from "react";
|
|
3
4
|
import { css, cx } from "#primitives/css";
|
|
4
5
|
import { parseMentions } from "./contract.js";
|
|
5
|
-
/*
|
|
6
|
-
*
|
|
7
|
-
* `code`, [links](url), and mentions as chips. Enough for the agent sheet's short answers without
|
|
8
|
-
* a Markdown dependency; a full renderer can replace this when replies carry more than that.
|
|
9
|
-
* Markdown link reference definitions (`[1]: url "Title"`) draw nothing in place; `splitSources`
|
|
10
|
-
* lifts them out as the reply's sources.
|
|
6
|
+
/* TanStack owns Markdown parsing/rendering; the adapter adds our mention chips and bare URLs.
|
|
7
|
+
* Raw HTML stays text. Source definitions are lifted out separately for the reply's source row.
|
|
11
8
|
*/
|
|
12
9
|
// Sized by the bubble it sits in.
|
|
13
10
|
const text = css({
|
|
@@ -15,9 +12,46 @@ const text = css({
|
|
|
15
12
|
gap: "control.iconGap",
|
|
16
13
|
minWidth: "0",
|
|
17
14
|
overflowWrap: "anywhere",
|
|
18
|
-
"& p,
|
|
19
|
-
"&
|
|
15
|
+
"& :is(p, ul, ol, pre, table, blockquote, h1, h2, h3, h4, h5, h6, hr)": { margin: "none" },
|
|
16
|
+
"& p": { whiteSpace: "pre-line" },
|
|
17
|
+
"& :is(h1, h2, h3, h4, h5, h6)": { fontSize: "inherit", fontWeight: "semibold" },
|
|
18
|
+
"& :is(ul, ol)": { paddingInlineStart: "layout.clusterGap" },
|
|
19
|
+
"& li > :is(ul, ol)": { marginBlockStart: "control.trackInset" },
|
|
20
|
+
"& li + li": { marginBlockStart: "control.trackInset" },
|
|
20
21
|
"& code": { fontFamily: "mono", fontSize: "code" },
|
|
22
|
+
"& pre": {
|
|
23
|
+
overflowX: "auto",
|
|
24
|
+
paddingBlock: "control.compactBlock",
|
|
25
|
+
paddingInline: "control.compactInline",
|
|
26
|
+
borderRadius: "keycap",
|
|
27
|
+
background: "bg.raised",
|
|
28
|
+
whiteSpace: "pre",
|
|
29
|
+
overflowWrap: "normal",
|
|
30
|
+
},
|
|
31
|
+
"& blockquote": {
|
|
32
|
+
display: "grid",
|
|
33
|
+
gap: "control.iconGap",
|
|
34
|
+
paddingInlineStart: "control.compactInline",
|
|
35
|
+
borderInlineStart: "2px solid token(colors.border.control)",
|
|
36
|
+
color: "fg.muted",
|
|
37
|
+
},
|
|
38
|
+
"& hr": { border: "0", borderTop: "1px solid token(colors.border.control)" },
|
|
39
|
+
"& table": {
|
|
40
|
+
display: "block",
|
|
41
|
+
maxWidth: "100%",
|
|
42
|
+
overflowX: "auto",
|
|
43
|
+
borderCollapse: "collapse",
|
|
44
|
+
fontVariantNumeric: "tabular-nums",
|
|
45
|
+
},
|
|
46
|
+
"& :is(th, td)": {
|
|
47
|
+
paddingBlock: "control.trackInset",
|
|
48
|
+
paddingInline: "control.compactBlock",
|
|
49
|
+
borderBottom: "1px solid token(colors.border.control)",
|
|
50
|
+
textAlign: "start",
|
|
51
|
+
verticalAlign: "top",
|
|
52
|
+
overflowWrap: "normal",
|
|
53
|
+
},
|
|
54
|
+
"& th": { fontWeight: "medium" },
|
|
21
55
|
"& a:not([data-mention])": { color: "inherit", textDecoration: "underline" },
|
|
22
56
|
});
|
|
23
57
|
const mention = css({
|
|
@@ -37,16 +71,18 @@ const mention = css({
|
|
|
37
71
|
cursor: "default",
|
|
38
72
|
"&:is(button, a)": { cursor: "pointer", _hover: { background: "bg.raisedHover" } },
|
|
39
73
|
});
|
|
40
|
-
const inlinePattern = /(\*\*[^*]+\*\*|`[^`]+`|\[[^[\]@][^[\]]*\]\([^)\s]+\))/;
|
|
41
|
-
const linkPattern = /^\[([^\]]+)\]\(([^)\s]+)\)$/;
|
|
42
74
|
const sourcePattern = /^\s*\[([^\]]+)\]:\s*(\S+)(?:\s+"([^"]*)")?\s*$/;
|
|
75
|
+
const fencePattern = /^\s*(?:`{3,}|~{3,})/;
|
|
43
76
|
/** The reply's text without its link reference definitions, and those definitions as sources. */
|
|
44
77
|
export function splitSources(content) {
|
|
45
78
|
const sources = [];
|
|
79
|
+
let inFence = false;
|
|
46
80
|
const body = content
|
|
47
81
|
.split("\n")
|
|
48
82
|
.filter((line) => {
|
|
49
|
-
|
|
83
|
+
if (fencePattern.test(line))
|
|
84
|
+
inFence = !inFence;
|
|
85
|
+
const match = inFence ? null : sourcePattern.exec(line);
|
|
50
86
|
if (!match)
|
|
51
87
|
return true;
|
|
52
88
|
const [, id = "", href = "", title] = match;
|
|
@@ -71,48 +107,80 @@ const plainText = css({
|
|
|
71
107
|
_hover: { background: "transparent", textDecoration: "underline" },
|
|
72
108
|
},
|
|
73
109
|
});
|
|
110
|
+
const MentionContext = createContext({});
|
|
74
111
|
export function MessageText({ content, onMentionSelect, mentionHref, plain = false, className, }) {
|
|
112
|
+
const handlers = useMemo(() => ({ onMentionSelect, mentionHref }), [onMentionSelect, mentionHref]);
|
|
75
113
|
if (plain) {
|
|
76
|
-
return (_jsx("div", { className: cx(text, plainText, className), "data-ciridae-ui": "", children: parseMentions(content).map((part, index) => typeof part === "string" ? part : renderMention(part, index,
|
|
114
|
+
return (_jsx("div", { className: cx(text, plainText, className), "data-ciridae-ui": "", children: parseMentions(content).map((part, index) => typeof part === "string" ? part : renderMention(part, index, handlers)) }));
|
|
77
115
|
}
|
|
78
|
-
|
|
79
|
-
.body.split(/\n\s*\n/)
|
|
80
|
-
.filter((block) => block.trim().length > 0);
|
|
81
|
-
const inline = (line) => renderInline(line, onMentionSelect, mentionHref);
|
|
82
|
-
return (_jsx("div", { className: cx(text, className), "data-ciridae-ui": "", children: blocks.map((block, blockIndex) => {
|
|
83
|
-
const lines = block.split("\n");
|
|
84
|
-
if (lines.every((line) => /^\s*[-*] /.test(line))) {
|
|
85
|
-
return (_jsx("ul", { children: lines.map((line, lineIndex) => (_jsx("li", { children: inline(line.replace(/^\s*[-*] /, "")) }, lineIndex))) }, blockIndex));
|
|
86
|
-
}
|
|
87
|
-
return (_jsx("p", { children: lines.map((line, lineIndex) => (_jsxs(Fragment, { children: [lineIndex > 0 && _jsx("br", {}), inline(line)] }, lineIndex))) }, blockIndex));
|
|
88
|
-
}) }));
|
|
116
|
+
return (_jsx("div", { className: cx(text, className), "data-ciridae-ui": "", children: _jsx(MentionContext.Provider, { value: handlers, children: _jsx(Markdown, { headingIds: false, extensions: [chatInline], components: markdownComponents, children: splitSources(content).body }) }) }));
|
|
89
117
|
}
|
|
90
118
|
/** A mention as a chip: a link with `mentionHref`, a button with `onMentionSelect`, else a label. */
|
|
91
|
-
function renderMention(part, key,
|
|
92
|
-
const href = mentionHref?.(part);
|
|
119
|
+
function renderMention(part, key, handlers) {
|
|
120
|
+
const href = handlers.mentionHref?.(part);
|
|
93
121
|
if (href) {
|
|
94
122
|
return (_jsx("a", { href: href, className: mention, "data-ciridae-ui": "", "data-mention": "", children: part.label }, key));
|
|
95
123
|
}
|
|
124
|
+
const { onMentionSelect } = handlers;
|
|
96
125
|
return onMentionSelect ? (_jsx("button", { type: "button", className: mention, "data-ciridae-ui": "", onClick: () => onMentionSelect(part), children: part.label }, key)) : (_jsx("span", { className: mention, "data-ciridae-ui": "", children: part.label }, key));
|
|
97
126
|
}
|
|
98
|
-
function
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
127
|
+
function MarkdownMention({ id, kind, label }) {
|
|
128
|
+
return renderMention({ id, kind, label }, 0, useContext(MentionContext));
|
|
129
|
+
}
|
|
130
|
+
// Keep heading levels inside the surrounding chat page, and ordinary external links in a new tab.
|
|
131
|
+
const markdownComponents = {
|
|
132
|
+
"chat-mention": MarkdownMention,
|
|
133
|
+
h1: "h3",
|
|
134
|
+
h2: "h4",
|
|
135
|
+
h3: "h5",
|
|
136
|
+
h4: "h6",
|
|
137
|
+
h5: "h6",
|
|
138
|
+
h6: "h6",
|
|
139
|
+
a: ({ href, ...props }) => (_jsx("a", { ...props, href: href, target: /^[a-z][a-z\d+.-]*:/i.test(href ?? "") ? "_blank" : undefined, rel: "noreferrer" })),
|
|
140
|
+
// Images belong in the attachment viewer, not arbitrary remote requests from a reply.
|
|
141
|
+
img: ({ alt }) => _jsx(_Fragment, { children: alt }),
|
|
142
|
+
};
|
|
143
|
+
/** Small inline additions, leaving fences, escapes, nesting and URL safety to TanStack. */
|
|
144
|
+
const chatInline = {
|
|
145
|
+
name: "chat-inline",
|
|
146
|
+
inlineParser: {
|
|
147
|
+
markers: "[h<",
|
|
148
|
+
parse({ source, index, inLink }) {
|
|
149
|
+
if (inLink)
|
|
150
|
+
return undefined;
|
|
151
|
+
const rest = source.slice(index);
|
|
152
|
+
const token = /^\[@[^\]]+\]\(mention:\/\/[a-z][a-z0-9_-]*\/[^)\s]+\)/.exec(rest)?.[0];
|
|
153
|
+
if (token) {
|
|
154
|
+
const [part] = parseMentions(token);
|
|
155
|
+
if (part && typeof part !== "string") {
|
|
156
|
+
return {
|
|
157
|
+
length: token.length,
|
|
158
|
+
node: {
|
|
159
|
+
type: "inlineComponent",
|
|
160
|
+
name: "chat-mention",
|
|
161
|
+
tagName: "chat-mention",
|
|
162
|
+
attributes: {},
|
|
163
|
+
properties: { ...part },
|
|
164
|
+
children: [],
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
}
|
|
106
168
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
169
|
+
const angle = /^<(https?:\/\/[^<>\s]+)>/.exec(rest);
|
|
170
|
+
if (!angle && /\w/.test(source[index - 1] ?? ""))
|
|
171
|
+
return undefined;
|
|
172
|
+
const url = angle?.[1] ?? /^https?:\/\/[^\s<>]+/.exec(rest)?.[0] ?? "";
|
|
173
|
+
let length = url.length;
|
|
174
|
+
while (!angle && length > 0 && /[.,:;"')\]*_~!?]/.test(url[length - 1] ?? ""))
|
|
175
|
+
length -= 1;
|
|
176
|
+
if (length > 0) {
|
|
177
|
+
const href = url.slice(0, length);
|
|
178
|
+
return {
|
|
179
|
+
length: angle?.[0].length ?? length,
|
|
180
|
+
node: { type: "link", href, children: [{ type: "text", value: href }] },
|
|
181
|
+
};
|
|
114
182
|
}
|
|
115
|
-
return
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
183
|
+
return undefined;
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
};
|
|
@@ -2,17 +2,17 @@ import type { ChatClient } from "./chat-client.js";
|
|
|
2
2
|
/** The caller's conversations, newest first, one page at a time. */
|
|
3
3
|
export declare function useConversationList(client: ChatClient, { enabled }?: {
|
|
4
4
|
enabled?: boolean;
|
|
5
|
-
}): import("@tanstack/react-query
|
|
5
|
+
}): import("@tanstack/react-query").UseInfiniteQueryResult<import("@tanstack/react-query").InfiniteData<{
|
|
6
6
|
data: {
|
|
7
|
-
id: string & import("zod
|
|
7
|
+
id: string & import("zod").$brand<"ConversationId">;
|
|
8
8
|
agent: string;
|
|
9
9
|
title: string | null;
|
|
10
10
|
metadata: Record<string, string>;
|
|
11
11
|
latest_response: {
|
|
12
|
-
id: string & import("zod
|
|
13
|
-
conversation_id: string & import("zod
|
|
14
|
-
status: "
|
|
15
|
-
output_item_ids: (string & import("zod
|
|
12
|
+
id: string & import("zod").$brand<"ResponseId">;
|
|
13
|
+
conversation_id: string & import("zod").$brand<"ConversationId">;
|
|
14
|
+
status: "failed" | "in_progress" | "completed" | "queued" | "requires_action" | "cancelled";
|
|
15
|
+
output_item_ids: (string & import("zod").$brand<"ItemId">)[];
|
|
16
16
|
usage: {
|
|
17
17
|
input_tokens: number;
|
|
18
18
|
output_tokens: number;
|
|
@@ -71,10 +71,10 @@ export type ActivityFeedProps = {
|
|
|
71
71
|
composerRef?: RefObject<HTMLDivElement | null>;
|
|
72
72
|
};
|
|
73
73
|
export type ActivityLabels = CiridaeLabels["activity"];
|
|
74
|
-
export declare function ActivityFeed({ items, filter, onComment, tagOptions, placeholder, now, labels: ownLabels, composerRef, }: ActivityFeedProps): import("
|
|
74
|
+
export declare function ActivityFeed({ items, filter, onComment, tagOptions, placeholder, now, labels: ownLabels, composerRef, }: ActivityFeedProps): import("react").JSX.Element;
|
|
75
75
|
/** All, Comments or Updates, as a compact segmented control. */
|
|
76
76
|
export declare function ActivityFeedFilter({ value, onValueChange, labels: ownLabels, }: {
|
|
77
77
|
value: ActivityFeedFilterValue;
|
|
78
78
|
onValueChange: (value: ActivityFeedFilterValue) => void;
|
|
79
79
|
labels?: Partial<ActivityLabels>;
|
|
80
|
-
}): import("
|
|
80
|
+
}): import("react").JSX.Element;
|
|
@@ -56,7 +56,7 @@ export type AgentWorkProps = {
|
|
|
56
56
|
className?: string;
|
|
57
57
|
};
|
|
58
58
|
/** What the agent is doing now and what waits on the user; nothing when neither. */
|
|
59
|
-
export declare function AgentWork({ tasks, layout, onTaskSelect, className }: AgentWorkProps): import("
|
|
59
|
+
export declare function AgentWork({ tasks, layout, onTaskSelect, className }: AgentWorkProps): import("react").JSX.Element | null;
|
|
60
60
|
export type AgentWorkButtonProps = {
|
|
61
61
|
tasks: readonly AgentTask[];
|
|
62
62
|
/** The drawer's title, such as the agent's name. */
|
|
@@ -67,10 +67,10 @@ export type AgentWorkButtonProps = {
|
|
|
67
67
|
* The agent's work as a header icon button, such as on a phone: spinning while it works, with a
|
|
68
68
|
* dot while something waits on the user, over a drawer with the column.
|
|
69
69
|
*/
|
|
70
|
-
export declare function AgentWorkButton({ tasks, title, className }: AgentWorkButtonProps): import("
|
|
70
|
+
export declare function AgentWorkButton({ tasks, title, className }: AgentWorkButtonProps): import("react").JSX.Element | null;
|
|
71
71
|
export type AgentTaskCardProps = {
|
|
72
72
|
task: AgentTask;
|
|
73
73
|
onReply?: (task: AgentTask, reply: AgentTaskReply) => void;
|
|
74
74
|
};
|
|
75
75
|
/** The agent asking: a waiting task's question, its details, and Deny / Approve or the answers. */
|
|
76
|
-
export declare function AgentTaskCard({ task, onReply }: AgentTaskCardProps): import("
|
|
76
|
+
export declare function AgentTaskCard({ task, onReply }: AgentTaskCardProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type PaletteName } from "../theme/index.js";
|
|
2
|
+
import { type AppNavigationProps } from "./app-navigation.js";
|
|
3
|
+
import { type MenuItem } from "./menu.js";
|
|
4
|
+
import type { ReactNode } from "react";
|
|
5
|
+
/** The palette the reader shows, which the host keeps, such as in storage, for `ThemeProvider`. */
|
|
6
|
+
export type PaletteChoice = {
|
|
7
|
+
/** `undefined` is the stylesheet's own palette, `ciridae`. */
|
|
8
|
+
value: PaletteName | undefined;
|
|
9
|
+
onValueChange: (palette: PaletteName) => void;
|
|
10
|
+
};
|
|
11
|
+
/** The color theme submenu: system, light or dark. */
|
|
12
|
+
export declare function useColorThemeMenuItem(): MenuItem;
|
|
13
|
+
/** The palette submenu over the kit's palettes. */
|
|
14
|
+
export declare function usePaletteMenuItem(choice: PaletteChoice): MenuItem;
|
|
15
|
+
export type AccountMenuProps = {
|
|
16
|
+
avatar: ReactNode;
|
|
17
|
+
name: string;
|
|
18
|
+
detail?: ReactNode;
|
|
19
|
+
/** The app's own entries, such as Edit profile, above the color theme. */
|
|
20
|
+
items?: readonly MenuItem[];
|
|
21
|
+
/** Adds a palette submenu after the color theme. */
|
|
22
|
+
palette?: PaletteChoice;
|
|
23
|
+
/** The last entry, in the danger color. */
|
|
24
|
+
signOut?: {
|
|
25
|
+
onSelect: () => void;
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
};
|
|
29
|
+
/** The avatar alone, for the rail and the phone header. */
|
|
30
|
+
compact?: boolean;
|
|
31
|
+
};
|
|
32
|
+
/** The signed-in account's menu: the app's entries, the color theme and palette, then sign out. */
|
|
33
|
+
export declare function AccountMenu({ avatar, name, detail, items, palette, signOut, compact, }: AccountMenuProps): import("react").JSX.Element;
|
|
34
|
+
/** A footer control drawn for every width: a sidebar row, a rail icon and a phone-header icon. */
|
|
35
|
+
export type AppFrameItem = {
|
|
36
|
+
id: string;
|
|
37
|
+
label: string;
|
|
38
|
+
icon: ReactNode;
|
|
39
|
+
onClick: () => void;
|
|
40
|
+
/** For a toggle, such as an assistant pane; marks the control pressed. */
|
|
41
|
+
pressed?: boolean;
|
|
42
|
+
};
|
|
43
|
+
export type AppAccount = Omit<AccountMenuProps, "compact">;
|
|
44
|
+
export type AppFrameProps = {
|
|
45
|
+
/**
|
|
46
|
+
* The main panel's breadcrumbs, the last one the page itself; the frame then draws the panel and
|
|
47
|
+
* its header. Leave out when each page renders its own `PageFrame`.
|
|
48
|
+
*/
|
|
49
|
+
title?: ReactNode;
|
|
50
|
+
/** The header's actions, with `title`. */
|
|
51
|
+
actions?: ReactNode;
|
|
52
|
+
/** Top of the expanded sidebar, such as search or the product name. */
|
|
53
|
+
sidebarTop: ReactNode;
|
|
54
|
+
/** Top of the rail, which stands in for the sidebar at narrower widths. */
|
|
55
|
+
sidebarRail: ReactNode;
|
|
56
|
+
/** The sidebar's sections as data, which `AppNavigation` draws in the sidebar and the rail. */
|
|
57
|
+
navigation?: Pick<AppNavigationProps, "sections" | "activeId" | "renderLink">;
|
|
58
|
+
/** The sidebar's own content, in place of `navigation`. */
|
|
59
|
+
sidebar?: ReactNode;
|
|
60
|
+
/** Expanded-only content at the top of the footer. */
|
|
61
|
+
sidebarFooter?: ReactNode;
|
|
62
|
+
items?: readonly AppFrameItem[];
|
|
63
|
+
/** Content before the shared status link and build SHA in the expanded footer. */
|
|
64
|
+
footnote?: ReactNode;
|
|
65
|
+
/** The bundled commit. A non-null SHA enables checks against /version.json (requires QueryClientProvider). */
|
|
66
|
+
buildSha?: string | null;
|
|
67
|
+
/** The app's status page, shown in the footer, rail and phone header. */
|
|
68
|
+
statusUrl?: string;
|
|
69
|
+
/** More icons for the rail's footer, after `items`. */
|
|
70
|
+
railActions?: ReactNode;
|
|
71
|
+
/** More icons for the phone header, with `title`, before `items` and the account. */
|
|
72
|
+
compactActions?: ReactNode;
|
|
73
|
+
account?: AppAccount;
|
|
74
|
+
/** Dialogs, sheets and other overlays the frame's controls open. */
|
|
75
|
+
overlays?: ReactNode;
|
|
76
|
+
children: ReactNode;
|
|
77
|
+
};
|
|
78
|
+
/** The app's frame: the sidebar for every width, its footer and account, and the page. */
|
|
79
|
+
export declare function AppFrame({ title, actions, sidebarTop, sidebarRail, navigation, sidebar, sidebarFooter, items, footnote, buildSha, statusUrl, railActions, compactActions, account, overlays, children, }: AppFrameProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* The app's frame, composed from the shell's pieces: the sidebar that folds to a rail and then
|
|
4
|
+
* into the phone menu, its footer rows and account menu drawn for each width, and, given a
|
|
5
|
+
* `title`, the main panel's header too. `AccountMenu` is the signed-in account's menu: the app's
|
|
6
|
+
* own entries, the color theme and palette, and sign out. Auth stays with the host, which passes
|
|
7
|
+
* sign-out as an action.
|
|
8
|
+
*/
|
|
9
|
+
import { ArrowClockwiseIcon, CaretUpIcon, CircleHalfIcon, PaletteIcon, PulseIcon, SignOutIcon, } from "@phosphor-icons/react";
|
|
10
|
+
import { PALETTE_NAMES } from "../theme/index.js";
|
|
11
|
+
import { AppNavigation } from "./app-navigation.js";
|
|
12
|
+
import { Button, IconButton } from "./button.js";
|
|
13
|
+
import { useColorTheme } from "./color-theme.js";
|
|
14
|
+
import { icon } from "./icon.js";
|
|
15
|
+
import { KeyboardShortcuts } from "./keyboard-shortcuts.js";
|
|
16
|
+
import { Link } from "./link.js";
|
|
17
|
+
import { useCiridaeLocale } from "./locale.js";
|
|
18
|
+
import { Menu } from "./menu.js";
|
|
19
|
+
import { AppAccountButton, AppBreadcrumbs, AppContent, AppHeader, AppHeaderActions, AppHeaderCompact, AppMain, AppShell, AppSidebar, AppSidebarFooter, AppSidebarFootnote, AppSidebarGroup, AppSidebarNav, AppSidebarOnly, AppSidebarRail, } from "./shell.js";
|
|
20
|
+
import { SidebarItem } from "./sidebar.js";
|
|
21
|
+
import { useNewVersionAvailable } from "./use-new-version-available.js";
|
|
22
|
+
/** The color theme submenu: system, light or dark. */
|
|
23
|
+
export function useColorThemeMenuItem() {
|
|
24
|
+
const colorTheme = useColorTheme();
|
|
25
|
+
const { labels } = useCiridaeLocale();
|
|
26
|
+
const choices = [
|
|
27
|
+
{ value: "system", label: labels.themeCustomizer.system },
|
|
28
|
+
{ value: "light", label: labels.themeCustomizer.light },
|
|
29
|
+
{ value: "dark", label: labels.themeCustomizer.dark },
|
|
30
|
+
];
|
|
31
|
+
return {
|
|
32
|
+
label: labels.themeCustomizer.colorTheme,
|
|
33
|
+
icon: _jsx(CircleHalfIcon, { className: icon({ size: "small" }) }),
|
|
34
|
+
items: choices.map((choice) => ({
|
|
35
|
+
label: choice.label,
|
|
36
|
+
checked: colorTheme.preference === choice.value,
|
|
37
|
+
onSelect: () => colorTheme.setPreference(choice.value),
|
|
38
|
+
})),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/** The palette submenu over the kit's palettes. */
|
|
42
|
+
export function usePaletteMenuItem(choice) {
|
|
43
|
+
return paletteMenuItem(choice, useCiridaeLocale().labels);
|
|
44
|
+
}
|
|
45
|
+
function paletteMenuItem({ value, onValueChange }, labels) {
|
|
46
|
+
const selected = value ?? "ciridae";
|
|
47
|
+
return {
|
|
48
|
+
label: labels.themeCustomizer.palette,
|
|
49
|
+
icon: _jsx(PaletteIcon, { className: icon({ size: "small" }) }),
|
|
50
|
+
items: PALETTE_NAMES.map((name) => ({
|
|
51
|
+
label: labels.themeCustomizer.paletteName(name),
|
|
52
|
+
checked: selected === name,
|
|
53
|
+
onSelect: () => onValueChange(name),
|
|
54
|
+
})),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/** The signed-in account's menu: the app's entries, the color theme and palette, then sign out. */
|
|
58
|
+
export function AccountMenu({ avatar, name, detail, items = [], palette, signOut, compact = false, }) {
|
|
59
|
+
const { labels } = useCiridaeLocale();
|
|
60
|
+
const colorThemeItem = useColorThemeMenuItem();
|
|
61
|
+
return (_jsx(Menu, { trigger: _jsx(AppAccountButton, { "aria-label": labels.accountMenu.menu, avatar: avatar, compact: compact, detail: detail, name: name, trailing: _jsx(CaretUpIcon, { className: icon({ size: "tiny" }) }) }), items: [
|
|
62
|
+
...items,
|
|
63
|
+
colorThemeItem,
|
|
64
|
+
...(palette ? [paletteMenuItem(palette, labels)] : []),
|
|
65
|
+
...(signOut
|
|
66
|
+
? [
|
|
67
|
+
{ separator: true },
|
|
68
|
+
{
|
|
69
|
+
...signOut,
|
|
70
|
+
label: labels.accountMenu.signOut,
|
|
71
|
+
icon: _jsx(SignOutIcon, { className: icon({ size: "small" }) }),
|
|
72
|
+
variant: "danger",
|
|
73
|
+
},
|
|
74
|
+
]
|
|
75
|
+
: []),
|
|
76
|
+
] }));
|
|
77
|
+
}
|
|
78
|
+
/** The app's frame: the sidebar for every width, its footer and account, and the page. */
|
|
79
|
+
export function AppFrame({ title, actions, sidebarTop, sidebarRail, navigation, sidebar, sidebarFooter, items = [], footnote, buildSha = null, statusUrl, railActions, compactActions, account, overlays, children, }) {
|
|
80
|
+
const { labels } = useCiridaeLocale();
|
|
81
|
+
const statusLink = statusUrl && (_jsx(IconButton, { "aria-label": labels.appFrame.status, nativeButton: false, render: _jsx("a", { href: statusUrl, target: "_blank", rel: "noreferrer" }), children: _jsx(PulseIcon, { className: icon() }) }));
|
|
82
|
+
const sidebarFoot = (_jsxs(_Fragment, { children: [(sidebarFooter || buildSha !== null || items.length > 0) && (_jsxs(AppSidebarOnly, { children: [sidebarFooter, buildSha !== null && _jsx(BuildUpdateButton, { buildSha: buildSha }), items.map((item) => (_jsx(SidebarItem, { "aria-pressed": item.pressed, icon: item.icon, onClick: item.onClick, children: item.label }, item.id)))] })), _jsxs(AppSidebarFootnote, { children: [footnote, statusUrl && (_jsxs(_Fragment, { children: [_jsx(Link, { external: true, tone: "muted", href: statusUrl, children: labels.appFrame.status }), _jsx("span", { "aria-hidden": "true", children: "\u00B7" })] })), _jsx("code", { title: buildSha ?? undefined, children: buildSha ? buildSha.slice(0, 7) : labels.appFrame.localBuild })] }), (railActions || statusLink || items.length > 0) && (_jsxs(AppSidebarOnly, { rail: true, children: [items.map((item) => (_jsx(SidebarItem, { "aria-label": item.label, "aria-pressed": item.pressed, icon: item.icon, onClick: item.onClick }, item.id))), railActions, statusLink] })), account && (_jsxs(_Fragment, { children: [_jsx(AppSidebarOnly, { children: _jsx(AccountMenu, { ...account }) }), _jsx(AppSidebarOnly, { rail: true, children: _jsx(AccountMenu, { ...account, compact: true }) })] }))] }));
|
|
83
|
+
return (_jsxs(AppShell, { children: [_jsx(KeyboardShortcuts, {}), navigation ? (_jsx(AppNavigation, { ...navigation, header: sidebarTop, railHeader: sidebarRail, footer: sidebarFoot })) : (_jsxs(AppSidebar, { children: [_jsx(AppSidebarGroup, { children: sidebarTop }), _jsx(AppSidebarRail, { children: sidebarRail }), sidebar && _jsx(AppSidebarNav, { children: sidebar }), _jsx(AppSidebarFooter, { children: sidebarFoot })] })), title === undefined ? (children) : (_jsxs(AppMain, { children: [_jsx(AppHeader, { actions: _jsxs(AppHeaderActions, { children: [actions, _jsxs(AppHeaderCompact, { children: [compactActions, statusLink, items.map((item) => (_jsx(IconButton, { "aria-label": item.label, "aria-pressed": item.pressed, onClick: item.onClick, children: item.icon }, item.id))), account && _jsx(AccountMenu, { ...account, compact: true })] })] }), children: _jsx(AppBreadcrumbs, { children: title }) }), _jsx(AppContent, { children: children })] })), overlays] }));
|
|
84
|
+
}
|
|
85
|
+
/** Only mounted for a named build, so local previews do not need a query provider. */
|
|
86
|
+
function BuildUpdateButton({ buildSha }) {
|
|
87
|
+
const hasNewVersion = useNewVersionAvailable(buildSha);
|
|
88
|
+
const { labels } = useCiridaeLocale();
|
|
89
|
+
if (!hasNewVersion)
|
|
90
|
+
return null;
|
|
91
|
+
return (_jsx(Button, { variant: "secondary", fullWidth: true, icon: _jsx(ArrowClockwiseIcon, { className: icon({ size: "small" }) }), onClick: () => window.location.reload(), children: labels.appFrame.updateAvailable }));
|
|
92
|
+
}
|
|
@@ -59,8 +59,8 @@ export type AppNavigationProps = Omit<ComponentProps<"aside">, "children"> & {
|
|
|
59
59
|
* out of room, so it does not flicker at the threshold.
|
|
60
60
|
*/
|
|
61
61
|
export declare function useSidebarRoom(foldedRows: number): {
|
|
62
|
-
navRef: import("
|
|
63
|
-
footerRef: import("
|
|
62
|
+
navRef: import("react").RefObject<HTMLDivElement | null>;
|
|
63
|
+
footerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
64
64
|
roomy: boolean;
|
|
65
65
|
};
|
|
66
|
-
export declare function AppNavigation({ sections, activeId: ownActiveId, renderLink, header, railHeader, footer, autoUnfold, labels: ownLabels, ...props }: AppNavigationProps): import("
|
|
66
|
+
export declare function AppNavigation({ sections, activeId: ownActiveId, renderLink, header, railHeader, footer, autoUnfold, labels: ownLabels, ...props }: AppNavigationProps): import("react").JSX.Element;
|
|
@@ -11,4 +11,4 @@ export type BadgeProps = Omit<useRender.ComponentProps<"span">, "children"> & {
|
|
|
11
11
|
icon?: ReactNode;
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
};
|
|
14
|
-
export declare function Badge({ tone, shape, appearance, icon, children, render, className, ...props }: BadgeProps): import("
|
|
14
|
+
export declare function Badge({ tone, shape, appearance, icon, children, render, className, ...props }: BadgeProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -3,15 +3,15 @@ import type { SVGProps } from "react";
|
|
|
3
3
|
* GitHub's own mark, rather than a lookalike from an icon set: it carries the brand, so it should
|
|
4
4
|
* be the shape people recognize. Path from Octicons `mark-github` (MIT).
|
|
5
5
|
*/
|
|
6
|
-
export declare function GithubMarkIcon(props: SVGProps<SVGSVGElement>): import("
|
|
6
|
+
export declare function GithubMarkIcon(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
|
|
7
7
|
/**
|
|
8
8
|
* The mark in the current text color, so it follows the theme. Decorative unless given a
|
|
9
9
|
* `title`, which names it for assistive technology.
|
|
10
10
|
*/
|
|
11
11
|
export declare function CiridaeMark({ title, ...props }: SVGProps<SVGSVGElement> & {
|
|
12
12
|
title?: string;
|
|
13
|
-
}): import("
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
14
|
/** The mark over its wordmark, in the current text color; `title` names it for assistive technology. */
|
|
15
15
|
export declare function CiridaeLogo({ title, ...props }: SVGProps<SVGSVGElement> & {
|
|
16
16
|
title: string;
|
|
17
|
-
}): import("
|
|
17
|
+
}): import("react").JSX.Element;
|
|
@@ -12,4 +12,4 @@ export declare function BulkActionBar({ count, onClear, actions, onSelectAll, to
|
|
|
12
12
|
/** Every row the list holds, as the Select all button counts it. */
|
|
13
13
|
total?: string;
|
|
14
14
|
labels?: Partial<CiridaeLabels["table"]>;
|
|
15
|
-
}): import("
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -13,7 +13,7 @@ export type ButtonProps = Omit<BaseButtonProps, "className"> & {
|
|
|
13
13
|
/** The hotkey that does what the button does, shown after its label; the host binds it. */
|
|
14
14
|
shortcut?: Hotkey;
|
|
15
15
|
};
|
|
16
|
-
export declare function Button({ className, variant, size, fullWidth, loading, icon, shortcut, children, disabled, ...props }: ButtonProps): import("
|
|
16
|
+
export declare function Button({ className, variant, size, fullWidth, loading, icon, shortcut, children, disabled, ...props }: ButtonProps): import("react").JSX.Element;
|
|
17
17
|
export type DataButtonState = "idle" | "pending" | "error" | "success";
|
|
18
18
|
export type DataButtonProps = Omit<ButtonProps, "children" | "icon" | "loading"> & {
|
|
19
19
|
state: DataButtonState;
|
|
@@ -24,14 +24,14 @@ export type DataButtonProps = Omit<ButtonProps, "children" | "icon" | "loading">
|
|
|
24
24
|
icon?: ReactNode;
|
|
25
25
|
};
|
|
26
26
|
/** Async action button with consistent pending, retry, and completion feedback. */
|
|
27
|
-
export declare function DataButton({ state, idleLabel, pendingLabel, errorLabel, successLabel, variant, icon, disabled, ...props }: DataButtonProps): import("
|
|
27
|
+
export declare function DataButton({ state, idleLabel, pendingLabel, errorLabel, successLabel, variant, icon, disabled, ...props }: DataButtonProps): import("react").JSX.Element;
|
|
28
28
|
type IconButtonSize = "compact" | "small" | "medium" | "large";
|
|
29
29
|
/**
|
|
30
30
|
* The size an `IconButton` takes where it does not set its own, so the container decides: the
|
|
31
31
|
* sidebar rail's icons are large, and the same icon shown in the phone header matches the header's
|
|
32
32
|
* small buttons.
|
|
33
33
|
*/
|
|
34
|
-
export declare const IconButtonSizeContext: import("
|
|
34
|
+
export declare const IconButtonSizeContext: import("react").Context<IconButtonSize>;
|
|
35
35
|
export type IconButtonProps = Omit<BaseButtonProps, "className" | "aria-label"> & {
|
|
36
36
|
className?: string;
|
|
37
37
|
"aria-label": string;
|
|
@@ -48,5 +48,5 @@ export type IconButtonProps = Omit<BaseButtonProps, "className" | "aria-label">
|
|
|
48
48
|
*/
|
|
49
49
|
shortcut?: Hotkey;
|
|
50
50
|
};
|
|
51
|
-
export declare function IconButton({ className, size, variant, badge, shortcut, children, "aria-label": label, ...props }: IconButtonProps): import("
|
|
51
|
+
export declare function IconButton({ className, size, variant, badge, shortcut, children, "aria-label": label, ...props }: IconButtonProps): import("react").JSX.Element;
|
|
52
52
|
export {};
|
|
@@ -10,5 +10,5 @@ export type CalendarProps = {
|
|
|
10
10
|
weekStartsOn?: WeekStartsOn;
|
|
11
11
|
labels?: Partial<CiridaeLabels["calendar"]>;
|
|
12
12
|
};
|
|
13
|
-
export declare function Calendar({ month, selected, onMonthChange, onSelect, locale: ownLocale, weekStartsOn, labels: ownLabels, }: CalendarProps): import("
|
|
13
|
+
export declare function Calendar({ month, selected, onMonthChange, onSelect, locale: ownLocale, weekStartsOn, labels: ownLabels, }: CalendarProps): import("react").JSX.Element;
|
|
14
14
|
export {};
|
|
@@ -18,4 +18,4 @@ export type CenteredPageProps = {
|
|
|
18
18
|
* content. `form` width narrows both for a short form; `wide` suits a card holding a list whose
|
|
19
19
|
* rows carry a label, a detail, and a control.
|
|
20
20
|
*/
|
|
21
|
-
export declare function CenteredPage({ brand, aside, title, description, header, width, children, }: CenteredPageProps): import("
|
|
21
|
+
export declare function CenteredPage({ brand, aside, title, description, header, width, children, }: CenteredPageProps): import("react").JSX.Element;
|