@maggioli-design-system/magma-react 2.2.0 → 2.4.0

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
@@ -5,7 +5,7 @@
5
5
  -->
6
6
  # @maggioli-design-system/magma-react - agent install guide
7
7
 
8
- > Version 2.2.0. You (the agent) are installing Magma into THIS project. Do not
8
+ > Version 2.4.0. You (the agent) are installing Magma into THIS project. Do not
9
9
  > assume the setup - detect it from the project, then ask the user only for what you
10
10
  > cannot infer. The detailed steps live in [`agents/install.md`](agents/install.md)
11
11
  > (this target) and [`agents/assets.md`](agents/assets.md) (shared styles, fonts,
@@ -23,31 +23,44 @@ Inspect the consumer project before asking anything:
23
23
  | Tailwind + version | `tailwindcss` in deps: v4 -> the CSS imports, v3 -> the JS preset (see agents/assets.md) |
24
24
  | SSR | `@angular/ssr` / Angular Universal, or Next App Router |
25
25
  | Compatible versions | derive from the installed `@maggioli-design-system/magma` major (see matrix in install.md) |
26
+ | Editor | a `.vscode/` folder -> VS Code; nothing -> ask (step 2) |
26
27
 
27
28
  ## Step 2 - ask only the gaps
28
29
 
29
30
  Ask the user only what detection left undecided. Typical questions:
30
31
 
31
- 1. **Icons**: use the prebuilt set (`@maggioli-design-system/svg-icons`) or do you need
32
- **iconsauce** for tree-shaking / custom icons? Most consumers do NOT need iconsauce -
33
- Magma already ships resolved SVGs; iconsauce is an internal build dependency. Only
34
- add `@iconsauce/*` if the user wants their own icon pipeline.
32
+ 1. **Icons**: which sets does the app use, and how should they be served? Every slug must
33
+ be served at `<mdsIconSvgPath><slug>.svg`, and each set comes from its own package:
34
+ Magma ships only `mgg/` (`@maggioli-design-system/svg-icons`), while `mi/` and
35
+ `mdi/` come from `@material-icons/svg` and `@mdi/svg`, and none of them is a
36
+ dependency of this package. The routes are in agents/assets.md section 3: **iconsauce**,
37
+ what Magma uses (it reads the sources and writes only the icons they name), or a copy
38
+ script that serves the files in the slug layout. Copying the `svg-icons` folder as it
39
+ is renders nothing: its files are not under `mgg/`.
35
40
  2. **Static assets path**: where are static files served from? This sets `mdsIconSvgPath`
36
41
  and the SVG copy destination.
37
42
  3. **Dark mode / preferences**: needed? If yes, wire the preference classes and components.
38
43
  4. Confirm the version row if the installed major is ambiguous.
44
+ 5. **Editor**: VS Code? It gets token and class autocomplete through two files in
45
+ `.vscode/` (agents/assets.md section 5); for another editor only the token file applies.
39
46
 
40
47
  ## Step 3 - execute
41
48
 
42
49
  1. Install packages and the shared assets - see [`agents/install.md`](agents/install.md).
43
50
  2. Wire styles in the exact cascade-layer order - see [`agents/assets.md`](agents/assets.md).
44
- 3. Copy the icon SVGs to the static path and set `mdsIconSvgPath`.
51
+ 3. Serve every icon slug the app uses at the static path, with the route from step 2, and
52
+ set `mdsIconSvgPath`.
45
53
  4. Register components: import the Mds* components from '@maggioli-design-system/magma-react' (no defineCustomElements needed).
54
+ 5. Set up editor autocomplete - see [`agents/assets.md`](agents/assets.md) section 5: MERGE the
55
+ keys into `.vscode/settings.json` and `.vscode/extensions.json`, never overwrite them.
46
56
 
47
57
  ## Step 4 - verify
48
58
 
49
- Build the app and confirm an `mds-*` component renders and at least one icon loads from
50
- the configured path. Report what was installed, the cascade order used, and the icon path.
59
+ Build the app and confirm an `mds-*` component renders and every icon it names loads
60
+ from the configured path (no 404 on `<path><slug>.svg`). In VS Code, check both halves of
61
+ the autocomplete: `var(--magma-` completes Magma tokens in a CSS file and, with Tailwind,
62
+ `bg-surface-default` shows a swatch. Report what was installed, the cascade order used, the
63
+ icon route and the icon path.
51
64
 
52
65
  ## Using the components
53
66
 
@@ -65,8 +78,10 @@ Once installed, do not guess component APIs or rules - read only the file you ne
65
78
  | Typography utilities | [`agents/typography.md`](agents/typography.md) |
66
79
  | Dark mode, preferences, named themes, surface levels and elevation, global design decisions, corner geometry | [`agents/theming.md`](agents/theming.md) |
67
80
  | Reporting a problem that is Magma's, not this project's (bug, wrong guide, missing token), with this project's origin label | [`agents/reporting.md`](agents/reporting.md) |
81
+ | What changed between the installed version and a newer one, before upgrading | `CHANGELOG.md` of each Magma package, newest release first (`magma-react` and `magma-angular` carry the releases of `magma`) |
68
82
 
69
83
  Tooling that needs structured data reads `documentation.json`: one per component beside
70
84
  its `AGENTS.md`, or `@maggioli-design-system/magma/dist/documentation.json` for all of them
71
- (over 2 MB - do not load it into context). `dist/types/components.d.ts` drives editor
72
- IntelliSense.
85
+ (over 2 MB - do not load it into context). In both, the relative links of the `usage`
86
+ texts resolve from the component's folder, `dist/collection/components/<tag>/`.
87
+ `dist/types/components.d.ts` drives editor IntelliSense.