# Changelog

All notable changes to the BIMA Design System are recorded here. The system follows [Semantic Versioning](https://semver.org): `MAJOR.MINOR.PATCH`.

- **MAJOR** — a token is removed/renamed or a component's contract changes in a way that breaks existing products. Requires a migration note.
- **MINOR** — new tokens, components, or guidance added; existing behaviour unchanged.
- **PATCH** — fixes to values, docs, or examples that don't change the intended design.

---

## [3.0.0] — 2026-11-12

Brand alignment with bimamilvik.com: typography changes for every consuming product.
Decision record: [docs/decisions/0001](docs/decisions/0001-bimamilvik-brand-alignment.md).

### Migration — what products must do
- **Nothing in markup or class names changes.** Every component keeps its contract.
- **Expect wider text.** Headings move from Inter to **Quicksand**, body text and UI from
  Inter to **Manrope**. Manrope sets slightly wider than Inter at the same size: check
  fixed-width elements (buttons with a set width, table columns, truncated labels).
- **Serve `dist/fonts/` beside `dist/bima.css`.** The fonts are now self-hosted (see below).
  From the npm package or a CDN this happens automatically. If you copy `bima.css` into
  your own build, copy `fonts/` too, or load the faces from Google Fonts.
- **Products that override `--bima-font-*` keep their override.** Workspace already sets
  Quicksand/Manrope and can drop its override.
- **Remove Inter-specific `font-feature-settings`** (`cv02 cv03 cv04 cv11`) from product
  CSS: they have no effect on Manrope.

### Changed — typography
- `--bima-font-family-display`: Inter → **Quicksand** (display, headings h1–h6, card/modal
  titles, KPI values).
- `--bima-font-family-body`: Inter → **Manrope** (body, labels, buttons, tabs, nav, sidebar).
- Line height, from bimamilvik.com: `--bima-leading-snug` 1.4 → **1.375**,
  `--bima-leading-normal` 1.6 → **1.5**, `--bima-leading-relaxed` 1.7 → **1.75**
  (`--bima-leading-tight` stays 1.25).
- Letter spacing, from bimamilvik.com: `--bima-tracking-tight` −0.025em → **−0.02em**,
  `--bima-tracking-normal` −0.01em → **0**, `--bima-tracking-wide` 0.06em → **0.08em**.
- `.bima-initialism` uses `--bima-tracking-wide` instead of a hard-coded `0.06em`.

### Changed — font loading
- **Self-hosted fonts.** Quicksand, Manrope and JetBrains Mono ship as variable WOFF2
  (Latin + Latin Extended) in `fonts/` and `dist/fonts/`, declared with `@font-face` in
  `tokens/variables.css`. The Google Fonts `@import` is removed: no third-party request, works
  under a strict Content-Security-Policy. Licence: SIL OFL 1.1 (`fonts/OFL-*.txt`).
- `package.json` publishes `fonts/` and exports `./fonts/*` and `./tokens/design-tokens.json`.

### Unchanged on purpose
- **Colours.** bimamilvik.com already renders the system's blue `#325CA8`, sky `#97CCE7`,
  navy `#0A2261` and text `#18181C`.
- **Focus ring `#2F7FA8` and strong border `#7F8C9E` in light mode.** bimamilvik.com's sky
  focus ring measures 1.73:1 on white; WCAG 1.4.11 needs 3:1. See the decision record.

### Fixed
- **`tokens/design-tokens.json` was stale** in 15 values (radii, shadows, line heights,
  `duration.slow`, `breakpoint.sm`, display size) and lacked letter spacing. New
  `scripts/tokens-json.mjs` updates it from `variables.css`; `npm run audit` and `npm test`
  now fail when the two drift.
- `package.json` `repository`, `homepage` and `bugs` pointed at the old
  `milvik-bima/bima-ui-framework`; now `milvik/bima-ui` and `https://ui.milvik.io/`.

### Docs
- `foundations/typography.md` rewritten for two typefaces; component specs, pattern notes,
  stack examples (Tailwind, Ant, MUI) and docs pages (download, reboot, tokens) updated.
- New `docs/decisions/` folder for decision records.

---

## [2.4.0] — 2026-10-27

Correctness, accessibility, and build-integrity release. Fixes the issues found
while building the `milvik-ui-ux` skill against `2.3.0`.

### Fixed — build
- **`dist/bima.min.css` no longer drops 340 classes.** The minifier treated
  apostrophes inside CSS comments as string delimiters, deleting the entire
  utilities layer (`bima-d-*`, `bima-p-*`, `bima-gap-*`, `bima-text-*`,
  `bima-bg-*`, `bima-shadow-*`), plus `bima-check`, `bima-radio`, `bima-switch`,
  `bima-range`, `bima-choice`, `bima-input-group__text`,
  `bima-btn-group--vertical` and `bima-select--sm/--lg`. Replaced with a
  comment-aware scanner.
- `npm run audit` now fails if `dist/bima.css` and `dist/bima.min.css` expose
  different class sets, preventing regressions.
- Rebuilt all `dist/` artefacts.

### Fixed — interaction
- **Escape inside a nested picker, select, dropdown, or popover now closes only
  that popup**, not the surrounding modal or offcanvas.
- **Date picker clamps its initial month to `data-min`/`data-max`** and adds
  previous/next-year navigation, so date-of-birth fields no longer open decades
  away and require month-by-month clicking. “Today” no longer selects a date
  outside the allowed range.
- **Programmatic APIs accept both `id` and `#id`** — `BIMA.showModal('#id')`,
  `showOffcanvas`, `hideModal`, dropdown and collapse helpers now match
  `BIMA.modal('#id')`.

### Fixed — accessibility
- Picker inputs now expose `role="combobox"` (fixes axe `aria-allowed-attr`).
- **Contrast (WCAG 2.x AA):** success/destructive button fills now use their dark
  variants (5.3:1 / 4.8:1); dark-mode secondary buttons use the sky link colour.
- `.bima-table-wrap` is now positioned so `.bima-sr-only` table captions/labels
  stay inside the horizontal scroller.

### Visible token changes
- **`--bima-border-strong` darkened** from `#CBD5E0` to `#7F8C9E` (3.4:1 on
  white); dark mode uses `#6B7A92` (3.65:1 on dark card). Inputs, switches,
  checkboxes and outlined controls therefore have stronger borders.
- **New `--bima-focus-ring` (`#2F7FA8`, 4.45:1 on white)** replaces sky for
  focus outlines in light mode; `--bima-border-focus` and
  `--bima-interactive-focus` now resolve to it. Dark mode keeps sky.
- New `--bima-success-darker` and `--bima-error-darker` tokens for button hovers.

### Fixed — docs & tokens
- CDN snippets show a pinned fallback version instead of `@/`; they still update
  to the latest published version at runtime.
- `tokens/design-tokens.json` synchronised with `variables.css` — status,
  border, focus, state, surface and dark-mode values.
- **JetBrains Mono is now actually loaded** alongside Inter via the framework
  `@import`; previously `--bima-font-mono` named a font that was never fetched.
- `.bima-btn--cta-inverse` works standalone (no longer requires `.bima-btn--cta`);
  redundant inline button/layout styles removed from docs examples.

---

## [2.3.0] — 2026-10-05

Typography and UI refresh. **Breaking:** the package was renamed.

### Breaking
- **Package renamed `@bima/ui` → `@milvikbima/ui`.** Update imports, CDN URLs,
  npm scopes and bundler aliases. The TypeScript declaration examples and docs
  were updated to the new scope.

### Changed — typography
- **New type system:** Quicksand (display) and Manrope (body) replaced by
  **Inter** for display, headings, body, navigation, labels and buttons;
  **JetBrains Mono** for code. Fonts load from Google Fonts via the framework
  CSS, with system-font fallback ladders.
- Added raw family tokens (`--bima-font-family-display/body/mono`) and semantic
  role tokens (`--bima-font-heading`, `-body`, `-label`, `-nav`, `-sidebar`,
  `-button`, `-tab`, `-section`, `-mono`).
- Added `.bima-ff-*` role utilities (display, heading, heading-sub, body, label,
  nav, sidebar, button, tab, section, mono), tracking utilities and
  `.bima-fs-label`.
- Updated leading/tracking scale; added `--bima-text-label` (13px).
- `--bima-text-muted` darkened to `#4F5D73` (5.6:1 on Mist).
- Headings now use `text-wrap: pretty` and tighter leading.

### Added — tokens & components
- **Sidebar token surface** (`--bima-sidebar-*`) for light and navy shells,
  covering background, borders, item states, indicators and section labels.
- `--bima-control-xs` (28px) and `.bima-btn--xs` / `.bima-btn--icon.bima-btn--xs`.
- Dark mode now sets `color-scheme: dark` and adds light-on-dark status text
  tokens (`--bima-success/warning/error/info/neutral-text`), plus dark
  `--bima-mist` and `--bima-sky-muted`.
- **Navbar:** pill hover states, softer link colour and a `__actions` helper.
- **Tooltips:** arrow indicator and explicit `data-bima-placement`
  top/bottom/left/right styling.
- Tabular numerals for inputs, tables, KPI values and deltas.
- Prose link underline scoped with `:where()` so component links are unaffected.
- `chrome.header-height` (60px) design token added.

---

## [2.2.0] — 2026-06-04

Packaging and publishing fix.

### Changed
- Reformatted the `package.json` `exports` map and scripts; no functional change.
- Removed the unused Figma archive from the repository.
- No CSS or JavaScript behaviour changes.

---

## [2.1.0] — 2026-06-03

Production-hardening release: the documented JavaScript API and events now
actually exist, plus a headless smoke-test suite, TypeScript types, and a stated
browser-support matrix. Recommended upgrade for all consumers — `2.0.0` shipped
with broken selects, a missing popover, and an inaccurate JS API.

### Added — JavaScript API & events (were documented but unimplemented)
- **`BIMA.collapse / modal / tab` (`'show'|'hide'|'toggle'`)**, **`BIMA.popover(el, opts)`** and **`BIMA.tooltip(el, opts)`** (return `{show, hide, destroy}` controllers), **`BIMA.scrollspy(el, opts)`** (returns `{refresh, destroy}`), and **`BIMA.carouselNext / Prev / Pause / Cycle`**. All previously referenced in the docs but absent from the runtime — calling them threw.
- **`bima:*` custom events now fire**: `bima:modal:show|shown|hide|hidden`, `bima:collapse:show|shown|hide|hidden` (show/hide cancelable via `preventDefault()`), `bima:tab:show`, `bima:carousel:slide`, `bima:scrollspy:activate`. None were dispatched before.
- **TypeScript declarations** — `dist/bima.d.ts` typing the full `window.BIMA` API and events.
- **Headless smoke-test suite** — `scripts/smoke.mjs` loads real pages in headless Chrome and asserts zero console errors, component init, API presence, and live events. Wired into `npm test`.
- **Browser-support matrix** — `browserslist` in `package.json` + `docs/getting-started/browser-support.html` (evergreen Chrome/Firefox/Edge, Safari/iOS ≥ 15.4).

### Changed
- **Packaging** — added `main` / `browser` / `unpkg` / `jsdelivr` / `types` fields and `./js` type mapping so bundlers and TypeScript resolve the JS + types; build now reports gzip sizes (CSS ≈ 15 KB, JS ≈ 18 KB gzipped).
- **Tooltip placement** — `data-bima-tooltip-placement` (top/bottom/left/right) and a `delay` option are now honoured (previously ignored — tooltips only auto-placed top/bottom).
- **Modal sizes without `:has()`** — `.bima-modal--sm/--lg/--xl/--scrollable` are now direct classes on the modal, so sizing works on browsers lacking `:has()` (the `:has()` rules remain as progressive enhancement).

### Added
- **Themed date / time / datetime pickers** — `data-bima-datepicker` (calendar), `data-bima-timepicker` (scrollable hour/minute columns, `data-step`, `data-format="12|24"`), and `data-bima-datetimepicker` (calendar + time) enhance a text input into a fully on-brand popover, replacing every un-themable native date/time popup. Each keeps a machine value on `data-value` (ISO date, `HH:MM`, or `YYYY-MM-DDTHH:MM`), supports `data-min`/`data-max`, and writes a hidden mirror input for form submission. New `.bima-datepicker*` / `.bima-timepicker*` styles in `extensions.css`.
- **Form-control patterns** — `.bima-input.is-verified` / `.bima-select.is-verified` (brand-tint "confirmed" field with check), `.bima-form-section` (uppercase section header + action), `.bima-steps` step indicator (+ `--on-navy`). New token `--bima-surface-input-filled` (light + dark).

### Changed
- **Themed select is now the default** — `bima.js` enhances every single (non-`multiple`) `.bima-select` automatically; `data-bima-select` is no longer required. Opt a control out with `data-bima-native`. This makes themed dropdowns consistent across the entire framework, docs, and examples (including previously-native selects such as `offcanvas.html`).
- **Custom select now works inside `.bima-float`** — the floating label rests/animates correctly over an enhanced select; the wrapper gains `.is-filled` / `.is-verified` state classes.
- **Every native date/time input replaced with a themed picker** across the docs and examples (`docs/forms/form-control.html`, `examples/components.html`, `examples/interactive.html`, `examples/form.html`, `examples/dashboard/claims.html`) — no remaining browser-native date/time popups.

### Added
- **Popover JS** — `data-bima-toggle="popover"` (with `data-bima-title`, `data-bima-content`, `data-bima-placement`) now works: click toggles a themed popover, closing on outside-click / Esc / re-click. Previously unimplemented.
- **`.bima-navitem--on-navy`** — sidebar nav-item variant for dark navy app shells (sky active state + indicator bar).

### Fixed
- **Prose-list leak into components** — `.docs-content ul/ol/li` (docs prose styling) was overriding framework list components (`.bima-list-group`, `.bima-dropdown__menu`, `.bima-nav`, `.bima-breadcrumb`, `.bima-pagination`) on every docs page — indenting and mis-spacing them. Scoped the prose rule with `:where()` (zero specificity) so components always win.
- **Accordion** — standardised the docs accordion onto the working `<button class="bima-accordion__header">` + `.bima-accordion__panel.is-open` pattern (was a broken `<h3>`+`__btn`+dead `bima-collapse show` mix). Removes the large inter-item gaps and restores open/close animation + single-open behaviour.
- **Floating labels** — floating controls are now taller (3.5rem) so the floated label and value each get room; resting label centres correctly and the custom select matches.
- **Themed select in inline/flex layouts** — added a `min-width` so the select no longer collapses and truncates in shrink-to-fit rows (e.g. inline filter bars).
- **Mixed-variant button groups** — grouped buttons now share one neutral seam border so a secondary's blue edge no longer clashes with a ghost's grey edge; variant identity stays in the text colour.
- **Sidebar nav-item / pill navbar demos** — use the real `.bima-navitem--on-navy` / `.bima-navbar` classes instead of inline-style hacks; pill navbar links no longer hidden in the docs example.
- **Dropdown option alignment** — option text now lines up exactly with the closed control's value (8px option + 4px menu = 12px), and the check mark aligns with the caret.
- **Dropdown indented inside docs/prose** — the themed menu is a `<ul>`, so ancestor rules like `.docs-content ul { padding-left: 1.25rem }` / `.docs-content li { margin-bottom }` (specificity 0,1,1) were overriding it and pushing options ~16px to the right on every docs page. Added two-class (`0,2,0`) defensive resets under `.bima-select-wrap` so the listbox stays flush wherever it's rendered, including inside content/prose containers.
- Custom select no longer renders the empty placeholder `<option>` as a blank row in the menu.

## [2.0.0] — 2026-06-03

Major expansion: Bootstrap-complete component coverage, full documentation site (58 pages), multi-page dashboard example, and a publishable npm package.

### Added — documentation site
- **58-page docs site** (`docs/`) with a navy-gradient sidebar, token-driven shell, and copy-buttons on every code block.
- **22 new docs pages** for Utilities (14), Getting Started (5), and Customize (3) sections.
- **Multi-page dashboard example** — `examples/dashboard/` (10 pages sharing one shell: workspace, members, enrollments, renewals, claims, plans, reports, settings).
- **Examples gallery** — `examples/index.html` linking all 5 example apps.

### Added — CSS
- **`src/css/content.css`** — display headings, lead, blockquote, list styles, images, figures.
- **`src/css/grid.css`** — 12-column flexbox grid with 6 breakpoints (xs/sm/md/lg/xl/xxl).
- **`src/css/carousel.css`** — slide + fade carousel variants.
- **`src/css/helpers.css`** — clearfix, focus-ring, icon-link, stacks, vr, visually-hidden.
- **`src/css/extensions.css`** — alias/compat layer for Bootstrap-style class names, gap-axis utilities (`bima-gap-x-*`, `bima-gap-y-*`), row-cols utilities, and additional helpers.

### Added — JavaScript
- **Carousel** — autoplay, slide/fade, prev/next/goto, keyboard, touch-swipe, ARIA.
- **Scrollspy** — offset-based active-nav update; `refreshScrollspy()` public method.
- **Custom select** (`data-bima-select`) — themed combobox/listbox wrapper, keyboard nav, type-ahead, optgroup support, ARIA-compliant.

### Fixed — form components
- **Floating labels** — resting label now aligns with the input cursor (`padding-top` matched to input's `padding-top`); float transform updated (`translateY(-0.875rem) scale(0.857)`) for clean separation at ~5px from top. Separate transform for `<textarea>`. Added `line-height: 1`, `white-space: nowrap`, `overflow: hidden` to prevent label overflow.
- **Date / time inputs** — added `accent-color: var(--bima-blue)` for themed popup highlight; `-webkit-calendar-picker-indicator` styled with hover state; `appearance: none` for consistent cross-browser rendering.

### Changed
- **`package.json`** — added `publishConfig: {access: "public"}`, `author`, `audit` + `test` scripts; removed redundant `"type": "module"`.
- **`.gitignore`** — standard ignores (`node_modules/`, `*.tgz`, `*.log`, `.DS_Store`).
- **Dist sizes** — bima.css ~172 KB, bima.min.css ~74 KB, bima.js ~60 KB, bima.min.js ~55 KB.

---

## [1.2.0] — 2026-06-02

Grew the framework into a **Bootstrap-style, packageable UI library** while keeping the BIMA theme. The spec/guidance stays technology-agnostic; the reference build is now a real, installable vanilla CSS + JS library.

### Added — distribution
- **`package.json`** — npm-publishable manifest (`@milvikbima/ui`), exports map, `files` whitelist, `sideEffects`, zero runtime dependencies.
- **`scripts/build.mjs`** — zero-dependency Node build: concatenates the CSS sources into `dist/bima.css`, writes a conservatively minified `dist/bima.min.css`, and copies `dist/bima.js` / `dist/bima.min.js`.
- **`getting-started.md`** — Bootstrap-"Introduction"-style guide: CDN, npm, download, starter template, what's included, theming via token overrides, browser support.
- **`dist/`** — built bundles (generated by `npm run build`).

### Added — CSS layers
- **`tokens/reboot.css`** — element reboot (normalisation + base element styling) built on tokens.
- **`tokens/bima-utilities.css`** — ~200 tokenized, `bima-`prefixed utility classes (display, flex, gap, spacing matrix, text, colour, background, border, radius, shadow, sizing, position, overflow, opacity, z-index, object-fit, visibility) + responsive display/text-align at md/lg.

### Added — components (in `tokens/bima.css`)
Button group, input group, floating labels, range, form validation feedback, dropdown, nav & tabs, breadcrumb, pagination, list group, accordion, progress, close button, popover, offcanvas, avatar, placeholder, ratio, stretched-link — bringing component coverage to Bootstrap parity.

### Added — JavaScript
- **`js/bima.js`** — dependency-free, data-attribute API (`data-bima-*`) + `window.BIMA`: dropdown, collapse, accordion, tabs, modal, offcanvas, toast, alert-dismiss, tooltip. Focus-trapped, keyboard-accessible, respects reduced motion.
- **`components/javascript.md`** — the JS usage doc.

### Notes
- The library is versioned with the design system (single version line).
- Source CSS order for the bundle: `variables.css` → `reboot.css` → `bima.css` → `bima-utilities.css`.

---

## [1.1.0] — 2026-06-02

Quality and consistency pass. Turned the framework from "spec + disconnected demos" into "spec + a token-driven reference implementation the demos consume."

### Added
- **`tokens/bima.css`** — reference component stylesheet (vanilla CSS). Every rule resolves to a `--bima-*` token; no hard-coded values. The single source of truth for component appearance.
- **`foundations/iconography.md`** — icon standard (Lucide, stroke style, sizes, a11y). Bans emoji-as-icons.
- **`foundations/data-visualization.md`** — categorical / sequential / diverging chart palettes derived from the brand, plus chart styling tokens and chart-type guidance.
- **`components/tables.md`** — tables promoted to a first-class component spec (sorting, selection, pagination, responsive, a11y).
- **`guidelines/content-style.md`** — voice & tone, capitalisation, button/error/empty microcopy, numbers & dates.
- **Control-size tokens** — `--bima-control-sm|md|lg` (32/40/48px) to end height drift.
- **Interaction-state tokens** — `--bima-state-hover`, `--bima-state-selected`, `--bima-row-hover`.
- **Accessible status text tokens** — `--bima-success-text`, `--bima-warning-text`, `--bima-error-text`, `--bima-info-text`, `--bima-neutral-text`.

### Fixed
- **Status colour contrast (WCAG AA).** Status badge/alert text previously failed AA — warning text on its tint was ~1.9:1, success ~2.8:1, error ~3.4:1. New `*-text` tokens are all ≥4.5:1 on their `-bg`.
- **Muted text contrast.** `--bima-text-muted` darkened `#718096 → #5E6B7B` so it passes AA on the Mist background.
- **Heading weight drift.** `h4` is now semibold everywhere (was 500 in `variables.css` but 600 in the specimens).
- **Token drift.** `examples/components.html` rebuilt to consume `variables.css` + `bima.css` with zero private tokens, and to use inline-SVG icons instead of emoji.

### Changed
- **Doc homepage consolidated.** `docs/index.html` now redirects to the single canonical `index.html` at the root.
- README reframed: still spec-first and technology-agnostic, but now documents the reference stylesheet and the tokens → components → examples architecture.

### Known follow-ups
- The other example pages (`dashboard.html`, `marketing.html`, `form.html`, `messaging-ui.html`) still declare private `:root` palettes and use emoji. Migrate them to `variables.css` + `bima.css` + SVG icons in a future pass.
- Add a per-product glossary under `guidelines/`.
- Add visual-regression snapshots once a hosting target is chosen.

---

## [1.0.0] — initial

- Foundations: colour, typography, spacing, elevation, motion, responsive grid.
- Components: buttons, forms, cards, navigation, feedback.
- Tokens: `variables.css`, `design-tokens.json`.
- Guidelines: accessibility, responsive, dark mode.
- Patterns: dashboard, stack implementations.
- Examples: dashboard, marketing, form, components, messaging UI + docs homepage.
