@atomazing-org/design-system 2.0.1 → 3.7.2

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 (28) hide show
  1. package/AGENTS.md +92 -0
  2. package/README.MD +263 -335
  3. package/dist/index.d.ts +11 -15
  4. package/dist/index.js +22 -22
  5. package/dist/presets/index.d.ts +15 -2
  6. package/dist/presets/index.js +315 -313
  7. package/dist/themePresets-CwgG5XEL.d.ts +65 -0
  8. package/dist/themePresets-CwgG5XEL.js +1 -0
  9. package/migrations/README.UPDATE.md +34 -20
  10. package/migrations/docs/migrations/design-system/README.md +48 -17
  11. package/migrations/docs/migrations/design-system/routes/adopt-existing/AEROCRM-EXAMPLE.md +197 -0
  12. package/migrations/docs/migrations/design-system/routes/adopt-existing/RUNBOOK.md +185 -25
  13. package/migrations/docs/migrations/design-system/routes/adopt-existing/migration.spec.json +84 -20
  14. package/migrations/docs/migrations/design-system/routes/greenfield/RUNBOOK.md +57 -25
  15. package/migrations/docs/migrations/design-system/routes/greenfield/migration.spec.json +37 -14
  16. package/migrations/docs/migrations/design-system/routes/mui4-to-latest/RUNBOOK.md +136 -77
  17. package/migrations/docs/migrations/design-system/routes/mui4-to-latest/migration.spec.json +104 -29
  18. package/migrations/docs/migrations/design-system/shared/WORKING-RULES.md +194 -0
  19. package/migrations/docs/migrations/design-system/shared/acceptance.md +76 -20
  20. package/migrations/docs/migrations/design-system/shared/common-regressions.md +218 -0
  21. package/migrations/docs/migrations/design-system/shared/gates.md +39 -3
  22. package/migrations/docs/migrations/design-system/shared/manual-qa-matrix.md +70 -0
  23. package/migrations/docs/migrations/design-system/shared/phase-exit-criteria.md +129 -0
  24. package/migrations/docs/migrations/design-system/shared/phases.md +377 -0
  25. package/migrations/skills/design-system-consumer-agent/SKILL.md +84 -0
  26. package/migrations/skills/design-system-migration-agent/SKILL.md +75 -9
  27. package/package.json +14 -4
  28. package/dist/typography-B-BeIk0v.d.ts +0 -120
