@vllnt/ui 0.4.0-canary.sha36bfa21 → 0.4.0-canary.sha49f831b

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 (105) hide show
  1. package/CHANGELOG.md +170 -6
  2. package/README.md +61 -3
  3. package/dist/components/atoms/accordion/accordion.js +28 -7
  4. package/dist/components/atoms/agent-activity/agent-activity.js +1 -1
  5. package/dist/components/atoms/ai-source-citation/ai-source-citation.js +1 -1
  6. package/dist/components/atoms/alert/alert.js +1 -1
  7. package/dist/components/atoms/alert-pulse/alert-pulse.js +7 -4
  8. package/dist/components/atoms/avatar/avatar.js +129 -24
  9. package/dist/components/atoms/badge/badge.js +84 -5
  10. package/dist/components/atoms/bottom-activity-strip/bottom-activity-strip.js +3 -2
  11. package/dist/components/atoms/breadcrumb/breadcrumb.js +89 -37
  12. package/dist/components/atoms/checklist/checklist.js +2 -2
  13. package/dist/components/atoms/curriculum/curriculum.js +4 -4
  14. package/dist/components/atoms/dialog/dialog.js +4 -2
  15. package/dist/components/atoms/drawer/drawer.js +1 -1
  16. package/dist/components/atoms/dropdown-menu/dropdown-menu.js +1 -1
  17. package/dist/components/atoms/floating-toolbar/floating-toolbar.js +23 -2
  18. package/dist/components/atoms/gauge-chart/gauge-chart.js +1 -1
  19. package/dist/components/atoms/glass-progress/glass-progress.js +1 -1
  20. package/dist/components/atoms/heat-overlay/heat-overlay.js +3 -2
  21. package/dist/components/atoms/jarvis-dock/jarvis-dock.js +2 -2
  22. package/dist/components/atoms/kbd/kbd.js +41 -11
  23. package/dist/components/atoms/keyboard-shortcuts-help/keyboard-shortcuts-help.js +1 -1
  24. package/dist/components/atoms/menubar/menubar.js +1 -1
  25. package/dist/components/atoms/meter/meter.js +2 -2
  26. package/dist/components/atoms/metric-cluster/metric-cluster.js +2 -1
  27. package/dist/components/atoms/policy-delivery-panel/policy-delivery-panel.js +19 -10
  28. package/dist/components/atoms/presence-stack/presence-stack.js +1 -1
  29. package/dist/components/atoms/progress-bar/progress-bar.js +190 -30
  30. package/dist/components/atoms/pull-quote/pull-quote.js +77 -0
  31. package/dist/components/atoms/quiz/quiz.js +2 -2
  32. package/dist/components/atoms/relationship-inspector/relationship-inspector.js +1 -1
  33. package/dist/components/atoms/routing-assignment-panel/routing-assignment-panel.js +20 -11
  34. package/dist/components/atoms/runtime-overview-panel/runtime-overview-panel.js +2 -1
  35. package/dist/components/atoms/scrim/scrim.js +32 -0
  36. package/dist/components/atoms/segmented-control/segmented-control.js +2 -2
  37. package/dist/components/atoms/select/select.js +3 -3
  38. package/dist/components/atoms/sheet/sheet.js +3 -2
  39. package/dist/components/atoms/skeleton/skeleton.js +1 -1
  40. package/dist/components/atoms/state-badge-overlay/state-badge-overlay.js +14 -16
  41. package/dist/components/atoms/stepper/stepper.js +1 -1
  42. package/dist/components/atoms/sticky-metric/sticky-metric.js +2 -1
  43. package/dist/components/atoms/table/table.js +1 -1
  44. package/dist/components/atoms/table-of-contents/table-of-contents.js +1 -1
  45. package/dist/components/atoms/table-of-contents-panel/table-of-contents-panel.js +4 -4
  46. package/dist/components/atoms/tabs/tabs.js +34 -11
  47. package/dist/components/atoms/tag-group/tag-group.js +10 -5
  48. package/dist/components/atoms/tags-input/tags-input.js +1 -1
  49. package/dist/components/atoms/thread-bubble/thread-bubble.js +1 -1
  50. package/dist/components/atoms/threshold-ring/threshold-ring.js +3 -2
  51. package/dist/components/atoms/timeline/timeline.js +15 -3
  52. package/dist/components/atoms/timeline-scrubber/timeline-scrubber.js +3 -2
  53. package/dist/components/atoms/tldr-section/tldr-section.js +5 -5
  54. package/dist/components/atoms/toggle/toggle.js +1 -1
  55. package/dist/components/atoms/view-switcher/view-switcher.js +1 -1
  56. package/dist/components/atoms/viewport-bookmarks/viewport-bookmarks.js +1 -1
  57. package/dist/components/atoms/watchlist/watchlist.js +1 -1
  58. package/dist/components/atoms/workspace-switcher/workspace-switcher.js +1 -1
  59. package/dist/components/index.js +38 -2
  60. package/dist/components/molecules/ai-artifact/ai-artifact.js +2 -12
  61. package/dist/components/molecules/approval-request/approval-request.js +168 -0
  62. package/dist/components/molecules/civilization-card/civilization-card.js +1 -1
  63. package/dist/components/molecules/completion-dialog/completion-dialog.js +1 -1
  64. package/dist/components/molecules/content-intro/content-intro.js +2 -2
  65. package/dist/components/molecules/conversation-thread/conversation-thread.js +5 -5
  66. package/dist/components/molecules/cookie-consent/cookie-consent.js +188 -80
  67. package/dist/components/molecules/copy-button/use-copy-to-clipboard.js +10 -12
  68. package/dist/components/molecules/countdown-timer/countdown-timer.js +1 -1
  69. package/dist/components/molecules/credit-badge/credit-badge.js +13 -16
  70. package/dist/components/molecules/filter-bar/filter-bar.js +2 -2
  71. package/dist/components/molecules/historical-figure-card/historical-figure-card.js +1 -1
  72. package/dist/components/molecules/plan-badge/plan-badge.js +12 -13
  73. package/dist/components/molecules/pricing-table/pricing-table.js +1 -1
  74. package/dist/components/molecules/progress-tracker/progress-tracker.js +8 -17
  75. package/dist/components/molecules/sidebar/sidebar.js +24 -9
  76. package/dist/components/molecules/tour/tour.js +1 -1
  77. package/dist/components/molecules/transaction-list/transaction-list.js +7 -9
  78. package/dist/components/molecules/tutorial-filters/tutorial-filters.js +2 -2
  79. package/dist/components/molecules/usage-breakdown/usage-breakdown.js +1 -1
  80. package/dist/components/organisms/access-matrix/access-matrix.js +271 -0
  81. package/dist/components/organisms/activity-heatmap/activity-heatmap.js +1 -1
  82. package/dist/components/organisms/code-block/code-block.js +145 -81
  83. package/dist/components/organisms/cta-band/cta-band.js +79 -0
  84. package/dist/components/organisms/flow-diagram/flow-controls.js +1 -1
  85. package/dist/components/organisms/flow-diagram/flow-fullscreen.js +1 -1
  86. package/dist/components/organisms/gantt-chart/gantt-chart.js +1 -1
  87. package/dist/components/organisms/historic-timeline/historic-timeline.js +1 -1
  88. package/dist/components/organisms/navbar-saas/navbar-saas.js +1 -1
  89. package/dist/components/organisms/order-summary/order-summary.js +172 -0
  90. package/dist/components/organisms/settings-list/settings-list.js +125 -0
  91. package/dist/components/organisms/share-dialog-people/share-dialog-people.js +412 -0
  92. package/dist/components/organisms/slideshow/slideshow.js +6 -6
  93. package/dist/components/organisms/subscription-card/subscription-card.js +10 -10
  94. package/dist/components/organisms/tutorial-complete/tutorial-complete.js +2 -2
  95. package/dist/components/organisms/tutorial-mdx/tutorial-mdx.js +1 -1
  96. package/dist/index.d.ts +1143 -82
  97. package/dist/index.js +10 -0
  98. package/dist/lib/copy-text.js +64 -0
  99. package/dist/lib/status-dot.js +33 -0
  100. package/dist/tailwind-preset.js +16 -0
  101. package/package.json +17 -4
  102. package/styles.css +48 -7
  103. package/themes/default.css +48 -7
  104. package/themes/presets.css +24 -24
  105. package/themes/products.css +146 -0
