@tailor-platform/app-shell 1.15.0 → 1.16.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 +1 -1
- package/dist/app-shell.d.ts +208 -114
- package/dist/app-shell.js +3449 -3446
- package/dist/{appshell-DLVBFo5J.js → appshell-B0wh5Lq0.js} +625 -512
- package/dist/style-entry.d.ts +116 -96
- package/dist/testing.d.ts +116 -96
- package/dist/testing.js +1 -1
- package/dist/vite-plugin.d.ts +116 -96
- package/package.json +8 -8
- package/skills/app-shell-patterns/SKILL.md +101 -14
- package/skills/app-shell-patterns/references/api/create-ai-gateway-client.md +115 -0
- package/skills/app-shell-patterns/references/api/create-typed-paths.md +117 -0
- package/skills/app-shell-patterns/references/api/define-i18n-labels.md +143 -0
- package/skills/app-shell-patterns/references/api/define-module.md +247 -0
- package/skills/app-shell-patterns/references/api/define-resource.md +307 -0
- package/skills/app-shell-patterns/references/api/guards/hidden.md +202 -0
- package/skills/app-shell-patterns/references/api/guards/overview.md +354 -0
- package/skills/app-shell-patterns/references/api/guards/pass.md +129 -0
- package/skills/app-shell-patterns/references/api/guards/redirect-to.md +307 -0
- package/skills/app-shell-patterns/references/api/router/use-location.md +240 -0
- package/skills/app-shell-patterns/references/api/router/use-navigate.md +138 -0
- package/skills/app-shell-patterns/references/api/router/use-params.md +218 -0
- package/skills/app-shell-patterns/references/api/use-ai-chat.md +110 -0
- package/skills/app-shell-patterns/references/api/use-app-shell-config.md +126 -0
- package/skills/app-shell-patterns/references/api/use-app-shell-data.md +146 -0
- package/skills/app-shell-patterns/references/api/use-app-shell.md +143 -0
- package/skills/app-shell-patterns/references/api/use-auth.md +145 -0
- package/skills/app-shell-patterns/references/api/use-override-breadcrumb.md +74 -0
- package/skills/app-shell-patterns/references/api/use-page-meta.md +96 -0
- package/skills/app-shell-patterns/references/api/use-register-command-palette-actions.md +90 -0
- package/skills/app-shell-patterns/references/api/use-resolved-locale.md +67 -0
- package/skills/app-shell-patterns/references/api/use-route-error.md +214 -0
- package/skills/app-shell-patterns/references/api/use-theme.md +108 -0
- package/skills/app-shell-patterns/references/api/use-time-zone.md +80 -0
- package/skills/app-shell-patterns/references/api/use-toast.md +107 -0
- package/skills/app-shell-patterns/references/components/action-panel.md +168 -0
- package/skills/app-shell-patterns/references/components/activity-card.md +142 -0
- package/skills/app-shell-patterns/references/components/ai-chat.md +315 -0
- package/skills/app-shell-patterns/references/components/alert.md +202 -0
- package/skills/app-shell-patterns/references/components/app-shell.md +530 -0
- package/skills/app-shell-patterns/references/components/appearance-switcher.md +87 -0
- package/skills/app-shell-patterns/references/components/attachment.md +138 -0
- package/skills/app-shell-patterns/references/components/autocomplete.md +278 -0
- package/skills/app-shell-patterns/references/components/avatar.md +80 -0
- package/skills/app-shell-patterns/references/components/badge.md +309 -0
- package/skills/app-shell-patterns/references/components/button.md +164 -0
- package/skills/app-shell-patterns/references/components/card.md +109 -0
- package/skills/app-shell-patterns/references/components/checkbox.md +169 -0
- package/skills/app-shell-patterns/references/components/combobox.md +318 -0
- package/skills/app-shell-patterns/references/components/command-palette.md +413 -0
- package/skills/app-shell-patterns/references/components/csv-importer.md +214 -0
- package/skills/app-shell-patterns/references/components/data-table.md +953 -0
- package/skills/app-shell-patterns/references/components/date-picker.md +248 -0
- package/skills/app-shell-patterns/references/components/default-header.md +75 -0
- package/skills/app-shell-patterns/references/components/default-sidebar.md +136 -0
- package/skills/app-shell-patterns/references/components/description-card.md +569 -0
- package/skills/app-shell-patterns/references/components/dialog.md +164 -0
- package/skills/app-shell-patterns/references/components/document-progress-card.md +154 -0
- package/skills/app-shell-patterns/references/components/form.md +378 -0
- package/skills/app-shell-patterns/references/components/global-header-layout.md +132 -0
- package/skills/app-shell-patterns/references/components/grid.md +184 -0
- package/skills/app-shell-patterns/references/components/input.md +83 -0
- package/skills/app-shell-patterns/references/components/layout.md +539 -0
- package/skills/app-shell-patterns/references/components/menu.md +218 -0
- package/skills/app-shell-patterns/references/components/metric-card.md +94 -0
- package/skills/app-shell-patterns/references/components/select.md +283 -0
- package/skills/app-shell-patterns/references/components/sheet.md +237 -0
- package/skills/app-shell-patterns/references/components/sidebar-group.md +466 -0
- package/skills/app-shell-patterns/references/components/sidebar-item.md +458 -0
- package/skills/app-shell-patterns/references/components/sidebar-layout.md +258 -0
- package/skills/app-shell-patterns/references/components/spinner.md +81 -0
- package/skills/app-shell-patterns/references/components/table.md +188 -0
- package/skills/app-shell-patterns/references/components/tabs.md +158 -0
- package/skills/app-shell-patterns/references/components/textarea.md +122 -0
- package/skills/app-shell-patterns/references/components/timeline.md +317 -0
- package/skills/app-shell-patterns/references/components/toolbar.md +138 -0
- package/skills/app-shell-patterns/references/components/tooltip.md +144 -0
- package/skills/app-shell-patterns/references/components/with-guard.md +445 -0
- package/skills/app-shell-patterns/references/concepts/authentication.md +301 -0
- package/skills/app-shell-patterns/references/concepts/custom-components.md +59 -0
- package/skills/app-shell-patterns/references/concepts/file-based-routing.md +350 -0
- package/skills/app-shell-patterns/references/{fundamental → concepts}/graphql.md +11 -4
- package/skills/app-shell-patterns/references/concepts/modules-and-resources.md +229 -0
- package/skills/app-shell-patterns/references/concepts/routing-navigation.md +387 -0
- package/skills/app-shell-patterns/references/concepts/sidebar-navigation.md +388 -0
- package/skills/app-shell-patterns/references/{fundamental/design-system.md → concepts/styling-theming.md} +258 -110
- package/skills/app-shell-patterns/references/migrations.md +34 -0
- package/skills/app-shell-patterns/references/pages/{detail.md → document-detail.md} +4 -27
- package/skills/app-shell-patterns/references/patterns/form-composer.md +43 -45
- package/skills/app-shell-patterns/references/patterns/form-modal.md +39 -100
- package/skills/app-shell-patterns/references/patterns/form-sectioned.md +12 -38
- package/skills/app-shell-patterns/references/patterns/form-single-page.md +11 -32
- package/skills/app-shell-patterns/references/patterns/form-wizard.md +12 -53
- package/skills/app-shell-patterns/references/patterns/interaction-confirm.md +11 -27
- package/skills/app-shell-patterns/references/patterns/interaction-multi-select.md +13 -27
- package/skills/app-shell-patterns/references/patterns/interaction-toast.md +10 -34
- package/skills/app-shell-patterns/references/patterns/list-dense-scan.md +11 -86
- package/skills/app-shell-patterns/references/fundamental/components.md +0 -1009
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
name: Multi Select
|
|
4
|
-
category: pattern
|
|
5
|
-
subcategory: interaction
|
|
2
|
+
title: Multi Select
|
|
6
3
|
description: Floating bottom action bar for bulk operations on selected list rows
|
|
7
|
-
requiredImports: [Table, Checkbox, Button, Menu]
|
|
8
|
-
tags: [bulk, selection, toolbar, floating-bar, multi-select, batch]
|
|
9
|
-
do:
|
|
10
|
-
- ANY list page where rows can be acted on in bulk (archive, assign, export, approve, delete)
|
|
11
|
-
- Selection is initiated by clicking a leading-column checkbox on rows
|
|
12
|
-
- Selection state needs to persist across pagination and filter changes
|
|
13
|
-
dont:
|
|
14
|
-
- A list where bulk action is genuinely impossible (single-select only)
|
|
15
|
-
- A pure picker/selector inside a Dialog whose footer already gates the action
|
|
16
|
-
- Destructive bulk action triggered without confirmation — pair with interaction/confirm
|
|
17
4
|
---
|
|
18
5
|
|
|
19
|
-
|
|
6
|
+
<!-- GENERATED by docs-kit from docs-src/patterns/interaction-multi-select.docs.outline.md — do not edit by hand. -->
|
|
7
|
+
|
|
8
|
+
# Multi Select
|
|
20
9
|
|
|
21
10
|
## When to Use
|
|
22
11
|
|
|
@@ -47,19 +36,14 @@ Floating action bar appears the moment selection count goes from 0 → 1, anchor
|
|
|
47
36
|
|
|
48
37
|
## Page Implementation
|
|
49
38
|
|
|
39
|
+
<example-preview name="interaction-multi-select"></example-preview>
|
|
40
|
+
|
|
50
41
|
```tsx
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
type Props = {
|
|
57
|
-
orders: Order[];
|
|
58
|
-
onArchive: (ids: string[]) => void;
|
|
59
|
-
onExport: (ids: string[]) => void;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export default function MultiSelect({ orders, onArchive, onExport }: Props) {
|
|
42
|
+
function InteractionMultiSelect() {
|
|
43
|
+
const orders = mockOrders;
|
|
44
|
+
const onArchive = (ids: string[]) => window.alert(`Archiving ${ids.length}`);
|
|
45
|
+
const onExport = (ids: string[]) => window.alert(`Exporting ${ids.length}`);
|
|
46
|
+
|
|
63
47
|
const [selectedIds, setSelectedIds] = useState<Set<string>>(new Set());
|
|
64
48
|
|
|
65
49
|
const toggleRow = (id: string) => {
|
|
@@ -155,6 +139,8 @@ export default function MultiSelect({ orders, onArchive, onExport }: Props) {
|
|
|
155
139
|
}
|
|
156
140
|
```
|
|
157
141
|
|
|
142
|
+
<!-- source: multi-select.tsx -->
|
|
143
|
+
|
|
158
144
|
## Constraints
|
|
159
145
|
|
|
160
146
|
- Count label + Clear button are always present in the bar
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
name: Toast
|
|
4
|
-
category: pattern
|
|
5
|
-
subcategory: interaction
|
|
2
|
+
title: Toast
|
|
6
3
|
description: Lightweight feedback after mutations — success or error notifications
|
|
7
|
-
requiredImports: [Button]
|
|
8
|
-
tags: [toast, feedback, notification, mutation, success, error]
|
|
9
|
-
do:
|
|
10
|
-
- Feedback after a mutation (create, update, delete) — success or error
|
|
11
|
-
- Lightweight async signal that doesn't need to block the UI
|
|
12
|
-
- Confirming work the user just initiated
|
|
13
|
-
dont:
|
|
14
|
-
- Destructive action that has not yet executed — use interaction/confirm
|
|
15
|
-
- Long-running blocking operation — use an inline progress UI, not a toast
|
|
16
4
|
---
|
|
17
5
|
|
|
18
|
-
|
|
6
|
+
<!-- GENERATED by docs-kit from docs-src/patterns/interaction-toast.docs.outline.md — do not edit by hand. -->
|
|
7
|
+
|
|
8
|
+
# Toast
|
|
19
9
|
|
|
20
10
|
## When to Use
|
|
21
11
|
|
|
@@ -25,31 +15,17 @@ dont:
|
|
|
25
15
|
|
|
26
16
|
## Page Implementation
|
|
27
17
|
|
|
28
|
-
|
|
29
|
-
/* pattern: interaction/toast */
|
|
30
|
-
import { Button, useToast } from "@tailor-platform/app-shell";
|
|
31
|
-
|
|
32
|
-
type Props = {
|
|
33
|
-
orderId: string;
|
|
34
|
-
onApprove: () => Promise<void>;
|
|
35
|
-
};
|
|
18
|
+
<example-preview name="interaction-toast"></example-preview>
|
|
36
19
|
|
|
37
|
-
|
|
20
|
+
```tsx
|
|
21
|
+
function InteractionToast() {
|
|
38
22
|
const toast = useToast();
|
|
39
|
-
|
|
40
|
-
const handleApprove = async () => {
|
|
41
|
-
try {
|
|
42
|
-
await onApprove();
|
|
43
|
-
toast.success(`Order ${orderId} approved`);
|
|
44
|
-
} catch {
|
|
45
|
-
toast.error("Failed to approve order. Try again.");
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return <Button onClick={handleApprove}>Approve</Button>;
|
|
23
|
+
return <Button onClick={() => toast.success("Order ORD-1024 approved")}>Approve</Button>;
|
|
50
24
|
}
|
|
51
25
|
```
|
|
52
26
|
|
|
27
|
+
<!-- source: toast-example.tsx -->
|
|
28
|
+
|
|
53
29
|
## Copy Rules
|
|
54
30
|
|
|
55
31
|
- Success: name what happened, including the object identifier. "Order #1234 created", "Product archived".
|
|
@@ -1,35 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
name: Dense Scan List
|
|
4
|
-
category: pattern
|
|
5
|
-
subcategory: list
|
|
2
|
+
title: Dense Scan List
|
|
6
3
|
description: High-density scannable list backed by GraphQL connections with DataTable, sort, filters, and pagination
|
|
7
|
-
requiredImports:
|
|
8
|
-
[
|
|
9
|
-
DataTable,
|
|
10
|
-
useDataTable,
|
|
11
|
-
useCollectionVariables,
|
|
12
|
-
createColumnHelper,
|
|
13
|
-
Layout,
|
|
14
|
-
Card,
|
|
15
|
-
Button,
|
|
16
|
-
Badge,
|
|
17
|
-
Link,
|
|
18
|
-
Menu,
|
|
19
|
-
Tabs,
|
|
20
|
-
]
|
|
21
|
-
tags: [table, bulk-action, filter, pagination, datatable, connection]
|
|
22
|
-
do:
|
|
23
|
-
- Browsing many records of one entity type (orders, POs, products) with GraphQL pagination
|
|
24
|
-
- Operators sort, filter, and select rows; row click navigates to detail
|
|
25
|
-
- Optionally a bucket control (Tabs) aligned to one categorical dimension (status, type)
|
|
26
|
-
dont:
|
|
27
|
-
- Side-by-side match/reconcile views comparing two grids
|
|
28
|
-
- A tiny/static list where DataTable would be heavyweight — use Table.Root manually
|
|
29
|
-
- Inline editable cells — use pattern/detail or pattern/form/modal instead
|
|
30
4
|
---
|
|
31
5
|
|
|
32
|
-
|
|
6
|
+
<!-- GENERATED by docs-kit from docs-src/patterns/list-dense-scan.docs.outline.md — do not edit by hand. -->
|
|
7
|
+
|
|
8
|
+
# Dense Scan List
|
|
33
9
|
|
|
34
10
|
## When to Use
|
|
35
11
|
|
|
@@ -39,73 +15,22 @@ dont:
|
|
|
39
15
|
|
|
40
16
|
## Column Definition
|
|
41
17
|
|
|
42
|
-
|
|
43
|
-
import type { Column } from "@tailor-platform/app-shell";
|
|
44
|
-
import { Badge } from "@tailor-platform/app-shell";
|
|
45
|
-
|
|
46
|
-
export type Order = {
|
|
47
|
-
id: string;
|
|
48
|
-
orderNumber: string;
|
|
49
|
-
customer: string;
|
|
50
|
-
status: "draft" | "confirmed" | "shipped" | "delivered";
|
|
51
|
-
amount: number;
|
|
52
|
-
createdAt: string;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// Primary status column — filled semantic variants (one per row).
|
|
56
|
-
// Secondary status columns (e.g. delivery, billing) use outline-* instead.
|
|
57
|
-
const statusVariant = {
|
|
58
|
-
draft: "neutral",
|
|
59
|
-
confirmed: "info",
|
|
60
|
-
shipped: "warning",
|
|
61
|
-
delivered: "success",
|
|
62
|
-
} as const;
|
|
63
|
-
|
|
64
|
-
export const columns: Column<Order>[] = [
|
|
65
|
-
{ label: "Order #", accessor: (row) => row.orderNumber },
|
|
66
|
-
{ label: "Customer", accessor: (row) => row.customer },
|
|
67
|
-
{
|
|
68
|
-
label: "Status",
|
|
69
|
-
render: (row) => <Badge variant={statusVariant[row.status]}>{row.status}</Badge>,
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
// Numeric columns right-align so digits line up. `type: "money" | "number"`
|
|
73
|
-
// auto-right; with a custom `render` set `align` explicitly.
|
|
74
|
-
label: "Amount",
|
|
75
|
-
align: "right",
|
|
76
|
-
render: (row) => `${row.amount.toLocaleString()}`,
|
|
77
|
-
},
|
|
78
|
-
{ label: "Created", accessor: (row) => row.createdAt },
|
|
79
|
-
];
|
|
80
|
-
```
|
|
18
|
+
Columns are defined with `createColumnHelper` (see the example below) — each column has a `label` and an `accessor`, or a custom `render` for cells like status badges.
|
|
81
19
|
|
|
82
20
|
## Page Implementation
|
|
83
21
|
|
|
84
|
-
|
|
85
|
-
/* pattern: list/dense-scan */
|
|
86
|
-
import { DataTable, Layout, useDataTable, Button, Input } from "@tailor-platform/app-shell";
|
|
87
|
-
import type { Order } from "./columns";
|
|
88
|
-
import { columns } from "./columns";
|
|
89
|
-
import type { DataTableData } from "@tailor-platform/app-shell";
|
|
90
|
-
|
|
91
|
-
type Props = {
|
|
92
|
-
data: DataTableData<Order>;
|
|
93
|
-
onCreateClick: () => void;
|
|
94
|
-
};
|
|
22
|
+
<example-preview name="dense-scan"></example-preview>
|
|
95
23
|
|
|
96
|
-
|
|
97
|
-
|
|
24
|
+
```tsx
|
|
25
|
+
function DenseScan() {
|
|
26
|
+
const table = useDataTable({ data: { rows: orders, total: orders.length }, columns });
|
|
98
27
|
|
|
99
28
|
return (
|
|
100
|
-
|
|
101
|
-
// column header row, and pagination footer stay visible at every viewport
|
|
102
|
-
// height — only the table's rows region scrolls. Omit `fill` on pages
|
|
103
|
-
// that should flow and scroll naturally (forms, dashboards, articles).
|
|
104
|
-
<Layout fill>
|
|
29
|
+
<Layout>
|
|
105
30
|
<Layout.Header
|
|
106
31
|
title="Orders"
|
|
107
32
|
actions={[
|
|
108
|
-
<Button key="create"
|
|
33
|
+
<Button key="create" size="sm">
|
|
109
34
|
Create Order
|
|
110
35
|
</Button>,
|
|
111
36
|
]}
|