nuxt-unified-ui 0.4.28 → 0.5.1

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