@trinityui/design-system 2.13.1 → 2.13.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 (39) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/MIGRATION.md +1 -1
  3. package/README.md +18 -15
  4. package/dist/IllustratedMessage.js +1 -1
  5. package/dist/app-shell.js +8442 -8025
  6. package/dist/assets/index.d.ts +4 -0
  7. package/dist/assets/index.d.ts.map +1 -1
  8. package/dist/charts.js +3 -3
  9. package/dist/components/AI/AIChainOfThought.d.ts +12 -5
  10. package/dist/components/AI/AIChainOfThought.d.ts.map +1 -1
  11. package/dist/components/AI/AIChainOfThought.types.d.ts +4 -1
  12. package/dist/components/AI/AIChainOfThought.types.d.ts.map +1 -1
  13. package/dist/components/AI/AIChangeSummary.d.ts +68 -0
  14. package/dist/components/AI/AIChangeSummary.d.ts.map +1 -0
  15. package/dist/components/AI/AIClarificationFlow.d.ts +73 -0
  16. package/dist/components/AI/AIClarificationFlow.d.ts.map +1 -0
  17. package/dist/components/AI/AIMessage.d.ts +9 -2
  18. package/dist/components/AI/AIMessage.d.ts.map +1 -1
  19. package/dist/components/AI/AIReplyBar.d.ts +57 -0
  20. package/dist/components/AI/AIReplyBar.d.ts.map +1 -0
  21. package/dist/components/AI/ChatThread.d.ts +7 -3
  22. package/dist/components/AI/ChatThread.d.ts.map +1 -1
  23. package/dist/components/AI/index.d.ts +3 -0
  24. package/dist/components/AI/index.d.ts.map +1 -1
  25. package/dist/components/AI/strings/defaults.d.ts.map +1 -1
  26. package/dist/components/AI/types/hitl.d.ts +110 -0
  27. package/dist/components/AI/types/hitl.d.ts.map +1 -1
  28. package/dist/components/AppLayout/AppLayout.d.ts.map +1 -1
  29. package/dist/components/AppLayout/InsightEnginePanel.d.ts +5 -6
  30. package/dist/components/AppLayout/InsightEnginePanel.d.ts.map +1 -1
  31. package/dist/components/AppLayout/ThreadHistorySidebar.d.ts +8 -0
  32. package/dist/components/AppLayout/ThreadHistorySidebar.d.ts.map +1 -1
  33. package/dist/components/StepList/StepList.d.ts.map +1 -1
  34. package/dist/index.d.ts +6 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +1831 -1835
  37. package/dist/patterns/AICopilotPattern/AICopilotPattern.d.ts +1 -1
  38. package/dist/patterns/AICopilotPattern/AICopilotPattern.d.ts.map +1 -1
  39. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @trinityui/design-system
2
2
 
