@nadicodeai/ui 12.1.210 → 12.1.212

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 (148) hide show
  1. package/AGENTS.md +11 -4
  2. package/dist/components/account-menu.d.ts +3 -3
  3. package/dist/components/account-menu.d.ts.map +1 -1
  4. package/dist/components/account-menu.js +7 -5
  5. package/dist/components/activity-feed.d.ts +4 -2
  6. package/dist/components/activity-feed.d.ts.map +1 -1
  7. package/dist/components/activity-feed.js +10 -3
  8. package/dist/components/board.d.ts +45 -0
  9. package/dist/components/board.d.ts.map +1 -0
  10. package/dist/components/board.js +35 -0
  11. package/dist/components/breadcrumb.d.ts +3 -3
  12. package/dist/components/breadcrumb.d.ts.map +1 -1
  13. package/dist/components/button.d.ts +6 -1
  14. package/dist/components/button.d.ts.map +1 -1
  15. package/dist/components/button.js +5 -2
  16. package/dist/components/card-row.js +1 -1
  17. package/dist/components/chart-card.d.ts +19 -6
  18. package/dist/components/chart-card.d.ts.map +1 -1
  19. package/dist/components/chart-card.js +17 -7
  20. package/dist/components/collection-page.d.ts +4 -4
  21. package/dist/components/collection-page.d.ts.map +1 -1
  22. package/dist/components/collection-page.js +4 -8
  23. package/dist/components/collection-toolbar.d.ts +5 -4
  24. package/dist/components/collection-toolbar.d.ts.map +1 -1
  25. package/dist/components/collection-toolbar.js +9 -5
  26. package/dist/components/column-foot.d.ts +53 -0
  27. package/dist/components/column-foot.d.ts.map +1 -0
  28. package/dist/components/column-foot.js +32 -0
  29. package/dist/components/conversation-card.d.ts +38 -0
  30. package/dist/components/conversation-card.d.ts.map +1 -0
  31. package/dist/components/conversation-card.js +19 -0
  32. package/dist/components/data-table.d.ts +27 -22
  33. package/dist/components/data-table.d.ts.map +1 -1
  34. package/dist/components/data-table.js +76 -25
  35. package/dist/components/entry-page.d.ts +55 -0
  36. package/dist/components/entry-page.d.ts.map +1 -0
  37. package/dist/components/entry-page.js +41 -0
  38. package/dist/components/entry-scene.d.ts +1 -1
  39. package/dist/components/entry-scene.js +1 -1
  40. package/dist/components/filter-toolbar.d.ts +43 -0
  41. package/dist/components/filter-toolbar.d.ts.map +1 -0
  42. package/dist/components/filter-toolbar.js +44 -0
  43. package/dist/components/hive-scene.d.ts +4 -1
  44. package/dist/components/hive-scene.d.ts.map +1 -1
  45. package/dist/components/hive-scene.js +6 -1
  46. package/dist/components/invite-card.js +1 -1
  47. package/dist/components/item.d.ts +1 -1
  48. package/dist/components/item.js +2 -2
  49. package/dist/components/kpi-card.d.ts +10 -3
  50. package/dist/components/kpi-card.d.ts.map +1 -1
  51. package/dist/components/kpi-card.js +12 -4
  52. package/dist/components/message-notice.d.ts +3 -3
  53. package/dist/components/message-notice.js +1 -1
  54. package/dist/components/notice-banner.d.ts +1 -1
  55. package/dist/components/notice-banner.js +1 -1
  56. package/dist/components/object-page.d.ts +8 -2
  57. package/dist/components/object-page.d.ts.map +1 -1
  58. package/dist/components/object-page.js +7 -2
  59. package/dist/components/object-workspace.d.ts +25 -5
  60. package/dist/components/object-workspace.d.ts.map +1 -1
  61. package/dist/components/object-workspace.js +30 -7
  62. package/dist/components/page-actions.d.ts +0 -2
  63. package/dist/components/page-actions.d.ts.map +1 -1
  64. package/dist/components/page-actions.js +1 -5
  65. package/dist/components/page-frame.d.ts +38 -0
  66. package/dist/components/page-frame.d.ts.map +1 -0
  67. package/dist/components/page-frame.js +29 -0
  68. package/dist/components/page-header.d.ts +4 -3
  69. package/dist/components/page-header.d.ts.map +1 -1
  70. package/dist/components/page-header.js +5 -4
  71. package/dist/components/pending-label.d.ts +1 -1
  72. package/dist/components/pending-label.d.ts.map +1 -1
  73. package/dist/components/pending-label.js +4 -6
  74. package/dist/components/place-count.d.ts +20 -0
  75. package/dist/components/place-count.d.ts.map +1 -0
  76. package/dist/components/place-count.js +16 -0
  77. package/dist/components/plan-card.d.ts +49 -0
  78. package/dist/components/plan-card.d.ts.map +1 -0
  79. package/dist/components/plan-card.js +22 -0
  80. package/dist/components/product-band.d.ts +20 -0
  81. package/dist/components/product-band.d.ts.map +1 -0
  82. package/dist/components/product-band.js +23 -0
  83. package/dist/components/product-shell.d.ts +316 -44
  84. package/dist/components/product-shell.d.ts.map +1 -1
  85. package/dist/components/product-shell.js +533 -36
  86. package/dist/components/reading-column.d.ts +1 -1
  87. package/dist/components/reading-column.js +1 -1
  88. package/dist/components/record-list.d.ts +19 -3
  89. package/dist/components/record-list.d.ts.map +1 -1
  90. package/dist/components/record-list.js +23 -8
  91. package/dist/components/record-time.d.ts +6 -2
  92. package/dist/components/record-time.d.ts.map +1 -1
  93. package/dist/components/record-time.js +8 -5
  94. package/dist/components/row-edit-form.d.ts +1 -1
  95. package/dist/components/row-edit-form.js +1 -1
  96. package/dist/components/scope-switcher.d.ts +3 -1
  97. package/dist/components/scope-switcher.d.ts.map +1 -1
  98. package/dist/components/scope-switcher.js +3 -6
  99. package/dist/components/settings-page.d.ts +3 -3
  100. package/dist/components/settings-page.js +3 -3
  101. package/dist/components/settings-section.d.ts +19 -5
  102. package/dist/components/settings-section.d.ts.map +1 -1
  103. package/dist/components/settings-section.js +14 -6
  104. package/dist/components/sidebar-sections.d.ts.map +1 -1
  105. package/dist/components/sidebar-sections.js +4 -4
  106. package/dist/components/sidebar.d.ts +27 -5
  107. package/dist/components/sidebar.d.ts.map +1 -1
  108. package/dist/components/sidebar.js +56 -24
  109. package/dist/components/table-card.d.ts.map +1 -1
  110. package/dist/components/table-card.js +2 -1
  111. package/dist/components/table-layouts.d.ts +27 -0
  112. package/dist/components/table-layouts.d.ts.map +1 -1
  113. package/dist/components/table-layouts.js +30 -0
  114. package/dist/components/toast.d.ts +10 -1
  115. package/dist/components/toast.d.ts.map +1 -1
  116. package/dist/components/toast.js +24 -1
  117. package/dist/components/update-card.js +1 -1
  118. package/dist/index.d.ts +5 -0
  119. package/dist/index.d.ts.map +1 -1
  120. package/dist/index.js +5 -0
  121. package/dist/internal/button-classes.d.ts +2 -0
  122. package/dist/internal/button-classes.d.ts.map +1 -1
  123. package/dist/internal/button-classes.js +54 -46
  124. package/dist/internal/card-actions.d.ts +3 -0
  125. package/dist/internal/card-actions.d.ts.map +1 -0
  126. package/dist/internal/card-actions.js +4 -0
  127. package/dist/internal/footer-strip.d.ts.map +1 -1
  128. package/dist/internal/footer-strip.js +3 -1
  129. package/dist/internal/table-compact-line.d.ts +1 -7
  130. package/dist/internal/table-compact-line.d.ts.map +1 -1
  131. package/dist/internal/table-compact-line.js +5 -11
  132. package/dist/lib/product-shell.d.ts +20 -0
  133. package/dist/lib/product-shell.d.ts.map +1 -0
  134. package/dist/lib/product-shell.js +19 -0
  135. package/dist/showcase/specimens/compositions.d.ts +15 -0
  136. package/dist/showcase/specimens/compositions.d.ts.map +1 -1
  137. package/dist/showcase/specimens/compositions.js +70 -0
  138. package/dist/showcase/specimens/index.d.ts +11 -0
  139. package/dist/showcase/specimens/index.d.ts.map +1 -1
  140. package/dist/showcase/specimens/navigation.d.ts +4 -0
  141. package/dist/showcase/specimens/navigation.d.ts.map +1 -1
  142. package/dist/showcase/specimens/navigation.js +26 -1
  143. package/dist/showcase/usage.generated.d.ts +1 -1
  144. package/dist/showcase/usage.generated.d.ts.map +1 -1
  145. package/dist/showcase/usage.generated.js +166 -45
  146. package/dist/styles/components.css +38 -0
  147. package/dist/styles/globals.css +0 -5
  148. package/package.json +6 -2
@@ -6,6 +6,7 @@ import * as React from "react";
6
6
  import { ChevronRight } from "lucide-react";
7
7
  import { cn } from "../lib/utils.js";
8
8
  import { Card, CardAction, CardDescription, CardFooter, CardHeader, CardTitle, } from "./card.js";
9
+ import { Skeleton, SkeletonRegion } from "./skeleton.js";
9
10
  import { TrendBadge, trendTone } from "./trend-badge.js";
10
11
  // The line is the only part of a card that needs the chart library, which a page of figures without
11
12
  // lines would otherwise load too; its row keeps its height while the line loads.
