@maz-ui/mcp 5.0.0-beta.31 → 5.0.0-beta.33
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/dist/mcp.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
|
7
7
|
import { resolve, join, dirname } from 'node:path';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
9
|
|
|
10
|
-
const version = "5.0.0-beta.
|
|
10
|
+
const version = "5.0.0-beta.33";
|
|
11
11
|
|
|
12
12
|
class MetadataExtractor {
|
|
13
13
|
extract(name, type, content, manualTags = []) {
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
## Props
|
|
2
2
|
|
|
3
|
-
| Name
|
|
4
|
-
|
|
|
5
|
-
| **items**
|
|
6
|
-
| **
|
|
7
|
-
| **
|
|
8
|
-
| **
|
|
9
|
-
| **
|
|
10
|
-
| **
|
|
11
|
-
| **
|
|
3
|
+
| Name | Description | Type | Required | Default | Possible values |
|
|
4
|
+
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | -------- | ----------- | --------------------------------------------------------------------------------------------------------- |
|
|
5
|
+
| **items** | The items to display in the tabs bar | `TSTypeOperator` | Yes | `undefined` | - |
|
|
6
|
+
| **model-value** | `v-model` <br/>Selected tab (standalone usage, without MazTabs). Holds the item `value` when provided, otherwise the 1-based index. Pass items `as const` (or with literal `value`) to infer a union type. | `MazTabsBarItemValue` | No | `undefined` | - |
|
|
7
|
+
| **size** | Size of the tabs (forwarded to each MazBtn) | `MazSize` | No | `md` | `'xl' \| 'lg' \| 'md' \| 'sm' \| 'xs' \| 'mini'` |
|
|
8
|
+
| **rounded-size** | Size of the rounded applied to the bar, the indicator and each tab | `MazRoundedSize` | No | `md` | `'none' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` |
|
|
9
|
+
| **color** | Color of the active tab indicator. When omitted, the default neutral indicator is used. | `MazColor` | No | `undefined` | `'primary' \| 'secondary' \| 'accent' \| 'info' \| 'success' \| 'warning' \| 'destructive' \| 'contrast'` |
|
|
10
|
+
| **standalone** | Force the standalone mode: the tabs bar ignores any surrounding `MazTabs` (selection, size, rounded-size and color are no longer inherited) and is driven only by its own `v-model`. Useful for a nested switcher inside a page already wrapped by `MazTabs`. | `boolean` | No | `false` | - |
|
|
11
|
+
| **persistent** | Will add a query param to the url to keep the selected tab on page refresh | `boolean` | No | `false` | - |
|
|
12
|
+
| **query-param** | The name of the query param to add to the url | `string` | No | `tab` | - |
|
|
13
|
+
| **block** | Will make the tabs bar full width | `boolean` | No | `false` | - |
|
|
14
|
+
| **elevation** | Will remove the elevation | `boolean` | No | `false` | - |
|
|
15
|
+
| **auto-scroll** | Will add a scroll on the tabs bar to show selected element | `boolean` | No | `true` | - |
|
|
16
|
+
| **bordered** | Will add a border to the tabs bar | `boolean` | No | `true` | - |
|
|
17
|
+
|
|
18
|
+
## Events
|
|
19
|
+
|
|
20
|
+
| Event name | Properties | Description |
|
|
21
|
+
| ------------------ | --------------------------------------------------------------------------------------- | --------------------------------------------------------- |
|
|
22
|
+
| update:model-value | **value** `MazTabsBarItemValue` - item value when provided, otherwise the 1-based index | Emitted when the selected tab changes (standalone usage). |
|
|
12
23
|
|
|
13
24
|
## Slots
|
|
14
25
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
## Props
|
|
2
2
|
|
|
3
|
-
| Name
|
|
4
|
-
|
|
|
5
|
-
| **model-value**
|
|
3
|
+
| Name | Description | Type | Required | Possible values |
|
|
4
|
+
| ---------------- | --------------------------------------------------------------- | ---------------- | -------- | --------------------------------------------------------------------------------------------------------- |
|
|
5
|
+
| **model-value** | The the selected tab number | `number` | No | - |
|
|
6
|
+
| **size** | Size of the tabs, forwarded to MazTabsBar (and each tab button) | `MazSize` | No | `'xl' \| 'lg' \| 'md' \| 'sm' \| 'xs' \| 'mini'` |
|
|
7
|
+
| **rounded-size** | Size of the rounded, forwarded to MazTabsBar | `MazRoundedSize` | No | `'none' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` |
|
|
8
|
+
| **color** | Color of the active tab indicator, forwarded to MazTabsBar | `MazColor` | No | `'primary' \| 'secondary' \| 'accent' \| 'info' \| 'success' \| 'warning' \| 'destructive' \| 'contrast'` |
|
|
6
9
|
|
|
7
10
|
## Events
|
|
8
11
|
|
|
@@ -182,17 +182,124 @@ You can choose the name of this query parameter with the props `query-param` `@d
|
|
|
182
182
|
]
|
|
183
183
|
|
|
184
184
|
const tabs2: MazTabsBarItem[] = ['First Tab', 'Second Tab', 'Third Tab', 'Fourth Tab', 'Fifth Tab', 'Sixth Tab', 'Seventh Tab', 'Eighth Tab', 'Ninth Tab', 'Tenth Tab']
|
|
185
|
+
|
|
186
|
+
const standaloneModel = ref('weekly')
|
|
187
|
+
|
|
188
|
+
const standaloneItems = [
|
|
189
|
+
{ label: 'Daily', value: 'daily' },
|
|
190
|
+
{ label: 'Weekly', value: 'weekly' },
|
|
191
|
+
{ label: 'Monthly', value: 'monthly' },
|
|
192
|
+
]
|
|
185
193
|
</script>
|
|
186
194
|
|
|
195
|
+
## Size and rounded size
|
|
196
|
+
|
|
197
|
+
Each tab is rendered with a [`MazBtn`](./maz-btn.md), so you can control its `size` (`MazSize`) and `rounded-size` (`MazRoundedSize`, applied to the bar, the indicator and each tab).
|
|
198
|
+
|
|
199
|
+
These props can be set on `MazTabsBar` directly, or on `MazTabs` which forwards them to its `MazTabsBar`. They are also globalizable through the [global defaults](./../guide/global-defaults.md) (`MazTabsBar` or `global` entry).
|
|
200
|
+
|
|
201
|
+
<MazTabs size="sm" rounded-size="lg">
|
|
202
|
+
<MazTabsBar :items="tabs2" />
|
|
203
|
+
</MazTabs>
|
|
204
|
+
|
|
205
|
+
```vue
|
|
206
|
+
<template>
|
|
207
|
+
<!-- size & rounded-size forwarded from MazTabs to MazTabsBar -->
|
|
208
|
+
<MazTabs size="sm" rounded-size="lg">
|
|
209
|
+
<MazTabsBar :items="tabs" />
|
|
210
|
+
<!-- ... -->
|
|
211
|
+
</MazTabs>
|
|
212
|
+
|
|
213
|
+
<!-- or directly on MazTabsBar -->
|
|
214
|
+
<MazTabsBar :items="tabs" size="lg" rounded-size="full" />
|
|
215
|
+
</template>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Each item can also override the `size` and `rounded-size` (and accepts every other [`MazBtn`](./maz-btn.md) prop, except `active`, `block`, `type`, `loading` and `fab`).
|
|
219
|
+
|
|
220
|
+
## Active color
|
|
221
|
+
|
|
222
|
+
The active tab is highlighted by the indicator. Use the `color` prop (`MazColor`) on `MazTabsBar` (or on `MazTabs`, which forwards it) to color it. When omitted, the default neutral indicator is used.
|
|
223
|
+
|
|
224
|
+
<MazTabs>
|
|
225
|
+
<MazTabsBar :items="tabs2" color="primary" />
|
|
226
|
+
</MazTabs>
|
|
227
|
+
|
|
228
|
+
```vue
|
|
229
|
+
<template>
|
|
230
|
+
<MazTabsBar :items="tabs" color="primary" />
|
|
231
|
+
</template>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Standalone usage
|
|
235
|
+
|
|
236
|
+
`MazTabsBar` can be used on its own, without `MazTabs`, as an independent switcher with its own `v-model`.
|
|
237
|
+
|
|
238
|
+
::: tip Nested inside a `MazTabs`
|
|
239
|
+
If your page is already wrapped by a `MazTabs`, a nested `MazTabsBar` would otherwise be linked to that parent (clicking a tab would change the page). Add the `standalone` prop to make it fully independent (it then ignores the parent's selection, size, rounded-size and color):
|
|
240
|
+
|
|
241
|
+
```vue
|
|
242
|
+
<MazTabsBar v-model="selected" :items="items" standalone />
|
|
243
|
+
```
|
|
244
|
+
:::
|
|
245
|
+
|
|
246
|
+
The model returns the `1`-based index of the selected tab, unless the items provide a `value` (`string | number`), in which case that value is returned. The model type is inferred from the items passed: declare the items `as const` (or with literal `value`s) to get a strict union type for the model and the `@update:model-value` event.
|
|
247
|
+
|
|
248
|
+
<MazTabsBar v-model="standaloneModel" :items="standaloneItems" color="secondary" rounded-size="full" />
|
|
249
|
+
|
|
250
|
+
<br />
|
|
251
|
+
|
|
252
|
+
<p>Selected value: <strong>{{ standaloneModel }}</strong></p>
|
|
253
|
+
|
|
254
|
+
```vue
|
|
255
|
+
<script lang="ts" setup>
|
|
256
|
+
import { MazTabsBar, type MazTabsBarItem } from 'maz-ui/components'
|
|
257
|
+
import { ref } from 'vue'
|
|
258
|
+
|
|
259
|
+
const selected = ref('weekly')
|
|
260
|
+
|
|
261
|
+
const items = [
|
|
262
|
+
{ label: 'Daily', value: 'daily' },
|
|
263
|
+
{ label: 'Weekly', value: 'weekly' },
|
|
264
|
+
{ label: 'Monthly', value: 'monthly' },
|
|
265
|
+
] as const satisfies readonly MazTabsBarItem[]
|
|
266
|
+
</script>
|
|
267
|
+
|
|
268
|
+
<template>
|
|
269
|
+
<MazTabsBar v-model="selected" :items="items" color="secondary" rounded-size="full" />
|
|
270
|
+
<!-- selected & @update:model-value === 'daily' | 'weekly' | 'monthly' -->
|
|
271
|
+
</template>
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
When no `value` is set on the items, the model is a number (the `1`-based index):
|
|
275
|
+
|
|
276
|
+
```vue
|
|
277
|
+
<script lang="ts" setup>
|
|
278
|
+
const selected = ref(1)
|
|
279
|
+
const items = ['First', 'Second', 'Third']
|
|
280
|
+
</script>
|
|
281
|
+
|
|
282
|
+
<template>
|
|
283
|
+
<MazTabsBar v-model="selected" :items="items" />
|
|
284
|
+
<!-- selected === 1 | 2 | 3 -->
|
|
285
|
+
</template>
|
|
286
|
+
```
|
|
287
|
+
|
|
187
288
|
## Types
|
|
188
289
|
|
|
189
290
|
```ts
|
|
190
|
-
type MazTabsBarItem
|
|
191
|
-
|
|
291
|
+
type MazTabsBarItem<Value extends string | number = string | number>
|
|
292
|
+
// Inherits all MazBtn props except 'active' | 'block' | 'type' | 'loading' | 'fab'
|
|
293
|
+
= | (Omit<MazBtnProps, 'active' | 'block' | 'type' | 'loading' | 'fab'> & {
|
|
192
294
|
/**
|
|
193
295
|
* Label of the tab
|
|
194
296
|
*/
|
|
195
297
|
label: string
|
|
298
|
+
/**
|
|
299
|
+
* Value returned by the model when the tab is selected (standalone usage).
|
|
300
|
+
* When omitted, the model returns the 1-based index of the tab.
|
|
301
|
+
*/
|
|
302
|
+
value?: Value
|
|
196
303
|
/**
|
|
197
304
|
* Will disable the tab
|
|
198
305
|
* @default false
|
|
@@ -208,7 +315,7 @@ type MazTabsBarItem
|
|
|
208
315
|
*/
|
|
209
316
|
content: string | number | boolean
|
|
210
317
|
}
|
|
211
|
-
}
|
|
318
|
+
})
|
|
212
319
|
| string
|
|
213
320
|
```
|
|
214
321
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maz-ui/mcp",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.0-beta.
|
|
4
|
+
"version": "5.0.0-beta.33",
|
|
5
5
|
"description": "Maz-UI ModelContextProtocol Client",
|
|
6
6
|
"author": "Louis Mazel <me@loicmazuel.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
45
|
-
"
|
|
46
|
-
"maz-ui": "5.0.0-beta.
|
|
45
|
+
"maz-ui": "5.0.0-beta.33",
|
|
46
|
+
"@maz-ui/utils": "5.0.0-beta.28"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@modelcontextprotocol/inspector": "^0.21.2",
|