Skip to content

Releases

@zazz-ui/core 0.15.0

Choose a tag to compare

@dereknelsen dereknelsen released this 18 Nov 22:26

base

  • BREAKING With data-ui-navigation="swap", Back and Forward swap only between entries the swap made. An entry the page pushed with history.pushState() (htmx's hx-push-url and hx-boost, a client router) is left to the page, going into it and coming out of it, and so is any entry a script gave history.state (htmx stamps the first entry it swaps on with { htmx: true }). Swapping those raced the library's own restore. A page that pushes URLs without restoring them on popstate must now restore them itself.
  • data-ui-navigation="off" on an ancestor of a link or form leaves its navigation to the browser (a full load, unless another library handles the click first). The nearest data-ui-navigation ancestor decides, so swap inside an opted-out region opts back in. It needs NavigateEvent.sourceElement; without it the attribute has no effect.
  • New Zazz.refresh(element), also window.Zazz and a named export of the entry module: runs the refresh hooks (reveal, attribute-form carousels, select-all checkboxes, sticky states, the drawer page indent) over markup another library inserted, the element itself included. With no argument it refreshes the whole body. For htmx: htmx.onLoad((el) => Zazz.refresh(el)).
  • The swap remembers its history entries in sessionStorage (zazz:navigation-entries), so Back and Forward between swapped pages still swap after a reload.

Install: npm install @zazz-ui/core@0.15.0, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.

@zazz-ui/core 0.14.3

Choose a tag to compare

@dereknelsen dereknelsen released this 18 Nov 15:33

base

  • findHeadBlock and the head-block comparison in head.ts (behind the language server's head-block fixes and the CLI) no longer use regexes that CodeQL flags as polynomial on long whitespace runs. Results are unchanged.

Install: npm install @zazz-ui/core@0.14.3, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.

@zazz-ui/core 0.14.2

Choose a tag to compare

@dereknelsen dereknelsen released this 17 Nov 17:27

drawer

  • A drawer removed from the page while open lets go of the page. With data-ui-navigation="swap", following a link inside an open drawer replaces the body without closing it, and the drawer kept holding the page at its old scroll position: the next page could not be scrolled, and jittered on iOS, until a reload. The drawer now unbinds as soon as it is gone.

Install: npm install @zazz-ui/core@0.14.2, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.

@zazz-ui/core 0.14.1

Choose a tag to compare

@dereknelsen dereknelsen released this 16 Nov 20:37

base

  • data-ui-navigation="swap" brings the destination page's stylesheets along. A <link rel="stylesheet"> or <style> in its <head> that the current page lacks is added before the swap, and the swap waits for new links to load (up to three seconds). Per-page CSS, such as a framework's scoped component styles, used to be missing after in-page navigation until a reload. Stylesheets are never removed, so keep page-specific CSS scoped to that page's markup.

Install: npm install @zazz-ui/core@0.14.1, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.

@zazz-ui/core 0.14.0

Choose a tag to compare

@dereknelsen dereknelsen released this 16 Nov 19:44

base

  • Letter spacing has one global knob. --tracking-modifier (default 0em) shifts every --tracking-* token by that length; --tracking-heading-modifier (display, h1–h6) and --tracking-body-modifier (2xl–2xs, eyebrow) default to it and override just their group. Give each a length with a unit.
  • New base/gesture.ts, the drag tracking behind toast swipes and the drawer: trackDrag follows one pointer on a locked axis and reports its offset and velocity, and shouldDismiss, pickSnap, rubberBand, and flickDuration decide and time the release. It ships with the primitives that use it, not in the core runtime. data-ui-no-drag on any element keeps a press inside it from starting a drag.
  • Line height has the same kind of knob. --leading-heading-multiplier and --leading-body-multiplier (default 1) scale every --leading-* token in their group.
  • body applies every --font-*-body role token (feature settings, kerning, optical sizing, the font-variant-* group, variation settings, weight), so setting one on :root reaches all body text.

carousel

  • BREAKING The carousel no longer uses Embla. It is a native scroll-snap container: touch, trackpad, and wheel scroll it on the compositor, and it scrolls without JavaScript. The script (base/carousel.js and base/carousel-scroll.js, on base/gesture.js) adds mouse drag, loop, controls, thumbs, autoplay, auto-scroll, and state. Remove the four embla-carousel* entries from a hand-written import map; signal-polyfill is the only one left. See ADR-0019.
  • BREAKING window.EmblaInit is now window.Carousel (init, initRoot). The API on a root moved from _emblaApi to _carousel, also returned by <ui-carousel>.api: goTo(index, instant?), goToNext(), goToPrev(), selectedSnap(), snapList(), play(), stop(), isPlaying(). Listen for zazz:carousel-select (detail.index) on the root in place of Embla's select event.
  • BREAKING Supported options: data-carousel-loop, -align, -axis, -draggable, -drag-free, -skip-snaps, -start-snap, -keyboard, and the autoplay and auto-scroll plugins with their delay, speed, start-delay, direction, play-on-init, stop-on-interaction, stop-on-mouse-enter, and stop-on-last-snap options. Other Embla options are ignored, among them slides-to-scroll, contain-scroll, duration, breakpoints, active, and watch-*. The class-names plugin is gone: style the snapped and in-view state tokens.
  • BREAKING --ui-carousel-touch-action and the data-ui-dragging flag on :root are removed. The pointer is captured during a mouse drag, so the grabbing cursor comes from the viewport's dragging state alone. Slides no longer force transition: none.
  • Right to left needs no option: the track follows the inherited dir (drop data-carousel-direction). data-carousel-axis="y" now lays the track out vertically by itself; give the viewport a height. data-carousel-thumbs-axis="y" does the same for a thumb strip.
  • The arrow keys follow the track: Left and Right mirror in RTL, and Up and Down step a vertical carousel.
  • Autoplay and auto-scroll pause while the carousel is off screen or the tab is hidden. Auto-scroll does not start on its own under prefers-reduced-motion: reduce. A root that is playing carries the playing state token.
  • New hooks: --ui-carousel-snap-align, --ui-carousel-settle-duration, --ui-carousel-settle-ease.
  • A slide that only touches the viewport's edge is no longer marked in-view.
  • The viewport hides its scrollbar, scrolls smoothly unless prefers-reduced-motion: reduce is set, and sets user-select: none while it can be dragged.

drawer

  • New primitive: a bottom sheet on the native <dialog> that is dragged down, or flicked, to dismiss. data-ui="drawer" is a drawer on every device, with data-drawer-slot="handle | content | header | body | footer | close". data-ui="dialog drawer" is a dialog that becomes a drawer below the sm band on a touch screen and keeps its dialog slots. Scrolling content scrolls before the drawer moves, and the backdrop fades with the drag. Hooks: --ui-drawer-*.
  • Snap points: data-drawer-snap="12rem 0.5 1" gives a drawer resting heights (a share of its height, or a px/rem length). It opens at the first, settles on the nearest, and a flick moves one stop; data-drawer-snap-sequential stops a fast flick from skipping. The handle steps through them on click, zazz:drawer-snap reports each change, data-drawer-state carries expanded or partial, and snapDrawer(dialog, index) moves it from script.
  • Stacked drawers: a drawer opened over another scales the one behind back and lifts it, and that one follows the front drawer's drag. Hooks: --ui-drawer-stack-scale, --ui-drawer-stack-lift, --ui-drawer-nested-backdrop-color.
  • Page indent: wrap the page in <ui-drawer-indent> (or data-ui="drawer-indent") and it scales back behind an open drawer with rounded top corners, following the last drawer's drag. Only scale and translate animate. Hooks: --ui-drawer-indent-inset, -offset, -radius, -bg, -backing. While indented, position: fixed elements inside the wrapper move with the page.
  • The software keyboard: on a phone the keyboard covers the bottom of the screen without shrinking the layout a drawer is placed against. While a field in the front drawer has the keyboard up, the drawer's content ends at the keyboard's top edge (its surface runs on underneath, so no page shows below it), the focused field scrolls into the part still visible, and the page behind holds its scroll position. Nothing to author.

toaster

  • Toasts swipe to dismiss, with a finger or the mouse: toward the edge they entered from, or sideways toward the nearest inline edge (either way when centered). A swipe of 45px or a quick flick dismisses; less returns the toast to rest. Timers pause during a swipe.
  • Toast text is no longer selectable (user-select: none), so a mouse drag swipes the toast and does not start a selection.
  • The toaster now loads base/gesture.js. zazz-ui update vendors it; a hand-written page that lists scripts one by one needs it too.

dialog

  • translate and scale join the <dialog> transition list, so a dialog moved with them (the drawer's drag, a drawer stacked behind another) eases back.
  • The phone size (--ui-dialog-mobile-size) skips a dialog that is also a drawer.
  • --ui-dialog-transition-delay--end defaults to 0ms (was 150ms), so a dialog starts closing as soon as it is dismissed.

radio

  • The checked dot is centered exactly. It used to sit up to a pixel off at fractional sizes, because its own box and mask tile snapped to the pixel grid separately from the circle. The dot is now a radial-gradient drawn over the whole circle, at the same size as before.
  • BREAKING --ui-radio-dot-mask now covers the circle's whole padding box, not a --ui-radio-dot-size box. Migration: give a custom mask its own position and size, e.g. url(star.svg) center / 50% no-repeat.
  • --ui-radio-border-color--checked defaults to --ui-field-border-color--hover (was --color-primary), and --ui-radio-dot-size follows --ui-radio-size (calc(var(--ui-radio-size) * 0.85)).

fields

  • BREAKING --ui-field-inset-child-radius is now --ui-field-inset-radius. It is computed from the field it sits in (--ui-field-radius minus --ui-field-inset-p and the border width) instead of --radius-sm, so inset parts stay concentric at any radius. Migration: rename the hook.
  • BREAKING --ui-field-addon-p is now --ui-field-inset-p, and its default drops from var(--spacing) to calc(var(--spacing) * 0.85). Input groups, password groups, the date picker button, and the tabs track all read it. Migration: rename the hook.

input-group

  • Addons, the password toggle, and the calendar picker button use --ui-field-inset-p and --ui-field-inset-radius.

password-group

  • The toggle uses --ui-field-inset-p and --ui-field-inset-radius.

input

  • --ui-input-calendar-picker-radius defaults to --ui-field-inset-radius.

tabs

  • The track takes the field family's metrics: --ui-tabs-track-p is --ui-field-inset-p, --ui-tabs-track-gap is --ui-field-gap, --ui-tabs-gap is --ui-field-option-gap, and the track and indicator borders read --ui-field-border-*. The indicator radius is the track radius minus the track padding, and --ui-tabs-indicator-inset defaults to half the track padding, so the indicator sits just inside the checked label.

switch

  • The thumb has a border in the field colors (it was transparent), and the checked track's border uses the field border colors instead of the track fill.

slider

  • The thumb is filled with --color-primary (was --color-card), with a --ui-field-border-color border.

button

  • --ui-button-background-clip defaults to border-box (was padding-box), so a translucent border sits over the fill instead of the page.

tooltip

  • The tooltip is outlined instead of shadowed: new --ui-tooltip-border-width (1px) and --ui-tooltip-border-style (solid), --ui-tooltip-border-color defaults to --color-background, and --ui-tooltip-shadow to none. Border utilities on the content apply to the arrow too.
  • The arrow is hidden by default. Set --ui-tooltip-display: block to show it. It is square with only its tip rounded (--ui-tooltip-arrow-radius, default 0), it continues the content's border, and it points the right way in RTL.
  • The text uses the mono family (--ui-tooltip-font-family), and the new --ui-tooltip-font-settings hook sets its variation settings.

Install: npm install @zazz-ui/core@0.14.0, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.

zazz-ui CLI 0.3.3

Choose a tag to compare

@dereknelsen dereknelsen released this 16 Nov 21:10
  • An exact version (update @0.14.1, diff @0.14.1, init 0.14.1) resolves right after it is published. The CLI reads an exact version from npm's cache, and when the cached version list predated the release, it reported "No matching version found" until something like @latest refreshed the list. A cache miss now asks the registry once. --offline still never goes online.
  • The README lists @zazz-ui/core 0.1 through 0.14 as supported.

Run with npx zazz-ui@0.3.3 (or pnpm dlx zazz-ui@0.3.3). Full history in packages/cli/CHANGELOG.md.

@zazz-ui/core 0.13.1

Choose a tag to compare

@dereknelsen dereknelsen released this 14 Nov 18:24

input

  • A full-width date, time, datetime-local, month, or week input no longer overflows its container in iOS Safari. The iOS correction for WebKit's sizing bug subtracted the field's padding and border but not the extra inline padding a touch screen adds to reach the touch-target height.

Install: npm install @zazz-ui/core@0.13.1, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.

@zazz-ui/core 0.13.0

Choose a tag to compare

@dereknelsen dereknelsen released this 13 Nov 21:29

base

  • BREAKING Tiers with no use are gone, which takes about 10 KB off the built CSS (1 KB gzipped). The editor and <ui-debug> report each one as a tier the utility does not take. Migrate as follows:
    • --isolation, --font-family, and --font-style take no breakpoints. Set the base value.
    • --border-style takes no breakpoints. A border that changes with width changes its width: --border--md: 0 or --border-width--md.
    • --container-name takes no breakpoints. Name the container at the base and switch it on with --container-type--md, or put the name in the shorthand (--container--md: panel / inline-size).
    • --shadow-angle takes no states. --shadow--hover or --elevation--hover changes one element's shadow; --shadow-angle--md still works.
    • No --starting tier where it had no practical use: on --transition, --transition-duration, --transition-delay, --animation, --anchor-name, --position-anchor, --position-area, --text-wrap, --text-decoration, --border-style, --mix-blend, and --z. Delete the declaration.
  • BREAKING --grid-cols: subgrid and --grid-rows: subgrid are gone: subgrid is a display. --display: subgrid takes both axes' tracks from the parent grid, --display: subgrid-col the columns, and --display: subgrid-row the rows; each takes breakpoints, and the axis it does not take keeps its own --grid-cols or --grid-rows. Across breakpoints the highest tier that names a display or a count decides. Migrate --display: grid; --grid-cols: subgrid to --display: subgrid-col, both axes to --display: subgrid, and a tier (--grid-cols--md: subgrid) to --display--md: subgrid-col; the editor and vp run lint:html suggest the rewrite. --template-cols: subgrid and --template-rows: subgrid work as before.
  • --display: grid-gallery is a grid that picks its column count from its child count: as many as fit in a row, up to six, each at least --ui-gallery-min-w wide (20ch by default), skipping a count that would leave one child alone in the last row. It takes breakpoints (--display: flex-col; --display--md: grid-gallery).

carousel

  • BREAKING The carousel runs on Embla v9 (9.0.0-rc04, pinned in the import map with new SRI hashes; update a hand-written import map to match). Core options pass straight through, so rename any v8 option attribute: the startIndex option is data-carousel-start-snap, -watch-drag → -draggable, -watch-resize → -resize, -watch-slides → -slide-changes, -watch-focus → -focus. data-carousel-start-index stays the kit's own dialog attribute (don't set it by hand). data-carousel-drag-free="snap" and data-carousel-in-view-margin are new. On Autoplay, data-carousel-autoplay-jump is now -instant; on Class Names, data-carousel-class-names-dragging is now -pointer-down. Code that calls _emblaApi / <ui-carousel>.api uses the v9 names: goTo, goToNext, goToPrev, canGoToNext, canGoToPrev, selectedSnap, snapList, and lowercase events (reinit, pointerdown, slidesinview); init is gone.
  • Autoplay and Auto Scroll keep the kit's documented behavior, which the kit now implements itself because Embla v9 dropped the options. They play on init, and a drag or slide focus stops them. With data-carousel-autoplay-stop-on-interaction="false" (or -auto-scroll-), a drag or focus holds them and they resume after. -play-on-init="false" still leaves the plugin stopped. -stop-on-mouse-enter and -stop-on-focus-in are gone. A playing plugin keeps playing after a resize or breakpoint change, which re-creates it; on its own, v9 would leave it stopped. One change from v8: once an interaction has stopped a plugin, a resize no longer restarts it.

tabs

  • data-tabs-variant="underline" draws tabs without a track: the indicator is a 2px line under the checked label, or at its start edge with data-tabs-orientation="vertical", and the labels use --font-size-md. --ui-tabs-underline-width and --ui-tabs-underline-color set the line.
  • Tabs nested in a panel no longer hide the outer tabs' panels. The panel rules matched any tab list inside the root; they now match only the root's own list.

toggle

  • A disabled toggle with a variant keeps that variant's color, at 60% opacity as on the button. Every disabled toggle used to take the muted surface at 50%; now only the default one does.
  • The primary, secondary, and tertiary variants hover and press with the button's lightness steps. They used to fade the fill to 90% and 80% alpha. muted fades toward the surface beneath, and ghost deepens its hover fill on press.
  • The checked border is --color-border (was --color-primary), and the fill paints under it: --ui-toggle-background-clip defaults to border-box, and --bg-clip overrides it per element.
  • A <kbd> in a toggle takes the compact key size, and one at either end of the content (a kbd group too) tightens that side's padding, as on the button.
  • data-toggle-size="sm" uses --font-size-xs, and the cursor is default to match the button.

utilities

  • New example fragments for the display keywords: gallery, subgrid, subgrid-col, subgrid-row, flex-reverse, and inline-flex.

debug

  • --grid-cols: subgrid and --grid-rows: subgrid are reported under not-integer, with a suggestion that folds the keyword into the element's --display.
  • The tier-unsupported warning names the utility, where it named the family: "--z--md uses a tier --z does not take".

Install: npm install @zazz-ui/core@0.13.0, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.

@zazz-ui/core 0.12.3

Choose a tag to compare

@dereknelsen dereknelsen released this 12 Nov 22:28

slider

  • The track fill moves again in Chromium and Safari. In 0.12.2's built dist/zazz.css the minifier folded the fill's named timeline into the animation shorthand, which browsers reject, so the fill stayed at the start. Only the built file was affected (CDN links and the package's style entry); @zazz-ui/core/index.css imports and zazz-ui vendored copies use the source and were fine.

switch

  • The thumb takes a border: --ui-switch-thumb-border-width and --ui-switch-thumb-border-style default to the field's, and --ui-switch-thumb-border-color, --ui-switch-thumb-border-color--hover, --ui-switch-thumb-border-color--checked, and --ui-switch-thumb-border-color--checked-hover default to transparent.
  • The track is one border width taller, so the gap around the thumb is the same on every side, on and off. The thumb casts --shadow-xs (was --shadow-sm).

Install: npm install @zazz-ui/core@0.12.3, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.

@zazz-ui/core 0.12.2

Choose a tag to compare

@dereknelsen dereknelsen released this 12 Nov 18:48

base

  • --color-input in dark mode is the solid --color-neutral-950, where it was the --color-tint-100 overlay.
  • A padding tier written without its base (--px--md: 4 with no --px) no longer applies to a slider, so it can't override the inline padding the slider's fill depends on.

fields

  • A field's hover border mixes 10% of --color-foreground into the border, where it mixed --color-primary.

slider

  • The track takes the field look: --ui-slider-track-bg, --ui-slider-track-border-width, and --ui-slider-track-border-color default to the matching --ui-field-* hooks, where they were --color-muted with a 1px muted border. The thumb is --color-card (was --color-background).
  • The track fills from the start to the thumb in --color-primary. Set the color with --ui-slider-fill-bg, and fill from the thumb to the end instead with --ui-slider-fill-side: end.
  • In Chromium and Safari, the fill needs the input to clip its overflow. A slider used with a mouse is now about 30px tall, and its track ends sit 3px in from each side to leave room for the focus ring. A thumb shadow larger than the default gets clipped, and padding utilities on the slider move the fill off the thumb.
  • Right-to-left sliders have no fill in Chromium or Safari, because the two engines disagree on which way it should run. Firefox fills them.

tabs

  • The indicator is --color-muted with no shadow (--ui-tabs-indicator-bg, --ui-tabs-indicator-shadow), where it was --color-card with --shadow-xs.
  • The track is tighter: --ui-tabs-track-p and --ui-tabs-track-gap are 0.35 * --spacing (were 0.5), and --ui-tabs-gap, between the tab list and the panels, is 0 (was --space-xs).

tooltip

  • An opening tooltip no longer flashes far from its trigger in Chromium when the page or a container around it is scrolled. Chromium misplaces one of the first two frames, so the opening fade now starts 34ms late and that frame is transparent. Closing is unchanged. A custom --ui-tooltip-transition gets the delay on its first entry.

Install: npm install @zazz-ui/core@0.12.2, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.