json-render-nuxt-ui 0.0.2 → 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/dist/index.mjs ADDED
@@ -0,0 +1,296 @@
1
+ import {
2
+ nuxtUiComponentDefinitions
3
+ } from "./chunk-C6RGC4NH.mjs";
4
+
5
+ // src/components.ts
6
+ import { h, resolveComponent } from "vue";
7
+ import { useBoundProp } from "@json-render/vue";
8
+ var gapClass = {
9
+ none: "gap-0",
10
+ xs: "gap-1",
11
+ sm: "gap-2",
12
+ md: "gap-4",
13
+ lg: "gap-6",
14
+ xl: "gap-8"
15
+ };
16
+ var nuxtUiComponents = {
17
+ Stack: ({ props, children }) => {
18
+ const gap = gapClass[props.gap ?? "md"];
19
+ return h("div", { class: `flex flex-col ${gap}` }, children);
20
+ },
21
+ Row: ({ props, children }) => {
22
+ const gap = gapClass[props.gap ?? "md"];
23
+ const alignMap = {
24
+ start: "items-start",
25
+ center: "items-center",
26
+ end: "items-end",
27
+ stretch: "items-stretch"
28
+ };
29
+ const justifyMap = {
30
+ start: "justify-start",
31
+ center: "justify-center",
32
+ end: "justify-end",
33
+ between: "justify-between",
34
+ around: "justify-around"
35
+ };
36
+ const classes = [
37
+ "flex flex-row",
38
+ gap,
39
+ alignMap[props.align ?? "center"],
40
+ justifyMap[props.justify ?? "start"],
41
+ props.wrap ? "flex-wrap" : ""
42
+ ].filter(Boolean).join(" ");
43
+ return h("div", { class: classes }, children);
44
+ },
45
+ Divider: ({ props }) => {
46
+ if (props.label) {
47
+ return h("div", { class: "flex items-center gap-3 my-2" }, [
48
+ h("hr", { class: "flex-1 border-default" }),
49
+ h("span", { class: "text-xs text-dimmed shrink-0" }, props.label),
50
+ h("hr", { class: "flex-1 border-default" })
51
+ ]);
52
+ }
53
+ return h("hr", { class: "border-default my-2" });
54
+ },
55
+ Text: ({ props }) => {
56
+ const sizeClass = {
57
+ xs: "text-xs",
58
+ sm: "text-sm",
59
+ md: "text-base",
60
+ lg: "text-lg"
61
+ };
62
+ const colorClass = {
63
+ default: "text-default",
64
+ muted: "text-muted",
65
+ dimmed: "text-dimmed"
66
+ };
67
+ const classes = [
68
+ sizeClass[props.size ?? "sm"],
69
+ colorClass[props.color ?? "default"]
70
+ ].join(" ");
71
+ return h("p", { class: classes }, props.content);
72
+ },
73
+ Card: ({ props, children }) => {
74
+ const UCard = resolveComponent("UCard");
75
+ const hasHeader = Boolean(props.title || props.description);
76
+ return h(UCard, null, {
77
+ header: hasHeader ? () => h("div", { class: "space-y-1" }, [
78
+ props.title ? h("h3", { class: "text-base font-semibold" }, props.title) : null,
79
+ props.description ? h("p", { class: "text-sm text-muted" }, props.description) : null
80
+ ]) : void 0,
81
+ default: () => h("div", { class: "space-y-4" }, children)
82
+ });
83
+ },
84
+ Header: ({ props }) => {
85
+ const level = props.level ?? "h2";
86
+ const titleClassByLevel = {
87
+ h1: "text-3xl font-bold tracking-tight",
88
+ h2: "text-2xl font-semibold tracking-tight",
89
+ h3: "text-xl font-semibold",
90
+ h4: "text-lg font-semibold",
91
+ h5: "text-base font-semibold",
92
+ h6: "text-sm font-semibold uppercase tracking-wide"
93
+ };
94
+ return h("header", { class: "space-y-1" }, [
95
+ h(level, { class: titleClassByLevel[level] }, props.text),
96
+ props.description ? h("p", { class: "text-sm text-muted" }, props.description) : null
97
+ ]);
98
+ },
99
+ Button: ({ props, on }) => {
100
+ const UButton = resolveComponent("UButton");
101
+ const press = on("press");
102
+ return h(UButton, {
103
+ label: props.label,
104
+ color: props.color,
105
+ variant: props.variant,
106
+ size: props.size,
107
+ icon: props.icon,
108
+ loading: props.loading,
109
+ disabled: props.disabled,
110
+ onClick: (event) => {
111
+ if (press.shouldPreventDefault) {
112
+ event.preventDefault();
113
+ }
114
+ press.emit();
115
+ }
116
+ });
117
+ },
118
+ Input: ({ props, bindings, emit }) => {
119
+ const UInput = resolveComponent("UInput");
120
+ const [value, setValue] = useBoundProp(
121
+ props.value,
122
+ bindings?.value
123
+ );
124
+ return h(UInput, {
125
+ modelValue: value ?? "",
126
+ type: props.type ?? "text",
127
+ placeholder: props.placeholder,
128
+ size: props.size,
129
+ disabled: props.disabled,
130
+ autofocus: props.autofocus,
131
+ "onUpdate:modelValue": (nextValue) => {
132
+ setValue(nextValue);
133
+ emit("change");
134
+ }
135
+ });
136
+ },
137
+ Select: ({ props, bindings, emit }) => {
138
+ const USelect = resolveComponent("USelect");
139
+ const [value, setValue] = useBoundProp(props.value, bindings?.value);
140
+ return h(USelect, {
141
+ modelValue: value ?? null,
142
+ items: props.items ?? [],
143
+ placeholder: props.placeholder,
144
+ size: props.size,
145
+ disabled: props.disabled,
146
+ "onUpdate:modelValue": (nextValue) => {
147
+ setValue(nextValue);
148
+ emit("change");
149
+ }
150
+ });
151
+ },
152
+ Checkbox: ({ props, bindings, emit }) => {
153
+ const UCheckbox = resolveComponent("UCheckbox");
154
+ const [checked, setChecked] = useBoundProp(
155
+ props.checked,
156
+ bindings?.checked
157
+ );
158
+ return h(UCheckbox, {
159
+ modelValue: checked ?? false,
160
+ label: props.label,
161
+ description: props.description ?? void 0,
162
+ disabled: props.disabled,
163
+ "onUpdate:modelValue": (nextValue) => {
164
+ setChecked(nextValue);
165
+ emit("change");
166
+ }
167
+ });
168
+ },
169
+ Textarea: ({ props, bindings, emit }) => {
170
+ const UTextarea = resolveComponent("UTextarea");
171
+ const [value, setValue] = useBoundProp(
172
+ props.value,
173
+ bindings?.value
174
+ );
175
+ return h(UTextarea, {
176
+ modelValue: value ?? "",
177
+ placeholder: props.placeholder,
178
+ rows: props.rows,
179
+ autoresize: props.autoresize,
180
+ maxrows: props.maxrows,
181
+ disabled: props.disabled,
182
+ "onUpdate:modelValue": (nextValue) => {
183
+ setValue(nextValue);
184
+ emit("change");
185
+ }
186
+ });
187
+ },
188
+ Switch: ({ props, bindings, emit }) => {
189
+ const USwitch = resolveComponent("USwitch");
190
+ const [checked, setChecked] = useBoundProp(
191
+ props.checked,
192
+ bindings?.checked
193
+ );
194
+ return h(USwitch, {
195
+ modelValue: checked ?? false,
196
+ label: props.label,
197
+ description: props.description ?? void 0,
198
+ disabled: props.disabled,
199
+ "onUpdate:modelValue": (nextValue) => {
200
+ setChecked(nextValue);
201
+ emit("change");
202
+ }
203
+ });
204
+ },
205
+ Dialog: ({ props, bindings, children, emit, on }) => {
206
+ const UModal = resolveComponent("UModal");
207
+ const UButton = resolveComponent("UButton");
208
+ const [open, setOpen] = useBoundProp(
209
+ props.open,
210
+ bindings?.open
211
+ );
212
+ const confirm = on("confirm");
213
+ const cancel = on("cancel");
214
+ const updateOpen = (nextOpen) => {
215
+ setOpen(nextOpen);
216
+ emit("openChange");
217
+ };
218
+ return h(
219
+ UModal,
220
+ {
221
+ open: open ?? false,
222
+ title: props.title,
223
+ description: props.description ?? void 0,
224
+ "onUpdate:open": (nextOpen) => updateOpen(nextOpen)
225
+ },
226
+ {
227
+ default: () => children,
228
+ footer: () => h("div", { class: "flex justify-end gap-2" }, [
229
+ h(UButton, {
230
+ variant: "ghost",
231
+ label: props.cancelLabel ?? "Cancel",
232
+ onClick: (event) => {
233
+ if (cancel.shouldPreventDefault) {
234
+ event.preventDefault();
235
+ }
236
+ cancel.emit();
237
+ updateOpen(false);
238
+ }
239
+ }),
240
+ h(UButton, {
241
+ color: props.confirmColor ?? "primary",
242
+ variant: props.confirmVariant ?? "solid",
243
+ label: props.confirmLabel ?? "Confirm",
244
+ onClick: (event) => {
245
+ if (confirm.shouldPreventDefault) {
246
+ event.preventDefault();
247
+ }
248
+ confirm.emit();
249
+ if (props.closeOnConfirm !== false) {
250
+ updateOpen(false);
251
+ }
252
+ }
253
+ })
254
+ ])
255
+ }
256
+ );
257
+ }
258
+ };
259
+
260
+ // src/globals.ts
261
+ var nuxtUiGlobalDeps = {
262
+ Card: ["UCard"],
263
+ Button: ["UButton"],
264
+ Input: ["UInput"],
265
+ Select: ["USelect"],
266
+ Checkbox: ["UCheckbox"],
267
+ Textarea: ["UTextarea"],
268
+ Switch: ["USwitch"],
269
+ Dialog: ["UModal", "UButton"]
270
+ };
271
+ function registerNuxtUiGlobals(nuxtApp, resolved, catalogComponents) {
272
+ const filterKeys = Array.isArray(catalogComponents) ? catalogComponents : Object.keys(catalogComponents);
273
+ const needed = /* @__PURE__ */ new Map();
274
+ for (const key of filterKeys) {
275
+ const deps = nuxtUiGlobalDeps[key];
276
+ if (deps) {
277
+ for (const dep of deps) needed.set(dep, key);
278
+ }
279
+ }
280
+ for (const [name, catalogName] of needed) {
281
+ const comp = resolved[name];
282
+ if (comp) {
283
+ nuxtApp.vueApp.component(name, comp);
284
+ } else {
285
+ console.warn(
286
+ `[json-render-nuxt-ui] Missing "${name}" \u2014 required by the "${catalogName}" component. Import it (import { ${name} } from "#components") and pass it to your registerNuxtUiGlobals() call.`
287
+ );
288
+ }
289
+ }
290
+ }
291
+ export {
292
+ nuxtUiComponentDefinitions,
293
+ nuxtUiComponents,
294
+ registerNuxtUiGlobals
295
+ };
296
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components.ts","../src/globals.ts"],"sourcesContent":["import { h, resolveComponent } from \"vue\";\nimport { useBoundProp, type BaseComponentProps } from \"@json-render/vue\";\nimport type { NuxtUiComponentName, NuxtUiProps } from \"./catalog\";\n\ntype ComponentMap = {\n [K in NuxtUiComponentName]: (\n ctx: BaseComponentProps<NuxtUiProps<K>>\n ) => ReturnType<typeof h>;\n};\n\nconst gapClass: Record<string, string> = {\n none: \"gap-0\",\n xs: \"gap-1\",\n sm: \"gap-2\",\n md: \"gap-4\",\n lg: \"gap-6\",\n xl: \"gap-8\",\n};\n\nexport const nuxtUiComponents: ComponentMap = {\n Stack: ({ props, children }) => {\n const gap = gapClass[props.gap ?? \"md\"];\n return h(\"div\", { class: `flex flex-col ${gap}` }, children);\n },\n\n Row: ({ props, children }) => {\n const gap = gapClass[props.gap ?? \"md\"];\n const alignMap: Record<string, string> = {\n start: \"items-start\",\n center: \"items-center\",\n end: \"items-end\",\n stretch: \"items-stretch\",\n };\n const justifyMap: Record<string, string> = {\n start: \"justify-start\",\n center: \"justify-center\",\n end: \"justify-end\",\n between: \"justify-between\",\n around: \"justify-around\",\n };\n const classes = [\n \"flex flex-row\",\n gap,\n alignMap[props.align ?? \"center\"],\n justifyMap[props.justify ?? \"start\"],\n props.wrap ? \"flex-wrap\" : \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n return h(\"div\", { class: classes }, children);\n },\n\n Divider: ({ props }) => {\n if (props.label) {\n return h(\"div\", { class: \"flex items-center gap-3 my-2\" }, [\n h(\"hr\", { class: \"flex-1 border-default\" }),\n h(\"span\", { class: \"text-xs text-dimmed shrink-0\" }, props.label),\n h(\"hr\", { class: \"flex-1 border-default\" }),\n ]);\n }\n return h(\"hr\", { class: \"border-default my-2\" });\n },\n\n Text: ({ props }) => {\n const sizeClass: Record<string, string> = {\n xs: \"text-xs\",\n sm: \"text-sm\",\n md: \"text-base\",\n lg: \"text-lg\",\n };\n const colorClass: Record<string, string> = {\n default: \"text-default\",\n muted: \"text-muted\",\n dimmed: \"text-dimmed\",\n };\n const classes = [\n sizeClass[props.size ?? \"sm\"],\n colorClass[props.color ?? \"default\"],\n ].join(\" \");\n return h(\"p\", { class: classes }, props.content);\n },\n\n Card: ({ props, children }) => {\n const UCard = resolveComponent(\"UCard\");\n const hasHeader = Boolean(props.title || props.description);\n\n return h(UCard, null, {\n header: hasHeader\n ? () =>\n h(\"div\", { class: \"space-y-1\" }, [\n props.title\n ? h(\"h3\", { class: \"text-base font-semibold\" }, props.title)\n : null,\n props.description\n ? h(\"p\", { class: \"text-sm text-muted\" }, props.description)\n : null,\n ])\n : undefined,\n default: () => h(\"div\", { class: \"space-y-4\" }, children),\n });\n },\n\n Header: ({ props }) => {\n const level = props.level ?? \"h2\";\n const titleClassByLevel: Record<string, string> = {\n h1: \"text-3xl font-bold tracking-tight\",\n h2: \"text-2xl font-semibold tracking-tight\",\n h3: \"text-xl font-semibold\",\n h4: \"text-lg font-semibold\",\n h5: \"text-base font-semibold\",\n h6: \"text-sm font-semibold uppercase tracking-wide\",\n };\n\n return h(\"header\", { class: \"space-y-1\" }, [\n h(level, { class: titleClassByLevel[level] }, props.text),\n props.description\n ? h(\"p\", { class: \"text-sm text-muted\" }, props.description)\n : null,\n ]);\n },\n\n Button: ({ props, on }) => {\n const UButton = resolveComponent(\"UButton\");\n const press = on(\"press\");\n\n return h(UButton, {\n label: props.label,\n color: props.color,\n variant: props.variant,\n size: props.size,\n icon: props.icon,\n loading: props.loading,\n disabled: props.disabled,\n onClick: (event: Event) => {\n if (press.shouldPreventDefault) {\n event.preventDefault();\n }\n press.emit();\n },\n });\n },\n\n Input: ({ props, bindings, emit }) => {\n const UInput = resolveComponent(\"UInput\");\n const [value, setValue] = useBoundProp<string | null | undefined>(\n props.value,\n bindings?.value\n );\n\n return h(UInput, {\n modelValue: value ?? \"\",\n type: props.type ?? \"text\",\n placeholder: props.placeholder,\n size: props.size,\n disabled: props.disabled,\n autofocus: props.autofocus,\n \"onUpdate:modelValue\": (nextValue: string) => {\n setValue(nextValue);\n emit(\"change\");\n },\n });\n },\n\n Select: ({ props, bindings, emit }) => {\n const USelect = resolveComponent(\"USelect\");\n const [value, setValue] = useBoundProp<\n string | number | boolean | null | undefined\n >(props.value, bindings?.value);\n\n return h(USelect, {\n modelValue: value ?? null,\n items: props.items ?? [],\n placeholder: props.placeholder,\n size: props.size,\n disabled: props.disabled,\n \"onUpdate:modelValue\": (nextValue: string | number | boolean | null) => {\n setValue(nextValue);\n emit(\"change\");\n },\n });\n },\n\n Checkbox: ({ props, bindings, emit }) => {\n const UCheckbox = resolveComponent(\"UCheckbox\");\n const [checked, setChecked] = useBoundProp<boolean | null | undefined>(\n props.checked,\n bindings?.checked\n );\n\n return h(UCheckbox, {\n modelValue: checked ?? false,\n label: props.label,\n description: props.description ?? undefined,\n disabled: props.disabled,\n \"onUpdate:modelValue\": (nextValue: boolean) => {\n setChecked(nextValue);\n emit(\"change\");\n },\n });\n },\n\n Textarea: ({ props, bindings, emit }) => {\n const UTextarea = resolveComponent(\"UTextarea\");\n const [value, setValue] = useBoundProp<string | null | undefined>(\n props.value,\n bindings?.value\n );\n\n return h(UTextarea, {\n modelValue: value ?? \"\",\n placeholder: props.placeholder,\n rows: props.rows,\n autoresize: props.autoresize,\n maxrows: props.maxrows,\n disabled: props.disabled,\n \"onUpdate:modelValue\": (nextValue: string) => {\n setValue(nextValue);\n emit(\"change\");\n },\n });\n },\n\n Switch: ({ props, bindings, emit }) => {\n const USwitch = resolveComponent(\"USwitch\");\n const [checked, setChecked] = useBoundProp<boolean | null | undefined>(\n props.checked,\n bindings?.checked\n );\n\n return h(USwitch, {\n modelValue: checked ?? false,\n label: props.label,\n description: props.description ?? undefined,\n disabled: props.disabled,\n \"onUpdate:modelValue\": (nextValue: boolean) => {\n setChecked(nextValue);\n emit(\"change\");\n },\n });\n },\n\n Dialog: ({ props, bindings, children, emit, on }) => {\n const UModal = resolveComponent(\"UModal\");\n const UButton = resolveComponent(\"UButton\");\n const [open, setOpen] = useBoundProp<boolean | undefined>(\n props.open,\n bindings?.open\n );\n const confirm = on(\"confirm\");\n const cancel = on(\"cancel\");\n\n const updateOpen = (nextOpen: boolean) => {\n setOpen(nextOpen);\n emit(\"openChange\");\n };\n\n return h(\n UModal,\n {\n open: open ?? false,\n title: props.title,\n description: props.description ?? undefined,\n \"onUpdate:open\": (nextOpen: boolean) => updateOpen(nextOpen),\n },\n {\n default: () => children,\n footer: () =>\n h(\"div\", { class: \"flex justify-end gap-2\" }, [\n h(UButton, {\n variant: \"ghost\",\n label: props.cancelLabel ?? \"Cancel\",\n onClick: (event: Event) => {\n if (cancel.shouldPreventDefault) {\n event.preventDefault();\n }\n cancel.emit();\n updateOpen(false);\n },\n }),\n h(UButton, {\n color: props.confirmColor ?? \"primary\",\n variant: props.confirmVariant ?? \"solid\",\n label: props.confirmLabel ?? \"Confirm\",\n onClick: (event: Event) => {\n if (confirm.shouldPreventDefault) {\n event.preventDefault();\n }\n confirm.emit();\n if (props.closeOnConfirm !== false) {\n updateOpen(false);\n }\n },\n }),\n ]),\n }\n );\n },\n};\n","import type { Component } from \"vue\";\nimport type { ComponentDefinition, NuxtUiComponentName } from \"./catalog\";\n\n/**\n * Maps json-render catalog component names to the Nuxt UI global component\n * names they depend on at runtime via `resolveComponent()`.\n *\n * Components that only use native HTML elements (e.g. Header) have no entry.\n */\nexport const nuxtUiGlobalDeps: Readonly<\n Partial<Record<NuxtUiComponentName, readonly string[]>>\n> = {\n Card: [\"UCard\"],\n Button: [\"UButton\"],\n Input: [\"UInput\"],\n Select: [\"USelect\"],\n Checkbox: [\"UCheckbox\"],\n Textarea: [\"UTextarea\"],\n Switch: [\"USwitch\"],\n Dialog: [\"UModal\", \"UButton\"],\n};\n\ntype NuxtAppLike = {\n vueApp: { component(name: string, comp: Component): void };\n};\n\n/**\n * Globally register the Nuxt UI components that json-render-nuxt-ui\n * needs at runtime.\n *\n * Nuxt auto-imports resolve `@nuxt/ui` components at compile time via\n * template transforms — they are NOT registered globally at runtime. The\n * json-render component registry uses Vue's `resolveComponent()`, so the\n * components it references must be registered on the Vue app instance.\n *\n * @param nuxtApp The Nuxt app instance (from `defineNuxtPlugin` callback).\n * @param resolved Object mapping Nuxt UI component names (e.g. `UCard`) to\n * their Vue component implementations — import these from `#components`.\n * @param catalogComponents The catalog component names to register globals for.\n * Only the Nuxt UI globals required by these components are registered. Pass\n * an array of names (`['Card', 'Button']`) or an object whose keys are names\n * (e.g. `nuxtUiComponentDefinitions` or a custom subset).\n *\n * @example\n * ```ts\n * import { registerNuxtUiGlobals, nuxtUiComponentDefinitions } from \"json-render-nuxt-ui\";\n * import { UCard, UButton, UInput, USelect, UCheckbox, UTextarea, USwitch, UModal } from \"#components\";\n *\n * export default defineNuxtPlugin((nuxtApp) => {\n * registerNuxtUiGlobals(\n * nuxtApp,\n * { UCard, UButton, UInput, USelect, UCheckbox, UTextarea, USwitch, UModal },\n * nuxtUiComponentDefinitions,\n * );\n * });\n * ```\n */\nexport function registerNuxtUiGlobals(\n nuxtApp: NuxtAppLike,\n resolved: Record<string, Component>,\n catalogComponents:\n | NuxtUiComponentName[]\n | Partial<Record<NuxtUiComponentName, ComponentDefinition>>,\n): void {\n const filterKeys: NuxtUiComponentName[] = Array.isArray(catalogComponents)\n ? catalogComponents\n : (Object.keys(catalogComponents) as NuxtUiComponentName[]);\n\n const needed = new Map<string, NuxtUiComponentName>();\n for (const key of filterKeys) {\n const deps = nuxtUiGlobalDeps[key];\n if (deps) {\n for (const dep of deps) needed.set(dep, key);\n }\n }\n\n for (const [name, catalogName] of needed) {\n const comp = resolved[name];\n if (comp) {\n nuxtApp.vueApp.component(name, comp);\n } else {\n console.warn(\n `[json-render-nuxt-ui] Missing \"${name}\" — required by the \"${catalogName}\" component. ` +\n `Import it (import { ${name} } from \"#components\") and pass it ` +\n `to your registerNuxtUiGlobals() call.`,\n );\n }\n }\n}\n"],"mappings":";;;;;AAAA,SAAS,GAAG,wBAAwB;AACpC,SAAS,oBAA6C;AAStD,IAAM,WAAmC;AAAA,EACvC,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEO,IAAM,mBAAiC;AAAA,EAC5C,OAAO,CAAC,EAAE,OAAO,SAAS,MAAM;AAC9B,UAAM,MAAM,SAAS,MAAM,OAAO,IAAI;AACtC,WAAO,EAAE,OAAO,EAAE,OAAO,iBAAiB,GAAG,GAAG,GAAG,QAAQ;AAAA,EAC7D;AAAA,EAEA,KAAK,CAAC,EAAE,OAAO,SAAS,MAAM;AAC5B,UAAM,MAAM,SAAS,MAAM,OAAO,IAAI;AACtC,UAAM,WAAmC;AAAA,MACvC,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,SAAS;AAAA,IACX;AACA,UAAM,aAAqC;AAAA,MACzC,OAAO;AAAA,MACP,QAAQ;AAAA,M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AAS;AAC9B;AAqCO,SAAS,sBACd,SACA,UACA,mBAGM;AACN,QAAM,aAAoC,MAAM,QAAQ,iBAAiB,IACrE,oBACC,OAAO,KAAK,iBAAiB;AAElC,QAAM,SAAS,oBAAI,IAAiC;AACpD,aAAW,OAAO,YAAY;AAC5B,UAAM,OAAO,iBAAiB,GAAG;AACjC,QAAI,MAAM;AACR,iBAAW,OAAO,KAAM,QAAO,IAAI,KAAK,GAAG;AAAA,IAC7C;AAAA,EACF;AAEA,aAAW,CAAC,MAAM,WAAW,KAAK,QAAQ;AACxC,UAAM,OAAO,SAAS,IAAI;AAC1B,QAAI,MAAM;AACR,cAAQ,OAAO,UAAU,MAAM,IAAI;AAAA,IACrC,OAAO;AACL,cAAQ;AAAA,QACN,kCAAkC,IAAI,6BAAwB,WAAW,oCAChD,IAAI;AAAA,MAE/B;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
package/package.json CHANGED
@@ -1,7 +1,22 @@
1
1
  {
2
2
  "name": "json-render-nuxt-ui",
3
- "version": "0.0.2",
4
- "description": "Nuxt UI adapter package for Vercel json-render",
3
+ "version": "0.0.3",
4
+ "license": "Apache-2.0",
5
+ "description": "Nuxt UI component library for json-render. JSON becomes beautiful Tailwind-styled Vue components.",
6
+ "keywords": [
7
+ "json",
8
+ "ui",
9
+ "vue",
10
+ "nuxt-ui",
11
+ "tailwind",
12
+ "reka-ui",
13
+ "ai",
14
+ "generative-ui",
15
+ "llm",
16
+ "renderer",
17
+ "streaming",
18
+ "components"
19
+ ],
5
20
  "repository": {
6
21
  "type": "git",
7
22
  "url": "git+https://github.com/brainchimps/json-render-nuxt-ui.git"
@@ -10,27 +25,47 @@
10
25
  "bugs": {
11
26
  "url": "https://github.com/brainchimps/json-render-nuxt-ui/issues"
12
27
  },
13
- "type": "module",
14
- "main": "./dist/index.cjs",
15
- "module": "./dist/index.js",
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "main": "./dist/index.js",
32
+ "module": "./dist/index.mjs",
16
33
  "types": "./dist/index.d.ts",
17
34
  "exports": {
18
35
  ".": {
19
36
  "types": "./dist/index.d.ts",
20
- "import": "./dist/index.js",
21
- "require": "./dist/index.cjs"
37
+ "import": "./dist/index.mjs",
38
+ "require": "./dist/index.js"
39
+ },
40
+ "./catalog": {
41
+ "types": "./dist/catalog.d.ts",
42
+ "import": "./dist/catalog.mjs",
43
+ "require": "./dist/catalog.js"
22
44
  }
23
45
  },
24
46
  "files": [
25
47
  "dist"
26
48
  ],
27
- "scripts": {
28
- "build": "tsup src/index.ts --format esm,cjs --dts",
29
- "test": "vitest run"
49
+ "dependencies": {
50
+ "@json-render/vue": "^0.16.0"
30
51
  },
31
52
  "devDependencies": {
32
53
  "tsup": "8.5.0",
33
54
  "typescript": "5.8.2",
34
- "vitest": "3.2.4"
55
+ "vitest": "3.2.4",
56
+ "zod": "^4.3.6"
57
+ },
58
+ "peerDependencies": {
59
+ "@nuxt/ui": "^4.0.0",
60
+ "tailwindcss": "^4.0.0",
61
+ "vue": "^3.5.0",
62
+ "zod": "^4.0.0"
63
+ },
64
+ "scripts": {
65
+ "build": "tsup",
66
+ "dev": "tsup --watch",
67
+ "check-types": "tsc --noEmit",
68
+ "typecheck": "tsc --noEmit",
69
+ "test": "vitest run"
35
70
  }
36
- }
71
+ }
package/dist/index.cjs DELETED
@@ -1,31 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/index.ts
20
- var index_exports = {};
21
- __export(index_exports, {
22
- helloWord: () => helloWord
23
- });
24
- module.exports = __toCommonJS(index_exports);
25
- function helloWord() {
26
- return "Hello json-render!";
27
- }
28
- // Annotate the CommonJS export names for ESM import in node:
29
- 0 && (module.exports = {
30
- helloWord
31
- });
package/dist/index.d.cts DELETED
@@ -1,3 +0,0 @@
1
- declare function helloWord(): string;
2
-
3
- export { helloWord };