Repository navigation
v5.7.0
🚀 Features
-
utils: Add the
formatRelativeTimeandgetRelativeTimehelpers for localized relative times (3 minutes ago, in 2 days, yesterday), with a compact form (3 min), configurable unit thresholds, an optional switch to an absolute date and a delay before the text changes (3706c9942) -
maz-ui: Add the
useRelativeTimecomposable, a reactive localized relative time that refreshes at the next change, pauses while the page is hidden and never runs on the server (21eabc6d5) -
nuxt: Auto-import the
useRelativeTimecomposable (f636e114c) -
utils: Add fuzzy search and string similarity helpers (b6dc2c8ca)
fuzzySearch(items, query, options)andcreateFuzzySearch(items, options): tolerant search in a list, sorted by relevance or in the original order (sort: 'original'), on several weighted keys, ignoring accents and case, with typo tolerance (typoThreshold)highlightMatches(text, indexes)splits a result into highlighted and plain partslevenshteinDistance,getMatchingScoreandisStringMatchingin@maz-ui/utils/helpers/stringMatchingnormalizeStringremoves accents, including on letters likeø,ł,đ,æandß
-
translations: Add the color picker, autocomplete and remove keys (a85284b09)
colorPicker.*: labels of the area, hue, alpha, eyedropper and swatches ofMazColorPickerinputAutocomplete.*:noResults,loading,errorandresultsofMazInputAutocompletearia.remove: label of the remove buttons (MazBadge,MazInputTags)
-
icons: Add git, sidebar and wifi-slash icons (c1181309d)
- New icons:
MazGitBranch,MazGitPullRequest,MazSidebarLeft,MazSidebarLeftCompact,MazSidebarLeftHidden,MazSidebarRight,MazWifiSlash - Available from
@maz-ui/icons/raw/*,@maz-ui/icons/static/*,@maz-ui/icons/lazy/*and asLazyMaz*exports of the package root
- New icons:
-
themes: Add the macos, windows and linux presets, the type scale, the glass material and the system colors (1924acec0)
macos,windowsandlinuxpresets: the look of a native desktop app (system fonts, 13px or 14px root font size, platform colors, arrow cursor on controls), available from@maz-ui/themes/presetsor by name withgetPreset('macos')typographyoption: the type scale by level (display,title-1totitle-4,body,label,caption,overline,code...), emitted as--maz-typography-*variables. The bundled presets ship their own scalecomponents.glassoption: translucent material for floating surfaces (bg,border,blur,saturate)systemColorsoption: system color keywords by role (AccentColor...), applied with@supportsso the preset color stays the fallbackfoundation['interactive-cursor']token: the cursor of interactive controls (defaultpointer)- Preset colors accept color keywords (
transparent,currentColor, system colors),hwb(),color-mix()andlight-dark() resolvePreset(preset): every color of a preset per mode, as hex and oklch, withgetContrastRatioandgetColorDistance
-
vite-plugin: Add
MazUiPurgeCssto remove the unused CSS of maz-ui. New@maz-ui/vite-pluginpackage, released with the other maz-ui packages (7b32087ec)MazUiPurgeCss()removes at build time the CSS of the components, plugins, directives and utilities of maz-ui that the app does not use, based on thepurge-manifest.jsonwritten by the maz-ui build.Options:
content(files to scan),entries(modules used at runtime),safelistandreport. See https://maz-ui.com/ecosystem/vite-plugin -
maz-ui: Add type scale, rich text, glass and container query utilities (0e88ef7a5)
- Type scale:
text-display,text-title-1totext-title-4,text-body-lg,text-body,text-body-sm,text-label,text-caption,text-overline,text-code, driven by thetypographyof the preset, and thetype-*variants without the font size rich-text,rich-text-smandrich-text-lgstyle raw HTML (Markdown, CMS),not-rich-textopts a block outglassutility andbg-glass/border-glasscolors,scrollbar-themedandcursor-interactiveutilities,transparency-reduce:variant- Container query sizes named like the breakpoints (
@tab-m:,max-w-lap-s) inmaz-ui/tailwindcss/theme-containers.css padded-containerfollows the closest@containerancestor, andpadded-container-no-pno longer computes a negative padding- New exports:
maz-ui/utilities.css(utilities for projects without Tailwind CSS) andmaz-ui/purge-manifest.json(for@maz-ui/vite-plugin)
- Type scale:
-
maz-ui: Add fuzzy search to MazSelect, MazChecklist, MazTable and MazInputAutocomplete (bcd91c14e)
MazSelect,MazChecklistandMazTablesearch tolerates typos and ignores accents and case.MazSelectandMazChecklistsort results by relevance (groups of options keep their order),MazTablekeeps the order of its rows. The search engine loads with the search input only.- New
MazInputAutocomplete: suggestions fromitemsor an asyncsource(query, { signal }), debounced and cancelled when the query changes, withminChars,limitand highlighted matches.Enterpicks the active or first suggestion.v-modelholds the text,v-model:selectedthe picked item. - New
useFuzzySearch(items, query, options)composable for your own lists.useStringMatchingkeeps its API. See https://maz-ui.com/components/maz-input-autocomplete
-
maz-ui: Add
MazColorPicker,MazIndicator,MazList,MazListItem,MazProgressBarandMazSegmented(d1abc6f88)MazColorPicker: inline or in a popover, saturation area, hue and alpha sliders,hex,rgbandhslformats, swatches and eyedropperMazIndicator: dot or counter attached to a corner of its content (max,pulse,overlap,position)MazListandMazListItem: lists with title, footer and dividers, clickable or collapsible items withlazycontentMazProgressBar: progress bar or meter, with a single value or stacked coloredsegments, and an accessible value textMazSegmented: segmented control with icons, configurable in the global config
-
maz-ui: Rewrite
MazInputTagswith badges and the sizes ofMazInput(3634cfa6c)- Tags are removable
MazBadgecomponents of the field's size, and the field has the height of aMazInputof the samesize - New
top-label,assistive-text,rounded-sizeandidprops ,adds a tag likeEnter, comma-separated values add several tags, duplicates are ignored- A first
Backspacein the empty input marks the last tag, a second one removes it - No floating label anymore:
labelis the placeholder and the accessible name of the input, usetop-labelfor a visible label - DOM changes: the root wraps the label, the field (
.m-input-tags__field) and the assistive text
- Tags are removable
-
maz-ui: Add the floating variant of
MazSidebar(c276d3549)variant="floating": an inset, rounded glass panel without borders- Neutral selection, accent-colored icons and plain counts in
MazSidebarMenuButton - Collapsed to icons: hairline separators between groups and an indicator dot for badges
-
maz-ui: Add the container color, a promise to
dialog.confirmand improve components (c58eae23a)containerneutral color (MazNeutralColortype) onMazBtn,MazBtnGroup,MazBadge,MazLink,MazDropdownandMazRadioButtons.MazPopoverdefaults to it,MazPaginationusescontainerbuttons and acontrastactive pagesurfaceandcontainerstay solid withpastel, and use foreground tints on hoverdialog.confirm()returns a promise, accepts richcontentand reactive button propslazyprop onMazAccordion,MazExpandAnimationandMazListItem: content renders on first openingMazBadge:removableprop with aremoveeventMazAvatar:indicatorprop and slot,color="auto"for a stable color per captionMazTabsBar:indicatorper item, atruebadge renders a dot andfalsehides it.MazCodeHighlight:colorModeprop (autofollows the closest.darkancestor)- Titles, labels and hints use the theme's type scale,
MazMarkdownEditorpreviews withrich-text, controls use the themable cursor and scroll areas use the themed scrollbar
-
nuxt: Purge the unused CSS of maz-ui and auto-import the new components (3278e4bd7)
css.purge(defaulttrue) addsMazUiPurgeCssof@maz-ui/vite-pluginto production builds, with the enabled plugins and directives as entries. Setfalseto disable it, or pass an object for its options (safelist,entries) when components are resolved at runtime from stringscss.injectUtilities(defaultfalse) injectsmaz-ui/utilities.css- Auto-import of
MazInputAutocomplete,MazColorPicker,MazIndicator,MazList,MazListItem,MazProgressBar,MazSegmentedanduseFuzzySearch
-
mcp: Show the effective theme colors and review brand colors, type scale and raw icons (8f4074c9f)
get_theme_tokensshows the effective colors of the project preset, or of a bundled one withpreset: every color and step in light and dark, with WCAG contrasts and what to check.colorsandstepsnarrow the output- New
maz-ui-mcp colors [preset]command - New
get_theme_tokenstopics:container-queries,layout,type-scaleandrich-text - New review rules:
pale-brand-color,type-scale,arbitrary-font-size,multiple-primary-actionsandraw-icon-tag(a@maz-ui/icons/rawimport used as a tag renders nothing) theme-colorsflagsbg-backgroundand suggestssurface- More search synonyms, and the
base-font-sizehint points tonoArbitraryPx.baseFontSizeof@maz-ui/eslint-config
-
maz-ui: Add size, max height, wrap and log follow mode to
MazCodeHighlight(284768c60)size(mini,xs,sm,md,lg) sets the size of the code and its paddingmax-heightcaps the height of the block,wrapbreaks long lines,hide-languagehides the language badgefollowkeeps the block scrolled to the last line of growing code (logs, build output) and highlights only the appended lines; the exposedscrollToBottom()follows again
-
translations: Add the scroll to bottom label of
MazCodeHighlight(f6a747254) -
maz-ui: Add app-wide defaults, light and dark themes and a scroll to bottom button to
MazCodeHighlight(1d5abce9b)light-themeanddark-themechoose the shiki theme of each color mode (themestill forces one for both)- Every display prop (
size, themes,color-mode,rounded,copyable,wrap,hide-language) can be set app-wide withdefaults.MazCodeHighlightof the MazUi plugin, andsizealso followsdefaults.global.size - A button scrolls a long block back to its last line once the user has scrolled up
sizeacceptsxl
-
maz-ui: Add
MazBtnDropdown, a button with a main action and a menu of its variants (290cb871c)MazBtnDropdownis a split button: the main action on the left emitsclick, the chevron on the right opens a menu of variants ("Save", then "Save as draft"). Both parts share thecolor,size,rounded-size,outlinedandpastelofMazBtn, and the menu takes theitemsofMazDropdown.It supports
trigger(click, hover, adaptive),position,loading,disabled,action-disabled,menu-disabled,type,start-icon,block, atooltipon the main action, and the global defaults ofsizeandroundedSize.<template> <MazBtnDropdown :items="items" menu-label="Other save options" @click="save"> Save </MazBtnDropdown> </template>
-
nuxt: Auto-import
MazBtnDropdown(534a71a8e) -
maz-ui:
MazDrawernow has a border (5dcf84c06) -
icons: Add the registry of icon names, the list of names and the files of the flags and logos (baf1fefc2)
@maz-ui/icons/registry:registerIcons({ star: MazStar }), the names used by<MazIcon icon="star" />@maz-ui/icons/icon-names.json: the name and SVG file of each icon (x-mark,flag-fr,logo-vue), read byMazUi()of@maz-ui/vite-plugin@maz-ui/icons/flags/*and@maz-ui/icons/logos/*: the SVG files of flags and logos, for an<img>(@maz-ui/icons/flags/3x2/FR.svg)
-
maz-ui: Icons by name in every icon prop, and add
MazSvg(c13e0b086)<MazIcon icon="x-mark" />and<MazBtn start-icon="moon">accept the icons of@maz-ui/iconsand the project's SVG by name, registered byMazUi()of@maz-ui/vite-pluginor@maz-ui/nuxt, with autocompletion of the names (MazIconNames,MazIconString). Components, raw SVG strings, URLs and data URIs keep working.MazSvg: renders an SVG (name, component, URL or raw string) at its own size and with its own colors, for illustrations, logos and flagsMazIconis vertically aligned with the text- Components with an icon prop are generic: type their template refs with
GenericInstanceTypeof@maz-ui/utils
-
vite-plugin: Add
MazUi(), icons by name and the project's SVG, with the CSS purge (21629edc4)MazUi()holds two plugins, both enabled by default:icons(MazUiIcons()): registers in each chunk the icons its files use by name, so only each page's icons are bundled, and in the server HTML. The SVG ofsrc/iconsare also names (hero, orapp:herowith aprefix), optimized by svgo. It writessrc/maz-icons.d.ts(the types of the names) and rewrites imports from the root of@maz-ui/iconsto each icon's module.purge(MazUiPurgeCss()): removes the unused CSS of maz-ui at build time
-
nuxt: Icons by name with the
iconsoption (3eaf4e252)Every icon of
@maz-ui/iconsand every SVG in<srcDir>/icons(app/iconswith Nuxt 4) is available by name in icon props, such as<MazBtn start-icon="moon">, enabled by default. Only each page's icons are bundled, and in the server HTML. Name types are generated in.nuxt/types/maz-icons.d.ts. Options:dir,prefix,safelist,strict,svgoConfig, oricons: false. -
mcp: Give icon names in
find_iconsand report unknown icon names inreview_code(8b6f1acee)find_iconsgives the name of each icon (trash) and its use by name,<MazBtn start-icon="trash">review_codereports an icon name in an icon prop that is neither an icon of@maz-ui/iconsnor of the project (icon="x-mak", did you mean "x-mark"?), using the generated name types or the icons folder, and icon names in a project withoutMazUi()or@maz-ui/nuxt
-
maz-ui: Icons by name in
MazAlertand in the steps ofMazStepper(74f7fecdd)<MazAlert icon="bell">andsteps: [{ icon: 'check' }]accept the formats ofMazIcon: a name of@maz-ui/iconsor of the project, a component, a URL or a raw SVG. -
maz-ui: Toast icons accept the formats of
MazIcon(9a795d241)The
iconoption of toasts accepts a name (toast.success('Saved', { icon: 'cloud-arrow-up' })), a component, a URL or a raw SVG, and replaces the type's icon. An icon component passed in this option was previously ignored. -
icons:
icon-names.jsongives the component of each name (59f2f3ce5)Each name in
icon-names.jsongives its component and file:{ "x-mark": { "component": "MazXMark", "file": "svg/x-mark.svg" } }. -
maz-ui:
MazAvataremitsloadedfrom the native image, andloading="intersecting"is deprecated (cb1fa66cf)With
loading="lazy"or"eager", the native image emitsloaded, as the defaultintersectingmode does.loading="intersecting"is deprecated: useloading="lazy"(native lazy loading). In v6,lazybecomes the default andintersectingis removed, along with theloadingandintersectingevents and thehideLoaderprop. In dev, a warning is logged whenloading="intersecting"is set. -
vite-plugin:
MazUiThemePresetskeeps in the build only the presets loaded by name (512215cb3)getPresetof@maz-ui/themesimports each named preset on demand, so every preset is a chunk of the build.MazUi({ presets: ['maz-ui', 'ocean'] }), orMazUiThemePresets({ presets })alone, keeps only the listed ones;[]keeps none, for an app that only uses preset objects. It also applies to the dependency optimizer, so a missing preset fails in dev as in production. -
nuxt: Theme presets are no longer prefetched,
theme.presetskeeps only the ones loaded by name (4c3bdb0f1)Pages no longer prefetch the chunks of named presets of
@maz-ui/themes: they are downloaded when the app loads them. The newtheme.presetsoption keeps only the listed presets in the build (withtheme.presetwhen it is a name), throughMazUiThemePresetsof@maz-ui/vite-plugin. -
maz-ui: Add
MazPageSection, a full-width page band with thepadded-containergutter (804060919)MazPageSectionrenders thepadded-containerutility (padded-container-no-pwithfull-bleed), with theas,full-bleed,max-widthandcontainerprops, each with a default for the whole app through thedefaultsoption ofMazUi. Its styles are inmaz-ui/style.css: it works with or without Tailwind CSS, without importing the utilities.The
padded-containerutilities no longer need the variables ofmaz-ui/style.css: they read their defaults as fallbacks and switch the side padding on the viewport themselves, somaz-ui/utilities.cssworks alone, and a--maz-container-padding-<mobile|tablet|desktop>set on a parent now applies to the sections inside. -
nuxt: Auto-import
MazPageSection(ef94342fd) -
utils: Publish
exports.json, the names of the helpers (3ac85eaaf)@maz-ui/utils/exports.jsonlists the helpers exported by@maz-ui/utils, written by the build from the package exports. Tools that need them, such as auto-import resolvers, read it instead of keeping their own list. -
maz-ui: Publish
exports.json, the names of the components and composables (4e2c158fd)maz-ui/exports.jsonlists the components and composables exported by maz-ui, written by the build from the exports ofmaz-ui/componentsandmaz-ui/composables.MazModulesResolverreads it, with@maz-ui/utils/exports.json, instead of keeping its own lists: a new composable or helper resolves without a change to the resolver. -
@maz-ui/icons: Add 9 logos (08f6b2f44)
Adds the
MazBun,MazClaude,MazGitlab,MazMicrosoftTeams,MazPnpm,MazSlack,MazVercel,MazXandMazYarnlogos. -
@maz-ui/mcp: New
review_coderules and fewer false positives (1b132978c)New rules:
missing-required-prop,unknown-slot-binding,input-label,button-navigation,native-dialog(alert, confirm, prompt),parse-error(a file that cannot be parsed is reported instead of stopping the review), andprefer-utils/prefer-ecosystemfor hand-written code that maz-ui provides (currency and date formatting, sleep, debounce, cookies, viewport, visibility, MutationObserver).
🔥 Performance
-
icons: Inline the SVG of each icon in its entry (dc1549d90)
The static and raw entries of an icon hold its component and SVG, instead of importing them from a separate module: 1,736 fewer files in the package, faster to publish and install. Imports and their types do not change.
The raw string of an icon is wrapped in a pure
String()call, so it is not copied into each??,||or ternary that uses it. -
icons: Icon types declared in five files (bd414762d)
Icon types are declared by their entries and by one module file (
declare module '@maz-ui/icons/static/MazStar'), instead of one file per module: 2,604 fewer files in the package, and TypeScript loads 80 files instead of 2,683. Each import keeps its exact types: a wrong name is still an error.The root types import their entries with an extension, so
import { MazTrash } from '@maz-ui/icons'is typed withmoduleResolution: nodenext. -
icons: No SVG files for flags and logos in the package (e750b8343)
Flags and logos are published as components and raw strings only (533 fewer files):
./flags/*and./logos/*, never released in a stable version, are removed../svg/*stays. -
themes: Named presets load from a registry the build can replace (3609bc6a3)
getPresetreads the loaders of named presets fromutils/preset-loaders, whichMazUiThemePresets(@maz-ui/vite-plugin) replaces at build time to keep only the app's presets. Loading a preset outside this list throws an error naming the option, and amaz-presetcookie naming it falls back to the configured preset with a warning. -
maz-ui:
MazCodeHighlighthighlights with the JavaScript regex engine of shiki, without WebAssembly (aeb45f5f6)The
shikientry loaded the Oniguruma engine, a WebAssembly file of about 600 KB, once the page was interactive. The highlighter is now built withshiki/coreandcreateJavaScriptRegexEngine: about 150 KB less (gzip) per page that highlights code. Languages and themes still load when a block uses them. The engine requires thevflag of regular expressions (Chrome 112, Safari 17, Firefox 116).
🩹 Fixes
-
maz-ui:
MazInputPhoneNumberapplies av-modelset right after mount (ab5a90025)The component ignored a
v-modelvalue set by the parent right after mount (data loaded one tick after render). The value is now compared with the last emitted value instead of a time-based flag.Fixes:
- The country code set by the parent right after mount is applied, and a stale country code sent back by the parent no longer overrides the phone number's country
- The parent can reset the country code (
v-model:country-codeset toundefined) @datareturns the country of the phone number after typing an international number from another country- The country from
fetch-countryno longer overrides a country or phone number set during the request, and still replaces the country of the browser locale - The detected country (browser locale or IP address) is only selected when it belongs to
only-countries/ignored-countries - The browser locale resolves to its region (
cagives Canada,arArgentina,beBelgium,zhorkono longer error) - An empty input no longer shows a valid state when the parent does not update the
v-model - A
nullor''v-modelis no longer rewritten toundefinedon mount or reset - An invalid
country-locale('',fr_FR) no longer crashes the render - Full-width and Arabic-Indic digits are kept while typing
- An incomplete phone number emits the typed value instead of an invalid E.164 (
+3306585858) - A valid phone number with an extension set by the parent is no longer rewritten without it
Improvements:
focus()andresultsare exposedaria-invalidon the inputs,aria-describedbylinking the phone number input to the assistive text,aria-liveon the assistive text- New
extfield in the results - New
country-list-code,country-list-name,start-icon,end-iconandloaderslots - The country list is cached by locale, and built on the client only without
country-locale(no hydration mismatch on country names) - The focus after selecting a country is cancelled on unmount
- No more duplicated warning for an unavailable country
-
maz-ui: Fix
MazSwitchaccessibility, autofill of inputs and dark mode details (f9b3598dd)MazSwitchkeeps anaria-labelattribute, its track is visible in both modes, and its disabled state uses opacityMazInputandMazTextareatint the whole field on browser autofill and keep the theme's text colorMazDatePickerandMazSelectinputs no longer stretch in height- Dark mode:
MazLinklightens on hover, the pastel text ofMazBtnandMazBadgeis lighter, and theMazSkeletongradient follows the foreground MazAccordionapplies itsdurationMazSelectCountryloads flags natively when they become visible
-
mcp: Name Codex, Cline and Zed as the agents without a project MCP config in init (32752a7f4)
-
Build the published packages in dry run too (587b8170a)
pnpm publish --dry-runstill runs theprepackscripts, which need the built packages: a dry run from a fresh clone or worktree failed on theprepackof@maz-ui/nuxt. -
maz-ui:
MazLinkacceptstext-align: inherit(70f489cb8) -
maz-ui:
MazIconkeeps a URL already undermazIconPath(767586cee)With
mazIconPath: '/icons',icon="/icons/star.svg"is fetched from/icons/star.svg, not/icons/icons/star.svg. Same with an absolute base:https://cdn.app.com/iconsand/icons/star.svggivehttps://cdn.app.com/icons/star.svg. -
Publish the exports without the
monorepo:devcondition (61fd61c82)The published
package.jsonno longer has themonorepo:devcondition, which pointed to sources that are not published. -
maz-ui:
useToastreturns the accent method of the toast plugin (7bf0ddb45) -
maz-ui:
MazIconrenders SVG files that start with an XML prolog (3b84b2dfa)An SVG starting with an XML prolog, a doctype or comments (as exported by design tools) rendered the fallback icon, whether from a URL, a raw string or a data URI. A data URI with an unencoded
%or a percent-encoded base64 payload is also decoded, without a request. -
vite-plugin: An icon used by name shares the raw module of maz-ui (a7448f3b3)
MazUi()imports an icon of@maz-ui/iconsused by name from itsrawmodule, resolved from maz-ui like the imports of its components. An icon used both by name and by a maz-ui component (the toast close cross) is bundled once instead of twice. -
vite-plugin: The SVG of a maz-ui icon is read from its built raw module (064a47773)
When the
rawmodule of an icon of@maz-ui/iconsis not resolved,MazUi()reads its SVG fromdist/rawinstead of its SVG file, identical byte for byte. Flags and logos need no file in the package. -
maz-ui:
MazAvatarandMazSelectCountryload images lazily withloading="lazy"(364cfbfe2)The
loadingattribute is now set beforesrc, so the browser no longer fetches images as soon as they render. -
@maz-ui/mcp: Skip
node_modules,distandcoveragein folders outside the working directory (158bb4d01)Reviewing
../appwent throughnode_modulesandcoverage, and stopped at the limit of 200 files.
💅 Refactors
-
nuxt:
setupAgentsresolves the agents, the rules and the MCP version of the app (0ce969446) -
icons: Testable icon generator (c9551f7d3)
One function per rule (component names, SVG cleaning, icon files), with the package root passed in by the build. The generated files are unchanged.
-
nuxt: Read the components and composables to auto-import from
maz-ui/exports.json(63b11acaa)
📦 Build
-
deps: Update 3 dependencies (major) (13e9990eb)
- @nuxt/devtools ^3.4.4 -> ^4.1.0
- @nuxt/devtools-kit ^3.4.4 -> ^4.1.0
- jsdom ^30.1.3 -> ^31.0.0
-
maz-ui: Resolve the colors of
MazSwitchwithoutlight-dark()(2ab6c0351)
🧪 Tests
- maz-ui: Update coverage thresholds (6c74d439e)
- icons: Unit tests and coverage of the registry, the resolver and the icon generator (f6a567eb0)
- vite-plugin: Icons of a variable with a type annotation (935faf353)
❤️ Contributors
- LouisMazel (@LouisMazel)