Repository navigation
@codeatlasdev/ui@4.4.0
Minor Changes
-
1c6653e:
NavItemin the AppShell panel getscolor(a decorative dot),leading(a snippet that replaces the icon),count(a neutral total, announced as a bare number instead of "N unread",1.2kabove 999) andactions(a snippet ofDropdownMenuItems behind a "…" button named "Actions for ") (#275).NavSection.onReorderandNavModule.onReordermake the rows reorderable with theuseDndprimitive: a grip per row, mouse, touch press-and-hold and keyboard, with announcements; the shell reports{ id, from, to }(newNavReorderEventtype) and never reordersitemsitself.PanelNavItemnow renders a row that contains the<a class="ca-nav-item__link">(a link cannot hold the actions button or the grip), so.ca-nav-itemis the row, not the anchor. New messagesappShell.itemActionsandappShell.moveItem. -
1c6653e:
AppShellLayouttakespanelWidth(px, held between 160 and 480, default 200) andresizablePanel(#292). The content offset and the open and close animation follow the width, so a panel for long labels no longer misaligns the page.resizablePaneladds a keyboard-operable drag handle on the panel's trailing edge (Arrow keys 8px, Shift 32px, Home and End for the bounds); withpersistPanelthe chosen width is stored inca-shelland restored by the inline script before the first paint. NewappShell.resizePanelmessage and.ca-panel__resizeclass. -
ca80cfd:
Combobox:multipleturns it into a searchable multi-select (valueisstring[],aria-multiselectablelistbox, list stays open, removable chips,Backspaceon an empty query removes the last chip) andcreatableworks in both modes.CommandPalette:search(query, signal)adds debounced (searchDebounce), abortable server-side results with loading, empty and failed states announced throughannounce(), plusonSelectand the exportedCommandResulttype. -
49116d1:
DataTablegains row groups, column resize, row reorder and safer interactive cells (#283).groupByrenders one<tbody>per key with a collapsible header (aria-expanded,groupLabelto customize).meta.resizableon a column adds a window-splitter handle (mouse, touch, keyboard arrows, Shift, Home, End, Enter) driven bysize,minSizeandmaxSize; the newDataTableColumnResizeis exported for hand-built headers.onReorderadds a drag grip per row on top of the newuseDndprimitive, moves rows between groups and reports{ id, from, to }(DataTableReorderEvent);rowIdgives rows stable ids andpageSizesets the page size in simple mode. A click on a link, button, input or other control inside a cell no longer firesonRowClick(adddata-no-row-clickto opt other elements out). The new labels (Reorder, Move, Resize) follow the active locale (en, pt-BR). Needs the drag and drop primitive from #284. -
d138bd8: New drag and drop primitive,
useDnd(),applyMoveand<DndLayer>, for sortable lists, moves between lists and drop zones (#284). It works with mouse and pen (4px threshold), touch (press and hold, so the page still scrolls) and keyboard (Space lifts, arrows move, Home/End jump, Enter drops, Escape cancels), speaks every step throughannounce()(English and Portuguese built in,useDnd({ messages })for others), auto-scrolls near the edges of a scrolling container and drops its animations underprefers-reduced-motion. The engine measures the boxes once per drag and only moves a clone, a drop line anddata-dnd-*attributes, so the list does not re-render untilonDrop.<DndLayer {dnd} />renders the keyboard instructions and the forced-colors aware styles (.ca-dnd-overlay,.ca-dnd-indicator), so apps that never drag add no bytes tocore.cssor to the i18n catalog. -
946d69d:
Drawercan be named without its default title: passaria-label,aria-labelledby(your own header) orhideTitle, andid,data-*and other attributes now reach the<dialog>(#285).AlertDialoggainsconfirmPropsandcancelProps(attributes for the two buttons) andcancelVariant(#287), plus achildrenbody, adescriptionthat accepts a snippet andconfirmDisabledfor type-to-confirm (#278). -
e983caa:
DropdownMenuis controllable and can open at a point.bind:openandonOpenChangeread and set the open state;anchor={{ x, y }}opens the menu at a viewport point (a right-click menu, notriggerneeded) and changing it while open moves the menu instead of toggling it. A menu opened from code starts on its first item and returns focus to the element that had it. On the built-in trigger Shift+F10 and the ContextMenu key open the menu like ArrowDown. -
e983caa:
DropdownMenugains selection items.DropdownMenuCheckboxItem(role="menuitemcheckbox",bind:checked,onCheckedChange) andDropdownMenuRadioGroup+DropdownMenuRadioItem(role="menuitemradio",bind:value,onValueChange) renderaria-checkedand a check indicator, stay open after a pick (closeOnSelectcloses), and join arrow, Home, End and typeahead navigation (the menu now also recognizesmenuitemradio). -
e983caa:
DropdownMenugains submenus.DropdownMenuSubtakes atriggersnippet holding aDropdownMenuSubTriggeritem (aria-haspopup="menu",aria-expanded, chevron) and the submenu items as children; they nest to any depth. ArrowRight, Enter or Space opens the submenu on its first item, ArrowLeft or Escape closes only that level, hovering the trigger opens it after a short intent delay and the pointer can cross into it. Selecting an item closes every level. A popover layer that is closing no longer owns Escape or outside presses, so a closing submenu hands them to its parent. -
ff460ad: Form controls forward native attributes and expose their element, with one vocabulary (
ref,hideLabel, rest props on the native element):Checkbox,TextField,TextAreaandFileUploadspread every other attribute and handler (data-*,maxlength,inputmode,onclick,onkeydown,name,capture...) on the native<input>/<textarea>, and take a bindablerefwith that element.Checkboxonchangenow receives the native event as a second argument, and its forwardedonclickmakes Shift range selection possible.TextField/TextAreagainonfocusandhideLabel(label kept for screen readers with.ca-sr-only;aria-labelalso works without a label).Selectacceptsaria-labelandaria-labelledbyfor a compact select without a visible label. The trigger is named by that text followed by the current value (visible text stays in the name); without either, the placeholder names it as before.FileUploadgainsref, anopen()instance method for a button outside the dropzone, andlist={false}: a plain picker whoseonchangereceives only the files just picked, with no built-in list and nothing kept infiles(the native input is cleared, so the same file can be picked again).
-
8c24c31: Theme option
motion: { enter: "none" }(token--ca-enter-scale: 0) turns off entrance and exit animations only:Dialog,AlertDialog,Drawer,Sheet,Lightbox,CommandPalette,DocsSearch, date pickers,DropdownMenu,Popover,TooltipandToastappear and leave in place, while hover and focus color transitions keep--ca-duration-*. New derived tokens--ca-enter-fast,--ca-enter-baseand--ca-enter-slow;MotionStagedemos render their final state when the theme turns entrances off, as underprefers-reduced-motion(#268). -
16f89dd:
Popoveris controllable.bind:openandonOpenChangeread and set the open state, and thechildrensnippet receivesclose, which closes the popover and returns focus to the trigger, so a choice made inside it (aCalendarday, an option) can dismiss it. Existing popovers are unchanged. -
8c24c31: New
--ca-radius-roundtoken (999px × --ca-radius-scale): "fully rounded at the current scale".SwatchGroupswatches, the AppShell active pips (.ca-nav-item__pip,.ca-rail__pip) and the new-item dot, and.ca-nav-item__badgeuse it, so a theme withradius: 0squares them with no app CSS (#267).--ca-radius-chipnow aliases it.--ca-radius-pillstays a fixed 999px for functional shapes (Switch, Slider, Progress, scrollbars) and forcontrolRadius: "pill". -
946d69d:
Tabsgainsvariant="line"(bare text tabs with an underline on the active one, for page headers), andTabsListandTabsTriggerforward rest attributes:aria-labelnames the tablist,data-*,idand event handlers reach the trigger button (#286). ATabsTriggernow pointsaria-controlsat its panel only while aTabsContentwith the samevalueis mounted, so tabs used as view switchers no longer reference missing elements. -
2ab0d93:
ToggleGroupgetsrequired: pressing the active item no longer clears the selection (radio-like,onchangestays silent;type="multiple"keeps its last pressed item). An empty group still selects on the first press. Closes the gap withSegmentedControlfor filters that must look like contiguous buttons.
Patch Changes
- 05cfbfc:
AppShellLayout: an item atpath: "/"is active on/only, no longer on every page, and a module atbasePath: "/"only gets the pages no other module claims. Module prefixes (basePath,pathPrefixes) match whole path segments and the longest one wins, whatever the module order (/settingsfoono longer matches/settings). - 98d2ace: Astro: the theme now survives
<ClientRouter />(View Transitions) navigations.caUIregisters anastro:before-swaphandler that carries#ca-theme,#ca-runtime-tokens, thetheme-colormeta and the theme attributes onto the incoming document (#265).codeatlas-ui initon Astro also addssvelte()from@astrojs/sveltetointegrations, and notesnpx astro add sveltewhen the dependency is missing (#273). - 3ae1f41:
Buttonwithhrefnow types the anchor's own attributes:download,rel,hreflang,ping,referrerpolicyandtype(the linked resource's MIME type) are accepted instead of rejected, as...restwas already spread on the<a>. The props are a union keyed onhref: a link takes anchor attributes, a button takes button attributes (form,formaction,name,value...), and<Button download>withouthrefis a type error. At run time atypepassed withhrefreaches the<a>, and a callerrelis kept and merged withnoopener noreferrerwhentarget="_blank"(it used to be overwritten). - 5c9ac81: CommandPalette: new
shortcutprop (defaulttrue). With two palettes on one page, every instance opened on Mod+K; setshortcut={false}on all but one, or when the app binds its own shortcut. - a61874b: Calendar, RangeCalendar, DatePicker and DateRangePicker: fast arrow-key sequences no longer lose keys. The roving focus now moves synchronously instead of after
tick(), so the next key always starts from the day it lands on, with or without Svelte'sexperimental.async. - e983caa:
DropdownMenuItemforwards its remaining attributes (data-*,id,aria-*,title, ...) to themenuitemelement.data-testidandaria-keyshortcutsused to be dropped.role,tabindexand the selection handler stay owned by the item. - ff8686f:
DropdownMenuItemandTabsTriggericon slots now size anysvgorimginside the 14px box, not only a direct child. ASchemeAssetlogo (its variants sit indisplay: contentsspans) used to collapse to 0×0 when the svg had nowidth/height, and an svg with a fixedwidth="24"overflowed the box; both now fill the box. - d01c039:
LoadingBoundarycountsminDurationfrom the moment the placeholder reaches the DOM instead of from the state change that schedules it, so a busy main thread no longer shortens the time the placeholder is visible. - 23276cf: Fix Escape going to the wrong layer. A Dialog, AlertDialog, Drawer, Sheet, Lightbox, CommandPalette or DocsSearch that is playing its exit animation no longer takes Escape or presses: they reach the layer below, so closing a confirm dialog and pressing Escape right after closes the Drawer under it (#288). A menu or popover that was open when a modal opened now ranks above that modal, so Escape closes the menu first and the dialog second instead of closing the dialog and leaving the menu open (#299). Exit animations of components that use
createPresence(Dialog, Drawer, AlertDialog, menus, popovers) now keep the node mounted through the exit instead of removing it in the flush that closes it, and a menu hosted in a dialog is no longer left stranded after its exit. - 05cfbfc:
Rail: the dock magnification scales the module icon (the glyph), not the whole button, so the hovered background no longer covers the active neighbour's background and pip. The effect follows--ca-motion-scale: it is off withmotion: { scale: 0 }and underprefers-reduced-motion. - 05cfbfc: Native
button,input,selectandtextareainherit the page font (font: inheritin the newca.resetlayer,styles/reset.css) instead of the browser's UA font. The AppShell section header (.ca-section__trigger/.ca-section__label) and any control without its own font rule now render in--ca-font-sans. Component and app rules still win: the layer is the first one. - 8c24c31:
Skeletonand theskeletonprop follow the theme surface style: underflat,solidandoutlinedno gradient band is drawn, the placeholder is a flat block that pulses its opacity (ca-skeleton-pulse, stopped under reduced motion). Glass, frosted, neumorphic, clay, chrome and tonal keep the shimmer sweep (#280).
Install
bun add @codeatlasdev/ui@4.4.0Special thanks
To our main supporters and special contributors, Fábio Henrique Araújo (@FabioHAraujo) and Richardson Douglas (@Richards0nd). 💛