@viewkitjs/views 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/CHANGELOG.md +420 -0
  2. package/LICENSE.md +7 -0
  3. package/README.md +50 -2
  4. package/dist/atoms/CommandMenu.d.ts +2 -0
  5. package/dist/atoms/CommandMenu.js +20 -0
  6. package/dist/atoms/List.d.ts +2 -0
  7. package/dist/atoms/List.js +6 -0
  8. package/dist/atoms/LoadMore.d.ts +2 -0
  9. package/dist/atoms/LoadMore.js +25 -0
  10. package/dist/atoms/Loading.d.ts +2 -0
  11. package/dist/atoms/Loading.js +7 -0
  12. package/dist/atoms/PlatformMark.d.ts +2 -0
  13. package/dist/atoms/PlatformMark.js +4 -0
  14. package/dist/atoms/RelationLink.d.ts +2 -0
  15. package/dist/atoms/RelationLink.js +6 -0
  16. package/dist/atoms/Row.d.ts +3 -0
  17. package/dist/atoms/Row.js +30 -0
  18. package/dist/atoms/RowMenu.d.ts +2 -0
  19. package/dist/atoms/RowMenu.js +101 -0
  20. package/dist/atoms/StatusBadge.d.ts +2 -0
  21. package/dist/atoms/StatusBadge.js +7 -0
  22. package/dist/atoms/StatusMarker.d.ts +2 -0
  23. package/dist/atoms/StatusMarker.js +19 -0
  24. package/dist/atoms/Tag.d.ts +2 -0
  25. package/dist/atoms/Tag.js +13 -0
  26. package/dist/atoms/TickBox.d.ts +2 -0
  27. package/dist/atoms/TickBox.js +8 -0
  28. package/dist/atoms/defaults.d.ts +2 -0
  29. package/dist/atoms/defaults.js +27 -0
  30. package/dist/atoms/tones.d.ts +5 -0
  31. package/dist/atoms/tones.js +28 -0
  32. package/dist/atoms/types.d.ts +178 -0
  33. package/dist/atoms/types.js +3 -0
  34. package/dist/cells/cell-format.d.ts +138 -0
  35. package/dist/cells/cell-format.js +16 -0
  36. package/dist/cells/cell-title.d.ts +17 -0
  37. package/dist/cells/cell-title.js +8 -0
  38. package/dist/cells/cell-values.d.ts +28 -0
  39. package/dist/cells/cell-values.js +87 -0
  40. package/dist/cells/index.d.ts +4 -0
  41. package/dist/cells/index.js +4 -0
  42. package/dist/cells/legacy-field.d.ts +52 -0
  43. package/dist/cells/legacy-field.js +164 -0
  44. package/dist/cells/relation-wrap.d.ts +3 -0
  45. package/dist/cells/relation-wrap.js +24 -0
  46. package/dist/cells/use-cell-format.d.ts +5 -0
  47. package/dist/cells/use-cell-format.js +10 -0
  48. package/dist/contract.d.ts +431 -0
  49. package/dist/contract.js +663 -0
  50. package/dist/display/actor.d.ts +4 -0
  51. package/dist/display/actor.js +26 -0
  52. package/dist/display/boolean.d.ts +18 -0
  53. package/dist/display/boolean.js +43 -0
  54. package/dist/display/breakdown.d.ts +15 -0
  55. package/dist/display/breakdown.js +32 -0
  56. package/dist/display/currency.d.ts +9 -0
  57. package/dist/display/currency.js +29 -0
  58. package/dist/display/date.d.ts +12 -0
  59. package/dist/display/date.js +26 -0
  60. package/dist/display/display-cores.d.ts +31 -0
  61. package/dist/display/display-cores.js +57 -0
  62. package/dist/display/entity-chip.d.ts +26 -0
  63. package/dist/display/entity-chip.js +9 -0
  64. package/dist/display/format.d.ts +51 -0
  65. package/dist/display/format.js +181 -0
  66. package/dist/display/index.d.ts +8 -0
  67. package/dist/display/index.js +7 -0
  68. package/dist/display/link.d.ts +29 -0
  69. package/dist/display/link.js +48 -0
  70. package/dist/display/location.d.ts +7 -0
  71. package/dist/display/location.js +15 -0
  72. package/dist/display/multi-value.d.ts +18 -0
  73. package/dist/display/multi-value.js +28 -0
  74. package/dist/display/name.d.ts +6 -0
  75. package/dist/display/name.js +14 -0
  76. package/dist/display/number.d.ts +11 -0
  77. package/dist/display/number.js +27 -0
  78. package/dist/display/options.d.ts +153 -0
  79. package/dist/display/options.js +1 -0
  80. package/dist/display/percent.d.ts +4 -0
  81. package/dist/display/percent.js +33 -0
  82. package/dist/display/phone.d.ts +10 -0
  83. package/dist/display/phone.js +38 -0
  84. package/dist/display/range.d.ts +6 -0
  85. package/dist/display/range.js +29 -0
  86. package/dist/display/relation.d.ts +4 -0
  87. package/dist/display/relation.js +29 -0
  88. package/dist/display/rich-text.d.ts +10 -0
  89. package/dist/display/rich-text.js +34 -0
  90. package/dist/display/select.d.ts +6 -0
  91. package/dist/display/select.js +38 -0
  92. package/dist/display/text-class.d.ts +23 -0
  93. package/dist/display/text-class.js +5 -0
  94. package/dist/display/text.d.ts +19 -0
  95. package/dist/display/text.js +8 -0
  96. package/dist/display/use-display-options.d.ts +2 -0
  97. package/dist/display/use-display-options.js +14 -0
  98. package/dist/display/user.d.ts +11 -0
  99. package/dist/display/user.js +10 -0
  100. package/dist/display/value-list.d.ts +10 -0
  101. package/dist/display/value-list.js +12 -0
  102. package/dist/display/viewer.d.ts +4 -0
  103. package/dist/display/viewer.js +11 -0
  104. package/dist/display/web-href.d.ts +8 -0
  105. package/dist/display/web-href.js +12 -0
  106. package/dist/editors/ChipsEditor.d.ts +59 -0
  107. package/dist/editors/ChipsEditor.js +73 -0
  108. package/dist/editors/DateEditor.d.ts +25 -0
  109. package/dist/editors/DateEditor.js +122 -0
  110. package/dist/editors/LocationEditor.d.ts +22 -0
  111. package/dist/editors/LocationEditor.js +229 -0
  112. package/dist/editors/NameEditor.d.ts +22 -0
  113. package/dist/editors/NameEditor.js +91 -0
  114. package/dist/editors/NumberEditor.d.ts +67 -0
  115. package/dist/editors/NumberEditor.js +86 -0
  116. package/dist/editors/RangeEditor.d.ts +22 -0
  117. package/dist/editors/RangeEditor.js +70 -0
  118. package/dist/editors/RelationEditor.d.ts +65 -0
  119. package/dist/editors/RelationEditor.js +64 -0
  120. package/dist/editors/SelectEditor.d.ts +72 -0
  121. package/dist/editors/SelectEditor.js +59 -0
  122. package/dist/editors/ValueListEditor.d.ts +38 -0
  123. package/dist/editors/ValueListEditor.js +217 -0
  124. package/dist/editors/edit-cores.d.ts +83 -0
  125. package/dist/editors/edit-cores.js +38 -0
  126. package/dist/editors/edit-session.d.ts +74 -0
  127. package/dist/editors/edit-session.js +35 -0
  128. package/dist/editors/open-values.d.ts +28 -0
  129. package/dist/editors/open-values.js +26 -0
  130. package/dist/editors/relation-source.d.ts +66 -0
  131. package/dist/editors/relation-source.js +102 -0
  132. package/dist/fields/binding.d.ts +87 -0
  133. package/dist/fields/binding.js +117 -0
  134. package/dist/fields/currency.d.ts +92 -0
  135. package/dist/fields/currency.js +55 -0
  136. package/dist/fields/denomination.d.ts +42 -0
  137. package/dist/fields/denomination.js +11 -0
  138. package/dist/fields/edit-core-types.d.ts +40 -0
  139. package/dist/fields/edit-core-types.js +29 -0
  140. package/dist/fields/format-knobs.d.ts +34 -0
  141. package/dist/fields/format-knobs.js +36 -0
  142. package/dist/fields/menus.d.ts +28 -0
  143. package/dist/fields/menus.js +1 -0
  144. package/dist/fields/money.d.ts +59 -0
  145. package/dist/fields/money.js +77 -0
  146. package/dist/fields/number-edit.d.ts +11 -0
  147. package/dist/fields/number-edit.js +17 -0
  148. package/dist/fields/prepare-write.d.ts +55 -0
  149. package/dist/fields/prepare-write.js +67 -0
  150. package/dist/fields/relation-source-types.d.ts +54 -0
  151. package/dist/fields/relation-source-types.js +1 -0
  152. package/dist/figures.d.ts +52 -0
  153. package/dist/figures.js +63 -0
  154. package/dist/filters/date-filter.d.ts +2 -0
  155. package/dist/filters/date-filter.js +1 -0
  156. package/dist/filters/filter-model.d.ts +177 -0
  157. package/dist/filters/filter-model.js +41 -0
  158. package/dist/filters/number-filter.d.ts +2 -0
  159. package/dist/filters/number-filter.js +1 -0
  160. package/dist/filters/range-filter.d.ts +2 -0
  161. package/dist/filters/range-filter.js +1 -0
  162. package/dist/filters/registry.d.ts +136 -0
  163. package/dist/filters/registry.js +46 -0
  164. package/dist/filters/relation-filter.d.ts +16 -0
  165. package/dist/filters/relation-filter.js +53 -0
  166. package/dist/filters/text-filter.d.ts +2 -0
  167. package/dist/filters/text-filter.js +1 -0
  168. package/dist/filters/types.d.ts +27 -0
  169. package/dist/filters/types.js +1 -0
  170. package/dist/grouping/sort-groups.d.ts +18 -0
  171. package/dist/grouping/sort-groups.js +33 -0
  172. package/dist/grouping/types.d.ts +10 -0
  173. package/dist/grouping/types.js +1 -0
  174. package/dist/index.d.ts +29 -0
  175. package/dist/index.js +29 -0
  176. package/dist/internal/chip.d.ts +4 -0
  177. package/dist/internal/chip.js +3 -0
  178. package/dist/internal/cx.d.ts +3 -0
  179. package/dist/internal/cx.js +3 -0
  180. package/dist/model/aggregates.d.ts +59 -0
  181. package/dist/model/aggregates.js +186 -0
  182. package/dist/model/card-density.d.ts +8 -0
  183. package/dist/model/card-density.js +10 -0
  184. package/dist/model/card-layout.d.ts +85 -0
  185. package/dist/model/card-layout.js +90 -0
  186. package/dist/model/column-capabilities.d.ts +162 -0
  187. package/dist/model/column-capabilities.js +233 -0
  188. package/dist/model/column-filters.d.ts +106 -0
  189. package/dist/model/column-filters.js +321 -0
  190. package/dist/model/column-format.d.ts +103 -0
  191. package/dist/model/column-format.js +1 -0
  192. package/dist/model/column-from.d.ts +28 -0
  193. package/dist/model/column-from.js +160 -0
  194. package/dist/model/column-inspect.d.ts +18 -0
  195. package/dist/model/column-inspect.js +6 -0
  196. package/dist/model/column-knobs.d.ts +20 -0
  197. package/dist/model/column-knobs.js +16 -0
  198. package/dist/model/column-money.d.ts +13 -0
  199. package/dist/model/column-money.js +27 -0
  200. package/dist/model/column-order.d.ts +36 -0
  201. package/dist/model/column-order.js +68 -0
  202. package/dist/model/column-schema.d.ts +335 -0
  203. package/dist/model/column-schema.js +1 -0
  204. package/dist/model/column-sort.d.ts +17 -0
  205. package/dist/model/column-sort.js +11 -0
  206. package/dist/model/column-state.d.ts +77 -0
  207. package/dist/model/column-state.js +95 -0
  208. package/dist/model/column-types.d.ts +109 -0
  209. package/dist/model/column-types.js +50 -0
  210. package/dist/model/column-warnings.d.ts +44 -0
  211. package/dist/model/column-warnings.js +24 -0
  212. package/dist/model/density.d.ts +3 -0
  213. package/dist/model/density.js +13 -0
  214. package/dist/model/field-type-of.d.ts +21 -0
  215. package/dist/model/field-type-of.js +11 -0
  216. package/dist/model/filter-capabilities.d.ts +1 -0
  217. package/dist/model/filter-capabilities.js +1 -0
  218. package/dist/model/filter-pushdown.d.ts +106 -0
  219. package/dist/model/filter-pushdown.js +147 -0
  220. package/dist/model/index.d.ts +40 -0
  221. package/dist/model/index.js +21 -0
  222. package/dist/model/part-rows.d.ts +28 -0
  223. package/dist/model/part-rows.js +40 -0
  224. package/dist/model/preferences.d.ts +151 -0
  225. package/dist/model/preferences.js +84 -0
  226. package/dist/model/prefs-buckets.d.ts +173 -0
  227. package/dist/model/prefs-buckets.js +71 -0
  228. package/dist/model/relation-filters.d.ts +45 -0
  229. package/dist/model/relation-filters.js +78 -0
  230. package/dist/model/render-count.d.ts +2 -0
  231. package/dist/model/render-count.js +24 -0
  232. package/dist/model/row-icon.d.ts +23 -0
  233. package/dist/model/row-icon.js +5 -0
  234. package/dist/model/view-rules.d.ts +73 -0
  235. package/dist/model/view-rules.js +216 -0
  236. package/dist/provider/ViewsProvider.d.ts +26 -0
  237. package/dist/provider/ViewsProvider.js +12 -0
  238. package/dist/provider/components.d.ts +222 -0
  239. package/dist/provider/components.js +3 -0
  240. package/dist/provider/context.d.ts +19 -0
  241. package/dist/provider/context.js +10 -0
  242. package/dist/provider/icons.d.ts +6 -0
  243. package/dist/provider/icons.js +1 -0
  244. package/dist/provider/ports.d.ts +35 -0
  245. package/dist/provider/ports.js +8 -0
  246. package/dist/react.d.ts +9 -0
  247. package/dist/react.js +4 -0
  248. package/dist/selection/SelectCheckbox.d.ts +17 -0
  249. package/dist/selection/SelectCheckbox.js +11 -0
  250. package/dist/selection/index.d.ts +7 -0
  251. package/dist/selection/index.js +6 -0
  252. package/dist/selection/model.d.ts +55 -0
  253. package/dist/selection/model.js +86 -0
  254. package/dist/selection/row-click.d.ts +35 -0
  255. package/dist/selection/row-click.js +20 -0
  256. package/dist/selection/types.d.ts +17 -0
  257. package/dist/selection/types.js +1 -0
  258. package/dist/selection/useCheckDragSelect.d.ts +61 -0
  259. package/dist/selection/useCheckDragSelect.js +165 -0
  260. package/dist/selection/useListSelection.d.ts +39 -0
  261. package/dist/selection/useListSelection.js +48 -0
  262. package/dist/selection/useListSelectionShortcuts.d.ts +6 -0
  263. package/dist/selection/useListSelectionShortcuts.js +14 -0
  264. package/dist/selection/useRestIntent.d.ts +18 -0
  265. package/dist/selection/useRestIntent.js +35 -0
  266. package/docs/contract.md +453 -0
  267. package/docs/install.md +105 -0
  268. package/docs/reshaping.md +19 -0
  269. package/package.json +114 -3
  270. package/skills/views/SKILL.md +87 -0
