@vokality/design-system 4.0.2 → 5.1.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 (36) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +3 -3
  3. package/dist/chat.d.ts +65 -2
  4. package/dist/components/ChatInbox/ChatInbox.d.ts +3 -1
  5. package/dist/components/ChatInbox/ChatInbox.js +3 -2
  6. package/dist/components/ChatPanel/ChatPanel.d.ts +1 -1
  7. package/dist/components/ChatPanel/ChatPanel.js +2 -2
  8. package/dist/components/ChatPanel/activity.d.ts +6 -0
  9. package/dist/components/ChatPanel/activity.js +102 -0
  10. package/dist/components/ChatPanel/transcript.d.ts +3 -3
  11. package/dist/components/ChatPanel/transcript.js +5 -4
  12. package/dist/components/Menu/Menu.d.ts +2 -2
  13. package/dist/components/Menu/Menu.js +2 -2
  14. package/dist/components/Popover/Popover.d.ts +2 -2
  15. package/dist/components/Select/Select.d.ts +2 -0
  16. package/dist/components/Select/Select.js +2 -2
  17. package/dist/components.css +65 -6
  18. package/dist/icons/refresh.svg +1 -0
  19. package/dist/icons/settings.svg +1 -0
  20. package/dist/internal/useThrottled.d.ts +2 -0
  21. package/dist/internal/useThrottled.js +17 -0
  22. package/dist/lib/icons.d.ts +15 -0
  23. package/dist/lib/icons.js +9 -0
  24. package/dist/localization.d.ts +13 -0
  25. package/dist/localization.js +13 -1
  26. package/dist/vokality.css +65 -6
  27. package/dist/vokality.iife.js +485 -98
  28. package/docs/components/ChatInbox/README.md +24 -7
  29. package/docs/components/ChatWidget/README.md +48 -7
  30. package/docs/components/Icon/README.md +1 -1
  31. package/docs/components/Menu/README.md +1 -1
  32. package/docs/components/Popover/README.md +3 -2
  33. package/docs/components/Select/README.md +2 -1
  34. package/package.json +1 -1
  35. package/skills/vokality-design-system/SKILL.md +2 -2
  36. package/skills/vokality-design-system/references/examples.tsx +8 -8
@@ -1,20 +1,22 @@
1
1
  # ChatInbox
2
2
 
3
- An embedded thread list and conversation panel. Wider containers show both; phone-sized containers show the list or selected conversation, with a Back action. The transcript and Markdown composer are shared with `ChatWidget`.
3
+ An embedded thread list and conversation panel. Wider containers show both; containers narrower than 40rem (a phone, or a 380px docked pane) show the list or the selected conversation, with a Back action that returns to the list.
4
+
5
+ The inbox fills its container: give the inbox's container a height. A docked side pane that runs the window's height, a page region or a dialog body all work; the thread list, transcript and composer scroll inside it. The transcript and Markdown composer are shared with `ChatWidget`.
4
6
 
