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 .agent/skills/basalt-html/parts/core.css

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions Sources/BasaltTokens/Tokens.swift
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,30 @@ extension Basalt {
dark: RGBA(red: 1, green: 1, blue: 1, alpha: 0.09)
)

/// The lit row's plate on the page (level 0), as one opaque colour: state-selected (black at 7%) over surface-0. For a part that replaces its own fill (a pressed toggle, a chosen card) or an app's own list row; --basalt-plate follows the level.
public static let plate0 = ThemedColor(
light: RGBA(red: 0.911749, green: 0.911749, blue: 0.911749, alpha: 1),
dark: RGBA(red: 0.125736, green: 0.125736, blue: 0.125736, alpha: 1)
)

/// The plate on a level-1 surface: state-selected over surface-1. In light, levels 1 to 3 are one white, so their plates are one colour.
public static let plate1 = ThemedColor(
light: RGBA(red: 0.930055, green: 0.930055, blue: 0.930055, alpha: 1),
dark: RGBA(red: 0.150617, green: 0.150617, blue: 0.150617, alpha: 1)
)

/// The plate on a level-2 surface: state-selected over surface-2.
public static let plate2 = ThemedColor(
light: RGBA(red: 0.930055, green: 0.930055, blue: 0.930055, alpha: 1),
dark: RGBA(red: 0.172036, green: 0.172036, blue: 0.172036, alpha: 1)
)

/// The plate on a level-3 surface: state-selected over surface-3.
public static let plate3 = ThemedColor(
light: RGBA(red: 0.930055, green: 0.930055, blue: 0.930055, alpha: 1),
dark: RGBA(red: 0.172036, green: 0.172036, blue: 0.172036, alpha: 1)
)

