@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 +25 -10
- package/CHANGELOG.md +715 -0
- package/agents/anti-patterns.md +7 -4
- package/agents/assets.md +231 -28
- package/agents/color.md +7 -5
- package/agents/components.md +5 -4
- package/agents/conventions.md +16 -0
- package/agents/install.md +11 -5
- package/agents/reporting.md +11 -2
- package/agents/theming.md +15 -0
- package/dist/components.js +1 -0
- package/dist/components.server.js +1 -0
- package/dist/mds-input-date-range.server.js +1 -0
- package/dist/mds-input-date.server.js +1 -0
- package/dist/mds-input-select.server.js +1 -0
- package/dist/mds-input.server.js +1 -0
- package/dist/mds-table-footer.server.js +1 -1
- package/dist/mds-table-header-cell.js +1 -1
- package/dist/mds-table-header-cell.server.js +1 -0
- package/dist/mds-table.server.js +2 -1
- package/dist/mds-toast-region.js +12 -0
- package/dist/mds-toast-region.server.js +15 -0
- package/dist/mds-toast.server.js +2 -1
- package/dist/mds-tooltip.server.js +1 -0
- package/dist/mds-usage.server.js +2 -1
- package/dist/types/components.d.ts +1 -0
- package/dist/types/components.server.d.ts +1 -0
- package/dist/types/mds-table-header-cell.d.ts +5 -2
- package/dist/types/mds-table-header-cell.server.d.ts +5 -2
- package/dist/types/mds-toast-region.d.ts +9 -0
- package/dist/types/mds-toast-region.server.d.ts +11 -0
- package/dist/types/mds-toast.d.ts +2 -2
- package/dist/types/mds-toast.server.d.ts +2 -2
- package/package.json +6 -4
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.
|
|
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**:
|
|
32
|
-
|
|
33
|
-
Magma
|
|
34
|
-
|
|
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.
|
|
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
|
|
50
|
-
the configured 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). `
|
|
72
|
-
|
|
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.
|