@maz-ui/mcp 4.9.3 → 5.0.0-beta.1
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/dist/mcp.mjs +1 -1
- package/docs/generated-docs/maz-alert.doc.md +1 -1
- package/docs/generated-docs/maz-avatar.doc.md +1 -1
- package/docs/generated-docs/maz-badge.doc.md +8 -8
- package/docs/generated-docs/maz-btn.doc.md +26 -26
- package/docs/generated-docs/maz-card.doc.md +19 -19
- package/docs/generated-docs/maz-chart.doc.md +8 -8
- package/docs/generated-docs/maz-container.doc.md +20 -20
- package/docs/generated-docs/maz-drawer.doc.md +8 -8
- package/docs/generated-docs/maz-dropdown.doc.md +1 -1
- package/docs/generated-docs/maz-dropzone.doc.md +2 -2
- package/docs/generated-docs/maz-gallery.doc.md +15 -15
- package/docs/generated-docs/maz-icon.doc.md +11 -14
- package/docs/generated-docs/maz-input.doc.md +38 -38
- package/docs/generated-docs/maz-lazy-img.doc.md +18 -0
- package/docs/generated-docs/maz-link.doc.md +9 -9
- package/docs/generated-docs/maz-pagination.doc.md +9 -9
- package/docs/generated-docs/maz-popover.doc.md +5 -1
- package/docs/generated-docs/maz-radio-buttons.doc.md +17 -17
- package/docs/generated-docs/maz-select.doc.md +2 -2
- package/docs/generated-docs/maz-skeleton.doc.md +10 -10
- package/docs/generated-docs/maz-table.doc.md +37 -37
- package/docs/generated-docs/maz-textarea.doc.md +1 -1
- package/docs/generated-docs/maz-timeline.doc.md +1 -1
- package/docs/src/blog/v4.md +7 -7
- package/docs/src/blog/v5.md +186 -0
- package/docs/src/components/maz-accordion.md +1 -1
- package/docs/src/components/maz-alert.md +15 -15
- package/docs/src/components/maz-animated-counter.md +4 -4
- package/docs/src/components/maz-avatar.md +2 -2
- package/docs/src/components/maz-backdrop.md +7 -7
- package/docs/src/components/maz-badge.md +16 -34
- package/docs/src/components/maz-bottom-sheet.md +74 -74
- package/docs/src/components/maz-btn-group.md +17 -17
- package/docs/src/components/maz-btn.md +129 -96
- package/docs/src/components/maz-card-spotlight.md +5 -5
- package/docs/src/components/maz-card.md +20 -20
- package/docs/src/components/maz-carousel.md +14 -14
- package/docs/src/components/maz-chart.md +23 -4
- package/docs/src/components/maz-checkbox.md +3 -3
- package/docs/src/components/maz-checklist.md +19 -19
- package/docs/src/components/maz-circular-progress-bar.md +4 -4
- package/docs/src/components/maz-container.md +52 -37
- package/docs/src/components/maz-date-picker.md +7 -7
- package/docs/src/components/maz-dialog-confirm.md +2 -2
- package/docs/src/components/maz-drawer.md +14 -14
- package/docs/src/components/maz-dropdown.md +27 -12
- package/docs/src/components/maz-dropzone.md +6 -6
- package/docs/src/components/maz-expand-animation.md +2 -2
- package/docs/src/components/maz-fullscreen-loader.md +2 -2
- package/docs/src/components/maz-gallery.md +1 -1
- package/docs/src/components/maz-icon.md +113 -60
- package/docs/src/components/maz-input-code.md +1 -1
- package/docs/src/components/maz-input-phone-number.md +89 -88
- package/docs/src/components/maz-input-tags.md +2 -2
- package/docs/src/components/maz-input.md +42 -12
- package/docs/src/components/maz-link.md +28 -12
- package/docs/src/components/maz-pagination.md +2 -2
- package/docs/src/components/maz-popover.md +236 -236
- package/docs/src/components/maz-pull-to-refresh.md +2 -2
- package/docs/src/components/maz-radio-buttons.md +11 -11
- package/docs/src/components/maz-radio.md +3 -3
- package/docs/src/components/maz-read-more.md +7 -7
- package/docs/src/components/maz-select-country.md +26 -26
- package/docs/src/components/maz-select.md +1 -1
- package/docs/src/components/maz-skeleton.md +25 -25
- package/docs/src/components/maz-spinner.md +2 -2
- package/docs/src/components/maz-stepper.md +5 -5
- package/docs/src/components/maz-switch.md +1 -1
- package/docs/src/components/maz-table.md +10 -10
- package/docs/src/components/maz-tabs.md +17 -17
- package/docs/src/components/maz-textarea.md +8 -8
- package/docs/src/components/maz-ticker.md +37 -37
- package/docs/src/components/maz-timeline.md +9 -9
- package/docs/src/composables/use-dialog.md +1 -1
- package/docs/src/composables/use-display-names.md +2 -2
- package/docs/src/composables/use-form-validator.md +35 -35
- package/docs/src/composables/use-idle-timeout.md +3 -3
- package/docs/src/composables/use-reading-time.md +5 -5
- package/docs/src/composables/use-string-matching.md +4 -4
- package/docs/src/composables/use-swipe.md +3 -3
- package/docs/src/composables/use-timer.md +3 -3
- package/docs/src/composables/use-toast.md +1 -1
- package/docs/src/composables/use-user-visibility.md +1 -1
- package/docs/src/composables/use-wait.md +2 -2
- package/docs/src/directives/click-outside.md +17 -17
- package/docs/src/directives/lazy-img.md +5 -5
- package/docs/src/directives/tooltip.md +15 -15
- package/docs/src/directives/zoom-img.md +1 -1
- package/docs/src/ecosystem/eslint-config.md +187 -0
- package/docs/src/ecosystem/stylelint-config.md +302 -0
- package/docs/src/guide/browser-support.md +81 -0
- package/docs/src/guide/getting-started.md +23 -16
- package/docs/src/guide/icon-set.md +11 -11
- package/docs/src/guide/icons.md +32 -5
- package/docs/src/guide/maz-ui-provider.md +6 -6
- package/docs/src/guide/migration-v4.md +3 -3
- package/docs/src/guide/migration-v5.md +662 -0
- package/docs/src/guide/nuxt.md +27 -44
- package/docs/src/guide/resolvers.md +2 -2
- package/docs/src/guide/tailwind.md +154 -0
- package/docs/src/guide/themes.md +258 -485
- package/docs/src/guide/vue.md +8 -5
- package/docs/src/helpers/capitalize.md +4 -4
- package/docs/src/helpers/country-code-to-unicode-flag.md +37 -37
- package/docs/src/helpers/currency.md +4 -4
- package/docs/src/helpers/date.md +4 -4
- package/docs/src/helpers/get-country-flag-url.md +9 -9
- package/docs/src/helpers/number.md +5 -5
- package/docs/src/index.md +296 -266
- package/docs/src/made-with-maz-ui.md +5 -5
- package/docs/src/plugins/aos.md +6 -6
- package/docs/src/plugins/dialog.md +4 -4
- package/docs/src/plugins/toast.md +3 -3
- package/docs/src/plugins/wait.md +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,662 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Maz-UI v5.0.0 Migration Guide
|
|
3
|
+
description: What changes for you when upgrading from Maz-UI v4 to v5
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# {{ $frontmatter.title }}
|
|
7
|
+
|
|
8
|
+
Maz-UI v5 is a major release. For **most consumers** the migration is short — you keep installing the package, importing its styles, using the components. Below is what actually changes for you.
|
|
9
|
+
|
|
10
|
+
::: warning Solo maintainer notice
|
|
11
|
+
Maz-UI is maintained by a single developer. After the v5 stable release, **v4 will no longer receive any support** — no security fixes, no backports. Please plan your upgrade.
|
|
12
|
+
:::
|
|
13
|
+
|
|
14
|
+
## Run the upgrade tool
|
|
15
|
+
|
|
16
|
+
A first pass that does the mechanical work for you:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Preview
|
|
20
|
+
npx @maz-ui/upgrade ./ --dry-run
|
|
21
|
+
|
|
22
|
+
# Apply
|
|
23
|
+
npx @maz-ui/upgrade ./
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
It rewrites: CSS subpath imports (`maz-ui/styles` → `maz-ui/style.css`), `left-icon`/`right-icon` → `start-icon`/`end-icon` (props, slots, `--has-*-icon` classes), `footer-align`/`variant` direction values, `color="background"` / `active-color="background"` → `surface`, `rounded-size="base"` → `md`, `--maz-background` / `--maz-border` CSS vars → `--maz-surface` / `--maz-divider`, `hsl(var(--maz-X))` collapse, Nuxt `injectMainCss` → `injectCss`, theme `strategy: 'hybrid'` → `'runtime'`, drops the removed theme options (`injectCriticalCSS`, `injectFullCSS`, `injectAllCSSOnServer`), and renames `colors.{light,dark}.background` → `surface` / `.border` → `divider` inside custom presets. It also bumps every `maz-ui` and `@maz-ui/*` entry in your `package.json` files to `^5.0.0` and runs the right `<pm> install` for you (detected from your lockfile — pnpm, yarn, bun, npm). Pass `--no-install` if you want to skip the install step.
|
|
27
|
+
|
|
28
|
+
What it can't decide for you: the `MazIcon` API simplification (section 4), `MazBadge` numeric size mapping (section 9), `foundation.radius` → `scales.rounded.md` reshape (section 11) and `MazChart` `update-mode` defaults (section 8). Those are best handled with the MCP server below.
|
|
29
|
+
|
|
30
|
+
See the full list of transforms in the [`@maz-ui/upgrade` README](https://github.com/LouisMazel/maz-ui/tree/master/packages/upgrade).
|
|
31
|
+
|
|
32
|
+
## Migrate with the Maz-UI MCP server
|
|
33
|
+
|
|
34
|
+
You don't have to scroll through this page by hand. The official **[`@maz-ui/mcp`](./mcp.md)** server exposes this guide (and every other Maz-UI doc — components, composables, plugins, helpers) to your AI assistant via the Model Context Protocol. Once it's wired up, the assistant can search the migration guide, pull the exact section it needs, and patch your codebase with full context on what changed in v5.
|
|
35
|
+
|
|
36
|
+
### One-time setup
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Claude Code
|
|
40
|
+
claude mcp add maz-ui npx @maz-ui/mcp --scope project
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
For Cursor, Windsurf, VS Code Copilot, Cline and Claude Desktop, see the [MCP guide](./mcp.md#ai-assistant-configuration). Then restart your assistant.
|
|
44
|
+
|
|
45
|
+
### A migration flow that works
|
|
46
|
+
|
|
47
|
+
1. **Pin the guide.** Open the assistant in your project root and prime it:
|
|
48
|
+
|
|
49
|
+
> Use the `maz-ui` MCP server. Fetch the v5 migration guide (`get_doc` on guide `migration-v5`) and read it in full before touching any code.
|
|
50
|
+
|
|
51
|
+
2. **Let it scan your codebase against the checklist.** Once it has the guide loaded:
|
|
52
|
+
|
|
53
|
+
> Walk the migration checklist top to bottom. For each numbered item, search my codebase, list every match, and tell me which ones need a change. Do not modify anything yet.
|
|
54
|
+
|
|
55
|
+
3. **Apply the easy ones in batch.** The mechanical renames are safe to automate:
|
|
56
|
+
|
|
57
|
+
> Apply the codemod for sections 2, 3, 6 and 14 (CSS subpath, `rounded-size="base"`, `left-icon`/`right-icon`, Nuxt `injectMainCss`). Show me a diff before saving.
|
|
58
|
+
|
|
59
|
+
4. **Discuss the judgment calls.** For sections that have more than a rename — `MazIcon` API, `MazChart` `update-mode`, theme preset reshape — let the assistant ask before rewriting:
|
|
60
|
+
|
|
61
|
+
> For sections 4, 8 and 10–12, do not patch automatically. Tell me which of my call sites are affected and propose options.
|
|
62
|
+
|
|
63
|
+
5. **Verify.** After patches:
|
|
64
|
+
|
|
65
|
+
> Run my typecheck and unit tests, then re-read sections you applied and confirm I haven't missed anything.
|
|
66
|
+
|
|
67
|
+
### Useful prompts
|
|
68
|
+
|
|
69
|
+
- *"Search the Maz-UI docs for `useToast` and tell me if my call sites still match the v5 signature."*
|
|
70
|
+
- *"My custom theme preset still defines `colors.light.background`. Look up the v5 preset shape from the MCP and rewrite my preset."*
|
|
71
|
+
- *"I see `hsl(var(--maz-primary))` in my CSS. Apply the v5 fix everywhere with the alpha cases handled via `color-mix`."*
|
|
72
|
+
- *"Compare my `MazIcon` usages against the v5 API and split the codemod into a deterministic part (URL/Vue component) and a part you want me to confirm."*
|
|
73
|
+
|
|
74
|
+
The MCP server is read-only — it ships docs, not code edits — so the assistant still has to write the patches against your repo with whatever tooling it has. But it removes the "did I miss a section?" risk: the guide and the rest of the v5 docs are always one tool call away.
|
|
75
|
+
|
|
76
|
+
## Migration checklist
|
|
77
|
+
|
|
78
|
+
1. Bump **Node to ≥ 20** and confirm your audience has modern browsers (see below).
|
|
79
|
+
2. If your **custom CSS** uses `hsl(var(--maz-<color>))`, simplify to `var(--maz-<color>)`.
|
|
80
|
+
3. Rename `import 'maz-ui/styles'` to `import 'maz-ui/style.css'` (and `maz-ui/aos-styles` → `maz-ui/aos.css`).
|
|
81
|
+
4. Replace any `rounded-size="base"` with `rounded-size="md"` (or drop the prop — the new default is visually identical).
|
|
82
|
+
5. Replace any **numeric `MazBadge` size** (`size="0.8rem"`, `size="1.2em"`, …) with one of the standardized keywords (`'mini' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'`).
|
|
83
|
+
6. **`MazIcon` API simplified** — drop `name`, `path` and `src` props; use a single `icon` prop that accepts a Vue component, a URL/`data:` URI, or a raw SVG string.
|
|
84
|
+
7. Rename **`left-icon` / `right-icon`** to **`start-icon` / `end-icon`** (and the matching slots / `--has-*-icon` classes) on `MazBtn`, `MazInput`, `MazLink`, `MazContainer`, `MazSelect`. Same idea for `MazCard`'s `footer-align` and `MazDrawer`'s `variant` — `'left' | 'right'` becomes `'start' | 'end'`.
|
|
85
|
+
8. **`MazChart`** drops `vue-chartjs` (lighter bundle, no eager registration of unused chart types). The `update-mode` prop now defaults to `'none'` — pass `update-mode="default"` if you want animated data updates.
|
|
86
|
+
9. That's it for most apps. Everything else is opt-in.
|
|
87
|
+
|
|
88
|
+
## Prerequisites
|
|
89
|
+
|
|
90
|
+
### Node
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
node -v # must be >= 20
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Browser support
|
|
97
|
+
|
|
98
|
+
v5 requires native support for a few modern CSS features (`color-mix()`, `@property`, native CSS nesting). Minimum versions:
|
|
99
|
+
|
|
100
|
+
| Browser | Minimum |
|
|
101
|
+
| --- | --- |
|
|
102
|
+
| Chromium (Chrome, Edge, Opera, Brave, Arc) | 111 (March 2023) |
|
|
103
|
+
| Safari | 16.4 (March 2023) |
|
|
104
|
+
| Firefox | 128 (July 2024) |
|
|
105
|
+
| Samsung Internet | 22 |
|
|
106
|
+
|
|
107
|
+
There is no polyfill path. If your audience still relies on older browsers, stay on v4. See the dedicated [Browser Support](./browser-support.md) page for the rationale.
|
|
108
|
+
|
|
109
|
+
## Required changes
|
|
110
|
+
|
|
111
|
+
### 1. `hsl(var(--maz-<color>))` → `var(--maz-<color>)` in your CSS
|
|
112
|
+
|
|
113
|
+
The biggest — and usually only — change to chase down in your codebase.
|
|
114
|
+
|
|
115
|
+
**In v4** the CSS variables injected by `@maz-ui/themes` held raw HSL channels (`210 100% 56%`), so you had to wrap them yourself:
|
|
116
|
+
|
|
117
|
+
```css
|
|
118
|
+
.brand {
|
|
119
|
+
background-color: hsl(var(--maz-primary));
|
|
120
|
+
border-color: hsl(var(--maz-primary) / 0.5);
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**In v5** the same variables hold complete CSS colors (`hsl(210 100% 56%)`). Wrapping in `hsl(...)` again produces `hsl(hsl(...))`, which is invalid. Update your own CSS:
|
|
125
|
+
|
|
126
|
+
```css
|
|
127
|
+
.brand {
|
|
128
|
+
background-color: var(--maz-primary);
|
|
129
|
+
border-color: color-mix(in srgb, var(--maz-primary) 50%, transparent);
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
For the alpha case, use `color-mix()`. The old `/ <alpha>` syntax no longer applies to already-wrapped values.
|
|
134
|
+
|
|
135
|
+
Quick search-and-fix:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Find the patterns to update
|
|
139
|
+
rg "hsl\(\s*var\(--maz-" src/
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### 2. CSS subpath renames
|
|
143
|
+
|
|
144
|
+
The two CSS entry points have been renamed to include their real file extension, so TypeScript treats them as plain side-effect CSS imports (no more `.d.ts` stubs required):
|
|
145
|
+
|
|
146
|
+
| v4 | v5 |
|
|
147
|
+
| --- | --- |
|
|
148
|
+
| `import 'maz-ui/styles'` | `import 'maz-ui/style.css'` |
|
|
149
|
+
| `import 'maz-ui/aos-styles'` | `import 'maz-ui/aos.css'` |
|
|
150
|
+
|
|
151
|
+
Both resolve to the same compiled CSS they did in v4, only the subpath key changes.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Find the patterns to update
|
|
155
|
+
rg "['\"]maz-ui/(styles|aos-styles)['\"]" src/
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 3. `rounded-size="base"` removed
|
|
159
|
+
|
|
160
|
+
The `'base'` value of the `rounded-size` prop has been removed across the affected components. The default radius is now `'md'` (which maps to the same visual radius v4 used for `'base'`).
|
|
161
|
+
|
|
162
|
+
| Component | Old default | New default |
|
|
163
|
+
| --- | --- | --- |
|
|
164
|
+
| `MazAlert` | `'base'` | `'md'` |
|
|
165
|
+
| `MazAvatar` | `'base'` | `'md'` |
|
|
166
|
+
| `MazBtn` | `'base'` | `'md'` |
|
|
167
|
+
| `MazContainer` | `'base'` | `'md'` |
|
|
168
|
+
| `MazInput` | `'base'` | `'md'` |
|
|
169
|
+
| `MazSkeleton` | `'base'` | `'md'` |
|
|
170
|
+
| `MazTable` | `'lg'` | `'md'` |
|
|
171
|
+
| `MazTextarea` | (none) | `'md'` |
|
|
172
|
+
| `MazTimeline` | `'base'` | `'md'` |
|
|
173
|
+
|
|
174
|
+
Search for explicit usages and replace them:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
rg "rounded-?size\s*=\s*['\"]base['\"]" src/
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
```vue
|
|
181
|
+
<!-- v4 -->
|
|
182
|
+
<MazBtn rounded-size="base" />
|
|
183
|
+
|
|
184
|
+
<!-- v5 -->
|
|
185
|
+
<MazBtn rounded-size="md" />
|
|
186
|
+
<!-- or just drop the prop, the new default is identical visually -->
|
|
187
|
+
<MazBtn />
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 4. `MazIcon` API simplified
|
|
191
|
+
|
|
192
|
+
`MazIcon` v4 had four ways to specify an icon (`icon`, `src`, `path`+`name`, `name`). v5 collapses everything into a single `icon` prop that accepts:
|
|
193
|
+
|
|
194
|
+
- A **Vue component** (lazy or static, from `@maz-ui/icons`)
|
|
195
|
+
- A **URL** or `data:` URI to a `.svg` file
|
|
196
|
+
- A **raw SVG string** (`'<svg>…</svg>'`)
|
|
197
|
+
|
|
198
|
+
```vue
|
|
199
|
+
<!-- v4 -->
|
|
200
|
+
<MazIcon name="home" />
|
|
201
|
+
<MazIcon name="home" path="/icons" />
|
|
202
|
+
<MazIcon src="/assets/star.svg" />
|
|
203
|
+
<MazIcon :icon="MazStar" />
|
|
204
|
+
|
|
205
|
+
<!-- v5 -->
|
|
206
|
+
<MazIcon icon="/home.svg" /> <!-- relative URL — `mazIconPath` is prepended in SSR -->
|
|
207
|
+
<MazIcon icon="/icons/home.svg" /> <!-- absolute path -->
|
|
208
|
+
<MazIcon icon="/assets/star.svg" />
|
|
209
|
+
<MazIcon :icon="MazStar" /> <!-- unchanged -->
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
The `mazIconPath` `provide` (and Nuxt's `mazUi.general.defaultMazIconPath`) is still honored — it now acts as a **base URL prefix** for relative URL icons, mainly useful in SSR where `fetch('/icons/home.svg')` cannot resolve without a host.
|
|
213
|
+
|
|
214
|
+
New props:
|
|
215
|
+
|
|
216
|
+
- `fallback` — same shape as `icon`. Used when `icon` is missing or fails to load. Defaults to `MazQuestionMarkCircle`.
|
|
217
|
+
- `svg-attributes` — extra attributes injected onto the rendered `<svg>`.
|
|
218
|
+
- `flip-icon-for-rtl` — mirror the icon horizontally when the document direction is RTL (useful for chevrons/arrows).
|
|
219
|
+
|
|
220
|
+
Removed:
|
|
221
|
+
|
|
222
|
+
- `loaded` and `unloaded` events (only `error` remains, useful for telemetry/fallback wiring).
|
|
223
|
+
|
|
224
|
+
The `<MazIcon>` rendering also got a small a11y polish — it sets `aria-hidden="true"` by default and switches to `role="img"` (without `aria-hidden`) automatically when an `aria-label` is provided.
|
|
225
|
+
|
|
226
|
+
### 5. New raw icon import path — `@maz-ui/icons/raw/*`
|
|
227
|
+
|
|
228
|
+
Each bundled icon is now also exported as a **raw SVG string** under the `raw/` subpath. Pass it to `<MazIcon :icon="…" />` to inline the SVG without paying the cost of a Vue component or an async chunk.
|
|
229
|
+
|
|
230
|
+
```vue
|
|
231
|
+
<script setup>
|
|
232
|
+
import MazIcon from 'maz-ui/components/MazIcon'
|
|
233
|
+
import { MazStar } from '@maz-ui/icons/raw/MazStar'
|
|
234
|
+
</script>
|
|
235
|
+
|
|
236
|
+
<template>
|
|
237
|
+
<MazIcon :icon="MazStar" />
|
|
238
|
+
</template>
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
The existing `static/` (eager Vue component) and `lazy/` (async Vue component) entries are still available — pick what fits the situation. See the [icons guide](./icons.md#raw-svg-strings-new-in-v5) for the full decision matrix.
|
|
242
|
+
|
|
243
|
+
### 6. Logical direction props — `left-icon`/`right-icon` → `start-icon`/`end-icon`
|
|
244
|
+
|
|
245
|
+
To make components RTL-correct out of the box, every prop / slot / class that names a *visual* edge has been renamed to a *logical* edge:
|
|
246
|
+
|
|
247
|
+
- **`left` / `right`** describe a physical position; they don't flip when `dir="rtl"`.
|
|
248
|
+
- **`start` / `end`** follow the inline direction — `start` is the side where reading begins (left in LTR, right in RTL).
|
|
249
|
+
|
|
250
|
+
This is consistent with native CSS (`margin-inline-start`, `padding-inline-end`, `text-align: start`) and with how design systems like Radix UI and MUI handle direction.
|
|
251
|
+
|
|
252
|
+
#### Components
|
|
253
|
+
|
|
254
|
+
| Component | v4 | v5 |
|
|
255
|
+
| --- | --- | --- |
|
|
256
|
+
| `MazBtn` | `left-icon` / `right-icon` props, `#left-icon` / `#right-icon` slots | `start-icon` / `end-icon` props, `#start-icon` / `#end-icon` slots |
|
|
257
|
+
| `MazInput` | `left-icon` / `right-icon` props, `#left-icon` / `#right-icon` slots | `start-icon` / `end-icon` props, `#start-icon` / `#end-icon` slots |
|
|
258
|
+
| `MazLink` | `left-icon` / `right-icon` props, `#left-icon` / `#right-icon` slots | `start-icon` / `end-icon` props, `#start-icon` / `#end-icon` slots |
|
|
259
|
+
| `MazContainer` | `left-icon` / `right-icon` props, `#icon-left` / `#icon-right` slots | `start-icon` / `end-icon` props, `#icon-start` / `#icon-end` slots |
|
|
260
|
+
| `MazSelect` | `#left-icon` / `#right-icon` slots | `#start-icon` / `#end-icon` slots |
|
|
261
|
+
| `MazCard` | `footer-align: 'left' \| 'right'` | `footer-align: 'start' \| 'end'` |
|
|
262
|
+
| `MazDrawer` | `variant: 'left' \| 'right' \| 'top' \| 'bottom'` | `variant: 'start' \| 'end' \| 'top' \| 'bottom'` (`top` / `bottom` unchanged — physical) |
|
|
263
|
+
|
|
264
|
+
`top` and `bottom` are intentionally kept (block-axis edges that don't flip in RTL).
|
|
265
|
+
|
|
266
|
+
#### Internal CSS hooks
|
|
267
|
+
|
|
268
|
+
If you target maz-ui's internal selectors from your own CSS, also rename:
|
|
269
|
+
|
|
270
|
+
| v4 | v5 |
|
|
271
|
+
| --- | --- |
|
|
272
|
+
| `.--has-left-icon` / `.--has-right-icon` | `.--has-start-icon` / `.--has-end-icon` (on `MazBtn`, `MazInput`) |
|
|
273
|
+
| `.m-input-wrapper-left` / `.m-input-wrapper-right` | `.m-input-wrapper-start` / `.m-input-wrapper-end` |
|
|
274
|
+
| `drawer-anim-left` / `drawer-anim-right` transitions | `drawer-anim-start` / `drawer-anim-end` (auto-mirrored under `[dir="rtl"]`) |
|
|
275
|
+
|
|
276
|
+
#### Migration
|
|
277
|
+
|
|
278
|
+
```vue
|
|
279
|
+
<!-- v4 -->
|
|
280
|
+
<MazBtn left-icon="user" right-icon="arrow-right">Save</MazBtn>
|
|
281
|
+
<MazInput :left-icon="MazSearch" />
|
|
282
|
+
<MazContainer title="Settings" left-icon="cog-6-tooth" />
|
|
283
|
+
<MazCard footer-align="right" />
|
|
284
|
+
<MazDrawer variant="right" />
|
|
285
|
+
|
|
286
|
+
<!-- v5 -->
|
|
287
|
+
<MazBtn start-icon="user" end-icon="arrow-right">Save</MazBtn>
|
|
288
|
+
<MazInput :start-icon="MazSearch" />
|
|
289
|
+
<MazContainer title="Settings" start-icon="cog-6-tooth" />
|
|
290
|
+
<MazCard footer-align="end" />
|
|
291
|
+
<MazDrawer variant="end" />
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
# Quick search to chase down the renames
|
|
296
|
+
rg "(left|right)-icon|(left|right)Icon|footer-align=\"(left|right)\"|variant=\"(left|right)\"" src/
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### 7. Icon-consuming components accept the full `MazIconProps` object
|
|
300
|
+
|
|
301
|
+
`MazBtn`, `MazInput`, `MazLink`, `MazContainer` and `MazDropdown` all forward their `start-icon` / `end-icon` / `icon` / `dropdown-icon` to an internal `<MazIcon>`. In v5 these props now accept either:
|
|
302
|
+
|
|
303
|
+
1. **A bare value** — Vue component, URL/`data:` URI, or raw SVG string (the same shape `MazIcon`'s `icon` prop accepts). This is the existing common case.
|
|
304
|
+
2. **A full `MazIconProps` object** — `{ icon, size, title, svgAttributes, fallback, flipIconForRtl }`. Useful when you need to override the inherited size, set a `<title>` for screen readers, or pass per-icon SVG attributes.
|
|
305
|
+
|
|
306
|
+
```vue
|
|
307
|
+
<!-- v4 only accepted a bare value -->
|
|
308
|
+
<MazBtn :left-icon="MazStar" />
|
|
309
|
+
|
|
310
|
+
<!-- v5 — bare value still works -->
|
|
311
|
+
<MazBtn :start-icon="MazStar" />
|
|
312
|
+
<MazBtn start-icon="/icons/star.svg" />
|
|
313
|
+
|
|
314
|
+
<!-- v5 — full props object for fine-grained control -->
|
|
315
|
+
<MazBtn
|
|
316
|
+
size="sm"
|
|
317
|
+
:start-icon="{
|
|
318
|
+
icon: MazStar,
|
|
319
|
+
size: 'lg', // override the size derived from `size='sm'`
|
|
320
|
+
title: 'Favorite', // adds <title> for screen readers
|
|
321
|
+
flipIconForRtl: true,
|
|
322
|
+
}"
|
|
323
|
+
/>
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
Falling back to passing `undefined` (or just omitting the prop) opts the icon out, as before.
|
|
327
|
+
|
|
328
|
+
### 8. `MazChart` no longer depends on `vue-chartjs`
|
|
329
|
+
|
|
330
|
+
`MazChart` v4 wrapped `vue-chartjs`, eagerly registered every Chart.js controller / element / scale at import time, and updated the chart with the default animation mode on every reactive change. v5 talks to `chart.js` directly, lazy-loads the engine on mount, and only registers the modules required by the chart `type` you requested.
|
|
331
|
+
|
|
332
|
+
What this means for you:
|
|
333
|
+
|
|
334
|
+
- The peer dependency on `vue-chartjs` is gone. If you were importing anything from it directly, switch to `chart.js`.
|
|
335
|
+
- The `update-mode` prop now **defaults to `'none'`** (previously `'default'`). Subsequent data / options changes no longer animate by default — this is what makes large dashboards stop freezing on prop updates. The initial render still animates per the chart's `options`. Pass `update-mode="default"` to restore the v4 behavior.
|
|
336
|
+
- The re-exported types (`MazChartData`, `MazChartType`, `MazChartUpdateMode`, `MazChartPlugin`, `MazChartDefaultDataPoint`) are unchanged — they now come from `chart.js` instead of `vue-chartjs` but are otherwise the same. The `ChartProps` link in the v4 docs (which pointed to `vue-chartjs/src/types.ts`) is replaced by the `MazChartProps` interface documented on the [MazChart page](../components/maz-chart.md).
|
|
337
|
+
|
|
338
|
+
```vue
|
|
339
|
+
<!-- v4 — animated update on every data change -->
|
|
340
|
+
<MazChart :type :data :options />
|
|
341
|
+
|
|
342
|
+
<!-- v5 — same call, but data updates skip animations by default -->
|
|
343
|
+
<MazChart :type :data :options />
|
|
344
|
+
|
|
345
|
+
<!-- v5 — restore v4 animated updates -->
|
|
346
|
+
<MazChart :type :data :options update-mode="default" />
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
If you weren't using `vue-chartjs` directly and were happy with the default animation behavior on every update, you can ignore this — only add `update-mode="default"` where the animation matters.
|
|
350
|
+
|
|
351
|
+
### 9. `MazBadge` `size` prop now uses `MazSize`
|
|
352
|
+
|
|
353
|
+
`MazBadge`'s `size` prop used to accept any CSS length string (e.g. `"0.8rem"`, `"1.2em"`). It now follows the same `MazSize` contract as the rest of the library (`MazBtn`, `MazInput`, …): one of `'mini' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'`. The default is `'md'`.
|
|
354
|
+
|
|
355
|
+
Padding, line-height and dimensions still scale relative to the chosen font-size via `em` units, so a single keyword controls the whole footprint.
|
|
356
|
+
|
|
357
|
+
```vue
|
|
358
|
+
<!-- v4 -->
|
|
359
|
+
<MazBadge size="0.8rem" />
|
|
360
|
+
<MazBadge size="1.2em" />
|
|
361
|
+
|
|
362
|
+
<!-- v5 -->
|
|
363
|
+
<MazBadge size="sm" />
|
|
364
|
+
<MazBadge size="md" />
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Approximate mapping if you want to preserve your previous footprint:
|
|
368
|
+
|
|
369
|
+
| v4 (font-size) | v5 |
|
|
370
|
+
| --- | --- |
|
|
371
|
+
| ≤ 0.65rem (~10px) | `'mini'` |
|
|
372
|
+
| 0.7rem (~11px) | `'xs'` |
|
|
373
|
+
| 0.75–0.8rem (12px) | `'sm'` |
|
|
374
|
+
| 0.85–0.9rem (~14px) | `'md'` (default) |
|
|
375
|
+
| 1rem (16px) | `'lg'` |
|
|
376
|
+
| ≥ 1.125rem (18px) | `'xl'` |
|
|
377
|
+
|
|
378
|
+
```bash
|
|
379
|
+
# Find badges still using a numeric size
|
|
380
|
+
rg "MazBadge[^/]*size=\"[0-9]" src/
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
If you really need a custom size, wrap or override via your own class — pass `size="md"` (or omit it) and apply a Tailwind text utility:
|
|
384
|
+
|
|
385
|
+
```vue
|
|
386
|
+
<MazBadge size="md" class="maz:text-[0.7rem]" />
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### 10. Theme preset rename — `background` → `surface`, `border` → `divider`
|
|
390
|
+
|
|
391
|
+
Preset keys now use the same names that components and Tailwind utilities have used all along. There is no compatibility alias — rename the keys in your custom preset.
|
|
392
|
+
|
|
393
|
+
```ts
|
|
394
|
+
// v4
|
|
395
|
+
{
|
|
396
|
+
colors: {
|
|
397
|
+
light: { background: '0 0% 100%', border: '220 13% 91%', /* ... */ },
|
|
398
|
+
dark: { background: '235 16% 15%', border: '238 17% 25%', /* ... */ },
|
|
399
|
+
},
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// v5
|
|
403
|
+
{
|
|
404
|
+
colors: {
|
|
405
|
+
light: { surface: '0 0% 100%', divider: '220 13% 91%', /* ... */ },
|
|
406
|
+
dark: { surface: '235 16% 15%', divider: '238 17% 25%', /* ... */ },
|
|
407
|
+
},
|
|
408
|
+
}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
The runtime CSS variables follow:
|
|
412
|
+
|
|
413
|
+
| v4 | v5 |
|
|
414
|
+
| --- | --- |
|
|
415
|
+
| `--maz-background[-N]` | `--maz-surface[-N]` |
|
|
416
|
+
| `--maz-border[-N]` | `--maz-divider[-N]` |
|
|
417
|
+
|
|
418
|
+
Tailwind utilities `maz:bg-surface`, `maz:text-surface-700`, `maz:border-divider` are stable — they pointed at these renamed vars even in v4 and continue to work.
|
|
419
|
+
|
|
420
|
+
```bash
|
|
421
|
+
# Find leftovers
|
|
422
|
+
rg "(--maz-background|--maz-border\b|colors\.(light|dark)\.(background|border))" src/
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
### 11. Theme preset: `foundation.radius` → `scales.rounded.md`
|
|
426
|
+
|
|
427
|
+
The single foundation radius is replaced by a full radius scale. Move your value to `scales.rounded.md` and pick the rest of the scale (or spread the bundled defaults).
|
|
428
|
+
|
|
429
|
+
```ts
|
|
430
|
+
// v4
|
|
431
|
+
{
|
|
432
|
+
foundation: {
|
|
433
|
+
'base-font-size': '14px',
|
|
434
|
+
'border-width': '1px',
|
|
435
|
+
'radius': '0.7rem',
|
|
436
|
+
},
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// v5
|
|
440
|
+
{
|
|
441
|
+
foundation: {
|
|
442
|
+
'base-font-size': '14px',
|
|
443
|
+
'border-width': '1px',
|
|
444
|
+
'space': '0.25rem',
|
|
445
|
+
},
|
|
446
|
+
scales: {
|
|
447
|
+
rounded: {
|
|
448
|
+
'xs': '0.125rem',
|
|
449
|
+
'sm': '0.25rem',
|
|
450
|
+
'md': '0.7rem',
|
|
451
|
+
'lg': '1rem',
|
|
452
|
+
'xl': '1.5rem',
|
|
453
|
+
'2xl': '2rem',
|
|
454
|
+
'3xl': '3rem',
|
|
455
|
+
},
|
|
456
|
+
shadow: { /* ... */ },
|
|
457
|
+
},
|
|
458
|
+
}
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
The bridge maps every `--maz-rounded-{key}` to its matching Tailwind `--radius-{key}`, so `maz:rounded-md`, `maz:rounded-lg`, etc. all move with your preset.
|
|
462
|
+
|
|
463
|
+
### 12. New optional preset blocks: `scales` and `components`
|
|
464
|
+
|
|
465
|
+
`@maz-ui/themes` now lets you drive the rounded / shadow scales (and `space` via `foundation`) plus a small set of per-component tokens:
|
|
466
|
+
|
|
467
|
+
```ts
|
|
468
|
+
{
|
|
469
|
+
foundation: {
|
|
470
|
+
space: '0.25rem',
|
|
471
|
+
},
|
|
472
|
+
scales: {
|
|
473
|
+
rounded: { /* xs..3xl */ },
|
|
474
|
+
shadow: { sm, md, lg, xl, elevation },
|
|
475
|
+
},
|
|
476
|
+
components: {
|
|
477
|
+
btn: { 'font-weight': '500' },
|
|
478
|
+
container: { bg: { light: 'var(--maz-surface)', dark: 'var(--maz-surface)' } },
|
|
479
|
+
input: { bg: { light: 'var(--maz-surface)', dark: 'var(--maz-surface-400)' } },
|
|
480
|
+
},
|
|
481
|
+
}
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
Both blocks are optional; the bundled presets ship with sensible defaults. New `foundation` keys also landed and are all optional: `font-mono`, `font-display`, `disabled-opacity`, `disabled-cursor`. See the [themes guide](./themes.md) for the full surface.
|
|
485
|
+
|
|
486
|
+
### 13. Theme strategy: `'hybrid'` removed, no more critical CSS
|
|
487
|
+
|
|
488
|
+
The `@maz-ui/themes` rendering pipeline collapsed back to a single path: the full CSS is generated and injected synchronously on first paint. The two-stage critical-CSS / async-full-CSS dance is gone.
|
|
489
|
+
|
|
490
|
+
What changed:
|
|
491
|
+
|
|
492
|
+
- `Strategy` is now `'runtime' | 'buildtime'` — `'hybrid'` no longer exists. The runtime default is `'runtime'`.
|
|
493
|
+
- `MazUiTheme` plugin options no longer accept `injectCriticalCSS` / `injectFullCSS`.
|
|
494
|
+
- `@maz-ui/nuxt`'s `theme` config no longer accepts `injectAllCSSOnServer`.
|
|
495
|
+
- `generateCSS` / `buildThemeCSS` / `buildSeparateThemeFiles` no longer accept `onlyCritical`, `criticalColors`, `criticalFoundation`, or `includeColorScales`. `buildSeparateThemeFiles` now returns `{ full, lightOnly, darkOnly }` only — no more `critical`.
|
|
496
|
+
|
|
497
|
+
What you need to do:
|
|
498
|
+
|
|
499
|
+
```diff
|
|
500
|
+
app.use(MazUiTheme, {
|
|
501
|
+
preset: mazUi,
|
|
502
|
+
- strategy: 'hybrid',
|
|
503
|
+
+ strategy: 'runtime',
|
|
504
|
+
- injectCriticalCSS: true,
|
|
505
|
+
- injectFullCSS: true,
|
|
506
|
+
})
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
```diff
|
|
510
|
+
export default defineNuxtConfig({
|
|
511
|
+
mazUi: {
|
|
512
|
+
theme: {
|
|
513
|
+
- strategy: 'hybrid',
|
|
514
|
+
+ strategy: 'runtime',
|
|
515
|
+
- injectAllCSSOnServer: true,
|
|
516
|
+
},
|
|
517
|
+
},
|
|
518
|
+
})
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
To keep first-paint clean, **pass the preset object** (not just a string name) so the full CSS is rendered before the first frame.
|
|
522
|
+
|
|
523
|
+
### 14. Nuxt module: `mazUi.css.injectMainCss` → `mazUi.css.injectCss`
|
|
524
|
+
|
|
525
|
+
The Nuxt module config key that toggles the global maz-ui stylesheet has been renamed. The old name is **silently ignored** — your app would build but ship without the maz-ui CSS — so update it.
|
|
526
|
+
|
|
527
|
+
```diff
|
|
528
|
+
export default defineNuxtConfig({
|
|
529
|
+
mazUi: {
|
|
530
|
+
css: {
|
|
531
|
+
- injectMainCss: true,
|
|
532
|
+
+ injectCss: true,
|
|
533
|
+
},
|
|
534
|
+
},
|
|
535
|
+
})
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
### 15. `color="background"` → `color="surface"` on components
|
|
539
|
+
|
|
540
|
+
The components that exposed `color="background"` in their public prop now use `color="surface"`. The visual result is identical — only the literal changes.
|
|
541
|
+
|
|
542
|
+
| Component | v4 | v5 |
|
|
543
|
+
| --- | --- | --- |
|
|
544
|
+
| `MazBtn` | `color="background"` | `color="surface"` |
|
|
545
|
+
| `MazBadge` | `color="background"` | `color="surface"` |
|
|
546
|
+
| `MazLink` | `color="background"` | `color="surface"` |
|
|
547
|
+
| `MazPopover` | `color="background"` (default) | `color="surface"` (default) |
|
|
548
|
+
| `MazPagination` | `active-color="background"` (default) | `active-color="surface"` (default) |
|
|
549
|
+
| `MazRadioButtons` | `color="background"` | `color="surface"` |
|
|
550
|
+
|
|
551
|
+
```bash
|
|
552
|
+
# Find prop usages to update
|
|
553
|
+
rg "color\s*=\s*['\"]background['\"]" src/
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
## Informational changes (probably no action needed)
|
|
557
|
+
|
|
558
|
+
### Theme colors are now emitted as OKLCh
|
|
559
|
+
|
|
560
|
+
`@maz-ui/themes` now ships its bundled presets (`mazUi`, `ocean`, `pristine`, `obsidian`) in `oklch()` form, and the dynamic color scale generator (`generateColorScale`, `adjustColorLightness`, `getContrastColor`) steps in OKLCh space and emits `oklch(L C H)` strings. The runtime CSS variables (`--maz-primary`, `--maz-primary-100`, …) therefore hold OKLCh colors.
|
|
561
|
+
|
|
562
|
+
This is **transparent for consumers**:
|
|
563
|
+
|
|
564
|
+
- Components keep working unchanged.
|
|
565
|
+
- Custom CSS using `var(--maz-<color>)` keeps working — `oklch()` is a regular CSS color.
|
|
566
|
+
- `color-mix(in srgb, var(--maz-primary) 50%, transparent)` still works; `color-mix(in oklab, …)` will give you slightly better blending if you care.
|
|
567
|
+
- Custom presets written in `hsl()`, `rgb()`, `#hex` or the legacy `'210 100% 56%'` form still parse — they get converted to OKLCh on the fly.
|
|
568
|
+
|
|
569
|
+
You only need to do something if you were:
|
|
570
|
+
|
|
571
|
+
- **Reading the channel format** of a color from `--maz-*` in JS — the value used to be an `hsl(...)` string, it's now an `oklch(...)` string. Use `getComputedStyle(...).getPropertyValue(...)` and a CSS color parser if you need channels.
|
|
572
|
+
- **Calling `adjustColorLightness`** directly — the `adjustment` parameter is now in OKLCh L units (`0..1`) instead of HSL L percentage (`0..100`). Divide your existing values by 100.
|
|
573
|
+
|
|
574
|
+
```ts
|
|
575
|
+
// v4: HSL L percentage
|
|
576
|
+
adjustColorLightness('hsl(210 50% 40%)', 20) // → 'hsl(210 50% 60%)'
|
|
577
|
+
|
|
578
|
+
// v5: OKLCh L (0..1)
|
|
579
|
+
adjustColorLightness('hsl(210 50% 40%)', 0.2) // → 'oklch(0.65 0.108 232.62)'
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
Why the switch: OKLCh is perceptually uniform, so generated scales (`primary-50` → `primary-950`) ramp consistently across hues — yellow-700 won't look muddy compared to blue-700 anymore. It also unlocks Display P3 colors when you author a vivid preset.
|
|
583
|
+
|
|
584
|
+
### Preset type: `HSL` → `CSSColor`
|
|
585
|
+
|
|
586
|
+
If you authored a custom preset via `@maz-ui/themes`, the color field type is now the looser `CSSColor = string` instead of the template literal `HSL`.
|
|
587
|
+
|
|
588
|
+
- Your existing raw values (`'210 100% 56%'`) keep working — they are auto-wrapped in `hsl(...)` at runtime by `normalizeColor`.
|
|
589
|
+
- You can now use any CSS color form: `'hsl(210 100% 56%)'`, `'#22c55e'`, `'oklch(0.7 0.15 30)'`, `'rgb(22 194 211)'`.
|
|
590
|
+
- Type checking on custom colors is now permissive. If you want strict validation, keep using the raw HSL form or validate at your boundary.
|
|
591
|
+
|
|
592
|
+
No action required for existing presets.
|
|
593
|
+
|
|
594
|
+
### Default border color
|
|
595
|
+
|
|
596
|
+
Tailwind v4 changed the default `border` color from the configured gray to `currentColor`. **Inside maz-ui components** we restore the v3 behavior so shadows, dividers and outlines keep their neutral tint; your own styles are unaffected (you get the Tailwind v4 default). If you also want the v3 default in your own code, see the [official Tailwind upgrade guide](https://tailwindcss.com/docs/upgrade-guide#default-border-color).
|
|
597
|
+
|
|
598
|
+
### Visual parity
|
|
599
|
+
|
|
600
|
+
Most visual regressions were caught during the migration, but keep an eye on:
|
|
601
|
+
|
|
602
|
+
- Shadows, radius and blur scales — Tailwind v4 shifted a few names (`shadow` → `shadow-sm`, `blur` → `blur-sm`, etc.). Maz-ui components have been updated internally; your own code is affected only if you used these classes directly.
|
|
603
|
+
- `outline-none` → `outline-hidden` (same story).
|
|
604
|
+
|
|
605
|
+
### `nova` preset added, bundled palettes refreshed
|
|
606
|
+
|
|
607
|
+
Four bundled presets remain (`mazUi`, `pristine`, `ocean`, `obsidian`) plus a new `nova` startup / AI / creative preset (electric violet primary, cyan accent, hot coral secondary, Geist font stack). Each existing preset's palette has been retuned so the `secondary` / `accent` voices actually pop in `MazCardSpotlight`, secondary `MazBtn` variants and badges:
|
|
608
|
+
|
|
609
|
+
| Preset | Identity |
|
|
610
|
+
| --- | --- |
|
|
611
|
+
| `pristine` | Sober Apple — near-black primary, system blue accent, system purple secondary, SF system font, Apple spring easing. |
|
|
612
|
+
| `ocean` | Calm water — teal primary, deep navy secondary, sandy ochre accent. |
|
|
613
|
+
| `obsidian` | Dark luxe — indigo primary, gold accent, fuchsia secondary, snappy expo easing. |
|
|
614
|
+
| `nova` | Modern AI — electric violet primary, cyan accent, hot coral secondary. |
|
|
615
|
+
|
|
616
|
+
Switching to one of the bundled presets does not require any code change beyond the preset name. If you depended on the previous (washed-out gray) `secondary` color in a custom theme, override it back via `colors.{light,dark}.secondary` in your preset.
|
|
617
|
+
|
|
618
|
+
### Preset name persistence (new — opt-out, no breaking change)
|
|
619
|
+
|
|
620
|
+
`@maz-ui/themes` now persists the active preset name in a `maz-preset` cookie (1-year TTL, `SameSite=Lax`) — same shape as the existing `maz-color-mode` cookie:
|
|
621
|
+
|
|
622
|
+
- The cookie is read at boot and **takes priority over `options.preset`** — even when `options.preset` is a preset object. `options.preset` (string or object) is the default the app boots with; the cookie carries the user's last explicit choice and wins.
|
|
623
|
+
- It is written after every successful preset resolution and after every `useTheme().updateTheme()` call.
|
|
624
|
+
- If the saved name no longer resolves, the cookie is cleared and the runtime falls back to `options.preset` (or default).
|
|
625
|
+
|
|
626
|
+
Persistence is enabled by default. To opt out (privacy, no end-user switching, …), set `persistPreset: false`:
|
|
627
|
+
|
|
628
|
+
```ts
|
|
629
|
+
app.use(MazUiTheme, {
|
|
630
|
+
preset: mazUi,
|
|
631
|
+
persistPreset: false,
|
|
632
|
+
})
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
The same option is exposed in the Nuxt module config under `mazUi.theme.persistPreset`.
|
|
636
|
+
|
|
637
|
+
## Troubleshooting
|
|
638
|
+
|
|
639
|
+
**Colors look wrong in devtools — I see `hsl(hsl(...))` somewhere.**
|
|
640
|
+
You still have `hsl(var(--maz-<color>))` in your CSS. See the required change above.
|
|
641
|
+
|
|
642
|
+
**A maz-ui component's border is a weird color.**
|
|
643
|
+
Expected if you were overriding `--maz-divider` (renamed from `--maz-border` in v5) with a non-color value. Confirm it's a valid CSS color.
|
|
644
|
+
|
|
645
|
+
**My custom preset's colors are ignored.**
|
|
646
|
+
Check the preset's type — if you imported `HSL` explicitly, switch to `CSSColor` (or just remove the type annotation). Raw HSL strings still work at runtime.
|
|
647
|
+
|
|
648
|
+
## Advanced: you had your own Tailwind setup
|
|
649
|
+
|
|
650
|
+
If you were already running Tailwind v3 in your app, shipping classes like `maz-flex` yourself, you need the same migration as any Tailwind v3 → v4 upgrade:
|
|
651
|
+
|
|
652
|
+
1. Run the official Tailwind upgrade tool: `npx @tailwindcss/upgrade` — it handles 95% of the work (utility renames, `@apply !important` syntax, `tailwind.config` → CSS-first, …).
|
|
653
|
+
2. Replace any `hsl(var(--maz-<color>))` in your own CSS (see above).
|
|
654
|
+
3. Read the [Tailwind integration](./tailwind.md) page to learn how to import maz-ui's bridge and expose your theme tokens to your own Tailwind config.
|
|
655
|
+
|
|
656
|
+
This is a niche path — most consumers never wrote maz-prefixed classes in their own code.
|
|
657
|
+
|
|
658
|
+
## See also
|
|
659
|
+
|
|
660
|
+
- [Tailwind CSS integration](./tailwind.md) — optional, for consumers who have their own Tailwind setup
|
|
661
|
+
- [Theming](./themes.md) — preset authoring and runtime theme switching
|
|
662
|
+
- [Browser Support](./browser-support.md) — exact minimum versions and the features they enable
|