@@ -0,0 +1,377 @@
1
+ # Shared Migration Phases
2
+
3
+ Use this document as the canonical step-by-step execution checklist for future
4
+ consumer app migrations to `@atomazing-org/design-system`.
5
+
6
+ Read this after route selection and before editing the target app.
7
+ Then combine it with:
8
+
9
+ - the selected route runbook
10
+ - the selected route `migration.spec.json`
11
+ - `shared/common-regressions.md`
12
+ - `shared/phase-exit-criteria.md`
13
+ - `shared/manual-qa-matrix.md`
14
+ - `shared/gates.md`
15
+ - `shared/acceptance.md`
16
+
17
+ ## How To Use This Playbook
18
+
19
+ 1. Detect the route first:
20
+ - `greenfield`
21
+ - `adopt-existing`
22
+ - `mui4-to-latest`
23
+ 2. Build the migration plan from the phases below.
24
+ 3. Keep the app runnable at the end of each phase.
25
+ 4. Run the relevant checks before moving to the next phase.
26
+ 5. Do not merge unrelated change classes into one unvalidated batch.
27
+
28
+ ## Phase Map
29
+
30
+ 1. Route selection and scope
31
+ 2. Baseline and safety net
32
+ 3. Dependency landing
33
+ 4. Mechanical migration or provider landing
34
+ 5. Runtime startup cleanup
35
+ 6. Shared infrastructure stabilization
36
+ 7. Token, typography, and primitive cleanup
37
+ 8. Domain migration waves
38
+ 9. Final gates and closeout
39
+
40
+ ## Phase 1: Route Selection And Scope
41
+
42
+ Goal:
43
+ Select the correct route and define the migration boundary before code changes.
44
+
45
+ Do:
46
+
47
+ - inspect `package.json`, imports, theme entrypoints, and current design-system usage
48
+ - choose the route:
49
+ - `mui4-to-latest` if `@material-ui/*` is present
50
+ - `greenfield` if the app is new and has no legacy theme or token layer
51
+ - `adopt-existing` otherwise
52
+ - identify:
53
+ - app root and provider wiring
54
+ - theme state source of truth
55
+ - shared shell and layout containers
56
+ - shared overlays
57
+ - protected routes
58
+ - token modules and hardcoded visual drift
59
+ - repo-local gates such as style, design, or typography contract scripts
60
+
61
+ Output:
62
+
63
+ - selected route and why
64
+ - initial migration scope
65
+ - list of required validation commands
66
+
67
+ Stop gate:
68
+
69
+ - the route is explicit
70
+ - the app areas at highest regression risk are named
71
+
72
+ Route notes:
73
+
74
+ - `greenfield`: scope is usually limited to provider wiring, app theme module, and startup safety
75
+ - `adopt-existing`: include provider, tokens, shared shell, shared overlays, and consumer primitives
76
+ - `mui4-to-latest`: also inventory legacy styling APIs, MUI v4 imports, and codemod impact zones
77
+
78
+ ## Phase 2: Baseline And Safety Net
79
+
80
+ Goal:
81
+ Capture the repo state before migration and make regressions visible early.
82
+
83
+ Do:
84
+
85
+ - run the repo's normal commands:
86
+ - `npm run lint` when present
87
+ - `npm test` when present
88
+ - `npm run build`
89
+ - run repo-local contract gates when present:
90
+ - `npm run lint:style-contract`
91
+ - `npm run lint:design-contract`
92
+ - `npm run lint:typography-contract`
93
+ - record pre-existing red checks separately from migration defects
94
+ - add or tighten smoke coverage before broad rewrites when the app has:
95
+ - a shared shell
96
+ - protected routes
97
+ - shared overlays
98
+ - dashboards, analytics, or dense workflow screens
99
+
100
+ Output:
101
+
102
+ - baseline check matrix
103
+ - known pre-existing failures
104
+ - smoke coverage plan
105
+
106
+ Stop gate:
107
+
108
+ - you can tell whether a later failure is new or pre-existing
109
+ - shell-critical or overlay-critical changes are covered by at least one route check
110
+
111
+ Route notes:
112
+
113
+ - `greenfield`: a simple startup check may be enough
114
+ - `adopt-existing`: shell and at least one real content route should be covered
115
+ - `mui4-to-latest`: add smoke coverage before codemod fallout reaches shared UI
116
+
117
+ ## Phase 3: Dependency Landing
118
+
119
+ Goal:
120
+ Land the dependency set needed for the target route without mixing in broad UI cleanup.
121
+
122
+ Do:
123
+
124
+ - update `package.json` directly
125
+ - add or align:
126
+ - `@atomazing-org/design-system`
127
+ - `@mui/material`
128
+ - `@mui/icons-material` when needed
129
+ - `@emotion/react`
130
+ - `@emotion/styled`
131
+ - remove route-incompatible packages such as `@material-ui/*`
132
+ - install dependencies with the repo's package manager
133
+ - if install scripts fail because of local tooling, retry with the package manager's `--ignore-scripts` equivalent only as recovery
134
+
135
+ Output:
136
+
137
+ - dependency set aligned with the chosen route
138
+ - install completed
139
+
140
+ Stop gate:
141
+
142
+ - the repo installs successfully
143
+ - dependency conflicts do not block the next phase
144
+
145
+ Route notes:
146
+
147
+ - `greenfield`: this is usually the main dependency phase
148
+ - `adopt-existing`: keep adjacent runtime alignment small and controlled
149
+ - `mui4-to-latest`: remove legacy Material-UI packages before broad theme unification
150
+
151
+ ## Phase 4: Mechanical Migration Or Provider Landing
152
+
153
+ Goal:
154
+ Reach the route-specific structural landing point before visual cleanup.
155
+
156
+ Do:
157
+
158
+ - `greenfield`:
159
+ - connect `ThemeProviderWrapper` at the app root
160
+ - create one explicit app theme module for preset choice when needed
161
+ - add theme controls only through `useThemeSettings()`
162
+ - `adopt-existing`:
163
+ - connect or normalize `ThemeProviderWrapper`
164
+ - remove competing root theme providers
165
+ - replace outdated design-system imports with public APIs or local app abstractions
166
+ - move preset selection into one app-owned theme module
167
+ - `mui4-to-latest`:
168
+ - run the official MUI codemod
169
+ - resolve compile breaks from the codemod
170
+ - replace JSS-only APIs and legacy theme APIs
171
+ - get the app stable on modern MUI plus Emotion before provider unification
172
+
173
+ Output:
174
+
175
+ - route-specific mechanical landing completed
176
+
177
+ Stop gate:
178
+
179
+ - the app compiles after the structural change
180
+ - there is one clear theme-root direction
181
+
182
+ ## Phase 5: Runtime Startup Cleanup
183
+
184
+ Goal:
185
+ Prove the app actually boots in a browser and remove startup defects before deeper cleanup.
186
+
187
+ Do:
188
+
189
+ - start the app with the normal dev or start command
190
+ - open the first route in a real browser
191
+ - fix:
192
+ - browser console startup errors
193
+ - migration-caused startup warnings
194
+ - duplicate runtime singleton loading for `react`, `react-dom`, `@emotion/react`, `@emotion/styled`
195
+ - remove module-scope code that depends on:
196
+ - `window`
197
+ - `document`
198
+ - `navigator`
199
+ - storage
200
+ - i18n locale activation
201
+ - move browser listeners into effects with cleanup
202
+ - if smoke mode bypasses auth, seed a deterministic role-bearing user for protected routes
203
+
204
+ Output:
205
+
206
+ - startup-clean browser boot
207
+
208
+ Stop gate:
209
+
210
+ - first route loads successfully
211
+ - migration-caused startup errors are gone
212
+
213
+ ## Phase 6: Shared Infrastructure Stabilization
214
+
215
+ Goal:
216
+ Stabilize the app shell and shared UI contracts before domain-by-domain feature work.
217
+
218
+ Do:
219
+
220
+ - preserve shell layout behavior:
221
+ - display mode
222
+ - grid or flex template
223
+ - `min-width`
224
+ - `min-height`
225
+ - `overflow`
226
+ - scroll behavior
227
+ - keep route roots and page containers filling the intended workspace
228
+ - if shared padded containers also fill width, normalize with `box-sizing: border-box` or remove forced width
229
+ - restore overlay semantics:
230
+ - stable `aria-labelledby`
231
+ - stable `aria-describedby`
232
+ - labeled close actions
233
+ - `combobox` and `listbox` semantics for searchable overlays
234
+ - audit shared charts, legends, chips, metric badges, and segmented filters for preset drift
235
+ - remove placeholder regressions and low-fidelity pass-through wrappers
236
+ - if analytics dashboards or metric cards are touched:
237
+ - keep labels and values on different hierarchy levels
238
+ - keep one explicit grid gap contract
239
+ - remove accidental full-width spans that break desktop rows
240
+
241
+ Output:
242
+
243
+ - stable shared shell
244
+ - stable shared overlays
245
+ - stable shared dashboard or compact-control contracts
246
+
247
+ Stop gate:
248
+
249
+ - desktop and mobile shell behavior matches the intended layout
250
+ - shared UI is usable and semantically wired
251
+
252
+ ## Phase 7: Token, Typography, And Primitive Cleanup
253
+
254
+ Goal:
255
+ Move the consumer toward the design-system contract instead of preserving legacy local drift.
256
+
257
+ Do:
258
+
259
+ - replace legacy tokens with `theme.palette`, `theme.typography`, and helpers such as `alpha()`
260
+ - normalize visible text:
261
+ - `Typography`
262
+ - explicit semantic `variant`
263
+ - `Typography component="span"` for visible text inside interactive controls
264
+ - remove zero-value wrappers:
265
+ - primitive wrappers
266
+ - surface wrappers
267
+ - simplify decorative consumer chrome that fights the preset:
268
+ - gradients
269
+ - direct shadow styling
270
+ - palette alpha suffix hacks
271
+ - if the repo needs guardrails, add or tighten:
272
+ - design-contract lint
273
+ - typography-contract lint
274
+ - if localized copy was touched, scan for mojibake or replacement characters and verify a real localized route
275
+
276
+ Output:
277
+
278
+ - token and text layer aligned with the design-system contract
279
+
280
+ Stop gate:
281
+
282
+ - typography and design drift are reduced, not just moved around
283
+ - the repo has enough local gates to keep the fix from regressing
284
+
285
+ ## Phase 8: Domain Migration Waves
286
+
287
+ Goal:
288
+ Migrate feature areas in controlled batches after shared infrastructure is stable.
289
+
290
+ Do:
291
+
292
+ - move feature areas one wave at a time
293
+ - keep each wave small enough to validate independently
294
+ - after each wave, re-run the relevant checks:
295
+ - smoke
296
+ - lint
297
+ - route checks
298
+ - build when the wave changes bundling or shared runtime behavior
299
+ - stop if a wave reintroduces shell, overlay, typography, or token regressions
300
+
301
+ Output:
302
+
303
+ - migrated domains with isolated validation history
304
+
305
+ Stop gate:
306
+
307
+ - each wave ends in a runnable, validated state
308
+
309
+ ## Phase 9: Final Gates And Closeout
310
+
311
+ Goal:
312
+ Close the migration only after runtime, route, and contract checks are all green.
313
+
314
+ Do:
315
+
316
+ - re-run:
317
+ - `npm run lint`
318
+ - `npm test`
319
+ - `npm run build`
320
+ - `npm run test:smoke` when present
321
+ - repo-local contract gates when present
322
+ - verify route-specific exit conditions:
323
+ - no `@material-ui/*` left for `mui4-to-latest`
324
+ - provider wiring and preset ownership are correct
325
+ - no migration-caused startup warnings remain
326
+ - record any remaining upstream-only warnings precisely by package and file
327
+ - write the migration summary:
328
+ - route used
329
+ - commands run
330
+ - startup issues fixed
331
+ - remaining manual QA
332
+ - rollback guidance if partial
333
+
334
+ Output:
335
+
336
+ - migration report suitable for future reuse
337
+
338
+ Stop gate:
339
+
340
+ - shared acceptance is satisfied
341
+ - the app is browser-runnable, not only build-green
342
+
343
+ ## Recommended Phase Splits By Route
344
+
345
+ `greenfield`:
346
+
347
+ 1. Route selection and baseline
348
+ 2. Dependency landing
349
+ 3. Provider landing
350
+ 4. Runtime startup cleanup
351
+ 5. Final gates
352
+
353
+ `adopt-existing`:
354
+
355
+ 1. Route selection and baseline
356
+ 2. Safety net
357
+ 3. Dependency landing
358
+ 4. Provider and theme unification
359
+ 5. Runtime cleanup
360
+ 6. Shared infrastructure stabilization
361
+ 7. Token and typography cleanup
362
+ 8. Domain waves
363
+ 9. Final gates
364
+
365
+ `mui4-to-latest`:
366
+
367
+ 1. Route selection and baseline
368
+ 2. Safety net
369
+ 3. Dependency landing
370
+ 4. Mechanical MUI migration
371
+ 5. Legacy styling cleanup
372
+ 6. Provider and theme unification
373
+ 7. Runtime cleanup
374
+ 8. Shared infrastructure stabilization
375
+ 9. Token and typography cleanup
376
+ 10. Domain waves
377
+ 11. Final gates
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: design-system-consumer-agent
3
+ description: Rules for integrating and maintaining @atomazing-org/design-system in application repos. Use when an AI agent needs to add the library, wire it into an app, or decide whether the request should become a route-based migration.
4
+ ---
5
+
6
+ # Design System Consumer Agent
7
+
8
+ Use this skill whenever the task is about adopting, integrating, or maintaining
9
+ `@atomazing-org/design-system` in an application repository.
10
+
11
+ ## Source Of Truth
12
+
13
+ 1. Read `../../docs/migrations/design-system/shared/WORKING-RULES.md`.
14
+ 2. Use `../../docs/migrations/design-system/README.md` for route selection context.
15
+ 3. If migration is needed, switch to `../design-system-migration-agent/SKILL.md`.
16
+
17
+ ## Default Workflow
18
+
19
+ 1. Inspect the target app:
20
+ - current dependencies
21
+ - current theme provider setup
22
+ - theme or token modules
23
+ - SSR or Next.js usage
24
+ 2. Apply the working rules from `WORKING-RULES.md`.
25
+ 3. Decide whether the task is:
26
+ - a normal integration task
27
+ - or a route-based migration
28
+
29
+ ## Escalate To Migration
30
+
31
+ Escalate to the migration workflow if any of these are true:
32
+
33
+ - `@material-ui/*` exists
34
+ - the app already has a substantial theme/token system
35
+ - the request would leave dual theme providers or dual sources of truth
36
+ - the user asks to standardize or replace the design foundation
37
+ - changes affect a large set of colors, typography, or component overrides
38
+
39
+ When escalation is needed:
40
+
41
+ 1. State that route-based migration is recommended.
42
+ 2. Select the route:
43
+ - `mui4-to-latest`
44
+ - `greenfield`
45
+ - `adopt-existing`
46
+ 3. Load `../design-system-migration-agent/SKILL.md`.
47
+ 4. For large repos, execute the selected route phase by phase instead of batching broad edits into one pass.
48
+
49
+ ## Normal Integration Expectations
50
+
51
+ When migration is not needed:
52
+
53
+ - use public imports only
54
+ - prefer `ThemeProviderWrapper`
55
+ - prefer `useThemeSettings()`
56
+ - use `defaultThemes`, `landingPageThemes`, or `allBuiltInThemes` intentionally
57
+ - keep preset choice in one explicit app-owned theme module instead of generic constants passthrough files
58
+ - let the active preset own the visual treatment of `Paper`, `Card`, `Dialog`, `Drawer`, and similar surfaces across the app
59
+ - do not hand-style consumer surfaces with app-local glow, bloom, blur, decorative borders, gradient washes, or pseudo-element chrome; those belong in presets/theme overrides
60
+ - keep app styling focused on layout, spacing, sizing, and content hierarchy
61
+ - if the app shell exposes a dedicated workspace or content pane, keep route roots and page containers stretched to fill it instead of shrinking to intrinsic content width
62
+ - for landing and marketing surfaces, prefer MUI-native preview composition over custom decorative UI logic
63
+ - do not hand-style landing surfaces with app-local glow, bloom, blur, decorative borders, gradient washes, or pseudo-element chrome; those belong in presets/theme overrides
64
+ - do not build nested rectangular surface hierarchies such as `card inside card inside card`
65
+ - keep one primary surface per logical block and use `Stack`, `List`, `Divider`, `Typography`, `Chip`, and `Avatar` before introducing another bordered layer
66
+ - keep landing preview blocks spacious and reduce content before compressing spacing
67
+ - remove zero-value wrappers that only rename MUI primitives or surfaces
68
+ - do not leave large inline `sx` objects in JSX; if a component needs substantial styling, extract a local `styled(...)` component in the same file and keep those styled declarations near the bottom
69
+ - if multiple role pages share the same shell, extract a shared workflow layout before changing visuals independently
70
+ - if a local barrel creates chunk-cycle warnings, prefer direct local imports for the affected workflow internals
71
+ - fix consumer-owned build warnings such as stale PWA asset globs or oversized local chunks instead of silencing them
72
+ - if a remaining warning belongs to an upstream toolchain package, record it precisely as external debt
73
+ - keep visible text on `Typography` with explicit semantic variants instead of raw JSX text nodes
74
+ - when buttons, chips, alerts, menu items, or toggle buttons show text, wrap that label in `Typography component="span"`
75
+ - keep compact legends, chips, segmented filters, and metric badges visually aligned with the active preset instead of restyling them into ad hoc chip-like chrome
76
+ - when shared dialogs, drawers, or bottom sheets are touched, keep stable `aria-labelledby` and `aria-describedby` wiring plus labeled close actions
77
+ - when an overlay owns filtered keyboard navigation, use `combobox` and `listbox` semantics instead of generic wrapper markup
78
+ - keep browser event listeners such as `beforeinstallprompt` or `matchMedia` subscriptions inside effects with cleanup
79
+ - remove zero-value surface wrappers that only forward to MUI `Card` or `Paper`
80
+ - use `alpha()` or equivalent theme helpers instead of palette-string alpha suffix hacks
81
+ - treat decorative gradients and shadow styling as migration defects unless the component is an explicit preview exception documented in the repo-local design-contract gate
82
+ - keep browser-only APIs out of module scope
83
+ - after dependency or provider wiring changes, start the app and verify the first route boots without browser console startup errors
84
+ - if bulk rewrites or localized copy changes were part of the work, keep files in UTF-8, scan for mojibake or replacement characters, and verify readable text on a real route
@@ -9,20 +9,32 @@ Use this skill to run a design-system migration as an AI-guided workflow.
9
9
 
