@cosmicdrift/kumiko-renderer 0.416.0 → 0.418.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 (191) hide show
  1. package/dist/app/action-form-body.d.ts +1 -4
  2. package/dist/app/action-form-body.js +14 -9
  3. package/dist/app/action-form-preview.d.ts +13 -0
  4. package/dist/app/action-form-preview.js +66 -0
  5. package/dist/app/action-form-support.d.ts +6 -1
  6. package/dist/app/action-form-support.js +26 -9
  7. package/dist/app/config-edit-body.js +71 -79
  8. package/dist/app/entity-list-screen.js +1 -1
  9. package/dist/app/header-actions-bar.d.ts +3 -1
  10. package/dist/app/header-actions-bar.js +12 -4
  11. package/dist/app/list-bulk-actions.d.ts +8 -1
  12. package/dist/app/list-bulk-actions.js +28 -4
  13. package/dist/app/locked-screen-header.d.ts +2 -0
  14. package/dist/app/locked-screen-header.js +8 -1
  15. package/dist/app/projection-detail-body.js +24 -5
  16. package/dist/app/projection-detail-guidance.d.ts +1 -0
  17. package/dist/app/projection-detail-guidance.js +7 -4
  18. package/dist/app/projection-detail-header-model.js +4 -1
  19. package/dist/app/projection-detail-header-region.js +25 -9
  20. package/dist/app/projection-detail-header.d.ts +2 -0
  21. package/dist/app/projection-detail-header.js +30 -3
  22. package/dist/app/projection-list-shim.js +1 -0
  23. package/dist/app/row-actions.d.ts +4 -0
  24. package/dist/app/row-actions.js +19 -3
  25. package/dist/app/use-projection-detail-actions.d.ts +3 -1
  26. package/dist/app/use-projection-detail-actions.js +9 -1
  27. package/dist/app/use-projection-detail-data.js +17 -1
  28. package/dist/app/use-projection-list-data.js +1 -1
  29. package/dist/card-options.d.ts +2 -0
  30. package/dist/components/choice-chip-class.d.ts +1 -0
  31. package/dist/components/choice-chip-class.js +9 -0
  32. package/dist/components/edit-mounts.d.ts +1 -1
  33. package/dist/components/embedded-list-paste.js +2 -2
  34. package/dist/components/grid-cell-for-field.js +1 -1
  35. package/dist/components/multi-select-chips.js +7 -2
  36. package/dist/components/multi-select-count.d.ts +5 -0
  37. package/dist/components/multi-select-count.js +10 -0
  38. package/dist/components/narrow-description.d.ts +3 -0
  39. package/dist/components/narrow-description.js +12 -0
  40. package/dist/components/related-list-section.d.ts +5 -3
  41. package/dist/components/related-list-section.js +9 -4
  42. package/dist/components/related-photo-grid.js +17 -3
  43. package/dist/components/render-edit-field-grid.d.ts +12 -3
  44. package/dist/components/render-edit-field-grid.js +60 -18
  45. package/dist/components/render-edit-fields-section.js +45 -11
  46. package/dist/components/render-edit-header-actions.js +1 -1
  47. package/dist/components/render-edit-layout.js +5 -3
  48. package/dist/components/render-edit-section-kinds.js +50 -12
  49. package/dist/components/render-edit-titles.js +1 -1
  50. package/dist/components/render-edit-types.d.ts +13 -0
  51. package/dist/components/render-field-ai-assist.js +26 -7
  52. package/dist/components/render-field-choice-inputs.js +3 -0
  53. package/dist/components/render-field-control.js +1 -1
  54. package/dist/components/render-field-value-chips.js +6 -4
  55. package/dist/components/render-field-values.js +3 -3
  56. package/dist/components/render-list-hint-columns.d.ts +1 -0
  57. package/dist/components/render-list-hint-columns.js +30 -5
  58. package/dist/components/render-list-reference-columns.js +2 -4
  59. package/dist/components/render-list-row-tone.d.ts +2 -0
  60. package/dist/components/render-list-row-tone.js +6 -0
  61. package/dist/components/render-list-table-props.d.ts +13 -2
  62. package/dist/components/render-list-table-props.js +9 -3
  63. package/dist/components/render-list-types.d.ts +4 -0
  64. package/dist/components/render-list.js +12 -4
  65. package/dist/components/use-render-list-columns.js +3 -3
  66. package/dist/components/write-form-registry.d.ts +13 -0
  67. package/dist/components/write-form-registry.js +6 -0
  68. package/dist/components/write-form-section.d.ts +5 -1
  69. package/dist/components/write-form-section.js +55 -16
  70. package/dist/data-table-bulk-types.d.ts +11 -2
  71. package/dist/data-table-bulk-types.js +3 -1
  72. package/dist/headless/form/form-controller.d.ts +2 -0
  73. package/dist/headless/form/form-controller.js +2 -2
  74. package/dist/headless/format/index.d.ts +1 -1
  75. package/dist/headless/format/index.js +6 -5
  76. package/dist/headless/format/money.d.ts +5 -0
  77. package/dist/headless/format/money.js +10 -0
  78. package/dist/headless/format/relative-time.d.ts +2 -0
  79. package/dist/headless/format/relative-time.js +4 -1
  80. package/dist/headless/index.d.ts +1 -1
  81. package/dist/headless/index.js +1 -1
  82. package/dist/headless/view-model/edit.js +87 -37
  83. package/dist/headless/view-model/list.js +6 -0
  84. package/dist/headless/view-model/types.d.ts +50 -5
  85. package/dist/hooks/use-bulk-run.d.ts +2 -2
  86. package/dist/hooks/use-list-table.js +11 -6
  87. package/dist/i18n-defaults.js +8 -2
  88. package/dist/primitives-record-guidance.d.ts +4 -0
  89. package/dist/primitives-share-types.d.ts +82 -0
  90. package/dist/primitives-share-types.js +1 -0
  91. package/dist/primitives.d.ts +34 -83
  92. package/dist/web/app/bold-markup.d.ts +3 -0
  93. package/dist/web/app/bold-markup.js +14 -0
  94. package/dist/web/app/dashboard-body.js +5 -1
  95. package/dist/web/app/dashboard-list-panel.js +7 -4
  96. package/dist/web/app/dashboard-panels.js +31 -3
  97. package/dist/web/app/dashboard-shared.d.ts +3 -1
  98. package/dist/web/app/dashboard-shared.js +3 -3
  99. package/dist/web/app/dashboard-stat-group-panel.d.ts +1 -1
  100. package/dist/web/app/dashboard-stat-group-panel.js +16 -2
  101. package/dist/web/app/dashboard-text-panel.js +11 -6
  102. package/dist/web/app/relative-time.js +10 -1
  103. package/dist/web/components/config-cascade.d.ts +2 -1
  104. package/dist/web/components/config-cascade.js +16 -4
  105. package/dist/web/drawn-icons.js +2 -1
  106. package/dist/web/layout/header-action-pinned.d.ts +4 -2
  107. package/dist/web/layout/header-action-pinned.js +13 -4
  108. package/dist/web/layout/header-overflow-menu.d.ts +2 -0
  109. package/dist/web/layout/header-overflow-menu.js +2 -0
  110. package/dist/web/layout/nav-tree.js +1 -1
  111. package/dist/web/layout/notification-bell.js +13 -4
  112. package/dist/web/layout/page-header-slot.d.ts +2 -0
  113. package/dist/web/layout/page-header-slot.js +4 -0
  114. package/dist/web/layout/screen-focus.js +4 -1
  115. package/dist/web/layout/shell-header.js +15 -7
  116. package/dist/web/primitives/banner.js +14 -3
  117. package/dist/web/primitives/card.js +5 -3
  118. package/dist/web/primitives/combobox.js +2 -2
  119. package/dist/web/primitives/data-table/actions-column.js +1 -1
  120. package/dist/web/primitives/data-table/card-body.d.ts +1 -1
  121. package/dist/web/primitives/data-table/card-body.js +37 -14
  122. package/dist/web/primitives/data-table/card-frame.d.ts +2 -0
  123. package/dist/web/primitives/data-table/card-frame.js +3 -0
  124. package/dist/web/primitives/data-table/card-row.js +28 -9
  125. package/dist/web/primitives/data-table/card-sort-select.js +1 -1
  126. package/dist/web/primitives/data-table/card-view.js +1 -1
  127. package/dist/web/primitives/data-table/data-cell-props.d.ts +2 -1
  128. package/dist/web/primitives/data-table/data-cell-props.js +1 -0
  129. package/dist/web/primitives/data-table/density.d.ts +3 -1
  130. package/dist/web/primitives/data-table/density.js +11 -4
  131. package/dist/web/primitives/data-table/row-render-parts.d.ts +1 -1
  132. package/dist/web/primitives/data-table/row-render-parts.js +3 -5
  133. package/dist/web/primitives/data-table/sort-options-select.js +2 -2
  134. package/dist/web/primitives/data-table/sortable-header.js +4 -4
  135. package/dist/web/primitives/data-table/table-body.js +2 -1
  136. package/dist/web/primitives/data-table/table-chrome.js +1 -3
  137. package/dist/web/primitives/data-table/table-content.js +7 -11
  138. package/dist/web/primitives/data-table/table-data-cell.js +31 -17
  139. package/dist/web/primitives/data-table/table-header-row.js +1 -1
  140. package/dist/web/primitives/data-table/table-view.js +1 -1
  141. package/dist/web/primitives/data-table/toolbar.js +6 -7
  142. package/dist/web/primitives/data-table/use-bulk-selection.d.ts +1 -1
  143. package/dist/web/primitives/data-table/use-bulk-selection.js +5 -0
  144. package/dist/web/primitives/data-table/use-data-table-state.d.ts +6 -1
  145. package/dist/web/primitives/data-table/use-data-table-state.js +12 -2
  146. package/dist/web/primitives/data-table-cell.d.ts +13 -2
  147. package/dist/web/primitives/data-table-cell.js +125 -53
  148. package/dist/web/primitives/data-table.js +1 -1
  149. package/dist/web/primitives/default-form.d.ts +1 -1
  150. package/dist/web/primitives/default-form.js +11 -10
  151. package/dist/web/primitives/drawer.js +2 -7
  152. package/dist/web/primitives/facet-filter.d.ts +1 -1
  153. package/dist/web/primitives/facet-filter.js +2 -5
  154. package/dist/web/primitives/facet-search-filter.js +1 -1
  155. package/dist/web/primitives/facet-trigger-label.d.ts +1 -4
  156. package/dist/web/primitives/facet-trigger-label.js +4 -7
  157. package/dist/web/primitives/field.js +15 -8
  158. package/dist/web/primitives/form-footer-parts.js +2 -2
  159. package/dist/web/primitives/inline-suffix.d.ts +2 -0
  160. package/dist/web/primitives/inline-suffix.js +5 -0
  161. package/dist/web/primitives/input-choice-kinds.js +12 -2
  162. package/dist/web/primitives/input-number-kinds.js +2 -2
  163. package/dist/web/primitives/input-text-kinds.js +1 -1
  164. package/dist/web/primitives/layout-elements.d.ts +4 -4
  165. package/dist/web/primitives/layout-elements.js +49 -12
  166. package/dist/web/primitives/layout.d.ts +1 -1
  167. package/dist/web/primitives/layout.js +1 -1
  168. package/dist/web/primitives/metric.js +4 -5
  169. package/dist/web/primitives/money-input.js +8 -7
  170. package/dist/web/primitives/number-input.d.ts +2 -1
  171. package/dist/web/primitives/number-input.js +9 -4
  172. package/dist/web/primitives/page-header.d.ts +1 -1
  173. package/dist/web/primitives/page-header.js +8 -1
  174. package/dist/web/primitives/pager.js +12 -21
  175. package/dist/web/primitives/photo-grid.js +2 -1
  176. package/dist/web/primitives/record-steps.d.ts +1 -1
  177. package/dist/web/primitives/record-steps.js +6 -15
  178. package/dist/web/primitives/row-actions.js +38 -24
  179. package/dist/web/primitives/use-container-narrow.d.ts +12 -0
  180. package/dist/web/primitives/use-container-narrow.js +42 -0
  181. package/dist/web/pwa/pwa-support.js +13 -7
  182. package/dist/web/ui/input.js +1 -1
  183. package/dist/web/ui/textarea.js +1 -1
  184. package/dist/web/widgets/dashboard-list-cards.js +6 -3
  185. package/dist/web/widgets/dashboard-list.d.ts +4 -1
  186. package/dist/web/widgets/dashboard-list.js +10 -5
  187. package/dist/web/widgets/progress-list.js +1 -1
  188. package/dist/web/widgets/stat-box-cell.js +1 -1
  189. package/package.json +5 -5
  190. package/src/changes.json +51 -0
  191. package/src/web/styles.css +3 -2
