Skip to content

Commit 9261d02

Browse files
Version Packages (#245)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 42f026d commit 9261d02

8 files changed

Lines changed: 97 additions & 109 deletions

.changeset/data-table-column-align.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

.changeset/data-table-column-truncate.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

.changeset/narrow-data-table-accessor.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

.changeset/red-badges-rest.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

.changeset/shiny-walls-glow.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

.changeset/typed-data-table-cells.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

packages/core/CHANGELOG.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,101 @@
11
# @tailor-platform/app-shell
22

3+
## 1.2.0
4+
5+
### Minor Changes
6+
7+
- 8a09b26: Add `align: "left" | "right"` to `DataTable` `Column`. When set to `"right"`, the header label, body cell, and loading-skeleton bar are right-aligned together — eliminating the inline `<span className="text-right">` wrappers callers were adding inside `render` for numeric columns (Amount, Score, Total).
8+
9+
`align` is **auto-defaulted to `"right"` for `type: "number"` and `type: "money"`** so the common case Just Works without extra config. Other types default to `"left"`. Pass `"left"` explicitly to opt a numeric column out.
10+
11+
```tsx
12+
// Auto-aligned right — no `align` needed
13+
column({
14+
label: "Total",
15+
type: "money",
16+
accessor: (row) => row.total,
17+
typeOptions: { currency: "USD" },
18+
});
19+
20+
// Explicit alignment for a custom-render column
21+
column({
22+
label: "Amount",
23+
align: "right",
24+
render: (row) => formatMoney(row.amount),
25+
});
26+
```
27+
28+
- b644bdb: Add `truncate: boolean` to `DataTable` `Column`. When set, the cell content is truncated with an ellipsis on overflow, and an app-shell `<Tooltip>` is auto-wired to reveal the full value on hover when the cell value is a stringifiable primitive. The tooltip resolves through the same precedence rule the built-in `type` renderers use — `accessor` first, then `row[col.id]` — so `inferColumns` consumers get the tooltip for free without an explicit accessor. Pair `truncate` with `width` on neighboring columns to anchor row width, since truncate cells use `max-w-0` to stay shrinkable.
29+
30+
```tsx
31+
column({
32+
label: "Description",
33+
render: (row) => row.description,
34+
accessor: (row) => row.description,
35+
truncate: true,
36+
});
37+
38+
// Or with `inferColumns`, no explicit `accessor` needed — the inferred
39+
// column pins `id` to the field name so the tooltip resolves automatically:
40+
column({ ...infer("description"), truncate: true });
41+
```
42+
43+
`inferColumns` now also pins `id` to the metadata field name (previously omitted). This makes the cell renderer's `row[col.id]` fallback resolve cleanly and stabilizes the React key / column-visibility identifier across re-renders.
44+
45+
- 4c89923: Add `defaultOpen` and `collapsible` props to `SidebarLayout` for controlling sidebar behavior.
46+
47+
```tsx
48+
// Sidebar closed by default on desktop
49+
<SidebarLayout defaultOpen={false} />
50+
51+
// Non-collapsible sidebar (always visible, toggle buttons hidden)
52+
<SidebarLayout collapsible={false} />
53+
```
54+
55+
- c4fbfa2: Add `type` and `typeOptions` to `DataTable` `Column` for built-in cell rendering. Set `type` to `text`, `number`, `money`, `date`, `badge`, or `link` to skip writing a `render` function for the common cases. `render` stays required for untyped columns and becomes an optional override when `type` is set.
56+
57+
`Column<TRow>` is a discriminated union on `type`, so wrong-shape options are a compile error rather than silently ignored at runtime — and `type: "link"` requires `typeOptions.href`.
58+
59+
```tsx
60+
column({
61+
label: "Total",
62+
accessor: (row) => row.total,
63+
type: "money",
64+
typeOptions: { currency: "USD" },
65+
});
66+
67+
column({
68+
label: "Status",
69+
accessor: (row) => row.status,
70+
type: "badge",
71+
typeOptions: {
72+
badgeVariantMap: { active: "success", draft: "neutral" },
73+
badgeLabelMap: { active: "Active", draft: "Draft" },
74+
},
75+
});
76+
```
77+
78+
### Patch Changes
79+
80+
- c4fbfa2: Narrow `Column.accessor`'s return type per built-in `type` so the typed cell renderers reject values they can't display. Returning an array or a plain object from a `text` / `number` / `money` / `date` / `badge` / `link` accessor is now a compile error instead of silently rendering `[object Object]` or a stringified list. `null` and `undefined` are still allowed and continue to render the `` placeholder. Columns without a `type` retain the loose `unknown` return type — they pair with `render` to draw whatever shape they like.
81+
82+
```tsx
83+
column({
84+
label: "Tags",
85+
type: "text",
86+
// ^ compile error: text accessor cannot return an array.
87+
accessor: (row) => row.tags,
88+
});
89+
```
90+
91+
- eecff8e: Add `subtle-success`, `subtle-warning`, and `subtle-error` badge variants for low-emphasis status labels.
92+
93+
```tsx
94+
<Badge variant="subtle-success">Matched</Badge>
95+
<Badge variant="subtle-warning">Needs Attention</Badge>
96+
<Badge variant="subtle-error">Needs Review</Badge>
97+
```
98+
399
## 1.1.1
4100

5101
### Patch Changes

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailor-platform/app-shell",
3-
"version": "1.1.1",
3+
"version": "1.2.0",
44
"description": "An opinionated React application framework for building ERP applications on Tailor Platform",
55
"keywords": [
66
"app-shell",

0 commit comments

Comments
 (0)