@maz-ui/mcp 5.0.0-beta.5 → 5.0.0-beta.51

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.
Files changed (164) hide show
  1. package/README.md +1 -1
  2. package/dist/mcp.d.mts +22 -9
  3. package/dist/mcp.d.ts +22 -9
  4. package/dist/mcp.mjs +160 -83
  5. package/docs/generated-docs/maz-avatar.doc.md +30 -30
  6. package/docs/generated-docs/maz-bottom-sheet.doc.md +16 -13
  7. package/docs/generated-docs/maz-btn.doc.md +21 -19
  8. package/docs/generated-docs/maz-checkbox.doc.md +16 -17
  9. package/docs/generated-docs/maz-circular-progress-bar.doc.md +1 -1
  10. package/docs/generated-docs/maz-code-highlight.doc.md +11 -0
  11. package/docs/generated-docs/maz-container.doc.md +1 -0
  12. package/docs/generated-docs/maz-date-picker.doc.md +41 -41
  13. package/docs/generated-docs/maz-drawer.doc.md +7 -8
  14. package/docs/generated-docs/maz-dropdown.doc.md +3 -0
  15. package/docs/generated-docs/maz-expand-animation.doc.md +4 -4
  16. package/docs/generated-docs/maz-fullscreen-loader.doc.md +5 -5
  17. package/docs/generated-docs/maz-gallery.doc.md +15 -15
  18. package/docs/generated-docs/maz-input-code.doc.md +16 -16
  19. package/docs/generated-docs/maz-input-phone-number.doc.md +43 -42
  20. package/docs/generated-docs/maz-input-price.doc.md +14 -14
  21. package/docs/generated-docs/maz-input-tags.doc.md +16 -16
  22. package/docs/generated-docs/maz-input.doc.md +33 -33
  23. package/docs/generated-docs/maz-lazy-img.doc.md +14 -14
  24. package/docs/generated-docs/maz-loading-bar.doc.md +4 -4
  25. package/docs/generated-docs/maz-markdown-editor.doc.md +65 -0
  26. package/docs/generated-docs/maz-popover.doc.md +1 -1
  27. package/docs/generated-docs/maz-pull-to-refresh.doc.md +39 -20
  28. package/docs/generated-docs/maz-radio-buttons.doc.md +17 -17
  29. package/docs/generated-docs/maz-radio.doc.md +16 -16
  30. package/docs/generated-docs/maz-reading-progress-bar.doc.md +4 -4
  31. package/docs/generated-docs/maz-select-country.doc.md +27 -26
  32. package/docs/generated-docs/maz-sidebar-content.doc.md +5 -0
  33. package/docs/generated-docs/maz-sidebar-footer.doc.md +5 -0
  34. package/docs/generated-docs/maz-sidebar-group.doc.md +11 -0
  35. package/docs/generated-docs/maz-sidebar-header.doc.md +5 -0
  36. package/docs/generated-docs/maz-sidebar-menu-button.doc.md +27 -0
  37. package/docs/generated-docs/maz-sidebar-menu-item.doc.md +5 -0
  38. package/docs/generated-docs/maz-sidebar-menu-sub.doc.md +16 -0
  39. package/docs/generated-docs/maz-sidebar-menu.doc.md +5 -0
  40. package/docs/generated-docs/maz-sidebar-separator.doc.md +0 -0
  41. package/docs/generated-docs/maz-sidebar-trigger.doc.md +5 -0
  42. package/docs/generated-docs/maz-sidebar.doc.md +36 -0
  43. package/docs/generated-docs/maz-slider.doc.md +1 -1
  44. package/docs/generated-docs/maz-spinner.doc.md +4 -4
  45. package/docs/generated-docs/maz-switch.doc.md +14 -14
  46. package/docs/generated-docs/maz-table-virtualizer.doc.md +20 -0
  47. package/docs/generated-docs/maz-table.doc.md +43 -37
  48. package/docs/generated-docs/maz-tabs-bar.doc.md +20 -9
  49. package/docs/generated-docs/maz-tabs.doc.md +6 -3
  50. package/docs/generated-docs/maz-textarea.doc.md +27 -25
  51. package/docs/generated-docs/maz-ticker.doc.md +1 -1
  52. package/docs/generated-docs/maz-timeline.doc.md +4 -4
  53. package/docs/generated-docs/maz-window-mockup.doc.md +23 -0
  54. package/docs/src/blog/v4.md +1 -1
  55. package/docs/src/blog/v5.md +5 -7
  56. package/docs/src/components/maz-avatar.md +52 -4
  57. package/docs/src/components/maz-bottom-sheet.md +300 -169
  58. package/docs/src/components/maz-btn.md +1 -1
  59. package/docs/src/components/maz-checklist.md +10 -10
  60. package/docs/src/components/maz-code-highlight.md +233 -0
  61. package/docs/src/components/maz-date-picker.md +55 -1
  62. package/docs/src/components/maz-dialog.md +46 -0
  63. package/docs/src/components/maz-dropdown.md +32 -16
  64. package/docs/src/components/maz-icon.md +16 -5
  65. package/docs/src/components/maz-input-phone-number.md +30 -0
  66. package/docs/src/components/maz-lazy-img.md +64 -0
  67. package/docs/src/components/maz-markdown-editor.md +369 -0
  68. package/docs/src/components/maz-pull-to-refresh.md +176 -17
  69. package/docs/src/components/maz-select-country.md +138 -1
  70. package/docs/src/components/maz-sidebar.md +719 -0
  71. package/docs/src/components/maz-table.md +156 -1
  72. package/docs/src/components/maz-tabs.md +110 -3
  73. package/docs/src/components/maz-textarea.md +58 -0
  74. package/docs/src/components/maz-timeline.md +60 -0
  75. package/docs/src/components/maz-window-mockup.md +249 -0
  76. package/docs/src/composables/use-drag.md +239 -0
  77. package/docs/src/composables/use-form-validator.md +297 -16
  78. package/docs/src/composables/use-pull-to-refresh.md +79 -0
  79. package/docs/src/composables/use-swipe.md +26 -11
  80. package/docs/src/directives/click-outside.md +8 -15
  81. package/docs/src/directives/fullscreen-img.md +1 -1
  82. package/docs/src/directives/lazy-img.md +44 -11
  83. package/docs/src/directives/tooltip.md +24 -1
  84. package/docs/src/directives/zoom-img.md +1 -1
  85. package/docs/src/ecosystem/eslint-config.md +95 -1
  86. package/docs/src/{guide/icons.md → ecosystem/icons/index.md} +1 -1
  87. package/docs/src/ecosystem/node/exec-promise.md +87 -0
  88. package/docs/src/ecosystem/node/index.md +53 -0
  89. package/docs/src/ecosystem/node/logger.md +146 -0
  90. package/docs/src/ecosystem/node/print-banner.md +93 -0
  91. package/docs/src/{guide → ecosystem}/nuxt.md +102 -47
  92. package/docs/src/{guide → ecosystem}/themes.md +152 -71
  93. package/docs/src/{guide → ecosystem}/translations.md +1 -1
  94. package/docs/src/ecosystem/utils/camel-case.md +31 -0
  95. package/docs/src/{helpers → ecosystem/utils}/capitalize.md +2 -3
  96. package/docs/src/ecosystem/utils/check-availability.md +79 -0
  97. package/docs/src/ecosystem/utils/cookie.md +80 -0
  98. package/docs/src/ecosystem/utils/debounce-callback.md +38 -0
  99. package/docs/src/ecosystem/utils/debounce-id.md +69 -0
  100. package/docs/src/ecosystem/utils/debounce.md +65 -0
  101. package/docs/src/ecosystem/utils/fetch-locale-ip.md +33 -0
  102. package/docs/src/ecosystem/utils/format-json.md +33 -0
  103. package/docs/src/ecosystem/utils/format-phone-number.md +37 -0
  104. package/docs/src/ecosystem/utils/get-browser-locale.md +29 -0
  105. package/docs/src/ecosystem/utils/get-error-message.md +39 -0
  106. package/docs/src/ecosystem/utils/idle-timeout.md +90 -0
  107. package/docs/src/ecosystem/utils/index.md +60 -0
  108. package/docs/src/ecosystem/utils/is-client.md +32 -0
  109. package/docs/src/ecosystem/utils/is-equal.md +38 -0
  110. package/docs/src/ecosystem/utils/is-server.md +31 -0
  111. package/docs/src/ecosystem/utils/is-standalone-mode.md +43 -0
  112. package/docs/src/ecosystem/utils/kebab-case.md +36 -0
  113. package/docs/src/ecosystem/utils/normalize-string.md +77 -0
  114. package/docs/src/ecosystem/utils/pascal-case.md +35 -0
  115. package/docs/src/ecosystem/utils/script-loader.md +77 -0
  116. package/docs/src/ecosystem/utils/sleep.md +59 -0
  117. package/docs/src/ecosystem/utils/snake-case.md +36 -0
  118. package/docs/src/ecosystem/utils/swipe-handler.md +91 -0
  119. package/docs/src/ecosystem/utils/textarea-autogrow.md +41 -0
  120. package/docs/src/ecosystem/utils/throttle-id.md +48 -0
  121. package/docs/src/ecosystem/utils/throttle.md +57 -0
  122. package/docs/src/ecosystem/utils/truthy-filter.md +31 -0
  123. package/docs/src/ecosystem/utils/types/deep-key-of.md +48 -0
  124. package/docs/src/ecosystem/utils/types/deep-partial.md +42 -0
  125. package/docs/src/ecosystem/utils/types/deep-required.md +39 -0
  126. package/docs/src/ecosystem/utils/types/flatten-object-keys.md +44 -0
  127. package/docs/src/ecosystem/utils/types/generic-instance-type.md +42 -0
  128. package/docs/src/ecosystem/utils/types/infer-maybe-ref.md +35 -0
  129. package/docs/src/ecosystem/utils/upper-first.md +32 -0
  130. package/docs/src/ecosystem/utils/user-visibility.md +69 -0
  131. package/docs/src/guide/getting-started.md +15 -13
  132. package/docs/src/guide/global-defaults.md +102 -0
  133. package/docs/src/guide/maz-ui-provider.md +6 -3
  134. package/docs/src/guide/migration-v4.md +13 -9
  135. package/docs/src/guide/migration-v5.md +211 -15
  136. package/docs/src/guide/resolvers.md +8 -8
  137. package/docs/src/guide/tailwind.md +4 -0
  138. package/docs/src/guide/vue.md +4 -4
  139. package/docs/src/index.md +13 -13
  140. package/docs/src/plugins/aos.md +1 -1
  141. package/package.json +11 -10
  142. package/docs/src/helpers/camel-case.md +0 -14
  143. package/docs/src/helpers/check-availability.md +0 -14
  144. package/docs/src/helpers/debounce-callback.md +0 -14
  145. package/docs/src/helpers/debounce-id.md +0 -14
  146. package/docs/src/helpers/debounce.md +0 -14
  147. package/docs/src/helpers/is-client.md +0 -14
  148. package/docs/src/helpers/is-equal.md +0 -14
  149. package/docs/src/helpers/is-standalone-mode.md +0 -14
  150. package/docs/src/helpers/kebab-case.md +0 -14
  151. package/docs/src/helpers/normalize-string.md +0 -14
  152. package/docs/src/helpers/pascal-case.md +0 -14
  153. package/docs/src/helpers/script-loader.md +0 -14
  154. package/docs/src/helpers/sleep.md +0 -14
  155. package/docs/src/helpers/snake-case.md +0 -14
  156. package/docs/src/helpers/throttle-id.md +0 -14
  157. package/docs/src/helpers/throttle.md +0 -14
  158. /package/docs/src/{guide → ecosystem/icons}/icon-set.md +0 -0
  159. /package/docs/src/{guide → ecosystem}/mcp.md +0 -0
  160. /package/docs/src/{helpers → ecosystem/utils}/country-code-to-unicode-flag.md +0 -0
  161. /package/docs/src/{helpers → ecosystem/utils}/currency.md +0 -0
  162. /package/docs/src/{helpers → ecosystem/utils}/date.md +0 -0
  163. /package/docs/src/{helpers → ecosystem/utils}/get-country-flag-url.md +0 -0
  164. /package/docs/src/{helpers → ecosystem/utils}/number.md +0 -0