10
10
  Treat `migrations/docs/migrations/design-system/` as the source of truth.
11
11
  Treat `migrations/scripts/` as optional legacy automation/reference, not a requirement.
12
+ Read `../../docs/migrations/design-system/shared/WORKING-RULES.md` before selecting the route.
12
13
 
13
14
  ## Quick start
14
15
 
15
16
  1. Read `../../docs/migrations/design-system/README.md`.
16
- 2. Detect the route from the target app (`package.json`, imports, current theme setup).
17
- 3. Read only the selected route files:
17
+ 2. Read `../../docs/migrations/design-system/shared/WORKING-RULES.md`.
18
+ 3. Read `../../docs/migrations/design-system/shared/phases.md`.
19
+ 4. Detect the route from the target app (`package.json`, imports, current theme setup).
20
+ 5. Read only the selected route files:
18
21
  - `../../docs/migrations/design-system/routes/<route>/RUNBOOK.md`
19
22
  - `../../docs/migrations/design-system/routes/<route>/migration.spec.json`
20
- 4. Read shared checks:
23
+ 6. Read shared checks:
21
24
  - `../../docs/migrations/design-system/shared/FOUNDATION.md`
25
+ - `../../docs/migrations/design-system/shared/WORKING-RULES.md`
26
+ - `../../docs/migrations/design-system/shared/phases.md`
27
+ - `../../docs/migrations/design-system/shared/phase-exit-criteria.md`
28
+ - `../../docs/migrations/design-system/shared/common-regressions.md`
29
+ - `../../docs/migrations/design-system/shared/manual-qa-matrix.md`
22
30
  - `../../docs/migrations/design-system/shared/gates.md`
