@maz-ui/mcp 5.2.0-beta.0 → 5.3.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/README.md +4 -2
- package/dist/chunks/files.mjs +28 -9
- package/dist/chunks/index.mjs +6588 -6170
- package/dist/chunks/theme.mjs +885 -426
- package/dist/cli.mjs +3 -9
- package/dist/index.d.mts +34 -2
- package/dist/index.d.ts +34 -2
- package/dist/index.mjs +5 -8
- package/dist/shared/{mcp.Ccxm-Aoc.mjs → mcp.ByQS-5Nc.mjs} +94 -31
- package/dist/shared/{mcp.D3_Fk0U3.mjs → mcp.CXId5vdl.mjs} +444 -3179
- package/docs/agents/claude-rule.md +13 -46
- package/docs/components/maz-alert.md +1 -1
- package/docs/components/maz-bottom-sheet.md +1 -1
- package/docs/components/maz-btn.md +3 -3
- package/docs/components/maz-card.md +1 -1
- package/docs/components/maz-container.md +2 -2
- package/docs/components/maz-dropdown.md +1 -1
- package/docs/components/maz-dropzone.md +1 -1
- package/docs/components/maz-icon.md +2 -2
- package/docs/components/maz-input.md +2 -2
- package/docs/components/maz-link.md +2 -2
- package/docs/components/maz-select-country.md +1 -1
- package/docs/components/maz-sidebar-menu-button.md +1 -1
- package/docs/components/maz-sidebar-menu-sub.md +1 -1
- package/docs/components/maz-sidebar.md +2 -2
- package/docs/ecosystem/node/index.md +1 -1
- package/docs/ecosystem/node/setup-agents.md +38 -1
- package/docs/ecosystem/nuxt.md +3 -3
- package/docs/guide/ai-agents.md +5 -4
- package/docs/guide/migration-v5.md +2 -2
- package/docs/manifest.json +1 -1
- package/package.json +15 -15
- package/dist/chunks/prompt.mjs +0 -280
|
@@ -1,66 +1,33 @@
|
|
|
1
1
|
# maz-ui
|
|
2
2
|
|
|
3
|
-
This project is built with **maz-ui** and its ecosystem. Reuse what it provides instead of re-implementing it:
|
|
3
|
+
This project is built with **maz-ui** and its ecosystem. Reuse what it provides instead of re-implementing it: UI elements, helpers, icons and styles you need usually already exist.
|
|
4
4
|
|
|
5
5
|
### Look it up before you write it
|
|
6
6
|
|
|
7
|
-
- **MCP server `maz-ui`** (when available): `search_docs` (describe the need: "confirm before delete"), `get_component_api`, `find_icons`, `get_theme_tokens`, `get_doc
|
|
8
|
-
-
|
|
7
|
+
- **MCP server `maz-ui`** (when available): `search_docs` (describe the need: "confirm before delete"), `get_component_api`, `find_icons`, `get_theme_tokens`, `get_doc` (icons, helpers, themes, translations, plugins, forms), `review_code`.
|
|
8
|
+
- Otherwise the version-matched docs in `node_modules/maz-ui/docs/` (start with `README.md`; in a monorepo, the `maz-ui` of the app).
|
|
9
9
|
|
|
10
10
|
Never guess an API: only use documented props, events, slots and imports.
|
|
11
11
|
|
|
12
|
-
###
|
|
12
|
+
### Rules
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- Use `Maz*` components instead of native elements or hand-made widgets: `MazBtn` (not `<button>`), `MazLink`, `MazInput`, `MazSelect`, `MazCheckbox`, `MazDialog`, `MazDrawer`, `MazPopover`, `MazDropdown`, `MazTabs`, `MazTable`, `MazCard`, `MazAvatar`, `MazBadge`, `MazAlert`, `MazDatePicker`, `MazInputPhoneNumber`, `MazDropzone`, `MazPagination`...
|
|
19
|
-
- Prop values are typed: colors are `primary | secondary | accent | info | success | warning | destructive | contrast | transparent` (plus `surface` on some components), sizes `mini | xs | sm | md | lg | xl`.
|
|
20
|
-
- A button with only an icon needs an `aria-label`.
|
|
21
|
-
|
|
22
|
-
### Feedback, overlays and forms
|
|
23
|
-
|
|
24
|
-
- `useToast()` for notifications, `useDialog()` or `MazDialogConfirm` for confirmations, `useWait()` for loading states, `MazSkeleton` / `MazSpinner` while data loads.
|
|
25
|
-
- These composables need their plugin. Vue: `app.use(ToastPlugin)` from `maz-ui/plugins/toast` (`DialogPlugin`, `WaitPlugin`, `AosPlugin` likewise). Nuxt: `mazUi: { plugins: { toast: true } }`, off by default like the directives (`mazUi.directives.vTooltip`, or import the directive).
|
|
26
|
-
- Forms: `useFormValidator` / `useFormField` with your Standard Schema library (Zod, Valibot, ArkType).
|
|
27
|
-
|
|
28
|
-
### Icons
|
|
29
|
-
|
|
30
|
-
Use `@maz-ui/icons`, never inline SVG nor another icon library. Pick the format by usage:
|
|
31
|
-
|
|
32
|
-
- **Icon props** (`<MazBtn :start-icon>`, `<MazIcon :icon>`...): the raw SVG string, the lightest, `@maz-ui/icons/raw/MazTrash`.
|
|
33
|
-
- **Directly in a template**: the component, `@maz-ui/icons/static/MazTrash`, then `<MazTrash class="size-5 text-muted" />` (size and color from the text: `1em`, `currentColor`).
|
|
34
|
-
- **Not visible at first render** (`v-if`, menus, dialogs, tabs): the lazy component, `@maz-ui/icons/lazy/MazTrash`. Never for icons visible on load: each one is an extra request.
|
|
35
|
-
- `<img>` or CSS only for multicolor icons (flags, logos): `@maz-ui/icons/svg/<name>.svg`, the text color does not apply there.
|
|
36
|
-
|
|
37
|
-
### Helpers
|
|
38
|
-
|
|
39
|
-
Use `@maz-ui/utils/helpers/<name>` and the maz-ui composables instead of lodash, VueUse or hand-written code: `debounce`, `throttle`, `sleep`, `isEqual`, `formatCurrency`, `formatDate`, `formatNumber`, `formatPhoneNumber`, `capitalize`, `normalizeString`, `getCookie` / `setCookie`, `useBreakpoints`, `useWindowSize`, `useTimer`, `useIdleTimeout`, `useSwipe`, `vClickOutside`, `vTooltip`, `vLazyImg`...
|
|
40
|
-
|
|
41
|
-
### Texts and languages
|
|
42
|
-
|
|
43
|
-
The texts built in the components come from `@maz-ui/translations`: change the language with `useTranslations().setLocale('fr')` and customize the texts in its options, not in every component.
|
|
14
|
+
- `Maz*` components instead of native elements or hand-made widgets (`MazBtn` not `<button>`, `MazInput`, `MazSelect`, `MazDialog`, `MazCard`...). A button with only an icon needs an `aria-label`.
|
|
15
|
+
- Icons from `@maz-ui/icons` (`find_icons`), never inline SVG nor another icon library.
|
|
16
|
+
- `@maz-ui/utils` and the maz-ui composables instead of lodash, VueUse or hand-written helpers. `useToast()` for notifications, `useDialog()` for confirmations (they need their plugin).
|
|
17
|
+
- Theme (brand colors, dark mode) through a `@maz-ui/themes` preset and `useTheme()`, never by hand.
|
|
44
18
|
|
|
45
19
|
### Styling with Tailwind
|
|
46
20
|
|
|
47
|
-
|
|
21
|
+
Only use theme tokens (`bg-surface text-foreground border-divider`, `bg-primary text-primary-foreground`, `text-muted`...). `get_theme_tokens` lists the maz-ui tokens and the ones of the project; when a value is missing, add a token to the project `@theme`.
|
|
48
22
|
|
|
49
|
-
- **Project tokens first**: the Tailwind entry of the project adds its own `@theme` tokens, variants and utilities, and the `definePreset` file sets the brand values. `get_theme_tokens` lists both (or read these files). When a value is missing, add a token to the project `@theme` instead of an arbitrary value.
|
|
50
|
-
- Colors: `primary`, `secondary`, `accent`, `info`, `success`, `warning`, `destructive`, `contrast` (each with `-foreground` and `-50` to `-950`), `surface`, `foreground`, `muted`, `divider`, `overlay`, `bg-container`, `bg-input`. Example: `bg-surface text-foreground border-divider`.
|
|
51
23
|
- Never 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: no `dark:` color overrides.
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
- In custom CSS, use the variables: `var(--maz-primary)`, `var(--maz-rounded-md)`, `calc(var(--maz-space) * 4)`.
|
|
55
|
-
|
|
56
|
-
### Theme
|
|
57
|
-
|
|
58
|
-
Brand colors, fonts, radius and spacing come from a `@maz-ui/themes` preset (`definePreset`), not from overrides scattered in CSS. Use `useTheme()` for dark mode and presets (`toggleDarkMode`, `setColorMode`, `updateTheme`), never toggle the `dark` class or store the mode yourself.
|
|
24
|
+
- **No `maz:` prefix**: it is internal to the maz-ui library.
|
|
25
|
+
- In custom CSS, use the variables: `var(--maz-primary)`, `var(--maz-rounded-md)`.
|
|
59
26
|
|
|
60
27
|
### Imports
|
|
61
28
|
|
|
62
|
-
- Deep imports: `maz-ui/components/MazBtn`, `maz-ui/composables/useToast`,
|
|
63
|
-
- With `@maz-ui/nuxt`, components and composables are auto-imported
|
|
29
|
+
- Deep imports: `maz-ui/components/MazBtn`, `maz-ui/composables/useToast`, `@maz-ui/utils/helpers/debounce`, `@maz-ui/icons/raw/MazTrash`. The `maz-ui` root entry only exports types. Never import from `maz-ui/src` or `maz-ui/dist`.
|
|
30
|
+
- With `@maz-ui/nuxt`, components and composables are auto-imported (icons are not).
|
|
64
31
|
|
|
65
32
|
### Before you finish
|
|
66
33
|
|
|
@@ -227,7 +227,7 @@ You can use either title, content, or both.
|
|
|
227
227
|
|
|
228
228
|
- `title` (`string`): Title of the alert.
|
|
229
229
|
- `content` (`string`): Content of the alert.
|
|
230
|
-
- `icon` (`
|
|
230
|
+
- `icon` (`any`): Icon of the alert - can be a component or icon name string.
|
|
231
231
|
- `hide-icon` (`boolean`, default: `false`): Hide the icon.
|
|
232
232
|
- `color` (`MazAlertColor`, default: `"info"`): Color of the alert. Values: `'success'`, `'warning'`, `'destructive'`, `'info'`, `'primary'`, `'secondary'`, `'accent'`, `'contrast'` (non exhaustive).
|
|
233
233
|
- `icon-size` (`MazIconSize`, default: `"md"`): Size of the icon.
|
|
@@ -217,7 +217,7 @@ The bottom sheet is a modal `dialog` labelled by its `title` and described by it
|
|
|
217
217
|
|
|
218
218
|
- `model-value` (`boolean`, `v-model`): Modal's model value.
|
|
219
219
|
- `title` (`string`): Title of the bottom sheet in the header.
|
|
220
|
-
- `icon` (`
|
|
220
|
+
- `icon` (`any`): Icon displayed on the left of the header. Accepts an icon value or a full `MazIconProps` object.
|
|
221
221
|
- `max-width` (`` `${number}rem` | `${number}px` | `${number}em` | `${number}vw` | `${number}vh` | `${number}vmin` | `${number}vmax` | `${number}%` | `${number}ch` | `${number}cm` | `${number}mm` | `${number}in` | `${number}ex` | `${number}pc` | `${number... ``, default: `"40rem"`): Bottom sheet's max-width, applied from the tablet breakpoint and up (full-width below).
|
|
222
222
|
- `hide-close-button` (`boolean`, default: `false`): Remove the close button in the header.
|
|
223
223
|
- `hide-header` (`boolean`, default: `false`): Remove the whole header.
|
|
@@ -406,9 +406,9 @@ When `to` attribute is provided, the component automatically becomes a `<RouterL
|
|
|
406
406
|
- `loading` (`boolean`, default: `false`): Enable the button loader.
|
|
407
407
|
- `disabled` (`boolean`, default: `false`): Disable the button.
|
|
408
408
|
- `fab` (`boolean`, default: `false`): If true, the button will have a fab style.
|
|
409
|
-
- `icon` (`
|
|
410
|
-
- `start-icon` (`
|
|
411
|
-
- `end-icon` (`
|
|
409
|
+
- `icon` (`any`): The icon to display in the fab variant. Accepts a bare value (Vue component, raw SVG string, URL or `data:` URI) for the common case, or a full `MazIconProps` object for fine-grained control (size, title, svgAttributes, fallback, flipIconForRtl, …).
|
|
410
|
+
- `start-icon` (`any`): The icon to display on the inline-start edge (left in LTR, right in RTL). Accepts a bare value or a full `MazIconProps` object.
|
|
411
|
+
- `end-icon` (`any`): The icon to display on the inline-end edge (right in LTR, left in RTL). Accepts a bare value or a full `MazIconProps` object.
|
|
412
412
|
- `padding` (`boolean`, default: `true`): Apply the padding of the button, set it to `false` to remove it.
|
|
413
413
|
- `justify` (`"center" | "end" | "start" | "space-between" | "space-around" | "space-evenly"`, default: `"center"`): Choose how the elements are aligned in the button.
|
|
414
414
|
- `active` (`boolean`, default: `false`): If true, the button will have an active state.
|
|
@@ -288,7 +288,7 @@ type MazGalleryImage =
|
|
|
288
288
|
|
|
289
289
|
### Props
|
|
290
290
|
|
|
291
|
-
- `orientation` (`"row" | "column" | "
|
|
291
|
+
- `orientation` (`"row" | "column" | "row-reverse" | "column-reverse"`, default: `"column"`): Card variant: Must be `column | row | row-reverse | column-reverse`.
|
|
292
292
|
- `href` (`string`): Make card a link (footer area excluded).
|
|
293
293
|
- `to` (`string | et | X`): Make card a link with a router-link or nuxt-link (footer area excluded).
|
|
294
294
|
- `href-target` (`string`, default: `"_self"`): Target option of link: Muse be one of `_blank | _self | _parent | _top | framename`.
|
|
@@ -226,8 +226,8 @@ Use the `header` slot to fully customize the header, or use `title`, `icon-start
|
|
|
226
226
|
- `rounded-size` (`MazRoundedSize`, default: `'md'`): Size of the rounded. Values: `'none'`, `'sm'`, `'md'`, `'lg'`, `'xl'`, `'full'` (non exhaustive).
|
|
227
227
|
- `transparent` (`boolean`, default: `false`): Remove background color.
|
|
228
228
|
- `overflow-hidden` (`boolean`, default: `true`): Hide overflow.
|
|
229
|
-
- `start-icon` (`
|
|
230
|
-
- `end-icon` (`
|
|
229
|
+
- `start-icon` (`any`): Icon displayed on the inline-start edge of the header (left in LTR, right in RTL). Accepts a bare value (Vue component, raw SVG string, URL or `data:` URI) or a full `MazIconProps` object.
|
|
230
|
+
- `end-icon` (`any`): Icon displayed on the inline-end edge of the header (right in LTR, left in RTL). Accepts a bare value or a full `MazIconProps` object.
|
|
231
231
|
- `icon-size` (`MazIconSize`, default: `"md"`): Size of the icon.
|
|
232
232
|
- `block` (`boolean`, default: `false`): Display the container in full width.
|
|
233
233
|
- `content-class` (`string`): Additional class to add to the content wrapper.
|
|
@@ -376,7 +376,7 @@ The trigger button exposes the menu state (`aria-haspopup="menu"`, `aria-expande
|
|
|
376
376
|
- `menu-panel-class` (`ClassValue`): Additional CSS classes to apply to the dropdown menu panel Useful for customizing the dropdown appearance (background, border, etc.).
|
|
377
377
|
- `menu-panel-style` (`StyleValue`): Inline styles to apply to the dropdown menu panel Useful for custom styling. You may use `!important` to override default styles.
|
|
378
378
|
- `block` (`boolean`, default: `false`): Makes the dropdown button expand to full width of its container.
|
|
379
|
-
- `dropdown-icon` (`
|
|
379
|
+
- `dropdown-icon` (`any`): Icon to use instead of the default chevron for the dropdown indicator Custom icon to display in place of the default chevron. Accepts a bare value (Vue component, raw SVG string, URL or `data:` URI) or a full `MazIconProps` object.
|
|
380
380
|
- `dropdown-icon-animation` (`boolean`, default: `true`): Controls whether the dropdown icon rotates when the dropdown is opened.
|
|
381
381
|
- `size` (`"xs" | "sm" | "md" | "lg" | "xl" | "mini"`, default: `'md'`): Size of the dropdown button.
|
|
382
382
|
- `transition` (`string`, default: `"scale-pop"`): Transition to use when the dropdown is opened or closed. Values: `'scale-pop'`, `'scale-fade'`, `'string'` (non exhaustive).
|
|
@@ -355,8 +355,8 @@ Customize the upload request using `uploadUrl`, `requestOptions` and `transformB
|
|
|
355
355
|
|
|
356
356
|
### Events
|
|
357
357
|
|
|
358
|
-
- `@add` (payload: `value: File`): Event emitted when a file is added to the dropzone
|
|
359
358
|
- `@error` (payload: `values: { files: File[] | null; event: DragEvent | null; code: MazDropzoneErrorCode; }`): Event emitted when an error occurs
|
|
359
|
+
- `@add` (payload: `value: File`): Event emitted when a file is added to the dropzone
|
|
360
360
|
- `@drop` (payload: `values: { files: File[] | null; event: DragEvent; }`): Event emitted when files are dropped in the dropzone
|
|
361
361
|
- `@update:modelValue` (payload: `value: MazDropzoneFileData[]`)
|
|
362
362
|
- `@enter` (payload: `values: { files: File[] | null; event: DragEvent; }`): Event emitted when dragged files enter the dropzone
|
|
@@ -191,8 +191,8 @@ Source: [Heroicons](https://heroicons.com/) - see also the [icon set page](../ec
|
|
|
191
191
|
|
|
192
192
|
### Props
|
|
193
193
|
|
|
194
|
-
- `icon` (`
|
|
195
|
-
- `fallback` (`
|
|
194
|
+
- `icon` (`any`): The icon to render. Accepts: - A Vue component (e.g. `import { MazStar } from '@maz-ui/icons/static/MazStar'`) - A URL or `data:` URI to a `.svg` file (`'/icons/star.svg'`, `'data:image/svg+xml,…'`) - A raw SVG string (`'<svg viewBox="0 0 24 24">…</svg>'`) The component detects the format and renders accordingly.
|
|
195
|
+
- `fallback` (`any`, default: `MazQuestionMarkCircle`): Fallback icon used when: - `icon` is not provided - `icon` is a URL that fails to load or returns invalid SVG Same shape as `icon`. Defaults to the imported `MazQuestionMarkCircle` if neither `icon` nor `fallback` resolves to anything renderable.
|
|
196
196
|
- `size` (`MazIconSize`): Predefined keyword (`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) or any CSS length.
|
|
197
197
|
- `title` (`string`): Sets a `<title>` element inside the SVG for screen-reader accessibility.
|
|
198
198
|
- `svg-attributes` (`Record<string, string | number>`): Extra attributes to merge onto the rendered `<svg>` root.
|
|
@@ -310,8 +310,8 @@ Use the attribute `rounded-size` with a value in `'none' | 'sm' | 'md' | 'lg' |
|
|
|
310
310
|
- `debounce` (`number | boolean`, default: `false`): Enables input debouncing to limit the frequency of value updates. When true, uses 500ms delay. When a number, uses that value as delay in milliseconds.
|
|
311
311
|
- `auto-focus` (`boolean`, default: `false`): Automatically focuses the input when the component mounts.
|
|
312
312
|
- `border-active` (`boolean`, default: `false`): When true, shows the colored border immediately instead of only on focus.
|
|
313
|
-
- `start-icon` (`
|
|
314
|
-
- `end-icon` (`
|
|
313
|
+
- `start-icon` (`any`): Icon displayed on the inline-start edge of the input (left in LTR, right in RTL). Accepts a bare value (Vue component, raw SVG string, URL or `data:` URI) or a full `MazIconProps` object for fine-grained control (size, title, svgAttributes, fallback, …).
|
|
314
|
+
- `end-icon` (`any`): Icon displayed on the inline-end edge of the input (right in LTR, left in RTL). Accepts a bare value or a full `MazIconProps` object.
|
|
315
315
|
- `rounded-size` (`MazRoundedSize`, default: `'md'`): Controls the border radius of the input component. Values: `'none'`, `'sm'`, `'md'`, `'lg'`, `'xl'`, `'full'` (non exhaustive).
|
|
316
316
|
- `block` (`boolean`): Makes the input expand to the full width of its container.
|
|
317
317
|
- `name` (`string`): The name of the input field. Used for form submission and validation.
|
|
@@ -134,8 +134,8 @@ If no `to` or `href` is provided, the component will be a `button` by default. Y
|
|
|
134
134
|
- `underline` (`boolean`, default: `false`): Add an underline to the link.
|
|
135
135
|
- `underline-hover` (`boolean`, default: `true`): Add an underline only on hover.
|
|
136
136
|
- `auto-external` (`boolean`, default: `true`): Add an external icon to the link if target is '_blank'.
|
|
137
|
-
- `start-icon` (`
|
|
138
|
-
- `end-icon` (`
|
|
137
|
+
- `start-icon` (`any`): Icon displayed on the inline-start edge (left in LTR, right in RTL). Accepts a bare value (Vue component, raw SVG string, URL or `data:` URI) or a full `MazIconProps` object for fine-grained control.
|
|
138
|
+
- `end-icon` (`any`): Icon displayed on the inline-end edge (right in LTR, left in RTL). Accepts a bare value or a full `MazIconProps` object.
|
|
139
139
|
- `disabled` (`boolean`, default: `false`): The disabled state of the link if the component is a button.
|
|
140
140
|
|
|
141
141
|
### Slots
|
|
@@ -475,7 +475,7 @@ This ensures consistent internationalization across your application while provi
|
|
|
475
475
|
- `translations` (`Partial<{ searchPlaceholder: string; }>`, default: `MazUiTranslationsNestedSchema['selectCountry']`): Translations.
|
|
476
476
|
- `hint` (`string`): Hint message displayed.
|
|
477
477
|
- `options` (`Option[]`): Options.
|
|
478
|
-
- `display-names-options` (`DisplayNamesOptions`, default: `{ type: "region", languageDisplay: "standard", fallback: "code", style: "long" }`): Display name type.
|
|
478
|
+
- `display-names-options` (`DisplayNamesOptions`, default: `{ type: "region", languageDisplay: "standard", fallback: "code", style: "long", }`): Display name type.
|
|
479
479
|
- `codes-type` (`CodesType`, default: `defined by displayNamesOptions.type (if 'region', 'country' is used, otherwise 'iso')`): Codes type. Values: `'iso'`, `'bcp'`, `'country'`, `'all'` (non exhaustive).
|
|
480
480
|
- `open` (`boolean`, default: `false`): Open the select.
|
|
481
481
|
- `model-value` (`Option["code"]`, `v-model`): The value of the select.
|
|
@@ -22,7 +22,7 @@ Used inside [MazSidebar](./maz-sidebar.md): read its page for complete examples.
|
|
|
22
22
|
|
|
23
23
|
- `to` (`string | Record<string, unknown>`): Route for router-link navigation.
|
|
24
24
|
- `href` (`string`): URL for anchor navigation.
|
|
25
|
-
- `icon` (`
|
|
25
|
+
- `icon` (`any`): Icon to display before the label. Accepts a bare icon value (Vue component, raw SVG string, URL) or a full `MazIconProps` object for fine-grained control (size, title, fallback, …).
|
|
26
26
|
- `label` (`string`): Label text.
|
|
27
27
|
- `badge` (`MazSidebarMenuButtonBadge`): Badge content. Pass a `string`/`number` for a simple primary badge, or a full `MazBadgeProps` object (with optional `text`) to customise color, size, outlined, ….
|
|
28
28
|
- `tooltip` (`string`): Tooltip text. When provided, shows a tooltip on hover via the `v-tooltip` directive.
|
|
@@ -21,7 +21,7 @@ Used inside [MazSidebar](./maz-sidebar.md): read its page for complete examples.
|
|
|
21
21
|
### Props
|
|
22
22
|
|
|
23
23
|
- `label` (`string`): Label for the sub-menu trigger button.
|
|
24
|
-
- `icon` (`
|
|
24
|
+
- `icon` (`any`): Icon to display before the label. Accepts a bare icon value (Vue component, raw SVG string, URL) or a full `MazIconProps` object for fine-grained control.
|
|
25
25
|
- `default-open` (`boolean`, default: `false`): Whether the sub-menu is open by default.
|
|
26
26
|
|
|
27
27
|
### Slots
|
|
@@ -455,7 +455,7 @@ Customize the sidebar width using these CSS custom properties (also settable via
|
|
|
455
455
|
|
|
456
456
|
- `to` (`string | Record<string, unknown>`): Route for router-link navigation.
|
|
457
457
|
- `href` (`string`): URL for anchor navigation.
|
|
458
|
-
- `icon` (`
|
|
458
|
+
- `icon` (`any`): Icon to display before the label. Accepts a bare icon value (Vue component, raw SVG string, URL) or a full `MazIconProps` object for fine-grained control (size, title, fallback, …).
|
|
459
459
|
- `label` (`string`): Label text.
|
|
460
460
|
- `badge` (`MazSidebarMenuButtonBadge`): Badge content. Pass a `string`/`number` for a simple primary badge, or a full `MazBadgeProps` object (with optional `text`) to customise color, size, outlined, ….
|
|
461
461
|
- `tooltip` (`string`): Tooltip text. When provided, shows a tooltip on hover via the `v-tooltip` directive.
|
|
@@ -482,7 +482,7 @@ Customize the sidebar width using these CSS custom properties (also settable via
|
|
|
482
482
|
### Props
|
|
483
483
|
|
|
484
484
|
- `label` (`string`): Label for the sub-menu trigger button.
|
|
485
|
-
- `icon` (`
|
|
485
|
+
- `icon` (`any`): Icon to display before the label. Accepts a bare icon value (Vue component, raw SVG string, URL) or a full `MazIconProps` object for fine-grained control.
|
|
486
486
|
- `default-open` (`boolean`, default: `false`): Whether the sub-menu is open by default.
|
|
487
487
|
|
|
488
488
|
### Slots
|
|
@@ -41,11 +41,12 @@ The content comes from the `docs/agents` folder of the `maz-ui` package installe
|
|
|
41
41
|
Guarantees:
|
|
42
42
|
|
|
43
43
|
- A file it did not generate is never overwritten (it is reported as `skip`).
|
|
44
|
-
- Generated rules edited by hand are kept and no longer updated (`skip`): their header records a checksum of the content. A formatter that only changes the whitespace does not count as an edit. Delete the file (or the `AGENTS.md` section) to get the rules of a new version.
|
|
44
|
+
- Generated rules edited by hand are kept and no longer updated (`skip`): their header records a checksum of the content, `paths:` frontmatter included. A formatter that only changes the whitespace does not count as an edit. Delete the file (or the `AGENTS.md` section) to get the rules of a new version.
|
|
45
45
|
- In `AGENTS.md`, only the delimited section is managed: your content stays as is.
|
|
46
46
|
- MCP config files are edited in place, keeping their formatting and comments. When a server already runs `@maz-ui/mcp` under another name, nothing is added.
|
|
47
47
|
- An existing entry of the maz-ui MCP server only gets a better command (the installed `@maz-ui/mcp`, a newer pinned version) and keeps its other fields (`env`...). A command written by hand (with `--docs`, for example) is never changed.
|
|
48
48
|
- In a monorepo, rules written by a newer maz-ui and a newer pinned `@maz-ui/mcp` are never downgraded by an app with an older version. Files are written atomically: apps started together never read a half-written file.
|
|
49
|
+
- The Claude rule is scoped with a `paths:` frontmatter, so that Claude Code only loads it when it reads or edits a file of the workspaces that depend on maz-ui (see Scope of the Claude rule), instead of at every session.
|
|
49
50
|
- Without `CLAUDE.md` in the project, Claude Code reads `AGENTS.md`: the Claude rule is then skipped to avoid loading the rules twice.
|
|
50
51
|
- Running it again is idempotent: unchanged files are reported as `unchanged`.
|
|
51
52
|
|
|
@@ -72,6 +73,8 @@ setupAgents({
|
|
|
72
73
|
mcpVersion: '5.1.0',
|
|
73
74
|
// Command of the MCP server, default: mcpServerCommand(rootDir, mcpVersion, tool)
|
|
74
75
|
mcpServer: undefined,
|
|
76
|
+
// Scope of the Claude rule: 'auto' (default), 'all' (always loaded) or globs relative to rootDir
|
|
77
|
+
paths: 'auto',
|
|
75
78
|
// Tool whose agents are configured, default: MAZ_UI_AGENTS_TOOL
|
|
76
79
|
tool: undefined,
|
|
77
80
|
// Rules of the tool, required with another tool than maz-ui, default: the agent docs of docsDir
|
|
@@ -79,6 +82,22 @@ setupAgents({
|
|
|
79
82
|
})
|
|
80
83
|
```
|
|
81
84
|
|
|
85
|
+
## Scope of the Claude rule
|
|
86
|
+
|
|
87
|
+
Without a `paths:` frontmatter, Claude Code loads a rule at every session, in every folder. `setupAgents` writes the frontmatter before the managed header (it must be the first thing of the file) and lists the globs in `result.claudeRulePaths`:
|
|
88
|
+
|
|
89
|
+
- `paths: 'auto'` (default): the workspaces of the monorepo (`pnpm-workspace.yaml`, or `workspaces` of `package.json`) whose `package.json` depends on one of the `packages` of the tool (`dependencies`, `devDependencies`, `peerDependencies`, `optionalDependencies`), with the `ruleGlobs` of the tool inside each: `apps/pwa/**/*.{vue,ts,tsx,css,scss}`. A single package project, or a project where no dependency is found, gets the `ruleGlobs` of the tool for the whole project. A tool without `packages` is never scoped.
|
|
90
|
+
- `paths: 'all'`: no frontmatter, the rule is always loaded.
|
|
91
|
+
- `paths: ['apps/web/**', 'packages/ui/**']`: your globs, used as is.
|
|
92
|
+
|
|
93
|
+
The frontmatter is rewritten at every run from the project and the options, as long as the file was not edited: the checksum of the header covers the frontmatter and the rules, so an edit of either (your own `paths:`, an added rule) is detected and the file is kept. A rule written before the frontmatter existed, or with a checksum of the rules alone, is updated.
|
|
94
|
+
|
|
95
|
+
In `'auto'` mode:
|
|
96
|
+
|
|
97
|
+
- Workspaces excluded by a negated pattern (`!apps/legacy` in `pnpm-workspace.yaml` or `workspaces`) are left out, with the folders below them.
|
|
98
|
+
- The characters `[ ] { } ( ) * ? !` of a folder name are escaped in the globs.
|
|
99
|
+
- When the globs would expand to more than 1000 patterns (the budget of Claude Code for braces), the rule falls back to the `ruleGlobs` of the tool for the whole project.
|
|
100
|
+
|
|
82
101
|
## Use it for another tool
|
|
83
102
|
|
|
84
103
|
`setupAgents` configures maz-ui by default, but any package that ships an MCP server and rules for AI agents can reuse it with the `tool` option, and get the same guarantees. Its rules are passed with `agentDocs`, since they do not come from the maz-ui docs. For example, [relizy](https://relizy.dev) runs it in `relizy mcp init`:
|
|
@@ -96,8 +115,16 @@ const tool: AgentsTool = {
|
|
|
96
115
|
mcpArgs: ['mcp'],
|
|
97
116
|
// Written in the header of the generated rules
|
|
98
117
|
generatedBy: '`relizy mcp init`',
|
|
118
|
+
// Marker written in the header of the generated content, default: `Managed by relizy` (`Managed by <name>`)
|
|
119
|
+
marker: 'Managed by relizy',
|
|
99
120
|
// Line under the title of the rules, default: `> relizy <version> is installed: these rules match this version.`
|
|
121
|
+
// Use `false` to write no note
|
|
100
122
|
versionNote: version => `> relizy ${version} is installed: these rules match this version.`,
|
|
123
|
+
// Packages (or bins) of former MCP servers: an entry that references one of them is replaced by the entry of the tool, default: none
|
|
124
|
+
legacyMcpPackages: ['relizy-legacy-mcp'],
|
|
125
|
+
// Scope of the Claude rule: the workspaces that depend on these packages, and the files of the rule inside them
|
|
126
|
+
packages: ['relizy'],
|
|
127
|
+
ruleGlobs: ['relizy.config.*', '**/CHANGELOG.md'],
|
|
101
128
|
}
|
|
102
129
|
|
|
103
130
|
setupAgents({
|
|
@@ -123,6 +150,16 @@ setupAgents({
|
|
|
123
150
|
|
|
124
151
|
Each tool only manages its own files, section and server entry: maz-ui and relizy can be set up in the same project, and removing one (`remove: true` with its `tool`) keeps the other. `mcpServerCommand`, `installsMcpPackage`, `readManagedVersion` and `isEditedManagedContent` also take the tool as last argument.
|
|
125
152
|
|
|
153
|
+
Set `marker` to keep recognizing files generated under a different marker than the name of the tool (e.g. `'Managed by @acme/mcp'` for a tool named `acme`): the header, the owned files and the version are all read from it. With `legacyMcpPackages`, an entry of the MCP config files (`.mcp.json`, `.cursor/mcp.json`, `.vscode/mcp.json`) that references a former package is replaced in place by the entry of the tool, only when the tool has no entry yet. `remove` never touches it.
|
|
154
|
+
|
|
155
|
+
## Lightweight entry
|
|
156
|
+
|
|
157
|
+
`@maz-ui/node/agents` exports `setupAgents` and its helpers without the rest of the package: it does not load `consola` nor `figlet` (logger and banner), and its types do not reference them. Use it in tools that only configure agents.
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
import { setupAgents } from '@maz-ui/node/agents'
|
|
161
|
+
```
|
|
162
|
+
|
|
126
163
|
## Command of the MCP server
|
|
127
164
|
|
|
128
165
|
```ts
|
package/docs/ecosystem/nuxt.md
CHANGED
|
@@ -16,7 +16,7 @@ url: "https://maz-ui.com/ecosystem/nuxt"
|
|
|
16
16
|
|
|
17
17
|
**Tip: Model Context Protocol (MCP)**
|
|
18
18
|
|
|
19
|
-
In development, the module
|
|
19
|
+
In development, the module can connect the AI coding agents detected in the project (Claude Code, Cursor, Copilot...) to the maz-ui [MCP server](./mcp.md), which gives them the docs and rules of the installed maz-ui (opt-in with `agents: { mcp: true }`). See AI Agents.
|
|
20
20
|
|
|
21
21
|
Check out the documentation of [@maz-ui/mcp](./mcp.md)
|
|
22
22
|
|
|
@@ -190,7 +190,7 @@ export default defineNuxtConfig({
|
|
|
190
190
|
vZoomImg: true,
|
|
191
191
|
},
|
|
192
192
|
|
|
193
|
-
// AI coding agents (default: { rules: false, mcp:
|
|
193
|
+
// AI coding agents (default: { rules: false, mcp: false }, true to enable everything)
|
|
194
194
|
agents: { rules: true, mcp: true },
|
|
195
195
|
}
|
|
196
196
|
})
|
|
@@ -440,7 +440,7 @@ Connect your AI coding agents (Claude Code, Cursor, GitHub Copilot, Codex, Winds
|
|
|
440
440
|
|
|
441
441
|
```ts
|
|
442
442
|
const agents = {
|
|
443
|
-
// Register the maz-ui MCP server in .mcp.json, .cursor/mcp.json, .vscode/mcp.json (default:
|
|
443
|
+
// Register the maz-ui MCP server in .mcp.json, .cursor/mcp.json, .vscode/mcp.json (default: false)
|
|
444
444
|
// Its instructions give the maz-ui rules to the agents
|
|
445
445
|
mcp: true,
|
|
446
446
|
// Also write the rules in .claude/rules/maz-ui.md and in AGENTS.md, for agents without MCP (default: false)
|
package/docs/guide/ai-agents.md
CHANGED
|
@@ -68,20 +68,21 @@ npx @maz-ui/mcp init --remove # remove everythi
|
|
|
68
68
|
|
|
69
69
|
Run it again after upgrading maz-ui: the rules follow the installed version.
|
|
70
70
|
|
|
71
|
-
### Nuxt:
|
|
71
|
+
### Nuxt: opt-in
|
|
72
72
|
|
|
73
|
-
With [`@maz-ui/nuxt`](../ecosystem/nuxt.md), the agents detected in the project
|
|
73
|
+
With [`@maz-ui/nuxt`](../ecosystem/nuxt.md), set `agents.mcp: true` to connect the agents detected in the project to the maz-ui MCP server when you start the dev server: the module adds the `maz-ui` entry to their MCP config (`.mcp.json`, `.cursor/mcp.json`, `.vscode/mcp.json`). The instructions of the MCP server already give the maz-ui rules to the agents. Nothing is written by default.
|
|
74
74
|
|
|
75
75
|
```ts
|
|
76
76
|
export default defineNuxtConfig({
|
|
77
77
|
modules: ['@maz-ui/nuxt'],
|
|
78
78
|
mazUi: {
|
|
79
|
-
// default: { rules: false, mcp:
|
|
79
|
+
// default: { rules: false, mcp: false }
|
|
80
80
|
agents: {
|
|
81
|
+
mcp: true, // register the maz-ui MCP server
|
|
81
82
|
rules: true, // also write .claude/rules/maz-ui.md and the AGENTS.md section
|
|
82
83
|
targets: ['claude', 'agents-md'], // default: the detected agents
|
|
83
84
|
},
|
|
84
|
-
// or
|
|
85
|
+
// or enable everything: agents: true
|
|
85
86
|
},
|
|
86
87
|
})
|
|
87
88
|
```
|
|
@@ -82,7 +82,7 @@ The MCP server is read-only - it ships docs, not code edits - so the assistant s
|
|
|
82
82
|
|
|
83
83
|
## Migration checklist
|
|
84
84
|
|
|
85
|
-
1. Bump **Node to
|
|
85
|
+
1. Bump **Node to 22.23.4+, 24.22.1+ or 26.12.1+** and confirm your audience has modern browsers (see below).
|
|
86
86
|
2. If your **custom CSS** uses `hsl(var(--maz-<color>))`, simplify to `var(--maz-<color>)`.
|
|
87
87
|
3. Rename `import 'maz-ui/styles'` to `import 'maz-ui/style.css'` (and `maz-ui/aos-styles` → `maz-ui/aos.css`).
|
|
88
88
|
4. Replace any `rounded-size="base"` with `rounded-size="md"` (or drop the prop - the new default is visually identical).
|
|
@@ -101,7 +101,7 @@ The MCP server is read-only - it ships docs, not code edits - so the assistant s
|
|
|
101
101
|
### Node
|
|
102
102
|
|
|
103
103
|
```bash
|
|
104
|
-
node -v # must be
|
|
104
|
+
node -v # must be ^22.23.4, ^24.22.1 or >=26.12.1
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
### Browser support
|