@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,184 @@
1
+ ---
2
+ title: Grid
3
+ description: Generic CSS-Grid layout primitive for equal or custom-width columns with responsive reflow, auto-fit, and spanning
4
+ ---
5
+
6
+ <!-- GENERATED by docs-kit from docs-src/components/grid.docs.outline.md — do not edit by hand. -->
7
+
8
+ # Grid
9
+
10
+ `Grid` is a generic, presentational layout primitive built on CSS Grid. It arranges arbitrary children into equal or custom-width columns, with gap control, responsive reflow, auto-fit sizing, and optional cell spanning via `Grid.Item`. It makes no assumptions about your data — children simply flow into the tracks you define.
11
+
12
+ > **Grid vs. Layout:** Use [`Layout`](./layout.md) for top-level **page scaffolding** (header + fixed-width sidebars + main content). Use `Grid` for **content grids** within a page — KPI cards, galleries, field groups, dashboards. They are complementary; reach for `Grid` whenever you just need "arrange these N things into columns."
13
+
14
+ ## Import
15
+
16
+ ```tsx
17
+ import { Grid } from "@tailor-platform/app-shell";
18
+ ```
19
+
20
+ ## Basic Usage
21
+
22
+ <example-preview name="basic-usage"></example-preview>
23
+
24
+ ```tsx
25
+ function BasicUsage() {
26
+ return (
27
+ <Grid columns={3} gap={4}>
28
+ <Card.Root>One</Card.Root>
29
+ <Card.Root>Two</Card.Root>
30
+ <Card.Root>Three</Card.Root>
31
+ </Grid>
32
+ );
33
+ }
34
+ ```
35
+
36
+ Plain children occupy a single cell. Wrap a child in `Grid.Item` only when it needs to span multiple tracks or be placed explicitly.
37
+
38
+ ## Sub-components
39
+
40
+ | Sub-component | Description |
41
+ | ------------- | ---------------------------------------------------------------------- |
42
+ | `Grid` | The grid container — defines columns, rows, gap, and alignment |
43
+ | `Grid.Item` | An optional cell that spans multiple columns/rows or is placed by line |
44
+
45
+ ## Props
46
+
47
+ ### Grid Props
48
+
49
+ | Prop | Type | Default | Description |
50
+ | --------------- | ------------------------------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------------------- |
51
+ | `columns` | `number \| string \| Responsive<number \| string>` | - | A number creates that many equal columns; a string is a verbatim `grid-template-columns` value |
52
+ | `rows` | `number \| string \| Responsive<number \| string>` | - | Same shape as `columns`, for `grid-template-rows` |
53
+ | `gap` | `number \| Responsive<number>` | `3` (12px) | Gap between rows and columns, in spacing-scale units (`4` → `1rem`) |
54
+ | `gapX` | `number \| Responsive<number>` | - | Horizontal (column) gap override |
55
+ | `gapY` | `number \| Responsive<number>` | - | Vertical (row) gap override |
56
+ | `minChildWidth` | `number \| string` | - | Auto-fit: each item is at least this wide and as many as fit are placed per row. **Overrides `columns`** |
57
+ | `flow` | `"row" \| "column" \| "dense" \| "row-dense" \| "column-dense"` | `"row"` | `grid-auto-flow` — placement direction and dense packing |
58
+ | `align` | `"start" \| "center" \| "end" \| "stretch" \| "baseline"` | - | `align-items` — block-axis alignment of items within their tracks |
59
+ | `justify` | `"start" \| "center" \| "end" \| "between" \| "around" \| "evenly"` | - | `justify-content` — inline-axis distribution of tracks within the grid |
60
+ | `className` | `string` | - | Additional CSS classes |
61
+ | `children` | `React.ReactNode` | - | Grid items (any elements, or `Grid.Item`) |
62
+
63
+ All standard HTML `<div>` props are also accepted.
64
+
65
+ ### Grid.Item Props
66
+
67
+ | Prop | Type | Default | Description |
68
+ | ----------- | -------------------------------------------------- | ------- | ----------------------------------------------------- |
69
+ | `colSpan` | `number \| "full" \| Responsive<number \| "full">` | - | Columns to span, or `"full"` for all columns |
70
+ | `rowSpan` | `number \| "full" \| Responsive<number \| "full">` | - | Rows to span, or `"full"` for all rows |
71
+ | `colStart` | `number \| Responsive<number>` | - | 1-based column line to start at (`grid-column-start`) |
72
+ | `colEnd` | `number \| Responsive<number>` | - | 1-based column line to end at (`grid-column-end`) |
73
+ | `className` | `string` | - | Additional CSS classes |
74
+ | `children` | `React.ReactNode` | - | Cell content |
75
+
76
+ All standard HTML `<div>` props are also accepted.
77
+
78
+ ## Responsive values
79
+
80
+ `columns`, `rows`, `gap`, `gapX`, `gapY`, and every `Grid.Item` prop accept either a single value (applied at all breakpoints) or a breakpoint object. Breakpoints align with Tailwind: `initial` (base), `sm`, `md`, `lg`, `xl`, `2xl`.
81
+
82
+ ```tsx
83
+ // 1 column on mobile, 2 from md, 4 from xl
84
+ <Grid columns={{ initial: 1, md: 2, xl: 4 }} gap={4}>
85
+ {/* … */}
86
+ </Grid>
87
+ ```
88
+
89
+ ## Sizing columns
90
+
91
+ There are three ways to size columns; pick whichever fits.
92
+
93
+ ```tsx
94
+ // 1. Equal columns
95
+ <Grid columns={4} gap={4}>{/* … */}</Grid>
96
+
97
+ // 2. Custom track widths (verbatim grid-template-columns)
98
+ <Grid columns="280px 1fr" gap={6}>{/* … */}</Grid>
99
+
100
+ // 3. Auto-fit — as many ≥240px columns as fit, no breakpoints needed
101
+ <Grid minChildWidth={240} gap={4}>{/* … */}</Grid>
102
+ ```
103
+
104
+ `minChildWidth` accepts a number (pixels) or a string (e.g. `"16rem"`) and takes precedence over `columns` when set.
105
+
106
+ ## Spanning with Grid.Item
107
+
108
+ ```tsx
109
+ <Grid columns={4} gap={4}>
110
+ <Grid.Item colSpan={2}>Wide card</Grid.Item>
111
+ <Card.Root>Normal</Card.Root>
112
+ <Grid.Item colSpan={{ initial: "full", md: 1 }} rowSpan={2}>
113
+ Tall
114
+ </Grid.Item>
115
+ <Grid.Item colSpan="full">Full-width footer row</Grid.Item>
116
+ </Grid>
117
+ ```
118
+
119
+ ## Alignment
120
+
121
+ `align` aligns items within their row (visible when row height exceeds the item), `justify` distributes the columns when they are narrower than the container (e.g. fixed-width tracks), and `flow` controls placement order:
122
+
123
+ ```tsx
124
+ <Grid columns="repeat(3, 96px)" gap={4} justify="between" align="center">
125
+ {/* fixed-width columns spread across the container */}
126
+ </Grid>
127
+ ```
128
+
129
+ > **Note:** `justify` only has a visible effect when the tracks do not fill the container. With fluid `columns={n}` (which uses `1fr` tracks) the columns always fill the width, so `justify` is a no-op — use fixed-width tracks to distribute columns. Likewise, `flow="…-dense"` only differs from the default when items span multiple cells and leave gaps to backfill.
130
+
131
+ ## Examples
132
+
133
+ ### Responsive KPI grid
134
+
135
+ ```tsx
136
+ <Grid columns={{ initial: 1, sm: 2, lg: 4 }} gap={4}>
137
+ {metrics.map((m) => (
138
+ <MetricCard key={m.id} title={m.label} value={m.value} />
139
+ ))}
140
+ </Grid>
141
+ ```
142
+
143
+ ### Auto-fitting card gallery
144
+
145
+ ```tsx
146
+ <Grid minChildWidth={240} gap={6}>
147
+ {products.map((p) => (
148
+ <Card.Root key={p.sku}>
149
+ <Card.Header title={p.name} description={p.sku} />
150
+ </Card.Root>
151
+ ))}
152
+ </Grid>
153
+ ```
154
+
155
+ ### Sidebar + content (custom widths)
156
+
157
+ ```tsx
158
+ <Grid columns="280px 1fr" gap={6}>
159
+ <Card.Root>{/* filters */}</Card.Root>
160
+ <Card.Root>{/* results */}</Card.Root>
161
+ </Grid>
162
+ ```
163
+
164
+ ### Dashboard with a featured panel
165
+
166
+ ```tsx
167
+ <Grid columns={{ initial: 1, md: 4 }} gap={4}>
168
+ <Grid.Item colSpan={{ initial: "full", md: 2 }}>
169
+ <Card.Root>Featured</Card.Root>
170
+ </Grid.Item>
171
+ <Card.Root>Stat</Card.Root>
172
+ <Card.Root>Stat</Card.Root>
173
+ </Grid>
174
+ ```
175
+
176
+ ## Styling
177
+
178
+ `Grid` is a presentational primitive: it renders a single `<div data-slot="grid">` (and `<div data-slot="grid-item">` for cells) styled with the library's internal `astw:`-prefixed utilities. Dynamic templates are applied via CSS custom properties, so arbitrary column counts and responsive values work without extra configuration. Pass `className` (**plain** utilities — see [Styling AppShell components](../concepts/styling-theming.md#styling-appshell-components)) or `style` to extend. Use `columns` and `gap` for the grid itself.
179
+
180
+ ## Related Components
181
+
182
+ - [Layout](./layout.md) - Page-level scaffold (header + sidebars + main)
183
+ - [Card](./card.md) - Common child of a grid cell
184
+ - [MetricCard](./metric-card.md) - KPI cards for dashboard grids
@@ -0,0 +1,83 @@
1
+ ---
2
+ title: Input
3
+ description: Styled text input with consistent theming
4
+ ---
5
+
6
+ <!-- GENERATED by docs-kit from docs-src/components/input.docs.outline.md — do not edit by hand. -->
7
+
8
+ # Input
9
+
10
+ The `Input` component is a styled text input that provides consistent theming across your application.
11
+
12
+ ## Import
13
+
14
+ ```tsx
15
+ import { Input } 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 <Input placeholder="Enter your name" />;
25
+ }
26
+ ```
27
+
28
+ ## Props
29
+
30
+ Accepts all standard HTML `<input>` props.
31
+
32
+ | Prop | Type | Default | Description |
33
+ | ------------- | --------- | -------- | ---------------------- |
34
+ | `type` | `string` | `"text"` | HTML input type |
35
+ | `placeholder` | `string` | - | Placeholder text |
36
+ | `disabled` | `boolean` | `false` | Disables the input |
37
+ | `className` | `string` | - | Additional CSS classes |
38
+
39
+ ## Examples
40
+
41
+ ### Text Input
42
+
43
+ ```tsx
44
+ <Input type="text" placeholder="Enter your name" />
45
+ ```
46
+
47
+ ### Email Input
48
+
49
+ ```tsx
50
+ <Input type="email" placeholder="you@example.com" />
51
+ ```
52
+
53
+ ### Number Input
54
+
55
+ ```tsx
56
+ <Input type="number" placeholder="0" min={0} max={100} />
57
+ ```
58
+
59
+ ### Disabled Input
60
+
61
+ ```tsx
62
+ <Input value="Read-only value" disabled />
63
+ ```
64
+
65
+ ### With onChange Handler
66
+
67
+ ```tsx
68
+ const [value, setValue] = useState("");
69
+
70
+ <Input value={value} onChange={(e) => setValue(e.target.value)} placeholder="Type something..." />;
71
+ ```
72
+
73
+ ## TypeScript
74
+
75
+ ```typescript
76
+ import { type InputProps } from "@tailor-platform/app-shell";
77
+ ```
78
+
79
+ ## Related Components
80
+
81
+ - [Button](./button.md) - Pair with inputs in forms
82
+ - [Textarea](./textarea.md) - Multi-line counterpart, for free-text that outgrows one line
83
+ - [Checkbox](./checkbox.md) - Boolean control with the same `Field` / React Hook Form integration