Astryx 0.4.2 — all @astryxdesign/* packages ship at this version.
npx astryx upgrade --apply@astryxdesign/core
New Features
-
AvatarGroup: expose
sizeon theavatar-group-overflowtheming target so themes can style the "+N" overflow chip per size (matchingavatar-fallback); the default chip font is unchanged (#5046). -
Chat: ChatMessageBubble accepts a
widthprop (numbers are pixels, strings pass through, e.g.width="100%"), following the sizing convention on Card and other containers. When set it replaces the bubble's defaultmax(80%, 280px)width cap; when unset nothing changes. Combined withvariant="ghost", custom in-message content (an artifact card, attachment chips, a standalone ChatMessageMetadata) can now align with the bubble's text column at the full message-column width — previously the only workaround was hardcoding the bubble's private padding token at every call site. (#2574) -
astryx theme templatewrites an annotated theme template into your project (#5048).
New sibling oftheme add: whereaddstarts you from a theme we ship,templatestarts you from a blank annotated one.astryx init --features themecalls the same leaf, so project setup writes it too — it previously printed a one-line hint and wrote nothing, which is the weakest form of the help a theme author needs, since the first problem is not knowing the command but not knowing what the theme surface contains. The file istheme.template.ts: everydefineThemefield with a note on when to reach for it, the token families, the component override syntax, and the consumption steps (providing the theme, loading the fonts you name, building for SSR), each section naming the CLI command that prints its authoritative reference. An existing file is never clobbered.This came out of a vibe test (#5047): agents given an annotated template reached twice as far into the theme surface as agents given only the docs (17 component targets vs 8, and the only arm to use interaction states, custom variants and
onDark), and shipped a third of the contrast defects.A template that lies is worse than no template, so its claims are machine-checked against live sources rather than trusted:
scripts/check-theme-template.test.mjsfails when adefineThemefield is added and left undocumented, when a token family is missing from the inventory, when a CSS variable or component key it names does not exist, when it cites a docs topic that does not, or when a theme source drops its SYNC reference.theme buildcompiles it warning-free in CI, and the CLI typecheck now covers it.
Fixes
-
Avatar: put the avatar box on the element that carries the
astryx-avatartheme target, so a theme rule on the documentedsizeaxis resizes the whole avatar instead of growing the wrapper around a fixed-size circle; treat a whitespace-onlynameoraltas absent, so it falls through to the default icon rather than rendering an empty plate behind a blank accessible name; warn through the shareduseDevWarninghook rather than a bareconsole.warnin the render body; and replace the phantom<OnlineIndicator />in the JSDoc example with the realAvatarStatusDot(#5030) -
CommandPaletteFooter: wire default keyboard-hint strings through useTranslator so they resolve from the locale catalog instead of being hardcoded English (#4506)
-
context-menucomponent overrides now drive the menu's internal radius and padding vars.ContextMenu.doc.mjshas always documentedderivedentries mappingborderRadius→--_dropdown-menu-radiusandpadding→--_dropdown-menu-padding, butderivedVarRegistryhad nocontext-menukey, so the mapping was dead:components: {'context-menu': {base: {borderRadius: '12px'}}}emittedborder-radiusalone and the menu kept reading its ownvar(--_dropdown-menu-radius). The registry entry now matches the doc, as it already does fordropdown-menu(#4783). -
useFocusTrap: a modal surface with no tabbable controls keeps its programmatic focus target instead of letting Tab escape into the page behind it. A dialog that places initial focus on atabIndex={-1}heading or panel had nowhere to advance to, so Tab walked straight out of the trap.@astryxdesign/core/hooksalso exportshasActiveFocusTrapEscapeandisImeKeyEvent, which coordinate nested traps and skip IME composition keys (#5023). -
Heading's
typeis a documented theming target, and the docs stop teaching a CSS variable that does not exist (#5016).
Headingreflectstypeas a theme selector —typography.scalegeneratesheading: {'type:display-1' …}rules for it — buttheming.targetslisted onlylevelandcolor, soastryx theme buildwarnedUnknown prop "type" on component "heading"on every theme that sets a type scale, including the shippedneutralTheme. The drift guard missed it twice over: it read a conditional spread ({level, color, ...(type && {type})}) as an unknown bag, and it only checked a component against a doc file in its own directory, soHeading/— documented fromText/Text.doc.mjs— was never checked at all. Both are fixed, which brings three more previously unchecked directories under the guard.Separately, the theme docs' component-override example set
--button-press-scale, which no component defines: copying it produces CSS that silently never applies. It now sets a real public var, and the example no longer declares the samebuttonkey twice. -
DateTimeInput: the focused-and-empty time placeholder hints ("e.g., 2:30 PM" / "e.g., 14:30") now route through the i18n translator so they localize with the rest of the component. Adds
@astryx.dateTimeInput.timeHint12hand@astryx.dateTimeInput.timeHint24hto theencatalog. The live-region "Invalid date" / "Invalid time" announcements this PR also covered landed first in #4363 and now reuse that PR's@astryx.dateInput.invalidDateand@astryx.timeInput.invalidTimekeys. (#4546) -
Floating layers now declare their own body type instead of inheriting it. The layer container already set
font-family; it now setsfont-sizeandline-heightfrom--text-body-size/--text-body-leadingalongside it. A layer is hosted wherever its trigger sits, so any content that did not set its own size took the ambient one — the same Tooltip, Popover or HoverCard rendered at 13px from a caption and at 20px from a lede. Content that goes throughText, or sets a size itself (Tooltip's label, DropdownMenu items, NavMenu headings), is unaffected: those already declared their own and still win. Anything that was relying on inheriting a non-body size now renders at the body size and should set one explicitly (#5064). -
Added a
@astryx.listInput.*catalog namespace topackages/core/locales/en.jsonso the labListInputcomponent's action labels, empty state, reorder instructions, and live announcements can be translated.ListInputpreviously hardcoded every visible and assistive-technology-facing string (#4967). -
Layer: use an inert
<template>marker to find each context layer's actual JSX position. Safe positions stay inline; positions inside a paragraph, link, button, inline formatting, or a structurally restricted container portal to the nearest safe ancestor. Corrective portals keep CSS custom properties inheriting from that nearby host while preserving direction and writing mode, andshow()passes the trigger as the popover's invokersource. The newlazyMountoption waits until opening to resolve and mount content; HoverCard uses it so rich content never enters an invalid paragraph during initial render and unmounts again when hidden. Other context layers keep their existing closed-content behavior (#5039). -
Two guards left failing on
mainby their own landings, so every PR since has been red through no fault of its own. #4963 gave Thumbnail's remove button a coarse-pointer hit-area var and did not document it, which the derived-var guard reads as an undocumented private var; the var is aninseton a::afteroverlay, so it is documented as private and listed alongside the other vars no standard CSS property maps onto. #5026 movedborderDefaultsintoCoreTokenName— the landing the theme-template guard was explicitly waiting for (its comment says "when #5017 lands, this guard starts requiring the template to cover it") — so the template's token inventory now names--border-width. -
Menus that open on hover no longer close when you click them. A hover-opened menu is already open under the cursor by the time the pointer arrives, so the click that naturally follows was dismissing it — fixed for TopNavMegaMenu in #4555, and now shared: the hover→click guard lives in
useMenuHover, so TopNavMenu, TopNavHeading, SideNavHeading and DropdownMenuSubMenu get it too, and TopNavMegaMenu runs on the shared machine instead of its own copy. Also from the consolidation: opening a menu moves focus into it synchronously rather than a frame later, closing one returns focus to its trigger instead of dropping it to the document, and keyboard activation always opens rather than toggling an open menu shut (#3121) -
SideNav: a hardening pass over the family, driven by the component audit. Accessibility, theming, passthrough and code-health defects across
SideNavItem,SideNavHeading,SideNavSection,SideNavCollapseButtonand thenavItemStylesmodule the TopNav drawer modes share — the motion guards, the untranslated flyout name, the hand-rolled visually-hidden block, the dropped...rest, the missing theming state, the uncleaned timers, and the hand-rolled hover intent, which is now the shareduseMenuHover. Nav rows also adopt the shared focus outline from #4654, so a keyboard-focused row is ringed with the system's2px --color-accentat3pxoffset in every theme instead of falling through to the browser's own ring; in a split-action row the link and the chevron toggle are ringed individually, since they are separate tab stops.
Three visual fixes came out of review. The collapsed submenu flyout was painting a second, square-cornered surface inside the popover's rounded one, and insetting its own content by 4px instead of standing off the rail — both gone, with the gap moved to the positioned layer whereDropdownMenukeeps it. The selected row now survivesforced-colors: active: it marked the current page with a 6% background tint, which forced colors flatten away entirely, and it now paintsHighlight/HighlightTextlikeToggleButtonandSegmentedControlItem. And the footer icon row comes out one size, with the collapse chevron centred rather than seated 2.42px high on a stray text baseline.Four changes are visible to a consumer. Hover on a collapsed item's flyout is now gated on
(hover: hover)and only closes onmouseleaveif hover opened it, and a click-to-dismiss no longer springs back open under a stationary pointer. The footer icon rows cascade asmsize throughSizeContext, so an unsizedButtonpassed tofooterIconsnow matches the built-in collapse button instead of rendering a size larger — pass an explicitsizeto opt out.SideNavCollapseButtontakes asize, for placements outside the nav that have no row to inherit from. AndSideNavCollapseButtontakes the controlledcollapsibleconfig — the same{isCollapsed, onCollapsedChange}object handed to SideNav — which is how a button rendered outside the sidenav now stays in step with it.handleRefon both components is deprecated in its favour: the state the consumer already owns reaches the button through props, with no imperative handle in between. -
Slider: the thumb no longer overhangs the component's own box at
minandmax. It was centred on the container edge at either extreme, leaving half of it (10px) outside the control, where a tight container clipped it or it overlapped the next element. Thumb travel is now inset by half a thumb at each end — the geometry a nativeinput[type=range]uses — and the fill, the marks and the pointer-to-value mapping share that inset, so the thumb also stays under the pointer that grabbed it instead of jumping by up to half its width. Vertical sliders and both thumbs of a range slider are fixed the same way (#5051). -
Interactive controls meet the WCAG 2.5.8 AA 24px minimum on touch. The Slider track (20px tall, and clickable along its whole length) floors its block size to 24px, Thumbnail's remove button grows its tappable area through a
::afteroverlay, andsmCheckboxInput, RadioListItem and Switch floor to a 24px target centred on the control. All of it is gated on@media (pointer: coarse), and only the invisible tappable area changes — rails, thumbs and glyphs stay exactly where they were, and fine-pointer rendering is untouched (#4963, #4964).
Documentation
- Ten private (
--_*) component theming vars are now documented in their owning component'stheming.vars[]:--_avatar-group-overlap,--_card-elevation,--_card-ring,--_codeblock-gutter-width,--_item-label-color,--_item-description-color,--_tab-indicator-bottom,--_tree-indent(plus--_dropdown-menu-radius/--_dropdown-menu-padding, which Breadcrumbs sets on a child menu). They were declared in source and described nowhere, because the drift guard skipped the--_prefix outright (#4783).
@astryxdesign/cli
New Features
-
astryx theme buildwarns when a theme names fonts it does not load. The resolved--font-family-*tokens and component-overridefontFamilyvalues are checked against CSS generics and known system families; anything else gets one warning per family in the receipt and, after the install instructions, the<link>/@font-facesnippet to add.astryx docs typographygains a Loading Custom Fonts section (Google Fonts and self-hosted recipes,font-display: swap, real fallback stacks), and the theme docs' production-build section points at it (#5015). -
astryx theme templatewrites an annotated theme template into your project (#5048).
New sibling oftheme add: whereaddstarts you from a theme we ship,templatestarts you from a blank annotated one.astryx init --features themecalls the same leaf, so project setup writes it too — it previously printed a one-line hint and wrote nothing, which is the weakest form of the help a theme author needs, since the first problem is not knowing the command but not knowing what the theme surface contains. The file istheme.template.ts: everydefineThemefield with a note on when to reach for it, the token families, the component override syntax, and the consumption steps (providing the theme, loading the fonts you name, building for SSR), each section naming the CLI command that prints its authoritative reference. An existing file is never clobbered.This came out of a vibe test (#5047): agents given an annotated template reached twice as far into the theme surface as agents given only the docs (17 component targets vs 8, and the only arm to use interaction states, custom variants and
onDark), and shipped a third of the contrast defects.A template that lies is worse than no template, so its claims are machine-checked against live sources rather than trusted:
scripts/check-theme-template.test.mjsfails when adefineThemefield is added and left undocumented, when a token family is missing from the inventory, when a CSS variable or component key it names does not exist, when it cites a docs topic that does not, or when a theme source drops its SYNC reference.theme buildcompiles it warning-free in CI, and the CLI typecheck now covers it.
Fixes
-
Heading's
typeis a documented theming target, and the docs stop teaching a CSS variable that does not exist (#5016).
Headingreflectstypeas a theme selector —typography.scalegeneratesheading: {'type:display-1' …}rules for it — buttheming.targetslisted onlylevelandcolor, soastryx theme buildwarnedUnknown prop "type" on component "heading"on every theme that sets a type scale, including the shippedneutralTheme. The drift guard missed it twice over: it read a conditional spread ({level, color, ...(type && {type})}) as an unknown bag, and it only checked a component against a doc file in its own directory, soHeading/— documented fromText/Text.doc.mjs— was never checked at all. Both are fixed, which brings three more previously unchecked directories under the guard.Separately, the theme docs' component-override example set
--button-press-scale, which no component defines: copying it produces CSS that silently never applies. It now sets a real public var, and the example no longer declares the samebuttonkey twice. -
Two guards left failing on
mainby their own landings, so every PR since has been red through no fault of its own. #4963 gave Thumbnail's remove button a coarse-pointer hit-area var and did not document it, which the derived-var guard reads as an undocumented private var; the var is aninseton a::afteroverlay, so it is documented as private and listed alongside the other vars no standard CSS property maps onto. #5026 movedborderDefaultsintoCoreTokenName— the landing the theme-template guard was explicitly waiting for (its comment says "when #5017 lands, this guard starts requiring the template to cover it") — so the template's token inventory now names--border-width.
Documentation
- MobileNavToggle preview simulates a mobile AppShell instead of an empty stage: new playground.appShellMobile for components that render nothing without AppShell mobile context (#4983)
@astryxdesign/theme-butter
Fixes
--radius-noneno longer overrides to0.125rem.--radius-noneand--radius-fullare documented as always fixed (never scaled by a theme), matching@astryxdesign/core's own defaults — each of these themes' radius group bumps swept--radius-nonealong with it by mistake, the same bug fixed fortheme-neutralin #4856. Anything opting out of rounding via--radius-noneunder these themes now renders with a true0pxradius again, instead of a silent 2px.
@astryxdesign/theme-chocolate
Fixes
--radius-noneno longer overrides to0.125rem.--radius-noneand--radius-fullare documented as always fixed (never scaled by a theme), matching@astryxdesign/core's own defaults — each of these themes' radius group bumps swept--radius-nonealong with it by mistake, the same bug fixed fortheme-neutralin #4856. Anything opting out of rounding via--radius-noneunder these themes now renders with a true0pxradius again, instead of a silent 2px.
@astryxdesign/theme-gothic
Fixes
--radius-noneno longer overrides to0.125rem.--radius-noneand--radius-fullare documented as always fixed (never scaled by a theme), matching@astryxdesign/core's own defaults — each of these themes' radius group bumps swept--radius-nonealong with it by mistake, the same bug fixed fortheme-neutralin #4856. Anything opting out of rounding via--radius-noneunder these themes now renders with a true0pxradius again, instead of a silent 2px.
@astryxdesign/theme-stone
Fixes
--radius-noneno longer overrides to0.125rem.--radius-noneand--radius-fullare documented as always fixed (never scaled by a theme), matching@astryxdesign/core's own defaults — each of these themes' radius group bumps swept--radius-nonealong with it by mistake, the same bug fixed fortheme-neutralin #4856. Anything opting out of rounding via--radius-noneunder these themes now renders with a true0pxradius again, instead of a silent 2px.
Contributors
Thanks to everyone who contributed to this release:
@AKnassa @cixzhang @freddymeta @HelloOjasMutreja @imdreamrunner @is-jain @jiunshinn @rubyycheung
Full Changelog: v0.4.1...v0.4.2