@zvk/composite 0.1.1 → 0.1.2

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 (40) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +410 -0
  3. package/dist/activity/activity-feed.d.ts +27 -0
  4. package/dist/activity/activity-feed.js +30 -0
  5. package/dist/ai/conversation-directory.d.ts +31 -0
  6. package/dist/ai/conversation-directory.js +44 -0
  7. package/dist/ai/provider-model-selector.d.ts +31 -0
  8. package/dist/ai/provider-model-selector.js +41 -0
  9. package/dist/ai/sticky-composer.d.ts +14 -0
  10. package/dist/ai/sticky-composer.js +13 -0
  11. package/dist/data/data-table-control-bar.d.ts +13 -0
  12. package/dist/data/data-table-control-bar.js +11 -0
  13. package/dist/detail/detail-inspector-panel.d.ts +21 -0
  14. package/dist/detail/detail-inspector-panel.js +18 -0
  15. package/dist/index.d.ts +32 -0
  16. package/dist/index.js +16 -0
  17. package/dist/integrations/integration-status-card.d.ts +20 -0
  18. package/dist/integrations/integration-status-card.js +15 -0
  19. package/dist/layout/feature-shell.d.ts +13 -0
  20. package/dist/layout/feature-shell.js +7 -0
  21. package/dist/navigation/command-palette-shell.d.ts +31 -0
  22. package/dist/navigation/command-palette-shell.js +45 -0
  23. package/dist/navigation/entity-switcher-menu.d.ts +38 -0
  24. package/dist/navigation/entity-switcher-menu.js +56 -0
  25. package/dist/navigation/link-action.d.ts +11 -0
  26. package/dist/navigation/link-action.js +41 -0
  27. package/dist/navigation/sectioned-workspace-shell.d.ts +2 -1
  28. package/dist/navigation/sectioned-workspace-shell.js +2 -2
  29. package/dist/settings/parameter-editor.d.ts +27 -0
  30. package/dist/settings/parameter-editor.js +12 -0
  31. package/dist/settings/settings-section-stack.d.ts +20 -0
  32. package/dist/settings/settings-section-stack.js +10 -0
  33. package/dist/state/route-state-frame.d.ts +10 -0
  34. package/dist/state/route-state-frame.js +31 -0
  35. package/dist/styles.css +2138 -99
  36. package/dist/workflows/process-list-panel.d.ts +26 -0
  37. package/dist/workflows/process-list-panel.js +24 -0
  38. package/dist/workflows/workflow-status-card.d.ts +20 -0
  39. package/dist/workflows/workflow-status-card.js +46 -0
  40. package/package.json +112 -17
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @zvk/composite Changelog
2
2
 