3
+ ## 2.13.2
4
+
5
+ ### Patch Changes
6
+
7
+ - **Additive**: New AIClarificationFlow asks a short series of clarifying questions in one card, one at a time. ([`c82db92`](https://github.com/Trinity-UI-Components/trinity-design-system/commit/c82db92da37d0b6c331c93beb65aaf766813787f))
8
+
9
+ It shows a header label, "1 of 4" progress, Back and Next (Done on the last step), an optional Skip, collapse and close. Each step is an AIClarificationPrompt, and Done hands every answer to `onComplete` as `{ [stepId]: { optionIds, otherText } }`, then shows a summary. Its strings are `ai.clarificationFlow.*`. It ships in a patch (Trinity 2.13 line) by a recorded owner exception in docs/process/api-patch-additions.json; the API check gains that exception file.
10
+
11
+ Storybook also gains two guides: Patterns/Evidence-Based Answer (one answer with clarification, reasoning, citations, confidence, verification, the query, sources, related questions and feedback, and which component to use when) and AI/Choosing AI Components (the AI components by job, with a quick-answers table).
12
+
13
+ AIChainOfThought: the thought process now shows as one slim line in every state: a spinner and "Reasoning in progress…" while it runs, "A step failed", "Plan's ready — needs your confirmation", or "✓ Thought process · Done · 4.2s". Opening the line shows the steps and the results. A phase that needs the person (a plan to confirm, a question, a failed task with Retry, a plan's Run) stays in view under the line. Pass `defaultCollapsed={false}` to start the card open.
14
+
15
+ AIMessage gains a `reasoning` slot and ChatThread's message slots a `reasoning` slot, so the thought process shows before the answer; InsightEnginePanel's and AICopilotPattern's `getReasoning` now fill it instead of the attachments.
16
+
17
+ Round shapes that rendered square are round again: the circle radius token is `'50%'`, and ten places appended `px` to it (`50%px`, which CSS drops). Fixed in StepList's step numbers (AIPlanReview's numbered steps), StatusIndicator's icon, dot and badge shapes (the green "Ready" ticks), its Legend, Timeline's dots, Modal's step dot, and the chart tooltip and legend markers. A test now fails if a unit is added to the circle token again.
18
+
19
+ StepList (AIPlanReview's steps, AIChainOfThought's tasks, AssessmentDrawer) centres the number, the first line of the step and its status (icon and text) on one line; the status sat about 4px high because an icon has no text baseline.
20
+
21
+ ThreadHistorySidebar's "History" title is now an h2 by default, not an h6, so it no longer skips heading levels. A new `headingLevel` prop sets it; InsightEnginePanel passes its own title's level, because the history sits beside the conversation, not inside it.
22
+
23
+ AppLayout's content area is keyboard-scrollable: while it overflows it takes `tabIndex={0}`, so a keyboard user can scroll content that holds no control (axe scrollable-region-focusable, WCAG 2.1.1). In the top-nav layout it is the `main` landmark; in the sidebar layout it is a group named by the new string `ai.appLayout.contentRegion` ('Page content'). It shows the theme's focus outline. Content that does not overflow is unchanged.
24
+
25
+ Visual review: the owner's local Storybook review on the release/2.13.2 branch (2026-10-16): AIClarificationFlow, AIChangeSummary, AIReplyBar, the slim AIChainOfThought line (thinking, error, plan, done; in the docked panel), the Evidence-based answer pattern, the Choosing AI components guide, the round StatusIndicator, Timeline and step-number shapes and StepList's alignment (light, dark)
26
+
3
27
  ## 2.13.1
4
28
 
5
29
  ### Patch Changes
package/MIGRATION.md CHANGED
@@ -343,7 +343,7 @@ This file is written in release PRs. A feature PR describes its correction in it
343
343
  | 2.13.0 | `AIMessage` footer actions | **Before:** `role="toolbar"` named "AI response actions", without the toolbar arrow-key model. **After:** `role="group"` with the same name; every action keeps its own tab stop. **Verified by:** `AIMessage.test.tsx` (G-04c) | b, c, e | G-04b: `copyBehavior="callback"`; G-04c: none (a toolbar without its arrow-key model fails the behavior contract); G-04d: none (WCAG 1.4.11 contrast); G-04e: none (the toggle state is the WCAG 4.1.2 fix); AIActionsGroup row wrap: none (WCAG 1.4.10 Reflow); AIMessage footer wrap: none (WCAG 1.4.10 Reflow) | Query `getByRole('group', { name: 'AI response actions' })` in tests. |
344
344
  | 2.13.0 | `AIMessage` idle action icons | **Before:** `text.disabled`, below 3:1 against the surface (WCAG 1.4.11). **After:** `text.secondary`, 3:1 or more in light and dark; focus outline; 24 by 24 px targets. **Verified by:** `AIMessage.test.tsx` (G-04d) | b, c, e | G-04b: `copyBehavior="callback"`; G-04c: none (a toolbar without its arrow-key model fails the behavior contract); G-04d: none (WCAG 1.4.11 contrast); G-04e: none (the toggle state is the WCAG 4.1.2 fix); AIActionsGroup row wrap: none (WCAG 1.4.10 Reflow); AIMessage footer wrap: none (WCAG 1.4.10 Reflow) | Nothing in code. Visual baselines of AIMessage and its hosts change. |
345
345
  | 2.13.0 | `AIMessage` feedback thumbs | **Before:** No pressed state; pressing the same thumb twice called `onFeedback` twice. **After:** `AIFeedbackControl` toggles with `aria-pressed`; the second press clears the rating and calls only `onFeedbackChange(null)`. **Verified by:** `AIMessage.test.tsx` (G-04e) | b, c, e | G-04b: `copyBehavior="callback"`; G-04c: none (a toolbar without its arrow-key model fails the behavior contract); G-04d: none (WCAG 1.4.11 contrast); G-04e: none (the toggle state is the WCAG 4.1.2 fix); AIActionsGroup row wrap: none (WCAG 1.4.10 Reflow); AIMessage footer wrap: none (WCAG 1.4.10 Reflow) | If you counted repeated `onFeedback` calls, use `onFeedbackChange`, which reports every change including the clear. |
346
- | 2.13.0 | `AIActionsGroup` `direction="row"` | **Before:** A row did not wrap and overflowed a narrow host (a 320 to 360px docked AI panel). **After:** Actions wrap onto the next line with the same `spacing` (a flex gap); each action sizes to its label, grows to share its line and shrinks with `minWidth: 0`, `maxWidth: 100%`. **Verified by:** `AIActions.test.tsx` (320px and 360px hosts), ai-aiactions--actions-group-row-narrow | b, c, e | G-04b: `copyBehavior="callback"`; G-04c: none (a toolbar without its arrow-key model fails the behavior contract); G-04d: none (WCAG 1.4.11 contrast); G-04e: none (the toggle state is the WCAG 4.1.2 fix); AIActionsGroup row wrap: none (WCAG 1.4.10 Reflow); AIMessage footer wrap: none (WCAG 1.4.10 Reflow) | Nothing. A consumer `sx` on an action still wins. |
346
+ | 2.13.0 | `AIActionsGroup` `direction="row"` | **Before:** A row did not wrap and overflowed a narrow host (a 320 to 360px docked AI panel). **After:** Actions wrap onto the next line with the same `spacing` (a flex gap); each action sizes to its label, grows to share its line and shrinks with `minWidth: 0`, `maxWidth: 100%`. **Verified by:** `AIActions.test.tsx` (320px and 360px hosts), ai-aiactionsgroup--actions-group-row-narrow | b, c, e | G-04b: `copyBehavior="callback"`; G-04c: none (a toolbar without its arrow-key model fails the behavior contract); G-04d: none (WCAG 1.4.11 contrast); G-04e: none (the toggle state is the WCAG 4.1.2 fix); AIActionsGroup row wrap: none (WCAG 1.4.10 Reflow); AIMessage footer wrap: none (WCAG 1.4.10 Reflow) | Nothing. A consumer `sx` on an action still wins. |
347
347
  | 2.13.0 | `AIMessage` footer (timestamp and actions) | **Before:** In a narrow host the footer stayed on one line: the timestamp broke over two lines and the thumbs stacked into a column. **After:** The footer wraps: the actions move under the timestamp, aligned to the end, and wrap as a group; the actions are spaced by a 4px flex gap. **Verified by:** ai-chatthread--docked-panel-widths play (320px host: thumbs side by side, timestamp on one line) | b, c, e | G-04b: `copyBehavior="callback"`; G-04c: none (a toolbar without its arrow-key model fails the behavior contract); G-04d: none (WCAG 1.4.11 contrast); G-04e: none (the toggle state is the WCAG 4.1.2 fix); AIActionsGroup row wrap: none (WCAG 1.4.10 Reflow); AIMessage footer wrap: none (WCAG 1.4.10 Reflow) | Nothing. A consumer `slotProps.footer` `sx` still wins. |
348
348
  | 2.13.0 | `ChatHistoryList` options button | **Before:** Hidden until hover (invisible on focus and touch), named 'Chat options' on every row, no menu-trigger state; the Delete icon was missing. **After:** Visible on focus, while its menu is open and on touch; named 'Options for {title}' (`ai.chatHistoryList.optionsFor`); `aria-haspopup="menu"` and `aria-expanded`; Delete, Pin and Unpin icons. **Verified by:** `ChatHistoryList.test.tsx` (WI-23b) | b | WI-23b: none | Tests that query `getByRole('button', { name: 'Chat options' })` use the per-row name, for example `'Options for Q4 revenue'`. |
349
349
  | 2.13.0 | `ResizablePanel` under `theme.direction: 'rtl'` | **Before:** Arrow keys and drag followed the physical layout (Left Arrow always widened a right-side panel). **After:** The arrow and the drag toward the content widen the panel. **Verified by:** `ResizablePanel.test.tsx` [WH-31] | b | H-31: none; H-32: none (use the panel header's Exit fullscreen and Close while fullscreen) | Nothing; an app that inverted the keys itself removes that. |
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <!-- catalog-counts:start intro -->
4
4
 
5
- Enterprise component platform built on **MUI 9** and **React 19** for [Trinity LifeSciences](https://trinitylifesciences.com). Provides 143 accessible React components (43 of them AI and human-in-the-loop components, 17 chart components and 13 page templates), 32 hooks, a 3-tier design token system, and a CSS-only package for non-React consumers, with the tokens, the React theme and the CSS package kept in parity.
5
+ Enterprise component platform built on **MUI 9** and **React 19** for [Trinity LifeSciences](https://trinitylifesciences.com). Provides 146 accessible React components (46 of them AI and human-in-the-loop components, 17 chart components and 13 page templates), 32 hooks, a 3-tier design token system, and a CSS-only package for non-React consumers, with the tokens, the React theme and the CSS package kept in parity.
6
6
 
7
7
  <!-- catalog-counts:end intro -->
8
8
 
@@ -49,15 +49,15 @@ Enterprise component platform built on **MUI 9** and **React 19** for [Trinity L
49
49
 
50
50
  | Capability | Details |
51
51
  |---|---|
52
- | **143 Components** | Navigation, layout, AI, data display, inputs, feedback, charts |
53
- | **43 AI Components** | InsightEngine, ChatThread, AIMessage, AIChainOfThought, the human-in-the-loop blocks, voice input, explainability, sources, personas |
52
+ | **146 Components** | Navigation, layout, AI, data display, inputs, feedback, charts |
53
+ | **46 AI Components** | InsightEngine, ChatThread, AIMessage, AIChainOfThought, the human-in-the-loop blocks, voice input, explainability, sources, personas |
54
54
  | **17 Chart Components** | Line, bar, area, pie, donut, scatter, bubble, radial, gauge, composed, sparkline, plus the chart wrapper, tooltips and legends |
55
55
  | **13 Page Templates** | Dashboard, list-detail, settings, auth, catalog, wizard, report, the AI review queue and more, plus one pattern (`AICopilotPattern`) |
56
56
  | **3-Tier Design Tokens** | Base → Semantic → Component tokens; the React theme and the CSS variables are generated from the same source and kept in parity |
57
57
  | **Dark Mode** | Automatic light/dark themes with WCAG 2.2 AA color contrast |
58
58
  | **3 Theme Presets** | CRM (compact), Portal (accessible), Analytics (data-viz) |
59
59
  | **32 Hooks** | Debounce, clipboard, breakpoints, disclosure, roving tabindex, live announcements, and more |
60
- | **TypeScript-First** | 850 root exports with full type definitions |
60
+ | **TypeScript-First** | 861 root exports with full type definitions |
61
61
  | **CSS-Only Package** | Angular, Vue, and static HTML support through 1186 `--trinity-*` CSS variables |
62
62
  | **80+ Brand Assets** | Gradient icons, background images, logos |
63
63
  | **Bundle Governance** | A size-limit ratchet on every public entry; each raise is measured and recorded |
@@ -97,7 +97,7 @@ Enterprise component platform built on **MUI 9** and **React 19** for [Trinity L
97
97
 
98
98
  | Package / Import | Exports | Use Case |
99
99
  |---|---:|---|
100
- | `@trinityui/design-system` | 850 | Full API: components, templates, patterns, hooks, tokens, themes and utilities |
100
+ | `@trinityui/design-system` | 861 | Full API: components, templates, patterns, hooks, tokens, themes and utilities |
101
101
  | `@trinityui/design-system/essentials` | 45 | Quick start: the themes and the core components |
102
102
  | `@trinityui/design-system/theme` | 52 | Theme utilities only (tree-shakeable) |
103
103
  | `@trinityui/design-system/tokens` | 131 | Design tokens only (tree-shakeable) |
@@ -214,7 +214,7 @@ The AI components read their built-in strings from one catalog, which `AIConfigP
214
214
 
215
215
  ### 6. Without React
216
216
 
217
- Load the CSS package and use the `--trinity-*` variables; `data-theme="dark"` switches the mode. See [CSS-Only Usage](#css-only-usage) and the CSS AI agent guide in Storybook (Getting Started/AI Agent Guide (CSS)).
217
+ Load the CSS package and use the `--trinity-*` variables; `data-theme="dark"` switches the mode. See [CSS-Only Usage](#css-only-usage) and the AI agent guide in Storybook (Getting Started/AI Agent Guide, "CSS only" track).
218
218
 
219
219
  For the full getting-started guide, see [docs/QUICK_START.md](./docs/QUICK_START.md) and the Getting Started page in Storybook.
220
220
 
@@ -287,9 +287,9 @@ The largest component category — a full suite for building AI-powered experien
287
287
  | Component | Description | Storybook |
288
288
  |---|---|---|
289
289
  | `InsightEngineInput` | The AI composer: send, stop while generating, mentions, models and sources, voice input, and an unavailable state with its reason | AI/InsightEngineInput |
290
- | `AIVoiceOverlay` | Voice input overlay with transcription | AI/Chat Components |
290
+ | `AIVoiceOverlay` | Voice input overlay with transcription | AI/AIVoiceMode |
291
291
  | `AIVoiceMode` | Full-screen voice conversation mode: an orb that follows the conversation, a live transcript, mute and end | AI/AIVoiceMode |
292
- | `AIListeningIndicator` | Animated listening state indicator | AI/Chat Components |
292
+ | `AIListeningIndicator` | Animated listening state indicator | AI/AIVoiceMode |
293
293
  | `PredictiveTextInput` | AI-powered autocomplete text input (OpenAI-compatible) | Form Inputs/PredictiveTextInput |
294
294
 
295
295
  #### AI Human in the Loop
@@ -299,6 +299,9 @@ The largest component category — a full suite for building AI-powered experien
299
299
  | `AIPlanReview` | The plan the AI proposes before it runs a query, for the user to review, correct and confirm (inline or in a dialog; `readOnly` for the record) | AI/AIPlanReview |
300
300
  | `AIReviewItem` | One answer in a golden-dataset review: the question, what produced the answer, and the reviewer's approve, edit or reject decision with its history | AI/AIReviewItem |
301
301
  | `AIClarificationPrompt` | A clarifying question the AI asks before it answers: options, a free-text answer and a typed result the backend can act on | AI/AIClarificationPrompt |
302
+ | `AIClarificationFlow` | Two to five related clarifying questions in one card, answered one at a time, with progress, Back and Next | AI/AIClarificationFlow |
303
+ | `AIChangeSummary` | What the AI changed in a document, on its version card: changed rows first, unchanged muted, Open | AI/AIChangeSummary |
304
+ | `AIReplyBar` | The next step at the end of an AI answer: one primary reply and a few suggestions, locked after use | AI/AIReplyBar |
302
305
  | `AIQueryDisclosure` | The query behind an answer, shown on demand, with Copy | AI/AIQueryDisclosure |
303
306
  | `AIFeedbackControl` | Thumbs up and down on an answer, and the "Tell us what went wrong" flow | AI/AIFeedbackControl |
304
307
  | `AIFeedbackForm` | What went wrong with an answer: problem types, a comment and an optional rerun | AI/AIFeedbackForm |
@@ -313,7 +316,7 @@ The largest component category — a full suite for building AI-powered experien
313
316
  | `AITextBlock` | Text of an AI response: plain text, or lightweight markdown (bold, italic, code, links, headings, lists, quotes, fenced code) with opt-in `[^id]` source citations and `headingOffset` | AI/AITextBlock |
314
317
  | `AIChainOfThought` | The reasoning behind an answer: thinking, a plan awaiting confirmation, execution with failed tasks and Retry, and the output | AI/AIChainOfThought |
315
318
  | `AIExplainability` | Confidence scores and explainability panel | AI/AIExplainability |
316
- | `AISource` | One source citation | none yet |
319
+ | `AISource` | One source citation | AI/AISourcesSection |
317
320
  | `AISourcesSection` | A simple list of source citations | AI/AISourcesSection |
318
321
  | `AISourcesPanel` | Source citations grouped by category | AI/AISourcesPanel |
319
322
  | `AISourceChip` | One source at the number, sentence, table cell or chart point it supports: a number or label chip that opens the source's details | AI/AISourceChip |
@@ -334,8 +337,8 @@ The largest component category — a full suite for building AI-powered experien
334
337
  | Component | Description | Storybook |
335
338
  |---|---|---|
336
339
  | `AISuggestedAction` | A suggested action as a pill button | AI/AISuggestedAction |
337
- | `AICircularAction` | A suggested action as a circular icon button | AI/AIActions |
338
- | `AIActionsGroup` | A group of suggested actions | AI/AIActions |
340
+ | `AICircularAction` | A suggested action as a circular icon button | AI/AICircularAction |
341
+ | `AIActionsGroup` | A group of suggested actions | AI/AIActionsGroup |
339
342
  | `AIContainer` | Themed container for AI content | AI/AIContainer |
340
343
  | `AIExpandableSection` | Collapsible section for AI detail panels | AI/AIExpandableSection |
341
344
  | `AIPersonaCard` | AI persona/agent identity card | AI/AIContainer |
@@ -364,9 +367,9 @@ These still work in 2.x and warn once in development; do not start new work with
364
367
  | Deprecated | Use instead | Storybook |
365
368
  |---|---|---|
366
369
  | `AIChatMessage` | `AIMessage` (and `UserMessage` for the user's turn) | AI/AIMessage |
367
- | `AIChatInput` | `InsightEngineInput`, or `ChatThread` for a whole conversation | AI/AIChat |
368
- | `AITypingIndicator` | `AIMessage`'s streaming state with `AIShimmer` | AI/AIChat |
369
- | `AIQuickReply` | `AISuggestedAction` or `AIActionsGroup` | AI/AIChat |
370
+ | `AIChatInput` | `InsightEngineInput`, or `ChatThread` for a whole conversation | Deprecated/AIChat |
371
+ | `AITypingIndicator` | `AIMessage`'s streaming state with `AIShimmer` | Deprecated/AIChat |
372
+ | `AIQuickReply` | `AISuggestedAction` or `AIActionsGroup` | Deprecated/AIChat |
370
373
  | `QueryInput` | `InsightEngineInput` | AI/InsightEngineInput |
371
374
  | `AIFabLayout` | `AppLayout` with `navStyle="topnav"` and `aiTrigger="fab"` | Templates/AppLayout |
372
375
 
@@ -381,7 +384,7 @@ All AI components import from `@trinityui/design-system`. AI-specific design tok
381
384
  | Component | Import | Description |
382
385
  |---|---|---|
383
386
  | `DataTable` | `@trinityui/design-system/data-table` | AG Grid Enterprise powered — sorting, filtering, grouping, pivot, server-side row models |
384
- | `SimpleTable` | `@trinityui/design-system` | Lightweight table for simple data (no AG Grid dependency) |
387
+ | `SimpleTable` | `@trinityui/design-system/essentials` | Lightweight table for simple data (no AG Grid dependency) |
385
388
  | `DataCard` | `@trinityui/design-system` | KPI/metric card with trend indicator and sparkline |
386
389
  | `DiffViewer` | `@trinityui/design-system` | Side-by-side or unified diff viewer |
387
390
  | `Timeline` | `@trinityui/design-system` | Vertical timeline with status indicators |
@@ -32,7 +32,7 @@ const Ut = ({
32
32
  justifyContent: "center",
33
33
  width: h.icon + 4,
34
34
  height: h.icon + 4,
35
- borderRadius: `${nt.borders.radius.circle}px`,
35
+ borderRadius: nt.borders.radius.circle,
36
36
  // Perfect circle
37
37
  backgroundColor: c.fill,
38
38
  color: c.onFill