@@ -8,6 +8,7 @@ const ICON_COLOR_CLASS = {
8
8
  hint: "text-primary",
9
9
  info: "text-primary",
10
10
  primary: "text-primary",
11
+ assist: "text-primary",
11
12
  ok: "text-status-ok",
12
13
  warning: "text-status-warn",
13
14
  error: "text-destructive",
@@ -23,6 +24,8 @@ function variantClass(variant, compact) {
23
24
  return "border-status-ok/30 bg-status-ok-surface text-foreground";
24
25
  case "primary":
25
26
  return "border-l-4 border-l-primary bg-card text-card-foreground";
27
+ case "assist":
28
+ return "rounded-[9px] border-transparent border-l-[3px] border-l-primary bg-secondary px-3 py-2.5 text-primary font-medium";
26
29
  case "hint":
27
30
  return compact
28
31
  ? "border-border bg-card text-foreground"
@@ -47,11 +50,19 @@ function BannerText({ compact, title: fullTitle, narrowTitle, narrowText, titleT
47
50
  const title = narrow && narrowTitle !== undefined ? narrowTitle : fullTitle;
48
51
  const showsNarrowText = narrow && narrowText !== undefined;
49
52
  const children = showsNarrowText ? narrowText : fullText;
50
- if (compact || inline) {
51
- return (_jsxs("div", { className: cn("min-w-0 grow", wrapsActions && "max-sm:min-w-[10rem] max-sm:basis-0"), children: [title !== undefined && (_jsxs(_Fragment, { children: [_jsx("strong", { "data-testid": titleTestId, className: "font-semibold", children: title }), " "] })), _jsxs("span", { className: cn(inline && !showsNarrowText && "max-sm:hidden"), children: [children, !showsNarrowText && _jsx(BannerParts, { parts: parts })] })] }));
52
- }
53
+ const text = { title, children, showsNarrowText, titleTestId, parts, wrapsActions };
54
+ if (inline && !compact && title !== undefined)
55
+ return _jsx(InlineTitledBannerText, { ...text });
56
+ if (compact || inline)
57
+ return _jsx(CompactBannerText, { inline: inline, ...text });
53
58
  return (_jsxs("div", { className: "min-w-0 flex-1", children: [title !== undefined && (_jsx("div", { "data-testid": titleTestId, className: "font-semibold", children: title })), children, !showsNarrowText && _jsx(BannerParts, { parts: parts }), actionsBelow] }));
54
59
  }
60
+ function InlineTitledBannerText({ title, children, showsNarrowText, titleTestId, parts, wrapsActions, }) {
61
+ return (_jsxs("div", { className: cn("min-w-0 grow", wrapsActions && "max-sm:min-w-[10rem] max-sm:basis-0"), children: [_jsx("div", { "data-testid": titleTestId, className: cn("text-xs text-muted-foreground", !showsNarrowText && "max-sm:text-sm max-sm:font-semibold max-sm:text-foreground"), children: title }), _jsxs("div", { className: cn(!showsNarrowText && "max-sm:hidden"), children: [children, !showsNarrowText && _jsx(BannerParts, { parts: parts })] })] }));
62
+ }
63
+ function CompactBannerText({ inline, title, children, showsNarrowText, titleTestId, parts, wrapsActions, }) {
64
+ return (_jsxs("div", { className: cn("min-w-0 grow", wrapsActions && "max-sm:min-w-[10rem] max-sm:basis-0"), children: [title !== undefined && (_jsxs(_Fragment, { children: [_jsx("strong", { "data-testid": titleTestId, className: "font-semibold", children: title }), " "] })), _jsxs("span", { className: cn(inline && !showsNarrowText && "max-sm:hidden"), children: [children, !showsNarrowText && _jsx(BannerParts, { parts: parts })] })] }));
65
+ }
55
66
  function bannerLayoutClass(variant, compact, actionsBelow, wrapsActions) {
56
67
  return cn("relative flex w-full items-center border", compact ? "gap-2 rounded-md px-2.5 py-2 text-[13px]" : "gap-3 rounded-lg px-3.5 py-2.5 text-sm",
57
68
  // Viewport breakpoint like the form footer bar; actions drop below the text on phones.
@@ -11,12 +11,14 @@ function cardBodyPadding(inline, hasHeader) {
11
11
  ? "px-[var(--card-padding)] pb-[var(--card-padding)]"
12
12
  : "p-[var(--card-padding)]";
13
13
  }
14
- function CardTitleRow({ slots, inline, }) {
14
+ function CardTitleRow({ slots, inline, labelTitle, }) {
15
15
  const { title, subtitle, headerActions } = slots;
16
16
  if (inline) {
17
17
  return (_jsxs("div", { className: "flex flex-wrap items-baseline gap-x-2.5 gap-y-1", children: [title !== undefined && _jsx("h3", { className: "m-0 text-sm font-semibold", children: title }), subtitle !== undefined && (_jsx("div", { className: "text-[12.5px] text-muted-foreground", children: subtitle })), headerActions !== undefined && _jsx("div", { className: "ml-auto", children: headerActions })] }));
18
18
  }
19
- return (_jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [title !== undefined && (_jsx("h3", { className: "text-base font-semibold leading-none tracking-tight", children: title })), subtitle !== undefined && _jsx("div", { className: "text-sm text-muted-foreground", children: subtitle })] }), headerActions] }));
19
+ return (_jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [title !== undefined && (_jsx("h3", { className: labelTitle
20
+ ? "text-[12.5px] font-semibold uppercase leading-none tracking-[0.06em] text-muted-foreground"
21
+ : "text-base font-semibold leading-none tracking-tight", children: title })), subtitle !== undefined && _jsx("div", { className: "text-sm text-muted-foreground", children: subtitle })] }), headerActions] }));
20
22
  }