3
+ ## [0.1.2](https://github.com/brandon-schabel/zvk/compare/composite-v0.1.1...composite-v0.1.2) (2026-06-19)
4
+
5
+
6
+ ### Features
7
+
8
+ * add theme presets and package improvements ([#19](https://github.com/brandon-schabel/zvk/issues/19)) ([867f955](https://github.com/brandon-schabel/zvk/commit/867f9556f7a60144cad4e747f2c032f2d5ede353))
9
+
3
10
  ## [0.1.1](https://github.com/brandon-schabel/zvk/compare/composite-v0.1.0...composite-v0.1.1) (2026-06-16)
4
11
 
5
12
 
package/README.md CHANGED
@@ -10,3 +10,413 @@ import "@zvk/composite/styles.css";
10
10
  ```
11
11
 
12
12
  Components are UI-only and accept typed props, slots, and callbacks. They do not own routing, persistence, data fetching, authentication, billing, or business rules.
13
+
14
+ Composite typography inherits the shared `@zvk/ui` font-family slots: primary for body/control text, secondary for titles and navigation accents, and tertiary wherever composed UI primitives render code or technical values.
15
+
16
+ ## What Composite Does Not Own
17
+
18
+ `@zvk/composite` owns repeated product-surface structure, semantic markup, accessible labels for the UI it renders, token-backed spacing, density-aware layout, and typed slots. It deliberately does not own app policy or runtime orchestration.
19
+
20
+ Keep these in the consuming app or a more specific package:
21
+
22
+ - routing, link components, active route state, and query params;
23
+ - data fetching, caching, mutations, optimistic updates, polling, subscriptions, and streaming;
24
+ - auth, billing, entitlements, permission checks, and organization policy;
25
+ - form state, validation, dirty-state detection, persistence, and schema interpretation;
26
+ - table engines, sorting, filtering, pagination, row selection, saved-view state, and column visibility;
27
+ - AI provider catalogs, model compatibility, prompt state, tool execution, attachments, message history, and AI SDK integration;
28
+ - analytics, telemetry, business copy, domain transforms, date formatting, and error classification.
29
+
30
+ ## App Surface Exports
31
+
32
+ App surfaces are intentionally router-agnostic and UI-only:
33
+
34
+ | Surface | Import | Purpose |
35
+ | --- | --- | --- |
36
+ | `AppWorkspaceShell` | `@zvk/composite/app-workspace-shell` | Product workspace chrome with brand, navigation, switcher, command, header, content, account, and footer slots. |
37
+ | `EntitySwitcherMenu` | `@zvk/composite/entity-switcher-menu` | Searchable context switcher for app-owned workspaces, projects, accounts, repositories, or environments. |
38
+ | `CommandPaletteShell` | `@zvk/composite/command-palette-shell` | Controlled command palette dialog with grouped commands and app-owned command execution. |
39
+ | `WorkspaceHeader` | `@zvk/composite/workspace-header` | Page header with title, description, status, metadata, and actions. |
40
+ | `BreadcrumbPageHeader` | `@zvk/composite/breadcrumb-page-header` | Breadcrumb-aware page header for nested workspace routes. |
41
+ | `SectionedWorkspaceShell` | `@zvk/composite/sectioned-workspace-shell` | Sectioned navigation shell for dense workspace panels. |
42
+ | `PageScaffold` | `@zvk/composite/page-scaffold` | Page layout with toolbar, aside, constrained width, and content slots. |
43
+ | `FeatureShell` | `@zvk/composite/feature-shell` | Reusable feature page layout with title, description, actions, metadata, and toolbar slots. |
44
+ | `StateSurface` | `@zvk/composite/state-surface` | Empty, loading, error, permission, success, and search-empty state panels. |
45
+ | `RouteStateFrame` | `@zvk/composite/route-state-frame` | Route-level view states for `loading`, `empty`, `error`, `not-found`, and `ready`. |
46
+ | `EntityCard` | `@zvk/composite/entity-card` | Selectable entity card with icon, title, description, badges, metadata, and actions. |
47
+ | `EntityListSection` | `@zvk/composite/entity-list-section` | List section wrapper with app-owned item rendering. |
48
+ | `SummaryMetricGrid` | `@zvk/composite/summary-metric-grid` | Metric cards for dashboards and operational summaries. |
49
+ | `SettingsHubList` | `@zvk/composite/settings-hub-list` | Settings index list with route-free items, badges, metadata, and disabled state. |
50
+ | `FormSurface` | `@zvk/composite/form-surface` | Native form shell for app-owned fields and submit handling. |
51
+ | `ConfirmActionDialog` | `@zvk/composite/confirm-action-dialog` | Confirmation dialog for destructive, primary, or neutral actions. |
52
+ | `IntegrationStatusCard` | `@zvk/composite/integration-status-card` | Provider/API/service connection status card with status, badges, metadata, metrics, actions, and errors. |
53
+ | `WorkflowStatusCard` | `@zvk/composite/workflow-status-card` | Workflow, run, import, queue, deploy, or parser status card with progress and current-step slots. |
54
+ | `ProcessListPanel` | `@zvk/composite/process-list-panel` | List panel for app-owned background work items, rendered by default through workflow status cards. |
55
+ | `ActivityFeed` | `@zvk/composite/activity-feed` | Ordered activity, audit, workflow, comment, or notification feed with app-owned ordering and timestamps. |
56
+ | `ParameterEditor` | `@zvk/composite/parameter-editor` | Grouped parameter/settings rows where controls, validation, persistence, and reset actions stay in the app. |
57
+ | `SettingsSectionStack` | `@zvk/composite/settings-section-stack` | Settings page section stack with controlled dirty/save presentation and app-owned forms. |
58
+ | `ProviderModelSelector` | `@zvk/composite/provider-model-selector` | Two-level provider/model, service/variant, or environment/resource selector where catalogs and constraints stay in the app. |
59
+ | `ConversationDirectory` | `@zvk/composite/conversation-directory` | Searchable/selectable conversation or record directory for app-owned AI workspaces. |
60
+ | `StickyComposer` | `@zvk/composite/sticky-composer` | Sticky prompt/input form shell with app-owned state, validation, tools, streaming, and submit effects. |
61
+ | `DetailInspectorPanel` | `@zvk/composite/detail-inspector-panel` | Right-side detail, metadata, review, or audit panel for selected app-owned entities. |
62
+ | `DataTableControlBar` | `@zvk/composite/data-table-control-bar` | Controller-free table toolbar for app-owned search, filters, views, density, columns, selection, and actions. |
63
+ | `DataTablePageFrame` | `@zvk/composite/data-table-page-frame` | Table page frame for app-owned search, filters, rows, pagination, loading, and empty state. |
64
+ | `LinkAction` | `@zvk/composite/link-action` | Anchor styled like a `@zvk/ui` button, with button variants and sizes. |
65
+
66
+ Use root imports when a file composes several surfaces together:
67
+
68
+ ```tsx
69
+ import {
70
+ AppWorkspaceShell,
71
+ PageScaffold,
72
+ RouteStateFrame,
73
+ WorkspaceHeader
74
+ } from "@zvk/composite";
75
+ ```
76
+
77
+ Use focused subpath imports when a file consumes one or two surfaces:
78
+
79
+ ```tsx
80
+ import { FeatureShell } from "@zvk/composite/feature-shell";
81
+ import { RouteStateFrame } from "@zvk/composite/route-state-frame";
82
+ import { LinkAction } from "@zvk/composite/link-action";
83
+
84
+ <FeatureShell
85
+ title="Projects"
86
+ description="Use this workspace to review active work."
87
+ actions={<LinkAction href="/projects/new">New project</LinkAction>}
88
+ >
89
+ <RouteStateFrame status="ready">...</RouteStateFrame>
90
+ </FeatureShell>
91
+ ```
92
+
93
+ These components should stay focused on visual structure, semantics, and affordances; routing, domain mapping, and data orchestration remain in the consuming app.
94
+
95
+ ## Migration Guide
96
+
97
+ Migrate repeated app-owned shells into `@zvk/composite` only when the repeated part is visual structure and interaction affordance, not domain behavior.
98
+
99
+ | Repeated app surface | Composite target | Keep in the app |
100
+ | --- | --- | --- |
101
+ | Product workspace chrome with brand, account, nav, switcher, command, and content slots | `AppWorkspaceShell` | route tree, auth context, workspace persistence, account menu actions |
102
+ | Tab-with-sidebar or dense route workspace wrappers | `SectionedWorkspaceShell` | active route, URL updates, permission gating, tab persistence |
103
+ | Route/page loading, empty, permission, error, and ready wrappers | `RouteStateFrame` or `StateSurface` | loader state, retry mutations, fetch errors, domain-specific empty data |
104
+ | Page headers and breadcrumb headers | `WorkspaceHeader` or `BreadcrumbPageHeader` | router links, breadcrumb construction, page-level data policy |
105
+ | Settings index pages and settings detail pages | `SettingsHubList` or `SettingsSectionStack` | route anchors, dirty-state calculation, validation, persistence, permission decisions |
106
+ | Provider/API status cards, workflow cards, and process lists | `IntegrationStatusCard`, `WorkflowStatusCard`, or `ProcessListPanel` | health checks, polling, process control, retries, logs, provider credentials |
107
+ | Audit logs, run histories, review threads, and notification feeds | `ActivityFeed` | event fetching, ordering, timestamps, subscriptions, comment mutations, infinite scroll |
108
+ | AI model choices, conversation sidebars, and sticky prompt forms | `ProviderModelSelector`, `ConversationDirectory`, or `StickyComposer` | catalogs, compatibility rules, message fetching, prompt validation, streaming, tools, persistence |
109
+ | Table page wrappers and table control bars | `DataTablePageFrame` or `DataTableControlBar` | table engine adapters, query state, sorting, filters, pagination, row selection, saved views |
110
+ | Selected-row or selected-record inspectors | `DetailInspectorPanel` | selected entity state, fetching, route params, drawer/sheet state, audit queries |
111
+
112
+ ## Sectioned Workspace Shells
113
+
114
+ `SectionedWorkspaceShell` is the migration target for repeated tab-with-sidebar or dense workspace wrappers. Use it when an app already owns the active tab, routes, permissions, and data loading, but repeats the same sidebar/header/content frame.
115
+
116
+ ```tsx
117
+ import { SectionedWorkspaceShell } from "@zvk/composite/sectioned-workspace-shell";
118
+
119
+ <SectionedWorkspaceShell
120
+ activeItemId="runs"
121
+ navLabel="Automation workspace navigation"
122
+ onItemSelect={(itemId) => {
123
+ // Route, persist, or guard in the app.
124
+ }}
125
+ sections={[
126
+ {
127
+ id: "operations",
128
+ label: "Operations",
129
+ items: [
130
+ { id: "runs", label: "Runs", description: "Recent automation history" },
131
+ { id: "logs", label: "Logs", href: "/automation/logs" },
132
+ { id: "limits", label: "Limits", disabled: true }
133
+ ]
134
+ }
135
+ ]}
136
+ sidebarFooter="Route state, permissions, and tab persistence stay in the app."
137
+ title="Automation workspace"
138
+ toolbar="Filters"
139
+ >
140
+ ...
141
+ </SectionedWorkspaceShell>
142
+ ```
143
+
144
+ When replacing an app-owned `*-tab-with-sidebar.tsx` wrapper, map repeated shell pieces directly: wrapper title to `title`, tab/sidebar groups to `sections`, active route key to `activeItemId`, app navigation labels to `navLabel`, and local helper text to `sidebarFooter` or `footer`. Keep route objects, loaders, permission checks, query params, and product-specific empty states in the app.
145
+
146
+ ## Navigation Accelerators
147
+
148
+ `EntitySwitcherMenu` and `CommandPaletteShell` provide reusable command/navigation shells while leaving persistence, routing, recent-item storage, shortcuts, and side effects in the app:
149
+
150
+ ```tsx
151
+ import { CommandPaletteShell } from "@zvk/composite/command-palette-shell";
152
+ import { EntitySwitcherMenu } from "@zvk/composite/entity-switcher-menu";
153
+
154
+ <EntitySwitcherMenu
155
+ current={{ id: "northline", label: "Northline" }}
156
+ groups={[{ id: "recent", items: [{ id: "northline", label: "Northline" }] }]}
157
+ label="Workspace"
158
+ onSelect={(item) => {
159
+ // Route or persist in the app.
160
+ }}
161
+ />;
162
+
163
+ <CommandPaletteShell
164
+ groups={[{ id: "navigation", commands: [{ id: "runs", label: "Open runs" }] }]}
165
+ onCommandSelect={(command) => {
166
+ // Execute in the app.
167
+ }}
168
+ onOpenChange={setOpen}
169
+ open={open}
170
+ />;
171
+ ```
172
+
173
+ ## Status Accelerators
174
+
175
+ `IntegrationStatusCard` and `WorkflowStatusCard` cover repeated provider/API and run/progress panels without owning health checks, polling, queues, retries, logs, or process control:
176
+
177
+ ```tsx
178
+ import { IntegrationStatusCard } from "@zvk/composite/integration-status-card";
179
+ import { WorkflowStatusCard } from "@zvk/composite/workflow-status-card";
180
+
181
+ <IntegrationStatusCard
182
+ actions={<button type="button">Test</button>}
183
+ metadata="Checked 1 minute ago"
184
+ status="Connected"
185
+ statusTone="success"
186
+ title="OpenAI"
187
+ />;
188
+
189
+ <WorkflowStatusCard
190
+ currentStep="Extracting line items"
191
+ progressLabel="42%"
192
+ progressValue={42}
193
+ status="Running"
194
+ title="Proposal parse"
195
+ tone="running"
196
+ />;
197
+ ```
198
+
199
+ `ProcessListPanel` turns repeated background-work lists into a reusable shell while keeping grouping, actions, logs, and lifecycle state in the app:
200
+
201
+ ```tsx
202
+ import { ProcessListPanel } from "@zvk/composite/process-list-panel";
203
+
204
+ <ProcessListPanel
205
+ items={[
206
+ {
207
+ id: "parse-run",
208
+ title: "Proposal parse",
209
+ status: "Running",
210
+ tone: "running",
211
+ progressValue: 42,
212
+ progressLabel: "42%"
213
+ }
214
+ ]}
215
+ title="Background work"
216
+ />;
217
+ ```
218
+
219
+ `ActivityFeed` provides ordered activity, audit, run history, review, and notification markup without owning event fetching, ordering, date formatting, real-time subscriptions, virtualization, comment mutation, or audit schemas.
220
+
221
+ ```tsx
222
+ import { ActivityFeed } from "@zvk/composite/activity-feed";
223
+
224
+ <ActivityFeed
225
+ groups={[
226
+ {
227
+ id: "today",
228
+ label: "Today",
229
+ items: [
230
+ {
231
+ id: "run-started",
232
+ title: "Parser run started",
233
+ description: "LandingAI accepted the uploaded plan.",
234
+ meta: "10:30 AM",
235
+ tone: "info"
236
+ },
237
+ {
238
+ id: "review",
239
+ title: "Reviewer commented",
240
+ body: "Confirm the normalized line item group.",
241
+ tone: "warning"
242
+ }
243
+ ]
244
+ }
245
+ ]}
246
+ title="Activity"
247
+ />;
248
+ ```
249
+
250
+ ## Settings Accelerators
251
+
252
+ `ParameterEditor` provides grouped settings rows for numeric, boolean, text, and choice controls passed in as app-owned slots. It does not generate controls from schemas, validate values, persist changes, or encode provider/model-specific parameters.
253
+
254
+ ```tsx
255
+ import { ParameterEditor } from "@zvk/composite/parameter-editor";
256
+
257
+ <ParameterEditor
258
+ groups={[
259
+ {
260
+ id: "model",
261
+ title: "Model settings",
262
+ rows: [
263
+ {
264
+ id: "temperature",
265
+ label: "Temperature",
266
+ value: "0.7",
267
+ control: <input aria-label="Temperature" type="range" />
268
+ }
269
+ ]
270
+ }
271
+ ]}
272
+ />;
273
+ ```
274
+
275
+ `ProviderModelSelector` provides the repeated two-level chooser shell for AI provider/model settings, service/variant selection, environment/resource selection, and similar grouped option workflows. The component owns layout, selected presentation, empty/loading states, and disabled styling; the app owns the catalog, filtering, pricing, validation, persistence, and provider checks.
276
+
277
+ ```tsx
278
+ import { ProviderModelSelector } from "@zvk/composite/provider-model-selector";
279
+
280
+ <ProviderModelSelector
281
+ groups={[
282
+ {
283
+ id: "openai",
284
+ label: "OpenAI",
285
+ description: "Text and reasoning models",
286
+ badge: "Connected",
287
+ items: [{ id: "gpt-5.4", label: "GPT-5.4", metadata: "128k context" }]
288
+ }
289
+ ]}
290
+ selectedGroupId="openai"
291
+ selectedItemId="gpt-5.4"
292
+ selectedSummary="OpenAI / GPT-5.4"
293
+ onItemSelect={(item, group) => {
294
+ // Persist and validate in the app.
295
+ }}
296
+ />;
297
+ ```
298
+
299
+ `ConversationDirectory` provides the repeated conversation/sidebar directory shell for AI workspaces, activity workbenches, and other record-selection panels. It owns grouped list layout, selected/disabled/pinned/unread/archived presentation, empty/loading states, and item selection callbacks. The app owns persistence, search/filter logic, routes, unread-count calculation, archive/delete actions, message fetching, streaming, and AI SDK integration.
300
+
301
+ ```tsx
302
+ import { ConversationDirectory } from "@zvk/composite/conversation-directory";
303
+
304
+ <ConversationDirectory
305
+ actions={<button type="button">New</button>}
306
+ groups={[
307
+ {
308
+ id: "today",
309
+ label: "Today",
310
+ items: [
311
+ {
312
+ id: "release-plan",
313
+ title: "Release planning",
314
+ description: "Package rollout notes",
315
+ meta: "12 messages",
316
+ selected: true,
317
+ unread: true
318
+ }
319
+ ]
320
+ }
321
+ ]}
322
+ label="Conversation history"
323
+ onItemSelect={(item) => {
324
+ // Route, persist, and fetch messages in the app.
325
+ }}
326
+ />;
327
+ ```
328
+
329
+ `StickyComposer` provides the repeated sticky composer frame for chat, AI prompt, command, and workbench input areas. It owns the native form container, sticky layout, tool slots, submit slot, status/error/footer placement, and loading/disabled presentation. The app owns input state, validation, files, tools, streaming, submit side effects, keyboard shortcuts beyond native form behavior, and persistence.
330
+
331
+ ```tsx
332
+ import { StickyComposer } from "@zvk/composite/sticky-composer";
333
+ import { Conversation } from "@zvk/ui/conversation";
334
+
335
+ <StickyComposer
336
+ aria-label="Message composer"
337
+ footer="State, validation, streaming, and persistence stay in the app."
338
+ input={<Conversation.PromptInputTextarea aria-label="Message" />}
339
+ leadingTools={<button type="button">Attach</button>}
340
+ onSubmit={(event) => {
341
+ event.preventDefault();
342
+ // Submit in the app.
343
+ }}
344
+ status="Ready"
345
+ submit={<Conversation.PromptInputSubmit>Send</Conversation.PromptInputSubmit>}
346
+ />;
347
+ ```
348
+
349
+ `SettingsSectionStack` groups settings-page sections, alerts, actions, disabled presentation, and a controlled save bar. It does not detect dirty state, validate values, persist changes, manage route anchors, or own form field state.
350
+
351
+ ```tsx
352
+ import { SettingsSectionStack } from "@zvk/composite/settings-section-stack";
353
+
354
+ <SettingsSectionStack
355
+ dirty
356
+ saveBar="Unsaved changes"
357
+ sections={[
358
+ {
359
+ id: "profile",
360
+ title: "Profile",
361
+ description: "App-owned controls passed as content.",
362
+ content: "Profile fields",
363
+ actions: "Reset"
364
+ },
365
+ {
366
+ id: "billing",
367
+ title: "Billing",
368
+ content: "Billing controls",
369
+ disabled: true
370
+ }
371
+ ]}
372
+ title="Workspace settings"
373
+ />;
374
+ ```
375
+
376
+ ## Detail Panels
377
+
378
+ `DetailInspectorPanel` gives `PageScaffold` aside slots and split views a reusable selected-item inspector. It owns header, status, metadata, section layout, empty/loading presentation, and footer placement. The app owns selected item state, fetching, route params, audit queries, and any drawer or sheet wrapper.
379
+
380
+ ```tsx
381
+ import { DetailInspectorPanel } from "@zvk/composite/detail-inspector-panel";
382
+
383
+ <DetailInspectorPanel
384
+ actions={<button type="button">Open full page</button>}
385
+ description="Selected workflow run"
386
+ footer="Drawer state and data loading stay in the app."
387
+ metadata="Updated 1 minute ago"
388
+ sections={[
389
+ {
390
+ id: "summary",
391
+ title: "Summary",
392
+ content: "Parser is extracting line items."
393
+ },
394
+ {
395
+ id: "audit",
396
+ title: "Audit",
397
+ content: "Queued by Codex"
398
+ }
399
+ ]}
400
+ status="Running"
401
+ title="Run details"
402
+ />;
403
+ ```
404
+
405
+ ## Data Table Controls
406
+
407
+ `DataTableControlBar` complements `DataTablePageFrame` when a table page repeats search, filters, saved views, density, column, selection, bulk-action, and action placement. It does not own search state, filter schemas, saved-view persistence, column visibility, row selection, sorting, pagination, data fetching, or table engine adapters.
408
+
409
+ ```tsx
410
+ import { DataTableControlBar } from "@zvk/composite/data-table-control-bar";
411
+
412
+ <DataTableControlBar
413
+ actions={<button type="button">Refresh</button>}
414
+ bulkActions={<button type="button">Archive selected</button>}
415
+ columnControl={<button type="button">Columns</button>}
416
+ densityControl={<button type="button">Compact</button>}
417
+ filters={<button type="button">Status</button>}
418
+ savedView={<button type="button">Saved view</button>}
419
+ search={<input aria-label="Search rows" />}
420
+ selectionSummary="3 selected"
421
+ />;
422
+ ```
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ export type ActivityFeedTone = "neutral" | "info" | "success" | "warning" | "danger";
3
+ export interface ActivityFeedItem {
4
+ readonly id: string;
5
+ readonly title: React.ReactNode;
6
+ readonly description?: React.ReactNode;
7
+ readonly meta?: React.ReactNode;
8
+ readonly body?: React.ReactNode;
9
+ readonly icon?: React.ReactNode;
10
+ readonly actions?: React.ReactNode;
11
+ readonly tone?: ActivityFeedTone;
12
+ }
13
+ export interface ActivityFeedGroup {
14
+ readonly id: string;
15
+ readonly label?: React.ReactNode;
16
+ readonly items: readonly ActivityFeedItem[];
17
+ }
18
+ export interface ActivityFeedProps extends Omit<React.ComponentPropsWithoutRef<"section">, "title" | "children"> {
19
+ readonly title?: React.ReactNode;
20
+ readonly description?: React.ReactNode;
21
+ readonly groups: readonly ActivityFeedGroup[];
22
+ readonly empty?: React.ReactNode;
23
+ readonly loading?: boolean;
24
+ readonly footer?: React.ReactNode;
25
+ readonly ref?: React.Ref<HTMLElement>;
26
+ }
27
+ export declare function ActivityFeed({ className, description, empty, footer, groups, loading, ref, title, ...props }: ActivityFeedProps): React.JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { Spinner } from "@zvk/ui/spinner";
4
+ import { cn } from "../utils/cn.js";
5
+ function hasValue(value) {
6
+ return value !== null && value !== undefined && value !== false;
7
+ }
8
+ function hasItems(groups) {
9
+ return groups.some((group) => group.items.length > 0);
10
+ }
11
+ function renderActivityItem(item) {
12
+ const tone = item.tone ?? "neutral";
13
+ const showAside = hasValue(item.actions);
14
+ const showDescription = hasValue(item.description);
15
+ const showMeta = hasValue(item.meta);
16
+ const showBody = hasValue(item.body);
17
+ const showIcon = hasValue(item.icon);
18
+ return (_jsx("article", { className: "zvk-composite-activity-feed__entry", "data-tone": tone, children: _jsxs("div", { className: "zvk-composite-activity-feed__shell", children: [showIcon ? _jsx("div", { className: "zvk-composite-activity-feed__icon", children: item.icon }) : null, _jsxs("div", { className: "zvk-composite-activity-feed__content", children: [_jsxs("div", { className: "zvk-composite-activity-feed__header", children: [_jsxs("div", { className: "zvk-composite-activity-feed__copy", children: [_jsx("h4", { className: "zvk-composite-activity-feed__title", children: item.title }), showDescription ? (_jsx("p", { className: "zvk-composite-activity-feed__description", children: item.description })) : null] }), showAside ? _jsx("div", { className: "zvk-composite-activity-feed__actions", children: item.actions }) : null] }), showMeta ? _jsx("div", { className: "zvk-composite-activity-feed__meta", children: item.meta }) : null, showBody ? _jsx("div", { className: "zvk-composite-activity-feed__body", children: item.body }) : null] })] }) }));
19
+ }
20
+ export function ActivityFeed({ className, description, empty = "No activity yet.", footer, groups, loading = false, ref, title, ...props }) {
21
+ const showHeader = hasValue(title) || hasValue(description);
22
+ const showItems = !loading && hasItems(groups);
23
+ const showEmptyState = !loading && !showItems;
24
+ return (_jsxs("section", { ...props, ref: ref, "aria-busy": loading ? true : props["aria-busy"], className: cn("zvk-composite-activity-feed", className), "data-loading": loading ? "" : undefined, children: [showHeader ? (_jsx("div", { className: "zvk-composite-activity-feed__header", children: _jsxs("div", { className: "zvk-composite-activity-feed__copy", children: [hasValue(title) ? _jsx("h3", { className: "zvk-composite-activity-feed__title", children: title }) : null, hasValue(description) ? (_jsx("p", { className: "zvk-composite-activity-feed__description", children: description })) : null] }) })) : null, _jsxs("div", { className: "zvk-composite-activity-feed__sections", children: [loading ? (_jsxs("div", { className: "zvk-composite-activity-feed__state", "data-state": "loading", children: [_jsx(Spinner, { label: "Loading activity feed", size: "sm", tone: "muted" }), _jsx("span", { children: "Loading activity feed..." })] })) : null, showEmptyState ? (_jsx("div", { className: "zvk-composite-activity-feed__state", "data-state": "empty", children: empty })) : null, showItems ? (_jsx("div", { className: "zvk-composite-activity-feed__groups", children: groups.map((group) => {
25
+ if (group.items.length === 0) {
26
+ return null;
27
+ }
28
+ return (_jsxs("section", { className: "zvk-composite-activity-feed__group", children: [hasValue(group.label) ? (_jsx("div", { className: "zvk-composite-activity-feed__group-label", children: group.label })) : null, _jsx("ul", { className: "zvk-composite-activity-feed__list", children: group.items.map((item) => (_jsx("li", { className: "zvk-composite-activity-feed__item", children: renderActivityItem(item) }, item.id))) })] }, group.id));
29
+ }) })) : null] }), hasValue(footer) ? _jsx("div", { className: "zvk-composite-activity-feed__footer", children: footer }) : null] }));
30
+ }
@@ -0,0 +1,31 @@
1
+ import * as React from "react";
2
+ export interface ConversationDirectoryItem {
3
+ readonly id: string;
4
+ readonly title: React.ReactNode;
5
+ readonly description?: React.ReactNode;
6
+ readonly meta?: React.ReactNode;
7
+ readonly badge?: React.ReactNode;
8
+ readonly selected?: boolean;
9
+ readonly disabled?: boolean;
10
+ readonly pinned?: boolean;
11
+ readonly unread?: boolean;
12
+ readonly archived?: boolean;
13
+ }
14
+ export interface ConversationDirectoryGroup {
15
+ readonly id: string;
16
+ readonly label?: React.ReactNode;
17
+ readonly items: readonly ConversationDirectoryItem[];
18
+ }
19
+ export interface ConversationDirectoryProps extends Omit<React.ComponentPropsWithoutRef<"aside">, "children"> {
20
+ readonly label: string;
21
+ readonly groups: readonly ConversationDirectoryGroup[];
22
+ readonly search?: React.ReactNode;
23
+ readonly actions?: React.ReactNode;
24
+ readonly empty?: React.ReactNode;
25
+ readonly loading?: boolean;
26
+ readonly onItemSelect?: (item: ConversationDirectoryItem) => void;
27
+ readonly renderItem?: (item: ConversationDirectoryItem) => React.ReactNode;
28
+ readonly footer?: React.ReactNode;
29
+ readonly ref?: React.Ref<HTMLElement>;
30
+ }
31
+ export declare function ConversationDirectory({ actions, className, empty, footer, groups, label, loading, onItemSelect, ref, renderItem, search, ...props }: ConversationDirectoryProps): React.JSX.Element;
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Spinner } from "@zvk/ui/spinner";
5
+ import { cn } from "../utils/cn.js";
6
+ function hasValue(value) {
7
+ return value !== null && value !== undefined && value !== false;
8
+ }
9
+ function renderNode(value) {
10
+ return hasValue(value) ? value : null;
11
+ }
12
+ function renderItemFlags(item) {
13
+ const flags = [];
14
+ if (item.pinned === true) {
15
+ flags.push(_jsx("span", { className: "zvk-composite-conversation-directory__item-state", "data-kind": "pinned", children: "Pinned" }, "pinned"));
16
+ }
17
+ if (item.unread === true) {
18
+ flags.push(_jsx("span", { className: "zvk-composite-conversation-directory__item-state", "data-kind": "unread", children: "Unread" }, "unread"));
19
+ }
20
+ if (item.archived === true) {
21
+ flags.push(_jsx("span", { className: "zvk-composite-conversation-directory__item-state", "data-kind": "archived", children: "Archived" }, "archived"));
22
+ }
23
+ return flags.length > 0 ? _jsx(_Fragment, { children: flags }) : null;
24
+ }
25
+ function renderDefaultItemContent(item) {
26
+ const flags = renderItemFlags(item);
27
+ return (_jsxs("div", { className: "zvk-composite-conversation-directory__item-copy", children: [_jsxs("div", { className: "zvk-composite-conversation-directory__item-heading", children: [_jsx("span", { className: "zvk-composite-conversation-directory__item-title", children: item.title }), hasValue(item.badge) ? _jsx("span", { className: "zvk-composite-conversation-directory__item-badge", children: item.badge }) : null] }), hasValue(item.description) ? (_jsx("span", { className: "zvk-composite-conversation-directory__item-description", children: item.description })) : null, hasValue(item.meta) || item.pinned === true || item.unread === true || item.archived === true ? (_jsxs("span", { className: "zvk-composite-conversation-directory__item-meta-row", children: [hasValue(item.meta) ? _jsx("span", { className: "zvk-composite-conversation-directory__item-meta", children: item.meta }) : null, flags !== null ? _jsx("span", { className: "zvk-composite-conversation-directory__item-states", children: flags }) : null] })) : null] }));
28
+ }
29
+ export function ConversationDirectory({ actions, className, empty = "No conversations available.", footer, groups, label, loading = false, onItemSelect, ref, renderItem, search, ...props }) {
30
+ const visibleGroups = groups.filter((group) => group.items.length > 0);
31
+ const showEmptyState = !loading && visibleGroups.length === 0;
32
+ const showLoader = loading;
33
+ return (_jsxs("aside", { ...props, ref: ref, "aria-busy": loading ? true : props["aria-busy"], "aria-label": label, className: cn("zvk-composite-conversation-directory", className), "data-empty": showEmptyState ? "" : undefined, "data-loading": loading ? "" : undefined, children: [_jsxs("header", { className: "zvk-composite-conversation-directory__header", children: [_jsx("div", { className: "zvk-composite-conversation-directory__header-copy", children: _jsx("h2", { className: "zvk-composite-conversation-directory__title", children: label }) }), hasValue(search) || hasValue(actions) ? (_jsxs("div", { className: "zvk-composite-conversation-directory__header-actions", children: [hasValue(search) ? _jsx("div", { className: "zvk-composite-conversation-directory__search", children: search }) : null, hasValue(actions) ? _jsx("div", { className: "zvk-composite-conversation-directory__actions", children: actions }) : null] })) : null] }), showLoader ? (_jsxs("div", { className: "zvk-composite-conversation-directory__state", "data-state": "loading", children: [_jsx(Spinner, { label: "Loading conversations", size: "sm", tone: "muted" }), _jsx("span", { children: "Loading conversations..." })] })) : null, showEmptyState ? (_jsx("div", { className: "zvk-composite-conversation-directory__state", "data-state": "empty", children: renderNode(empty) })) : null, !showLoader && !showEmptyState ? (_jsx("div", { className: "zvk-composite-conversation-directory__groups", children: visibleGroups.map((group) => (_jsxs("section", { "aria-label": typeof group.label === "string" ? group.label : undefined, className: "zvk-composite-conversation-directory__group", children: [hasValue(group.label) ? (_jsx("div", { className: "zvk-composite-conversation-directory__group-header", children: _jsx("h3", { className: "zvk-composite-conversation-directory__group-title", children: group.label }) })) : null, _jsx("ul", { className: "zvk-composite-conversation-directory__list", children: group.items.map((item) => {
34
+ const isDisabled = item.disabled === true;
35
+ const isSelected = item.selected === true;
36
+ const itemBody = renderItem !== undefined ? renderItem(item) : renderDefaultItemContent(item);
37
+ return (_jsx("li", { className: "zvk-composite-conversation-directory__list-item", children: _jsx("button", { "aria-pressed": isSelected, className: "zvk-composite-conversation-directory__item", "data-archived": item.archived === true ? "" : undefined, "data-disabled": isDisabled ? "" : undefined, "data-pinned": item.pinned === true ? "" : undefined, "data-selected": isSelected ? "" : undefined, "data-unread": item.unread === true ? "" : undefined, disabled: isDisabled, type: "button", onClick: () => {
38
+ if (isDisabled) {
39
+ return;
40
+ }
41
+ onItemSelect?.(item);
42
+ }, children: _jsx("div", { className: "zvk-composite-conversation-directory__item-content", children: itemBody }) }) }, item.id));
43
+ }) })] }, group.id))) })) : null, hasValue(footer) ? _jsx("div", { className: "zvk-composite-conversation-directory__footer", children: footer }) : null] }));
44
+ }
@@ -0,0 +1,31 @@
1
+ import * as React from "react";
2
+ export interface ProviderModelItem {
3
+ readonly id: string;
4
+ readonly label: React.ReactNode;
5
+ readonly description?: React.ReactNode;
6
+ readonly badge?: React.ReactNode;
7
+ readonly metadata?: React.ReactNode;
8
+ readonly disabled?: boolean;
9
+ }
10
+ export interface ProviderModelGroup {
11
+ readonly id: string;
12
+ readonly label: React.ReactNode;
13
+ readonly description?: React.ReactNode;
14
+ readonly badge?: React.ReactNode;
15
+ readonly disabled?: boolean;
16
+ readonly items: readonly ProviderModelItem[];
17
+ }
18
+ export interface ProviderModelSelectorProps extends React.HTMLAttributes<HTMLDivElement> {
19
+ readonly groups: readonly ProviderModelGroup[];
20
+ readonly selectedGroupId?: string;
21
+ readonly selectedItemId?: string;
22
+ readonly onGroupSelect?: (group: ProviderModelGroup) => void;
23
+ readonly onItemSelect?: (item: ProviderModelItem, group: ProviderModelGroup) => void;
24
+ readonly search?: React.ReactNode;
25
+ readonly selectedSummary?: React.ReactNode;
26
+ readonly advancedSettings?: React.ReactNode;
27
+ readonly empty?: React.ReactNode;
28
+ readonly loading?: boolean;
29
+ readonly ref?: React.Ref<HTMLDivElement>;
30
+ }
31
+ export declare function ProviderModelSelector({ advancedSettings, className, empty, groups, loading, onGroupSelect, onItemSelect, ref, search, selectedGroupId, selectedItemId, selectedSummary, ...props }: ProviderModelSelectorProps): React.JSX.Element;