nuxt-unified-ui 0.4.27 → 0.5.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 +9 -0
- package/package.json +6 -5
- package/skills/nuxt-unified-ui/SKILL.md +153 -0
- package/skills/nuxt-unified-ui/references/code-style.md +520 -0
- package/skills/nuxt-unified-ui/references/dialogs-impl.md +57 -0
- package/skills/nuxt-unified-ui/references/dialogs.md +168 -0
- package/skills/nuxt-unified-ui/references/form-elements.md +59 -0
- package/skills/nuxt-unified-ui/references/form-field-schema.md +50 -0
- package/skills/nuxt-unified-ui/references/forms.md +194 -0
- package/skills/nuxt-unified-ui/references/layer-setup.md +88 -0
- package/skills/nuxt-unified-ui/references/public-surface.md +73 -0
- package/skills/nuxt-unified-ui/references/radashi.md +190 -0
- package/skills/nuxt-unified-ui/references/toast-and-ui.md +61 -0
package/README.md
CHANGED
|
@@ -17,3 +17,12 @@ Start the development server on http://localhost:8080
|
|
|
17
17
|
```bash
|
|
18
18
|
vpr serve
|
|
19
19
|
```
|
|
20
|
+
|
|
21
|
+
## Agent Skills
|
|
22
|
+
|
|
23
|
+
One installable Agent Skill lives under `skills/nuxt-unified-ui/` (`npx skills` compatible). It covers the layer API **and** mandatory Nuxt code style (forms, dialogs, radashi, formatting).
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx skills add . --list
|
|
27
|
+
npx skills add <owner>/<repo>
|
|
28
|
+
```
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-unified-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"main": "./nuxt.config.ts",
|
|
6
6
|
"types": "./index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
"index.d.ts",
|
|
16
16
|
"app",
|
|
17
17
|
"i18n",
|
|
18
|
-
"modules"
|
|
18
|
+
"modules",
|
|
19
|
+
"skills"
|
|
19
20
|
],
|
|
20
21
|
"dependencies": {
|
|
21
22
|
"@formkit/tempo": "1.1.0",
|
|
22
|
-
"@iconify-json/lucide": "1.2.
|
|
23
|
-
"@nuxt/kit": "4.5.
|
|
23
|
+
"@iconify-json/lucide": "1.2.122",
|
|
24
|
+
"@nuxt/kit": "4.5.2",
|
|
24
25
|
"@nuxt/ui": "4.10.0",
|
|
25
26
|
"@nuxtjs/i18n": "10.6.0",
|
|
26
27
|
"@vueuse/core": "14.4.0",
|
|
@@ -29,6 +30,6 @@
|
|
|
29
30
|
"unified-mongo-filter": "0.4.0"
|
|
30
31
|
},
|
|
31
32
|
"peerDependencies": {
|
|
32
|
-
"nuxt": ">=4.5.
|
|
33
|
+
"nuxt": ">=4.5.2"
|
|
33
34
|
}
|
|
34
35
|
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nuxt-unified-ui
|
|
3
|
+
description: >-
|
|
4
|
+
Single skill for the nuxt-unified-ui Nuxt layer and mandatory Nuxt code style:
|
|
5
|
+
install/extend the layer, required CSS, modules/config, radashi radXxx
|
|
6
|
+
auto-imports, un-form / useForm, launchFormPickerDialog /
|
|
7
|
+
launchChoicePickerDialog, toast helpers, un-card / un-typography, and the
|
|
8
|
+
whitespace/formatting/code-shape conventions for all Nuxt-generated code. Use
|
|
9
|
+
when working in or consuming nuxt-unified-ui, or whenever generating Vue/Nuxt
|
|
10
|
+
code that must match unified code style.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# nuxt-unified-ui
|
|
14
|
+
|
|
15
|
+
Reusable **Nuxt layer** (Nuxt UI + helpers) **plus** the mandatory **code style** for Nuxt projects using this stack.
|
|
16
|
+
|
|
17
|
+
Peer dependency: **Nuxt `>=4.5.2`**.
|
|
18
|
+
|
|
19
|
+
This is the **only** installable skill in this repo. Deep topics live under `references/`.
|
|
20
|
+
|
|
21
|
+
## When to use
|
|
22
|
+
|
|
23
|
+
- Installing / extending `nuxt-unified-ui` as a Nuxt layer
|
|
24
|
+
- Using `un-form`, dialogs, toasts, `un-card`, radashi `radXxx`, etc.
|
|
25
|
+
- **Whenever generating or editing Nuxt/Vue/server code** that must follow the unified look (whitespace, wrapping, template shape, sectioning)
|
|
26
|
+
|
|
27
|
+
## References (read as needed)
|
|
28
|
+
|
|
29
|
+
| Topic | File |
|
|
30
|
+
|-------|------|
|
|
31
|
+
| **Code style (mandatory)** | [references/code-style.md](references/code-style.md) |
|
|
32
|
+
| Layer install + required CSS | [references/layer-setup.md](references/layer-setup.md) |
|
|
33
|
+
| Public surface inventory | [references/public-surface.md](references/public-surface.md) |
|
|
34
|
+
| Forms (`useForm` / `un-form`) | [references/forms.md](references/forms.md) |
|
|
35
|
+
| Form field schema | [references/form-field-schema.md](references/form-field-schema.md) |
|
|
36
|
+
| Form elements | [references/form-elements.md](references/form-elements.md) |
|
|
37
|
+
| Dialogs / toasts / UI | [references/dialogs.md](references/dialogs.md) |
|
|
38
|
+
| Dialog implementation | [references/dialogs-impl.md](references/dialogs-impl.md) |
|
|
39
|
+
| Toast + `un-*` details | [references/toast-and-ui.md](references/toast-and-ui.md) |
|
|
40
|
+
| Radashi `radXxx` catalog | [references/radashi.md](references/radashi.md) |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Code style (read [code-style.md](references/code-style.md) before writing code)
|
|
45
|
+
|
|
46
|
+
**Always apply** to Vue SFCs and app/server `.ts` files. Higher-level idea: code should **scan vertically** — double blanks between major sections, multi-line literals, predictable template wrapping, section comments as a map.
|
|
47
|
+
|
|
48
|
+
Absolute highlights:
|
|
49
|
+
|
|
50
|
+
- `<script setup>` only — **never** `lang="ts"`; no TS annotations in Vue (runtime prop types)
|
|
51
|
+
- 2-space indent; single quotes; semicolons; trailing commas in multi-line literals
|
|
52
|
+
- Double blank lines between major sections; blank line before `</script>`; **two** blanks before `<template>`
|
|
53
|
+
- Non-trivial async/functions: blank line after `{`, double blank between major steps, blank before `}`
|
|
54
|
+
- `else` / `catch` on their own line after `}`
|
|
55
|
+
- Script object literals always multi-line (even one property)
|
|
56
|
+
- Kebab-case tags (`u-button`, `un-card`)
|
|
57
|
+
- `v-if` / `v-for` on `<template>` wrappers — not on rendered nodes
|
|
58
|
+
- **2+ attributes → one per line**; non-self-closing `>` on same line as last attr; multi-line self-closing `/>` on its own line
|
|
59
|
+
- `{{ ... }}` on its own line
|
|
60
|
+
- `/* section */` comments; imports co-located under the section that uses them
|
|
61
|
+
- Light naming: `handleXxx` handlers, `it` in short callbacks, descriptive `for...of`, computeds use block + `return`
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Quick start (host app)
|
|
66
|
+
|
|
67
|
+
1. Install the package.
|
|
68
|
+
2. Create host `assets/css/main.css`:
|
|
69
|
+
|
|
70
|
+
```css
|
|
71
|
+
@import 'tailwindcss';
|
|
72
|
+
@import '@nuxt/ui';
|
|
73
|
+
@import 'nuxt-unified-ui/nuxt-ui-fixes.css';
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
3. Extend the layer (CSS wiring is **required**):
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
import { pathRelativeToBase } from 'nuxt-unified-ui';
|
|
80
|
+
|
|
81
|
+
export default defineNuxtConfig({
|
|
82
|
+
css: [
|
|
83
|
+
pathRelativeToBase(import.meta.url, './assets/css/main.css'),
|
|
84
|
+
],
|
|
85
|
+
extends: [
|
|
86
|
+
'nuxt-unified-ui',
|
|
87
|
+
],
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
4. Wrap the app with `u-app`.
|
|
92
|
+
5. Prefer layer helpers (`useForm`, `launchFormPickerDialog`, `toastSuccess`) over reinventing them.
|
|
93
|
+
6. Generate all new code using [code-style.md](references/code-style.md).
|
|
94
|
+
|
|
95
|
+
Details: [layer-setup.md](references/layer-setup.md).
|
|
96
|
+
|
|
97
|
+
## Package surface
|
|
98
|
+
|
|
99
|
+
| Export | Path |
|
|
100
|
+
|--------|------|
|
|
101
|
+
| `nuxt-unified-ui` | `./nuxt.config.ts` (also re-exports `pathRelativeToBase`) |
|
|
102
|
+
| `nuxt-unified-ui/app` | `./app` |
|
|
103
|
+
| `nuxt-unified-ui/nuxt-ui-fixes.css` | `./app/assets/css/nuxt-ui-fixes.css` |
|
|
104
|
+
|
|
105
|
+
Published: `nuxt.config.ts`, `index.d.ts`, `app/`, `i18n/`, `modules/`.
|
|
106
|
+
|
|
107
|
+
## Mental model (`app/`)
|
|
108
|
+
|
|
109
|
+
| Path | Role |
|
|
110
|
+
|------|------|
|
|
111
|
+
| `app/components/` | `un-form`, `un-card`, `un-typography`, `un-spinner` |
|
|
112
|
+
| `app/composables/` | `useForm`, `useFormExtraElements` |
|
|
113
|
+
| `app/elements/` | Built-in form field renderers |
|
|
114
|
+
| `app/dialogs/` | Form / choice picker modal UIs |
|
|
115
|
+
| `app/utils/` | `launchDialog*`, `toast*`, `smartMatch`, `unSet`, dates, … |
|
|
116
|
+
| `app/plugins/` | `$toaster` via `useToast()` |
|
|
117
|
+
| `modules/radashi.ts` | Auto-imports radashi as `rad*` |
|
|
118
|
+
| `i18n/locales/` | `en.json`, `de.json` |
|
|
119
|
+
|
|
120
|
+
## Layer config (inherited)
|
|
121
|
+
|
|
122
|
+
From `nuxt.config.ts`: `@vueuse/nuxt`, `@nuxt/ui`, `@nuxtjs/i18n`; `ui.colorMode: false`; default variant `neutral`; i18n `no_prefix` with `en`/`de`; `experimental.typedPages: true`.
|
|
123
|
+
|
|
124
|
+
## Common tasks
|
|
125
|
+
|
|
126
|
+
| Task | Prefer |
|
|
127
|
+
|------|--------|
|
|
128
|
+
| Schema form | `useForm` + `<form-tag />` / `<un-form>` → [forms.md](references/forms.md) |
|
|
129
|
+
| Modal form | `launchFormPickerDialog` + `submitButton.onClick` → [dialogs.md](references/dialogs.md) |
|
|
130
|
+
| Confirm / choice | `launchChoicePickerDialog` + button `onClick` (avoid `value`) |
|
|
131
|
+
| Feedback | `toastSuccess` / `toastError` / `toast` |
|
|
132
|
+
| Page chrome | `un-typography` + `un-card` |
|
|
133
|
+
| Custom field | `registerFormExtraElement` in a plugin |
|
|
134
|
+
| Utilities | `radXxx` → [radashi.md](references/radashi.md) |
|
|
135
|
+
| Formatting any of the above | [code-style.md](references/code-style.md) |
|
|
136
|
+
|
|
137
|
+
## Do / don’t
|
|
138
|
+
|
|
139
|
+
**Do**
|
|
140
|
+
|
|
141
|
+
- Extend via `extends: ['nuxt-unified-ui']`
|
|
142
|
+
- Keep required host `main.css` + `pathRelativeToBase` CSS entry + `nuxt-ui-fixes.css`
|
|
143
|
+
- Use field `identifier` for element kind; `type` only for HTML input types
|
|
144
|
+
- Handle dialog actions in `onClick`
|
|
145
|
+
- Follow code style for every generated file
|
|
146
|
+
|
|
147
|
+
**Don’t**
|
|
148
|
+
|
|
149
|
+
- Invent APIs not in source
|
|
150
|
+
- Reference any local playground as consumer docs
|
|
151
|
+
- Use PascalCase component tags in templates
|
|
152
|
+
- Set choice-button `value` unless the await result must distinguish buttons
|
|
153
|
+
- Assume color mode is enabled (layer disables it)
|