Repository navigation
@codeatlasdev/ui@3.0.0
Major Changes
-
a1d14f5: Sober default theme, Liquid Glass is now opt-in (#111). The package used to look like a UI-kit demo: a glass material over a three-hue mesh, glow on selected states, a white rim on every surface, hue-tinted 24-40px shadows, 10px controls, 2px icons and 700 headings. The default is now solid and neutral:
defaultStyle: "solid",paper: "plain",radius: 0.8(--ca-radius-mdis 8px),iconStroke: 1.75, heading weight 600 (and no extra h1 tracking).- Surfaces, text and outlines carry almost no chroma (the brand hue stays on fills, focus, links and charts); shadows are neutral black (
--ca-shadow-*,--ca-glass-shadow,--ca-mat-*-shadow). [data-style="solid"]and[data-style="flat"]set--ca-glow-primary(-strong)and--ca-glass-rimto transparent and draw--ca-mat-edgeas a hairline, so.glass-tinted,.glass-prominent,.glass-glow,.glass-active,.glass-btn-prominentand the AppShell nav pills lose their halo and rim without a component change. The page mesh (--ca-page-mesh) is drawn only byglassandfrosted.- New recipe
designStyle("liquid")reproduces the former look exactly (glass, mesh, glow, round corners, bold headings, tinted shadows).designStyle("default")now means the sober default.
Migration: to keep the old look, use
designStyle("liquid", { ...yourTheme }), or setdefaultStyle: "glass",paper: "mesh",radius: 1,iconStroke: 2andtypography: { weights: { heading: 700 } }.colorScheme.setStyle("glass")still switches at runtime. Apps that override--ca-*tokens are unaffected; apps that read--ca-radius-*or the shadow tokens get the new values.defineTheme()with no options now resolves the new defaults (designTokensemits nothing for them).
Minor Changes
-
8b36a1e: AppShellLayout: the shell keeps its state across page loads (#109). On an MPA (Astro, a full reload) every navigation is a new document, and the panel, the selected module, the expanded sections and the panel scroll all reset.
persistPanel(defaulttrue) now keeps the panel open/closed, the selected module and the section open map inlocalStorage["ca-shell"](the oldca-panel-openkey is migrated), and the panel scroll per module insessionStorage. An inline script emitted right after the sidebar restores them before the first paint and setsdata-ca-panel/data-ca-moduleon<html>, so a stored-closed panel is laid out closed with no flash, on the same model as the theme script. Stored values are validated and discarded when malformed. The user's last choice for a section wins overdefaultOpen; the section holding the current page always opens. The shell now starts at its target width instead of animating open on load.persistPanel={false}keeps the old always-default behavior for demos and embeds. -
3476d9a: Brand assets from one mark.
caBrandPluginandgenerateBrand(@codeatlasdev/ui/vite) render a content-hashed favicon (SVG that followsprefers-color-scheme, ICO, PNG),apple-touch-icon, 192/512/maskable manifest icons and a web app manifest from one SVG with{{ink}}/{{spark}}placeholders and your theme;resolveBrandandrenderMarkexpose the resolved sRGB colors.iconLinksandogCard(@codeatlasdev/ui/seo) emit the head links and the 1200x630 social-card HTML forrenderOgImage.<Seo>now also writesog:image:typeandtwitter:image.@resvg/resvg-jsandpng-to-icoare optional peer dependencies. -
1eeca1c: Surface engine and layout primitives (#112).
New components:
Box,Flex,Stack,Grid,Container,Section(layout),Surface,CardandSurfacePanel.- Layout primitives take token props (
gap,p/px/py,align,justify,direction,columns,wrap) and a polymorphicas. A prop renders as adata-*attribute (data-gap="4"), a responsive object ({ base: "2", md: "4" }) asdata-md-gap="4", styled bystyles/layout.cssin@layer ca.utilities. No inlinestyle. Surfacehas orthogonal axes:elevation0-5,materialauto | solid | frosted | glass | liquid,tone,variantfilled | outlined | ghost,radius,interactive,glow,as. One.ca-surfacerule reads--ca-surface-*variables.material="auto"follows<html data-style>; the explicit materials look the same under every style. It never setswill-changeorisolation, and it hasforced-colorsand reduced-transparency entries.Card(title,headingLevel,href,flush,full,headerActions) is built onSurface;SurfacePanelis a raised<section>(the AppShell sidebarPanelkeeps its name).- Docs: Surface, Card, Layout primitives;
docs/css-api.mdlists the newca-*classes and the data attributes.
Behavior changes to review in
Stack,GridandRow(they were the only layout components with inlinestyle):StackandGridgapis now a spacing step string (gap="4"is 16px), not pixels.align/justifyusestart | center | end | between | ...instead of raw CSS values.Gridcolsis nowcolumns(1-12, or a responsive object);rowGap,colGapand CSS template strings ("2fr 1fr",repeat(auto-fill, ...)) are gone: writegrid-template-columnsin a class.Rowis deprecated in favor ofFlex. It still renders.ca-rowand maps a pixelgapto the matching step.GlassCardandGlassSurfaceare deprecated in favor ofCardandSurface, and removed in the next major. They render the new components, keep theirca-glass-card*andglass*classes and look the same under everydata-style, and log a[ca-ui]warning in development.
Size:
styles/core.cssgrows from 9.6 to 13.0 kB gzip (limit 9.6 to 13.6 kB),global.cssfrom 12.6 to 15.9 kB:layout.cssis ~2.2 kB (every token prop and step at the base and four breakpoints, generated byscripts/build-layout.ts) andsurface.css~1.2 kB (the five materials by six elevations). JS entries are unchanged.Migration:
bunx @codeatlasdev/ui migrate --write srcrewritesGlassCardtoCard material="glass"(thicknesstoelevation,tintedtotone="brand",glowingtoglow, staticpaddingtop),GlassSurfacetoSurface(refractiontomaterial="liquid"),RowtoFlex, andStack/Gridpixel gaps,colsandalign/justifyvalues. Dynamic or off-scale usages are left as they are, with their import, for you to finish. - Layout primitives take token props (
-
49b2bf4: Unified layer engine. Dialog, AlertDialog, Sheet, Drawer, Lightbox, CommandPalette, DocsSearch, DropdownMenu, Popover, Tooltip, Select, Combobox, NotificationBell and the date pickers now share one layer stack (
primitives/layer.ts).- Modals are native
<dialog>+showModal(); menus, popovers and tooltips arepopoverelements. Both live in the top layer, so stacking no longer depends onz-index: a menu inside a dialog is always on top. The--ca-z-dropdownand--ca-z-tooltiptokens remain for your own in-flow UI but are no longer used by overlays. - Anchored layers use CSS anchor positioning when supported and Floating UI otherwise.
- One Escape / outside-press / focus stack: only the topmost layer reacts, so nested overlays dismiss in order. Focus returns to the trigger on close.
- New
onLayerChange(listener)(and alayerchangeCustomEventondocument) fires on every layer open and close with the open layers and their rectangles, so hosts can park or snapshot native views. - The
.ca-floatingwrapperdivis gone:.ca-floatingis now on the layer element itself (the one carryingdata-state/data-side), and.ca-date__floatwas removed.
- Modals are native
Install
bun add @codeatlasdev/ui@3.0.0Special thanks
To our main supporters and special contributors, Fábio Henrique Araújo (@FabioHAraujo) and Richardson Douglas (@Richards0nd). 💛