@tollerud/ui 4.0.3 → 4.0.5

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/AGENTS.md CHANGED
@@ -39,10 +39,10 @@ npm install @tollerud/footer
39
39
  ```css
40
40
  /* app/globals.css */
41
41
  @import "@tollerud/ui/globals.css";
42
- @source "../node_modules/@tollerud/ui/dist";
42
+ @import "@tollerud/ui/source.css";
43
43
  ```
44
44
 
45
- Adjust `@source` relative to your CSS file. Without it, classes used only inside `@tollerud/ui` dist may be purged.
45
+ `source.css` resolves `@source` inside the installed package (npm, pnpm, workspaces, Bun). Without it, classes used only inside `@tollerud/ui` dist may be purged.
46
46
 
47
47
  **Optional preset shim** — extra utilities from `@tollerud/ui/preset`:
48
48
 
package/CHANGELOG.md CHANGED
@@ -7,6 +7,55 @@
7
7
  • Never write bold mid-paragraph as a heading substitute — it merges into surrounding text
8
8
  -->
9
9
 
10
+ ## 4.0.5 — 2026-06-10 — Starter template and DX docs
11
+
12
+ Patch release: human-facing Next.js starter, migration guide, and footer package tooling alignment. No breaking API changes.
13
+
14
+ ### Added
15
+
16
+ - `examples/next-starter/` — copy-paste Next.js 16 + Tailwind v4 reference app (`source.css`, `Toaster`, sample page)
17
+ - `GETTING_STARTED.md` — “Migrating from copied components” section (grep recipe, prop drift checklist, link to `SKILL.md`)
18
+
19
+ ### Changed
20
+
21
+ - `@tollerud/footer` — TypeScript 6.x in devDependencies; `sync-footer-package.mjs` preserves `tsup.config.ts` build and `publishConfig`
22
+ - `GETTING_STARTED.md` / `README.md` — footer self-contained dependency model documented; starter template linked
23
+ - `packages/footer/tsconfig.json` — `ignoreDeprecations: "6.0"` for DTS emit under TS 6
24
+
25
+ ### Migration
26
+
27
+ Nothing breaking. New apps can copy `examples/next-starter/` instead of wiring from scratch.
28
+
29
+ ---
30
+
31
+ ## 4.0.4 — 2026-06-10 — Export verification and source.css
32
+
33
+ Patch release: verifies all subpath exports in CI, adds package-owned Tailwind scanning, and expands install docs.
34
+
35
+ ### Added
36
+
37
+ - `@tollerud/ui/source.css` — package-owned `@source` for `dist` scanning (npm, pnpm, workspaces, Bun)
38
+ - `test:subpath` now checks all 70 manifest entries (`dist/{name}.js` + `.d.ts`)
39
+ - `test:package` runs attw against every public subpath export
40
+
41
+ ### Changed
42
+
43
+ - Recommended Tailwind v4 setup: `@import "@tollerud/ui/source.css"` after `globals.css`
44
+ - `GETTING_STARTED.md` — monorepo `@source` path table, footer-only minimal install
45
+ - `tailwind.css` re-exports `source.css` for one-import convenience
46
+ - Docs site getting-started page updated for `source.css`
47
+
48
+ ### Migration
49
+
50
+ Replace manual `@source "../node_modules/@tollerud/ui/dist"` with:
51
+
52
+ ```css
53
+ @import "@tollerud/ui/globals.css";
54
+ @import "@tollerud/ui/source.css";
55
+ ```
56
+
57
+ ---
58
+
10
59
  ## 4.0.3 — 2026-06-09 — Publish pipeline hardening
11
60
 
12
61
  Patch release: aligns npm publish with `validate`, fixes preset export shape, enables provenance via OIDC, and fixes `@tollerud/footer` CI build.
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Install
4
4
 
5
+ ### Full design system
6
+
7
+ Copy-paste — installs `@tollerud/ui` and all required peers:
8
+
5
9
  ```bash
6
10
  npm install @tollerud/ui clsx tailwind-merge tailwindcss@4 \
7
11
  @radix-ui/react-dialog @radix-ui/react-dropdown-menu @radix-ui/react-progress \
@@ -17,17 +21,64 @@ As of **v2.0.0**, Radix, Lucide, Framer Motion, and Sonner are **required peer d
17
21
  npm install @paper-design/shaders-react
18
22
  ```
19
23
 
