@tonycodes-ui/mortar 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -39
- package/DESIGN.md +1 -1
- package/catalog.json +413 -377
- package/cli/audit.mjs +152 -0
- package/dist/agent-data.json +1 -1
- package/dist/application.d.ts +30 -5
- package/dist/application.js +20 -8
- package/dist/index.d.ts +1 -1
- package/dist/inspection.js +17 -1
- package/dist/internal.d.ts +15 -1
- package/dist/internal.js +12 -1
- package/dist/marketing.d.ts +3 -2
- package/dist/marketing.js +2 -6
- package/dist/primitives.js +20 -11
- package/docs/agents.md +21 -18
- package/docs/theming.md +72 -1
- package/package.json +1 -1
- package/skills/mortar/SKILL.md +1 -1
- package/src/application.css +95 -1
- package/src/application.tsx +88 -19
- package/src/data.css +58 -2
- package/src/foundation.css +10 -0
- package/src/index.ts +3 -0
- package/src/inspection.tsx +15 -0
- package/src/internal.tsx +93 -2
- package/src/marketing.tsx +4 -74
- package/src/primitives.tsx +38 -19
package/CHANGELOG.md
CHANGED
|
@@ -2,54 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
Mortar follows [semantic versioning](https://semver.org/). Before 1.0, a minor release may contain breaking changes, and it says so. Each release is published from its `v<version>` tag to [npmjs.com](https://www.npmjs.com/package/@tonycodes-ui/mortar) with npm provenance. Its GitHub release carries the exact archive and a `provenance.json` with the commit and SHA-512 integrity.
|
|
4
4
|
|
|
5
|
-
## 0.
|
|
5
|
+
## 0.13.0 (2026-11-05)
|
|
6
6
|
|
|
7
7
|
### Added
|
|
8
8
|
|
|
9
|
-
- **
|
|
10
|
-
-
|
|
11
|
-
- **
|
|
12
|
-
- `
|
|
13
|
-
-
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- **MarketingHeader** `tagline` shows a short descriptor beside the wordmark, outside the home link. It is hidden at 560px and narrower.
|
|
19
|
-
- **Footer** `layout="inline"` is one compact row of brand, notes, links, copyright and legal links. It wraps without changing reading order. `description` and `columns` are now optional.
|
|
20
|
-
- **Open agent tooling in the package: an MCP server and the `mortar` CLI.** They read the installed version's catalogue, contracts, examples and guides, run locally, work offline and need no account. They add no runtime dependencies. See [Mortar for coding agents](https://github.com/tonycodes/mortar/blob/main/docs/agents.md).
|
|
21
|
-
- `mortar mcp` is a stdio MCP server (`claude mcp add mortar -- npx -y @tonycodes-ui/mortar mcp`) with six tools: `search_components`, `get_component` (props with types and defaults, usage notes, dependencies, marker, tested states and a JSX example), `get_build_packet` (for component names or a free-text brief: the dependency closure, imports, CSS and ThemeProvider setup, design principles, API conventions and matching page templates), `get_guide`, `list_kits` and `audit_app`.
|
|
22
|
-
- `mortar search`, `component`, `packet`, `audit`, `guide` and `kits` give the same answers on the command line, with `--json`.
|
|
23
|
-
- `mortar audit [path]` is a read-only static audit of an application: version range, imports and props that the installed version does not have (with 0.6 rename suggestions), invalid prop values, CSS overriding `.m-*` classes or `[data-m-component]`, raw colours beside Mortar components, a missing `styles.css` import or ThemeProvider, deep imports and local copies of Mortar source. It exits 1 when it finds errors.
|
|
24
|
-
- An agent skill, `skills/mortar/SKILL.md` (`npx mortar skill`), with the workflow defaults: search, packet, compose, audit, and contribute by pull request.
|
|
25
|
-
- The package now also ships `AGENTS.md`, `CONTRIBUTING.md`, `TESTING.md` and the guides in `docs/`, which the tools read.
|
|
26
|
-
- **`ErrorSummary`** (Foundation › Form controls): the problems that stopped a form submitting, listed above the form with a link to each field. Props: `errors` (`{ message; href?; target? }[]`; renders nothing when empty), `title` (default "There is a problem"), `headingLevel` (default 2), `autoFocus` (default true), `submitCount`, `id` and `className`. It is a `role="alert"` region named by its heading with `tabIndex={-1}`: it takes focus when it appears and whenever `submitCount` changes, but not while a fixed field's error clears. A link focuses its field without changing the URL hash; for a group such as a RadioGroup the checked or first radio takes focus, and the label or legend scrolls into view.
|
|
27
|
-
- **Checkbox `error`**: the message is announced when it appears (`role="alert"`), the box is `aria-invalid` and `aria-describedby` links the description and the error. `required` adds the decorative `*` after the label, as on Input and Select. Without these props the markup is unchanged.
|
|
28
|
-
- **RadioGroup `error`, `hint`, `required` and `id`**: the hint or error sits under the legend and describes the fieldset; with an error each radio is `aria-invalid`, and `required` marks every radio and adds `*` to the legend. Without these props the markup is unchanged.
|
|
9
|
+
- **DataTable column priority and pinning for narrow screens** ([#77](https://github.com/tonycodes/mortar/issues/77)). `priority: "medium"` hides a column when the table is narrower than 480px and `priority: "low"` below 768px. This is the table's own width (a container query), so a table in a narrow panel collapses as it would on a phone. The first column always shows. A table with priorities keeps its truncated columns shrinking on narrow screens (down to 5rem) so the remaining columns fit instead of scrolling. `pin: "end"` keeps a column, such as row actions, at the trailing edge while the table scrolls sideways; its background follows the row's stripe, hover and selection. Tables without these props are unchanged.
|
|
10
|
+
- **`mortar audit` flags raw HTML elements that a Mortar component replaces** (`raw-element`, [#76](https://github.com/tonycodes/mortar/issues/76)). In an app that uses Mortar, a raw `<table>` (use DataTable or Table), `<select>`, `<textarea>`, `<dialog>`, `<progress>` or `<input>` is an error, and a raw `<button>` is a warning. Each finding names the component to use and gives its file and line. Inputs are matched by `type`, so `hidden`, `file`, `range`, `color` and `image` inputs are not reported. HTML inside strings and template literals is ignored, including concise arrow returns, `case` and `throw`, and nested templates inside `${…}`. A backtick quoted inside `${…}` does not hide a later element. The mapping is read from a new `replaces` field on each component's contract in the catalogue, so new components extend it.
|
|
11
|
+
- **Top navigation for application screens.** All additions are optional, and default markup is unchanged.
|
|
12
|
+
- **Dropdown groups.** `Navbar` `items` and `StackedShell` `navigation` take a labelled group, `{ label, items }`, beside plain links. A group opens a panel of links (each with an optional description, icon and `current`), using the same flyout as MarketingHeader. A group holding the current page is marked current. On narrow screens it opens inside the folded menu, and choosing a link closes the menu.
|
|
13
|
+
- **Bar tone.** `tone` on Navbar and StackedShell can be `"inverse"` (the other appearance, through the inverse remap) or `"accent"` (the brand's accent fill, or its gradient when it defines one). An accent bar has on-accent links and focus, an inverted primary action and outlined secondary ones. Dropdown panels keep the page's colours.
|
|
14
|
+
- **Page tabs.** StackedShell `tabs` (`{ label, items }`) adds a second row of page tabs under the bar, rendered as a TabNav.
|
|
15
|
+
- **Template.** A new application template, "Dashboard, top navigation" (`?recipe=stacked-dashboard`), composes StackedShell with all three.
|
|
16
|
+
- **Split landing template** (`?recipe=split-landing`, [#68](https://github.com/tonycodes/mortar/issues/68)). A one-screen landing page composed only from public components: MarketingPage, a MarketingHeader with a tagline and the consumer's logo in the logo slot, a split Hero with an emphasised title, a Notice as supporting feedback, a NetworkIllustration, and an inline Footer. The CLI and MCP list it with the components it composes. Its browser test checks 320px reflow, 200% zoom, long text, keyboard order and visible focus in both themes, and that the emphasised phrase uses the green brand's link colour in light and dark. It also has a visual baseline.
|
|
17
|
+
- **Docs: marketing surfaces and illustrations** ([theming](docs/theming.md#marketing-surfaces-and-illustrations)). Shows which existing tokens a branded landing page and its SVG read (canvas, text, borders, emphasis, accent and focus), and lists the supported extension points and what is not supported. No new tokens: every role already had one. [Mortar for coding agents](docs/agents.md#the-audit) and the agent skill now say that a clean audit is not proof that a page uses only Mortar components.
|
|
29
18
|
|
|
30
19
|
### Fixed
|
|
31
20
|
|
|
32
|
-
- **
|
|
33
|
-
- **
|
|
21
|
+
- **Pinned DataTable cells keep the forced-colours highlight.** A selected or hovered pinned cell was specific enough to paint its own background over `Highlight`, so the text stayed `HighlightText` on `--m-selected`. Those backgrounds now sit below the forced-colours rule, and still cover the stripe in ordinary colours.
|
|
22
|
+
- **Switch and Checkbox keep keyboard focus when their description comes and goes** ([#78](https://github.com/tonycodes/mortar/issues/78)). A description set in only one state (for example "Showing all 4 keys" when on) swapped the layout and remounted the input, so Space stopped working. Once a choice has had a description or error it keeps the described layout, and focus follows if the layout changes.
|
|
23
|
+
- **MetricGroup no longer clips long values on phones** ([#81](https://github.com/tonycodes/mortar/issues/81)). Below 560px metrics still sit two to a row, but a value too wide for half a row (such as "Operational" at 320px) takes a row of its own, and a value wider than the row wraps.
|
|
24
|
+
- **SegmentedControl no longer pushes the page sideways** ([#80](https://github.com/tonycodes/mortar/issues/80)). It is never wider than its container: options scroll inside the control, the selected option is scrolled into view on mount and on change, and the focus ring isn't clipped. Apps can drop local overflow wrappers.
|
|
25
|
+
- **Accent navbar sunken contrast.** `Navbar` `tone="accent"` sets `--m-sunken` from `--m-accent-wash`, the same direction as an accent button's hover, so current items, avatars and hovers on the bar stay at least 4.5:1. A wash towards the on-accent text dropped the built-in green light bar to 4.2:1.
|
|
34
26
|
|
|
35
27
|
### Changed
|
|
36
28
|
|
|
37
|
-
-
|
|
38
|
-
- **Packages are published to npmjs.com.** Install with a plain `npm install @tonycodes-ui/mortar`; no registry configuration, account or token is needed. Releases are published from GitHub Actions with npm trusted publishing (OIDC, no long-lived token) and `--provenance`, so each version on npmjs.com links to the workflow run and commit that built it.
|
|
39
|
-
- **The playground moved to GitHub Pages**, at https://mortar.tony.codes/playground/. The site root links the playground, GitHub, npm and the docs. The package `homepage` points there.
|
|
40
|
-
- **Everything is free and in this repository.** The hosted Mortar Cloud preview (agent identities, OAuth MCP connections, hosted audits and planned paid plans) is retired. The kit, docs, playground and agent tooling are MIT licensed here, with no accounts, licence checks, telemetry or hosted service. GitHub maintainer review is the only review gate.
|
|
41
|
-
- The sign-up and other auth page templates use `ErrorSummary` and `Checkbox error` instead of a local summary and a hand-wired terms error. The terms checkbox is now `required`.
|
|
42
|
-
|
|
43
|
-
### Migration
|
|
44
|
-
|
|
45
|
-
Versions up to 0.11 of the private-registry package `@tony-ui/mortar` were published only to the previous owner-hosted registry, `https://git.tony.codes/api/packages/tony/npm/`, which will be retired. New versions are on npmjs.com only. To upgrade, remove the scope override and install from npmjs.com:
|
|
46
|
-
|
|
47
|
-
```sh
|
|
48
|
-
npm config delete @tony-ui:registry --location=project
|
|
49
|
-
npm install @tonycodes-ui/mortar@latest
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
A project that must stay on 0.11 or earlier keeps its scope override (`@tony-ui:registry=https://git.tony.codes/api/packages/tony/npm/` in `.npmrc`) while that registry remains available, or installs the archive attached to the version's [GitHub release](https://github.com/tonycodes/mortar/releases).
|
|
29
|
+
- **Brands under a strict Content Security Policy are documented** ([#82](https://github.com/tonycodes/mortar/issues/82)). `brandTokens` and `registerBrand` inject an inline `<style>`, which `style-src 'self'` blocks, silently dropping the brand. `docs/theming.md` now shows the CSP-safe path: generate the rule with `brandToCss` at build time, import it after Mortar's styles, and pass ThemeProvider the brand name only. It also covers the options for runtime tenant brands (`'unsafe-inline'`, a hash, or serving each tenant's rule as a stylesheet).
|
|
53
30
|
|
|
54
31
|
## 0.11.0 (2026-10-20)
|
|
55
32
|
|
package/DESIGN.md
CHANGED
|
@@ -27,7 +27,7 @@ Every component follows these rules. New props must fit them, and the code revie
|
|
|
27
27
|
- Tables align columns with `start | end`, not `left | right`.
|
|
28
28
|
- **Tone.**
|
|
29
29
|
- Status uses `Tone` (`neutral | info | success | warning | danger`).
|
|
30
|
-
- Section surfaces use `tone: "default" | "muted" | "inverse"`. Promotional bands (CallToAction, Hero and Banner) also take `"accent"`: the brand's accent fill, which is its accent gradient when it defines one, with on-accent text. Button and ActionLink take the same fill as `variant="accent"`. Each component offers only the tones it styles.
|
|
30
|
+
- Section surfaces use `tone: "default" | "muted" | "inverse"`. Promotional bands (CallToAction, Hero and Banner) also take `"accent"`: the brand's accent fill, which is its accent gradient when it defines one, with on-accent text. Button and ActionLink take the same fill as `variant="accent"`. The application bar (Navbar, and StackedShell through it) takes `tone: "default" | "inverse" | "accent"`; it has no muted tone. Each component offers only the tones it styles.
|
|
31
31
|
- A destructive action is `tone="danger"`, and a destructive item in a list is `danger: true`.
|
|
32
32
|
- Tone renders as `data-tone`.
|
|
33
33
|
- **State.** Busy work is `loading`. Empty content is `empty?: { title; description?; action? }`. Errors are `error` (string).
|