@tailor-platform/app-shell 1.18.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-shell-core.css +2 -2
- package/dist/app-shell.d.ts +1108 -190
- package/dist/app-shell.js +13090 -10783
- package/dist/{appshell-Y1AYCuVJ.js → appshell-B4QkQvXF.js} +519 -392
- package/dist/fonts/inter.css +7 -7
- package/dist/fonts/noto-sans-jp.css +116 -116
- package/dist/style-entry.d.ts +1 -656
- package/dist/testing.d.ts +132 -97
- package/dist/testing.js +1 -1
- package/dist/vite-plugin.d.ts +132 -97
- package/package.json +15 -10
- package/skills/app-shell-patterns/SKILL.md +38 -27
- package/skills/app-shell-patterns/references/api/aggregations.md +131 -0
- package/skills/app-shell-patterns/references/api/create-ai-gateway-client.md +32 -2
- package/skills/app-shell-patterns/references/api/define-module.md +5 -5
- package/skills/app-shell-patterns/references/api/router/use-params.md +2 -2
- package/skills/app-shell-patterns/references/api/use-ai-chat.md +46 -8
- package/skills/app-shell-patterns/references/api/use-app-shell-config.md +4 -4
- package/skills/app-shell-patterns/references/api/use-app-shell-data.md +5 -5
- package/skills/app-shell-patterns/references/api/use-app-shell.md +2 -2
- package/skills/app-shell-patterns/references/api/use-auth.md +3 -3
- package/skills/app-shell-patterns/references/api/use-route-error.md +12 -12
- package/skills/app-shell-patterns/references/components/action-panel.md +57 -23
- package/skills/app-shell-patterns/references/components/activity-card.md +3 -3
- package/skills/app-shell-patterns/references/components/ai-chat.md +37 -3
- package/skills/app-shell-patterns/references/components/app-shell.md +6 -5
- package/skills/app-shell-patterns/references/components/badge.md +7 -3
- package/skills/app-shell-patterns/references/components/card.md +2 -2
- package/skills/app-shell-patterns/references/components/data-table.md +514 -77
- package/skills/app-shell-patterns/references/components/date-picker.md +2 -2
- package/skills/app-shell-patterns/references/components/default-sidebar.md +2 -2
- package/skills/app-shell-patterns/references/components/dialog.md +8 -0
- package/skills/app-shell-patterns/references/components/filter-rail.md +10 -3
- package/skills/app-shell-patterns/references/components/form.md +19 -9
- package/skills/app-shell-patterns/references/components/global-header-layout.md +31 -8
- package/skills/app-shell-patterns/references/components/item-list.md +191 -0
- package/skills/app-shell-patterns/references/components/layout.md +24 -17
- package/skills/app-shell-patterns/references/components/select.md +18 -0
- package/skills/app-shell-patterns/references/components/sidebar-group.md +9 -7
- package/skills/app-shell-patterns/references/components/sidebar-layout.md +74 -11
- package/skills/app-shell-patterns/references/components/sidebar-section.md +8 -8
- package/skills/app-shell-patterns/references/components/tabs.md +32 -2
- package/skills/app-shell-patterns/references/components/text.md +75 -38
- package/skills/app-shell-patterns/references/components/tree.md +342 -0
- package/skills/app-shell-patterns/references/components/with-guard.md +5 -5
- package/skills/app-shell-patterns/references/concepts/authentication.md +1 -1
- package/skills/app-shell-patterns/references/concepts/routing-navigation.md +3 -3
- package/skills/app-shell-patterns/references/concepts/sidebar-navigation.md +16 -14
- package/skills/app-shell-patterns/references/concepts/styling-theming.md +28 -20
- package/skills/app-shell-patterns/references/migrations.md +22 -2
- package/skills/app-shell-patterns/references/pages/document-detail.md +32 -25
- package/skills/app-shell-patterns/references/patterns/form-modal.md +4 -1
- package/skills/app-shell-patterns/references/patterns/interaction-multi-select.md +1 -1
- package/dist/semantic-contrast.test.ts +0 -227
- package/dist/theme-bridge.test.ts +0 -182
|
@@ -84,6 +84,17 @@ Other props spread onto the root `<div>`.
|
|
|
84
84
|
|
|
85
85
|
Other props spread onto the region's outer `<div>`.
|
|
86
86
|
|
|
87
|
+
While the root's `status` is `"submitted"`, the conversation automatically appends a [`Spinner`](./spinner.md) and localized “Thinking…” status at the end. This covers the initial reply wait, tool execution, and the next reply wait after a tool result. The indicator disappears when text starts streaming, or when the request finishes, fails, or is stopped. It participates in the conversation's normal auto-scroll behavior; no separate loader state is needed.
|
|
88
|
+
|
|
89
|
+
### `AIChat.ToolCall`
|
|
90
|
+
|
|
91
|
+
A compact label for one model-requested tool call. Each label occupies its own row, so multiple calls stack vertically. It does not imply execution success, render tool arguments/results, or manage history.
|
|
92
|
+
|
|
93
|
+
| Prop | Type | Default | Description |
|
|
94
|
+
| ----------- | ------------------------------ | -------- | ------------------------------------------------ |
|
|
95
|
+
| `call` | `{ id: string; name: string }` | required | A `toolCalls` element returned by `useAIChat()`. |
|
|
96
|
+
| `className` | `string` | - | Merged onto the outer row, not the badge. |
|
|
97
|
+
|
|
87
98
|
### `AIChat.Composer`
|
|
88
99
|
|
|
89
100
|
| Prop | Type | Default | Description |
|
|
@@ -112,17 +123,18 @@ Most props stay inside their region. These `AIChat.Composer` props land on **ano
|
|
|
112
123
|
|
|
113
124
|
`onValueChange` is wrapped rather than forwarded — it is called from the `Textarea`'s `onChange`, and again with `""` after a submit. `defaultValue` seeds the composer's own state and is never forwarded. Nothing on `AIChat`, `AIChat.Header`, or `AIChat.Conversation` reaches another AppShell component.
|
|
114
125
|
|
|
115
|
-
|
|
126
|
+
Four attached parts wrap an AppShell component. They expose only the props the part's job needs rather than inheriting the wrapped component's surface, so its visual treatment is fixed and not yours to change:
|
|
116
127
|
|
|
117
128
|
| Part | Wraps | Accepts | Fixed |
|
|
118
129
|
| ----------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------- | ---------------------------------- |
|
|
119
130
|
| `AIChat.Suggestion` | [`Button`](./button.md) | `suggestion`, `onSelect`, `className`, `disabled`, `children` | `variant="secondary"`, `size="sm"` |
|
|
120
131
|
| `AIChat.Action` | [`Button`](./button.md) inside a [`Tooltip`](./tooltip.md) | `label`, `onClick`, `className`, `disabled`, `children` | `variant="ghost"`, `size="icon"` |
|
|
121
132
|
| `AIChat.ChainOfThoughtSearchResult` | [`Badge`](./badge.md) | `className`, `children`, `variant` | — |
|
|
133
|
+
| `AIChat.ToolCall` | [`Badge`](./badge.md) | `call`, `className` | `variant="neutral"` |
|
|
122
134
|
|
|
123
135
|
`variant` stays open on `ChainOfThoughtSearchResult` because conveying status is what a `Badge` is for. `AIChat.Action`'s `label` becomes both the accessible name and the tooltip text.
|
|
124
136
|
|
|
125
|
-
|
|
137
|
+
`ToolCall` applies `className` to its outer row, not the inner badge. For `Suggestion`, `Action`, and `ChainOfThoughtSearchResult`, `className` is merged with `cn()`, which is not configured for AppShell's internal prefix, so it cannot reliably override a base utility from the wrapped component. Add properties the component doesn't set, and reach for the wrapped component's own props or variants to change ones it does — see [Styling AppShell components](../concepts/styling-theming.md#styling-appshell-components).
|
|
126
138
|
|
|
127
139
|
## Filling the page
|
|
128
140
|
|
|
@@ -261,6 +273,28 @@ Structured step timeline for agentic turns — the discrete plan being executed,
|
|
|
261
273
|
|
|
262
274
|
`status` is `"complete" | "active" | "pending"`.
|
|
263
275
|
|
|
276
|
+
### Tool calls during the active flow
|
|
277
|
+
|
|
278
|
+
`useAIChat()` returns a transient `toolCalls` list separately from `messages`. Render it with `AIChat.ToolCall` after the message history inside `AIChat.Conversation`:
|
|
279
|
+
|
|
280
|
+
```tsx
|
|
281
|
+
{
|
|
282
|
+
toolCalls.length > 0 ? (
|
|
283
|
+
<AIChat.Message from="assistant">
|
|
284
|
+
{toolCalls.map((call) => (
|
|
285
|
+
<AIChat.ToolCall key={call.id} call={call} />
|
|
286
|
+
))}
|
|
287
|
+
</AIChat.Message>
|
|
288
|
+
) : null;
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Each call renders on its own row, in the order supplied. Labels are localized automatically.
|
|
293
|
+
|
|
294
|
+
The list clears when the response finishes, is stopped, or fails. It does not create tool messages or persist in the conversation log.
|
|
295
|
+
|
|
296
|
+
These names record model requests, not execution success. Tool arguments and results stay internal. Do not infer a `ToolHeader` success or running state from name-only metadata.
|
|
297
|
+
|
|
264
298
|
### Tool
|
|
265
299
|
|
|
266
300
|
Collapsible tool-call card. Maps 1:1 to the AI SDK's tool-part lifecycle, so a streaming loop can update a call in place as parts arrive.
|
|
@@ -279,7 +313,7 @@ Collapsible tool-call card. Maps 1:1 to the AI SDK's tool-part lifecycle, so a s
|
|
|
279
313
|
|
|
280
314
|
### Sources
|
|
281
315
|
|
|
282
|
-
Compact "Used N sources" citation trigger under a grounded answer.
|
|
316
|
+
Compact "Used N sources" citation trigger under a grounded answer. Supply source data from your application; `useAIChat()` does not return citation metadata.
|
|
283
317
|
|
|
284
318
|
```tsx
|
|
285
319
|
<AIChat.Sources>
|
|
@@ -232,14 +232,14 @@ Access the configured timezone in components using [`useTimeZone`](../api/use-ti
|
|
|
232
232
|
- **Description:** Global error boundary component applied to all routes
|
|
233
233
|
|
|
234
234
|
```tsx
|
|
235
|
-
import { useRouteError } from "@tailor-platform/app-shell";
|
|
235
|
+
import { Text, useRouteError } from "@tailor-platform/app-shell";
|
|
236
236
|
|
|
237
237
|
const GlobalErrorBoundary = () => {
|
|
238
238
|
const error = useRouteError() as Error;
|
|
239
239
|
return (
|
|
240
240
|
<div className="p-8">
|
|
241
|
-
<h1 className="
|
|
242
|
-
<p className="text-
|
|
241
|
+
<Text.h1 className="mb-4">Something went wrong</Text.h1>
|
|
242
|
+
<Text.p className="text-danger-text">{error.message}</Text.p>
|
|
243
243
|
</div>
|
|
244
244
|
);
|
|
245
245
|
};
|
|
@@ -432,6 +432,7 @@ import {
|
|
|
432
432
|
SidebarLayout,
|
|
433
433
|
defineModule,
|
|
434
434
|
defineResource,
|
|
435
|
+
Text,
|
|
435
436
|
useRouteError,
|
|
436
437
|
} from "@tailor-platform/app-shell";
|
|
437
438
|
import { Building } from "lucide-react";
|
|
@@ -450,8 +451,8 @@ const ErrorBoundary = () => {
|
|
|
450
451
|
const error = useRouteError() as Error;
|
|
451
452
|
return (
|
|
452
453
|
<div className="p-8">
|
|
453
|
-
<h1
|
|
454
|
-
<p>{error.message}</p>
|
|
454
|
+
<Text.h1>Error</Text.h1>
|
|
455
|
+
<Text.p>{error.message}</Text.p>
|
|
455
456
|
</div>
|
|
456
457
|
);
|
|
457
458
|
};
|
|
@@ -32,6 +32,7 @@ function BasicUsage() {
|
|
|
32
32
|
<Badge variant="subtle-warning">Subtle Warning</Badge>
|
|
33
33
|
<Badge variant="subtle-error">Subtle Error</Badge>
|
|
34
34
|
<Badge variant="subtle-info">Subtle Info</Badge>
|
|
35
|
+
<Badge variant="subtle-neutral">Subtle Neutral</Badge>
|
|
35
36
|
</div>
|
|
36
37
|
);
|
|
37
38
|
}
|
|
@@ -54,6 +55,7 @@ Filled variants for high emphasis, plus subtle variants for lower-emphasis statu
|
|
|
54
55
|
<Badge variant="subtle-warning">Needs Attention</Badge>
|
|
55
56
|
<Badge variant="subtle-error">Needs Review</Badge>
|
|
56
57
|
<Badge variant="subtle-info">In Progress</Badge>
|
|
58
|
+
<Badge variant="subtle-neutral">Archived</Badge>
|
|
57
59
|
```
|
|
58
60
|
|
|
59
61
|
### Outline Variants with Status Dots
|
|
@@ -74,9 +76,9 @@ _Generated from the type surface — first-party props only._
|
|
|
74
76
|
|
|
75
77
|
### BadgeProps
|
|
76
78
|
|
|
77
|
-
| Prop | Type
|
|
78
|
-
| ---------- |
|
|
79
|
-
| `variant?` | `"error" \| "neutral" \| "success" \| "warning" \| "info" \| "default" \| "subtle-success" \| "subtle-warning" \| "subtle-error" \| "subtle-info" \| "outline-success" \| "outline-warning" \| "outline-error" \| "outline-info" \| "outline-neutral" \| null` | `"default"` | Visual style variant |
|
|
79
|
+
| Prop | Type | Default | Description |
|
|
80
|
+
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | -------------------- |
|
|
81
|
+
| `variant?` | `"error" \| "neutral" \| "success" \| "warning" \| "info" \| "default" \| "subtle-success" \| "subtle-warning" \| "subtle-error" \| "subtle-info" \| "subtle-neutral" \| "outline-success" \| "outline-warning" \| "outline-error" \| "outline-info" \| "outline-neutral" \| null` | `"default"` | Visual style variant |
|
|
80
82
|
|
|
81
83
|
## Exports
|
|
82
84
|
|
|
@@ -99,6 +101,7 @@ type BadgeVariant =
|
|
|
99
101
|
| "subtle-warning" // Low-emphasis yellow
|
|
100
102
|
| "subtle-error" // Low-emphasis red/destructive
|
|
101
103
|
| "subtle-info" // Low-emphasis blue
|
|
104
|
+
| "subtle-neutral" // Low-emphasis gray
|
|
102
105
|
// Outline variants with status dots
|
|
103
106
|
| "outline-success"
|
|
104
107
|
| "outline-warning"
|
|
@@ -225,6 +228,7 @@ function ProductBadge({ product }: { product: Product }) {
|
|
|
225
228
|
| `subtle-warning` | ![Subtle yellow badge] | Low-emphasis pending or attention states |
|
|
226
229
|
| `subtle-error` | ![Subtle red badge] | Low-emphasis failures or exceptions |
|
|
227
230
|
| `subtle-info` | ![Subtle blue badge] | Low-emphasis informational or in-progress |
|
|
231
|
+
| `subtle-neutral` | ![Subtle gray badge] | Low-emphasis tags with no status |
|
|
228
232
|
|
|
229
233
|
### Outline Variants
|
|
230
234
|
|
|
@@ -25,7 +25,7 @@ function BasicUsage() {
|
|
|
25
25
|
<Card.Root>
|
|
26
26
|
<Card.Header title="Order Details" description="Summary of order #1234" />
|
|
27
27
|
<Card.Content>
|
|
28
|
-
<p>Content goes here</p>
|
|
28
|
+
<Text.p>Content goes here</Text.p>
|
|
29
29
|
</Card.Content>
|
|
30
30
|
</Card.Root>
|
|
31
31
|
);
|
|
@@ -154,7 +154,7 @@ For a scrollable list, put the overflow on `Card.Content`. Rows supply their own
|
|
|
154
154
|
```tsx
|
|
155
155
|
<Card.Root>
|
|
156
156
|
<Card.Content>
|
|
157
|
-
<p>No header needed for this card.</p>
|
|
157
|
+
<Text.p>No header needed for this card.</Text.p>
|
|
158
158
|
</Card.Content>
|
|
159
159
|
</Card.Root>
|
|
160
160
|
```
|