24
+ ### Footer only (minimal)
25
+
26
+ If you only need the branded footer — no Tailwind, Radix, or other design-system peers:
27
+
28
+ ```bash
29
+ npm install @tollerud/footer
30
+ ```
31
+
32
+ ```tsx
33
+ import { Footer } from '@tollerud/footer'
34
+
35
+ <Footer />
36
+ ```
37
+
38
+ `@tollerud/footer` is **self-contained by design** — it bundles `clsx` and `tailwind-merge` so footer-only apps avoid extra peer installs. You still need Tailwind with Tollerud tokens (`@tollerud/ui/globals.css` or equivalent) for `text-tollerud-*` / `bg-tollerud-*` classes to resolve.
39
+
40
+ Use `@tollerud/ui` (or `@tollerud/ui/footer`) when you need the full component set. Apps using both packages may install duplicate `clsx` / `tailwind-merge` versions — harmless in practice; npm dedupes when ranges align.
41
+
42
+ ### Next.js starter
43
+
44
+ Copy [`examples/next-starter/`](../examples/next-starter/) from this repo — minimal App Router app with `globals.css`, `source.css`, sample page, and `Toaster` mounted.
45
+
46
+ ```bash
47
+ cp -R examples/next-starter my-app && cd my-app && npm install && npm run dev
48
+ ```
49
+
20
50
  ---
21
51
 
22
52
  ## Tailwind Setup (v4)
23
53
 
54
+ **Recommended** — package-owned `@source` (works with npm, pnpm, Yarn workspaces, and Bun):
55
+
24
56
  ```css
25
57
  /* app/globals.css */
26
58
  @import "@tollerud/ui/globals.css";
59
+ @import "@tollerud/ui/source.css";
60
+ ```
61
+
62
+ `globals.css` bundles Tailwind v4, design tokens, and all component layer styles. `source.css` points Tailwind at the installed package `dist` folder so component utility classes are not purged — no fragile `../node_modules` paths.
63
+
64
+ ### Manual `@source` path (monorepos / custom layouts)
65
+
66
+ If you prefer an explicit path, resolve it **relative to your CSS file** to `node_modules/@tollerud/ui/dist`:
67
+
68
+ | Layout | Example CSS file | `@source` path |
69
+ |--------|------------------|----------------|
70
+ | Next.js App Router (default) | `app/globals.css` | `../node_modules/@tollerud/ui/dist` |
71
+ | `src/` app dir | `src/app/globals.css` | `../../node_modules/@tollerud/ui/dist` |
72
+ | Turborepo / npm workspace app | `apps/web/app/globals.css` | `../../../node_modules/@tollerud/ui/dist` |
73
+ | pnpm (package in workspace) | `app/globals.css` | Prefer `@import "@tollerud/ui/source.css"` — hoisting varies |
74
+ | Bun | `app/globals.css` | Prefer `@import "@tollerud/ui/source.css"` |
75
+
76
+ ```css
77
+ @import "@tollerud/ui/globals.css";
27
78
  @source "../node_modules/@tollerud/ui/dist";
28
79
  ```
29
80
 
30
- `globals.css` bundles Tailwind v4, design tokens, and all component layer styles. Point `@source` at the package `dist` folder relative to your CSS file so component utility classes are not purged.
81
+ If styles disappear in production, the `@source` path is wrong switch to `@tollerud/ui/source.css` or fix the relative path.
31
82
 
32
83
  **Optional preset shim** — for extra theme tokens from `@tollerud/ui/preset` (`tollerud-preset.cjs`):
33
84
 
@@ -42,7 +93,7 @@ export default { presets: [tollerudPreset] }
42
93
  @config "./tailwind.config.ts";
43
94
  @import "@tollerud/ui/tokens.css";
44
95
  @import "@tollerud/ui/globals-layers.css";