/// The one primary action per view: the inverse of the page.
public static let actionPrimary = ThemedColor(
light: RGBA(red: 0.090173, green: 0.090173, blue: 0.090173, alpha: 1),
Expand Down
40 changes: 37 additions & 3 deletions docs/foundations.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ kept as a rule so both themes behave alike (DECISIONS 166). Four text levels wer
prop, because paint without semantics ends up on a `div` nothing can operate. A real choice box (`size-choice`, the
checked control's own look) sits in a seat reserved on every choice card, on its header line, inline-end of the title,
empty at rest with the input boundary, so choosing moves no title. Selected is the selected wash as one solid fill at the
card's own level (the active-row plate recipe: `--_plate-solid`, about `#262626` on level 1 in dark and `#ededed` on
card's own level (the active-row plate, `--basalt-plate`, the token `plate-1` on level 1: about `#262626` on level 1 in dark and `#ededed` on
white), with the rim and the level unchanged: level is position, and a chosen card is not nested deeper. The title stays
primary with no weight change; tertiary content steps to secondary on the fill. Hover on an unselected card is the
hover wash alone, with no further step on a selected one; there is no press scale; focus is the control ring at +2
Expand Down Expand Up @@ -826,7 +826,7 @@ type. `Heading size` takes `"6xl"`, `"7xl"`, `"hero"` and `"display"`; the roles
## Space, size, radius

- **Space:** a 4px base, with Tailwind-compatible names (`space-4` is 16px), plus the half
steps 0.5, 1.5, 2.5 and 3.5 (2, 6, 10 and 14px) for control padding and optical spacing, and `space-32` (128px), the large section gap.
steps 0.5, 1.5, 2.5 and 3.5 (2, 6, 10 and 14px) for control padding and optical spacing, and `space-32` (128px), the large section gap. There is no step above it: a larger length is a size with a role (a label column is `size-description-label`, 160), not a gap.
- **Component sizes are tokens too:** the tab underline (2), tracks (4), dots (6), choice boxes,
the switch, kbd and badge heights, table rows, and the widths of dialogs, sheets, toasts,
popovers, tooltips and the command menu, all under `size-*`. Component CSS has no raw
Expand Down Expand Up @@ -2183,7 +2183,7 @@ as if it were known, which Basalt can't detect.

## What the HTML skill does not draw

The log slots, the status bar, the command block, the event log, the source stamp, the inline-label rows, the filter toolbar, the notice bar, the listbox, the open list, the drawer and `Reflow` are React's alone: the HTML skill has no module for them (DECISIONS 167, Q8). So are `Pagination` and `ListBand` (DECISIONS 222: the skill has no pagination module and none is added). The skill's modules draw the rest (DECISIONS 230, the owner approved the caps): `select` has `data-numeric` (the width of its widest option, measured once fonts are ready; cap 9,000), `filter` has a toolbar trigger that holds its widest value (cap 17,450), and the form dialog is a module of its own, `dialog-form` (`data-form`: the 480 box, the held head and foot, the scrolling body, full screen under 720, the top held as it opens and first focus by the input that opened it; cap 2,200), so the plain and alert dialog keep `dialog`'s 5,150. React's alone: `FormGrid` and the rest of Declare's gaps (DECISIONS 242: the form grid, a segmented control's `fullWidth`, `required`, `invalid` and its tab stop on the chosen value, a `Switch` description, `TextButton` keeping focus and underlining a `Reserve`), the held top's re-measure on a window resize, and the scrim closing a form only while nothing has been entered (the skill's scrim closes it). React's alone too: `LoadingShape` and its parts (DECISIONS 258; the skill's loading shape is a follow-up batch). Whether the skill gets the links and the charts is not decided.
The log slots, the status bar, the command block, the event log, the source stamp, the inline-label rows, the filter toolbar, the notice bar, the listbox, the open list, the drawer and `Reflow` are React's alone: the HTML skill has no module for them (DECISIONS 167, Q8). So are `Pagination` and `ListBand` (DECISIONS 222: the skill has no pagination module and none is added). The skill's modules draw the rest (DECISIONS 230, the owner approved the caps): `select` has `data-numeric` (the width of its widest option, measured once fonts are ready; cap 9,000), `filter` has a toolbar trigger that holds its widest value (cap 17,450), and the form dialog is a module of its own, `dialog-form` (`data-form`: the 480 box, the held head and foot, the scrolling body, full screen under 720, the top held as it opens and first focus by the input that opened it; cap 2,200), so the plain and alert dialog keep `dialog`'s 5,150. React's alone: `FormGrid` and the rest of Declare's gaps (DECISIONS 242: the form grid, a segmented control's `fullWidth`, `required`, `invalid` and its tab stop on the chosen value, a `Switch` description, `TextButton` keeping focus and underlining a `Reserve`), the held top's re-measure on a window resize, and the scrim closing a form only while nothing has been entered (the skill's scrim closes it). React's alone too: `LoadingShape` and its parts (DECISIONS 258; the skill's loading shape is a follow-up batch). React's alone too: `Composer`, `Mention` and `MentionPicker` (cimip-gaps-2, B3; see [Writing to someone](#writing-to-someone-the-composer-the-mention-and-the-picker)). Whether the skill gets the links and the charts is not decided.

## Logs, status and forms

Expand Down Expand Up @@ -2232,6 +2232,40 @@ implementation hasn't been reviewed by the panel). Candidates D14a, D14b, D15, X
`Stat`'s source line. A countdown ticks by the second and a clock by the minute on one shared timer; `data-loops="held"` freezes both and releasing writes the current value; no live region; reduced motion does not stop them.
- **Filter toolbar** (`FilterToolbar`): the kind select (phone only), the filter, `FilterResult` and the sort with the word "Sort" beside it (`aria-hidden`, and in the select's `aria-label`).

## Writing to someone: the composer, the mention and the picker

Found by an app's message stream (cimip-gaps-2, batch B3; the no-council path, DECISIONS 226 and 265: decided and built by Opus, the code reviewed by Astra and the pixels checked by
the lead; the owner sees the pictures before merge). Every part serves any app where people write to each other: a support inbox, a build's comments, a team chat, a shared document.

