@maggioli-design-system/magma-react 2.0.1 → 2.2.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 +72 -0
- package/agents/anti-patterns.md +39 -0
- package/agents/assets.md +203 -0
- package/agents/color.md +193 -0
- package/agents/components.md +129 -0
- package/agents/conventions.md +188 -0
- package/agents/install.md +215 -0
- package/agents/reporting.md +118 -0
- package/agents/theming.md +140 -0
- package/agents/typography.md +32 -0
- package/agents/variants.md +112 -0
- package/dist/mds-button-dropdown.js +1 -1
- package/dist/mds-button-dropdown.server.js +2 -0
- package/dist/mds-button.server.js +2 -0
- package/dist/mds-input-date-range.server.js +2 -1
- package/dist/mds-input-otp.server.js +1 -0
- package/dist/mds-input-upload.server.js +2 -0
- package/dist/types/mds-button-dropdown.d.ts +5 -2
- package/dist/types/mds-button-dropdown.server.d.ts +5 -2
- package/dist/types/mds-input-select.d.ts +2 -2
- package/dist/types/mds-input-select.server.d.ts +2 -2
- package/package.json +2 -2
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
GENERATED FILE - do not edit by hand.
|
|
3
|
+
Source of truth: docs/agents/ in the magma monorepo.
|
|
4
|
+
Regenerate with: npm run sync.agent-docs (from the stencil package).
|
|
5
|
+
-->
|
|
6
|
+
# Magma - reporting a problem
|
|
7
|
+
|
|
8
|
+
> Scope: you are working in a project that uses Magma and you hit a problem that is
|
|
9
|
+
> Magma's, not the project's: a component that misbehaves, a guide that is wrong, a
|
|
10
|
+
> missing token or utility, a packaging or install issue. This is how to report it to
|
|
11
|
+
> the Magma repository, `magma-design-system/magma`, labelled with the project it comes
|
|
12
|
+
> from, so the maintainers can tell which project reported what.
|
|
13
|
+
|
|
14
|
+
## 1. Make sure it is Magma's
|
|
15
|
+
|
|
16
|
+
- Read the component's `AGENTS.md` and `antipattern.md`, and
|
|
17
|
+
[`anti-patterns.md`](anti-patterns.md): a documented mistake is the project's to fix,
|
|
18
|
+
not a Magma bug.
|
|
19
|
+
- Check that the installed `magma`, `styles` and `design-tokens` versions belong
|
|
20
|
+
together (the ones a `magma` release depends on): mismatched versions break tokens
|
|
21
|
+
and styles on their own.
|
|
22
|
+
- Reduce it to the smallest markup that still shows the problem, without the project's
|
|
23
|
+
own CSS or wrappers when you can.
|
|
24
|
+
|
|
25
|
+
## 2. Look for an existing issue
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
gh issue list --repo magma-design-system/magma --state all --search "<component or keywords>"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If one already describes it, comment there with what is new (your versions, another
|
|
32
|
+
reproduction) and the project you hit it in, instead of opening a duplicate.
|
|
33
|
+
|
|
34
|
+
## 3. Ask before you open it
|
|
35
|
+
|
|
36
|
+
The Magma repository is public: opening an issue publishes its text. Draft the issue,
|
|
37
|
+
show it to the user, and create it only once they agree. Leave out anything private to
|
|
38
|
+
the project: internal URLs, credentials, customer data, unreleased features.
|
|
39
|
+
|
|
40
|
+
## 4. Pick the labels
|
|
41
|
+
|
|
42
|
+
Every issue carries three kinds of label:
|
|
43
|
+
|
|
44
|
+
| Label | Says | Values |
|
|
45
|
+
| ----- | ---- | ------ |
|
|
46
|
+
| type | what kind of issue | `bug`, `feature`, `docs` |
|
|
47
|
+
| `prg-*` | which Magma package is affected | `prg-stencil` (the components: `magma`, `magma-react`, `magma-angular`), `prg-styles`, `prg-design-tokens`, `prg-svg-icons`, `prg-icons`, `prg-identity` |
|
|
48
|
+
| `prd-*` | which project it was found in (its origin) | one per project, e.g. `prd-mindy` |
|
|
49
|
+
|
|
50
|
+
Find this project's origin label. Each one's description names the project and its
|
|
51
|
+
repository:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
gh label list --repo magma-design-system/magma --search prd-
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Match it against this project's repository name (the `origin` remote, or the `name` in
|
|
58
|
+
`package.json`). If none matches, do not create one: the Magma maintainers manage the
|
|
59
|
+
labels of their repository. Open the issue without it and say in the body which project
|
|
60
|
+
and repository it comes from, so they can add the label.
|
|
61
|
+
|
|
62
|
+
GitHub sets labels on a new issue only for users with write access to the repository,
|
|
63
|
+
and drops them for everyone else, often without an error. After creating the issue,
|
|
64
|
+
check what it got:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
gh issue view <number> --repo magma-design-system/magma --json labels
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
If the labels were dropped, the `Found in` line of the body is what the maintainers
|
|
71
|
+
label it from.
|
|
72
|
+
|
|
73
|
+
## 5. Write it
|
|
74
|
+
|
|
75
|
+
In English. Title: `<component or package>: <what is wrong>`, e.g.
|
|
76
|
+
`mds-modal: the window jumps on open`. Body:
|
|
77
|
+
|
|
78
|
+
```markdown
|
|
79
|
+
## Problem
|
|
80
|
+
|
|
81
|
+
What happens, and what should happen instead.
|
|
82
|
+
|
|
83
|
+
## How to reproduce
|
|
84
|
+
|
|
85
|
+
The minimal markup or the steps, and the browser if it matters.
|
|
86
|
+
|
|
87
|
+
## Versions
|
|
88
|
+
|
|
89
|
+
- @maggioli-design-system/magma (or magma-react / magma-angular): <installed version>
|
|
90
|
+
- @maggioli-design-system/styles: <installed version>
|
|
91
|
+
- @maggioli-design-system/design-tokens: <installed version>
|
|
92
|
+
- Framework: <e.g. Next 16 + React 19, Angular 20, none>
|
|
93
|
+
|
|
94
|
+
## Workaround
|
|
95
|
+
|
|
96
|
+
What the project does meanwhile, if anything.
|
|
97
|
+
|
|
98
|
+
Found in <project> (<repository>): <where in the app>.
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Read the installed versions from the lockfile or `npm ls`, not from the ranges in
|
|
102
|
+
`package.json`.
|
|
103
|
+
|
|
104
|
+
## 6. Create it
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
gh issue create --repo magma-design-system/magma \
|
|
108
|
+
--title "mds-modal: the window jumps on open" \
|
|
109
|
+
--label bug --label prg-stencil --label prd-<project> \
|
|
110
|
+
--body-file magma-issue.md
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Pass only labels that exist: `gh` refuses an unknown one. Without `gh`, give the user
|
|
114
|
+
the title, the labels and the body to open it by hand at
|
|
115
|
+
`https://github.com/magma-design-system/magma/issues/new`.
|
|
116
|
+
|
|
117
|
+
Then give the user the issue URL, and leave a comment in the project next to the
|
|
118
|
+
workaround that links it, so the workaround can go once the fix ships.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
GENERATED FILE - do not edit by hand.
|
|
3
|
+
Source of truth: docs/agents/ in the magma monorepo.
|
|
4
|
+
Regenerate with: npm run sync.agent-docs (from the stencil package).
|
|
5
|
+
-->
|
|
6
|
+
# Magma styles - theming, dark mode and preferences
|
|
7
|
+
|
|
8
|
+
> Scope: dark mode, the user preferences (contrast, motion, consumption), the named
|
|
9
|
+
> themes, the surface levels and elevation, the global design decisions you may override,
|
|
10
|
+
> and the corner geometry axis. Requires the styles setup in [`assets.md`](assets.md).
|
|
11
|
+
> The color roles themselves: [`color.md`](color.md).
|
|
12
|
+
|
|
13
|
+
The component layer already handles these - **do not re-implement them in app code**.
|
|
14
|
+
|
|
15
|
+
## Dark mode and preferences
|
|
16
|
+
|
|
17
|
+
Handled at the palette level - no per-element classes. Components read tokens, not
|
|
18
|
+
literal colours, so they invert automatically. Activate on `<html>`:
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<html class="pref-mode-system"><!-- or pref-mode-light / pref-mode-dark --></html>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Same pattern for `pref-contrast-*`, `pref-animation-*` and `pref-consumption-*` (high
|
|
25
|
+
contrast, reduced motion, low consumption): the classes on `<html>` cascade through. To
|
|
26
|
+
let the user choose, each preference has its component - `mds-pref-mode`,
|
|
27
|
+
`mds-pref-contrast`, `mds-pref-animation`, `mds-pref-consumption`, `mds-pref-theme`,
|
|
28
|
+
`mds-pref-language` - and `mds-pref` groups them in one panel; they write the classes and
|
|
29
|
+
remember the choice. Never write `color-scheme` or dark-mode media queries by hand.
|
|
30
|
+
|
|
31
|
+
## Named themes
|
|
32
|
+
|
|
33
|
+
A named theme retints the whole neutral scaffolding of the page at once - surfaces,
|
|
34
|
+
wash, borders, text, the inverse chip - and keeps it contrast-checked. It is one
|
|
35
|
+
attribute on `<html>`, and it needs `themes.css` ([`assets.md`](assets.md)):
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<html data-theme-name="cool"><!-- or "warm"; no attribute = the default theme --></html>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
| Theme | Family | Cast |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| (none) | `neutral` | grey |
|
|
44
|
+
| `cool` | `porcelain` | blue-grey |
|
|
45
|
+
| `warm` | `bisque` | warm grey |
|
|
46
|
+
|
|
47
|
+
The status colors (info, success, warning, danger) never change with the theme. To let
|
|
48
|
+
the user choose, use `mds-pref-theme`: it writes the attribute, remembers the choice and
|
|
49
|
+
also carries the corner shape (below). A theme works only on code that paints with the
|
|
50
|
+
semantic roles; a raw palette step stays as it is. Defining your own theme is not a
|
|
51
|
+
consumer feature yet.
|
|
52
|
+
|
|
53
|
+
## Surfaces and elevation
|
|
54
|
+
|
|
55
|
+
Every neutral background is one of five surface levels. They are not five greys to pick
|
|
56
|
+
from: each one says where the element sits relative to the page.
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
surface-default the page, the canvas everything else sits on
|
|
60
|
+
surface-sunken recessed into the page: wells, insets, code blocks, tracks
|
|
61
|
+
surface-muted on the page plane, grouped: zebra rows, a subtle section
|
|
62
|
+
surface-raised lifted off the page: cards, panels, sticky headers
|
|
63
|
+
surface-overlay floating above everything: modal, dropdown, popover, tooltip
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The ladder in the default theme (`--magma-surface-*`, Tailwind `bg-surface-*`):
|
|
67
|
+
|
|
68
|
+
| Level | Light | Dark |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| `sunken` | `#e8e8e8` | `#020202` |
|
|
71
|
+
| `muted` | `#ebebeb` | `#0d0d0d` |
|
|
72
|
+
| `default` | `#f2f2f2` | `#1d1d1d` |
|
|
73
|
+
| `raised` | `#f8f8f8` | `#303030` |
|
|
74
|
+
| `overlay` | `#ffffff` | `#4a4a4a` |
|
|
75
|
+
|
|
76
|
+
In both modes the ladder rises toward the light: `sunken` and `muted` sit below the page,
|
|
77
|
+
`raised` and `overlay` above it. Light keeps the page a soft grey so that a card can be
|
|
78
|
+
lighter than it; dark lifts the page off pure black so that there is room below it.
|
|
79
|
+
|
|
80
|
+
**In light, elevation needs a shadow.** The steps above the page are close in light
|
|
81
|
+
(`#f2f2f2` page, `#f8f8f8` card), so the fill alone barely separates a raised element; in
|
|
82
|
+
dark the fill does most of the work. Pair `raised` and `overlay` with a shadow, as the
|
|
83
|
+
components do (`mds-card` uses `--shadow-md-sharp`, `mds-modal` `--shadow-2xl`):
|
|
84
|
+
|
|
85
|
+
```css
|
|
86
|
+
.panel {
|
|
87
|
+
background: rgb(var(--magma-surface-raised));
|
|
88
|
+
box-shadow: var(--shadow-md-sharp);
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
```html
|
|
93
|
+
<div class="bg-surface-raised shadow-md-sharp">...</div>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
An overlay separates from what is under it by its shadow, not by a border: in dark
|
|
97
|
+
`border-muted` is darker than `surface-overlay`.
|
|
98
|
+
|
|
99
|
+
**Text is safe on every level.** Each text role is computed against the least
|
|
100
|
+
contrasting surface of its family, so `text-default`, `text-muted` and the rest are
|
|
101
|
+
legible on all five levels in both modes (checked in CI). The tinted pills are a
|
|
102
|
+
different device with tighter rules: see the wash levels in [`color.md`](color.md).
|
|
103
|
+
|
|
104
|
+
**Themes and contrast move the levels, not your code.** Under a named theme the five
|
|
105
|
+
levels take the theme's cast. Under `pref-contrast-more` the page (`surface-default`)
|
|
106
|
+
becomes the paper of the mode (`#fff` light, `#000` dark) while `raised` and `overlay`
|
|
107
|
+
keep their step, so cards and floating layers still stand off the page. Code that paints
|
|
108
|
+
with the roles follows both with no rule of its own.
|
|
109
|
+
|
|
110
|
+
**Roles, not primitives.** `--surface-neutral-raised` and its siblings
|
|
111
|
+
(`--surface-<family>-*`) are the design-tokens primitives behind the roles, one set per
|
|
112
|
+
family: they follow the mode but not the named theme nor the contrast preference. Paint
|
|
113
|
+
with `--magma-surface-*`.
|
|
114
|
+
|
|
115
|
+
## Global design decisions
|
|
116
|
+
|
|
117
|
+
Override `--magma-*` vars only inside the `overrides` cascade layer:
|
|
118
|
+
`--magma-disabled-opacity` (`0.5`), `--magma-backdrop-opacity` (`0.1`),
|
|
119
|
+
`--magma-outline-focus`.
|
|
120
|
+
|
|
121
|
+
```css
|
|
122
|
+
@layer overrides { :root { --magma-disabled-opacity: 0.35; } }
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Corner geometry
|
|
126
|
+
|
|
127
|
+
Corner geometry is an axis of its own, because the shape and the radius scale tuned
|
|
128
|
+
for it have to move together: a squircle cuts a much smaller corner than a round one
|
|
129
|
+
at the same radius. Set `data-corner-shape` - on `<html>`, or on any element to
|
|
130
|
+
deviate for that subtree only - and both follow. Overriding `--magma-corner-shape`
|
|
131
|
+
by itself changes the shape WITHOUT the scale.
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<html data-corner-shape="round">
|
|
135
|
+
<section data-corner-shape="squircle">...</section>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
In your own CSS take radii from the `--magma-radius-*` scale (`none`, `3xs` ... `5xl`,
|
|
139
|
+
`full`), which follows the axis: `border-radius: var(--magma-radius-lg)`. A raw
|
|
140
|
+
`--radius-*` token or a pixel value stays the same under every shape.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
GENERATED FILE - do not edit by hand.
|
|
3
|
+
Source of truth: docs/agents/ in the magma monorepo.
|
|
4
|
+
Regenerate with: npm run sync.agent-docs (from the stencil package).
|
|
5
|
+
-->
|
|
6
|
+
# Magma styles - typography
|
|
7
|
+
|
|
8
|
+
> Scope: setting text in your own UI with Magma's typography utilities. Requires the
|
|
9
|
+
> styles and fonts setup in [`assets.md`](assets.md).
|
|
10
|
+
|
|
11
|
+
## Typography utilities
|
|
12
|
+
|
|
13
|
+
Use the semantic `text-*` utilities instead of composing `font-*` + `text-*`:
|
|
14
|
+
`text-title-h1`..`h6`, `text-title-action`, `text-info-{paragraph,detail,caption,label,option,tip}`,
|
|
15
|
+
`text-read-{paragraph,detail,caption}`, `text-code-{snippet,hack}`.
|
|
16
|
+
|
|
17
|
+
They come from `styles/dist/tailwind/typography.css` (see the Tailwind section of
|
|
18
|
+
[`assets.md`](assets.md)). Without Tailwind, the same scale is a plain CSS class per style,
|
|
19
|
+
named `typography-*` (`typography-title-h1`, `typography-info-detail`, ...), in
|
|
20
|
+
`@maggioli-design-system/styles/dist/css/utility-typography.css`: import it in the
|
|
21
|
+
`utilities` layer.
|
|
22
|
+
|
|
23
|
+
Inside component markup, `mds-text` sets a style through its `typography` prop (`h1` ..
|
|
24
|
+
`h6`, `action`, `paragraph`, `detail`, `caption`, `label`, `option`, `tip`, `snippet`,
|
|
25
|
+
`hack`); `variant="read"` switches `paragraph`, `detail` and `caption` from the `info`
|
|
26
|
+
family to the `read` one.
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<h2 class="text-title-h3">Invoices</h2>
|
|
30
|
+
<p class="typography-read-paragraph">Plain CSS, no Tailwind.</p>
|
|
31
|
+
<mds-text typography="h3">Invoices</mds-text>
|
|
32
|
+
```
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
GENERATED FILE - do not edit by hand.
|
|
3
|
+
Source of truth: docs/agents/ in the magma monorepo.
|
|
4
|
+
Regenerate with: npm run sync.agent-docs (from the stencil package).
|
|
5
|
+
-->
|
|
6
|
+
# Magma components - variant and tone
|
|
7
|
+
|
|
8
|
+
> Scope: the two independent axes many components accept - `variant` (the color role)
|
|
9
|
+
> and `tone` (the visual intensity) - their values, and how to check what one component
|
|
10
|
+
> accepts. The other component rules: [`conventions.md`](conventions.md). The color
|
|
11
|
+
> roles behind each variant: [`color.md`](color.md).
|
|
12
|
+
|
|
13
|
+
Many components accept both `variant` and `tone` props. These are independent axes:
|
|
14
|
+
|
|
15
|
+
- `variant` controls the **color role** - it answers _what kind of action/state this
|
|
16
|
+
is_.
|
|
17
|
+
- `tone` controls the **visual intensity** - it answers _how much emphasis this should
|
|
18
|
+
have_, independent of `variant`.
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<mds-button variant="primary" tone="strong">Save</mds-button>
|
|
22
|
+
<mds-button variant="error" tone="outline">Delete</mds-button>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The same `variant` + different `tone` is the right way to express importance - do not
|
|
26
|
+
invent custom CSS to dim or saturate. Pick the variant that matches the **meaning**, not
|
|
27
|
+
the colour you happen to want.
|
|
28
|
+
|
|
29
|
+
> Magma 2.0 breaking rename of `tone`: `ghost` -> `outline`; `quiet` -> `text` on
|
|
30
|
+
> `mds-button`, `mds-radial-menu` and `mds-radial-menu-item` (the only components with a
|
|
31
|
+
> `text` tone), `quiet` -> `weak` everywhere else. The codemod
|
|
32
|
+
> (`@maggioli-design-system/magma-codemods`) applies both.
|
|
33
|
+
|
|
34
|
+
## Variants
|
|
35
|
+
|
|
36
|
+
Allowed values depend on the component but draw from these families:
|
|
37
|
+
|
|
38
|
+
| Family | Values | Use for | Paints with ([`color.md`](color.md)) |
|
|
39
|
+
| -------- | ------------------------------------- | ------------------------------------------- | ---------------------------------------- |
|
|
40
|
+
| Accent | `primary`, `secondary`, `ai` | Actions and selection, AI-driven features | `--magma-accent-*`, `--magma-accent-ai-*` |
|
|
41
|
+
| Status | `info`, `success`, `warning`, `error` | Communicating state | `--magma-<hue>-*` (`error` is the `danger` hue) |
|
|
42
|
+
| Neutral | `dark`, `light` | Neutral chrome buttons, chips, badges | the neutral roles |
|
|
43
|
+
| Label | `amaranth`, `red`, `aqua`, `blue`, ... | Categories, tags, visual grouping | the `label-*` palette |
|
|
44
|
+
| Identity | `google`, `apple` | Sign-in buttons (`mds-button`, `mds-radial-menu`, `mds-radial-menu-item`) | fixed by the provider's guidelines; `tone` is ignored |
|
|
45
|
+
|
|
46
|
+
| Variant name | Family | Description |
|
|
47
|
+
| ------------ | -------- | --------------------------------------------------------------------------- |
|
|
48
|
+
| `primary` | Accent | The most important actions or messages |
|
|
49
|
+
| `secondary` | Accent | Kept for compatibility: it renders exactly like `primary`. A second brand colour is a named theme, not a variant ([`theming.md`](theming.md)); for a supporting action lower the `tone` instead |
|
|
50
|
+
| `ai` | Accent | AI-generated content or AI-powered features |
|
|
51
|
+
| `error` | Status | Failures, destructive actions, validation issues |
|
|
52
|
+
| `success` | Status | Successful operations, positive confirmation |
|
|
53
|
+
| `warning` | Status | Caution, non-blocking issues that require attention |
|
|
54
|
+
| `info` | Status | Neutral informational content or guidance |
|
|
55
|
+
| `dark` | Neutral | Neutral chrome. Painted with roles that follow the mode, so it is not "for light backgrounds": check the component's `pattern.md` for how it renders |
|
|
56
|
+
| `light` | Neutral | The other half of the neutral pair, same caveat as `dark` |
|
|
57
|
+
| `amaranth` | Label | Decorative amaranth label for tags, categories, or visual grouping |
|
|
58
|
+
| `red` | Label | Decorative red label for tags, categories, or visual grouping |
|
|
59
|
+
| `aqua` | Label | Decorative aqua label for tags, categories, or visual grouping |
|
|
60
|
+
| `blue` | Label | Decorative blue label for tags, categories, or visual grouping |
|
|
61
|
+
| `green` | Label | Decorative green label for tags, categories, or visual grouping |
|
|
62
|
+
| `lime` | Label | Decorative lime label for tags, categories, or visual grouping |
|
|
63
|
+
| `orange` | Label | Decorative orange label for tags, categories, or visual grouping |
|
|
64
|
+
| `orchid` | Label | Decorative orchid label for tags, categories, or visual grouping |
|
|
65
|
+
| `purple` | Label | Decorative purple label for tags, categories, or visual grouping |
|
|
66
|
+
| `sky` | Label | Decorative sky label for tags, categories, or visual grouping |
|
|
67
|
+
| `violet` | Label | Decorative violet label for tags, categories, or visual grouping |
|
|
68
|
+
| `yellow` | Label | Decorative yellow label for tags, categories, or visual grouping |
|
|
69
|
+
|
|
70
|
+
A label colour never communicates state: for state use a status variant.
|
|
71
|
+
|
|
72
|
+
## Tones
|
|
73
|
+
|
|
74
|
+
The tone vocabulary, from the most to the least emphasis:
|
|
75
|
+
|
|
76
|
+
| Tone | Weight | Visual |
|
|
77
|
+
| --------- | ------------------- | ---------------------------------------------------------- |
|
|
78
|
+
| `strong` | Highest emphasis | Solid filled background |
|
|
79
|
+
| `weak` | Medium emphasis | Subtle tinted background, for supporting context |
|
|
80
|
+
| `outline` | Medium-low emphasis | Border only, no fill |
|
|
81
|
+
| `text` | Lowest emphasis | No border, no background - just the label, in-text actions |
|
|
82
|
+
| `box` | Boxed container | High-contrast container style |
|
|
83
|
+
|
|
84
|
+
Only `strong` and `weak` are common. `outline` exists on `mds-button`, `mds-badge`,
|
|
85
|
+
`mds-radial-menu` and `mds-radial-menu-item`; `text` on `mds-button`, `mds-radial-menu`
|
|
86
|
+
and `mds-radial-menu-item`; `box` on `mds-button` and `mds-banner`.
|
|
87
|
+
|
|
88
|
+
## What one component accepts
|
|
89
|
+
|
|
90
|
+
The values a specific component accepts for `tone`, `variant`, `size`, etc. are
|
|
91
|
+
**narrower** than the vocabularies above. For example, `mds-button` accepts
|
|
92
|
+
`tone="outline"` but `mds-banner` does not.
|
|
93
|
+
|
|
94
|
+
To verify a prop value before using it, read the Props table in the component's
|
|
95
|
+
`AGENTS.md` (listed in [`components.md`](components.md)): the Type column lists the
|
|
96
|
+
allowed values. The typed signatures are also in
|
|
97
|
+
`@maggioli-design-system/magma/dist/types/components.d.ts`, where a prop is typed by
|
|
98
|
+
name (e.g. `tone?: ToneMinimalBoxVariantType`).
|
|
99
|
+
|
|
100
|
+
The `tone` types:
|
|
101
|
+
|
|
102
|
+
| Type | Allowed `tone` values | Components |
|
|
103
|
+
| --------------------------- | ------------------------------------------ | ---------- |
|
|
104
|
+
| `ToneMinimalVariantType` | `strong`, `weak` | `mds-avatar`, `mds-avatar-stack-item`, `mds-button-dropdown`, `mds-chip`, `mds-entity`, `mds-label`, `mds-push-notification-item`, `mds-toast` |
|
|
105
|
+
| `ToneMinimalBoxVariantType` | `strong`, `weak`, `box` | `mds-banner` |
|
|
106
|
+
| `ToneSmartVariantType` | `strong`, `weak`, `outline` | `mds-badge` |
|
|
107
|
+
| `ToneVariantType` | `outline`, `strong`, `text`, `weak` | `mds-radial-menu`, `mds-radial-menu-item` |
|
|
108
|
+
| `ToneBoxVariantType` | `outline`, `strong`, `text`, `weak`, `box` | `mds-button` |
|
|
109
|
+
| `ToneSimpleVariantType` | `strong`, `weak`, `text` | none today |
|
|
110
|
+
|
|
111
|
+
`variant`, `size`, and other constrained props follow the same pattern (e.g.
|
|
112
|
+
`ThemeVariantType`, `ThemeFullVariantType`, `ChipVariantType`, `ProgressBarSizeType`).
|
|
@@ -7,6 +7,6 @@ export const MdsButtonDropdown = /*@__PURE__*/ createComponent({
|
|
|
7
7
|
elementClass: MdsButtonDropdownElement,
|
|
8
8
|
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
9
9
|
react: React,
|
|
10
|
-
events: {},
|
|
10
|
+
events: { onMdsButtonDropdownClick: 'mdsButtonDropdownClick' },
|
|
11
11
|
defineCustomElement: defineMdsButtonDropdown
|
|
12
12
|
});
|
|
@@ -14,7 +14,8 @@ export const MdsInputDateRange = /*@__PURE__*/ createComponent({
|
|
|
14
14
|
delay: 'delay',
|
|
15
15
|
hideToday: 'hide-today',
|
|
16
16
|
dualCalendar: 'dual-calendar',
|
|
17
|
-
name: 'name'
|
|
17
|
+
name: 'name',
|
|
18
|
+
disabled: 'disabled'
|
|
18
19
|
},
|
|
19
20
|
hydrateModule: typeof window === 'undefined' ? import('@maggioli-design-system/magma/hydrate') : undefined,
|
|
20
21
|
clientModule: clientComponents.MdsInputDateRange,
|
|
@@ -9,6 +9,7 @@ export const MdsInputOtp = /*@__PURE__*/ createComponent({
|
|
|
9
9
|
accessibleName: 'aria-label',
|
|
10
10
|
length: 'length',
|
|
11
11
|
autosubmit: 'autosubmit',
|
|
12
|
+
disabled: 'disabled',
|
|
12
13
|
value: 'value'
|
|
13
14
|
},
|
|
14
15
|
hydrateModule: typeof window === 'undefined' ? import('@maggioli-design-system/magma/hydrate') : undefined,
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
* This file was automatically generated by the Stencil React Output Target.
|
|
3
3
|
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
|
|
4
4
|
*/
|
|
5
|
-
import type { StencilReactComponent } from '@stencil/react-output-target/runtime';
|
|
5
|
+
import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime';
|
|
6
|
+
import { type MdsButtonDropdownCustomEvent } from "@maggioli-design-system/magma";
|
|
6
7
|
import type { Components } from "@maggioli-design-system/magma/dist/components";
|
|
7
8
|
import { MdsButtonDropdown as MdsButtonDropdownElement } from "@maggioli-design-system/magma/dist/components/mds-button-dropdown.js";
|
|
8
|
-
export type MdsButtonDropdownEvents =
|
|
9
|
+
export type MdsButtonDropdownEvents = {
|
|
10
|
+
onMdsButtonDropdownClick: EventName<MdsButtonDropdownCustomEvent<void>>;
|
|
11
|
+
};
|
|
9
12
|
export declare const MdsButtonDropdown: StencilReactComponent<MdsButtonDropdownElement, MdsButtonDropdownEvents, Components.MdsButtonDropdown>;
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
* This file was automatically generated by the Stencil React Output Target.
|
|
3
3
|
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
|
|
4
4
|
*/
|
|
5
|
-
import type { StencilReactComponent } from '@stencil/react-output-target/runtime';
|
|
5
|
+
import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime';
|
|
6
6
|
import { type SerializeShadowRootOptions } from '@stencil/react-output-target/ssr';
|
|
7
|
+
import { type MdsButtonDropdownCustomEvent } from "@maggioli-design-system/magma";
|
|
7
8
|
import type { Components } from "@maggioli-design-system/magma/dist/components";
|
|
8
9
|
import { MdsButtonDropdown as MdsButtonDropdownElement } from "@maggioli-design-system/magma/dist/components/mds-button-dropdown.js";
|
|
9
10
|
export declare const serializeShadowRoot: SerializeShadowRootOptions;
|
|
10
|
-
export type MdsButtonDropdownEvents =
|
|
11
|
+
export type MdsButtonDropdownEvents = {
|
|
12
|
+
onMdsButtonDropdownClick: EventName<MdsButtonDropdownCustomEvent<void>>;
|
|
13
|
+
};
|
|
11
14
|
export declare const MdsButtonDropdown: StencilReactComponent<MdsButtonDropdownElement, MdsButtonDropdownEvents, Components.MdsButtonDropdown>;
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
|
|
4
4
|
*/
|
|
5
5
|
import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime';
|
|
6
|
-
import { type
|
|
6
|
+
import { type MdsInputSelectCustomEvent, type MdsInputSelectEventDetail } from "@maggioli-design-system/magma";
|
|
7
7
|
import type { Components } from "@maggioli-design-system/magma/dist/components";
|
|
8
8
|
import { MdsInputSelect as MdsInputSelectElement } from "@maggioli-design-system/magma/dist/components/mds-input-select.js";
|
|
9
9
|
export type MdsInputSelectEvents = {
|
|
10
|
-
onMdsInputSelectChange: EventName<MdsInputSelectCustomEvent<
|
|
10
|
+
onMdsInputSelectChange: EventName<MdsInputSelectCustomEvent<MdsInputSelectEventDetail>>;
|
|
11
11
|
};
|
|
12
12
|
export declare const MdsInputSelect: StencilReactComponent<MdsInputSelectElement, MdsInputSelectEvents, Components.MdsInputSelect>;
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime';
|
|
6
6
|
import { type SerializeShadowRootOptions } from '@stencil/react-output-target/ssr';
|
|
7
|
-
import { type
|
|
7
|
+
import { type MdsInputSelectCustomEvent, type MdsInputSelectEventDetail } from "@maggioli-design-system/magma";
|
|
8
8
|
import type { Components } from "@maggioli-design-system/magma/dist/components";
|
|
9
9
|
import { MdsInputSelect as MdsInputSelectElement } from "@maggioli-design-system/magma/dist/components/mds-input-select.js";
|
|
10
10
|
export declare const serializeShadowRoot: SerializeShadowRootOptions;
|
|
11
11
|
export type MdsInputSelectEvents = {
|
|
12
|
-
onMdsInputSelectChange: EventName<MdsInputSelectCustomEvent<
|
|
12
|
+
onMdsInputSelectChange: EventName<MdsInputSelectCustomEvent<MdsInputSelectEventDetail>>;
|
|
13
13
|
};
|
|
14
14
|
export declare const MdsInputSelect: StencilReactComponent<MdsInputSelectElement, MdsInputSelectEvents, Components.MdsInputSelect>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maggioli-design-system/magma-react",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"main": "dist/components.js",
|
|
5
5
|
"module": "dist/components.js",
|
|
6
6
|
"types": "dist/types/components.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@maggioli-design-system/magma": "2.0
|
|
35
|
+
"@maggioli-design-system/magma": "2.2.0",
|
|
36
36
|
"@stencil/react-output-target": "1.6.2"
|
|
37
37
|
},
|
|
38
38
|
"repository": {
|