@webmcpui/vue 0.3.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 +83 -0
- package/dist/index.d.ts +396 -0
- package/dist/index.js +318 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# @webmcpui/vue
|
|
2
|
+
|
|
3
|
+
Idiomatic, typed **Vue** components for [webmcpui](https://webmcpui.com) —
|
|
4
|
+
WebMCP-native, accessible, shadcn/Tailwind-aligned.
|
|
5
|
+
|
|
6
|
+
Each component wraps the corresponding [`@webmcpui/core`](https://www.npmjs.com/package/@webmcpui/core)
|
|
7
|
+
custom element, so the WebMCP tool exposure, form association, and accessibility
|
|
8
|
+
live **once** (in core) and you get typed props, `v-model`, `@event` listeners,
|
|
9
|
+
and slots — with **no `isCustomElement` config** (the `wmcp-*` tag only appears
|
|
10
|
+
inside the component's render function, never your templates).
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add @webmcpui/vue @webmcpui/core vue
|
|
16
|
+
# optional theme (shadcn-aligned):
|
|
17
|
+
pnpm add @webmcpui/tokens
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```vue
|
|
23
|
+
<script setup lang="ts">
|
|
24
|
+
import { ref } from 'vue';
|
|
25
|
+
import { Button, Input, Dialog, Tabs } from '@webmcpui/vue';
|
|
26
|
+
import '@webmcpui/tokens/css'; // omit for an unstyled baseline (see below)
|
|
27
|
+
|
|
28
|
+
const email = ref('');
|
|
29
|
+
const open = ref(false);
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<Button variant="primary" @click="open = true">Book</Button>
|
|
34
|
+
|
|
35
|
+
<!-- form control with v-model — expose it and an agent can fill it -->
|
|
36
|
+
<Input v-model="email" label="Email" type="email" expose />
|
|
37
|
+
|
|
38
|
+
<!-- the agent opens it; the human confirms -->
|
|
39
|
+
<Dialog v-model:open="open" label="Confirm" expose>
|
|
40
|
+
<Button variant="primary" @click="open = false">Confirm</Button>
|
|
41
|
+
</Dialog>
|
|
42
|
+
</template>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`v-model` binds `Input`'s value, `v-model:open` a `Dialog`, `v-model:active` a
|
|
46
|
+
`Tabs`. Every component takes `expose` (+ optional `tool-name` /
|
|
47
|
+
`tool-description`) to register its [WebMCP](https://webmcpui.com/docs/webmcp)
|
|
48
|
+
tool that an agent can call. With no agent present it's a no-op.
|
|
49
|
+
|
|
50
|
+
## Components
|
|
51
|
+
|
|
52
|
+
`Button` · `Input` · `Dialog` · `Tabs` — more land each release as the core kit
|
|
53
|
+
grows. Props mirror the [element attributes](https://webmcpui.com/docs):
|
|
54
|
+
`variant`, `size`, `type`, `disabled`, `expose`, `tool-name`, … plus the
|
|
55
|
+
`v-model` bindings above.
|
|
56
|
+
|
|
57
|
+
## Styling
|
|
58
|
+
|
|
59
|
+
Themed through the [design tokens](https://www.npmjs.com/package/@webmcpui/tokens)
|
|
60
|
+
(CSS custom properties, shadcn-aligned, light + dark). Two modes:
|
|
61
|
+
|
|
62
|
+
- **Themed** — `import '@webmcpui/tokens/css'` once at your app root.
|
|
63
|
+
- **Unstyled** — don't import the tokens CSS. The elements render with neutral
|
|
64
|
+
inline fallbacks; style them yourself via the CSS custom properties or the
|
|
65
|
+
`::part()` selectors each element exposes.
|
|
66
|
+
|
|
67
|
+
## Server rendering (Nuxt, …)
|
|
68
|
+
|
|
69
|
+
These are **client-rendered custom elements** — importing them evaluates
|
|
70
|
+
`class extends HTMLElement`, which has no meaning on the server. Register/use
|
|
71
|
+
them client-side only:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
// a Nuxt plugin: plugins/webmcpui.client.ts (the .client suffix = browser only)
|
|
75
|
+
import { Button } from '@webmcpui/vue';
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
or wrap usage in `<ClientOnly>`. The elements upgrade and hydrate on the client
|
|
79
|
+
normally.
|
|
80
|
+
|
|
81
|
+
## Docs
|
|
82
|
+
|
|
83
|
+
Full docs, live demos, and `llms.txt` at **[webmcpui.com](https://webmcpui.com)**.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { PropType, VNode } from 'vue';
|
|
3
|
+
import { WmcpButtonVariant, WmcpButtonSize, WmcpButtonType, WmcpInputType, StandardSchemaV1, WmcpBadgeVariant, WmcpPopoverPlacement, WmcpPopoverTrigger, WmcpAlertVariant } from '@webmcpui/core';
|
|
4
|
+
export { WmcpAlertVariant, WmcpBadgeVariant, WmcpButtonSize, WmcpButtonType, WmcpButtonVariant, WmcpInputType } from '@webmcpui/core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `<Button>` — an idiomatic, typed Vue wrapper over `<wmcp-button>`.
|
|
8
|
+
*
|
|
9
|
+
* Behavior (form-associated submit/reset, WebMCP action exposure, a11y) lives
|
|
10
|
+
* in `@webmcpui/core`; this adds Vue ergonomics: typed props and a component
|
|
11
|
+
* you can use in templates without configuring `isCustomElement` (the
|
|
12
|
+
* `<wmcp-button>` tag only appears inside this render function). Attributes and
|
|
13
|
+
* listeners (`@click`, `class`, `style`, …) fall through to the element.
|
|
14
|
+
*
|
|
15
|
+
* ```vue
|
|
16
|
+
* <script setup>
|
|
17
|
+
* import { Button } from '@webmcpui/vue';
|
|
18
|
+
* import '@webmcpui/tokens/css';
|
|
19
|
+
* </script>
|
|
20
|
+
*
|
|
21
|
+
* <template>
|
|
22
|
+
* <Button variant="primary" @click="save">Save</Button>
|
|
23
|
+
* <Button expose tool-name="book_appointment">Book</Button>
|
|
24
|
+
* </template>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare const Button: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
28
|
+
variant: PropType<WmcpButtonVariant>;
|
|
29
|
+
size: PropType<WmcpButtonSize>;
|
|
30
|
+
type: PropType<WmcpButtonType>;
|
|
31
|
+
disabled: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: undefined;
|
|
34
|
+
};
|
|
35
|
+
expose: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: undefined;
|
|
38
|
+
};
|
|
39
|
+
name: StringConstructor;
|
|
40
|
+
label: StringConstructor;
|
|
41
|
+
toolName: StringConstructor;
|
|
42
|
+
toolDescription: StringConstructor;
|
|
43
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
46
|
+
variant: PropType<WmcpButtonVariant>;
|
|
47
|
+
size: PropType<WmcpButtonSize>;
|
|
48
|
+
type: PropType<WmcpButtonType>;
|
|
49
|
+
disabled: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
default: undefined;
|
|
52
|
+
};
|
|
53
|
+
expose: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
default: undefined;
|
|
56
|
+
};
|
|
57
|
+
name: StringConstructor;
|
|
58
|
+
label: StringConstructor;
|
|
59
|
+
toolName: StringConstructor;
|
|
60
|
+
toolDescription: StringConstructor;
|
|
61
|
+
}>> & Readonly<{}>, {
|
|
62
|
+
disabled: boolean;
|
|
63
|
+
expose: boolean;
|
|
64
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* `<Input>` — a typed Vue wrapper over `<wmcp-input>` with `v-model` support.
|
|
68
|
+
* Form association, Standard Schema validation, and WebMCP `fill_*` exposure
|
|
69
|
+
* live in core; this maps `v-model` to the element's `value` and re-emits
|
|
70
|
+
* `input` / `change`.
|
|
71
|
+
*
|
|
72
|
+
* ```vue
|
|
73
|
+
* <Input v-model="email" type="email" label="Email" :schema="emailSchema" expose />
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
declare const Input: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
77
|
+
modelValue: StringConstructor;
|
|
78
|
+
type: PropType<WmcpInputType>;
|
|
79
|
+
label: StringConstructor;
|
|
80
|
+
name: StringConstructor;
|
|
81
|
+
placeholder: StringConstructor;
|
|
82
|
+
required: {
|
|
83
|
+
type: BooleanConstructor;
|
|
84
|
+
default: undefined;
|
|
85
|
+
};
|
|
86
|
+
disabled: {
|
|
87
|
+
type: BooleanConstructor;
|
|
88
|
+
default: undefined;
|
|
89
|
+
};
|
|
90
|
+
helperText: StringConstructor;
|
|
91
|
+
requiredMessage: StringConstructor;
|
|
92
|
+
expose: {
|
|
93
|
+
type: BooleanConstructor;
|
|
94
|
+
default: undefined;
|
|
95
|
+
};
|
|
96
|
+
toolName: StringConstructor;
|
|
97
|
+
toolDescription: StringConstructor;
|
|
98
|
+
schema: {
|
|
99
|
+
type: PropType<StandardSchemaV1<unknown, unknown>>;
|
|
100
|
+
default: undefined;
|
|
101
|
+
};
|
|
102
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
103
|
+
[key: string]: any;
|
|
104
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("input" | "change" | "update:modelValue")[], "input" | "change" | "update:modelValue", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
105
|
+
modelValue: StringConstructor;
|
|
106
|
+
type: PropType<WmcpInputType>;
|
|
107
|
+
label: StringConstructor;
|
|
108
|
+
name: StringConstructor;
|
|
109
|
+
placeholder: StringConstructor;
|
|
110
|
+
required: {
|
|
111
|
+
type: BooleanConstructor;
|
|
112
|
+
default: undefined;
|
|
113
|
+
};
|
|
114
|
+
disabled: {
|
|
115
|
+
type: BooleanConstructor;
|
|
116
|
+
default: undefined;
|
|
117
|
+
};
|
|
118
|
+
helperText: StringConstructor;
|
|
119
|
+
requiredMessage: StringConstructor;
|
|
120
|
+
expose: {
|
|
121
|
+
type: BooleanConstructor;
|
|
122
|
+
default: undefined;
|
|
123
|
+
};
|
|
124
|
+
toolName: StringConstructor;
|
|
125
|
+
toolDescription: StringConstructor;
|
|
126
|
+
schema: {
|
|
127
|
+
type: PropType<StandardSchemaV1<unknown, unknown>>;
|
|
128
|
+
default: undefined;
|
|
129
|
+
};
|
|
130
|
+
}>> & Readonly<{
|
|
131
|
+
onInput?: ((...args: any[]) => any) | undefined;
|
|
132
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
133
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
134
|
+
}>, {
|
|
135
|
+
disabled: boolean;
|
|
136
|
+
expose: boolean;
|
|
137
|
+
required: boolean;
|
|
138
|
+
schema: StandardSchemaV1<unknown, unknown>;
|
|
139
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* `<Dialog>` — a typed Vue wrapper over `<wmcp-dialog>` with `v-model:open`.
|
|
143
|
+
* The modal behavior (native `<dialog>`, focus trap, WebMCP `open_*` exposure)
|
|
144
|
+
* lives in core; this two-way-binds `open` and re-emits `open` / `close`.
|
|
145
|
+
*
|
|
146
|
+
* ```vue
|
|
147
|
+
* <Dialog v-model:open="open" label="Confirm" expose>…</Dialog>
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
declare const Dialog: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
151
|
+
open: {
|
|
152
|
+
type: BooleanConstructor;
|
|
153
|
+
default: undefined;
|
|
154
|
+
};
|
|
155
|
+
modal: {
|
|
156
|
+
type: BooleanConstructor;
|
|
157
|
+
default: undefined;
|
|
158
|
+
};
|
|
159
|
+
staticBackdrop: {
|
|
160
|
+
type: BooleanConstructor;
|
|
161
|
+
default: undefined;
|
|
162
|
+
};
|
|
163
|
+
label: StringConstructor;
|
|
164
|
+
name: StringConstructor;
|
|
165
|
+
expose: {
|
|
166
|
+
type: BooleanConstructor;
|
|
167
|
+
default: undefined;
|
|
168
|
+
};
|
|
169
|
+
toolName: StringConstructor;
|
|
170
|
+
toolDescription: StringConstructor;
|
|
171
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
172
|
+
[key: string]: any;
|
|
173
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("close" | "update:open" | "open")[], "close" | "update:open" | "open", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
174
|
+
open: {
|
|
175
|
+
type: BooleanConstructor;
|
|
176
|
+
default: undefined;
|
|
177
|
+
};
|
|
178
|
+
modal: {
|
|
179
|
+
type: BooleanConstructor;
|
|
180
|
+
default: undefined;
|
|
181
|
+
};
|
|
182
|
+
staticBackdrop: {
|
|
183
|
+
type: BooleanConstructor;
|
|
184
|
+
default: undefined;
|
|
185
|
+
};
|
|
186
|
+
label: StringConstructor;
|
|
187
|
+
name: StringConstructor;
|
|
188
|
+
expose: {
|
|
189
|
+
type: BooleanConstructor;
|
|
190
|
+
default: undefined;
|
|
191
|
+
};
|
|
192
|
+
toolName: StringConstructor;
|
|
193
|
+
toolDescription: StringConstructor;
|
|
194
|
+
}>> & Readonly<{
|
|
195
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
196
|
+
"onUpdate:open"?: ((...args: any[]) => any) | undefined;
|
|
197
|
+
onOpen?: ((...args: any[]) => any) | undefined;
|
|
198
|
+
}>, {
|
|
199
|
+
expose: boolean;
|
|
200
|
+
open: boolean;
|
|
201
|
+
modal: boolean;
|
|
202
|
+
staticBackdrop: boolean;
|
|
203
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* `<Tabs>` — a typed Vue wrapper over `<wmcp-tabs>` with `v-model:active`.
|
|
207
|
+
* Holds the persistent active tab and exposes the WebMCP `switch_*` tool (in
|
|
208
|
+
* core). Pass the panels as slotted `<section tab="…" tab-label="…">` children.
|
|
209
|
+
*
|
|
210
|
+
* ```vue
|
|
211
|
+
* <Tabs v-model:active="active" label="Account" expose>
|
|
212
|
+
* <section tab="overview" tab-label="Overview">…</section>
|
|
213
|
+
* </Tabs>
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
216
|
+
declare const Tabs: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
217
|
+
active: StringConstructor;
|
|
218
|
+
label: StringConstructor;
|
|
219
|
+
name: StringConstructor;
|
|
220
|
+
expose: {
|
|
221
|
+
type: BooleanConstructor;
|
|
222
|
+
default: undefined;
|
|
223
|
+
};
|
|
224
|
+
toolName: StringConstructor;
|
|
225
|
+
toolDescription: StringConstructor;
|
|
226
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
227
|
+
[key: string]: any;
|
|
228
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("change" | "update:active")[], "change" | "update:active", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
229
|
+
active: StringConstructor;
|
|
230
|
+
label: StringConstructor;
|
|
231
|
+
name: StringConstructor;
|
|
232
|
+
expose: {
|
|
233
|
+
type: BooleanConstructor;
|
|
234
|
+
default: undefined;
|
|
235
|
+
};
|
|
236
|
+
toolName: StringConstructor;
|
|
237
|
+
toolDescription: StringConstructor;
|
|
238
|
+
}>> & Readonly<{
|
|
239
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
240
|
+
"onUpdate:active"?: ((...args: any[]) => any) | undefined;
|
|
241
|
+
}>, {
|
|
242
|
+
expose: boolean;
|
|
243
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
244
|
+
|
|
245
|
+
/** `<Switch>` — a typed Vue wrapper over `<wmcp-switch>` with `v-model` (boolean).
|
|
246
|
+
* Form association + WebMCP `fill_*` exposure live in core. */
|
|
247
|
+
declare const Switch: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
248
|
+
modelValue: {
|
|
249
|
+
type: BooleanConstructor;
|
|
250
|
+
default: undefined;
|
|
251
|
+
};
|
|
252
|
+
label: StringConstructor;
|
|
253
|
+
name: StringConstructor;
|
|
254
|
+
required: {
|
|
255
|
+
type: BooleanConstructor;
|
|
256
|
+
default: undefined;
|
|
257
|
+
};
|
|
258
|
+
disabled: {
|
|
259
|
+
type: BooleanConstructor;
|
|
260
|
+
default: undefined;
|
|
261
|
+
};
|
|
262
|
+
expose: {
|
|
263
|
+
type: BooleanConstructor;
|
|
264
|
+
default: undefined;
|
|
265
|
+
};
|
|
266
|
+
toolName: StringConstructor;
|
|
267
|
+
toolDescription: StringConstructor;
|
|
268
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
269
|
+
[key: string]: any;
|
|
270
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
271
|
+
modelValue: {
|
|
272
|
+
type: BooleanConstructor;
|
|
273
|
+
default: undefined;
|
|
274
|
+
};
|
|
275
|
+
label: StringConstructor;
|
|
276
|
+
name: StringConstructor;
|
|
277
|
+
required: {
|
|
278
|
+
type: BooleanConstructor;
|
|
279
|
+
default: undefined;
|
|
280
|
+
};
|
|
281
|
+
disabled: {
|
|
282
|
+
type: BooleanConstructor;
|
|
283
|
+
default: undefined;
|
|
284
|
+
};
|
|
285
|
+
expose: {
|
|
286
|
+
type: BooleanConstructor;
|
|
287
|
+
default: undefined;
|
|
288
|
+
};
|
|
289
|
+
toolName: StringConstructor;
|
|
290
|
+
toolDescription: StringConstructor;
|
|
291
|
+
}>> & Readonly<{
|
|
292
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
293
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
294
|
+
}>, {
|
|
295
|
+
disabled: boolean;
|
|
296
|
+
expose: boolean;
|
|
297
|
+
modelValue: boolean;
|
|
298
|
+
required: boolean;
|
|
299
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
300
|
+
|
|
301
|
+
/** `<Badge>` — a presentational status pill (`variant` + slot). No WebMCP tool. */
|
|
302
|
+
declare const Badge: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
303
|
+
variant: PropType<WmcpBadgeVariant>;
|
|
304
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
305
|
+
[key: string]: any;
|
|
306
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
307
|
+
variant: PropType<WmcpBadgeVariant>;
|
|
308
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
309
|
+
|
|
310
|
+
/** `<Separator>` — a presentational divider (`orientation`). No WebMCP tool. */
|
|
311
|
+
declare const Separator: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
312
|
+
orientation: PropType<"horizontal" | "vertical">;
|
|
313
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
314
|
+
[key: string]: any;
|
|
315
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
316
|
+
orientation: PropType<"horizontal" | "vertical">;
|
|
317
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* `<Tooltip>` — a typed Vue wrapper over `<wmcp-tooltip>`. Put the trigger in
|
|
321
|
+
* the `#trigger` slot (or use `label`) and the tip text in the default slot.
|
|
322
|
+
*/
|
|
323
|
+
declare const Tooltip: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
324
|
+
label: StringConstructor;
|
|
325
|
+
placement: PropType<WmcpPopoverPlacement>;
|
|
326
|
+
trigger: PropType<WmcpPopoverTrigger>;
|
|
327
|
+
name: StringConstructor;
|
|
328
|
+
expose: {
|
|
329
|
+
type: BooleanConstructor;
|
|
330
|
+
default: undefined;
|
|
331
|
+
};
|
|
332
|
+
toolName: StringConstructor;
|
|
333
|
+
toolDescription: StringConstructor;
|
|
334
|
+
}>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
335
|
+
[key: string]: any;
|
|
336
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
337
|
+
label: StringConstructor;
|
|
338
|
+
placement: PropType<WmcpPopoverPlacement>;
|
|
339
|
+
trigger: PropType<WmcpPopoverTrigger>;
|
|
340
|
+
name: StringConstructor;
|
|
341
|
+
expose: {
|
|
342
|
+
type: BooleanConstructor;
|
|
343
|
+
default: undefined;
|
|
344
|
+
};
|
|
345
|
+
toolName: StringConstructor;
|
|
346
|
+
toolDescription: StringConstructor;
|
|
347
|
+
}>> & Readonly<{}>, {
|
|
348
|
+
expose: boolean;
|
|
349
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
350
|
+
|
|
351
|
+
/** `<Alert>` — a presentational inline callout (`variant`, `title`, slot). */
|
|
352
|
+
declare const Alert: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
353
|
+
variant: PropType<WmcpAlertVariant>;
|
|
354
|
+
title: StringConstructor;
|
|
355
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
356
|
+
[key: string]: any;
|
|
357
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
358
|
+
variant: PropType<WmcpAlertVariant>;
|
|
359
|
+
title: StringConstructor;
|
|
360
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
361
|
+
|
|
362
|
+
/** `<Progress>` — a presentational progress bar (`value`, `max`, `indeterminate`). */
|
|
363
|
+
declare const Progress: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
364
|
+
value: NumberConstructor;
|
|
365
|
+
max: NumberConstructor;
|
|
366
|
+
indeterminate: {
|
|
367
|
+
type: BooleanConstructor;
|
|
368
|
+
default: undefined;
|
|
369
|
+
};
|
|
370
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
371
|
+
[key: string]: any;
|
|
372
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
373
|
+
value: NumberConstructor;
|
|
374
|
+
max: NumberConstructor;
|
|
375
|
+
indeterminate: {
|
|
376
|
+
type: BooleanConstructor;
|
|
377
|
+
default: undefined;
|
|
378
|
+
};
|
|
379
|
+
}>> & Readonly<{}>, {
|
|
380
|
+
indeterminate: boolean;
|
|
381
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
382
|
+
|
|
383
|
+
/** `<Avatar>` — a presentational avatar (`src`, `alt`, `fallback`). */
|
|
384
|
+
declare const Avatar: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
385
|
+
src: StringConstructor;
|
|
386
|
+
alt: StringConstructor;
|
|
387
|
+
fallback: StringConstructor;
|
|
388
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
389
|
+
[key: string]: any;
|
|
390
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
391
|
+
src: StringConstructor;
|
|
392
|
+
alt: StringConstructor;
|
|
393
|
+
fallback: StringConstructor;
|
|
394
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
395
|
+
|
|
396
|
+
export { Alert, Avatar, Badge, Button, Dialog, Input, Progress, Separator, Switch, Tabs, Tooltip };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
// src/button.ts
|
|
2
|
+
import { defineComponent, h } from "vue";
|
|
3
|
+
import {
|
|
4
|
+
WmcpButton
|
|
5
|
+
} from "@webmcpui/core";
|
|
6
|
+
|
|
7
|
+
// src/define.ts
|
|
8
|
+
function defineOnce(tagName, elementClass) {
|
|
9
|
+
if (typeof customElements === "undefined") return;
|
|
10
|
+
if (!customElements.get(tagName)) {
|
|
11
|
+
customElements.define(tagName, elementClass);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// src/button.ts
|
|
16
|
+
defineOnce(WmcpButton.tagName, WmcpButton);
|
|
17
|
+
var Button = defineComponent({
|
|
18
|
+
name: "WmcpButton",
|
|
19
|
+
props: {
|
|
20
|
+
variant: String,
|
|
21
|
+
size: String,
|
|
22
|
+
type: String,
|
|
23
|
+
disabled: { type: Boolean, default: void 0 },
|
|
24
|
+
expose: { type: Boolean, default: void 0 },
|
|
25
|
+
name: String,
|
|
26
|
+
label: String,
|
|
27
|
+
toolName: String,
|
|
28
|
+
toolDescription: String
|
|
29
|
+
},
|
|
30
|
+
setup(props, { slots }) {
|
|
31
|
+
return () => {
|
|
32
|
+
const bindings = {};
|
|
33
|
+
for (const [key, value] of Object.entries(props)) {
|
|
34
|
+
if (value !== void 0) bindings[key] = value;
|
|
35
|
+
}
|
|
36
|
+
return h(WmcpButton.tagName, bindings, slots.default?.());
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// src/input.ts
|
|
42
|
+
import { defineComponent as defineComponent2, h as h2 } from "vue";
|
|
43
|
+
import {
|
|
44
|
+
WmcpInput
|
|
45
|
+
} from "@webmcpui/core";
|
|
46
|
+
defineOnce(WmcpInput.tagName, WmcpInput);
|
|
47
|
+
var Input = defineComponent2({
|
|
48
|
+
name: "WmcpInput",
|
|
49
|
+
props: {
|
|
50
|
+
modelValue: String,
|
|
51
|
+
type: String,
|
|
52
|
+
label: String,
|
|
53
|
+
name: String,
|
|
54
|
+
placeholder: String,
|
|
55
|
+
required: { type: Boolean, default: void 0 },
|
|
56
|
+
disabled: { type: Boolean, default: void 0 },
|
|
57
|
+
helperText: String,
|
|
58
|
+
requiredMessage: String,
|
|
59
|
+
expose: { type: Boolean, default: void 0 },
|
|
60
|
+
toolName: String,
|
|
61
|
+
toolDescription: String,
|
|
62
|
+
schema: {
|
|
63
|
+
type: Object,
|
|
64
|
+
default: void 0
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
emits: ["update:modelValue", "input", "change"],
|
|
68
|
+
setup(props, { emit }) {
|
|
69
|
+
return () => {
|
|
70
|
+
const bindings = {
|
|
71
|
+
onInput: (e) => {
|
|
72
|
+
emit("update:modelValue", e.target.value);
|
|
73
|
+
emit("input", e);
|
|
74
|
+
},
|
|
75
|
+
onChange: (e) => emit("change", e)
|
|
76
|
+
};
|
|
77
|
+
for (const [key, value] of Object.entries(props)) {
|
|
78
|
+
if (value === void 0) continue;
|
|
79
|
+
if (key === "modelValue") bindings.value = value;
|
|
80
|
+
else bindings[key] = value;
|
|
81
|
+
}
|
|
82
|
+
return h2(WmcpInput.tagName, bindings);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// src/dialog.ts
|
|
88
|
+
import { defineComponent as defineComponent3, h as h3 } from "vue";
|
|
89
|
+
import { WmcpDialog } from "@webmcpui/core";
|
|
90
|
+
defineOnce(WmcpDialog.tagName, WmcpDialog);
|
|
91
|
+
var Dialog = defineComponent3({
|
|
92
|
+
name: "WmcpDialog",
|
|
93
|
+
props: {
|
|
94
|
+
open: { type: Boolean, default: void 0 },
|
|
95
|
+
modal: { type: Boolean, default: void 0 },
|
|
96
|
+
staticBackdrop: { type: Boolean, default: void 0 },
|
|
97
|
+
label: String,
|
|
98
|
+
name: String,
|
|
99
|
+
expose: { type: Boolean, default: void 0 },
|
|
100
|
+
toolName: String,
|
|
101
|
+
toolDescription: String
|
|
102
|
+
},
|
|
103
|
+
emits: ["update:open", "open", "close"],
|
|
104
|
+
setup(props, { slots, emit }) {
|
|
105
|
+
return () => {
|
|
106
|
+
const bindings = {
|
|
107
|
+
onOpen: () => {
|
|
108
|
+
emit("open");
|
|
109
|
+
emit("update:open", true);
|
|
110
|
+
},
|
|
111
|
+
onClose: () => {
|
|
112
|
+
emit("close");
|
|
113
|
+
emit("update:open", false);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
for (const [key, value] of Object.entries(props)) {
|
|
117
|
+
if (value !== void 0) bindings[key] = value;
|
|
118
|
+
}
|
|
119
|
+
return h3(WmcpDialog.tagName, bindings, slots.default?.());
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// src/tabs.ts
|
|
125
|
+
import { defineComponent as defineComponent4, h as h4 } from "vue";
|
|
126
|
+
import { WmcpTabs } from "@webmcpui/core";
|
|
127
|
+
defineOnce(WmcpTabs.tagName, WmcpTabs);
|
|
128
|
+
var Tabs = defineComponent4({
|
|
129
|
+
name: "WmcpTabs",
|
|
130
|
+
props: {
|
|
131
|
+
active: String,
|
|
132
|
+
label: String,
|
|
133
|
+
name: String,
|
|
134
|
+
expose: { type: Boolean, default: void 0 },
|
|
135
|
+
toolName: String,
|
|
136
|
+
toolDescription: String
|
|
137
|
+
},
|
|
138
|
+
emits: ["update:active", "change"],
|
|
139
|
+
setup(props, { slots, emit }) {
|
|
140
|
+
return () => {
|
|
141
|
+
const bindings = {
|
|
142
|
+
onChange: (e) => {
|
|
143
|
+
emit("change", e);
|
|
144
|
+
emit("update:active", e.detail?.value);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
for (const [key, value] of Object.entries(props)) {
|
|
148
|
+
if (value !== void 0) bindings[key] = value;
|
|
149
|
+
}
|
|
150
|
+
return h4(WmcpTabs.tagName, bindings, slots.default?.());
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
// src/switch.ts
|
|
156
|
+
import { defineComponent as defineComponent5, h as h5 } from "vue";
|
|
157
|
+
import { WmcpSwitch } from "@webmcpui/core";
|
|
158
|
+
defineOnce(WmcpSwitch.tagName, WmcpSwitch);
|
|
159
|
+
var Switch = defineComponent5({
|
|
160
|
+
name: "WmcpSwitch",
|
|
161
|
+
props: {
|
|
162
|
+
modelValue: { type: Boolean, default: void 0 },
|
|
163
|
+
label: String,
|
|
164
|
+
name: String,
|
|
165
|
+
required: { type: Boolean, default: void 0 },
|
|
166
|
+
disabled: { type: Boolean, default: void 0 },
|
|
167
|
+
expose: { type: Boolean, default: void 0 },
|
|
168
|
+
toolName: String,
|
|
169
|
+
toolDescription: String
|
|
170
|
+
},
|
|
171
|
+
emits: ["update:modelValue", "change"],
|
|
172
|
+
setup(props, { emit }) {
|
|
173
|
+
return () => {
|
|
174
|
+
const bindings = {
|
|
175
|
+
onChange: (e) => {
|
|
176
|
+
emit("update:modelValue", e.target.checked);
|
|
177
|
+
emit("change", e);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
for (const [key, value] of Object.entries(props)) {
|
|
181
|
+
if (value === void 0) continue;
|
|
182
|
+
if (key === "modelValue") bindings.checked = value;
|
|
183
|
+
else bindings[key] = value;
|
|
184
|
+
}
|
|
185
|
+
return h5(WmcpSwitch.tagName, bindings);
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
// src/badge.ts
|
|
191
|
+
import { defineComponent as defineComponent6, h as h6 } from "vue";
|
|
192
|
+
import { WmcpBadge } from "@webmcpui/core";
|
|
193
|
+
defineOnce(WmcpBadge.tagName, WmcpBadge);
|
|
194
|
+
var Badge = defineComponent6({
|
|
195
|
+
name: "WmcpBadge",
|
|
196
|
+
props: { variant: String },
|
|
197
|
+
setup(props, { slots }) {
|
|
198
|
+
return () => {
|
|
199
|
+
const bindings = {};
|
|
200
|
+
for (const [key, value] of Object.entries(props)) {
|
|
201
|
+
if (value !== void 0) bindings[key] = value;
|
|
202
|
+
}
|
|
203
|
+
return h6(WmcpBadge.tagName, bindings, slots.default?.());
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
// src/separator.ts
|
|
209
|
+
import { defineComponent as defineComponent7, h as h7 } from "vue";
|
|
210
|
+
import { WmcpSeparator } from "@webmcpui/core";
|
|
211
|
+
defineOnce(WmcpSeparator.tagName, WmcpSeparator);
|
|
212
|
+
var Separator = defineComponent7({
|
|
213
|
+
name: "WmcpSeparator",
|
|
214
|
+
props: { orientation: String },
|
|
215
|
+
setup(props) {
|
|
216
|
+
return () => {
|
|
217
|
+
const bindings = {};
|
|
218
|
+
for (const [key, value] of Object.entries(props)) {
|
|
219
|
+
if (value !== void 0) bindings[key] = value;
|
|
220
|
+
}
|
|
221
|
+
return h7(WmcpSeparator.tagName, bindings);
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
// src/tooltip.ts
|
|
227
|
+
import { defineComponent as defineComponent8, h as h8 } from "vue";
|
|
228
|
+
import {
|
|
229
|
+
WmcpTooltip
|
|
230
|
+
} from "@webmcpui/core";
|
|
231
|
+
defineOnce(WmcpTooltip.tagName, WmcpTooltip);
|
|
232
|
+
var Tooltip = defineComponent8({
|
|
233
|
+
name: "WmcpTooltip",
|
|
234
|
+
props: {
|
|
235
|
+
label: String,
|
|
236
|
+
placement: String,
|
|
237
|
+
trigger: String,
|
|
238
|
+
name: String,
|
|
239
|
+
expose: { type: Boolean, default: void 0 },
|
|
240
|
+
toolName: String,
|
|
241
|
+
toolDescription: String
|
|
242
|
+
},
|
|
243
|
+
setup(props, { slots }) {
|
|
244
|
+
return () => {
|
|
245
|
+
const bindings = {};
|
|
246
|
+
for (const [k, v] of Object.entries(props)) if (v !== void 0) bindings[k] = v;
|
|
247
|
+
const children = [];
|
|
248
|
+
if (slots.trigger) children.push(h8("span", { slot: "trigger" }, slots.trigger()));
|
|
249
|
+
if (slots.default) children.push(...slots.default());
|
|
250
|
+
return h8(WmcpTooltip.tagName, bindings, children);
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
// src/alert.ts
|
|
256
|
+
import { defineComponent as defineComponent9, h as h9 } from "vue";
|
|
257
|
+
import { WmcpAlert } from "@webmcpui/core";
|
|
258
|
+
defineOnce(WmcpAlert.tagName, WmcpAlert);
|
|
259
|
+
var Alert = defineComponent9({
|
|
260
|
+
name: "WmcpAlert",
|
|
261
|
+
props: { variant: String, title: String },
|
|
262
|
+
setup(props, { slots }) {
|
|
263
|
+
return () => {
|
|
264
|
+
const bindings = {};
|
|
265
|
+
for (const [k, v] of Object.entries(props)) if (v !== void 0) bindings[k] = v;
|
|
266
|
+
return h9(WmcpAlert.tagName, bindings, slots.default?.());
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
// src/progress.ts
|
|
272
|
+
import { defineComponent as defineComponent10, h as h10 } from "vue";
|
|
273
|
+
import { WmcpProgress } from "@webmcpui/core";
|
|
274
|
+
defineOnce(WmcpProgress.tagName, WmcpProgress);
|
|
275
|
+
var Progress = defineComponent10({
|
|
276
|
+
name: "WmcpProgress",
|
|
277
|
+
props: {
|
|
278
|
+
value: Number,
|
|
279
|
+
max: Number,
|
|
280
|
+
indeterminate: { type: Boolean, default: void 0 }
|
|
281
|
+
},
|
|
282
|
+
setup(props) {
|
|
283
|
+
return () => {
|
|
284
|
+
const bindings = {};
|
|
285
|
+
for (const [k, v] of Object.entries(props)) if (v !== void 0) bindings[k] = v;
|
|
286
|
+
return h10(WmcpProgress.tagName, bindings);
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
// src/avatar.ts
|
|
292
|
+
import { defineComponent as defineComponent11, h as h11 } from "vue";
|
|
293
|
+
import { WmcpAvatar } from "@webmcpui/core";
|
|
294
|
+
defineOnce(WmcpAvatar.tagName, WmcpAvatar);
|
|
295
|
+
var Avatar = defineComponent11({
|
|
296
|
+
name: "WmcpAvatar",
|
|
297
|
+
props: { src: String, alt: String, fallback: String },
|
|
298
|
+
setup(props) {
|
|
299
|
+
return () => {
|
|
300
|
+
const bindings = {};
|
|
301
|
+
for (const [k, v] of Object.entries(props)) if (v !== void 0) bindings[k] = v;
|
|
302
|
+
return h11(WmcpAvatar.tagName, bindings);
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
export {
|
|
307
|
+
Alert,
|
|
308
|
+
Avatar,
|
|
309
|
+
Badge,
|
|
310
|
+
Button,
|
|
311
|
+
Dialog,
|
|
312
|
+
Input,
|
|
313
|
+
Progress,
|
|
314
|
+
Separator,
|
|
315
|
+
Switch,
|
|
316
|
+
Tabs,
|
|
317
|
+
Tooltip
|
|
318
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webmcpui/vue",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Idiomatic, typed Vue components for webmcpui — WebMCP-native, accessible, shadcn/Tailwind-aligned. Wraps @webmcpui/core.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Gary Pfaff (Pfaff Digital)",
|
|
7
|
+
"homepage": "https://webmcpui.com",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/webmcpui/webmcpui.git",
|
|
11
|
+
"directory": "packages/vue"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/webmcpui/webmcpui/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"webmcp",
|
|
18
|
+
"vue",
|
|
19
|
+
"ai-agents",
|
|
20
|
+
"components",
|
|
21
|
+
"shadcn",
|
|
22
|
+
"web-components"
|
|
23
|
+
],
|
|
24
|
+
"type": "module",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"import": "./dist/index.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsup",
|
|
36
|
+
"typecheck": "tsc --noEmit",
|
|
37
|
+
"clean": "rm -rf dist"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@webmcpui/core": ">=0.3.0",
|
|
44
|
+
"vue": ">=3.4"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@webmcpui/core": "workspace:*",
|
|
48
|
+
"tsup": "^8.3.5",
|
|
49
|
+
"typescript": "^5.7.2",
|
|
50
|
+
"vue": "^3.5.13"
|
|
51
|
+
}
|
|
52
|
+
}
|