@@ -24,9 +25,9 @@ const VALUE_TONE_CLASS = {
24
25
  * @family Charts
25
26
  * @when One figure a person checks at a glance: Active Agents, Spend, Tasks done, Need attention, in an overview's row of figures.
26
27
  * @instead A figure read over time is a `ChartCard`, and a single figure is never nested inside one. A ratio beside two money measures is a `KpiCard` next to the chart, never a second axis. A level against a cap is `Progress`.
27
- * @behaviour Label left and the change badge right on the first line, the value under them, the comparison in the footer. The footer is one line in every card of a row, so their dividers line up: the comparison and the note, joined, cut with an ellipsis when long and whole on hover. A figure with no comparison shows no badge and no empty footer. A figure that opens its owner (`render`) ends its label with a chevron. Colour sits only where it reads a fact: direction crossed with whether up is good sets the badge icon's tone (success, blocked, or grey for a flat or neutral measure), and `tone` marks the value itself as warning or critical when it crosses a threshold; the card, label and comparison stay neutral. With `sparkline`, Vercel Observability's overview tile: the label across the tile, the value under it with the change badge at its right, a 32 px line in `chart-1` across the card's width, then the comparison and the note in muted ink on up to two lines, which every tile of a row reserves, so the tiles' lines and comparisons sit at the same heights and nothing is cut at a five-tile row. A figure with no line or no comparison keeps the empty rows. The line loads on demand: a streaming server render and the browser draw it once it has loaded, and a synchronous `renderToString` leaves its row empty.
28
+ * @behaviour Label left and the change badge right on the first line, the value under them, the comparison in the footer. The footer is one line in every card of a row, so their dividers line up: the comparison and the note, joined, cut with an ellipsis when long and whole on hover. A figure with no comparison shows no badge and no empty footer. A figure that opens its owner (`render`) ends its label with a chevron. Colour sits only where it reads a fact: direction crossed with whether up is good sets the badge icon's tone (success, blocked, or grey for a flat or neutral measure), and `tone` marks the value itself as warning or critical when it crosses a threshold; the card, label and comparison stay neutral. The label keeps two lines, wrapped or not, and the value stands under them at the same height in either layout, so the values of a row sit level whichever layout each card takes. With `sparkline`, Vercel Observability's overview tile: the label across the tile, the value under it with the change badge at its right, a 32 px line in `chart-1` across the card's width, then the comparison and the note in muted ink on up to two lines, which every tile of a row reserves, so the tiles' lines and comparisons sit at the same heights and nothing is cut at a five-tile row. A figure with no line or no comparison keeps the empty rows. The line loads on demand: a streaming server render and the browser draw it once it has loaded, and a synchronous `renderToString` leaves its row empty. While its page reads the figure, `KpiCardSkeleton` stands in its place: the same small card, the label's two lines, the value's line and, with `footer`, the footer's line, with no words (nadicode decision).
28
29
  * @words The label names the measure in sentence case: "Active Agents", "Spend". The change is signed with a true minus and its unit ("+12.4%", "−1"), the comparison names the period: "vs 16 last week", "vs August 2026". No icon beside the label.
29
- * @access The trend icon is hidden and the direction is read as a word in the reader's language (`directionLabel`). Figures use tabular digits. The value is text, never only colour.
30
+ * @access The trend icon is hidden and the direction is read as a word in the reader's language (`directionLabel`). Figures use tabular digits. The value is text, never only colour. `KpiCardSkeleton` is busy and its bars are hidden from assistive technology.
30
31
  */
31
32
  function KpiCard({ label, value, delta, note, tone = "default", render, presentation = "card", sparkline, }) {
32
33
  if (presentation === "inline") {
@@ -35,8 +36,15 @@ function KpiCard({ label, value, delta, note, tone = "default", render, presenta
35
36
  const footerLine = [delta?.comparison, note].filter(Boolean).join(" · ");
36
37
  const badge = delta ? (_jsx(TrendBadge, { value: delta.value, direction: delta.direction, tone: trendTone(delta.direction, delta.upIsGood, delta.neutral), directionLabel: delta.directionLabel })) : null;
37
38
  if (sparkline) {
38
- return (_jsx(Card, { size: "sm", "data-slot": "kpi-card", "data-tone": tone, render: render, variant: render ? "link" : "default", children: _jsxs(CardHeader, { className: "gap-y-1", children: [_jsxs(CardDescription, { className: "col-span-2 flex min-w-0 items-center gap-0.5", children: [_jsx("span", { className: "truncate", title: label, children: label }), render ? _jsx(ChevronRight, { "aria-hidden": "true", className: "size-4 shrink-0" }) : null] }), delta ? (_jsx(CardAction, { "data-kpi-delta": delta.direction, className: "row-span-1 row-start-2 self-center", children: badge })) : null, _jsx(CardTitle, { className: cn("col-start-1 row-start-2 min-w-0 truncate text-heading-md tabular-nums group-data-[size=sm]/card:text-heading-md", VALUE_TONE_CLASS[tone]), "data-kpi-value": "", children: value }), _jsx("div", { "data-slot": "kpi-card-sparkline", className: "col-span-2 mt-1 h-8 min-w-0", children: sparkline.length > 1 ? (_jsx(React.Suspense, { fallback: null, children: _jsx(ChartSparkline, { data: sparkline, className: "h-8 w-full" }) })) : null }), _jsx("p", { "data-slot": "kpi-card-change", className: "col-span-2 mt-1 line-clamp-2 min-h-10 min-w-0 text-sm text-muted-foreground", title: footerLine || undefined, children: footerLine })] }) }));
39
+ return (_jsx(Card, { size: "sm", "data-slot": "kpi-card", "data-tone": tone, render: render, variant: render ? "link" : "default", children: _jsxs(CardHeader, { className: "gap-y-1", children: [_jsxs(CardDescription, { className: "col-span-2 mb-1 flex min-h-10 min-w-0 items-start gap-0.5", children: [_jsx("span", { className: "line-clamp-2", children: label }), render ? _jsx(ChevronRight, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }) : null] }), delta ? (_jsx(CardAction, { "data-kpi-delta": delta.direction, className: "row-span-1 row-start-2 self-center", children: badge })) : null, _jsx(CardTitle, { className: cn("col-start-1 row-start-2 min-w-0 truncate text-heading-md tabular-nums group-data-[size=sm]/card:text-heading-md", VALUE_TONE_CLASS[tone]), "data-kpi-value": "", children: value }), _jsx("div", { "data-slot": "kpi-card-sparkline", className: "col-span-2 mt-1 h-8 min-w-0", children: sparkline.length > 1 ? (_jsx(React.Suspense, { fallback: null, children: _jsx(ChartSparkline, { data: sparkline, className: "h-8 w-full" }) })) : null }), _jsx("p", { "data-slot": "kpi-card-change", className: "col-span-2 mt-1 line-clamp-2 min-h-10 min-w-0 text-sm text-muted-foreground", title: footerLine || undefined, children: footerLine })] }) }));
39
40
  }
40
41
  return (_jsxs(Card, { size: "sm", "data-slot": "kpi-card", "data-tone": tone, render: render, variant: render ? "link" : "default", children: [_jsxs(CardHeader, { children: [_jsxs(CardDescription, { className: "flex min-h-10 items-start gap-0.5", children: [_jsx("span", { className: "line-clamp-2", children: label }), render ? _jsx(ChevronRight, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }) : null] }), _jsx(CardTitle, { className: cn("text-heading-md tabular-nums group-data-[size=sm]/card:text-heading-md", VALUE_TONE_CLASS[tone]), "data-kpi-value": "", children: value }), delta ? _jsx(CardAction, { "data-kpi-delta": delta.direction, children: badge }) : null] }), delta || note ? (_jsx(CardFooter, { className: "flex-nowrap", children: _jsx("span", { className: "min-w-0 truncate", title: footerLine, children: footerLine }) })) : null] }));
41
42
  }
42
- export { KpiCard };
43
+ /**
44
+ * What stands in a KpiCard's place while its page reads the figure: the card, the label's two
45
+ * lines, the value's line and, for a figure with a comparison or a note, the footer's line.
46
+ */
47
+ function KpiCardSkeleton({ footer = false }) {
48
+ return (_jsx(SkeletonRegion, { busy: true, "data-slot": "kpi-card-skeleton", children: _jsxs(Card, { size: "sm", children: [_jsxs(CardHeader, { children: [_jsx(CardDescription, { className: "min-h-10", children: _jsx(Skeleton, { boxHeight: 20, className: "max-w-full", height: 16, width: 128 }) }), _jsx(CardTitle, { children: _jsx(Skeleton, { boxHeight: 32, height: 24, width: 96 }) })] }), footer ? (_jsx(CardFooter, { children: _jsx(Skeleton, { boxHeight: 20, height: 16, width: "100%" }) })) : null] }) }));
49
+ }
50
+ export { KpiCard, KpiCardSkeleton };
@@ -5,8 +5,8 @@ export type { MessageNoticeTone };
5
5
  /**
6
6
  * A message where it changes the reader's decision (DESIGN.md "Elevation &
7
7
  * Depth", the notice paragraph):
8
- * - `action`: under the control whose write failed, as one passage with its
9
- * control beside it;
8
+ * - `action`: beside the control whose write failed, as one passage: under a
9
+ * lone control, above the buttons of a footer;
10
10
  * - `section`: at the top of the section it concerns, framed, for a condition
11
11
  * that lasts.
12
12
  */
@@ -29,7 +29,7 @@ export type MessageNoticeProps = {
29
29
  * A catalogue message about one thing on the screen.
30
30
  *
31
31
  * @family Feedback
32
- * @when "Display text that requires attention or provides additional information." (https://vercel.com/geist/note) "Use a Note for inline contextual feedback next to the field, card, or section it describes: a region change warning above a region picker, a rate-limit notice next to a usage gauge." (https://vercel.com/geist/note) "Choose `variant` by meaning: `error` for a problem the user must fix, `warning` for a consequence to acknowledge, `success` for a passed check, `secondary` for neutral information." (https://vercel.com/geist/note) Ours: a message beside the field, card or section it describes, under the control whose write failed (`action`), or atop the section whose condition lasts (`section`). The `tone` is the `variant`: `destructive` is `error`, `warning` is `warning`, `info` is `success` (a passed check or a state the product manages for the reader, drawn in the accent blue) and `neutral` is `secondary`; there is no violet or cyan.
32
+ * @when "Display text that requires attention or provides additional information." (https://vercel.com/geist/note) "Use a Note for inline contextual feedback next to the field, card, or section it describes: a region change warning above a region picker, a rate-limit notice next to a usage gauge." (https://vercel.com/geist/note) "Choose `variant` by meaning: `error` for a problem the user must fix, `warning` for a consequence to acknowledge, `success` for a passed check, `secondary` for neutral information." (https://vercel.com/geist/note) Ours: a message beside the field, card or section it describes, beside the control whose write failed (`action`: under a lone control, above the buttons of a footer, as a settings card's failed save stands above its Save), or atop the section whose condition lasts (`section`). The `tone` is the `variant`: `destructive` is `error`, `warning` is `warning`, `info` is `success` (a passed check or a state the product manages for the reader, drawn in the accent blue) and `neutral` is `secondary`; there is no violet or cyan.
33
33
  * @instead "Pick `Banner` when the message is page-level or system-wide and needs a CTA, `Toast` for transient acknowledgments, `Modal` for destructive confirmations." (https://vercel.com/geist/note) Ours: `Banner` is `NoticeBanner`, for a condition of the page's own object, and a system-wide condition is a notification in the product's inbox, never a banner; `Toast` is `showMessageToast` and `Modal` is `ConfirmDialog`. For a field's wrong value use `FieldError`. For a failed read use `EmptyState failed`.
34
34
  * @behaviour "A Note is persistent until the underlying state changes; don’t add an ad hoc dismiss control because it competes with the message." (https://vercel.com/geist/note) "One Note per concept. Stacking three Notes on a card means the page architecture, not the Note copy, is wrong." (https://vercel.com/geist/note) "The optional `NoteAction` holds a single inline CTA. Don’t pair it with a second button." (https://vercel.com/geist/note) Ours: `Alert` is its primitive. Tone `destructive` by default, `warning`, `info` or `neutral`; there is no `success` tone. Colour sits on the line, the text and the mark; the ground stays clear, and the action stays neutral. `section` is the framed note, a line 36 px high with its mark and sentence on one row and the action at its trailing edge (under 768 px the action takes its own row, full width), with or without an action; `action` is the unframed passage, its mark and sentence on one row with the action link inside the sentence, after a space. The title and the body run on as one passage, the title closed by a full stop when it has none of its own, so the two never read as one sentence; the title leads in bold (semibold in a note, medium in a passage) only when a body follows it, and stands at regular weight alone. A message worded for a notice has one action, a small default button in a section and an underlined 14 px link in the passage, and at most a second one after it (Nadia's *Ask Nadia* after *Try again*), an outline button in a section and a second link in the passage; a third is not shown. A section can draw the host's own `controls` in the action's place instead, such as a carried tree's buttons that keep their behaviour. Long words wrap, nothing truncates. A successful retry removes it. Required: the catalogue `message`, so the sentence and its mark are always drawn.
35
35
  * @words "`NoteLabel` is a 1–2 word Title Case prefix that names the topic: `Region Change`, `Rate Limit`, `Plan Limit`. Cut hedges like `Heads Up`, `FYI`, and `Note`." (https://vercel.com/geist/note) "`NoteContent` is one sentence in active voice that names the impact: `Changing this region restarts all functions.`" (https://vercel.com/geist/note) "No `variant="info"` exists; omit `variant` for the default info icon or use `variant="secondary"` for neutral copy." (https://vercel.com/geist/note) "Single-fragment labels take no period; full descriptive sentences in the body do." (https://vercel.com/geist/note) Ours: words come from the catalogue only. The message's title stands in for `NoteLabel` and `NoteContent`, in sentence case, and `info` exists as Geist's blue `success`. The action is labelled with its result: *Try again*, *Sign in*. When the message carries an action, its body does not repeat it: the link is the step, so the body ends before "Try again".
@@ -17,7 +17,7 @@ const LEAD = { action: "font-medium", section: "font-semibold" };
17
17
  * A catalogue message about one thing on the screen.
18
18
  *
19
19
  * @family Feedback
20
- * @when "Display text that requires attention or provides additional information." (https://vercel.com/geist/note) "Use a Note for inline contextual feedback next to the field, card, or section it describes: a region change warning above a region picker, a rate-limit notice next to a usage gauge." (https://vercel.com/geist/note) "Choose `variant` by meaning: `error` for a problem the user must fix, `warning` for a consequence to acknowledge, `success` for a passed check, `secondary` for neutral information." (https://vercel.com/geist/note) Ours: a message beside the field, card or section it describes, under the control whose write failed (`action`), or atop the section whose condition lasts (`section`). The `tone` is the `variant`: `destructive` is `error`, `warning` is `warning`, `info` is `success` (a passed check or a state the product manages for the reader, drawn in the accent blue) and `neutral` is `secondary`; there is no violet or cyan.
20
+ * @when "Display text that requires attention or provides additional information." (https://vercel.com/geist/note) "Use a Note for inline contextual feedback next to the field, card, or section it describes: a region change warning above a region picker, a rate-limit notice next to a usage gauge." (https://vercel.com/geist/note) "Choose `variant` by meaning: `error` for a problem the user must fix, `warning` for a consequence to acknowledge, `success` for a passed check, `secondary` for neutral information." (https://vercel.com/geist/note) Ours: a message beside the field, card or section it describes, beside the control whose write failed (`action`: under a lone control, above the buttons of a footer, as a settings card's failed save stands above its Save), or atop the section whose condition lasts (`section`). The `tone` is the `variant`: `destructive` is `error`, `warning` is `warning`, `info` is `success` (a passed check or a state the product manages for the reader, drawn in the accent blue) and `neutral` is `secondary`; there is no violet or cyan.
21
21
  * @instead "Pick `Banner` when the message is page-level or system-wide and needs a CTA, `Toast` for transient acknowledgments, `Modal` for destructive confirmations." (https://vercel.com/geist/note) Ours: `Banner` is `NoticeBanner`, for a condition of the page's own object, and a system-wide condition is a notification in the product's inbox, never a banner; `Toast` is `showMessageToast` and `Modal` is `ConfirmDialog`. For a field's wrong value use `FieldError`. For a failed read use `EmptyState failed`.
22
22
  * @behaviour "A Note is persistent until the underlying state changes; don’t add an ad hoc dismiss control because it competes with the message." (https://vercel.com/geist/note) "One Note per concept. Stacking three Notes on a card means the page architecture, not the Note copy, is wrong." (https://vercel.com/geist/note) "The optional `NoteAction` holds a single inline CTA. Don’t pair it with a second button." (https://vercel.com/geist/note) Ours: `Alert` is its primitive. Tone `destructive` by default, `warning`, `info` or `neutral`; there is no `success` tone. Colour sits on the line, the text and the mark; the ground stays clear, and the action stays neutral. `section` is the framed note, a line 36 px high with its mark and sentence on one row and the action at its trailing edge (under 768 px the action takes its own row, full width), with or without an action; `action` is the unframed passage, its mark and sentence on one row with the action link inside the sentence, after a space. The title and the body run on as one passage, the title closed by a full stop when it has none of its own, so the two never read as one sentence; the title leads in bold (semibold in a note, medium in a passage) only when a body follows it, and stands at regular weight alone. A message worded for a notice has one action, a small default button in a section and an underlined 14 px link in the passage, and at most a second one after it (Nadia's *Ask Nadia* after *Try again*), an outline button in a section and a second link in the passage; a third is not shown. A section can draw the host's own `controls` in the action's place instead, such as a carried tree's buttons that keep their behaviour. Long words wrap, nothing truncates. A successful retry removes it. Required: the catalogue `message`, so the sentence and its mark are always drawn.
23
23
  * @words "`NoteLabel` is a 1–2 word Title Case prefix that names the topic: `Region Change`, `Rate Limit`, `Plan Limit`. Cut hedges like `Heads Up`, `FYI`, and `Note`." (https://vercel.com/geist/note) "`NoteContent` is one sentence in active voice that names the impact: `Changing this region restarts all functions.`" (https://vercel.com/geist/note) "No `variant="info"` exists; omit `variant` for the default info icon or use `variant="secondary"` for neutral copy." (https://vercel.com/geist/note) "Single-fragment labels take no period; full descriptive sentences in the body do." (https://vercel.com/geist/note) Ours: words come from the catalogue only. The message's title stands in for `NoteLabel` and `NoteContent`, in sentence case, and `info` exists as Geist's blue `success`. The action is labelled with its result: *Try again*, *Sign in*. When the message carries an action, its body does not repeat it: the link is the step, so the body ends before "Try again".
@@ -25,7 +25,7 @@ export type NoticeBannerProps = {
25
25
  * A condition of the page's own object, with the fix the page offers.
26
26
  *
27
27
  * @family Feedback
28
- * @when "A prominent message that spans the full width of its container to announce important information." (https://vercel.com/geist/banner) "Used for temporary, project-wide notifications that require resolution" (https://vercel.com/geist/project-banner) "Use Project Banner for project-wide states that need resolution: overdue billing, an active rollback, attack mitigation, an expiring trial blocking deploys." (https://vercel.com/geist/project-banner) "Match `variant` to severity: `error` for critical downtime or payment-blocking states, `warning` for an exceptional state with non-immediate action, `success` for a positive temporary mitigation, `gray` for routine project-wide notices." (https://vercel.com/geist/project-banner) Ours: a condition of the page's own object that the page itself resolves, with that resolving action on the banner: a past-due subscription on its billing page, a failed refresh of the page's own reading. The `tone` is the `variant`: `destructive` is `error`, `warning` is `warning`, `info` is `success` and `neutral` is `gray`. A page gives it to its composition's `notice` (`CollectionPage`, `ObjectPage`, `OverviewPage`, `SettingsPage`), which places it under the title; a product never renders it, which `nadicodeai/page-composition` refuses (nadicode decision).
28
+ * @when "A prominent message that spans the full width of its container to announce important information." (https://vercel.com/geist/banner) "Used for temporary, project-wide notifications that require resolution" (https://vercel.com/geist/project-banner) "Use Project Banner for project-wide states that need resolution: overdue billing, an active rollback, attack mitigation, an expiring trial blocking deploys." (https://vercel.com/geist/project-banner) "Match `variant` to severity: `error` for critical downtime or payment-blocking states, `warning` for an exceptional state with non-immediate action, `success` for a positive temporary mitigation, `gray` for routine project-wide notices." (https://vercel.com/geist/project-banner) Ours: a condition of the page's own object that the page itself resolves, with that resolving action on the banner: a past-due subscription on its billing page, a failed refresh of the page's own reading. The `tone` is the `variant`: `destructive` is `error`, `warning` is `warning`, `info` is `success` and `neutral` is `gray`. A page gives it to its composition's `notice` (`CollectionPage`, `ObjectPage`, `OverviewPage`, `SettingsPage`, a `DataTable` that is the page's job, and `EntryPage` outside the shell), which places it under the title; a product never renders it, which `nadicodeai/page-composition` refuses (nadicode decision).
29
29
  * @instead "Pick `Note` for inline contextual messages tied to a single field or card, `Toast` for transient acknowledgments, `Modal` for confirmations." (https://vercel.com/geist/project-banner) Ours: there is no announcement strip. `Note` is `MessageNotice` (`placement="section"`), `Toast` is `showMessageToast` and `Modal` is `ConfirmDialog`. For a measured level use a `KpiCard` with its tone; crossing a threshold is a notification in the inbox, not a banner. A condition of the system, the setup or the staff (a connection, a stored secret, a failing job, anything a staff member fixes in settings) is a notification in the product's inbox, never a banner on a page, and the page that fixes it shows the state in its own section: "The Vercel dashboard displays a popover, which contains all relevant notifications" (https://vercel.com/docs/notifications), and the Portal's System health raises it through Knock to the bell at the sidebar's foot.
30
30
  * @behaviour "Project Banner is non-dismissible by design. If the message can be dismissed without resolving the underlying state, it isn’t banner-worthy; move it to a `Note`." (https://vercel.com/geist/project-banner) "Show one Project Banner at a time. Stacking competing banners drowns the most urgent state." (https://vercel.com/geist/project-banner) "Always pass a `callToAction` that resolves the state. A banner with no route is a dead end." (https://vercel.com/geist/project-banner) Ours: a strip as wide as its container: a filled ground with a line on its top and bottom edge only, no corners, 40 px high and centred, with the mark, the sentence and the fix on one row; under 768 px the fix drops under the sentence, aligned with its text. The title and the description run on as one passage: the title closed by a full stop when it has none of its own, leading in semibold when a description follows and at regular weight alone, the description after it on the same line, and a description that repeats the title not shown. `detail` takes its own row under the passage. Colour sits on the whole strip (ground, both lines, mark and text); the fix is an underlined link in the darkest step of the same hue (neutral: `text-foreground`) and returns to the strip's text on hover. Neutral and info take the Info mark, warning and destructive the TriangleAlert. `action` is the `callToAction`: one command, never two, never a ready-made button, and there is no close button. Required: `action`, `title`, `tone` and `liveRegion`; the mark is always drawn, and `icon` swaps the tone's mark for another lucide icon.
31
31
  * @words "`label` is one sentence in sentence case that names the impact: `Your Pro trial expires in 3 days.` Don’t open with `Heads up` or apologetic preambles." (https://vercel.com/geist/project-banner) "`callToAction.label` is Title Case `Verb + Noun` and points at the resolver: `Update Payment Method`, `Reactivate Project`, `Review Tokens`." (https://vercel.com/geist/project-banner) "Name the affected entity when the project context isn’t obvious from the surrounding chrome (`Production deployments are paused on my-project`)." (https://vercel.com/geist/project-banner) "Don’t encode severity in the copy with emoji or interjections; the variant carries that signal." (https://vercel.com/geist/project-banner) "`NoteLabel` is a 1–2 word Title Case prefix that names the topic: `Region Change`, `Rate Limit`, `Plan Limit`. Cut hedges like `Heads Up`, `FYI`, and `Note`." (https://vercel.com/geist/note) Ours: the `title` is the `label`: the one sentence, naming the condition, its impact and the object. A `description` only adds what the title leaves out, in one more sentence. Our `label` is the `NoteLabel` topic prefix. The action is sentence case, verb and noun, pointing at the resolver: "Update payment method", "Try again". No "Please". The words come from the product's catalogue code.
@@ -9,7 +9,7 @@ const LIVE_REGION_ROLE = { assertive: "alert", polite: "status", off: "note" };
9
9
  * A condition of the page's own object, with the fix the page offers.
10
10
  *
11
11
  * @family Feedback
12
- * @when "A prominent message that spans the full width of its container to announce important information." (https://vercel.com/geist/banner) "Used for temporary, project-wide notifications that require resolution" (https://vercel.com/geist/project-banner) "Use Project Banner for project-wide states that need resolution: overdue billing, an active rollback, attack mitigation, an expiring trial blocking deploys." (https://vercel.com/geist/project-banner) "Match `variant` to severity: `error` for critical downtime or payment-blocking states, `warning` for an exceptional state with non-immediate action, `success` for a positive temporary mitigation, `gray` for routine project-wide notices." (https://vercel.com/geist/project-banner) Ours: a condition of the page's own object that the page itself resolves, with that resolving action on the banner: a past-due subscription on its billing page, a failed refresh of the page's own reading. The `tone` is the `variant`: `destructive` is `error`, `warning` is `warning`, `info` is `success` and `neutral` is `gray`. A page gives it to its composition's `notice` (`CollectionPage`, `ObjectPage`, `OverviewPage`, `SettingsPage`), which places it under the title; a product never renders it, which `nadicodeai/page-composition` refuses (nadicode decision).
12
+ * @when "A prominent message that spans the full width of its container to announce important information." (https://vercel.com/geist/banner) "Used for temporary, project-wide notifications that require resolution" (https://vercel.com/geist/project-banner) "Use Project Banner for project-wide states that need resolution: overdue billing, an active rollback, attack mitigation, an expiring trial blocking deploys." (https://vercel.com/geist/project-banner) "Match `variant` to severity: `error` for critical downtime or payment-blocking states, `warning` for an exceptional state with non-immediate action, `success` for a positive temporary mitigation, `gray` for routine project-wide notices." (https://vercel.com/geist/project-banner) Ours: a condition of the page's own object that the page itself resolves, with that resolving action on the banner: a past-due subscription on its billing page, a failed refresh of the page's own reading. The `tone` is the `variant`: `destructive` is `error`, `warning` is `warning`, `info` is `success` and `neutral` is `gray`. A page gives it to its composition's `notice` (`CollectionPage`, `ObjectPage`, `OverviewPage`, `SettingsPage`, a `DataTable` that is the page's job, and `EntryPage` outside the shell), which places it under the title; a product never renders it, which `nadicodeai/page-composition` refuses (nadicode decision).
13
13
  * @instead "Pick `Note` for inline contextual messages tied to a single field or card, `Toast` for transient acknowledgments, `Modal` for confirmations." (https://vercel.com/geist/project-banner) Ours: there is no announcement strip. `Note` is `MessageNotice` (`placement="section"`), `Toast` is `showMessageToast` and `Modal` is `ConfirmDialog`. For a measured level use a `KpiCard` with its tone; crossing a threshold is a notification in the inbox, not a banner. A condition of the system, the setup or the staff (a connection, a stored secret, a failing job, anything a staff member fixes in settings) is a notification in the product's inbox, never a banner on a page, and the page that fixes it shows the state in its own section: "The Vercel dashboard displays a popover, which contains all relevant notifications" (https://vercel.com/docs/notifications), and the Portal's System health raises it through Knock to the bell at the sidebar's foot.
14
14
  * @behaviour "Project Banner is non-dismissible by design. If the message can be dismissed without resolving the underlying state, it isn’t banner-worthy; move it to a `Note`." (https://vercel.com/geist/project-banner) "Show one Project Banner at a time. Stacking competing banners drowns the most urgent state." (https://vercel.com/geist/project-banner) "Always pass a `callToAction` that resolves the state. A banner with no route is a dead end." (https://vercel.com/geist/project-banner) Ours: a strip as wide as its container: a filled ground with a line on its top and bottom edge only, no corners, 40 px high and centred, with the mark, the sentence and the fix on one row; under 768 px the fix drops under the sentence, aligned with its text. The title and the description run on as one passage: the title closed by a full stop when it has none of its own, leading in semibold when a description follows and at regular weight alone, the description after it on the same line, and a description that repeats the title not shown. `detail` takes its own row under the passage. Colour sits on the whole strip (ground, both lines, mark and text); the fix is an underlined link in the darkest step of the same hue (neutral: `text-foreground`) and returns to the strip's text on hover. Neutral and info take the Info mark, warning and destructive the TriangleAlert. `action` is the `callToAction`: one command, never two, never a ready-made button, and there is no close button. Required: `action`, `title`, `tone` and `liveRegion`; the mark is always drawn, and `icon` swaps the tone's mark for another lucide icon.
15
15
  * @words "`label` is one sentence in sentence case that names the impact: `Your Pro trial expires in 3 days.` Don’t open with `Heads up` or apologetic preambles." (https://vercel.com/geist/project-banner) "`callToAction.label` is Title Case `Verb + Noun` and points at the resolver: `Update Payment Method`, `Reactivate Project`, `Review Tokens`." (https://vercel.com/geist/project-banner) "Name the affected entity when the project context isn’t obvious from the surrounding chrome (`Production deployments are paused on my-project`)." (https://vercel.com/geist/project-banner) "Don’t encode severity in the copy with emoji or interjections; the variant carries that signal." (https://vercel.com/geist/project-banner) "`NoteLabel` is a 1–2 word Title Case prefix that names the topic: `Region Change`, `Rate Limit`, `Plan Limit`. Cut hedges like `Heads Up`, `FYI`, and `Note`." (https://vercel.com/geist/note) Ours: the `title` is the `label`: the one sentence, naming the condition, its impact and the object. A `description` only adds what the title leaves out, in one more sentence. Our `label` is the `NoteLabel` topic prefix. The action is sentence case, verb and noun, pointing at the resolver: "Update payment method", "Try again". No "Please". The words come from the product's catalogue code.
@@ -1,10 +1,16 @@
1
- import type { ComponentProps, ReactElement, ReactNode } from "react";
1
+ import { type ComponentProps, type ReactElement, type ReactNode } from "react";
2
2
  import { type NoticeBannerProps } from "./notice-banner.js";
3
3
  import { type IdentityMarkProps } from "./identity-mark.js";
4
4
  import { type CardActions } from "./page-actions.js";
5
5
  type ObjectPageFact = {
6
6
  label: string;
7
7
  value: ReactNode;
8
+ url?: never;
9
+ } | {
10
+ label: string;
11
+ value: string;
12
+ /** The value is a web address, such as a company's website: it wraps only after `://`, a dot or a slash. */
13
+ url: true;
8
14
  };
9
15
  export type ObjectPageEntry = {
10
16
  /** The row's noun phrase: "Deployment settings", "Build logs". */
@@ -56,7 +62,7 @@ export type ObjectPageProps = {
56
62
  * @family Compositions
57
63
  * @when One thing a person opened from a list and now reads or acts on: a customer, a partner, an Installation, a Library entry.
58
64
  * @instead "Use Context Card to reveal entity metadata on hover or focus: a user, a deployment, a project, an API key." (https://vercel.com/geist/context-card) Ours: that hover is a `HoverCard`, drawn inside this package by a component such as `RecordTime`, never this page. A list of records is a CollectionPage; a page of settings only is a SettingsPage, whose cards are SettingsSections; an Agent's Edit page in Nadia's window opens on its AgentProfileCard, the documented exception. A card of values a person saves is a setting card, never this one.
59
- * @behaviour "For a static key/value metadata block on a detail page, use `Description`." (https://vercel.com/geist/entity) "The right column holds at most one or two controls. If the row needs more, move secondary actions into a `Dots Menu`." (https://vercel.com/geist/entity) "Lead the left column with a scannable identifier: an `Avatar` or icon, a Title Case label, then sentence-case secondary metadata (`Member since Mar 14, 2026`)." (https://vercel.com/geist/entity) "Don’t put interactive controls in the title slot. Buttons, menus, and links belong in the content (`<dd>`) or in the parent layout, not the label (`<dt>`)." (https://vercel.com/geist/description) Ours: where the product draws a path, the path above the page names the object's parent, and the product's section navigation stands between the path and the card. As Vercel's deployment page (Deployment Details, then its steps), the object card is the first card of the page: a header bar with the name at the start and the object's commands at the end (a secondary, then the primary as the filled button, then the three dots, in `PageActions`' order, on the name's row while the name keeps 128 px, as on a phone, and under it otherwise; the primary is the one thing the object waits on its viewer for, such as approving a company that waits for approval, beside its alternative as the secondary, and an object with nothing waiting has none), the mark at 64 stands beside the name and optional line in the header, for every kind of object, with no preview box, since a product object has no picture of itself as a deployment has its screenshot; full-width facts follow in four columns once they have 36rem and two below (an object that exists always has one; an object not made yet, such as an account's plan before it chooses one, has none, and its card is the header alone, its name saying so and, for a viewer who may, its primary making it), each a muted label over its value in body text, then an optional footer with a hint at the start and one link at the end. Optional `entries` follow in a card of their own 12 px under it: rows that open one by one, each with its chevron first (it turns down when open), its title, and its summary at the trailing edge, as Vercel's Build Logs and Deployment Checks rows; an open entry's panel starts under its title, and on a card narrower than 28 rem, as on a phone, at the card's edge, so its sections keep the chevron's room; an entry marked `defaultOpen` opens with the page, for a link that names it. The footer takes a link only, so no Save or other command of the object fits in it; the object's changes live in its sections, each a setting card with its own footer. The sections follow, 24 apart, each an `ObjectSection`, `ObjectFacts`, a `RecordList` with its `heading`, a `SettingsSection` or an `ActivityFeed`, drawing its own states; a section earns a card when it owns a decision, never for every label and value. The card is neutral; colour belongs to the company's compact identity, a semantic fact value, or an entry's status summary, with no coloured card ground.
65
+ * @behaviour "For a static key/value metadata block on a detail page, use `Description`." (https://vercel.com/geist/entity) "The right column holds at most one or two controls. If the row needs more, move secondary actions into a `Dots Menu`." (https://vercel.com/geist/entity) "Lead the left column with a scannable identifier: an `Avatar` or icon, a Title Case label, then sentence-case secondary metadata (`Member since Mar 14, 2026`)." (https://vercel.com/geist/entity) "Don’t put interactive controls in the title slot. Buttons, menus, and links belong in the content (`<dd>`) or in the parent layout, not the label (`<dt>`)." (https://vercel.com/geist/description) Ours: where the product draws a path, the path above the page names the object's parent, and the product's section navigation stands between the path and the card. As Vercel's deployment page (Deployment Details, then its steps), the object card is the first card of the page: a header bar with the name at the start and the object's commands at the end (a secondary, then the primary as the filled button, then the three dots, in `PageActions`' order, on the name's row while the name keeps 128 px, as on a phone, and under it otherwise; the primary is the one thing the object waits on its viewer for, such as approving a company that waits for approval, beside its alternative as the secondary, and an object with nothing waiting has none), the mark at 64 stands beside the name and optional line in the header, for every kind of object, with no preview box, since a product object has no picture of itself as a deployment has its screenshot; full-width facts follow in four columns once they have 36rem and two below (an object that exists always has one; an object not made yet, such as an account's plan before it chooses one, has none, and its card is the header alone, its name saying so and, for a viewer who may, its primary making it), each a muted label over its value in body text, then an optional footer with a hint at the start and one link at the end. Optional `entries` follow in a card of their own 12 px under it: rows that open one by one, each with its chevron first (it turns down when open), its title, and its summary at the trailing edge, as Vercel's Build Logs and Deployment Checks rows; an open entry's panel starts under its title, and on a card narrower than 28 rem, as on a phone, at the card's edge, so its sections keep the chevron's room; an entry marked `defaultOpen` opens with the page, for a link that names it. The footer takes a link only, so no Save or other command of the object fits in it; the object's changes live in its sections, each a setting card with its own footer. The sections follow, 24 apart, each an `ObjectSection`, `ObjectFacts`, a `RecordList` with its `heading`, a `SettingsSection` or an `ActivityFeed`, drawing its own states; a section earns a card when it owns a decision, never for every label and value. The card is neutral; colour belongs to the company's compact identity, a semantic fact value, or an entry's status summary, with no coloured card ground. A fact marked `url`, such as a company's website, wraps only after `://`, a dot or a slash, never inside a word, and keeps the whole address as its text (design inspection, 2026-11-07).
60
66
  * @words "Keep right-column buttons Verb + Noun (`Remove Member`, `Resend Invite`). Bare verbs like `Remove` or `Confirm` lose context once the row scrolls offscreen." (https://vercel.com/geist/entity) "Title slot is Title Case noun (`Last Deployed`, `Build Duration`); content is sentence case unless the value is a literal identifier, ID, or timestamp that should be preserved verbatim." (https://vercel.com/geist/description) Ours: sentence case throughout. The name as the object is called everywhere else; the line says what it is and whose ("Customer of Partner Alpha · since 3 August 2026"); a fact's label is a noun ("Plan"), its value the figure; an entry's title is a noun phrase; the hint is one sentence ("To update it, push to the main branch."); the link names where it goes ("Deployments"); the menu's trigger reads "More for {name}".
61
67
  * @access "Geist renders `<dl>`/`<dt>`/`<dd>` so screen readers announce each key/value pair as a definition." (https://vercel.com/geist/description) "Don’t wrap the component in extra paragraphs that break the list semantics." (https://vercel.com/geist/description) Ours: with `headingProps` the name is the page's h1; without them it is text, for a product whose chrome already titles the page. The mark is decorative beside the name. Each entry is an h2 heading holding a button with `aria-expanded` that controls its panel.
62
68
  */
@@ -1 +1 @@
1
- {"version":3,"file":"object-page.d.ts","sourceRoot":"","sources":["../../src/components/object-page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrE,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAIlF,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,KAAK,WAAW,EAAqC,MAAM,gBAAgB,CAAC;AAErF,KAAK,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG;IAC5B,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,IAAI,EAAE,YAAY,CAAC;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,kHAAkH;IAClH,IAAI,EAAE,MAAM,CAAC;IACb,kGAAkG;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,2FAA2F;IAC3F,OAAO,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACrC,4FAA4F;IAC5F,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,4IAA4I;IAC5I,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAQ,GACT,EAAE,eAAe,GAAG,YAAY,CA+FhC"}
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment } from "react";
2
3
  import { FooterStrip } from "../internal/footer-strip.js";
3
4
  import { NoticeBanner } from "./notice-banner.js";
4
5
  import { cn } from "../lib/utils.js";
@@ -6,6 +7,10 @@ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./
6
7
  import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "./card.js";
7
8
  import { IdentityMark } from "./identity-mark.js";
8
9
  import { CardActionsRow, PageCommandButton } from "./page-actions.js";
10
+ const AFTER_DOT_OR_SLASH = /(?<=[./])(?!\/)/;
11
+ function UrlValue({ url }) {
12
+ return url.split(AFTER_DOT_OR_SLASH).map((part, index) => (_jsxs(Fragment, { children: [index > 0 ? _jsx("wbr", {}) : null, part] }, `${index}:${part}`)));
13
+ }
9
14
  /**
10
15
  * One object's page: the object card with its name, commands, facts, rows that open and one link
11
16
  * elsewhere, then its sections as cards.
@@ -13,13 +18,13 @@ import { CardActionsRow, PageCommandButton } from "./page-actions.js";
13
18
  * @family Compositions
14
19
  * @when One thing a person opened from a list and now reads or acts on: a customer, a partner, an Installation, a Library entry.
15
20
  * @instead "Use Context Card to reveal entity metadata on hover or focus: a user, a deployment, a project, an API key." (https://vercel.com/geist/context-card) Ours: that hover is a `HoverCard`, drawn inside this package by a component such as `RecordTime`, never this page. A list of records is a CollectionPage; a page of settings only is a SettingsPage, whose cards are SettingsSections; an Agent's Edit page in Nadia's window opens on its AgentProfileCard, the documented exception. A card of values a person saves is a setting card, never this one.
16
- * @behaviour "For a static key/value metadata block on a detail page, use `Description`." (https://vercel.com/geist/entity) "The right column holds at most one or two controls. If the row needs more, move secondary actions into a `Dots Menu`." (https://vercel.com/geist/entity) "Lead the left column with a scannable identifier: an `Avatar` or icon, a Title Case label, then sentence-case secondary metadata (`Member since Mar 14, 2026`)." (https://vercel.com/geist/entity) "Don’t put interactive controls in the title slot. Buttons, menus, and links belong in the content (`<dd>`) or in the parent layout, not the label (`<dt>`)." (https://vercel.com/geist/description) Ours: where the product draws a path, the path above the page names the object's parent, and the product's section navigation stands between the path and the card. As Vercel's deployment page (Deployment Details, then its steps), the object card is the first card of the page: a header bar with the name at the start and the object's commands at the end (a secondary, then the primary as the filled button, then the three dots, in `PageActions`' order, on the name's row while the name keeps 128 px, as on a phone, and under it otherwise; the primary is the one thing the object waits on its viewer for, such as approving a company that waits for approval, beside its alternative as the secondary, and an object with nothing waiting has none), the mark at 64 stands beside the name and optional line in the header, for every kind of object, with no preview box, since a product object has no picture of itself as a deployment has its screenshot; full-width facts follow in four columns once they have 36rem and two below (an object that exists always has one; an object not made yet, such as an account's plan before it chooses one, has none, and its card is the header alone, its name saying so and, for a viewer who may, its primary making it), each a muted label over its value in body text, then an optional footer with a hint at the start and one link at the end. Optional `entries` follow in a card of their own 12 px under it: rows that open one by one, each with its chevron first (it turns down when open), its title, and its summary at the trailing edge, as Vercel's Build Logs and Deployment Checks rows; an open entry's panel starts under its title, and on a card narrower than 28 rem, as on a phone, at the card's edge, so its sections keep the chevron's room; an entry marked `defaultOpen` opens with the page, for a link that names it. The footer takes a link only, so no Save or other command of the object fits in it; the object's changes live in its sections, each a setting card with its own footer. The sections follow, 24 apart, each an `ObjectSection`, `ObjectFacts`, a `RecordList` with its `heading`, a `SettingsSection` or an `ActivityFeed`, drawing its own states; a section earns a card when it owns a decision, never for every label and value. The card is neutral; colour belongs to the company's compact identity, a semantic fact value, or an entry's status summary, with no coloured card ground.
21
+ * @behaviour "For a static key/value metadata block on a detail page, use `Description`." (https://vercel.com/geist/entity) "The right column holds at most one or two controls. If the row needs more, move secondary actions into a `Dots Menu`." (https://vercel.com/geist/entity) "Lead the left column with a scannable identifier: an `Avatar` or icon, a Title Case label, then sentence-case secondary metadata (`Member since Mar 14, 2026`)." (https://vercel.com/geist/entity) "Don’t put interactive controls in the title slot. Buttons, menus, and links belong in the content (`<dd>`) or in the parent layout, not the label (`<dt>`)." (https://vercel.com/geist/description) Ours: where the product draws a path, the path above the page names the object's parent, and the product's section navigation stands between the path and the card. As Vercel's deployment page (Deployment Details, then its steps), the object card is the first card of the page: a header bar with the name at the start and the object's commands at the end (a secondary, then the primary as the filled button, then the three dots, in `PageActions`' order, on the name's row while the name keeps 128 px, as on a phone, and under it otherwise; the primary is the one thing the object waits on its viewer for, such as approving a company that waits for approval, beside its alternative as the secondary, and an object with nothing waiting has none), the mark at 64 stands beside the name and optional line in the header, for every kind of object, with no preview box, since a product object has no picture of itself as a deployment has its screenshot; full-width facts follow in four columns once they have 36rem and two below (an object that exists always has one; an object not made yet, such as an account's plan before it chooses one, has none, and its card is the header alone, its name saying so and, for a viewer who may, its primary making it), each a muted label over its value in body text, then an optional footer with a hint at the start and one link at the end. Optional `entries` follow in a card of their own 12 px under it: rows that open one by one, each with its chevron first (it turns down when open), its title, and its summary at the trailing edge, as Vercel's Build Logs and Deployment Checks rows; an open entry's panel starts under its title, and on a card narrower than 28 rem, as on a phone, at the card's edge, so its sections keep the chevron's room; an entry marked `defaultOpen` opens with the page, for a link that names it. The footer takes a link only, so no Save or other command of the object fits in it; the object's changes live in its sections, each a setting card with its own footer. The sections follow, 24 apart, each an `ObjectSection`, `ObjectFacts`, a `RecordList` with its `heading`, a `SettingsSection` or an `ActivityFeed`, drawing its own states; a section earns a card when it owns a decision, never for every label and value. The card is neutral; colour belongs to the company's compact identity, a semantic fact value, or an entry's status summary, with no coloured card ground. A fact marked `url`, such as a company's website, wraps only after `://`, a dot or a slash, never inside a word, and keeps the whole address as its text (design inspection, 2026-11-07).
17
22
  * @words "Keep right-column buttons Verb + Noun (`Remove Member`, `Resend Invite`). Bare verbs like `Remove` or `Confirm` lose context once the row scrolls offscreen." (https://vercel.com/geist/entity) "Title slot is Title Case noun (`Last Deployed`, `Build Duration`); content is sentence case unless the value is a literal identifier, ID, or timestamp that should be preserved verbatim." (https://vercel.com/geist/description) Ours: sentence case throughout. The name as the object is called everywhere else; the line says what it is and whose ("Customer of Partner Alpha · since 3 August 2026"); a fact's label is a noun ("Plan"), its value the figure; an entry's title is a noun phrase; the hint is one sentence ("To update it, push to the main branch."); the link names where it goes ("Deployments"); the menu's trigger reads "More for {name}".
18
23
  * @access "Geist renders `<dl>`/`<dt>`/`<dd>` so screen readers announce each key/value pair as a definition." (https://vercel.com/geist/description) "Don’t wrap the component in extra paragraphs that break the list semantics." (https://vercel.com/geist/description) Ours: with `headingProps` the name is the page's h1; without them it is text, for a product whose chrome already titles the page. The mark is decorative beside the name. Each entry is an h2 heading holding a button with `aria-expanded` that controls its panel.
19
24
  */
20
25
  export function ObjectPage({ mark, name, headingProps, description, facts, actions, entries, footer, notice, children, }) {
21
26
  const title = headingProps ? (_jsx("h1", { ...headingProps, className: cn("outline-none", headingProps.className), children: name })) : (name);
22
- return (_jsxs("div", { className: "grid min-w-0 gap-6", "data-slot": "object-page", children: [notice ? _jsx(NoticeBanner, { ...notice }) : null, _jsxs("div", { className: "grid min-w-0 gap-3", children: [_jsxs(Card, { className: "min-w-0", render: _jsx("div", { "data-slot": "object-card" }), size: "sm", children: [_jsxs(CardHeader, { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-3", facts && "border-b"), children: [_jsxs("div", { className: cn("flex min-w-0 flex-1 items-center gap-4", actions?.menu && !actions.secondary && !actions.primary ? "basis-0" : "basis-64"), children: [_jsx(IdentityMark, { ...mark, size: 64 }), _jsxs("div", { className: "grid min-w-0 gap-1", children: [_jsx(CardTitle, { className: "min-w-0 wrap-break-word group-data-[size=sm]/card:text-heading-sm", children: title }), description ? _jsx(CardDescription, { children: description }) : null] })] }), actions ? _jsx(CardActionsRow, { ...actions }) : null] }), facts ? (_jsx(CardContent, { className: "grid min-w-0 gap-x-6 gap-y-5", children: _jsx("div", { className: "@container/object-page-facts grid min-w-0 content-start gap-4", children: _jsx("dl", { className: "grid min-w-0 grid-cols-2 gap-x-6 gap-y-4 @xl/object-page-facts:grid-cols-4", "data-slot": "object-page-facts", children: facts.map((fact) => (_jsxs("div", { className: "grid min-w-0 content-start gap-1", children: [_jsx("dt", { className: "text-label-sm text-muted-foreground", children: fact.label }), _jsx("dd", { className: "min-w-0 text-body-sm wrap-break-word text-foreground", children: fact.value })] }, fact.label))) }) }) })) : null, footer ? (_jsx(FooterStrip, { hint: footer.hint, hintSlot: "object-page-hint", children: _jsx(PageCommandButton, { command: footer.link, variant: "outline" }) })) : null] }), entries && entries.length > 0 ? (_jsx(Card, { className: "@container/object-page-entries min-w-0 py-0", render: _jsx("div", { "data-slot": "object-page-entries" }), size: "sm", children: _jsx(Accordion, { className: "*:last:border-b-0", defaultValue: entries
27
+ return (_jsxs("div", { className: "grid min-w-0 gap-6", "data-slot": "object-page", children: [notice ? _jsx(NoticeBanner, { ...notice }) : null, _jsxs("div", { className: "grid min-w-0 gap-3", children: [_jsxs(Card, { className: "min-w-0", render: _jsx("div", { "data-slot": "object-card" }), size: "sm", children: [_jsxs(CardHeader, { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-3", facts && "border-b"), children: [_jsxs("div", { className: cn("flex min-w-0 flex-1 items-center gap-4", actions?.menu && !actions.secondary && !actions.primary ? "basis-0" : "basis-64"), children: [_jsx(IdentityMark, { ...mark, size: 64 }), _jsxs("div", { className: "grid min-w-0 gap-1", children: [_jsx(CardTitle, { className: "min-w-0 wrap-break-word group-data-[size=sm]/card:text-heading-sm", children: title }), description ? _jsx(CardDescription, { children: description }) : null] })] }), actions ? _jsx(CardActionsRow, { ...actions }) : null] }), facts ? (_jsx(CardContent, { className: "grid min-w-0 gap-x-6 gap-y-5", children: _jsx("div", { className: "@container/object-page-facts grid min-w-0 content-start gap-4", children: _jsx("dl", { className: "grid min-w-0 grid-cols-2 gap-x-6 gap-y-4 @xl/object-page-facts:grid-cols-4", "data-slot": "object-page-facts", children: facts.map((fact) => (_jsxs("div", { className: "grid min-w-0 content-start gap-1", children: [_jsx("dt", { className: "text-label-sm text-muted-foreground", children: fact.label }), _jsx("dd", { className: "min-w-0 text-body-sm wrap-break-word text-foreground", children: fact.url ? _jsx(UrlValue, { url: fact.value }) : fact.value })] }, fact.label))) }) }) })) : null, footer ? (_jsx(FooterStrip, { hint: footer.hint, hintSlot: "object-page-hint", children: _jsx(PageCommandButton, { command: footer.link, variant: "outline" }) })) : null] }), entries && entries.length > 0 ? (_jsx(Card, { className: "@container/object-page-entries min-w-0 py-0", render: _jsx("div", { "data-slot": "object-page-entries" }), size: "sm", children: _jsx(Accordion, { className: "*:last:border-b-0", defaultValue: entries
23
28
  .filter((entry) => entry.defaultOpen)
24
29
  .map((entry) => entry.title), multiple: true, size: "small", children: entries.map((entry) => (_jsxs(AccordionItem, { value: entry.title, children: [_jsxs(AccordionTrigger, { className: "justify-start gap-3 px-(--card-spacing) group-data-[size=small]/accordion:text-body-sm focus-visible:-outline-offset-2 *:data-[slot=accordion-trigger-icon]:order-first *:data-[slot=accordion-trigger-icon]:text-muted-foreground", level: 2, children: [_jsx("span", { className: "min-w-0 flex-1", children: entry.title }), entry.summary] }), _jsx(AccordionContent, { className: "px-(--card-spacing) @md/object-page-entries:ps-[calc(var(--card-spacing)+1.75rem)]", children: entry.children })] }, entry.title))) }) })) : null] }), children] }));
25
30
  }
@@ -1,4 +1,4 @@
1
- import { type ReactNode } from "react";
1
+ import { type ReactElement, type ReactNode } from "react";
2
2
  import { type CardActions, type PageCommand } from "./page-actions.js";
3
3
  type ObjectFactShape = {
4
4
  label: string;
@@ -20,6 +20,13 @@ export type ObjectFact = ObjectFactShape & ({
20
20
  /** A value that ends in an ellipsis on one line instead of wrapping; a string value is also whole in its title. Not available on a `block` fact. */
21
21
  ellipsis?: boolean;
22
22
  });
23
+ /** The way back to the list a section's record was chosen from, with nothing chosen. */
24
+ export type ObjectSectionBack = {
25
+ /** Names where it leads: "Back to statements". */
26
+ label: string;
27
+ /** The product's router link, such as `<Link href="/statements" />`. */
28
+ link: ReactElement;
29
+ };
23
30
  /** A card's footer: one muted sentence at its start and the card's one command at its end. */
24
31
  export type CardFooterLine = {
25
32
  hint: string;
@@ -34,21 +41,34 @@ export type CardFooterLine = {
34
41
  * @family Compositions
35
42
  * @when A part of an ObjectPage a person reads or changes on its own: a customer's Company details, an Agent's Instructions, a Library entry's source, a Partner's services in Billing. Also a setup card on an overview, its body the `NumberedSteps` a person follows, as Vercel's Speed Insights *Get Started*: the Dashboard's setup guide; and a card among a person's settings that holds no setting, such as their nadicode card on Profile.
36
43
  * @instead Values a person edits and saves together are a SettingsSection; a list of the object's records is a RecordList with its heading; a passing condition is a MessageNotice.
37
- * @behaviour As Vercel's Spend Management, Payment Method and AI Gateway Credit cards on its Billing page: a resting card, its title and the one-sentence description directly under it, both always given; at the header's trailing edge `actions`, drawn as every card's header draws them (`CardActions`: the muted `meta`, then up to two secondaries as outline buttons, the primary as the filled one, then the three dots), so a way to another page is a secondary with its `link`, an outline button named for the page, never a text link; then its body; then the optional `footer`, a strip under a divider with its sentence at the start and its one command at the end as an outline button. No icon in the header. Neutral throughout. A section that edits in place swaps to the same section as a `SettingsSection`, with Cancel (`save.cancel`) before Save.
38
- * @words The title names what the section holds ("Company", "Instructions"); the description says in one sentence what it holds or lets a person change; a command is a verb on it ("Edit"), and a way to another page is that page's name ("Statements"); `meta` is a short count or time ("2 of 5 Agents"); the footer's sentence is a limit or where the section's object changes ("At most three cards.").
39
- * @access The title is a heading one level under the page (h2), deeper only under another heading through `headingLevel`.
44
+ * @behaviour `cardSize="sm"` draws the compact card, as `Card`'s `size`, for a section that stands beside fuller cards (nadicode decision). As Vercel's Spend Management, Payment Method and AI Gateway Credit cards on its Billing page: a resting card, its title and the one-sentence description directly under it, both always given; a `status` right after the title, as SettingsSection and TableCard place theirs ("Provisional"), makes the header one record's, as a Statement's cycle: the title at medium weight, and a lone `meta` in the caption's size that keeps the title's row on a narrow card (nadicode decision); at the header's trailing edge `actions`, drawn as every card's header draws them (`CardActions`: the muted `meta`, then up to two secondaries as outline buttons, the primary as the filled one, then the three dots), so a way to another page is a secondary with its `link`, an outline button named for the page, never a text link; then its body; then the optional `footer`, a strip under a divider with its sentence at the start and its one command at the end as an outline button. No icon in the header. Neutral throughout. A section that shows one record chosen from a list on the same page, such as an issued Statement opened from its history, takes `back`: the way to the list with nothing chosen, a quiet link with a leading arrow above the title, never a button among the `actions` (nadicode decision). A section that edits in place swaps to the same section as a `SettingsSection`, with Cancel (`save.cancel`) before Save. While its page reads it, `ObjectSectionSkeleton` stands in its place: the same card, bars for the title and the description at their line heights, then `rows` lines of the body, with no words (nadicode decision).
45
+ * @words The title names what the section holds ("Company", "Instructions"); the description says in one sentence what it holds or lets a person change; a command is a verb on it ("Edit"), and a way to another page is that page's name ("Statements"); `meta` is a short count or time ("2 of 5 Agents"); `back` says where it leads ("Back to statements"); the footer's sentence is a limit or where the section's object changes ("At most three cards.").
46
+ * @access The title is a heading one level under the page (h2), deeper only under another heading through `headingLevel`; a `status` stands beside it, outside it. `back` is a real link before the title in reading order. `ObjectSectionSkeleton` is busy and its bars are hidden from assistive technology.
40
47
  */
41
- export declare function ObjectSection({ title, description, actions, footer, children, headingLevel, }: {
48
+ export declare function ObjectSection({ title, status, description, actions, back, footer, children, headingLevel, cardSize, }: {
42
49
  title: string;
50
+ /** The state of what the section holds, as a `StatusBadge` right after the title: "Provisional". */
51
+ status?: ReactElement | undefined;
43
52
  /** The one sentence under the title that says what the section holds or changes. */
44
53
  description: NonNullable<ReactNode>;
45
54
  /** The section's commands at its header's trailing edge, a way to another page among them. */
46
55
  actions?: CardActions;
56
+ /** Above the title, the way back to the list this section's record was chosen from. */
57
+ back?: ObjectSectionBack | undefined;
47
58
  /** The strip under the body: a limit or where the object changes, and the one command after it. */
48
59
  footer?: CardFooterLine;
49
60
  children: ReactNode;
50
61
  /** A card titles a section of its page; nest it deeper only under another heading. */
51
62
  headingLevel?: 2 | 3 | 4;
63
+ /** The card's own density, as `Card`'s `size`: `sm` for a section that stands beside fuller cards. */
64
+ cardSize?: "default" | "sm";
65
+ }): import("react").JSX.Element;
66
+ /**
67
+ * What stands in an ObjectSection's place while its page reads it: its card, a bar for the title
68
+ * and one for the description, and `rows` lines of its body.
69
+ */
70
+ export declare function ObjectSectionSkeleton({ rows }: {
71
+ rows: number;
52
72
  }): import("react").JSX.Element;
53
73
  /**
54
74
  * An object's facts as labelled values in a grid, inside one of its sections.
@@ -1 +1 @@
1
- {"version":3,"file":"object-workspace.d.ts","sourceRoot":"","sources":["../../src/components/object-workspace.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAK9C,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,WAAW,EAEjB,MAAM,gBAAgB,CAAC;AAGxB,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,gGAAgG;IAChG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,eAAe,GACtC,CACI;IACE;;;OAGG;IACH,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB,GACD;IACE,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,oJAAoJ;IACpJ,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CACJ,CAAC;AAEJ,8FAA8F;AAC9F,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,CAAA;CAAE,GACvC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC;AAE5C;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,WAAW,EACX,OAAO,EACP,MAAM,EACN,QAAQ,EACR,YAAgB,GACjB,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,WAAW,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACpC,8FAA8F;IAC9F,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,mGAAmG;IACnG,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,sFAAsF;IACtF,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC1B,+BAsBA;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAmB,GACpB,EAAE;IACD,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC,+BAyDA"}
1
+ {"version":3,"file":"object-workspace.d.ts","sourceRoot":"","sources":["../../src/components/object-workspace.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAMjE,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,WAAW,EAEjB,MAAM,gBAAgB,CAAC;AAKxB,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,gGAAgG;IAChG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,KAAK,CAAC,EAA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,QAAQ,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;CAC7B,+BA+CA;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAoB/D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAmB,GACpB,EAAE;IACD,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC,+BAyDA"}
@@ -1,23 +1,46 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Info } from "lucide-react";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRender } from "@base-ui/react/use-render";
3
+ import { ArrowLeft, Info } from "lucide-react";
3
4
  import { useId } from "react";
4
5
  import { cn } from "../lib/utils.js";
6
+ import { hasCardActions } from "../internal/card-actions.js";
5
7
  import { FooterStrip } from "../internal/footer-strip.js";
6
8
  import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "./card.js";
7
9
  import { CardActionsRow, PageCommandButton, } from "./page-actions.js";
10
+ import { textLinkVariants } from "./text-link.js";
11
+ import { Skeleton, SkeletonRegion } from "./skeleton.js";
8
12
  import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
13
+ function BackLink({ label, link }) {
14
+ return useRender({
15
+ defaultTagName: "a",
16
+ render: link,
17
+ props: {
18
+ className: textLinkVariants({ kind: "quiet" }),
19
+ children: (_jsxs(_Fragment, { children: [_jsx(ArrowLeft, { "aria-hidden": "true" }), label] })),
20
+ },
21
+ });
22
+ }
9
23
  /**
10
24
  * A section of an object's page: a card that owns one decision about the object.
11
25
  *
12
26
  * @family Compositions
13
27
  * @when A part of an ObjectPage a person reads or changes on its own: a customer's Company details, an Agent's Instructions, a Library entry's source, a Partner's services in Billing. Also a setup card on an overview, its body the `NumberedSteps` a person follows, as Vercel's Speed Insights *Get Started*: the Dashboard's setup guide; and a card among a person's settings that holds no setting, such as their nadicode card on Profile.
14
28
  * @instead Values a person edits and saves together are a SettingsSection; a list of the object's records is a RecordList with its heading; a passing condition is a MessageNotice.
15
- * @behaviour As Vercel's Spend Management, Payment Method and AI Gateway Credit cards on its Billing page: a resting card, its title and the one-sentence description directly under it, both always given; at the header's trailing edge `actions`, drawn as every card's header draws them (`CardActions`: the muted `meta`, then up to two secondaries as outline buttons, the primary as the filled one, then the three dots), so a way to another page is a secondary with its `link`, an outline button named for the page, never a text link; then its body; then the optional `footer`, a strip under a divider with its sentence at the start and its one command at the end as an outline button. No icon in the header. Neutral throughout. A section that edits in place swaps to the same section as a `SettingsSection`, with Cancel (`save.cancel`) before Save.
16
- * @words The title names what the section holds ("Company", "Instructions"); the description says in one sentence what it holds or lets a person change; a command is a verb on it ("Edit"), and a way to another page is that page's name ("Statements"); `meta` is a short count or time ("2 of 5 Agents"); the footer's sentence is a limit or where the section's object changes ("At most three cards.").
17
- * @access The title is a heading one level under the page (h2), deeper only under another heading through `headingLevel`.
29
+ * @behaviour `cardSize="sm"` draws the compact card, as `Card`'s `size`, for a section that stands beside fuller cards (nadicode decision). As Vercel's Spend Management, Payment Method and AI Gateway Credit cards on its Billing page: a resting card, its title and the one-sentence description directly under it, both always given; a `status` right after the title, as SettingsSection and TableCard place theirs ("Provisional"), makes the header one record's, as a Statement's cycle: the title at medium weight, and a lone `meta` in the caption's size that keeps the title's row on a narrow card (nadicode decision); at the header's trailing edge `actions`, drawn as every card's header draws them (`CardActions`: the muted `meta`, then up to two secondaries as outline buttons, the primary as the filled one, then the three dots), so a way to another page is a secondary with its `link`, an outline button named for the page, never a text link; then its body; then the optional `footer`, a strip under a divider with its sentence at the start and its one command at the end as an outline button. No icon in the header. Neutral throughout. A section that shows one record chosen from a list on the same page, such as an issued Statement opened from its history, takes `back`: the way to the list with nothing chosen, a quiet link with a leading arrow above the title, never a button among the `actions` (nadicode decision). A section that edits in place swaps to the same section as a `SettingsSection`, with Cancel (`save.cancel`) before Save. While its page reads it, `ObjectSectionSkeleton` stands in its place: the same card, bars for the title and the description at their line heights, then `rows` lines of the body, with no words (nadicode decision).
30
+ * @words The title names what the section holds ("Company", "Instructions"); the description says in one sentence what it holds or lets a person change; a command is a verb on it ("Edit"), and a way to another page is that page's name ("Statements"); `meta` is a short count or time ("2 of 5 Agents"); `back` says where it leads ("Back to statements"); the footer's sentence is a limit or where the section's object changes ("At most three cards.").
31
+ * @access The title is a heading one level under the page (h2), deeper only under another heading through `headingLevel`; a `status` stands beside it, outside it. `back` is a real link before the title in reading order. `ObjectSectionSkeleton` is busy and its bars are hidden from assistive technology.
32
+ */
33
+ export function ObjectSection({ title, status, description, actions, back, footer, children, headingLevel = 2, cardSize = "default", }) {
34
+ const loneMeta = Boolean(actions?.meta) && !hasCardActions({ ...actions, meta: undefined });
35
+ const header = (_jsxs(CardHeader, { className: status ? "[&_[data-slot=card-actions-meta]]:text-caption" : undefined, narrowAction: status && loneMeta ? "title-row" : undefined, children: [status ? (_jsxs(CardTitle, { className: "flex flex-wrap items-center gap-2 font-medium", children: [_jsx("span", { role: "heading", "aria-level": headingLevel, children: title }), status] })) : (_jsx(CardTitle, { role: "heading", "aria-level": headingLevel, children: title })), _jsx(CardDescription, { children: description }), actions ? (_jsx(CardAction, { children: _jsx(CardActionsRow, { ...actions }) })) : null] }));
36
+ return (_jsxs(Card, { "data-slot": "object-section", size: cardSize, children: [back ? (_jsxs("div", { className: "grid min-w-0 gap-2", children: [_jsx("div", { className: "px-(--card-spacing)", children: _jsx(BackLink, { ...back }) }), header] })) : (header), _jsx(CardContent, { children: children }), footer ? (_jsx(FooterStrip, { hint: footer.hint, hintSlot: "object-section-hint", children: footer.command ? _jsx(PageCommandButton, { command: footer.command, variant: "outline" }) : null })) : null] }));
37
+ }
38
+ /**
39
+ * What stands in an ObjectSection's place while its page reads it: its card, a bar for the title
40
+ * and one for the description, and `rows` lines of its body.
18
41
  */
19
- export function ObjectSection({ title, description, actions, footer, children, headingLevel = 2, }) {
20
- return (_jsxs(Card, { "data-slot": "object-section", children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { role: "heading", "aria-level": headingLevel, children: title }), _jsx(CardDescription, { children: description }), actions ? (_jsx(CardAction, { children: _jsx(CardActionsRow, { ...actions }) })) : null] }), _jsx(CardContent, { children: children }), footer ? (_jsx(FooterStrip, { hint: footer.hint, hintSlot: "object-section-hint", children: footer.command ? _jsx(PageCommandButton, { command: footer.command, variant: "outline" }) : null })) : null] }));
42
+ export function ObjectSectionSkeleton({ rows }) {
43
+ return (_jsx(SkeletonRegion, { busy: true, "data-slot": "object-section-skeleton", children: _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: _jsx(Skeleton, { boxHeight: 26, className: "max-w-full", height: 20, width: 160 }) }), _jsx(CardDescription, { children: _jsx(Skeleton, { boxHeight: 20, className: "max-w-full", height: 16, width: 288 }) })] }), _jsx(CardContent, { className: "flex flex-col gap-3", children: Array.from({ length: rows }, (_, row) => (_jsx(Skeleton, { className: "h-4 w-full" }, row))) })] }) }));
21
44
  }
22
45
  /**
23
46
  * An object's facts as labelled values in a grid, inside one of its sections.
@@ -45,8 +45,6 @@ export type CardActions = Omit<PageActionsProps, "secondary"> & {
45
45
  * @access DOM order is visual order. A command whose label does not name its target carries `accessibleName`. A way to another page is a real link.
46
46
  */
47
47
  export declare function CardActionsRow({ meta, period, secondary, primary, menu }: CardActions): import("react").JSX.Element | null;
48
- /** Whether a card's header has anything of `actions` to draw, so it keeps no empty cell for them. */
49
- export declare function hasCardActions({ meta, period, secondary, primary, menu }: CardActions): boolean;
50
48
  export declare function PageCommandButton({ command, ...appearance }: CommandLook & {
51
49
  command: PagePrimaryCommand;
52
50
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"page-actions.d.ts","sourceRoot":"","sources":["../../src/components/page-actions.ts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AgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,MAAa,GACd,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,+BAIA;AAED,uGAAuG;AACvG,wBAAgB,aAAa,IAAI,OAAO,CAGvC;AAED,yFAAyF;AACzF,wBAAgB,eAAe,gCAS9B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,sCA6BlD"}
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
3
3
  import { createContext, useContext, useEffect, useId, useLayoutEffect, useState, } from "react";
4
4
  import { createPortal } from "react-dom";
5
5
  import { createStore, useStore } from "zustand";
6
+ import { hasCardActions } from "../internal/card-actions.js";
6
7
  import { useCommandRunner } from "../internal/command-runner.js";
7
8
  import { lookOf, PageCommandButton as PlainCommandButton, WithDisabledReason, } from "../internal/page-command-button.js";
8
9
  import { MenuCommandRow } from "../internal/record-menu-items.js";
@@ -25,11 +26,6 @@ export function CardActionsRow({ meta, period, secondary, primary, menu }) {
25
26
  const secondaries = secondary === undefined ? [] : "label" in secondary ? [secondary] : secondary;
26
27
  return (_jsxs("div", { "data-slot": "card-actions", className: "flex max-w-full min-w-0 flex-wrap items-center gap-2", children: [meta ? (_jsx("span", { className: "mr-1 text-label-sm text-muted-foreground", "data-slot": "card-actions-meta", children: meta })) : null, period, secondaries.map((command) => (_jsx(PageCommandButton, { command: command, variant: "outline" }, command.label))), primary ? _jsx(PageCommandButton, { command: primary, variant: "default" }) : null, menu ? _jsx(ActionMenu, { ...menu, size: "page" }) : null] }));
27
28
  }
28
- /** Whether a card's header has anything of `actions` to draw, so it keeps no empty cell for them. */
29
- export function hasCardActions({ meta, period, secondary, primary, menu }) {
30
- const secondaries = secondary === undefined ? 0 : "label" in secondary ? 1 : secondary.length;
31
- return Boolean(meta || period || secondaries > 0 || primary || menu);
32
- }
33
29
  export function PageCommandButton({ command, ...appearance }) {
34
30
  if ("choices" in command)
35
31
  return _jsx(ChoicesCommandButton, { command: command, ...appearance });
@@ -0,0 +1,38 @@
1
+ import type { ComponentProps, ReactElement, ReactNode } from "react";
2
+ import { type ReadingColumnWidth } from "./reading-column.js";
3
+ type PageFrameTitle = {
4
+ /** The page's title, drawn as its h1 with the page's actions on its row, for a page whose composition draws none. */
5
+ title: string;
6
+ /** One muted line under the title, saying what the page's concept is. */
7
+ description?: ReactNode;
8
+ /** The heading's own props, such as a fuller name that adds the record the page belongs to: "Skills, Sofia". */
9
+ headingProps?: Omit<ComponentProps<"h1">, "children">;
10
+ } | {
11
+ title?: undefined;
12
+ description?: never;
13
+ headingProps?: never;
14
+ };
15
+ export type PageFrameProps = PageFrameTitle & {
16
+ /** The product's `<main />`, which the frame fills with the page and scrolls: a page owns its landmarks, so no component renders one. */
17
+ main: ReactElement;
18
+ /** The landmark's name when the title is not it: the record the page belongs to ("Sofia"), or the page's name where its composition draws the title ("Scheduled tasks"). */
19
+ label?: string;
20
+ /** The page's measure: `full` for collections, objects and boards, `settings` for a page of settings, `reading` for a conversation or a form. */
21
+ column?: ReadingColumnWidth;
22
+ /** The page: a page composition, or the sections of one. */
23
+ children: ReactNode;
24
+ };
25
+ /**
26
+ * The page area of a product whose host app draws the window around its pages: the page's `main`
27
+ * landmark, its scrolling and gutter, its column, and its title row when its composition draws none.
28
+ *
29
+ * @family Compositions
30
+ * @when Every page of Nadia's window, whose `ProductShell` stands in Hermes's window with `host` while Hermes renders each page in its own page area: Settings, the company's places, an Agent's Edit sections and her landing, Scheduled tasks, a past conversation and New Agent.
31
+ * @instead A product whose `ProductShell` draws the page area itself (its `main`) gives the shell its page composition and never draws this. A page whose composition titles it (the `title` of `CollectionPage` or `OverviewPage`, `ObjectPage`'s `headingProps`) gives the frame a `label` and no `title`, so the page has one h1. A board whose lanes the host draws is `BoardHeader` above them and `BoardEmpty` in their place. A page never draws `PageHeader` or `ReadingColumn` itself, which `nadicodeai/page-composition` refuses.
32
+ * @behaviour The product passes its own `<main />`, as `ProductShell` takes it, and the frame fills it: the page's scroller at the full height of the host's page area, 24 px in from every edge, with the scrollbar's gutter kept on both edges, so the column stands at the same place whether the page scrolls or not. Inside stands one column: `full` (1280 px) for collections, objects, boards and an Agent's Edit sections, `settings` (960 px) for a page of settings, `reading` (768 px) for a conversation or a form a person fills in. Given a `title`, the frame draws the title row at the top of that column, `PageHeader` with the `description` under it and the page's `PageActions` on its row, as a product's chrome does; without one it draws no row and tells the page so (`PageActionsHostProvider`'s `titled`), and the composition that titles the page holds its actions, as `CollectionPage` ends its search row with them. The page keeps its place in the tree whether the frame draws a title or not, so a page that opens one of its records and comes back keeps what the person chose there.
33
+ * @words The product's: the title is the page's name as the product's column writes it ("Skills", "Mail"); the description is one sentence saying what the page's concept does; the label names the record the page belongs to ("Sofia") or the page whose composition draws the title ("Scheduled tasks").
34
+ * @access The product's element is the page's `main` landmark, named by `label`, or by the title. The title is the page's h1, and `headingProps` gives it a fuller name where the title alone does not say whose page it is. DOM order is visual order.
35
+ */
36
+ export declare function PageFrame({ main, label, title, description, headingProps, column, children, }: PageFrameProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
37
+ export {};
38
+ //# sourceMappingURL=page-frame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-frame.d.ts","sourceRoot":"","sources":["../../src/components/page-frame.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIrE,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAErF,KAAK,cAAc,GACf;IACE,qHAAqH;IACrH,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,gHAAgH;IAChH,YAAY,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;CACvD,GACD;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,CAAC;IAAC,YAAY,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAErE,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG;IAC5C,yIAAyI;IACzI,IAAI,EAAE,YAAY,CAAC;IACnB,4KAA4K;IAC5K,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iJAAiJ;IACjJ,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,4DAA4D;IAC5D,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,KAAK,EACL,KAAK,EACL,WAAW,EACX,YAAY,EACZ,MAAe,EACf,QAAQ,GACT,EAAE,cAAc,8EAqBhB"}
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useRender } from "@base-ui/react/use-render";
4
+ import { PageActionsHostProvider } from "./page-actions.js";
5
+ import { PageHeader } from "./page-header.js";
6
+ import { ReadingColumn } from "./reading-column.js";
7
+ /**
8
+ * The page area of a product whose host app draws the window around its pages: the page's `main`
9
+ * landmark, its scrolling and gutter, its column, and its title row when its composition draws none.
10
+ *
11
+ * @family Compositions
12
+ * @when Every page of Nadia's window, whose `ProductShell` stands in Hermes's window with `host` while Hermes renders each page in its own page area: Settings, the company's places, an Agent's Edit sections and her landing, Scheduled tasks, a past conversation and New Agent.
13
+ * @instead A product whose `ProductShell` draws the page area itself (its `main`) gives the shell its page composition and never draws this. A page whose composition titles it (the `title` of `CollectionPage` or `OverviewPage`, `ObjectPage`'s `headingProps`) gives the frame a `label` and no `title`, so the page has one h1. A board whose lanes the host draws is `BoardHeader` above them and `BoardEmpty` in their place. A page never draws `PageHeader` or `ReadingColumn` itself, which `nadicodeai/page-composition` refuses.
14
+ * @behaviour The product passes its own `<main />`, as `ProductShell` takes it, and the frame fills it: the page's scroller at the full height of the host's page area, 24 px in from every edge, with the scrollbar's gutter kept on both edges, so the column stands at the same place whether the page scrolls or not. Inside stands one column: `full` (1280 px) for collections, objects, boards and an Agent's Edit sections, `settings` (960 px) for a page of settings, `reading` (768 px) for a conversation or a form a person fills in. Given a `title`, the frame draws the title row at the top of that column, `PageHeader` with the `description` under it and the page's `PageActions` on its row, as a product's chrome does; without one it draws no row and tells the page so (`PageActionsHostProvider`'s `titled`), and the composition that titles the page holds its actions, as `CollectionPage` ends its search row with them. The page keeps its place in the tree whether the frame draws a title or not, so a page that opens one of its records and comes back keeps what the person chose there.
15
+ * @words The product's: the title is the page's name as the product's column writes it ("Skills", "Mail"); the description is one sentence saying what the page's concept does; the label names the record the page belongs to ("Sofia") or the page whose composition draws the title ("Scheduled tasks").
16
+ * @access The product's element is the page's `main` landmark, named by `label`, or by the title. The title is the page's h1, and `headingProps` gives it a fuller name where the title alone does not say whose page it is. DOM order is visual order.
17
+ */
18
+ export function PageFrame({ main, label, title, description, headingProps, column = "full", children, }) {
19
+ return useRender({
20
+ defaultTagName: "div",
21
+ render: main,
22
+ props: {
23
+ "aria-label": label ?? title,
24
+ className: "h-full min-h-0 overflow-y-auto p-nadicode-lg [scrollbar-gutter:stable_both-edges]",
25
+ children: (_jsx(PageActionsHostProvider, { titled: Boolean(title), children: _jsxs(ReadingColumn, { width: column, children: [title ? (_jsx(PageHeader, { description: description, headingProps: headingProps, title: title })) : null, children] }) })),
26
+ },
27
+ state: { slot: "page-frame" },
28
+ });
29
+ }
@@ -11,8 +11,9 @@ import * as React from "react";
11
11
  * it is the top bar's `Breadcrumb`; filters, search and sort sit in the toolbar below.
12
12
  * @behaviour The header stands in the page's own column, so the title and the page's cards share one
13
13
  * left edge. The title is always there and the actions arrive through the `PageActions` slot, so
14
- * the page draws its commands once. On a phone the title keeps its row with one action, as Vercel's
15
- * does; it gives way, and the actions wrap under it, only when they leave it less than 128 px. Under the title sits the `description`: one muted line
14
+ * the page draws its commands once. The title wraps between words and is never cut. On a header
15
+ * narrower than 576 px, a phone's or a narrow window's, the actions leave the title's row and stand
16
+ * as one row under the title and the description, on their left edge. Under the title sits the `description`: one muted line
16
17
  * saying what the page's concept is, on every page that is a destination or a section, as every Vercel
17
18
  * page does. It ends in a link to learn more when there is one, and never counts or introduces anything
18
19
  * else. It is the page's only explanation: no other line introduces, explains or counts the page, and
@@ -23,7 +24,7 @@ import * as React from "react";
23
24
  * object worked from a section sidebar, the title is the section's name: *Apps*. The description is
24
25
  * one sentence in the product's words, saying what the page's concept does and where it applies,
25
26
  * without a full stop when it ends in a link.
26
- * @access The title is the page's `h1`; DOM order is visual order.
27
+ * @access The title is the page's `h1`, read before its description and then the actions; DOM order is the narrow header's visual order, and a wider one sets the actions at the title row's end.
27
28
  */
28
29
  declare function PageHeader({ title, description, headingProps, className, unseen, ...props }: Omit<React.ComponentProps<"header">, "title" | "children"> & {
29
30
  title: React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"page-header.d.ts","sourceRoot":"","sources":["../../src/components/page-header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,iBAAS,UAAU,CAAC,EAClB,KAAK,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,MAAc,EACd,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IAC9D,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,uEAAuE;IACvE,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;IAC5D;;;OAGG;IACH,MAAM,C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