diff --git a/.changeset/design-guide-from-sessions.md b/.changeset/design-guide-from-sessions.md
new file mode 100644
index 00000000..a479c4bb
--- /dev/null
+++ b/.changeset/design-guide-from-sessions.md
@@ -0,0 +1,5 @@
+---
+"@codeui/kit": patch
+---
+
+Extend the Inkstone guide with rules from CodeLoom reviews: a 6px gap between islands, hover cards instead of `title`, rows in a list, background work, technical values, avatars, forms, and loading without an empty flash.
diff --git a/.changeset/dropdown-menu-spacing.md b/.changeset/dropdown-menu-spacing.md
new file mode 100644
index 00000000..ce8a51cc
--- /dev/null
+++ b/.changeset/dropdown-menu-spacing.md
@@ -0,0 +1,5 @@
+---
+"@codeui/styles": patch
+---
+
+Draw dropdown separators as a single line aligned with the item labels. Reduce row padding and the gaps between items and before shortcuts.
diff --git a/.changeset/hover-card-resizable.md b/.changeset/hover-card-resizable.md
new file mode 100644
index 00000000..9e6fef7d
--- /dev/null
+++ b/.changeset/hover-card-resizable.md
@@ -0,0 +1,9 @@
+---
+"@codeui/kit": minor
+"@codeui/styles": minor
+---
+
+Add HoverCard (`@codeui/kit/hover-card`) and Resizable (`@codeui/kit/resizable`), with their styles in `@codeui/styles/hovercard` and `@codeui/styles/resizable`.
+
+- `HoverCard`, `HoverCardTrigger` and `HoverCardContent` show supplementary details on hover or keyboard focus. The card opens after 500ms, closes 150ms after the pointer leaves, closes on Escape, uses the Popover surface with a 320px max width, and does not animate when opened from the keyboard.
+- `Resizable`, `ResizablePanel` and `ResizableHandle` split a row or a column into panels sized by fractions or `"240px"` strings, with `minSize`, `maxSize` and `collapsible`. The handle is an 8px hit area with a 1px line that changes colour on hover, drag and focus, and it moves with the arrow keys, Home and End.
diff --git a/.changeset/hover-card-shared-surface.md b/.changeset/hover-card-shared-surface.md
new file mode 100644
index 00000000..11f39289
--- /dev/null
+++ b/.changeset/hover-card-shared-surface.md
@@ -0,0 +1,14 @@
+---
+"@codeui/kit": minor
+"@codeui/styles": minor
+---
+
+Hover cards share one card and move it between triggers.
+
+- All the hover cards of a page share one card. Moving the pointer or keyboard focus to another trigger while a card is open moves that card at once: it slides to the new trigger, resizes to the new content, and fades the new content in. For 400ms after a card closes, the next one opens at once and without the pop. The move lasts 200ms (`--cui-motion-duration-panel`) with the kit's ease-out. While the pointer is on its way to the open card, another trigger it crosses takes the card only after 150ms of rest. A move from the keyboard swaps the content in place with no motion; with reduced motion only the new content fades in.
+- `HoverCardGroup` gives the cards inside it a card of their own, with `skipDelayDuration` for the skip window. `shared={false}` gives one `HoverCard` its own surface; `forceMount` implies it.
+- `HoverCardContent` is no longer polymorphic. Its props (`class`, `classes`, `style`, `ref`, `mount`, dismiss handlers, and any other attribute or event handler) go on the shared card while that card shows it, and come off when another card takes it over.
+- `HoverCard` drops the Kobalte root options it never used (`id`). The trigger renders without a Kobalte popover anchor and still sets `data-expanded` and `data-closed`.
+- Overlays opened by hover tell pointer from keyboard more reliably: the input tracker also records `pointerover`, which the browser fires before the `pointermove` that crosses into an element.
+- A hover card opened from inside another card's content gets a surface of its own. The outer card stays open while the pointer is on the inner card and until it closes, and a press on the inner card does not close it.
+- An `a` trigger (alone or `as={Link}`) has a dotted underline in the hint tone (`--cui-hovercard-trigger-decoration-color`) that takes the text colour on hover and while the card is open.
diff --git a/.changeset/hovercard-controlled-closed.md b/.changeset/hovercard-controlled-closed.md
new file mode 100644
index 00000000..f063d267
--- /dev/null
+++ b/.changeset/hovercard-controlled-closed.md
@@ -0,0 +1,5 @@
+---
+"@codeui/kit": patch
+---
+
+HoverCard no longer opens an empty card. With `open={false}` a second hover, focus or click left the shared surface open with nothing in it, and a card without `HoverCardContent` opened an empty surface too. Both now stay closed.
diff --git a/.changeset/kit-avatar-hovercard.md b/.changeset/kit-avatar-hovercard.md
new file mode 100644
index 00000000..bbe77593
--- /dev/null
+++ b/.changeset/kit-avatar-hovercard.md
@@ -0,0 +1,10 @@
+---
+"@codeui/kit": minor
+"@codeui/styles": minor
+---
+
+Add Avatar (`@codeui/kit/avatar`, styles in `@codeui/styles/avatar`) and bring HoverCard in line with the Inkstone guide.
+
+- `Avatar` shows a person's picture, or one or two initials on a fill whose hue comes from a stable `identifier` (never the name). It has a full radius with a neutral 20% ring, sizes `xs` to `lg` from the shared control scale and density, the name as its accessible name and in the kit Tooltip, and a dashed `unassigned` state. `avatarHue` and `avatarInitials` are exported.
+- `HoverCard` opens at once on click as well as on hover and focus. On a touch screen the first tap on a link opens the card instead of following it. The default placement is `right-start` (it was `bottom`), and the card wraps long words.
+- `HoverCardList` and `HoverCardItem` render a list inside a hover card: one line per entry with a state icon, an identifier and a truncated title, nesting by `depth`, capped at 24rem with its own scroll.
diff --git a/.changeset/solid-2.md b/.changeset/solid-2.md
new file mode 100644
index 00000000..70691cb9
--- /dev/null
+++ b/.changeset/solid-2.md
@@ -0,0 +1,8 @@
+---
+"@codeui/kit": minor
+"@codeui/styles": patch
+---
+
+Require Solid 2 and `@solidjs/web` for the component kit. Upgrade the application to Solid 2 and switch to `@solidjs/vite-plugin` before installing this release. The kit uses Kobalte 2.0.0.
+
+Keep the background from receiving pointer input while a hydrated modal is open.
diff --git a/.changeset/tooltip-provider-defaults.md b/.changeset/tooltip-provider-defaults.md
new file mode 100644
index 00000000..9e2cf40f
--- /dev/null
+++ b/.changeset/tooltip-provider-defaults.md
@@ -0,0 +1,7 @@
+---
+"@codeui/kit": minor
+---
+
+Add `TooltipProvider` (`Provider` in `@codeui/kit/tooltip/parts`) to set `openDelay`, `closeDelay`, `skipDelayDuration`, `gutter`, `shift` and `variant` for every tooltip below it. A prop on one tooltip still wins.
+
+Tooltips are calmer by default: they open 700ms after hover (was 200ms), the next one opens at once for 400ms after one closes (was 300ms), and they use the neutral `secondary` fill (was the brand `primary`). Pass `openDelay`, `skipDelayDuration` or `variant` to keep the old behaviour.
diff --git a/.claude/skills/verify-codeui/features/README.md b/.claude/skills/verify-codeui/features/README.md
index 9dea01d2..5bb08075 100644
--- a/.claude/skills/verify-codeui/features/README.md
+++ b/.claude/skills/verify-codeui/features/README.md
@@ -31,9 +31,10 @@ Each feature file has an H1, one paragraph of user-visible behavior, and exactly
## Features
-- [Overlays](./overlays.md): Dialog and Popover open, focus, dismiss and focus return. Proven journey: `journeys/dialog-keyboard.mjs`.
+- [Overlays](./overlays.md): Dialog, Popover and HoverCard open, focus, dismiss and focus return; HoverCard tap, placement and list. Proven journeys: `journeys/dialog-keyboard.mjs`, `journeys/hovercard-touch.mjs`, `journeys/hovercard-list.mjs`, `journeys/hovercard-edge.mjs`.
+- [Avatar](./avatar.md): initials contrast on every hue, hue from the id, ring, sizes per density, unassigned, tooltip. Journeys: `journeys/avatar.mjs`, `journeys/avatar-sizes.mjs`.
- [Form fields](./form-fields.md): TextField, Select, Listbox, NumberField, SegmentedControl, RadioList, Checkbox input by keyboard, validation states.
- [Theming](./theming.md): `data-cui-theme` modes, `--cui-*` tokens, and the `@layer cui` override contract.
- [Settings rows](./settings.md): SettingsRow and SettingsGroup labelling, CodeImage parity and phone stacking. Journey: `journeys/settings-row.mjs`.
- [Feedback](./feedback.md): Tooltip on hover and focus. Keyboard journey: `journeys/tooltip-keyboard.mjs`.
-- [Sidebar and settings controls](./controls.md): Accordion first click, Switch pointer vs keyboard focus, OptionCard keyboard. Journeys: `journeys/accordion-first-click.mjs`, `journeys/switch-focus.mjs`, `journeys/option-card-keyboard.mjs`.
+- [Sidebar and settings controls](./controls.md): Accordion first click, Switch pointer vs keyboard focus, OptionCard keyboard. Resizable handle keyboard. Journeys: `journeys/accordion-first-click.mjs`, `journeys/resizable-keyboard.mjs`, `journeys/switch-focus.mjs`, `journeys/option-card-keyboard.mjs`.
diff --git a/.claude/skills/verify-codeui/features/avatar.md b/.claude/skills/verify-codeui/features/avatar.md
new file mode 100644
index 00000000..897553a1
--- /dev/null
+++ b/.claude/skills/verify-codeui/features/avatar.md
@@ -0,0 +1,29 @@
+# Avatar
+
+A person shows as a circle: their picture, or one or two initials on a hue derived from a stable id. The name is the accessible name (`role="img"`) and shows in the kit Tooltip on hover. Sizes follow the shared control scale and density; an unassigned owner is a dashed empty circle.
+
+## Sub-features
+
+- `avatar-initials`: initials reach 4.5:1 against the fill on every hue in both themes; hues differ by id, and the same name with different ids gets different hues; neutral fill without an id.
+- `avatar-ring`: full radius and a 1px inset ring at 20% of `--cui-text-default` (§2.5 neutral, 16–35% alpha).
+- `avatar-sizes`: `xs`, `sm`, `md`, `lg` equal `--cui-control-height-*` at compact, comfortable and touch density.
+- `avatar-unassigned`: dashed border in `--cui-text-muted`, no fill, no children, named "Unassigned".
+- `avatar-picture`: the picture covers the circle; a failed picture falls back to initials (`designsystem-avatar--states`).
+- `avatar-tooltip`: hovering shows the name in `[data-cui=tooltip-content]`.
+
+## How to get to it (user POV)
+
+- `designsystem-avatar--initials`: eight people, three "Sam Lee" with different ids, one guest without an id.
+- `designsystem-avatar--sizes`: every size at compact, comfortable and touch density, with initials, picture and unassigned.
+- `designsystem-avatar--states`: picture, failed picture, unassigned.
+
+## Driving it with drive.mjs
+
+- `node .claude/skills/verify-codeui/scripts/drive.mjs designsystem-avatar--initials --journey .claude/skills/verify-codeui/journeys/avatar.mjs` checks contrast per avatar by painting the computed fill into a canvas (Chrome reports OKLCH), hue difference, the ring alpha, and the tooltip on hover.
+- `node .claude/skills/verify-codeui/scripts/drive.mjs designsystem-avatar--sizes --journey .claude/skills/verify-codeui/journeys/avatar-sizes.mjs` checks heights against the size table, the unassigned border, and that the picture covers the circle.
+
+## Gotchas
+
+- `getComputedStyle().backgroundColor` returns `oklch(...)`; convert through a canvas before computing contrast.
+- The avatar is not focusable, so its tooltip opens on hover only. Keyboard users get the name from the accessible name.
+- The failed-picture state needs a request that 404s; the static Storybook server answers `/missing-avatar.png` with 404.
diff --git a/.claude/skills/verify-codeui/features/controls.md b/.claude/skills/verify-codeui/features/controls.md
index 81a90b14..0204d5d6 100644
--- a/.claude/skills/verify-codeui/features/controls.md
+++ b/.claude/skills/verify-codeui/features/controls.md
@@ -9,6 +9,7 @@ The controls CodeImage's sidebar and Settings dialog are built from: the accordi
- `switch-pointer` toggles on click with no focus ring.
- `switch-keyboard` toggles with Space and shows the 2px ring; Tab focus shows it too.
- `option-card-keyboard` enters the group with Tab, selects with arrows, draws one ring outside the focused card and the inset accent ring on the selected one.
+- `resizable-keyboard` focuses the `separator` handle with Tab, moves it with the arrow keys and stops at the panel's `minSize`/`maxSize` (Home 200px, End 360px). Journey: `journeys/resizable-keyboard.mjs` on `designsystem-resizable--sidebar`; `--vertical` and `--collapsible` render-only.
## How to get to it (user POV)
diff --git a/.claude/skills/verify-codeui/features/overlays.md b/.claude/skills/verify-codeui/features/overlays.md
index 0cf6b2cc..eaf2c45d 100644
--- a/.claude/skills/verify-codeui/features/overlays.md
+++ b/.claude/skills/verify-codeui/features/overlays.md
@@ -17,6 +17,10 @@ Dialog and Popover open from a trigger, move focus inside, trap Tab while modal,
- `popover-dismiss` closes on Escape and returns focus to the trigger.
- `popover-pop` opens with `data-motion="none"` from the keyboard and pops from the trigger side with a pointer; surface `--cui-surface-dialog`, radius 18, 14px / 1.3 text. Journey: `journeys/popover-pop.mjs` on `designsystem-popover--popover-story`.
- `menu-pop` the same for DropdownMenu, with 36px rows at 14px. Journey: `journeys/menu-pop.mjs` on `designsystem-dropdownmenu--dropdown-menu-story`.
+- `hovercard-open` opens `[data-cui=hovercard-content]` on trigger focus (no motion, focus stays on the trigger) and on a resting pointer; Escape and moving away close it; surface `--cui-surface-dialog`, radius 16, max width 320. Journey: `journeys/hovercard-open.mjs` on `designsystem-hovercard--hover-card-story`.
+- `hovercard-touch` opens the card on a touch tap without following the link, places it on the right of the trigger by default, keeps the floating surface (dialog fill, shadow with the dark inset ring, radius 16, max width 320), closes on an outside press, and opens at once on a mouse click. Journey: `journeys/hovercard-touch.mjs` on `designsystem-hovercard--hover-card-story`.
+- `hovercard-edge` flips the card to the left when there is no room on the right. Journey: `journeys/hovercard-edge.mjs` on `designsystem-hovercard--edge-placement`.
+- `hovercard-list` renders `HoverCardList`: one 28px line per entry, 16px indent per depth, truncated titles, named state icons, capped at 24rem with its own scroll. Journey: `journeys/hovercard-list.mjs` on `designsystem-hovercard--task-list`.
- `popover-parts` composes `@codeui/kit/popover/parts` parts with title, description, arrow and close button.
## How to get to it (user POV)
diff --git a/.claude/skills/verify-codeui/journeys/avatar-sizes.mjs b/.claude/skills/verify-codeui/journeys/avatar-sizes.mjs
new file mode 100644
index 00000000..b9027af8
--- /dev/null
+++ b/.claude/skills/verify-codeui/journeys/avatar-sizes.mjs
@@ -0,0 +1,57 @@
+// Avatar sizes follow the shared control height scale and density; unassigned is a dashed empty circle.
+export default async ({ page, check }) => {
+ await check("sizes match the control scale per density", () =>
+ page.locator("[data-cui-density]").evaluateAll(groups =>
+ (() => {
+ const expected = {
+ compact: [24, 32, 38, 46],
+ comfortable: [28, 36, 44, 52],
+ touch: [32, 40, 50, 58],
+ };
+ const actual = Object.fromEntries(
+ groups.map(g => [
+ g.getAttribute("data-cui-density"),
+ [...g.querySelectorAll("[data-cui=avatar]:not([data-unassigned])")]
+ .filter((_, i) => i % 2 === 0)
+ .map(a => a.getBoundingClientRect().height),
+ ]),
+ );
+ return {
+ pass: JSON.stringify(actual) === JSON.stringify(expected),
+ actual,
+ expected,
+ };
+ })(),
+ ),
+ );
+ await check("unassigned is a dashed empty circle in secondary text colour", () =>
+ page
+ .locator("[data-cui=avatar][data-unassigned]")
+ .first()
+ .evaluate(a => {
+ const c = getComputedStyle(a);
+ return {
+ pass:
+ c.borderTopStyle === "dashed" &&
+ a.childElementCount === 0 &&
+ c.backgroundColor === "rgba(0, 0, 0, 0)" &&
+ a.getAttribute("aria-label") === "Unassigned",
+ border: c.borderTopStyle,
+ color: c.borderTopColor,
+ };
+ }),
+ );
+ await check("the picture covers the circle and keeps the ring", () =>
+ page
+ .locator("[data-cui=avatar-image]")
+ .first()
+ .evaluate(img => ({
+ pass:
+ img.complete &&
+ img.naturalWidth > 0 &&
+ img.getBoundingClientRect().width ===
+ img.parentElement.getBoundingClientRect().width,
+ natural: img.naturalWidth,
+ })),
+ );
+};
diff --git a/.claude/skills/verify-codeui/journeys/avatar.mjs b/.claude/skills/verify-codeui/journeys/avatar.mjs
new file mode 100644
index 00000000..d741fb1d
--- /dev/null
+++ b/.claude/skills/verify-codeui/journeys/avatar.mjs
@@ -0,0 +1,81 @@
+// Avatar: initials reach 4.5:1 on their hue in both themes, the ring is a neutral
+// 16-35% line, sizes follow the control scale, hover shows the name in the kit Tooltip.
+export default async ({ page, step, check, axe }) => {
+ const contrast = () =>
+ page.locator("[data-cui=avatar]").evaluateAll(avatars => {
+ const canvas = document.createElement("canvas");
+ canvas.width = canvas.height = 1;
+ const ctx = canvas.getContext("2d", { willReadFrequently: true });
+ const rgb = color => {
+ ctx.clearRect(0, 0, 1, 1);
+ ctx.fillStyle = color;
+ ctx.fillRect(0, 0, 1, 1);
+ return [...ctx.getImageData(0, 0, 1, 1).data].slice(0, 3);
+ };
+ const lum = ([r, g, b]) =>
+ [r, g, b]
+ .map(v => v / 255)
+ .map(v => (v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4))
+ .reduce((sum, v, i) => sum + v * [0.2126, 0.7152, 0.0722][i], 0);
+ const ratio = (a, b) => {
+ const [hi, lo] = [lum(a), lum(b)].sort((x, y) => y - x);
+ return (hi + 0.05) / (lo + 0.05);
+ };
+ return avatars
+ .filter(
+ a =>
+ a.querySelector("[data-cui=avatar-fallback]") &&
+ !a.hasAttribute("data-unassigned"),
+ )
+ .map(a => {
+ const c = getComputedStyle(a);
+ return {
+ name: a.getAttribute("aria-label"),
+ ratio: Math.round(ratio(rgb(c.backgroundColor), rgb(c.color)) * 100) / 100,
+ ring: getComputedStyle(a, "::after").boxShadow,
+ radius: c.borderRadius,
+ };
+ });
+ });
+ const rows = await contrast();
+ await check("initials reach 4.5:1 on every hue", () => ({
+ pass: rows.length > 0 && rows.every(r => r.ratio >= 4.5),
+ min: Math.min(...rows.map(r => r.ratio)),
+ rows,
+ }));
+ await check("hues differ by id, and the same name with different ids differs", () =>
+ page.locator("[data-cui=avatar]").evaluateAll(avatars => {
+ const fills = avatars.map(a => getComputedStyle(a).backgroundColor);
+ const sam = avatars
+ .filter(a => a.getAttribute("aria-label") === "Sam Lee")
+ .map(a => getComputedStyle(a).backgroundColor);
+ return {
+ pass: new Set(fills.slice(0, 8)).size === 8 && new Set(sam).size === 3,
+ sam,
+ };
+ }),
+ );
+ await check("full radius and a neutral ring at 20% alpha", () => {
+ const ring = rows[0].ring;
+ const alpha = Number(/(?:\/\s*|,\s*)([\d.]+)\)/.exec(ring)?.[1]);
+ return {
+ pass:
+ rows.every(r => r.radius === "9999px" || parseFloat(r.radius) >= 9999) &&
+ /inset/.test(ring) &&
+ alpha >= 0.16 &&
+ alpha <= 0.35,
+ ring,
+ alpha,
+ radius: rows[0].radius,
+ };
+ });
+ await step("Hover Ada Lovelace", async () => {
+ await page.getByRole("img", { name: "Ada Lovelace" }).hover();
+ await page.locator("[data-cui=tooltip-content]").waitFor({ timeout: 2000 });
+ });
+ await check("the tooltip shows the name", async () => {
+ const text = await page.locator("[data-cui=tooltip-content]").innerText();
+ return { pass: text.trim() === "Ada Lovelace", text };
+ });
+ await axe("tooltip");
+};
diff --git a/.claude/skills/verify-codeui/journeys/hovercard-edge.mjs b/.claude/skills/verify-codeui/journeys/hovercard-edge.mjs
new file mode 100644
index 00000000..d3544c38
--- /dev/null
+++ b/.claude/skills/verify-codeui/journeys/hovercard-edge.mjs
@@ -0,0 +1,14 @@
+// With no room on the right, the card flips to the left of the trigger.
+export default async ({ page, step, check }) => {
+ const content = page.locator("[data-cui=hovercard-content]");
+ const trigger = page.locator("[data-cui=hovercard-trigger]");
+ await step("Tab to the trigger", async () => {
+ await page.keyboard.press("Tab");
+ await content.waitFor({ timeout: 2000 });
+ });
+ await check("the card sits on the left of the trigger", async () => {
+ const t = await trigger.boundingBox();
+ const c = await content.boundingBox();
+ return { pass: c.x + c.width <= t.x, cardRight: c.x + c.width, triggerLeft: t.x };
+ });
+};
diff --git a/.claude/skills/verify-codeui/journeys/hovercard-list.mjs b/.claude/skills/verify-codeui/journeys/hovercard-list.mjs
new file mode 100644
index 00000000..49020965
--- /dev/null
+++ b/.claude/skills/verify-codeui/journeys/hovercard-list.mjs
@@ -0,0 +1,74 @@
+// A list in a hover card: one line per entry, nesting by indent, truncated titles,
+// capped near 24rem with its own scroll.
+export default async ({ page, step, check, axe }) => {
+ const content = page.locator("[data-cui=hovercard-content]");
+ await step("Tab to the trigger", async () => {
+ await page.keyboard.press("Tab");
+ await content.waitFor({ timeout: 2000 });
+ });
+ await check("the list caps at 24rem and scrolls on its own", () =>
+ page.locator("[data-cui=hovercard-list]").evaluate(el => ({
+ pass:
+ el.clientHeight <= 384 &&
+ el.clientHeight > 300 &&
+ el.scrollHeight > el.clientHeight &&
+ getComputedStyle(el).overflowY === "auto",
+ clientHeight: el.clientHeight,
+ scrollHeight: el.scrollHeight,
+ })),
+ );
+ await check("every entry is one line: icon, identifier, truncated title", () =>
+ page.locator("[data-cui=hovercard-item]").evaluateAll(items => {
+ const heights = [
+ ...new Set(items.map(item => Math.round(item.getBoundingClientRect().height))),
+ ];
+ const title = items[2].querySelector("[data-cui=hovercard-item-title]");
+ return {
+ pass:
+ heights.length === 1 &&
+ heights[0] <= 32 &&
+ title.scrollWidth > title.clientWidth &&
+ getComputedStyle(title).textOverflow === "ellipsis" &&
+ items.every(
+ item =>
+ item.querySelector("[data-cui=hovercard-item-icon]") &&
+ item.querySelector("[data-cui=hovercard-item-id]"),
+ ),
+ heights,
+ truncated: title.scrollWidth > title.clientWidth,
+ };
+ }),
+ );
+ await check("nesting is shown by indent, 16px per level", () =>
+ page.locator("[data-cui=hovercard-item]").evaluateAll(items => {
+ const left = i =>
+ items[i].querySelector("[data-cui=hovercard-item-icon]").getBoundingClientRect()
+ .left;
+ return {
+ pass: left(1) - left(0) === 16 && left(3) - left(0) === 32,
+ d1: left(1) - left(0),
+ d2: left(3) - left(0),
+ };
+ }),
+ );
+ await check("state icons are named", async () => {
+ const names = await page.getByRole("img", { name: "Running" }).count();
+ return { pass: names > 0, running: names };
+ });
+ await step("Scroll the list to the end", async () => {
+ await page
+ .locator("[data-cui=hovercard-list]")
+ .evaluate(el => el.scrollTo(0, el.scrollHeight));
+ });
+ await check(
+ "the card stays open and the same size while the list scrolls",
+ async () => {
+ const box = await content.boundingBox();
+ return {
+ pass: (await content.count()) === 1 && box.height < 480,
+ height: box.height,
+ };
+ },
+ );
+ await axe("open");
+};
diff --git a/.claude/skills/verify-codeui/journeys/hovercard-open.mjs b/.claude/skills/verify-codeui/journeys/hovercard-open.mjs
new file mode 100644
index 00000000..7e3c3447
--- /dev/null
+++ b/.claude/skills/verify-codeui/journeys/hovercard-open.mjs
@@ -0,0 +1,59 @@
+// HoverCard: keyboard focus opens it in place (data-motion=none) and Escape closes it with
+// focus kept on the trigger; a resting pointer opens it, and moving away closes it.
+export default async ({ page, step, check, focus, axe, theme }) => {
+ const content = page.locator("[data-cui=hovercard-content]");
+ const trigger = page.locator("[data-cui=hovercard-trigger]");
+ const surface = () =>
+ content.evaluate(el => {
+ const c = getComputedStyle(el);
+ return {
+ motion: el.getAttribute("data-motion"),
+ bg: c.backgroundColor,
+ radius: c.borderRadius,
+ maxWidth: c.maxWidth,
+ origin: c.getPropertyValue("--cui-popper-content-transform-origin").trim(),
+ };
+ });
+ await step("Tab to the trigger", async () => {
+ await page.keyboard.press("Tab");
+ await content.waitFor({ timeout: 2000 });
+ });
+ const kbd = await surface();
+ await check("focus opens the card without motion, focus stays on the trigger", async () => ({
+ pass: kbd.motion === "none" && (await focus()).dataCui === "hovercard-trigger",
+ ...kbd,
+ }));
+ await check("Popover surface: dialog fill, radius 16, max width 320, origin at the trigger side", () => ({
+ pass:
+ kbd.bg === (theme === "dark" ? "rgb(37, 37, 37)" : "rgb(255, 255, 255)") &&
+ kbd.radius === "16px" &&
+ kbd.maxWidth === "320px" &&
+ kbd.origin === "left top",
+ ...kbd,
+ }));
+ await axe("open");
+ await step("Press Escape", async () => {
+ await page.keyboard.press("Escape");
+ await content.waitFor({ state: "detached", timeout: 2000 });
+ });
+ await check("Escape closes the card and focus stays on the trigger", async () => ({
+ pass: (await content.count()) === 0 && (await focus()).dataCui === "hovercard-trigger",
+ }));
+ await step("Blur, then rest the pointer on the trigger", async () => {
+ await page.evaluate(() => document.activeElement.blur());
+ const box = await trigger.boundingBox();
+ await page.mouse.move(box.x + 4, box.y + box.height / 2);
+ await page.mouse.move(box.x + 8, box.y + box.height / 2);
+ await content.waitFor({ timeout: 2000 });
+ });
+ await check("hover opens the card with motion allowed", async () => {
+ const s = await surface();
+ return { pass: s.motion === null, ...s };
+ });
+ await step("Move the pointer far away", async () => {
+ await page.mouse.move(5, 800);
+ await page.mouse.move(10, 850);
+ await content.waitFor({ state: "detached", timeout: 2000 });
+ });
+ await check("leaving closes the card", async () => ({ pass: (await content.count()) === 0 }));
+};
diff --git a/.claude/skills/verify-codeui/journeys/hovercard-touch.mjs b/.claude/skills/verify-codeui/journeys/hovercard-touch.mjs
new file mode 100644
index 00000000..b3d0bb56
--- /dev/null
+++ b/.claude/skills/verify-codeui/journeys/hovercard-touch.mjs
@@ -0,0 +1,60 @@
+// HoverCard opens on a touch tap without following the link, sits on the right of its
+// trigger by default, keeps the Pop surface, and a second tap closes nothing.
+export default async ({ page, step, check, axe, theme }) => {
+ const content = page.locator("[data-cui=hovercard-content]");
+ const trigger = page.locator("[data-cui=hovercard-trigger]");
+ const startUrl = page.url();
+ await step("Tap the trigger with a touch pointer", async () => {
+ await trigger.dispatchEvent("pointerdown", { pointerType: "touch", bubbles: true });
+ await trigger.dispatchEvent("pointerup", { pointerType: "touch", bubbles: true });
+ await trigger.dispatchEvent("click", { bubbles: true, cancelable: true });
+ await content.waitFor({ timeout: 2000 });
+ });
+ await check("tap opens the card and does not follow the link", async () => ({
+ pass: (await content.count()) === 1 && page.url() === startUrl,
+ url: page.url(),
+ }));
+ const geometry = async () => {
+ const t = await trigger.boundingBox();
+ const c = await content.boundingBox();
+ return { triggerRight: t.x + t.width, cardLeft: c.x, cardWidth: c.width };
+ };
+ await check("the card sits on the right of the trigger", async () => {
+ const g = await geometry();
+ return { pass: g.cardLeft >= g.triggerRight, ...g };
+ });
+ await check("floating surface: dialog fill, shadow, radius 16, max width 20rem", () =>
+ content.evaluate((el, theme) => {
+ const c = getComputedStyle(el);
+ return {
+ pass:
+ c.backgroundColor ===
+ (theme === "dark" ? "rgb(37, 37, 37)" : "rgb(255, 255, 255)") &&
+ c.borderRadius === "16px" &&
+ c.maxWidth === "320px" &&
+ c.boxShadow !== "none" &&
+ (theme === "light" || c.boxShadow.includes("inset")),
+ bg: c.backgroundColor,
+ radius: c.borderRadius,
+ maxWidth: c.maxWidth,
+ shadow: c.boxShadow,
+ };
+ }, theme),
+ );
+ await axe("open");
+ await step("Tap outside", async () => {
+ await page.mouse.click(1200, 850);
+ await content.waitFor({ state: "detached", timeout: 2000 });
+ });
+ await check("an outside press closes the card", async () => ({
+ pass: (await content.count()) === 0,
+ }));
+ await step("Click the trigger with a mouse", async () => {
+ const box = await trigger.boundingBox();
+ await page.mouse.click(box.x + 8, box.y + box.height / 2);
+ await page.waitForTimeout(100);
+ });
+ await check("a click opens the card at once, without the 500ms delay", async () => ({
+ pass: (await content.count()) === 1,
+ }));
+};
diff --git a/.claude/skills/verify-codeui/journeys/resizable-keyboard.mjs b/.claude/skills/verify-codeui/journeys/resizable-keyboard.mjs
new file mode 100644
index 00000000..19f83272
--- /dev/null
+++ b/.claude/skills/verify-codeui/journeys/resizable-keyboard.mjs
@@ -0,0 +1,45 @@
+// Resizable sidebar: arrow keys move the handle, End stops at maxSize (360px), Home at
+// minSize (200px); the focused handle shows the focus colour.
+export default async ({ page, step, check, focus, axe }) => {
+ const sidebar = page.locator("[data-testid=sidebar]");
+ const handle = page.getByRole("separator", { name: "Resize sidebar" });
+ const width = () => sidebar.evaluate(el => Math.round(el.getBoundingClientRect().width));
+ const line = () =>
+ handle.evaluate(el => {
+ const c = getComputedStyle(el, "::before");
+ return { color: c.backgroundColor, width: c.width, focusColor: getComputedStyle(document.documentElement).getPropertyValue("--cui-focus-color").trim() };
+ });
+ await check("sidebar starts at 240px", async () => {
+ const w = await width();
+ return { pass: w === 240, width: w };
+ });
+ await step("Tab to the handle", async () => {
+ await page.keyboard.press("Tab");
+ });
+ await check("handle has focus and shows a 2px focus-colour line", async () => {
+ const f = await focus();
+ const l = await line();
+ return { pass: f.role === "separator" && l.width === "2px", focus: f, ...l };
+ });
+ await axe("focused");
+ await step("ArrowRight", async () => page.keyboard.press("ArrowRight"));
+ await check("ArrowRight widens the sidebar", async () => {
+ const w = await width();
+ return { pass: w > 240 && w <= 360, width: w };
+ });
+ await step("End", async () => page.keyboard.press("End"));
+ await check("End stops at maxSize 360px", async () => {
+ const w = await width();
+ return { pass: w === 360, width: w };
+ });
+ await step("ArrowRight past the max", async () => page.keyboard.press("ArrowRight"));
+ await check("the sidebar stays at 360px", async () => {
+ const w = await width();
+ return { pass: w === 360, width: w };
+ });
+ await step("Home", async () => page.keyboard.press("Home"));
+ await check("Home stops at minSize 200px", async () => {
+ const w = await width();
+ return { pass: w === 200, width: w };
+ });
+};
diff --git a/.claude/skills/verify-codeui/journeys/tooltip-empty.mjs b/.claude/skills/verify-codeui/journeys/tooltip-empty.mjs
index f4d3826d..fecafb6f 100644
--- a/.claude/skills/verify-codeui/journeys/tooltip-empty.mjs
+++ b/.claude/skills/verify-codeui/journeys/tooltip-empty.mjs
@@ -8,7 +8,7 @@ export default async ({ page, step, check, focus, axe }) => {
for (const name of empties) {
await step(`hover ${name}`, async () => {
await page.getByRole("button", { name }).hover();
- await page.waitForTimeout(600);
+ await page.waitForTimeout(1000);
});
await check(`hover ${name}: no bubble`, async () => ({
pass: (await bubbles()) === 0,
@@ -20,7 +20,7 @@ export default async ({ page, step, check, focus, axe }) => {
for (const [i, name] of empties.entries()) {
await step(`Tab to ${name}`, async () => {
await page.keyboard.press("Tab");
- await page.waitForTimeout(600);
+ await page.waitForTimeout(1000);
});
await check(`focus ${name}: no bubble, no aria-describedby`, async () => {
const f = await focus();
diff --git a/.github/workflows/consumer.yml b/.github/workflows/consumer.yml
index df6b42c3..3e9110c4 100644
--- a/.github/workflows/consumer.yml
+++ b/.github/workflows/consumer.yml
@@ -1,6 +1,18 @@
name: Packed kit consumer
on:
workflow_dispatch:
+ pull_request:
+ paths:
+ - ".github/workflows/consumer.yml"
+ - "examples/check-hydration.mjs"
+ - "examples/consumer-*/**"
+ - "examples/run-consumer-check.mjs"
+ - "packages/inkstone/**"
+ - "packages/kit/**"
+ - "packages/styles/**"
+ - "package.json"
+ - "pnpm-lock.yaml"
+ - "pnpm-workspace.yaml"
jobs:
consumer:
runs-on: ubuntu-latest
@@ -14,4 +26,5 @@ jobs:
node-version: 24.x
cache: pnpm
- run: pnpm install --frozen-lockfile
+ - run: pnpm exec playwright install-deps chromium
- run: node examples/run-consumer-check.mjs
diff --git a/.github/workflows/package-preview.yml b/.github/workflows/package-preview.yml
new file mode 100644
index 00000000..9fee9d0d
--- /dev/null
+++ b/.github/workflows/package-preview.yml
@@ -0,0 +1,108 @@
+name: Package preview
+
+on:
+ pull_request:
+
+permissions:
+ contents: read
+ pull-requests: write
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
+ cancel-in-progress: true
+
+jobs:
+ preview:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ persist-credentials: false
+
+ - uses: pnpm/action-setup@v4
+ with:
+ version: 10.34.9
+
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24.x
+ cache: pnpm
+
+ - run: pnpm install --frozen-lockfile
+ - run: pnpm build:kit
+
+ - name: Pack the preview packages
+ run: pnpm --filter '@codeui/kit...' pack --recursive --pack-destination "$RUNNER_TEMP/codeui-preview"
+
+ - name: Upload installable packages
+ id: artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: codeui-preview
+ path: ${{ runner.temp }}/codeui-preview/*.tgz
+ if-no-files-found: error
+ retention-days: 14
+
+ - name: Publish package preview URLs
+ id: publish
+ # The GitHub artifact can still be installed if pkg.pr.new is unavailable.
+ continue-on-error: true
+ run: >-
+ pnpm exec pkg-pr-new publish --pnpm --no-compact --no-template
+ --previewVersion --comment=off --json "$RUNNER_TEMP/codeui-preview.json"
+ ./packages/inkstone ./packages/styles ./packages/kit
+
+ - name: Comment the preview links
+ if: steps.publish.outcome == 'success' && github.event.pull_request.head.repo.full_name == github.repository
+ uses: actions/github-script@v7
+ with:
+ script: |
+ const { readFileSync } = require('node:fs');
+ const { join } = require('node:path');
+ const { packages } = JSON.parse(readFileSync(join(process.env.RUNNER_TEMP, 'codeui-preview.json'), 'utf8'));
+ const kit = packages.find(pkg => pkg.name === '@codeui/kit');
+ const marker = '';
+ const body = [
+ marker,
+ '### CodeUI package preview',
+ '',
+ `Built from \`${context.payload.pull_request.head.sha.slice(0, 7)}\`.`,
+ '',
+ '\`\`\`sh',
+ `npm install ${kit.url}`,
+ '\`\`\`',
+ '',
+ 'The kit installs matching previews of \`@codeui/styles\` and \`@codeui/inkstone\`.',
+ '',
+ ...packages.map(pkg => `- [${pkg.name}](${pkg.url})`),
+ ].join('\n');
+ const issue = { ...context.repo, issue_number: context.issue.number };
+ const comments = await github.paginate(github.rest.issues.listComments, issue);
+ const previous = comments.find(comment =>
+ comment.user?.login === 'github-actions[bot]' && comment.body?.startsWith(marker)
+ );
+ if (previous) {
+ await github.rest.issues.updateComment({ ...context.repo, comment_id: previous.id, body });
+ } else {
+ await github.rest.issues.createComment({ ...issue, body });
+ }
+
+ - name: Show download instructions
+ env:
+ ARTIFACT_URL: ${{ steps.artifact.outputs.artifact-url }}
+ PUBLISH_OUTCOME: ${{ steps.publish.outcome }}
+ run: |
+ {
+ echo "### CodeUI preview packages"
+ if [ "$PUBLISH_OUTCOME" != success ]; then
+ echo "pkg.pr.new could not publish preview URLs. Check the publish step for details."
+ echo
+ fi
+ echo "[Download the three package tarballs]($ARTIFACT_URL)"
+ echo
+ echo '```sh'
+ echo "gh run download $GITHUB_RUN_ID --repo $GITHUB_REPOSITORY -n codeui-preview -D .codeui-preview"
+ echo 'npm install ./.codeui-preview/*.tgz'
+ echo '```'
+ } >> "$GITHUB_STEP_SUMMARY"
diff --git a/.gitignore b/.gitignore
index 28b7af10..315ee9d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,7 +40,8 @@ storybook-static
# docs: the example apps, copied from apps/examples/dist by scripts/copy-examples.mjs
apps/docs/public/examples
-# Vitest browser failure screenshots
+# Vitest browser failure artifacts
__screenshots__
+.vitest-attachments
/packages/styles/src/generated-appearance/
diff --git a/README.md b/README.md
index 1760172a..669c271d 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,18 @@
+## Try packages from a pull request
+
+Use the `pkg.pr.new` install command in the **CodeUI package preview** comment on the pull request. It points to a specific commit. The kit preview includes matching previews of `@codeui/styles` and `@codeui/inkstone` as dependencies. The Solid 2 kit requires both `solid-js@^2` and `@solidjs/web@^2`.
+
+You can also download the `codeui-preview` artifact from the **Package preview** run on the pull request. Extract the ZIP in your consumer project and install all three tarballs together.
+
+```sh
+npm install ./.codeui-preview/*.tgz
+```
+
+The run summary includes a GitHub CLI command that downloads the tarballs to that directory. The artifact expires after 14 days. Repository maintainers can enable direct install URLs by installing the [pkg.pr.new GitHub App](https://github.com/apps/pkg-pr-new) for CodeUI.
+
## Project Commands
List of cli commands available from a project root.
diff --git a/apps/docs/content/docs/(kit)/agents.mdx b/apps/docs/content/docs/(kit)/agents.mdx
index 91af4aff..732f60f0 100644
--- a/apps/docs/content/docs/(kit)/agents.mdx
+++ b/apps/docs/content/docs/(kit)/agents.mdx
@@ -35,7 +35,7 @@ Import parts as a namespace:
import * as D from "@codeui/kit/dialog/parts";
```
-The app needs `solid-js ^1.9.8` and the vanilla-extract Vite plugin. See [Installation](/docs/installation).
+The app needs Solid 2, `@solidjs/web`, and `@solidjs/vite-plugin`. See [Installation](/docs/installation).
## Rules for generated code
diff --git a/apps/docs/content/docs/(kit)/components/avatar.mdx b/apps/docs/content/docs/(kit)/components/avatar.mdx
new file mode 100644
index 00000000..4bfa7369
--- /dev/null
+++ b/apps/docs/content/docs/(kit)/components/avatar.mdx
@@ -0,0 +1,153 @@
+---
+title: "Avatar"
+description: "A person: their picture, or their initials on a colour from their id."
+---
+
+## When to use
+
+Use `Avatar` wherever the interface shows a person: the owner of a task, the author of a comment, the members of a group. It shows the person's picture when there is one. Otherwise it shows one or two initials on a fill whose hue comes from a stable id, so the same person keeps the same colour on every screen and two people with the same name do not share one.
+
+Use one `Avatar` for every person in the app. Do not build a separate badge or initials chip per feature.
+
+## When to choose another component
+
+- Use [`Badge`](/docs/components/badge) for a status or a category. An avatar always stands for a person or an owner.
+- Use the item's own mark, such as a provider or repository logo in a rounded tile, for something that is not a person.
+
+## Live demo
+
+
+
+Hover an avatar to see the name in the kit [`Tooltip`](/docs/components/tooltip).
+
+## Anatomy
+
+
+
+| Export | Renders | `classes` key | `data-cui` | Role |
+| --- | --- | --- | --- | --- |
+| `Avatar` | `span` | `root` | `avatar` | `img`, named by `name` |
+| Initials | `span`, hidden from assistive technology | `fallback` | `avatar-fallback` | None |
+| Picture | `img` with an empty `alt`, only when `src` is set | `image` | `avatar-image` | None |
+
+The root also renders `data-size` (`xs`, `sm`, `md` or `lg`, default `xs`) and `data-unassigned` when the avatar is unassigned. The picture covers the initials while it loads, so a slow or failed picture never leaves an empty circle.
+
+## Variants
+
+### Hue from the id
+
+
+
+`identifier` takes a stable id, such as a user id. `avatarHue(identifier)` hashes it to a hue between 0 and 359, and the fill uses that hue at a fixed lightness and chroma per theme. Never pass the name: a name changes and two people can share it. Without `identifier` the fill is neutral grey.
+
+### Size
+
+
+
+`size` takes a step of the shared control scale, so an avatar lines up with the buttons and fields next to it, and it follows `data-cui-density`.
+
+| `size` | Compact | Comfortable | Touch | Initials |
+| --- | --- | --- | --- | --- |
+| `xs` (default) | 24px | 28px | 32px | 11px (`--cui-font-size-badge`) |
+| `sm` | 32px | 36px | 40px | 13px (`--cui-font-size-caption`) |
+| `md` | 38px | 44px | 50px | 14px (`--cui-font-size-sm`) |
+| `lg` | 46px | 52px | 58px | 16px (`--cui-font-size-md`) |
+
+### Initials
+
+`avatarInitials(name)` takes the first letter of the first and of the last word: "Ada King Lovelace" becomes AL, and "Linus" becomes L. It counts code points, so accented and non-Latin letters stay whole. Pass `initials` when your data has better ones.
+
+## States
+
+
+
+### Picture
+
+Set `src`. The picture fills the circle with `object-fit: cover`, under the same ring as the initials.
+
+### Picture failed
+
+When the picture fails to load, `Avatar` removes it and the initials show.
+
+### Unassigned
+
+`unassigned` draws an empty circle with a dashed edge in secondary text colour. It has no fill and no initials. Its accessible name and tooltip are "Unassigned" unless you pass `name`.
+
+## Ready API
+
+### `Avatar`
+
+
+
+Every other prop goes to the root `span`. `Avatar` wraps no Kobalte primitive. With `tooltip`, the root sits inside the kit `Tooltip` trigger.
+
+### `avatarHue`
+
+`avatarHue(identifier: string): number` returns the hue `Avatar` uses for an id, an FNV-1a hash folded to 0–359. Use it to colour something else that belongs to the same person.
+
+### `avatarInitials`
+
+`avatarInitials(name: string): string` returns the one or two initials `Avatar` shows for a name, in upper case.
+
+## Styled parts API
+
+Import the parts from `@codeui/kit/avatar/parts`. The entry also exports `avatarParts`, `avatarHue`, `avatarInitials` and the types `AvatarPart`, `AvatarClasses`, `AvatarSize` and `AvatarVariants`.
+
+### `Root`
+
+The circle. It takes `size`, `unassigned`, `hue` and every `span` attribute. Give it `role="img"` and the name as `aria-label`.
+
+
+
+### `Image`
+
+The picture. It renders while `src` is set and removes itself on error. Its `alt` defaults to empty, because the root carries the name.
+
+### `Fallback`
+
+The initials. It sets `aria-hidden="true"`.
+
+## Styles export
+
+### `avatarStyles`
+
+`avatarStyles.root()`, `avatarStyles.image()` and `avatarStyles.fallback()` return `cui-avatar`, `cui-avatar-image` and `cui-avatar-fallback`. On custom markup, set `data-size` and `--cui-avatar-hue`.
+
+## Accessibility
+
+The root has `role="img"` and the name as its accessible name, so a screen reader reads "Ada Lovelace, image". The initials are hidden, so they are not read letter by letter, and the picture has an empty `alt`.
+
+The name also shows in the kit Tooltip on hover. The avatar is not focusable, so put it next to text or inside a control that names the person for keyboard users, such as a row title or a button label.
+
+The initials reach 4.5:1 against their fill on every hue in both themes: at least 5.5:1 in dark and 10:1 in light. The fill itself can sit close to the surface, which is why the circle has the neutral ring.
+
+## SSR notes
+
+`Avatar` renders completely on the server, with the picture and the initials. The hue is computed from the id, so the server and the client agree. The tooltip content renders on the client when it opens.
+
+## Theming hooks
+
+| Variable | Default | Used for |
+| --- | --- | --- |
+| `--cui-avatar-hue` | Set from `identifier` | Fill hue |
+| `--cui-avatar-lightness` | `light-dark(0.86, 0.48)` | Fill lightness in OKLCH |
+| `--cui-avatar-chroma` | `light-dark(0.06, 0.07)`; `0` without an id | Fill chroma in OKLCH |
+| `--cui-avatar-color` | `--cui-text-default` | Initials |
+| `--cui-avatar-ring` | `--cui-text-default` at 20% | The 1px inner ring |
+| `--cui-avatar-unassigned-color` | `--cui-text-muted` | Dashed edge of an unassigned avatar |
+| `--cui-avatar-size`, `--cui-avatar-font-size` | From `data-size` | Diameter and initials size |
+| `--cui-radius-full` | | Full radius |
+
+## Composition examples
+
+### In a row
+
+
+
+In a list row the avatar sits in the leading slot and tells the rows apart by owner. An item with no owner shows the unassigned circle, so every row keeps the same shape.
+
+## Related
+
+- [`Tooltip`](/docs/components/tooltip) shows the name on hover.
+- [`HoverCard`](/docs/components/hover-card) holds more about the person than a name.
+- [Patterns](/docs/design/patterns) explains where avatars go.
diff --git a/apps/docs/content/docs/(kit)/components/hover-card.mdx b/apps/docs/content/docs/(kit)/components/hover-card.mdx
new file mode 100644
index 00000000..cc4040f0
--- /dev/null
+++ b/apps/docs/content/docs/(kit)/components/hover-card.mdx
@@ -0,0 +1,200 @@
+---
+title: HoverCard
+description: A card of extra detail beside a link, opened by hover, focus or click.
+---
+
+## When to use
+
+Use a hover card to preview what sits behind a link: a file, a person, a thread. Use it for a description or for more than one fact. A single name belongs in a [Tooltip](/docs/components/tooltip), and the `title` attribute is never the answer.
+It opens when the pointer rests on the trigger, when the trigger gets keyboard focus, and on click, so it works on touch screens. It closes when the pointer leaves both, on blur, on Escape and on a press outside.
+
+A hover card is supplementary. Never put the only path to an action or to information inside it. The card never takes focus, so a keyboard user cannot reach a button inside it. Keep the same details reachable from the page the link opens.
+
+## When to choose another component
+
+- [Tooltip](/docs/components/tooltip) names a control in a few words. A hover card holds a few lines of rich content.
+- [Popover](/docs/components/popover) opens on click, takes focus, and can hold buttons and fields. Use it when the user has to act on the content.
+
+## Live demo
+
+
+
+Put `HoverCardTrigger` and `HoverCardContent` in `HoverCard`. Hover the link, or move focus to it with Tab.
+
+## Anatomy
+
+
+
+| Export | Renders | `classes` key | `data-cui` | Role |
+| --- | --- | --- | --- | --- |
+| `HoverCardGroup` | Nothing. Gives the cards inside it a surface of their own, optional | none | none | none |
+| `HoverCard` | Nothing. Holds the open state and the timers | none | none | none |
+| `HoverCardTrigger` | `a`, or the element passed to `as` | none | `hovercard-trigger` | Link |
+| `HoverCardContent` | The shared card, a `div` in a portal on `mount` or `document.body` | `content` | `hovercard-content` | none |
+| `HoverCardList` | `ul`, optional | none | `hovercard-list` | List |
+| `HoverCardItem` | `li`, with an icon slot, an identifier and a title | `item`, `itemIcon`, `itemId`, `itemTitle` | `hovercard-item`, `hovercard-item-icon`, `hovercard-item-id`, `hovercard-item-title` | List item |
+
+## Variants
+
+### Placement
+
+
+
+`placement` sets the side and the alignment. The default is `right-start`: the card sits beside its trigger, top edges aligned, so it does not cover the lines below. When there is no room on the right, Kobalte flips it to the left. The card wraps its text at 20rem (320px).
+`gutter` sets the distance from the trigger. The kit sets it to 6px.
+
+### Delays
+
+
+
+The card opens 500ms after the pointer enters or the trigger gets focus, and closes 150ms after the pointer leaves the trigger and the card. Change this with `openDelay` and `closeDelay`.
+On its way from the trigger to the card, the pointer may cross the gap between them without closing the card. `ignoreSafeArea` turns that off.
+
+Once one card is open, the next one opens at once. See [Moving between cards](#moving-between-cards).
+
+### Moving between cards
+
+
+
+All the hover cards of a page share one card. When the pointer or keyboard focus moves to another trigger while a card is open, that card moves to the new trigger instead of closing while a second one opens: it slides to its new place, grows or shrinks to the new content, and the new content fades in. Each `HoverCard` keeps its own props, so the card takes the `placement`, `gutter`, class and handlers of the trigger it moves to.
+
+- The move happens at once, without `openDelay`.
+- For 400ms after a card closes, the next one still opens at once and without the pop.
+- On its way to the open card, the pointer may cross another trigger. The card only moves when the pointer rests on that trigger for 150ms, so you can still reach the card you opened.
+- When focus moves from the keyboard, the card swaps its content in place, with no motion.
+- With reduced motion, the card stays in place and only the new content fades in.
+
+Because the card is shared, only one hover card of the page is open at a time. A card that must stay open next to another needs its own surface: put it in a `HoverCardGroup` or pass `shared={false}`.
+
+### Nested cards
+
+A hover card inside the content of another one gets a surface of its own, without a group. Both cards stay open: the outer card waits while the pointer is on the inner card and until the inner card closes. A press on the inner card does not close the outer one. Escape closes the inner card first.
+
+### Groups
+
+
+
+`HoverCardGroup` gives the cards inside it a card of their own. Moving between triggers of the same group moves the group's card. The cards of a group never take over the page card or another group's card, so a card from each can be open at the same time. A card uses the nearest group above it; outside any group it uses the page card.
+
+`skipDelayDuration` sets how long after a card of the group closes the next one still opens at once. The page card uses 400ms.
+
+`shared={false}` gives one `HoverCard` a surface of its own, like a group with a single card. A card with `forceMount` always has its own.
+
+### List of entries
+
+
+
+Use `HoverCardList` and `HoverCardItem` to list tasks, files or members. Each entry is one line: a state icon, a short identifier, then the title, truncated. Show nesting with `depth`, which indents the entry 16px per level, not with tree lines. Drop a prefix every entry shares. A finished entry shows no icon, and the icon slot stays so the identifiers line up.
+
+The list caps at 24rem (`--cui-hovercard-list-max-height`) and scrolls on its own, so the card keeps its size. The list takes focus with Tab once the card is open, so a keyboard user can scroll it.
+
+Give each state icon a name with `iconLabel`, such as "Running", and make each state differ in shape, not only colour.
+
+## States
+
+### Opened by click or tap
+
+A click opens the card at once, without `openDelay`. On a touch screen, the first tap on a closed card opens it and does not follow the link; the next tap follows it. A press outside closes the card.
+
+### Controlled
+
+Without `open`, the card manages its own state. To control it, pass `open` and `onOpenChange`. When another card takes over the shared surface, the card calls `onOpenChange(false)`.
+
+## Ready API
+
+Import from `@codeui/kit/hover-card` or from `@codeui/kit`.
+
+### `HoverCardGroup`
+
+Optional. Gives the cards inside it a surface of their own.
+
+
+
+### `HoverCard`
+
+Holds the open state, the hover and focus timers, and the position.
+
+
+
+Inherited from Kobalte's [popover](https://kobalte.dev/docs/core/components/popover) root:
+
+
+
+### `HoverCardTrigger`
+
+Renders an `a`. Give it an `href`, or render another focusable element with `as`, so keyboard users can reach it. An `a` without `href` cannot take focus.
+
+A trigger that renders an `a`, alone or through `as={Link}`, has a dotted underline in the hint tone, so it reads as something to hover inside running text. The underline takes the text colour on hover and while the card is open. A trigger rendered as a button or a row keeps its own look.
+
+### `HoverCardContent`
+
+Renders its children into the shared card, which is portaled to `document.body` and placed next to the trigger. While this card is the one shown, its props go on the card: `class`, `classes`, `style`, `ref`, `mount`, the dismiss handlers, and any other attribute or event handler, such as `id`, `aria-hidden` or `onPointerEnter`. When another card takes the card over, they come off and that card's props go on. Attributes take string, number or boolean values.
+
+
+
+
+
+### `HoverCardList`
+
+A `ul` that caps at 24rem and scrolls. Give it an `aria-label`. Every other prop goes to the `ul`.
+
+### `HoverCardItem`
+
+One line in a `HoverCardList`.
+
+
+
+### `hoverCardStyles`
+
+`hoverCardStyles.content()` returns the card class, `cui-hovercard-content`. `hoverCardStyles.list()`, `item()`, `itemIcon()`, `itemId()` and `itemTitle()` return the list classes. `hoverCardParts` maps each part to its `data-cui` value.
+
+## Accessibility
+
+### Keyboard
+
+| Key | Action |
+| --- | --- |
+| Tab | Moving focus to the trigger opens the card after `openDelay`. Moving focus away closes it. Moving focus to another trigger while the card is open moves the card there at once. |
+| Enter | Follows the link. A trigger rendered as a button opens the card. |
+| Escape | Closes the card. Focus stays on the trigger. |
+
+### ARIA
+
+- A `HoverCardList` is a list with its `aria-label`; a named state icon is an image with its state name.
+- The card has no role and is not linked to the trigger. Screen readers announce the link only, which is why the card must not hold anything the user needs.
+- Escape closes the innermost layer only, so a hover card inside a dialog closes before the dialog.
+
+### Focus
+
+The card never takes focus. Focus stays on the trigger while it is open.
+
+## SSR notes
+
+The trigger renders on the server. The card renders on the client, and only while it is open. The page card is created the first time a card opens, in a `div` it appends to `document.body`.
+
+## Theming hooks
+
+`HoverCardContent` reads these variables. Set the `--cui-hovercard-content-*` ones on the card to change a single card. See [Tokens](/docs/foundations/tokens) for the defaults.
+
+| Variable | Default | Used for |
+| --- | --- | --- |
+| `--cui-hovercard-trigger-decoration-color` | `--cui-text-hint` | Dotted underline of an `a` trigger, before hover |
+| `--cui-hovercard-content-background` | `--cui-surface-dialog` | Fill |
+| `--cui-hovercard-content-box-shadow` | `--cui-shadow-dialog` | Shadow, and the 1px ring in dark mode |
+| `--cui-hovercard-content-radius` | `--cui-radius-card` | Radius (16px) |
+| `--cui-hovercard-content-padding` | `--cui-space-4` | Padding |
+| `--cui-hovercard-content-max-width` | `min(320px, 100vw - 32px)` | Width limit |
+| `--cui-hovercard-content-font-size`, `--cui-hovercard-content-line-height` | `--cui-font-size-sm`, `--cui-font-line-height-snug` | Text (14px / 1.3) |
+| `--cui-hovercard-content-color` | `--cui-text-dialog` | Text colour |
+| `--cui-hovercard-list-max-height` | `24rem` | Height of a list before it scrolls |
+| `--cui-hovercard-item-indent` | `16px` | Indent per `depth` level |
+| `--cui-hovercard-item-depth` | Set from `depth` | Nesting level of one entry |
+| `--cui-motion-duration-normal`, `--cui-motion-duration-fast`, `--cui-motion-ease-out` | | Pop: in from `scale(0.96)` over 160ms, out to `scale(0.98)` over 120ms |
+| `--cui-motion-duration-panel`, `--cui-motion-ease-out` | | Moving between cards: slide, resize and content fade over 200ms, ease-out |
+
+A card opened by hover or click pops from the trigger side, with `transform-origin` from `--cui-popper-content-transform-origin`. A card opened by keyboard focus, or within 400ms of another card closing, appears with no animation (`data-motion="none"`). With reduced motion, the card only fades, and moving between cards only fades the new content in. Moving between cards from the keyboard has no motion.
+
+## Related
+
+- [Tooltip](/docs/components/tooltip) names a control in a few words.
+- [Popover](/docs/components/popover) holds interactive content and takes focus.
diff --git a/apps/docs/content/docs/(kit)/components/index.mdx b/apps/docs/content/docs/(kit)/components/index.mdx
index e219dffc..7acbd906 100644
--- a/apps/docs/content/docs/(kit)/components/index.mdx
+++ b/apps/docs/content/docs/(kit)/components/index.mdx
@@ -3,7 +3,7 @@ title: Overview
description: Every kit component, grouped by the job it does.
---
-The kit has 36 components, grouped by purpose. Each link includes live examples and the public API.
+The kit has 39 components, grouped by purpose. Each link includes live examples and the public API.
## Actions
@@ -13,7 +13,9 @@ The kit has 36 components, grouped by purpose. Each link includes live examples
## Layout and text
+- [Avatar](/docs/components/avatar): A person: their picture, or their initials on a colour from their id.
- [Kbd](/docs/components/kbd): A keycap that shows a key or a keyboard shortcut.
+- [Resizable](/docs/components/resizable): Panels in a row or a column, split by handles the user drags to resize them.
- [Stack](/docs/components/stack): A flex container that spaces its children with token gaps.
- [Table](/docs/components/table): A native table with Inkstone styles.
- [Text](/docs/components/text): Text set in the kit type scale, with tones and polymorphic headings.
@@ -54,6 +56,7 @@ The kit has 36 components, grouped by purpose. Each link includes live examples
- [CommandMenu](/docs/components/command-menu): A searchable palette of commands opened from the keyboard.
- [Dialog](/docs/components/dialog): A modal window over the page, for a decision that blocks the user.
- [DropdownMenu](/docs/components/dropdown-menu): A menu of actions opened from a trigger.
+- [HoverCard](/docs/components/hover-card): A card of extra detail beside a link, opened by hover, focus or click.
- [Popover](/docs/components/popover): A floating panel anchored to a trigger, for content the user opens on demand.
- [Sheet](/docs/components/sheet): A panel that slides in from an edge of the screen.
- [Tooltip](/docs/components/tooltip): A short label that appears on hover or focus.
diff --git a/apps/docs/content/docs/(kit)/components/meta.json b/apps/docs/content/docs/(kit)/components/meta.json
index dd56f337..8ba35fc8 100644
--- a/apps/docs/content/docs/(kit)/components/meta.json
+++ b/apps/docs/content/docs/(kit)/components/meta.json
@@ -7,7 +7,9 @@
"icon-button",
"link",
"---Layout and text---",
+ "avatar",
"kbd",
+ "resizable",
"settings-row",
"stack",
"table",
@@ -41,6 +43,7 @@
"command-menu",
"dialog",
"dropdown-menu",
+ "hover-card",
"popover",
"sheet",
"tooltip"
diff --git a/apps/docs/content/docs/(kit)/components/resizable.mdx b/apps/docs/content/docs/(kit)/components/resizable.mdx
new file mode 100644
index 00000000..8ea6b914
--- /dev/null
+++ b/apps/docs/content/docs/(kit)/components/resizable.mdx
@@ -0,0 +1,130 @@
+---
+title: Resizable
+description: Panels in a row or a column, split by handles the user drags to resize them.
+---
+
+## When to use
+
+Use Resizable when the user decides how much room two areas get: a sidebar next to a conversation, an editor over a console.
+The user drags a handle, or focuses it and uses the arrow keys.
+
+## When to choose another component
+
+- [Stack](/docs/components/stack) lays out fixed areas. Use it when the sizes are yours to choose, not the user's.
+- [Sheet](/docs/components/sheet) is the side panel on a phone. Resizing needs a fine pointer or a keyboard, so swap to a sheet at 768px and below.
+
+## Live demo
+
+
+
+Put `ResizablePanel`s in `Resizable`, with a `ResizableHandle` between each pair. Give the root a size: a height for a row, and both a width and a height for a column.
+
+## Anatomy
+
+
+
+| Export | Renders | `classes` key | `data-cui` | Role |
+| --- | --- | --- | --- | --- |
+| `Resizable` | `div` with `display: flex` | `root` | `resizable` | none |
+| `ResizablePanel` | `div` with `flex-basis` set to its size | `panel` | `resizable-panel` | none |
+| `ResizableHandle` | `button` | `handle` | `resizable-handle` | `separator` |
+
+Only the handle has kit styles. Style the panels yourself. Put padding on a child of the panel: on the panel it adds to the size Kobalte sets.
+
+## Variants
+
+### Vertical
+
+
+
+`orientation="vertical"` stacks the panels. The handle draws a horizontal line and the arrow keys become Up and Down.
+
+### Sidebar with a minimum and a maximum width
+
+
+
+Sizes take a fraction of the root (`0.25`) or a pixel string (`"240px"`). Here the sidebar starts at 240px and stays between 200px and 360px. The panel without `initialSize` takes the space the others leave.
+
+### Islands
+
+
+
+The handle draws a 1px line in `--cui-border-divider`. In an Inkstone layout of islands, the 8px gap already separates them, and Inkstone allows no line between islands. Set `--cui-resizable-handle-line-color: transparent` on the handle there. The line still shows on hover, while dragging, and on keyboard focus.
+
+## States
+
+### Collapsible
+
+
+
+`collapsible` lets a panel collapse to `collapsedSize` (0 by default) when the user drags past its `minSize`, or presses Enter on the handle. `onCollapse` and `onExpand` report the change.
+
+### Controlled
+
+Without `sizes`, the root manages the sizes. To control them, pass `sizes` as fractions that add up to 1, with `onSizesChange`. Save them to restore the layout on the next visit.
+
+## Ready API
+
+Import from `@codeui/kit/resizable` or from `@codeui/kit`. Everything not listed here passes through to Kobalte's [resizable](https://kobalte.dev/docs/core/components/resizable).
+
+### `Resizable`
+
+
+
+### `ResizablePanel`
+
+
+
+### `ResizableHandle`
+
+Give every handle an `aria-label` that names what it resizes.
+
+
+
+### `resizableStyles`
+
+`resizableStyles.handle()` returns the handle class, `cui-resizable-handle`. `root()` and `panel()` return an empty string. `resizableParts` maps each part to its `data-cui` value. `ResizableSize` is a fraction or a `` `${number}px` `` string. `ResizeStrategy` (`"preceding"`, `"following"`, `"both"`) picks which neighbours give up space when a panel resizes from code.
+
+## Accessibility
+
+### Keyboard
+
+| Key | Action |
+| --- | --- |
+| Tab | Focuses the handle. |
+| ←→ | Move a horizontal handle by `keyboardDelta` (0.1 of the root by default). |
+| ↑↓ | Move a vertical handle by `keyboardDelta`. |
+| Shift + arrow | Moves the handle as far as the panels allow. |
+| HomeEnd | Move the handle to the minimum or the maximum size. |
+| Enter | Collapses or expands the nearest collapsible panel. |
+
+### ARIA
+
+- The handle has `role="separator"`, `aria-orientation`, and `aria-controls` pointing at the panel before it.
+- `aria-valuenow`, `aria-valuemin` and `aria-valuemax` are fractions from 0 to 1.
+
+### Focus
+
+Keyboard focus draws the handle line 2px wide in `--cui-focus-color`, with no transition.
+
+## SSR notes
+
+Panels with fractional sizes render at their size on the server. A pixel `initialSize` needs the measured root, so prefer fractions when the first server paint matters.
+
+## Theming hooks
+
+Set these on the handle. See [Tokens](/docs/foundations/tokens) for the defaults.
+
+| Variable | Default | Used for |
+| --- | --- | --- |
+| `--cui-resizable-handle-size` | `--cui-space-2` (8px) | Hit area. It overlaps both panels, so the panels still fill the root |
+| `--cui-resizable-handle-line-color` | `--cui-border-divider` | Line at rest |
+| `--cui-resizable-handle-line-active-color` | `--cui-surface-scroll-thumb` | Line on hover and focus (`data-active`) |
+| `--cui-resizable-handle-line-dragging-color` | `--cui-surface-scroll-thumb-hover` | Line while dragging (`data-dragging`) |
+| `--cui-resizable-handle-line-width` | `--cui-border-width` (1px) | Line width; 2px on keyboard focus |
+| `--cui-motion-duration-fast`, `--cui-motion-ease-out` | | Line colour change, 120ms |
+
+## Related
+
+- [Sheet](/docs/components/sheet) holds the same panel on a phone.
+- [Stack](/docs/components/stack) lays out areas the user does not resize.
diff --git a/apps/docs/content/docs/(kit)/components/tooltip.mdx b/apps/docs/content/docs/(kit)/components/tooltip.mdx
index 21c42897..1354fdb4 100644
--- a/apps/docs/content/docs/(kit)/components/tooltip.mdx
+++ b/apps/docs/content/docs/(kit)/components/tooltip.mdx
@@ -38,8 +38,8 @@ Wrap the element in `Tooltip` and pass the label as `content`. Hover the button,
-`variant="primary"` fills the tooltip with the brand blue. It is the default. `variant="secondary"` uses the neutral fill.
-Inkstone keeps the accent for focus, selection, and the one primary action, so prefer `secondary` in toolbars and panels.
+`variant="secondary"` uses the neutral fill. It is the default. `variant="primary"` fills the tooltip with the brand blue.
+Inkstone keeps the accent for focus, selection, and the one primary action, so keep `secondary` in toolbars and panels.
### Placement
@@ -52,9 +52,24 @@ Inkstone keeps the accent for focus, selection, and the one primary action, so p
-The tooltip opens 200ms after the pointer enters and closes at once when it leaves. Change this with `openDelay` and `closeDelay`.
+The tooltip opens 700ms after the pointer enters and closes at once when it leaves. Change this with `openDelay` and `closeDelay`.
Keyboard focus ignores `openDelay` and opens the tooltip at once.
+### Defaults for a whole app
+
+Wrap the app in `TooltipProvider` to set the defaults of every tooltip below it. A prop on one tooltip still wins.
+
+```tsx
+import { TooltipProvider } from "@codeui/kit";
+
+
+
+;
+```
+
+It takes `openDelay`, `closeDelay`, `skipDelayDuration`, `gutter`, `shift` and `variant`. With parts, import it as `Provider` from `@codeui/kit/tooltip/parts`.
+`skipDelayDuration` is how long after a tooltip closes the next one opens at once, without its delay or its animation. The kit default is 400ms.
+
### Icon button trigger
@@ -128,7 +143,7 @@ The trigger `div` and its children render on the server. The content renders on
| `--cui-shadow-md` | Shadow |
| `--cui-motion-duration-normal`, `--cui-motion-duration-fast`, `--cui-motion-ease-out` | Pop: in from `scale(0.96)` over 160ms, out to `scale(0.98)` over 120ms |
-A tooltip opened by hover pops from its trigger. One opened by keyboard focus, and the next tooltip opened within 300ms of another closing, appear with no animation (`data-motion="none"`), as Inkstone asks. The description goes on the first focusable element inside the trigger, so a screen reader reads it with the focused control.
+A tooltip opened by hover pops from its trigger. One opened by keyboard focus, and the next tooltip opened within 400ms of another closing, appear with no animation (`data-motion="none"`), as Inkstone asks. The description goes on the first focusable element inside the trigger, so a screen reader reads it with the focused control.
## Composition examples
diff --git a/apps/docs/content/docs/(kit)/contributing/add-a-component.mdx b/apps/docs/content/docs/(kit)/contributing/add-a-component.mdx
index d5e70c6c..23c374cd 100644
--- a/apps/docs/content/docs/(kit)/contributing/add-a-component.mdx
+++ b/apps/docs/content/docs/(kit)/contributing/add-a-component.mdx
@@ -17,7 +17,7 @@ Each component has three layers. Each layer builds on the one before it.
| Parts | `packages/kit/src/parts/.tsx` | `@codeui/kit/` | Apps that need a custom layout, and the ready component |
| Ready component | `packages/kit/src/components//.tsx` | `@codeui/kit` | Most apps |
-Wrap a Kobalte primitive when one exists. Check the [Kobalte components](https://kobalte.dev) for version 0.13.14 first. Build on plain elements only when Kobalte has nothing, as `Stack` and `Text` do.
+Wrap a Kobalte primitive when one exists. Check the [Kobalte 2 components](https://github.com/kobaltedev/kobalte/tree/solid2/packages/core/src) first. Build on plain elements only when Kobalte has nothing, as `Stack` and `Text` do.
## Write the styles
@@ -58,12 +58,8 @@ export const badgeStyles: BadgeStyles = {
};
export function Root(props: PolymorphicProps>) {
- const [local, others] = splitProps(props as PolymorphicProps<"span", RootProps>, [
- "class",
- "size",
- "tone",
- "variant",
- ]);
+ const local = props as PolymorphicProps<"span", RootProps>;
+ const others = omit(local, "class", "size", "tone", "variant");
return (
= B.RootProps & {
/** A short, non-interactive status label. Set `textValue` when the content is not text. */
export function Badge(props: PolymorphicProps>) {
- const [local, others] = splitProps(props as PolymorphicProps<"span", BadgeProps>, [
- "children",
- "icon",
- "classes",
- "class",
- ]);
+ const local = props as PolymorphicProps<"span", BadgeProps>;
+ const others = omit(local, "children", "icon", "classes", "class");
return (
@@ -133,7 +125,7 @@ export function Badge(props: PolymorphicProps
## Test the behavior
-Tests live in `packages/kit/test`. Client tests run in jsdom with `solid-testing-library`. A file that ends in `.ssr.test.tsx` runs in the server test config instead.
+Tests live in `packages/kit/test`. Client tests run in Chromium with Vitest and `@solidjs/testing-library`. A file that ends in `.ssr.test.tsx` runs in the server test config instead.
```tsx title="packages/kit/test/display.test.tsx"
it("names the badge with its text, not its icon", () => {
diff --git a/apps/docs/content/docs/(kit)/contributing/verify-accessibility-and-ssr.mdx b/apps/docs/content/docs/(kit)/contributing/verify-accessibility-and-ssr.mdx
index 48e63e84..5ab9e5b1 100644
--- a/apps/docs/content/docs/(kit)/contributing/verify-accessibility-and-ssr.mdx
+++ b/apps/docs/content/docs/(kit)/contributing/verify-accessibility-and-ssr.mdx
@@ -84,7 +84,7 @@ The harness runs `pnpm install`, so do not run it in a checkout that another pro
## Test the server render
```tsx title="packages/kit/test/accordion.ssr.test.tsx"
-import { renderToString } from "solid-js/web";
+import { renderToString } from "@solidjs/web";
import { Accordion } from "../src/components/Accordion/Accordion";
it("server renders labelled headers and expanded content without DOM measurement", () => {
const html = renderToString(() => (
diff --git a/apps/docs/content/docs/(kit)/installation.mdx b/apps/docs/content/docs/(kit)/installation.mdx
index 5ae25062..517cec0f 100644
--- a/apps/docs/content/docs/(kit)/installation.mdx
+++ b/apps/docs/content/docs/(kit)/installation.mdx
@@ -5,26 +5,28 @@ description: "Install static styles and the Solid components."
## Requirements
-The component package supports Solid `^1.9.8`. Its styles are plain CSS. The library builds the Inkstone theme from DTCG tokens before publishing.
+The component package requires Solid 2 and `@solidjs/web`. It uses Kobalte 2.0.0. Its styles are plain CSS. The library builds the Inkstone theme from DTCG tokens before publishing.
## Install
```sh
-pnpm add @codeui/kit solid-js@^1.9.8
-pnpm add -D vite vite-plugin-solid
+pnpm add @codeui/kit solid-js@^2 @solidjs/web@^2
+pnpm add -D vite@^8 @solidjs/vite-plugin@^3
```
## Configure Vite
```ts title="vite.config.ts"
import { defineConfig } from "vite";
-import solid from "vite-plugin-solid";
+import solid from "@solidjs/vite-plugin";
export default defineConfig({
plugins: [solid()],
});
```
+Set `jsxImportSource` to `@solidjs/web` in `tsconfig.json`. To upgrade an existing project, follow the [Solid 2 migration guide](https://docs.solidjs.com/migration/from-solid-1/).
+
## Automatic styles
Import a Solid component normally. Its module imports the compiled component stylesheet, shared styles and theme.
diff --git a/apps/docs/content/docs/(kit)/migration/from-0-1.mdx b/apps/docs/content/docs/(kit)/migration/from-0-1.mdx
index 8d0c6b35..e4a94a55 100644
--- a/apps/docs/content/docs/(kit)/migration/from-0-1.mdx
+++ b/apps/docs/content/docs/(kit)/migration/from-0-1.mdx
@@ -10,10 +10,12 @@ Work through the sections in order.
## Raise the Solid version
```sh
-pnpm add @codeui/kit solid-js@^1.9.8
+pnpm add @codeui/kit solid-js@^2 @solidjs/web@^2
```
-The kit depends on `@kobalte/core` 0.13.14 and `@kobalte/utils` 0.9.2. Kobalte 0.13.13 raised its own peer to `solid-js ^1.9.8`, so the kit's peer moved from `^1.7.0` to `^1.9.8`. An app on Solid 1.8 gets a peer dependency warning and can resolve two Solid copies.
+Upgrade the app to Solid 2 before installing the current kit. Follow the [Solid 2 migration guide](https://docs.solidjs.com/migration/from-solid-1/).
+
+For Vite, replace `vite-plugin-solid` with `@solidjs/vite-plugin` and set `jsxImportSource` to `@solidjs/web`. See the [Vite setup](/docs/installation#configure-vite).
## Load the compiled CSS
@@ -23,7 +25,7 @@ The library publishes plain CSS with its generated Inkstone theme. Remove a vani
## Check the Kobalte behavior changes
-No Kobalte release between 0.13.6 and 0.13.14 is marked breaking. These changes are visible in kit components:
+The kit now uses [Kobalte 2.0.0](https://github.com/kobaltedev/kobalte/releases/tag/@kobalte%2Fcore@2.0.0). If your app also imports Kobalte directly, upgrade that dependency to the same release. These behavior changes also apply when upgrading from a kit version built on Kobalte 0.13.
| Change | Where you see it | What to do |
| --- | --- | --- |
diff --git a/apps/docs/content/docs/(kit)/migration/from-codeimage-ui.mdx b/apps/docs/content/docs/(kit)/migration/from-codeimage-ui.mdx
index 69436e8c..93aaed5d 100644
--- a/apps/docs/content/docs/(kit)/migration/from-codeimage-ui.mdx
+++ b/apps/docs/content/docs/(kit)/migration/from-codeimage-ui.mdx
@@ -9,7 +9,7 @@ This page maps every export of `@codeimage/ui` that CodeImage still imports. Mov
## Before you start
-1. Install the kit as shown in [Installation](/docs/installation). The kit needs `solid-js ^1.9.8` and the vanilla-extract Vite plugin.
+1. Install the kit as shown in [Installation](/docs/installation). The kit requires Solid 2 and `@solidjs/web`.
2. Put your CSS reset below the kit's layer. See [Keep app resets below the kit layer](#keep-app-resets-below-the-kit-layer).
3. Set `data-cui-theme` on ``. See [Replace the theme attributes](#replace-the-theme-attributes).
diff --git a/apps/docs/content/docs/css/components/avatar.mdx b/apps/docs/content/docs/css/components/avatar.mdx
new file mode 100644
index 00000000..0cfa5812
--- /dev/null
+++ b/apps/docs/content/docs/css/components/avatar.mdx
@@ -0,0 +1,69 @@
+---
+title: Avatar
+description: "A person in plain HTML: their picture, or their initials on a colour from their id."
+---
+
+Load `@codeui/styles/avatar.css`, or `all.css`. The Solid component is documented in [Avatar](/docs/components/avatar).
+
+## Demo
+
+
+
+## Markup
+
+| Part | Element | Class | `data-cui` |
+| --- | --- | --- | --- |
+| Root | `span` with `role="img"` and the name as `aria-label` | `cui-avatar` | `avatar` |
+| Initials | `span` with `aria-hidden="true"` | `cui-avatar-fallback` | `avatar-fallback` |
+| Picture | `img` with `alt=""`, after the initials | `cui-avatar-image` | `avatar-image` |
+
+| Attribute | Values | Default |
+| --- | --- | --- |
+| `data-size` | `xs`, `sm`, `md`, `lg` | `xs` |
+| `data-unassigned` | Presence | Off |
+| `--cui-avatar-hue` (inline style) | A hue in degrees | `0` |
+| `--cui-avatar-chroma` (inline style) | `0` for a neutral fill | Set per theme |
+
+## Variants
+
+### Size
+
+
+
+The sizes are the shared control heights, `--cui-control-height-xs` to `--cui-control-height-lg`, so they follow `data-cui-density`. Comfortable density gives 28, 36, 44 and 52px.
+
+### Hue
+
+Set `--cui-avatar-hue` from a stable id, never from the name. `avatarHue(id)` from `@codeui/styles/avatar` returns the hue the Solid component uses. Without an id, set `--cui-avatar-chroma: 0` for a neutral fill.
+
+## States
+
+### Picture
+
+Put the `img` after the initials. It covers them while it loads. When it fails, remove it and the initials show.
+
+### Unassigned
+
+Set `data-unassigned` and leave the root empty. It draws a dashed circle with no fill. Name it "Unassigned".
+
+## What you supply
+
+- The hue from a stable id, and the initials from the name. `avatarHue` and `avatarInitials` from `@codeui/styles/avatar` do both.
+- Removing the picture when it fails to load.
+- A tooltip with the name, such as the [Tooltip](/docs/css/components/tooltip) markup.
+
+## Helper
+
+```ts
+import "@codeui/styles/avatar.css";
+import { applyStyleProps } from "@codeui/styles";
+import { avatarHue, avatarInitials, avatarStyleProps } from "@codeui/styles/avatar";
+
+const avatar = document.createElement("span");
+applyStyleProps(avatar, avatarStyleProps({ size: "sm" }));
+avatar.role = "img";
+avatar.ariaLabel = "Grace Hopper";
+avatar.style.setProperty("--cui-avatar-hue", String(avatarHue("user_grace")));
+avatar.innerHTML = `${avatarInitials("Grace Hopper")}`;
+// class="cui-avatar" data-cui="avatar" data-size="sm"
+```
diff --git a/apps/docs/content/docs/css/components/dropdown-menu.mdx b/apps/docs/content/docs/css/components/dropdown-menu.mdx
index 4585f48a..bbc021cb 100644
--- a/apps/docs/content/docs/css/components/dropdown-menu.mdx
+++ b/apps/docs/content/docs/css/components/dropdown-menu.mdx
@@ -19,7 +19,7 @@ The demos render the open menu in normal flow, under its trigger. On a page, the
| Content | `div` | `cui-dropdownmenu-content` | `dropdownmenu-content` |
| Item | `div` or `button` | `cui-dropdownmenu-item` | `dropdownmenu-item` |
| Right slot | `div` or `span` | `cui-dropdownmenu-right-slot` | None |
-| Separator | `div` | `cui-dropdownmenu-separator` | None |
+| Separator | `hr` or `div` | `cui-dropdownmenu-separator` | None |
| Submenu content | `div` | `cui-dropdownmenu-submenu-content cui-dropdownmenu-content` | None |
The right slot holds a shortcut or a submenu arrow. It pushes itself to the end of the item and uses muted text.
diff --git a/apps/docs/content/docs/css/components/hover-card.mdx b/apps/docs/content/docs/css/components/hover-card.mdx
new file mode 100644
index 00000000..85a530cf
--- /dev/null
+++ b/apps/docs/content/docs/css/components/hover-card.mdx
@@ -0,0 +1,65 @@
+---
+title: HoverCard
+description: A card of extra detail next to a link, in plain HTML.
+---
+
+Load `@codeui/styles/hovercard.css`, or `all.css`. The Solid component is documented in [HoverCard](/docs/components/hover-card).
+
+## Demo
+
+
+
+The demo renders the open card in normal flow, under its trigger. On a page, the card floats and your positioning code places it.
+
+## Markup
+
+| Part | Element | Class | `data-cui` |
+| --- | --- | --- | --- |
+| Trigger | `a` with an `href`. It gets a dotted underline in the hint tone | none | `hovercard-trigger` |
+| Content | `div` | `cui-hovercard-content` | `hovercard-content` |
+| List | `ul` with an `aria-label` | `cui-hovercard-list` | `hovercard-list` |
+| Entry | `li` | `cui-hovercard-item` | `hovercard-item` |
+| State icon | `span`, 16px, always present | `cui-hovercard-item-icon` | `hovercard-item-icon` |
+| Identifier | `span` | `cui-hovercard-item-id` | `hovercard-item-id` |
+| Title | `span`, truncated | `cui-hovercard-item-title` | `hovercard-item-title` |
+
+| Attribute | Values | Default |
+| --- | --- | --- |
+| `data-expanded` on the trigger | Presence, while the card is open. The dotted underline takes the text colour | Off |
+| `data-expanded` on the content | Presence | Off |
+| `data-motion` on the content | `none` | None |
+
+## List of entries
+
+
+
+One line per entry: state icon, identifier, then the title truncated. Set `--cui-hovercard-item-depth` on an entry to indent it 16px per level. The list caps at 24rem and scrolls on its own. Keep the icon span on a finished entry, empty, so the identifiers line up.
+
+## States
+
+### Open
+
+`data-expanded` plays the pop-in: a fade from `scale(0.96)`. The animation grows from `--cui-popper-content-transform-origin`, so set it to the side that faces the trigger.
+Without `data-expanded`, the content plays its exit animation and stays transparent. Set it on an open card even without a script.
+
+### Closing
+
+Remove `data-expanded` while the card is still in the page, and remove the card when the animation ends. `data-motion="none"` turns off both animations. Use it when the card opens from keyboard focus. With reduced motion, the card only fades.
+
+## What you supply
+
+- Showing the card at once on a click or tap, and 500ms after the pointer rests on the trigger or the trigger gets focus, and hiding it 150ms after the pointer leaves the trigger and the card, on blur, and on Escape.
+- Placement beside the trigger, on the right unless there is no room, then on the left, and `--cui-popper-content-transform-origin`.
+- A focusable trigger. Nothing in the card may be the only way to reach an action: the card never takes focus.
+
+## Helper
+
+```ts
+import "@codeui/styles/hovercard.css";
+import { hoverCardParts, hoverCardStyles } from "@codeui/styles/hovercard";
+
+const card = document.querySelector("#thread-card")!;
+card.className = hoverCardStyles.content();
+card.dataset.cui = hoverCardParts.content;
+// class="cui-hovercard-content" data-cui="hovercard-content"
+```
diff --git a/apps/docs/content/docs/css/components/meta.json b/apps/docs/content/docs/css/components/meta.json
index fb997792..ee9de684 100644
--- a/apps/docs/content/docs/css/components/meta.json
+++ b/apps/docs/content/docs/css/components/meta.json
@@ -6,7 +6,9 @@
"icon-button",
"link",
"---Layout and text---",
+ "avatar",
"kbd",
+ "resizable",
"settings-row",
"stack",
"table",
@@ -39,6 +41,7 @@
"command-menu",
"dialog",
"dropdown-menu",
+ "hover-card",
"popover",
"sheet",
"tooltip"
diff --git a/apps/docs/content/docs/css/components/resizable.mdx b/apps/docs/content/docs/css/components/resizable.mdx
new file mode 100644
index 00000000..56ac08b9
--- /dev/null
+++ b/apps/docs/content/docs/css/components/resizable.mdx
@@ -0,0 +1,55 @@
+---
+title: Resizable
+description: The handle between two resizable panels, in plain HTML.
+---
+
+Load `@codeui/styles/resizable.css`, or `all.css`. The Solid component is documented in [Resizable](/docs/components/resizable).
+
+## Demo
+
+
+
+## Markup
+
+| Part | Element | Class | `data-cui` |
+| --- | --- | --- | --- |
+| Root | `div` | none | `resizable` |
+| Panel | `div` | none | `resizable-panel` |
+| Handle | `button type="button"` with `role="separator"` | `cui-resizable-handle` | `resizable-handle` |
+
+Only the handle has styles. Give the root `display: flex` (`flex-direction: column` when vertical) and a size, and give each panel `flex: none`, `overflow: hidden` and a `flex-basis`.
+
+| Attribute | Values | Default |
+| --- | --- | --- |
+| `data-orientation` on the handle | `horizontal`, `vertical` | `horizontal` |
+| `data-active` on the handle | Presence: hovered, focused or dragged | Off |
+| `data-dragging` on the handle | Presence | Off |
+
+## Variants
+
+### Vertical
+
+
+
+`data-orientation="vertical"` draws a horizontal line and a row-resize cursor.
+
+## States
+
+The line is `--cui-border-divider` at rest, `--cui-surface-scroll-thumb` on hover and with `data-active`, `--cui-surface-scroll-thumb-hover` with `data-dragging`, and 2px of `--cui-focus-color` on `:focus-visible`. The colour changes over 120ms, except on keyboard focus. In an island layout, set `--cui-resizable-handle-line-color: transparent`: the gap between islands already separates them.
+
+## What you supply
+
+- Dragging and keyboard resizing: arrow keys by a step, Home and End to the limits, Enter to collapse.
+- `aria-orientation`, `aria-controls`, `aria-valuenow`, `aria-valuemin` and `aria-valuemax` on the handle, and an `aria-label`.
+
+## Helper
+
+```ts
+import "@codeui/styles/resizable.css";
+import { applyStyleProps } from "@codeui/styles";
+import { resizableStyleProps } from "@codeui/styles/resizable";
+
+const handle = document.querySelector("[role=separator]")!;
+applyStyleProps(handle, resizableStyleProps({ orientation: "vertical" }));
+// class="cui-resizable-handle" data-cui="resizable-handle" data-orientation="vertical"
+```
diff --git a/apps/docs/content/docs/design/color.mdx b/apps/docs/content/docs/design/color.mdx
index bfa0ea87..66f7a180 100644
--- a/apps/docs/content/docs/design/color.mdx
+++ b/apps/docs/content/docs/design/color.mdx
@@ -165,6 +165,12 @@ Toghen resolves the status tokens from the Gosfuig ramps. Danger uses red, cauti
When you override a status `base` token, its hover and active colours follow through CSS relative colours.
+### Workflow states are not status
+
+A task "in review" or "to test" needs nothing from the user, so it is neutral or uses the brand wash. In CodeLoom, every in-progress Jira item once had the same orange half-circle, and it read as a warning: "alcuni sembrano warning anche se sono in to test". Every state has a visible name, in a label or a tooltip, and its glyph changes shape as well as colour.
+
+The reverse matters as much. A real warning, such as a server that needs you to sign in, always shows in the caution tone with an alert icon, and never folds into ordinary content or a collapsed group. And a finished item does not celebrate in green: it shows no status icon and keeps its time.
+
## Lines
A line is allowed only where a fill would disappear:
diff --git a/apps/docs/content/docs/design/decisions.mdx b/apps/docs/content/docs/design/decisions.mdx
index 534f0f18..77a3a004 100644
--- a/apps/docs/content/docs/design/decisions.mdx
+++ b/apps/docs/content/docs/design/decisions.mdx
@@ -33,6 +33,11 @@ Every rule in Inkstone was decided by reviewing a working build. None comes from
| A toast pointing to "7 new things" in Settings | It sent the user away from their work | Dots on the controls themselves |
| A 9.5px timeline label | Unreadable | 11px minimum |
| Glass window style, dot grid backgrounds | Glossy and busy | Hairline, flat or accent wash |
+| `title` attributes for descriptions | Slow, unstyled, unreachable by touch | A hover card |
+| A status footer for ambient state | "un po fuorviante" | A header control shown only when it needs action |
+| A full screen with "Back to …" | It hid the work | A tab in an island |
+| A formatting toolbar under a text input | "non servono a niente" | Shortcuts that render as you type |
+| A generic icon and the same label on every row | Every row looked the same | The item's own mark in the leading slot |
## Where the kit disagrees with Inkstone
@@ -47,8 +52,9 @@ The kit's tokens were measured from CodeImage, so they carry CodeImage's drift a
| Selection | Kit listbox fills the selected row with blue | Neutral fill |
| Radius | Eleven tokens; buttons at 9px, dialogs at 14px, the toolbar at 18px | The nesting table |
| Selection ring | Drawn with inset shadow, outline or border in different places | `outline` with a negative offset |
-| Focus | Mostly 2px offset, 3px in the accordion | 2px everywhere |
+| Focus | Mostly 2px offset, 3px in the accordion | 2px offset, inside the row in packed lists and toolbars |
| Motion | Button press 200ms `ease`; focus `ease-in`; dialog `ease-in-out` keyframes | The movements on the Motion page |
+| Island gap | CodeImage sits 8px from the edge and between islands | 6px (`--cui-space-1-5`) |
| Breakpoints | 767, 768 and 769px | 768 / 769 only |
| Export colour | CodeImage's Export still uses the old kit blue `#0072f5` | `--cui-action-brand-base` |
| Tags, keycaps, grips | Three tag styles, three keycap styles, two grips | One each |
diff --git a/apps/docs/content/docs/design/layout.mdx b/apps/docs/content/docs/design/layout.mdx
index b2bd8c26..da0b05c2 100644
--- a/apps/docs/content/docs/design/layout.mdx
+++ b/apps/docs/content/docs/design/layout.mdx
@@ -17,9 +17,15 @@ description: A still content island, a 360px side panel, floating bars, and one
└──────────────────────────────────────────────────────────────┘
```
-The interface has fixed sizes and the content takes all the remaining space. The side panel is 360px. The header row is 36px. Everything sits 8px from the window edge and 8px from its neighbours.
+The interface has fixed sizes and the content takes all the remaining space. The side panel is 360px. The header row is 36px. Everything sits 6px from the window edge and 6px from its neighbours.
-When the content is read-only, the layout leaves out the containers of the controls it does not show. The content gets that space, instead of empty frames where the controls would be.
+The space of an island layout goes inside the islands. The page between them is a thin seam. CodeLoom started with wider gaps, and they spent room on background instead of content: "questo permette di risparmiare spazio".
+
+A side panel may be resizable with the kit `Resizable`, always between a minimum and a maximum width, so it can make room for long titles without swallowing the content.
+
+A view opens as a tab in an island, beside the content. It never replaces the content with a full screen and a "Back to …" button.
+
+When the content is read-only, the layout leaves out the containers of the controls it does not show. The content gets that space, instead of empty frames where the controls would be. The same goes for lists: an item with nothing in it gets no row. CodeLoom once showed an empty "checkpoint" row: "non ha molto senso".
## Side panel
@@ -28,6 +34,7 @@ CodeImage's side panel is an accordion. Its rules came from several review round
- **One section open at a time.** With several sections open, the panel scrolled further every time a section was opened.
- **Everything visible inside the open section.** An early build had "More / Less" toggles inside sections, which hid options without making the panel easier to scan. They were removed.
- **The header carries the current value.** Each section header shows an icon, a title, the current value as a short grey summary (for example "64" or "macOS"), and a chevron. The user can read the whole configuration with every section closed.
+- **The whole header is the trigger.** The chevron is an icon inside the row, not a separate button, and row actions sit over the end of the row inside its fill. A separate chevron button left the rest of the row dead and made the two hit areas collide.
- **The open section sits on an inset**, a quieter island inside the panel, so it is clear which header the controls belong to.
The panel can also be shown as a rail of icons, one panel per section. That is a preference in Settings, not a separate layout. Both forms render the same sections from the same code, so they cannot drift apart. A hybrid of rail and accordion was tried and rejected.
diff --git a/apps/docs/content/docs/design/motion.mdx b/apps/docs/content/docs/design/motion.mdx
index bfb358b6..4abc7973 100644
--- a/apps/docs/content/docs/design/motion.mdx
+++ b/apps/docs/content/docs/design/motion.mdx
@@ -41,6 +41,10 @@ Naming the movements gives designers, developers and agents a shared vocabulary.
When you minimise CodeImage's large "What's new" dialog, it does not just fade out. It shrinks to a third of its size and slides into the small card in the bottom-left corner, in 200ms. The motion tells the user where the content went, so they know where to find it again. This is what motion is for in Inkstone.
+### Spinners share one clock
+
+Several spinners that mount at different moments, in a sidebar row, a list entry and a chip, turn out of phase and look like separate, nervous activities. Every spinner turns on one clock, aligned to the document timeline, so they read as one. **Proposed:** the kit `Spinner` does this itself.
+
### What stays still
In CodeImage's side panel, the segmented control's indicator **jumps** to the new option instead of sliding. That is deliberate. The control is used many times while working, and the content it changes, such as the frame radius, animates instead. The control responds instantly and the content changes smoothly.
diff --git a/apps/docs/content/docs/design/patterns.mdx b/apps/docs/content/docs/design/patterns.mdx
index dc7d3d7f..670686e7 100644
--- a/apps/docs/content/docs/design/patterns.mdx
+++ b/apps/docs/content/docs/design/patterns.mdx
@@ -51,6 +51,7 @@ The preview is a schematic drawn in the option's own colours, not a miniature of
| Overlay | When | Backdrop |
| --- | --- | --- |
| Tooltip | Name an icon, explain a value | None |
+| Hover card | Show several facts or a description | None |
| Popover | Pick a value for one row | None |
| Menu | Choose an action | None |
| Command menu | Find anything by name | None |
@@ -70,13 +71,19 @@ A picker opens over the panel that holds it, anchored to its row. It does not pu
A dialog is for settings and for decisions the user must make before continuing, such as reviewing detected secrets before an export. It is not for asking "are you sure?" about something that can be undone.
+A tooltip is one line that names one thing. A description, or several facts about a row, goes in a hover card beside its trigger, on the right unless there is no room, wrapped at about 20rem. It opens on click too, so touch works, and everything in it is reachable another way. The `title` attribute is never used: it is slow, unstyled, and invisible to touch and keyboard. Use the kit [`HoverCard`](/docs/components/hover-card): it opens on hover, focus and click, sits on the right by default, and follows Pop. Moving to the next trigger while a card is open moves that card instead of opening a second one: it slides to the new trigger and resizes to the new content. A trigger in running text has a dotted underline in the hint tone, so it reads as something to hover.
+
+A list inside a menu or a hover card has one line per entry: state icon, identifier, title truncated. Nesting shows by indent, and a prefix that every entry shares is dropped. Two or more entries for the same action go in a submenu labelled with the count, so the menu does not fill up with "Open …" rows. A long list caps at about 24rem and scrolls on its own. In a hover card, build it with `HoverCardList` and `HoverCardItem`.
+
Escape closes only the innermost layer. In CodeImage, pressing Escape on a segmented control inside Settings once closed the whole dialog.
## Command menu
`⌘K`, or `Ctrl+K` outside Apple platforms, opens the command menu in every layout. It floats at the bottom centre, six rows tall, with no scrim, so the content stays in view while you browse.
-It lists every option of every visible control, every action and every setting. It reads the same data as the controls, so a new setting appears in it without extra work. Moving through the rows previews each option on the content. Enter applies it and Escape puts the old value back. A short hint in the search row says so: `↑↓ preview · ↵ apply · esc cancel`.
+It lists every option of every visible control, every action and every setting. It reads the same data as the controls, so a new setting appears in it without extra work. Moving through the rows previews each option on the content. Enter applies it and Escape puts the old value back. A footer row of keycaps says so: `↑↓ Navigate · ↵ Apply · esc Close`.
+
+Rows are an icon, the name, and the description on the right. The highlighted row's full description opens in a hover card that follows the arrow keys. A group label has about `--cui-space-2` above it and `--cui-space-1` below, and the first label adds nothing above.
## Actions in dialogs and toasts
@@ -91,6 +98,42 @@ Close and Confirm go on the right of the footer. A third, minor action is a smal
+An action at the end of a sentence or a notice, such as **Sign in** after a message that asks for it, is a text link after `--cui-space-2`, underlined on hover. A button box pressed against the text looked "orrendo".
+
+## Rows in a list
+
+- **The leading slot tells the item apart.** It holds the item's type, source or owner, never a generic icon repeated on every row. A label that is the same on every row moves to the accessible description.
+- **The trailing slot has one meaning.** It shows the time, and an icon only for live work, a failure, a stop or a request for the user. A list where some finished rows showed a check and others showed "2h" raised the question: "what's the difference between completed and 1h?"
+- **Ownership is nesting.** An item sits under its owner, not under a separate heading that changes with the selection. Organising groups, such as pinned or archived, stay outside that tree.
+- **One row per thing.** A summary and its members are one row: the live member first, then the count that opens the rest. A fact every member shares goes once on the group row.
+- **A large flat group gets a second level** by the owner the user recognises, with an avatar and a count, instead of long paths on every row.
+
+## Background work
+
+Work that runs while the user does something else stays visible as one control near where the user acts. It shows a count and how many are still active, for example "3 tasks · 1 running", opens the list, where each item shows what it runs and for how long, and goes away when nothing is left.
+
+## Data and technical values
+
+- **Show data as what it is.** A file read shows the lines, a change shows a diff, anything else shows name and value rows. Raw JSON is only for data with no known shape.
+- **Show the value, not a verb about it.** A command, path or query shows itself. The part that identifies it is primary text, the rest is tertiary mono and truncates. Opened, the full value is highlighted in the code font with a Copy button. "Running pnpm" said nothing about what ran.
+- **Running work shows its time** at the end of its row, in tabular figures with a reserved width, and the time stays once the work ends.
+- **An author line** is the author's mark in a rounded tile, the name in primary text, then facts in secondary text joined by " · ".
+
+## Avatar
+
+A person is an avatar: their picture when there is one, otherwise one or two initials on a hue derived from their id, never from their name, so the colour does not change when the name does. Full radius with a neutral ring, so it never vanishes into its background. The name is in the tooltip and the accessible name. Sizes come from the shared control scale, and an unassigned owner is an empty dashed circle. Use the kit [`Avatar`](/docs/components/avatar); three CodeLoom features had each built their own.
+
+## Forms and inputs
+
+- **A setup form asks the main choice first** and puts advanced methods behind a disclosure. Each method has a one-line hint on where to find its value. An error sits under the field that caused it, and clears when the method changes.
+- **A suggested value is the placeholder**, with a Tab keycap to accept it, not a separate chip with ×.
+- **Attached context is a chip above the input**: the source's mark, the key at 600, the title truncated, on the brand wash, with a remove button. Attaching never sends.
+- **A text input has no formatting toolbar.** Formatting comes from shortcuts and renders as you type: "bold italic etc non servono a niente".
+
+## Loading
+
+Loading never shows the empty state, not even for one frame. While the next content loads, keep the previous content or show a skeleton, and keep recently viewed content cached so going back is instant. In CodeLoom, switching threads once flashed "nothing here" before the thread appeared.
+
## Announcing new things
A new feature gets a small blue dot on its control, at most three at a time across the app, and the dot never animates. A release is announced by a small card in the bottom-left corner, once per release. A blocking "What's new" dialog was replaced, and so was a toast that said "Settings has 7 new things".
@@ -108,7 +151,7 @@ A new feature gets a small blue dot on its control, at most three at a time acro
- Text contrast is at least 4.5:1 below 18px. Icons, rings and control edges are at least 3:1. Both themes are checked.
- Every control works from the keyboard. Pickers and cards open with Enter and Space. A list previews on focus just as it does on hover.
-- There is one focus ring: 2px, offset 2px, shown on `:focus-visible`.
+- There is one focus ring: 2px, offset 2px, shown on `:focus-visible`. In packed lists, trees and toolbars the ring sits inside the row and shows only for keyboard input, because an outer ring covers the row next to it.
- Closing an overlay returns focus to whatever opened it.
- On a phone, opening a dialog does not focus a text field, so the keyboard does not cover the dialog.
- Every icon button and field has an accessible name. Colour is never the only signal.
diff --git a/apps/docs/content/docs/design/space-and-shape.mdx b/apps/docs/content/docs/design/space-and-shape.mdx
index f7624454..0d82434d 100644
--- a/apps/docs/content/docs/design/space-and-shape.mdx
+++ b/apps/docs/content/docs/design/space-and-shape.mdx
@@ -22,7 +22,7 @@ There are no lines between groups, so space alone shows what belongs together. T
### The shell
-Everything sits 8px from the window edge and 8px from its neighbours. The header has no bar of its own. It is as tall as its controls (36px) and reads as the first row of islands, with its edges aligned to the islands below.
+Everything sits 6px from the window edge and 6px from its neighbours, so the page between islands reads as a thin seam and the space goes inside the islands. The header has no bar of its own. It is as tall as its controls (36px) and reads as the first row of islands, with its edges aligned to the islands below.
## Radius follows nesting
diff --git a/apps/docs/content/docs/design/typography.mdx b/apps/docs/content/docs/design/typography.mdx
index c3aab619..44fbc907 100644
--- a/apps/docs/content/docs/design/typography.mdx
+++ b/apps/docs/content/docs/design/typography.mdx
@@ -40,6 +40,7 @@ A selected option may become bolder only if its box already reserves the bold wi
## Rules that keep text steady
+- **A section heading is text, not a row.** It has no fill, no row height and no capitals: Label or Meta at 600 in secondary text, with a count in tertiary text at 400. In CodeLoom, a "Pinned" shelf drawn with a row's height and fill read as one more item, not as the start of a group.
- **Tabular numbers.** Durations, sizes, zoom levels and timers use `font-variant-numeric: tabular-nums`, so the row does not shift while a value counts up.
- **Truncate values, not labels.** A long value ends in an ellipsis inside a capped width, and the full text stays reachable through a tooltip or the accessible name. A label is never cut.
diff --git a/apps/docs/export-manifest.json b/apps/docs/export-manifest.json
index ca2397d3..1a83b9e0 100644
--- a/apps/docs/export-manifest.json
+++ b/apps/docs/export-manifest.json
@@ -240,7 +240,45 @@
"TableSize": "components/table#variants",
"tableStyles": "components/table#tablestyles",
"TableStyles": "components/table#tablestyles",
- "TableVariants": "components/table#variants"
+ "TableVariants": "components/table#variants",
+ "HoverCard": "components/hover-card#hovercard",
+ "HoverCardClasses": "components/hover-card#anatomy",
+ "HoverCardContent": "components/hover-card#hovercardcontent",
+ "HoverCardContentProps": "components/hover-card#hovercardcontent",
+ "HoverCardPart": "components/hover-card#anatomy",
+ "hoverCardParts": "components/hover-card#anatomy",
+ "HoverCardProps": "components/hover-card#hovercard",
+ "hoverCardStyles": "components/hover-card#hovercardstyles",
+ "HoverCardStyles": "components/hover-card#hovercardstyles",
+ "HoverCardTrigger": "components/hover-card#hovercardtrigger",
+ "HoverCardTriggerProps": "components/hover-card#hovercardtrigger",
+ "Resizable": "components/resizable#resizable",
+ "ResizableClasses": "components/resizable#anatomy",
+ "ResizableHandle": "components/resizable#resizablehandle",
+ "ResizableHandleProps": "components/resizable#resizablehandle",
+ "ResizableOrientation": "components/resizable#resizable",
+ "ResizablePanel": "components/resizable#resizablepanel",
+ "ResizablePanelProps": "components/resizable#resizablepanel",
+ "ResizablePart": "components/resizable#anatomy",
+ "resizableParts": "components/resizable#anatomy",
+ "ResizableProps": "components/resizable#resizable",
+ "ResizableSize": "components/resizable#resizablestyles",
+ "resizableStyles": "components/resizable#resizablestyles",
+ "ResizableStyles": "components/resizable#resizablestyles",
+ "ResizeStrategy": "components/resizable#resizablestyles",
+ "Avatar": "components/avatar#avatar",
+ "avatarHue": "components/avatar#avatarhue",
+ "avatarInitials": "components/avatar#avatarinitials",
+ "AvatarProps": "components/avatar#avatar",
+ "avatarVars": "components/avatar#avatar",
+ "HoverCardItem": "components/hover-card#hovercarditem",
+ "HoverCardItemProps": "components/hover-card#hovercarditem",
+ "HoverCardList": "components/hover-card#hovercardlist",
+ "HoverCardListProps": "components/hover-card#hovercardlist",
+ "TooltipDefaults": "components/tooltip#defaults-for-a-whole-app",
+ "TooltipProvider": "components/tooltip#defaults-for-a-whole-app",
+ "HoverCardGroup": "components/hover-card#hovercardgroup",
+ "HoverCardGroupProps": "components/hover-card#hovercardgroup"
},
"@codeui/kit/accordion/parts": {
"AccordionClasses": "components/accordion#anatomy",
@@ -1022,7 +1060,9 @@
},
"@codeui/kit/tooltip": {
"Tooltip": "components/tooltip#tooltip",
- "TooltipProps": "components/tooltip#tooltip"
+ "TooltipProps": "components/tooltip#tooltip",
+ "TooltipDefaults": "components/tooltip#defaults-for-a-whole-app",
+ "TooltipProvider": "components/tooltip#defaults-for-a-whole-app"
},
"@codeui/kit/virtualized-listbox": {
"VirtualizedListbox": "components/virtualized-listbox#virtualizedlistbox",
@@ -1190,7 +1230,9 @@
"Root": "components/tooltip#styled-parts-api",
"RootProps": "components/tooltip#styled-parts-api",
"Trigger": "components/tooltip#styled-parts-api",
- "TriggerProps": "components/tooltip#styled-parts-api"
+ "TriggerProps": "components/tooltip#styled-parts-api",
+ "Provider": "components/tooltip#defaults-for-a-whole-app",
+ "TooltipDefaults": "components/tooltip#defaults-for-a-whole-app"
},
"@codeui/kit/table": {
"Table": "components/table#table",
@@ -1204,6 +1246,65 @@
"tableStyles": "components/table#tablestyles",
"TableStyles": "components/table#tablestyles",
"TableVariants": "components/table#variants"
+ },
+ "@codeui/kit/hover-card": {
+ "HoverCard": "components/hover-card#hovercard",
+ "HoverCardClasses": "components/hover-card#anatomy",
+ "HoverCardContent": "components/hover-card#hovercardcontent",
+ "HoverCardContentProps": "components/hover-card#hovercardcontent",
+ "HoverCardPart": "components/hover-card#anatomy",
+ "hoverCardParts": "components/hover-card#anatomy",
+ "HoverCardProps": "components/hover-card#hovercard",
+ "hoverCardStyles": "components/hover-card#hovercardstyles",
+ "HoverCardStyles": "components/hover-card#hovercardstyles",
+ "HoverCardTrigger": "components/hover-card#hovercardtrigger",
+ "HoverCardTriggerProps": "components/hover-card#hovercardtrigger",
+ "HoverCardItem": "components/hover-card#hovercarditem",
+ "HoverCardItemProps": "components/hover-card#hovercarditem",
+ "HoverCardList": "components/hover-card#hovercardlist",
+ "HoverCardListProps": "components/hover-card#hovercardlist",
+ "HoverCardGroup": "components/hover-card#hovercardgroup",
+ "HoverCardGroupProps": "components/hover-card#hovercardgroup"
+ },
+ "@codeui/kit/resizable": {
+ "Resizable": "components/resizable#resizable",
+ "ResizableClasses": "components/resizable#anatomy",
+ "ResizableHandle": "components/resizable#resizablehandle",
+ "ResizableHandleProps": "components/resizable#resizablehandle",
+ "ResizableOrientation": "components/resizable#resizable",
+ "ResizablePanel": "components/resizable#resizablepanel",
+ "ResizablePanelProps": "components/resizable#resizablepanel",
+ "ResizablePart": "components/resizable#anatomy",
+ "resizableParts": "components/resizable#anatomy",
+ "ResizableProps": "components/resizable#resizable",
+ "ResizableSize": "components/resizable#resizablestyles",
+ "resizableStyles": "components/resizable#resizablestyles",
+ "ResizableStyles": "components/resizable#resizablestyles",
+ "ResizeStrategy": "components/resizable#resizablestyles"
+ },
+ "@codeui/kit/avatar": {
+ "Avatar": "components/avatar#avatar",
+ "avatarHue": "components/avatar#avatarhue",
+ "avatarInitials": "components/avatar#avatarinitials",
+ "AvatarProps": "components/avatar#avatar",
+ "avatarVars": "components/avatar#avatar"
+ },
+ "@codeui/kit/avatar/parts": {
+ "AvatarClasses": "components/avatar#anatomy",
+ "avatarHue": "components/avatar#avatarhue",
+ "avatarInitials": "components/avatar#avatarinitials",
+ "AvatarPart": "components/avatar#anatomy",
+ "avatarParts": "components/avatar#anatomy",
+ "AvatarSize": "components/avatar#variants",
+ "avatarStyles": "components/avatar#avatarstyles",
+ "AvatarStyles": "components/avatar#avatarstyles",
+ "AvatarVariants": "components/avatar#variants",
+ "Fallback": "components/avatar#fallback",
+ "FallbackProps": "components/avatar#fallback",
+ "Image": "components/avatar#image",
+ "ImageProps": "components/avatar#image",
+ "Root": "components/avatar#root",
+ "RootProps": "components/avatar#root"
}
}
}
diff --git a/apps/docs/html-demos/avatar/basic.html b/apps/docs/html-demos/avatar/basic.html
new file mode 100644
index 00000000..78c4e9cd
--- /dev/null
+++ b/apps/docs/html-demos/avatar/basic.html
@@ -0,0 +1,12 @@
+
+
+ GH
+
+
+ AT
+
+
+ G
+
+
+
diff --git a/apps/docs/html-demos/avatar/sizes.html b/apps/docs/html-demos/avatar/sizes.html
new file mode 100644
index 00000000..46929cab
--- /dev/null
+++ b/apps/docs/html-demos/avatar/sizes.html
@@ -0,0 +1,6 @@
+
+ GH
+ GH
+ GH
+ GH
+
diff --git a/apps/docs/html-demos/hover-card/basic.html b/apps/docs/html-demos/hover-card/basic.html
new file mode 100644
index 00000000..e3690b21
--- /dev/null
+++ b/apps/docs/html-demos/hover-card/basic.html
@@ -0,0 +1,7 @@
+
+ Fix flaky hydration test
+ Opened 2 hours ago · 3 subagents
+
+
diff --git a/apps/docs/html-demos/hover-card/list.html b/apps/docs/html-demos/hover-card/list.html
new file mode 100644
index 00000000..4e5405cc
--- /dev/null
+++ b/apps/docs/html-demos/hover-card/list.html
@@ -0,0 +1,20 @@
+
+ Migrate the kit to Solid 2
+
+
+
+ T-12
+ Migrate the kit to Solid 2
+
+
+
+ T-13
+ Port Popover and Tooltip to the new reactivity model
+
+
+
+ T-15
+ Keep keyboard opens free of motion
+
+
+
diff --git a/apps/docs/html-demos/resizable/basic.html b/apps/docs/html-demos/resizable/basic.html
new file mode 100644
index 00000000..d40820bd
--- /dev/null
+++ b/apps/docs/html-demos/resizable/basic.html
@@ -0,0 +1,5 @@
+
+
Threads
+
+
Conversation
+
diff --git a/apps/docs/html-demos/resizable/vertical.html b/apps/docs/html-demos/resizable/vertical.html
new file mode 100644
index 00000000..134ef951
--- /dev/null
+++ b/apps/docs/html-demos/resizable/vertical.html
@@ -0,0 +1,5 @@
+
+
Threads
+
+
Conversation
+
diff --git a/apps/examples/README.md b/apps/examples/README.md
index 9be08ab6..1cb1a5d1 100644
--- a/apps/examples/README.md
+++ b/apps/examples/README.md
@@ -9,7 +9,7 @@ Solid apps made with `@codeui/kit`. The docs site lists them at `/examples` and
| `theme-studio` | Theme Studio | A theme builder for CodeImage that exports a `createTheme` module |
| `inspector` | Inspector playground | The [prosemirror-inspector](https://github.com/riccardoperra/prosemirror-devtools) invoice workbench, with plain ProseMirror |
-Each app is a real consumer of the kit: Vite and `vite-plugin-solid`, as [Installation](../docs/content/docs/(kit)/installation.mdx) describes. The interface uses kit components and `--cui-*` tokens only, and follows [`packages/kit/DESIGN.md`](../../packages/kit/DESIGN.md).
+Each app is a real consumer of the kit: Vite and `@solidjs/vite-plugin`, as [Installation](../docs/content/docs/(kit)/installation.mdx) describes. The interface uses kit components and `--cui-*` tokens only, and follows [`packages/kit/DESIGN.md`](../../packages/kit/DESIGN.md).
## Develop
diff --git a/apps/examples/package.json b/apps/examples/package.json
index ba20c687..9d9925d3 100644
--- a/apps/examples/package.json
+++ b/apps/examples/package.json
@@ -16,8 +16,8 @@
"@codeui/kit": "workspace:*",
"@fontsource-variable/inter": "^5.2.8",
"@fontsource-variable/jetbrains-mono": "^5.2.8",
- "@kobalte/core": "^0.13.14",
- "lucide-solid": "^1.74.0",
+ "@kobalte/core": "2.0.0",
+ "@lucide/solid": "1.77.0",
"prosemirror-commands": "^1.7.2",
"prosemirror-history": "^1.5.1",
"prosemirror-inspector": "^0.3.0",
@@ -27,11 +27,12 @@
"prosemirror-state": "^1.4.4",
"prosemirror-transform": "^1.12.6",
"prosemirror-view": "^1.42.9",
- "solid-js": "^1.9.8"
+ "solid-js": "2.0.3",
+ "@solidjs/web": "2.0.3"
},
"devDependencies": {
"typescript": "^5.6.2",
- "vite": "^8.0.0",
- "vite-plugin-solid": "^2.11.12"
+ "vite": "8.3.8",
+ "@solidjs/vite-plugin": "3.0.1"
}
}
diff --git a/apps/examples/src/dashboard/App.tsx b/apps/examples/src/dashboard/App.tsx
index e166f9c6..489ac5c2 100644
--- a/apps/examples/src/dashboard/App.tsx
+++ b/apps/examples/src/dashboard/App.tsx
@@ -1,12 +1,13 @@
import { Button, type CommandItem, CommandMenu, createToaster, DropdownMenuItem, IconButton, Kbd, Sheet, Text, Toaster, Tooltip } from "@codeui/kit";
-import Activity from "lucide-solid/icons/activity";
-import ChartNoAxesColumn from "lucide-solid/icons/chart-no-axes-column";
-import Menu from "lucide-solid/icons/menu";
-import Search from "lucide-solid/icons/search";
-import SettingsIcon from "lucide-solid/icons/settings";
-import UserPlus from "lucide-solid/icons/user-plus";
-import Users from "lucide-solid/icons/users";
-import { createSignal, For, type JSX, Match, Show, Switch } from "solid-js";
+import Activity from "@lucide/solid/icons/activity";
+import ChartNoAxesColumn from "@lucide/solid/icons/chart-no-axes-column";
+import Menu from "@lucide/solid/icons/menu";
+import Search from "@lucide/solid/icons/search";
+import SettingsIcon from "@lucide/solid/icons/settings";
+import UserPlus from "@lucide/solid/icons/user-plus";
+import Users from "@lucide/solid/icons/users";
+import { createSignal, For, Match, Show, Switch } from "solid-js";
+import { type JSX } from "@solidjs/web";
import { ExampleMenu, MadeWith } from "../shared/ExampleMenu";
import { modKey, onModK } from "../shared/hotkey";
import { createIsPhone } from "../shared/media";
@@ -145,7 +146,7 @@ export function App() {
onModK(openCommands);
return (
-
+
@@ -234,6 +235,6 @@ export function App() {
}}
/>
-
+
);
}
diff --git a/apps/examples/src/dashboard/CustomerSheet.tsx b/apps/examples/src/dashboard/CustomerSheet.tsx
index bb75f922..4aab9bf3 100644
--- a/apps/examples/src/dashboard/CustomerSheet.tsx
+++ b/apps/examples/src/dashboard/CustomerSheet.tsx
@@ -1,5 +1,5 @@
import { Badge, Button, SegmentedControl, SegmentedControlItem, Sheet, type SheetProps, Text } from "@codeui/kit";
-import { createEffect, createSignal, For, Show } from "solid-js";
+import { createMemo, For, Show } from "solid-js";
import { formatMoneyWhole, formatNumber } from "../shared/format";
import { createIsPhone } from "../shared/media";
import { createControlSize } from "../shared/size";
@@ -12,11 +12,9 @@ export function CustomerSheet() {
const isPhone = createIsPhone();
const size = createControlSize();
// The last customer stays on screen while the sheet slides out.
- const [customer, setCustomer] = createSignal();
- createEffect(() => {
- const open = pulse.customers().find(c => c.id === pulse.openCustomer());
- if (open) setCustomer(open);
- });
+ const customer = createMemo(previous =>
+ pulse.customers().find(c => c.id === pulse.openCustomer()) ?? previous,
+ );
const placement = (): Pick => (isPhone() ? { side: "bottom", draggable: true } : { side: "right" });
return (
diff --git a/apps/examples/src/dashboard/Customers.tsx b/apps/examples/src/dashboard/Customers.tsx
index 4aaa31eb..95b9591d 100644
--- a/apps/examples/src/dashboard/Customers.tsx
+++ b/apps/examples/src/dashboard/Customers.tsx
@@ -22,8 +22,8 @@ import {
TextField,
Tooltip,
} from "@codeui/kit";
-import Ellipsis from "lucide-solid/icons/ellipsis";
-import { createEffect, createMemo, createSignal, For, on, onCleanup, onMount, Show } from "solid-js";
+import Ellipsis from "@lucide/solid/icons/ellipsis";
+import { createEffect, createMemo, createSignal, For, onSettled, Show } from "solid-js";
import { formatMoneyWhole, formatNumber } from "../shared/format";
import { createIsPhone } from "../shared/media";
import { createControlSize } from "../shared/size";
@@ -52,10 +52,10 @@ export function Customers() {
const [page, setPage] = createSignal(1);
const [selected, setSelected] = createSignal([]);
- onMount(() => {
+ onSettled(() => {
if (pulse.customersLoaded()) return;
const timer = setTimeout(() => pulse.setCustomersLoaded(true), 700);
- onCleanup(() => clearTimeout(timer));
+ return () => clearTimeout(timer);
});
const sorted = createMemo(() => [...pulse.customers()].sort((a, b) => a.lastSeen - b.lastSeen));
@@ -68,8 +68,8 @@ export function Customers() {
const pages = () => Math.max(1, Math.ceil(filtered().length / pageSize));
const rows = () => filtered().slice((page() - 1) * pageSize, page() * pageSize);
// A new filter starts from the first page with nothing selected. An archive only steps back when its page empties.
- createEffect(on([tab, query], () => (setPage(1), setSelected([])), { defer: true }));
- createEffect(() => page() > pages() && setPage(pages()));
+ createEffect(() => [tab(), query()], () => { setPage(1); setSelected([]); }, { defer: true });
+ createEffect(() => ({ page: page(), pages: pages() }), state => { if (state.page > state.pages) setPage(state.pages); });
const onPage = () => rows().filter(c => selected().includes(c.id));
const selectPage = (checked: boolean) => {
diff --git a/apps/examples/src/dashboard/Overview.tsx b/apps/examples/src/dashboard/Overview.tsx
index c20de361..53818462 100644
--- a/apps/examples/src/dashboard/Overview.tsx
+++ b/apps/examples/src/dashboard/Overview.tsx
@@ -1,5 +1,6 @@
import { SegmentedControl, SegmentedControlItem, Text } from "@codeui/kit";
-import { For, type JSX } from "solid-js";
+import { For } from "solid-js";
+import { type JSX } from "@solidjs/web";
import { BarChart, BarList, ChartLegend, LineChart, type Series, Sparkline } from "../shared/charts";
import { formatChange, formatCompact, formatMoneyWhole, formatNumber, formatPercent } from "../shared/format";
import { createIsPhone } from "../shared/media";
diff --git a/apps/examples/src/dashboard/Settings.tsx b/apps/examples/src/dashboard/Settings.tsx
index bcbb64e5..87bc2ae9 100644
--- a/apps/examples/src/dashboard/Settings.tsx
+++ b/apps/examples/src/dashboard/Settings.tsx
@@ -17,12 +17,13 @@ import {
TextField,
} from "@codeui/kit";
import * as D from "@codeui/kit/dialog/parts";
-import Bell from "lucide-solid/icons/bell";
-import ChevronDown from "lucide-solid/icons/chevron-down";
-import Palette from "lucide-solid/icons/palette";
-import SlidersHorizontal from "lucide-solid/icons/sliders-horizontal";
-import Users from "lucide-solid/icons/users";
-import { createEffect, createSignal, For, type JSX, Match, Show, Switch as SwitchMatch } from "solid-js";
+import Bell from "@lucide/solid/icons/bell";
+import ChevronDown from "@lucide/solid/icons/chevron-down";
+import Palette from "@lucide/solid/icons/palette";
+import SlidersHorizontal from "@lucide/solid/icons/sliders-horizontal";
+import Users from "@lucide/solid/icons/users";
+import { createMemo, createSignal, For, Match, Show, Switch as SwitchMatch } from "solid-js";
+import { type JSX } from "@solidjs/web";
import { createIsPhone } from "../shared/media";
import { setTheme, theme, type Theme } from "../shared/theme";
import type { Role, WeekStart } from "./data";
@@ -48,8 +49,8 @@ export function Settings() {
const isPhone = createIsPhone();
const [query, setQuery] = createSignal("");
// The last section stays on screen while the dialog closes.
- const [shown, setShown] = createSignal("general");
- createEffect(() => pulse.section() && setShown(pulse.section()!));
+ const shown = createMemo(previous => pulse.section() ?? previous ?? "general");
+
const matches = () => {
const text = query().trim().toLowerCase();
@@ -211,14 +212,14 @@ function Notifications() {
<>
- {control => pulse.setAlerts("digest", checked)} />}
+ {control => pulse.setAlerts(draft => { draft.digest = checked; })} />}
{alert => (
- {control => pulse.setAlerts(alert.key, checked)} />}
+ {control => pulse.setAlerts(draft => { draft[alert.key] = checked; })} />}
)}
diff --git a/apps/examples/src/dashboard/main.tsx b/apps/examples/src/dashboard/main.tsx
index 47a8fb7d..c943816b 100644
--- a/apps/examples/src/dashboard/main.tsx
+++ b/apps/examples/src/dashboard/main.tsx
@@ -1,5 +1,5 @@
import "../shared/base.css";
-import { render } from "solid-js/web";
+import { render } from "@solidjs/web";
import { App } from "./App";
import "./dashboard.css";
diff --git a/apps/examples/src/dashboard/pulse.ts b/apps/examples/src/dashboard/pulse.ts
index 2ca7679e..4698354a 100644
--- a/apps/examples/src/dashboard/pulse.ts
+++ b/apps/examples/src/dashboard/pulse.ts
@@ -1,6 +1,6 @@
import type { ToastController } from "@codeui/kit";
import { createContext, createMemo, createSignal, useContext } from "solid-js";
-import { createStore } from "solid-js/store";
+import { createStore } from "solid-js";
import {
bucketSeries,
createBuckets,
diff --git a/apps/examples/src/finance/App.tsx b/apps/examples/src/finance/App.tsx
index 91b90dff..6af1e8e0 100644
--- a/apps/examples/src/finance/App.tsx
+++ b/apps/examples/src/finance/App.tsx
@@ -1,8 +1,8 @@
import { Button, type CommandItem, CommandMenu, createSelectOptions, createToaster, IconButton, Kbd, SegmentedControl, SegmentedControlItem, Select, Sheet, Text, Toaster } from "@codeui/kit";
-import PanelRight from "lucide-solid/icons/panel-right";
-import Plus from "lucide-solid/icons/plus";
-import Search from "lucide-solid/icons/search";
-import Wallet from "lucide-solid/icons/wallet";
+import PanelRight from "@lucide/solid/icons/panel-right";
+import Plus from "@lucide/solid/icons/plus";
+import Search from "@lucide/solid/icons/search";
+import Wallet from "@lucide/solid/icons/wallet";
import { createSignal, Show } from "solid-js";
import { ExampleMenu } from "../shared/ExampleMenu";
import { modKey, onModK } from "../shared/hotkey";
@@ -86,7 +86,7 @@ export function App() {
);
return (
-
+
@@ -173,6 +173,6 @@ export function App() {
}}
/>
-
+
);
}
diff --git a/apps/examples/src/finance/Planning.tsx b/apps/examples/src/finance/Planning.tsx
index 613fbdc3..17a1c474 100644
--- a/apps/examples/src/finance/Planning.tsx
+++ b/apps/examples/src/finance/Planning.tsx
@@ -1,8 +1,9 @@
import { Accordion, type AccordionEntry, Badge, Button, Progress, Slider, Text } from "@codeui/kit";
-import CalendarClock from "lucide-solid/icons/calendar-clock";
-import PiggyBank from "lucide-solid/icons/piggy-bank";
-import Target from "lucide-solid/icons/target";
-import { createSignal, For, type JSX, Show } from "solid-js";
+import CalendarClock from "@lucide/solid/icons/calendar-clock";
+import PiggyBank from "@lucide/solid/icons/piggy-bank";
+import Target from "@lucide/solid/icons/target";
+import { createSignal, For, Show } from "solid-js";
+import { type JSX } from "@solidjs/web";
import { MadeWith } from "../shared/ExampleMenu";
import { formatDay, formatMoneyWhole } from "../shared/format";
import { bills, budgets, goals, monthSpending, today } from "./data";
diff --git a/apps/examples/src/finance/Transactions.tsx b/apps/examples/src/finance/Transactions.tsx
index 512c72b8..6199e3ec 100644
--- a/apps/examples/src/finance/Transactions.tsx
+++ b/apps/examples/src/finance/Transactions.tsx
@@ -16,8 +16,8 @@ import {
Text,
TextField,
} from "@codeui/kit";
-import Ellipsis from "lucide-solid/icons/ellipsis";
-import { createEffect, createMemo, createSignal, For, on, Show } from "solid-js";
+import Ellipsis from "@lucide/solid/icons/ellipsis";
+import { createEffect, createMemo, createSignal, For, Show } from "solid-js";
import { formatDay, formatMoney } from "../shared/format";
import { createControlSize } from "../shared/size";
import { accounts, categories, type Category, type Transaction } from "./data";
@@ -47,8 +47,8 @@ export function Transactions() {
const pages = () => Math.max(1, Math.ceil(filtered().length / pageSize));
const rows = () => filtered().slice((page() - 1) * pageSize, page() * pageSize);
// A new filter or scope starts from the first page. A deletion only steps back when its page empties.
- createEffect(on([query, category, ledger.account, ledger.period], () => setPage(1), { defer: true }));
- createEffect(() => page() > pages() && setPage(pages()));
+ createEffect(() => [query(), category(), ledger.account(), ledger.period()], () => { setPage(1); }, { defer: true });
+ createEffect(() => ({ page: page(), pages: pages() }), state => { if (state.page > state.pages) setPage(state.pages); });
const clear = () => {
setQuery("");
diff --git a/apps/examples/src/finance/main.tsx b/apps/examples/src/finance/main.tsx
index c17520c1..87d7a68c 100644
--- a/apps/examples/src/finance/main.tsx
+++ b/apps/examples/src/finance/main.tsx
@@ -1,5 +1,5 @@
import "../shared/base.css";
-import { render } from "solid-js/web";
+import { render } from "@solidjs/web";
import { App } from "./App";
import "./finance.css";
diff --git a/apps/examples/src/gallery/main.tsx b/apps/examples/src/gallery/main.tsx
index 4c5a5e8a..d87ae19b 100644
--- a/apps/examples/src/gallery/main.tsx
+++ b/apps/examples/src/gallery/main.tsx
@@ -1,7 +1,7 @@
import "../shared/base.css";
import { Badge, Link, Text } from "@codeui/kit";
import { For } from "solid-js";
-import { render } from "solid-js/web";
+import { render } from "@solidjs/web";
import { docsUrl, examples } from "../shared/examples";
import "./gallery.css";
diff --git a/apps/examples/src/inspector/App.tsx b/apps/examples/src/inspector/App.tsx
index 663eb233..3e6ddd81 100644
--- a/apps/examples/src/inspector/App.tsx
+++ b/apps/examples/src/inspector/App.tsx
@@ -1,9 +1,9 @@
import { Button, createToaster, DropdownMenuItem, IconButton, Kbd, SegmentedControl, SegmentedControlItem, Sheet, Text, Toaster } from "@codeui/kit";
-import FileCheck from "lucide-solid/icons/file-check";
-import PanelLeft from "lucide-solid/icons/panel-left";
-import RotateCcw from "lucide-solid/icons/rotate-ccw";
-import ScanSearch from "lucide-solid/icons/scan-search";
-import { For, lazy, onCleanup, onMount, Show } from "solid-js";
+import FileCheck from "@lucide/solid/icons/file-check";
+import PanelLeft from "@lucide/solid/icons/panel-left";
+import RotateCcw from "@lucide/solid/icons/rotate-ccw";
+import ScanSearch from "@lucide/solid/icons/scan-search";
+import { For, lazy, onSettled, Show } from "solid-js";
import { ExampleMenu } from "../shared/ExampleMenu";
import { modKey } from "../shared/hotkey";
import { createIsPhone } from "../shared/media";
@@ -33,7 +33,7 @@ export function App() {
};
// ⌘⇧D or Ctrl+Shift+D, the shortcut the inspector's own playground uses.
- onMount(() => {
+ onSettled(() => {
const listener = (event: KeyboardEvent) => {
if (event.key.toLowerCase() !== "d" || !event.shiftKey || !(event.metaKey || event.ctrlKey) || event.altKey) return;
event.preventDefault();
@@ -41,7 +41,7 @@ export function App() {
else bench.openInspector(false);
};
window.addEventListener("keydown", listener, true);
- onCleanup(() => window.removeEventListener("keydown", listener, true));
+ return () => window.removeEventListener("keydown", listener, true);
});
const number = () => readMeta(bench.doc()).number;
@@ -49,7 +49,7 @@ export function App() {
const toggleInspector = () => (bench.inspectorOpen() ? closeInspector() : bench.openInspector(true));
return (
-
+
@@ -74,13 +74,13 @@ export function App() {
bench.setSheetOpen(true)}>
-
+
>
}
>
-
{/* "On" is a step of fill, not the accent: this is a view, not a signal (DESIGN.md §2.3). */}
- studio.setView(card() ? "frame" : "card")}>
+ studio.setView(card() ? "frame" : "card")}>
@@ -356,7 +357,7 @@ export function App() {
};
onModK(openCommands);
- onMount(() => {
+ onSettled(() => {
const listener = (event: KeyboardEvent) => {
if (!(event.metaKey || event.ctrlKey) || event.altKey || event.key.toLowerCase() !== "z") return;
// Inside a field, undo belongs to the text being typed.
@@ -365,11 +366,11 @@ export function App() {
event.preventDefault();
};
window.addEventListener("keydown", listener);
- onCleanup(() => window.removeEventListener("keydown", listener));
+ return () => window.removeEventListener("keydown", listener);
});
return (
-
+
@@ -466,6 +467,6 @@ export function App() {
}}
/>
-
+
);
}
diff --git a/apps/examples/src/theme-studio/Colors.tsx b/apps/examples/src/theme-studio/Colors.tsx
index 251062ea..fc8bae1e 100644
--- a/apps/examples/src/theme-studio/Colors.tsx
+++ b/apps/examples/src/theme-studio/Colors.tsx
@@ -1,9 +1,10 @@
import { Badge, Button, IconButton, Popover, PopoverContent, PopoverTrigger, Slider, Text, TextField, Tooltip } from "@codeui/kit";
-import Check from "lucide-solid/icons/check";
-import ChevronLeft from "lucide-solid/icons/chevron-left";
-import TriangleAlert from "lucide-solid/icons/triangle-exclamation-point";
-import X from "lucide-solid/icons/x";
-import { createMemo, createSignal, For, type JSX, Show } from "solid-js";
+import Check from "@lucide/solid/icons/check";
+import ChevronLeft from "@lucide/solid/icons/chevron-left";
+import TriangleAlert from "@lucide/solid/icons/triangle-exclamation-point";
+import X from "@lucide/solid/icons/x";
+import { createMemo, createSignal, For, Show } from "solid-js";
+import { type JSX } from "@solidjs/web";
import { createIsPhone } from "../shared/media";
import { createControlSize } from "../shared/size";
import { fromOklch, isHex, type Oklch, parseColor, toHex, toOklch } from "./color";
diff --git a/apps/examples/src/theme-studio/ExportDialog.tsx b/apps/examples/src/theme-studio/ExportDialog.tsx
index cd756630..50bf9b64 100644
--- a/apps/examples/src/theme-studio/ExportDialog.tsx
+++ b/apps/examples/src/theme-studio/ExportDialog.tsx
@@ -1,7 +1,7 @@
import { Button, Dialog, DialogPanelContent, DialogPanelFooter, SegmentedControl, SegmentedControlItem, SettingsGroup, SettingsRow, Stack, TextArea } from "@codeui/kit";
import * as D from "@codeui/kit/dialog/parts";
-import Copy from "lucide-solid/icons/copy";
-import Download from "lucide-solid/icons/download";
+import Copy from "@lucide/solid/icons/copy";
+import Download from "@lucide/solid/icons/download";
import { createMemo, createSignal, For, Show } from "solid-js";
import { tokenize } from "./highlight";
import { createArtStyle, Line } from "./Preview";
diff --git a/apps/examples/src/theme-studio/Panel.tsx b/apps/examples/src/theme-studio/Panel.tsx
index ecccc609..4b15059d 100644
--- a/apps/examples/src/theme-studio/Panel.tsx
+++ b/apps/examples/src/theme-studio/Panel.tsx
@@ -1,9 +1,10 @@
import { Accordion, type AccordionEntry, OptionCardGroup, SegmentedControl, SegmentedControlItem, Slider, Switch, Text, TextField } from "@codeui/kit";
-import AppWindow from "lucide-solid/icons/app-window";
-import Code from "lucide-solid/icons/code";
-import Palette from "lucide-solid/icons/palette";
-import TextCursor from "lucide-solid/icons/text-cursor";
-import { createEffect, createSignal, For, type JSX, on, Show } from "solid-js";
+import AppWindow from "@lucide/solid/icons/app-window";
+import Code from "@lucide/solid/icons/code";
+import Palette from "@lucide/solid/icons/palette";
+import TextCursor from "@lucide/solid/icons/text-cursor";
+import { createEffect, createSignal, For, Show } from "solid-js";
+import { type JSX } from "@solidjs/web";
import { MadeWith } from "../shared/ExampleMenu";
import { createControlSize } from "../shared/size";
import { ColorRow, SheetPicker } from "./Colors";
@@ -210,9 +211,9 @@ export function PanelTabs() {
let panel!: HTMLDivElement;
// The rows come back when the picker closes, so focus returns to the row that opened it.
createEffect(
- on(studio.picker, (now, before) => {
+ studio.picker, (now, before) => {
if (!now && before) queueMicrotask(() => panel.querySelector(`[data-slot="${before}"] .ts-row-main`)?.focus());
- }),
+ },
);
return (
diff --git a/apps/examples/src/theme-studio/Preview.tsx b/apps/examples/src/theme-studio/Preview.tsx
index 815dd11f..8d5fd812 100644
--- a/apps/examples/src/theme-studio/Preview.tsx
+++ b/apps/examples/src/theme-studio/Preview.tsx
@@ -1,4 +1,5 @@
-import { createSignal, For, type JSX, onCleanup, onMount, Show } from "solid-js";
+import { createSignal, For, onSettled, Show } from "solid-js";
+import { type JSX } from "@solidjs/web";
import { parseColor, readableOn } from "./color";
import type { Token } from "./highlight";
import { findSample } from "./samples";
@@ -156,7 +157,7 @@ export function Stage() {
const style = createArtStyle();
const [room, setRoom] = createSignal({ width: Infinity, height: Infinity });
let viewport!: HTMLDivElement;
- onMount(() => {
+ onSettled(() => {
const update = () => {
const computed = getComputedStyle(viewport);
setRoom({
@@ -166,7 +167,7 @@ export function Stage() {
};
const observer = new ResizeObserver(update);
observer.observe(viewport);
- onCleanup(() => observer.disconnect());
+ return () => observer.disconnect();
});
const scale = () => Math.min(1, room().width / art.width, room().height / art.height);
return (
diff --git a/apps/examples/src/theme-studio/main.tsx b/apps/examples/src/theme-studio/main.tsx
index e1f4ea79..16341c5f 100644
--- a/apps/examples/src/theme-studio/main.tsx
+++ b/apps/examples/src/theme-studio/main.tsx
@@ -1,5 +1,5 @@
import "../shared/base.css";
-import { render } from "solid-js/web";
+import { render } from "@solidjs/web";
import { App } from "./App";
import "./theme-studio.css";
diff --git a/apps/examples/src/theme-studio/studio.ts b/apps/examples/src/theme-studio/studio.ts
index a6e04bac..b6aacc56 100644
--- a/apps/examples/src/theme-studio/studio.ts
+++ b/apps/examples/src/theme-studio/studio.ts
@@ -1,5 +1,5 @@
import type { ToastController } from "@codeui/kit";
-import { batch, createContext, createEffect, createMemo, createSignal, useContext } from "solid-js";
+import { createContext, createEffect, createMemo, createSignal, useContext } from "solid-js";
import type { LanguageId } from "./highlight";
import { findPreset, presets, startPreset } from "./presets";
import { findSample } from "./samples";
@@ -60,13 +60,13 @@ export function createStudio(notifications: ToastController) {
const commit = (next: Theme, key?: string, origin = committed().origin) => {
const changed = !sameTheme(next, saved()) || origin !== committed().origin;
const folded = key !== undefined && key === lastKey && performance.now() - lastTime < coalesceMs;
- batch(() => {
- setPreview(null);
- if (!changed) return;
- if (!folded) setPast(list => [...list.slice(-99), committed()]);
+ setPreview(null);
+ if (changed) {
+ const previous = committed();
+ if (!folded) setPast(list => [...list.slice(-99), previous]);
setFuture([]);
setCommitted({ theme: next, origin });
- });
+ }
lastKey = key;
lastTime = performance.now();
};
@@ -74,19 +74,19 @@ export function createStudio(notifications: ToastController) {
const target = from().at(-1);
if (!target) return;
lastKey = undefined;
- batch(() => {
- setFrom(from().slice(0, -1));
- setTo(list => [...list, committed()]);
- setCommitted(target);
- setPreview(null);
- setPicker(null);
- });
+ const previous = committed();
+ setFrom(from().slice(0, -1));
+ setTo(list => [...list, previous]);
+ setCommitted(target);
+ setPreview(null);
+ setPicker(null);
};
const undo = () => step(past, setPast, setFuture);
const redo = () => step(future, setFuture, setPast);
- createEffect(() => {
- const state = { theme: toObject(saved()), origin: committed().origin, sample: sample(), view: view() };
+ createEffect(
+ () => ({ theme: toObject(saved()), origin: committed().origin, sample: sample(), view: view() }),
+ state => {
try {
localStorage.setItem(storageKey, JSON.stringify(state));
} catch {
@@ -115,11 +115,10 @@ export function createStudio(notifications: ToastController) {
};
/** Brings the row of a colour on screen: its section, and on a phone the sheet that holds it. */
- const reveal = (key: SlotKey) =>
- batch(() => {
- setSection(sectionOf(key));
- setPanelOpen(true);
- });
+ const reveal = (key: SlotKey) => {
+ setSection(sectionOf(key));
+ setPanelOpen(true);
+ };
/** Ends a picker: its preview becomes one history step, or is dropped. */
const closePicker = (keep: boolean) => {
diff --git a/apps/examples/tsconfig.json b/apps/examples/tsconfig.json
index 6cbaf962..ac2ef251 100644
--- a/apps/examples/tsconfig.json
+++ b/apps/examples/tsconfig.json
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"jsx": "preserve",
- "jsxImportSource": "solid-js",
+ "jsxImportSource": "@solidjs/web",
"module": "esnext",
"moduleResolution": "bundler",
"target": "es2022",
diff --git a/apps/examples/vite.config.ts b/apps/examples/vite.config.ts
index e7f1defe..7a955a6f 100644
--- a/apps/examples/vite.config.ts
+++ b/apps/examples/vite.config.ts
@@ -1,5 +1,35 @@
-import { defineConfig } from "vite";
-import solid from "vite-plugin-solid";
+import { dirname } from "node:path";
+import { createRequire } from "node:module";
+import { defineConfig, normalizePath, type Plugin } from "vite";
+import solid from "@solidjs/vite-plugin";
+
+// The standalone inspector is compiled against Solid 1. Keep its runtime
+// local to the inspector when the Solid 2 plugin deduplicates app imports.
+function inspectorRuntime(): Plugin {
+ const require = createRequire(import.meta.url);
+ const inspectorRequire = createRequire(
+ require.resolve("prosemirror-inspector/standalone/production"),
+ );
+ const entries = new Map([
+ ["solid-js", inspectorRequire.resolve("solid-js/dist/solid.js")],
+ ["solid-js/web", inspectorRequire.resolve("solid-js/web/dist/web.js")],
+ ]);
+ const runtimeDir = normalizePath(
+ dirname(inspectorRequire.resolve("solid-js/package.json")),
+ );
+ return {
+ name: "inspector-solid-runtime",
+ enforce: "pre",
+ resolveId(id, importer) {
+ if (
+ importer &&
+ (importer.startsWith(runtimeDir) ||
+ /\/(prosemirror-inspector|@tanstack\/devtools-utils)\//.test(importer))
+ )
+ return entries.get(id);
+ },
+ };
+}
/** One HTML page per example. Add the folder name here and to `src/shared/examples.ts`. */
const pages = ["finance", "dashboard", "theme-studio", "inspector"];
@@ -7,12 +37,16 @@ const pages = ["finance", "dashboard", "theme-studio", "inspector"];
export default defineConfig({
// Relative, so the same build runs at `/` and under `/examples/` on the docs site.
base: "./",
- plugins: [solid()],
+ plugins: [inspectorRuntime(), solid()],
+ optimizeDeps: { exclude: ["prosemirror-inspector/standalone/production"] },
server: { port: 6160 },
preview: { port: 6160 },
build: {
rollupOptions: {
- input: { index: "index.html", ...Object.fromEntries(pages.map(page => [page, `${page}/index.html`])) },
+ input: {
+ index: "index.html",
+ ...Object.fromEntries(pages.map(page => [page, `${page}/index.html`])),
+ },
},
},
});
diff --git a/configs/rollup.config.ts b/configs/rollup.config.ts
deleted file mode 100644
index 4b5c6853..00000000
--- a/configs/rollup.config.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import withSolid from "rollup-preset-solid";
-
-export default withSolid({
- input: "src/index.tsx",
- targets: ["esm", "cjs"]
-});
diff --git a/configs/vite.config.ts b/configs/vite.config.ts
index b0d38420..5faae21d 100644
--- a/configs/vite.config.ts
+++ b/configs/vite.config.ts
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
-import solidPlugin from "vite-plugin-solid";
+import solidPlugin from "@solidjs/vite-plugin";
export default defineConfig({
plugins: [solidPlugin()],
diff --git a/docs/kit-2026/consumer.md b/docs/kit-2026/consumer.md
index c261474b..e8bb4411 100644
--- a/docs/kit-2026/consumer.md
+++ b/docs/kit-2026/consumer.md
@@ -14,7 +14,7 @@ node examples/run-consumer-check.mjs
The runner builds both packages, packs them, and installs the tarballs into three independent temporary npm dependency trees. No workspace alias can hide a missing published file.
- The Vite consumer imports no kit CSS manually and renders Button, Switch, TextField, Select, Dialog, Popover and SegmentedControl.
-- The SSR consumer compiles the same components with Solid's server compiler.
+- The SSR consumer compiles the same components with the Solid 2 Vite plugin.
- The CSS-only consumer installs only styles and renders a native button with JavaScript disabled. No Solid package or browser script is required.
The browser checks component markers, rendering errors, the Button fill against the current theme token, and a plain CSS brand override. The CSS-only check also loads composed FieldLabel and SwitchLabel classes, and Button and IconButton classes, in forward, reverse and duplicate stylesheet orders.
@@ -25,11 +25,11 @@ Add `--keep` to retain the installed fixtures and production builds. The runner
## Server portals and hydration
-The command checks that Dialog and Popover bodies exist in server HTML. It also writes a server-rendered page with Solid's hydration script and the browser build. The browser check delays module loading to capture the server nodes, then starts hydration. The same two nodes must survive, appear exactly once and move outside the app container into their portal targets. Browser errors fail this check.
+The command checks that Dialog and Popover bodies exist in server HTML. It also writes a server-rendered page with Solid's hydration script and the browser build. The browser check delays module loading to capture the server nodes, then starts hydration. The same two nodes must survive, appear exactly once, and move into their portal targets. Escape must close the nested popover and return focus to its trigger. A second Escape must close the dialog. Browser errors and hydration mismatch warnings fail the check.
-Open or force-mounted Dialog, Popover, Sheet and CommandMenu portals render inline at their declaration on the server. Hydration adopts the server subtree before the native Solid Portal moves it. Closed content stays absent unless force-mounted. Place these portals in a valid flow-content context. The native client-only path still handles portals opened after hydration.
+Open or force-mounted Dialog, Popover, Sheet and CommandMenu portals render inline at their declaration on the server. Hydration adopts the server nodes and moves them into the portal target. Closed content stays absent unless force-mounted. Place these portals in a valid flow-content context. The native client-only path still handles portals opened after hydration.
-Focused SSR and hydration tests cover open and closed states, defaultOpen, forceMount, nested portals, typed input preservation, delegated events, synchronous autofocus, target changes, close/reopen, Escape, focus return and disposal.
+Focused SSR and hydration tests cover open and closed states, defaultOpen, forceMount, nested portals, typed input preservation, delegated events, autofocus, target changes, close/reopen, Escape, focus return and disposal.
## Check production CSS selection
diff --git a/examples/check-hydration.mjs b/examples/check-hydration.mjs
index 9db381ff..d29598a1 100644
--- a/examples/check-hydration.mjs
+++ b/examples/check-hydration.mjs
@@ -1,8 +1,12 @@
+import assert from "node:assert/strict";
+
export async function checkHydration(page, url) {
const errors = [];
page.on("pageerror", error => errors.push(error.message));
page.on("console", message => {
- if (message.type() === "error") errors.push(message.text());
+ const text = message.text();
+ if (message.type() === "error" || /hydration key miss|hydration.*mismatch/i.test(text))
+ errors.push(text);
});
let release;
const scripts = new Promise(resolve => {
@@ -17,6 +21,7 @@ export async function checkHydration(page, url) {
waitUntil: "commit",
});
await page.locator('[data-cui="dialog-panel"]').waitFor();
+ await page.locator('[data-cui="popover-content"]').waitFor();
await page.evaluate(() => {
window.__KIT_SERVER_NODES__ = [
...document.querySelectorAll(
@@ -42,5 +47,19 @@ export async function checkHydration(page, url) {
)
);
});
+ const dialog = page.getByRole("dialog", { name: "Consumer dialog" });
+ const popover = page.getByRole("dialog", { name: "Consumer popover" });
+ const trigger = dialog.getByRole("button", { name: "Consumer popover trigger" });
+ await popover.getByRole("button", { name: "Popover body" }).press("Escape");
+ await popover.waitFor({ state: "detached", timeout: 5000 });
+ assert.equal(await dialog.isVisible(), true, "Escape closes only the nested popover");
+ await page.waitForFunction(
+ button => document.activeElement === button,
+ await trigger.elementHandle({ timeout: 5000 }),
+ { timeout: 5000 },
+ );
+ await trigger.press("Escape");
+ await dialog.waitFor({ state: "detached", timeout: 5000 });
+
return { adoption, errors };
}
diff --git a/examples/consumer-ssr/App.jsx b/examples/consumer-ssr/App.jsx
index d3a72ec6..5282b51b 100644
--- a/examples/consumer-ssr/App.jsx
+++ b/examples/consumer-ssr/App.jsx
@@ -19,13 +19,15 @@ export default function App() {
-