@tonycodes-ui/mortar 0.24.0 → 0.25.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/docs/agents.md CHANGED
@@ -86,7 +86,7 @@ Add `--json` for machine-readable output. `mortar audit` exits with status 1 whe
86
86
 
87
87
  1. **Search.** Before writing UI, find what the kit already has: `search_components`, or `list_kits` to browse. Start from the purpose shell: `AppShell` for application screens, `MarketingHeader` (with `Footer`) for public pages, `DocsShell` for documentation and `AuthLayout` for sign-in and registration.
88
88
  2. **Packet.** Call `get_build_packet` with the components you picked, or with the brief. Compose from it: the contracts list every prop, and the page templates show complete page patterns to follow.
89
- 3. **Compose.** Use named imports from `@tonycodes-ui/mortar` and the exact props and values in each contract. Keep product names, data, routes, permissions and actions in props and slots. Theme with `ThemeProvider` and tokens (`get_guide theming`). Never copy a component's source, wrap it repeatedly, or override `.m-*` classes or `[data-m-component]` in your CSS.
89
+ 3. **Compose.** Use named imports from `@tonycodes-ui/mortar` and the exact props and values in each contract. Keep product names, data, routes, permissions and actions in props and slots. Theme with `ThemeProvider` and tokens (`get_guide theming`). Never copy a component's source, wrap it repeatedly, or override `.m-*` classes or `[data-m-component]` in your CSS. When replacing an unlabeled native `<input>`, move search icons onto `leadingIcon`/`trailingIcon` and units onto `prefix`/`suffix`; do not keep `relative`/`absolute` chrome around a labeled `Input`, and do not put static text in `action` (that slot is for an attached Button or menu).
90
90
  For an iOS, iPadOS or Android app, use the SwiftUI package and the Compose library (`get_guide native`). A component's contract names its native equivalent under `native`, and a packet for a native brief lists every component the native libraries have.
91
91
  4. **Audit.** Run `audit_app` (or `npx mortar audit`) and fix what it finds, then run the app's own typecheck and build. Verify in a browser: mobile and desktop, light and dark, keyboard and focus, and loading, empty and error states.
92
92
  5. **Contribute.** If a shared pattern is missing or a component is wrong, fix it in the kit, not in the app. Open a pull request at [github.com/tonycodes/mortar](https://github.com/tonycodes/mortar) following [CONTRIBUTING.md](../CONTRIBUTING.md) and [AGENTS.md](../AGENTS.md) (`get_guide contributing`). Maintainer review and CI decide what merges; agents never approve, merge or publish their own changes.
@@ -95,29 +95,31 @@ Add `--json` for machine-readable output. `mortar audit` exits with status 1 whe
95
95
 
96
96
  `audit_app` reads the application's files and never changes them. It checks against the contracts of the Mortar version installed in the app (or, for releases older than this tooling, against the tool's own catalogue, and says so).
97
97
 
