Releases: JacobKnaack/fernwell
Releases · JacobKnaack/fernwell
Release list
v0.4.0
v0.3.0
Added
- Docs: new Components page (
docs/components.html) with a live demo and markup for every shipped component (Alert, Button, Card, Combobox, Disclosure, Drawer, Empty, Eyebrow, Field, List row, Menu, Modal, Nav, Pagination, Progress, Selection controls, Spinner, Stat, Table, Tag, Toast) plus layout utilities, linked from a new docs-wide page nav alongside the Overview page.
Fixed
.fw-tableno longer inflates the whole page's width on narrow viewports. Below 560px it now switches totable-layout: fixed(was alwaysauto): a wide table's content-driven intrinsic width was previously counted by mobile browsers' viewport-fit sizing even though.fw-table-wrap'soverflow-x: autoalready scrolled that overflow locally, producing horizontal scroll on the entire document into blank space..fw-table-select/.fw-table-actionsget a small explicit width at that breakpoint (override via--fw-table-select-w/--fw-table-actions-w) instead of relying on thewidth: 1%shrink-trick, which behaves differently once the table stops sizing to content; other columns share the remaining space and wrap their text, except.fw-table-numcells (money, dates, IDs), which truncate with an ellipsis rather than break mid-value. Desktop (>560px) is unchanged..kit-toc(docs on-page nav drawer) now also sizes with100dvh, fixing it rendering partially outside the viewport on iOS Safari when the address bar shows/hides..fw-drawer's mobile (≤560px) full-width rule no longer uses100vw, which could exceed the true viewport and contribute to page-level horizontal scroll.
v0.2.0
Changed (breaking)
- Colour tokens renamed from the default palette to semantic roles, so a consumer never has to rename a token to retheme it.
src/tokens/tokens.jsonand every component now speak in roles; the shipped values are unchanged, just renamed:--fw-ink→--fw-text,--fw-ink-soft→--fw-text-soft,--fw-ink-fixed→--fw-on-primary--fw-cloud→--fw-bg,--fw-cloud-dim→--fw-bg-dim--fw-marigold→--fw-primary,--fw-marigold-lt→--fw-primary-soft--fw-marigold-dk→--fw-primary-hover(button hover) or--fw-warning(pending tag/dot/toast — see below)--fw-plum→--fw-secondary,--fw-plum-dk→--fw-secondary-hover,--fw-plum-bg→--fw-secondary-bg--fw-meadow→--fw-success,--fw-meadow-bg→--fw-success-bg--fw-coral→--fw-danger,--fw-coral-bg→--fw-danger-bg--fw-sky→--fw-info,--fw-sky-bg→--fw-info-bg--fw-on-brand/-soft/-fill/-line→--fw-on-secondary/-soft/-fill/-line--fw-pending-bg→--fw-warning-bg--fw-shadow-marigold→--fw-shadow-primary,--fw-shadow-meadow→--fw-shadow-success.fw-tag-plum→.fw-tag-secondary--fw-marigold-dksplit into two roles because it did two jobs under one name (button hover and the pending/waiting accent) — a consumer retheming Primary to blue no longer accidentally turns pending tags blue too.
src/tokens/tokens.jsonschema changed:color.light/color.dark(andshadow.light/shadow.dark) collapsed into one entry per token,{ value }(same both themes) or{ light, dark? }. A value can reference another token in the same group with{name}.
Added
- Table component (
src/css/components/table.css): a native<table>inside a scrolling card (.fw-table-wrap), with.fw-table-striped,.fw-table-compact, a sticky header (.fw-table-stickyon the wrapper, height via--fw-table-max-height), mono/right-aligned numeric cells (.fw-table-num), action and checkbox columns (.fw-table-actions,.fw-table-select), empty and loading rows (.fw-table-empty,.fw-table-loading,[aria-busy="true"]), and sort indicators driven purely byaria-sorton the<th>. tableJS enhancer (table[data-fw-table]): client-side column sorting onth[data-fw-sort](td[data-fw-sort-value]overrides cell text for numbers and dates), row selection via[data-fw-select-row]with a[data-fw-select-all]header checkbox that tracks checked / indeterminate state; exportstable.sort(),table.getSelected(),table.setRowSelected(),table.selectAll()and theSortDirection/SortDetail/SelectDetailtypes; emitsfw:sortandfw:select.- Collapsible menu component (
src/css/components/menu.css): a nestable menu built on native<details>/<summary>that reads as a nav tree or, with.fw-menu-accordion, as an accordion..fw-menu>.fw-menu-list>.fw-menu-itemrows are.fw-menu-link([aria-current="page"]tint) ordetails.fw-menu-group>.fw-menu-summary(CSS-mask chevron, rotates on[open]); nested lists hang off an indent rail;.fw-menu-splitputs a link and an icon-only toggle (.fw-menu-summary-icon) in one row so a parent can navigate and expand;.fw-menu-panelholds free-form accordion bodies. Config via--fw-menu-indentand--fw-menu-row-h. Works without JS. menuJS enhancer (.fw-menu[data-fw-menu]): opens every ancestor group of an[aria-current]link on init and marks a collapsed branch that holds it with.is-current;data-fw-menu-exclusivecloses sibling groups when one opens; arrow-key navigation (↑ ↓ between visible rows, → opens / enters a group or jumps from a split link to its toggle, ← closes / returns to the parent, Home / End) without touching Tab order; exportsmenu.open(),close(),toggle(),reveal(),expandAll(),collapseAll()and theToggleDetailtype; emitsfw:toggle.- Docs: new Collapsible menu section (07e) with a three-level nav tree (split row, auto-revealed current page) and an exclusive FAQ accordion.
- Docs: an on-page navigation tree (
#kit-toc,docs/index.html) built at runtime from the page's own<h2>sections, nesting the<h3>install methods as children — dogfoods the new.fw-menucomponent and callsmenu.init()directly. Pinned open beside.kit-wrapon wide viewports (min-width: 1600px); below that it's an off-canvas drawer opened by a chevron.kit-toc-togglebutton fixed to the left edge, reusing thenavenhancer (data-fw-nav-toggle) for outside-click / Escape /aria-expanded. Smooth-scrolls to the target heading (docs/styles/index.css, respectsprefers-reduced-motion). .fw-checkboxnow styles the:indeterminatestate (a dash on Primary), so a select-all checkbox reads correctly when only some rows are ticked.- Docs: new Table section (07d) with a sortable, selectable invoices table, a compact sticky-header table, and an empty state.
- Derived tokens:
--fw-primary-hover,--fw-primary-soft,--fw-secondary-hover,--fw-secondary-bg,--fw-success-bg,--fw-warning-bg,--fw-danger-bg,--fw-info-bg,--fw-on-secondary-soft/-fill/-line,--fw-focus-ringand--fw-shadow-primary/-successare now computed from their seed colour withcolor-mix()instead of being separately hand-tuned hex/rgba values — override the seed (e.g.--fw-primary) and every derived token follows, in both themes, without needing to be redeclared. - New
--fw-warning/--fw-warning-bgtokens (the oldmarigold-dkpending accent, now independent of Primary). - Generated
src/css/tokens.cssnow wraps its rules in@layer fw-tokens, so a plain (unlayered) consumer override always wins over Fernwell's own[data-theme="dark"]re-declaration, regardless of selector specificity or source order — previously a:rootoverride had to be repeated for[data-theme="dark"]or it was clobbered on theme toggle. [data-theme="light"]now also sets the light token block, so a light island inside a dark page (or vice versa) works.- Runtime theming API on
theme:setTokens(tokens, { scope }),resetTokens(scope?),getToken(name, el?)— override tokens from JS (per-tenant branding, a user-picked accent), optionally scoped to a subtree or split by theme with{ light, dark }. Renders into one<style data-fw-tokens>that wins over both the@layer fw-tokensdefaults and any static override. docs/index.html: new Theming section with a live palette editor (colour pickers for every seed role, wired tosetTokens/resetTokens, with a live CSS preview) and a rewritten Color section showing role names alongside their default palette nicknames.- Token lint (
npm run lint) now fails on any retired pre-rename token or class name (--fw-marigold,--fw-ink,.fw-tag-plum, …), to guard against regressions.