@tonycodes-ui/mortar 0.23.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/CHANGELOG.md +2 -2
- package/DESIGN.md +2 -0
- package/catalog.json +299 -297
- package/cli/audit.mjs +302 -4
- package/cli/migrations.mjs +5 -0
- package/dist/agent-data.json +1 -1
- package/dist/auth.d.ts +2 -0
- package/dist/feedback.d.ts +1 -0
- package/docs/agents.md +26 -23
- package/docs/auth-flows.md +1 -1
- package/package.json +1 -1
- package/src/auth.tsx +2 -0
- package/src/feedback.tsx +1 -0
package/dist/auth.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export declare function ProviderButtons({ providers, layout, label, className, }
|
|
|
26
26
|
export declare function AuthHeader({ logo, title, description, headingLevel, headingId, className, titleClassName, }: {
|
|
27
27
|
logo?: ReactNode;
|
|
28
28
|
title: string;
|
|
29
|
+
/** Phrasing content only; rendered inside a `<p>`. */
|
|
29
30
|
description?: ReactNode;
|
|
30
31
|
headingLevel: HeadingLevel;
|
|
31
32
|
headingId: string;
|
|
@@ -35,6 +36,7 @@ export declare function AuthHeader({ logo, title, description, headingLevel, hea
|
|
|
35
36
|
export interface AuthLayoutProps {
|
|
36
37
|
/** The screen's heading, e.g. "Sign in to your account". */
|
|
37
38
|
title: string;
|
|
39
|
+
/** Phrasing content only (text, links, emphasis). Rendered inside a `<p>`. */
|
|
38
40
|
description?: ReactNode;
|
|
39
41
|
/** Logo node above the heading. */
|
|
40
42
|
logo?: ReactNode;
|
package/dist/feedback.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ export declare function SaveBar({ open, message, saveLabel, discardLabel, onSave
|
|
|
64
64
|
}): import("react").JSX.Element;
|
|
65
65
|
/** Site-wide announcement bar with an optional link and dismiss button. */
|
|
66
66
|
export declare function Banner({ children, action, onDismiss, label, dismissLabel, tone, variant, placement, id, className, }: {
|
|
67
|
+
/** Phrasing content only (text, links, emphasis). Rendered inside a `<p>`. */
|
|
67
68
|
children: ReactNode;
|
|
68
69
|
action?: LinkAction;
|
|
69
70
|
onDismiss?: () => void;
|
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,28 +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
|
|
99
|
-
|
|
|
100
|
-
| `not-declared`
|
|
101
|
-
| `not-installed`
|
|
102
|
-
| `version-mismatch`
|
|
103
|
-
| `unknown-export`
|
|
104
|
-
| `deep-import`
|
|
105
|
-
| `unknown-prop`
|
|
106
|
-
| `invalid-value`
|
|
107
|
-
| `css-override`
|
|
108
|
-
| `class-override`
|
|
109
|
-
| `local-copy`
|
|
110
|
-
| `raw-element`
|
|
111
|
-
| `
|
|
112
|
-
| `
|
|
113
|
-
| `
|
|
114
|
-
| `
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
119
|
-
| `
|
|
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 |
|
|
120
123
|
|
|
121
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.
|
|
122
125
|
|
package/docs/auth-flows.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Every auth screen is a page of its own, built from the same parts:
|
|
4
4
|
|
|
5
|
-
- **AuthLayout** is the page. It renders the `main` landmark and the page's `h1`, with an optional logo, description and footer link. `layout="center"` sets the form on the page, `layout="cards"` on a raised card, and `layout="split"` beside an `aside` (a quote or image) on wide screens.
|
|
5
|
+
- **AuthLayout** is the page. It renders the `main` landmark and the page's `h1`, with an optional logo, description and footer link. The description is phrasing-only (a string or inline markup): it sits inside a `<p>`, so a nested `<p>`, `<div>` or heading is invalid. `layout="center"` sets the form on the page, `layout="cards"` on a raised card, and `layout="split"` beside an `aside` (a quote or image) on wide screens.
|
|
6
6
|
- **ProviderButtons** lists sign-in providers (GitHub, Google, SSO). Separate them from the email form with `<Divider label="or continue with" soft spacing="none" />`.
|
|
7
7
|
- **PasswordInput** is every password field: a show/hide toggle, the right `autocomplete`, an optional requirement checklist and a strength meter.
|
|
8
8
|
- **CodeInput** is every one-time code: one input drawn as a cell per character.
|
package/package.json
CHANGED
package/src/auth.tsx
CHANGED
|
@@ -74,6 +74,7 @@ export function AuthHeader({
|
|
|
74
74
|
}: {
|
|
75
75
|
logo?: ReactNode;
|
|
76
76
|
title: string;
|
|
77
|
+
/** Phrasing content only; rendered inside a `<p>`. */
|
|
77
78
|
description?: ReactNode;
|
|
78
79
|
headingLevel: HeadingLevel;
|
|
79
80
|
headingId: string;
|
|
@@ -95,6 +96,7 @@ export function AuthHeader({
|
|
|
95
96
|
export interface AuthLayoutProps {
|
|
96
97
|
/** The screen's heading, e.g. "Sign in to your account". */
|
|
97
98
|
title: string;
|
|
99
|
+
/** Phrasing content only (text, links, emphasis). Rendered inside a `<p>`. */
|
|
98
100
|
description?: ReactNode;
|
|
99
101
|
/** Logo node above the heading. */
|
|
100
102
|
logo?: ReactNode;
|