@@ -0,0 +1,146 @@
1
+ ---
2
+ title: logger / createLogger
3
+ description: Opinionated [consola](https://github.com/unjs/consola)-backed logger with semantic levels, status helpers (`success`, `ready`, `fail`), and formatting helpers (`box`, `divider`, `brand`).
4
+ ---
5
+
6
+ # {{ $frontmatter.title }}
7
+
8
+ {{ $frontmatter.description }}
9
+
10
+ The default `logger` is a singleton ready to use; `createLogger` builds a fresh instance with its own level and reporters.
11
+
12
+ ## Quick start
13
+
14
+ ```ts
15
+ import { logger } from '@maz-ui/node'
16
+
17
+ logger.info('Build started')
18
+ logger.success('All checks passed')
19
+ logger.warn('Deprecated flag used')
20
+ logger.error('Build failed', errorObject)
21
+ ```
22
+
23
+ ## Default instance
24
+
25
+ ```ts
26
+ import { logger } from '@maz-ui/node'
27
+ ```
28
+
29
+ A pre-configured `Logger` with `level: 'default'` (numeric 3). Suitable for most scripts.
30
+
31
+ ## Custom instances
32
+
33
+ ```ts
34
+ import { createLogger } from '@maz-ui/node'
35
+
36
+ const dev = createLogger({ level: 4 }) // debug
37
+ const ci = createLogger({ level: 2 }) // normal
38
+ const silent = createLogger({ level: Number.NEGATIVE_INFINITY })
39
+ ```
40
+
41
+ ```ts
42
+ function createLogger(options?: LoggerOptions): Logger
43
+
44
+ type LoggerOptions = Partial<ConsolaOptions>
45
+ ```
46
+
47
+ `LoggerOptions` is forwarded directly to [consola's `createConsola()`](https://github.com/unjs/consola#instance-options) — see consola docs for every accepted field (tag, reporters, formatOptions, …).
48
+
49
+ ## API
50
+
51
+ ```ts
52
+ interface Logger {
53
+ // Core
54
+ log(message, ...args): void
55
+ info(message, ...args): void
56
+ warn(message, ...args): void
57
+ error(message, ...args): void
58
+ debug(message, ...args): void
59
+ trace(message, ...args): void
60
+ verbose(message, ...args): void
61
+ silent(message, ...args): void
62
+ fatal(message, ...args): void
63
+
64
+ // Status
65
+ start(message, ...args): void
66
+ ready(message, ...args): void
67
+ success(message, ...args): void
68
+ fail(message, ...args): void
69
+
70
+ // Formatting
71
+ box(message, ...args): void
72
+ brand(message: string): void
73
+ divider(character?: string): void
74
+ eot(): void
75
+ break(count?: number): void
76
+ clear(): void
77
+
78
+ // Reporters
79
+ addReporter(reporter: ConsolaReporter): void
80
+ removeReporter(reporter: ConsolaReporter): void
81
+
82
+ // Level control
83
+ setLevel(level: LogLevel): void
84
+ getLevel(): number
85
+ }
86
+ ```
87
+
88
+ ### Log levels
89
+
90
+ `setLevel()` accepts a semantic name. Anything below the active level is suppressed.
91
+
92
+ | Level | Numeric | Description |
93
+ | ----------- | ----------------- | ---------------------------- |
94
+ | `'silent'` | `-Infinity` | No logs displayed |
95
+ | `'error'` | `0` | Fatal and error only |
96
+ | `'warning'` | `1` | Warnings and above |
97
+ | `'normal'` | `2` | Normal logs and above |
98
+ | `'default'` | `3` (default) | Informational logs |
99
+ | `'debug'` | `4` | Debug logs and above |
100
+ | `'trace'` | `5` | All logs including trace |
101
+ | `'verbose'` | `Infinity` | Maximum verbosity |
102
+
103
+ ```ts
104
+ logger.setLevel('debug')
105
+ logger.debug('Now visible')
106
+
107
+ logger.setLevel('silent')
108
+ logger.error('No longer printed')
109
+ ```
110
+
111
+ ### Formatting helpers
112
+
113
+ | Method | Output |
114
+ | ------------ | ------------------------------------------------------------------- |
115
+ | `box(msg)` | Renders the message inside a bordered box. |
116
+ | `brand(msg)` | Prints in bright blue — used by `printBanner`. |
117
+ | `divider(c)` | Prints a separator line that adapts to the terminal width. |
118
+ | `eot()` | Prints a blank line (end-of-transmission marker). |
119
+ | `break(n)` | Prints `n` blank lines (default: 1). |
120
+
121
+ ## Examples
122
+
123
+ Build script with mixed levels:
124
+
125
+ ```ts
126
+ import { createLogger, execPromise } from '@maz-ui/node'
127
+
128
+ const log = createLogger({ level: 3 })
129
+
130
+ log.box('🚀 Build starting')
131
+ log.divider()
132
+
133
+ await execPromise('npm install', { logger: log, packageName: 'setup' })
134
+ log.ready('Dependencies installed')
135
+
136
+ await execPromise('npm run build', { logger: log, packageName: 'build' })
137
+ log.success('Build complete')
138
+ ```
139
+
140
+ Switch verbosity from an env flag:
141
+
142
+ ```ts
143
+ const log = createLogger({
144
+ level: process.env.CI ? 2 : 4,
145
+ })
146
+ ```
@@ -0,0 +1,93 @@
1
+ ---
2
+ title: printBanner
3
+ description: Print an ASCII-art banner via figlet with optional version, dividers and clearing — handy for CLI entry points.
4
+ ---
5
+
6
+ # {{ $frontmatter.title }}
7
+
8
+ Print an ASCII-art banner (via [figlet](https://github.com/patorjk/figlet.js)) with optional version, dividers and clearing — handy for CLI entry points.
9
+
10
+ ## Usage
11
+
12
+ ```ts
13
+ import { printBanner } from '@maz-ui/node'
14
+
15
+ printBanner({
16
+ name: 'maz-cli',
17
+ version: 'v1.0.0',
18
+ })
19
+ ```
20
+
21
+ Renders:
22
+
23
+ ```text
24
+ ███╗ ███╗ █████╗ ███████╗ ██████╗██╗ ██╗
25
+ ████╗ ████║██╔══██╗╚══███╔╝ ██╔════╝██║ ██║
26
+ ██╔████╔██║███████║ ███╔╝ ██║ ██║ ██║
27
+ ██║╚██╔╝██║██╔══██║ ███╔╝ ██║ ██║ ██║
28
+ ██║ ╚═╝ ██║██║ ██║███████╗ ╚██████╗███████╗██║
29
+ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚═════╝╚══════╝╚═╝
30
+
31
+ v1.0.0
32
+ ```
33
+
34
+ ## API
35
+
36
+ ```ts
37
+ function printBanner(args: {
38
+ name: string
39
+ version?: string
40
+ options?: FigletOptions & {
41
+ clear?: boolean
42
+ divider?: boolean
43
+ breakBefore?: boolean
44
+ breakAfter?: boolean
45
+ }
46
+ }): void
47
+ ```
48
+
49
+ | Parameter | Type | Description |
50
+ | --------- | --------- | -------------------------------------------- |
51
+ | `name` | `string` | Text rendered as ASCII art (required). |
52
+ | `version` | `string` | Optional version line printed under the banner. |
53
+ | `options` | `object` | Figlet options + extras (see below). |
54
+
55
+ ### Options
56
+
57
+ | Option | Type | Default | Description |
58
+ | ------------------ | --------- | -------------- | ------------------------------------------------------------------------ |
59
+ | `clear` | `boolean` | `true` | Clear the terminal screen before printing. |
60
+ | `divider` | `boolean` | `false` | Print a separator line after the banner. |
61
+ | `breakBefore` | `boolean` | `true` | Print a blank line before the banner. |
62
+ | `breakAfter` | `boolean` | `true` | Print a blank line after the banner. |
63
+ | `font` | `string` | `'ANSI Shadow'` | Any [figlet font name](https://github.com/patorjk/figlet.js#fonts). |
64
+ | `horizontalLayout` | `string` | `'full'` | Figlet horizontal layout: `'default'`, `'full'`, `'fitted'`, … |
65
+
66
+ All standard [`figlet` options](https://github.com/patorjk/figlet.js#api) are forwarded.
67
+
68
+ ## Examples
69
+
70
+ Minimal banner:
71
+
72
+ ```ts
73
+ printBanner({ name: 'maz-cli' })
74
+ ```
75
+
76
+ Banner with divider, no screen clearing:
77
+
78
+ ```ts
79
+ printBanner({
80
+ name: 'maz-cli',
81
+ version: 'v1.0.0',
82
+ options: { clear: false, divider: true },
83
+ })
84
+ ```
85
+
86
+ Custom font:
87
+
88
+ ```ts
89
+ printBanner({
90
+ name: 'Hi!',
91
+ options: { font: 'Standard', horizontalLayout: 'fitted' },
92
+ })
93
+ ```
@@ -126,11 +126,13 @@ export default defineNuxtConfig({
126
126
  theme: {
127
127
  preset: 'maz-ui', // 'maz-ui' | 'pristine' | 'ocean' | 'obsidian' | 'nova' | custom object
128
128
  strategy: 'runtime', // 'runtime' | 'buildtime'
129
- darkModeStrategy: 'class', // 'class' | 'media' | 'auto'
129
+ darkModeStrategy: 'class', // 'class' | 'media'
130
+ darkClass: 'dark', // class on <html> when colorMode === 'dark' (default: 'dark')
131
+ lightClass: 'light', // class on <html> when colorMode === 'light' (default: 'light')
130
132
  overrides: {
131
133
  colors: {
132
- light: { primary: '220 100% 50%' },
133
- dark: { primary: '220 100% 70%' }
134
+ light: { primary: 'oklch(0.65 0.19 254)' },
135
+ dark: { primary: 'oklch(0.72 0.18 254)' }
134
136
  }
135
137
  },
136
138
  mode: 'both', // 'light' | 'dark' | 'both'
@@ -150,6 +152,16 @@ export default defineNuxtConfig({
150
152
  autoImport: true, // All components globally available
151
153
  },
152
154
 
155
+ // Global component defaults (priority: instance prop > defaults[Component] > defaults.global > library default)
156
+ defaults: {
157
+ global: { roundedSize: 'lg' }, // cross-cutting (roundedSize, size)
158
+ MazBtn: { roundedSize: 'full' }, // per-component, wins over global
159
+ MazCard: { bordered: false, elevation: true },
160
+ },
161
+
162
+ // Country flags of MazSelectCountry and MazInputPhoneNumber: 'cdn' (default), 'local' (offline) or '/flags/{code}.svg'
163
+ flags: 'local',
164
+
153
165
  // Plugins (not enabled by default)
154
166
  plugins: {
155
167
  aos: true,
@@ -220,16 +232,16 @@ const theme = {
220
232
  overrides: {
221
233
  colors: {
222
234
  light: {
223
- primary: '220 100% 50%',
224
- secondary: '220 14% 96%',
225
- surface: '0 0% 100%',
226
- foreground: '222 84% 5%',
235
+ primary: 'oklch(0.6 0.18 254)',
236
+ secondary: 'oklch(0.96 0.01 254)',
237
+ surface: 'oklch(1 0 0)',
238
+ foreground: 'oklch(0.16 0.02 254)',
227
239
  },
228
240
  dark: {
229
- primary: '220 100% 70%',
230
- secondary: '220 14% 4%',
231
- surface: '222 84% 5%',
232
- foreground: '210 40% 98%',
241
+ primary: 'oklch(0.72 0.18 254)',
242
+ secondary: 'oklch(0.22 0.02 254)',
243
+ surface: 'oklch(0.16 0.02 254)',
244
+ foreground: 'oklch(0.96 0.005 254)',
233
245
  }
234
246
  },
235
247
  // Override other theme properties...
@@ -245,7 +257,14 @@ const theme = {
245
257
  strategy: 'runtime', // 'runtime' (recommended) | 'buildtime'
246
258
 
247
259
  // Dark mode handling
248
- darkModeStrategy: 'class', // 'class' | 'media' | 'auto'
260
+ darkModeStrategy: 'class', // 'class' | 'media'
261
+
262
+ // Class added to <html> when colorMode === 'dark' (default: 'dark')
263
+ darkClass: 'dark',
264
+
265
+ // Class added to <html> when colorMode === 'light' (default: 'light')
266
+ // Mirror of darkClass — used to force `color-scheme: only light`.
267
+ lightClass: 'light',
249
268
 
250
269
  // Persist the active preset name in the `maz-preset` cookie so the
251
270
  // user's last-used theme is restored on reload. Default: true.
@@ -253,6 +272,43 @@ const theme = {
253
272
  }
254
273
  ```
255
274
 
275
+ ### Global Component Defaults
276
+
277
+ Set default prop values once for every component. Resolution priority, per prop: instance prop > `defaults[Component]` > `defaults.global` > library default. A global default never overrides a prop set on the instance.
278
+
279
+ ```ts
280
+ const defaults = {
281
+ // Cross-cutting tokens applied to every component that exposes them
282
+ global: {
283
+ roundedSize: 'lg', // 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full'
284
+ size: 'sm', // 'mini' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'
285
+ },
286
+ // Per-component defaults, strongly typed as Partial<ComponentNameProps>, win over `global`
287
+ MazBtn: { roundedSize: 'full' },
288
+ MazCard: { bordered: false, elevation: true },
289
+ MazContainer: { bordered: false },
290
+ }
291
+ ```
292
+
293
+ See the [Global component defaults guide](/guide/global-defaults) for the full list of globalizable props.
294
+
295
+ ### Country Flags
296
+
297
+ Source of the flags of `MazSelectCountry` and `MazInputPhoneNumber`. A `flag-src` set on a component wins.
298
+
299
+ ```ts
300
+ export default defineNuxtConfig({
301
+ mazUi: {
302
+ // 'cdn' (default): flagcdn.com
303
+ // 'local': flags of @maz-ui/icons, one chunk per flag loaded when visible, no request to a third party
304
+ // '/flags/{code}.svg': your own files ({CODE} for uppercase codes)
305
+ flags: 'local',
306
+ },
307
+ })
308
+ ```
309
+
310
+ Nothing is added to your build unless `flags` is `'local'`. See [MazSelectCountry](/components/maz-select-country#flags-source) for the details (Content Security Policy, PWA precache).
311
+
256
312
  ## Theme Strategies Explained
257
313
 
258
314
  ### Runtime (Recommended)
@@ -329,6 +385,7 @@ const composables = {
329
385
  useReadingTime: true, // Reading time calculation
330
386
  useDisplayNames: true, // Display localized names
331
387
  useSwipe: true, // Swipe gestures
388
+ usePullToRefresh: true, // Pull to refresh gesture
332
389
 
333
390
  // 🔧 Advanced
334
391
  useFreezeValue: true, // Freeze reactive values
@@ -379,41 +436,39 @@ import { definePreset } from '@maz-ui/themes'
379
436
 
380
437
  export const customTheme = definePreset({
381
438
  base: 'maz-ui',
382
- name: 'custom',
383
- foundation: {
384
- 'base-font-size': '14px',
385
- 'font-family': `Manrope, sans-serif, system-ui, -apple-system`,
386
- 'space': '0.25rem',
387
- 'border-width': '0.0625rem',
388
- },
389
- scales: {
390
- rounded: { md: '0.7rem' },
391
- },
392
- colors: {
393
- light: {
394
- primary: '350 100% 50%', // Custom pink
395
- secondary: '350 14% 96%',
396
- surface: '0 0% 100%',
397
- foreground: '222 84% 5%',
398
- muted: '210 40% 96%',
399
- accent: '210 40% 90%',
400
- destructive: '0 84% 60%',
401
- border: '214 32% 91%',
402
- input: '214 32% 91%',
403
- ring: '350 100% 50%',
439
+ overrides: {
440
+ name: 'custom',
441
+ foundation: {
442
+ 'base-font-size': '14px',
443
+ 'font-family': `Manrope, sans-serif, system-ui, -apple-system`,
444
+ 'space': '0.25rem',
445
+ 'border-width': '0.0625rem',
446
+ },
447
+ scales: {
448
+ rounded: { md: '0.7rem' },
449
+ },
450
+ colors: {
451
+ light: {
452
+ primary: 'oklch(0.65 0.27 5)', // Custom pink
453
+ secondary: 'oklch(0.96 0.01 5)',
454
+ surface: 'oklch(1 0 0)',
455
+ foreground: 'oklch(0.16 0.02 254)',
456
+ muted: 'oklch(0.6 0.01 254)',
457
+ accent: 'oklch(0.7 0.05 5)',
458
+ destructive: 'oklch(0.6 0.22 27)',
459
+ divider: 'oklch(0.92 0.005 254)',
460
+ },
461
+ dark: {
462
+ primary: 'oklch(0.75 0.22 5)',
463
+ secondary: 'oklch(0.24 0.02 5)',
464
+ surface: 'oklch(0.16 0.02 254)',
465
+ foreground: 'oklch(0.96 0.005 254)',
466
+ muted: 'oklch(0.6 0.01 254)',
467
+ accent: 'oklch(0.3 0.04 5)',
468
+ destructive: 'oklch(0.55 0.2 27)',
469
+ divider: 'oklch(0.3 0.01 254)',
470
+ }
404
471
  },
405
- dark: {
406
- primary: '350 100% 70%',
407
- secondary: '350 14% 4%',
408
- surface: '222 84% 5%',
409
- foreground: '210 40% 98%',
410
- muted: '217 33% 17%',
411
- accent: '217 33% 17%',
412
- destructive: '0 62% 30%',
413
- border: '217 33% 17%',
414
- input: '217 33% 17%',
415
- ring: '350 100% 70%',
416
- }
417
472
  },
418
473
  })
419
474
 
@@ -429,7 +484,7 @@ export default defineNuxtConfig({
429
484
  ```
430
485
 
431
486
  ::: tip Subtree Overrides with MazUiProvider
432
- You can use [`MazUiProvider`](./maz-ui-provider.md) within a Nuxt app to override theme or translations in a specific subtree, while the module handles global defaults.
487
+ You can use [`MazUiProvider`](../guide/maz-ui-provider.md) within a Nuxt app to override theme or translations in a specific subtree, while the module handles global defaults.
433
488
  :::
434
489
 
435
490
  ## Troubleshooting