@tristan2828/ui-foundation 4.133.0 → 4.134.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.
@@ -41,10 +41,10 @@
41
41
  - [23. A Group menu, and a record read beside the list](#23-a-group-menu-and-a-record-read-beside-the-list) · lines 1935–2011
42
42
  - [24. A stored colour beside its name](#24-a-stored-colour-beside-its-name) · lines 2013–2099
43
43
  - [Picking one on a form: `ColorField`](#picking-one-on-a-form-colorfield) · lines 2038–2099
44
- - [25. A list's tools: views, filters, columns, row actions, a phone's rows](#25-a-lists-tools-views-filters-columns-row-actions-a-phones-rows) · lines 2101–2347
45
- - [The framed look, and sibling lists beside the title](#the-framed-look-and-sibling-lists-beside-the-title) · lines 2276–2347
46
- - [26. A record's related list, capped](#26-a-records-related-list-capped) · lines 2349–2385
47
- - [27. A repeat and its next time](#27-a-repeat-and-its-next-time) · lines 2387–2436
44
+ - [25. A list's tools: views, filters, columns, row actions, a phone's rows](#25-a-lists-tools-views-filters-columns-row-actions-a-phones-rows) · lines 2101–2351
45
+ - [The framed look, and sibling lists beside the title](#the-framed-look-and-sibling-lists-beside-the-title) · lines 2280–2351
46
+ - [26. A record's related list, capped](#26-a-records-related-list-capped) · lines 2353–2389
47
+ - [27. A repeat and its next time](#27-a-repeat-and-its-next-time) · lines 2391–2440
48
48
 
49
49
  <!-- /index -->
50
50
 
@@ -2267,8 +2267,12 @@ const { filters, multiFilters, setFilter, setFilters, setMultiFilter, activeView
2267
2267
  or a modified click works as a link's does. `title` is plain text (the
2268
2268
  row is already the link). Row actions sit at the row's end; headings,
2269
2269
  paging and every state hold. A card layout, when picked, wins.
2270
- - The fixtures' `app/DataTable tools` ListTools, ListToolsFiltered and
2271
- OneRowAction stories hold all of it, under axe and the token check in
2270
+ - **`lead`** (4.134) puts one control at the row's start, outside the
2271
+ link, in a 44px-wide column: the tick that completes a to-do from its
2272
+ row. Its clicks never open the record, so it carries its own label
2273
+ (`Complete <title>`), as the table's tick column does.
2274
+ - The fixtures' `app/DataTable tools` ListTools, ListToolsFiltered,
2275
+ OneRowAction and PhoneRowLead stories hold all of it, under axe and the token check in
2272
2276
  both themes; `e2e/data-table-tools.spec.ts` checks the pills, the stored
2273
2277
  pick and a view's columns winning, the ⋯ menu, the 44px rows, the
2274
2278
  phone's line and sheet.
@@ -84,6 +84,13 @@ export type DataTablePhoneRow<TData> = {
84
84
  status?: (row: TData) => ReactNode;
85
85
  /** The facts that matter (two, usually) on one muted line under it, between dots; empty ones are left out. */
86
86
  facts?: (row: TData) => readonly ReactNode[];
87
+ /**
88
+ * A control at the row's start, outside the link (4.134): the tick that
89
+ * completes a to-do from its row, say. Its clicks are its own, so it
90
+ * never opens the record; it gets a 44px-wide column, centred, and its
91
+ * own label (the row's title is in the link, not around it).
92
+ */
93
+ lead?: (row: TData) => ReactNode;
87
94
  };
88
95
  export declare function PhoneRow<TData>({ row, phoneRow, actions, highlighted, href, onOpen, }: {
89
96
  row: TData;
@@ -43,7 +43,7 @@ export function PhoneRow({ row, phoneRow, actions, highlighted, href, onOpen, })
43
43
  const facts = (phoneRow.facts?.(row) ?? []).filter((fact) => fact !== null && fact !== undefined && fact !== '' && fact !== false);
44
44
  const content = (_jsxs(_Fragment, { children: [_jsxs("span", { className: "flex min-w-0 items-baseline justify-between gap-3", children: [_jsx("span", { className: "min-w-0 type-body font-medium break-words text-foreground", children: phoneRow.title(row) }), phoneRow.status ? _jsx("span", { className: "shrink-0", children: phoneRow.status(row) }) : null] }), facts.length > 0 ? (_jsx("span", { className: "flex flex-wrap gap-x-1.5 type-caption text-muted-foreground", children: facts.map((fact, index) => (_jsxs("span", { className: "inline-flex gap-x-1.5", children: [index > 0 ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: "\u00B7" }), _jsx("span", { className: "sr-only", children: ", " })] })) : null, fact] }, index))) })) : null] }));
45
45
  return (_jsxs("li", { "data-slot": "data-table-phone-row", "data-highlighted": highlighted || undefined, className: cn('flex items-center gap-1 border-b border-border last:border-b-0', highlighted &&
46
- '[--muted-foreground:var(--table-highlight-muted-foreground)] bg-(--table-highlight) shadow-[inset_3px_0_0_0_var(--info-text)]'), children: [href !== undefined ? (_jsx("a", { href: href, className: cn(PHONE_TARGET_CLASS, PHONE_OPENS_CLASS), onClick: (event) => {
46
+ '[--muted-foreground:var(--table-highlight-muted-foreground)] bg-(--table-highlight) shadow-[inset_3px_0_0_0_var(--info-text)]'), children: [phoneRow.lead ? (_jsx("span", { "data-slot": "data-table-phone-row-lead", className: "flex w-11 shrink-0 items-center justify-center self-stretch", children: phoneRow.lead(row) })) : null, href !== undefined ? (_jsx("a", { href: href, className: cn(PHONE_TARGET_CLASS, PHONE_OPENS_CLASS), onClick: (event) => {
47
47
  if (!onOpen || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)
48
48
  return;
49
49
  event.preventDefault();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tristan2828/ui-foundation",
3
- "version": "4.133.0",
3
+ "version": "4.134.0",
4
4
  "description": "Shared UI foundation for contract-first, database-backed React apps: shadcn primitives, DataTable/EntityForm composites, auth, the gateway error seam, design tokens, lint rules and the AI playbook.",
5
5
  "license": "MIT",
6
6
  "repository": {