98
- | Rule | Severity | Finds |
99
- | ------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
100
- | `not-declared` | error | Mortar imported but missing from package.json |
101
- | `not-installed` | error | Mortar imported but not in node_modules |
102
- | `version-mismatch` | error | The installed version does not satisfy the package.json range |
103
- | `unknown-export` | error | A named import the installed version does not export, with the replacement for names removed in 0.6 |
104
- | `deep-import` | error | Imports or aliases into the package's `src` or `dist`, or an entry other than the package, `/styles.css`, `/brand` and `/email` |
105
- | `unknown-prop` | error | A prop the component's contract does not declare, with the 0.6 rename where there is one |
106
- | `invalid-value` | error | A literal outside the prop's declared union, such as `layout="centered"` (now `center`) |
107
- | `css-override` | error | Consumer CSS selecting Mortar's `.m-*` classes or `[data-m-component]` |
108
- | `class-override` | error | A Tailwind arbitrary variant that targets `.m-*` classes, such as `[&_.m-button]:rounded-none` |
109
- | `local-copy` | error | A copy of a Mortar source file, or code rendering Mortar's component marker |
110
- | `raw-element` | error | A raw `<table>`, `<select>`, `<textarea>`, `<dialog>`, `<progress>` or `<input>` (by type; not `hidden`, `file`, `range`, `color` or `image`) anywhere in an app that uses Mortar, naming the component to use instead. A raw `<button>` is a warning. The mapping comes from each contract's `replaces` field, so new components extend it |
111
- | `invalid-phrasing` | error | A block HTML element (`div`, `p`, heading, list, …) in a phrasing-only slot that Mortar renders inside a `<p>` (from each contract's `phrasingSlots`, today `Banner` `children` and `AuthLayout` `description`) |
112
- | `legacy-package` | error | An import or `package.json` dependency of the retired private-registry package (see [CHANGELOG Migration](../CHANGELOG.md#migration)); install and import `@tonycodes-ui/mortar` instead. A `node_modules` copy of the old package does not count as installing the public one |
113
- | `email-app-import` | error | In an email (a file importing `@tonycodes-ui/mortar/email` or React Email), an app component or `styles.css`, naming the email component to use. Raw elements in emails are not reported: email layout is tables |
114
- | `email-peer-missing` | error | `@tonycodes-ui/mortar/email` is imported but `@react-email/components` is not in package.json |
115
- | `missing-styles` | error | No import of `@tonycodes-ui/mortar/styles.css` |
116
- | `styles-order` | warning | Mortar's styles imported before Tailwind |
117
- | `missing-theme-provider` | warning | Mortar components rendered without a `ThemeProvider` |
118
- | `kit-class` | warning | Mortar-internal class names on the app's own markup |
119
- | `raw-colour` | warning | Hex, `rgb()`/`oklch()` colours or Tailwind palette classes in files that render Mortar components, except where they define a brand (`brandTokens`, `brandToCss`/`brandToStyle`/`registerBrand` arguments, `BrandDefinition` objects, `--m-brand-*` values) |
120
- | `limited-data` | info | The installed release has no agent data, so a newer catalogue was used |
98
+ | Rule | Severity | Finds |
99
+ | -------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
100
+ | `not-declared` | error | Mortar imported but missing from package.json |
101
+ | `not-installed` | error | Mortar imported but not in node_modules |
102
+ | `version-mismatch` | error | The installed version does not satisfy the package.json range |
103
+ | `unknown-export` | error | A named import the installed version does not export, with the replacement for names removed in 0.6 |
104
+ | `deep-import` | error | Imports or aliases into the package's `src` or `dist`, or an entry other than the package, `/styles.css`, `/brand` and `/email` |
105
+ | `unknown-prop` | error | A prop the component's contract does not declare, with the 0.6 rename where there is one |
106
+ | `invalid-value` | error | A literal outside the prop's declared union, such as `layout="centered"` (now `center`) |
107
+ | `css-override` | error | Consumer CSS selecting Mortar's `.m-*` classes or `[data-m-component]` |
108
+ | `class-override` | error | A Tailwind arbitrary variant that targets `.m-*` classes, such as `[&_.m-button]:rounded-none` |
109
+ | `local-copy` | error | A copy of a Mortar source file, or code rendering Mortar's component marker |
110
+ | `raw-element` | error | A raw `<table>`, `<select>`, `<textarea>`, `<dialog>`, `<progress>` or `<input>` (by type; not `hidden`, `file`, `range`, `color` or `image`) anywhere in an app that uses Mortar, naming the component to use instead. A raw `<button>` is a warning. The mapping comes from each contract's `replaces` field, so new components extend it |
111
+ | `invalid-phrasing` | error | A block HTML element (`div`, `p`, heading, list, …) in a phrasing-only slot that Mortar renders inside a `<p>` (from each contract's `phrasingSlots`, today `Banner` `children` and `AuthLayout` `description`) |
112
+ | `input-static-action` | warning | Static text (a string or noninteractive `<span>`) in `Input` `action`. `action` is for an attached control; use `suffix` or `prefix` for units and symbols |
113
+ | `input-absolute-adornment` | warning | An absolutely positioned decorative sibling (`absolute` in `className`) next to `Input` inside a `relative` wrapper. Use `leadingIcon` or `trailingIcon` so the icon sits in the text box, not against the label |
114
+ | `legacy-package` | error | An import or `package.json` dependency of the retired private-registry package (see [CHANGELOG Migration](../CHANGELOG.md#migration)); install and import `@tonycodes-ui/mortar` instead. A `node_modules` copy of the old package does not count as installing the public one |
115
+ | `email-app-import` | error | In an email (a file importing `@tonycodes-ui/mortar/email` or React Email), an app component or `styles.css`, naming the email component to use. Raw elements in emails are not reported: email layout is tables |
116
+ | `email-peer-missing` | error | `@tonycodes-ui/mortar/email` is imported but `@react-email/components` is not in package.json |
117
+ | `missing-styles` | error | No import of `@tonycodes-ui/mortar/styles.css` |
118
+ | `styles-order` | warning | Mortar's styles imported before Tailwind |
119
+ | `missing-theme-provider` | warning | Mortar components rendered without a `ThemeProvider` |
120
+ | `kit-class` | warning | Mortar-internal class names on the app's own markup |
121
+ | `raw-colour` | warning | Hex, `rgb()`/`oklch()` colours or Tailwind palette classes in files that render Mortar components, except where they define a brand (`brandTokens`, `brandToCss`/`brandToStyle`/`registerBrand` arguments, `BrandDefinition` objects, `--m-brand-*` values) |
122
+ | `limited-data` | info | The installed release has no agent data, so a newer catalogue was used |
121
123
 
122
124
  The audit is a fast scanner, not a type checker. It checks JSX body children when a component's contract has no `children` slot (for example `<Switch>…</Switch>`). It does not see props passed through a spread (`{...props}`), components re-exported or wrapped under another name, class names built at runtime, or markup in `.vue`, `.svelte`, `.astro` or `.html` files. Run the app's typecheck and build as well.
123
125
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tonycodes-ui/mortar",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "Mortar: a shared design foundation, application and marketing UI for React and Tailwind.",
5
5
  "keywords": [
6
6
  "react",