@cosmicdrift/kumiko-renderer 0.416.0 → 0.417.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 (167) hide show
  1. package/dist/app/action-form-body.d.ts +1 -4
  2. package/dist/app/action-form-body.js +9 -8
  3. package/dist/app/config-edit-body.js +71 -79
  4. package/dist/app/entity-list-screen.js +1 -1
  5. package/dist/app/header-actions-bar.d.ts +3 -1
  6. package/dist/app/header-actions-bar.js +12 -4
  7. package/dist/app/locked-screen-header.d.ts +2 -0
  8. package/dist/app/locked-screen-header.js +8 -1
  9. package/dist/app/projection-detail-body.js +24 -5
  10. package/dist/app/projection-detail-guidance.d.ts +1 -0
  11. package/dist/app/projection-detail-guidance.js +7 -4
  12. package/dist/app/projection-detail-header-model.js +4 -1
  13. package/dist/app/projection-detail-header-region.js +25 -9
  14. package/dist/app/projection-detail-header.d.ts +2 -0
  15. package/dist/app/projection-detail-header.js +30 -3
  16. package/dist/app/projection-list-shim.js +1 -0
  17. package/dist/app/row-actions.d.ts +4 -0
  18. package/dist/app/row-actions.js +19 -3
  19. package/dist/app/use-projection-detail-actions.d.ts +3 -1
  20. package/dist/app/use-projection-detail-actions.js +9 -1
  21. package/dist/app/use-projection-detail-data.js +17 -1
  22. package/dist/app/use-projection-list-data.js +1 -1
  23. package/dist/card-options.d.ts +2 -0
  24. package/dist/components/choice-chip-class.d.ts +1 -0
  25. package/dist/components/choice-chip-class.js +9 -0
  26. package/dist/components/edit-mounts.d.ts +1 -1
  27. package/dist/components/grid-cell-for-field.js +1 -1
  28. package/dist/components/multi-select-chips.js +2 -1
  29. package/dist/components/narrow-description.d.ts +3 -0
  30. package/dist/components/narrow-description.js +12 -0
  31. package/dist/components/related-list-section.d.ts +5 -3
  32. package/dist/components/related-list-section.js +9 -4
  33. package/dist/components/related-photo-grid.js +17 -3
  34. package/dist/components/render-edit-field-grid.d.ts +12 -3
  35. package/dist/components/render-edit-field-grid.js +60 -18
  36. package/dist/components/render-edit-fields-section.js +45 -11
  37. package/dist/components/render-edit-header-actions.js +1 -1
  38. package/dist/components/render-edit-layout.js +4 -2
  39. package/dist/components/render-edit-section-kinds.js +50 -12
  40. package/dist/components/render-edit-titles.js +1 -1
  41. package/dist/components/render-edit-types.d.ts +11 -0
  42. package/dist/components/render-field-ai-assist.js +3 -2
  43. package/dist/components/render-field-control.js +1 -1
  44. package/dist/components/render-field-value-chips.js +4 -2
  45. package/dist/components/render-list-hint-columns.d.ts +1 -0
  46. package/dist/components/render-list-hint-columns.js +30 -5
  47. package/dist/components/render-list-reference-columns.js +2 -4
  48. package/dist/components/render-list-row-tone.d.ts +2 -0
  49. package/dist/components/render-list-row-tone.js +6 -0
  50. package/dist/components/render-list-table-props.d.ts +13 -2
  51. package/dist/components/render-list-table-props.js +9 -3
  52. package/dist/components/render-list-types.d.ts +4 -0
  53. package/dist/components/render-list.js +12 -4
  54. package/dist/components/use-render-list-columns.js +3 -3
  55. package/dist/components/write-form-registry.d.ts +13 -0
  56. package/dist/components/write-form-registry.js +6 -0
  57. package/dist/components/write-form-section.d.ts +5 -1
  58. package/dist/components/write-form-section.js +55 -16
  59. package/dist/headless/form/form-controller.d.ts +1 -0
  60. package/dist/headless/form/form-controller.js +1 -1
  61. package/dist/headless/format/index.js +5 -4
  62. package/dist/headless/format/relative-time.d.ts +2 -0
  63. package/dist/headless/format/relative-time.js +4 -1
  64. package/dist/headless/view-model/edit.js +87 -37
  65. package/dist/headless/view-model/list.js +6 -0
  66. package/dist/headless/view-model/types.d.ts +49 -4
  67. package/dist/hooks/use-list-table.js +11 -6
  68. package/dist/i18n-defaults.js +7 -2
  69. package/dist/primitives-record-guidance.d.ts +4 -0
  70. package/dist/primitives-share-types.d.ts +82 -0
  71. package/dist/primitives-share-types.js +1 -0
  72. package/dist/primitives.d.ts +34 -83
  73. package/dist/web/app/bold-markup.d.ts +3 -0
  74. package/dist/web/app/bold-markup.js +14 -0
  75. package/dist/web/app/dashboard-body.js +5 -1
  76. package/dist/web/app/dashboard-list-panel.js +7 -4
  77. package/dist/web/app/dashboard-panels.js +31 -3
  78. package/dist/web/app/dashboard-shared.d.ts +3 -1
  79. package/dist/web/app/dashboard-shared.js +3 -3
  80. package/dist/web/app/dashboard-stat-group-panel.d.ts +1 -1
  81. package/dist/web/app/dashboard-stat-group-panel.js +16 -2
  82. package/dist/web/app/dashboard-text-panel.js +11 -6
  83. package/dist/web/app/relative-time.js +10 -1
  84. package/dist/web/components/config-cascade.d.ts +2 -1
  85. package/dist/web/components/config-cascade.js +16 -4
  86. package/dist/web/drawn-icons.js +2 -1
  87. package/dist/web/layout/header-action-pinned.d.ts +4 -2
  88. package/dist/web/layout/header-action-pinned.js +13 -4
  89. package/dist/web/layout/header-overflow-menu.d.ts +2 -0
  90. package/dist/web/layout/header-overflow-menu.js +2 -0
  91. package/dist/web/layout/notification-bell.js +12 -3
  92. package/dist/web/layout/page-header-slot.d.ts +2 -0
  93. package/dist/web/layout/page-header-slot.js +4 -0
  94. package/dist/web/layout/screen-focus.js +4 -1
  95. package/dist/web/layout/shell-header.js +13 -5
  96. package/dist/web/primitives/banner.js +14 -3
  97. package/dist/web/primitives/card.js +5 -3
  98. package/dist/web/primitives/combobox.js +2 -2
  99. package/dist/web/primitives/data-table/actions-column.js +1 -1
  100. package/dist/web/primitives/data-table/card-body.d.ts +1 -1
  101. package/dist/web/primitives/data-table/card-body.js +37 -14
  102. package/dist/web/primitives/data-table/card-frame.d.ts +2 -0
  103. package/dist/web/primitives/data-table/card-frame.js +3 -0
  104. package/dist/web/primitives/data-table/card-row.js +28 -9
  105. package/dist/web/primitives/data-table/card-sort-select.js +1 -1
  106. package/dist/web/primitives/data-table/card-view.js +1 -1
  107. package/dist/web/primitives/data-table/data-cell-props.d.ts +2 -1
  108. package/dist/web/primitives/data-table/data-cell-props.js +1 -0
  109. package/dist/web/primitives/data-table/density.d.ts +3 -1
  110. package/dist/web/primitives/data-table/density.js +11 -4
  111. package/dist/web/primitives/data-table/row-render-parts.d.ts +1 -1
  112. package/dist/web/primitives/data-table/row-render-parts.js +3 -5
  113. package/dist/web/primitives/data-table/sort-options-select.js +2 -2
  114. package/dist/web/primitives/data-table/sortable-header.js +4 -4
  115. package/dist/web/primitives/data-table/table-body.js +2 -1
  116. package/dist/web/primitives/data-table/table-chrome.js +1 -3
  117. package/dist/web/primitives/data-table/table-content.js +7 -11
  118. package/dist/web/primitives/data-table/table-data-cell.js +31 -17
  119. package/dist/web/primitives/data-table/table-header-row.js +1 -1
  120. package/dist/web/primitives/data-table/table-view.js +1 -1
  121. package/dist/web/primitives/data-table/toolbar.js +6 -7
  122. package/dist/web/primitives/data-table/use-data-table-state.d.ts +6 -1
  123. package/dist/web/primitives/data-table/use-data-table-state.js +12 -2
  124. package/dist/web/primitives/data-table-cell.d.ts +13 -2
  125. package/dist/web/primitives/data-table-cell.js +123 -43
  126. package/dist/web/primitives/data-table.js +1 -1
  127. package/dist/web/primitives/default-form.d.ts +1 -1
  128. package/dist/web/primitives/default-form.js +11 -10
  129. package/dist/web/primitives/drawer.js +2 -7
  130. package/dist/web/primitives/facet-filter.d.ts +1 -1
  131. package/dist/web/primitives/facet-filter.js +2 -5
  132. package/dist/web/primitives/facet-search-filter.js +1 -1
  133. package/dist/web/primitives/facet-trigger-label.d.ts +1 -4
  134. package/dist/web/primitives/facet-trigger-label.js +4 -7
  135. package/dist/web/primitives/field.js +15 -8
  136. package/dist/web/primitives/form-footer-parts.js +2 -2
  137. package/dist/web/primitives/inline-suffix.d.ts +2 -0
  138. package/dist/web/primitives/inline-suffix.js +5 -0
  139. package/dist/web/primitives/input-choice-kinds.js +12 -2
  140. package/dist/web/primitives/input-number-kinds.js +2 -2
  141. package/dist/web/primitives/input-text-kinds.js +1 -1
  142. package/dist/web/primitives/layout-elements.d.ts +4 -4
  143. package/dist/web/primitives/layout-elements.js +49 -12
  144. package/dist/web/primitives/layout.d.ts +1 -1
  145. package/dist/web/primitives/layout.js +1 -1
  146. package/dist/web/primitives/money-input.js +8 -7
  147. package/dist/web/primitives/number-input.d.ts +2 -1
  148. package/dist/web/primitives/number-input.js +9 -4
  149. package/dist/web/primitives/page-header.d.ts +1 -1
  150. package/dist/web/primitives/page-header.js +8 -1
  151. package/dist/web/primitives/pager.js +12 -21
  152. package/dist/web/primitives/photo-grid.js +2 -1
  153. package/dist/web/primitives/record-steps.d.ts +1 -1
  154. package/dist/web/primitives/record-steps.js +6 -15
  155. package/dist/web/primitives/row-actions.js +38 -24
  156. package/dist/web/primitives/use-container-narrow.d.ts +12 -0
  157. package/dist/web/primitives/use-container-narrow.js +42 -0
  158. package/dist/web/ui/input.js +1 -1
  159. package/dist/web/ui/textarea.js +1 -1
  160. package/dist/web/widgets/dashboard-list-cards.js +6 -3
  161. package/dist/web/widgets/dashboard-list.d.ts +4 -1
  162. package/dist/web/widgets/dashboard-list.js +10 -5
  163. package/dist/web/widgets/progress-list.js +1 -1
  164. package/dist/web/widgets/stat-box-cell.js +1 -1
  165. package/package.json +5 -5
  166. package/src/changes.json +51 -0
  167. package/src/web/styles.css +3 -2
