@atomazing-org/design-system 1.2.8 → 2.0.1

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.
Files changed (33) hide show
  1. package/README.MD +48 -13
  2. package/dist/index.d.ts +21 -1000
  3. package/dist/index.js +37 -118
  4. package/dist/presets/index.d.ts +20 -7
  5. package/dist/presets/index.js +357 -2
  6. package/dist/{typography-Dq0wCojD.d.mts → typography-B-BeIk0v.d.ts} +4 -5
  7. package/migrations/README.UPDATE.md +29 -0
  8. package/migrations/docs/migrations/design-system/README.md +69 -0
  9. package/migrations/docs/migrations/design-system/routes/adopt-existing/RUNBOOK.md +34 -0
  10. package/migrations/docs/migrations/design-system/routes/adopt-existing/migration.spec.json +54 -0
  11. package/migrations/docs/migrations/design-system/routes/greenfield/RUNBOOK.md +29 -0
  12. package/migrations/docs/migrations/design-system/routes/greenfield/migration.spec.json +36 -0
  13. package/migrations/docs/migrations/design-system/routes/mui4-to-latest/RUNBOOK.md +81 -0
  14. package/migrations/docs/migrations/design-system/routes/mui4-to-latest/migration.spec.json +70 -0
  15. package/migrations/docs/migrations/design-system/routes/mui4-to-latest/token-map.csv +4 -0
  16. package/migrations/docs/migrations/design-system/schema/migration.spec.schema.json +63 -0
  17. package/migrations/docs/migrations/design-system/shared/FOUNDATION.md +39 -0
  18. package/migrations/docs/migrations/design-system/shared/acceptance.md +27 -0
  19. package/migrations/docs/migrations/design-system/shared/gates.md +35 -0
  20. package/migrations/docs/migrations/design-system/shared/rollback.md +13 -0
  21. package/migrations/skills/design-system-migration-agent/SKILL.md +92 -0
  22. package/package.json +39 -17
  23. package/dist/chunk-OYZ4FCLV.mjs +0 -2
  24. package/dist/chunk-OYZ4FCLV.mjs.map +0 -1
  25. package/dist/index.d.mts +0 -1181
  26. package/dist/index.js.map +0 -1
  27. package/dist/index.mjs +0 -273
  28. package/dist/index.mjs.map +0 -1
  29. package/dist/presets/index.d.mts +0 -17
  30. package/dist/presets/index.js.map +0 -1
  31. package/dist/presets/index.mjs +0 -2
  32. package/dist/presets/index.mjs.map +0 -1
  33. package/dist/typography-Dq0wCojD.d.ts +0 -121
package/README.MD CHANGED
@@ -24,18 +24,26 @@ Install the library:
24
24
  npm install @atomazing-org/design-system
25
25
  ```
26
26
 
27
- Install required peer dependencies (MUI v7 + Emotion):
27
+ Install required peer dependencies (React 18/19 + MUI v7 + Emotion core):
28
28
 
29
29
  ```bash
30
- npm install @mui/material @mui/icons-material @emotion/react @emotion/styled
30
+ npm install react react-dom @mui/material @emotion/react @emotion/styled
31
31
  ```
32
32
 
33
- Optional (only if your project uses Emotion `css` helpers):
33
+ Optional peers:
34
+
35
+ - `@mui/icons-material` (only if your app imports MUI icons)
36
+ - `@emotion/css` (only if your project uses Emotion `css` helpers)
34
37
 
35
38
  ```bash
36
- npm install @emotion/css
39
+ npm install @mui/icons-material @emotion/css
37
40
  ```
38
41
 
42
+ ### Package format (v2)
43
+
44
+ `@atomazing-org/design-system` v2 is **ESM-only**.
45
+ Use ESM imports (`import ... from ...`). CommonJS `require()` is not supported.
46
+
39
47
  ---
40
48
 
41
49
  ## Quick start
@@ -125,11 +133,6 @@ Dark mode switches the active **scheme** inside the current preset.
125
133
 
126
134
  It’s the most common UX: the app automatically follows the user’s OS preference without custom code in every project.
127
135
 
128
- ### What about `auto`?
129
-
130
- `auto` is a **legacy alias** of `system` kept for backward compatibility (e.g., older stored settings).
131
- Recommendation: show **System** in UI, but accept `auto` as input and normalize it to `system`.
132
-
133
136
  Example selector:
134
137
 
135
138
  ```tsx
@@ -170,6 +173,34 @@ Note: when `darkMode` is set, `darkMode` is locked and `setDarkMode` is ignored.
170
173
 
171
174
  ---
172
175
 
176
+ ## Persistence (`appSettings`)
177
+
178
+ Theme selection is persisted in `localStorage` under the key `appSettings`.
179
+
180
+ v2 JSON shape:
181
+
182
+ ```json
183
+ { "themeId": "editorial-classic", "darkMode": "system" }
184
+ ```
185
+
186
+ Notes:
187
+ - v2 stores only `themeId` and `darkMode`.
188
+ - v2 does not migrate legacy stored formats (`theme`, `version`, `auto`); invalid/legacy payloads reset to defaults.
189
+
190
+ ---
191
+
192
+ ## App migration routes (repo docs)
193
+
194
+ If you are migrating an app to v2, use the route runbooks under:
195
+
196
+ - `migrations/docs/migrations/design-system/README.md`
197
+ - `migrations/docs/migrations/design-system/routes/*`
198
+
199
+ `examples/react-app` is the canonical Vite consumer smoke app for local v2 validation (`npm run smoke:react-app`).
200
+ `examples/next-app-router` is the canonical Next.js App Router SSR reference consumer (`npm run smoke:next`).
201
+
202
+ ---
203
+
173
204
  ## Custom themes
174
205
 
175
206
  Provide your own preset(s) to the provider. A preset is one identifiable theme with **two schemes**: `light` and `dark`.
@@ -314,7 +345,8 @@ From the repository root:
314
345
  pnpm lint
315
346
  pnpm build
316
347
  pnpm test
317
- pnpm -C examples/repro dev
348
+ pnpm -C examples/react-app dev
349
+ pnpm -C examples/next-app-router dev
318
350
  ```
319
351
 
320
352
  ---
@@ -351,24 +383,27 @@ Make sure your app installs these (MUI v7 + Emotion):
351
383
  - Create a `ThemePreset` with `colorSchemes.light` and `colorSchemes.dark`.
352
384
  - Combine with defaults: `const themes = [...defaultThemes, myPreset];`
353
385
 
354
- ## Examples (examples/repro)
386
+ ## Examples (`examples/react-app`, `examples/next-app-router`)
355
387
 
356
- The repo includes a runnable example app that demonstrates:
388
+ The repo includes runnable example apps that demonstrate:
357
389
  - preset switching
358
390
  - dark mode switching
359
391
  - background + card surfaces changing correctly
360
392
  - token/debug view (if enabled in the example)
393
+ - Next.js App Router SSR integration with a client provider boundary
361
394
 
362
395
  Run it from the repository root:
363
396
 
364
397
  ```bash
365
- pnpm -C examples/repro dev
398
+ pnpm -C examples/react-app dev
399
+ pnpm -C examples/next-app-router dev
366
400
  ```
367
401
 
368
402
  What to check in the UI:
369
403
  - switching to **dark** changes the **page background** and **Card/Paper** background
370
404
  - text stays readable on both backgrounds
371
405
  - inputs, buttons, menus, and dialogs remain usable
406
+ - Next.js example keeps SSR stable while theme state finalizes on the client
372
407
 
373
408
  ---
374
409