21
23
  // Generic card chrome (rounded-xl like the entity card), slot- and
22
24
  // options-based so the contract grows additively and consumers never have
@@ -32,7 +34,7 @@ export function DefaultCard({ slots, options, className, testId, dataAttributes,
32
34
  const s = slots ?? {};
33
35
  const inlineHeader = options?.headerLayout === "inline";
34
36
  const hasTitleRow = s.title !== undefined || s.subtitle !== undefined || s.headerActions !== undefined;
35
- const defaultHeader = hasTitleRow || s.headerContent !== undefined ? (_jsxs("div", { className: cn("flex flex-col gap-3", inlineHeader ? "px-4 pt-3.5" : "px-[var(--card-padding)] pt-6 pb-4", fillHeight && "shrink-0"), children: [hasTitleRow && _jsx(CardTitleRow, { slots: s, inline: inlineHeader }), s.headerContent] })) : null;
37
+ const defaultHeader = hasTitleRow || s.headerContent !== undefined ? (_jsxs("div", { className: cn("flex flex-col gap-3", inlineHeader ? "px-4 pt-3.5" : "px-[var(--card-padding)] pt-6 pb-4", fillHeight && "shrink-0"), children: [hasTitleRow && (_jsx(CardTitleRow, { slots: s, inline: inlineHeader, labelTitle: options?.titleStyle === "label" })), s.headerContent] })) : null;
36
38
  const header = s.header ?? defaultHeader;
37
39
  const hasHeader = header !== null && header !== undefined;
38
40
  const card = (_jsxs("div", { ...dataAttributes, "data-slot": "card", "data-testid": testId, className: cn(framed ? cardSurface({ radius }) : "flex flex-col",
@@ -19,8 +19,8 @@ import { useEffect, useState } from "react";
19
19
  import { REFERENCE_SEARCH_DEBOUNCE_MS, useTranslation } from "../../index.js";
20
20
  import { cn } from "../lib/cn.js";
21
21
  import { groupOptions } from "./option-groups.js";
22
- const triggerClass = "flex h-9 w-full min-w-0 items-center justify-between gap-2 " +
23
- "rounded-md border border-input text-left max-md:min-h-11 " +
22
+ const triggerClass = "flex h-[38px] w-full min-w-0 items-center justify-between gap-2 " +
23
+ "rounded-[7px] border-[1.5px] border-input text-left max-md:min-h-11 " +
24
24
  "bg-transparent px-3 py-1 text-sm shadow-sm transition-colors " +
25
25
  "placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 " +
26
26
  "focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";
@@ -19,7 +19,7 @@ export function ActionsHeaderCell({ label, style, absorbsLeftover, }) {
19
19
  // preceding data column instead of the (already narrow)
20
20
  // page edge. No border-l: a permanent divider looks heavy;
21
21
  // the sticky bg already sets the column apart during scroll.
22
- className: "w-px text-right text-muted-foreground md:sticky md:right-0 md:z-10 md:bg-muted", "aria-label": label, style: absorbsLeftover ? { ...style, width: "auto" } : style }));
22
+ className: "w-px text-right text-muted-foreground md:sticky md:right-0 md:z-10 md:bg-background", "aria-label": label, style: absorbsLeftover ? { ...style, width: "auto" } : style }));
23
23
  }
