@nqlib/nqui 0.4.3 → 0.4.4

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.
Files changed (153) hide show
  1. package/INSTALLATION.md +215 -0
  2. package/README.md +104 -151
  3. package/dist/button-CJHdCq9I.js +155 -0
  4. package/dist/button-R304rhsj.cjs +1 -0
  5. package/dist/calendar.cjs.js +1 -1
  6. package/dist/calendar.es.js +1 -1
  7. package/dist/carousel-D1FMVglR.cjs +1 -0
  8. package/dist/carousel-U7RZhYZj.js +179 -0
  9. package/dist/carousel.cjs.js +1 -1
  10. package/dist/carousel.es.js +1 -1
  11. package/dist/command-palette-DCtLpM3Q.js +694 -0
  12. package/dist/command-palette-MHc03bBf.cjs +5 -0
  13. package/dist/command.cjs.js +1 -1
  14. package/dist/command.es.js +1 -1
  15. package/dist/components/custom/color-picker.d.ts +1 -1
  16. package/dist/components/custom/color-picker.d.ts.map +1 -1
  17. package/dist/components/custom/color-slider.d.ts +4 -10
  18. package/dist/components/custom/color-slider.d.ts.map +1 -1
  19. package/dist/components/custom/enhanced-radio-group.d.ts +13 -4
  20. package/dist/components/custom/enhanced-radio-group.d.ts.map +1 -1
  21. package/dist/components/custom/enhanced-tabs.d.ts.map +1 -1
  22. package/dist/components/debug/debug-features.d.ts +29 -0
  23. package/dist/components/debug/debug-features.d.ts.map +1 -0
  24. package/dist/components/debug/debug-panel.d.ts.map +1 -1
  25. package/dist/components/error-boundary.d.ts +20 -0
  26. package/dist/components/error-boundary.d.ts.map +1 -0
  27. package/dist/components/index.d.ts +103 -0
  28. package/dist/components/index.d.ts.map +1 -0
  29. package/dist/components/ui/badge.d.ts +16 -5
  30. package/dist/components/ui/badge.d.ts.map +1 -1
  31. package/dist/components/ui/button.d.ts +38 -4
  32. package/dist/components/ui/button.d.ts.map +1 -1
  33. package/dist/components/ui/checkbox.d.ts +16 -2
  34. package/dist/components/ui/checkbox.d.ts.map +1 -1
  35. package/dist/components/ui/combobox.d.ts +2 -1
  36. package/dist/components/ui/combobox.d.ts.map +1 -1
  37. package/dist/components/ui/input-group.d.ts +1 -1
  38. package/dist/components/ui/input-group.d.ts.map +1 -1
  39. package/dist/components/ui/pagination.d.ts +3 -2
  40. package/dist/components/ui/pagination.d.ts.map +1 -1
  41. package/dist/components/ui/radio-group.d.ts +3 -1
  42. package/dist/components/ui/radio-group.d.ts.map +1 -1
  43. package/dist/components/ui/select.d.ts +6 -1
  44. package/dist/components/ui/select.d.ts.map +1 -1
  45. package/dist/components/ui/sidebar.d.ts +1 -1
  46. package/dist/components/ui/sidebar.d.ts.map +1 -1
  47. package/dist/components/ui/slider.d.ts +10 -2
  48. package/dist/components/ui/slider.d.ts.map +1 -1
  49. package/dist/components/ui/sonner.d.ts +18 -2
  50. package/dist/components/ui/sonner.d.ts.map +1 -1
  51. package/dist/components/ui/spinner.d.ts +2 -1
  52. package/dist/components/ui/spinner.d.ts.map +1 -1
  53. package/dist/components/ui/switch.d.ts +15 -2
  54. package/dist/components/ui/switch.d.ts.map +1 -1
  55. package/dist/components/ui/tabs.d.ts +1 -1
  56. package/dist/components/ui/tabs.d.ts.map +1 -1
  57. package/dist/components/ui/toggle.d.ts +1 -1
  58. package/dist/components/ui/toggle.d.ts.map +1 -1
  59. package/dist/debug-panel-CG-vAN0L.js +9016 -0
  60. package/dist/debug-panel-DHBfAc1V.cjs +75 -0
  61. package/dist/debug.cjs.js +1 -0
  62. package/dist/debug.es.js +7 -0
  63. package/dist/{drawer-CU4lkcz7.js → drawer-DO26uhym.js} +31 -31
  64. package/dist/drawer-DVarEy65.cjs +1 -0
  65. package/dist/drawer.cjs.js +1 -1
  66. package/dist/drawer.es.js +1 -1
  67. package/dist/{enhanced-calendar-BENbxw7_.js → enhanced-calendar-BGlsSYJd.js} +1 -1
  68. package/dist/{enhanced-calendar-5PA8CeF7.cjs → enhanced-calendar-C7EQIr6i.cjs} +1 -1
  69. package/dist/entries/debug.d.ts +14 -0
  70. package/dist/entries/debug.d.ts.map +1 -0
  71. package/dist/entries/sonner.d.ts +1 -2
  72. package/dist/entries/sonner.d.ts.map +1 -1
  73. package/dist/hooks/use-mobile.d.ts.map +1 -1
  74. package/dist/hooks/use-scroll-spy.d.ts.map +1 -1
  75. package/dist/index-CI756mSv.cjs +41 -0
  76. package/dist/index-CgfzsUO6.js +1069 -0
  77. package/dist/index.d.ts +2 -98
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/lib/index.d.ts +9 -0
  80. package/dist/lib/index.d.ts.map +1 -0
  81. package/dist/lib/wrap-inline-label-text.d.ts +7 -0
  82. package/dist/lib/wrap-inline-label-text.d.ts.map +1 -0
  83. package/dist/nqui.cjs.js +49 -245
  84. package/dist/nqui.es.js +7399 -16735
  85. package/dist/sonner-CpmECDBk.js +179 -0
  86. package/dist/sonner-nE9hIalJ.cjs +48 -0
  87. package/dist/sonner.cjs.js +1 -1
  88. package/dist/sonner.es.js +3 -2
  89. package/dist/styles.css +186 -1
  90. package/docs/components/README.md +107 -8
  91. package/docs/components/nqui-badge.md +1 -0
  92. package/docs/components/nqui-button.md +3 -1
  93. package/docs/components/nqui-card.md +8 -0
  94. package/docs/components/nqui-carousel.md +6 -0
  95. package/docs/components/nqui-checkbox.md +38 -1
  96. package/docs/components/nqui-color-slider.md +5 -3
  97. package/docs/components/nqui-combobox.md +58 -37
  98. package/docs/components/nqui-drawer.md +1 -1
  99. package/docs/components/nqui-radio-group.md +45 -2
  100. package/docs/components/nqui-scroll-area.md +1 -1
  101. package/docs/components/nqui-select.md +2 -2
  102. package/docs/components/nqui-sheet.md +1 -1
  103. package/docs/components/nqui-slider.md +13 -0
  104. package/docs/components/nqui-spinner.md +6 -1
  105. package/docs/components/nqui-switch.md +23 -1
  106. package/docs/components/nqui-tabs.md +11 -1
  107. package/docs/components/nqui-toaster.md +5 -1
  108. package/docs/internal-notes/PUBLISHING.md +46 -4
  109. package/docs/nqui-skills/SKILL.md +102 -0
  110. package/docs/nqui-skills/design-system.md +143 -0
  111. package/docs/nqui-skills/rules/composition.md +183 -0
  112. package/docs/nqui-skills/rules/forms.md +190 -0
  113. package/docs/nqui-skills/rules/icons.md +158 -0
  114. package/docs/nqui-skills/rules/styling.md +192 -0
  115. package/package.json +23 -12
  116. package/scripts/build-styles.js +16 -0
  117. package/scripts/cli.js +1 -0
  118. package/scripts/download-skills.js +91 -0
  119. package/scripts/examples/nextjs-layout-sidebar.tsx +100 -0
  120. package/scripts/examples/nextjs-page-sidebar.tsx +81 -0
  121. package/scripts/examples/vite-app.tsx +135 -0
  122. package/scripts/examples/vite-main.tsx +17 -0
  123. package/scripts/examples.js +92 -6
  124. package/scripts/generate-docs.js +169 -0
  125. package/scripts/init-css.js +34 -14
  126. package/scripts/init-cursor.js +8 -0
  127. package/scripts/init-debug-css.js +4 -2
  128. package/scripts/post-install.js +41 -9
  129. package/scripts/publish-npmjs.js +17 -3
  130. package/scripts/resolve-target-dir.js +20 -1
  131. package/scripts/verify-build.js +1 -1
  132. package/scripts/wizard.js +12 -7
  133. package/dist/button-CYFTFDKe.cjs +0 -1
  134. package/dist/button-nJvDl3w8.js +0 -44
  135. package/dist/carousel-DEyyJi49.js +0 -179
  136. package/dist/carousel-Dhhz8m5V.cjs +0 -1
  137. package/dist/command-palette-UHk8zZOg.cjs +0 -45
  138. package/dist/command-palette-d-TrdBsM.js +0 -1778
  139. package/dist/components/custom/enhanced-badge.d.ts +0 -33
  140. package/dist/components/custom/enhanced-badge.d.ts.map +0 -1
  141. package/dist/components/custom/enhanced-button.d.ts +0 -34
  142. package/dist/components/custom/enhanced-button.d.ts.map +0 -1
  143. package/dist/components/custom/enhanced-checkbox.d.ts +0 -28
  144. package/dist/components/custom/enhanced-checkbox.d.ts.map +0 -1
  145. package/dist/components/custom/enhanced-combobox.d.ts +0 -35
  146. package/dist/components/custom/enhanced-combobox.d.ts.map +0 -1
  147. package/dist/components/custom/enhanced-select.d.ts +0 -30
  148. package/dist/components/custom/enhanced-select.d.ts.map +0 -1
  149. package/dist/components/custom/enhanced-sonner.d.ts +0 -16
  150. package/dist/components/custom/enhanced-sonner.d.ts.map +0 -1
  151. package/dist/drawer-BcIxWRN8.cjs +0 -1
  152. package/dist/sonner-Co6YpYVs.js +0 -546
  153. package/dist/sonner-DbQhVp8m.cjs +0 -330
