jsonforms-nuxt-ui-renderers 0.1.7 → 0.2.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 +23 -0
- package/dist/index.cjs +545 -490
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -1
- package/dist/index.d.ts +52 -1
- package/dist/index.js +542 -490
- package/dist/index.js.map +1 -1
- package/dist/styles.css +138 -0
- package/dist/styles.css.map +1 -0
- package/dist/styles.d.cts +2 -0
- package/dist/styles.d.ts +2 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -18,10 +18,13 @@ Nuxt UI should be installed/configured in your Nuxt app (see Nuxt UI docs).
|
|
|
18
18
|
```ts
|
|
19
19
|
import { JsonForms } from '@jsonforms/vue'
|
|
20
20
|
import { nuxtUiRenderers } from 'jsonforms-nuxt-ui-renderers'
|
|
21
|
+
import 'jsonforms-nuxt-ui-renderers/styles.css'
|
|
21
22
|
|
|
22
23
|
// <JsonForms :schema="schema" :uischema="uischema" :data="data" :renderers="nuxtUiRenderers" />
|
|
23
24
|
```
|
|
24
25
|
|
|
26
|
+
Import `styles.css` for default styling of layout panels, labels, and typography. The package uses semantic class names (`jf-*`) and does not depend on Tailwind or any specific CSS framework.
|
|
27
|
+
|
|
25
28
|
### Important
|
|
26
29
|
|
|
27
30
|
- These renderers **resolve Nuxt UI components by name** (e.g. `UFormField`, `UInput`, `UTextarea`, `USelectMenu`, `USwitch`, `UButton`).
|
|
@@ -61,6 +64,26 @@ This package is intentionally small and opinionated: it ships a **single** rende
|
|
|
61
64
|
- If no matching detail UI schema is registered, a default one is generated via JSONForms `Generate.uiSchema(...)`
|
|
62
65
|
- The root object is rendered as a `VerticalLayout`; nested objects default to a `Group` using the control’s label
|
|
63
66
|
|
|
67
|
+
## Theming
|
|
68
|
+
|
|
69
|
+
The package uses semantic class names (`jf-*`) for layout and typography. Override via:
|
|
70
|
+
|
|
71
|
+
1. **CSS variables** – Customize defaults by overriding variables in `:root` (see `styles.css`).
|
|
72
|
+
2. **Theme overrides** – Pass custom classes to `createNuxtUiRenderers`:
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import { createNuxtUiRenderers } from 'jsonforms-nuxt-ui-renderers'
|
|
76
|
+
|
|
77
|
+
const renderers = createNuxtUiRenderers({
|
|
78
|
+
theme: {
|
|
79
|
+
panel: 'rounded border border-gray-200 p-3', // Tailwind
|
|
80
|
+
layoutVertical: 'flex flex-col gap-3',
|
|
81
|
+
},
|
|
82
|
+
})
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Theme keys: `panel`, `groupNested`, `layoutVertical`, `layoutVerticalWide`, `layoutHorizontal`, `layoutHorizontalItem`, `arrayItemToolbar`, `labelSection`, `labelSectionSpaced`, `textMuted`, `textMutedXs`, `textItemTitle`, `textItemSuffix`, `textLabel`, `flexBetween`, `flexBetweenStart`, `flexActions`.
|
|
86
|
+
|
|
64
87
|
## Contributing
|
|
65
88
|
|
|
66
89
|
- Install deps: `pnpm install`
|