24
24
  export function ActionsBodyCell({ testId, fillsHeight, measureContent, children, }) {
25
25
  return (_jsx(TableCell, { "data-testid": testId,
@@ -1,5 +1,5 @@
1
1
  import { type cardColumnRoles } from "@cosmicdrift/kumiko-framework/ui-types";
2
- import type { ReactNode } from "react";
2
+ import { type ReactNode } from "react";
3
3
  import type { ListColumnViewModel, ListRowViewModel } from "../../../headless/index.ts";
4
4
  import type { DataTableModel } from "./use-data-table-state.ts";
5
5
  export type CardRoles = ReturnType<typeof cardColumnRoles<ListColumnViewModel>>;
@@ -1,7 +1,9 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cardMetaLines } from "@cosmicdrift/kumiko-framework/ui-types";
3
- import { ChevronRight } from "lucide-react";
4
- import { cellLinkProp, DataTableCell, isBadgeColumn, isEmptyCellValue, isUnlabeledFalse, showsBareCheckMark, } from "../data-table-cell.js";
3
+ import { Sparkles } from "lucide-react";
4
+ import { Fragment } from "react";
5
+ import { cn } from "../../lib/cn.js";
6
+ import { CellPill, cellLinkProp, DataTableCell, isBadgeColumn, isEmptyCellValue, isUnlabeledFalse, showsBareCheckMark, } from "../data-table-cell.js";
5
7
  import { CardLeadingImage } from "../file-thumbnail.js";
6
8
  import { columnCellPresentationProps } from "./data-cell-props.js";
7
9
  import { showFullTextOnHover } from "./table-footer.js";
@@ -11,17 +13,22 @@ function cardHint(hint) {
11
13
  const detailField = narrowDetailField ?? _detail;
12
14
  return { ...rest, ...(detailField !== undefined && { detailField }) };
13
15
  }
14
- function cardCell(m, row, col, { linksAllowed } = { linksAllowed: false }) {
16
+ function withoutPill(col) {
17
+ const { pillField: _pill, pillToneField: _pillTone, ...rest } = col;
18
+ return rest;
19
+ }
20
+ function cardCell(m, row, col, { linksAllowed, omitPill } = {
21
+ linksAllowed: false,
22
+ }) {
15
23
  const { onCellChange } = m;
16
24
  const opensRow = m.rowOpener(row) !== undefined;
17
25
  // A bare check mark in the subtitle line says nothing without its column.
18
26
  if (showsBareCheckMark(col.type, row.values[col.field], col.renderer))
19
27
  return col.label;
20
28
  const shortSentence = col.hint?.narrowField === undefined ? undefined : row.values[col.hint.narrowField];
21
- return (_jsx(DataTableCell, { value: isEmptyCellValue(shortSentence) ? row.values[col.field] : shortSentence, row: row.values, field: col.field, type: col.type, renderer: col.renderer, translate: m.tableTranslate, locale: m.tableLocale, ...columnCellPresentationProps(col), ...(col.hint !== undefined && { hint: cardHint(col.hint) }), ...(col.fileDisplay !== undefined && { fileDisplay: col.fileDisplay, compactFile: true }), ...(onCellChange !== undefined && {
29
+ return (_jsx(DataTableCell, { value: isEmptyCellValue(shortSentence) ? row.values[col.field] : shortSentence, row: row.values, field: col.field, type: col.type, renderer: col.renderer, translate: m.tableTranslate, locale: m.tableLocale, ...columnCellPresentationProps(omitPill === true ? withoutPill(col) : col), ...(col.hint !== undefined && { hint: cardHint(col.hint) }), ...(col.fileDisplay !== undefined && { fileDisplay: col.fileDisplay, compactFile: true }), ...(onCellChange !== undefined && {
22
30
  onChange: (value) => onCellChange(row.id, col.field, value),
23
- }), ...(col.rowActionLink === true &&
24
- col.display === undefined && { display: "button" }), ...cellLinkProp(col, row, linksAllowed || !opensRow) }));
31
+ }), ...cellLinkProp(col, row, linksAllowed || !opensRow) }));
25
32
  }
26
33
  function cellTestIdOf(m, row, field) {
27
34
  return m.getCellTestId?.(row, field) ?? `cell-${row.id}-${field}`;
@@ -53,27 +60,43 @@ export function splitLinkColumns(m, row, roles) {
53
60
  };
54
61
  }
55
62
  export function renderCardLinks(m, row, linkColumns) {
56
- return (_jsx("div", { "data-testid": `card-links-${row.id}`, className: "flex flex-wrap items-center gap-x-3 text-[13px] leading-5", children: linkColumns.map((col) => (_jsx("span", { "data-testid": cellTestIdOf(m, row, col.field), children: cardCell(m, row, col, { linksAllowed: true }) }, col.field))) }));
63
+ return (_jsx("div", { "data-testid": `card-links-${row.id}`, className: "flex flex-wrap items-center gap-x-3 text-[13px] font-medium leading-5 text-primary", children: linkColumns.map((col) => (_jsx("span", { "data-testid": cellTestIdOf(m, row, col.field), children: cardCell(m, row, col, { linksAllowed: true }) }, col.field))) }));
57
64
  }
58
65
  function renderMetaCell(m, row, col) {
59
- return (_jsx("div", { "data-testid": cellTestIdOf(m, row, col.field), className: "min-w-0 max-w-full truncate leading-5", onPointerEnter: showFullTextOnHover, children: isBadgeColumn(col) ? (_jsx("span", { className: "inline-flex align-middle", children: cardCell(m, row, col) })) : (cardCell(m, row, col)) }, col.field));
66
+ return (_jsx("div", { "data-testid": cellTestIdOf(m, row, col.field), className: `min-w-0 max-w-full leading-5 ${col.ellipsis === true ? "truncate" : "break-words"}${col.multiline === true ? " whitespace-pre-line" : ""}${col.emphasis === true ? " font-semibold text-foreground" : ""}`, onPointerEnter: showFullTextOnHover, children: isBadgeColumn(col) ? (_jsx("span", { className: "inline-flex align-middle", children: cardCell(m, row, col) })) : (cardCell(m, row, col)) }, col.field));
60
67
  }
61
- function renderCardMeta(m, row, metaColumns) {
62
- return (_jsx("div", { className: "min-w-0", children: _jsx("div", { "data-testid": `card-meta-${row.id}`, className: "flex min-w-0 flex-col text-[13px] leading-5 tabular-nums text-foreground-secondary", children: cardMetaLines(metaColumns).map((line) => line[0]?.narrowInline === true ? (_jsx("div", { "data-testid": `card-vals-${row.id}-${line[0].field}`, className: "mt-1 flex min-w-0 max-w-full flex-wrap items-center gap-x-3 gap-y-0.5 text-[12.5px] leading-5", children: line.map((col) => renderMetaCell(m, row, col)) }, line.map((col) => col.field).join("|"))) : (_jsx("div", { className: "flex h-5 min-w-0 max-w-full items-center", children: line.map((col) => renderMetaCell(m, row, col)) }, line.map((col) => col.field).join("|")))) }) }));
68
+ function renderCardMeta(m, row, metaColumns, placement = "below") {
69
+ const plain = m.plainPhoneCards === true;
70
+ const lines = cardMetaLines(metaColumns);
71
+ return (_jsx("div", { className: "min-w-0", children: _jsx("div", { "data-testid": placement === "above" ? `card-above-${row.id}` : `card-meta-${row.id}`, className: `flex min-w-0 flex-col text-[12.5px] leading-5 tabular-nums text-muted-foreground`, children: lines.map((line, lineIndex) => line[0]?.narrowInline === true ? (_jsx("div", { "data-testid": `card-vals-${row.id}-${line[0].field}`, className: cn("mt-1 flex min-w-0 max-w-full flex-wrap items-center gap-y-0.5 text-[12.5px] leading-5", plain ? "gap-x-0" : "gap-x-3"), children: line.map((col, colIndex) => (_jsxs(Fragment, { children: [plain && colIndex > 0 && _jsx("span", { "aria-hidden": "true", children: ",\u00A0" }), renderMetaCell(m, row, col)] }, col.field))) }, line.map((col) => col.field).join("|"))) : (_jsx("div", { className: cn("flex min-h-5 min-w-0 max-w-full items-center", plain &&
72
+ placement === "below" &&
73
+ lineIndex === lines.length - 1 &&
74
+ "text-foreground"), children: line.map((col) => renderMetaCell(m, row, col)) }, line.map((col) => col.field).join("|")))) }) }));
63
75
  }
76
+ // Header line of the card: the "to do" sentence (primary with a sparkle when the column is `emphasis`)
77
+ // on the left, the column's extra pill on the right.
64
78
  function renderCardLead(m, row, lead) {
65
79
  if (lead === undefined || isEmptyCellValue(row.values[lead.field]))
66
80
  return null;
67
- return (_jsx("div", { "data-testid": cellTestIdOf(m, row, lead.field), className: "min-w-0 text-xs font-medium leading-5", children: cardCell(m, row, lead) }));
81
+ const emphasized = lead.emphasis === true;
82
+ const pill = (_jsx(CellPill, { row: row.values, pillField: lead.pillField, pillToneField: lead.pillToneField }));
83
+ return (_jsxs("div", { className: "flex min-w-0 items-center justify-between gap-2", children: [_jsxs("div", { "data-testid": cellTestIdOf(m, row, lead.field), className: `flex min-w-0 items-start gap-1.5 text-xs leading-5 ${emphasized ? "font-medium text-primary [&_span]:text-primary" : "font-medium text-muted-foreground"}`, children: [emphasized && _jsx(Sparkles, { className: "mt-0.5 size-3.5 shrink-0", "aria-hidden": "true" }), cardCell(m, row, lead, { linksAllowed: false, omitPill: true })] }), pill !== null && _jsx("span", { className: "shrink-0", children: pill })] }));
84
+ }
85
+ const OUTLINED_NEUTRAL_PILL_CLASS = "[&_span]:border [&_span]:border-border-strong [&_span]:bg-transparent [&_span]:text-muted-foreground";
86
+ function renderCardStatus(m, row, status) {
87
+ const cell = cardCell(m, row, status);
88
+ return (_jsx("span", { "data-testid": cellTestIdOf(m, row, status.field), className: "shrink-0", children: status.cardBadge === true ? (isBadgeColumn(status) ? (_jsx("span", { className: `inline-flex ${OUTLINED_NEUTRAL_PILL_CLASS}`, children: cell })) : (_jsx("span", { className: "inline-flex rounded-full border border-border-strong px-2 py-0.5 text-xs text-muted-foreground", children: cell }))) : (cell) }));
68
89
  }
69
90
  function renderCardHeading(m, row, roles) {
70
91
  const { title: cardTitleColumn, status: cardStatusColumn } = roles;
71
92
  const showStatus = cardStatusColumn !== undefined && !isEmptyCellValue(row.values[cardStatusColumn.field]);
72
- return (_jsxs("div", { className: "flex min-w-0 items-start justify-between gap-2", children: [cardTitleColumn !== undefined && (_jsx("span", { "data-testid": cellTestIdOf(m, row, cardTitleColumn.field), className: "min-w-0 truncate text-[14.5px] font-semibold text-foreground", onPointerEnter: showFullTextOnHover, children: cardCell(m, row, cardTitleColumn) })), showStatus && (_jsx("span", { "data-testid": cellTestIdOf(m, row, cardStatusColumn.field), className: "shrink-0", children: cardCell(m, row, cardStatusColumn) }))] }));
93
+ return (_jsxs("div", { className: "flex min-w-0 items-start justify-between gap-2", children: [cardTitleColumn !== undefined && (_jsx("span", { "data-testid": cellTestIdOf(m, row, cardTitleColumn.field), className: "min-w-0 truncate text-[14.5px] font-semibold text-foreground", onPointerEnter: showFullTextOnHover, children: cardCell(m, row, cardTitleColumn) })), showStatus && renderCardStatus(m, row, cardStatusColumn)] }));
73
94
  }
74
95
  export function renderCardBody(m, row, roles) {
75
96
  const { image: cardImageColumn, meta: cardMetaColumns } = roles;
76
- const metaColumns = cardMetaColumns.filter((col) => !isEmptyCellValue(row.values[col.field]) &&
97
+ const shownMeta = cardMetaColumns.filter((col) => !isEmptyCellValue(row.values[col.field]) &&
77
98
  !isUnlabeledFalse(col.type, row.values[col.field], col.renderer));
78
- return (_jsxs(_Fragment, { children: [cardImageColumn?.fileDisplay !== undefined && (_jsx("div", { "data-testid": `card-image-${row.id}`, className: "shrink-0", children: _jsx(CardLeadingImage, { value: row.values[cardImageColumn.field], display: cardImageColumn.fileDisplay }) })), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [renderCardLead(m, row, roles.lead), renderCardHeading(m, row, roles), metaColumns.length > 0 && renderCardMeta(m, row, metaColumns)] }), m.rowOpener(row) !== undefined && (_jsx(ChevronRight, { className: "size-4 shrink-0 text-border-strong", "aria-hidden": "true" }))] }));
99
+ const aboveColumns = shownMeta.filter((col) => col.cardAbove === true);
100
+ const metaColumns = shownMeta.filter((col) => col.cardAbove !== true);
101
+ return (_jsxs(_Fragment, { children: [cardImageColumn?.fileDisplay !== undefined && (_jsx("div", { "data-testid": `card-image-${row.id}`, className: "shrink-0", children: _jsx(CardLeadingImage, { value: row.values[cardImageColumn.field], display: cardImageColumn.fileDisplay }) })), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [renderCardLead(m, row, roles.lead), aboveColumns.length > 0 && renderCardMeta(m, row, aboveColumns, "above"), renderCardHeading(m, row, roles), metaColumns.length > 0 && renderCardMeta(m, row, metaColumns)] })] }));
79
102
  }
@@ -5,4 +5,6 @@ export declare function isInsideCardFrame(m: FrameInput): boolean;
5
5
  /** `frame: "card"` below sm: every card of the card layout is bordered and rounded, with a gap. */
6
6
  export declare function hasSeparateCardRows(m: FrameInput): boolean;
7
7
  export declare const CARD_SURFACE_CLASS = "rounded-lg border border-border bg-card";
8
+ export declare const ASSISTANT_FOCUS_CARD_CLASS = "bg-primary/10 shadow-[inset_3px_0_0_var(--color-primary)]";
9
+ export declare const ASSISTANT_FOCUS_ROW_CLASS = "bg-primary/10 hover:bg-primary/10 [&>td:first-child]:shadow-[inset_3px_0_0_var(--color-primary)]";
8
10
  export {};
@@ -7,3 +7,6 @@ export function hasSeparateCardRows(m) {
7
7
  return m.frame === "card" && m.belowSm;
8
8
  }
9
9
  export const CARD_SURFACE_CLASS = "rounded-lg border border-border bg-card";
10
+ // The row the assistant sees: light primary wash plus a 3px primary bar on the left edge.
11
+ export const ASSISTANT_FOCUS_CARD_CLASS = "bg-primary/10 shadow-[inset_3px_0_0_var(--color-primary)]";
12
+ export const ASSISTANT_FOCUS_ROW_CLASS = "bg-primary/10 hover:bg-primary/10 [&>td:first-child]:shadow-[inset_3px_0_0_var(--color-primary)]";
@@ -1,10 +1,10 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Fragment } from "react";
3
3
  import { cn } from "../../lib/cn.js";
4
4
  import { cardToneClass } from "../data-table-cell.js";
5
5
  import { RowActionsCell } from "../row-actions.js";
6
6
  import { renderCardBody, renderCardLinks, splitLinkColumns } from "./card-body.js";
7
- import { CARD_SURFACE_CLASS, hasSeparateCardRows } from "./card-frame.js";
7
+ import { ASSISTANT_FOCUS_CARD_CLASS, CARD_SURFACE_CLASS, hasSeparateCardRows, } from "./card-frame.js";
8
8
  import { rowClickHandler } from "./row-click-guard.js";
9
9
  import { renderExpandToggle, renderExpansion } from "./row-render-parts.js";
10
10
  // The card's <li> opens the row on click; controls inside must not reach it.
@@ -27,8 +27,17 @@ function renderCardOpenButton(openRow, body) {
27
27
  openRow();
28
28
  }, children: body }));