23
31
  - `../../docs/migrations/design-system/shared/acceptance.md`
24
32
  - `../../docs/migrations/design-system/shared/rollback.md` (before risky edits)
25
- 5. Execute the migration in small commits, validating after each major step.
33
+ 7. Execute the migration in small commits, validating after each major step.
34
+ 8. For large repos, keep the migration phase-gated:
35
+ - keep the app runnable at the end of each phase
36
+ - keep one main change class per phase
37
+ - stabilize shared infrastructure before domain-by-domain waves
26
38
 
27
39
  ## Select route
28
40
 
@@ -35,22 +47,36 @@ Inspect the target app repository:
35
47
  - Else:
36
48
  - use `adopt-existing`
37
49
 
50
+ Use migration instead of ad hoc integration if the request would otherwise leave
51
+ multiple theme providers, multiple theme state stores, or a large unresolved token layer.
52
+
38
53
  If detection is ambiguous, stop and ask the user which route to prefer.
39
54
 
40
55
  ## Execute workflow (AI-driven, no local migration scripts required)
41
56
 
42
- 1. Create a short plan and name the selected route.
57
+ 1. Create a phased plan and name the selected route.
58
+ - use `shared/phases.md` as the default step-by-step scaffold for the plan
59
+ - For large repos, define explicit stop-gates between dependency landing, mechanical migration, root theme unification, runtime cleanup, shared infrastructure, domain waves, and final closeout.
43
60
  2. Run baseline checks (`npm test`, `npm run build`, and `npm run lint` when available).