45
- @source "../node_modules/@tollerud/ui/dist";
96
+ @import "@tollerud/ui/source.css";
46
97
  ```
47
98
 
48
99
  ### Tailwind v3 (legacy)
@@ -94,6 +145,37 @@ Use subpath imports (`@tollerud/ui/button`) for smaller client boundaries when s
94
145
 
95
146
  ---
96
147
 
148
+ ## Migrating from copied components
149
+
150
+ Older projects sometimes copied `Button.tsx`, `lib/utils.ts`, or whole `components/ui/` trees from this design system. Replace them with package imports.
151
+
152
+ ### Detect copied files
153
+
154
+ ```bash
155
+ grep -rl "tollerud-yellow\|tollerud-noir\|tollerud-surface" src --include="*.tsx" --include="*.ts"
156
+ ```
157
+
158
+ Also look for `components/ui/index.ts` re-exporting relative paths instead of `@tollerud/ui`.
159
+
160
+ ### Fix checklist
161
+
162
+ 1. Install the package and peers (see [Install](#install) above).
163
+ 2. Replace local imports — `import { Button } from '@/components/ui/Button'` → `import { Button } from '@tollerud/ui'` (or `@tollerud/ui/button`).
164
+ 3. Replace hand-rolled `cn()` — `import { cn } from '@tollerud/ui'` or `@tollerud/ui/utils`.
165
+ 4. Delete copied files after imports compile.
166
+ 5. Check **prop drift** against [SKILL.md](SKILL.md) — copied files may use outdated prop names (`onChange` vs `onValueChange`, etc.).
167
+ 6. Replace hardcoded hex (`#FFFF00`, `#0A0A0A`) with tokens (`text-tollerud-yellow`, `bg-tollerud-noir-950`).
168
+ 7. Add `<Toaster />` near the app root if you use Sonner toasts.
169
+ 8. Run `npx tsc --noEmit` and fix type errors from signature changes.
170
+
171
+ | Copied pattern | Fix |
172
+ |----------------|-----|
173
+ | `src/components/ui/Button.tsx` | Delete; import from `@tollerud/ui` |
174
+ | Local `lib/utils.ts` with `cn()` | Delete; `import { cn } from '@tollerud/ui/utils'` |
175
+ | `components/ui.ts` re-exporting relatives | Direct `@tollerud/ui` imports |
176
+
177
+ ---
178
+
97
179
  ## AI agents
98
180
 
99
181
  If you're using Claude Code or Cursor, sync [SKILL.md](SKILL.md) into your project skills folder — it reflects the actual current exports and known gotchas.
