@maz-ui/mcp 5.0.0-beta.31 → 5.0.0-beta.32
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.32";
|
|
11
11
|
|
|
12
12
|
class MetadataExtractor {
|
|
13
13
|
extract(name, type, content, manualTags = []) {
|
|
@@ -1,14 +1,24 @@
|
|
|
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
|
+
| **persistent** | Will add a query param to the url to keep the selected tab on page refresh | `boolean` | No | `false` | - |
|
|
11
|
+
| **query-param** | The name of the query param to add to the url | `string` | No | `tab` | - |
|
|
12
|
+
| **block** | Will make the tabs bar full width | `boolean` | No | `false` | - |
|
|
13
|
+
| **elevation** | Will remove the elevation | `boolean` | No | `false` | - |
|
|
14
|
+
| **auto-scroll** | Will add a scroll on the tabs bar to show selected element | `boolean` | No | `true` | - |
|
|
15
|
+
| **bordered** | Will add a border to the tabs bar | `boolean` | No | `true` | - |
|
|
16
|
+
|
|
17
|
+
## Events
|
|
18
|
+
|
|
19
|
+
| Event name | Properties | Description |
|
|
20
|
+
| ------------------ | --------------------------------------------------------------------------------------- | --------------------------------------------------------- |
|
|
21
|
+
| update:model-value | **value** `MazTabsBarItemValue` - item value when provided, otherwise the 1-based index | Emitted when the selected tab changes (standalone usage). |
|
|
12
22
|
|
|
13
23
|
## Slots
|
|
14
24
|
|
|
@@ -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,116 @@ 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
|
+
]
|
|
193
|
+
</script>
|
|
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
|
+
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.
|
|
239
|
+
|
|
240
|
+
<MazTabsBar v-model="standaloneModel" :items="standaloneItems" color="secondary" rounded-size="full" />
|
|
241
|
+
|
|
242
|
+
<br />
|
|
243
|
+
|
|
244
|
+
<p>Selected value: <strong>{{ standaloneModel }}</strong></p>
|
|
245
|
+
|
|
246
|
+
```vue
|
|
247
|
+
<script lang="ts" setup>
|
|
248
|
+
import { MazTabsBar, type MazTabsBarItem } from 'maz-ui/components'
|
|
249
|
+
import { ref } from 'vue'
|
|
250
|
+
|
|
251
|
+
const selected = ref('weekly')
|
|
252
|
+
|
|
253
|
+
const items = [
|
|
254
|
+
{ label: 'Daily', value: 'daily' },
|
|
255
|
+
{ label: 'Weekly', value: 'weekly' },
|
|
256
|
+
{ label: 'Monthly', value: 'monthly' },
|
|
257
|
+
] as const satisfies readonly MazTabsBarItem[]
|
|
258
|
+
</script>
|
|
259
|
+
|
|
260
|
+
<template>
|
|
261
|
+
<MazTabsBar v-model="selected" :items="items" color="secondary" rounded-size="full" />
|
|
262
|
+
<!-- selected & @update:model-value === 'daily' | 'weekly' | 'monthly' -->
|
|
263
|
+
</template>
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
When no `value` is set on the items, the model is a number (the `1`-based index):
|
|
267
|
+
|
|
268
|
+
```vue
|
|
269
|
+
<script lang="ts" setup>
|
|
270
|
+
const selected = ref(1)
|
|
271
|
+
const items = ['First', 'Second', 'Third']
|
|
185
272
|
</script>
|
|
186
273
|
|
|
274
|
+
<template>
|
|
275
|
+
<MazTabsBar v-model="selected" :items="items" />
|
|
276
|
+
<!-- selected === 1 | 2 | 3 -->
|
|
277
|
+
</template>
|
|
278
|
+
```
|
|
279
|
+
|
|
187
280
|
## Types
|
|
188
281
|
|
|
189
282
|
```ts
|
|
190
|
-
type MazTabsBarItem
|
|
191
|
-
|
|
283
|
+
type MazTabsBarItem<Value extends string | number = string | number>
|
|
284
|
+
// Inherits all MazBtn props except 'active' | 'block' | 'type' | 'loading' | 'fab'
|
|
285
|
+
= | (Omit<MazBtnProps, 'active' | 'block' | 'type' | 'loading' | 'fab'> & {
|
|
192
286
|
/**
|
|
193
287
|
* Label of the tab
|
|
194
288
|
*/
|
|
195
289
|
label: string
|
|
290
|
+
/**
|
|
291
|
+
* Value returned by the model when the tab is selected (standalone usage).
|
|
292
|
+
* When omitted, the model returns the 1-based index of the tab.
|
|
293
|
+
*/
|
|
294
|
+
value?: Value
|
|
196
295
|
/**
|
|
197
296
|
* Will disable the tab
|
|
198
297
|
* @default false
|
|
@@ -208,7 +307,7 @@ type MazTabsBarItem
|
|
|
208
307
|
*/
|
|
209
308
|
content: string | number | boolean
|
|
210
309
|
}
|
|
211
|
-
}
|
|
310
|
+
})
|
|
212
311
|
| string
|
|
213
312
|
```
|
|
214
313
|
|
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.32",
|
|
5
5
|
"description": "Maz-UI ModelContextProtocol Client",
|
|
6
6
|
"author": "Louis Mazel <me@loicmazuel.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
45
45
|
"@maz-ui/utils": "5.0.0-beta.28",
|
|
46
|
-
"maz-ui": "5.0.0-beta.
|
|
46
|
+
"maz-ui": "5.0.0-beta.32"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@modelcontextprotocol/inspector": "^0.21.2",
|