44
- 3. Parse `migration.spec.json` and convert each step into concrete actions:
61
+ - If the repo exposes contract gates such as `npm run lint:style-contract`,
62
+ `npm run lint:design-contract`, or `npm run lint:typography-contract`,
63
+ include them in the baseline and closeout pass.
64
+ - If the repo exposes smoke or e2e coverage for shell, protected routes, or
65
+ overlays such as `npm run test:smoke`, include that in the migration gate.
66
+ 3. Run the repo's normal dev/start command and verify the app reaches the first route in a real browser before and after migration work.
67
+ 4. Parse `migration.spec.json` and convert each step into concrete actions:
45
68
  - execute `run` commands when they are generic and safe;
46
69
  - if a `run` command references `migrations/scripts/*`, perform the intent manually:
47
70
  - dependency updates: edit `package.json` directly;
48
71
  - route detection: inspect `package.json` and imports directly;
49
72
  - token replacements: use CSV mapping + targeted search/replace + manual review;
50
73
  - gates: use `rg` searches and test/build commands.
51
- 4. Execute `manualReview` items as explicit subtasks and record what was changed.
52
- 5. Re-run route gates and shared acceptance checks.
53
- 6. Summarize:
74
+ 5. Execute `manualReview` items as explicit subtasks and record what was changed.
75
+ - Do not batch dependency upgrades, shell rewrites, and broad token cleanup into one unvalidated change set.
76
+ - If shell, overlays, or shared primitives are in scope, add or tighten smoke coverage before broad refactors.
77
+ 6. If install scripts fail because of repo tooling such as Husky, retry with the package manager's `--ignore-scripts` equivalent only as a recovery path, then continue with the intended validation commands.
78
+ 7. Re-run route gates and shared acceptance checks, including runtime startup verification in a real browser.
79
+ 8. Summarize:
54
80
  - selected route;
