@atomazing-org/design-system 2.0.2 → 3.7.3
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 +343 -34
- package/dist/index.d.ts +11 -15
- package/dist/index.js +22 -22
- package/dist/presets/index.d.ts +10 -2
- package/dist/presets/index.js +283 -263
- package/dist/themePresets-CwgG5XEL.d.ts +65 -0
- package/dist/themePresets-CwgG5XEL.js +1 -0
- package/migrations/README.UPDATE.md +2 -0
- package/migrations/docs/migrations/design-system/routes/adopt-existing/migration.spec.json +21 -12
- package/migrations/docs/migrations/design-system/routes/greenfield/migration.spec.json +10 -9
- package/migrations/docs/migrations/design-system/routes/mui4-to-latest/migration.spec.json +19 -17
- package/migrations/docs/migrations/design-system/shared/WORKING-RULES.md +194 -194
- package/package.json +14 -5
- package/dist/typography-B-BeIk0v.d.ts +0 -120
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ThemeOptions, TypeBackground } from '@mui/material/styles';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Available options for dark mode configuration.
|
|
6
|
+
* - `system`: Follows the operating system preference.
|
|
7
|
+
* - `light`: Forces light mode.
|
|
8
|
+
* - `dark`: Forces dark mode.
|
|
9
|
+
*/
|
|
10
|
+
type DarkModeOptions = "system" | "light" | "dark";
|
|
11
|
+
interface OptionItem {
|
|
12
|
+
label: string;
|
|
13
|
+
value: DarkModeOptions;
|
|
14
|
+
icon: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
type ThemeModeBackground = Partial<Record<"light" | "dark", Partial<TypeBackground>>>;
|
|
17
|
+
type NamedThemeOptions = ThemeOptions & {
|
|
18
|
+
name: string;
|
|
19
|
+
background?: ThemeModeBackground;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Represents user-specific theme preferences stored in the application.
|
|
23
|
+
*/
|
|
24
|
+
interface AppSettings {
|
|
25
|
+
/**
|
|
26
|
+
* The selected preset id from the available themes list.
|
|
27
|
+
* Invalid or missing values are normalized to the first available theme.
|
|
28
|
+
*/
|
|
29
|
+
themeId: string;
|
|
30
|
+
/**
|
|
31
|
+
* Controls how dark mode is applied in the app.
|
|
32
|
+
*/
|
|
33
|
+
darkMode: DarkModeOptions;
|
|
34
|
+
}
|
|
35
|
+
interface ThemeContextProps {
|
|
36
|
+
theme: string;
|
|
37
|
+
darkMode: DarkModeOptions;
|
|
38
|
+
setTheme: (theme: string) => void;
|
|
39
|
+
setDarkMode: (mode: DarkModeOptions) => void;
|
|
40
|
+
themes: NamedThemeOptions[];
|
|
41
|
+
selectedTheme: NamedThemeOptions;
|
|
42
|
+
defaultThemeName: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type ThemeId = string;
|
|
46
|
+
type ThemeScheme = "light" | "dark";
|
|
47
|
+
type DarkModeSetting = DarkModeOptions;
|
|
48
|
+
interface ThemePreset {
|
|
49
|
+
id: ThemeId;
|
|
50
|
+
label: string;
|
|
51
|
+
colorSchemes: {
|
|
52
|
+
light: ThemeOptions;
|
|
53
|
+
dark: ThemeOptions;
|
|
54
|
+
};
|
|
55
|
+
description?: string;
|
|
56
|
+
tags?: string[];
|
|
57
|
+
version?: string;
|
|
58
|
+
}
|
|
59
|
+
type NormalizedPreset = ThemePreset & {
|
|
60
|
+
meta?: {
|
|
61
|
+
origin: "preset" | "legacy" | "custom";
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type { AppSettings as A, DarkModeOptions as D, NamedThemeOptions as N, OptionItem as O, ThemeContextProps as T, ThemePreset as a, ThemeModeBackground as b, NormalizedPreset as c, ThemeId as d, ThemeScheme as e, DarkModeSetting as f };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -39,3 +39,5 @@ Use route-based migration instead of ad hoc edits when the target app has:
|
|
|
39
39
|
- `migrations/scripts/*` is optional legacy automation.
|
|
40
40
|
- The docs and skills are the source of truth for AI-driven migration work.
|
|
41
41
|
- Migration closeout now requires a real app startup check, not only lint/test/build.
|
|
42
|
+
- Run `pnpm run check:migration-readiness` before migration work to validate the
|
|
43
|
+
local migration pack contract (routes, specs, shared docs, and gitignore rules).
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"steps": [
|
|
22
22
|
{
|
|
23
23
|
"name": "Inventory and baseline",
|
|
24
|
-
"run": ["npm test", "npm run build"],
|
|
25
24
|
"manualReview": [
|
|
26
25
|
"Map current design-system usage, theme entrypoints, local token modules, shared shell code, shared overlays, and protected routes.",
|
|
27
26
|
"Record pre-existing failing checks separately from migration defects.",
|
|
28
|
-
"Split the repo into shared-infrastructure scope and domain migration waves before broad edits begin."
|
|
27
|
+
"Split the repo into shared-infrastructure scope and domain migration waves before broad edits begin.",
|
|
28
|
+
"Run the target repository baseline checks with its package manager (for example lint, tests, and build when available)."
|
|
29
29
|
]
|
|
30
30
|
},
|
|
31
31
|
{
|
|
@@ -38,13 +38,16 @@
|
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"name": "Add design-system deps",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
41
|
+
"manualReview": [
|
|
42
|
+
"Edit package.json directly and add or upgrade @atomazing-org/design-system to <SET_VERSION>.",
|
|
43
|
+
"Align peer runtime package versions as needed and keep the repository package manager conventions intact."
|
|
43
44
|
]
|
|
44
45
|
},
|
|
45
46
|
{
|
|
46
47
|
"name": "Install deps",
|
|
47
|
-
"
|
|
48
|
+
"manualReview": [
|
|
49
|
+
"Install dependencies with the target repository package manager (npm, pnpm, yarn, or bun)."
|
|
50
|
+
]
|
|
48
51
|
},
|
|
49
52
|
{
|
|
50
53
|
"name": "Root theme unification",
|
|
@@ -80,14 +83,21 @@
|
|
|
80
83
|
{
|
|
81
84
|
"name": "Token and primitive cleanup",
|
|
82
85
|
"manualReview": [
|
|
83
|
-
"
|
|
84
|
-
"Prepare CSV or targeted replacements for legacy tokens and review the diff file by file.",
|
|
86
|
+
"Prepare targeted replacements for legacy tokens and review the diff file by file.",
|
|
85
87
|
"Normalize visible text to Typography with explicit semantic variants.",
|
|
86
88
|
"Remove zero-value wrapper components and zero-value surface wrappers.",
|
|
87
89
|
"Replace palette alpha suffix hacks with alpha() and simplify decorative consumer surface chrome.",
|
|
88
90
|
"If bulk replacements or file rewrites touched localized copy, scan for mojibake or replacement characters and verify non-Latin UI text still renders readable strings."
|
|
89
91
|
]
|
|
90
92
|
},
|
|
93
|
+
{
|
|
94
|
+
"name": "Shared workflow extraction and bundler hygiene",
|
|
95
|
+
"manualReview": [
|
|
96
|
+
"If multiple pages share the same workflow shell, extract one shared layout contract and keep role-specific behavior in headers and sections.",
|
|
97
|
+
"If local barrels introduce circular chunk warnings for app internals, switch to direct local imports for those modules.",
|
|
98
|
+
"Fix consumer-owned build warnings such as stale PWA asset globs or oversized local chunks through config and chunking changes, not warning suppression."
|
|
99
|
+
]
|
|
100
|
+
},
|
|
91
101
|
{
|
|
92
102
|
"name": "Domain migration waves",
|
|
93
103
|
"manualReview": [
|
|
@@ -98,11 +108,10 @@
|
|
|
98
108
|
},
|
|
99
109
|
{
|
|
100
110
|
"name": "Quality gates",
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"npm run build"
|
|
111
|
+
"manualReview": [
|
|
112
|
+
"Re-run the target repository closeout gates with its package manager: lint, tests, and build (when available).",
|
|
113
|
+
"Run repo-local token and design-contract checks when they exist (for example lint:design-contract).",
|
|
114
|
+
"Manually verify no forbidden hardcoded token modules or identifiers remain for the target app (for example with rg searches)."
|
|
106
115
|
]
|
|
107
116
|
}
|
|
108
117
|
]
|
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
"$schema": "../../schema/migration.spec.schema.json",
|
|
3
3
|
"id": "greenfield",
|
|
4
4
|
"title": "Greenfield install of @atomazing-org/design-system",
|
|
5
|
-
"detect": {
|
|
6
|
-
"packageJson": {
|
|
7
|
-
"allDependencies": []
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
5
|
"entryConditions": ["package.json exists"],
|
|
11
6
|
"exitConditions": [
|
|
12
7
|
"ThemeProviderWrapper is connected at the app root",
|
|
@@ -23,13 +18,16 @@
|
|
|
23
18
|
},
|
|
24
19
|
{
|
|
25
20
|
"name": "Add deps",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
21
|
+
"manualReview": [
|
|
22
|
+
"Edit package.json directly and add @atomazing-org/design-system:<SET_VERSION>, @mui/material:^7, @mui/icons-material:^7, @emotion/react:^11, and @emotion/styled:^11.",
|
|
23
|
+
"Preserve the target repository package manager conventions and lockfile strategy."
|
|
28
24
|
]
|
|
29
25
|
},
|
|
30
26
|
{
|
|
31
27
|
"name": "Install deps",
|
|
32
|
-
"
|
|
28
|
+
"manualReview": [
|
|
29
|
+
"Install dependencies with the target repository package manager (npm, pnpm, yarn, or bun)."
|
|
30
|
+
]
|
|
33
31
|
},
|
|
34
32
|
{
|
|
35
33
|
"name": "Manual integration",
|
|
@@ -51,7 +49,10 @@
|
|
|
51
49
|
},
|
|
52
50
|
{
|
|
53
51
|
"name": "Quality",
|
|
54
|
-
"
|
|
52
|
+
"manualReview": [
|
|
53
|
+
"Run the target repository quality gates with its package manager: lint, tests, and build (when available).",
|
|
54
|
+
"If the repository provides smoke, style-contract, design-contract, or typography-contract checks, include them in closeout."
|
|
55
|
+
]
|
|
55
56
|
}
|
|
56
57
|
],
|
|
57
58
|
"gates": ["lint", "tests", "build"]
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"steps": [
|
|
26
26
|
{
|
|
27
27
|
"name": "Inventory and baseline",
|
|
28
|
-
"run": ["npm ci", "npm test", "npm run build"],
|
|
29
28
|
"manualReview": [
|
|
30
29
|
"Map @material-ui/* imports and dependencies plus legacy styling APIs such as makeStyles, withStyles, createMuiTheme, StylesProvider, and ServerStyleSheets.",
|
|
31
30
|
"Record pre-existing failing checks separately from migration defects.",
|
|
32
|
-
"Split the repo into shared-infrastructure scope and domain migration waves before broad edits begin."
|
|
31
|
+
"Split the repo into shared-infrastructure scope and domain migration waves before broad edits begin.",
|
|
32
|
+
"Run baseline checks with the target repository package manager (for example install/ci, tests, and build as available)."
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
{
|
|
@@ -42,22 +42,22 @@
|
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
"name": "Update package.json deps (v4 to modern MUI plus design-system)",
|
|
45
|
-
"run": [
|
|
46
|
-
"node migrations/scripts/migrations/design-system/actions/update-package-json.mjs --remove @material-ui/core --remove @material-ui/styles --remove @material-ui/icons --add @mui/material:^7 --add @mui/icons-material:^7 --add @emotion/react:^11 --add @emotion/styled:^11 --add @atomazing-org/design-system:<SET_VERSION>"
|
|
47
|
-
],
|
|
48
45
|
"manualReview": [
|
|
46
|
+
"Edit package.json directly: remove @material-ui/core, @material-ui/styles, and @material-ui/icons; add @mui/material:^7, @mui/icons-material:^7, @emotion/react:^11, @emotion/styled:^11, and @atomazing-org/design-system:<SET_VERSION>.",
|
|
49
47
|
"Check for adjacent ecosystem packages such as mui lab, x packages, date-pickers, or data-grid and align them separately.",
|
|
50
48
|
"Treat this as a dependency landing step only; do not mix in broad visual cleanup."
|
|
51
49
|
]
|
|
52
50
|
},
|
|
53
51
|
{
|
|
54
52
|
"name": "Install deps",
|
|
55
|
-
"
|
|
53
|
+
"manualReview": [
|
|
54
|
+
"Install dependencies with the target repository package manager (npm, pnpm, yarn, or bun)."
|
|
55
|
+
]
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"name": "Run official codemod (v4 to v5)",
|
|
59
|
-
"run": ["npx @mui/codemod@latest v5.0.0/preset-safe src"],
|
|
60
59
|
"manualReview": [
|
|
60
|
+
"Run the official MUI codemod with a package-manager-appropriate executor (for example pnpm dlx, npm exec, yarn dlx, or bunx): @mui/codemod@latest v5.0.0/preset-safe src.",
|
|
61
61
|
"Review TODO markers and compile errors left by the codemod.",
|
|
62
62
|
"Treat the codemod output as a mechanical landing step, not as a finished migration."
|
|
63
63
|
]
|
|
@@ -110,10 +110,8 @@
|
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
112
|
"name": "Apply token remap (project-specific)",
|
|
113
|
-
"run": [
|
|
114
|
-
"node migrations/scripts/migrations/design-system/shared/apply-replacements-from-csv.mjs --csv migrations/docs/migrations/design-system/routes/mui4-to-latest/token-map.csv --root src"
|
|
115
|
-
],
|
|
116
113
|
"manualReview": [
|
|
114
|
+
"Use token-map.csv as a reference for targeted replacements and apply changes in controlled batches.",
|
|
117
115
|
"Enable only the rows needed in token-map.csv and review the diff in controlled batches.",
|
|
118
116
|
"For large repos, apply token replacement after shared infrastructure is stable instead of doing a blind repo-wide rewrite first.",
|
|
119
117
|
"For complex replacements, add dedicated rules or perform manual edits.",
|
|
@@ -130,14 +128,18 @@
|
|
|
130
128
|
},
|
|
131
129
|
{
|
|
132
130
|
"name": "Quality gates",
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"npm test",
|
|
138
|
-
"npm run build"
|
|
131
|
+
"manualReview": [
|
|
132
|
+
"Re-run the target repository closeout gates with its package manager: lint, tests, and build (when available).",
|
|
133
|
+
"Verify package.json and source contain no @material-ui/* dependencies or imports (for example with rg).",
|
|
134
|
+
"Run repo-local token/design-contract gates when available and manually verify forbidden legacy token usage is removed."
|
|
139
135
|
]
|
|
140
136
|
}
|
|
141
137
|
],
|
|
142
|
-
"gates": [
|
|
138
|
+
"gates": [
|
|
139
|
+
"no-legacy-material-ui",
|
|
140
|
+
"no-hardcoded-tokens",
|
|
141
|
+
"lint",
|
|
142
|
+
"tests",
|
|
143
|
+
"build"
|
|
144
|
+
]
|
|
143
145
|
}
|