@valiify/dashboard-ui 0.2.1 → 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.
Files changed (101) hide show
  1. package/CHANGELOG.md +1025 -12
  2. package/COMPONENTS.md +185 -79
  3. package/GETTING_STARTED.md +138 -38
  4. package/QUICK_REFERENCE.md +48 -30
  5. package/README.md +134 -83
  6. package/TROUBLESHOOTING.md +52 -34
  7. package/class-manifest.json +140 -71
  8. package/design-methodology/dashboard.md +92 -80
  9. package/dist/dashboard-ui.css +1525 -1078
  10. package/dist/index.css +1246 -732
  11. package/package.json +19 -10
  12. package/scripts/codemods/0.5.0-chip-sizes.mjs +437 -0
  13. package/src/build/utilities.css +7 -10
  14. package/src/components/_template.css +12 -8
  15. package/src/components/alert.css +35 -8
  16. package/src/components/avatar.css +42 -30
  17. package/src/components/breadcrumbs.css +39 -22
  18. package/src/components/button.css +84 -14
  19. package/src/components/card.css +2 -2
  20. package/src/components/checkbox.css +16 -11
  21. package/src/components/chip.css +155 -79
  22. package/src/components/composer.css +145 -0
  23. package/src/components/data-row.css +10 -6
  24. package/src/components/divider.css +17 -22
  25. package/src/components/dropdown-field.css +83 -43
  26. package/src/components/dropdown-menu.css +80 -14
  27. package/src/components/field-verification.css +21 -5
  28. package/src/components/filter-segment.css +27 -8
  29. package/src/components/icon-button.css +49 -10
  30. package/src/components/index.css +2 -0
  31. package/src/components/input.css +88 -32
  32. package/src/components/link.css +27 -16
  33. package/src/components/loading-inline.css +15 -21
  34. package/src/components/menu-item.css +149 -49
  35. package/src/components/modal.css +8 -5
  36. package/src/components/navigation-rail.css +67 -31
  37. package/src/components/pagination-item.css +29 -28
  38. package/src/components/pagination.css +9 -14
  39. package/src/components/pill.css +16 -10
  40. package/src/components/progress-bar.css +8 -10
  41. package/src/components/radio-select.css +9 -2
  42. package/src/components/recipient-input.css +119 -0
  43. package/src/components/section-marker.css +5 -5
  44. package/src/components/segment-selector.css +9 -3
  45. package/src/components/sensitive-data.css +7 -5
  46. package/src/components/skeleton.css +18 -6
  47. package/src/components/step.css +15 -4
  48. package/src/components/stepper.css +3 -2
  49. package/src/components/switch.css +7 -0
  50. package/src/components/tabs.css +108 -28
  51. package/src/components/tag.css +156 -51
  52. package/src/components/text-button.css +54 -59
  53. package/src/components/textarea.css +87 -22
  54. package/src/components/toast.css +41 -15
  55. package/src/components/tooltip.css +13 -2
  56. package/src/fonts.css +2 -1
  57. package/src/library.css +1 -1
  58. package/src/reset.css +213 -0
  59. package/src/themes/valiify-tokens.css +101 -126
  60. package/src/themes/valiify.css +258 -157
  61. package/src/utility-surface.css +51 -49
  62. package/types/components.d.ts +142 -24
  63. package/CLAUDE.md +0 -3694
  64. package/examples/README.md +0 -198
  65. package/examples/basic/index.html +0 -155
  66. package/examples/daisyui-starter/README.md +0 -58
  67. package/examples/daisyui-starter/check-no-bleed.mjs +0 -249
  68. package/examples/daisyui-starter/index.html +0 -72
  69. package/examples/daisyui-starter/linked.html +0 -74
  70. package/examples/daisyui-starter/package-lock.json +0 -2221
  71. package/examples/daisyui-starter/package.json +0 -22
  72. package/examples/daisyui-starter/postcss.config.js +0 -1
  73. package/examples/daisyui-starter/src/host.css +0 -14
  74. package/examples/daisyui-starter/src/only-import.css +0 -4
  75. package/examples/daisyui-starter/src/styles.css +0 -36
  76. package/examples/daisyui-starter/tailwind.config.js +0 -13
  77. package/examples/postcss-starter/README.md +0 -47
  78. package/examples/postcss-starter/index.html +0 -54
  79. package/examples/postcss-starter/package.json +0 -19
  80. package/examples/postcss-starter/postcss.config.js +0 -5
  81. package/examples/postcss-starter/src/styles.css +0 -17
  82. package/examples/sveltekit-starter/README.md +0 -32
  83. package/examples/sveltekit-starter/check-scoped-styles.mjs +0 -103
  84. package/examples/sveltekit-starter/package-lock.json +0 -1300
  85. package/examples/sveltekit-starter/package.json +0 -24
  86. package/examples/sveltekit-starter/src/app.css +0 -17
  87. package/examples/sveltekit-starter/src/app.html +0 -11
  88. package/examples/sveltekit-starter/src/lib/GlobalReset.svelte +0 -20
  89. package/examples/sveltekit-starter/src/lib/ScopedRemedy.svelte +0 -27
  90. package/examples/sveltekit-starter/src/lib/ScopedReset.svelte +0 -22
  91. package/examples/sveltekit-starter/src/routes/+layout.svelte +0 -6
  92. package/examples/sveltekit-starter/src/routes/+page.svelte +0 -10
  93. package/examples/sveltekit-starter/svelte.config.js +0 -4
  94. package/examples/sveltekit-starter/vite.config.js +0 -6
  95. package/examples/vite-starter/README.md +0 -125
  96. package/examples/vite-starter/index.html +0 -12
  97. package/examples/vite-starter/package.json +0 -19
  98. package/examples/vite-starter/src/main.js +0 -188
  99. package/examples/vite-starter/src/styles.css +0 -22
  100. package/examples/vite-starter/vite.config.js +0 -6
  101. package/src/themes/valiify-type-prefixed.css +0 -37