55
81
  - files changed;
56
82
  - remaining manual follow-up (visual QA, edge screens, regressions).
@@ -75,6 +101,45 @@ Use these substitutions when specs mention local `.mjs` helpers:
75
101
 
76
102
  Prefer `rg` for all searches.
77
103
 
104
+ ## Runtime Startup Gate
105
+
106
+ Do not close a migration on the basis of build success alone.
107
+
108
+ - Start the app with the repo's normal dev/start command.
109
+ - Open the first route in a real browser.
110
+ - Fix startup console errors before closeout.
111
+ - Fix migration-caused startup warnings before closeout when they indicate broken runtime alignment.
112
+ - If `react`, `react-dom`, `@emotion/react`, or `@emotion/styled` are loaded more than once, align bundler/runtime configuration with dedupe, aliasing, or singleton-sharing.
113
+ - Remove module-scope code that depends on browser APIs, storage, or i18n locale activation.
114
+ - Verify that the active preset still owns the application background after migration.
115
+ - If root shells, layouts, or page wrappers set page-level `background` or `backgroundColor`, remove those overrides unless they are intentional component surfaces.
116
+ - If shell workspaces or route-level content panes were touched, verify the main page root still fills the available content region instead of collapsing to content width or leaving empty workspace.
117
+ - If shared charts, legends, chips, segmented filters, or compact status controls were touched, verify they still read as preset-aligned UI instead of ad hoc chip-like chrome.
118
+ - Keep preset selection explicit in one app-owned theme module instead of generic constants passthrough files.
119
+ - If several role-based pages share the same structural shell, extract a shared workflow layout contract before continuing with visual cleanup.
120
+ - If a local barrel re-export introduces circular chunk warnings, switch the affected app internals to direct local imports.
121
+ - Fix consumer-owned build warnings such as stale asset globs or oversized local chunks with config and bundling changes.
122
+ - If a remaining build warning is emitted by an upstream toolchain package, record the exact package and file rather than pretending the app owns it.
123
+ - Audit visible text when UI components are touched:
124
+ - use `Typography` with explicit `variant`
125
+ - wrap visible text in `Button`, `ToggleButton`, `MenuItem`, `Chip`, and `Alert` with `Typography component="span"`
126
+ - if typography regressions are broad, add or update a repo-local typography contract check and keep it green
127
+ - If raw token drift is broad, add or update a repo-local design-contract check for hardcoded colors, raw numeric font sizes, or ad hoc radius/opacity values and keep it green
128
+ - Expand the design-contract check when needed so it also catches decorative gradients, direct shadow styling, theme shadow-token drift, palette alpha suffix hacks, and unapproved visual-preview exceptions
129
+ - If the consumer repo already enforces a style-contract or styleless-UI rule, keep that gate green during the migration instead of treating it as unrelated local debt
130
+ - If a migrated consumer component still carries a large inline `sx` object, extract that styling into a local `styled(...)` component in the same file and keep the styled declarations near the bottom of the file
131
+ - If bulk replacements, codemods, or encoding-sensitive file rewrites touched localized copy, scan for mojibake or replacement characters and verify at least one real localized route renders readable text
132
+ - Remove zero-value surface wrappers that only forward to MUI `Card` or `Paper`
133
+ - Replace palette-string alpha hacks with theme helpers such as `alpha()`
134
+ - Treat consumer-owned gradient or shadow chrome on normal surfaces as a migration defect unless it is an explicitly documented preview exception
135
+ - When shared overlays are touched:
136
+ - keep `aria-labelledby` and `aria-describedby` wired through stable ids
137
+ - label close actions explicitly
138
+ - hide decorative bottom-sheet chrome from assistive tech when it carries no state
139
+ - use `combobox` and `listbox` semantics for overlay search UIs with keyboard filtering
140
+ - Keep browser event listeners such as `beforeinstallprompt` or `matchMedia` subscriptions inside effects with cleanup instead of render paths or module scope
141
+ - Prefer smoke checks through stable overlay entrypoints if overlay infrastructure changes during migration
142
+
78
143
  ## Required outputs