@@ -0,0 +1,18 @@
1
+ import type { ReactNode } from "react";
2
+ import type { FieldDefOf } from "@viewkitjs/fields";
3
+ import type { DisplayOptions } from "./options.js";
4
+ /**
5
+ * THE BOOLEAN DISPLAY — and a real seam, not an arbitrary file split: every
6
+ * other type is either pure display or defers its write to a mounted editor,
7
+ * while a boolean commits from the DISPLAY itself. The checkbox or icon on
8
+ * screen IS the control, one click from flipping the stored value with nothing
9
+ * else in between.
10
+ *
11
+ * `format.style` is therefore a WRITE POLICY as much as a look — four modes
12
+ * (`checkbox`, `icon`, `text`, `marker`), each drawing a different subset of
13
+ * the two states and wired to a different verb (two-way flip, read-only,
14
+ * one-way "resolve"). One function switches on it, so a mode's policy and its
15
+ * pixels stay declared in exactly one place. None of them is a pill: a value
16
+ * that reads as a state on screen is a `status`, and says so in its type.
17
+ */
18
+ export declare function renderBoolean(field: FieldDefOf<"boolean">, value: unknown, opts?: DisplayOptions): ReactNode;
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useViews } from "../provider/context.js";
4
+ export function renderBoolean(field, value, opts) {
5
+ const truthy = Boolean(value);
6
+ const display = field.format?.style ?? "checkbox";
7
+ if (display === "marker") {
8
+ if (!truthy)
9
+ return null;
10
+ return (_jsx(BooleanMarker, { label: opts?.marker?.label ?? field.label, title: opts?.marker?.title, reason: opts?.markerReason, onResolve: opts?.onResolve, slotOwnsClick: opts?.slotOwnsClick }));
11
+ }
12
+ if (display === "text") {
13
+ const option = field.options?.find((o) => o.value === String(truthy));
14
+ return option ? (_jsx("span", { className: "truncate text-(color:--vk-fg-subtle)", children: option.label })) : (_jsx(BooleanWord, { value: truthy }));
15
+ }
16
+ const glyph = opts?.booleanIcon ? opts.booleanIcon(truthy) : _jsx(BooleanTick, { checked: truthy });
17
+ return renderToggle(glyph, truthy, field, opts);
18
+ }
19
+ function BooleanMarker({ label, title, reason, onResolve, slotOwnsClick, }) {
20
+ const { atoms, icons, messages } = useViews();
21
+ const Warning = icons.warning;
22
+ if (slotOwnsClick) {
23
+ return _jsx(atoms.StatusBadge, { slot: "warning", label: label, leading: _jsx(Warning, { className: "h-3 w-3 shrink-0" }) });
24
+ }
25
+ return (_jsx(atoms.StatusMarker, { slot: "warning", label: label, title: title ?? messages({ key: "views.display.needs-attention" }), reason: reason, onResolve: onResolve }));
26
+ }
27
+ function BooleanWord({ value }) {
28
+ const { messages } = useViews();
29
+ return (_jsx("span", { className: "truncate text-(color:--vk-fg-subtle)", children: messages({ key: "views.display.boolean", values: { value: value ? "true" : "false" } }) }));
30
+ }
31
+ function BooleanTick({ checked }) {
32
+ const { TickBox } = useViews().atoms;
33
+ return _jsx(TickBox, { checked: checked });
34
+ }
35
+ function renderToggle(child, truthy, field, opts) {
36
+ if (!opts?.onToggle || opts?.slotOwnsClick) {
37
+ return _jsx("span", { className: "flex items-center", children: child });
38
+ }
39
+ return (_jsx("button", { type: "button", role: "switch", "aria-checked": truthy, "aria-label": field.label, disabled: opts.booleanDisabled, onClick: (event) => {
40
+ event.stopPropagation();
41
+ opts.onToggle?.(!truthy);
42
+ }, className: "flex items-center rounded-sm transition-opacity hover:opacity-80", children: child }));
43
+ }
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from "react";
2
+ import { type FieldDef, type FieldDefOf } from "@viewkitjs/fields";
3
+ import type { DisplayOptions } from "./options.js";
4
+ /** The display's own dispatch, handed in by `DISPLAY_CORES` so this file never
5
+ * imports the table that imports it. */
6
+ type RenderField = (field: FieldDef, value: unknown, opts?: DisplayOptions) => ReactNode;
7
+ /**
8
+ * A GROUPED ROLLUP — one figure per option, or per time bucket — drawn as its
9
+ * parts with the headline beside. By option: a segmented bar, every part in
10
+ * order, zeros taking no width but still listed in the title. By time: a
11
+ * sparkline of bars, the current (partial) bucket faded. The headline is drawn
12
+ * through the result's own display, so it reads as the number it sorts by.
13
+ */
14
+ export declare function renderBreakdown(field: FieldDefOf<"rollup">, value: unknown, opts: DisplayOptions | undefined, render: RenderField): ReactNode;
15
+ export {};
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { isBreakdown, presentedDef, } from "@viewkitjs/fields";
4
+ import { STATUS_DOT } from "../atoms/tones.js";
5
+ import { cx } from "../internal/cx.js";
6
+ export function renderBreakdown(field, value, opts, render) {
7
+ if (!isBreakdown(value))
8
+ return render(presentedDef(field), value, opts);
9
+ const headline = render(presentedDef(field), value.headline, opts);
10
+ const time = !!field.groupBy && "time" in field.groupBy;
11
+ return (_jsxs("span", { className: "flex min-w-0 items-center gap-2", title: titleOf(value), children: [time ? _jsx(Spark, { parts: value.parts }) : _jsx(Bar, { parts: value.parts }), _jsx("span", { className: "shrink-0 tabular-nums", children: headline })] }));
12
+ }
13
+ function titleOf(value) {
14
+ return value.parts.map((p) => `${p.label ?? p.key}: ${p.value ?? "—"}`).join(" · ");
15
+ }
16
+ function Bar({ parts }) {
17
+ const total = parts.reduce((sum, p) => sum + Math.max(0, p.value ?? 0), 0);
18
+ return (_jsx("span", { className: "flex h-1.5 min-w-12 flex-1 overflow-hidden rounded-full bg-(color:--vk-neutral)", children: parts.map((p) => (_jsx("span", { "data-part": p.key, className: cx("block h-full", p.slot ? STATUS_DOT[p.slot] : "bg-(color:--vk-fg-subtle)"), style: { width: total > 0 ? `${(100 * Math.max(0, p.value ?? 0)) / total}%` : "0%" } }, p.key))) }));
19
+ }
20
+ function Spark({ parts }) {
21
+ const width = 64;
22
+ const height = 16;
23
+ const n = parts.length;
24
+ if (n === 0)
25
+ return null;
26
+ const max = Math.max(1, ...parts.map((p) => p.value ?? 0));
27
+ const barW = Math.max(1, Math.floor((width - (n - 1)) / n));
28
+ return (_jsx("svg", { width: width, height: height, viewBox: `0 0 ${width} ${height}`, className: "shrink-0", "aria-hidden": true, children: parts.map((p, i) => {
29
+ const h = p.value == null ? 0 : Math.max(1, Math.round((height * p.value) / max));
30
+ return (_jsx("rect", { "data-partial": p.partial ? "" : undefined, x: i * (barW + 1), y: height - h, width: barW, height: h, fill: "var(--vk-fg-subtle)", opacity: p.partial ? 0.4 : 0.8 }, p.key));
31
+ }) }));
32
+ }
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from "react";
2
+ import { type FieldDefOf } from "@viewkitjs/fields";
3
+ import type { DisplayOptions } from "./options.js";
4
+ /**
5
+ * Money. A fixed code comes off the field; a per-row code arrives resolved in
6
+ * `opts.currency` (the host has the row). The caller's answer beats the field's
7
+ * — asking to read a surface in one currency is asking for exactly that.
8
+ */
9
+ export declare function renderCurrency(field: FieldDefOf<"currency">, value: unknown, opts?: DisplayOptions): ReactNode;
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { isIntegerField } from "@viewkitjs/fields";
4
+ import { STATUS_TEXT } from "../atoms/tones.js";
5
+ import { cx } from "../internal/cx.js";
6
+ import { CellSuffix, formatNumberValue } from "./format.js";
7
+ import { cellTextClass } from "./text-class.js";
8
+ import { useDisplayOptions } from "./use-display-options.js";
9
+ export function renderCurrency(field, value, opts) {
10
+ const n = typeof value === "number" ? value : Number(value);
11
+ if (Number.isNaN(n))
12
+ return _jsx("span", { className: cellTextClass(opts?.wrap), children: String(value) });
13
+ return _jsx(CurrencyValue, { field: field, n: n, opts: opts });
14
+ }
15
+ function CurrencyValue({ field, n, opts: given, }) {
16
+ const opts = useDisplayOptions(given);
17
+ const fixed = "fixed" in field.code ? field.code.fixed : undefined;
18
+ const integer = isIntegerField(field);
19
+ const format = {
20
+ style: "currency",
21
+ currency: fixed,
22
+ decimals: integer ? 0 : (field.format?.decimals ?? 2),
23
+ suffix: field.format?.suffix,
24
+ signed: field.format?.signed,
25
+ signedTone: field.format?.signedTone,
26
+ };
27
+ const shown = integer ? { ...opts, decimals: 0 } : opts;
28
+ return (_jsxs("span", { className: cx(cellTextClass(opts?.wrap), "tabular-nums", format.signed && format.signedTone !== "neutral" && n > 0 && STATUS_TEXT.success), children: [formatNumberValue(n, format, shown), format.suffix && _jsx(CellSuffix, { children: format.suffix })] }));
29
+ }
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from "react";
2
+ import type { FieldDefOf } from "@viewkitjs/fields";
3
+ import type { DisplayOptions } from "./options.js";
4
+ /**
5
+ * A calendar day or an instant — one renderer, because they differ in what the
6
+ * row holds and in validation, never in how they read.
7
+ *
8
+ * The slow-hover tooltip carries the FULL date and time regardless of the
9
+ * field's display style or the show-time setting, so a `relative` value ("3 days
10
+ * ago") is still pinnable to a real moment.
11
+ */
12
+ export declare function renderDate(field: FieldDefOf<"date"> | FieldDefOf<"datetime">, value: unknown, opts?: DisplayOptions): ReactNode;
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { fromDayKey } from "@viewkitjs/fields/query";
4
+ import { cx } from "../internal/cx.js";
5
+ import { useViews } from "../provider/context.js";
6
+ import { formatDateValue } from "./format.js";
7
+ import { cellTextClass } from "./text-class.js";
8
+ import { useDisplayOptions } from "./use-display-options.js";
9
+ export function renderDate(field, value, opts) {
10
+ return _jsx(DateValue, { field: field, value: value, opts: opts });
11
+ }
12
+ function DateValue({ field, value, opts: given, }) {
13
+ const opts = useDisplayOptions(given);
14
+ const { Tooltip } = useViews().components;
15
+ const withTime = opts.withTime ?? (field.type === "datetime" ? field.format?.withTime : false);
16
+ const cell = (_jsx("span", { className: cx(cellTextClass(opts.wrap), "tabular-nums text-(color:--vk-fg)"), children: formatDateValue(value, opts.dateStyle ?? field.format?.dateStyle, withTime, field.type, opts) }));
17
+ const d = field.type === "date" && typeof value === "string"
18
+ ? fromDayKey(value)
19
+ : value instanceof Date
20
+ ? value
21
+ : new Date(String(value));
22
+ if (!d || Number.isNaN(d.getTime()))
23
+ return cell;
24
+ const full = formatDateValue(value, "long", field.type === "datetime", field.type, opts);
25
+ return (_jsx(Tooltip, { content: full, side: "bottom", align: "start", delayMs: 1000, className: "tabular-nums", children: cell }));
26
+ }
@@ -0,0 +1,31 @@
1
+ import type { ReactNode } from "react";
2
+ import { type FieldDef, type FieldDefOf, type FieldType } from "@viewkitjs/fields";
3
+ import type { DisplayOptions } from "./options.js";
4
+ /**
5
+ * ONE RENDERER PER STORAGE TYPE, and the table that picks between them.
6
+ *
7
+ * The dispatch is a mapped type over `FieldType` rather than a switch, and that
8
+ * is the point: a new member of the union with no core here fails to compile,
9
+ * where a missing switch arm would only show up at runtime as a silently empty
10
+ * cell — which looks exactly like missing data.
11
+ *
12
+ * `date` and `datetime` share a core deliberately. They differ in what the row
13
+ * holds ("YYYY-MM-DD" versus an instant) and in validation, never in how they
14
+ * read, so one renderer serves both and the two can't drift.
15
+ *
16
+ * `rollup` and `formula` have no look of their own: a derived field's VALUE is
17
+ * its result's (spec §2.3), so both lift to `presentedDef` — the result's shape
18
+ * under the field's key — and dispatch again. One place does the lift.
19
+ */
20
+ export type DisplayCore<D extends FieldDef> = (field: D, value: unknown, opts?: DisplayOptions) => ReactNode;
21
+ export declare const DISPLAY_CORES: {
22
+ [K in FieldType]: DisplayCore<FieldDefOf<K>>;
23
+ };
24
+ /**
25
+ * THE entry point: a field, its value, and whatever the surface knows.
26
+ *
27
+ * The nullish bail is here rather than in each core so "there is nothing to
28
+ * draw" is answered once — and so the one type that disagrees can say so in a
29
+ * single place.
30
+ */
31
+ export declare function renderFieldValue(field: FieldDef, value: unknown, opts?: DisplayOptions): ReactNode;
@@ -0,0 +1,57 @@
1
+ "use client";
2
+ import { presentedDef, valueTypeOf, } from "@viewkitjs/fields";
3
+ import { renderBoolean } from "./boolean.js";
4
+ import { renderCurrency } from "./currency.js";
5
+ import { renderDate } from "./date.js";
6
+ import { renderDomain, renderEmail, renderUrl } from "./link.js";
7
+ import { renderNumber } from "./number.js";
8
+ import { renderPercent } from "./percent.js";
9
+ import { renderPhone } from "./phone.js";
10
+ import { renderMultiselect, renderSelect, renderStatus } from "./select.js";
11
+ import { renderRelation } from "./relation.js";
12
+ import { renderText } from "./text.js";
13
+ import { renderLocation } from "./location.js";
14
+ import { renderName } from "./name.js";
15
+ import { renderActor } from "./actor.js";
16
+ import { renderRichText } from "./rich-text.js";
17
+ import { renderRange } from "./range.js";
18
+ import { renderBreakdown } from "./breakdown.js";
19
+ import { renderUser } from "./user.js";
20
+ export const DISPLAY_CORES = {
21
+ text: renderText,
22
+ number: renderNumber,
23
+ date: renderDate,
24
+ datetime: renderDate,
25
+ boolean: renderBoolean,
26
+ select: renderSelect,
27
+ multiselect: renderMultiselect,
28
+ relation: renderRelation,
29
+ url: renderUrl,
30
+ domain: renderDomain,
31
+ email: renderEmail,
32
+ location: renderLocation,
33
+ name: renderName,
34
+ actor: renderActor,
35
+ rich_text: renderRichText,
36
+ range: renderRange,
37
+ percent: renderPercent,
38
+ currency: renderCurrency,
39
+ status: renderStatus,
40
+ user: renderUser,
41
+ phone: renderPhone,
42
+ lookup: (field, value, opts) => renderFieldValue(presentedDef(field), value, opts),
43
+ rollup: (field, value, opts) => field.groupBy
44
+ ? renderBreakdown(field, value, opts, renderFieldValue)
45
+ : renderFieldValue(presentedDef(field), value, opts),
46
+ formula: (field, value, opts) => renderFieldValue(presentedDef(field), value, opts),
47
+ };
48
+ export function renderFieldValue(field, value, opts) {
49
+ const type = valueTypeOf(field);
50
+ if (type !== "boolean" &&
51
+ !(type === "name" && opts?.nameFallback) &&
52
+ (value == null || value === "" || (Array.isArray(value) && value.length === 0))) {
53
+ return null;
54
+ }
55
+ const core = DISPLAY_CORES[field.type];
56
+ return core(field, value, opts);
57
+ }
@@ -0,0 +1,26 @@
1
+ import { type ReactNode } from "react";
2
+ /**
3
+ * THE identity of an entity reference, anywhere one is drawn inline — a grid
4
+ * relation cell, a board-card chip, the activity feed's entity link.
5
+ *
6
+ * The convention it enforces: **avatar first, icon second.** An entity with a
7
+ * real image (a person's photo, someday a company logo) shows it; only when
8
+ * there is none does the glyph chain take over — host-supplied icon → the
9
+ * caller's fallback. Surfaces supply the data
10
+ * (`avatarUrl` rides the relation value); this component owns the rule, so
11
+ * "should this show the picture?" is never re-decided per surface.
12
+ *
13
+ * Renders a fragment (glyph + label as siblings) — the CALLER owns the flex
14
+ * container, its gap, and the interactivity around it. That is what lets the
15
+ * grid chip, with its own hover/link contract, and the feed link, with its
16
+ * primary-colored label, share one identity without sharing chrome.
17
+ */
18
+ export declare function EntityChipIdentity({ label, avatarUrl, iconOverride, fallbackIcon, labelClassName, }: {
19
+ label: string;
20
+ avatarUrl?: string | null;
21
+ /** Host-resolved glyph — never beats a real avatar. */
22
+ iconOverride?: ReactNode;
23
+ /** Rendered when neither an avatar nor an override exists. */
24
+ fallbackIcon?: ReactNode;
25
+ labelClassName?: string;
26
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { cx } from "../internal/cx.js";
5
+ export function EntityChipIdentity({ label, avatarUrl, iconOverride, fallbackIcon, labelClassName, }) {
6
+ const [avatarBroken, setAvatarBroken] = useState(false);
7
+ const glyph = avatarUrl && !avatarBroken ? (_jsx("img", { src: avatarUrl, alt: "", className: "h-4 w-4 -my-0.5 shrink-0 rounded-full object-cover", draggable: false, onError: () => setAvatarBroken(true) })) : ((iconOverride ?? fallbackIcon ?? null));
8
+ return (_jsxs(_Fragment, { children: [glyph, _jsx("span", { className: cx("min-w-0", labelClassName), children: label })] }));
9
+ }
@@ -0,0 +1,51 @@
1
+ import { type ReactNode } from "react";
2
+ import { type DateStyle } from "@viewkitjs/fields";
3
+ import { type TemporalKind } from "@viewkitjs/fields/query";
4
+ import type { DisplayOptions, FieldPresentation, NumberLikeFormat } from "./options.js";
5
+ /**
6
+ * How a VALUE becomes a string — dates, numbers, and the suffix that trails one.
7
+ *
8
+ * These read the field's `format` block and the caller's overrides, never a
9
+ * column: that is the whole substitution this folder makes. They carry no JSX
10
+ * beyond the one suffix node, so a footer aggregate, a column menu's live
11
+ * preview and a drawer row can all print a value the same way the cell does
12
+ * without pulling a renderer in with them.
13
+ *
14
+ * A viewer handed in wins; with none, the neutral conventions (`en-GB`, UTC) —
15
+ * never the runtime's locale or zone.
16
+ */
17
+ /** The per-user overrides that beat what the field declares. */
18
+ type NumberOverrides = Pick<DisplayOptions, "decimals" | "currency" | "durationStyle" | "presentation" | "viewer">;
19
+ /** Default presentation is explicit and replaceable; it owns no mutable global state. */
20
+ export declare const DEFAULT_FIELD_PRESENTATION: FieldPresentation;
21
+ /**
22
+ * A number, in the denomination its format names — plain, duration, percent or
23
+ * currency (`NumberLikeFormat`: the two typed cores fold their field into it).
24
+ *
25
+ * The currency arrives ALREADY RESOLVED: a per-row denomination (`code.field`)
26
+ * needs the row, and a field never has one — the host folds the row's answer into
27
+ * `opts.currency` before calling. Precedence below is therefore only two deep:
28
+ * the caller's answer, then the field's single declared code.
29
+ */
30
+ export declare function formatNumberValue(value: number, format: NumberLikeFormat | undefined, opts?: NumberOverrides): string;
31
+ /**
32
+ * A date or an instant, in the style asked for.
33
+ *
34
+ * Takes the STYLE rather than the field: a date and a datetime differ in what
35
+ * the row holds and in validation, not in how they read, so one formatter serves
36
+ * both and the caller resolves which style won.
37
+ */
38
+ export declare function formatDateValue(value: unknown, dateStyle: DateStyle | undefined, withTime?: boolean, kind?: TemporalKind, opts?: Pick<DisplayOptions, "presentation" | "viewer">): string;
39
+ /**
40
+ * THE unit-suffix look (a "/mo" after a price). Any renderer — a typed core, a
41
+ * custom cell, a group aggregate — uses this, so suffixes never diverge in style.
42
+ *
43
+ * Built with `createElement` rather than JSX because this module is the FORMAT
44
+ * module: its other two exports are pure string functions that a Node-side
45
+ * consumer can import, and one 3-line node is not worth turning the file into a
46
+ * component module to get angle brackets.
47
+ */
48
+ export declare function CellSuffix({ children }: {
49
+ children: ReactNode;
50
+ }): ReactNode;
51
+ export {};
@@ -0,0 +1,181 @@
1
+ import { createElement } from "react";
2
+ import { DEFAULT_CONVENTIONS, resolveFieldMessage } from "@viewkitjs/fields";
3
+ import { fromDayKey, toDayKey } from "@viewkitjs/fields/query";
4
+ import { formatDurationMs } from "@viewkitjs/fields/format/time";
5
+ import { resolveViewsMessage } from "../contract.js";
6
+ import { viewerFrom } from "./viewer.js";
7
+ function daySpan(days) {
8
+ if (days < 7)
9
+ return { count: days, unit: "d" };
10
+ const weeks = Math.floor(days / 7);
11
+ if (weeks < 4)
12
+ return { count: weeks, unit: "w" };
13
+ const months = Math.max(1, Math.floor(days / 30));
14
+ if (months < 12)
15
+ return { count: months, unit: "mo" };
16
+ return { count: Math.floor(days / 365), unit: "y" };
17
+ }
18
+ function spanWords(span, ahead, context) {
19
+ return ahead
20
+ ? (context.messages ?? resolveViewsMessage)({ key: "views.display.in", values: span })
21
+ : (context.fieldMessages ?? resolveFieldMessage)({ key: "time.ago", values: span });
22
+ }
23
+ function relative(input, context) {
24
+ const then = input instanceof Date ? input.getTime() : new Date(input).getTime();
25
+ const diff = context.now.getTime() - then;
26
+ const abs = Math.abs(diff);
27
+ if (abs < 60_000)
28
+ return (context.messages ?? resolveViewsMessage)({ key: "views.display.just-now" });
29
+ const minutes = Math.floor(abs / 60_000);
30
+ const hours = Math.floor(minutes / 60);
31
+ const span = minutes < 60
32
+ ? { count: minutes, unit: "m" }
33
+ : hours < 24
34
+ ? { count: hours, unit: "h" }
35
+ : daySpan(Math.floor(hours / 24));
36
+ return spanWords(span, diff < 0, context);
37
+ }
38
+ function viewerToday(context) {
39
+ const parts = new Intl.DateTimeFormat("en-US", {
40
+ timeZone: context.timeZone ?? DEFAULT_CONVENTIONS.timeZone,
41
+ year: "numeric",
42
+ month: "numeric",
43
+ day: "numeric",
44
+ }).formatToParts(context.now);
45
+ const value = (type) => Number(parts.find((part) => part.type === type)?.value);
46
+ return { year: value("year"), month: value("month"), day: value("day") };
47
+ }
48
+ function dayKeyParts(day) {
49
+ const [year, month, date] = day.split("-").map(Number);
50
+ return { year, month, day: date };
51
+ }
52
+ const ordinal = ({ year, month, day }) => Date.UTC(year, month - 1, day) / 86_400_000;
53
+ function relativeCalendarDay(day, context) {
54
+ const diff = ordinal(viewerToday(context)) - ordinal(dayKeyParts(day));
55
+ const words = context.messages ?? resolveViewsMessage;
56
+ if (diff === 0)
57
+ return words({ key: "views.display.today" });
58
+ if (diff === 1)
59
+ return words({ key: "views.display.yesterday" });
60
+ if (diff === -1)
61
+ return words({ key: "views.display.tomorrow" });
62
+ return spanWords(daySpan(Math.abs(diff)), diff < 0, context);
63
+ }
64
+ const pad2 = (n) => String(n).padStart(2, "0");
65
+ function absoluteDay({ year, month, day }, style, today, context, time) {
66
+ const words = context.messages ?? resolveViewsMessage;
67
+ const name = (length) => words({ key: "views.display.month", values: { month, length } });
68
+ const date = style === "numeric"
69
+ ? `${pad2(day)}/${pad2(month)}/${year}`
70
+ : style === "long"
71
+ ? `${day} ${name("long")} ${year}`
72
+ : `${pad2(day)} ${name("short")}${year === today.year ? "" : ` ${year}`}`;
73
+ return time ? `${date}, ${time}` : date;
74
+ }
75
+ function instantParts(instant, timeZone) {
76
+ const parts = new Intl.DateTimeFormat("en-GB", {
77
+ timeZone: timeZone ?? DEFAULT_CONVENTIONS.timeZone,
78
+ year: "numeric",
79
+ month: "numeric",
80
+ day: "numeric",
81
+ hour: "2-digit",
82
+ minute: "2-digit",
83
+ hourCycle: "h23",
84
+ }).formatToParts(instant);
85
+ const value = (type) => parts.find((part) => part.type === type)?.value ?? "";
86
+ return {
87
+ year: Number(value("year")),
88
+ month: Number(value("month")),
89
+ day: Number(value("day")),
90
+ time: `${value("hour")}:${value("minute")}`,
91
+ };
92
+ }
93
+ export const DEFAULT_FIELD_PRESENTATION = {
94
+ message: resolveFieldMessage,
95
+ number: ({ value, format, decimals, currency, context }) => {
96
+ const style = format?.style ?? "plain";
97
+ if (style === "percent")
98
+ return `${new Intl.NumberFormat(context.locale, {
99
+ minimumFractionDigits: decimals ?? 0,
100
+ maximumFractionDigits: decimals ?? 0,
101
+ }).format(value)}%`;
102
+ return new Intl.NumberFormat(context.locale, {
103
+ ...(style === "currency" ? { style: "currency", currency: currency ?? "EUR" } : {}),
104
+ minimumFractionDigits: decimals ?? (style === "currency" ? 2 : 0),
105
+ maximumFractionDigits: decimals ?? 2,
106
+ }).format(value);
107
+ },
108
+ duration: ({ milliseconds, style }) => formatDurationMs(milliseconds, style),
109
+ calendarDay: ({ day, style, context }) => absoluteDay(dayKeyParts(day), style, viewerToday(context), context),
110
+ instant: ({ instant, style, withTime, context }) => {
111
+ const parts = instantParts(instant instanceof Date ? instant : new Date(instant), context.timeZone);
112
+ return absoluteDay(parts, style, viewerToday(context), context, withTime ? parts.time : undefined);
113
+ },
114
+ relativeCalendarDay: ({ day, context }) => relativeCalendarDay(day, context),
115
+ relativeInstant: ({ instant, context }) => relative(instant, context),
116
+ };
117
+ function presentation(opts) {
118
+ return {
119
+ implementation: opts?.presentation ?? DEFAULT_FIELD_PRESENTATION,
120
+ context: opts?.viewer ?? viewerFrom(DEFAULT_CONVENTIONS),
121
+ };
122
+ }
123
+ export function formatNumberValue(value, format, opts) {
124
+ const style = format?.style ?? "plain";
125
+ const decimals = opts?.decimals ?? (format && "decimals" in format ? format.decimals : undefined);
126
+ const signed = (format && "signed" in format && format.signed) || false;
127
+ const abs = signed ? Math.abs(value) : value;
128
+ if (style === "duration") {
129
+ const declared = format && "durationStyle" in format ? format.durationStyle : undefined;
130
+ const unit = format && "unit" in format ? format.unit : undefined;
131
+ const { implementation, context } = presentation(opts);
132
+ return implementation.duration({
133
+ milliseconds: unit === "s" ? abs * 1000 : abs,
134
+ style: opts?.durationStyle ?? declared,
135
+ context,
136
+ });
137
+ }
138
+ const currency = opts?.currency ?? (format && "currency" in format ? format.currency : undefined) ?? "EUR";
139
+ const { implementation, context } = presentation(opts);
140
+ const formatted = implementation.number({
141
+ value: abs,
142
+ format: format?.style === "duration" ? undefined : format,
143
+ decimals,
144
+ currency,
145
+ context,
146
+ });
147
+ if (!signed)
148
+ return formatted;
149
+ return `${value >= 0 ? "+" : "−"} ${formatted}`;
150
+ }
151
+ export function formatDateValue(value, dateStyle, withTime, kind = "datetime", opts) {
152
+ const d = kind === "date" && typeof value === "string"
153
+ ? fromDayKey(value)
154
+ : value instanceof Date
155
+ ? value
156
+ : new Date(String(value));
157
+ if (!d || Number.isNaN(d.getTime()))
158
+ return String(value);
159
+ const style = dateStyle ?? "short";
160
+ const { implementation, context } = presentation(opts);
161
+ const day = typeof value === "string" ? value : toDayKey(d);
162
+ let out;
163
+ if (style === "relative") {
164
+ out =
165
+ kind === "date"
166
+ ? implementation.relativeCalendarDay({ day, context })
167
+ : implementation.relativeInstant({ instant: d, context });
168
+ }
169
+ else {
170
+ out =
171
+ kind === "date"
172
+ ? implementation.calendarDay({ day, style, context })
173
+ : implementation.instant({ instant: d, style, withTime: !!withTime, context });
174
+ }
175
+ return out;
176
+ }
177
+ export function CellSuffix({ children }) {
178
+ return createElement("span", {
179
+ className: "ml-1 text-(length:--grid-text-xs,0.75rem) font-normal text-(color:--vk-fg-subtlest)",
180
+ }, children);
181
+ }
@@ -0,0 +1,8 @@
1
+ export { DISPLAY_CORES, renderFieldValue, type DisplayCore } from "./display-cores.js";
2
+ export { webHref } from "./web-href.js";
3
+ export type { DisplayOptions, FieldPresentation, FieldViewerContext, NumberLikeFormat, RelationWrap, } from "./options.js";
4
+ export { CellSuffix, DEFAULT_FIELD_PRESENTATION, formatDateValue, formatNumberValue } from "./format.js";
5
+ export { viewerFrom } from "./viewer.js";
6
+ export { cellTextClass } from "./text-class.js";
7
+ export { MultiValueCell } from "./multi-value.js";
8
+ export { CHIP_BASE, CHIP_INTERACTIVE } from "../internal/chip.js";
@@ -0,0 +1,7 @@
1
+ export { DISPLAY_CORES, renderFieldValue } from "./display-cores.js";
2
+ export { webHref } from "./web-href.js";
3
+ export { CellSuffix, DEFAULT_FIELD_PRESENTATION, formatDateValue, formatNumberValue } from "./format.js";
4
+ export { viewerFrom } from "./viewer.js";
5
+ export { cellTextClass } from "./text-class.js";
6
+ export { MultiValueCell } from "./multi-value.js";
7
+ export { CHIP_BASE, CHIP_INTERACTIVE } from "../internal/chip.js";
@@ -0,0 +1,29 @@
1
+ import { type ReactNode } from "react";
2
+ import { type FieldDefOf } from "@viewkitjs/fields";
3
+ import type { DisplayOptions } from "./options.js";
4
+ /**
5
+ * THE TWO ADDRESSES — a web address and a mail address. Both are text that goes
6
+ * somewhere; they differ in where, and in how loudly they say so.
7
+ */
8
+ /**
9
+ * A web address. The scheme is stripped from the LABEL and kept in the
10
+ * destination: `https://` is noise in a 240px box and load-bearing in an href.
11
+ * A value that is no link (`webHref`) draws as its text. Its platform
12
+ * (`linkPlatform`, read with the host's conventions) goes to the app's
13
+ * `PlatformMark`, drawn before it; the default draws nothing, so a link looks
14
+ * plain. Several links draw as their main one and a count (`renderValueList`).
15
+ */
16
+ export declare function renderUrl(_field: FieldDefOf<"url">, value: unknown, opts?: DisplayOptions): ReactNode;
17
+ /**
18
+ * A company's domain, labelled as it is kept and linked to `https://` it. A domain is the company's own site,
19
+ * so no platform is read from it: `linkedin.com` kept as a domain is no LinkedIn profile.
20
+ */
21
+ export declare function renderDomain(_field: FieldDefOf<"domain">, value: unknown, opts?: DisplayOptions): ReactNode;
22
+ /**
23
+ * One or several mail addresses.
24
+ *
25
+ * Never the option family's label treatment: an address is not a slug, and
26
+ * title-casing turned `no-reply@vendor.com` into "No Reply@vendor.Com" — a
27
+ * mangled address rather than merely an ugly one.
28
+ */
29
+ export declare function renderEmail(_field: FieldDefOf<"email">, value: unknown, opts?: DisplayOptions): ReactNode;