@nqlib/nqui 0.5.6 → 0.6.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.
Files changed (76) hide show
  1. package/dist/{command-palette-DhoWGyk_.js → command-palette-CHUiGh5m.js} +2 -2
  2. package/dist/{command-palette-D24rOeE6.cjs → command-palette-DsvP2QNP.cjs} +2 -2
  3. package/dist/command.cjs.js +1 -1
  4. package/dist/command.es.js +1 -1
  5. package/dist/components/custom/table-of-contents.d.ts +2 -2
  6. package/dist/components/custom/table-of-contents.d.ts.map +1 -1
  7. package/dist/components/index.d.ts +3 -0
  8. package/dist/components/index.d.ts.map +1 -1
  9. package/dist/components/theme-appearance-menu.d.ts +9 -0
  10. package/dist/components/theme-appearance-menu.d.ts.map +1 -0
  11. package/dist/components/theme-toggle.d.ts +2 -0
  12. package/dist/components/theme-toggle.d.ts.map +1 -0
  13. package/dist/components/ui/checkbox.d.ts.map +1 -1
  14. package/dist/components/ui/combobox.d.ts +5 -3
  15. package/dist/components/ui/combobox.d.ts.map +1 -1
  16. package/dist/components/ui/toggle-group.d.ts.map +1 -1
  17. package/dist/{debug-panel-BjfW-YVo.js → debug-panel-BcYzsTp2.js} +1 -1
  18. package/dist/{debug-panel-CpqsKuxd.cjs → debug-panel-mwtujy5J.cjs} +1 -1
  19. package/dist/debug.cjs.js +1 -1
  20. package/dist/debug.es.js +1 -1
  21. package/dist/elevation-debate.html +286 -0
  22. package/dist/{input-shared-CDgy_NdJ.cjs → input-shared-C9Try5fg.cjs} +1 -1
  23. package/dist/{input-shared-NnOiyHpu.js → input-shared-DXf3Edqt.js} +1 -1
  24. package/dist/lib/floating-surface.d.ts +6 -2
  25. package/dist/lib/floating-surface.d.ts.map +1 -1
  26. package/dist/nqui.cjs.js +15 -13
  27. package/dist/nqui.es.js +2752 -2646
  28. package/dist/styles.css +151 -255
  29. package/docs/components/README.md +4 -1
  30. package/docs/components/nqui-combobox.md +15 -2
  31. package/docs/components/nqui-command-palette.md +7 -0
  32. package/docs/components/nqui-command.md +41 -0
  33. package/docs/components/nqui-scroll-area.md +69 -0
  34. package/docs/nqui-skills/AGENT_PROMPT.md +190 -0
  35. package/docs/nqui-skills/COMPONENTS_INDEX.md +51 -1
  36. package/docs/nqui-skills/COMPOSITION.md +321 -0
  37. package/docs/nqui-skills/ELEVATION.md +181 -0
  38. package/docs/nqui-skills/EVAL.md +148 -0
  39. package/docs/nqui-skills/HUMAN_GUIDE.md +18 -0
  40. package/docs/nqui-skills/MIGRATION.md +133 -0
  41. package/docs/nqui-skills/MOTION.md +189 -0
  42. package/docs/nqui-skills/README.md +2 -0
  43. package/docs/nqui-skills/READ_BUDGET.md +60 -0
  44. package/docs/nqui-skills/RECIPES.md +820 -0
  45. package/docs/nqui-skills/SKILL.md +58 -1
  46. package/docs/nqui-skills/STATES.md +154 -0
  47. package/docs/nqui-skills/THEMING.md +203 -0
  48. package/docs/nqui-skills/WRITING.md +205 -0
  49. package/docs/nqui-skills/_claude-commands/README.md +50 -0
  50. package/docs/nqui-skills/_claude-commands/design/SKILL.md +111 -0
  51. package/docs/nqui-skills/_claude-commands/edit/SKILL.md +97 -0
  52. package/docs/nqui-skills/adapt/SKILL.md +5 -2
  53. package/docs/nqui-skills/animate/SKILL.md +5 -2
  54. package/docs/nqui-skills/audit/SKILL.md +5 -2
  55. package/docs/nqui-skills/bolder/SKILL.md +5 -2
  56. package/docs/nqui-skills/clarify/SKILL.md +5 -2
  57. package/docs/nqui-skills/colorize/SKILL.md +5 -2
  58. package/docs/nqui-skills/delight/SKILL.md +5 -4
  59. package/docs/nqui-skills/distill/SKILL.md +5 -2
  60. package/docs/nqui-skills/impeccable/SKILL.md +0 -16
  61. package/docs/nqui-skills/impeccable/reference/INDEX.md +26 -0
  62. package/docs/nqui-skills/layout/SKILL.md +5 -2
  63. package/docs/nqui-skills/nqui-components/SKILL.md +33 -9
  64. package/docs/nqui-skills/nqui-composition/SKILL.md +148 -0
  65. package/docs/nqui-skills/nqui-data-tables/SKILL.md +127 -0
  66. package/docs/nqui-skills/nqui-design-system/SKILL.md +22 -1
  67. package/docs/nqui-skills/nqui-install/SKILL.md +1 -0
  68. package/docs/nqui-skills/overdrive/SKILL.md +5 -2
  69. package/docs/nqui-skills/polish/SKILL.md +5 -4
  70. package/docs/nqui-skills/quieter/SKILL.md +5 -2
  71. package/docs/nqui-skills/shape/SKILL.md +5 -2
  72. package/docs/nqui-skills/typeset/SKILL.md +5 -2
  73. package/package.json +2 -1
  74. package/scripts/build-styles.js +4 -3
  75. package/scripts/cli.js +2 -0
  76. package/scripts/install-claude-skills.js +148 -0