5
7
  ```tsx
6
8
  import { useState } from "react";
7
9
  import { ChatInbox } from "@vokality/design-system/chat-inbox";
8
- import type { ChatMessage, ChatThread } from "@vokality/design-system/chat-models";
10
+ import type { ChatItem, ChatThread } from "@vokality/design-system/chat-models";
9
11
 
10
- function Inbox({ threads, messages }: { threads: ChatThread[]; messages: ChatMessage[] }) {
12
+ function Inbox({ threads, items }: { threads: ChatThread[]; items: ChatItem[] }) {
11
13
  const [selected, setSelected] = useState<string | null>(null);
12
14
  return <ChatInbox
13
15
  title="Inbox"
14
16
  threads={threads}
15
17
  selectedThreadId={selected}
16
18
  onSelectThread={setSelected}
17
- messages={messages}
19
+ items={items}
18
20
  composer={{ onSend(markdown) { sendToApplication(selected, markdown); } }}
19
21
  />;
20
22
  }
@@ -22,20 +24,35 @@ function Inbox({ threads, messages }: { threads: ChatThread[]; messages: ChatMes
22
24
 
23
25
  ## Thread data
24
26
 
25
- `threads` is an array of `ChatThread`: `id`, `title`, optional render-ready `preview`, `avatar`, `timestamp`, positive whole-number `unreadCount` and `disabled`. IDs stay stable across updates. The application owns filtering, fetching, selection, message data, delivery and retry requests.
27
+ `threads` is an array of `ChatThread`: `id`, `title`, optional render-ready `preview`, `avatar`, `timestamp`, positive whole-number `unreadCount` and `disabled`. IDs stay stable across updates. The application owns filtering, fetching, selection, transcript items, delivery and retry requests.
26
28
 
27
29
  `selectedThreadId` and `onSelectThread(id)` form the controlled selection contract. Back emits `null`. `title` names the thread list and defaults to “Conversations”; the conversation header uses the selected thread title. With no selection, `emptySelection` overrides the invitation to choose a conversation. An empty thread list has localized feedback.
28
30
 
31
+ `headerActions` puts controls at the trailing end of the header that is showing: the conversation header (after Back and the title) while a thread is open, otherwise the thread-list header. Use `size="xs"` `IconButton`s and `Button`s, such as a docked pane's close action and an "Open task" link, so the header stays one row at 380px. The application decides what to show for the open thread.
32
+
29
33
  Selecting a thread focuses its heading after the application accepts the selection. Back returns focus to its thread button. The layout responds to container width, including inside a narrow desktop column. No viewport listener, custom list keyboard behavior or routing is added.
30
34
 
31
35
  ## Conversation and composer
32
36
 
33
- The remaining props match `ChatWidget`: `messages`, `composer`, `emptyState`, `pending`, `error`, `onRetry`, `onRetryMessage(id)` and transcript `aria-label`. See [ChatWidget](../ChatWidget/README.md) for the render-ready message and Markdown composer contracts.
37
+ The remaining props match `ChatWidget`: `items`, `composer`, `readOnlyNotice`, `emptyState`, `pending`, `error`, `onRetry`, `onRetryMessage(id)` and transcript `aria-label`. See [ChatWidget](../ChatWidget/README.md) for the render-ready message, agent activity and Markdown composer contracts.
38
+
39
+ A task's thread can interleave messages from several channels with the agent runs that answered them:
40
+
41
+ ```tsx
42
+ const items: ChatItem[] = [
43
+ { type: "message", id: "m1", direction: "incoming", author: { name: "Maya", source: { label: "Linear", mark: <LinearMark aria-hidden /> } }, content: "The export is missing two invoices." },
44
+ { type: "activity", id: "run-1", title: "Working on the fix", state: "finished", elapsed: "2m 14s", outcome: "Edited 4 files, checks passed", entries },
45
+ ];
46
+
47
+ <ChatInbox title="Tasks" threads={tasks} selectedThreadId={taskId} onSelectThread={setTaskId} items={items} readOnlyNotice="Answer in Linear for now." />;
48
+ ```
49
+
50
+ Without `composer` the conversation is read-only: `readOnlyNotice` (or localized default copy) takes the composer's place and says why.
34
51
 
35
52
  Writing comes first. A small lower action row offers Aa, emoji and optional attachments; Aa reveals bold, italic, link and bullet-list controls through the editor's native Radix disclosure.
36
53
 
37
54
  Switching threads remounts the conversation panel, canceling pending editor uploads and clearing an uncontrolled draft. Supply a controlled composer value and keep drafts by thread ID in the application when drafts should survive navigation. Applications also own successful-send acknowledgement: controlled drafts do not clear automatically.
38
55
 
39
- Use `LocaleProvider.messages.chat` for conversation labels and `messages.richText` for editor labels. Colors, typography, outlines and compact controls use system tokens. The inbox height follows the dynamic viewport; the thread list, transcript and composer have bounded scrolling. No AI service or backend is bundled.
56
+ Use `LocaleProvider.messages.chat` for conversation labels and `messages.richText` for editor labels. Colors, typography, outlines and compact controls use system tokens. The inbox is as tall as its container; the thread list, transcript and composer have bounded scrolling. No AI service or backend is bundled.
40
57
 
41
58
  New messages receive a brief Motion fade and 4px rise. Existing thread history appears immediately without a stagger. Reduced-motion preferences remove the translation and animation duration.
@@ -4,9 +4,10 @@ A floating chat icon opens a conversation above it. The panel shares its transcr
4
4
 
5
5
  ```tsx
