Skip to content

v5.7.0

Choose a tag to compare

@LouisMazel LouisMazel released this 18 Nov 20:42
· 185 commits to develop since this release

compare changes

🚀 Features

  • utils: Add the formatRelativeTime and getRelativeTime helpers 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 useRelativeTime composable, 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 useRelativeTime composable (f636e114c)

  • utils: Add fuzzy search and string similarity helpers (b6dc2c8ca)

    • fuzzySearch(items, query, options) and createFuzzySearch(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 parts
    • levenshteinDistance, getMatchingScore and isStringMatching in @maz-ui/utils/helpers/stringMatching
    • normalizeString removes 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 of MazColorPicker
    • inputAutocomplete.*: noResults, loading, error and results of MazInputAutocomplete
    • aria.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 as LazyMaz* exports of the package root
  • themes: Add the macos, windows and linux presets, the type scale, the glass material and the system colors (1924acec0)

    • macos, windows and linux presets: 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/presets or by name with getPreset('macos')
    • typography option: the type scale by level (display, title-1 to title-4, body, label, caption, overline, code...), emitted as --maz-typography-* variables. The bundled presets ship their own scale
    • components.glass option: translucent material for floating surfaces (bg, border, blur, saturate)
    • systemColors option: system color keywords by role (AccentColor...), applied with @supports so the preset color stays the fallback
    • foundation['interactive-cursor'] token: the cursor of interactive controls (default pointer)
    • Preset colors accept color keywords (transparent, currentColor, system colors), hwb(), color-mix() and light-dark()
    • resolvePreset(preset): every color of a preset per mode, as hex and oklch, with getContrastRatio and getColorDistance
  • vite-plugin: Add MazUiPurgeCss to remove the unused CSS of maz-ui. New @maz-ui/vite-plugin package, 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 the purge-manifest.json written by the maz-ui build.

    Options: content (files to scan), entries (modules used at runtime), safelist and report. 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-1 to text-title-4, text-body-lg, text-body, text-body-sm, text-label, text-caption, text-overline, text-code, driven by the typography of the preset, and the type-* variants without the font size
    • rich-text, rich-text-sm and rich-text-lg style raw HTML (Markdown, CMS), not-rich-text opts a block out
    • glass utility and bg-glass / border-glass colors, scrollbar-themed and cursor-interactive utilities, transparency-reduce: variant
    • Container query sizes named like the breakpoints (@tab-m:, max-w-lap-s) in maz-ui/tailwindcss/theme-containers.css
    • padded-container follows the closest @container ancestor, and padded-container-no-p no longer computes a negative padding
    • New exports: maz-ui/utilities.css (utilities for projects without Tailwind CSS) and maz-ui/purge-manifest.json (for @maz-ui/vite-plugin)
  • maz-ui: Add fuzzy search to MazSelect, MazChecklist, MazTable and MazInputAutocomplete (bcd91c14e)

    • MazSelect, MazChecklist and MazTable search tolerates typos and ignores accents and case. MazSelect and MazChecklist sort results by relevance (groups of options keep their order), MazTable keeps the order of its rows. The search engine loads with the search input only.
    • New MazInputAutocomplete: suggestions from items or an async source(query, { signal }), debounced and cancelled when the query changes, with minChars, limit and highlighted matches. Enter picks the active or first suggestion. v-model holds the text, v-model:selected the picked item.
    • New useFuzzySearch(items, query, options) composable for your own lists. useStringMatching keeps its API. See https://maz-ui.com/components/maz-input-autocomplete
  • maz-ui: Add MazColorPicker, MazIndicator, MazList, MazListItem, MazProgressBar and MazSegmented (d1abc6f88)

    • MazColorPicker: inline or in a popover, saturation area, hue and alpha sliders, hex, rgb and hsl formats, swatches and eyedropper
    • MazIndicator: dot or counter attached to a corner of its content (max, pulse, overlap, position)
    • MazList and MazListItem: lists with title, footer and dividers, clickable or collapsible items with lazy content
    • MazProgressBar: progress bar or meter, with a single value or stacked colored segments, and an accessible value text
    • MazSegmented: segmented control with icons, configurable in the global config
  • maz-ui: Rewrite MazInputTags with badges and the sizes of MazInput (3634cfa6c)

    • Tags are removable MazBadge components of the field's size, and the field has the height of a MazInput of the same size
    • New top-label, assistive-text, rounded-size and id props
    • , adds a tag like Enter, comma-separated values add several tags, duplicates are ignored
    • A first Backspace in the empty input marks the last tag, a second one removes it
    • No floating label anymore: label is the placeholder and the accessible name of the input, use top-label for a visible label
    • DOM changes: the root wraps the label, the field (.m-input-tags__field) and the assistive text
  • 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.confirm and improve components (c58eae23a)

    • container neutral color (MazNeutralColor type) on MazBtn, MazBtnGroup, MazBadge, MazLink, MazDropdown and MazRadioButtons. MazPopover defaults to it, MazPagination uses container buttons and a contrast active page
    • surface and container stay solid with pastel, and use foreground tints on hover
    • dialog.confirm() returns a promise, accepts rich content and reactive button props
    • lazy prop on MazAccordion, MazExpandAnimation and MazListItem: content renders on first opening
    • MazBadge: removable prop with a remove event
    • MazAvatar: indicator prop and slot, color="auto" for a stable color per caption
    • MazTabsBar: indicator per item, a true badge renders a dot and false hides it. MazCodeHighlight: colorMode prop (auto follows the closest .dark ancestor)
    • Titles, labels and hints use the theme's type scale, MazMarkdownEditor previews with rich-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 (default true) adds MazUiPurgeCss of @maz-ui/vite-plugin to production builds, with the enabled plugins and directives as entries. Set false to disable it, or pass an object for its options (safelist, entries) when components are resolved at runtime from strings
    • css.injectUtilities (default false) injects maz-ui/utilities.css
    • Auto-import of MazInputAutocomplete, MazColorPicker, MazIndicator, MazList, MazListItem, MazProgressBar, MazSegmented and useFuzzySearch
  • mcp: Show the effective theme colors and review brand colors, type scale and raw icons (8f4074c9f)

    • get_theme_tokens shows the effective colors of the project preset, or of a bundled one with preset: every color and step in light and dark, with WCAG contrasts and what to check. colors and steps narrow the output
    • New maz-ui-mcp colors [preset] command
    • New get_theme_tokens topics: container-queries, layout, type-scale and rich-text
    • New review rules: pale-brand-color, type-scale, arbitrary-font-size, multiple-primary-actions and raw-icon-tag (a @maz-ui/icons/raw import used as a tag renders nothing)
    • theme-colors flags bg-background and suggests surface
    • More search synonyms, and the base-font-size hint points to noArbitraryPx.baseFontSize of @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 padding
    • max-height caps the height of the block, wrap breaks long lines, hide-language hides the language badge
    • follow keeps the block scrolled to the last line of growing code (logs, build output) and highlights only the appended lines; the exposed scrollToBottom() 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-theme and dark-theme choose the shiki theme of each color mode (theme still forces one for both)
    • Every display prop (size, themes, color-mode, rounded, copyable, wrap, hide-language) can be set app-wide with defaults.MazCodeHighlight of the MazUi plugin, and size also follows defaults.global.size
    • A button scrolls a long block back to its last line once the user has scrolled up
    • size accepts xl
  • maz-ui: Add MazBtnDropdown, a button with a main action and a menu of its variants (290cb871c)

    MazBtnDropdown is a split button: the main action on the left emits click, the chevron on the right opens a menu of variants ("Save", then "Save as draft"). Both parts share the color, size, rounded-size, outlined and pastel of MazBtn, and the menu takes the items of MazDropdown.

    It supports trigger (click, hover, adaptive), position, loading, disabled, action-disabled, menu-disabled, type, start-icon, block, a tooltip on the main action, and the global defaults of size and roundedSize.

    <template>
      <MazBtnDropdown :items="items" menu-label="Other save options" @click="save">
        Save
      </MazBtnDropdown>
    </template>
  • nuxt: Auto-import MazBtnDropdown (534a71a8e)

  • maz-ui: MazDrawer now 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 by MazUi() 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/icons and the project's SVG by name, registered by MazUi() of @maz-ui/vite-plugin or @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 flags
    • MazIcon is vertically aligned with the text
    • Components with an icon prop are generic: type their template refs with GenericInstanceType of @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 of src/icons are also names (hero, or app:hero with a prefix), optimized by svgo. It writes src/maz-icons.d.ts (the types of the names) and rewrites imports from the root of @maz-ui/icons to each icon's module.
    • purge (MazUiPurgeCss()): removes the unused CSS of maz-ui at build time
  • nuxt: Icons by name with the icons option (3eaf4e252)

    Every icon of @maz-ui/icons and every SVG in <srcDir>/icons (app/icons with 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, or icons: false.

  • mcp: Give icon names in find_icons and report unknown icon names in review_code (8b6f1acee)

    • find_icons gives the name of each icon (trash) and its use by name, <MazBtn start-icon="trash">
    • review_code reports an icon name in an icon prop that is neither an icon of @maz-ui/icons nor 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 without MazUi() or @maz-ui/nuxt
  • maz-ui: Icons by name in MazAlert and in the steps of MazStepper (74f7fecdd)

    <MazAlert icon="bell"> and steps: [{ icon: 'check' }] accept the formats of MazIcon: a name of @maz-ui/icons or of the project, a component, a URL or a raw SVG.

  • maz-ui: Toast icons accept the formats of MazIcon (9a795d241)

    The icon option 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.json gives the component of each name (59f2f3ce5)

    Each name in icon-names.json gives its component and file: { "x-mark": { "component": "MazXMark", "file": "svg/x-mark.svg" } }.

  • maz-ui: MazAvatar emits loaded from the native image, and loading="intersecting" is deprecated (cb1fa66cf)

    With loading="lazy" or "eager", the native image emits loaded, as the default intersecting mode does.

    loading="intersecting" is deprecated: use loading="lazy" (native lazy loading). In v6, lazy becomes the default and intersecting is removed, along with the loading and intersecting events and the hideLoader prop. In dev, a warning is logged when loading="intersecting" is set.

  • vite-plugin: MazUiThemePresets keeps in the build only the presets loaded by name (512215cb3)

    getPreset of @maz-ui/themes imports each named preset on demand, so every preset is a chunk of the build. MazUi({ presets: ['maz-ui', 'ocean'] }), or MazUiThemePresets({ 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.presets keeps 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 new theme.presets option keeps only the listed presets in the build (with theme.preset when it is a name), through MazUiThemePresets of @maz-ui/vite-plugin.

  • maz-ui: Add MazPageSection, a full-width page band with the padded-container gutter (804060919)

    MazPageSection renders the padded-container utility (padded-container-no-p with full-bleed), with the as, full-bleed, max-width and container props, each with a default for the whole app through the defaults option of MazUi. Its styles are in maz-ui/style.css: it works with or without Tailwind CSS, without importing the utilities.

    The padded-container utilities no longer need the variables of maz-ui/style.css: they read their defaults as fallbacks and switch the side padding on the viewport themselves, so maz-ui/utilities.css works 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.json lists 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.json lists the components and composables exported by maz-ui, written by the build from the exports of maz-ui/components and maz-ui/composables. MazModulesResolver reads 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, MazX and MazYarn logos.

  • @maz-ui/mcp: New review_code rules 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), and prefer-utils / prefer-ecosystem for 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 with moduleResolution: 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)

    getPreset reads the loaders of named presets from utils/preset-loaders, which MazUiThemePresets (@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 a maz-preset cookie naming it falls back to the configured preset with a warning.

  • maz-ui: MazCodeHighlight highlights with the JavaScript regex engine of shiki, without WebAssembly (aeb45f5f6)

    The shiki entry loaded the Oniguruma engine, a WebAssembly file of about 600 KB, once the page was interactive. The highlighter is now built with shiki/core and createJavaScriptRegexEngine: about 150 KB less (gzip) per page that highlights code. Languages and themes still load when a block uses them. The engine requires the v flag of regular expressions (Chrome 112, Safari 17, Firefox 116).

🩹 Fixes

  • maz-ui: MazInputPhoneNumber applies a v-model set right after mount (ab5a90025)

    The component ignored a v-model value 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-code set to undefined)
    • @data returns the country of the phone number after typing an international number from another country
    • The country from fetch-country no 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 (ca gives Canada, ar Argentina, be Belgium, zh or ko no longer error)
    • An empty input no longer shows a valid state when the parent does not update the v-model
    • A null or '' v-model is no longer rewritten to undefined on 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() and results are exposed
    • aria-invalid on the inputs, aria-describedby linking the phone number input to the assistive text, aria-live on the assistive text
    • New ext field in the results
    • New country-list-code, country-list-name, start-icon, end-icon and loader slots
    • 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 MazSwitch accessibility, autofill of inputs and dark mode details (f9b3598dd)

    • MazSwitch keeps an aria-label attribute, its track is visible in both modes, and its disabled state uses opacity
    • MazInput and MazTextarea tint the whole field on browser autofill and keep the theme's text color
    • MazDatePicker and MazSelect inputs no longer stretch in height
    • Dark mode: MazLink lightens on hover, the pastel text of MazBtn and MazBadge is lighter, and the MazSkeleton gradient follows the foreground
    • MazAccordion applies its duration
    • MazSelectCountry loads 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-run still runs the prepack scripts, which need the built packages: a dry run from a fresh clone or worktree failed on the prepack of @maz-ui/nuxt.

  • maz-ui: MazLink accepts text-align: inherit (70f489cb8)

  • maz-ui: MazIcon keeps a URL already under mazIconPath (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/icons and /icons/star.svg give https://cdn.app.com/icons/star.svg.

  • Publish the exports without the monorepo:dev condition (61fd61c82)

    The published package.json no longer has the monorepo:dev condition, which pointed to sources that are not published.

  • maz-ui: useToast returns the accent method of the toast plugin (7bf0ddb45)

  • maz-ui: MazIcon renders 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/icons used by name from its raw module, 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 raw module of an icon of @maz-ui/icons is not resolved, MazUi() reads its SVG from dist/raw instead of its SVG file, identical byte for byte. Flags and logos need no file in the package.

  • maz-ui: MazAvatar and MazSelectCountry load images lazily with loading="lazy" (364cfbfe2)

    The loading attribute is now set before src, so the browser no longer fetches images as soon as they render.

  • @maz-ui/mcp: Skip node_modules, dist and coverage in folders outside the working directory (158bb4d01)

    Reviewing ../app went through node_modules and coverage, and stopped at the limit of 200 files.

💅 Refactors

  • nuxt: setupAgents resolves 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 MazSwitch without light-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