@tailor-platform/app-shell 1.15.0 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/app-shell-core.css +1 -1
  2. package/dist/app-shell.d.ts +811 -131
  3. package/dist/app-shell.js +7155 -5797
  4. package/dist/{appshell-DLVBFo5J.js → appshell-CahhZy7v.js} +656 -524
  5. package/dist/semantic-contrast.test.ts +154 -0
  6. package/dist/style-entry.d.ts +147 -92
  7. package/dist/testing.d.ts +152 -95
  8. package/dist/testing.js +1 -1
  9. package/dist/theme-bridge.test.ts +101 -1
  10. package/dist/theme.bridge.css +91 -0
  11. package/dist/theme.css +6 -1
  12. package/dist/themes/_template.css +7 -1
  13. package/dist/themes/bloom.css +0 -6
  14. package/dist/themes/cream.css +0 -6
  15. package/dist/themes/default.css +389 -69
  16. package/dist/vite-plugin.d.ts +147 -92
  17. package/package.json +8 -8
  18. package/skills/app-shell-patterns/SKILL.md +108 -19
  19. package/skills/app-shell-patterns/references/api/create-ai-gateway-client.md +115 -0
  20. package/skills/app-shell-patterns/references/api/create-typed-paths.md +117 -0
  21. package/skills/app-shell-patterns/references/api/define-i18n-labels.md +143 -0
  22. package/skills/app-shell-patterns/references/api/define-module.md +247 -0
  23. package/skills/app-shell-patterns/references/api/define-resource.md +307 -0
  24. package/skills/app-shell-patterns/references/api/guards/hidden.md +202 -0
  25. package/skills/app-shell-patterns/references/api/guards/overview.md +354 -0
  26. package/skills/app-shell-patterns/references/api/guards/pass.md +129 -0
  27. package/skills/app-shell-patterns/references/api/guards/redirect-to.md +307 -0
  28. package/skills/app-shell-patterns/references/api/router/use-location.md +240 -0
  29. package/skills/app-shell-patterns/references/api/router/use-navigate.md +138 -0
  30. package/skills/app-shell-patterns/references/api/router/use-params.md +218 -0
  31. package/skills/app-shell-patterns/references/api/use-ai-chat.md +110 -0
  32. package/skills/app-shell-patterns/references/api/use-app-shell-config.md +132 -0
  33. package/skills/app-shell-patterns/references/api/use-app-shell-data.md +150 -0
  34. package/skills/app-shell-patterns/references/api/use-app-shell.md +150 -0
  35. package/skills/app-shell-patterns/references/api/use-auth.md +145 -0
  36. package/skills/app-shell-patterns/references/api/use-override-breadcrumb.md +74 -0
  37. package/skills/app-shell-patterns/references/api/use-page-meta.md +96 -0
  38. package/skills/app-shell-patterns/references/api/use-register-command-palette-actions.md +90 -0
  39. package/skills/app-shell-patterns/references/api/use-resolved-locale.md +67 -0
  40. package/skills/app-shell-patterns/references/api/use-route-error.md +214 -0
  41. package/skills/app-shell-patterns/references/api/use-theme.md +108 -0
  42. package/skills/app-shell-patterns/references/api/use-time-zone.md +80 -0
  43. package/skills/app-shell-patterns/references/api/use-toast.md +104 -0
  44. package/skills/app-shell-patterns/references/components/action-panel.md +168 -0
  45. package/skills/app-shell-patterns/references/components/activity-card.md +142 -0
  46. package/skills/app-shell-patterns/references/components/ai-chat.md +315 -0
  47. package/skills/app-shell-patterns/references/components/alert.md +202 -0
  48. package/skills/app-shell-patterns/references/components/app-shell.md +530 -0
  49. package/skills/app-shell-patterns/references/components/appearance-switcher.md +87 -0
  50. package/skills/app-shell-patterns/references/components/attachment.md +138 -0
  51. package/skills/app-shell-patterns/references/components/autocomplete.md +278 -0
  52. package/skills/app-shell-patterns/references/components/avatar.md +80 -0
  53. package/skills/app-shell-patterns/references/components/badge.md +309 -0
  54. package/skills/app-shell-patterns/references/components/button.md +164 -0
  55. package/skills/app-shell-patterns/references/components/card.md +181 -0
  56. package/skills/app-shell-patterns/references/components/checkbox.md +169 -0
  57. package/skills/app-shell-patterns/references/components/combobox.md +318 -0
  58. package/skills/app-shell-patterns/references/components/command-palette.md +413 -0
  59. package/skills/app-shell-patterns/references/components/csv-importer.md +214 -0
  60. package/skills/app-shell-patterns/references/components/data-table.md +1168 -0
  61. package/skills/app-shell-patterns/references/components/date-picker.md +259 -0
  62. package/skills/app-shell-patterns/references/components/default-header.md +75 -0
  63. package/skills/app-shell-patterns/references/components/default-sidebar.md +136 -0
  64. package/skills/app-shell-patterns/references/components/description-card.md +569 -0
  65. package/skills/app-shell-patterns/references/components/dialog.md +164 -0
  66. package/skills/app-shell-patterns/references/components/document-progress-card.md +154 -0
  67. package/skills/app-shell-patterns/references/components/filter-rail.md +165 -0
  68. package/skills/app-shell-patterns/references/components/form.md +378 -0
  69. package/skills/app-shell-patterns/references/components/global-header-layout.md +132 -0
  70. package/skills/app-shell-patterns/references/components/grid.md +184 -0
  71. package/skills/app-shell-patterns/references/components/input.md +83 -0
  72. package/skills/app-shell-patterns/references/components/layout.md +539 -0
  73. package/skills/app-shell-patterns/references/components/menu.md +218 -0
  74. package/skills/app-shell-patterns/references/components/metric-card.md +94 -0
  75. package/skills/app-shell-patterns/references/components/select.md +283 -0
  76. package/skills/app-shell-patterns/references/components/sheet.md +237 -0
  77. package/skills/app-shell-patterns/references/components/sidebar-group.md +472 -0
  78. package/skills/app-shell-patterns/references/components/sidebar-item.md +458 -0
  79. package/skills/app-shell-patterns/references/components/sidebar-layout.md +258 -0
  80. package/skills/app-shell-patterns/references/components/sidebar-section.md +114 -0
  81. package/skills/app-shell-patterns/references/components/spinner.md +81 -0
  82. package/skills/app-shell-patterns/references/components/table.md +188 -0
  83. package/skills/app-shell-patterns/references/components/tabs.md +158 -0
  84. package/skills/app-shell-patterns/references/components/textarea.md +122 -0
  85. package/skills/app-shell-patterns/references/components/timeline.md +317 -0
  86. package/skills/app-shell-patterns/references/components/toolbar.md +138 -0
  87. package/skills/app-shell-patterns/references/components/tooltip.md +144 -0
  88. package/skills/app-shell-patterns/references/components/with-guard.md +445 -0
  89. package/skills/app-shell-patterns/references/concepts/authentication.md +301 -0
  90. package/skills/app-shell-patterns/references/concepts/custom-components.md +59 -0
  91. package/skills/app-shell-patterns/references/concepts/file-based-routing.md +356 -0
  92. package/skills/app-shell-patterns/references/{fundamental → concepts}/graphql.md +31 -18
  93. package/skills/app-shell-patterns/references/concepts/modules-and-resources.md +229 -0
  94. package/skills/app-shell-patterns/references/concepts/routing-navigation.md +425 -0
  95. package/skills/app-shell-patterns/references/concepts/sidebar-navigation.md +420 -0
  96. package/skills/app-shell-patterns/references/concepts/styling-theming.md +785 -0
  97. package/skills/app-shell-patterns/references/migrations.md +55 -0
  98. package/skills/app-shell-patterns/references/pages/{detail.md → document-detail.md} +10 -33
  99. package/skills/app-shell-patterns/references/patterns/form-composer.md +43 -45
  100. package/skills/app-shell-patterns/references/patterns/form-modal.md +37 -92
  101. package/skills/app-shell-patterns/references/patterns/form-sectioned.md +12 -38
  102. package/skills/app-shell-patterns/references/patterns/form-single-page.md +11 -32
  103. package/skills/app-shell-patterns/references/patterns/form-wizard.md +12 -53
  104. package/skills/app-shell-patterns/references/patterns/interaction-confirm.md +11 -27
  105. package/skills/app-shell-patterns/references/patterns/interaction-multi-select.md +136 -139
  106. package/skills/app-shell-patterns/references/patterns/interaction-toast.md +10 -34
  107. package/skills/app-shell-patterns/references/patterns/list-dense-scan.md +13 -88
  108. package/skills/app-shell-patterns/references/fundamental/components.md +0 -1009
  109. package/skills/app-shell-patterns/references/fundamental/design-system.md +0 -440
