# @mielui/svelte 0.5.0 LLM changelog

Context for coding agents upgrading or composing against this release. The human changelog is the short bullet list; this page covers only changes that need migration or composition detail.

# Mielui 0.5.0 notes for coding agents

## One border per frame, strips in written order

Frames no longer have a double-border mode or a movable strip position. Stop
setting `chrome.borders` in themes. The type no longer accepts it, and the parser
ignores it in saved JSON. Stop setting `--mielui-inset-position`,
`--mielui-border-inset-scale`, or `--mielui-modal-inset`. Nothing reads them.

An inset surface (`.mielui-inset-surface`, `.mielui-card-surface`) now fills its
frame with no gutter. Its corner radius is `--mielui-plate-radius` minus
`--border-size`. Compute inner radii the same way in new frames. Do not add a
gutter or an inner ring.

Strips render in the order you write them. Card, Dialog, Sheet, and Toast footers
still render below the inset, because the component places the footer there. In
composed Code Block, File Diff, and Composer markup, put a header first to show it
on top, or after the content to show it below. The high-level Code Block (`code`
or `tabs` props) puts its header on top.

## New default brand color

`DEFAULT_THEME.brand` and the `--color-primary` default in `ui.css` are now
`#e5808a`. Primary labels still use `--color-on-primary` (dark ink); do not put
white text on the default accent. Anything that compared against the old
`#ba7ca5` literal, such as a snapshot or a hand-written theme that meant "the
default", needs the new value or should read `DEFAULT_THEME.brand`.

## New default neutral: moss

`neutralTemperatures` now ends with `'moss'`, and `DEFAULT_THEME.neutral` is
`'moss'`. The `--mielui-neutral-*` defaults in `ui.css` match its ramp: the light
stage is `#f3f2ec` and the dark stage is `#10120f`, with a darker `#0b0d0a`
plate. Code that iterates `neutralTemperatures` gets a fourth entry. A theme that
meant "the default grey" must set `neutral: 'true'` explicitly. Do not pin page
backgrounds to grey literals such as `#f6f6f6` or `#1a1a1a`; read
`--color-background` so the default and any Studio theme both apply.

## Components run on ui-sdk

Every interactive primitive now comes from `@ui-sdk/svelte` and `@ui-sdk/core`, pinned to `0.1.0-beta.24`. Do not add `bits-ui`, `vaul-svelte`, `@floating-ui/dom`, or `@internationalized/date` back, and do not import from them in new components. When a project installs Mielui components with the CLI, it needs both ui-sdk packages at that exact version, because `ui.css` imports `@ui-sdk/core/layer.css`. A newer beta can change behavior, so do not loosen the pin.

Read `node_modules/@ui-sdk/svelte/docs/llms.txt` before building a new component, and copy the pattern in `components/popover`: a Mielui part renders the ui-sdk part and passes its markup through a `render` snippet onto a Mielui element such as `Button`, spreading `props` onto it. Never render a second focusable element next to the one ui-sdk gives you props for.

### Styling hooks

Style state with ui-sdk's attributes: `data-open` and `data-closed` for disclosures and popups, `data-selected` for tabs and options, `data-checked` for radios, switches and menu checkbox items (the native `Checkbox` keeps `data-state="checked"` on its box), `data-pressed` for toggles, `data-highlighted` for the active menu or list item, and `data-disabled`. In Tailwind that is `data-open:`, `group-data-open:`, and so on. `data-state="open"`, `data-[state=active]` and the other Bits values match nothing now, and nothing fails when you write them, so search for them when you port code. `data-state` is still used for Mielui's own states (`error`, `streaming`, `loading` and similar on AI components, tables and charts); leave those alone.

### Popups and modals

Popups (Popover, menus, Select, Combobox, Tooltip, Hover Card, date picker panels) and modals (Dialog, Alert Dialog, Sheet, Drawer, Command) render where you write them and go into the browser's top layer with the popover API or `showModal`. They are not moved to `<body>`. Three consequences:

- Events from inside a popup bubble to its ancestors. A popup inside a clickable row or card fires the row's handler unless you stop propagation, or render the popup outside the row.
- A `<form>` inside a Dialog that sits inside another form is nested HTML. Move the dialog outside the outer form.
- Popup content is a sibling of its trigger. Closed Select, Combobox and Tooltip content stays mounted, hidden, and an open popup carries `popover`. A parent's `:last-child`, `space-y-*`, `divide-*` or `& > *` rule matches it, so a hand-made joined-control wrapper loses its trailing edge. Skip `[popover]` and `[data-ui$=-content]` in those selectors, as `Group` does.

