@sybilion/uilib 1.4.27 → 1.4.29
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/assets/globals.css +4 -4
- package/dist/agent-glossary/content-prompt.generated.ts +8 -2
- package/dist/agent-glossary/content.generated.ts +8 -2
- package/dist/agent-glossary/content.md +8 -2
- package/dist/agent-glossary/content.prompt.md +8 -2
- package/dist/agent-glossary/workspace.generated.ts +3 -9
- package/dist/agent-glossary/workspace.index.md +3 -9
- package/dist/agent-glossary/workspace.md +3 -9
- package/dist/esm/src/components/ui/Chat/ChatChrome/ChatChrome.js +1 -1
- package/dist/esm/src/components/ui/Chat/ChatPrompt/useChatPromptEditor.js +7 -4
- package/dist/esm/src/components/ui/Page/PageFooter/PageFooter.styl.js +1 -1
- package/dist/esm/src/components/ui/Sidebar/SidebarMenuButton/SidebarMenuButton.js +16 -5
- package/dist/esm/types/src/docs/pages/PageEmptyCanvasPage.d.ts +1 -0
- package/dist/esm/types/tests/sidebarMenuButton.test.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/ui/Chat/AGENT.md +18 -0
- package/src/components/ui/Chat/ChatChrome/AGENT.md +55 -0
- package/src/components/ui/Chat/ChatPrompt/useChatPromptEditor.ts +7 -4
- package/src/{docs/agent-guidance/chat-sheet.md → components/ui/Chat/ChatSheet/AGENT.md} +2 -2
- package/src/components/ui/Page/AGENT.md +8 -2
- package/src/components/ui/Page/PageEmptyCanvas/AGENT.md +17 -0
- package/src/components/ui/Page/PageFooter/PageFooter.styl +8 -2
- package/src/components/ui/Sidebar/SidebarMenuButton/SidebarMenuButton.tsx +37 -23
- package/src/docs/pages/ChatAttachmentsDropzonePage.tsx +41 -39
- package/src/docs/pages/ChatComposerPrefillPage.tsx +31 -29
- package/src/docs/pages/ChatPage.styl +1 -1
- package/src/docs/pages/ChatSheetPage.tsx +2 -2
- package/src/docs/pages/ChatSlashCommandsPage.tsx +32 -30
- package/src/docs/pages/ChatUserCsvAttachmentPage.tsx +30 -28
- package/src/docs/pages/PageColumnsPage.tsx +1 -1
- package/src/docs/pages/PageEmptyCanvasPage.tsx +86 -0
- package/src/docs/pages/PageFooterPage.tsx +21 -2
- package/src/docs/pages/PagePage.tsx +1 -1
- package/src/docs/pages/PageTabsPage.tsx +1 -1
- package/src/docs/registry.ts +6 -0
- package/src/docs/agent-guidance/chat-attachments-dropzone.md +0 -15
- package/src/docs/agent-guidance/chat-composer-prefill.md +0 -15
- package/src/docs/agent-guidance/chat-slash-commands.md +0 -15
- package/src/docs/agent-guidance/chat-user-csv-attachment.md +0 -14
- package/src/docs/agent-guidance/page-columns.md +0 -19
- package/src/docs/agent-guidance/page-footer.md +0 -15
- package/src/docs/agent-guidance/page-tabs.md +0 -19
- package/src/docs/agent-guidance/page.md +0 -15
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import cn from 'classnames';
|
|
2
|
-
|
|
3
1
|
import { Button } from '#uilib/components/ui/Button';
|
|
4
2
|
import type { ButtonProps } from '#uilib/components/ui/Button/Button.types';
|
|
5
|
-
import { SmartTextTruncate } from '#uilib/components/ui/SmartTextTruncate/SmartTextTruncate';
|
|
6
3
|
import { ChevronRight } from 'lucide-react';
|
|
7
|
-
|
|
8
4
|
import S from './SidebarMenuButton.styl';
|
|
5
|
+
import { Slottable } from '@radix-ui/react-slot';
|
|
6
|
+
import { SmartTextTruncate } from '#uilib/components/ui/SmartTextTruncate/SmartTextTruncate';
|
|
7
|
+
import cn from 'classnames';
|
|
9
8
|
|
|
10
9
|
export function SidebarMenuButton({
|
|
11
10
|
asChild = false,
|
|
@@ -45,38 +44,53 @@ export function SidebarMenuButton({
|
|
|
45
44
|
</span>
|
|
46
45
|
) : null;
|
|
47
46
|
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
</>
|
|
47
|
+
const buttonClassName = cn(
|
|
48
|
+
variant === 'default' ? S.sidebarMenuButtonCta : S.sidebarMenuButton,
|
|
49
|
+
S[`size-${size}`],
|
|
50
|
+
className,
|
|
53
51
|
);
|
|
54
52
|
|
|
53
|
+
if (effectiveAsChild) {
|
|
54
|
+
// The consumer supplies the root element (e.g. <NavLink/>). Radix Slot
|
|
55
|
+
// requires exactly one element child, so the consumer's element is wrapped
|
|
56
|
+
// in <Slottable/> and icon/addon stay as siblings — Slot clones the
|
|
57
|
+
// consumer's element with Button's props and injects the siblings as its
|
|
58
|
+
// children. SmartTextTruncate is intentionally omitted: wrapping the
|
|
59
|
+
// consumer's element would nest the rendered <a> inside a truncate
|
|
60
|
+
// container and break the slot contract.
|
|
61
|
+
return (
|
|
62
|
+
<Button
|
|
63
|
+
asChild
|
|
64
|
+
variant={variant}
|
|
65
|
+
size={size}
|
|
66
|
+
data-slot="sidebar-menu-button"
|
|
67
|
+
data-sidebar="menu-button"
|
|
68
|
+
data-active={isActive}
|
|
69
|
+
className={buttonClassName}
|
|
70
|
+
{...props}
|
|
71
|
+
>
|
|
72
|
+
{icon}
|
|
73
|
+
<Slottable>{children}</Slottable>
|
|
74
|
+
{addon}
|
|
75
|
+
</Button>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
55
79
|
return (
|
|
56
80
|
<Button
|
|
57
|
-
asChild={effectiveAsChild}
|
|
58
81
|
variant={variant}
|
|
59
82
|
size={size}
|
|
60
83
|
data-slot="sidebar-menu-button"
|
|
61
84
|
data-sidebar="menu-button"
|
|
62
85
|
data-active={isActive}
|
|
63
86
|
aria-expanded={hasSubItems ? isExpanded : undefined}
|
|
64
|
-
className={
|
|
65
|
-
variant === 'default' ? S.sidebarMenuButtonCta : S.sidebarMenuButton,
|
|
66
|
-
S[`size-${size}`],
|
|
67
|
-
className,
|
|
68
|
-
)}
|
|
87
|
+
className={buttonClassName}
|
|
69
88
|
{...props}
|
|
70
89
|
>
|
|
71
90
|
{icon}
|
|
72
|
-
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
<>
|
|
76
|
-
{userContent}
|
|
77
|
-
{chevron}
|
|
78
|
-
</>
|
|
79
|
-
)}
|
|
91
|
+
{label}
|
|
92
|
+
{addon}
|
|
93
|
+
{chevron}
|
|
80
94
|
</Button>
|
|
81
95
|
);
|
|
82
96
|
}
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
MessageRole,
|
|
8
8
|
TEXT_ATTACHMENT_ACCEPT_PARTS,
|
|
9
9
|
} from '#uilib/components/ui/Chat';
|
|
10
|
+
import chatAttachmentsDropzoneGuidance from '#uilib/components/ui/Chat/ChatChrome/AGENT.md';
|
|
10
11
|
import { PageContentSection } from '#uilib/components/ui/Page';
|
|
11
|
-
import chatAttachmentsDropzoneGuidance from '#uilib/docs/agent-guidance/chat-attachments-dropzone.md';
|
|
12
12
|
import { ScrollRef } from '@homecode/ui';
|
|
13
13
|
|
|
14
14
|
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
@@ -111,44 +111,46 @@ export default function ChatAttachmentsDropzonePage() {
|
|
|
111
111
|
send to post it. Office and PDF parsers load on demand when you attach
|
|
112
112
|
those types; PDF also requires <code>allowPdfAttachments</code>.
|
|
113
113
|
</p>
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
114
|
+
<div style={{ minHeight: 600 }}>
|
|
115
|
+
<ChatChrome
|
|
116
|
+
variant="clean"
|
|
117
|
+
showResizeHandle={false}
|
|
118
|
+
resizeHandle={undefined}
|
|
119
|
+
onClose={undefined}
|
|
120
|
+
isEmpty={isEmpty}
|
|
121
|
+
renderPresets={() => null}
|
|
122
|
+
messages={messages}
|
|
123
|
+
onQuickReply={() => {}}
|
|
124
|
+
suppressedQuickReplyKeys={NO_QUICK_REPLY_KEYS}
|
|
125
|
+
isLoading={isLoading}
|
|
126
|
+
scriptContinueLabel={undefined}
|
|
127
|
+
onScriptContinue={undefined}
|
|
128
|
+
showSyntheticBranchButtons={false}
|
|
129
|
+
unusedBranchKeys={[]}
|
|
130
|
+
showInlinePresets={false}
|
|
131
|
+
isLastMessageFromUser={isLastMessageFromUser}
|
|
132
|
+
scrollRef={scrollRef}
|
|
133
|
+
effectiveScopeId="docs-chat-attachments-dropzone"
|
|
134
|
+
onPromptSubmit={onPromptSubmit}
|
|
135
|
+
onChatDeleted={() => {}}
|
|
136
|
+
allowedAttachments={TEXT_ATTACHMENT_ACCEPT_PARTS}
|
|
137
|
+
allowPdfAttachments
|
|
138
|
+
emptyState={{
|
|
139
|
+
title: 'Drop a text, Office, or PDF file',
|
|
140
|
+
description:
|
|
141
|
+
'Drag a file onto this panel, review it above the composer, then send. DOCX and XLSX are parsed in the browser.',
|
|
142
|
+
additionalContent: (
|
|
143
|
+
<p style={{ fontSize: 13, opacity: 0.85 }}>
|
|
144
|
+
Accepted types include <code>.txt</code>, <code>.csv</code>,{' '}
|
|
145
|
+
<code>.md</code>, <code>.json</code>, <code>.docx</code>,{' '}
|
|
146
|
+
<code>.xlsx</code>, and more (
|
|
147
|
+
{TEXT_ATTACHMENT_ACCEPT_PARTS.length} entries in the text
|
|
148
|
+
allowlist).
|
|
149
|
+
</p>
|
|
150
|
+
),
|
|
151
|
+
}}
|
|
152
|
+
/>
|
|
153
|
+
</div>
|
|
152
154
|
</PageContentSection>
|
|
153
155
|
</>
|
|
154
156
|
);
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
type Message,
|
|
8
8
|
MessageRole,
|
|
9
9
|
} from '#uilib/components/ui/Chat';
|
|
10
|
+
import chatComposerPrefillGuidance from '#uilib/components/ui/Chat/AGENT.md';
|
|
10
11
|
import { PageContentSection } from '#uilib/components/ui/Page';
|
|
11
|
-
import chatComposerPrefillGuidance from '#uilib/docs/agent-guidance/chat-composer-prefill.md';
|
|
12
12
|
import { ScrollRef } from '@homecode/ui';
|
|
13
13
|
import { MessageSquare } from 'lucide-react';
|
|
14
14
|
|
|
@@ -172,34 +172,36 @@ export default function ChatComposerPrefillPage() {
|
|
|
172
172
|
opens chat with prefill once
|
|
173
173
|
</li>
|
|
174
174
|
</ul>
|
|
175
|
-
<
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
175
|
+
<div style={{ minHeight: 600 }}>
|
|
176
|
+
<ChatChrome
|
|
177
|
+
variant="clean"
|
|
178
|
+
showResizeHandle={false}
|
|
179
|
+
resizeHandle={undefined}
|
|
180
|
+
onClose={undefined}
|
|
181
|
+
isEmpty={isEmpty}
|
|
182
|
+
renderPresets={() => null}
|
|
183
|
+
messages={messages}
|
|
184
|
+
onQuickReply={() => {}}
|
|
185
|
+
suppressedQuickReplyKeys={NO_QUICK_REPLY_KEYS}
|
|
186
|
+
isLoading={isLoading}
|
|
187
|
+
scriptContinueLabel={undefined}
|
|
188
|
+
onScriptContinue={undefined}
|
|
189
|
+
showSyntheticBranchButtons={false}
|
|
190
|
+
unusedBranchKeys={[]}
|
|
191
|
+
showInlinePresets={false}
|
|
192
|
+
isLastMessageFromUser={isLastMessageFromUser}
|
|
193
|
+
scrollRef={scrollRef}
|
|
194
|
+
effectiveScopeId="docs-chat-composer-prefill-inline"
|
|
195
|
+
onPromptSubmit={onSubmit}
|
|
196
|
+
onChatDeleted={() => {}}
|
|
197
|
+
promptPrefill={inlinePrefill}
|
|
198
|
+
emptyState={{
|
|
199
|
+
title: 'Inline prefill demo',
|
|
200
|
+
description:
|
|
201
|
+
'Click “Prefill inline composer” or type below. Portal and ?prompt= use the header ChatSheet.',
|
|
202
|
+
}}
|
|
203
|
+
/>
|
|
204
|
+
</div>
|
|
203
205
|
</PageContentSection>
|
|
204
206
|
</>
|
|
205
207
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SlashCommandItem } from '#uilib/components/ui/Chat';
|
|
2
|
+
import chatSheetGuidance from '#uilib/components/ui/Chat/ChatSheet/AGENT.md';
|
|
2
3
|
import { PageContentSection } from '#uilib/components/ui/Page';
|
|
3
|
-
import chatSheetGuidance from '#uilib/docs/agent-guidance/chat-sheet.md';
|
|
4
4
|
import { MessageSquare } from 'lucide-react';
|
|
5
5
|
|
|
6
6
|
import {
|
|
@@ -28,7 +28,7 @@ export default function ChatSheetPage() {
|
|
|
28
28
|
<AppPageHeader
|
|
29
29
|
breadcrumbs={[{ label: 'Chat' }, { label: 'Chat sheet' }]}
|
|
30
30
|
title="Chat sheet (portal)"
|
|
31
|
-
subheader={`Same integration as the app dataset page: ChatSheet
|
|
31
|
+
subheader={`Same integration pattern as the app dataset page: portal ChatSheet with dataset-scoped presets for "${DOCS_SAMPLE_DATASET_NAME}" (this demo uses header actions for the trigger). Panel portaled into the shell chat slot.`}
|
|
32
32
|
actions={
|
|
33
33
|
<DocsHeaderActions
|
|
34
34
|
scopeId={DOCS_CHAT_SHEET_SCOPE_ID}
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
MessageRole,
|
|
8
8
|
type SlashCommandItem,
|
|
9
9
|
} from '#uilib/components/ui/Chat';
|
|
10
|
+
import chatSlashCommandsGuidance from '#uilib/components/ui/Chat/ChatChrome/AGENT.md';
|
|
10
11
|
import { PageContentSection } from '#uilib/components/ui/Page';
|
|
11
|
-
import chatSlashCommandsGuidance from '#uilib/docs/agent-guidance/chat-slash-commands.md';
|
|
12
12
|
import { ScrollRef } from '@homecode/ui';
|
|
13
13
|
|
|
14
14
|
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
@@ -117,35 +117,37 @@ export default function ChatSlashCommandsPage() {
|
|
|
117
117
|
font-size: 150%;
|
|
118
118
|
}
|
|
119
119
|
`}</style>
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
120
|
+
<div style={{ minHeight: 600 }}>
|
|
121
|
+
<ChatChrome
|
|
122
|
+
variant="clean"
|
|
123
|
+
showResizeHandle={false}
|
|
124
|
+
resizeHandle={undefined}
|
|
125
|
+
onClose={undefined}
|
|
126
|
+
isEmpty={isEmpty}
|
|
127
|
+
renderPresets={() => null}
|
|
128
|
+
messages={messages}
|
|
129
|
+
onQuickReply={() => {}}
|
|
130
|
+
suppressedQuickReplyKeys={NO_QUICK_REPLY_KEYS}
|
|
131
|
+
isLoading={isLoading}
|
|
132
|
+
scriptContinueLabel={undefined}
|
|
133
|
+
onScriptContinue={undefined}
|
|
134
|
+
showSyntheticBranchButtons={false}
|
|
135
|
+
unusedBranchKeys={[]}
|
|
136
|
+
showInlinePresets={false}
|
|
137
|
+
isLastMessageFromUser={isLastMessageFromUser}
|
|
138
|
+
scrollRef={scrollRef}
|
|
139
|
+
effectiveScopeId="docs-chat-slash-inline"
|
|
140
|
+
onPromptSubmit={onSubmit}
|
|
141
|
+
onChatDeleted={() => {}}
|
|
142
|
+
slashCommandItems={DOCS_SLASH_ITEMS}
|
|
143
|
+
promptPlaceholder='Ask something or type "/" for demo commands…'
|
|
144
|
+
emptyState={{
|
|
145
|
+
title: 'Try slash commands',
|
|
146
|
+
description:
|
|
147
|
+
'Pick a command from the palette to insert a mention chip with optional className and color.',
|
|
148
|
+
}}
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
149
151
|
</PageContentSection>
|
|
150
152
|
</>
|
|
151
153
|
);
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
type Message,
|
|
7
7
|
MessageRole,
|
|
8
8
|
} from '#uilib/components/ui/Chat';
|
|
9
|
+
import chatUserCsvAttachmentGuidance from '#uilib/components/ui/Chat/ChatChrome/AGENT.md';
|
|
9
10
|
import { PageContentSection } from '#uilib/components/ui/Page';
|
|
10
|
-
import chatUserCsvAttachmentGuidance from '#uilib/docs/agent-guidance/chat-user-csv-attachment.md';
|
|
11
11
|
import { ScrollRef } from '@homecode/ui';
|
|
12
12
|
|
|
13
13
|
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
@@ -139,33 +139,35 @@ export default function ChatUserCsvAttachmentPage() {
|
|
|
139
139
|
Load preset-style message + CSV attachment
|
|
140
140
|
</Button>
|
|
141
141
|
</p>
|
|
142
|
-
<
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
142
|
+
<div style={{ minHeight: 600 }}>
|
|
143
|
+
<ChatChrome
|
|
144
|
+
variant="clean"
|
|
145
|
+
showResizeHandle={false}
|
|
146
|
+
resizeHandle={undefined}
|
|
147
|
+
onClose={undefined}
|
|
148
|
+
isEmpty={isEmpty}
|
|
149
|
+
renderPresets={() => null}
|
|
150
|
+
messages={messages}
|
|
151
|
+
onQuickReply={() => {}}
|
|
152
|
+
suppressedQuickReplyKeys={NO_QUICK_REPLY_KEYS}
|
|
153
|
+
isLoading={isLoading}
|
|
154
|
+
scriptContinueLabel={undefined}
|
|
155
|
+
onScriptContinue={undefined}
|
|
156
|
+
showSyntheticBranchButtons={false}
|
|
157
|
+
unusedBranchKeys={[]}
|
|
158
|
+
showInlinePresets={false}
|
|
159
|
+
isLastMessageFromUser={isLastMessageFromUser}
|
|
160
|
+
scrollRef={scrollRef}
|
|
161
|
+
effectiveScopeId="docs-chat-user-csv"
|
|
162
|
+
onPromptSubmit={onSubmit}
|
|
163
|
+
onChatDeleted={() => {}}
|
|
164
|
+
emptyState={{
|
|
165
|
+
title: 'CSV attachment demo',
|
|
166
|
+
description:
|
|
167
|
+
'Click the button above or send any message. The CSV row uses the same UI as dashboard presets.',
|
|
168
|
+
}}
|
|
169
|
+
/>
|
|
170
|
+
</div>
|
|
169
171
|
</PageContentSection>
|
|
170
172
|
</>
|
|
171
173
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
2
|
|
|
3
3
|
import { PageColumns, PageContentSection } from '#uilib/components/ui/Page';
|
|
4
|
-
import pageColumnsGuidance from '#uilib/
|
|
4
|
+
import pageColumnsGuidance from '#uilib/components/ui/Page/AGENT.md';
|
|
5
5
|
|
|
6
6
|
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
7
7
|
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Button } from '#uilib/components/ui/Button';
|
|
2
|
+
import {
|
|
3
|
+
PageContent,
|
|
4
|
+
PageContentSection,
|
|
5
|
+
PageEmptyCanvas,
|
|
6
|
+
} from '#uilib/components/ui/Page';
|
|
7
|
+
import pageEmptyCanvasGuidance from '#uilib/components/ui/Page/PageEmptyCanvas/AGENT.md';
|
|
8
|
+
|
|
9
|
+
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
10
|
+
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
11
|
+
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
12
|
+
|
|
13
|
+
const demoFrameStyle = {
|
|
14
|
+
border: '2px dashed var(--border)',
|
|
15
|
+
borderRadius: 'var(--p-3)',
|
|
16
|
+
minHeight: 320,
|
|
17
|
+
display: 'flex',
|
|
18
|
+
} as const;
|
|
19
|
+
|
|
20
|
+
export default function PageEmptyCanvasPage() {
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
<AppPageHeader
|
|
24
|
+
breadcrumbs={[{ label: 'PageEmptyCanvas' }]}
|
|
25
|
+
title="PageEmptyCanvas"
|
|
26
|
+
subheader="Centered empty state with title, hint, and optional CTA. Use when a route has no data yet."
|
|
27
|
+
actions={<DocsHeaderActions />}
|
|
28
|
+
/>
|
|
29
|
+
<DocsGuidance source={pageEmptyCanvasGuidance} />
|
|
30
|
+
<PageContentSection
|
|
31
|
+
style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
|
|
32
|
+
>
|
|
33
|
+
<section>
|
|
34
|
+
<h3>Title and hint</h3>
|
|
35
|
+
<p
|
|
36
|
+
style={{
|
|
37
|
+
marginBottom: '1rem',
|
|
38
|
+
color: 'var(--muted-foreground)',
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
Minimal empty state: a short <code>title</code> plus a{' '}
|
|
42
|
+
<code>hint</code> describing what to do next.
|
|
43
|
+
</p>
|
|
44
|
+
<div style={demoFrameStyle}>
|
|
45
|
+
<PageEmptyCanvas
|
|
46
|
+
title="No alerts yet"
|
|
47
|
+
hint="When a news alert fires, it will appear here."
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
</section>
|
|
51
|
+
|
|
52
|
+
<section>
|
|
53
|
+
<h3>Extended example</h3>
|
|
54
|
+
<p
|
|
55
|
+
style={{
|
|
56
|
+
marginBottom: '1rem',
|
|
57
|
+
color: 'var(--muted-foreground)',
|
|
58
|
+
}}
|
|
59
|
+
>
|
|
60
|
+
Real-world placement: render directly under <code>PageContent</code>
|
|
61
|
+
; the canvas centers and grows itself.
|
|
62
|
+
</p>
|
|
63
|
+
<div style={{ ...demoFrameStyle, minHeight: 360 }}>
|
|
64
|
+
<PageContent variant="clean">
|
|
65
|
+
<PageEmptyCanvas
|
|
66
|
+
title="This workspace is empty"
|
|
67
|
+
hint="Connect a data source to populate your dashboard with drivers and forecasts."
|
|
68
|
+
>
|
|
69
|
+
<Button type="button" variant="default">
|
|
70
|
+
Connect data source
|
|
71
|
+
</Button>
|
|
72
|
+
<a
|
|
73
|
+
href="https://sybilion.com"
|
|
74
|
+
target="_blank"
|
|
75
|
+
rel="noopener noreferrer"
|
|
76
|
+
>
|
|
77
|
+
Learn how to connect a data source
|
|
78
|
+
</a>
|
|
79
|
+
</PageEmptyCanvas>
|
|
80
|
+
</PageContent>
|
|
81
|
+
</div>
|
|
82
|
+
</section>
|
|
83
|
+
</PageContentSection>
|
|
84
|
+
</>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
} from '#uilib/components/ui/Page';
|
|
9
9
|
import type { PageFooterLinkItem } from '#uilib/components/ui/Page/PageFooter/PageFooter';
|
|
10
10
|
import { Switch } from '#uilib/components/ui/Switch';
|
|
11
|
-
import pageFooterGuidance from '#uilib/docs/agent-guidance/page-footer.md';
|
|
12
11
|
import { GlobeIcon, Hash, MailIcon, MessageCircle } from 'lucide-react';
|
|
13
12
|
|
|
14
13
|
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
@@ -16,6 +15,26 @@ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
|
16
15
|
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
17
16
|
import S from './PageFooterPage.styl';
|
|
18
17
|
|
|
18
|
+
/** Human-maintainer docs only — not in agent glossary (shell-wired via AppLayout). */
|
|
19
|
+
const PAGE_FOOTER_GUIDANCE = `PageFooter renders the page-level footer with copyright, a version label, and an optional row of links that wrap on narrow viewports. Links accept an icon and label and open external destinations.
|
|
20
|
+
|
|
21
|
+
**Shell-only.** Standalone apps wire this in \`AppLayout\` via \`AppShellMainContent footer={…}\`; agents composing route pages do not import or render PageFooter.
|
|
22
|
+
|
|
23
|
+
## When to use
|
|
24
|
+
|
|
25
|
+
- At the bottom of an application shell to show copyright, version, and support links.
|
|
26
|
+
- When you need a consistent set of external links, such as website, email, or community channels.
|
|
27
|
+
|
|
28
|
+
## When not to use
|
|
29
|
+
|
|
30
|
+
- For page actions or navigation within the app; keep those in the header or sidebar.
|
|
31
|
+
- Inside individual sections or cards; the footer belongs to the page shell.
|
|
32
|
+
|
|
33
|
+
## Do
|
|
34
|
+
|
|
35
|
+
- Keep the link list short so it remains scannable when it wraps on mobile.
|
|
36
|
+
`;
|
|
37
|
+
|
|
19
38
|
const DEMO_LINKS: PageFooterLinkItem[] = [
|
|
20
39
|
{
|
|
21
40
|
id: 'site',
|
|
@@ -70,7 +89,7 @@ export default function PageFooterPage() {
|
|
|
70
89
|
subheader="Copyright + optional link row with gap and wrapping."
|
|
71
90
|
actions={<DocsHeaderActions />}
|
|
72
91
|
/>
|
|
73
|
-
<DocsGuidance source={
|
|
92
|
+
<DocsGuidance source={PAGE_FOOTER_GUIDANCE} />
|
|
74
93
|
<PageContent>
|
|
75
94
|
<PageContentSection title="With links prop">
|
|
76
95
|
<div
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PageContent, PageContentSection } from '#uilib/components/ui/Page';
|
|
2
|
-
import pageGuidance from '#uilib/
|
|
2
|
+
import pageGuidance from '#uilib/components/ui/Page/AGENT.md';
|
|
3
3
|
|
|
4
4
|
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
5
5
|
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PageContentSection, PageTabs } from '#uilib/components/ui/Page';
|
|
2
|
-
import pageTabsGuidance from '#uilib/
|
|
2
|
+
import pageTabsGuidance from '#uilib/components/ui/Page/AGENT.md';
|
|
3
3
|
|
|
4
4
|
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
5
5
|
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
package/src/docs/registry.ts
CHANGED
|
@@ -428,6 +428,12 @@ export const DOC_REGISTRY: DocEntry[] = [
|
|
|
428
428
|
section: 'Layout',
|
|
429
429
|
load: () => import('./pages/PageColumnsPage'),
|
|
430
430
|
},
|
|
431
|
+
{
|
|
432
|
+
slug: 'page-empty-canvas',
|
|
433
|
+
title: 'PageEmptyCanvas',
|
|
434
|
+
section: 'Layout',
|
|
435
|
+
load: () => import('./pages/PageEmptyCanvasPage'),
|
|
436
|
+
},
|
|
431
437
|
{
|
|
432
438
|
slug: 'page-footer',
|
|
433
439
|
title: 'PageFooter',
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
ChatChrome supports a file dropzone: users drag text, Office, or PDF files onto the chat panel and the parsed content attaches to the prompt until they send. Configure accepted types via allowedAttachments and enable PDFs with allowPdfAttachments.
|
|
2
|
-
|
|
3
|
-
## When to use
|
|
4
|
-
|
|
5
|
-
- When users need to give the assistant file context, such as CSV data or documents.
|
|
6
|
-
- When attached files should be reviewed alongside the typed prompt before sending.
|
|
7
|
-
|
|
8
|
-
## When not to use
|
|
9
|
-
|
|
10
|
-
- For persistent file uploads to storage; use a dedicated upload flow.
|
|
11
|
-
- When only plain text input is expected; omit the attachment props to disable the dropzone.
|
|
12
|
-
|
|
13
|
-
## Do
|
|
14
|
-
|
|
15
|
-
- Office and PDF parsers load on demand, so the first attachment of those types incurs a one-off load.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
The chat composer can be prefilled without auto-sending: pass promptPrefill to ChatChrome, call ChatSheetActions.openNewChatWithPrefill for the portal sheet, or use a ?prompt= deep link. Focus lands at the end of the text so users can edit before submitting.
|
|
2
|
-
|
|
3
|
-
## When to use
|
|
4
|
-
|
|
5
|
-
- To seed the composer from a call to action, such as a suggested question on a dataset page.
|
|
6
|
-
- To deep link into the product with a prepared prompt via ?prompt=.
|
|
7
|
-
- When opening a new chat session that should start from a template prompt.
|
|
8
|
-
|
|
9
|
-
## When not to use
|
|
10
|
-
|
|
11
|
-
- To send a message automatically on behalf of the user; prefill never submits.
|
|
12
|
-
|
|
13
|
-
## Do
|
|
14
|
-
|
|
15
|
-
- Keep prefilled text short and editable; it is a starting point, not a command.
|