maz-ui 5.1.0-beta.0 → 5.1.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/dist/assets/{MazBtn.B1l5ztwQ.css → MazBtn.CQZ0x6EA.css} +1 -1
- package/dist/chunks/{MazBtn.DF6uWDj3.js → MazBtn.D-Tj7I_e.js} +2 -2
- package/dist/chunks/{MazDropzone.Dez5j0WP.js → MazDropzone.BaPph4gM.js} +1 -1
- package/dist/chunks/{MazInputTags.C8VNuiEY.js → MazInputTags.B8Qp88Pt.js} +1 -1
- package/dist/chunks/{MazMarkdownEditor.BYpR5wF5.js → MazMarkdownEditor.ENw_RcQf.js} +1 -1
- package/dist/chunks/{MazPagination.CO3G0QRM.js → MazPagination.C9xcws2r.js} +1 -1
- package/dist/chunks/{MazPickerCalendarGrid.CpcqhEfy.js → MazPickerCalendarGrid.5VBnk7xS.js} +1 -1
- package/dist/chunks/{MazTabsBar.Wqbm-4CQ.js → MazTabsBar.B9f5DxPw.js} +1 -1
- package/dist/components/MazBtn.js +1 -1
- package/dist/components/MazBtn.vue.d.ts +1 -1
- package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarGrid.js +1 -1
- package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarMonth.js +1 -1
- package/dist/components/MazDatePicker/MazPickerCalendarSwitcher.js +1 -1
- package/dist/components/MazDatePicker/MazPickerMonthSwitcher.js +1 -1
- package/dist/components/MazDatePicker/MazPickerShortcuts.js +1 -1
- package/dist/components/MazDatePicker/MazPickerTime.js +1 -1
- package/dist/components/MazDatePicker/MazPickerYearSwitcher.js +1 -1
- package/dist/components/MazDropzone.js +1 -1
- package/dist/components/MazInputTags.js +1 -1
- package/dist/components/MazMarkdownEditor.js +1 -1
- package/dist/components/MazPagination.js +1 -1
- package/dist/components/MazTabsBar.js +1 -1
- package/dist/components/index.js +6 -6
- package/docs/README.md +37 -37
- package/docs/agents/agents-md.md +4 -4
- package/docs/agents/claude-rule.md +4 -4
- package/docs/components/maz-accordion.md +2 -0
- package/docs/components/maz-btn-group.md +1 -0
- package/docs/components/maz-btn.md +3 -1
- package/docs/components/maz-card-spotlight.md +2 -2
- package/docs/components/maz-circular-progress-bar.md +2 -2
- package/docs/components/maz-drawer.md +3 -2
- package/docs/components/maz-fullscreen-loader.md +2 -2
- package/docs/components/maz-input-number.md +1 -1
- package/docs/components/maz-input-phone-number.md +1 -1
- package/docs/components/maz-input.md +1 -1
- package/docs/components/maz-loading-bar.md +2 -2
- package/docs/components/maz-pagination.md +2 -2
- package/docs/components/maz-pull-to-refresh.md +1 -1
- package/docs/components/maz-radio.md +2 -2
- package/docs/components/maz-select-country.md +2 -2
- package/docs/components/maz-sidebar-content.md +2 -2
- package/docs/components/maz-sidebar-footer.md +2 -2
- package/docs/components/maz-sidebar-group.md +2 -2
- package/docs/components/maz-sidebar-header.md +2 -2
- package/docs/components/maz-sidebar-menu-button.md +2 -2
- package/docs/components/maz-sidebar-menu-item.md +2 -2
- package/docs/components/maz-sidebar-menu-sub.md +2 -2
- package/docs/components/maz-sidebar-menu.md +2 -2
- package/docs/components/maz-sidebar-separator.md +2 -2
- package/docs/components/maz-sidebar-trigger.md +2 -2
- package/docs/components/maz-spinner.md +2 -2
- package/docs/components/maz-stepper.md +5 -0
- package/docs/components/maz-table-cell.md +2 -2
- package/docs/components/maz-table-row.md +2 -2
- package/docs/components/maz-table-title.md +2 -2
- package/docs/components/maz-table-virtualizer.md +2 -2
- package/docs/components/maz-tabs-bar.md +2 -2
- package/docs/components/maz-tabs-content-item.md +2 -2
- package/docs/components/maz-tabs-content.md +2 -2
- package/docs/components/maz-ui-provider.md +2 -2
- package/docs/composables/use-aos.md +2 -2
- package/docs/composables/use-breakpoints.md +2 -2
- package/docs/composables/use-toast.md +2 -2
- package/docs/composables/use-user-visibility.md +4 -4
- package/docs/composables/use-wait.md +2 -2
- package/docs/directives/fullscreen-img.md +4 -4
- package/docs/ecosystem/icons/icon-set.md +4 -4
- package/docs/ecosystem/icons/index.md +4 -4
- package/docs/ecosystem/mcp.md +1 -1
- package/docs/ecosystem/nuxt.md +5 -1
- package/docs/ecosystem/translations.md +2 -2
- package/docs/ecosystem/utils/country-code-to-unicode-flag.md +2 -2
- package/docs/guide/ai-agents.md +26 -5
- package/docs/guide/tailwind.md +25 -1
- package/docs/manifest.json +1 -1
- package/docs/reference/tailwind-tokens.md +1 -1
- package/docs/rules.md +5 -3
- package/package.json +2 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Translations (i18n)"
|
|
3
|
-
description: "Internationalization
|
|
3
|
+
description: "Internationalization of the maz-ui components with @maz-ui/translations: built-in locales, custom messages, lazy loading and runtime locale switching with useTranslations"
|
|
4
4
|
package: "@maz-ui/translations"
|
|
5
5
|
url: "https://maz-ui.com/ecosystem/translations"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Translations (i18n)
|
|
9
9
|
|
|
10
|
-
> Internationalization
|
|
10
|
+
> Internationalization of the maz-ui components with @maz-ui/translations: built-in locales, custom messages, lazy loading and runtime locale switching with useTranslations
|
|
11
11
|
|
|
12
12
|
- Package: `@maz-ui/translations`
|
|
13
13
|
- Import: `import { useTranslations } from '@maz-ui/translations'` or `import { fr } from '@maz-ui/translations'`
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "countryCodeToUnicodeFlag"
|
|
3
3
|
description: "Convert country code in unicode flag"
|
|
4
4
|
package: "@maz-ui/utils"
|
|
5
5
|
url: "https://maz-ui.com/ecosystem/utils/country-code-to-unicode-flag"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# countryCodeToUnicodeFlag
|
|
9
9
|
|
|
10
10
|
> Convert country code in unicode flag
|
|
11
11
|
|
package/docs/guide/ai-agents.md
CHANGED
|
@@ -81,7 +81,7 @@ export default defineNuxtConfig({
|
|
|
81
81
|
})
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
It only runs in development (never in CI, in tests or during builds), writes nothing when no agent is detected, keeps the files in sync with the installed maz-ui version and never overwrites files it does not own.
|
|
84
|
+
It only runs in development (never in CI, in tests or during builds), writes nothing when no agent is detected, keeps the files in sync with the installed maz-ui version and never overwrites files it does not own. In a monorepo, it writes at the root of the workspace, where the agents start (`agents.dir` to choose another folder).
|
|
85
85
|
|
|
86
86
|
### Without any file in the project
|
|
87
87
|
|
|
@@ -122,7 +122,7 @@ The MCP server gives agents tools that work with the needs they have, and verify
|
|
|
122
122
|
| `search_docs` | Find what maz-ui provides for a need ("confirm before delete", "phone input", "debounce search") |
|
|
123
123
|
| `get_component_api` | Exact props, values, events, slots of up to 10 components |
|
|
124
124
|
| `find_icons` | Icons by meaning ("delete", "settings", "france flag") with their imports |
|
|
125
|
-
| `get_theme_tokens` |
|
|
125
|
+
| `get_theme_tokens` | The theme of your project (preset, `@theme` tokens, variants, utilities) and every Tailwind class and CSS variable of maz-ui |
|
|
126
126
|
| `get_doc` | Any page of the docs, or only some sections |
|
|
127
127
|
| `list_docs` | The whole catalog |
|
|
128
128
|
| `get_setup_guide` | Installation in a Vue or Nuxt app, with or without Tailwind |
|
|
@@ -141,6 +141,25 @@ The maz-ui plugin bundles the MCP server, a `maz-ui` skill (rules and workflow)
|
|
|
141
141
|
|
|
142
142
|
The plugin works in every project, `init` configures one project for your whole team: use both or either.
|
|
143
143
|
|
|
144
|
+
### Review hook without the plugin
|
|
145
|
+
|
|
146
|
+
The review hook of the plugin is the `review --hook` mode of the CLI. To use it alone, add it to `.claude/settings.json` (shared with your team) or `.claude/settings.local.json` (your machine only):
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"hooks": {
|
|
151
|
+
"PostToolUse": [
|
|
152
|
+
{
|
|
153
|
+
"matcher": "Edit|Write|MultiEdit",
|
|
154
|
+
"hooks": [{ "type": "command", "command": "npx -y @maz-ui/mcp@latest review --hook", "timeout": 90 }]
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Each file Claude edits is reviewed; the errors and warnings are sent back to Claude, which fixes them.
|
|
162
|
+
|
|
144
163
|
## Code review in CI
|
|
145
164
|
|
|
146
165
|
The checks of `review_code` are also available from the command line:
|
|
@@ -173,7 +192,7 @@ The command exits with an error code when it finds errors (or more warnings than
|
|
|
173
192
|
| `root-import`, `internal-import` | error | Runtime imports from `maz-ui` (types only) or from `src`/`dist` |
|
|
174
193
|
| `nuxt-auto-import` | info | Imports that `@maz-ui/nuxt` already auto-imports |
|
|
175
194
|
|
|
176
|
-
When something is intended, ignore it with a comment on the line above (`<!-- maz-ui-review-ignore prefer-maz-component -->`, `// maz-ui-review-ignore theme-colors`), or `maz-ui-review-ignore-file` for a whole file.
|
|
195
|
+
When something is intended, ignore it with a comment on the line above (`<!-- maz-ui-review-ignore prefer-maz-component -->`, `// maz-ui-review-ignore theme-colors`), or `maz-ui-review-ignore-file` for a whole file. Give the reason after `--`: `<!-- maz-ui-review-ignore theme-colors -- frame over the video -->`.
|
|
177
196
|
|
|
178
197
|
## llms.txt
|
|
179
198
|
|
|
@@ -193,7 +212,7 @@ This project is built with **maz-ui** and its ecosystem (`@maz-ui/themes`, `@maz
|
|
|
193
212
|
|
|
194
213
|
Before creating a component, composable, helper, icon or style, check what maz-ui offers:
|
|
195
214
|
|
|
196
|
-
- **MCP server `maz-ui`** (when available): `search_docs` (describe the need: "confirm before delete", "phone input"), `get_component_api` (exact props, events, slots), `find_icons`, `get_theme_tokens` (Tailwind classes), `get_doc`, `review_code`.
|
|
215
|
+
- **MCP server `maz-ui`** (when available): `search_docs` (describe the need: "confirm before delete", "phone input"), `get_component_api` (exact props, events, slots), `find_icons`, `get_theme_tokens` (Tailwind classes of the project and of maz-ui), `get_doc`, `review_code`.
|
|
197
216
|
- **Version-matched docs** in `node_modules/maz-ui/docs/` (start with `README.md`; in a monorepo, resolve `maz-ui` from the app package). Read the relevant page before using an API.
|
|
198
217
|
|
|
199
218
|
Never guess an API: only use props, events, slots and imports that are documented.
|
|
@@ -215,7 +234,9 @@ Use `@maz-ui/utils` and maz-ui composables instead of lodash, VueUse or hand-wri
|
|
|
215
234
|
|
|
216
235
|
### Styling with Tailwind
|
|
217
236
|
|
|
218
|
-
The maz-ui theme is exposed to Tailwind (`@import 'maz-ui/tailwindcss/theme.css'`). Only use
|
|
237
|
+
The maz-ui theme is exposed to Tailwind (`@import 'maz-ui/tailwindcss/theme.css'`) and the project usually extends it. Only use theme tokens:
|
|
238
|
+
|
|
239
|
+
- **Project tokens first**: the Tailwind entry of the project (the CSS file that imports `maz-ui/tailwindcss/theme.css`) adds its own `@theme` tokens (fonts, animations, colors...), `@custom-variant` and `@utility`, and the `definePreset` file sets the brand values of the maz-ui tokens. `get_theme_tokens` lists both; without the MCP server, read these files. When a value is missing, add a token to the project `@theme` and use its class instead of an arbitrary value.
|
|
219
240
|
|
|
220
241
|
- Colors: `primary`, `secondary`, `accent`, `info`, `success`, `warning`, `destructive`, `contrast` (each with `-foreground` and `-50` to `-950`), `surface`, `foreground`, `muted`, `divider`, `overlay`, plus `bg-container` and `bg-input`. Example: `bg-surface text-foreground border-divider`, `bg-primary text-primary-foreground`, `text-muted`.
|
|
221
242
|
- Never use the default Tailwind palette (`bg-blue-500`, `text-gray-600`, `bg-white`, `text-black`) nor hard-coded colors (`#fff`, `rgb()`, `bg-[#...]`). Theme colors already adapt to dark mode: do not add `dark:` color overrides.
|
package/docs/guide/tailwind.md
CHANGED
|
@@ -273,6 +273,28 @@ Toggle the mode with `useTheme()` (`toggleDarkMode()`, `setColorMode('dark' | 'l
|
|
|
273
273
|
|
|
274
274
|
## Extending the theme
|
|
275
275
|
|
|
276
|
+
### How the layers fit together
|
|
277
|
+
|
|
278
|
+
Your theme is built from three layers, from the most global to the most specific:
|
|
279
|
+
|
|
280
|
+
1. **The preset** (`definePreset` of `@maz-ui/themes`) gives the **values**: it emits runtime CSS variables (`--maz-primary`, `--maz-font-family`, `--maz-rounded-md`, `--maz-motion-fast`...) for the light and dark modes.
|
|
281
|
+
2. **The maz-ui theme** (`maz-ui/tailwindcss/theme.css`) gives the **class names**: it maps each Tailwind token to a preset variable (`--color-primary: var(--maz-primary)`, `--font-display: var(--maz-font-display-stack)`). `bg-primary` or `font-display` therefore follow the active preset and color mode, without rebuild.
|
|
282
|
+
3. **Your Tailwind entry** gives the **project tokens**: everything you declare after the maz-ui imports (`@theme`, `@custom-variant`, `@utility`) adds classes next to the maz-ui ones.
|
|
283
|
+
|
|
284
|
+
| You want | Put it in | You get |
|
|
285
|
+
| --- | --- | --- |
|
|
286
|
+
| Brand colors, fonts, radius, shadows, motion, spacing | the preset (`colors`, `foundation`, `scales`) | the same maz-ui classes with your values, components included |
|
|
287
|
+
| Background of cards and inputs, button font weight | the preset (`components`) | `bg-container`, `bg-input`, `MazBtn` |
|
|
288
|
+
| A color outside the maz-ui roles (chart series, category) | `@theme { --color-* }` | `bg-<name>`, `text-<name>`... |
|
|
289
|
+
| An animation | `@theme { --animate-* }` + `@keyframes` | `animate-<name>` |
|
|
290
|
+
| A variant (short screens, a state) | `@custom-variant` | `<name>:` |
|
|
291
|
+
| A reusable group of declarations | `@utility` | `<name>` |
|
|
292
|
+
| The width of `padded-container` | `--maz-container-max-width` in your base layer | Container width |
|
|
293
|
+
|
|
294
|
+
**Warning: Redefining a maz-ui token**
|
|
295
|
+
|
|
296
|
+
A token you redefine in your `@theme` (`--color-primary`, `--font-sans`, `--radius-md`...) replaces the maz-ui mapping: the class keeps your literal value and **stops following the preset** (preset switch, light and dark values). Change brand values in the preset instead; redefine a token only when you need it, for example to give a literal font name to `@nuxt/fonts` (see Fonts).
|
|
297
|
+
|
|
276
298
|
### Brand colors: use a preset
|
|
277
299
|
|
|
278
300
|
Your brand colors, radius, fonts and spacing belong to a theme preset: every maz-ui component **and** every Tailwind utility (`bg-primary`, `rounded-md`, `font-sans`...) then use them, in light and dark modes.
|
|
@@ -321,7 +343,7 @@ For a color outside the maz-ui roles (a chart series, a product category), decla
|
|
|
321
343
|
|
|
322
344
|
### Fonts
|
|
323
345
|
|
|
324
|
-
The font utilities read the preset
|
|
346
|
+
The font utilities read the preset: `font-sans` uses `foundation.font-family`, `font-display` uses `font-display-stack` and `font-mono` uses `font-mono-stack`. You can also redefine them in your Tailwind entry, after the maz-ui import (keep the same stacks as the preset, the classes no longer follow it):
|
|
325
347
|
|
|
326
348
|
```css
|
|
327
349
|
@theme {
|
|
@@ -466,6 +488,8 @@ Tailwind v4 processes each SFC `<style>` block in isolation: a block that uses `
|
|
|
466
488
|
|
|
467
489
|
Every class and variable of this page is available to AI coding agents, generated from the sources of the installed version: the `get_theme_tokens` tool of the [maz-ui MCP server](../ecosystem/mcp.md), and `node_modules/maz-ui/docs/reference/tailwind-tokens.md`. See [AI agents](./ai-agents.md).
|
|
468
490
|
|
|
491
|
+
`get_theme_tokens` also reads **your** theme: the Tailwind entries of the project (CSS files with `@theme`, `@custom-variant`, `@utility` or a `tailwindcss` import) and the `definePreset` calls, in every app of a monorepo. Agents get your preset values, your tokens with their comments (`animate-rise`, `font-display`, `short:`...), the tokens that redefine a maz-ui one and the setup problems (missing maz-ui import). A comment above a token in your `@theme` is a good place to say when to use it.
|
|
492
|
+
|
|
469
493
|
## Migrating from Tailwind v3
|
|
470
494
|
|
|
471
495
|
Run the official upgrade tool first, it handles most of the v3 to v4 transition (renamed utilities, `tailwind.config.js` to CSS-first configuration):
|