@@ -0,0 +1,309 @@
1
+ ---
2
+ title: Badge
3
+ description: Display status, labels, and tags with customizable variants
4
+ ---
5
+
6
+ <!-- GENERATED by docs-kit from docs-src/components/badge.docs.outline.md — do not edit by hand. -->
7
+
8
+ # Badge
9
+
10
+ The `Badge` component displays status indicators, labels, and tags with multiple style variants. It's commonly used to show document status, priority levels, or categorical information.
11
+
12
+ ## Import
13
+
14
+ ```tsx
15
+ import { Badge, type BadgeVariant, type BadgeOptions } from "@tailor-platform/app-shell";
16
+ ```
17
+
18
+ ## Basic Usage
19
+
20
+ <example-preview name="basic-usage"></example-preview>
21
+
22
+ ```tsx
23
+ function BasicUsage() {
24
+ return (
25
+ <div className="flex flex-wrap gap-2">
26
+ <Badge>Default</Badge>
27
+ <Badge variant="success">Success</Badge>
28
+ <Badge variant="warning">Warning</Badge>
29
+ <Badge variant="error">Error</Badge>
30
+ <Badge variant="info">Info</Badge>
31
+ <Badge variant="subtle-success">Subtle Success</Badge>
32
+ <Badge variant="subtle-warning">Subtle Warning</Badge>
33
+ <Badge variant="subtle-error">Subtle Error</Badge>
34
+ <Badge variant="subtle-info">Subtle Info</Badge>
35
+ </div>
36
+ );
37
+ }
38
+ ```
39
+
40
+ ## Variants
41
+
42
+ ### Solid and Subtle Variants
43
+
44
+ Filled variants for high emphasis, plus subtle variants for lower-emphasis status labels:
45
+
46
+ ```tsx
47
+ <Badge variant="default">Default</Badge>
48
+ <Badge variant="success">Approved</Badge>
49
+ <Badge variant="warning">Pending</Badge>
50
+ <Badge variant="error">Rejected</Badge>
51
+ <Badge variant="neutral">Draft</Badge>
52
+ <Badge variant="info">New</Badge>
53
+ <Badge variant="subtle-success">Matched</Badge>
54
+ <Badge variant="subtle-warning">Needs Attention</Badge>
55
+ <Badge variant="subtle-error">Needs Review</Badge>
56
+ <Badge variant="subtle-info">In Progress</Badge>
57
+ ```
58
+
59
+ ### Outline Variants with Status Dots
60
+
61
+ Outlined badges with colored status dots for subtle emphasis:
62
+
63
+ ```tsx
64
+ <Badge variant="outline-success">Active</Badge>
65
+ <Badge variant="outline-warning">In Progress</Badge>
66
+ <Badge variant="outline-error">Failed</Badge>
67
+ <Badge variant="outline-info">Info</Badge>
68
+ <Badge variant="outline-neutral">Inactive</Badge>
69
+ ```
70
+
71
+ ## Props
72
+
73
+ _Generated from the type surface — first-party props only._
74
+
75
+ ### BadgeProps
76
+
77
+ | Prop | Type | Default | Description |
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 |
80
+
81
+ ## Exports
82
+
83
+ - `Badge` — function
84
+ - `BadgeProps` — interface
85
+ - `badgeVariants` — const
86
+
87
+ ### Badge Variants
88
+
89
+ ```typescript
90
+ type BadgeVariant =
91
+ // Solid/subtle variants
92
+ | "default" // Primary color
93
+ | "success" // Green
94
+ | "warning" // Yellow
95
+ | "error" // Red/destructive
96
+ | "neutral" // Gray/secondary
97
+ | "info" // Blue
98
+ | "subtle-success" // Low-emphasis green
99
+ | "subtle-warning" // Low-emphasis yellow
100
+ | "subtle-error" // Low-emphasis red/destructive
101
+ | "subtle-info" // Low-emphasis blue
102
+ // Outline variants with status dots
103
+ | "outline-success"
104
+ | "outline-warning"
105
+ | "outline-error"
106
+ | "outline-info"
107
+ | "outline-neutral";
108
+ ```
109
+
110
+ ### BadgeOptions
111
+
112
+ Shared options used by `DataTable` and `DescriptionCard` badge fields:
113
+
114
+ ```typescript
115
+ interface BadgeOptions {
116
+ /** Maps each value (stringified) to a Badge variant. Unmapped values use `defaultBadgeVariant`. */
117
+ badgeVariantMap?: Record<string, BadgeVariant>;
118
+ /** Maps each value (stringified) to a display label. Unmapped values render the raw value. */
119
+ badgeLabelMap?: Record<string, string>;
120
+ /** Variant used when the value is not in `badgeVariantMap`. Default: `"outline-neutral"`. */
121
+ defaultBadgeVariant?: BadgeVariant;
122
+ }
123
+ ```
124
+
125
+ ## Examples
126
+
127
+ ### Order Status
128
+
129
+ ```tsx
130
+ function OrderStatus({ status }: { status: string }) {
131
+ const variantMap: Record<string, BadgeVariant> = {
132
+ pending: "outline-warning",
133
+ processing: "outline-info",
134
+ shipped: "outline-success",
135
+ delivered: "success",
136
+ cancelled: "outline-error",
137
+ };
138
+
139
+ return <Badge variant={variantMap[status] || "neutral"}>{status.toUpperCase()}</Badge>;
140
+ }
141
+ ```
142
+
143
+ ### Priority Badges
144
+
145
+ ```tsx
146
+ const priorities = [
147
+ { label: "Low", variant: "outline-neutral" },
148
+ { label: "Medium", variant: "outline-info" },
149
+ { label: "High", variant: "outline-warning" },
150
+ { label: "Critical", variant = "error" },
151
+ ];
152
+
153
+ <div className="flex gap-2">
154
+ {priorities.map((p) => (
155
+ <Badge key={p.label} variant={p.variant}>
156
+ {p.label}
157
+ </Badge>
158
+ ))}
159
+ </div>;
160
+ ```
161
+
162
+ ### With Icons
163
+
164
+ ```tsx
165
+ import { CheckCircle, AlertCircle, XCircle } from "lucide-react";
166
+
167
+ <div className="flex gap-2">
168
+ <Badge variant="success">
169
+ <CheckCircle className="w-3 h-3 mr-1" />
170
+ Verified
171
+ </Badge>
172
+ <Badge variant="warning">
173
+ <AlertCircle className="w-3 h-3 mr-1" />
174
+ Review
175
+ </Badge>
176
+ <Badge variant="error">
177
+ <XCircle className="w-3 h-3 mr-1" />
178
+ Blocked
179
+ </Badge>
180
+ </div>;
181
+ ```
182
+
183
+ ### Dynamic Variant Selection
184
+
185
+ ```tsx
186
+ interface Product {
187
+ name: string;
188
+ stock: number;
189
+ }
190
+
191
+ function ProductBadge({ product }: { product: Product }) {
192
+ // Determine variant based on stock level
193
+ let variant: BadgeVariant = "success";
194
+ if (product.stock === 0) {
195
+ variant = "error";
196
+ } else if (product.stock < 10) {
197
+ variant = "warning";
198
+ }
199
+
200
+ return <Badge variant={variant}>{product.stock} in stock</Badge>;
201
+ }
202
+ ```
203
+
204
+ ### Custom Styling
205
+
206
+ ```tsx
207
+ <Badge variant="success" className="uppercase">
208
+ Premium
209
+ </Badge>
210
+ ```
211
+
212
+ ## Visual Reference
213
+
214
+ ### Solid and Subtle Variants
215
+
216
+ | Variant | Preview | Use Case |
217
+ | ---------------- | ---------------------- | ------------------------------------------ |
218
+ | `default` | ![Blue badge] | Primary actions, default status |
219
+ | `success` | ![Green badge] | Completed, approved, active |
220
+ | `warning` | ![Yellow badge] | Pending, in progress, attention needed |
221
+ | `error` | ![Red badge] | Failed, rejected, critical |
222
+ | `neutral` | ![Gray badge] | Draft, inactive, disabled |
223
+ | `info` | ![Blue badge] | Informational, new, in-progress |
224
+ | `subtle-success` | ![Subtle green badge] | Low-emphasis completed or matched statuses |
225
+ | `subtle-warning` | ![Subtle yellow badge] | Low-emphasis pending or attention states |
226
+ | `subtle-error` | ![Subtle red badge] | Low-emphasis failures or exceptions |
227
+ | `subtle-info` | ![Subtle blue badge] | Low-emphasis informational or in-progress |
228
+
229
+ ### Outline Variants
230
+
231
+ | Variant | Preview | Use Case |
232
+ | ----------------- | ----------------------- | -------------------------- |
233
+ | `outline-success` | ![Green dot + outline] | Active, available, healthy |
234
+ | `outline-warning` | ![Orange dot + outline] | In progress, scheduled |
235
+ | `outline-error` | ![Red dot + outline] | Error, unavailable, down |
236
+ | `outline-info` | ![Blue dot + outline] | Information, processing |
237
+ | `outline-neutral` | ![Gray dot + outline] | Neutral state, inactive |
238
+
239
+ ## Accessibility
240
+
241
+ - Use semantic color meanings consistently (green = success, red = error, etc.)
242
+ - Don't rely solely on color to convey information
243
+ - Consider adding icons or text labels for clarity
244
+ - Badges are non-interactive: they render with the default cursor (not a pointer) and won't suggest clickability, even when placed inside a clickable container such as a `DataTable` row with `onClickRow`
245
+
246
+ ## Usage in DescriptionCard
247
+
248
+ Badges can be used with DescriptionCard for automatic status rendering:
249
+
250
+ ```tsx
251
+ import { DescriptionCard } from "@tailor-platform/app-shell";
252
+
253
+ <DescriptionCard
254
+ data={orderData}
255
+ fields={[
256
+ {
257
+ type: "badge",
258
+ key: "status",
259
+ label: "Status",
260
+ meta: {
261
+ sentenceCaseBadges: false,
262
+ badgeVariantMap: {
263
+ pending: "outline-warning",
264
+ shipped: "outline-success",
265
+ delivered: "success",
266
+ },
267
+ },
268
+ },
269
+ ]}
270
+ />;
271
+ ```
272
+
273
+ [Learn more about DescriptionCard →](./description-card.md)
274
+
275
+ ## Best Practices
276
+
277
+ ### Do:
278
+
279
+ - ✅ Use consistent variants for the same meaning across your app
280
+ - ✅ Keep badge text short (1-2 words)
281
+ - ✅ Use outline variants for subtle emphasis
282
+ - ✅ Use solid variants for important status indicators
283
+
284
+ ### Don't:
285
+
286
+ - ❌ Use too many different badge colors (stick to semantic colors)
287
+ - ❌ Put long text in badges (use tooltips instead)
288
+ - ❌ Make badges clickable without visual indication
289
+ - ❌ Use badges for navigation (use links or buttons instead)
290
+
291
+ ## Related Components
292
+
293
+ - [DescriptionCard](./description-card.md) - Use badges in structured displays
294
+ - [Layout](./layout.md) - Organize badges in layouts
295
+
296
+ ## Styling
297
+
298
+ Badges are styled with the library's internal `astw:`-prefixed utilities. Write **plain** Tailwind utilities in your own markup, and reach for `variant` rather than restyling what `Badge` sets itself — see [Styling AppShell components](../concepts/styling-theming.md#styling-appshell-components). Customize appearance by:
299
+
300
+ 1. **Using className prop** for additional styles
301
+ 2. **Overriding CSS variables** in your theme
302
+ 3. **Creating custom variants** using the `badgeVariants` utility
303
+
304
+ ```tsx
305
+ import { badgeVariants } from "@tailor-platform/app-shell";
306
+ import { cn } from "@/lib/utils";
307
+
308
+ <div className={cn(badgeVariants({ variant: "success" }), "mt-2")}>Custom Badge</div>;
309
+ ```
@@ -0,0 +1,164 @@
1
+ ---
2
+ title: Button
3
+ description: Styled button with multiple variants and sizes
4
+ ---
5
+
6
+ <!-- GENERATED by docs-kit from docs-src/components/button.docs.outline.md — do not edit by hand. -->
7
+
8
+ # Button
9
+
10
+ The `Button` component is a styled button with multiple visual variants and sizes. It supports rendering as a custom element via the `render` prop (Base UI render pattern).
11
+
12
+ ## Import
13
+
14
+ ```tsx
15
+ import { Button } from "@tailor-platform/app-shell";
16
+ ```
17
+
18
+ ## Basic Usage
19
+
20
+ <example-preview name="basic-usage"></example-preview>
21
+
22
+ ```tsx
23
+ function BasicUsage() {
24
+ return (
25
+ <div className="flex gap-2">
26
+ <Button>Click me</Button>
27
+ <Button variant="outline">Outline</Button>
28
+ <Button variant="destructive">Delete</Button>
29
+ </div>
30
+ );
31
+ }
32
+ ```
33
+
34
+ ## Props
35
+
36
+ _Generated from the type surface — first-party props only._
37
+
38
+ ### ButtonProps
39
+
40
+ | Prop | Type | Default | Description |
41
+ | ---------- | ------------------------------------------------------------------------------------- | ----------- | ------------------------------------------------- |
42
+ | `render?` | `React.ReactElement` | - | Custom element to render as (Base UI render prop) |
43
+ | `size?` | `"default" \| "sm" \| "lg" \| "xs" \| "icon" \| null` | `"default"` | Button size |
44
+ | `variant?` | `"link" \| "default" \| "destructive" \| "outline" \| "secondary" \| "ghost" \| null` | `"default"` | Visual style variant |
45
+
46
+ ## Exports
47
+
48
+ - `Button` — function
49
+ - `ButtonProps` — type
50
+ - `buttonVariants` — const
51
+
52
+ All standard HTML `<button>` props are also accepted.
53
+
54
+ ## Variants
55
+
56
+ <example-preview name="variants"></example-preview>
57
+
58
+ ```tsx
59
+ function Variants() {
60
+ return (
61
+ <div className="flex flex-wrap gap-2">
62
+ <Button variant="default">Primary Action</Button>
63
+ <Button variant="destructive">Delete</Button>
64
+ <Button variant="outline">Secondary Action</Button>
65
+ <Button variant="secondary">Tertiary</Button>
66
+ <Button variant="ghost">Ghost</Button>
67
+ <Button variant="link">Link Style</Button>
68
+ </div>
69
+ );
70
+ }
71
+ ```
72
+
73
+ ## Sizes
74
+
75
+ <example-preview name="sizes"></example-preview>
76
+
77
+ ```tsx
78
+ function Sizes() {
79
+ return (
80
+ <div className="flex items-center gap-2">
81
+ <Button size="xs">Extra Small</Button>
82
+ <Button size="sm">Small</Button>
83
+ <Button size="default">Default</Button>
84
+ <Button size="lg">Large</Button>
85
+ <Button size="icon">
86
+ <PlusIcon />
87
+ </Button>
88
+ </div>
89
+ );
90
+ }
91
+ ```
92
+
93
+ ## Render Prop
94
+
95
+ The `render` prop lets you use the button's styles on a custom element:
96
+
97
+ ```tsx
98
+ import { Button } from "@tailor-platform/app-shell";
99
+ import { Link } from "@tailor-platform/app-shell";
100
+
101
+ <Button render={<Link to="/orders" />} variant="outline">
102
+ View Orders
103
+ </Button>;
104
+ ```
105
+
106
+ This is the Base UI render pattern — the button's class names and event handlers are applied to the rendered element.
107
+
108
+ ## Examples
109
+
110
+ ### Form Actions
111
+
112
+ ```tsx
113
+ <div className="flex gap-2 justify-end">
114
+ <Button variant="outline">Cancel</Button>
115
+ <Button>Save Changes</Button>
116
+ </div>
117
+ ```
118
+
119
+ ### Destructive Confirmation
120
+
121
+ ```tsx
122
+ <Button variant="destructive" onClick={handleDelete}>
123
+ Delete Order
124
+ </Button>
125
+ ```
126
+
127
+ ### Icon Button
128
+
129
+ ```tsx
130
+ import { PlusIcon } from "lucide-react";
131
+
132
+ <Button size="icon" variant="outline">
133
+ <PlusIcon />
134
+ </Button>;
135
+ ```
136
+
137
+ ## TypeScript
138
+
139
+ ```typescript
140
+ import { type ButtonProps } from "@tailor-platform/app-shell";
141
+ ```
142
+
143
+ ## Styling
144
+
145
+ Use `buttonVariants` to apply button styles to non-button elements:
146
+
147
+ ```tsx
148
+ import { buttonVariants } from "@tailor-platform/app-shell";
149
+
150
+ <a href="/orders" className={buttonVariants({ variant: "outline", size: "sm" })}>
151
+ View Orders
152
+ </a>;
153
+ ```
154
+
155
+ ## Accessibility
156
+
157
+ - Buttons render with `cursor: pointer` to signal interactivity consistently across all variants and sizes.
158
+ - Disabled buttons suppress the pointer cursor via `pointer-events-none`, so they do not signal clickability.
159
+
160
+ ## Related Components
161
+
162
+ - [Dialog](./dialog.md) - Use buttons as dialog triggers and actions
163
+ - [Sheet](./sheet.md) - Use buttons as sheet triggers
164
+ - [Layout](./layout.md) - Use buttons in page header actions
@@ -0,0 +1,181 @@
1
+ ---
2
+ title: Card
3
+ description: General-purpose container with consistent styling using a compound component API
4
+ ---
5
+
6
+ <!-- GENERATED by docs-kit from docs-src/components/card.docs.outline.md — do not edit by hand. -->
7
+
8
+ # Card
9
+
10
+ `Card` is a general-purpose container component with a compound component API (`Card.Root`, `Card.Header`, `Card.Content`). It provides consistent surface styling (background, border, border-radius, shadow) for grouping related content.
11
+
12
+ ## Import
13
+
14
+ ```tsx
15
+ import { Card } from "@tailor-platform/app-shell";
16
+ ```
17
+
18
+ ## Basic Usage
19
+
20
+ <example-preview name="basic-usage"></example-preview>
21
+
22
+ ```tsx
23
+ function BasicUsage() {
24
+ return (
25
+ <Card.Root>
26
+ <Card.Header title="Order Details" description="Summary of order #1234" />
27
+ <Card.Content>
28
+ <p>Content goes here</p>
29
+ </Card.Content>
30
+ </Card.Root>
31
+ );
32
+ }
33
+ ```
34
+
35
+ ## Parts
36
+
37
+ | Part | Description |
38
+ | -------------- | ---------------------------------------------------------------- |
39
+ | `Card.Root` | Outer container. Renders a `<div>` with surface styling applied. |
40
+ | `Card.Header` | Top section with an optional title and description. |
41
+ | `Card.Content` | Body section with consistent padding, or edge-to-edge. |
42
+
43
+ ## Card.Root Props
44
+
45
+ `Card.Root` accepts all standard HTML `<div>` props.
46
+
47
+ | Prop | Type | Default | Description |
48
+ | ----------- | ----------------- | ------- | ---------------------- |
49
+ | `className` | `string` | - | Additional CSS classes |
50
+ | `children` | `React.ReactNode` | - | Card parts and content |
51
+
52
+ ## Card.Header Props
53
+
54
+ | Prop | Type | Default | Description |
55
+ | ------------- | ----------------- | ------- | ----------------------------------------------------------- |
56
+ | `title` | `React.ReactNode` | - | Card title rendered in a `<h3>`. |
57
+ | `description` | `React.ReactNode` | - | Supplementary text rendered below the title. |
58
+ | `children` | `React.ReactNode` | - | Additional header content rendered after title/description. |
59
+ | `className` | `string` | - | Additional CSS classes. |
60
+
61
+ ## Card.Content Props
62
+
63
+ `Card.Content` accepts all standard HTML `<div>` props.
64
+
65
+ | Prop | Type | Default | Description |
66
+ | ----------- | ----------------------- | ----------- | ---------------------------------------------------------------------------------------------- |
67
+ | `padding` | `"default"` \| `"none"` | `"default"` | `"none"` renders the content edge-to-edge — see [Edge-to-edge content](#edge-to-edge-content). |
68
+ | `className` | `string` | - | Additional CSS classes |
69
+ | `children` | `React.ReactNode` | - | Card body content |
70
+
71
+ ## Edge-to-edge content
72
+
73
+ Use `padding="none"` when a `Table`, `DataTable` or divided list should meet the card's border instead of floating inside it:
74
+
75
+ <example-preview name="edge-to-edge-table"></example-preview>
76
+
77
+ ```tsx
78
+ function EdgeToEdgeTable() {
79
+ return (
80
+ <Card.Root>
81
+ <Card.Header title="Line items" />
82
+ <Card.Content padding="none">
83
+ <Table.Root>
84
+ <Table.Header>
85
+ <Table.Row>
86
+ <Table.Head>Item</Table.Head>
87
+ <Table.Head align="right">Qty</Table.Head>
88
+ </Table.Row>
89
+ </Table.Header>
90
+ <Table.Body>
91
+ <Table.Row>
92
+ <Table.Cell>Steel bracket</Table.Cell>
93
+ <Table.Cell align="right">12</Table.Cell>
94
+ </Table.Row>
95
+ <Table.Row>
96
+ <Table.Cell>Hex bolt M8</Table.Cell>
97
+ <Table.Cell align="right">40</Table.Cell>
98
+ </Table.Row>
99
+ </Table.Body>
100
+ </Table.Root>
101
+ </Card.Content>
102
+ </Card.Root>
103
+ );
104
+ }
105
+ ```
106
+
107
+ Don't add padding back on the table. `Table.Head` and `Table.Cell` already inset their first and last cells by 24px, which lines the first column up with the card title.
108
+
109
+ Edge-to-edge content also:
110
+
111
+ - **Keeps row backgrounds inside the card's rounded corners.** A direct `Table` or `DataTable` child clips its row hover and pinned-cell backgrounds to the card's corners.
112
+ - **Removes a nested `DataTable`'s own border**, so it doesn't draw a box inside the card. Its toolbar and footer stay as they are:
113
+
114
+ ```tsx
115
+ <Card.Root>
116
+ <Card.Header title="Line items" />
117
+ <Card.Content padding="none">
118
+ <DataTable.Root value={table}>
119
+ <DataTable.Table />
120
+ <DataTable.Footer>
121
+ <DataTable.Pagination />
122
+ </DataTable.Footer>
123
+ </DataTable.Root>
124
+ </Card.Content>
125
+ </Card.Root>
126
+ ```
127
+
128
+ For a scrollable list, put the overflow on `Card.Content`. Rows supply their own `px-6`, and dividers run to the card edges:
129
+
130
+ ```tsx
131
+ <Card.Content padding="none" className="max-h-60 overflow-y-auto">
132
+ <ul className="divide-y divide-border border-t border-border">
133
+ {items.map((item) => (
134
+ <li key={item.id} className="px-6 py-3">
135
+ {item.name}
136
+ </li>
137
+ ))}
138
+ </ul>
139
+ </Card.Content>
140
+ ```
141
+
142
+ ## Examples
143
+
144
+ ### Header only
145
+
146
+ ```tsx
147
+ <Card.Root>
148
+ <Card.Header title="Summary" description="Key metrics for this period" />
149
+ </Card.Root>
150
+ ```
151
+
152
+ ### Content only
153
+
154
+ ```tsx
155
+ <Card.Root>
156
+ <Card.Content>
157
+ <p>No header needed for this card.</p>
158
+ </Card.Content>
159
+ </Card.Root>
160
+ ```
161
+
162
+ ### Custom header content
163
+
164
+ ```tsx
165
+ <Card.Root>
166
+ <Card.Header title="Recent Orders">
167
+ <Button size="sm" variant="outline">
168
+ View all
169
+ </Button>
170
+ </Card.Header>
171
+ <Card.Content padding="none">
172
+ <Table.Root>{/* ... */}</Table.Root>
173
+ </Card.Content>
174
+ </Card.Root>
175
+ ```
176
+
177
+ ## Related
178
+
179
+ - [MetricCard](./metric-card.md) — Card variant for KPI / dashboard metric display.
180
+ - [DescriptionCard](./description-card.md) — Card variant for structured key-value data.
181
+ - [ActivityCard](./activity-card.md) — Card variant for timeline activity feeds.