@@ -0,0 +1,215 @@
1
+ # nqui – Installation & CLI reference
2
+
3
+ Developer guide: what runs on install, available commands, and the recommended setup sequence.
4
+
5
+ ---
6
+
7
+ ## What runs on `npm install`
8
+
9
+ When you add `@nqlib/nqui` to a project and run `npm install` (or pnpm/yarn/bun):
10
+
11
+ 1. **Postinstall script** runs: `node scripts/post-install.js` (same as `npx @nqlib/nqui setup`).
12
+ 2. **Behavior:**
13
+ - If your project has a `package.json` and no `nqui:init` script, a **`nqui:init`** script is added to run the full setup in one command.
14
+ - **Cursor rules** are written into your project’s `.cursor/` directory:
15
+ - `.cursor/rules/nqui-components.mdc`
16
+ - `.cursor/skills/nqui-install/`
17
+ - `.cursor/skills/nqui-components/`
18
+ - A **next-steps message** is printed (run `npx nqui-setup` anytime to see it again).
19
+ 3. **Not done on install:** Peer packages are not installed, `.cursor/nqui-skills/` is not created, and CSS is not set up. Run the full setup (see below) for that.
20
+ 4. **CI:** Postinstall is skipped when `CI=true` or `CI=1`.
21
+
22
+ ---
23
+
24
+ ## CLI commands
25
+
26
+ All commands are run from your **project root** (where `package.json` lives).
27
+
28
+ | Command | Description |
29
+ |--------|-------------|
30
+ | `npx @nqlib/nqui setup` | Re-run postinstall: print next steps and write Cursor rules (no peers/skills/CSS). Same as `npx nqui-setup`. |
31
+ | `npx @nqlib/nqui install-peers` | Install `@nqlib/nqui` and all required + optional peer dependencies (icons, cmdk, dnd-kit, etc.). |
32
+ | `npx @nqlib/nqui init-cursor` | Write `.cursor/rules` and `.cursor/skills`, and **download nqui-skills** (copy `docs/nqui-skills` → `.cursor/nqui-skills`, create `AGENTS.md`). |
33
+ | `npx @nqlib/nqui init-skills` | Only download skills: copy to `.cursor/nqui-skills`, (re)create `AGENTS.md`. Use `--force` to overwrite. |
34
+ | `npx @nqlib/nqui init-css` | Detect framework, create `nqui/index.css` and `nqui/nqui-setup.css`, optionally copy example layouts. Options: `--sidebar`, `--force`, `--wizard`. |
35
+ | `npx @nqlib/nqui` _(no args)_ | Runs **init-css** with default output `nqui/index.css`. |
36
+ | `npx @nqlib/nqui init-debug` / `init-debug-css` | Initialize debug CSS for `DebugPanel`. |
37
+ | `npm run nqui:init` | One-shot full setup (only after install added the script): install-peers → init-cursor → init-skills → init-css --sidebar --force. |
38
+
39
+ **Monorepos:** Cursor rules and skills are written to the package that has `@nqlib/nqui` in `node_modules` or in its `package.json`. Open that package folder in Cursor for skills to resolve.
40
+
41
+ ---
42
+
43
+ ## Recommended sequence
44
+
45
+ ### Option A: One command (after install)
46
+
47
+ If postinstall added the script:
48
+
49
+ ```bash
50
+ npm run nqui:init
51
+ ```
52
+
53
+ This runs: **install-peers** → **init-cursor** → **init-skills** → **init-css --sidebar --force**.
54
+
55
+ Then **manually** add the nqui CSS import to your main CSS file (see [Step 2: Setup CSS](#step-2-setup-css-required) below).
56
+
57
+ ### Option B: Step by step
58
+
59
+ ```bash
60
+ # 1. Install nqui + minimal deps (or use install-peers for full)
61
+ npm install @nqlib/nqui @hugeicons/react @hugeicons/core-free-icons
62
+ # or: npx @nqlib/nqui install-peers
63
+
64
+ # 2. Cursor rules + nqui-skills
65
+ npx @nqlib/nqui init-cursor
66
+
67
+ # 3. (Optional) Refresh skills only
68
+ npx @nqlib/nqui init-skills
69
+
70
+ # 4. CSS setup
71
+ npx @nqlib/nqui init-css --sidebar
72
+ # Then add the import to your main CSS (see Step 2 below)
73
+ ```
74
+
75
+ ---
76
+
77
+ ## Requirements
78
+
79
+ - **React 18 or 19** (peer: `^18.0.0 || ^19.0.0`)
80
+ - **Tailwind CSS v4**
81
+ - **Node.js** per your framework
82
+
83
+ ---
84
+
85
+ ## Step 1: Install nqui + peers
86
+
87
+ **Minimal (icons required for most components):**
88
+
89
+ ```bash
90
+ npm install @nqlib/nqui @hugeicons/react @hugeicons/core-free-icons
91
+ ```
92
+
93
+ **Full (all optional peers for Sortable, Carousel, DataTable, Calendar, etc.):**
94
+
95
+ ```bash
96
+ npx @nqlib/nqui install-peers
97
+ ```
98
+
99
+ ---
100
+
101
+ ## Step 2: Setup CSS (required)
102
+
103
+ ### 2a. Run init-css
104
+
105
+ ```bash
106
+ npx @nqlib/nqui init-css
107
+ ```
108
+
109
+ Creates:
110
+
111
+ - `nqui/index.css` — imports `@nqlib/nqui/styles`
112
+ - `nqui/nqui-setup.css` — framework-specific Tailwind + nqui snippet
113
+
114
+ ### 2b. Add import to main CSS (manual)
115
+
116
+ Add the nqui import to your **main CSS file**:
117
+
118
+ | Framework | Main CSS file |
119
+ |-----------|----------------|
120
+ | Next.js | `app/globals.css` |
121
+ | Vite | `src/index.css` |
122
+ | Remix | `app/root.css` |
123
+
124
+ **Option A (recommended):** After `@import "tailwindcss"`:
125
+
126
+ ```css
127
+ @import "@nqlib/nqui/styles";
128
+ ```
129
+
130
+ **Option B:** Copy the **entire contents** of `nqui/nqui-setup.css` to the **very top** of your main CSS file.
131
+
132
+ ### 2c. Next.js + Tailwind v4
133
+
134
+ Include these in your main CSS:
135
+
136
+ ```css
137
+ @source "./**/*.{js,ts,jsx,tsx,mdx}";
138
+ @source "../components/**/*.{js,ts,jsx,tsx,mdx}";
139
+ @source "../node_modules/@nqlib/nqui/dist/**/*.js";
140
+ ```
141
+
142
+ ### 2d. Custom path
143
+
144
+ ```bash
145
+ npx @nqlib/nqui init-css app/styles/nqui.css
146
+ ```
147
+
148
+ ---
149
+
150
+ ## Step 3: Use components
151
+
152
+ ```tsx
153
+ import { Button, Input, Card } from "@nqlib/nqui";
154
+ ```
155
+
156
+ Next.js App Router pages that use nqui need `"use client"`.
157
+
158
+ ---
159
+
160
+ ## Step 4: Debug tools (optional)
161
+
162
+ ```bash
163
+ npx @nqlib/nqui init-debug-css
164
+ ```
165
+
166
+ Then in your app:
167
+
168
+ ```tsx
169
+ import { DebugPanel } from "@nqlib/nqui";
170
+ import "./nqui-debug.css"; // or path from init-debug-css
171
+
172
+ // In your root/layout: render when NODE_ENV === 'development'
173
+ <DebugPanel />
174
+ ```
175
+
176
+ ---
177
+
178
+ ## Step 5: Cursor / IDE rules
179
+
180
+ On install, basic rules are written to `.cursor/rules/nqui-components.mdc`. For the full **nqui-skills** set (`.cursor/nqui-skills/` and `AGENTS.md`), run:
181
+
182
+ ```bash
183
+ npx @nqlib/nqui init-cursor
184
+ ```
185
+
186
+ Component docs index: `node_modules/@nqlib/nqui/docs/components/README.md`.
187
+
188
+ ---
189
+
190
+ ## Optional: Local vs published nqui
191
+
192
+ To switch between a **local** (linked) build and the **published** npm package during development, you can add a `scripts/toggle-nqui.js` script to your app and wire it to your `dev` script. This is optional and not created by nqui. See the nqui skill **nqui-local-published-toggle** for the script and usage (e.g. `USE_LOCAL_NQUI=true node scripts/toggle-nqui.js && next dev`).
193
+
194
+ ---
195
+
196
+ ## Troubleshooting
197
+
198
+ **"Module not found: '@nqlib/nqui/styles'" or CSS not loading**
199
+
200
+ 1. Run `npx @nqlib/nqui init-css`.
201
+ 2. Add `@import "@nqlib/nqui/styles";` near the **top** of your main CSS file.
202
+ 3. Ensure it appears **before** other app styles.
203
+
204
+ **Components render without styles**
205
+
206
+ Your main CSS is missing the nqui import. Add `@import "@nqlib/nqui/styles";` or paste the contents of `nqui/nqui-setup.css` at the top of your main CSS.
207
+
208
+ **Debug Panel not showing**
209
+
210
+ - Ensure `NODE_ENV !== 'production'`.
211
+ - Import the debug CSS and render `<DebugPanel />` in your app tree.
212
+
213
+ **Package name**
214
+
215
+ Use `@nqlib/nqui` (the published package name).
package/README.md CHANGED
@@ -10,42 +10,88 @@ A React component library with enhanced UI components and developer tools. Built
10
10
 
11
11
  ## Installation
12
12
 
13
- Install from npmjs.com (recommended - no authentication needed):
13
+ ### Install the package
14
+
15
+ Install the published package from [npm](https://www.npmjs.com/package/@nqlib/nqui):
14
16
 
15
17
  ```bash
16
18
  npm install @nqlib/nqui @hugeicons/react @hugeicons/core-free-icons
17
19
  ```
18
20
 
19
- Hugeicons is required for icon display in components (Button, Accordion, Select, etc.).
21
+ Hugeicons is required for icons in components (Button, Accordion, Select, etc.).
20
22
 
21
- **Full install** (all optional peers for Sortable, Carousel, DataTable, Calendar, etc.):
23
+ **All optional peers** (Sortable, Carousel, DataTable, Calendar, etc.):
22
24
 
23
25
  ```bash
24
26
  npx @nqlib/nqui install-peers
25
27
  ```
26
28
 
27
- **After install:** A post-install message will show the next steps. Run `npx nqui-setup` anytime to see them again.
29
+ **After `npm install`:** the post-install script may add a `nqui:init` script and write initial Cursor rules under `.cursor/`. It does **not** copy full **nqui-skills** or set up CSS — run the commands below. Run `npx nqui-setup` (same as `npx @nqlib/nqui setup`) anytime to see next steps again. Post-install is skipped when `CI=true` or `CI=1`.
30
+
31
+ ### IDE skills (Cursor and compatible agents)
32
+
33
+ Copy the library’s **skills** into your app so your IDE can follow nqui patterns (components, design system, ToggleGroup rules, etc.):
34
+
35
+ | Command | What it does |
36
+ |--------|----------------|
37
+ | `npx @nqlib/nqui init-cursor` | Writes `.cursor/rules` and `.cursor/skills`, copies **`docs/nqui-skills`** → **`.cursor/nqui-skills`**, and creates **`AGENTS.md`** at the project root pointing agents at `.cursor/nqui-skills/SKILL.md`. |
38
+ | `npx @nqlib/nqui init-skills` | **Skills only:** copies nqui-skills to `.cursor/nqui-skills/` and (re)creates `AGENTS.md`. Use `--force` to overwrite existing files. |
39
+ | `npm run nqui:init` | **One-shot** (if post-install added this script): `install-peers` → `init-cursor` → `init-skills` → `init-css --sidebar --force`. You still add the CSS import to your main stylesheet (see [INSTALLATION.md](./INSTALLATION.md)). |
40
+
41
+ After copying skills, **restart the IDE** so rules and skills reload.
42
+
43
+ **Monorepos:** rules and skills are written to the workspace package that depends on `@nqlib/nqui`. Open that folder in your IDE so paths resolve.
44
+
45
+ ---
28
46
 
29
- **Alternative:** Install from GitHub Packages (requires GitHub account + token):
47
+ ### CLI commands
48
+
49
+ Run from your **app project root** (where `package.json` lives). Equivalent **global bins** (when the package is installed): `nqui`, `nqui-setup`, `nqui-install-peers`, `nqui-init-cursor`, `nqui-init-skills`, `nqui-init-css`, `nqui-init-debug`.
50
+
51
+ | Command | Description |
52
+ |--------|-------------|
53
+ | `npx @nqlib/nqui setup` | Re-run post-install: next steps + Cursor rules (not full skills/CSS). Same as `npx nqui-setup`. |
54
+ | `npx @nqlib/nqui install-peers` | Install `@nqlib/nqui` and required + optional peer dependencies. |
55
+ | `npx @nqlib/nqui init-cursor` | Cursor rules + **nqui-skills** → `.cursor/nqui-skills/` + `AGENTS.md`. |
56
+ | `npx @nqlib/nqui init-skills` | Copy nqui-skills only; `--force` to overwrite. |
57
+ | `npx @nqlib/nqui init-css` | Detect framework; create `nqui/index.css` and `nqui/nqui-setup.css`. Flags: `--sidebar`, `--force`, `--wizard`. Optional output path, e.g. `npx @nqlib/nqui init-css app/styles/nqui.css`. |
58
+ | `npx @nqlib/nqui` | No args → same as **init-css** (default `nqui/index.css`). |
59
+ | `npx @nqlib/nqui init-debug` or `init-debug-css` | Scaffold CSS for `DebugPanel`. |
60
+
61
+ ---
62
+
63
+ ### Recommended setup order
64
+
65
+ **Option A — one command** (if `nqui:init` exists in `package.json`):
30
66
 
31
67
  ```bash
32
- # Create .npmrc in your project
33
- echo "@nqlib:registry=https://npm.pkg.github.com" > .npmrc
68
+ npm run nqui:init
69
+ ```
70
+
71
+ Then add `@import "@nqlib/nqui/styles";` (or your framework’s full CSS snippet) to your main CSS — see [INSTALLATION.md](./INSTALLATION.md) Step 2.
34
72
 
35
- # Authenticate with GitHub
36
- npm login --registry=https://npm.pkg.github.com
73
+ **Option B step by step:**
37
74
 
38
- # Install
75
+ ```bash
39
76
  npm install @nqlib/nqui @hugeicons/react @hugeicons/core-free-icons
77
+ # optional: npx @nqlib/nqui install-peers
78
+
79
+ npx @nqlib/nqui init-cursor
80
+ # optional refresh: npx @nqlib/nqui init-skills
81
+
82
+ npx @nqlib/nqui init-css --sidebar
83
+ # add CSS import to app/globals.css or src/index.css — see INSTALLATION.md
40
84
  ```
41
85
 
86
+ **Detailed CSS paths, Next.js `@source` lines, and troubleshooting:** [INSTALLATION.md](./INSTALLATION.md).
87
+
42
88
  ## Quick Start
43
89
 
44
- ### Option 1: Package Import (Recommended)
90
+ ### Option 1: Package import (recommended)
45
91
 
46
- #### For Next.js
92
+ #### Next.js
47
93
 
48
- 1. **Import CSS in your `app/layout.tsx` or `app/globals.css`:**
94
+ 1. **Import CSS** in `app/globals.css` (or equivalent):
49
95
 
50
96
  ```tsx
51
97
  // app/globals.css
@@ -71,9 +117,10 @@ export default function Page() {
71
117
  }
72
118
  ```
73
119
 
74
- **Note:** Pages using nqui components must include `"use client"` because nqui components use React hooks.
120
+ Pages using nqui must use `"use client"` where required (hooks).
121
+
122
+ **Local linking:** with `npm link` or `file:`, you may need Webpack instead of Turbopack:
75
123
 
76
- **For Local Development:** If you're using `npm link` or `file:` protocol, you may need to use Webpack instead of Turbopack:
77
124
  ```json
78
125
  {
79
126
  "scripts": {
@@ -81,22 +128,22 @@ export default function Page() {
81
128
  }
82
129
  }
83
130
  ```
84
- See [Troubleshooting](#troubleshooting) for more details.
85
131
 
86
- #### For Vite
132
+ See [Troubleshooting](#troubleshooting).
133
+
134
+ #### Vite
87
135
 
88
- 1. **Import CSS in your `src/main.tsx` or `src/index.css`:**
136
+ 1. **CSS** in `src/index.css`:
89
137
 
90
138
  ```css
91
- /* src/index.css */
92
139
  @import "tailwindcss";
93
140
  @import "tw-animate-css";
94
141
  @import "@nqlib/nqui/styles";
95
142
  ```
96
143
 
97
- **Note:** Vite does NOT require `@source` directives. Tailwind CSS v4 automatically scans files when using the `@tailwindcss/vite` plugin. Only Next.js requires `@source` directives.
144
+ Vite with `@tailwindcss/vite` does not need the same `@source` directives as Next.js.
98
145
 
99
- 2. **Use components:**
146
+ 2. **Components:**
100
147
 
101
148
  ```tsx
102
149
  import { Button } from '@nqlib/nqui';
@@ -106,43 +153,30 @@ function App() {
106
153
  }
107
154
  ```
108
155
 
109
- ### Option 2: Init Script (Alternative)
110
-
111
- The init script automatically detects your framework and sets up CSS with framework-specific Tailwind directives:
156
+ ### Option 2: `init-css` helper
112
157
 
113
158
  ```bash
114
159
  npx @nqlib/nqui init-css
115
160
  ```
116
161
 
117
- This will:
118
- - Detect your framework (Next.js, Vite, Remix, etc.)
119
- - Add framework-specific Tailwind setup
120
- - Copy nqui CSS variables to the appropriate location
121
- - Provide next steps
122
-
123
- **For Next.js:** Creates/updates `app/globals.css` with Next.js-specific directives
124
- **For Vite:** Creates/updates `src/index.css` with Vite-specific directives
162
+ Detects Next.js, Vite, Remix, etc., and scaffolds CSS entry files; see [INSTALLATION.md](./INSTALLATION.md) for wiring the import into your main stylesheet.
125
163
 
126
- ## Setup Requirements
164
+ ## Setup requirements
127
165
 
128
- ### Tailwind CSS Configuration
166
+ ### Tailwind CSS
129
167
 
130
- nqui requires Tailwind CSS v4. Ensure you have it installed:
168
+ nqui expects Tailwind CSS v4:
131
169
 
132
170
  ```bash
133
171
  npm install tailwindcss@^4.1.0
134
172
  ```
135
173
 
136
- For **Next.js**, Tailwind CSS v4 works with the new `@import` syntax in CSS files.
137
-
138
- For **Vite**, install the Tailwind CSS Vite plugin:
174
+ **Vite** add the plugin:
139
175
 
140
176
  ```bash
141
177
  npm install @tailwindcss/vite
142
178
  ```
143
179
 
144
- Then add it to your `vite.config.ts`:
145
-
146
180
  ```ts
147
181
  import tailwindcss from '@tailwindcss/vite';
148
182
  import { defineConfig } from 'vite';
@@ -152,16 +186,12 @@ export default defineConfig({
152
186
  });
153
187
  ```
154
188
 
155
- ### Optional: Debug Tools
156
-
157
- If you want to use the debug tools in development:
189
+ ### Optional: debug tools
158
190
 
159
191
  ```bash
160
192
  npx @nqlib/nqui init-debug-css
161
193
  ```
162
194
 
163
- Then import in your app:
164
-
165
195
  ```tsx
166
196
  import { DebugPanel } from '@nqlib/nqui';
167
197
  import '@nqlib/nqui/debug.css';
@@ -176,16 +206,11 @@ function App() {
176
206
  }
177
207
  ```
178
208
 
179
- ## Component Instructions
180
-
181
- Per-component implementation guides (AI/LLM-optimized) are in `docs/components/`:
182
- - After install: `node_modules/@nqlib/nqui/docs/components/README.md` (index of all components)
183
- - Each file: `nqui-<component>.md` — import, variants, props, notes
184
- - Token-optimized for easy AI consumption and implementation
209
+ ## Component instructions
185
210
 
186
- **Cursor/IDE rules:** Component guidelines are auto-injected to `.cursor/rules/nqui-components.mdc` on install. Run `npx @nqlib/nqui init-cursor` to refresh.
211
+ Guides for each component live under `docs/components/` in the package (after install: `node_modules/@nqlib/nqui/docs/components/`). Use **`npx @nqlib/nqui init-skills`** (or `init-cursor`) so your IDE loads `.cursor/nqui-skills` and `AGENTS.md`.
187
212
 
188
- ### Basic Components
213
+ ### Examples
189
214
 
190
215
  ```tsx
191
216
  import { Button, Checkbox, Input } from '@nqlib/nqui';
@@ -198,13 +223,8 @@ function MyForm() {
198
223
  <Button variant="default">Submit</Button>
199
224
  </form>
200
225
  );
201
- }
202
226
  ```
203
227
 
204
- ### Enhanced Components
205
-
206
- nqui includes enhanced versions of common components with additional variants:
207
-
208
228
  ```tsx
209
229
  import { Button, Separator } from '@nqlib/nqui';
210
230
 
@@ -220,8 +240,6 @@ function MyComponent() {
220
240
  }
221
241
  ```
222
242
 
223
- ### Custom Components
224
-
225
243
  ```tsx
226
244
  import { ColorPicker, Rating, TableOfContents } from '@nqlib/nqui';
227
245
 
@@ -236,48 +254,26 @@ function MyApp() {
236
254
  }
237
255
  ```
238
256
 
239
- ## Framework Support
257
+ ## Framework support
240
258
 
241
- - **Next.js** (App Router) - Fully tested and supported
242
- - **Vite** - Fully supported
243
- - **Remix** - Supported
244
- - **Create React App** - Supported
259
+ - **Next.js** (App Router)
260
+ - **Vite**
261
+ - **Remix**
262
+ - **Create React App**
245
263
 
246
- All components are framework-agnostic and work with any React setup.
264
+ Components are framework-agnostic for any React setup.
247
265
 
248
266
  ## Troubleshooting
249
267
 
250
- ### @source Directives: Next.js vs Vite
251
-
252
- **Problem:** Tailwind classes not working, or confusion about whether to use `@source` directives
253
-
254
- **Solution:**
255
- - **Next.js REQUIRES `@source` directives** in your CSS file:
256
- ```css
257
- @import "tailwindcss";
258
- @source "./**/*.{js,ts,jsx,tsx,mdx}";
259
- @source "../components/**/*.{js,ts,jsx,tsx,mdx}";
260
- @source "../node_modules/@nqlib/nqui/dist/**/*.js";
261
- @import "tw-animate-css";
262
- @import "@nqlib/nqui/styles";
263
- ```
264
-
265
- - **Vite does NOT need `@source` directives** - Tailwind automatically scans files:
266
- ```css
267
- @import "tailwindcss";
268
- @import "tw-animate-css";
269
- @import "@nqlib/nqui/styles";
270
- ```
268
+ ### `@source`: Next.js vs Vite
271
269
 
272
- **Why the difference?** Next.js has a different file structure and build process, so Tailwind needs explicit paths. Vite's `@tailwindcss/vite` plugin automatically handles file scanning.
270
+ - **Next.js** needs `@source` lines so Tailwind sees app and `node_modules/@nqlib/nqui` see the Quick Start block above.
271
+ - **Vite** typically does not need those `@source` lines when using `@tailwindcss/vite`.
273
272
 
274
- **Common mistake:** Adding `@source` directives to Vite projects (not needed and may cause issues) or missing them in Next.js projects (will cause Tailwind to not find classes).
273
+ ### Module resolution (Next.js 16+, local packages)
275
274
 
276
- ### Module Resolution Issues (Next.js 16+)
275
+ If `@nqlib/nqui` fails to resolve with `npm link` / `file:`:
277
276
 
278
- If you encounter `Module not found: Can't resolve '@nqlib/nqui'` when using `npm link` or `file:` protocol, switch to Webpack:
279
-
280
- **Quick Fix:**
281
277
  ```json
282
278
  {
283
279
  "scripts": {
@@ -286,79 +282,36 @@ If you encounter `Module not found: Can't resolve '@nqlib/nqui'` when using `npm
286
282
  }
287
283
  ```
288
284
 
289
- **Or in `next.config.ts`:**
290
- ```typescript
291
- const nextConfig: NextConfig = {
292
- experimental: {
293
- turbo: undefined, // Disable Turbopack
294
- },
295
- };
296
- ```
297
-
298
- **Why?** Next.js 16 uses Turbopack by default, which has limited symlink support. Webpack handles symlinks better for local development. Production builds always use Webpack, so there's no production impact.
285
+ Production builds use Webpack; this mainly affects local dev with symlinks.
299
286
 
300
- See [instructions.md](./instructions.md) for more troubleshooting tips.
287
+ More tips: [instructions.md](./instructions.md).
301
288
 
302
289
  ## Features
303
290
 
304
- - **Enhanced UI Components** - Button, Checkbox, RadioGroup, Separator, ScrollArea with additional variants
305
- - 🎨 **Custom Components** - ColorPicker, Rating, TableOfContents
306
- - 🛠️ **Debug Tools** - Development tools for inspecting and testing components
307
- - 🎯 **TypeScript** - Full TypeScript support with exported types
308
- - **Accessible** - Built on Radix UI primitives for accessibility
309
- - 🎨 **Themable** - CSS variables for easy theming
310
- - 📦 **Tree-shakeable** - Import only what you need
291
+ - **UI components** Buttons, forms, layout, data display, overlays, with consistent variants
292
+ - **Custom components** e.g. ColorPicker, Rating, TableOfContents
293
+ - **Debug tools** optional `DebugPanel` in development
294
+ - **TypeScript** exported types
295
+ - **Accessible** Radix UI primitives
296
+ - **Theming** CSS variables
297
+ - **Tree-shakeable** import only what you use
311
298
 
312
299
  ## Documentation
313
300
 
314
- - [Installation Guide](./INSTALLATION.md) - Detailed setup instructions
315
- - [Debug Tools](./src/components/debug/README.md) - Debug panel documentation
316
- - [AGENTS.md](./AGENTS.md) - Development guidelines for contributors
317
-
318
- ## Development
301
+ - [INSTALLATION.md](./INSTALLATION.md) CSS setup, CLI details, monorepos
302
+ - [Debug tools](./src/components/debug/README.md) debug panel
303
+ - [CHANGELOG.md](./CHANGELOG.md) release history
319
304
 
320
- For contributors:
305
+ ## Publishing (maintainers)
321
306
 
322
- ```bash
323
- # Install dependencies
324
- npm install
325
-
326
- # Run dev server (showcase app)
327
- npm run dev
328
-
329
- # Build library
330
- npm run build:lib
331
-
332
- # Build showcase app
333
- npm run build:app
334
-
335
- # Lint
336
- npm run lint
337
- ```
338
-
339
- ## Publishing
340
-
341
- For maintainers:
342
-
343
- **Publish to npmjs.com (recommended):**
344
307
  ```bash
345
308
  npm version patch|minor|major
346
309
  npm run publish:npm
347
310
  ```
348
311
 
349
- **Publish to GitHub Packages:**
350
- ```bash
351
- npm version patch|minor|major
352
- npm run publish:github
353
- ```
354
-
355
- **Publish to both:**
356
- ```bash
357
- npm version patch|minor|major
358
- npm run publish:both
359
- ```
312
+ GitHub Packages: `npm run publish:github`. Both: `npm run publish:both`.
360
313
 
361
- See [PUBLISHING.md](./PUBLISHING.md) for detailed instructions.
314
+ Details: [docs/internal-notes/PUBLISHING.md](./docs/internal-notes/PUBLISHING.md).
362
315
 
363
316
  ## License
364
317