@atomazing-org/design-system 1.2.9 → 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.
- package/README.MD +48 -13
- package/dist/index.d.ts +21 -1000
- package/dist/index.js +37 -118
- package/dist/presets/index.d.ts +20 -7
- package/dist/presets/index.js +357 -2
- package/dist/{typography-Dq0wCojD.d.mts → typography-B-BeIk0v.d.ts} +4 -5
- package/migrations/README.UPDATE.md +29 -0
- package/migrations/docs/migrations/design-system/README.md +69 -0
- package/migrations/docs/migrations/design-system/routes/adopt-existing/RUNBOOK.md +34 -0
- package/migrations/docs/migrations/design-system/routes/adopt-existing/migration.spec.json +54 -0
- package/migrations/docs/migrations/design-system/routes/greenfield/RUNBOOK.md +29 -0
- package/migrations/docs/migrations/design-system/routes/greenfield/migration.spec.json +36 -0
- package/migrations/docs/migrations/design-system/routes/mui4-to-latest/RUNBOOK.md +81 -0
- package/migrations/docs/migrations/design-system/routes/mui4-to-latest/migration.spec.json +70 -0
- package/migrations/docs/migrations/design-system/routes/mui4-to-latest/token-map.csv +4 -0
- package/migrations/docs/migrations/design-system/schema/migration.spec.schema.json +63 -0
- package/migrations/docs/migrations/design-system/shared/FOUNDATION.md +39 -0
- package/migrations/docs/migrations/design-system/shared/acceptance.md +27 -0
- package/migrations/docs/migrations/design-system/shared/gates.md +35 -0
- package/migrations/docs/migrations/design-system/shared/rollback.md +13 -0
- package/migrations/skills/design-system-migration-agent/SKILL.md +92 -0
- package/package.json +39 -17
- package/dist/chunk-OYZ4FCLV.mjs +0 -2
- package/dist/chunk-OYZ4FCLV.mjs.map +0 -1
- package/dist/index.d.mts +0 -1181
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -273
- package/dist/index.mjs.map +0 -1
- package/dist/presets/index.d.mts +0 -17
- package/dist/presets/index.js.map +0 -1
- package/dist/presets/index.mjs +0 -2
- package/dist/presets/index.mjs.map +0 -1
- 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
|
|
30
|
+
npm install react react-dom @mui/material @emotion/react @emotion/styled
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
Optional
|
|
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/
|
|
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/
|
|
386
|
+
## Examples (`examples/react-app`, `examples/next-app-router`)
|
|
355
387
|
|
|
356
|
-
The repo includes
|
|
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/
|
|
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
|
|