@maz-ui/mcp 5.3.1-beta.0 → 5.4.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.
@@ -15089,6 +15089,10 @@ function presetColors(preset) {
15089
15089
  ...names.map((name) => `| \`${name}\` | ${colorClasses(name)} | ${display(light[name])} | ${display(dark[name])} |`)
15090
15090
  ];
15091
15091
  }
15092
+ function presetColorScale(preset) {
15093
+ const mode = asRecord(preset.overrides.scales).color;
15094
+ return typeof mode === "string" ? [`Color scales: \`${mode}\` (\`scales.color\`), the derivation of the \`-50\`..\`-950\` steps of the brand colors (\`bg-primary-100\`, \`text-accent-700\`...). \`perceptual\` keeps their order and hue with very light or very dark brand colors.`] : [];
15095
+ }
15092
15096
  function presetFoundation(preset, wanted) {
15093
15097
  const rows = Object.entries(asRecord(preset.overrides.foundation)).filter(([key]) => wanted(FOUNDATION_USAGE[key]?.topic ?? "css-variables")).map(([key, value]) => `| \`${key}\` | \`--maz-${key}\` | ${FOUNDATION_USAGE[key]?.usage ?? "-"} | ${display(value)} |`);
15094
15098
  return rows.length > 0 ? ["| Foundation | CSS variable | Used by | Value |", "| --- | --- | --- | --- |", ...rows] : [];
@@ -15120,6 +15124,7 @@ function renderPreset(preset, wanted, filtered) {
15120
15124
  const origin = [preset.exportName && `\`${preset.exportName}\``, preset.base && `base \`${preset.base}\``].filter(Boolean).join(", ");
15121
15125
  const tables = [
15122
15126
  wanted("colors") ? presetColors(preset) : [],
15127
+ wanted("colors") ? presetColorScale(preset) : [],
15123
15128
  presetFoundation(preset, wanted),
15124
15129
  presetScales(preset, wanted),
15125
15130
  wanted("colors") ? presetComponents(preset) : []
@@ -18,6 +18,10 @@ url: "https://maz-ui.com/components/maz-animated-element"
18
18
 
19
19
  ## Basic usage
20
20
 
21
+ **Tip:**
22
+
23
+ This component is SSR friendly: its content is in the server markup and the animation is pure CSS, so it starts on the first paint when the element is in the viewport, without waiting for JavaScript. Below the viewport, it plays when the element enters it. With `prefers-reduced-motion: reduce`, the content is displayed without animation.
24
+
21
25
  ```vue
22
26
  <script lang="ts" setup>
23
27
  import MazAnimatedElement from 'maz-ui/components/MazAnimatedElement'
@@ -20,7 +20,7 @@ url: "https://maz-ui.com/components/maz-animated-text"
20
20
 
21
21
  **Tip:**
22
22
 
23
- This component is SSR friendly. It will display the brut text on the server side with the chosen tag, and the animated text on the client side.
23
+ This component is SSR friendly: the server renders the same markup as the client, so the text keeps its layout on hydration (no layout shift). The animation is pure CSS and starts on the first paint when the text is in the viewport, without waiting for JavaScript; below the viewport, it plays when the text enters it. With `prefers-reduced-motion: reduce`, the text is displayed without animation.
24
24
 
25
25
  ```vue
26
26
  <script lang="ts" setup>
@@ -146,13 +146,17 @@ Choose the size of the rounded with the attribute `rounded-size` and value `none
146
146
 
147
147
  The button can be a fab button with the attribute `fab`
148
148
 
149
+ **Tip: Accessible name**
150
+
151
+ A button that only shows an icon has no text for screen readers: give it an `aria-label` describing the action (`aria-label="Light mode"`), or a `title` on the icon (`:icon="{ icon: MazSun, title: 'Light mode' }"`), which names the icon and so the button.
152
+
149
153
  ```html
150
- <MazBtn fab icon="/sun.svg" size="mini" />
151
- <MazBtn fab icon="/sun.svg" size="xs" />
152
- <MazBtn fab icon="/sun.svg" size="sm" />
154
+ <MazBtn fab icon="/sun.svg" aria-label="Light mode" size="mini" />
155
+ <MazBtn fab icon="/sun.svg" aria-label="Light mode" size="xs" />
156
+ <MazBtn fab icon="/sun.svg" aria-label="Light mode" size="sm" />
153
157
  <MazBtn fab> fab </MazBtn>
154
- <MazBtn fab icon="/sun.svg" size="lg" />
155
- <MazBtn fab icon="/sun.svg" size="xl" />
158
+ <MazBtn fab icon="/sun.svg" aria-label="Light mode" size="lg" />
159
+ <MazBtn fab icon="/sun.svg" aria-label="Light mode" size="xl" />
156
160
  ```
157
161
 
158
162
  ## Block
@@ -61,7 +61,7 @@ You can remove the buttons with the props `hide-buttons`
61
61
  - `size` (`"xs" | "sm" | "md" | "lg" | "xl" | "mini"`, default: `'md'`): The size of the input number component.
62
62
  - `hide-buttons` (`boolean`, default: `false`): Whether to hide the increment and decrement buttons or not.
63
63
  - `text-center` (`boolean`, default: `true`): Whether to center the text inside the input or not.
64
- - `inputmode` (`"none" | "text" | "search" | "email" | "tel" | "url" | "numeric" | "decimal"`, default: `"numeric"`): The inputmode attribute for the input.
64
+ - `inputmode` (`"none" | "text" | "search" | "url" | "email" | "tel" | "numeric" | "decimal"`, default: `"numeric"`): The inputmode attribute for the input.
65
65
  - `block` (`boolean`): The input will be displayed in full width.
66
66
  - `error` (`boolean`, default: `false`): Will display the input in error state.
67
67
  - `hint` (`string`): The hint text to display below the input.
@@ -518,7 +518,7 @@ interface MazInputPhoneNumberData {
518
518
  - `block` (`boolean`, default: `false`): The input will be displayed in full width.
519
519
  - `orientation` (`"row" | "col" | "responsive"`, default: `"responsive"`): Orientation of the inputs in the component.
520
520
  - `country-select-attributes` (`Record<string, unknown>`, default: `{ name: "country", autocomplete: "off", style: { width: "14rem", }, }`): Meta attributes of the country input.
521
- - `phone-input-attributes` (`(Record<string, unknown> & { name: string; inputmode: "none" | "text" | "search" | "email" | "tel" | "url" | "numeric" | "decimal" | undefined; autocomplete: string; })`, default: `{ name: "phone", autocomplete: "tel", inputmode: "tel", }`): Meta attributes of the phone number input.
521
+ - `phone-input-attributes` (`(Record<string, unknown> & { name: string; inputmode: "none" | "text" | "search" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined; autocomplete: string; })`, default: `{ name: "phone", autocomplete: "tel", inputmode: "tel", }`): Meta attributes of the phone number input.
522
522
  - `assistive-text` (`string`): Helper text displayed below the input to provide additional context or validation feedback.
523
523
  - `hint` (`string`): Alternative text that replaces the label when provided. Useful for contextual hints.
524
524
 
@@ -305,7 +305,7 @@ Use the attribute `rounded-size` with a value in `'none' | 'sm' | 'md' | 'lg' |
305
305
  - `hint` (`string`): Alternative text that replaces the label when provided. Useful for contextual hints.
306
306
  - `input-classes` (`string`): Additional CSS classes to apply specifically to the input wrapper element.
307
307
  - `border` (`boolean`, default: `true`): Controls whether the input has a visible border. Set to false for borderless inputs.
308
- - `inputmode` (`"none" | "text" | "search" | "email" | "tel" | "url" | "numeric" | "decimal"`, default: `"text"`): HTML inputmode attribute that provides hints for virtual keyboards on mobile devices.
308
+ - `inputmode` (`"none" | "text" | "search" | "url" | "email" | "tel" | "numeric" | "decimal"`, default: `"text"`): HTML inputmode attribute that provides hints for virtual keyboards on mobile devices.
309
309
  - `size` (`"xs" | "sm" | "md" | "lg" | "xl" | "mini"`): Controls the height and text size of the input component.
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.
@@ -124,7 +124,7 @@ export default defineNuxtConfig({
124
124
 
125
125
  // Theming System
126
126
  theme: {
127
- preset: 'maz-ui', // 'maz-ui' | 'pristine' | 'ocean' | 'obsidian' | 'nova' | custom object
127
+ preset: 'maz-ui', // 'maz-ui' | 'pristine' | 'ocean' | 'obsidian' | 'nova' | 'folio' | custom object
128
128
  strategy: 'runtime', // 'runtime' | 'buildtime'
129
129
  darkModeStrategy: 'class', // 'class' | 'media'
130
130
  darkClass: 'dark', // class on <html> when colorMode === 'dark' (default: 'dark')
@@ -21,7 +21,7 @@ Modern and performant theme system for Maz-UI built on native CSS features (`lig
21
21
  - **Native widget theming** - `color-scheme` makes scrollbars, native `<select>`, date pickers and autofill follow the active mode automatically
22
22
  - **Animated theme switch** - Optional full-page View Transitions via `setColorMode(..., { animate: true })`
23
23
  - **Anti-FART** - `<meta name="color-scheme">` injected at boot to prevent any Flash of inAccurate coloR Theme (no setup needed)
24
- - **Automatic color scales** - `--maz-X-50` through `--maz-X-950` derived via OKLCh relative color syntax - perceptually uniform and chroma-preserving
24
+ - **Automatic color scales** - the `-50` to `-950` steps are derived via OKLCh relative color syntax, with an opt-in `perceptual` mode that keeps their order and hue with any base color
25
25
  - **Performance Strategies** - Runtime injection or build-time generation according to your needs
26
26
  - **Strict TypeScript** - Complete types for perfect DX
27
27
  - **Zero FOUC** - Pass the preset object up front; the full CSS is injected synchronously on first paint
@@ -47,7 +47,7 @@ const app = createApp(App)
47
47
 
48
48
  app.use(MazUi, {
49
49
  theme: {
50
- preset: mazUi, // pristine | ocean | obsidian | nova
50
+ preset: mazUi, // pristine | ocean | obsidian | nova | folio
51
51
  strategy: 'runtime', // 'runtime' | 'buildtime'
52
52
  darkModeStrategy: 'class', // 'class' | 'media' (only if mode is `both`)
53
53
  mode: 'both', // 'light' | 'dark' | 'both' (supported color modes)
@@ -300,6 +300,18 @@ A modern startup / AI / creative preset - electric violet primary, hot coral sec
300
300
  import { nova } from '@maz-ui/themes/presets'
301
301
  ```
302
302
 
303
+ ### Folio
304
+
305
+ An electric and modern preset made for long reading, and the one of this documentation: an electric blue primary, an electric magenta secondary and a cyan accent that blend into a plasma gradient, on faintly violet surfaces (almost white in light mode, violet-black in dark mode). Fraunces (serif) for the headings, Inter for the text, Geist Mono for the code, soft 0.625rem `md` radius. In dark mode the color roles turn into bright tones carrying dark text, so they stay readable as text on the surface too. Every text pair reaches WCAG AA.
306
+
307
+ ```typescript
308
+ import { folio } from '@maz-ui/themes/presets'
309
+ ```
310
+
311
+ **Tip: Fonts**
312
+
313
+ Like the other presets, Folio only declares font stacks: load Fraunces, Inter and Geist Mono yourself (self-hosted or from a font service), the stacks fall back to system fonts otherwise.
314
+
303
315
  ## Rendering Strategies
304
316
 
305
317
  ### ⚡ Runtime (Recommended)
@@ -472,6 +484,32 @@ const codeTheme = definePreset({
472
484
  })
473
485
  ```
474
486
 
487
+ ### Color scales
488
+
489
+ The steps `-50` to `-950` of the brand colors (`primary`, `secondary`, `accent`, `info`, `success`, `warning`, `destructive`) are derived from the base color, which is the `500` step. `scales.color` picks the derivation:
490
+
491
+ - `relative` (default): a fixed lightness offset per step. With a very dark or very light base, the scale collapses: half of a navy scale is black, half of a gold scale is white.
492
+ - `perceptual`: each step travels a share of the way between the base and a light or a dark bound, with a chroma capped near white and black. The steps keep their order and their hue whatever the base, and the classes do not change (`bg-accent-300`, `text-primary-700`...).
493
+
494
+ ```typescript
495
+ const brandTheme = definePreset({
496
+ base: 'maz-ui',
497
+ overrides: {
498
+ colors: {
499
+ light: { secondary: '#0E1450', accent: '#FFC93C' },
500
+ },
501
+ scales: {
502
+ color: 'perceptual',
503
+ },
504
+ },
505
+ })
506
+ ```
507
+
508
+ - The scales stay dynamic: they follow `updateTheme()` and the light and dark values of the base. A step is relative to the base of each mode: `accent-300` gives two colors in light and dark when the two bases differ.
509
+ - `surface`, `foreground`, `contrast` and `divider` keep the relative scale: the components use it as "one notch darker or lighter" (`bg-surface-600`).
510
+ - The steps are redefined for the maz-ui components (`--maz-color-<role>-<step>`) and for the Tailwind classes of your project (`--color-<role>-<step>`). They take precedence over a step you redefine in your own `@theme`.
511
+ - The browsers clip an out-of-gamut color channel by channel, which can shift its hue: the chroma cap keeps this shift under the visible threshold for almost every color, the most saturated blues and yellows excepted.
512
+
475
513
  ### Per-component overrides
476
514
 
477
515
  `components` is a small, validated set of per-component knobs. Every entry is per-mode where appropriate so light and dark can drift independently:
@@ -870,6 +908,7 @@ Multi-step scales under `scales.<key>`.
870
908
  | --- | --- | --- |
871
909
  | `rounded.xs..3xl` | `--maz-rounded-xs..3xl` | `rounded-{key}` (bridged to `--radius-{key}`) |
872
910
  | `shadow.{sm, md, lg, xl, elevation}` | `--maz-shadow-style-{key}` | `shadow-{key}` (bridged to `--shadow-{key}`) |
911
+ | `color` (`'relative'` \| `'perceptual'`) | `--maz-color-<role>-50..950`, `--color-<role>-50..950` | `bg-primary-300`... (see Color scales) |
873
912
 
874
913
  > Same naming-collision avoidance as foundation: `rounded.*` (instead of `radius.*`) and `shadow-style-*` (instead of plain `shadow-*`) keep the bridge cycle-free under `prefix(maz)`.
875
914
 
@@ -98,7 +98,7 @@ The entire Maz-UI setup is now code-split into the Dashboard chunk.
98
98
 
99
99
  ```typescript
100
100
  interface ThemeOptions {
101
- preset: ThemePreset // Required - Theme preset (mazUi, ocean, pristine, obsidian, nova, or custom)
101
+ preset: ThemePreset // Required - Theme preset (mazUi, ocean, pristine, obsidian, nova, folio, or custom)
102
102
  overrides?: ThemePresetOverrides // Partial overrides for colors, foundation, etc.
103
103
  strategy?: 'runtime' | 'buildtime' // CSS generation strategy (default: 'runtime')
104
104
  darkModeStrategy?: 'class' | 'media' // Dark mode handling (default: 'class')
package/docs/guide/vue.md CHANGED
@@ -83,7 +83,7 @@ app.use(MazUi, {
83
83
  * @see https://maz-ui.com/ecosystem/themes
84
84
  */
85
85
  theme: {
86
- preset: mazUi, // 'ocean' | 'pristine' | 'obsidian' | 'nova'
86
+ preset: mazUi, // 'ocean' | 'pristine' | 'obsidian' | 'nova' | 'folio'
87
87
  overrides: {
88
88
  foundation: {
89
89
  'space': '0.25rem',