@maz-ui/mcp 5.0.0-canary.ef64a02.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/mcp.d.mts +22 -9
- package/dist/mcp.d.ts +22 -9
- package/dist/mcp.mjs +160 -83
- package/docs/generated-docs/maz-avatar.doc.md +30 -30
- package/docs/generated-docs/maz-bottom-sheet.doc.md +16 -13
- package/docs/generated-docs/maz-btn.doc.md +21 -19
- package/docs/generated-docs/maz-checkbox.doc.md +16 -17
- package/docs/generated-docs/maz-circular-progress-bar.doc.md +1 -1
- package/docs/generated-docs/maz-code-highlight.doc.md +11 -0
- package/docs/generated-docs/maz-container.doc.md +1 -0
- package/docs/generated-docs/maz-date-picker.doc.md +41 -41
- package/docs/generated-docs/maz-drawer.doc.md +7 -8
- package/docs/generated-docs/maz-dropdown.doc.md +3 -0
- package/docs/generated-docs/maz-expand-animation.doc.md +4 -4
- package/docs/generated-docs/maz-fullscreen-loader.doc.md +5 -5
- package/docs/generated-docs/maz-gallery.doc.md +15 -15
- package/docs/generated-docs/maz-input-code.doc.md +16 -16
- package/docs/generated-docs/maz-input-phone-number.doc.md +43 -38
- package/docs/generated-docs/maz-input-price.doc.md +14 -14
- package/docs/generated-docs/maz-input-tags.doc.md +16 -16
- package/docs/generated-docs/maz-input.doc.md +33 -33
- package/docs/generated-docs/maz-lazy-img.doc.md +14 -14
- package/docs/generated-docs/maz-loading-bar.doc.md +4 -4
- package/docs/generated-docs/maz-markdown-editor.doc.md +65 -0
- package/docs/generated-docs/maz-popover.doc.md +1 -1
- package/docs/generated-docs/maz-pull-to-refresh.doc.md +39 -20
- package/docs/generated-docs/maz-radio-buttons.doc.md +17 -17
- package/docs/generated-docs/maz-radio.doc.md +16 -16
- package/docs/generated-docs/maz-reading-progress-bar.doc.md +4 -4
- package/docs/generated-docs/maz-select-country.doc.md +27 -26
- package/docs/generated-docs/maz-sidebar-content.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-footer.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-group.doc.md +11 -0
- package/docs/generated-docs/maz-sidebar-header.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-menu-button.doc.md +27 -0
- package/docs/generated-docs/maz-sidebar-menu-item.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-menu-sub.doc.md +16 -0
- package/docs/generated-docs/maz-sidebar-menu.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-separator.doc.md +0 -0
- package/docs/generated-docs/maz-sidebar-trigger.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar.doc.md +36 -0
- package/docs/generated-docs/maz-slider.doc.md +1 -1
- package/docs/generated-docs/maz-spinner.doc.md +4 -4
- package/docs/generated-docs/maz-switch.doc.md +14 -14
- package/docs/generated-docs/maz-table-virtualizer.doc.md +20 -0
- package/docs/generated-docs/maz-table.doc.md +43 -37
- package/docs/generated-docs/maz-tabs-bar.doc.md +20 -9
- package/docs/generated-docs/maz-tabs.doc.md +6 -3
- package/docs/generated-docs/maz-textarea.doc.md +27 -24
- package/docs/generated-docs/maz-ticker.doc.md +1 -1
- package/docs/generated-docs/maz-timeline.doc.md +4 -4
- package/docs/generated-docs/maz-window-mockup.doc.md +23 -0
- package/docs/src/blog/v4.md +1 -1
- package/docs/src/blog/v5.md +5 -7
- package/docs/src/components/maz-avatar.md +52 -4
- package/docs/src/components/maz-badge.md +4 -4
- package/docs/src/components/maz-bottom-sheet.md +304 -169
- package/docs/src/components/maz-btn.md +3 -3
- package/docs/src/components/maz-chart.md +8 -0
- package/docs/src/components/maz-checklist.md +10 -10
- package/docs/src/components/maz-code-highlight.md +233 -0
- package/docs/src/components/maz-container.md +2 -2
- package/docs/src/components/maz-date-picker.md +62 -1
- package/docs/src/components/maz-dialog.md +52 -0
- package/docs/src/components/maz-drawer.md +4 -0
- package/docs/src/components/maz-dropdown.md +36 -16
- package/docs/src/components/maz-icon.md +16 -5
- package/docs/src/components/maz-input-phone-number.md +136 -103
- package/docs/src/components/maz-input.md +4 -0
- package/docs/src/components/maz-lazy-img.md +64 -0
- package/docs/src/components/maz-markdown-editor.md +373 -0
- package/docs/src/components/maz-popover.md +2 -1
- package/docs/src/components/maz-pull-to-refresh.md +176 -17
- package/docs/src/components/maz-radio-buttons.md +6 -0
- package/docs/src/components/maz-select-country.md +138 -1
- package/docs/src/components/maz-select.md +9 -0
- package/docs/src/components/maz-sidebar.md +719 -0
- package/docs/src/components/maz-slider.md +6 -0
- package/docs/src/components/maz-stepper.md +4 -0
- package/docs/src/components/maz-table.md +162 -1
- package/docs/src/components/maz-tabs.md +117 -3
- package/docs/src/components/maz-textarea.md +85 -1
- package/docs/src/components/maz-timeline.md +60 -0
- package/docs/src/components/maz-window-mockup.md +249 -0
- package/docs/src/composables/use-drag.md +239 -0
- package/docs/src/composables/use-form-validator.md +297 -16
- package/docs/src/composables/use-pull-to-refresh.md +79 -0
- package/docs/src/composables/use-swipe.md +26 -11
- package/docs/src/directives/click-outside.md +8 -15
- package/docs/src/directives/fullscreen-img.md +1 -1
- package/docs/src/directives/lazy-img.md +44 -11
- package/docs/src/directives/tooltip.md +24 -1
- package/docs/src/directives/zoom-img.md +1 -1
- package/docs/src/ecosystem/eslint-config.md +189 -8
- package/docs/src/{guide/icons.md → ecosystem/icons/index.md} +1 -1
- package/docs/src/ecosystem/node/exec-promise.md +87 -0
- package/docs/src/ecosystem/node/index.md +53 -0
- package/docs/src/ecosystem/node/logger.md +146 -0
- package/docs/src/ecosystem/node/print-banner.md +93 -0
- package/docs/src/{guide → ecosystem}/nuxt.md +107 -47
- package/docs/src/ecosystem/stylelint-config.md +122 -10
- package/docs/src/{guide → ecosystem}/themes.md +152 -71
- package/docs/src/{guide → ecosystem}/translations.md +1 -1
- package/docs/src/ecosystem/utils/camel-case.md +31 -0
- package/docs/src/{helpers → ecosystem/utils}/capitalize.md +2 -3
- package/docs/src/ecosystem/utils/check-availability.md +79 -0
- package/docs/src/ecosystem/utils/cookie.md +80 -0
- package/docs/src/ecosystem/utils/debounce-callback.md +38 -0
- package/docs/src/ecosystem/utils/debounce-id.md +69 -0
- package/docs/src/ecosystem/utils/debounce.md +65 -0
- package/docs/src/ecosystem/utils/fetch-locale-ip.md +33 -0
- package/docs/src/ecosystem/utils/format-json.md +33 -0
- package/docs/src/ecosystem/utils/format-phone-number.md +37 -0
- package/docs/src/ecosystem/utils/get-browser-locale.md +29 -0
- package/docs/src/ecosystem/utils/get-error-message.md +39 -0
- package/docs/src/ecosystem/utils/idle-timeout.md +90 -0
- package/docs/src/ecosystem/utils/index.md +60 -0
- package/docs/src/ecosystem/utils/is-client.md +32 -0
- package/docs/src/ecosystem/utils/is-equal.md +38 -0
- package/docs/src/ecosystem/utils/is-ios.md +37 -0
- package/docs/src/ecosystem/utils/is-server.md +31 -0
- package/docs/src/ecosystem/utils/is-standalone-mode.md +43 -0
- package/docs/src/ecosystem/utils/kebab-case.md +36 -0
- package/docs/src/ecosystem/utils/normalize-string.md +77 -0
- package/docs/src/ecosystem/utils/pascal-case.md +35 -0
- package/docs/src/ecosystem/utils/prevent-ios-input-zoom.md +66 -0
- package/docs/src/ecosystem/utils/script-loader.md +77 -0
- package/docs/src/ecosystem/utils/sleep.md +59 -0
- package/docs/src/ecosystem/utils/snake-case.md +36 -0
- package/docs/src/ecosystem/utils/swipe-handler.md +91 -0
- package/docs/src/ecosystem/utils/textarea-autogrow.md +41 -0
- package/docs/src/ecosystem/utils/throttle-id.md +48 -0
- package/docs/src/ecosystem/utils/throttle.md +57 -0
- package/docs/src/ecosystem/utils/truthy-filter.md +31 -0
- package/docs/src/ecosystem/utils/types/deep-key-of.md +48 -0
- package/docs/src/ecosystem/utils/types/deep-partial.md +42 -0
- package/docs/src/ecosystem/utils/types/deep-required.md +39 -0
- package/docs/src/ecosystem/utils/types/flatten-object-keys.md +44 -0
- package/docs/src/ecosystem/utils/types/generic-instance-type.md +42 -0
- package/docs/src/ecosystem/utils/types/infer-maybe-ref.md +35 -0
- package/docs/src/ecosystem/utils/upper-first.md +32 -0
- package/docs/src/ecosystem/utils/user-visibility.md +69 -0
- package/docs/src/guide/getting-started.md +15 -13
- package/docs/src/guide/global-defaults.md +102 -0
- package/docs/src/guide/maz-ui-provider.md +6 -3
- package/docs/src/guide/migration-v4.md +13 -9
- package/docs/src/guide/migration-v5.md +222 -20
- package/docs/src/guide/resolvers.md +8 -8
- package/docs/src/guide/tailwind.md +4 -0
- package/docs/src/guide/vue.md +4 -4
- package/docs/src/index.md +13 -13
- package/docs/src/plugins/aos.md +1 -1
- package/package.json +15 -11
- package/docs/src/helpers/camel-case.md +0 -14
- package/docs/src/helpers/check-availability.md +0 -14
- package/docs/src/helpers/debounce-callback.md +0 -14
- package/docs/src/helpers/debounce-id.md +0 -14
- package/docs/src/helpers/debounce.md +0 -14
- package/docs/src/helpers/is-client.md +0 -14
- package/docs/src/helpers/is-equal.md +0 -14
- package/docs/src/helpers/is-standalone-mode.md +0 -14
- package/docs/src/helpers/kebab-case.md +0 -14
- package/docs/src/helpers/normalize-string.md +0 -14
- package/docs/src/helpers/pascal-case.md +0 -14
- package/docs/src/helpers/script-loader.md +0 -14
- package/docs/src/helpers/sleep.md +0 -14
- package/docs/src/helpers/snake-case.md +0 -14
- package/docs/src/helpers/throttle-id.md +0 -14
- package/docs/src/helpers/throttle.md +0 -14
- /package/docs/src/{guide → ecosystem/icons}/icon-set.md +0 -0
- /package/docs/src/{guide → ecosystem}/mcp.md +0 -0
- /package/docs/src/{helpers → ecosystem/utils}/country-code-to-unicode-flag.md +0 -0
- /package/docs/src/{helpers → ecosystem/utils}/currency.md +0 -0
- /package/docs/src/{helpers → ecosystem/utils}/date.md +0 -0
- /package/docs/src/{helpers → ecosystem/utils}/get-country-flag-url.md +0 -0
- /package/docs/src/{helpers → ecosystem/utils}/number.md +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '@maz-ui/node'
|
|
3
|
+
description: Lightweight Node.js utilities — promise-based shell execution, an opinionated consola-backed logger, and a banner printer for CLIs.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# {{ $frontmatter.title }}
|
|
7
|
+
|
|
8
|
+
{{ $frontmatter.description }}
|
|
9
|
+
|
|
10
|
+
<NpmBadge package="@maz-ui/node" />
|
|
11
|
+
|
|
12
|
+
`@maz-ui/node` powers the CLIs and build scripts inside the maz-ui ecosystem. It's intentionally tiny: an `exec` wrapper that returns a real `Promise`, a colourful logger built on [consola](https://github.com/unjs/consola), and a banner helper using [figlet](https://github.com/patorjk/figlet.js).
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
::: code-group
|
|
17
|
+
|
|
18
|
+
```bash [pnpm]
|
|
19
|
+
pnpm add @maz-ui/node
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```bash [npm]
|
|
23
|
+
npm install @maz-ui/node
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```bash [yarn]
|
|
27
|
+
yarn add @maz-ui/node
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
:::
|
|
31
|
+
|
|
32
|
+
## Basic usage
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import { execPromise, logger, printBanner } from '@maz-ui/node'
|
|
36
|
+
|
|
37
|
+
printBanner({ name: 'my-cli', version: '1.0.0' })
|
|
38
|
+
|
|
39
|
+
logger.info('Running tests…')
|
|
40
|
+
await execPromise('npm test', { packageName: 'tests' })
|
|
41
|
+
logger.success('Done')
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## What's inside
|
|
45
|
+
|
|
46
|
+
- [`execPromise`](./exec-promise) — Promise-based `child_process.exec` with structured logging.
|
|
47
|
+
- [`logger` / `createLogger`](./logger) — consola-backed logger with semantic log levels and helpers (`box`, `divider`, `brand`, …).
|
|
48
|
+
- [`printBanner`](./print-banner) — ASCII-art banner printer (figlet) with versioning, dividers and clearing.
|
|
49
|
+
|
|
50
|
+
## Requirements
|
|
51
|
+
|
|
52
|
+
- Node.js >= 22.12.0
|
|
53
|
+
- ESM only — published as `"type": "module"`.
|
|
@@ -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
|
+
```
|
|
@@ -115,6 +115,7 @@ export default defineNuxtConfig({
|
|
|
115
115
|
autoImportPrefix: 'Maz', // useMazToast instead of useToast
|
|
116
116
|
defaultMazIconPath: '/icons', // Default path for <MazIcon />
|
|
117
117
|
devtools: true, // Enable DevTools integration
|
|
118
|
+
preventIosInputZoom: true, // No zoom on focused fields on iOS
|
|
118
119
|
},
|
|
119
120
|
|
|
120
121
|
// CSS & Styling
|
|
@@ -126,11 +127,13 @@ export default defineNuxtConfig({
|
|
|
126
127
|
theme: {
|
|
127
128
|
preset: 'maz-ui', // 'maz-ui' | 'pristine' | 'ocean' | 'obsidian' | 'nova' | custom object
|
|
128
129
|
strategy: 'runtime', // 'runtime' | 'buildtime'
|
|
129
|
-
darkModeStrategy: 'class', // 'class' | 'media'
|
|
130
|
+
darkModeStrategy: 'class', // 'class' | 'media'
|
|
131
|
+
darkClass: 'dark', // class on <html> when colorMode === 'dark' (default: 'dark')
|
|
132
|
+
lightClass: 'light', // class on <html> when colorMode === 'light' (default: 'light')
|
|
130
133
|
overrides: {
|
|
131
134
|
colors: {
|
|
132
|
-
light: { primary: '
|
|
133
|
-
dark: { primary: '
|
|
135
|
+
light: { primary: 'oklch(0.65 0.19 254)' },
|
|
136
|
+
dark: { primary: 'oklch(0.72 0.18 254)' }
|
|
134
137
|
}
|
|
135
138
|
},
|
|
136
139
|
mode: 'both', // 'light' | 'dark' | 'both'
|
|
@@ -150,6 +153,16 @@ export default defineNuxtConfig({
|
|
|
150
153
|
autoImport: true, // All components globally available
|
|
151
154
|
},
|
|
152
155
|
|
|
156
|
+
// Global component defaults (priority: instance prop > defaults[Component] > defaults.global > library default)
|
|
157
|
+
defaults: {
|
|
158
|
+
global: { roundedSize: 'lg' }, // cross-cutting (roundedSize, size)
|
|
159
|
+
MazBtn: { roundedSize: 'full' }, // per-component, wins over global
|
|
160
|
+
MazCard: { bordered: false, elevation: true },
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
// Country flags of MazSelectCountry and MazInputPhoneNumber: 'cdn' (default), 'local' (offline) or '/flags/{code}.svg'
|
|
164
|
+
flags: 'local',
|
|
165
|
+
|
|
153
166
|
// Plugins (not enabled by default)
|
|
154
167
|
plugins: {
|
|
155
168
|
aos: true,
|
|
@@ -195,6 +208,10 @@ const general = {
|
|
|
195
208
|
|
|
196
209
|
// Enable Nuxt DevTools integration
|
|
197
210
|
devtools: true,
|
|
211
|
+
|
|
212
|
+
// Stop iOS from zooming the page when a form field gets the focus (default: false)
|
|
213
|
+
// Adds `maximum-scale=1` to the viewport on iOS only, see the preventIosInputZoom helper of @maz-ui/utils
|
|
214
|
+
preventIosInputZoom: false,
|
|
198
215
|
}
|
|
199
216
|
```
|
|
200
217
|
|
|
@@ -220,16 +237,16 @@ const theme = {
|
|
|
220
237
|
overrides: {
|
|
221
238
|
colors: {
|
|
222
239
|
light: {
|
|
223
|
-
primary: '
|
|
224
|
-
secondary: '
|
|
225
|
-
surface: '0 0
|
|
226
|
-
foreground: '
|
|
240
|
+
primary: 'oklch(0.6 0.18 254)',
|
|
241
|
+
secondary: 'oklch(0.96 0.01 254)',
|
|
242
|
+
surface: 'oklch(1 0 0)',
|
|
243
|
+
foreground: 'oklch(0.16 0.02 254)',
|
|
227
244
|
},
|
|
228
245
|
dark: {
|
|
229
|
-
primary: '
|
|
230
|
-
secondary: '
|
|
231
|
-
surface: '
|
|
232
|
-
foreground: '
|
|
246
|
+
primary: 'oklch(0.72 0.18 254)',
|
|
247
|
+
secondary: 'oklch(0.22 0.02 254)',
|
|
248
|
+
surface: 'oklch(0.16 0.02 254)',
|
|
249
|
+
foreground: 'oklch(0.96 0.005 254)',
|
|
233
250
|
}
|
|
234
251
|
},
|
|
235
252
|
// Override other theme properties...
|
|
@@ -245,7 +262,14 @@ const theme = {
|
|
|
245
262
|
strategy: 'runtime', // 'runtime' (recommended) | 'buildtime'
|
|
246
263
|
|
|
247
264
|
// Dark mode handling
|
|
248
|
-
darkModeStrategy: 'class', // 'class' | 'media'
|
|
265
|
+
darkModeStrategy: 'class', // 'class' | 'media'
|
|
266
|
+
|
|
267
|
+
// Class added to <html> when colorMode === 'dark' (default: 'dark')
|
|
268
|
+
darkClass: 'dark',
|
|
269
|
+
|
|
270
|
+
// Class added to <html> when colorMode === 'light' (default: 'light')
|
|
271
|
+
// Mirror of darkClass — used to force `color-scheme: only light`.
|
|
272
|
+
lightClass: 'light',
|
|
249
273
|
|
|
250
274
|
// Persist the active preset name in the `maz-preset` cookie so the
|
|
251
275
|
// user's last-used theme is restored on reload. Default: true.
|
|
@@ -253,6 +277,43 @@ const theme = {
|
|
|
253
277
|
}
|
|
254
278
|
```
|
|
255
279
|
|
|
280
|
+
### Global Component Defaults
|
|
281
|
+
|
|
282
|
+
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.
|
|
283
|
+
|
|
284
|
+
```ts
|
|
285
|
+
const defaults = {
|
|
286
|
+
// Cross-cutting tokens applied to every component that exposes them
|
|
287
|
+
global: {
|
|
288
|
+
roundedSize: 'lg', // 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full'
|
|
289
|
+
size: 'sm', // 'mini' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
290
|
+
},
|
|
291
|
+
// Per-component defaults, strongly typed as Partial<ComponentNameProps>, win over `global`
|
|
292
|
+
MazBtn: { roundedSize: 'full' },
|
|
293
|
+
MazCard: { bordered: false, elevation: true },
|
|
294
|
+
MazContainer: { bordered: false },
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
See the [Global component defaults guide](/guide/global-defaults) for the full list of globalizable props.
|
|
299
|
+
|
|
300
|
+
### Country Flags
|
|
301
|
+
|
|
302
|
+
Source of the flags of `MazSelectCountry` and `MazInputPhoneNumber`. A `flag-src` set on a component wins.
|
|
303
|
+
|
|
304
|
+
```ts
|
|
305
|
+
export default defineNuxtConfig({
|
|
306
|
+
mazUi: {
|
|
307
|
+
// 'cdn' (default): flagcdn.com
|
|
308
|
+
// 'local': flags of @maz-ui/icons, one chunk per flag loaded when visible, no request to a third party
|
|
309
|
+
// '/flags/{code}.svg': your own files ({CODE} for uppercase codes)
|
|
310
|
+
flags: 'local',
|
|
311
|
+
},
|
|
312
|
+
})
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
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).
|
|
316
|
+
|
|
256
317
|
## Theme Strategies Explained
|
|
257
318
|
|
|
258
319
|
### Runtime (Recommended)
|
|
@@ -329,6 +390,7 @@ const composables = {
|
|
|
329
390
|
useReadingTime: true, // Reading time calculation
|
|
330
391
|
useDisplayNames: true, // Display localized names
|
|
331
392
|
useSwipe: true, // Swipe gestures
|
|
393
|
+
usePullToRefresh: true, // Pull to refresh gesture
|
|
332
394
|
|
|
333
395
|
// 🔧 Advanced
|
|
334
396
|
useFreezeValue: true, // Freeze reactive values
|
|
@@ -379,41 +441,39 @@ import { definePreset } from '@maz-ui/themes'
|
|
|
379
441
|
|
|
380
442
|
export const customTheme = definePreset({
|
|
381
443
|
base: 'maz-ui',
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
444
|
+
overrides: {
|
|
445
|
+
name: 'custom',
|
|
446
|
+
foundation: {
|
|
447
|
+
'base-font-size': '14px',
|
|
448
|
+
'font-family': `Manrope, sans-serif, system-ui, -apple-system`,
|
|
449
|
+
'space': '0.25rem',
|
|
450
|
+
'border-width': '0.0625rem',
|
|
451
|
+
},
|
|
452
|
+
scales: {
|
|
453
|
+
rounded: { md: '0.7rem' },
|
|
454
|
+
},
|
|
455
|
+
colors: {
|
|
456
|
+
light: {
|
|
457
|
+
primary: 'oklch(0.65 0.27 5)', // Custom pink
|
|
458
|
+
secondary: 'oklch(0.96 0.01 5)',
|
|
459
|
+
surface: 'oklch(1 0 0)',
|
|
460
|
+
foreground: 'oklch(0.16 0.02 254)',
|
|
461
|
+
muted: 'oklch(0.6 0.01 254)',
|
|
462
|
+
accent: 'oklch(0.7 0.05 5)',
|
|
463
|
+
destructive: 'oklch(0.6 0.22 27)',
|
|
464
|
+
divider: 'oklch(0.92 0.005 254)',
|
|
465
|
+
},
|
|
466
|
+
dark: {
|
|
467
|
+
primary: 'oklch(0.75 0.22 5)',
|
|
468
|
+
secondary: 'oklch(0.24 0.02 5)',
|
|
469
|
+
surface: 'oklch(0.16 0.02 254)',
|
|
470
|
+
foreground: 'oklch(0.96 0.005 254)',
|
|
471
|
+
muted: 'oklch(0.6 0.01 254)',
|
|
472
|
+
accent: 'oklch(0.3 0.04 5)',
|
|
473
|
+
destructive: 'oklch(0.55 0.2 27)',
|
|
474
|
+
divider: 'oklch(0.3 0.01 254)',
|
|
475
|
+
}
|
|
404
476
|
},
|
|
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
477
|
},
|
|
418
478
|
})
|
|
419
479
|
|
|
@@ -429,7 +489,7 @@ export default defineNuxtConfig({
|
|
|
429
489
|
```
|
|
430
490
|
|
|
431
491
|
::: tip Subtree Overrides with MazUiProvider
|
|
432
|
-
You can use [`MazUiProvider`](
|
|
492
|
+
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
493
|
:::
|
|
434
494
|
|
|
435
495
|
## Troubleshooting
|