@@ -0,0 +1,189 @@
1
+ ---
2
+ name: nqui-motion
3
+ description: Motion design as a system, not decoration. Easing vocabulary, timing scale, choreography, reduced-motion. Use when adding ANY animation or transition. Without this, motion is either absent (cold) or busy (chaotic).
4
+ ---
5
+
6
+ # nqui Motion — Choreography, Not Decoration
7
+
8
+ Motion is design. It either serves comprehension (showing where something came from, conveying hierarchy, providing feedback) or it's noise. This file is the vocabulary.
9
+
10
+ ## Three motion principles
11
+
12
+ 1. **Motion has a job.** Every animation answers one of: *Where did this come from? Where did it go? What changed? What's happening right now?* If you can't answer, cut the animation.
13
+ 2. **Motion respects continuity.** Things appear from their source (Sheet slides from edge, Popover scales from its trigger, Toast slides from the toast region — never from random space).
14
+ 3. **Motion gets out of the way.** A confirmation animation that takes 600ms means the user waits 600ms before moving on. Make motion fast unless it's communicating something significant.
15
+
16
+ ## The timing scale
17
+
18
+ Use named tokens, not arbitrary milliseconds. These cover 95% of UI motion.
19
+
20
+ | Token | Duration | When to use |
21
+ |-------|----------|-------------|
22
+ | **instant** | 0ms (no animation) | State toggles where motion would be a delay (`checked`, `disabled`) |
23
+ | **micro** | 100ms | Hover states, focus rings, color shifts on press |
24
+ | **quick** | 150ms | Most state changes: opening dropdowns, button presses, small reveals |
25
+ | **standard** | 200-250ms | Modal/Sheet/Drawer entries, page transitions, accordion expansions |
26
+ | **dramatic** | 300-400ms | One-off attention moments — initial empty state appearing, success confirmation, onboarding cues |
27
+ | **never** | ≥500ms | Almost nothing. If you reach for 500ms+, you're decorating, not communicating |
28
+
29
+ **Default if unsure:** 150ms (`quick`). Most UI motion should be this fast.
30
+
31
+ ## The easing vocabulary
32
+
33
+ Easing curves communicate **physicality** — they tell the eye whether something is decelerating naturally (good) or moving mechanically (bad).
34
+
35
+ | Curve | Tailwind / CSS | When |
36
+ |-------|---------------|------|
37
+ | **ease-out** (`cubic-bezier(0.16, 1, 0.3, 1)`) | `ease-out` | **Default for entrances.** Things decelerate as they arrive — feels natural |
38
+ | **ease-in** (`cubic-bezier(0.4, 0, 1, 1)`) | `ease-in` | **Default for exits.** Things accelerate as they leave — out of the way |
39
+ | **ease-in-out** | `ease-in-out` | Reserved for symmetric back-and-forth (toggle that animates same way both directions) |
40
+ | **linear** | `linear` | Only for continuous motion (loading bar, spinner, marquee) — never for state changes |
41
+ | **spring** (react-spring / framer) | — | Only when modeling physical objects (drag, drawer pull). Subtle, not bouncy |
42
+
43
+ **Banned curves:** elastic, bounce, anything with overshoot > 10%. They look dated and tacky. Real objects decelerate smoothly; they don't sproing.
44
+
45
+ ## Animate this, never animate that
46
+
47
+ | ✅ Animate | ❌ Never animate |
48
+ |------------|------------------|
49
+ | `opacity` | `width` / `height` (use grid-row tricks if you need height transition) |
50
+ | `transform` (translate, scale, rotate) | `top` / `left` / `right` / `bottom` |
51
+ | `filter: blur()` (sparingly) | `padding` / `margin` |
52
+ | `background-color` (subtle, fast) | `box-shadow` (very expensive — use opacity on a shadow layer instead) |
53
+ | `color` | `font-size` |
54
+ | CSS variables (modern, GPU-friendly) | Layout properties that cause reflow |
55
+
56
+ **Why:** transform and opacity are GPU-composited and free. Layout properties cause reflow and jank, especially during scroll.
57
+
58
+ ## What to animate, when
59
+
60
+ ### Entrance / exit (mount, unmount)
61
+ - **Modal/Dialog:** scale from 95% + fade in, 200ms ease-out
62
+ - **Sheet:** translate from off-screen edge, 250ms ease-out (in), 200ms ease-in (out)
63
+ - **Popover/Tooltip:** scale from 95% + fade, 150ms ease-out, origin at trigger
64
+ - **Toast:** slide in from toast region (usually bottom or top-right), 200ms ease-out
65
+ - **Empty state on first appearance:** fade in + translate up 4px, 300ms ease-out
66
+ - **List items appearing:** stagger 30ms per item, fade + translate up 8px each, ease-out
67
+
68
+ ### State changes
69
+ - **Selection (item in a list):** background color shift, 150ms
70
+ - **Button press:** scale 0.97 for 100ms, then back — micro-affordance
71
+ - **Hover:** background or color shift, 100ms — never transform
72
+ - **Focus ring:** instant appear, fade out at 150ms
73
+
74
+ ### Attention direction (use sparingly)
75
+ - **Skeleton → real content:** crossfade 150ms (avoid the "snap")
76
+ - **Optimistic item appearing:** fade in at 70% opacity, then to 100% when confirmed
77
+ - **Error shake:** translate x ±4px, 4 cycles of 50ms each — only for form submission errors with severity
78
+
79
+ ### Continuous (loading)
80
+ - **Spinner:** 1 full rotation per 900ms, linear
81
+ - **Skeleton shimmer:** 1.5s loop, ease-in-out, very subtle (8-12% opacity range)
82
+ - **Loading bar (indeterminate):** 1.5s loop, ease-in-out
83
+ - **Progress bar (determinate):** transition `width` change with 200ms ease-out (this is one of the few times width animation is OK because it represents real progress)
84
+
85
+ ## Choreography — when multiple things move
86
+
87
+ Bad: everything animates at once → chaos.
88
+ Good: a clear sequence the eye can follow.
89
+
90
+ ### Stagger
91
+ When N similar things appear (list items, cards, nav items), animate them sequentially with a small delay (20-40ms between each). Stagger creates a sense of rhythm and avoids the "everything pops at once" feel.
92
+
93
+ ```tsx
94
+ {items.map((item, i) => (
95
+ <div
96
+ key={item.id}
97
+ style={{ animationDelay: `${i * 30}ms` }}
98
+ className="animate-fade-in-up"
99
+ >
100
+ ...
101
+ </div>
102
+ ))}
103
+ ```
104
+
105
+ **Cap stagger at ~8 items.** Beyond that, the last items appear so late it feels broken. For larger lists, skip the stagger or use a much smaller delay (10ms).
106
+
107
+ ### Sequence (different things, in order)
108
+ When a complex element appears, parts can arrive in sequence — but only when sequence conveys meaning:
109
+
110
+ ```
111
+ modal appears:
112
+ backdrop fades in (150ms)
113
+ → modal scales in (200ms, starts at 50ms — backdrop catches up)
114
+ → modal content fades in (150ms, starts at 200ms)
115
+ ```
116
+
117
+ **Default to simultaneous unless sequence is meaningful.** Don't sequence parts of a single UI element — that fragments perception.
118
+
119
+ ## Reduced motion (mandatory)
120
+
121
+ Respect `prefers-reduced-motion: reduce`. This is not optional — vestibular disorders are real.
122
+
123
+ ```css
124
+ @media (prefers-reduced-motion: reduce) {
125
+ *,
126
+ *::before,
127
+ *::after {
128
+ animation-duration: 0.01ms !important;
129
+ animation-iteration-count: 1 !important;
130
+ transition-duration: 0.01ms !important;
131
+ scroll-behavior: auto !important;
132
+ }
133
+ }
134
+ ```
135
+
136
+ **What survives reduced motion:**
137
+ - Opacity transitions (fade in/out) — these don't cause vestibular issues
138
+ - Color transitions — fine
139
+ - Subtle scale (≤ 5% change) — fine
140
+
141
+ **What gets disabled:**
142
+ - All translate-based animations (slide-in, slide-up)
143
+ - Spinners (replace with text "Loading…")
144
+ - Parallax, scroll-driven motion
145
+ - Auto-playing carousels
146
+
147
+ **The pattern:** wrap motion in a media query and provide a static alternative:
148
+
149
+ ```tsx
150
+ const prefersReducedMotion = useReducedMotion()
151
+
152
+ <div className={prefersReducedMotion ? "" : "animate-slide-in"}>
153
+ {content}
154
+ </div>
155
+ ```
156
+
157
+ ## Anti-patterns (the AI-motion ones)
158
+
159
+ These are the motion patterns that immediately signal AI-generated:
160
+
161
+ | ❌ Anti-pattern | ✅ Use instead |
162
+ |----------------|---------------|
163
+ | Bouncing/elastic everything | Smooth ease-out, no overshoot |
164
+ | 500ms+ for routine state changes | 150ms |
165
+ | Animating layout (width/height/padding) | Transform + opacity |
166
+ | Sequential typewriter text reveal | Just render the text |
167
+ | Hover scales > 1.05 | Hover background shift only |
168
+ | Wobbly button presses | scale(0.97) for 100ms, done |
169
+ | Marquee scrolling text in non-marketing UI | Truncate with ellipsis |
170
+ | Pulsing CTAs to "draw attention" | Better hierarchy, not motion |
171
+ | Spinning logos | Why? Just why? |
172
+ | Hero "shimmer" effects on every gradient | One shimmer, on one element, occasionally |
173
+ | Per-letter text animation in product UI | Reserve for marketing landing pages |
174
+
175
+ ## The motion audit
176
+
177
+ Before shipping:
178
+
179
+ - [ ] Every animation answers one of the four "why" questions (where from / where to / what changed / what's happening)
180
+ - [ ] No animation is longer than 250ms unless it's the rare "dramatic" moment
181
+ - [ ] Animating only `transform` and `opacity` (no layout props)
182
+ - [ ] Easing is ease-out for entrances, ease-in for exits (never linear except for continuous)
183
+ - [ ] `prefers-reduced-motion: reduce` is respected — verified with the OS toggle
184
+ - [ ] No bounce, elastic, or overshoot curves anywhere
185
+ - [ ] Stagger capped at ~8 items
186
+ - [ ] No infinite/looping animation outside of loading states
187
+ - [ ] Hover states are color/background shifts, not transforms
188
+
189
+ If anything moves "to look cool" rather than to serve comprehension, cut it.
@@ -6,10 +6,12 @@ These files mirror the **nqui** Cursor skills. They live in the `@nqlib/nqui` pa
6
6
  | Skill | Path |
7
7
  | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
8
8
  | Hub (start here) | [SKILL.md](./SKILL.md) |
9
+ | **Composition (product UI, recipes vs catalog)** | [COMPOSITION.md](./COMPOSITION.md) |
9
10
  | **Task → components (designers)** | [HUMAN_GUIDE.md](./HUMAN_GUIDE.md) |
10
11
  | **Component doc routing (agents; read first; saves tokens)** | [COMPONENTS_INDEX.md](./COMPONENTS_INDEX.md) |
11
12
  | Per-component markdown (copied by `init-skills` to `.cursor/.../components/`) | `docs/components/` in repo; `components/` under this folder after init |
12
13
  | Components & layouts | [nqui-components/SKILL.md](./nqui-components/SKILL.md) |
14
+ | Data tables + ScrollArea (dashboard grids) | [nqui-data-tables/SKILL.md](./nqui-data-tables/SKILL.md) |
13
15
  | Design system (sizing, Card + ScrollArea) | [nqui-design-system/SKILL.md](./nqui-design-system/SKILL.md) |
14
16
  | shadcn-style usage rules | [nqui-shadcn/SKILL.md](./nqui-shadcn/SKILL.md) |
15
17
  | Bundle size & peers | [nqui-bundle-size-best-practices/SKILL.md](./nqui-bundle-size-best-practices/SKILL.md) |
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: read-budget
3
+ description: Minimal-read routing for nqui agent tasks. Tells you which files to load (and which NOT to) for common tasks. Read this FIRST when the task is unclear — it will route you to ~1-3 files instead of bulk-reading the whole skills folder.
4
+ ---
5
+
6
+ # Read Budget — load only what you need
7
+
8
+ The skills folder has ~50 files totaling ~5000 lines. Bulk reading wastes context. Use this table to load 1–3 files per task.
9
+
10
+ ## Routing
11
+
12
+ | Task | Read THIS | Then maybe | Do NOT read |
13
+ |------|-----------|------------|-------------|
14
+ | **Build a new view from scratch** | `SKILL.md` (Agent Build Protocol — 10 steps) → `nqui-composition/SKILL.md` (craft) → `COMPOSITION.md` (pattern) → `RECIPES.md` (combos) | `STATES.md` (state matrix), `WRITING.md` (copy), one `components/nqui-<name>.md` per component | MOTION.md unless you're adding animation, full component README |
15
+ | **"How do I compose X?"** (status, bulk action, toolbar, loading state) | `RECIPES.md` (one numbered recipe) | The component(s) the recipe names | nqui-composition (philosophy, not needed for combo lookup) |
16
+ | **Make UI feel more Apple / refined** | `nqui-composition/SKILL.md` (three principles + hierarchy rules) | `RECIPES.md` to replace busy combos | Refinement skills — fix the composition first |
17
+ | **Make sure I've covered all states** | `STATES.md` (audit checklist) | — | nqui-composition (covered separately) |
18
+ | **Write copy / labels / error messages / empty states** | `WRITING.md` | — | nqui-composition, components |
19
+ | **Add transitions or animations** | `MOTION.md` (timing scale + easing) | The specific component's doc if it has motion-related props | All refinement skills |
20
+ | **Layered UI / nested cards / "this needs more depth"** | `ELEVATION.md` (the 2+1 rule + decision tree) | `nqui-design-system/SKILL.md` for the token names | Refinement skills until depth is right |
21
+ | **Run pre-ship review** | `SKILL.md` 30-second Linear designer test → `STATES.md` audit → `WRITING.md` audit → `MOTION.md` audit | `/audit` for technical/accessibility check | Refinement skills until the audits pass |
22
+ | **Set up an AI agent to use nqui** | `AGENT_PROMPT.md` (paste into agent system prompt) | `SKILL.md` Agent Build Protocol | Skills folder — agent will discover via routing |
23
+ | **Customize brand color / radius / palette** | `THEMING.md` | `colors.css` for the actual token names | Refinement skills, recipes |
24
+ | **Verify a release before publishing** | `EVAL.md` (run the 12-prompt eval) | `MIGRATION.md` to note breaking changes | All other skills — eval drives the priority |
25
+ | **Update consumer app after upgrade** | `MIGRATION.md` (latest section) | `THEMING.md` if customizations need re-verification | — |
26
+ | **Build auth / login / signup / OAuth / OTP / SSO** | `RECIPES.md` recipes 16-22 | One component doc per Field used | `Dialog`-related docs (auth is page-level, not modal) |
27
+ | **Choose between similar components** (Select vs Combobox, Dialog vs Sheet) | `COMPONENTS_INDEX.md` (inline decision tables) | One winner doc | Other component docs, COMPOSITION.md |
28
+ | **Fix a specific component's behavior** | `components/nqui-<name>.md` (single file) | `nqui-design-system/SKILL.md` only if sizing/spacing | `impeccable/`, refinement skills |
29
+ | **Card + ScrollArea / flex height bug** | `components/nqui-scroll-area.md` §0 (symptom routing) | §1 if §0 doesn't match | Other §, COMPOSITION.md |
30
+ | **Data table with sticky header / paging** | `nqui-data-tables/SKILL.md` | `components/nqui-scroll-area.md` §0–§6 | `nqui-table.md` (different component) |
31
+ | **Form (login, settings, checkout)** | `nqui-shadcn/rules/forms.md` | `components/nqui-field.md`, `nqui-input.md` | COMPOSITION.md form recipe is enough alone |
32
+ | **Toolbar selection (mode, format)** | `nqui-components/SKILL.md` (ToggleGroup rules section only) | `components/nqui-toggle-group.md` | `nqui-radio-group.md` (wrong default) |
33
+ | **Audit / review existing UI** | `audit/SKILL.md` | One specific reference IF a finding needs depth (see `impeccable/reference/INDEX.md`) | Full `impeccable/SKILL.md` if `.impeccable.md` exists |
34
+ | **Apply a refinement** (`/layout`, `/colorize`, etc.) | The specific skill `SKILL.md` | `.impeccable.md` (project context, NOT the full impeccable skill) | Other refinement skills, full `impeccable/SKILL.md` |
35
+ | **Design philosophy / anti-patterns** | `impeccable/SKILL.md` (one time, then trust it's loaded) | `impeccable/reference/<topic>.md` for one specific topic | All reference files at once |
36
+ | **Install / setup / version migration** | `nqui-install/SKILL.md` OR `nqui-local-published-toggle/SKILL.md` | — | impeccable, components |
37
+
38
+ ## Rules of thumb
39
+
40
+ 1. **One-and-done lookups** (component prop, when-to-use): `COMPONENTS_INDEX.md` first, then ONE file. Stop.
41
+ 2. **Build tasks**: `SKILL.md` Agent Build Protocol → never deviate from its step order.
42
+ 3. **Don't reload `impeccable/SKILL.md`** if the conversation has already touched a design skill — its context persists.
43
+ 4. **`reference/` subdirectories** require an index — see `impeccable/reference/INDEX.md`. Do NOT bulk-read references.
44
+ 5. **`.impeccable.md` in project root** is the project's design context. Refinement skills should check it, not reload the full impeccable skill.
45
+
46
+ ## File-size hints (for picking the cheapest read)
47
+
48
+ - Per-component docs: typically 15–70 lines. Largest: `nqui-scroll-area.md` (175), `nqui-combobox.md` (158).
49
+ - `impeccable/SKILL.md`: ~360 lines — expensive. Load once per conversation.
50
+ - `impeccable/reference/*`: 70–195 lines each. Use the index, never all.
51
+ - `COMPOSITION.md`: ~220 lines. Contains all named layout patterns + checklist.
52
+ - Refinement skill `SKILL.md` files: typically 100–150 lines.
53
+
54
+ ## Token-saving anti-patterns
55
+
56
+ - ❌ Loading `components/README.md` (large index file) when `COMPONENTS_INDEX.md` answers the question
57
+ - ❌ Bulk-reading `impeccable/reference/*` to "be thorough"
58
+ - ❌ Re-invoking `/impeccable` mid-conversation when context is already loaded
59
+ - ❌ Reading multiple refinement skills before choosing one — pick based on description
60
+ - ❌ Reading all 65 component docs to "discover" what's available — use `COMPONENTS_INDEX.md` area tables