package/README.md CHANGED
@@ -15,7 +15,7 @@ A complete, browsable UI library built around **monochrome + yellow accent**. No
15
15
  | [`@tollerud/ui`](https://www.npmjs.com/package/@tollerud/ui) | `npm install @tollerud/ui` | You want the full design system — components, tokens, Tailwind preset |
16
16
  | [`@tollerud/footer`](https://www.npmjs.com/package/@tollerud/footer) | `npm install @tollerud/footer` | You only need the branded footer, with no other design system dependency |
17
17
 
18
- **Footer maintenance:** `@tollerud/ui` re-exports `Footer` from the same source as `@tollerud/footer`. Use the standalone `@tollerud/footer` package only when you want the footer without pulling in the full design system (and its peer deps). Both packages are maintained in this monorepo; version them together when the footer changes.
18
+ **Footer maintenance:** `@tollerud/ui` exports `Footer` from the same source as `@tollerud/footer` (`npm run sync:footer` keeps them lockstep). Use the standalone package when you want the branded footer without Radix, Lucide, Framer Motion, Sonner, or other `@tollerud/ui` peers — `@tollerud/footer` bundles `clsx` and `tailwind-merge` as dependencies **on purpose** for that path. You still need Tailwind + Tollerud tokens for footer styles. Deprecation of `@tollerud/footer` is not planned for now.
19
19
 
20
20
  ## Philosophy
21
21
 
@@ -25,6 +25,8 @@ Tollerud UI is minimal but not cold. It uses a near-black foundation with warm y
25
25
 
26
26
  ## Quick Start
27
27
 
28
+ **Starter template:** [`examples/next-starter/`](examples/next-starter/) — copy into a new project, `npm install`, `npm run dev`. See [GETTING_STARTED.md](GETTING_STARTED.md) for the full guide and migration from copied components.
29
+
28
30
  ### npm package (recommended)
29
31
 
30
32
  ```bash
@@ -42,14 +44,14 @@ As of **v2.0.0**, Radix primitives, Lucide, Framer Motion, and Sonner are **peer
42
44
  npm install @paper-design/shaders-react
43
45
  ```
44
46
 
45
- **CSS** — one import in `app/globals.css` (Tailwind v4 + tokens + component classes):
47
+ **CSS** — two imports in `app/globals.css` (Tailwind v4 + tokens + component class scanning):
46
48
 
47
49
  ```css
48
50
  @import '@tollerud/ui/globals.css';
49
- @source '../node_modules/@tollerud/ui/dist';
51
+ @import '@tollerud/ui/source.css';
50
52
  ```
51
53
 
52
- Adjust the `@source` path relative to your CSS file so it resolves to `node_modules/@tollerud/ui/dist`.
54
+ `source.css` resolves `@source` inside the installed package works with npm, pnpm, Yarn workspaces, and Bun. See [GETTING_STARTED.md](GETTING_STARTED.md) for manual `@source` paths in monorepos.
53
55
 
54
56
  **Optional preset shim** — if you need utilities from `@tollerud/ui/preset` beyond what `tokens.css` provides:
55
57
 
@@ -64,7 +66,7 @@ export default { presets: [tollerudPreset] }
64
66
  @config './tailwind.config.ts';
65
67
  @import '@tollerud/ui/tokens.css';
66
68
  @import '@tollerud/ui/globals-layers.css';
67
- @source '../node_modules/@tollerud/ui/dist';
69
+ @import '@tollerud/ui/source.css';
68
70
  ```
69
71
 
70
72
  **Tailwind v3 (legacy)** — preset in `tailwind.config.ts` plus `@tollerud/ui/globals-v3.css`:
package/SKILL.md CHANGED
@@ -27,7 +27,7 @@ Apply the Tailwind preset when you need extra utilities from `@tollerud/ui/prese
27
27
  ```css
28
28
  /* app/globals.css — Tailwind v4 (default) */
29
29
  @import "@tollerud/ui/globals.css";
30
- @source "../node_modules/@tollerud/ui/dist";
30
+ @import "@tollerud/ui/source.css";
31
31
  ```
32
32
 
33
33
  As of **v1.4.0**, charts (`BarChart`, `AreaChart`, `Donut`, `Sparkline`) and marketing blocks (`HeroBlock`, `FeatureCard`, `CTABand`) ship in the package. As of **v1.3.0**, `@tollerud/ui/globals.css` is the Tailwind v4 entry. Tailwind colors are under `tollerud.*` only (`text-tollerud-yellow`, `bg-tollerud-surface-raised`, etc.) — not `tia-*`.
package/globals.css CHANGED
@@ -4,7 +4,7 @@
4
4
  Usage in app/globals.css:
5
5
 
6
6
  @import '@tollerud/ui/globals.css';
7
- @source '../node_modules/@tollerud/ui/dist';
7
+ @import '@tollerud/ui/source.css';
8
8
 
9
9
  Optional preset shim (extra theme tokens from tollerud-preset.cjs):
10
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tollerud/ui",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "description": "Tollerud User Interface — dark, monochrome + yellow accent. Noir aesthetic meets modern utility.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -32,6 +32,7 @@
32
32
  "./globals-v3.css": "./globals-v3.css",
33
33
  "./globals-layers.css": "./globals-layers.css",
34
34
  "./tailwind.css": "./tailwind.css",
35
+ "./source.css": "./source.css",
35
36
  "./tokens.css": "./tokens.css",
36
37
  "./preset": "./tollerud-preset.cjs",
37
38
  "./brand/tollerud-logo.svg": "./brand/tollerud-logo.svg",
@@ -52,6 +53,7 @@
52
53
  "globals-v3.css",
53
54
  "globals-layers.css",
54
55
  "tailwind.css",
56
+ "source.css",
55
57
  "tokens.css",
56
58
  "tollerud-preset.cjs",
57
59
  "GETTING_STARTED.md",
package/source.css ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Tailwind v4 — scan @tollerud/ui dist for component utility classes.
3
+ *
4
+ * Import in app/globals.css after globals.css:
5
+ *
6
+ * @import "@tollerud/ui/globals.css";
7
+ * @import "@tollerud/ui/source.css";
8
+ *
9
+ * Paths resolve inside the installed package — works with npm, pnpm, Yarn
10
+ * workspaces, and Bun without fragile ../node_modules relative paths.
11
+ */
12
+ @source "./dist";
package/tailwind.css CHANGED
@@ -1,9 +1,6 @@
1
1
  /**
2
2
  * Convenience entry for Tailwind v4 consumers.
3
- * Re-exports globals + documents the @source path for class scanning.
3
+ * Re-exports globals + source scanning in one import.
4
4
  */
5
5
  @import "./globals.css";
6
-
7
- /* In your app globals.css, add after this import:
8
- @source "../node_modules/@tollerud/ui/dist";
9
- */
6
+ @import "./source.css";