79
144
 
80
145
  Produce all of the following in the final response/work log:
@@ -82,6 +147,7 @@ Produce all of the following in the final response/work log:
82
147
  - selected route and why
83
148
  - completed steps vs skipped steps
84
149
  - exact commands run
150
+ - startup issues found and how they were fixed
85
151
  - unresolved warnings / manual QA checklist
86
152
  - rollback guidance if migration is partial
87
153
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomazing-org/design-system",
3
- "version": "2.0.1",
3
+ "version": "3.7.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@9.14.4",
@@ -18,20 +18,24 @@
18
18
  "styles",
19
19
  "utils"
20
20
  ],
21
+ "main": "./dist/index.js",
21
22
  "module": "dist/index.js",
22
23
  "types": "./dist/index.d.ts",
23
24
  "exports": {
24
25
  ".": {
25
26
  "types": "./dist/index.d.ts",
26
- "import": "./dist/index.js"
27
+ "import": "./dist/index.js",
28
+ "default": "./dist/index.js"
27
29
  },
28
30
  "./presets": {
29
31
  "types": "./dist/presets/index.d.ts",
30
- "import": "./dist/presets/index.js"
32
+ "import": "./dist/presets/index.js",
33
+ "default": "./dist/presets/index.js"
31
34
  }
32
35
  },