29
29
  }
30
- function renderCardButtons(m, row, buttonActions) {
31
- return renderStopPropagation("flex justify-start", `row-${row.id}-card-buttons`, _jsx(RowActionsCell, { row: row, actions: buttonActions, mode: m.rowActionMode, compact: true, small: true }));
30
+ const CARD_BUTTON_DISPLAYS = new Set([
31
+ "button",
32
+ "link",
33
+ "text",
34
+ "responsive",
35
+ ]);
36
+ // The footer line: the AI chip (a `responsive` action) on the left, the other actions and link columns on the right.
37
+ function renderCardFooter(m, row, buttonActions, links) {
38
+ const aiActions = buttonActions.filter((a) => a.display === "responsive");
39
+ const otherActions = buttonActions.filter((a) => a.display !== "responsive");
40
+ return renderStopPropagation("flex items-center justify-between gap-3", `row-${row.id}-card-buttons`, _jsxs(_Fragment, { children: [aiActions.length > 0 && (_jsx(RowActionsCell, { row: row, actions: aiActions, mode: m.rowActionMode, compact: true, small: true })), _jsxs("div", { className: cn("flex items-center gap-3", aiActions.length > 0 && "ml-auto"), children: [links, otherActions.length > 0 && (_jsx(RowActionsCell, { row: row, actions: otherActions, mode: m.rowActionMode, compact: true, small: true }))] })] }));
32
41
  }
33
42
  function cardLeftPadding(compact) {
34
43
  return compact ? "pl-2" : "pl-4";
@@ -45,26 +54,36 @@ function splitCardActions(m, row, opensRow) {
45
54
  const cardActions = menuMode && opensRow ? [] : (m.menuActions ?? []);
46
55
  return {
47
56
  buttonActions: cardActions.filter((a) => !menuMode &&
48
- (a.display === "button" || a.display === "link") &&
57
+ (a.display === "button" ||
58
+ a.display === "link" ||
59
+ a.display === "text" ||
60
+ a.display === "responsive") &&
49
61
  (a.isVisible === undefined || a.isVisible(row))),
50
- menuActions: cardActions.filter((a) => menuMode || (a.display !== "button" && a.display !== "link")),
62
+ menuActions: cardActions.filter((a) => menuMode || !CARD_BUTTON_DISPLAYS.has(a.display)),
51
63
  };
52
64
  }
65
+ function renderCardContent(m, row, main, buttonActions, linkColumns) {
66
+ const hasButtons = buttonActions.length > 0;
67
+ if (linkColumns.length === 0 && !hasButtons)
68
+ return main;
69
+ return (_jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [main, hasButtons
70
+ ? renderCardFooter(m, row, buttonActions, linkColumns.length > 0 ? renderCardLinks(m, row, linkColumns) : null)
71
+ : renderCardLinks(m, row, linkColumns)] }));
72
+ }
53
73
  export function renderCard(m, row, roles) {
54
74
  const { rowTone } = m;
55
75
  const openRow = m.rowOpener(row);
56
76
  const { buttonActions, menuActions } = splitCardActions(m, row, openRow !== undefined);
57
77
  const hasMenu = menuActions.length > 0;
58
- const hasButtons = buttonActions.length > 0;
59
78
  const { bodyRoles, linkColumns } = splitLinkColumns(m, row, roles);
60
79
  const body = renderCardBody(m, row, bodyRoles);
61
80
  const main = openRow !== undefined ? renderCardOpenButton(openRow, body) : body;
62
81
  // In a list with row tones every card carries a stripe (neutral = grey) so the cards align.
63
82
  const toneClass = cardToneClass(rowTone === undefined ? undefined : (rowTone(row) ?? "neutral"));
64
83
  const toned = toneClass !== "";
65
- const rowItem = (_jsxs("li", { "data-testid": m.rowTestId(row), "data-tone": rowTone?.(row), className: cn(cardRowBaseClass(m), toneClass,
84
+ const rowItem = (_jsxs("li", { "data-testid": m.rowTestId(row), "data-tone": rowTone?.(row), className: cn(cardRowBaseClass(m), toneClass, m.focusedRowId === row.id && ASSISTANT_FOCUS_CARD_CLASS,
66
85
  // A toned card already pads past its inner 4px stripe (see cardToneClass); a later pl-* would override it.
67
- !toned && cardLeftPadding(m.expansion !== undefined || m.selection.active), hasMenu ? "pr-2" : "pr-4", m.density.card), ...(openRow !== undefined && { onClick: rowClickHandler(openRow) }), children: [m.selection.cardCheckbox(row), renderExpandToggle(m, row), linkColumns.length > 0 || hasButtons ? (_jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [main, linkColumns.length > 0 && renderCardLinks(m, row, linkColumns), hasButtons && renderCardButtons(m, row, buttonActions)] })) : (main), hasMenu && renderCardMenu(m, row, menuActions)] }, row.id));
86
+ !toned && cardLeftPadding(m.expansion !== undefined || m.selection.active), hasMenu ? "pr-2" : "pr-4", m.density.card), ...(openRow !== undefined && { onClick: rowClickHandler(openRow) }), children: [m.selection.cardCheckbox(row), renderExpandToggle(m, row), renderCardContent(m, row, main, buttonActions, linkColumns), hasMenu && renderCardMenu(m, row, menuActions)] }, row.id));
68
87
  if (m.expansion === undefined)
69
88
  return rowItem;
70
89
  // The expansion is a sibling <li>, outside the row's click target, so