@@ -4,14 +4,6 @@ import { cn } from "../lib/cn.js";
4
4
  import { InsideScreenFormColumnContext } from "./metric.js";
5
5
  import { ReasonBox, ReasonInfoButton } from "./reason-box.js";
6
6
  import { useIsBelowSmViewport } from "./use-narrow-viewport.js";
7
- const STEP_STRIPE_CLASS = {
8
- bad: "bg-status-bad",
9
- warn: "bg-status-warn",
10
- critical: "bg-status-critical",
11
- ok: "bg-status-ok",
12
- accent: "bg-primary",
13
- neutral: "bg-border-strong",
14
- };
15
7
  function StepTitle({ item }) {
16
8
  const narrow = useIsBelowSmViewport();
17
9
  return narrow ? (item.narrowTitle ?? item.title) : item.title;
@@ -26,16 +18,15 @@ function StepDetail({ item }) {
26
18
  function StepRow({ item, reasonLabel, moreActionsLabel, }) {
27
19
  const [reasonOpen, setReasonOpen] = useState(item.reasonOpen === true);
28
20
  const reasonBoxId = useId();
29
- const narrow = useIsBelowSmViewport();
30
- return (_jsxs("li", { "data-testid": `record-step-${item.id}`, "data-tone": item.tone, className: "relative grid grid-cols-[minmax(0,1fr)_auto] gap-x-3 gap-y-1 py-3 pl-5 pr-4 max-sm:py-[9px] max-sm:pl-3.5 max-sm:pr-0", children: [_jsx("span", { "aria-hidden": "true", className: cn("absolute inset-y-2.5 left-0 w-1 rounded-[2px] max-sm:inset-y-[9px]", STEP_STRIPE_CLASS[item.tone ?? "neutral"]) }), _jsxs("div", { className: "col-start-1 row-start-1 flex min-w-0 items-start gap-2", children: [_jsx("span", { className: "font-medium text-foreground max-sm:text-[13.5px]", "data-slot": "step-what", children: _jsx(StepTitle, { item: item }) }), item.reason !== undefined && (_jsx("span", { className: "flex max-sm:hidden", children: _jsx(ReasonInfoButton, { label: reasonLabel, open: reasonOpen, controls: reasonBoxId, onToggle: () => setReasonOpen((open) => !open) }) }))] }), _jsxs("div", { className: "col-start-2 row-start-1 flex shrink-0 items-center gap-3 max-sm:row-span-2 max-sm:self-center max-sm:[&_button]:h-8 max-sm:[&_button]:text-[13px]", children: [item.moreActions !== undefined && !narrow && (_jsxs("div", { className: "flex items-center gap-3 text-[12.5px] text-muted-foreground [&_a]:text-[12.5px] [&_a]:text-muted-foreground [&_button]:text-[12.5px] [&_button]:text-muted-foreground", children: [moreActionsLabel !== undefined && (_jsx("span", { "data-testid": `record-step-${item.id}-more-actions-label`, children: moreActionsLabel })), item.moreActions] })), item.actions] }), _jsx("div", { className: "col-start-1 row-start-2 min-w-0 sm:col-span-2", children: _jsx(StepDetail, { item: item }) }), item.moreActions !== undefined && narrow && (_jsxs("div", { "data-testid": `record-step-${item.id}-more-actions`, className: "col-span-2 row-start-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground [&_a]:text-xs [&_a]:text-muted-foreground [&_button]:text-xs [&_button]:text-muted-foreground", children: [moreActionsLabel !== undefined && _jsx("span", { children: moreActionsLabel }), item.moreActions] })), item.reason !== undefined && reasonOpen && (_jsx("div", { className: "col-span-2 row-start-3 max-sm:hidden", children: _jsx(ReasonBox, { id: reasonBoxId, testId: `record-step-${item.id}-reason`, ...(item.reasonTitle !== undefined && { title: item.reasonTitle }), children: item.reason }) }))] }));
21
+ return (_jsxs("li", { "data-testid": `record-step-${item.id}`, "data-tone": item.tone, className: "grid min-h-16 grid-cols-[minmax(0,1fr)_auto] content-center gap-x-3 gap-y-1 px-4 py-2.5", children: [_jsxs("div", { className: "col-start-1 row-start-1 flex min-w-0 items-start gap-2", children: [_jsx("span", { className: "font-medium text-foreground max-sm:text-[13.5px]", "data-slot": "step-what", children: _jsx(StepTitle, { item: item }) }), item.reason !== undefined && (_jsx("span", { className: "flex max-sm:hidden", children: _jsx(ReasonInfoButton, { label: reasonLabel, open: reasonOpen, controls: reasonBoxId, onToggle: () => setReasonOpen((open) => !open) }) }))] }), _jsx("div", { className: "col-start-1 row-start-2 min-w-0 sm:col-span-1", children: _jsx(StepDetail, { item: item }) }), item.actions !== undefined && (_jsx("div", { className: "flex shrink-0 items-center gap-3 max-sm:col-span-2 max-sm:row-start-3 max-sm:mt-1 [&_button]:h-9 [&_button_svg]:hidden max-sm:[&>*]:w-full max-sm:[&_button]:w-full sm:col-start-2 sm:row-span-2 sm:row-start-1 sm:self-center", children: item.actions })), item.moreActions !== undefined && (_jsxs("div", { "data-testid": `record-step-${item.id}-more-actions`, className: "col-span-2 row-start-4 mt-1 flex flex-wrap items-center gap-x-3 gap-y-2 border-t border-border-row pt-2.5 text-[12.5px]", children: [moreActionsLabel !== undefined && (_jsx("span", { className: "text-muted-foreground max-sm:w-full", "data-testid": `record-step-${item.id}-more-actions-label`, children: moreActionsLabel })), _jsx("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] [&_button]:h-9 [&_button]:rounded-md [&_button]:border [&_button]:border-border-strong [&_button]:bg-card [&_button]:px-3 [&_button]:text-[12.5px] [&_button]:font-medium [&_button]:text-foreground [&_button_svg]:text-primary", children: item.moreActions })] })), item.reason !== undefined && reasonOpen && (_jsx("div", { className: "col-span-2 row-start-5 max-sm:hidden", children: _jsx(ReasonBox, { id: reasonBoxId, testId: `record-step-${item.id}-reason`, ...(item.reasonTitle !== undefined && { title: item.reasonTitle }), children: item.reason }) }))] }));
31
22
  }
32
- function StepsHeader({ title, subtitle, count, testId, }) {
33
- return (_jsxs("header", { className: "flex flex-wrap items-baseline gap-x-3 gap-y-1 px-4 py-3 max-sm:px-0 max-sm:pt-1", children: [_jsx("h3", { className: "m-0 text-sm font-semibold text-foreground", children: title }), subtitle !== undefined && (_jsx("span", { className: "text-[13px] text-muted-foreground max-sm:hidden", children: subtitle })), count !== undefined && (_jsx("span", { "data-testid": `${testId ?? "record-steps"}-count`, className: "ml-auto text-xs text-muted-foreground sm:hidden", children: count }))] }));
23
+ function StepsHeader({ title, subtitle }) {
24
+ return (_jsxs("header", { className: "flex flex-wrap items-baseline gap-x-3 gap-y-1 px-4 pt-2.5", children: [_jsx("h3", { className: "m-0 text-[11.5px] font-normal text-muted-foreground", children: title }), subtitle !== undefined && (_jsx("span", { className: "text-[13px] text-muted-foreground max-sm:hidden", children: subtitle }))] }));
34
25
  }
35
26
  function StepsMoreToggle({ testId, expanded, label, onToggle, }) {
36
- return (_jsxs("button", { type: "button", "data-testid": `${testId ?? "record-steps"}-toggle`, "aria-expanded": expanded, className: "relative w-full border-t px-4 py-3 text-left text-sm font-medium text-primary hover:underline max-sm:border-border-row max-sm:py-[9px] max-sm:pl-3.5 max-sm:pr-0 max-sm:text-xs max-sm:font-normal", onClick: onToggle, children: [_jsx("span", { "aria-hidden": "true", className: "absolute inset-y-[9px] left-0 w-1 rounded-[2px] bg-border-strong sm:hidden" }), label] }));
27
+ return (_jsx("button", { type: "button", "data-testid": `${testId ?? "record-steps"}-toggle`, "aria-expanded": expanded, className: "w-full border-t border-border-row px-4 py-3 text-left text-sm font-medium text-primary hover:underline max-sm:py-[9px] max-sm:text-xs max-sm:font-normal", onClick: onToggle, children: label }));
37
28
  }
38
- export function DefaultRecordSteps({ title, subtitle, emptyLabel, reasonLabel, narrowLimit, moreLabel, lessLabel, moreActionsLabel, items, count, testId, }) {
29
+ export function DefaultRecordSteps({ title, subtitle, emptyLabel, reasonLabel, narrowLimit, moreLabel, lessLabel, moreActionsLabel, items, testId, }) {
39
30
  const insideScreenFormColumn = useContext(InsideScreenFormColumnContext);
40
31
  const narrow = useIsBelowSmViewport();
41
32
  const [expanded, setExpanded] = useState(false);
@@ -46,5 +37,5 @@ export function DefaultRecordSteps({ title, subtitle, emptyLabel, reasonLabel, n
46
37
  : expanded
47
38
  ? lessLabel
48
39
  : moreLabel(items.length - visible.length);
49
- return (_jsx("section", { "data-testid": testId, className: cn("shrink-0", !insideScreenFormColumn && "px-6 py-2 max-sm:px-4"), children: _jsxs("div", { className: "sm:rounded-md sm:border sm:bg-card", children: [_jsx(StepsHeader, { title: title, subtitle: subtitle, count: count, testId: testId }), items.length === 0 ? (_jsx("p", { className: "m-0 px-4 py-3 text-sm text-muted-foreground", children: emptyLabel })) : (_jsx("ul", { className: "m-0 flex list-none flex-col divide-y divide-border-row p-0", children: visible.map((item) => (_jsx(StepRow, { item: item, reasonLabel: reasonLabel, moreActionsLabel: moreActionsLabel }, item.id))) })), limited && toggleLabel !== undefined && (_jsx(StepsMoreToggle, { testId: testId, expanded: expanded, label: toggleLabel, onToggle: () => setExpanded((open) => !open) }))] }) }));
40
+ return (_jsx("section", { "data-testid": testId, className: cn("shrink-0", !insideScreenFormColumn && "px-6 py-2 max-sm:px-4"), children: _jsxs("div", { className: "rounded-[9px] border border-border bg-card", children: [_jsx(StepsHeader, { title: title, subtitle: subtitle }), items.length === 0 ? (_jsx("p", { className: "m-0 px-4 py-3 text-sm text-muted-foreground", children: emptyLabel })) : (_jsx("ul", { className: "m-0 flex list-none flex-col divide-y divide-border-row p-0", children: visible.map((item) => (_jsx(StepRow, { item: item, reasonLabel: reasonLabel, moreActionsLabel: moreActionsLabel }, item.id))) })), limited && toggleLabel !== undefined && (_jsx(StepsMoreToggle, { testId: testId, expanded: expanded, label: toggleLabel, onToggle: () => setExpanded((open) => !open) }))] }) }));
50
41
  }
@@ -11,6 +11,11 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigge
11
11
  import { useToast } from "./toast.js";
12
12
  import "../react-css-custom-properties.js";
13
13
  import { actionIconFor, SECONDARY_BUTTON_EXTRA_CLASSES } from "./button.js";
14
+ // RowAction carries no AI marker; the sparkles icon is the convention for an
15
+ // AI-prepared action (same as record guidance), so it selects the soft look.
16
+ function isSoftAiAction(action, icon) {
17
+ return action.style !== "danger" && icon === "sparkles";
18
+ }
14
19
  // The primary row action always remains a visible text button: `edit` when declared,
15
20
  // otherwise the first visible action ("Edit appears in every row, always, as text").
16
21
  function primaryRowAction(actions) {
@@ -91,9 +96,9 @@ function useRowActionTrigger(row) {
91
96
  }
92
97
  // An icon-only form without a resolvable icon would render an empty button.
93
98
  // `compact` is the narrow card layout, where "responsive" collapses to its icon.
94
- function effectiveRowActionDisplay(display, hasIcon, compact) {
99
+ function effectiveRowActionDisplay(display, hasIcon, compact, keepsLabel) {
95
100
  if (display === "responsive")
96
- return hasIcon && compact ? "icon" : "button";
101
+ return hasIcon && compact && !keepsLabel ? "icon" : "button";
97
102
  if (display === "icon" && !hasIcon)
98
103
  return "link";
99
104
  return display;
@@ -102,25 +107,30 @@ function RowActionButton({ row, action, iconOnly = false, asLink = false, compac
102
107
  const { busy, triggerNow } = useRowActionTrigger(row);
103
108
  const [confirmOpen, setConfirmOpen] = useState(false);
104
109
  const resolvedIcon = actionIconFor(action.icon);
105
- const resolvedDisplay = effectiveRowActionDisplay(action.display, resolvedIcon !== undefined, compact);
106
- // A card's small row action is always an outlined button, also when the author asked for a link.
107
- const display = small && resolvedDisplay === "link" ? "button" : resolvedDisplay;
110
+ const resolvedDisplay = effectiveRowActionDisplay(action.display, resolvedIcon !== undefined, compact, isSoftAiAction(action, resolvedIcon));
111
+ const display = resolvedDisplay;
112
+ if (display === "text") {
113
+ return (_jsx("span", { "data-testid": `row-${row.id}-action-${action.id}`, className: cn("px-2.5 text-muted-foreground", small ? "text-[13px]" : "text-sm"), children: action.label }));
114
+ }
108
115
  const isBorderedButton = display === "button";
116
+ const isSoftAiButton = isBorderedButton && isSoftAiAction(action, resolvedIcon);
109
117
  const showIconOnly = display === "icon" || (display === undefined && iconOnly && resolvedIcon !== undefined);
110
118
  const linkLike = display === "link" || (display === undefined && asLink);
111
- const variantClass = isBorderedButton
112
- ? action.style === "primary"
113
- ? "border border-transparent bg-primary text-primary-foreground hover:bg-primary/90"
119
+ const variantClass = isSoftAiButton
120
+ ? "border border-transparent bg-primary/10 text-primary hover:bg-primary/15"
121
+ : isBorderedButton
122
+ ? action.style === "primary"
123
+ ? "border border-transparent bg-primary text-primary-foreground hover:bg-primary/90"
124
+ : action.style === "danger"
125
+ ? "border border-destructive/40 bg-card text-destructive hover:bg-destructive/10"
126
+ : "border border-border-strong bg-card text-foreground hover:bg-accent"
114
127
  : action.style === "danger"
115
- ? "border border-destructive/40 bg-card text-destructive hover:bg-destructive/10"
116
- : "border border-border-strong bg-card text-foreground hover:bg-accent"
117
- : action.style === "danger"
118
- ? "text-destructive hover:bg-destructive/10"
119
- : linkLike
120
- ? "font-medium text-primary hover:bg-muted"
121
- : action.style === "primary"
122
- ? "text-primary hover:bg-primary/10"
123
- : "text-foreground hover:bg-accent";
128
+ ? "text-destructive hover:bg-destructive/10"
129
+ : linkLike
130
+ ? "font-medium text-primary hover:bg-muted"
131
+ : action.style === "primary"
132
+ ? "text-primary hover:bg-primary/10"
133
+ : "text-foreground hover:bg-accent";
124
134
  return (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", "data-testid": `row-${row.id}-action-${action.id}`, disabled: busy, ...(showIconOnly && { "aria-label": action.label, title: action.label }), onClick: (e) => {
125
135
  e.stopPropagation();
126
136
  if (needsActionConfirm(action)) {
@@ -129,13 +139,17 @@ function RowActionButton({ row, action, iconOnly = false, asLink = false, compac
129
139
  else {
130
140
  void triggerNow(action);
131
141
  }
132
- }, className: cn("inline-flex items-center justify-center gap-1.5 text-sm", isBorderedButton
133
- ? small
134
- ? cn("rounded-md font-medium", COMPACT_TAP_CLASSES)
135
- : "h-8 rounded-md px-3 font-medium max-md:h-11"
136
- : linkLike
137
- ? "h-7 rounded-md px-2.5 max-md:h-11"
138
- : "h-8 rounded-sm max-md:h-11", showIconOnly ? "w-8 max-md:w-11" : !linkLike && !isBorderedButton && "px-2", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:opacity-50 disabled:pointer-events-none", variantClass), children: busy ? (_jsx(Loader2, { className: "size-3.5 animate-spin", "aria-hidden": "true" })) : resolvedIcon === undefined || (linkLike && !showIconOnly) ? (action.label) : showIconOnly ? (_jsx(Icon, { name: resolvedIcon, className: "size-4" })) : (_jsxs(_Fragment, { children: [_jsx(Icon, { name: resolvedIcon, className: "size-4" }), action.label] })) }), _jsx(DefaultDialog, { open: confirmOpen, onOpenChange: setConfirmOpen, title: action.label, ...(action.confirm !== undefined && { description: action.confirm }), confirmLabel: action.confirmLabel ?? action.label, ...(action.style === "danger" && { variant: "danger" }), onConfirm: () => triggerNow(action), testId: `row-${row.id}-action-${action.id}-dialog` })] }));
142
+ }, className: cn("inline-flex items-center justify-center gap-1.5 text-sm", isSoftAiButton
143
+ ? "h-[26px] rounded-md px-2.5 text-[12.5px] font-semibold"
144
+ : isBorderedButton
145
+ ? small
146
+ ? cn("rounded-md font-medium", COMPACT_TAP_CLASSES)
147
+ : "h-8 rounded-md px-3 font-medium max-md:h-11"
148
+ : linkLike
149
+ ? small
150
+ ? "h-8 rounded-md px-0 text-[13px] font-medium"
151
+ : "h-7 rounded-md px-2.5 max-md:h-11"
152
+ : "h-8 rounded-sm max-md:h-11", showIconOnly ? "w-8 max-md:w-11" : !linkLike && !isBorderedButton && "px-2", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:opacity-50 disabled:pointer-events-none", variantClass), children: busy ? (_jsx(Loader2, { className: "size-3.5 animate-spin", "aria-hidden": "true" })) : resolvedIcon === undefined || (linkLike && !showIconOnly) ? (action.label) : showIconOnly ? (_jsx(Icon, { name: resolvedIcon, className: "size-4" })) : (_jsxs(_Fragment, { children: [_jsx(Icon, { name: resolvedIcon, className: "size-4" }), action.label] })) }), _jsx(DefaultDialog, { open: confirmOpen, onOpenChange: setConfirmOpen, title: action.label, ...(action.confirm !== undefined && { description: action.confirm }), confirmLabel: action.confirmLabel ?? action.label, ...(action.style === "danger" && { variant: "danger" }), onConfirm: () => triggerNow(action), testId: `row-${row.id}-action-${action.id}-dialog` })] }));
139
153
  }
140
154
  // Kebab dropdown for >2 actions, one inline confirm dialog per item like
141
155
  // the inline-button path. Menu is controlled so it closes explicitly on
@@ -0,0 +1,12 @@
1
+ import { type RefObject } from "react";
2
+ /** `narrow`: the referenced element is narrower than the card breakpoint. `docked`: the shell
3
+ * reports a docked assistant panel, which shrinks the content without changing the viewport (so
4
+ * a media query cannot see it) and not necessarily below the breakpoint. Both are false until
5
+ * measured and where ResizeObserver is missing. */
6
+ export declare function useContainerSqueeze<T extends HTMLElement>(): [
7
+ RefObject<T | null>,
8
+ {
9
+ readonly narrow: boolean;
10
+ readonly docked: boolean;
11
+ }
12
+ ];
@@ -0,0 +1,42 @@
1
+ import { useLayoutEffect, useRef, useState } from "react";
2
+ import { NARROW_VIEWPORT_BREAKPOINT_PX } from "./use-narrow-viewport.js";
3
+ // Set by the shell while the assistant panel is docked; the inset then gets that much right padding.
4
+ const DOCKED_PANEL_WIDTH_VAR = "--agent-panel-width";
5
+ function isPanelDocked(element) {
6
+ const width = Number.parseFloat(getComputedStyle(element).getPropertyValue(DOCKED_PANEL_WIDTH_VAR));
7
+ return Number.isFinite(width) && width > 0;
8
+ }
9
+ /** `narrow`: the referenced element is narrower than the card breakpoint. `docked`: the shell
10
+ * reports a docked assistant panel, which shrinks the content without changing the viewport (so
11
+ * a media query cannot see it) and not necessarily below the breakpoint. Both are false until
12
+ * measured and where ResizeObserver is missing. */
13
+ export function useContainerSqueeze() {
14
+ const ref = useRef(null);
15
+ const [narrow, setNarrow] = useState(false);
16
+ const [docked, setDocked] = useState(false);
17
+ useLayoutEffect(() => {
18
+ const element = ref.current;
19
+ // skip: no element or no observer support (SSR, bare test DOMs) keeps the viewport rules
20
+ if (element === null || typeof ResizeObserver === "undefined")
21
+ return;
22
+ const measure = () => {
23
+ const width = element.getBoundingClientRect().width;
24
+ setNarrow(width > 0 && width < NARROW_VIEWPORT_BREAKPOINT_PX);
25
+ setDocked(isPanelDocked(element));
26
+ };
27
+ measure();
28
+ const observer = new ResizeObserver(measure);
29
+ observer.observe(element);
30
+ // An overflowing table keeps its width when the panel docks, so only the variable change tells.
31
+ const styleObserver = new MutationObserver(measure);
32
+ styleObserver.observe(element.ownerDocument.documentElement, {
33
+ attributes: true,
34
+ attributeFilter: ["style"],
35
+ });
36
+ return () => {
37
+ observer.disconnect();
38
+ styleObserver.disconnect();
39
+ };
40
+ }, []);
41
+ return [ref, { narrow, docked }];
42
+ }
@@ -3,6 +3,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { cn } from "../lib/cn.js";
5
5
  function Input({ className, type, ...props }) {
6
- return (_jsx("input", { type: type, "data-slot": "input", className: cn("h-9 w-full min-w-0 max-md:min-h-11 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className), ...props }));
6
+ return (_jsx("input", { type: type, "data-slot": "input", className: cn("h-[38px] w-full min-w-0 max-md:min-h-11 rounded-[7px] border-[1.5px] border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className), ...props }));
7
7
  }
8
8
  export { Input };
@@ -3,6 +3,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { cn } from "../lib/cn.js";
5
5
  function Textarea({ className, ...props }) {
6
- return (_jsx("textarea", { "data-slot": "textarea", className: cn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40", className), ...props }));
6
+ return (_jsx("textarea", { "data-slot": "textarea", className: cn("flex field-sizing-content min-h-16 w-full rounded-[7px] border-[1.5px] border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40", className), ...props }));
7
7
  }
8
8
  export { Textarea };
@@ -32,15 +32,18 @@ export function DashboardListCards({ columns, rows, testId, rowToneField, titleF
32
32
  const plain = columns.filter((column) => column.hint === undefined);
33
33
  const badgeColumns = plain.filter((column) => column.display === "badge");
34
34
  const buttonColumns = plain.filter((column) => column.display === "button");
35
- const otherColumns = plain.filter((column) => column.display !== "badge" && column.display !== "button");
35
+ const otherColumns = plain.filter((column) => column.display !== "badge" && column.display !== "button" && column.hiddenInCards !== true);
36
36
  const cell = (column, row) => (_jsx(DashboardListCell, { column: column, row: row, ...cellProps }, column.field));
37
37
  return (_jsx("ul", { "data-testid": testId, className: "m-0 flex list-none flex-col gap-2 p-0", children: rows.map((row, index) => {
38
38
  const detail = detailOf(hintColumn?.hint, row);
39
- const badges = badgeColumns.filter((column) => hasValue(row[column.field]));
39
+ const allBadges = badgeColumns.filter((column) => hasValue(row[column.field]));
40
+ // First badge (type) heads the card next to the time; further badges (e.g. AI) sit bottom left.
41
+ const badges = allBadges.slice(0, 1);
42
+ const footBadges = allBadges.slice(1);
40
43
  const buttons = buttonColumns.filter((column) => hasValue(row[column.field]));
41
44
  const others = otherColumns.filter((column) => hasValue(row[column.field]));
42
45
  return (_jsxs("li", { "data-testid": "dashboard-list-card", className: cn("flex flex-col gap-1 rounded-lg border border-border bg-card px-3 py-2.5", cardToneClass(rowToneField === undefined
43
46
  ? undefined
44
- : (rowToneOf(row, rowToneField) ?? "neutral"))), children: [(badges.length > 0 || detail !== undefined) && (_jsxs("div", { className: "flex min-w-0 items-center gap-2 text-xs text-muted-foreground", children: [badges.map((column) => cell(column, row)), detail !== undefined && (_jsx("small", { "data-testid": "dashboard-list-card-detail", className: "min-w-0 truncate text-xs", children: detail }))] })), hintColumn !== undefined && (_jsx(CardHeadline, { column: hintColumn, row: row, titleField: titleField })), (others.length > 0 || buttons.length > 0) && (_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("div", { className: "flex min-w-0 flex-col text-xs text-muted-foreground", children: others.map((column) => (_jsx("span", { className: "truncate", children: cell(column, row) }, column.field))) }), buttons.length > 0 && (_jsx("div", { className: "flex shrink-0 flex-wrap justify-end gap-2 [&_a]:relative [&_a]:h-8 [&_a]:px-2.5 [&_a]:text-xs [&_a]:max-md:min-h-0 [&_a]:before:absolute [&_a]:before:inset-x-0 [&_a]:before:-inset-y-1.5 [&_a]:before:content-['']", children: buttons.map((column) => cell(column, row)) }))] }))] }, typeof row["id"] === "string" ? row["id"] : index));
47
+ : (rowToneOf(row, rowToneField) ?? "neutral"))), children: [(badges.length > 0 || detail !== undefined) && (_jsxs("div", { className: "flex min-w-0 items-center gap-2 text-xs text-muted-foreground", children: [badges.map((column) => cell(column, row)), detail !== undefined && (_jsx("small", { "data-testid": "dashboard-list-card-detail", className: cn("ml-auto min-w-0 truncate text-xs", rowToneOf(row, rowToneField) === "warn" && "font-medium text-status-warn"), children: detail }))] })), hintColumn !== undefined && (_jsx(CardHeadline, { column: hintColumn, row: row, titleField: titleField })), others.map((column) => (_jsx("span", { className: "text-xs text-muted-foreground line-clamp-2", children: cell(column, row) }, column.field))), (footBadges.length > 0 || buttons.length > 0) && (_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("div", { className: "flex min-w-0 items-center gap-2", children: footBadges.map((column) => cell(column, row)) }), buttons.length > 0 && (_jsx("div", { className: "flex shrink-0 flex-wrap justify-end gap-2 [&_a]:relative [&_a]:h-8 [&_a]:px-2.5 [&_a]:text-xs [&_a]:max-md:min-h-0 [&_a]:before:absolute [&_a]:before:inset-x-0 [&_a]:before:-inset-y-1.5 [&_a]:before:content-['']", children: buttons.map((column) => cell(column, row)) }))] }))] }, typeof row["id"] === "string" ? row["id"] : index));
45
48
  }) }));
46
49
  }
@@ -10,8 +10,9 @@ export type DashboardListColumn = {
10
10
  readonly buttonVariant?: "primary";
11
11
  readonly badgeToneField?: string;
12
12
  readonly badgeDot?: false;
13
+ readonly badgeIcon?: "sparkles";
13
14
  /** `false` leaves an empty cell blank instead of drawing the placeholder. */
14
- readonly emptyPlaceholder?: false;
15
+ readonly emptyPlaceholder?: string | false;
15
16
  /** Resolves the raw cell value to display text, e.g. a reference id to its label. */
16
17
  readonly renderValue?: (value: unknown, row: Readonly<Record<string, unknown>>) => string;
17
18
  /** Links the rendered text to its target, e.g. a reference cell to the record's detail. */
@@ -20,6 +21,8 @@ export type DashboardListColumn = {
20
21
  readonly hint?: ListColumnHintViewModel;
21
22
  /** `showOnNarrowOnly`: drawn in the phone cards only, never as a table column. */
22
23
  readonly narrowOnly?: true;
24
+ /** `hideOnNarrow`: a table column that the phone cards leave out. */
25
+ readonly hiddenInCards?: true;
23
26
  };
24
27
  export type DashboardListRow = Readonly<Record<string, unknown>>;
25
28
  type Row = DashboardListRow;
@@ -1,5 +1,5 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ArrowUpRight, ChevronRight } from "lucide-react";
2
+ import { ArrowUpRight, ChevronRight, Sparkles } from "lucide-react";
3
3
  import { EMPTY_VALUE_PLACEHOLDER, } from "../../headless/index.js";
4
4
  import { isSelectOptionTone } from "../../status-tone.js";
5
5
  import { cn } from "../lib/cn.js";
@@ -39,7 +39,7 @@ export function dashboardListCellText(column, row, field, formats, translate) {
39
39
  }
40
40
  export function DashboardListCell({ column, row, formatPercent, formatNumber, formatDateTime, translate, leading, }) {
41
41
  const raw = row[column.field];
42
- const empty = column.emptyPlaceholder === false ? "" : EMPTY_VALUE_PLACEHOLDER;
42
+ const empty = column.emptyPlaceholder === false ? "" : (column.emptyPlaceholder ?? EMPTY_VALUE_PLACEHOLDER);
43
43
  if (column.hint !== undefined) {
44
44
  return _jsx(HintCell, { value: raw, row: row, hint: column.hint, leading: leading });
45
45
  }
@@ -51,8 +51,11 @@ export function DashboardListCell({ column, row, formatPercent, formatNumber, fo
51
51
  if (raw === undefined || raw === null || raw === "")
52
52
  return empty;
53
53
  const toneKey = column.badgeToneField !== undefined ? row[column.badgeToneField] : undefined;
54
- const tone = (typeof toneKey === "string" ? LIST_BADGE_TONE[toneKey] : undefined) ?? "muted";
55
- return (_jsx(StatusBadge, { tone: tone, dot: column.badgeDot !== false, children: String(raw) }));
54
+ const isAi = column.badgeIcon === "sparkles";
55
+ const tone = isAi
56
+ ? "accent"
57
+ : ((typeof toneKey === "string" ? LIST_BADGE_TONE[toneKey] : undefined) ?? "muted");
58
+ return (_jsxs(StatusBadge, { tone: tone, dot: !isAi && column.badgeDot !== false, children: [isAi && _jsx(Sparkles, { className: "size-3", "aria-hidden": "true" }), String(raw)] }));
56
59
  }
57
60
  if (column.display === "datetime") {
58
61
  const atMs = timestampMsOf(raw);
@@ -118,6 +121,7 @@ export function DashboardListTable({ columns: allColumns, rows, formatPercent, f
118
121
  const leadingBadgeColumns = leadingBadgeColumnsOf(visibleColumns);
119
122
  const columns = visibleColumns.filter((column) => !leadingBadgeColumns.includes(column));
120
123
  const hintColumn = columns.find((column) => column.hint !== undefined);
124
+ const deadlineFields = new Set(hintColumn?.hint?.narrowDetailField === undefined ? [] : [hintColumn.hint.narrowDetailField]);
121
125
  const padded = rowToneField !== undefined || leadingBadgeColumns.length > 0;
122
126
  const cellProps = { formatPercent, formatNumber, formatDateTime, translate };
123
127
  return (_jsx("div", { className: "overflow-x-auto", children: _jsxs("table", { "data-testid": testId, className: "w-full text-sm", children: [showHeader && (_jsx("thead", { children: _jsxs("tr", { className: "h-9 border-b border-border-row text-left text-xs text-muted-foreground", children: [columns.map((column) => (_jsx("th", { scope: "col", className: cn("px-4 font-medium", column.display === "button" && "text-right"), children: column.label }, column.field))), rowLink !== undefined && _jsx("th", { scope: "col", className: "w-8" })] }) })), _jsx("tbody", { children: rows.map((row, index) => {
@@ -139,7 +143,8 @@ export function DashboardListTable({ columns: allColumns, rows, formatPercent, f
139
143
  !showHeader &&
140
144
  "max-sm:grid max-sm:h-auto max-sm:grid-cols-1 max-sm:gap-1 max-sm:py-2", rowToneMarker === "bar" && rowToneClass(tone)), children: [columns.map((column, columnIndex) => {
141
145
  const leading = leadingFor(column, columnIndex);
142
- const cell = (_jsx(DashboardListCell, { column: column, row: row, ...cellProps, ...(column.hint !== undefined && { leading }) }));
146
+ const plainCell = (_jsx(DashboardListCell, { column: column, row: row, ...cellProps, ...(column.hint !== undefined && { leading }) }));
147
+ const cell = tone === "warn" && deadlineFields.has(column.field) ? (_jsx("span", { className: "font-medium text-status-warn", children: plainCell })) : (plainCell);
143
148
  return (_jsx("td", { className: cn("px-4", column.display === "button" && "text-right", !showHeader && "max-sm:block"), children: column.hint === undefined && dot !== null && columnIndex === 0 ? (_jsxs("span", { className: "flex items-center gap-2", children: [dot, cell] })) : (cell) }, column.field));
144
149
  }), rowLink !== undefined && (_jsx("td", { className: "w-8 px-2 text-right", children: _jsx(RowLinkIcon, { link: rowTarget, icon: rowLink.icon, label: translate("kumiko.dashboard.list.open-row") }) }))] }, rowKey));
145
150
  const reasonHint = columns.find((column) => column.hint !== undefined && hintReasonOf(column.hint, row) !== undefined)?.hint;
@@ -6,5 +6,5 @@ export function ProgressList({ rows, emptyContent, testId, }) {
6
6
  if (rows.length === 0) {
7
7
  return _jsx("div", { "data-testid": testId, children: emptyContent });
8
8
  }
9
- return (_jsx("ul", { "data-testid": testId, className: "flex max-h-64 flex-col gap-3 overflow-y-auto pr-1", children: rows.map((row) => (_jsxs("li", { className: "flex flex-col gap-1", children: [_jsxs("div", { className: "flex items-baseline justify-between gap-2 text-sm", children: [_jsx("span", { className: "font-medium", children: row.label }), _jsx("span", { className: cn("tabular-nums", row.tone === "danger" ? "text-status-critical" : "text-muted-foreground"), children: row.value })] }), row.fraction !== null && _jsx(ProgressBar, { value: row.fraction, tone: row.tone }), row.sub !== undefined && _jsx("div", { className: "text-xs text-muted-foreground", children: row.sub })] }, row.id))) }));
9
+ return (_jsx("ul", { "data-testid": testId, className: "flex max-h-64 flex-col gap-3 overflow-y-auto pr-1", children: rows.map((row) => (_jsxs("li", { className: "flex flex-col gap-1", children: [row.fraction !== null && _jsx(ProgressBar, { value: row.fraction, tone: row.tone }), _jsxs("div", { className: "flex items-baseline justify-between gap-2 text-sm", children: [_jsx("span", { className: "font-medium", children: row.label }), _jsx("span", { className: cn("tabular-nums", row.tone === "danger" ? "text-status-critical" : "text-muted-foreground"), children: row.value })] }), row.sub !== undefined && _jsx("div", { className: "text-xs text-muted-foreground", children: row.sub })] }, row.id))) }));
10
10
  }
@@ -6,5 +6,5 @@ import { Sparkline, StatLinkFrame, TONE_VALUE, } from "./stat.js";
6
6
  * sub line small beside it. Below `sm` plain text "<number> <label>" that joins the strip's single line. */
7
7
  export function StatBoxCell({ label, narrowLabel, value, sub, tone = "default", icon, delta, spark, testId, link, }) {
8
8
  const belowSm = useIsBelowSmViewport();
9
- return (_jsx(StatLinkFrame, { link: link, testId: testId, children: belowSm ? (_jsxs("span", { "data-testid": testId, className: "whitespace-nowrap text-sm", children: [_jsx("span", { className: "tabular-nums text-foreground", children: value }), " ", _jsx("span", { className: "text-foreground", children: narrowLabel ?? label })] })) : (_jsxs("div", { "data-testid": testId, className: "flex min-w-0 items-center gap-3 rounded-lg border border-border bg-background px-3 py-2.5", children: [icon, _jsx("span", { className: cn("text-2xl font-semibold leading-none tabular-nums", TONE_VALUE[tone]), children: value }), _jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx("span", { className: "truncate text-sm font-semibold text-foreground", children: label }), sub !== undefined && (_jsx("span", { className: "truncate text-xs text-muted-foreground", children: sub }))] }), delta !== undefined && (_jsxs("span", { className: "whitespace-nowrap text-xs font-medium tabular-nums text-muted-foreground", children: [delta.direction === "up" ? "↑" : "↓", delta.value] })), spark !== undefined && (_jsx(Sparkline, { points: spark, className: cn("h-6 w-16 shrink-0", TONE_VALUE[tone]) }))] })) }));
9
+ return (_jsx(StatLinkFrame, { link: link, testId: testId, children: belowSm ? (_jsxs("span", { "data-testid": testId, className: "whitespace-nowrap text-sm", children: [_jsx("span", { className: "font-semibold tabular-nums text-foreground", children: value }), " ", _jsx("span", { className: "text-foreground", children: narrowLabel ?? label })] })) : (_jsxs("div", { "data-testid": testId, className: "flex min-w-0 items-center gap-3 rounded-lg border border-border bg-background px-3 py-2.5", children: [icon, _jsx("span", { className: cn("text-2xl font-semibold leading-none tabular-nums", TONE_VALUE[tone]), children: value }), _jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx("span", { className: "truncate text-sm font-semibold text-foreground", children: label }), sub !== undefined && (_jsx("span", { className: "truncate text-xs text-muted-foreground", children: sub }))] }), delta !== undefined && (_jsxs("span", { className: "whitespace-nowrap text-xs font-medium tabular-nums text-muted-foreground", children: [delta.direction === "up" ? "↑" : "↓", delta.value] })), spark !== undefined && (_jsx(Sparkline, { points: spark, className: cn("h-6 w-16 shrink-0", TONE_VALUE[tone]) }))] })) }));
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-renderer",
3
- "version": "0.416.0",
3
+ "version": "0.417.0",
4
4
  "description": "React renderer for Kumiko screens. The root export holds the platform-agnostic logic (primitives contract, hooks, KumikoScreen, navigation and SSE abstractions); ./headless the DOM-free UI logic, ./live the HTTP dispatcher, ./web the browser bindings (HTML primitives, history navigation, EventSource live events, createKumikoApp).",
5
5
  "license": "MIT",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -48,8 +48,8 @@
48
48
  }
49
49
  },
50
50
  "dependencies": {
51
- "@cosmicdrift/kumiko-framework": "0.416.0",
52
- "@cosmicdrift/kumiko-types": "0.416.0",
51
+ "@cosmicdrift/kumiko-framework": "0.417.0",
52
+ "@cosmicdrift/kumiko-types": "0.417.0",
53
53
  "@types/qrcode": "^1.5.6",
54
54
  "class-variance-authority": "^0.7.1",
55
55
  "clsx": "^2.1.1",
@@ -79,8 +79,8 @@
79
79
  }
80
80
  },
81
81
  "devDependencies": {
82
- "@cosmicdrift/kumiko-locale-de": "0.416.0",
83
- "@cosmicdrift/kumiko-testing": "0.416.0",
82
+ "@cosmicdrift/kumiko-locale-de": "0.417.0",
83
+ "@cosmicdrift/kumiko-testing": "0.417.0",
84
84
  "@tailwindcss/cli": "^4.3.3",
85
85
  "@testing-library/react": "^16.3.3",
86
86
  "@testing-library/user-event": "^14.6.8",
package/src/changes.json CHANGED
@@ -1,4 +1,55 @@
1
1
  [
2
+ {
3
+ "version": "0.417.0",
4
+ "type": "breaking",
5
+ "title": "Board look for lists, forms, record pages and the shell",
6
+ "detail": "Lists get a new header, empty state, pager, toolbar, row actions and phone cards; the \"…\" menu only shows for overflow actions. New list options: `mutedRowField`, column `ellipsis` and `emphasis`, `dateOnlyAfterDays` on date columns, `toolbarSort`, `hideCountFooter`. `ListBadgeTone` is exported from `@cosmicdrift/kumiko-types` and badge tones also take the SelectOptionTone words. Record pages: `pageNavigation: false`, `mobileSummary`, `metricsPlacement.narrow: \"before-steps\"`, `MetricSpec.visibleWhen`, `photosBeside`, `recordSections.omitFirstTitle`, field option `concealed`, banner `iconless`; read-only groups with explicit `columns` render as a facts grid. Forms: banner variant `assist`, `FormProps.topBanner`, compact ConfigCascade, booleans as an off/on segment in settings, pinned footer actions with `hideIcon`, no cancel button in the drawer footer, drawers full screen on phones. Dashboards: progress-list `labelParams`, stat tiles as one text line on phones, the bell only renders with unread notices. The emptyState action no longer needs an icon. The i18n key `kumiko.pager.goToPage` is replaced by `kumiko.pager.pageOf`. Form fields: layout field options `badge` (`{ label, tone }` or `{ field, tone }`, type `FieldBadge`) and `hintField` (value field shown as a muted hint under the field); the badge sits next to the label. Number and money fields show a `suffix`/currency symbol right behind the number on a full-width field; textareas are four lines tall by default; choice chips are 26px pills (primary border and light fill when chosen); the hint of a field with `aiAssist` stays directly under the textarea, before the chips and the AI input. Record pages show the summary directly under the title, the status chip next to the H1 and the mobile summary left-aligned under it; destructive header actions move into the \"…\" menu; groups of a fields section render as labelled grids; a fields section description sits muted under the data (first sentence bold) on record pages; with `photosBeside` the data column is 380px wide. `photoGrid` gets `badgeField` (row text shown as a warn badge on the image) and tiles without `captionField` read \"Photo n\" (new key `kumiko.photo-grid.fallback-caption`); tiles are edge-to-edge images with the caption below, and the tile's per-photo actions stand in the caption row on the right (they wrap below it when a phone tile is too narrow). Next-step buttons are 36px high without icon and the \"Vorher klären\" chips wrap. Dashboards: stat strip tiles are separate cards on desktop, panel subtitles sit right in the head, the progress-list takes `subtitleField` (answer field shown muted at the head's right), the bar sits above the label row, a deadline cell uses the warn tone when the row has tone warn, `hideOnNarrow` columns stay out of phone cards, a text panel starting with a lead gets a primary accent bar and `**bold**` in paragraphs renders bold, the assist banner has a primary left bar. A list hint detail (`plainSentence`) is always muted text, never a tone badge. configEdit takes `compact: true` (no origin icon or reset link, no accent bar, uppercase group labels, form column max 940px). New list column options `multiline: true` (free text: wraps instead of ending in \"…\" and a line break in the value starts a new line, table and phone card; the helpdesk reply message uses it). A function-rendered column (reference columns) now shows its string `emptyPlaceholder` through the shared empty cell (translated, muted). A configEdit whose keys all carry `mask.section` keeps the feature description on its first section. The key-looking heuristic for `emptyPlaceholder` is gone: every string goes through translate and `cardAbove: true` (phone card: the column's line stands above the title, muted). A relatedList in tabs mode sits in a bordered card with a grey header row inside the page margin. Settings rows (`layout=\"row\"`) put the control beside the label from a 384px container width (label and control share the row 1:1; the generated settings hub with `compact` is 940px wide, so it reads as rows), below that they stack. The photo grid sets its column templates as arbitrary properties (two columns on a phone, three from md) so a missing utility cannot collapse it to one column. Record pages, round 2: every projectionDetail section takes `tabLabel` (i18n key of the tab name; the `title` stays the card heading), `after` (a `{ react: { __component } }` slot drawn directly under the section card, also beside `photosBeside`) and the phone options `hideOnNarrow: true`, `showOnNarrowOnly: true` (exclusive), `titleOnNarrow: false` (no section title below `sm`); fields and writeForm sections take `descriptionNarrow` (short description on the phone), an edit field `{ field, hideOnNarrow: true }` leaves the grid below `sm`, `layout.narrowTabs: false` drops the tab strip on the phone so the visible sections stand one under the other, `header.narrowTitle` (i18n key) is the short title in the phone top bar, `photoGrid.badgeFirst: true` sorts tiles with a badge to the front. A writeForm section takes `submitWith`: the id of a writeHandler action in the screen's `actions`; the section then has no submit button, and that action sends its own payload plus the current form values in one write after the form validates (a form field named like a payload key, a `submitWith` that is no writeHandler action and two forms for one action fail at boot). The `after`, `tabLabel`, `descriptionNarrow` and `narrowTitle` texts are i18n keys. A navigate action takes `icon: false` (no icon, not even the id-derived default). A dashboard list `footerLink.label` is optional: without it only `moreText` shows, as muted text without a link. List columns get `hideWhenDocked: true` (leaves a table whose container is narrower than `md`, the docked assistant panel, while the phone card still shows it). Behaviour change on the phone: with `mobileSummary` set, the record header shows no status chip row and no subtitle under the H1, only the H1, the mobile summary and then the AI text.",
7
+ "migration": "Lists that want the desktop sort dropdown set `toolbarSort: true`. Apps that override `kumiko.pager.goToPage` move the text to `kumiko.pager.pageOf`. Snapshot and DOM tests that assert old list, drawer or header classes need new expectations."
8
+ },
9
+ {
10
+ "version": "0.417.0",
11
+ "type": "breaking",
12
+ "title": "List cells stay blank when empty, truncate, and phone cards follow the board",
13
+ "detail": "Empty cells render nothing by default (no more \"—\"); `emptyPlaceholder` is now `string | false` (an i18n key or literal shown muted in the empty cell; `false` keeps the cell blank). New column options `tone: \"muted\"` (whole column in the muted text colour) and `cardBadge: true` (the phone card shows the column right of the title as an outlined neutral pill; without one the first select column stays the badge). `RowActionDisplay` gains `\"text\"` (muted text without a button, e.g. a closed state). Table cells truncate with an ellipsis instead of wrapping (headers still wrap); a pill column shows its pill with a dot next to the cell text. Phone cards: a column with `emphasis` leads the card as a primary line with a sparkle icon and its pill on the right; `responsive` and `text` row actions sit in the card footer (the soft AI action on the left, links right); the card status pill sits right in the title row. A list facet bound to `namedFilters` is now appended after the other facets. A select facet reads only its label while unfiltered. The pager shows \"0 of 0\" (key `kumiko.pager.statusEmpty`) for an empty list, with an outlined page-size select and 32px outlined arrows. Stand-in screens (`visibleWhen` fallback) draw neither pager nor count footer. The phone sort line reads \"Sorted by X ↓\" without the count (key `kumiko.list.sort.summary` lost `{count}` and `{noun}`); the filter button shows a sliders icon. The new column option `hideWhenDocked: true` leaves a table whose container is narrower than `md` (docked assistant panel), measured with a ResizeObserver; `hideOnNarrow` only means the phone viewport. A list row (table and card) whose id equals the `ScreenFocus` record id is highlighted (light primary fill, 3px primary bar on the left). Relative times in lists (`relativeTime` format and the live formatter) read short and uniformly: \"just now\", \"5 min. ago\", \"yesterday, 19:02\", \"2 days ago\", an absolute date after 7 days, in all locales. A `hideOnNarrow` column is never the phone card title, the first visible column is; `cardAbove` columns do not count toward the three card meta lines; an `emphasis` column leads the card like a hint column, so a computed column with a renderer can be the \"to do\" line.",
14
+ "migration": "Tests and apps that expect \"—\" in empty list cells set `emptyPlaceholder: \"—\"` or update the expectation. Apps that override `kumiko.list.sort.summary` drop `{count}` and `{noun}`. Tests that assert `whitespace-normal` list cells or long relative texts (\"5 minutes ago\") need new expectations."
15
+ },
16
+ {
17
+ "version": "0.417.0",
18
+ "type": "improvement",
19
+ "title": "Dashboard labelNarrow, AI badges, compact settings hub, stand-in and header fixes",
20
+ "detail": "Dashboard stat `labelNarrow` (i18n key) replaces `label` below sm and resolves with `{ count: <stat value> }`, so a plural key gives \"1 answer\" / \"2 answers\". Dashboard list badge columns take `badgeIcon: \"sparkles\"` (soft blue AI pill with a sparkles icon, no dot); the \"more\" footer link is primary. `ConfigMask.compact: true` renders the generated settings screen like `configEdit` `compact: true` (no origin icon or reset link, no accent bar, large section labels). Behaviour change: every compact `configEdit` screen now also drops name-derived field icons (e.g. the phone icon) on all viewports, previously only below sm; `ConfigMask.section` (i18n key) groups keys under their own titled section. Number chips with a field `suffix` show \"15.000 €\" style text. The photo grid is 2 columns, 3 from md. Inline banners with a title show it as a muted label above the text. A form that only a record screen's `actions` (navigate or drawer) open now counts as reachable, so it no longer needs `dormant: true`. Stand-in screens no longer show a pager or count, empty lists draw no header row or frame, `HeaderActionPinned` takes `hideOnListScreens` (the KI trigger can leave list screens on phones), and related lists on phones render plain cards."
21
+ },
22
+ {
23
+ "version": "0.417.0",
24
+ "type": "breaking",
25
+ "title": "submitWith actions never write without their form, relative \"just now\" is translated",
26
+ "detail": "A projectionDetail action that a writeForm section submits (`submitWith`) now refuses to write when that form is not mounted (other tab, hidden by `visibleWhen`) and shows an error instead of silently sending only its own payload. A form hidden by CSS (`hideOnNarrow`, `showOnNarrowOnly`) keeps its loaded values; when its validation fails the action shows an error naming the fields. Boot rejects a `submitWith` action in a tabs layout unless its `showOnTabs` lists only the form section's id. The \"just now\" text of relative times is the new key `kumiko.time.justNow` (en, de, es, fr, it) instead of a built-in table; `RelativeTimeOptions.justNow` is now the translated text (string) instead of a boolean.",
27
+ "migration": "Tabs layouts with a `submitWith` action add `showOnTabs: [\"<form section id>\"]` to that action. Callers of `formatRelativeTime` that pass `justNow: true` pass the translated text instead."
28
+ },
29
+ {
30
+ "version": "0.417.0",
31
+ "type": "improvement",
32
+ "title": "Board fixes round 3: header action placement, feed counts, docked columns, label sections",
33
+ "detail": "A projectionDetail action takes `placement: \"menu\"` (same as entityEdit): it goes into the header \"…\" menu instead of a button; without a header menu it stays inline. A feed panel takes `showTotal: true | { text }` (i18n key with `{shown}` and `{total}`, `{total}` is the query's `total`, else the rows returned), shown right in the panel head like a list panel's. `hideWhenDocked` now also applies while the shell reports a docked assistant panel (`--agent-panel-width` above 0), not only in a container narrower than 768px. configEdit `compact` is 940px wide (settings rows split 1:1), and the label of a settings row wraps instead of ending in \"…\". A writeForm section on a record page draws its title as the small uppercase label like the other sections. `photoGrid.badgeFirst` moves badged tiles to the front only below `sm`; from `sm` up the natural order stays. A fields section description sits above the data on a phone and under it from `sm`. An empty first cell of a clickable list row shows its `emptyPlaceholder`. The label-less \"k more\" text under phone dashboard cards is primary. A column with `emphasis` keeps bold foreground text in a muted row (`mutedRowField`) and in a phone card's `cardAbove` line."
34
+ },
35
+ {
36
+ "version": "0.417.0",
37
+ "type": "fix",
38
+ "title": "Board fixes round 8: docked columns, photo tiles, compact save bar, muted titles, record hints",
39
+ "detail": "`hideWhenDocked` also reacts when the shell sets `--agent-panel-width` after the table mounted (an overflowing table keeps its width, so the resize observer alone never fired). Photo tiles are 3:2 on a phone and flat 2:1 from md, cropped with object-cover. The save bar of configEdit `compact` is pinned at the page bottom with a separator line like on a record page; only the form column is capped at 940px. The clickable title of a muted row (`mutedRowField`) follows the muted colour; only a column with `emphasis` stays dark. A writeForm section's `hintField` and field badge fall back to the screen's record values for fields the form does not hold; only form fields are submitted. The content area (`<main>`) of both `DefaultAppShell` and `WorkspaceShell` makes room for a docked assistant panel (`--agent-panel-width`) like for a non-modal drawer, so lists and their row actions no longer sit under the panel; the top bar keeps the full width."
40
+ },
41
+ {
42
+ "version": "0.417.0",
43
+ "type": "fix",
44
+ "title": "Board fixes round 9: tab tables, phone dashboard, document-designer overview",
45
+ "detail": "A relatedList tab's table draws no count footer (hideCountFooter; the tab label already says how many rows there are). The phone stat line of a stat group spreads its items across the line and wraps between them, with the number semibold (as in every StatBoxCell), and a dashboard panel's subtitle and action group may shrink and wrap (on a phone it stacks under the title) instead of widening the page. The document-designer overview caps its slug, used-by and overridden-by cells narrower so the platform overview fits 1280px with the wider board padding. Concealed field values stay muted in the field grid instead of taking the value weight and colour. A text panel keeps an unpaired `**` as literal text instead of bolding the rest of the paragraph."
46
+ },
47
+ {
48
+ "version": "0.417.0",
49
+ "type": "improvement",
50
+ "title": "Text.narrow and Section.hint primitive props",
51
+ "detail": "The primitives contract gains `TextProps.narrow` (phone wording for a text line) and `SectionProps.hint` (`{ text, textNarrow?, testId }`, the muted hint a record section prints under its data, above it on phones). The web primitives render both; custom primitive sets can ignore them and fall back to the wide text."
52
+ },
2
53
  {
3
54
  "version": "0.416.0",
4
55
  "type": "fix",
@@ -327,9 +327,10 @@
327
327
  /* A non-modal side Drawer publishes the width it occupies (widgets/drawer.tsx); the content area
328
328
  narrows by that much instead of sitting underneath. Only <main>: the drawer starts below the
329
329
  header, and the pinned form footer lives inside <main>. No transition: the sheet slides by
330
- transform, its width never animates. */
330
+ transform, its width never animates. The docked assistant panel (Enterprise) publishes
331
+ --agent-panel-width the same way and also starts below the header; a drawer opens over it. */
331
332
  [data-slot="sidebar-inset"] > main {
332
- padding-inline-end: var(--kumiko-drawer-inset-right, 0px);
333
+ padding-inline-end: max(var(--kumiko-drawer-inset-right, 0px), var(--agent-panel-width, 0px));
333
334
  padding-inline-start: var(--kumiko-drawer-inset-left, 0px);
334
335
  }
335
336