ui-sdk owns focus, dismissal, inert, and scroll lock. Do not add `inert`, focus traps, `clickOutside`, or body scroll locks around a ui-sdk overlay; the old helpers are gone from `@mielui/svelte/utils`. To cancel a close, handle `onOpenChange` and call `details.cancel()` for the reasons you want to block (Dialog's `allowEscape` and `allowClickOutside` do this for you). Anything outside a modal that must stay usable while it is open, like a toast host, needs ui-sdk's `bindPersistentLayer`; in Mielui use the internal `persistentLayer` attachment, as Toaster and Notch do.

Overlay motion is CSS. Put the shared class on the panel (`mielui-popup` with `mielui-motion-panel`, or `mielui-motion-modal`, `mielui-motion-scrim`, `mielui-motion-sheet`) and let ui-sdk add `data-starting-style` and `data-ending-style`. Do not wrap a ui-sdk panel in a Svelte `transition:`; `panelMotion`, `dialogIn`, `dialogOut`, `overlayIn`, `overlayOut`, `sheetIn`, and `sheetOut` were removed for that reason. A panel reopened during its exit restarts its entrance; that is expected.

### Menus

`DropdownMenu.Item` and `ContextMenu.Item` run `callback` when chosen by pointer or keyboard. ui-sdk activates items on Enter and Space without a click event, so an item that only has `onclick` does nothing from the keyboard. This type-checks and fails silently. Move the work to `callback`.

### Tooltip

`Tooltip.Trigger` is the button, so do not put a `Button` inside it. To show a tooltip on a control that is already a trigger (a Dropdown Menu or Popover trigger), use `Tooltip.Trigger`'s `render` snippet and spread its `props` onto that trigger, or onto the trigger's own `render`. Inside a `Tooltip.Provider` one bubble is shared, timing comes from the Provider's `delay` and `closeDelay`, a one-word label that changes under the same trigger rolls, and moving to another trigger swaps the label at once; ui-sdk names only the trigger that opened the shared bubble, so an icon-only trigger inside a Provider must carry its own `aria-label`. A Root with `showOnClick` always gets its own tooltip.

### Toolbar

A Toolbar and `Composer.Toolbar` move focus with the arrow keys only between toolbar parts: `Toolbar.Button`, `Toolbar.Link`, `Toolbar.Item`, group items, `Composer.Submit`, and `Attachment.Trigger`. A plain `<button>` or `Button` child is skipped by the arrow keys and becomes its own Tab stop. To put a Select or Dropdown Menu trigger in a toolbar, render it through `Toolbar.Button`:

```svelte
<Toolbar.Button>
    {#snippet render({ props })}
        <DropdownMenu.Trigger {...props}>Insert</DropdownMenu.Trigger>
    {/snippet}
</Toolbar.Button>
```

Mark a selected button with `aria-pressed="true"` and a current link with `aria-current="page"`; `data-state="on"` no longer does anything.

### Dates

Date values are ISO strings: `'2026-09-17'` for one date and `['2026-09-17', '2026-09-19']` for a range, or `null`. A range value changes only once both ends are set. There are no times, so code that passed `CalendarDateTime` or read `.hour` must drop it. Build values with string helpers or `@ui-sdk/core`'s ISO helpers, not `@internationalized/date`. Disallow days with `unavailable` matchers, and veto a change in `onValueChange` with `details.cancel()`; `validate` and `onInvalid` are gone. The renamed props are listed in the breaking notes, and the old names are rejected by TypeScript, so follow the compiler.

### Behavior that changed without a type error

Accordion headers no longer handle arrow keys. Enter on a Switch submits its form. An open Popover no longer locks scroll areas inside the page. With the input appearance, Combobox leaves the page interactive so its clear button keeps working. Select moves real focus to its first option when opened by pointer. Command's Escape clears the search before it closes. Command and Combobox results keep their written order and mark the best match with `data-highlighted`, so read the highlighted result instead of assuming the first one is the best match. `Combobox.Root` no longer takes `hoverable`, `delay`, or `closeDelay`. Select's trigger text comes from ui-sdk: an item without `label` shows its own text, aria-hidden decoration left out, so drop any `data-select-label` markers. Style a Tabs marker through `[data-ui="tabs-indicator"]` and its `--active-tab-left/top/width/height` variables, and hide it while it lacks `data-visible`. A named range Slider submits one `start/end` string, so a server that read two values with `getAll(name)` must split it on `/`. OTP Field's bound `element` is now the root `<div>`, so focus or read the code through `value` and the field's own input, and pass `pattern` as `digits`, `letters`, `alphanumeric`, or a per-character RegExp, never Bits UI's whole-code regex strings. Tests or flows that depended on the old behavior need updating, not workarounds.

### Variant classes merge through `cn`

Component `variants.ts` files import `tv` from `tailwind-variants/lite`, and `tailwind-merge` is no longer installed with components. A `tv` result is a plain class string with no conflict resolution, so wrap every call in `cn(...)` and pass the consumer's `class` to `cn`, not to the variant function: `cn(className, button({ variant, size }))`. Do not add `tailwind-merge` back or import the full `tailwind-variants` entry when editing an installed component; `cn` already resolves conflicts.

### Highlight languages load on demand

Code Block and File Diff register JavaScript, TypeScript, Svelte, HTML, CSS, JSON, and shell at once. Every other language (Python, SQL, Go, YAML, and the rest) lives in a separate chunk. The browser loads it on first use, and `highlight()` returns escaped plain text until it arrives. The server starts loading it as soon as the highlighter module loads, so server-rendered pages include the colors. The components call `highlight()` inside `$derived`, so they recolor on their own. Code that calls `highlight()` outside a reactive context gets plain text for those languages on the first call. Call it from `$derived` instead of caching the first result. Do not register the extra languages up front again to work around the plain-text first render.

### Attachments replace actions

Morph, Number Shuffle, and Shimmer, plus the `pressable`, `travelingHighlight`, `dynamicWidth`, and `visualViewportBounds` helpers from `@mielui/svelte/utils`, are Svelte attachments. They live at `@mielui/svelte/attachments/morph`, `@mielui/svelte/attachments/number-shuffle`, and `@mielui/svelte/attachments/shimmer`. The `@mielui/svelte/actions/*` paths are gone, with no alias, so change the import path as well as the call. A leftover `use:numberShuffle={{ value }}` no longer type-checks; write `{@attach numberShuffle({ value })}` with the same object, and do not wrap these in `fromAction`. Svelte recreates an attachment when a value inside its argument changes. Number Shuffle and Morph remember what each element last showed, so a plain object is enough and the roll still starts from the previous value. `travelingHighlight` and `dynamicWidth` must be called even without options. There is no `enabled` flag: attach conditionally with `{@attach condition && dynamicWidth()}`.

### Trigger ids, Button events, and spread order

ui-sdk assigns the `id` of every popup trigger (Dialog, Alert Dialog, Sheet, Drawer, Popover, Dropdown Menu, Tooltip), so those trigger types no longer accept `id`. To point at a trigger, use a `data-*` attribute or `bind:element`. Select and Combobox triggers still take `id` so a `<label for>` can name them.

Button's `onclick` is `MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>`, and `onkeydown` is the keyboard equivalent. Leave the parameter of a handler passed to Button unannotated instead of typing it as `MouseEvent` and forwarding it. A part that always renders a `<button>` keeps `onclick` in its rest props, builds `const attributes = $derived(buttonAttributes(rest))`, spreads `attributes`, and calls `attributes.onclick?.(event)` before its own default action. Never cast the event.

Put `{...rest}` first on an element, so the component's `data-ui`, state attributes, and ARIA state win. Button is the exception: its rest props stay last so wrapper parts can set their own `data-ui`. When a consumer should be able to replace a default ARIA value, read it from `rest` with a fallback, as Response Stream does with `aria-live`.

### Command and Context Menu details

`Command.Group` puts `class` and rest props on the group element, not the heading. Code that styled the heading through Group's `class` still type-checks but now styles the whole group, so target the heading from the group, for example `[&_.mielui-menu-label]:…`. `Command.Item`'s `value` is not an identifier: it replaces `name` as the text the search matches, so do not set it to an id. For Context Menu's `CheckboxItem`, bind `checked` or leave it unset; a one-way `checked={x}` resets to `x` when the menu opens again.