@@ -29,7 +29,7 @@ function ColumnSortSelect({ columns, sort, onSortChange, testId }) {
29
29
  // option for it the select would claim "Unsorted" while the list is sorted.
30
30
  const currentSortValue = sort !== undefined && sort !== null ? `${sort.field}:${sort.dir}` : "";
31
31
  const currentSortIsUnlisted = sort !== undefined && sort !== null && !sortOptions.some((o) => o.value === currentSortValue);
32
- return (_jsxs("div", { className: "relative flex h-9 items-center gap-1.5 px-4 text-[13px] text-foreground-secondary", children: [_jsx("span", { "aria-hidden": "true", children: sortLabel }), sort !== undefined && sort !== null && _jsx(SortArrow, { className: "size-3.5", "aria-hidden": "true" }), _jsxs("select", { "aria-label": translate?.("kumiko.list.sort.label") ?? "Sort", "data-testid": testId !== undefined ? `${testId}-sort` : "render-list-sort", value: currentSortValue, onChange: (e) => {
32
+ return (_jsxs("div", { className: "relative flex h-[37px] items-center gap-1.5 px-4 text-[13px] text-foreground-secondary", children: [_jsx("span", { "aria-hidden": "true", children: sortLabel }), sort !== undefined && sort !== null && _jsx(SortArrow, { className: "size-3.5", "aria-hidden": "true" }), _jsxs("select", { "aria-label": translate?.("kumiko.list.sort.label") ?? "Sort", "data-testid": testId !== undefined ? `${testId}-sort` : "render-list-sort", value: currentSortValue, onChange: (e) => {
33
33
  const raw = e.target.value;
34
34
  if (raw === "") {
35
35
  onSortChange(null);
@@ -15,7 +15,7 @@ export function renderCardsView(m) {
15
15
  const toolbarOwnsSort = m.toolbarSort === true && !m.belowSm && hasSortOptionsSelect(m.sortOptions, m.onSortChange);
16
16
  const summary = m.belowSm ? sortSummaryText(m) : undefined;
17
17
  const separateCards = hasSeparateCardRows(m);
18
- return (_jsx("div", { "data-testid": testId, className: "contents", children: _jsxs("div", { "data-testid": testId !== undefined ? `${testId}-cards` : "render-list-cards", className: "flex flex-col", children: [!toolbarOwnsSort && (_jsx(CardSortSelect, { columns: columns, sort: m.sort, onSortChange: m.onSortChange, testId: testId, summary: summary, ...(m.sortOptions !== undefined && { sortOptions: m.sortOptions }) })), _jsx("ul", { className: separateCards
18
+ return (_jsx("div", { "data-testid": testId, className: "contents", children: _jsxs("div", { "data-testid": testId !== undefined ? `${testId}-cards` : "render-list-cards", className: "flex flex-col", children: [!toolbarOwnsSort && m.plainPhoneCards !== true && (_jsx(CardSortSelect, { columns: columns, sort: m.sort, onSortChange: m.onSortChange, testId: testId, summary: summary, ...(m.sortOptions !== undefined && { sortOptions: m.sortOptions }) })), _jsx("ul", { className: separateCards
19
19
  ? cn("m-0 flex list-none flex-col gap-2 p-0 pb-2", m.fillsHeight && "px-4")
20
20
  : isInsideCardFrame(m)
21
21
  ? "m-0 list-none p-0"
@@ -10,5 +10,6 @@ export declare function columnCellPresentationProps(col: ListColumnViewModel): {
10
10
  badgeDot?: false | undefined;
11
11
  pillField?: string | undefined;
12
12
  pillToneField?: string | undefined;
13
- emptyPlaceholder?: false | undefined;
13
+ emptyPlaceholder?: string | false | undefined;
14
+ dateOnlyAfterDays?: number | undefined;
14
15
  };
@@ -11,5 +11,6 @@ export function columnCellPresentationProps(col) {
11
11
  ...(col.pillField !== undefined && { pillField: col.pillField }),
12
12
  ...(col.pillToneField !== undefined && { pillToneField: col.pillToneField }),
13
13
  ...(col.emptyPlaceholder !== undefined && { emptyPlaceholder: col.emptyPlaceholder }),
14
+ ...(col.dateOnlyAfterDays !== undefined && { dateOnlyAfterDays: col.dateOnlyAfterDays }),
14
15
  };
15
16
  }
@@ -4,11 +4,13 @@ type DensityClasses = {
4
4
  readonly row: string;
5
5
  /** Table body cell; `!` beats the fill-height table's own cell padding. */
6
6
  readonly cell: string;
7
+ /** Height of a body cell: the board row is 50px; compact rows stay tight. */
8
+ readonly cellHeight: string;
7
9
  /** Header cell; keeps the horizontal inset in line with the body cells. */
8
10
  readonly header: string;
9
11
  /** Card row below the md breakpoint. */
10
12
  readonly card: string;
11
13
  };
12
- /** Comfortable (and a table without `view`) adds no class at all, so the markup stays as it was. */
14
+ /** Comfortable (and a table without `view`) adds only the board row height. */
13
15
  export declare function densityClasses(view: DataTableViewOptions | undefined, keepsFillEdgeInset: boolean): DensityClasses;
14
16
  export {};
@@ -1,12 +1,19 @@
1
- const NO_DENSITY_CLASSES = { row: "", cell: "", header: "", card: "" };
1
+ const ROW_HEIGHT_CLASS = "h-[50px]";
2
+ const NO_DENSITY_CLASSES = {
3
+ row: "",
4
+ cell: "",
5
+ cellHeight: ROW_HEIGHT_CLASS,
6
+ header: "",
7
+ card: "",
8
+ };
2
9
  // A fill-height table insets its first and last column by 24px; compact keeps that edge.
3
10
  const FILL_EDGE_INSET = " first:pl-6! last:pr-6!";
4
11
  const DENSITY_CLASSES = {
5
12
  comfortable: NO_DENSITY_CLASSES,
6
- relaxed: { row: "", cell: "sm:py-3!", header: "", card: "" },
7
- compact: { row: "h-8", cell: "p-1!", header: "px-1!", card: "min-h-14 py-2" },
13
+ relaxed: { row: "", cell: "sm:py-3!", cellHeight: ROW_HEIGHT_CLASS, header: "", card: "" },
14
+ compact: { row: "h-8", cell: "p-1!", cellHeight: "", header: "px-1!", card: "min-h-14 py-2" },
8
15
  };
9
- /** Comfortable (and a table without `view`) adds no class at all, so the markup stays as it was. */
16
+ /** Comfortable (and a table without `view`) adds only the board row height. */
10
17
  export function densityClasses(view, keepsFillEdgeInset) {
11
18
  if (view === undefined)
12
19
  return NO_DENSITY_CLASSES;
@@ -5,4 +5,4 @@ import type { DataTableModel } from "./use-data-table-state.ts";
5
5
  export declare function renderExpandToggle(m: DataTableModel, row: ListRowViewModel): ReactNode;
6
6
  export declare function renderExpansion(m: DataTableModel, row: ListRowViewModel, as: "row" | "item", colSpan: number): ReactNode;
7
7
  export declare function renderBand(m: DataTableModel, item: DataTableBandItem): ReactNode;
8
- export declare function renderEmptyBlock(m: DataTableModel, embedded?: boolean): ReactNode;
8
+ export declare function renderEmptyBlock(m: DataTableModel): ReactNode;
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from "../../lib/cn.js";
3
2
  import { TableCell, TableRow } from "../../ui/table.js";
4
3
  import { cellTitle } from "../data-table-cell.js";
5
4
  import { GroupBand } from "./group-band.js";
@@ -29,8 +28,7 @@ export function renderExpansion(m, row, as, colSpan) {
29
28
  export function renderBand(m, item) {
30
29
  return _jsx(GroupBand, { item: item, columnOf: m.columnOf });
31
30
  }
32
- // `embedded`: the block sits inside the framed table's body, which already draws the border.
33
- export function renderEmptyBlock(m, embedded = false) {
34
- const { testId, chromeless, fillsHeight, emptyState, tableTranslate } = m;
35
- return (_jsx("div", { "data-testid": testId !== undefined ? `${testId}-empty` : "render-list-empty", className: cn("flex flex-col items-center justify-center gap-3 px-6 py-10 text-[13px] text-muted-foreground", !embedded && chromeless !== true && !fillsHeight && "rounded-md border border-border-row"), children: emptyState ?? _jsx("span", { children: tableTranslate?.("kumiko.list.no-entries") ?? "No entries." }) }));
31
+ export function renderEmptyBlock(m) {
32
+ const { testId, emptyState, tableTranslate } = m;
33
+ return (_jsx("div", { "data-testid": testId !== undefined ? `${testId}-empty` : "render-list-empty", className: "m-6 flex flex-col items-center justify-center gap-3 rounded-[9px] border border-dashed border-border-strong px-6 py-10 text-[13px] text-muted-foreground [&>:first-child]:font-semibold [&>:first-child]:text-foreground", children: emptyState ?? (_jsx("span", { className: "text-sm font-semibold text-foreground", children: tableTranslate?.("kumiko.list.no-entries") ?? "No entries." })) }));
36
34
  }
@@ -30,7 +30,7 @@ export function sortSummaryText(m) {
30
30
  direction,
31
31
  count,
32
32
  noun,
33
- }) ?? `Sorted by ${active.label} ${direction} · ${count} ${noun}`).trim();
33
+ }) ?? `Sorted by ${active.label} ${direction}`).trim();
34
34
  }
35
35
  // "Sorted by: <active label>" over a native select; with no matching option only the prefix shows
36
36
  // so the control never claims an order the list is not in.
@@ -38,7 +38,7 @@ export function SortOptionsSelect({ options, sort, onSortChange, testId, classNa
38
38
  const translate = useOptionalTranslation();
39
39
  const active = activeSortOption(options, sort);
40
40
  const prefix = translate?.("kumiko.list.sort.prefix") ?? "Sorted by";
41
- return (_jsxs("div", { className: cn("relative flex h-9 items-center gap-1.5 rounded-md text-[13px] text-foreground-secondary focus-within:ring-1 focus-within:ring-ring", summary !== undefined && !bordered && "h-6 text-xs text-muted-foreground", bordered && "rounded-md border border-border-strong bg-background px-2.5 text-foreground", className), children: [_jsx("span", { "aria-hidden": "true", "data-testid": `${testId}-label`, className: summary === undefined && active !== undefined ? "inline-flex gap-1.5" : undefined, children: summary !== undefined || active === undefined ? ((summary ?? prefix)) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground", children: `${prefix}: ` }), _jsx("span", { "data-testid": `${testId}-value`, children: active.label })] })) }), chevron && _jsx(ChevronDown, { className: "size-3.5", "aria-hidden": "true" }), _jsxs("select", { "aria-label": prefix, "data-testid": testId, value: active !== undefined ? sortOptionValue(active) : "", onChange: (e) => {
41
+ return (_jsxs("div", { className: cn("relative flex h-[37px] items-center gap-1.5 rounded-md text-[13px] text-foreground-secondary focus-within:ring-1 focus-within:ring-ring", summary !== undefined && !bordered && "h-6 text-xs text-muted-foreground", bordered && "rounded-md border border-border-strong bg-background px-2.5 text-foreground", className), children: [_jsx("span", { "aria-hidden": "true", "data-testid": `${testId}-label`, className: summary === undefined && active !== undefined ? "inline-flex gap-1.5" : undefined, children: summary !== undefined || active === undefined ? ((summary ?? prefix)) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground", children: `${prefix}: ` }), _jsx("span", { "data-testid": `${testId}-value`, children: active.label })] })) }), chevron && _jsx(ChevronDown, { className: "size-3.5", "aria-hidden": "true" }), _jsxs("select", { "aria-label": prefix, "data-testid": testId, value: active !== undefined ? sortOptionValue(active) : "", onChange: (e) => {
42
42
  const picked = options.find((option) => sortOptionValue(option) === e.target.value);
43
43
  if (picked !== undefined)
44
44
  onSortChange({ field: picked.field, dir: picked.dir });
@@ -4,8 +4,8 @@ import { cn } from "../../lib/cn.js";
4
4
  import { TableHead } from "../../ui/table.js";
5
5
  import { FIT_CONTENT_CELL_CLASS } from "../data-table-cell.js";
6
6
  export const COMPACT_HEADER_CLASS = "text-xs font-semibold";
7
- /** Small-caps look of column headers from sm up: 11px keeps dense tables inside 1280px. */
8
- const SMALL_CAPS_HEADER_CLASS = "sm:text-[11px] sm:uppercase sm:tracking-[0.05em]";
7
+ /** Board header: 13.5px regular, ink colour, 37px high, 12px side padding. */
8
+ const HEADER_CLASS = "h-[37px] border-b-[1.5px] border-border-row px-3 text-[13.5px] first:pl-6 last:pr-[34px]";
9
9
  // SortableHeader: renders the th header per column, with or without
10
10
  // click-sort. Three paths:
11
11
  // (a) sortable=false OR no onSortChange -> plain label, no cursor
@@ -23,13 +23,13 @@ export function SortableHeader({ field, label, sortable, highlighted, numeric, a
23
23
  ...(columnField !== undefined && { "data-column-field": columnField }),
24
24
  };
25
25
  if (!sortable || onSortChange === undefined) {
26
- return (_jsxs(TableHead, { "data-testid": `column-${field}`, "data-sortable": sortable === true ? true : undefined, "data-highlighted": highlighted === true ? "true" : undefined, className: cn("font-medium whitespace-normal text-muted-foreground", SMALL_CAPS_HEADER_CLASS, numeric === true && "text-right", actionColumn === true && "sm:text-right", fitContent === true && FIT_CONTENT_CELL_CLASS, highlighted === true && "bg-accent/40", trailing !== undefined && "group/header relative", compact === true && COMPACT_HEADER_CLASS, className), ...cellExtras, children: [actionColumn === true ? _jsx("span", { className: "sm:sr-only", children: label }) : label, trailing] }));
26
+ return (_jsxs(TableHead, { "data-testid": `column-${field}`, "data-sortable": sortable === true ? true : undefined, "data-highlighted": highlighted === true ? "true" : undefined, className: cn("font-normal whitespace-normal text-foreground-secondary", HEADER_CLASS, numeric === true && "text-right", actionColumn === true && "sm:text-right", fitContent === true && FIT_CONTENT_CELL_CLASS, highlighted === true && "bg-accent/40", trailing !== undefined && "group/header relative", compact === true && COMPACT_HEADER_CLASS, className), ...cellExtras, children: [actionColumn === true ? _jsx("span", { className: "sm:sr-only", children: label }) : label, trailing] }));
27
27
  }
28
28
  const Icon = active?.dir === "asc" ? ArrowUp : active?.dir === "desc" ? ArrowDown : ArrowUpDown;
29
29
  const next = nextSortState(active?.dir, field);
30
30
  return (_jsxs(TableHead, { "data-testid": `column-${field}`, "data-sortable": "true", "data-highlighted": highlighted === true ? "true" : undefined, "aria-sort": ariaSort, className: cn(active !== undefined
31
31
  ? "font-semibold text-foreground"
32
- : "font-medium text-muted-foreground", "whitespace-normal", SMALL_CAPS_HEADER_CLASS, numeric === true && "text-right", fitContent === true && FIT_CONTENT_CELL_CLASS, highlighted === true && "bg-accent/40", trailing !== undefined && "group/header relative", compact === true && COMPACT_HEADER_CLASS, className), ...cellExtras, children: [_jsxs("button", { type: "button", onClick: () => onSortChange(next), className: cn("group/sort inline-flex h-8 items-center gap-1.5 rounded-sm px-2 -mx-2 text-sm [font-weight:inherit]", SMALL_CAPS_HEADER_CLASS, "hover:bg-accent hover:text-accent-foreground", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", active !== undefined && "text-foreground", compact === true && "text-xs"), children: [_jsx("span", { children: label }), _jsx(Icon, { "data-sort-icon": active === undefined ? "idle" : "active", className: cn("size-3.5", active === undefined &&
32
+ : "font-normal text-foreground-secondary", "whitespace-normal", HEADER_CLASS, numeric === true && "text-right", fitContent === true && FIT_CONTENT_CELL_CLASS, highlighted === true && "bg-accent/40", trailing !== undefined && "group/header relative", compact === true && COMPACT_HEADER_CLASS, className), ...cellExtras, children: [_jsxs("button", { type: "button", onClick: () => onSortChange(next), className: cn("group/sort inline-flex h-8 items-center gap-1.5 rounded-sm px-2 -mx-2 text-[13.5px] [font-weight:inherit]", "hover:bg-accent hover:text-accent-foreground", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", active !== undefined && "text-foreground", compact === true && "text-xs"), children: [_jsx("span", { children: label }), _jsx(Icon, { "data-sort-icon": active === undefined ? "idle" : "active", className: cn("size-3.5", active === undefined &&
33
33
  "opacity-0 group-hover/sort:opacity-40 group-focus-visible/sort:opacity-40"), "aria-hidden": "true" })] }), trailing] }));
34
34
  }
35
35
  // 3-state toggle: no sort -> asc -> desc -> no sort. Idiomatic for
@@ -5,6 +5,7 @@ import { rowToneClass } from "../data-table-cell.js";
5
5
  import { HintReasonRowScope, hintReasonOf } from "../hint-reason-row.js";
6
6
  import { RowActionsCell } from "../row-actions.js";
7
7
  import { ActionsBodyCell } from "./actions-column.js";
8
+ import { ASSISTANT_FOCUS_ROW_CLASS } from "./card-frame.js";
8
9
  import { bandClassName, bandReactKey, bandTestId } from "./group-band.js";
9
10
  import { rowClickHandler } from "./row-click-guard.js";
10
11
  import { renderBand, renderExpandToggle, renderExpansion } from "./row-render-parts.js";
@@ -27,7 +28,7 @@ function renderDataRow(m, row) {
27
28
  const opensOnClick = openRow !== undefined;
28
29
  const keyboard = m.keyboardRow(row.id, openRow);
29
30
  const reasonHint = m.columns.find((col) => col.hint !== undefined && hintReasonOf(col.hint, row.values) !== undefined)?.hint;
30
- const rowElements = (_jsxs(_Fragment, { children: [_jsxs(TableRow, { "data-testid": m.rowTestId(row), "data-tone": rowTone?.(row), onClick: rowClickHandler(openRow), className: cn(rowToneClass(rowTone?.(row)), opensOnClick && "cursor-pointer", "[&:has(+[data-reason-row])]:border-b-0", m.fillsHeight && "h-10 border-border-row hover:bg-muted", density.row, keyboard.className), ...keyboard.props, children: [m.selection.bodyCell(row, m.pins.bodyCell(SELECT_COLUMN_KEY)), m.expansion !== undefined && renderExpandCell(m, row), m.columns.map((col, colIndex) => renderDataCell(m, row, col, colIndex, opensOnClick)), m.hasTableActions && tableActions !== undefined && renderActionsCell(m, row, tableActions)] }), renderExpansion(m, row, "row", m.fullColSpan)] }));
31
+ const rowElements = (_jsxs(_Fragment, { children: [_jsxs(TableRow, { "data-testid": m.rowTestId(row), "data-tone": rowTone?.(row), onClick: rowClickHandler(openRow), className: cn(rowToneClass(rowTone?.(row)), opensOnClick && "cursor-pointer", m.focusedRowId === row.id && ASSISTANT_FOCUS_ROW_CLASS, "[&:has(+[data-reason-row])]:border-b-0", m.fillsHeight && "h-[50px] border-border-row hover:bg-muted", density.row, keyboard.className), ...keyboard.props, children: [m.selection.bodyCell(row, m.pins.bodyCell(SELECT_COLUMN_KEY)), m.expansion !== undefined && renderExpandCell(m, row), m.columns.map((col, colIndex) => renderDataCell(m, row, col, colIndex, opensOnClick)), m.hasTableActions && tableActions !== undefined && renderActionsCell(m, row, tableActions)] }), renderExpansion(m, row, "row", m.fullColSpan)] }));
31
32
  return (_jsx(HintReasonRowScope, { hint: reasonHint, row: row.values, renderBoxRow: (box) => (_jsx(TableRow, { "data-testid": `${m.rowTestId(row)}-reason`, "data-reason-row": "true", children: _jsx(TableCell, { colSpan: m.fullColSpan, children: box }) })), children: rowElements }, row.id));
32
33
  }
33
34
  export function renderTableBody(m) {
@@ -14,9 +14,7 @@ export function FlushTable({ className, ...props }) {
14
14
  // in SortableHeader: a `[&_th]:font-*` rule here would outrank it.
15
15
  // Child selectors only: an expanded row nests a whole table inside a cell, and
16
16
  // descendant selectors would make its header sticky and re-pad its cells.
17
- export const FILL_TABLE_CLASS = cn("[&>thead>tr>th]:sticky [&>thead>tr>th]:top-0 [&>thead>tr>th]:z-10 [&>thead>tr>th]:h-9 [&>thead>tr>th]:bg-muted [&>thead>tr>th]:px-2 [&>thead>tr>th]:text-[13px]", "[&>thead>tr>th]:shadow-[inset_0_-1px_0_var(--color-border)] [&>thead>tr>th_button]:text-[13px] [&>tbody>tr>td]:px-2 [&>tbody>tr>td]:py-0",
18
- // The small-caps header size of SortableHeader; the child selectors above would outrank it.
19
- "sm:[&>thead>tr>th]:text-[11px] sm:[&>thead>tr>th_button]:text-[11px]", "[&>*>tr>:first-child]:pl-6 [&>*>tr>:last-child]:pr-6");
17
+ export const FILL_TABLE_CLASS = cn("[&>thead>tr>th]:sticky [&>thead>tr>th]:top-0 [&>thead>tr>th]:z-10 [&>thead>tr>th]:h-[37px] [&>thead>tr>th]:bg-background [&>thead>tr>th]:px-3 [&>thead>tr>th]:text-[13.5px]", "[&>thead>tr>th]:shadow-[inset_0_-1.5px_0_var(--color-border-row)] [&>thead>tr>th_button]:text-[13.5px] [&>tbody>tr>td]:px-3 [&>tbody>tr>td]:py-0", "[&>*>tr>:first-child]:pl-6 [&>*>tr>:last-child]:pr-[34px]");
20
18
  // `!`: beats the first/last-child padding of FILL_TABLE_CLASS, which would
21
19
  // otherwise widen the narrow toggle column / pad the full-width expansion cell.
22
20
  // The nested table's sticky actions cell (last td) gets the muted surface
@@ -8,11 +8,10 @@ import { DataTableFooter } from "./table-footer.js";
8
8
  import { renderTableView } from "./table-view.js";
9
9
  // The pager is ALWAYS rendered below the table (even with rows=[]) so the
10
10
  // user can page back on a filter hit of zero without losing the list.
11
- // Except total === 0: then there is nothing to paginate. Incompatible with
12
- // infinite scroll: the caller sets either pager OR onReachEnd.
11
+ // Incompatible with infinite scroll: the caller sets either pager OR onReachEnd.
13
12
  function renderPager(m) {
14
13
  const { pager, serverGroups, testId } = m;
15
- if (pager === undefined || !(pager.total > 0) || serverGroups !== undefined)
14
+ if (pager === undefined || serverGroups !== undefined)
16
15
  return undefined;
17
16
  return (_jsx(Pager, { page: pager.page, limit: pager.limit, total: pager.total, onPageChange: pager.onPageChange, ...(pager.pageSizeOptions !== undefined && { pageSizeOptions: pager.pageSizeOptions }), ...(pager.onPageSizeChange !== undefined && { onPageSizeChange: pager.onPageSizeChange }), testId: testId !== undefined ? `${testId}-pager` : "render-list-pager", pinned: m.fillsHeight || isInsideCardFrame(m), plain: m.isNarrow && hasSeparateCardRows(m) }));
18
17
  }
@@ -25,7 +24,7 @@ function renderSentinel(m, pagerElement) {
25
24
  }
26
25
  function renderTableBodyContent(m) {
27
26
  if (m.isEmpty)
28
- return isInsideCardFrame(m) ? renderTableView(m) : renderEmptyBlock(m);
27
+ return renderEmptyBlock(m);
29
28
  return m.isNarrow ? renderCardsView(m) : renderTableView(m);
30
29
  }
31
30
  export function renderTableContent(m) {
@@ -33,17 +32,14 @@ export function renderTableContent(m) {
33
32
  const tableContent = renderTableBodyContent(m);
34
33
  const pagerElement = renderPager(m);
35
34
  const sentinelElement = renderSentinel(m, pagerElement);
36
- const framed = isInsideCardFrame(m);
35
+ // An empty list is only the dashed empty block, with no card frame around it.
36
+ const framed = isInsideCardFrame(m) && !m.isEmpty;
37
37
  // With scrollBody the footer (pager, else the entry count) sits OUTSIDE the
38
38
  // scroll surface so it stays put at any row count; the infinite sentinel
39
39
  // stays INSIDE, or it would never intersect the scrollport.
40
40
  const content = m.fillsHeight ? (_jsxs("div", { "data-testid": testId !== undefined ? `${testId}-scroll` : "render-list-scroll", className: cn("min-h-0 flex-1 overflow-auto bg-card", !framed && "border-t border-border"), children: [tableContent, sentinelElement] })) : (_jsxs(_Fragment, { children: [tableContent, sentinelElement] }));
41
- // A rendered empty state stands alone: a "0 entries" count or pager under it only repeats it.
42
- const hasEmptyState = m.isEmpty && m.emptyState !== undefined;
43
- const footer = hasEmptyState
44
- ? undefined
45
- : (pagerElement ??
46
- (m.fillsHeight ? (_jsx(DataTableFooter, { count: serverGroups?.totalCount ?? m.rows.length, ...(itemNoun !== undefined && { itemNoun }), testId: testId !== undefined ? `${testId}-footer` : "render-list-footer" })) : undefined));
41
+ const footer = pagerElement ??
42
+ (m.fillsHeight && m.hideCountFooter !== true ? (_jsx(DataTableFooter, { count: serverGroups?.totalCount ?? m.rows.length, ...(itemNoun !== undefined && { itemNoun }), testId: testId !== undefined ? `${testId}-footer` : "render-list-footer" })) : undefined);
47
43
  // Frame card: content and footer share one bordered card. A fill-height card is as tall as
48
44
  // its rows and shrinks into the scroll container; the 24px sides match the toolbar's inset.
49
45
  return (_jsxs(_Fragment, { children: [m.selection.bar, framed ? (_jsxs("div", { "data-testid": testId !== undefined ? `${testId}-frame` : "render-list-frame", className: cn(CARD_SURFACE_CLASS, "overflow-hidden", m.fillsHeight && "mx-6 mb-6 flex min-h-0 flex-col"), children: [content, footer] })) : (_jsxs(_Fragment, { children: [content, footer] }))] }));