- **The composer** (`Composer`). The field is Basalt's `Textarea` with an accessible name (`label`) and no visible label; the placeholder says where the message goes too. Under it a row:
the app's own actions at its start (ghost `sm` buttons: attach, a format toggle) and Send, a primary Button, always the row's last, at its end. Under that one status line, `text-xs` in
tertiary ink, one line tall even when empty and never more (a long list of names is cut with an ellipsis; the live region holds the whole text), a polite live region: who is typing (`typingStatus`: "Ana is typing", "Ana and Ben are typing", "Ana, Ben, and Cy are typing", "4 people
are typing") or anything the app says there. Nothing moves when it fills. The field starts at `rows` lines (default 2, the textarea's own least) and grows with its text a line at a time
to `maxRows` (default 8), then scrolls; it has no resize handle, since its height is its text's. Where the browser cannot size a field to its content (`field-sizing`), it is measured, within
the same bounds.
- **Sending.** Enter sends and Shift+Enter is a new line (the soft keyboard's key says Send), or with `sendKey="Mod+Enter"` Enter is a new line and the platform's modifier with Enter sends,
shown as chips beside Send (`ActionShortcut`). A key never sends, and never picks a name, while an input method is composing (`isComposing`, or the key code 229 some engines send instead). The key presses Send, so a key and a press are one send and the button's own wait
(`waitForAnswer`) guards both: a second Enter while a message is out sends nothing. On success the field is cleared, unless its text changed while the send was out; a refusal (a
rejection, or `false`) keeps the words. A press on Send keeps focus, and a phone's keyboard, in the field; after a keyboard press on Send, focus goes back to the field.
- **A mention** (`Mention`) is the trigger and the name, "@Ana Ruiz", at 500 in primary ink: a glyph and a weight mark it, never a colour, and it wraps with its text. The trigger is a prop
("#billing"). A mention that calls on the reader (`you`) also sits on its level's plate (`--basalt-plate`), radius 4, 2px each side of its own (given back by a margin, the plate ate half the space before it), drawn on
every line it wraps to; in forced colours it is `Mark` with `MarkText`, and in print the plate is dropped.
- **The mention picker** (`MentionPicker`; `Composer`'s `mentions` renders it for the composer's field, and the app imports it, so a composer without names never carries it) is Combobox's popup and rows, reused: the popup's level (its opener's plus one), rim, `shadow-overlay`, radius 12,
one-line and two-line rows (40 and 58), group labels ("People", "Teams", "Roles", the app's words), the plate, its glide and the lift. `Listbox` is a list in the page that holds its own
focus, so it is not the picker. Focus stays in the field, which carries `aria-autocomplete="list"` and `aria-haspopup="listbox"`, and while the picker is open `aria-controls` and
`aria-activedescendant` to the active row (whose `aria-selected` is true). A trigger at the start of the text, or after a space or an opening bracket, opens it; one inside a word (an address)
does not. ↑ and ↓ move the plate, passing over a row that cannot be picked; Enter or Tab writes the trigger, the name and a space (the browser's own undo takes it back); a press on a row picks
it; Esc closes it until another trigger is typed, and a dialog round the field stays open. A name may hold a space while something matches it; once nothing does, the picker closes, so a
sentence is never held, and a query that matches nothing opens nothing (the app still hears it, `onQueryChange`, to look names up). The default match is each word typed starting a word of
the label or the description. It sits 6px under the trigger's line, or above it when there is more room there, inside what can be seen, 8px from its edges, at every width: the room is the visual viewport's where there is one, so a phone's keyboard (which shrinks it and not WebKit's `innerHeight`) counts. It never writes into a field that is read-only or disabled (it does not open there, and checks again as it writes), nor into a mention the field no longer holds: a value the app set while it was open closes it, and an Enter or Tab meant for its rows then writes and sends nothing. The field's own `aria-controls`, `aria-activedescendant`, `aria-autocomplete` and `aria-haspopup` are kept and put back when it closes or lets go. Rows are cut and never
wrap, as every popup row is (whether a described row may wrap is open). It enters and leaves as a popup does.
- **The plate is public.** The lit row's plate as one opaque colour per level is the tokens `plate-0` to `plate-3` (the selected wash composited over the level, or in dark over the next
level; a test holds each to that recipe), in both themes and in Swift, and `--basalt-plate`, which follows the level a part sits in (`data-level`; the page and a nested theme root start
at `plate-0`). An app's own list draws its active row with it as Basalt's do (and gives that row a forced-colours form of its own, `Highlight` with `HighlightText`, since a fill is dropped there); Basalt's pressed toggle, chosen card and chosen peek read it, painting the pixel the private recipe did.
- **No space step above `space-32`.** The 160 an app asked for was a label column, which `size-description-label` names. A space step is a gap; past 64 the scale holds only the section gaps
(96 and 128, `size-section-gap-md` and `size-section-gap`), and a larger gap than those has no role.
- **The HTML skill** draws none of these: they are React's alone. A page the skill writes is read, not written into, so a composer and a picker have no use there; a quoted mention is words.

## Primitives

Components build on Base UI (the default base in shadcn/ui since July 2026, from the team
Expand Down
29 changes: 29 additions & 0 deletions packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,35 @@ const { shortcuts, keyshortcuts } = useShortcuts([{ key: "j", description: "Next
- The formatters draw nothing: `formatStamp` ("14:49:07", to the second and always 24-hour), `formatClock` ("2:49 PM" in `en-US`, "14:49" in `en-GB`: a clock a person reads follows the locale, with a numeric hour), `formatDay` ("Nov 1"), `formatCountdown` ("18d 09:10:51", `null` once passed) and `formatAge`, each with its machine `dateTime` (ISO), the zone an argument and the `locale` too (default `en-US`, never the runtime's, so a server's render and the browser's agree). `Clock`, `Stat`, `SourceStamp`, `SourceStateWords` and `CommandBlock` take `locale` as well, and `EventLog` for the width its time column reserves.
- `SourceStamp`'s name and time are the app's: Basalt ships no source's icon or name.

## Writing to someone

The composer, the mention and the mention picker (cimip-gaps-2, B3; decided and built by Opus on the no-council path, not yet reviewed). See foundations, "Writing to
someone".

```tsx
{/* A support inbox: Enter sends, Shift+Enter is a new line; the send waits for the server and keeps the words if it is refused */}
<Composer
label="Reply to the customer"
placeholder="Reply to the customer. Type @ to bring someone in."
actions={<Button variant="ghost" size="sm" onClick={attach}>Attach</Button>}
status={typingStatus(typingNames)}
onSend={(text) => api.reply(ticket, text)}
mentions={(field) => <MentionPicker field={field} options={[{ label: "Ana Ruiz", value: "u1", description: "Support lead", group: "People" }, { label: "billing", value: "t1", description: "Team of 4", group: "Teams" }]} onPick={(o) => picked.add(o.value)} />}
/>

{/* A build's comments: Mod+Enter sends (⌘↵ or Ctrl Enter, shown beside Send) */}
<Composer label="Comment on the build" sendKey="Mod+Enter" onSend={comment} />

{/* In the stream: a mention, and one that calls on the reader (on the plate) */}
<p>Thanks <Mention>Ana Ruiz</Mention>; <Mention you>Lee Park</Mention>, can you look? Routed to <Mention trigger="#">billing</Mention>.</p>

{/* An app's own text field with the picker: its handlers see defaultPrevented on a key the picker used */}
<MentionPicker field={ref} options={people} filter={null} onQueryChange={lookUp} />
```

An app's own list draws its active row with the plate Basalt's popups use: `background: var(--basalt-plate)` follows the level the row sits in, and the tokens
`--basalt-plate-0` to `--basalt-plate-3` are each level's.

## Loading in the page's own shape

A region whose data is on its way draws its own parts, and what isn't known is painted as bones measured from the drawing (DECISIONS 247, 248, 249b and 258;
Expand Down
Loading
Loading