# chirp-ui 0.4.0

URL: /chirp-ui/releases/0.4.0/
Section: releases
Description: Release 0.4.0

---

> For a complete page index, fetch /chirp-ui/llms.txt.

## Install

```bash
pip install chirp-ui==0.4.0
# or
uv add chirp-ui==0.4.0
```

With Chirp:

```bash
pip install "bengal-chirp[ui]"
```

## What's New

### Sharp-edges hardening (phases 1--4)

A systematic audit and fix pass across the entire component library:

- **Phase 1** --- Normalized variant/size defaults to empty strings, added `hx={}` dict shorthand to `btn`/`icon_btn`/`form`, filled 53 missing CSS tokens, migrated `overflow: hidden` to `overflow: clip`, wrapped `localStorage` in try/catch, aligned test stubs with real filters (43 parity tests), documented all 195 templates in `COMPONENT-OPTIONS.md`.
- **Phase 2** --- Renamed colliding macros (`segmented_control` to `segmented_control_field`, `tab` to `tab_button`), `bem()` strips invalid modifiers, `contrast_text()` warns on unparseable colors, added `is_strict()`/`reset_colors()` APIs, `--chirpui-z-*`/`--chirpui-anim-*` tokens replacing 114 hardcoded CSS values, `tab_is_active()` guarded against empty href.
- **Phase 3** --- `btn()` defaults to `type="button"`, `build_hx_attrs()` validates against known htmx attrs, `field_errors()` warns and coerces non-list values, pagination uses `<button disabled>` instead of `<span aria-disabled>`, avatar gains `decorative` mode, Alpine `register()` gets idempotency guard, 44 `@provides`/`@consumes` annotations inline.
- **Phase 4** --- Standardized slot naming (`footer` param to slot in card, `actions` canonical), `attrs` to `attrs_unsafe` across 37 macros with deprecation warning, `hx={}` dict in all macro docstrings + `HTMX-PATTERNS.md`, neumorphic CSS from 102 to 44 selectors, `assert_element()` test helper with 29 structural tests, `docs/INDEX.md` navigation index.

### Context-aware theming

`timeline`, `callout`, `status_indicator`, and `settings_row_list` automatically adapt when nested inside `surface()` or `card()` via `--on-<surface>` CSS modifier classes.

### SVG pattern tiles and CSS-only patterns

10 reusable SVG pattern tiles under `templates/patterns/` with `--chirpui-pattern-*` tokens and `.chirpui-texture` overlay utilities. CSS-only gradient patterns: `.chirpui-bg-pattern--*` (dots, grid, diag, crosshatch, weave), `.chirpui-band` pattern variants, full-page `.chirpui-ambient`, and noise/static overlay utilities.

### New composites

- `install_snippet` --- command + copy button
- `filter_row` --- lightweight inline filter form
- `tag_browse` --- tray + badges for tag-filtered listings
- `settings_row` --- label + status badge + detail

### Other improvements

- ComponentDescriptor coverage: 199 total (101 new), with a test gate ensuring every template has a descriptor.
- Migrated 5 composite templates to kida's `{% yield %}` directive.
- Bumped `kida-templates` dependency to `>=0.6.0`.

## Fixes

- Global CSS reset (`box-sizing: border-box`, `body { margin: 0 }`), `vh` to `dvh` on modals/drawers/dropdowns, `:focus-visible` on tabs/accordion/collapse/segmented, neumorphic dark-mode shadows, toast z-index, site-header glass `@supports` guard, scroll-anchor for sticky headers.
- Missing `chirpui-font-medium` CSS utility.
- Muted color-mix tokens now derive from `var(--chirpui-surface)` instead of bare `white`, fixing dark-mode backgrounds.
- Tray overlay `aria-hidden="true"` for pre-Alpine hydration.

## Links

- [PyPI](https://pypi.org/project/chirp-ui/)
- [GitHub](https://github.com/lbliii/chirp-ui)
