@inbeat/standards 0.12.2 → 0.14.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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.14.0](https://github.com/Genoux/ib-toolkit/compare/standards-v0.13.0...standards-v0.14.0) (2026-11-13)
4
+
5
+
6
+ ### Features
7
+
8
+ * enforce the type scale and show avatar stack names ([#70](https://github.com/Genoux/ib-toolkit/issues/70)) ([e6020e6](https://github.com/Genoux/ib-toolkit/commit/e6020e649762503db92358590822d603ebe8d29d))
9
+ * **ui:** set table cells to 13.5px ([#72](https://github.com/Genoux/ib-toolkit/issues/72)) ([3e1b5d5](https://github.com/Genoux/ib-toolkit/commit/3e1b5d5d80c36c99a6c2efd03fe26921110d39eb))
10
+
11
+ ## [0.13.0](https://github.com/Genoux/ib-toolkit/compare/standards-v0.12.2...standards-v0.13.0) (2026-11-12)
12
+
13
+
14
+ ### Features
15
+
16
+ * **ui:** add opt-in fieldtrip brand layer ([#68](https://github.com/Genoux/ib-toolkit/issues/68)) ([1e8f629](https://github.com/Genoux/ib-toolkit/commit/1e8f6296336e8e76c69787f374ba6b782c690abe))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * **standards:** keep markdown out of biome in new apps ([1e8f629](https://github.com/Genoux/ib-toolkit/commit/1e8f6296336e8e76c69787f374ba6b782c690abe))
22
+
3
23
  ## [0.12.2](https://github.com/Genoux/ib-toolkit/compare/standards-v0.12.1...standards-v0.12.2) (2026-10-19)
4
24
 
5
25
 
@@ -90,10 +90,22 @@ Server actions are queued per client; never use them for reads.
90
90
  component or variant is missing, stop and flag it for ib-toolkit; never invent, copy or patch
91
91
  one (a workaround needs the user's OK and a `// toolkit-gap:` comment).
92
92
  - Primitives and generic blocks from `@inbeat/ui/components/*`; tokens from
93
- `@inbeat/ui/theme.css`. A block moves to the toolkit only once an app actually uses it.
93
+ `@inbeat/ui/theme.css`, plus the opt-in Fieldtrip brand layer `@inbeat/ui/fieldtrip.css` (see
94
+ "Look" in the `ib-ui` skill). A block moves to the toolkit only once an app actually uses it.
94
95
  - Buttons are `rounded-full` with no destructive variant; destructive flows use
95
96
  `DestructiveActionDialog` from `@inbeat/ui`. Icon-only buttons get a tooltip. Lists use
96
97
  `DataTableShell` + `DataTable`; empty lists use `EmptyState`.
98
+ - Type scale: every text takes one of these roles and nothing sets a size or weight of its own
99
+ (`ib check` fails on `text-[13px]`, `font-[510]`, `font-bold`). Body `text-sm` (14px): inputs,
100
+ menu items, detail values, person names. Table cells are 13.5px, set by `Table`, and column
101
+ headers 13px, set by `TableHead`. Body strong `text-sm font-medium`: a row's identifying cell,
102
+ card titles, form labels, buttons, tabs. Caption `text-xs` muted: meta lines, timestamps,
103
+ hints. Tag `text-xs font-medium`: pills and count badges. Section title
104
+ `text-base font-semibold`; card, sheet and dialog title `text-lg font-semibold`; page title
105
+ `text-xl font-semibold`. Secondary information is `text-muted-foreground`, never smaller.
106
+ Weights are regular, medium and semibold. Larger named sizes are for display text on public
107
+ and onboarding screens. To change the scale, change it in ib-toolkit.
108
+ - People in a table are avatars only (`MemberAvatarStack`); it names them in a tooltip.
97
109
  - Radix via `radix-ui`; animation via `motion` only.
98
110
 
99
111
  ### Simplicity
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inbeat/standards",
3
- "version": "0.12.2",
3
+ "version": "0.14.0",
4
4
  "description": "Agent standards for inBeat apps: managed AGENTS.md block, skills under .agents/skills, ib CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -31,7 +31,7 @@
31
31
  "test": "bun --bun vitest run"
32
32
  },
33
33
  "devDependencies": {
34
- "@inbeat/config": "^0.12.2",
34
+ "@inbeat/config": "^0.14.0",
35
35
  "vitest": "^4.1.1"
36
36
  },
37
37
  "repository": {
@@ -152,6 +152,23 @@ Every module of `@inbeat/ui`, imported as `@inbeat/ui/<path>`.
152
152
  `next.config.ts`: `transpilePackages: ["@inbeat/ui"]` (ui ships source; core and next ship compiled JS).
153
153
  The template installs every peer the catalog needs.
154
154
 
155
+ ## Look: neutral, Fieldtrip, or product-specific
156
+
157
+ Decide this when the app starts and record it in the app's `AGENTS.md`. The components are the
158
+ same in all three; only tokens and app-owned components change.
159
+
160
+ - **Neutral** (default; dashboards and internal tools): `theme.css` alone.
161
+ - **Fieldtrip brand**: add `@import "@inbeat/ui/fieldtrip.css";` after `theme.css`. It gives the
162
+ brand palette as `--color-fieldtrip-<name>` and `-light` (ink, olive, orange, mauve, brown,
163
+ green, spring, yellow, sky, pink, powder; utilities like `bg-fieldtrip-orange`) and maps
164
+ `font-sans` to SwissNow and `font-serif` to Diplomat. The font files are licensed and stay in
165
+ the app: load them with `next/font/local` and put `--font-swiss-now` and `--font-diplomat` on
166
+ `<html>`.
167
+ - **Product-specific**: override tokens (`--primary`, `--radius`, ...) in the app's `globals.css`
168
+ after the imports, and build components only that product needs (a game card, a custom
169
+ dropdown) in the app, on the same tokens. They are not toolkit gaps and stay in the app until a
170
+ second app needs them. Never copy a toolkit component into the app to edit it.
171
+
155
172
  ## Adding or changing a component
156
173
 
157
174
  Do it in `ib-toolkit/packages/ui/src/components`, add or update its story in `packages/ui/stories`
package/src/cli.ts CHANGED
@@ -5,6 +5,7 @@ import { parseCreateArgs } from "./create-args";
5
5
  import { foundationProblems } from "./foundation";
6
6
  import { runMcp } from "./mcp";
7
7
  import { claudeFilesIgnoringAgents, staleFiles, write } from "./sync";
8
+ import { typeScaleProblems } from "./type-scale";
8
9
 
9
10
  const USAGE = [
10
11
  "usage: ib <create <dir> [--local] | sync [app-dir] | check [app-dir] | mcp>",
@@ -42,6 +43,7 @@ const commands: Record<string, () => number | Promise<number>> = {
42
43
  const stale = staleFiles(appDir);
43
44
  const ignoring = claudeFilesIgnoringAgents(appDir);
44
45
  const problems = foundationProblems(appDir);
46
+ const offScale = typeScaleProblems(appDir);
45
47
  if (stale.length > 0) {
46
48
  console.error(
47
49
  `out of date with @inbeat/standards, run \`ib sync\`:\n ${stale.join("\n ")}`,
@@ -56,7 +58,13 @@ const commands: Record<string, () => number | Promise<number>> = {
56
58
  if (problems.length > 0) {
57
59
  console.error(`not on the shared foundation:\n ${problems.join("\n ")}`);
58
60
  }
59
- return stale.length + ignoring.length + problems.length === 0 ? 0 : 1;
61
+ if (offScale.length > 0) {
62
+ console.error(
63
+ 'outside the type scale (see "UI" in the standard; pick a role, or change the scale in ' +
64
+ `ib-toolkit):\n ${offScale.join("\n ")}`,
65
+ );
66
+ }
67
+ return stale.length + ignoring.length + problems.length + offScale.length === 0 ? 0 : 1;
60
68
  },
61
69
  mcp: () =>
62
70
  runMcp(args, {
@@ -0,0 +1,41 @@
1
+ import { existsSync, readdirSync, readFileSync } from "node:fs";
2
+ import { join, relative } from "node:path";
3
+
4
+ // The type scale lives in @inbeat/ui and in the "UI" section of the standard. An app picks a
5
+ // role (text-sm, text-xs, text-base, ...) and never a size or weight of its own, so a change of
6
+ // scale happens once, in the toolkit.
7
+ // `em` sizes are relative to their parent (inline code in running text), so they follow the scale.
8
+ const OFF_SCALE = [
9
+ { pattern: /\btext-\[[\d.]+(?:px|rem)\]/g, reason: "hand-set font size" },
10
+ { pattern: /\bfont-\[\d+\]/g, reason: "hand-set font weight" },
11
+ {
12
+ pattern: /\bfont-(?:bold|extrabold|black)\b/g,
13
+ reason: "weight outside regular, medium, semibold",
14
+ },
15
+ ];
16
+
17
+ function sourceFiles(dir: string): string[] {
18
+ return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
19
+ const path = join(dir, entry.name);
20
+ if (entry.isDirectory()) return sourceFiles(path);
21
+ return entry.name.endsWith(".tsx") ? [path] : [];
22
+ });
23
+ }
24
+
25
+ /** `src/file.tsx:12 text-[13px] (hand-set font size)` for every class outside the type scale. */
26
+ export function typeScaleProblems(appDir: string): string[] {
27
+ const srcDir = join(appDir, "src");
28
+ if (!existsSync(srcDir)) return [];
29
+
30
+ return sourceFiles(srcDir).flatMap((path) =>
31
+ readFileSync(path, "utf8")
32
+ .split("\n")
33
+ .flatMap((line, index) =>
34
+ OFF_SCALE.flatMap(({ pattern, reason }) =>
35
+ [...line.matchAll(pattern)].map(
36
+ ([className]) => `${relative(appDir, path)}:${index + 1} ${className} (${reason})`,
37
+ ),
38
+ ),
39
+ ),
40
+ );
41
+ }
@@ -152,6 +152,23 @@ Every module of `@inbeat/ui`, imported as `@inbeat/ui/<path>`.
152
152
  `next.config.ts`: `transpilePackages: ["@inbeat/ui"]` (ui ships source; core and next ship compiled JS).
153
153
  The template installs every peer the catalog needs.
154
154
 
155
+ ## Look: neutral, Fieldtrip, or product-specific
156
+
157
+ Decide this when the app starts and record it in the app's `AGENTS.md`. The components are the
158
+ same in all three; only tokens and app-owned components change.
159
+
160
+ - **Neutral** (default; dashboards and internal tools): `theme.css` alone.
161
+ - **Fieldtrip brand**: add `@import "@inbeat/ui/fieldtrip.css";` after `theme.css`. It gives the
162
+ brand palette as `--color-fieldtrip-<name>` and `-light` (ink, olive, orange, mauve, brown,
163
+ green, spring, yellow, sky, pink, powder; utilities like `bg-fieldtrip-orange`) and maps
164
+ `font-sans` to SwissNow and `font-serif` to Diplomat. The font files are licensed and stay in
165
+ the app: load them with `next/font/local` and put `--font-swiss-now` and `--font-diplomat` on
166
+ `<html>`.
167
+ - **Product-specific**: override tokens (`--primary`, `--radius`, ...) in the app's `globals.css`
168
+ after the imports, and build components only that product needs (a game card, a custom
169
+ dropdown) in the app, on the same tokens. They are not toolkit gaps and stay in the app until a
170
+ second app needs them. Never copy a toolkit component into the app to edit it.
171
+
155
172
  ## Adding or changing a component
156
173
 
157
174
  Do it in `ib-toolkit/packages/ui/src/components`, add or update its story in `packages/ui/stories`
@@ -93,10 +93,22 @@ Server actions are queued per client; never use them for reads.
93
93
  component or variant is missing, stop and flag it for ib-toolkit; never invent, copy or patch
94
94
  one (a workaround needs the user's OK and a `// toolkit-gap:` comment).
95
95
  - Primitives and generic blocks from `@inbeat/ui/components/*`; tokens from
96
- `@inbeat/ui/theme.css`. A block moves to the toolkit only once an app actually uses it.
96
+ `@inbeat/ui/theme.css`, plus the opt-in Fieldtrip brand layer `@inbeat/ui/fieldtrip.css` (see
97
+ "Look" in the `ib-ui` skill). A block moves to the toolkit only once an app actually uses it.
97
98
  - Buttons are `rounded-full` with no destructive variant; destructive flows use
98
99
  `DestructiveActionDialog` from `@inbeat/ui`. Icon-only buttons get a tooltip. Lists use
99
100
  `DataTableShell` + `DataTable`; empty lists use `EmptyState`.
101
+ - Type scale: every text takes one of these roles and nothing sets a size or weight of its own
102
+ (`ib check` fails on `text-[13px]`, `font-[510]`, `font-bold`). Body `text-sm` (14px): inputs,
103
+ menu items, detail values, person names. Table cells are 13.5px, set by `Table`, and column
104
+ headers 13px, set by `TableHead`. Body strong `text-sm font-medium`: a row's identifying cell,
105
+ card titles, form labels, buttons, tabs. Caption `text-xs` muted: meta lines, timestamps,
106
+ hints. Tag `text-xs font-medium`: pills and count badges. Section title
107
+ `text-base font-semibold`; card, sheet and dialog title `text-lg font-semibold`; page title
108
+ `text-xl font-semibold`. Secondary information is `text-muted-foreground`, never smaller.
109
+ Weights are regular, medium and semibold. Larger named sizes are for display text on public
110
+ and onboarding screens. To change the scale, change it in ib-toolkit.
111
+ - People in a table are avatars only (`MemberAvatarStack`); it names them in a tooltip.
100
112
  - Radix via `radix-ui`; animation via `motion` only.
101
113
 
102
114
  ### Simplicity
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "extends": ["@inbeat/config/biome"],
3
3
  "files": {
4
- "includes": ["**", "!!**/.next", "!**/next-env.d.ts"]
4
+ "includes": ["**", "!!**/.next", "!**/next-env.d.ts", "!**/*.md"]
5
5
  }
6
6
  }