33
36
  "files": [
34
37
  "dist",
38
+ "AGENTS.md",
35
39
  "README.MD",
36
40
  "migrations/README.UPDATE.md",
37
41
  "migrations/docs",
@@ -43,13 +47,18 @@
43
47
  "registry": "https://registry.npmjs.org/"
44
48
  },
45
49
  "scripts": {
46
- "build": "tsup",
50
+ "build": "tsup && node tools/fix-dts-runtime-stubs.mjs",
51
+ "changeset": "changeset",
47
52
  "dev": "tsup --watch",
48
53
  "test": "vitest run",
49
54
  "check:runtime-alignment": "node tools/checks/runtime-version-alignment.mjs",
55
+ "check:migration-readiness": "node tools/checks/migration-readiness.mjs",
56
+ "release": "changeset publish",
57
+ "release:verify": "pnpm lint && pnpm test && pnpm build && pnpm run smoke:esm && pnpm run smoke:react-app && pnpm run smoke:next && pnpm run check:migration-readiness",
50
58
  "smoke:esm": "node tools/smoke/esm-imports.mjs",
51
59
  "smoke:react-app": "pnpm --dir examples/react-app run lint:ts && pnpm --dir examples/react-app run build",
52
60
  "smoke:next": "pnpm --dir examples/next-app-router run lint && pnpm run check:runtime-alignment && pnpm --dir examples/next-app-router run build",
61
+ "version-packages": "changeset version",
53
62
  "format": "pnpm run format:eslint && pnpm run format:prettier",
54
63
  "format:eslint": "pnpm run lint:eslint -- --fix",
55
64
  "format:prettier": "prettier \"**/*.{json,js,ts,tsx}\" --write",
@@ -73,6 +82,7 @@
73
82
  },
74
83
  "devDependencies": {
75
84
  "@atomazing-org/eslint-config": "3.6.0",
85
+ "@changesets/cli": "^2.30.0",
76
86
  "@emotion/react": "^11.14.0",
77
87
  "@emotion/styled": "^11.14.1",
78
88
  "@mui/icons-material": "7.3.8",