Repository navigation
@codeatlasdev/ui@1.0.0
·
328 commits
to main
since this release
Major Changes
-
ef015e6: 1.0.0: stable API. From here on, breaking changes to props, exports,
--ca-*tokens or the publicca-*classes (seedocs/css-api.md) only land in a major.Breaking
- Default UI strings are English and come from a typed catalog (
en,pt-BR). Portuguese apps callsetLocale("pt-BR")once in the root layout; the wording is the same as before. Text props (label,placeholder,confirmLabel,emptyText, …) no longer have hardcoded defaults: omit them to use the catalog, pass them to override. ThemeOptionsis nowPartial<ThemeDefinition>(defineTheme).BrandPresetis removed: usePresetDefinition({ id, color, label? }).brandPresetCSSoutput changed (theme islands) and the head style id isca-theme(wasca-brand-presets).- CSS is layered:
global.cssdeclares@layer ca.reset, ca.tokens, ca.themes, ca.base, ca.components, ca.materials, ca.utilities. App CSS stays unlayered and wins without!important; override a token by declaring--ca-*on:root. - Page background:
htmlpaints a solid--ca-surface-baseand the decorative mesh moved tobody::before(Safari 26 and the overscroll area sample the root color).bodyis transparent. MobileHeaderandBottomNavare opaque (--ca-chrome-surface) so the browser status bar and toolbar match them.autofocuson touch devices only focuses when the keyboard was primed in the opening tap (primeKeyboard()); pass{ touch: true }to force. This removes the iOS "focus without keyboard" jump.responsiveisundefined-width untilinit()runs (no hydration mismatch); derived values treat it as desktop.- The
.ca-app-scoped 16px input rule and the.ca-input-ios-safeclass are gone: every text field is covered globally.
Theme engine
defineTheme()+themeCSS(): typed theme object compiled once to deterministic CSS: brand presets from one hex, fonts, radius multiplier, density, raw token overrides.- Built-in presets are generated from
theme/builtins.ts(bun run --cwd packages/ui themes;validatefails ifstyles/themes/*.cssis stale). - The init script validates stored preset/scheme/style against what the app knows (an old
ca-presetno longer repaints the app in amber), appliesdata-stylebefore first paint, sets<meta name="theme-color">, follows the OS undersystembefore hydration and replays runtime tokens. - Theme islands:
data-theme-scope="light" | "dark"anddata-preseton any element, nested in any order. colorScheme.setTokens(vars)writes one<style id="ca-runtime-tokens">, persisted and replayed before paint.colorScheme.init()is idempotent and returns a cleanup; storage errors (Safari private mode) no longer throw.colorScheme.presetslists valid ids.
Mobile and WebKit
- Tokens
--ca-safe-top|right|bottom|left,--ca-vh(dvh with vh fallback),--ca-kb-inset,--ca-input-font-size(-sm),--ca-chrome-surface,--ca-bottom-nav-h. viewportstore (on-screen keyboard inset fromvisualViewport, ignores URL-bar and pinch-zoom changes) and thekeyboardAwareaction.primeKeyboard()/focusTextField()(from@codeatlasdev/ui/actions): open the iOS keyboard from the tap that opens a dialog, sheet or search. Used byDocsSearch,CommandPaletteandCombobox.- Browser chrome color sync:
theme-colorfollows the opaque color under the top edge (header, theme island or page) on Chrome/Samsung Android, Safari ≤ 18 and PWAs. - New components:
StickyActions,MobilePane.Sheetswipe-to-dismiss (swipeToDismiss),AuthLayoutmobileBrand. - 44px touch targets for every
Buttonsize, press feedback on touch, no tap flash, 16px minimum on every text field (no iOS zoom),-webkit-text-size-adjust. - Overlays contain overscroll;
backdrop-filterfalls back to opaque surfaces where unsupported. nativeFeel()(kit): keyboard-only focus rings, no browser context menu or selection on chrome,.ca-selectableopt-in, optional zoom lock for desktop shells;html[data-ca-surface="transparent"]for vibrancy windows.
Integrations
- Astro:
caUI(theme)from@codeatlasdev/ui/astroinjects the theme before first paint and configures SSR. CodeTabsacceptstabsas data (for MDX/Astro where Svelte context cannot reach children);CodeSnippetand code tabs follow the scheme of their context through dual shiki themes.
Fixes
- Glass lost its blur in production builds: Lightning CSS (Vite 8) drops
backdrop-filterdeclared before-webkit-backdrop-filter. Order fixed everywhere and guarded by a test. Dialogbody no longer collapses to zero height in WKWebView (Tauri, Safari).Selectno longer putsaria-requiredon the trigger button; required state goes to the form control and the label.isItemActivehandles trailing slashes (trailingSlash: "always"sites).Tooltipmeets AA contrast in both schemes (--ca-tooltip-bg).- New tokens
--ca-focus-ring,--ca-focus-ring-offset,--ca-selection-bg,--ca-scrollbar-thumb(-hover); reduced motion zeroes--ca-duration-*.
- Default UI strings are English and come from a typed catalog (