6
6
  import { ChatWidget } from "@vokality/design-system/chat-widget";
7
- import type { ChatMessage } from "@vokality/design-system/chat-models";
7
+ import type { ChatItem } from "@vokality/design-system/chat-models";
8
8
 
9
- const messages: ChatMessage[] = [{
9
+ const items: ChatItem[] = [{
10
+ type: "message",
10
11
  id: "welcome",
11
12
  author: { name: "Support" },
12
13
  direction: "incoming",
@@ -15,16 +16,56 @@ const messages: ChatMessage[] = [{
15
16
 
16
17
  <ChatWidget
17
18
  title="Ledger support"
18
- messages={messages}
19
+ items={items}
19
20
  composer={{ onSend(markdown) { sendToApplication(markdown); } }}
20
21
  />;
21
22
  ```
22
23
 
23
24
  ## Data and delivery
24
25
 
25
- `ChatMessage` contains a stable `id`, `author: { name, avatar? }`, `direction`, render-ready `content`, optional `timestamp`, and optional `delivery`. `delivery: { state: "pending" }` shows sending feedback. `{ state: "failed", error? }` shows failure feedback and a retry action when `onRetryMessage(id)` is supplied. Omit delivery for a sent message.
26
+ `items` is the transcript in conversation order: each `ChatItem` is a message (`{ type: "message", ...ChatMessage }`) or an agent run (`{ type: "activity", ...ChatActivity }`). IDs are stable and unique across both.
26
27
 
27
- The application owns the message array, transport, authentication, async sending, retries and persistence. Content is a React node; strings are displayed as text. The component does not parse incoming Markdown or inject HTML. Render formatted content in your application, including through an existing read-only `RichTextEditor` if useful.
28
+ `ChatMessage` contains a stable `id`, `author: { name, avatar?, source? }`, `direction`, render-ready `content`, optional `timestamp`, optional `delivery` and optional `actions`. `delivery: { state: "pending" }` shows sending feedback. `{ state: "failed", error? }` shows failure feedback and a retry action when `onRetryMessage(id)` is supplied. Omit delivery for a sent message.
29
+
30
+ - `author.source: { label, mark? }` names the channel the message came through ("Linear", "Pull request") in a small ruled tag beside the author. `mark` is a decorative 12px image; the label carries the meaning.
31
+ - `actions: ChatAction[]` draws extra-small buttons under the message: `{ id, label, onSelect, disabled?, variant? }`, where `variant` is `outline` (default), `primary`, `ghost` or `danger`. Keep to one primary action per message.
32
+
33
+ The application owns the transcript items, transport, authentication, async sending, retries and persistence. Content is a React node; strings are displayed as text. The component does not parse incoming Markdown or inject HTML. Render formatted content in your application, including through an existing read-only `RichTextEditor` if useful.
34
+
35
+ ## Agent activity
36
+
37
+ A `ChatActivity` is one agent run: `id`, `title` ("Working on the fix"), `state` (`working`, `waiting`, `finished`, `failed` or `stopped`), optional application-formatted `elapsed`, a one-line `outcome` ("Edited 4 files, checks passed"), `entries` in order and `omitted`, the number of steps the application did not keep.
38
+
39
+ An entry is narration, `{ type: "narration", id, content }`, or a step, `{ type: "step", id, kind, label, outcome?, state }`. Steps are display-ready strings from the application, already redacted; the component only draws them.
40
+
41
+ | Step kind | Icon |
42
+ | --- | --- |
43
+ | `read` | `file` |
44
+ | `search` | `search` |
45
+ | `edit` | `pencil` |
46
+ | `run` | `chevron-right` |
47
+ | `web` | `arrow-up-right` |
48
+ | `plan` | `menu` |
49
+ | `delegate` | `users` |
50
+ | `tool` | `ellipsis` |
51
+
52
+ | Step state | Shown as |
53
+ | --- | --- |
54
+ | `started` | A quiet working mark, announced as “In progress”; the words “In progress” once the run is no longer working |
55
+ | `succeeded` | The label and outcome alone |
56
+ | `failed` | `circle-alert` and “Failed” in `danger` |
57
+ | `left_running` | “Kept running” in `muted-foreground` |
58
+
59
+ - **Working:** a status line (working mark, title, “Working”, elapsed) over the latest six entries. Earlier entries open above them from an “N earlier entries” disclosure.
60
+ - **Waiting:** the run stopped to ask a person something. It shows its latest entries like a working run, but with no working mark; `message-circle` and “Waiting” are in `primary`, and the border is `primary-line`. Steps added while it waits are not announced.
61
+ - **Finished, failed or stopped:** one line with the state icon (`circle-check` in `success`, `circle-alert` in `danger`, `minus`), title, state word, outcome and elapsed. It is a Radix Collapsible trigger with `aria-expanded`; opening it shows every entry.
62
+ - `omitted` adds “and 312 more steps” after the entries (localized and pluralized).
63
+
64
+ The transcript log ignores activity entries (`aria-live="off"`) so screen readers never hear every step. Each run has its own polite status that announces the latest step while working, and otherwise the run's state (“Waiting”, then how it ended), at most once every five seconds; what was already on screen when it mounted is not announced. Failure is always a word as well as a colour, and forced-colors mode keeps the words.
65
+
66
+ ## Read-only conversations
67
+
68
+ Omit `composer` when the application can't post to the conversation. `readOnlyNotice` takes the composer's place and says why; without it the panel shows localized default copy (“Replies aren't available in this conversation.”). Use `composer.disabled` with a placeholder instead for a conversation that is only paused.
28
69
 
29
70
  ## Composer
30
71
 
@@ -39,9 +80,9 @@ The composer shows the writing field first. Its lower action row contains Aa, em
39
80
  - `open`, `defaultOpen`, `onOpenChange` and `modal` pass directly to Radix. The default is non-modal. `align` chooses the start or end corner; end is the default.
40
81
  - `triggerLabel` overrides “Open chat”; `unreadCount` adds an accessible unread count.
41
82
  - `title` names the panel; `description` adds supporting content. `aria-label` names the transcript log.
42
- - `emptyState`, `pending`, `error` and `onRetry` present application state. New messages are announced politely; scrolling up to read history stops automatic following.
83
+ - `emptyState`, `pending`, `error` and `onRetry` present application state. New messages are announced politely, agent runs through their own throttled status; scrolling up to read history stops automatic following.
43
84
  - The launcher respects safe-area insets. Panel height follows the dynamic viewport and available Radix space. Long text wraps, while transcript and composer scroll within the panel.
44
85
 
45
- Motion animates the native Radix panel with a brief fade and 8px rise on opening, and a shorter exit. The launcher has small hover/press feedback. New messages fade in with a 4px rise; existing history is shown immediately. Reduced-motion preferences remove translations, scaling and animation duration. Radix retains focus, keyboard and dismissal behavior throughout.
86
+ Motion animates the native Radix panel with a brief fade and 8px rise on opening, and a shorter exit. The launcher has small hover/press feedback. New messages and agent runs fade in with a 4px rise; existing history is shown immediately. Disclosure chevrons rotate in 160ms. Reduced-motion preferences remove translations, scaling and animation duration. Radix retains focus, keyboard and dismissal behavior throughout.
46
87
 
47
88
  Built-in labels use `LocaleProvider.messages.chat`; rich-editor labels remain in `messages.richText`. All themes and compact density use existing tokens. Import the system CSS once. No AI service or backend is bundled.
@@ -8,7 +8,7 @@ An outline icon from the Vokality set (Lucide), drawn inline with `currentColor`
8
8
  ## The set
9
9
  | Group | Icons | Default size |
10
10
  | --- | --- | --- |
11
- | Actions | `arrow-up-right`, `pencil`, `copy`, `trash`, `plus`, `minus`, `upload`, `ellipsis` | 16–20px (arrow 17px) |
11
+ | Actions | `arrow-up-right`, `pencil`, `copy`, `trash`, `plus`, `minus`, `upload`, `ellipsis`, `refresh`, `settings` | 16–20px (arrow 17px; refresh and settings 18px) |
12
12
  | Status | `info`, `circle-check`, `triangle-alert`, `circle-alert`, `check` | 18px (check 16px) |
13
13
  | Navigation | `chevron-left`, `chevron-right`, `chevron-down`, `menu`, `x`, `home`, `folder`, `users`, `chart`, `search`, `calendar` | 16px (menu and x 22px) |
14
14
  | Data | `arrow-up`, `arrow-down`, `chevrons-up-down`, `file` | 14–16px |
@@ -41,7 +41,7 @@ WAI-ARIA menu button: the trigger has `aria-haspopup="menu"`, `aria-expanded` an
41
41
 
42
42
  ## Props
43
43
  - `items`: `{ label, onSelect, icon, shortcut, danger, disabled }`, checkable and submenu items as above, `{ type: 'separator' }` or `{ type: 'label', label }`.
44
- - `label` or `icon` + `triggerLabel`, `variant`, `size` (`sm` or `xs`; an icon-only trigger becomes a 24px icon button at `xs`), `align`, `disabled`.
44
+ - `label` or `icon` + `triggerLabel`, `variant` (`outline`, `ghost`, `primary` or `text`), `size` (`sm` or `xs`; an icon-only trigger becomes a 24px icon button at `xs`), `align`, `disabled`. `text` draws a labelled trigger in sentence case (12px at `xs`, the size of compact `Text size="small"`); an icon-only trigger is a ghost icon button unless `variant="outline"`.
45
45
 
46
46
  ## Rules
47
47
  - Menus hold actions. To pick a value, use `Select`; to navigate, use links.
@@ -3,7 +3,7 @@
3
3
  A small non-modal panel attached to a button, for interactive content that doesn't need a full dialog: filters, quick settings, a short form. Built on Radix Popover.
4
4
 
5
5
  ## Anatomy
6
- 1. **Trigger**: an outline `Button` with a chevron glyph cell (optional leading `icon`).
6
+ 1. **Trigger**: an outline `Button` with a chevron glyph cell (optional leading `icon`). `variant="text"` draws it as `Button variant="text"`: sentence case, no edge, the chevron right after the label.
7
7
  2. **Panel**: `surface-elevated`, 1px `border`, square, 0.75rem padding, at least 16rem wide (`width` to set it), with an optional title in Manrope 600. It sits 4px below the trigger, lined up with its start (or end, `align="end"`) edge, flips above when there is no room below and shrinks to the room it has; it rises 0.5rem as it fades in.
8
8
 
9
9
  ## Behaviour
@@ -12,7 +12,7 @@ A small non-modal panel attached to a button, for interactive content that doesn
12
12
  - The page stays usable behind it; nothing else is blocked.
13
13
 
14
14
  ## Props
15
- - `label`, `title`, `icon`, `variant`, `size` (`sm` or `xs`), `align`, `width`.
15
+ - `label`, `title`, `icon`, `variant` (`outline`, `ghost`, `primary` or `text`), `size` (`sm` or `xs`), `align`, `width`.
16
16
  - Native Radix state and mode: `open`, `defaultOpen`, `onOpenChange`, `modal`.
17
17
  - `children`: panel content. `close`: one focusable element rendered through Radix Close. The former render-function child is replaced by native Close composition; for more application-specific actions, control `open` through `onOpenChange`.
18
18
 
@@ -22,5 +22,6 @@ The trigger has `aria-haspopup="dialog"`, `aria-expanded` and `aria-controls`; t
22
22
  ## Rules
23
23
  - Use a `Dialog` when the content needs full attention or a decision before continuing.
24
24
  - Use a `Tooltip` for plain text with nothing to interact with.
25
+ - In a status line, use `variant="text" size="xs"`: the trigger reads in sentence case at 12px (`text-xs`, the size of `Text size="small"` under compact density) and sits at `--control-height-xs`.
25
26
 
26
27
  [Radix Popover documentation](https://www.radix-ui.com/primitives/docs/components/popover) defines focus and dismissal behavior.
@@ -39,10 +39,11 @@ Implements the WAI-ARIA *select-only combobox* pattern with Radix Select: the tr
39
39
  - `name`, `form`, `required` and `disabled` pass to Radix Root. Its native form select posts the value, participates in validation and handles reset; disabled controls are excluded.
40
40
  - `aria-label` when there is no `Field`; `aria-labelledby`, `aria-describedby` and `aria-invalid` wire accessible presentation.
41
41
  - `open`, `defaultOpen` and `onOpenChange` pass directly to Radix; `dir` and `autoComplete` are supported through its Root contract.
42
+ - `size="xs"`: the compact trigger for toolbars and status lines, 24px (`--control-height-xs`) with `text-xs` and `space-sm` padding on fine pointers; a coarse pointer keeps the 44px target. Name it with `aria-label` or a visible label beside it. Forms keep the default size.
42
43
  - The ref is the trigger `<button>`, so a `Select` can be a `Tooltip` trigger.
43
44
 
44
45
  ## Rules
45
- - Render inside a `Field`.
46
+ - Render inside a `Field`, except a `size="xs"` select in a toolbar.
46
47
  - With five or fewer options that people should compare, use a `RadioGroup`.
47
48
  - For long lists that need search, use `Combobox`; to pick several, use `MultiSelect`.
48
49
  - Never fall back to a native `<select>`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vokality/design-system",
3
- "version": "4.0.2",
3
+ "version": "5.1.0",
4
4
  "description": "Vokality's design system: tokens, themes and React components for every Vokality project.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -44,9 +44,9 @@ For [RichTextEditor](../../docs/components/RichTextEditor/README.md), store a Co
44
44
 
45
45
  Attachments are opt-in through `onUploadAttachment(file, { signal })`, returning a durable `{ name, url }`. Reuse the application's upload service, validate unknown responses at that service boundary, honor cancellation, and enforce upload policy on the server. The editor handles upload feedback, cancel/retry, safe URL checks, and Markdown links. Removing a link does not delete its server asset. Use `onUploadPendingChange` when an external send action must wait for uploads.
46
46
 
47
- For [ChatWidget](../../docs/components/ChatWidget/README.md) and [ChatInbox](../../docs/components/ChatInbox/README.md), supply typed `ChatMessage`/`ChatThread` data with stable IDs. Message `content` is a render-ready React node; a string displays as text. Use the application's established safe Markdown renderer if formatted incoming content is needed. The composer emits Markdown.
47
+ For [ChatWidget](../../docs/components/ChatWidget/README.md) and [ChatInbox](../../docs/components/ChatInbox/README.md), pass the transcript as `items: ChatItem[]` in conversation order: `{ type: "message", ...ChatMessage }` or `{ type: "activity", ...ChatActivity }` for an agent run, each with a stable ID, plus typed `ChatThread` data. Message `content` is a render-ready React node; a string displays as text. Use the application's established safe Markdown renderer if formatted incoming content is needed. `author.source` names the channel a message came through; `actions` adds extra-small buttons under it. Activity steps are display-ready strings from the application; the components only draw and announce them. Omit `composer` for a read-only conversation and say why with `readOnlyNotice`. The composer emits Markdown.
48
48
 
49
- `composer.onSend` synchronously accepts a draft; the application owns async transport, streaming, pending/error state, retry callbacks, and persistence. An uncontrolled draft clears after normal callback return. Clear a controlled draft explicitly after application acceptance. Inbox selection is controlled, Back emits `null`, and switching threads resets uncontrolled drafts and cancels pending uploads. Keep controlled drafts by thread ID if navigation must preserve them. Do not invent an AI backend or upload endpoint for a presentation task.
49
+ `composer.onSend` synchronously accepts a draft; the application owns async transport, streaming, pending/error state, retry callbacks, and persistence. An uncontrolled draft clears after normal callback return. Clear a controlled draft explicitly after application acceptance. `ChatInbox` fills its container, so give that container a height (a docked pane, a page region). Inbox selection is controlled, Back emits `null`, and switching threads resets uncontrolled drafts and cancels pending uploads. Keep controlled drafts by thread ID if navigation must preserve them. Do not invent an AI backend or upload endpoint for a presentation task.
50
50
 
51
51
  ## Motion and verification
52
52
 
@@ -7,7 +7,7 @@ import { RichTextEditor } from "@vokality/design-system/rich-text";
7
7
  import type { RichTextUpload } from "@vokality/design-system/rich-text";
8
8
  import { ChatWidget } from "@vokality/design-system/chat-widget";
9
9
  import { ChatInbox } from "@vokality/design-system/chat-inbox";
10
- import type { ChatComposerOptions, ChatMessage, ChatThread } from "@vokality/design-system/chat-models";
10
+ import type { ChatComposerOptions, ChatItem, ChatMessage, ChatThread } from "@vokality/design-system/chat-models";
11
11
 
12
12
  // Import @vokality/design-system/vokality.css once in the application entry.
13
13
  // Upload and persistence callbacks below belong to the application, not the UI.
@@ -54,7 +54,7 @@ export function EmailSetting({ enabled, onChange }: { enabled: boolean; onChange
54
54
  }
55
55
 
56
56
  interface SupportWidgetProps {
57
- messages: readonly ChatMessage[];
57
+ items: readonly ChatItem[];
58
58
  sending: boolean;
59
59
  // Accept synchronously; the application manages the eventual transport result.
60
60
  acceptMessage: (markdown: string) => void;
@@ -62,10 +62,10 @@ interface SupportWidgetProps {
62
62
  uploadAttachment?: RichTextUpload;
63
63
  }
64
64
 
65
- export function SupportWidget({ messages, sending, acceptMessage, retryMessage, uploadAttachment }: SupportWidgetProps) {
65
+ export function SupportWidget({ items, sending, acceptMessage, retryMessage, uploadAttachment }: SupportWidgetProps) {
66
66
  const [draft, setDraft] = useState("");
67
67
  return (
68
- <ChatWidget title="Support" messages={messages} onRetryMessage={retryMessage} composer={{
68
+ <ChatWidget title="Support" items={items} onRetryMessage={retryMessage} composer={{
69
69
  value: draft,
70
70
  onChange: setDraft,
71
71
  sending,
@@ -83,15 +83,15 @@ interface SupportInboxProps {
83
83
  threads: readonly ChatThread[];
84
84
  selectedThreadId: string | null;
85
85
  onSelectThread: (threadId: string | null) => void;
86
- // These messages and this composer must belong to the selected thread.
87
- messages: readonly ChatMessage[];
86
+ // These items and this composer must belong to the selected thread.
87
+ items: readonly ChatItem[];
88
88
  // Supply value/onChange backed by thread IDs to preserve drafts on navigation.
89
89
  composer: ChatComposerOptions;
90
90
  retryMessage: (messageId: string) => void;
91
91
  }
92
92
 
93
- export function SupportInbox({ threads, selectedThreadId, onSelectThread, messages, composer, retryMessage }: SupportInboxProps) {
94
- return <ChatInbox title="Inbox" threads={threads} selectedThreadId={selectedThreadId} onSelectThread={onSelectThread} messages={messages} composer={composer} onRetryMessage={retryMessage} />;
93
+ export function SupportInbox({ threads, selectedThreadId, onSelectThread, items, composer, retryMessage }: SupportInboxProps) {
94
+ return <ChatInbox title="Inbox" threads={threads} selectedThreadId={selectedThreadId} onSelectThread={onSelectThread} items={items} composer={composer} onRetryMessage={retryMessage} />;
95
95
  }
96
96
 
97
97
  // content is ready to render. A Markdown string here would display as text.