json-render-nuxt-ui 0.0.1 → 0.0.3

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/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2026 Brainchimps GmbH
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,18 +1,178 @@
1
1
  # json-render-nuxt-ui
2
2
 
3
- Nuxt UI adapter package for Vercel `json-render`.
3
+ Pre-built [Nuxt UI](https://ui.nuxt.com/) components for [json-render](https://json-render.dev/). Drop-in catalog definitions and Vue implementations to render JSON specs with Nuxt UI.
4
4
 
5
- ## Install
5
+ ## Compatibility
6
+
7
+ This package aims for compatibility with the official json-render shadcn package and tracks progress against its UI component set in [`SHADCN_UI_COMPONENTS_CHECKLIST.md`](./SHADCN_UI_COMPONENTS_CHECKLIST.md).
8
+
9
+ ## Installation
6
10
 
7
11
  ```bash
8
- pnpm add json-render-nuxt-ui
12
+ npm install json-render-nuxt-ui @json-render/core @json-render/vue @nuxt/ui zod
9
13
  ```
10
14
 
11
- ## Usage
15
+ ## Nuxt Plugin (required)
16
+
17
+ > **Unlike @json-render/shadcn**, Nuxt UI components are auto-imported via compile-time template transforms — they are **not** registered globally at runtime. This package deliberately uses Vue's `resolveComponent()` instead of importing `@nuxt/ui` internals directly, so consumers keep full control over tree-shaking and bundled component set. The trade-off is that you must register the components yourself in a Nuxt plugin. `registerNuxtUiGlobals()` makes this easy.
12
18
 
13
- ```ts
14
- import { helloWord } from "json-render-nuxt-ui";
19
+ Create a plugin file (e.g. `plugins/register-json-render-nuxt-ui.ts`):
15
20
 
16
- console.log(helloWord());
17
- // Hello json-render!
21
+ ```typescript
22
+ import {
23
+ registerNuxtUiGlobals,
24
+ nuxtUiComponentDefinitions,
25
+ } from "json-render-nuxt-ui";
26
+ import {
27
+ UCard,
28
+ UButton,
29
+ UInput,
30
+ USelect,
31
+ UCheckbox,
32
+ UTextarea,
33
+ USwitch,
34
+ UModal,
35
+ } from "#components";
36
+
37
+ export default defineNuxtPlugin((nuxtApp) => {
38
+ registerNuxtUiGlobals(
39
+ nuxtApp,
40
+ { UCard, UButton, UInput, USelect, UCheckbox, UTextarea, USwitch, UModal },
41
+ nuxtUiComponentDefinitions,
42
+ );
43
+ });
18
44
  ```
45
+
46
+ **How it works:**
47
+
48
+ - The second argument is a record of Nuxt UI components imported from `#components` (Nuxt's virtual module). Only these are tree-shakeable — never use `import("#components")` dynamically.
49
+ - The third argument determines which globals to register based on catalog component names. Pass `nuxtUiComponentDefinitions` to register all built-in components, or a subset like `{ Card: ..., Button: ... }` to register only what you use.
50
+ - If you forget a component, you'll see a clear warning in the console telling you exactly which import to add.
51
+
52
+ ## Quick Start
53
+
54
+ ### 1. Create a Catalog
55
+
56
+ Import standard definitions from `json-render-nuxt-ui/catalog` and pass them to `defineCatalog`:
57
+
58
+ ```typescript
59
+ import { defineCatalog } from "@json-render/core";
60
+ import { schema } from "@json-render/vue/schema";
61
+ import { nuxtUiComponentDefinitions } from "json-render-nuxt-ui/catalog";
62
+
63
+ const catalog = defineCatalog(schema, {
64
+ components: {
65
+ Card: nuxtUiComponentDefinitions.Card,
66
+ Header: nuxtUiComponentDefinitions.Header,
67
+ Button: nuxtUiComponentDefinitions.Button,
68
+ Input: nuxtUiComponentDefinitions.Input,
69
+ },
70
+ actions: {},
71
+ });
72
+ ```
73
+
74
+ > **Note:** State actions (`setState`, `pushState`, `removeState`, `validateForm`) are built into the Vue schema and handled automatically by `ActionProvider`.
75
+
76
+ ### 2. Create a Registry
77
+
78
+ Import implementations from `json-render-nuxt-ui` and pass them to `defineRegistry`:
79
+
80
+ ```typescript
81
+ import { defineRegistry } from "@json-render/vue";
82
+ import { nuxtUiComponents } from "json-render-nuxt-ui";
83
+
84
+ const { registry } = defineRegistry(catalog, {
85
+ components: {
86
+ Card: nuxtUiComponents.Card,
87
+ Header: nuxtUiComponents.Header,
88
+ Button: nuxtUiComponents.Button,
89
+ Input: nuxtUiComponents.Input,
90
+ },
91
+ });
92
+ ```
93
+
94
+ ### 3. Render
95
+
96
+ ```vue
97
+ <script setup lang="ts">
98
+ import { JSONUIProvider, Renderer } from "@json-render/vue";
99
+ </script>
100
+
101
+ <template>
102
+ <JSONUIProvider :registry="registry" :initial-state="{}">
103
+ <Renderer :spec="spec" :registry="registry" />
104
+ </JSONUIProvider>
105
+ </template>
106
+ ```
107
+
108
+ ## Extending with Custom Components
109
+
110
+ Start from the built-ins and add your own:
111
+
112
+ ```typescript
113
+ import { z } from "zod";
114
+
115
+ const catalog = defineCatalog(schema, {
116
+ components: {
117
+ Card: nuxtUiComponentDefinitions.Card,
118
+ Header: nuxtUiComponentDefinitions.Header,
119
+ Button: nuxtUiComponentDefinitions.Button,
120
+ Input: nuxtUiComponentDefinitions.Input,
121
+
122
+ Metric: {
123
+ props: z.object({
124
+ label: z.string(),
125
+ value: z.string(),
126
+ }),
127
+ description: "Simple metric item",
128
+ },
129
+ },
130
+ actions: {},
131
+ });
132
+ ```
133
+
134
+ ## Standard Components
135
+
136
+ ### Layout
137
+
138
+ | Component | Description |
139
+ |-----------|-------------|
140
+ | `Card` | Container card with optional title and description |
141
+ | `Header` | Section heading with optional description |
142
+
143
+ ### Input
144
+
145
+ | Component | Description |
146
+ |-----------|-------------|
147
+ | `Button` | Clickable button (emits `press`) |
148
+ | `Input` | Text input with optional two-way state binding on `value` |
149
+ | `Select` | Select input with optional two-way state binding on `value` |
150
+ | `Checkbox` | Checkbox with optional two-way state binding on `checked` |
151
+ | `Textarea` | Multiline input with optional two-way state binding on `value` |
152
+ | `Switch` | Toggle switch with optional two-way state binding on `checked` |
153
+
154
+ ### Overlay
155
+
156
+ | Component | Description |
157
+ |-----------|-------------|
158
+ | `Dialog` | Modal dialog with open binding and `confirm` / `cancel` events |
159
+
160
+ ## Built-in Actions
161
+
162
+ State actions (`setState`, `pushState`, `removeState`, `validateForm`) are built into `@json-render/vue` schema and handled by `ActionProvider`.
163
+
164
+ | Action | Description |
165
+ |--------|-------------|
166
+ | `setState` | Set a value at a state path |
167
+ | `pushState` | Push a value onto an array in state |
168
+ | `removeState` | Remove an item from an array in state |
169
+ | `validateForm` | Validate all fields and write result to state |
170
+
171
+ ## Exports
172
+
173
+ | Entry Point | Exports |
174
+ |-------------|---------|
175
+ | `json-render-nuxt-ui` | `nuxtUiComponents`, `nuxtUiComponentDefinitions`, `registerNuxtUiGlobals` |
176
+ | `json-render-nuxt-ui/catalog` | `nuxtUiComponentDefinitions` |
177
+
178
+ The `/catalog` entry point contains only Zod schemas and can be used in server-side prompt generation. The main entry re-exports `nuxtUiComponentDefinitions` for convenience so you only need one import in your plugin.
@@ -0,0 +1,254 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Type for a component definition.
5
+ */
6
+ type ComponentDefinition = {
7
+ props: z.ZodType;
8
+ slots?: string[];
9
+ events?: string[];
10
+ description: string;
11
+ example?: Record<string, unknown>;
12
+ };
13
+ declare const nuxtUiComponentDefinitions: {
14
+ Stack: {
15
+ props: z.ZodObject<{
16
+ gap: z.ZodOptional<z.ZodEnum<{
17
+ none: "none";
18
+ xs: "xs";
19
+ sm: "sm";
20
+ md: "md";
21
+ lg: "lg";
22
+ xl: "xl";
23
+ }>>;
24
+ }, z.core.$strip>;
25
+ slots: string[];
26
+ description: string;
27
+ };
28
+ Row: {
29
+ props: z.ZodObject<{
30
+ gap: z.ZodOptional<z.ZodEnum<{
31
+ none: "none";
32
+ xs: "xs";
33
+ sm: "sm";
34
+ md: "md";
35
+ lg: "lg";
36
+ xl: "xl";
37
+ }>>;
38
+ align: z.ZodOptional<z.ZodEnum<{
39
+ start: "start";
40
+ center: "center";
41
+ end: "end";
42
+ stretch: "stretch";
43
+ }>>;
44
+ justify: z.ZodOptional<z.ZodEnum<{
45
+ start: "start";
46
+ center: "center";
47
+ end: "end";
48
+ between: "between";
49
+ around: "around";
50
+ }>>;
51
+ wrap: z.ZodOptional<z.ZodBoolean>;
52
+ }, z.core.$strip>;
53
+ slots: string[];
54
+ description: string;
55
+ };
56
+ Divider: {
57
+ props: z.ZodObject<{
58
+ label: z.ZodOptional<z.ZodString>;
59
+ }, z.core.$strip>;
60
+ description: string;
61
+ };
62
+ Text: {
63
+ props: z.ZodObject<{
64
+ content: z.ZodString;
65
+ size: z.ZodOptional<z.ZodEnum<{
66
+ xs: "xs";
67
+ sm: "sm";
68
+ md: "md";
69
+ lg: "lg";
70
+ }>>;
71
+ color: z.ZodOptional<z.ZodEnum<{
72
+ default: "default";
73
+ muted: "muted";
74
+ dimmed: "dimmed";
75
+ }>>;
76
+ }, z.core.$strip>;
77
+ description: string;
78
+ };
79
+ Card: {
80
+ props: z.ZodObject<{
81
+ title: z.ZodOptional<z.ZodString>;
82
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
83
+ }, z.core.$strip>;
84
+ slots: string[];
85
+ description: string;
86
+ };
87
+ Header: {
88
+ props: z.ZodObject<{
89
+ text: z.ZodString;
90
+ level: z.ZodOptional<z.ZodEnum<{
91
+ h1: "h1";
92
+ h2: "h2";
93
+ h3: "h3";
94
+ h4: "h4";
95
+ h5: "h5";
96
+ h6: "h6";
97
+ }>>;
98
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
99
+ }, z.core.$strip>;
100
+ description: string;
101
+ };
102
+ Button: {
103
+ props: z.ZodObject<{
104
+ label: z.ZodString;
105
+ color: z.ZodOptional<z.ZodEnum<{
106
+ success: "success";
107
+ error: "error";
108
+ primary: "primary";
109
+ secondary: "secondary";
110
+ info: "info";
111
+ warning: "warning";
112
+ neutral: "neutral";
113
+ }>>;
114
+ variant: z.ZodOptional<z.ZodEnum<{
115
+ link: "link";
116
+ solid: "solid";
117
+ outline: "outline";
118
+ soft: "soft";
119
+ subtle: "subtle";
120
+ ghost: "ghost";
121
+ }>>;
122
+ size: z.ZodOptional<z.ZodEnum<{
123
+ xs: "xs";
124
+ sm: "sm";
125
+ md: "md";
126
+ lg: "lg";
127
+ xl: "xl";
128
+ }>>;
129
+ icon: z.ZodOptional<z.ZodString>;
130
+ loading: z.ZodOptional<z.ZodBoolean>;
131
+ disabled: z.ZodOptional<z.ZodBoolean>;
132
+ }, z.core.$strip>;
133
+ description: string;
134
+ events: string[];
135
+ };
136
+ Input: {
137
+ props: z.ZodObject<{
138
+ value: z.ZodOptional<z.ZodNullable<z.ZodString>>;
139
+ placeholder: z.ZodOptional<z.ZodString>;
140
+ type: z.ZodOptional<z.ZodEnum<{
141
+ number: "number";
142
+ search: "search";
143
+ text: "text";
144
+ email: "email";
145
+ password: "password";
146
+ tel: "tel";
147
+ url: "url";
148
+ }>>;
149
+ size: z.ZodOptional<z.ZodEnum<{
150
+ xs: "xs";
151
+ sm: "sm";
152
+ md: "md";
153
+ lg: "lg";
154
+ xl: "xl";
155
+ }>>;
156
+ disabled: z.ZodOptional<z.ZodBoolean>;
157
+ autofocus: z.ZodOptional<z.ZodBoolean>;
158
+ }, z.core.$strip>;
159
+ description: string;
160
+ events: string[];
161
+ };
162
+ Select: {
163
+ props: z.ZodObject<{
164
+ value: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
165
+ items: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
166
+ label: z.ZodString;
167
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
168
+ disabled: z.ZodOptional<z.ZodBoolean>;
169
+ }, z.core.$strip>]>>>;
170
+ placeholder: z.ZodOptional<z.ZodString>;
171
+ size: z.ZodOptional<z.ZodEnum<{
172
+ xs: "xs";
173
+ sm: "sm";
174
+ md: "md";
175
+ lg: "lg";
176
+ xl: "xl";
177
+ }>>;
178
+ disabled: z.ZodOptional<z.ZodBoolean>;
179
+ }, z.core.$strip>;
180
+ description: string;
181
+ events: string[];
182
+ };
183
+ Checkbox: {
184
+ props: z.ZodObject<{
185
+ checked: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
186
+ label: z.ZodOptional<z.ZodString>;
187
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
188
+ disabled: z.ZodOptional<z.ZodBoolean>;
189
+ }, z.core.$strip>;
190
+ description: string;
191
+ events: string[];
192
+ };
193
+ Textarea: {
194
+ props: z.ZodObject<{
195
+ value: z.ZodOptional<z.ZodNullable<z.ZodString>>;
196
+ placeholder: z.ZodOptional<z.ZodString>;
197
+ rows: z.ZodOptional<z.ZodNumber>;
198
+ autoresize: z.ZodOptional<z.ZodBoolean>;
199
+ maxrows: z.ZodOptional<z.ZodNumber>;
200
+ disabled: z.ZodOptional<z.ZodBoolean>;
201
+ }, z.core.$strip>;
202
+ description: string;
203
+ events: string[];
204
+ };
205
+ Switch: {
206
+ props: z.ZodObject<{
207
+ checked: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
208
+ label: z.ZodOptional<z.ZodString>;
209
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
210
+ disabled: z.ZodOptional<z.ZodBoolean>;
211
+ }, z.core.$strip>;
212
+ description: string;
213
+ events: string[];
214
+ };
215
+ Dialog: {
216
+ props: z.ZodObject<{
217
+ open: z.ZodOptional<z.ZodBoolean>;
218
+ title: z.ZodOptional<z.ZodString>;
219
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
220
+ confirmLabel: z.ZodOptional<z.ZodString>;
221
+ cancelLabel: z.ZodOptional<z.ZodString>;
222
+ confirmColor: z.ZodOptional<z.ZodEnum<{
223
+ success: "success";
224
+ error: "error";
225
+ primary: "primary";
226
+ secondary: "secondary";
227
+ info: "info";
228
+ warning: "warning";
229
+ neutral: "neutral";
230
+ }>>;
231
+ confirmVariant: z.ZodOptional<z.ZodEnum<{
232
+ link: "link";
233
+ solid: "solid";
234
+ outline: "outline";
235
+ soft: "soft";
236
+ subtle: "subtle";
237
+ ghost: "ghost";
238
+ }>>;
239
+ closeOnConfirm: z.ZodOptional<z.ZodBoolean>;
240
+ }, z.core.$strip>;
241
+ slots: string[];
242
+ description: string;
243
+ events: string[];
244
+ };
245
+ };
246
+ /**
247
+ * Infer the props type for a Nuxt UI component by name.
248
+ * Derives the TypeScript type directly from the Zod schema,
249
+ * so component implementations stay in sync with catalog definitions.
250
+ */
251
+ type NuxtUiComponentName = keyof typeof nuxtUiComponentDefinitions;
252
+ type NuxtUiProps<K extends NuxtUiComponentName> = z.output<(typeof nuxtUiComponentDefinitions)[K]["props"]>;
253
+
254
+ export { type ComponentDefinition, type NuxtUiComponentName, type NuxtUiProps, nuxtUiComponentDefinitions };
@@ -0,0 +1,254 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Type for a component definition.
5
+ */
6
+ type ComponentDefinition = {
7
+ props: z.ZodType;
8
+ slots?: string[];
9
+ events?: string[];
10
+ description: string;
11
+ example?: Record<string, unknown>;
12
+ };
13
+ declare const nuxtUiComponentDefinitions: {
14
+ Stack: {
15
+ props: z.ZodObject<{
16
+ gap: z.ZodOptional<z.ZodEnum<{
17
+ none: "none";
18
+ xs: "xs";
19
+ sm: "sm";
20
+ md: "md";
21
+ lg: "lg";
22
+ xl: "xl";
23
+ }>>;
24
+ }, z.core.$strip>;
25
+ slots: string[];
26
+ description: string;
27
+ };
28
+ Row: {
29
+ props: z.ZodObject<{
30
+ gap: z.ZodOptional<z.ZodEnum<{
31
+ none: "none";
32
+ xs: "xs";
33
+ sm: "sm";
34
+ md: "md";
35
+ lg: "lg";
36
+ xl: "xl";
37
+ }>>;
38
+ align: z.ZodOptional<z.ZodEnum<{
39
+ start: "start";
40
+ center: "center";
41
+ end: "end";
42
+ stretch: "stretch";
43
+ }>>;
44
+ justify: z.ZodOptional<z.ZodEnum<{
45
+ start: "start";
46
+ center: "center";
47
+ end: "end";
48
+ between: "between";
49
+ around: "around";
50
+ }>>;
51
+ wrap: z.ZodOptional<z.ZodBoolean>;
52
+ }, z.core.$strip>;
53
+ slots: string[];
54
+ description: string;
55
+ };
56
+ Divider: {
57
+ props: z.ZodObject<{
58
+ label: z.ZodOptional<z.ZodString>;
59
+ }, z.core.$strip>;
60
+ description: string;
61
+ };
62
+ Text: {
63
+ props: z.ZodObject<{
64
+ content: z.ZodString;
65
+ size: z.ZodOptional<z.ZodEnum<{
66
+ xs: "xs";
67
+ sm: "sm";
68
+ md: "md";
69
+ lg: "lg";
70
+ }>>;
71
+ color: z.ZodOptional<z.ZodEnum<{
72
+ default: "default";
73
+ muted: "muted";
74
+ dimmed: "dimmed";
75
+ }>>;
76
+ }, z.core.$strip>;
77
+ description: string;
78
+ };
79
+ Card: {
80
+ props: z.ZodObject<{
81
+ title: z.ZodOptional<z.ZodString>;
82
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
83
+ }, z.core.$strip>;
84
+ slots: string[];
85
+ description: string;
86
+ };
87
+ Header: {
88
+ props: z.ZodObject<{
89
+ text: z.ZodString;
90
+ level: z.ZodOptional<z.ZodEnum<{
91
+ h1: "h1";
92
+ h2: "h2";
93
+ h3: "h3";
94
+ h4: "h4";
95
+ h5: "h5";
96
+ h6: "h6";
97
+ }>>;
98
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
99
+ }, z.core.$strip>;
100
+ description: string;
101
+ };
102
+ Button: {
103
+ props: z.ZodObject<{
104
+ label: z.ZodString;
105
+ color: z.ZodOptional<z.ZodEnum<{
106
+ success: "success";
107
+ error: "error";
108
+ primary: "primary";
109
+ secondary: "secondary";
110
+ info: "info";
111
+ warning: "warning";
112
+ neutral: "neutral";
113
+ }>>;
114
+ variant: z.ZodOptional<z.ZodEnum<{
115
+ link: "link";
116
+ solid: "solid";
117
+ outline: "outline";
118
+ soft: "soft";
119
+ subtle: "subtle";
120
+ ghost: "ghost";
121
+ }>>;
122
+ size: z.ZodOptional<z.ZodEnum<{
123
+ xs: "xs";
124
+ sm: "sm";
125
+ md: "md";
126
+ lg: "lg";
127
+ xl: "xl";
128
+ }>>;
129
+ icon: z.ZodOptional<z.ZodString>;
130
+ loading: z.ZodOptional<z.ZodBoolean>;
131
+ disabled: z.ZodOptional<z.ZodBoolean>;
132
+ }, z.core.$strip>;
133
+ description: string;
134
+ events: string[];
135
+ };
136
+ Input: {
137
+ props: z.ZodObject<{
138
+ value: z.ZodOptional<z.ZodNullable<z.ZodString>>;
139
+ placeholder: z.ZodOptional<z.ZodString>;
140
+ type: z.ZodOptional<z.ZodEnum<{
141
+ number: "number";
142
+ search: "search";
143
+ text: "text";
144
+ email: "email";
145
+ password: "password";
146
+ tel: "tel";
147
+ url: "url";
148
+ }>>;
149
+ size: z.ZodOptional<z.ZodEnum<{
150
+ xs: "xs";
151
+ sm: "sm";
152
+ md: "md";
153
+ lg: "lg";
154
+ xl: "xl";
155
+ }>>;
156
+ disabled: z.ZodOptional<z.ZodBoolean>;
157
+ autofocus: z.ZodOptional<z.ZodBoolean>;
158
+ }, z.core.$strip>;
159
+ description: string;
160
+ events: string[];
161
+ };
162
+ Select: {
163
+ props: z.ZodObject<{
164
+ value: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
165
+ items: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
166
+ label: z.ZodString;
167
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
168
+ disabled: z.ZodOptional<z.ZodBoolean>;
169
+ }, z.core.$strip>]>>>;
170
+ placeholder: z.ZodOptional<z.ZodString>;
171
+ size: z.ZodOptional<z.ZodEnum<{
172
+ xs: "xs";
173
+ sm: "sm";
174
+ md: "md";
175
+ lg: "lg";
176
+ xl: "xl";
177
+ }>>;
178
+ disabled: z.ZodOptional<z.ZodBoolean>;
179
+ }, z.core.$strip>;
180
+ description: string;
181
+ events: string[];
182
+ };
183
+ Checkbox: {
184
+ props: z.ZodObject<{
185
+ checked: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
186
+ label: z.ZodOptional<z.ZodString>;
187
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
188
+ disabled: z.ZodOptional<z.ZodBoolean>;
189
+ }, z.core.$strip>;
190
+ description: string;
191
+ events: string[];
192
+ };
193
+ Textarea: {
194
+ props: z.ZodObject<{
195
+ value: z.ZodOptional<z.ZodNullable<z.ZodString>>;
196
+ placeholder: z.ZodOptional<z.ZodString>;
197
+ rows: z.ZodOptional<z.ZodNumber>;
198
+ autoresize: z.ZodOptional<z.ZodBoolean>;
199
+ maxrows: z.ZodOptional<z.ZodNumber>;
200
+ disabled: z.ZodOptional<z.ZodBoolean>;
201
+ }, z.core.$strip>;
202
+ description: string;
203
+ events: string[];
204
+ };
205
+ Switch: {
206
+ props: z.ZodObject<{
207
+ checked: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
208
+ label: z.ZodOptional<z.ZodString>;
209
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
210
+ disabled: z.ZodOptional<z.ZodBoolean>;
211
+ }, z.core.$strip>;
212
+ description: string;
213
+ events: string[];
214
+ };
215
+ Dialog: {
216
+ props: z.ZodObject<{
217
+ open: z.ZodOptional<z.ZodBoolean>;
218
+ title: z.ZodOptional<z.ZodString>;
219
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
220
+ confirmLabel: z.ZodOptional<z.ZodString>;
221
+ cancelLabel: z.ZodOptional<z.ZodString>;
222
+ confirmColor: z.ZodOptional<z.ZodEnum<{
223
+ success: "success";
224
+ error: "error";
225
+ primary: "primary";
226
+ secondary: "secondary";
227
+ info: "info";
228
+ warning: "warning";
229
+ neutral: "neutral";
230
+ }>>;
231
+ confirmVariant: z.ZodOptional<z.ZodEnum<{
232
+ link: "link";
233
+ solid: "solid";
234
+ outline: "outline";
235
+ soft: "soft";
236
+ subtle: "subtle";
237
+ ghost: "ghost";
238
+ }>>;
239
+ closeOnConfirm: z.ZodOptional<z.ZodBoolean>;
240
+ }, z.core.$strip>;
241
+ slots: string[];
242
+ description: string;
243
+ events: string[];
244
+ };
245
+ };
246
+ /**
247
+ * Infer the props type for a Nuxt UI component by name.
248
+ * Derives the TypeScript type directly from the Zod schema,
249
+ * so component implementations stay in sync with catalog definitions.
250
+ */
251
+ type NuxtUiComponentName = keyof typeof nuxtUiComponentDefinitions;
252
+ type NuxtUiProps<K extends NuxtUiComponentName> = z.output<(typeof nuxtUiComponentDefinitions)[K]["props"]>;
253
+
254
+ export { type ComponentDefinition, type NuxtUiComponentName, type NuxtUiProps, nuxtUiComponentDefinitions };