Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.d/facts-value-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
section: kit
---

- **`Facts` and `ValueList` render key-value and value lists as plain text**. `Facts` and `Fact` display key-value pairs with muted UI-font labels ("Runs on") in an aligned column; `meta` puts a note ("and 8 run steps") beside a value, and `change` marks an added or removed row. `ValueList` renders comma-separated or stacked values as text, marking added, removed, and changed items inline with change hues, signs, and strikethrough instead of wrapping each item in a pill like `ChangePills`. `ValueMark` marks one value the same way, and `ValueChange` accepts `variant="text"` for a single value change in the same style, and `Fields` is now `Facts` with code labels. See [Layout components](docs/guides/renderer-kit-components.md#layout-components).
- **`Facts` and `ValueList` render key-value and value lists as plain text**. `Facts` and `Fact` display key-value pairs with muted UI-font labels ("Runs on") in an aligned column; `meta` puts a note ("and 8 run steps") beside a value, and `change` marks an added or removed row. `ValueList` renders comma-separated or stacked values as text, marking added, removed, and changed items inline with change hues, signs, and strikethrough instead of wrapping each item in a pill like `ChangePills`. `ValueMark` marks one value the same way, and `ValueChange` accepts `variant="text"` for a single value change in the same style, and `Fields` is now `Facts` with code labels. See [Renderer kit: type and values](docs/guides/renderer-kit-type.md#facts-and-value-lists).
6 changes: 6 additions & 0 deletions changelog.d/type-roles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
section: kit
---

- **Type roles style text by purpose instead of size**. `Text variant` takes a role (`title`, `heading`, `kind`, `label`, `value`, `code`, `meta`, or `figure`) with its size, weight, font, and tone from the theme; without React, use the `pk-type-<role>` class. Kit components apply them automatically (`EntityCard` names use `title`, `Group` header bands use `heading`, and `Facts` labels use `label`). The kit also adds three quiet text pieces: `Code` for inline code, `Slot` for a named placeholder in a template, and `Tag` for a category label without a border. See [Renderer kit: type and values](docs/guides/renderer-kit-type.md).
- **`EntityCard` adds header slots around its title**. Optional muted slots place `kind` above the title ("Job", "Service"), a single-line `subtitle` below it, and `aside` at the end of the first line (such as a timeout); `titleFont="code"` renders code identifiers in monospace. `Facts` placed directly inside a card align with the title. See [Layout components](docs/guides/renderer-kit-components.md#layout-components).
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ the same tasks: [explore](agents/explore.md), [install](agents/install.md),
[develop a renderer](guides/develop-a-renderer.md), the
[renderer kit guide](guides/renderer-kit.md) (including
[graphs](guides/renderer-kit-graphs.md) and
[components](guides/renderer-kit-components.md) and
[components](guides/renderer-kit-components.md),
[type and values](guides/renderer-kit-type.md), and
[change emphasis](guides/change-emphasis.md)), and the
[renderer SDK guide](guides/renderer-sdk.md). When you need API details, check
the [renderer kit API](reference/renderer-kit.md), the
Expand Down
3 changes: 2 additions & 1 deletion docs/agents/create-projection.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,8 @@ kit already meets the checks the host holds every renderer to. The starter has
no stylesheet: compose views from the kit's components (`ContentView`, `Group`,
`CardGrid`, `EntityCard`, `Facts`, `ValueList`, `Fields`, `Stack`, `Inline`,
`Text`, `Chip`, `Chips`) and their props (`Facts` for properties and settings,
`ValueList` for value lists with inline change marks instead of pills),
`ValueList` for value lists with inline change marks instead of pills, and
`Text variant` for type roles like `title`, `label` or `meta` instead of sizes),
and for an inline style they don't cover use `token` (`token.space(2)`). For
items with comparable properties (a row per item, a column per property), use
the kit's `DataTable` rather than hand-built table markup: sortable headings
Expand Down
40 changes: 21 additions & 19 deletions docs/guides/renderer-kit-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,30 +312,32 @@ accept token scale steps rather than raw lengths or colors—this is how
select button, `label`, `identifier`, `children`, and worded change status. In
progress modes, its leading edge picks up the change hue as `emphasis` rises
while `presence` fades it in or out; in diff mode, `mark={change}` applies
standard kit change-region styling.
standard kit change-region styling. Its header gives the card one title:
`label` uses the `title` role (`titleFont="code"` for code identifiers), with
optional muted slots for `kind` above it ("Job", "Service"), a one-line
`subtitle` below it ("6 runs · fail-fast off"), and `aside` at the end of the
first line (such as a timeout). `Facts` placed directly inside a card align
with its title.
- `RelationshipList` and `RelationshipItem` list a card's relationships, each a
selectable unit with its own ID, `presence`, and (in diff mode) `mark` and
`changeText`.
- `Facts` and `Fact` render a key-value list with muted UI-font labels ("Runs
on") in an aligned column. `meta` adds a muted note after a value ("and 8 run
steps") instead of a separate row, and `change` marks an added or removed row.
`Fields` and `Field` are the same list with `labelFont="code"` for raw data
keys.
- `ValueList` renders a list of values as text, separated by commas (or
`separator="dot"`) and wrapping between items, or stacked one per line
(`layout="stack"`). Added items appear in the added hue after `+`, removed
items are struck through in the removed hue after `−`, and changed items show
the old value (`was`) struck through, an arrow, and the new value. Marks fade
with `emphasis` (inheriting the surrounding item's when omitted) and are
announced in words. Items are unboxed by default; `display="chips"` renders
them as chips (`ChangePills`) for small or selectable sets.
`ValueChange variant="text"` renders a single value change the same way,
without pills.
- `Facts` and `Fact` (an item's facts as a key-value list) and `ValueList` (a
list of values with changes marked inline, not in pills): see
[Renderer kit: type and values](renderer-kit-type.md#facts-and-value-lists).
- `Stack` and `Inline` arrange children in a vertical column or wrapping row
with `gap={1…8}` steps from the spacing scale.
- `Text` renders typography using `size` (`xs`, `sm`, `md`, `lg`, `xl`),
`weight`, and `tone` (`default`, `muted`, `subtle`, or one of the kit's tones,
`quiet` and `flag`; see [Tones](#tones)).
- `Text` renders text using a [type role](#type-roles) (`variant`), or `size`
(`xs`, `sm`, `md`, `lg`, `xl`) and `weight` when no role fits, along with
`tone` (`default`, `muted`, `subtle`, or one of the kit's tones, `quiet` and
`flag`; see [Tones](#tones)).
- `Code`, `Slot`, and `Tag` are quiet text pieces; see
[Renderer kit: type and values](renderer-kit-type.md).

## Type roles

Text in kit components uses a type role (`title`, `heading`, `kind`, `label`,
`value`, `code`, `meta`, or `figure`) instead of a raw size; see
[Renderer kit: type and values](renderer-kit-type.md).

## Tones

Expand Down
58 changes: 58 additions & 0 deletions docs/guides/renderer-kit-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Renderer kit: type and values

Readers scan a projection in seconds, so its text hierarchy needs to be clear at
a glance. The kit's type roles and quiet text pieces keep that hierarchy
consistent across renderers; the authoring guide's
[visual craft](../agents/create-projection.md#visual-craft) rules cover when to
use each one.

## Type roles

A type role describes what a piece of text is and sets its size, weight, font,
and tone from the theme so cards read consistently across views. Use a role
instead of a raw size:

<!-- prettier-ignore -->
| Role | Use | Style |
|---|---|---|
| `title` | Card name | Body size, semibold |
| `heading` | Section inside a card or group header band | One step smaller, semibold |
| `kind` | Category word above a title ("Job", "Service") | Smallest step, muted |
| `label` | Key beside a value ("Runs on") | Muted, matching the value's size |
| `value` | Body text | Matches surrounding text |
| `code` | Identifier, path, version, or expression | Monospace, one pixel smaller |
| `meta` | Secondary detail ("40 min") | Smallest step, muted |
| `figure` | Count or number in a column | Tabular figures |

Pass `Text variant="title"` (or any other role) in React, or add the
`pk-type-<role>` class (`typeRoleClass(role)`, from the kit's main entry) to any
element without React. Kit components apply these roles themselves: an
`EntityCard` name uses `title`, `Facts` labels use `label`, and a `Group` header
band uses `heading`. Unmuted roles inherit the surrounding text color, so
removed items stay muted.

## Facts and value lists

`Facts` and `Fact` render a key-value list with muted UI-font labels ("Runs on")
in an aligned column. `meta` adds a muted note after a value ("and 8 run steps")
instead of a separate row, and `change` marks an added or removed row. `Fields`
and `Field` are the same list with `labelFont="code"` for raw data keys.

`ValueList` renders a list of values as text, separated by commas (or
`separator="dot"`) and wrapping between items, or stacked one per line
(`layout="stack"`). Added items appear in the added hue after `+`, removed items
are struck through in the removed hue after `−`, and changed items show the old
value (`was`) struck through, an arrow, and the new value. Marks fade with
`emphasis` (inheriting the surrounding item's when omitted) and are announced in
words. Items are unboxed by default; `display="chips"` renders them as chips
(`ChangePills`) for small or selectable sets. `ValueMark` marks one value the
same way, and `ValueChange variant="text"` renders a single value change without
pills.

## Quiet text pieces

`Code` renders inline code in prose or a value (an expression, path, or version)
in monospace, inheriting the surrounding text color with no fill or border.
`Slot` renders a named placeholder in a template (`Build on os`) as muted
monospace without brackets. `Tag` renders a quiet category label (such as a
lifetime or mode) with a recessed fill and no border.
Loading
Loading