package/README.md CHANGED
@@ -4,54 +4,73 @@ A Tailwind CSS component library for Valiify Dashboard applications.
4
4
 
5
5
  **40 verified components** extracted from Figma. CSS-only, framework-agnostic, zero JavaScript dependencies.
6
6
 
7
- ## ⚠️ Important: Read This First
7
+ ## Which file do you import?
8
8
 
9
- **This package requires a build tool.** Installing `npm install @valiify/dashboard-ui tailwindcss` is not enough. You also need:
9
+ **Tailwind 4 app — the default, and what production uses.** Your Tailwind build
10
+ compiles our tokens, so you get every component class **and** every token utility
11
+ (`bg-approved`, `rounded-control`, `text-body-dense`):
10
12
 
11
- - **Vite:** `@tailwindcss/vite`
12
- - **webpack:** `@tailwindcss/webpack`
13
- - **PostCSS/Next.js:** `@tailwindcss/postcss`
14
- - **No bundler:** `@tailwindcss/cli`
15
-
16
- **Without one of these packages, nothing will work.** No errors, no styles. See [Installation](#installation) below.
17
-
18
- ## Quick Start (Recommended)
19
-
20
- The fastest way to get started is to use our verified example:
21
-
22
- ```bash
23
- # Copy the Vite starter
24
- npx degit BubbaCoop/Valiify-dashboard-ui/examples/vite-starter my-app
25
- cd my-app
26
-
27
- # Install and run
28
- npm install
29
- npm run dev
13
+ ```css
14
+ @import "tailwindcss";
15
+ @import "@valiify/dashboard-ui/source";
30
16
  ```
31
17
 
32
- Open [http://localhost:5173](http://localhost:5173) - if you see styled components with working icons, you're done.
18
+ > **`./source` requires Tailwind 4**, plus its build integration
19
+ > (`@tailwindcss/vite`, `@tailwindcss/postcss`, `@tailwindcss/webpack` or
20
+ > `@tailwindcss/cli`). Without the integration package nothing is processed and
21
+ > nothing errors. Tailwind's own Preflight is the reset — **don't disable it**
22
+ > ([why, and the remedy if you must](#step-3-create-your-stylesheet)).
33
23
 
34
- **Or:** See the [complete installation guide](GETTING_STARTED.md) for manual setup with any build tool.
24
+ **Alternatives** — use one of these only if the default doesn't fit:
35
25
 
36
- ## Entry points
26
+ | Your setup | Import | What you get |
27
+ | --- | --- | --- |
28
+ | **Tailwind 3, or any app with its own reset** (daisyUI, a framework's base styles) | `@import "@valiify/dashboard-ui/styles.css";` **as the first line** | Prebuilt components with **no Preflight and no `html` rule**, so they can't fight your reset, plus a closed set of `vd:`-prefixed utilities. Never use `./source` on Tailwind 3. |
29
+ | **No Tailwind at all**, the bundle is the page's only stylesheet | `@import "@valiify/dashboard-ui/reset.css";` then `@import "@valiify/dashboard-ui/styles.css";` | The same prebuilt components, plus the ~20-line reset they need on a bare page (below). |
30
+ | **No build step at all** (a static page, a prototype) | `<link rel="stylesheet" href="node_modules/@valiify/dashboard-ui/dist/index.css">` | The prebuilt components **with** Tailwind's Preflight and an `html` rule — fine on a standalone page, wrong inside an app that has its own reset. |
37
31
 
38
- | Import | Use it when |
39
- | --- | --- |
40
- | `@valiify/dashboard-ui/styles.css` | dropping the library into a host app that already has a reset — **no Preflight, no `html` rule, unlayered**, closed `vd:` utility set |
41
- | `@valiify/dashboard-ui` | a standalone page where our Preflight is welcome |
42
- | `@valiify/dashboard-ui/source` | your Tailwind compiles our `@theme`, giving every token utility |
32
+ Tailwind is an **optional** peer dependency (`>=3.0.0`): the prebuilt entries need
33
+ none, and the package installs cleanly next to Tailwind 3 or 4.
43
34
 
44
- Component classes are namespaced: `.vd-btn`, `.vd-card-title`, `.vd-input-field`.
45
- The generated list ships as `@valiify/dashboard-ui/manifest`.
35
+ Component classes are namespaced: `.vd-btn`, `.vd-input-field`, `.vd-chip`. The
36
+ generated list ships as `@valiify/dashboard-ui/manifest`.
46
37
 
47
38
  ```css
48
- /* a host app — the @import must come FIRST, CSS discards a later one */
39
+ /* Tailwind 3 host — the @import must come FIRST; CSS discards a later one */
49
40
  @import "@valiify/dashboard-ui/styles.css";
50
41
  @tailwind base;
51
42
  @tailwind components;
52
43
  @tailwind utilities;
53
44
  ```
54
45
 
46
+ ### Do you need `./reset.css`?
47
+
48
+ `./styles.css` ships no Preflight, so it cannot fight your reset. The flip side is
49
+ that a page with **no** other stylesheet falls back to the browser's defaults, and
50
+ three of those break the library's geometry: elements are `content-box`, so every
51
+ padded component renders wider and taller than designed (the small input measures
52
+ 38px against a designed 24); `<p>` and `<h2>` carry a 1em margin inside Alert,
53
+ Toast, Modal and Tooltip; `<button>` carries a 2px UA border. Text also falls back
54
+ to the UA serif, because the bundle defines `--font-sans` but has no Preflight to
55
+ bind it.
56
+
57
+ ```css
58
+ /* a standalone page — the reset FIRST, then the bundle */
59
+ @import "@valiify/dashboard-ui/reset.css";
60
+ @import "@valiify/dashboard-ui/styles.css";
61
+ ```
62
+
63
+ **Skip it inside an app that already has a reset.** Its first eight rules would be
64
+ redundant there, and its ninth sets `html { color; background-color }` — a page
65
+ default your app owns. Nothing imports this file for you.
66
+
67
+ It is about twenty lines and deliberately not a Preflight: no lists, tables,
68
+ images, fieldsets, form-control appearance or placeholder colour. Every rule is
69
+ there because a measured value was wrong without it, and both directions are gated
70
+ in CI (`npm run verify:reset`) — it must override nothing the bundle declares, and
71
+ it must still render the documented markup exactly as `@valiify/dashboard-ui` (the
72
+ Preflight-carrying entry) does.
73
+
55
74
  `./styles.css` does not render "identically" to `./source`. Its contract is
56
75
  narrower and checkable, in two clauses:
57
76
 
@@ -72,7 +91,26 @@ Both clauses are measured in `examples/daisyui-starter` (Tailwind 3 + daisyUI 4,
72
91
  three load paths) and `examples/sveltekit-starter` (Svelte scoped styles, including
73
92
  clause 2 asserted as a loss) — `npm run check` in each.
74
93
 
75
- ## Installation
94
+ ## Quick Start (Tailwind 4 + Vite)
95
+
96
+ Copy the Vite starter, which depends on the published `@valiify/dashboard-ui@^0.5.0`:
97
+
98
+ ```bash
99
+ npx degit BubbaCoop/Valiify-dashboard-ui/examples/vite-starter my-app
100
+ cd my-app
101
+ npm install
102
+ npm run dev
103
+ ```
104
+
105
+ Open [http://localhost:5173](http://localhost:5173) — styled components with working
106
+ icons mean you're set up. For any other build tool, see [Installation](#installation)
107
+ below or the [full guide](GETTING_STARTED.md).
108
+
109
+ ## Installation (Tailwind 4)
110
+
111
+ The default setup. On Tailwind 3 or without Tailwind, use the
112
+ [alternatives above](#which-file-do-you-import) instead — they need only
113
+ `npm install @valiify/dashboard-ui` and one `@import`.
76
114
 
77
115
  ### Step 1: Install Packages
78
116
 
@@ -80,16 +118,16 @@ Choose based on your build tool:
80
118
 
81
119
  ```bash
82
120
  # Vite (recommended)
83
- npm install @valiify/dashboard-ui tailwindcss @tailwindcss/vite
121
+ npm install @valiify/dashboard-ui tailwindcss@4 @tailwindcss/vite
84
122
 
85
123
  # webpack
86
- npm install @valiify/dashboard-ui tailwindcss @tailwindcss/webpack
124
+ npm install @valiify/dashboard-ui tailwindcss@4 @tailwindcss/webpack
87
125
 
88
126
  # PostCSS / Next.js
89
- npm install @valiify/dashboard-ui tailwindcss @tailwindcss/postcss
127
+ npm install @valiify/dashboard-ui tailwindcss@4 @tailwindcss/postcss
90
128
 
91
129
  # Tailwind CLI (no bundler)
92
- npm install @valiify/dashboard-ui tailwindcss @tailwindcss/cli
130
+ npm install @valiify/dashboard-ui tailwindcss@4 @tailwindcss/cli
93
131
  ```
94
132
 
95
133
  > ⚠️ **You need THREE packages, not two.** `tailwindcss` alone doesn't process CSS in v4. Missing the integration package (the third one above) causes silent failure.
@@ -139,7 +177,7 @@ Create a CSS file (e.g., `src/styles.css`):
139
177
 
140
178
  ```css
141
179
  /* Optional: Load fonts */
142
- @import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");
180
+ @import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");
143
181
 
144
182
  /* Required: Tailwind first */
145
183
  @import "tailwindcss";
@@ -150,6 +188,35 @@ Create a CSS file (e.g., `src/styles.css`):
150
188
 
151
189
  > **⚠️ CRITICAL:** Import from CSS, never from JavaScript. See [Common Mistakes](GETTING_STARTED.md#common-mistakes).
152
190
 
191
+ > **⚠️ Don't disable Preflight.** In a Tailwind 4 app, Tailwind's Preflight *is*
192
+ > the reset these components are sized against. Importing only Tailwind's theme and
193
+ > utilities (leaving out `tailwindcss/preflight.css`) leaves elements `content-box`
194
+ > with the browser's margins and fonts, and components render the wrong size with no
195
+ > error. If you must turn Preflight off, load the library's reset into Tailwind's
196
+ > `base` layer in its place:
197
+ >
198
+ > ```css
199
+ > @layer theme, base, components, utilities;
200
+ > @import "tailwindcss/theme.css" layer(theme);
201
+ > @import "@valiify/dashboard-ui/reset.css" layer(base);
202
+ > @import "tailwindcss/utilities.css" layer(utilities);
203
+ > @import "@valiify/dashboard-ui/source";
204
+ > ```
205
+ >
206
+ > **Not a plain `@import "@valiify/dashboard-ui/reset.css";`.** `./source` keeps its
207
+ > component rules in `@layer components`, and an unlayered rule beats every layered
208
+ > one, so the reset's element rules would override the components' own styling. In
209
+ > `layer(base)` the reset sits beneath the components, where a reset belongs.
210
+ >
211
+ > Measured on 0.5.0 in Chromium, with the documented markup and an 828px-wide Alert:
212
+ >
213
+ > | Tailwind 4 setup | Small input | Alert | Font |
214
+ > | --- | --- | --- | --- |
215
+ > | Documented (`@import "tailwindcss";`, Preflight on) | **24** | **98** | Inter |
216
+ > | Preflight off (theme + utilities only) | 26 | 152 | Times |
217
+ > | Preflight off + plain `reset.css` import | 24 | 106 | Inter |
218
+ > | Preflight off + `reset.css` in `layer(base)` | **24** | **98** | Inter |
219
+
153
220
  ### Step 4: Import Your Stylesheet
154
221
 
155
222
  In your JavaScript entry point:
@@ -164,6 +231,9 @@ import "./styles.css"; // ✅ Import YOUR stylesheet, not the library
164
231
  Add to your JavaScript:
165
232
 
166
233
  ```js
234
+ // `?url` is Vite's syntax. With another bundler, import the file the way it
235
+ // exposes asset URLs, or copy node_modules/@valiify/dashboard-ui/src/icons/sprite.svg
236
+ // into your public folder and fetch that path.
167
237
  import spriteUrl from "@valiify/dashboard-ui/icons/sprite.svg?url";
168
238
 
169
239
  fetch(spriteUrl)
@@ -203,20 +273,23 @@ fetch(spriteUrl)
203
273
 
204
274
  ### Examples
205
275
 
206
- - **[examples/vite-starter/](examples/vite-starter/)** - Working Vite setup (recommended)
207
- - **[examples/postcss-starter/](examples/postcss-starter/)** - PostCSS CLI setup
208
- - **[examples/basic/](examples/basic/)** - Standalone HTML (prebuilt CSS)
276
+ In the repository (they are not part of the npm package — copy one with `degit`):
277
+
278
+ - **[examples/vite-starter/](https://github.com/BubbaCoop/Valiify-dashboard-ui/tree/main/examples/vite-starter)** - Tailwind 4 + Vite (recommended)
279
+ - **[examples/postcss-starter/](https://github.com/BubbaCoop/Valiify-dashboard-ui/tree/main/examples/postcss-starter)** - Tailwind 4 + PostCSS CLI
280
+ - **[examples/daisyui-starter/](https://github.com/BubbaCoop/Valiify-dashboard-ui/tree/main/examples/daisyui-starter)** - Tailwind 3 + daisyUI host, `./styles.css`
281
+ - **[examples/basic/](https://github.com/BubbaCoop/Valiify-dashboard-ui/tree/main/examples/basic)** - Standalone HTML, no build
209
282
 
210
283
  ### Reference
211
284
 
212
- - **[CLAUDE.md](CLAUDE.md)** - Technical reference: every component's structure, states, and Figma differences
213
- - **[CHANGELOG.md](CHANGELOG.md)** - Version history and breaking changes
285
+ - **[CHANGELOG.md](CHANGELOG.md)** - Version history and breaking changes, with a codemod for every 0.5.0 rename
286
+ - **[CLAUDE.md](https://github.com/BubbaCoop/Valiify-dashboard-ui/blob/main/CLAUDE.md)** (repository only) - Technical reference: every component's structure, states, and Figma differences
214
287
 
215
288
  ## Available Components
216
289
 
217
290
  ### Form Controls
218
291
 
219
- Button • IconButton • TextButton • Input • Textarea • Checkbox • RadioSelect • Switch • DropdownField • SensitiveData
292
+ Button • IconButton • TextButton • Input • Textarea • Checkbox • RadioSelect • Switch • DropdownField • Composer • RecipientInput • SensitiveData
220
293
 
221
294
  ### Data Display
222
295
 
@@ -254,12 +327,13 @@ See [GETTING_STARTED.md](GETTING_STARTED.md#components-that-need-javascript) for
254
327
 
255
328
  ### Styles don't apply at all
256
329
 
257
- **Cause:** Missing integration package or wrong import.
330
+ **Cause (Tailwind 4, `./source`):** a missing integration package or a wrong import.
331
+ **Cause (prebuilt `./styles.css`):** the `@import` is not the first line, so the browser discards it.
258
332
 
259
333
  **Fix:**
260
- 1. Install `@tailwindcss/vite` (or postcss/webpack/cli)
261
- 2. Register it in your config
262
- 3. Import from CSS, not JavaScript
334
+ 1. On Tailwind 4, install `@tailwindcss/vite` (or postcss/webpack/cli) and register it
335
+ 2. Import from CSS, not JavaScript
336
+ 3. On the prebuilt bundle, make its `@import` the first line
263
337
 
264
338
  See [TROUBLESHOOTING.md](TROUBLESHOOTING.md#styles-dont-apply-at-all).
265
339
 
@@ -271,9 +345,9 @@ See [TROUBLESHOOTING.md](TROUBLESHOOTING.md#styles-dont-apply-at-all).
271
345
 
272
346
  ### Token utilities don't work
273
347
 
274
- **Cause:** Using prebuilt `/` entry instead of `/source`.
348
+ **Cause:** token utilities (`bg-approved`, `rounded-control`) are generated by *your* Tailwind 4 build from `./source`. The prebuilt entries don't carry them; `./styles.css` ships only a closed, `vd:`-prefixed set.
275
349
 
276
- **Fix:** Change `@import "@valiify/dashboard-ui"` to `@import "@valiify/dashboard-ui/source"`.
350
+ **Fix:** on Tailwind 4, import `@valiify/dashboard-ui/source`. On Tailwind 3 or without Tailwind, use the `vd:` utilities `./styles.css` ships, or the component classes.
277
351
 
278
352
  ### Component looks broken
279
353
 
@@ -287,34 +361,11 @@ See [TROUBLESHOOTING.md](TROUBLESHOOTING.md#styles-dont-apply-at-all).
287
361
 
288
362
  **Fix:** See [Components That Need JavaScript](#components-that-need-javascript).
289
363
 
290
- ## Two Entry Points
291
-
292
- ```css
293
- /* /source - for apps with Tailwind build (recommended) */
294
- @import "tailwindcss";
295
- @import "@valiify/dashboard-ui/source";
296
-
297
- /* / (prebuilt) - for standalone HTML, no Tailwind build */
298
- <link rel="stylesheet" href="node_modules/@valiify/dashboard-ui/dist/index.css">
299
- ```
300
-
301
- **Use `/source` for:**
302
- - Any app with a bundler (Vite, webpack, Next.js, etc.)
303
- - When you want token utilities (`bg-approved`, `rounded-pill`, `type-label-l`)
304
- - When your own `@theme` should survive
305
-
306
- **Use `/` (prebuilt) only for:**
307
- - Standalone HTML pages with no build process
308
- - Email previews
309
- - Static prototypes
310
-
311
- See [GETTING_STARTED.md](GETTING_STARTED.md) for details.
312
-
313
364
  ## Design System
314
365
 
315
366
  Built on the Valiify Figma design system (Commercial-Designs, `FdcEV83HPv44bzLPAQU1hR`).
316
367
 
317
- **40 colors** • **5 radii** • **3 border widths** • **37 text styles** • **4 shadows** • **6 label utilities**
368
+ **48 colors** • **5 radii** • **3 border widths** • **5 control heights** • **21 text styles** (each also a `.vd-text-*` class) • **4 shadows**
318
369
 
319
370
  All tokens are **extracted from Figma**, not hand-written. They live in a Tailwind `@theme` block, so each one generates utilities:
320
371
 
@@ -322,7 +373,7 @@ All tokens are **extracted from Figma**, not hand-written. They live in a Tailwi
322
373
  /* Token → Utilities */
323
374
  --color-approved → bg-approved, text-approved, border-approved
324
375
  --radius-control → rounded-control
325
- --text-body-1 → text-body-1 (size + line-height + weight + tracking)
376
+ --text-body-dense → text-body-dense (size + line-height + weight + tracking)
326
377
  ```
327
378
 
328
379
  Browse the full set in Storybook under **Foundations → Design Tokens**.
@@ -358,8 +409,8 @@ npm install
358
409
  ### Build
359
410
 
360
411
  ```bash
361
- npm run build # Build library
362
- npm run dev # Build + watch
412
+ npm run build # Theme, icons, both bundles, manifest
413
+ npm run dev # Watch dist/index.css only (not the theme, icons or ./styles.css)
363
414
  npm run build:theme # Regenerate tokens from Figma JSON
364
415
  ```
365
416
 
@@ -381,7 +432,7 @@ npm run verify:a11y # Accessibility scan
381
432
  npm run typecheck # TypeScript
382
433
  ```
383
434
 
384
- All verification runs in CI: [.github/workflows/ci.yml](.github/workflows/ci.yml)
435
+ Every gate except `verify:a11y` runs in CI ([ci.yml](https://github.com/BubbaCoop/Valiify-dashboard-ui/blob/main/.github/workflows/ci.yml)); `verify:a11y` is deliberately not wired while a designer-blocked contrast pair keeps it red.
385
436
 
386
437
  ### Add a Component
387
438
 
@@ -389,7 +440,7 @@ All verification runs in CI: [.github/workflows/ci.yml](.github/workflows/ci.yml
389
440
  npm run new:component Badge # Scaffold CSS, story, types
390
441
  ```
391
442
 
392
- See [docs/component-process.md](docs/component-process.md) for the full process.
443
+ See [docs/component-process.md](https://github.com/BubbaCoop/Valiify-dashboard-ui/blob/main/docs/component-process.md) for the full process.
393
444
 
394
445
  ## Architecture
395
446
 
@@ -401,8 +452,8 @@ See [docs/component-process.md](docs/component-process.md) for the full process.
401
452
 
402
453
  ## Status
403
454
 
404
- **Current:** Phase 3 complete - 40 components built and verified
405
- **Next:** Accessibility remediation, then publish to NPM
455
+ **0.5.0** — 40 components on the Revision 3 design scale, every one with a visual spec.
456
+ **Next:** accessibility remediation (the remaining items are designer-blocked contrast tokens).
406
457
 
407
458
  ## Links
408
459
 
@@ -413,7 +464,7 @@ See [docs/component-process.md](docs/component-process.md) for the full process.
413
464
 
414
465
  ## Contributing
415
466
 
416
- Not accepting external contributions yet. This is a pre-release package under active development.
467
+ Not accepting external contributions yet.
417
468
 
418
469
  ## License
419
470
 
@@ -423,7 +474,7 @@ MIT © Valiify
423
474
 
424
475
  ## Still Having Issues?
425
476
 
426
- 1. **Check the examples** - `examples/vite-starter/` is a verified working setup
477
+ 1. **Check the examples** - [examples/vite-starter](https://github.com/BubbaCoop/Valiify-dashboard-ui/tree/main/examples/vite-starter) is a verified working setup
427
478
  2. **Read [GETTING_STARTED.md](GETTING_STARTED.md)** - Covers all build tools
428
479
  3. **Read [TROUBLESHOOTING.md](TROUBLESHOOTING.md)** - Debug guide
429
480
  4. **Read [COMPONENTS.md](COMPONENTS.md)** - Complete markup reference
@@ -9,7 +9,9 @@ Page loads, no errors in console, but components have no styling. Buttons look l
9
9
 
10
10
  ### Causes and Fixes
11
11
 
12
- **1. Missing integration package**
12
+ **On the prebuilt `./styles.css` (Tailwind 3 or no Tailwind):** its `@import` must be the **first** line of the stylesheet — CSS silently discards an `@import` that follows any other rule. Causes 1–3 below are for the Tailwind 4 (`./source`) setup.
13
+
14
+ **1. Missing integration package (Tailwind 4)**
13
15
 
14
16
  You have `tailwindcss` but not `@tailwindcss/vite` (or postcss/webpack/cli).
15
17
 
@@ -61,10 +63,10 @@ You did `import "@valiify/dashboard-ui/source"` in a `.js` file.
61
63
 
62
64
  **Check:** Search your codebase:
63
65
  ```bash
64
- grep -r "@valiify/dashboard-ui" src/**/*.{js,ts,jsx,tsx}
66
+ grep -rE "@valiify/dashboard-ui(/source|/styles\.css|/index\.css|['\"])" src --include='*.js' --include='*.ts' --include='*.jsx' --include='*.tsx'
65
67
  ```
66
68
 
67
- If you find hits, **those are wrong**. The library must be imported from CSS only.
69
+ A hit is a stylesheet imported from JavaScript, and that is wrong: the library's CSS must be imported from CSS. (The sprite import, `@valiify/dashboard-ui/icons/sprite.svg?url`, is the one import that belongs in JavaScript, and this search skips it.)
68
70
 
69
71
  **Fix:**
70
72
  ```diff
@@ -179,21 +181,17 @@ Open DevTools Elements and search for `<svg`. You should see a hidden div contai
179
181
  Classes like `bg-approved`, `text-content-secondary`, `rounded-pill` have no effect. Only works with `var(--color-approved)`.
180
182
 
181
183
  ### Cause
182
- You're using the prebuilt `/` entry instead of `/source`.
184
+ Token utilities are generated by **your Tailwind 4 build** from `./source`. The prebuilt entries are already compiled, so nothing generates them there: `.` / `./index.css` carry none, and `./styles.css` carries only a **closed** set spelled with a `vd:` prefix (`vd:bg-approved`). A utility outside that set renders unstyled with no error.
183
185
 
184
186
  ### How to Check
185
187
  ```css
186
- /* If your CSS looks like this: */
187
- @import "@valiify/dashboard-ui"; /* ← no /source */
188
+ /* If your CSS imports a prebuilt entry: */
189
+ @import "@valiify/dashboard-ui"; /* or /index.css, /styles.css */
188
190
  ```
189
191
 
190
192
  ### Fix
191
- ```css
192
- /* Change to: */
193
- @import "@valiify/dashboard-ui/source";
194
- ```
195
-
196
- The prebuilt entry is already compiled, so Tailwind can't generate utilities from it. Only `/source` exposes the `@theme` tokens that generate utilities.
193
+ - **Tailwind 4:** import `@valiify/dashboard-ui/source` instead (after `@import "tailwindcss";`).
194
+ - **Tailwind 3, or no Tailwind:** `./source` is not an option — it needs Tailwind 4. Use the `vd:` spellings `./styles.css` ships (the full list is in `@valiify/dashboard-ui/manifest`, `prefixedUtilities`), or the component classes.
197
195
 
198
196
  ## Components Look Broken or Partially Styled
199
197
 
@@ -223,7 +221,7 @@ Missing wrapper elements or incorrect markup structure.
223
221
 
224
222
  **Check the component reference:**
225
223
 
226
- See [COMPONENTS.md](COMPONENTS.md) for the required markup structure of every component, or [CLAUDE.md](CLAUDE.md) for the complete technical reference.
224
+ See [COMPONENTS.md](COMPONENTS.md) for the required markup structure of every component, or the repository's [CLAUDE.md](https://github.com/BubbaCoop/Valiify-dashboard-ui/blob/main/CLAUDE.md) for the complete technical reference.
227
225
 
228
226
  **Quick verification:**
229
227
 
@@ -288,17 +286,35 @@ These components ship **zero JavaScript**. They're styled shells that require yo
288
286
 
289
287
  **Minimal example:**
290
288
  ```js
291
- const trigger = document.querySelector('[aria-haspopup="listbox"]');
292
- const panel = document.querySelector(".dropdown-panel");
293
-
294
- trigger.addEventListener("click", () => {
295
- const isOpen = trigger.getAttribute("aria-expanded") === "true";
296
- trigger.setAttribute("aria-expanded", !isOpen);
297
- panel.hidden = isOpen;
298
- });
289
+ // One handler per dropdown on the page. Each .vd-dropdown wraps a trigger
290
+ // (aria-haspopup + aria-expanded) and a .vd-dropdown-panel that starts `hidden`.
291
+ for (const dropdown of document.querySelectorAll(".vd-dropdown")) {
292
+ const trigger = dropdown.querySelector("[aria-haspopup]");
293
+ const panel = dropdown.querySelector(".vd-dropdown-panel");
294
+
295
+ const setOpen = (open) => {
296
+ trigger.setAttribute("aria-expanded", String(open));
297
+ panel.hidden = !open;
298
+ };
299
+
300
+ trigger.addEventListener("click", () =>
301
+ setOpen(trigger.getAttribute("aria-expanded") !== "true"),
302
+ );
303
+
304
+ // Close on an outside click, and on Escape (returning focus to the trigger).
305
+ document.addEventListener("click", (e) => {
306
+ if (!dropdown.contains(e.target)) setOpen(false);
307
+ });
308
+ dropdown.addEventListener("keydown", (e) => {
309
+ if (e.key === "Escape") {
310
+ setOpen(false);
311
+ trigger.focus();
312
+ }
313
+ });
314
+ }
299
315
  ```
300
316
 
301
- See `examples/vite-starter/src/main.js` for a complete working dropdown implementation.
317
+ See [examples/vite-starter/src/main.js](https://github.com/BubbaCoop/Valiify-dashboard-ui/blob/main/examples/vite-starter/src/main.js) (in the repository; examples are not part of the npm package) for a complete implementation, including option selection.
302
318
 
303
319
  **For modals:** Use native `<dialog>` instead:
304
320
 
@@ -386,14 +402,16 @@ npm run build
386
402
 
387
403
  ### Bundle size is huge
388
404
 
389
- **Cause:** You're importing the prebuilt entry (`@valiify/dashboard-ui`) which includes all of Tailwind's base styles.
405
+ **Cause:** You're importing the prebuilt entry (`@valiify/dashboard-ui`), which includes Tailwind's Preflight and is compiled whole.
390
406
 
391
- **Fix:** Use `/source` instead and let your own Tailwind build handle it:
407
+ **Fix:**
408
+ - **Tailwind 4:** use `./source` and let your own build compile it, so you ship one Preflight and only the utilities you use:
392
409
 
393
- ```css
394
- @import "tailwindcss";
395
- @import "@valiify/dashboard-ui/source";
396
- ```
410
+ ```css
411
+ @import "tailwindcss";
412
+ @import "@valiify/dashboard-ui/source";
413
+ ```
414
+ - **Tailwind 3, or an app with its own reset:** use `./styles.css` — the same components with no Preflight.
397
415
 
398
416
  Also verify your production build is minifying CSS.
399
417
 
@@ -401,9 +419,9 @@ Also verify your production build is minifying CSS.
401
419
 
402
420
  ### "Module has no exported member 'ButtonProps'"
403
421
 
404
- **Cause:** This package is CSS-only with minimal TypeScript definitions.
422
+ **Cause:** This package is CSS-only. Its `./types` entry ships **class-name** types — string unions of every class, per component (`import type { ButtonClass } from "@valiify/dashboard-ui/types"`) — not component props.
405
423
 
406
- **Fix:** Component props are not typed. Use basic HTML element types:
424
+ **Fix:** Type your own components' props with HTML element types, and use the class unions for the class names:
407
425
 
408
426
  ```tsx
409
427
  // Instead of ButtonProps (doesn't exist)
@@ -421,7 +439,7 @@ axe or Lighthouse flags color contrast issues on labels, placeholders, or tertia
421
439
  Known issue: `Content/Tertiary` (#727280) fails WCAG AA (4.5:1) on `Surface/Neutral` and `Surface/Frame` backgrounds. Ratios are 4.20 and 4.26 (need 4.5:1).
422
440
 
423
441
  ### Status
424
- Designer-blocked. This is a token-level issue, not a CSS bug. See `docs/accessibility-audit.md` for details.
442
+ Designer-blocked. This is a token-level issue, not a CSS bug. See the repository's [docs/accessibility-audit.md](https://github.com/BubbaCoop/Valiify-dashboard-ui/blob/main/docs/accessibility-audit.md) for details.
425
443
 
426
444
  ### Workaround
427
445
  For critical labels that must pass AA, override with a darker color:
@@ -432,11 +450,11 @@ For critical labels that must pass AA, override with a darker color:
432
450
  </span>
433
451
  ```
434
452
 
435
- `Content/Secondary` (#5b5b68) passes at 4.54:1 on all four surfaces.
453
+ `Content/Secondary` (#5b5b68) passes on all four surfaces: 6.69:1 on Paper, 6.41 on Card, 5.93 on Neutral, 6.01 on Frame.
436
454
 
437
455
  ## Still Stuck?
438
456
 
439
- 1. **Check the examples** - `examples/vite-starter/` and `examples/postcss-starter/` are verified working setups. If those work and yours doesn't, compare the differences.
457
+ 1. **Check the examples** - the repository's [examples/vite-starter](https://github.com/BubbaCoop/Valiify-dashboard-ui/tree/main/examples/vite-starter) and [examples/postcss-starter](https://github.com/BubbaCoop/Valiify-dashboard-ui/tree/main/examples/postcss-starter) are verified working setups. If those work and yours doesn't, compare the differences.
440
458
 
441
459
  2. **Search issues** - https://github.com/BubbaCoop/Valiify-dashboard-ui/issues
442
460
 
@@ -447,4 +465,4 @@ For critical labels that must pass AA, override with a darker color:
447
465
  - What component you're trying to use
448
466
  - Whether examples work for you
449
467
 
450
- 4. **Check the Tailwind v4 docs** - Many issues are Tailwind v4 setup problems, not library-specific: https://tailwindcss.com/docs/v4-beta
468
+ 4. **Check the Tailwind v4 docs** - Many issues are Tailwind v4 setup problems, not library-specific: https://tailwindcss.com/docs