@tailor-platform/app-shell 1.9.0 → 1.10.1
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 +272 -18
- package/dist/app-shell.js +5474 -4296
- package/dist/themes/bloom.css +2 -1
- package/dist/themes/cream.css +2 -1
- package/package.json +2 -2
- package/skills/app-shell-patterns/references/fundamental/components.md +15 -2
- package/skills/app-shell-patterns/references/patterns/list-dense-scan.md +2 -1
package/dist/themes/bloom.css
CHANGED
|
@@ -146,7 +146,8 @@ html
|
|
|
146
146
|
background-color: transparent;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
html [data-slot="button"][class*="astw:bg-background"][class*="astw:border"]
|
|
149
|
+
html [data-slot="button"][class*="astw:bg-background"][class*="astw:border"],
|
|
150
|
+
html [data-slot="data-table-filter-chip"] {
|
|
150
151
|
background-color: transparent;
|
|
151
152
|
transition:
|
|
152
153
|
background-color 0.12s ease,
|
package/dist/themes/cream.css
CHANGED
|
@@ -146,7 +146,8 @@ html
|
|
|
146
146
|
background-color: transparent;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
html [data-slot="button"][class*="astw:bg-background"][class*="astw:border"]
|
|
149
|
+
html [data-slot="button"][class*="astw:bg-background"][class*="astw:border"],
|
|
150
|
+
html [data-slot="data-table-filter-chip"] {
|
|
150
151
|
background-color: transparent;
|
|
151
152
|
transition:
|
|
152
153
|
background-color 0.12s ease,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailor-platform/app-shell",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "An opinionated React application framework for building ERP applications on Tailor Platform",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app-shell",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"lucide-react": "^1.8.0",
|
|
55
55
|
"openai": "6.45.0",
|
|
56
56
|
"papaparse": "^5.5.3",
|
|
57
|
-
"react-router": "^7.
|
|
57
|
+
"react-router": "^7.18.2",
|
|
58
58
|
"sonner": "^2.0.7",
|
|
59
59
|
"tailwind-merge": "^3.6.0",
|
|
60
60
|
"@tailor-platform/app-shell-vite-plugin": "0.2.3"
|
|
@@ -387,7 +387,7 @@ Plus `badgeVariants` CVA for custom-styled siblings.
|
|
|
387
387
|
|
|
388
388
|
**Import:** compound namespace + helpers from `'@tailor-platform/app-shell'`, e.g. `DataTable`, `useDataTable`, `useCollectionVariables`, `createColumnHelper`, and types such as `Column`, `UseDataTableReturn`.
|
|
389
389
|
|
|
390
|
-
**Purpose:** Production list screens over GraphQL **connections**. Owns toolbar filter chips (**`DataTable.Filters`** from column `filter` configs), header sort, **`DataTable.Pagination`** (cursor-first; First/Last when `total` is provided), loading skeleton/error row, **`onClickRow`**, **`rowActions`** (kebab column), **`onSelectionChange`** (checkbox column).
|
|
390
|
+
**Purpose:** Production list screens over GraphQL **connections**. Owns toolbar filter chips (**`DataTable.Filters`** from column `filter` configs), header sort, **`DataTable.Pagination`** (cursor-first; First/Last when `total` is provided), loading skeleton/error row, **`onClickRow`**, **`rowActions`** (kebab column), **`onSelectionChange`** (checkbox column), **column pinning** (`pin: "left" | "right"`) and built-in **column settings** (`<DataTable.Toolbar columnSettings>` — user show/hide + reorder + pin, persisted per-user via **`tableId`**).
|
|
391
391
|
|
|
392
392
|
**Primitives:** Builds on low-level **`Table`**; do not reinvent pagination/filters manually unless the dataset is trivial.
|
|
393
393
|
|
|
@@ -404,12 +404,13 @@ const table = useDataTable({
|
|
|
404
404
|
data: fetching ? undefined : mappedFromQuery,
|
|
405
405
|
loading: fetching,
|
|
406
406
|
control,
|
|
407
|
+
tableId: "purchase-orders", // persist user column layout to localStorage
|
|
407
408
|
onClickRow: (row) => navigate(detailHref(row)),
|
|
408
409
|
// onSelectionChange, rowActions, sort: …
|
|
409
410
|
});
|
|
410
411
|
|
|
411
412
|
<DataTable.Root value={table}>
|
|
412
|
-
<DataTable.Toolbar>
|
|
413
|
+
<DataTable.Toolbar columnSettings>
|
|
413
414
|
<DataTable.Filters />
|
|
414
415
|
</DataTable.Toolbar>
|
|
415
416
|
<DataTable.Table />
|
|
@@ -419,6 +420,10 @@ const table = useDataTable({
|
|
|
419
420
|
</DataTable.Root>;
|
|
420
421
|
```
|
|
421
422
|
|
|
423
|
+
**Row navigation:** whole row is clickable via **`onClickRow`** → `navigate(detailHref(row))`; wrap the primary identifier cell in `<Link>` for keyboard/SR access. Never add a per-row "View" / "Open" / "→" button. (A first-class row-interaction API is under design — see the row-interaction tracking issue.)
|
|
424
|
+
|
|
425
|
+
**Column pinning & settings:** set `pin: "left" | "right"` on a `Column` to freeze it during horizontal scroll — selection auto-pins left, row-actions auto-pins right (a `width` is optional but recommended for stable sizing). Pass **`columnSettings`** to **`DataTable.Toolbar`** to render the built-in "Columns" control (show/hide, reorder, re-pin) at the top-right; pass a stable, **unique** **`tableId`** to persist each user's layout to `localStorage` (a per-user preference — intentionally not in the URL like filters/sort).
|
|
426
|
+
|
|
422
427
|
**Column alignment:** each `Column` accepts **`align`** (`"left" | "right"`) applied to both header and body cell. Numeric `type` columns (`"number"`, `"money"`) default to `"right"` automatically so digits align on the decimal place — pass `align="left"` to opt out; everything else defaults to `"left"`.
|
|
423
428
|
|
|
424
429
|
**Metadata path:** Prefer `createColumnHelper` + `inferColumns(tableMetadata.order)` (`@tailor-platform/app-shell-sdk-plugin` codegen) when available so enum/datetime/string filters bind to the right editors.
|
|
@@ -638,6 +643,14 @@ const table = useDataTable({
|
|
|
638
643
|
**API:** `InputProps` — extends native `<input>` props.
|
|
639
644
|
**Used in patterns:** all `form/*`.
|
|
640
645
|
|
|
646
|
+
### `Checkbox`
|
|
647
|
+
|
|
648
|
+
**Import:** `import { Checkbox } from '@tailor-platform/app-shell'`
|
|
649
|
+
**Purpose:** Boolean form control. Maps to spec field type: `boolean`. Also used for row selection and filter toggles.
|
|
650
|
+
**API:** `CheckboxProps` — extends Base UI `Checkbox.Root` (`checked`/`defaultChecked`, `onCheckedChange`, `indeterminate`, `disabled`, `required`, `name`, `inputRef`) and adds an inline `label`. Integrates with `Field` for invalid/disabled/label state exactly like `Input`/`Select` — no bespoke `error` prop.
|
|
651
|
+
**Accessible name:** the inline `label` prop (enclosing) or a sibling `Field.Label`; for a bare box (e.g. a table row-select cell) pass `aria-label`.
|
|
652
|
+
**Used in patterns:** `form/*` (boolean fields), `list/*` (row selection), DataTable filter/column controls.
|
|
653
|
+
|
|
641
654
|
### `Select`
|
|
642
655
|
|
|
643
656
|
**Import:** `import { Select } from '@tailor-platform/app-shell'`
|
|
@@ -153,8 +153,9 @@ Omit `fill` on pages that should flow and scroll naturally (forms, dashboards, a
|
|
|
153
153
|
- Handle every state: `DataTable` renders the loading skeleton and error row; always provide a **labelled empty state** (what the list is + how to add the first record) rather than a bare empty table
|
|
154
154
|
- Status Badge colors must use design system tokens (variant prop): the **primary** status column uses **filled** semantic variants; **secondary** status columns (delivery, billing) use **`outline-*`** (see `design-system.md` → Composition & emphasis rules)
|
|
155
155
|
- Bulk actions toolbar appears only when ≥1 row is selected
|
|
156
|
-
- Whole row is clickable via `onClickRow`;
|
|
156
|
+
- Whole row is clickable via `onClickRow`; wrap the primary identifier cell in `<Link>` for keyboard/SR access. No per-row "View" / "Open" buttons
|
|
157
157
|
- Per-row `Menu` (overflow `…`) is reserved for non-navigation actions (Archive, Duplicate, Delete)
|
|
158
|
+
- Wide lists (many columns / horizontal scroll): pin the column users scan by to the **left** — the record's identifier (invoice / order **reference**) or its **name** (customer, product) — so it stays anchored while the rest scrolls; optionally pin a single high-signal **status** or **total** to the **right**. Keep the pinned set small (≈1 left, at most 1 right) — over-pinning eats the scroll area. Let users override via `<DataTable.Toolbar columnSettings>` (show/hide + reorder + re-pin) with a stable `tableId` so each user's layout persists
|
|
158
159
|
|
|
159
160
|
## Anti-patterns
|
|
160
161
|
|