package/CHANGELOG.md CHANGED
@@ -8,6 +8,61 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
8
8
 
9
9
  ### Added
10
10
 
11
+ - **`@vllnt/ui/package.json` export** - tools can read the package manifest
12
+ (for example its version) without `ERR_PACKAGE_PATH_NOT_EXPORTED`.
13
+
14
+ ## [0.4.0] - 2026-11-20
15
+
16
+ ### Added
17
+
18
+ - **Dialog overlay** - `DialogContent` takes `overlay="scrim"` (default, the
19
+ dimmed veil as before) or `overlay="none"` (no veil; the dialog stays modal).
20
+ (#601)
21
+ - **Design tokens** - `color.badge-label.*`, `brand.status.*`, `radius.control`
22
+ (6 px), `radius.surface` (8 px), `size.target.min` (44 px), `size.control-xs`
23
+ (32 px, and 44 px under a coarse pointer), `opacity.grain` and
24
+ `opacity.contact`. Only the radius, size and opacity tokens have CSS
25
+ variables. (#602)
26
+ - **Lock 2 tokens** - `shadow.raised`, `shadow.overlay` and `shadow.floating`
27
+ (`--shadow-raised`, `--shadow-overlay`, `--shadow-floating`, one list per
28
+ mode), `spacing.page-gutter`, `spacing.page-gutter-tablet` and
29
+ `spacing.page-gutter-desktop` (20, 48 and 96 px, as `--spacing-page-gutter*`),
30
+ `size.page-max` (1440 px) and `size.measure-narrow` (480 px) as
31
+ `--size-page-max` and `--size-measure-narrow`, and a `spacing.24` step
32
+ (96 px, no CSS variable). (#614)
33
+ - **Badge v1.3 props** - `tone`, `size`, `border`, `dot` and `variant="soft"`.
34
+ A status tone colours a dot, not the words. Existing props and defaults
35
+ render as before. (#610)
36
+ - **ProgressBar `blocks`** - draws ten blocks and fills one per whole 10% of
37
+ `value / max`; `aria-valuenow` stays exact. (#611)
38
+ - **Lint rule A12** (`vllnt/a12-no-status-text-colour`) - flags a status colour
39
+ used as text colour in component code. 56 existing files are allowlisted and
40
+ burn down in #604. (#607)
41
+ - **`warning` tone** - `AlertPulse` (`severity`), `BottomActivityStrip`,
42
+ `HeatOverlay`, `MetricCluster`, `RuntimeOverviewPanel`, `StickyMetric`,
43
+ `ThresholdRing` and `TimelineScrubber` (`tone`) accept `warning`, the name the
44
+ design library uses. (#616)
45
+ - **Product themes stylesheet** - `@vllnt/ui/themes/products.css` ships the
46
+ Maia and PaaS themes as `html[data-theme="maia"]` and
47
+ `html[data-theme="paas"]`, each with a `.dark` block. It is generated from
48
+ `packages/design/tokens.json`. Load JetBrains Mono (Maia, PaaS) in your
49
+ app; the package does not ship the font.
50
+ - **Status and diff colors** - CSS variables `--success`, `--warning`,
51
+ `--info`, their `-foreground` pairs, `--diff-added` and `--diff-removed` in
52
+ `themes/default.css` and `styles.css`, and matching Tailwind colors
53
+ (`success`, `warning`, `info`, `diff.added`, `diff.removed`) in the preset.
54
+ - **Label type step** - `--font-size-label`, `--line-height-label` and
55
+ `--font-weight-label`.
56
+ - **Sidebar `pathname` prop** - names the page the sidebar marks as current.
57
+ It defaults to the router's pathname, so existing usage is unchanged. Pass
58
+ it when the URL the visitor sees differs from the route that renders, such as
59
+ a prerendered locale or variant route, instead of overriding the router's
60
+ pathname context.
61
+ - **Sidebar `prefetch` prop** - set it to `false` to stop the sidebar's links
62
+ from prefetching their pages. Left unset, the links keep the router's default
63
+ prefetching, so existing usage is unchanged. A sidebar with dozens of links
64
+ in view otherwise prefetches every one of them on page load.
65
+
11
66
  - **New hooks** - `useFocusContainment` (trap Tab inside a custom modal and
12
67
  restore focus on close) and `useEventCallback` (stable callback that always
13
68
  calls the latest closure). Registry items import them from `@vllnt/ui`.
@@ -19,7 +74,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
19
74
  `ProfileSectionProps`, `TLDRSectionProps`, `AreaChartProps`, `BarChartProps`,
20
75
  `LineChartProps` and `ThemePresetProviderProps`.
21
76
 
22
- - Source-only React Native renderer and shared design contracts for the 0.4.0 canary track; stable Web installation remains unchanged.
77
+ - Source-only React Native renderer and shared design contracts (`@vllnt/ui-core`, `@vllnt/ui-native`). They are experimental and not published with this release; installing `@vllnt/ui` is unchanged.
23
78
  - Localized Native catalog discovery, dependency/capability comparison, and extensible React/React Native source tabs in a single component preview surface.
24
79
  - **Accessibility gate** - the Storybook test-runner runs axe-core (WCAG 2.0,
25
80
  2.1 and 2.2, levels A and AA) on every story in the light and dark theme and
@@ -42,9 +97,85 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
42
97
  that contains them (the registry pins `^0.3.0`, which does not).
43
98
  `registry:integrity` now fails when a registry item imports a name that
44
99
  `@vllnt/ui` does not export. (#543)
100
+ - **`copyText` helper** - `copyText(value): Promise<boolean>` is exported from
101
+ `@vllnt/ui`. It writes through the Clipboard API, falls back to a temporary
102
+ textarea and `document.execCommand("copy")` when that API is missing or
103
+ rejects, and resolves to `false` when neither path works. (#576)
45
104
 
46
105
  ### Changed
47
106
 
107
+ - **Dark surfaces are pure black** - the default dark theme now renders
108
+ `--background`, `--muted`, `--card` and `--popover` as `0 0 0` (#000000).
109
+ Hairline borders separate the surfaces: `--border`, `--secondary` and
110
+ `--accent` stay `0.2686` (#262626), and `--input` is unchanged. Before,
111
+ `--muted` was `0.2686` (#262626) and `--card` / `--popover` were `0.1445`
112
+ (#0a0a0a). A `bg-card` or `bg-popover` surface needs a `border` to show its
113
+ edge; every shipped one has it, and a test now fails on one that does not.
114
+ The separators in `DropdownMenu`, `Menubar` and `Select` draw with
115
+ `bg-border` instead of `bg-muted`, which is the page color now, and a test
116
+ fails on any one-pixel divider that uses `bg-muted`. Light mode is unchanged.
117
+ Themes that override these roles (presets, Maia) keep their values; PaaS and
118
+ any app that reads the dark `--muted`, `--card` or `--popover` directly get
119
+ black.
120
+ - **Hover, selected and data-state fills use `secondary`** - 32 component files
121
+ (`Table`, `Tabs` pill, `Toggle`, `Slideshow`, `FilterBar` and others) used
122
+ `bg-muted` for that feedback, which is now the page color in dark.
123
+ They use `bg-secondary` with the same opacity. In the default and PaaS themes
124
+ the fill is the same color as before in light and dark, because `--secondary`
125
+ equals the old `--muted` there. Theme presets keep a quiet neutral
126
+ `--secondary` (their `--accent` is a brand color), so text on these fills
127
+ stays at 6.65 to 12.53:1 in dark. The Maia theme has its own dark `--muted`
128
+ (`0.2002`) and a core dark `--secondary` (`0.2686`), so its dark hover fills
129
+ are one step lighter than before.
130
+ `SegmentedControl`, `ViewSwitcher`, `WorkspaceSwitcher` and the `PricingTable`
131
+ period toggle draw their track with `bg-secondary` for the same reason: the
132
+ selected segment is `bg-background` on that track.
133
+ - **Skeletons, tracks and handles use `secondary`** - 29 `bg-muted` fills in 23
134
+ component files were the whole visual of their element: `Skeleton`, the
135
+ `ProgressBar`, `Meter`, `Tour`, `Checklist`, `UsageBreakdown` and other
136
+ progress, meter and usage tracks, the `Drawer` handle, the empty cells of
137
+ `ActivityHeatmap` and the neutral `GanttChart` bar. They use `bg-secondary`
138
+ (#262626) with the same opacity, because `bg-muted` is the page color in dark
139
+ and they would disappear. Chips, code spans and panels keep `bg-muted`: their
140
+ text and border carry them. A test fails on a `bg-muted` skeleton or bar.
141
+ - **Alert destructive** - the title and body use the foreground colour. The
142
+ status colour stays on the border and the glyph. (#607)
143
+ - **Badge status chips** use a status dot. (#610)
144
+ - **Maia is Ink, and `--input` follows the design library** - Maia `--primary`
145
+ is black in light and white in dark (it was pink), Maia uses the core sans
146
+ font instead of Figtree, and its display and label weights are 600, not 700.
147
+ The default theme's `--input` is `0.6167` in light (was `0.66`) and `0.5208`
148
+ in dark (was `0.49`). (#614)
149
+ - **Theme presets meet the input 3:1 rule on muted** - the 12 runtime presets
150
+ (aura, chatgpt, claude, cyberlime, cyberpunk, dracula, dusk, gemini, matrix,
151
+ nord, synthwave and tron) get a new `--input` lightness in light and dark, by
152
+ 0.048 at most, with hue and chroma unchanged. The control border now reaches
153
+ 3:1 on background, card, popover and muted. (#620)
154
+ - **`warn` is deprecated** in the eight components above; pass `warning`. `warn`
155
+ still works and renders the same colour. Removing it would break consumers,
156
+ so that waits for a breaking release. `HeatOverlay` and `AlertPulse` now
157
+ default to `warning`. A `data-*` tone attribute echoes the value you pass.
158
+ - **Site header name** - `NavbarSaas` is the one code name for the design
159
+ library's `organism / Site header`. A `floating` style will join it as an
160
+ added prop, and `FloatingNavbar` stays a separate component until then.
161
+ `Display` is the design library's `atom / Heading` with `Level=display`.
162
+ - **Colour tokens meet WCAG AA** (#538). The default light theme uses a darker
163
+ `--muted-foreground`, `--destructive` and `--input`; in the dark theme
164
+ `--destructive` is lighter with a dark foreground and `--input` is lighter, so
165
+ input borders are easier to see in both. Presets adjust `--primary`,
166
+ `--destructive`, `--input` and `--ring` the same way. Visual snapshots change.
167
+ - **Font tokens on `:root`** - `styles.css` now defines `--font-sans`,
168
+ `--font-display` and `--font-mono` on `:root`. If your app sets variables
169
+ with these names, declare them later in the cascade or on `body` so yours win.
170
+ - **Lighter imports** (#541) - CodeBlock renders its code as plain text first
171
+ and highlights it once the Prism build loads on the client; TutorialMDX loads
172
+ the MDX compiler only for content with JSX, and FlowDiagram loads
173
+ `html-to-image` only when copied. Apps that use neither `toast` nor
174
+ `Toaster` no longer bundle sonner.
175
+ - **Smaller package** - the tarball has 361 files instead of 659: the
176
+ per-component re-export stubs and `dist/test-setup.js` are gone.
177
+ Only the `exports` entry points are public, so imports do not change.
178
+
48
179
  - **Peer dependency ranges now match what the package needs.** `next` is
49
180
  `>=15.0.0` (Next 14 peers React 18, which the React 19 build cannot use),
50
181
  `tailwindcss` is `^3.4.0` (components use `size-*`, `text-balance` and
@@ -86,10 +217,46 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
86
217
 
87
218
  ### Fixed
88
219
 
220
+ - **Tap targets** - the NavbarSaas links, the Breadcrumb crumbs, the
221
+ TableOfContents buttons and the Sidebar family heading link are at least
222
+ 24 px tall (WCAG 2.5.8); they were 20 px.
223
+ - **Close button target size** - the close buttons of `DialogContent`,
224
+ `SheetContent` and `CompletionDialog` were 16 px. They are at least 24 x 24 px
225
+ around the same 16 px icon (WCAG 2.5.8). (#576)
226
+ - **Copy without the Clipboard API** - `useCopyToClipboard` (so `CopyButton`,
227
+ `CodeBlock`, `Terminal` and the other copy controls) and
228
+ `AIArtifactCopyButton` fall back to a temporary textarea and
229
+ `document.execCommand("copy")` when `navigator.clipboard` is missing (plain
230
+ http, such as a Tailnet IP) or `writeText` rejects. The fallback works inside
231
+ modal dialogs, alert dialogs, native `dialog` elements and modal menus, keeps
232
+ the text the user had selected on the page, and returns focus only when it
233
+ came from the keyboard. `copied` stays `false` when both paths fail.
234
+ `FlowDiagram` copies a PNG, so it has no text fallback and keeps reporting
235
+ "Copy failed". (#576)
236
+ - **Accordion accessibility** - each trigger now has `aria-controls` pointing
237
+ at its panel, and each panel is a `region` labelled by its trigger. Closed
238
+ panels are `inert`, so screen readers no longer read closed answers and Tab
239
+ skips links inside them. The open and close animation is unchanged.
240
+ - **Select, SegmentedControl, FloatingToolbar and ProgressBar** - `Select`
241
+ shows `aria-invalid` with a destructive border. The `Select` menu animation,
242
+ the `SegmentedControl` selection transition, the `FloatingToolbar` colour
243
+ transition and the `ProgressBar` transitions stop under
244
+ `prefers-reduced-motion`. `FloatingToolbar` is one tab stop, and the arrow,
245
+ Home and End keys move between its actions and skip disabled ones. (#611)
246
+ - **Setup docs** - the Tailwind config in both READMEs, the installation page
247
+ and the agent skill now lists `./node_modules/@vllnt/ui/dist/**/*.js` in
248
+ `content`. Tailwind 3 ignores a preset's `content` once the app sets its own,
249
+ so the documented config generated no component styles. The agent skill's
250
+ peer ranges and colour format (OKLCH) are corrected too.
251
+ - **Tailwind preset dependency** - `tailwindcss-animate`, which
252
+ `@vllnt/ui/tailwind-preset` imports, is now a runtime dependency. With 0.3.0
253
+ the preset failed to load unless the app installed it.
89
254
  - **Duplicate React keys** - Terminal, FileUpload, AvatarGroup, Breadcrumb and
90
255
  about 20 other list renderers no longer key rows by content or label alone,
91
256
  so repeated or blank entries stop triggering duplicate-key errors. FileUpload
92
- ignores a file that is already in the list, so removal removes one entry.
257
+ adds an identical file (same name, size and lastModified) once, so removal
258
+ removes one entry, and a selection that adds nothing new does not call
259
+ `onFilesChange`.
93
260
  - **`"use client"` directives** - Toolbar, Stepper, AIChatInput, ObjectCard,
94
261
  OverviewBoard and ZoomHUD use event handlers or browser globals and now carry
95
262
  the directive. `check:use-client` also flags handler props and browser globals.
@@ -109,10 +276,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
109
276
  listbox, tree, dialogs and focus return), reduced motion and hard-coded
110
277
  palette contrast across the Web components flagged by the #535 audit. (#543)
111
278
 
112
- - **FileUpload duplicates** - Selecting identical files (same name, size and
113
- lastModified) adds them once, and a selection that adds nothing new no longer
114
- calls `onFilesChange`.
115
-
116
279
  ## [0.3.0] - 2026-06-26
117
280
 
118
281
  ### Added
@@ -260,6 +423,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
260
423
 
261
424
  - Initial public publish to the public npm registry.
262
425
 
426
+ [0.4.0]: https://github.com/vllnt/ui/releases/tag/v0.4.0
263
427
  [0.3.0]: https://github.com/vllnt/ui/releases/tag/v0.3.0
264
428
  [0.2.1]: https://github.com/vllnt/ui/releases/tag/v0.2.1
265
429
  [0.2.0]: https://github.com/vllnt/ui/releases/tag/v0.2.0
package/README.md CHANGED
@@ -1,9 +1,33 @@
1
1
  # @vllnt/ui
2
2
 
3
- React component library — 309 components built on Radix UI primitives, Tailwind CSS, and CVA.
3
+ React components built on Radix UI primitives, Tailwind CSS, and CVA. For humans and AI agents.
4
4
 
5
5
  See [CHANGELOG.md](./CHANGELOG.md) for release history.
6
6
 
7
+ ## For AI agents
8
+
9
+ An agent can read this library as text and JSON, without scraping pages. The site is <https://ui.vllnt.com>.
10
+
11
+ | URL | Returns |
12
+ | --- | --- |
13
+ | `https://ui.vllnt.com/llms.txt` | A short plain-text overview: install steps, docs links, and components grouped by category. |
14
+ | `https://ui.vllnt.com/llms-full.txt` | One long text file: guides, the design guide, latest release notes, templates, and a summary of every component. |
15
+ | `https://ui.vllnt.com/r/registry.json` | JSON index of every component in the shadcn registry. |
16
+ | `https://ui.vllnt.com/r/<name>` | One component as a shadcn registry item, with its source files inline. |
17
+ | `https://ui.vllnt.com/r/themes?t=<token>` | A shadcn theme item decoded from a theme token made in the theme editor. |
18
+ | `https://ui.vllnt.com/r/design.json` | The design tokens as JSON. |
19
+ | `https://ui.vllnt.com/design.txt` | The design guide as plain text. `https://ui.vllnt.com/DESIGN.md` is the same guide as Markdown. |
20
+ | `https://ui.vllnt.com/mcp` | An MCP server. It speaks JSON-RPC 2.0 over HTTP POST and has four read-only tools: `search_components`, `get_component`, `list_categories`, `list_platforms`. A GET returns server info. |
21
+ | `https://ui.vllnt.com/.well-known/api-catalog` | A catalog of these APIs (RFC 9727 linkset). |
22
+
23
+ The home page, the design and philosophy pages, and most docs and component pages also answer in Markdown. Send `Accept: text/markdown` to the same URL. A wildcard `Accept` does not select Markdown; the header must name `text/markdown`.
24
+
25
+ ```bash
26
+ curl -H "Accept: text/markdown" https://ui.vllnt.com/components/button
27
+ ```
28
+
29
+ More: <https://ui.vllnt.com/docs/agents>.
30
+
7
31
  ## Install
8
32
 
9
33
  ```bash
@@ -92,7 +116,9 @@ export default {
92
116
  presets: [uiPreset],
93
117
  content: [
94
118
  "./src/**/*.{ts,tsx}",
95
- // The preset auto-includes @vllnt/ui content paths
119
+ // Required: Tailwind 3 ignores a preset's `content` once your config sets
120
+ // its own, so list the package's compiled components here.
121
+ "./node_modules/@vllnt/ui/dist/**/*.js",
96
122
  ],
97
123
  };
98
124
  ```
@@ -114,6 +140,8 @@ import "@vllnt/ui/styles.css";
114
140
 
115
141
  This imports Tailwind base/components/utilities + default theme variables + safe-area utilities.
116
142
 
143
+ If TypeScript reports TS2882 for this import (newer versions check side-effect imports), add `declare module "*.css";` to a `.d.ts` file in your app.
144
+
117
145
  ### 3. Use Components
118
146
 
119
147
  ```tsx
@@ -138,6 +166,7 @@ export function Example() {
138
166
  | `@vllnt/ui/styles.css` | Full styles (Tailwind base + theme variables + utilities) |
139
167
  | `@vllnt/ui/themes/default.css` | Theme CSS variables only (no Tailwind base) |
140
168
  | `@vllnt/ui/themes/presets.css` | Built-in color presets (applied via `data-theme`) |
169
+ | `@vllnt/ui/themes/products.css` | Product themes `maia` and `paas` (generated; applied via `data-theme`) |
141
170
 
142
171
  ## Theming
143
172
 
@@ -160,7 +189,7 @@ All colors are **OKLCH channel** CSS variables (`L C H`), consumed as
160
189
  --destructive: 0.55 0.2078 25.326;
161
190
  --destructive-foreground: 0.9848 0 0;
162
191
  --border: 0.9219 0 0;
163
- --input: 0.66 0 0;
192
+ --input: 0.6167 0 0;
164
193
  --ring: 0.1445 0 0;
165
194
  --radius: 0.5rem;
166
195
  --card: 1 0 0;
@@ -187,6 +216,35 @@ at runtime with `<ThemeSwitcher />` (or `setThemePreset` / `useThemePreset`),
187
216
  which set `data-theme` on the document root. Render `<ThemePresetProvider />`
188
217
  once near the root to restore the saved preset before paint.
189
218
 
219
+ ### Product themes
220
+
221
+ `@vllnt/ui/themes/products.css` adds two full product themes, generated from
222
+ `packages/design/tokens.json`. Import it after `styles.css`, set
223
+ `data-theme="maia"` or `data-theme="paas"` on `<html>`, and keep using the
224
+ `dark` class for dark mode:
225
+
226
+ ```html
227
+ <html data-theme="maia" class="dark">
228
+ ```
229
+
230
+ - `maia` (Ink): no accent; `--primary` is the ink colour (pure black `#000000`
231
+ in light on purpose, while core keeps `#171717`; white in dark). Core Inter
232
+ plus JetBrains Mono, weights 400 to 600, tighter type
233
+ scale and radius. Its Label step is capitals in the design: add `uppercase`
234
+ where you use it.
235
+ - `paas`: core neutrals and status tones in JetBrains Mono. Dark is the design
236
+ default; light works too.
237
+
238
+ The package does not ship fonts. Core puts Inter (sans) and JetBrains Mono
239
+ (mono) first, then the system stacks. Load Inter and JetBrains Mono (core, Maia
240
+ and PaaS) in your app, for example with `next/font` or a font `<link>`; without
241
+ them each stack falls back to the system font stack (`system-ui` for core sans
242
+ and Maia, `ui-monospace` for core mono and PaaS).
243
+
244
+ Both define `success`, `warning`, `info`, `diff-added` and `diff-removed` roles
245
+ (the core theme defines them as well). Web `--radius` carries the theme's
246
+ `md` step only; the other radius steps ship in the `@vllnt/ui-core` outputs.
247
+
190
248
  To design and export your own theme, use the visual editor at
191
249
  [`/themes`](https://ui.vllnt.com/themes) — it exports a CSS block, a
192
250
  `npx shadcn add` command, or design tokens.
@@ -1,8 +1,22 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { createContext, use, useCallback, useMemo, useState } from "react";
3
+ import {
4
+ createContext,
5
+ use,
6
+ useCallback,
7
+ useId,
8
+ useMemo,
9
+ useState
10
+ } from "react";
4
11
  import { cn } from "../../../lib/utils.js";
5
12
  const AccordionContext = createContext(null);
13
+ function getPartId(baseId, part, value) {
14
+ const key = value.replaceAll(
15
+ /[^\dA-Za-z-]/g,
16
+ (character) => `_${(character.codePointAt(0) ?? 0).toString(16)}_`
17
+ );
18
+ return `${baseId}-${part}-${key}`;
19
+ }
6
20
  function useAccordionContext() {
7
21
  const context = use(AccordionContext);
8
22
  if (!context) {
@@ -16,6 +30,7 @@ function Accordion({
16
30
  defaultValue,
17
31
  type = "single"
18
32
  }) {
33
+ const baseId = useId();
19
34
  const [openItems, setOpenItems] = useState(() => {
20
35
  if (!defaultValue) return /* @__PURE__ */ new Set();
21
36
  if (Array.isArray(defaultValue)) return new Set(defaultValue);
@@ -39,8 +54,8 @@ function Accordion({
39
54
  [type]
40
55
  );
41
56
  const contextValue = useMemo(
42
- () => ({ openItems, toggleItem, type }),
43
- [openItems, toggleItem, type]
57
+ () => ({ baseId, openItems, toggleItem, type }),
58
+ [baseId, openItems, toggleItem, type]
44
59
  );
45
60
  return /* @__PURE__ */ jsx(AccordionContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
46
61
  "div",
@@ -76,18 +91,20 @@ function AccordionTrigger({
76
91
  icon,
77
92
  value
78
93
  }) {
79
- const { openItems, toggleItem } = useAccordionContext();
94
+ const { baseId, openItems, toggleItem } = useAccordionContext();
80
95
  const isOpen = openItems.has(value);
81
96
  return /* @__PURE__ */ jsxs(
82
97
  "button",
83
98
  {
99
+ "aria-controls": getPartId(baseId, "content", value),
84
100
  "aria-expanded": isOpen,
85
101
  className: cn(
86
102
  "w-full flex items-center justify-between p-4 text-left font-medium transition-colors",
87
- "hover:bg-muted/50",
88
- isOpen && "bg-muted/30",
103
+ "hover:bg-secondary/50",
104
+ isOpen && "bg-secondary/30",
89
105
  className
90
106
  ),
107
+ id: getPartId(baseId, "trigger", value),
91
108
  onClick: () => {
92
109
  toggleItem(value);
93
110
  },
@@ -134,15 +151,19 @@ function AccordionContent({
134
151
  className,
135
152
  value
136
153
  }) {
137
- const { openItems } = useAccordionContext();
154
+ const { baseId, openItems } = useAccordionContext();
138
155
  const isOpen = openItems.has(value);
139
156
  return /* @__PURE__ */ jsx(
140
157
  "div",
141
158
  {
159
+ "aria-labelledby": getPartId(baseId, "trigger", value),
142
160
  className: cn(
143
161
  "overflow-hidden transition-all duration-200",
144
162
  isOpen ? "max-h-[1000px] opacity-100" : "max-h-0 opacity-0"
145
163
  ),
164
+ id: getPartId(baseId, "content", value),
165
+ inert: !isOpen,
166
+ role: "region",
146
167
  children: /* @__PURE__ */ jsx(
147
168
  "div",
148
169
  {
@@ -296,7 +296,7 @@ const AgentStepProgress = ({
296
296
  "aria-valuemax": 100,
297
297
  "aria-valuemin": 0,
298
298
  "aria-valuenow": clamped,
299
- className: cn("h-1.5 w-full rounded-full bg-muted", className),
299
+ className: cn("h-1.5 w-full rounded-full bg-secondary", className),
300
300
  ref,
301
301
  role: "progressbar",
302
302
  ...rest,
@@ -15,7 +15,7 @@ const AISourceCitation = ({
15
15
  "a",
16
16
  {
17
17
  className: cn(
18
- "group inline-flex max-w-full flex-col gap-2 rounded-xl border border-border/70 bg-background px-3 py-2 text-left shadow-sm transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
18
+ "group inline-flex max-w-full flex-col gap-2 rounded-xl border border-border/70 bg-background px-3 py-2 text-left shadow-sm transition-colors hover:bg-secondary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
19
19
  className
20
20
  ),
21
21
  href,
@@ -10,7 +10,7 @@ const alertVariants = cva(
10
10
  variants: {
11
11
  variant: {
12
12
  default: "bg-background text-foreground",
13
- destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
13
+ destructive: "border-destructive/50 text-foreground dark:border-destructive [&>svg]:text-destructive"
14
14
  }
15
15
  }
16
16
  }
@@ -4,17 +4,20 @@ import { cn } from "../../../lib/utils.js";
4
4
  const SEVERITY_STROKE = {
5
5
  error: "stroke-red-500",
6
6
  info: "stroke-blue-500",
7
- warn: "stroke-amber-500"
7
+ warn: "stroke-amber-500",
8
+ warning: "stroke-amber-500"
8
9
  };
9
10
  const SEVERITY_FILL = {
10
11
  error: "fill-red-500/20",
11
12
  info: "fill-blue-500/20",
12
- warn: "fill-amber-500/20"
13
+ warn: "fill-amber-500/20",
14
+ warning: "fill-amber-500/20"
13
15
  };
14
16
  const SEVERITY_LABEL = {
15
17
  error: "Error",
16
18
  info: "Info",
17
- warn: "Warning"
19
+ warn: "Warning",
20
+ warning: "Warning"
18
21
  };
19
22
  const safeRadius = (value) => value < 6 ? 6 : value;
20
23
  const AlertPulse = ({
@@ -28,7 +31,7 @@ const AlertPulse = ({
28
31
  labels,
29
32
  radius = 36,
30
33
  reducedMotion = false,
31
- severity = "warn",
34
+ severity = "warning",
32
35
  ...rest
33
36
  } = props;
34
37
  const r = safeRadius(radius);
@@ -1,51 +1,156 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { createContext, use } from "react";
3
4
  import * as AvatarPrimitive from "@radix-ui/react-avatar";
5
+ import { cva } from "class-variance-authority";
4
6
  import { cn } from "../../../lib/utils.js";
7
+ const avatarSizeVariants = cva("relative flex shrink-0", {
8
+ defaultVariants: {
9
+ size: "md"
10
+ },
11
+ variants: {
12
+ size: {
13
+ lg: "size-12 text-lg",
14
+ md: "size-10",
15
+ sm: "size-8 text-sm",
16
+ xl: "size-16 text-2xl",
17
+ xs: "size-6 text-xs"
18
+ }
19
+ }
20
+ });
21
+ const avatarShapeVariants = cva("", {
22
+ defaultVariants: {
23
+ shape: "circle"
24
+ },
25
+ variants: {
26
+ shape: {
27
+ circle: "rounded-full",
28
+ square: "rounded-md"
29
+ }
30
+ }
31
+ });
32
+ const avatarPresenceVariants = cva(
33
+ "absolute bottom-0 right-0 flex items-center justify-center rounded-full ring-2 ring-background",
34
+ {
35
+ defaultVariants: {
36
+ size: "md"
37
+ },
38
+ variants: {
39
+ presence: {
40
+ away: "border-2 border-warning bg-background",
41
+ busy: "bg-destructive",
42
+ online: "bg-success"
43
+ },
44
+ size: {
45
+ lg: "size-3.5",
46
+ md: "size-3",
47
+ sm: "size-2.5",
48
+ xl: "size-4",
49
+ xs: "size-2"
50
+ }
51
+ }
52
+ }
53
+ );
54
+ const DEFAULT_PRESENCE_LABELS = {
55
+ away: "Away",
56
+ busy: "Busy",
57
+ online: "Online"
58
+ };
59
+ const AvatarShapeContext = createContext("circle");
60
+ const AvatarPresenceMarker = ({
61
+ label,
62
+ presence,
63
+ size
64
+ }) => /* @__PURE__ */ jsxs(
65
+ "span",
66
+ {
67
+ className: avatarPresenceVariants({ presence, size }),
68
+ "data-presence": presence,
69
+ children: [
70
+ presence === "busy" ? /* @__PURE__ */ jsx(
71
+ "span",
72
+ {
73
+ "aria-hidden": "true",
74
+ className: "h-0.5 w-1/2 rounded-full bg-background"
75
+ }
76
+ ) : null,
77
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: label })
78
+ ]
79
+ }
80
+ );
5
81
  const Avatar = ({
82
+ children,
6
83
  className,
84
+ presence,
85
+ presenceLabels,
7
86
  ref,
87
+ shape = "circle",
88
+ size = "md",
8
89
  ...props
9
- }) => /* @__PURE__ */ jsx(
90
+ }) => /* @__PURE__ */ jsx(AvatarShapeContext, { value: shape, children: /* @__PURE__ */ jsxs(
10
91
  AvatarPrimitive.Root,
11
92
  {
12
93
  className: cn(
13
- "relative flex size-10 shrink-0 overflow-hidden rounded-full",
94
+ avatarSizeVariants({ size }),
95
+ avatarShapeVariants({ shape }),
96
+ presence === void 0 && "overflow-hidden",
14
97
  className
15
98
  ),
16
99
  ref,
17
- ...props
100
+ ...props,
101
+ children: [
102
+ children,
103
+ presence === void 0 ? null : /* @__PURE__ */ jsx(
104
+ AvatarPresenceMarker,
105
+ {
106
+ label: presenceLabels?.[presence] ?? DEFAULT_PRESENCE_LABELS[presence],
107
+ presence,
108
+ size
109
+ }
110
+ )
111
+ ]
18
112
  }
19
- );
113
+ ) });
20
114
  Avatar.displayName = AvatarPrimitive.Root.displayName;
21
115
  const AvatarImage = ({
22
116
  className,
23
117
  ref,
24
118
  ...props
25
- }) => /* @__PURE__ */ jsx(
26
- AvatarPrimitive.Image,
27
- {
28
- className: cn("aspect-square h-full w-full", className),
29
- ref,
30
- ...props
31
- }
32
- );
119
+ }) => {
120
+ const shape = use(AvatarShapeContext);
121
+ return /* @__PURE__ */ jsx(
122
+ AvatarPrimitive.Image,
123
+ {
124
+ className: cn(
125
+ "aspect-square h-full w-full",
126
+ avatarShapeVariants({ shape }),
127
+ className
128
+ ),
129
+ ref,
130
+ ...props
131
+ }
132
+ );
133
+ };
33
134
  AvatarImage.displayName = AvatarPrimitive.Image.displayName;
34
135
  const AvatarFallback = ({
35
136
  className,
36
137
  ref,
37
138
  ...props
38
- }) => /* @__PURE__ */ jsx(
39
- AvatarPrimitive.Fallback,
40
- {
41
- className: cn(
42
- "flex h-full w-full items-center justify-center rounded-full bg-muted",
43
- className
44
- ),
45
- ref,
46
- ...props
47
- }
48
- );
139
+ }) => {
140
+ const shape = use(AvatarShapeContext);
141
+ return /* @__PURE__ */ jsx(
142
+ AvatarPrimitive.Fallback,
143
+ {
144
+ className: cn(
145
+ "flex h-full w-full items-center justify-center bg-muted",
146
+ avatarShapeVariants({ shape }),
147
+ className
148
+ ),
149
+ ref,
150
+ ...props
151
+ }
152
+ );
153
+ };
49
154
  AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
50
155
  export {
51
156
  Avatar,