@trinityui/design-system 2.1.3 → 2.2.1

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 (220) hide show
  1. package/CHANGELOG.md +628 -1
  2. package/MIGRATION.md +118 -0
  3. package/README.md +546 -136
  4. package/dist/Legend.js +873 -868
  5. package/dist/app-shell.js +5705 -5757
  6. package/dist/charts.js +2399 -2407
  7. package/dist/components/AI/AIActions.d.ts +3 -3
  8. package/dist/components/AI/AIActions.d.ts.map +1 -1
  9. package/dist/components/AI/AIAvatar.d.ts +1 -1
  10. package/dist/components/AI/AIAvatar.d.ts.map +1 -1
  11. package/dist/components/AI/AIChainOfThought.d.ts +63 -188
  12. package/dist/components/AI/AIChainOfThought.d.ts.map +1 -1
  13. package/dist/components/AI/AIChainOfThought.types.d.ts +195 -0
  14. package/dist/components/AI/AIChainOfThought.types.d.ts.map +1 -0
  15. package/dist/components/AI/AIChainOfThought.utils.d.ts +20 -0
  16. package/dist/components/AI/AIChainOfThought.utils.d.ts.map +1 -0
  17. package/dist/components/AI/AIChat.d.ts +5 -5
  18. package/dist/components/AI/AIChat.d.ts.map +1 -1
  19. package/dist/components/AI/AIContainer.d.ts +3 -3
  20. package/dist/components/AI/AIContainer.d.ts.map +1 -1
  21. package/dist/components/AI/AIExplainability.d.ts +1 -1
  22. package/dist/components/AI/AIExplainability.d.ts.map +1 -1
  23. package/dist/components/AI/AILabel.d.ts +1 -1
  24. package/dist/components/AI/AILabel.d.ts.map +1 -1
  25. package/dist/components/AI/AIMessage.d.ts +15 -2
  26. package/dist/components/AI/AIMessage.d.ts.map +1 -1
  27. package/dist/components/AI/AIRelatedQuestions.d.ts +1 -1
  28. package/dist/components/AI/AIRelatedQuestions.d.ts.map +1 -1
  29. package/dist/components/AI/AIResponseRenderer.d.ts +33 -26
  30. package/dist/components/AI/AIResponseRenderer.d.ts.map +1 -1
  31. package/dist/components/AI/AISources.d.ts +2 -2
  32. package/dist/components/AI/AISources.d.ts.map +1 -1
  33. package/dist/components/AI/AISourcesPanel.d.ts +2 -2
  34. package/dist/components/AI/AISourcesPanel.d.ts.map +1 -1
  35. package/dist/components/AI/AITextBlock.d.ts +59 -19
  36. package/dist/components/AI/AITextBlock.d.ts.map +1 -1
  37. package/dist/components/AI/AIVisuals.d.ts +4 -4
  38. package/dist/components/AI/AIVisuals.d.ts.map +1 -1
  39. package/dist/components/AI/AIVoiceInput.d.ts +2 -2
  40. package/dist/components/AI/AIVoiceInput.d.ts.map +1 -1
  41. package/dist/components/AI/ChatHeader.d.ts +1 -1
  42. package/dist/components/AI/ChatHeader.d.ts.map +1 -1
  43. package/dist/components/AI/ChatHistoryList.d.ts +1 -1
  44. package/dist/components/AI/ChatHistoryList.d.ts.map +1 -1
  45. package/dist/components/AI/ChatThread.d.ts +21 -1
  46. package/dist/components/AI/ChatThread.d.ts.map +1 -1
  47. package/dist/components/AI/InsightEngine.d.ts +29 -1
  48. package/dist/components/AI/InsightEngine.d.ts.map +1 -1
  49. package/dist/components/AI/InsightEngineInput.d.ts +1 -1
  50. package/dist/components/AI/InsightEngineInput.d.ts.map +1 -1
  51. package/dist/components/AI/QueryInput.d.ts +1 -1
  52. package/dist/components/AI/QueryInput.d.ts.map +1 -1
  53. package/dist/components/AI/UserAvatar.d.ts +1 -1
  54. package/dist/components/AI/UserAvatar.d.ts.map +1 -1
  55. package/dist/components/AI/UserMessage.d.ts +1 -1
  56. package/dist/components/AI/UserMessage.d.ts.map +1 -1
  57. package/dist/components/AI/tokens.d.ts +120 -10
  58. package/dist/components/AI/tokens.d.ts.map +1 -1
  59. package/dist/components/AppLayout/AIFab.d.ts +1 -1
  60. package/dist/components/AppLayout/AIFab.d.ts.map +1 -1
  61. package/dist/components/AppLayout/AIFabLayout.deprecated.d.ts +3 -2
  62. package/dist/components/AppLayout/AIFabLayout.deprecated.d.ts.map +1 -1
  63. package/dist/components/AppLayout/AppLayout.d.ts +45 -1
  64. package/dist/components/AppLayout/AppLayout.d.ts.map +1 -1
  65. package/dist/components/AppLayout/InsightEnginePanel.d.ts +1 -1
  66. package/dist/components/AppLayout/InsightEnginePanel.d.ts.map +1 -1
  67. package/dist/components/AppLayout/ResizablePanel.d.ts +1 -1
  68. package/dist/components/AppLayout/ResizablePanel.d.ts.map +1 -1
  69. package/dist/components/AppLayout/ThreadHistorySidebar.d.ts +1 -1
  70. package/dist/components/AppLayout/ThreadHistorySidebar.d.ts.map +1 -1
  71. package/dist/components/Autocomplete/Autocomplete.d.ts +10 -1
  72. package/dist/components/Autocomplete/Autocomplete.d.ts.map +1 -1
  73. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +57 -0
  74. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -0
  75. package/dist/components/Breadcrumbs/index.d.ts +3 -0
  76. package/dist/components/Breadcrumbs/index.d.ts.map +1 -0
  77. package/dist/components/Carousel/Carousel.d.ts +26 -1
  78. package/dist/components/Carousel/Carousel.d.ts.map +1 -1
  79. package/dist/components/Carousel/index.d.ts +1 -1
  80. package/dist/components/Carousel/index.d.ts.map +1 -1
  81. package/dist/components/Charts/AreaChart.d.ts +1 -1
  82. package/dist/components/Charts/AreaChart.d.ts.map +1 -1
  83. package/dist/components/Charts/BarChart.d.ts +1 -1
  84. package/dist/components/Charts/BarChart.d.ts.map +1 -1
  85. package/dist/components/Charts/ChartWrapper.d.ts +1 -1
  86. package/dist/components/Charts/ChartWrapper.d.ts.map +1 -1
  87. package/dist/components/Charts/ComposedChart.d.ts +1 -1
  88. package/dist/components/Charts/ComposedChart.d.ts.map +1 -1
  89. package/dist/components/Charts/CustomLegend.d.ts +6 -8
  90. package/dist/components/Charts/CustomLegend.d.ts.map +1 -1
  91. package/dist/components/Charts/CustomTooltip.d.ts +4 -3
  92. package/dist/components/Charts/CustomTooltip.d.ts.map +1 -1
  93. package/dist/components/Charts/LineChart.d.ts +1 -1
  94. package/dist/components/Charts/LineChart.d.ts.map +1 -1
  95. package/dist/components/Charts/PieChart.d.ts +1 -1
  96. package/dist/components/Charts/PieChart.d.ts.map +1 -1
  97. package/dist/components/Charts/RadialChart.d.ts +2 -2
  98. package/dist/components/Charts/RadialChart.d.ts.map +1 -1
  99. package/dist/components/Charts/ScatterChart.d.ts +1 -1
  100. package/dist/components/Charts/ScatterChart.d.ts.map +1 -1
  101. package/dist/components/Charts/Sparkline.d.ts +1 -1
  102. package/dist/components/Charts/Sparkline.d.ts.map +1 -1
  103. package/dist/components/Charts/highchartsUtils.d.ts.map +1 -1
  104. package/dist/components/ChipsInput/ChipsInput.d.ts +1 -1
  105. package/dist/components/ChipsInput/ChipsInput.d.ts.map +1 -1
  106. package/dist/components/ClearableTextField/ClearableTextField.d.ts +7 -1
  107. package/dist/components/ClearableTextField/ClearableTextField.d.ts.map +1 -1
  108. package/dist/components/Combobox/Combobox.d.ts +1 -1
  109. package/dist/components/Combobox/Combobox.d.ts.map +1 -1
  110. package/dist/components/CommandPalette/CommandPalette.d.ts +10 -1
  111. package/dist/components/CommandPalette/CommandPalette.d.ts.map +1 -1
  112. package/dist/components/Cron/Cron.d.ts +1 -1
  113. package/dist/components/Cron/Cron.d.ts.map +1 -1
  114. package/dist/components/DataCard/DataCard.d.ts +1 -1
  115. package/dist/components/DataCard/DataCard.d.ts.map +1 -1
  116. package/dist/components/DiffViewer/DiffViewer.d.ts +1 -1
  117. package/dist/components/DiffViewer/DiffViewer.d.ts.map +1 -1
  118. package/dist/components/DockLayout/DockLayout.d.ts +1 -1
  119. package/dist/components/DockLayout/DockLayout.d.ts.map +1 -1
  120. package/dist/components/DocumentCard/DocumentCard.d.ts +77 -0
  121. package/dist/components/DocumentCard/DocumentCard.d.ts.map +1 -0
  122. package/dist/components/DocumentCard/index.d.ts +3 -0
  123. package/dist/components/DocumentCard/index.d.ts.map +1 -0
  124. package/dist/components/FileUpload/FileUpload.d.ts +1 -1
  125. package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
  126. package/dist/components/FilterBar/FilterBar.d.ts +42 -1
  127. package/dist/components/FilterBar/FilterBar.d.ts.map +1 -1
  128. package/dist/components/Footer.d.ts +17 -2
  129. package/dist/components/Footer.d.ts.map +1 -1
  130. package/dist/components/GoToTop/GoToTop.d.ts +1 -1
  131. package/dist/components/GoToTop/GoToTop.d.ts.map +1 -1
  132. package/dist/components/HtmlToMui/HtmlToMui.d.ts +39 -0
  133. package/dist/components/HtmlToMui/HtmlToMui.d.ts.map +1 -0
  134. package/dist/components/HtmlToMui/StreamingHtmlToMui.d.ts +35 -0
  135. package/dist/components/HtmlToMui/StreamingHtmlToMui.d.ts.map +1 -0
  136. package/dist/components/HtmlToMui/index.d.ts +4 -0
  137. package/dist/components/HtmlToMui/index.d.ts.map +1 -0
  138. package/dist/components/IllustratedMessage.d.ts +2 -2
  139. package/dist/components/IllustratedMessage.d.ts.map +1 -1
  140. package/dist/components/LandingPage/LandingPage.d.ts +1 -1
  141. package/dist/components/LandingPage/LandingPage.d.ts.map +1 -1
  142. package/dist/components/MentionsInput/MentionsInput.d.ts +1 -1
  143. package/dist/components/MentionsInput/MentionsInput.d.ts.map +1 -1
  144. package/dist/components/Modal/Modal.d.ts +1 -1
  145. package/dist/components/Modal/Modal.d.ts.map +1 -1
  146. package/dist/components/NestedMenu/NestedMenu.d.ts +6 -0
  147. package/dist/components/NestedMenu/NestedMenu.d.ts.map +1 -1
  148. package/dist/components/OverflowTooltip/OverflowTooltip.d.ts +7 -3
  149. package/dist/components/OverflowTooltip/OverflowTooltip.d.ts.map +1 -1
  150. package/dist/components/PageHeader/PageHeader.d.ts +23 -5
  151. package/dist/components/PageHeader/PageHeader.d.ts.map +1 -1
  152. package/dist/components/Popper/Popper.d.ts +1 -1
  153. package/dist/components/Popper/Popper.d.ts.map +1 -1
  154. package/dist/components/PredictiveTextInput/PredictiveTextInput.d.ts +1 -1
  155. package/dist/components/PredictiveTextInput/PredictiveTextInput.d.ts.map +1 -1
  156. package/dist/components/SandboxedIframeRenderer/SandboxedIframeRenderer.d.ts +62 -0
  157. package/dist/components/SandboxedIframeRenderer/SandboxedIframeRenderer.d.ts.map +1 -0
  158. package/dist/components/SandboxedIframeRenderer/index.d.ts +3 -0
  159. package/dist/components/SandboxedIframeRenderer/index.d.ts.map +1 -0
  160. package/dist/components/SearchInput/SearchInput.d.ts +1 -1
  161. package/dist/components/SearchInput/SearchInput.d.ts.map +1 -1
  162. package/dist/components/SimpleTable/SimpleTable.d.ts +7 -2
  163. package/dist/components/SimpleTable/SimpleTable.d.ts.map +1 -1
  164. package/dist/components/SplitPane/SplitPane.d.ts +51 -7
  165. package/dist/components/SplitPane/SplitPane.d.ts.map +1 -1
  166. package/dist/components/SplitPane/index.d.ts +1 -1
  167. package/dist/components/SplitPane/index.d.ts.map +1 -1
  168. package/dist/components/StatusIndicator/StatusIndicator.d.ts +1 -1
  169. package/dist/components/StatusIndicator/StatusIndicator.d.ts.map +1 -1
  170. package/dist/components/Timeline/Timeline.d.ts +1 -1
  171. package/dist/components/Timeline/Timeline.d.ts.map +1 -1
  172. package/dist/components/Toast/Toast.d.ts +1 -1
  173. package/dist/components/Toast/Toast.d.ts.map +1 -1
  174. package/dist/components/TopNavHeader.d.ts +14 -2
  175. package/dist/components/TopNavHeader.d.ts.map +1 -1
  176. package/dist/components/TopNavWithSidebar.d.ts +34 -4
  177. package/dist/components/TopNavWithSidebar.d.ts.map +1 -1
  178. package/dist/components/Tour/Tour.d.ts +1 -1
  179. package/dist/components/Tour/Tour.d.ts.map +1 -1
  180. package/dist/components/TransferList/TransferList.d.ts +1 -1
  181. package/dist/components/TransferList/TransferList.d.ts.map +1 -1
  182. package/dist/components/TreeView/TreeView.d.ts +1 -1
  183. package/dist/components/TreeView/TreeView.d.ts.map +1 -1
  184. package/dist/components/index.d.ts +2 -2
  185. package/dist/components/index.d.ts.map +1 -1
  186. package/dist/components/navigation/components.d.ts +5 -5
  187. package/dist/components/navigation/components.d.ts.map +1 -1
  188. package/dist/components/shared/NavBar.styles.d.ts +65 -0
  189. package/dist/components/shared/NavBar.styles.d.ts.map +1 -0
  190. package/dist/components/shared/useResizable.d.ts +82 -0
  191. package/dist/components/shared/useResizable.d.ts.map +1 -0
  192. package/dist/components/shared/warnDeprecated.d.ts +30 -0
  193. package/dist/components/shared/warnDeprecated.d.ts.map +1 -0
  194. package/dist/components/templates/Dashboard/DashboardTemplate.d.ts +1 -1
  195. package/dist/components/templates/Dashboard/DashboardTemplate.d.ts.map +1 -1
  196. package/dist/components/templates/ListDetail/ListDetailTemplate.d.ts +1 -1
  197. package/dist/components/templates/ListDetail/ListDetailTemplate.d.ts.map +1 -1
  198. package/dist/components/templates/Settings/SettingsTemplate.d.ts +1 -1
  199. package/dist/components/templates/Settings/SettingsTemplate.d.ts.map +1 -1
  200. package/dist/data-table2.js +18194 -15721
  201. package/dist/data.js +116 -114
  202. package/dist/essentials.js +91 -89
  203. package/dist/form.d.ts.map +1 -1
  204. package/dist/forms.js +358 -45092
  205. package/dist/index.d.ts +44 -11
  206. package/dist/index.d.ts.map +1 -1
  207. package/dist/index.js +30203 -29843
  208. package/dist/theme.d.ts +4 -1
  209. package/dist/theme.d.ts.map +1 -1
  210. package/dist/theme.js +188 -161
  211. package/dist/tokens.d.ts +16 -0
  212. package/dist/tokens.d.ts.map +1 -1
  213. package/dist/tokens.js +1 -1
  214. package/dist/trinity.css +862 -1014
  215. package/package.json +69 -27
  216. package/dist/assets/design-system.css +0 -1
  217. package/dist/components/RichTextEditor/RichTextEditor.d.ts +0 -39
  218. package/dist/components/RichTextEditor/RichTextEditor.d.ts.map +0 -1
  219. package/dist/components/RichTextEditor/index.d.ts +0 -3
  220. package/dist/components/RichTextEditor/index.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,26 +1,97 @@
1
1
  # Trinity Design System
2
2
 
3
- Trinity Design System is an enterprise component platform built on MUI for [Trinity LifeSciences](https://trinitylifesciences.com).
3
+ Enterprise component platform built on **MUI v9** for [Trinity LifeSciences](https://trinitylifesciences.com). Provides 100+ accessible React components, a 3-tier design token system, 35+ AI-specific components, 17 chart types, 18 custom hooks, and a CSS-only package for non-React consumers.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@trinityui/design-system.svg)](https://www.npmjs.com/package/@trinityui/design-system)
6
6
  [![npm css package](https://img.shields.io/npm/v/@trinityui/design-system-css.svg)](https://www.npmjs.com/package/@trinityui/design-system-css)
7
7
  [![license](https://img.shields.io/npm/l/@trinityui/design-system.svg)](./LICENSE)
8
8
 
9
- It provides:
10
- - A React component library: `@trinityui/design-system`
11
- - A CSS-only package for non-React apps: `@trinityui/design-system-css`
9
+ ---
10
+
11
+ ## Table of Contents
12
+
13
+ - [Key Capabilities](#key-capabilities)
14
+ - [Architecture](#architecture)
15
+ - [Packages & Entry Points](#packages--entry-points)
16
+ - [Installation](#installation)
17
+ - [Quick Start](#quick-start)
18
+ - [Component Catalog](#component-catalog)
19
+ - [Navigation](#navigation-6-components)
20
+ - [Layout](#layout-7-components)
21
+ - [AI](#ai-35-components)
22
+ - [Data Display](#data-display-8-components)
23
+ - [Input & Forms](#input--forms-18-components)
24
+ - [Feedback](#feedback-7-components)
25
+ - [Charts](#charts-17-components)
26
+ - [Icon System](#icon-system)
27
+ - [Hooks](#hooks-18)
28
+ - [Accessibility](#accessibility)
29
+ - [Design Tokens](#design-tokens)
30
+ - [Theme Presets](#theme-presets)
31
+ - [CSS-Only Usage](#css-only-usage)
32
+ - [Storybook](#storybook)
33
+ - [Development](#development)
34
+ - [Documentation](#documentation)
35
+ - [License](#license)
36
+
37
+ ---
38
+
39
+ ## Key Capabilities
40
+
41
+ | Capability | Details |
42
+ |---|---|
43
+ | **100+ Components** | Navigation, layout, AI, data display, inputs, feedback, charts |
44
+ | **35+ AI Components** | InsightEngine, ChatThread, ChainOfThought, voice input, explainability, sources, personas |
45
+ | **17 Chart Types** | Line, bar, area, pie, donut, scatter, bubble, radial, gauge, composed, sparkline |
46
+ | **3-Tier Design Tokens** | Base → Semantic → Component tokens with CSS variable output |
47
+ | **Dark Mode** | Automatic light/dark themes with WCAG 2.1 AA color contrast |
48
+ | **3 Theme Presets** | CRM (compact), Portal (accessible), Analytics (data-viz) |
49
+ | **18 Custom Hooks** | Debounce, clipboard, breakpoints, focus trap, roving tabindex, and more |
50
+ | **TypeScript-First** | 200+ exports with full type definitions |
51
+ | **CSS-Only Package** | Angular, Vue, and static HTML support via CSS variables |
52
+ | **80+ Brand Assets** | Gradient icons, background images, logos |
53
+ | **Bundle Governance** | Size-limit enforced: core ≤50KB, main ≤200KB |
54
+ | **Accessibility** | axe-core testing, eslint-plugin-jsx-a11y, ARIA hooks, skip links, focus traps |
55
+
56
+ ---
12
57
 
13
58
  ## Architecture
14
59
 
15
- `Design Tokens` -> `Theme Layer` -> `React Components (@trinityui/design-system)` -> `React Consumer Apps`
16
- `Design Tokens` -> `CSS Variables Build` -> `CSS Package (@trinityui/design-system-css)` -> `Angular / Vue / Static Apps`
60
+ ```
61
+ ┌─────────────────────────────────────────────────────────────┐
62
+ │ Design Tokens (tokens.ts) │
63
+ │ Base → Semantic → Component (2,700 lines) │
64
+ └──────────────┬──────────────────────────┬────────────────────┘
65
+ │ │
66
+ ▼ ▼
67
+ ┌──────────────────────────┐ ┌─────────────────────────────────┐
68
+ │ MUI Theme Layer │ │ CSS Variables Build │
69
+ │ lightTheme / darkTheme │ │ generate-css-from-tokens.ts │
70
+ │ + 3 preset themes │ │ trinity.css / trinity-base.css │
71
+ └──────────┬───────────────┘ └──────────┬──────────────────────┘
72
+ │ │
73
+ ▼ ▼
74
+ ┌──────────────────────────┐ ┌─────────────────────────────────┐
75
+ │ @trinityui/design-system │ │ @trinityui/design-system-css │
76
+ │ React + MUI Components │ │ Angular / Vue / Static HTML │
77
+ └──────────────────────────┘ └─────────────────────────────────┘
78
+ ```
17
79
 
18
- ## Packages
80
+ ---
19
81
 
20
- | Package | Use Case |
21
- |---|---|
22
- | `@trinityui/design-system` | React + MUI applications |
23
- | `@trinityui/design-system-css` | Angular, Vue, static HTML, or any CSS-only integration |
82
+ ## Packages & Entry Points
83
+
84
+ | Package / Import | Exports | Use Case |
85
+ |---|---|---|
86
+ | `@trinityui/design-system` | 200+ | Full API — all components, hooks, tokens, utilities |
87
+ | `@trinityui/design-system/essentials` | 16 | Quick-start — theme + core components |
88
+ | `@trinityui/design-system/theme` | ~10 | Theme utilities only (tree-shakeable) |
89
+ | `@trinityui/design-system/tokens` | ~30 | Design tokens only (tree-shakeable) |
90
+ | `@trinityui/design-system/data-table` | 3 | DataTable + AG Grid Enterprise license setup |
91
+ | `@trinityui/design-system/css` | — | CSS file from the React package |
92
+ | `@trinityui/design-system-css` | — | Standalone CSS-only package for non-React apps |
93
+
94
+ ---
24
95
 
25
96
  ## Installation
26
97
 
@@ -30,7 +101,12 @@ It provides:
30
101
  pnpm add @trinityui/design-system react react-dom @mui/material @mui/icons-material @emotion/react @emotion/styled
31
102
  ```
32
103
 
33
- > Commercial licensing: For MUI, AG Grid, or Syncfusion license procurement/renewal, contact Arun Manoharan, Rahul Desai, or Sangeetha before production use.
104
+ **Optional dependencies** (install only if using these features):
105
+
106
+ ```bash
107
+ pnpm add recharts # Charts
108
+ pnpm add @mui/x-date-pickers dayjs # DatePicker
109
+ ```
34
110
 
35
111
  ### CSS-only package
36
112
 
@@ -38,7 +114,13 @@ pnpm add @trinityui/design-system react react-dom @mui/material @mui/icons-mater
38
114
  pnpm add @trinityui/design-system-css
39
115
  ```
40
116
 
41
- ## React Quick Start
117
+ > **Commercial licensing:** For MUI, AG Grid, or Syncfusion license procurement/renewal, contact Arun Manoharan, Rahul Desai, or Sangeetha before production use.
118
+
119
+ ---
120
+
121
+ ## Quick Start
122
+
123
+ ### 1. Wrap your app with the theme
42
124
 
43
125
  ```tsx
44
126
  import { ThemeProvider, CssBaseline } from '@mui/material';
@@ -54,206 +136,534 @@ export function AppProviders({ children }: { children: React.ReactNode }) {
54
136
  }
55
137
  ```
56
138
 
57
- ## Import Strategy
139
+ ### 2. Import strategy
58
140
 
59
- Use MUI for standard UI primitives, and Trinity for domain-specific components and tokens.
141
+ Use **MUI** for standard UI primitives. Use **Trinity** for domain-specific components, tokens, and hooks.
60
142
 
61
143
  ```tsx
144
+ // MUI primitives
62
145
  import { Button, Card, TextField } from '@mui/material';
146
+
147
+ // Trinity components
63
148
  import { StatusIndicator, Toast, useToast } from '@trinityui/design-system';
64
149
  ```
65
150
 
66
- ## Async Autocomplete
151
+ ### 3. Dark mode
152
+
153
+ ```tsx
154
+ import { lightTheme, darkTheme } from '@trinityui/design-system';
155
+
156
+ <ThemeProvider theme={isDarkMode ? darkTheme : lightTheme}>
157
+ <CssBaseline />
158
+ <App />
159
+ </ThemeProvider>
160
+ ```
161
+
162
+ For the full getting-started guide, see [docs/QUICK_START.md](./docs/QUICK_START.md).
163
+
164
+ ---
165
+
166
+ ## Component Catalog
167
+
168
+ ### Navigation (6 components)
169
+
170
+ | Component | Import | Description |
171
+ |---|---|---|
172
+ | `TopNavHeader` | `@trinityui/design-system` | Primary navigation header with search, client switcher, and user menu |
173
+ | `TopNavWithSidebar` | `@trinityui/design-system` | Full layout with collapsible sidebar navigation |
174
+ | `Footer` | `@trinityui/design-system` | Page footer — light and dark variants, compact 40px height |
175
+ | `SearchBar` | `@trinityui/design-system` | Header search bar primitive with suggestion support |
176
+ | `ClientMenu` | `@trinityui/design-system` | Client/tenant switcher dropdown |
177
+ | `AppsMenu` | `@trinityui/design-system` | Application launcher grid menu |
178
+
179
+ Also exports: `TrinityLogo`, `UserMenu`, `HeaderActions`, and 14 navigation type definitions.
180
+
181
+ ---
182
+
183
+ ### Layout (7 components)
184
+
185
+ | Component | Import | Description |
186
+ |---|---|---|
187
+ | `AppLayout` | `@trinityui/design-system` | Primary app shell — nav + content + optional AI panel |
188
+ | `PageHeader` | `@trinityui/design-system` | Page header with breadcrumbs, title, and actions |
189
+ | `SplitPane` | `@trinityui/design-system` | Resizable split view (horizontal/vertical) |
190
+ | `DockLayout` | `@trinityui/design-system` | Dockable panel layout with configurable zones |
191
+ | `ResizablePanel` | `@trinityui/design-system` | Standalone resizable side panel |
192
+ | `InsightEnginePanel` | `@trinityui/design-system` | AI insight panel designed for AppLayout integration |
193
+ | `LandingPage` | `@trinityui/design-system` | Pre-built landing page template |
194
+
195
+ Also exports: 3 page templates (`DashboardTemplate`, `ListDetailTemplate`, `SettingsTemplate`).
196
+
197
+ ---
198
+
199
+ ### AI (35+ components)
200
+
201
+ The largest component category — a full suite for building AI-powered experiences.
202
+
203
+ #### AI Containers & Orchestration
204
+
205
+ | Component | Description |
206
+ |---|---|
207
+ | `InsightEngine` | Top-level AI experience orchestrator |
208
+ | `ChatThread` | Scrollable conversation thread with message grouping |
209
+ | `ChatHeader` | Chat view header with mode switching |
210
+ | `ChatHistoryList` | Navigable list of past conversations |
211
+
212
+ #### AI Input
213
+
214
+ | Component | Description |
215
+ |---|---|
216
+ | `InsightEngineInput` | Primary AI query input with context awareness |
217
+ | `AIVoiceOverlay` | Voice input overlay with transcription |
218
+ | `AIListeningIndicator` | Animated listening state indicator |
219
+ | `PredictiveTextInput` | AI-powered autocomplete text input (OpenAI-compatible) |
220
+ | `AIChatInput` | Lightweight chat input primitive |
221
+ | `AIQuickReply` | Quick-reply suggestion chips |
222
+
223
+ #### AI Rendering & Explainability
224
+
225
+ | Component | Description |
226
+ |---|---|
227
+ | `AIResponseRenderer` | Renders structured AI responses (text, tables, charts, actions) |
228
+ | `AITextBlock` | Styled text block for AI output with streaming support |
229
+ | `AIChainOfThought` | Multi-phase reasoning visualization (understand → plan → execute → output) |
230
+ | `AIExplainability` | Confidence scores and explainability panel |
231
+ | `AISource` / `AISourcesSection` / `AISourcesPanel` | Source citations — individual, grouped, and full panel views |
232
+ | `AIRelatedQuestions` | Suggested follow-up questions |
233
+
234
+ #### AI Messages & Avatars
235
+
236
+ | Component | Description |
237
+ |---|---|
238
+ | `AIMessage` | AI-authored message bubble with actions |
239
+ | `UserMessage` | User-authored message bubble |
240
+ | `AIChatMessage` | Lightweight chat message primitive |
241
+ | `AIAvatar` | AI bot avatar (animated) |
242
+ | `UserAvatar` | User avatar for chat contexts |
243
+ | `AILabel` | "AI-generated" badge/label (multiple sizes and variants) |
244
+
245
+ #### AI Actions & Layout
246
+
247
+ | Component | Description |
248
+ |---|---|
249
+ | `AISuggestedAction` / `AICircularAction` / `AIActionsGroup` | AI-suggested action buttons and groups |
250
+ | `AIContainer` | Themed container for AI content |
251
+ | `AIExpandableSection` | Collapsible section for AI detail panels |
252
+ | `AIPersonaCard` | AI persona/agent identity card |
253
+ | `GradientText` / `GradientIconBadge` | Visual flourishes for AI UI |
254
+ | `StatCard` | KPI stat card for AI dashboards |
255
+ | `AIShimmer` | Shimmer loading state for AI content |
256
+ | `AITypingIndicator` | Animated typing indicator |
257
+
258
+ All AI components import from `@trinityui/design-system`. AI-specific design tokens available via `aiTokens`.
259
+
260
+ ---
261
+
262
+ ### Data Display (8 components)
263
+
264
+ | Component | Import | Description |
265
+ |---|---|---|
266
+ | `DataTable` | `@trinityui/design-system/data-table` | AG Grid Enterprise powered — sorting, filtering, grouping, pivot, server-side row models |
267
+ | `SimpleTable` | `@trinityui/design-system` | Lightweight table for simple data (no AG Grid dependency) |
268
+ | `DataCard` | `@trinityui/design-system` | KPI/metric card with trend indicator and sparkline |
269
+ | `DiffViewer` | `@trinityui/design-system` | Side-by-side or unified diff viewer |
270
+ | `Timeline` | `@trinityui/design-system` | Vertical timeline with status indicators |
271
+ | `TreeView` | `@trinityui/design-system` | Hierarchical tree view with expansion and selection |
272
+ | `TransferList` | `@trinityui/design-system` | Dual-list transfer component with search and bulk actions |
273
+ | `StatusIndicator` / `StatusLegend` | `@trinityui/design-system` | Unified status display (success/warning/error/info) + legend |
274
+
275
+ **DataTable setup:**
276
+
277
+ ```tsx
278
+ import { DataTable, setAgGridEnterpriseLicenseKey } from '@trinityui/design-system/data-table';
279
+
280
+ // Set license key once at app bootstrap
281
+ setAgGridEnterpriseLicenseKey('<YOUR_KEY>');
282
+ ```
283
+
284
+ ### App Layout
67
285
 
68
- `Autocomplete` supports asynchronous loading from either a callback (`dataSource`) or a URL (`url`), including infinite pagination on scroll.
286
+ `AppLayout` is the recommended shell for React applications that need Trinity branding, sidebar navigation, user context, and optional AI panel integration.
69
287
 
70
- ### Data source mode
288
+ ```tsx
289
+ import * as React from 'react';
290
+ import HomeOutlinedIcon from '@mui/icons-material/HomeOutlined';
291
+ import BarChartIcon from '@mui/icons-material/BarChart';
292
+ import SettingsOutlinedIcon from '@mui/icons-material/SettingsOutlined';
293
+ import { AppLayout, type NavItem } from '@trinityui/design-system';
294
+
295
+ const navItems: NavItem[] = [
296
+ { id: 'home', label: 'Home', icon: <HomeOutlinedIcon /> },
297
+ { id: 'analytics', label: 'Analytics', icon: <BarChartIcon /> },
298
+ { id: 'settings', label: 'Settings', icon: <SettingsOutlinedIcon /> },
299
+ ];
300
+
301
+ export default function AppShell() {
302
+ const [selectedNavItem, setSelectedNavItem] = React.useState('home');
303
+
304
+ return (
305
+ <AppLayout
306
+ navStyle="sidebar"
307
+ aiTrigger="none"
308
+ companyName="Portfolio Console"
309
+ navItems={navItems}
310
+ selectedNavItem={selectedNavItem}
311
+ onSelectedNavItemChange={setSelectedNavItem}
312
+ user={{ name: 'Jane Doe', email: 'jane@example.com', initials: 'JD' }}
313
+ >
314
+ <main>Page content</main>
315
+ </AppLayout>
316
+ );
317
+ }
318
+ ```
319
+
320
+ Optional header regions can be disabled when the consuming app owns those controls elsewhere:
71
321
 
72
322
  ```tsx
73
- import { Autocomplete, type AutocompleteAsyncRequest } from '@trinityui/design-system';
323
+ <AppLayout
324
+ navStyle="sidebar"
325
+ showSearch={false}
326
+ showClientSelector={false}
327
+ showSidebarToggle={false}
328
+ >
329
+ <main>Page content</main>
330
+ </AppLayout>
331
+ ```
74
332
 
75
- type UserOption = { id: string; name: string; email: string };
333
+ | Prop | Default | Description |
334
+ |---|---:|---|
335
+ | `showSearch` | `true` | Shows the desktop search field and mobile search action. |
336
+ | `showClientSelector` | `true` | Shows the client selector dropdown in the header. |
337
+ | `showSidebarToggle` | `true` | Shows the sidebar hamburger/collapse button in sidebar mode. |
338
+
339
+ ---
340
+
341
+ ### Input & Forms (18+ components)
342
+
343
+ | Component | Import | Description |
344
+ |---|---|---|
345
+ | `Autocomplete` | `@trinityui/design-system` | Full-featured autocomplete — async loading, pagination, sortable chips, virtualization |
346
+ | `VirtualizedAutocomplete` | `@trinityui/design-system` | Virtualized variant for large option lists |
347
+ | `Combobox` | `@trinityui/design-system` | Accessible combobox with keyboard navigation |
348
+ | `SearchInput` | `@trinityui/design-system` | Standalone search input with suggestion dropdown |
349
+ | `ClearableTextField` | `@trinityui/design-system` | Text field with integrated clear button |
350
+ | `ChipsInput` | `@trinityui/design-system` | Tag/chip entry input with validation |
351
+ | `MentionsInput` | `@trinityui/design-system` | @mention-enabled text input |
352
+ | `FileUpload` / `UploadDropZone` | `@trinityui/design-system` | Drag-and-drop file upload with progress |
353
+ | `CommandPalette` | `@trinityui/design-system` | Cmd+K style command palette with fuzzy search |
354
+ | `FilterBar` | `@trinityui/design-system` | Multi-filter toolbar with presets and saved filters |
355
+ | `NestedMenu` | `@trinityui/design-system` | Multi-level nested menu |
356
+ | `Cron` | `@trinityui/design-system` | Visual cron expression builder |
357
+ | `Carousel` | `@trinityui/design-system` | Content carousel with transition effects |
358
+ | `Popper` | `@trinityui/design-system` | Positioning utility component |
359
+
360
+ #### Form Utilities
361
+
362
+ ```tsx
363
+ import { FormProvider, useForm, useFormField } from '@trinityui/design-system';
364
+
365
+ // Built-in validators
366
+ import { required, email, minLength, maxLength, pattern, min, max, custom } from '@trinityui/design-system';
367
+ ```
368
+
369
+ `FormProvider` gives you form state management with composable validation — no additional form library required.
370
+
371
+ #### Async Autocomplete Example
372
+
373
+ ```tsx
374
+ import { Autocomplete, type AutocompleteAsyncRequest } from '@trinityui/design-system';
76
375
 
77
376
  const loadUsers = async ({ search, page, pageSize, signal }: AutocompleteAsyncRequest) => {
78
- const response = await fetch(`/api/users?q=${encodeURIComponent(search)}&page=${page}&pageSize=${pageSize}`, { signal });
79
- const data = await response.json();
80
- return {
81
- options: data.items as UserOption[],
82
- hasMore: data.hasMore as boolean,
83
- nextPage: page + 1,
84
- };
377
+ const res = await fetch(`/api/users?q=${encodeURIComponent(search)}&page=${page}&pageSize=${pageSize}`, { signal });
378
+ const data = await res.json();
379
+ return { options: data.items, hasMore: data.hasMore, nextPage: page + 1 };
85
380
  };
86
381
 
87
- <Autocomplete<UserOption, true, false, false>
382
+ <Autocomplete
88
383
  name="users"
89
384
  label="Users"
90
385
  options={[]}
91
386
  multiple
92
387
  value={[]}
93
- onHandleChange={(next) => setUsers(next as UserOption[])}
388
+ onHandleChange={(next) => setUsers(next)}
94
389
  labelProperty="name"
95
390
  valueProperty="id"
96
- optionValues={['name', 'email']}
97
- async={{
98
- dataSource: loadUsers,
99
- paginate: true,
100
- pageSize: 25,
101
- debounceMs: 250,
102
- minSearchLength: 1,
103
- }}
104
- />;
391
+ async={{ dataSource: loadUsers, paginate: true, pageSize: 25, debounceMs: 250 }}
392
+ />
105
393
  ```
106
394
 
107
- ## Sortable Multi-Select Autocomplete
108
-
109
- Enable `sortableSelected` to reorder selected chips.
110
- - Mouse: drag and drop chips.
111
- - Keyboard: `Ctrl/Cmd + Shift + Arrow` keys on a selected chip.
395
+ #### Predictive Text Input (OpenAI via Azure Function)
112
396
 
113
397
  ```tsx
114
- <Autocomplete<string, true, false, false>
115
- name="focus-areas"
116
- label="Focus Areas"
117
- options={['Oncology', 'Safety', 'AI', 'Regulatory']}
118
- multiple
119
- value={selected}
120
- onHandleChange={(next) => setSelected(next as string[])}
121
- sortableSelected
122
- virtualized={false}
123
- />;
398
+ import { PredictiveTextInput, createOpenAIPredictor } from '@trinityui/design-system';
399
+
400
+ const predictor = createOpenAIPredictor({ endpoint: '/api/predictive-text', maxSuggestions: 5 });
401
+
402
+ <PredictiveTextInput label="Prompt" value={value} onChange={setValue} onPredict={predictor} />
124
403
  ```
125
404
 
126
- ## Predictive Text Input (OpenAI via Azure Function)
405
+ See the [Azure Function template](./examples/azure-functions/predictive-text/) for the backend.
406
+
407
+ ---
408
+
409
+ ### Feedback (7 components)
127
410
 
128
- Use `PredictiveTextInput` with `createOpenAIPredictor` and point it to your backend endpoint (for example, an Azure Function at `/api/predictive-text`).
411
+ | Component | Import | Description |
412
+ |---|---|---|
413
+ | `Modal` | `@trinityui/design-system` | Modal dialog with size variants and accessible focus management |
414
+ | `ConfirmDialog` | `@trinityui/design-system` | Confirm/cancel dialog (also available via `useConfirmDialog` hook) |
415
+ | `ToastProvider` / `Toast` | `@trinityui/design-system` | Toast notification system (wrap app in `ToastProvider`, trigger via `useToast`) |
416
+ | `IllustratedMessage` | `@trinityui/design-system` | Empty state / error illustrated message |
417
+ | `Tour` | `@trinityui/design-system` | Guided product tour with step-by-step highlights |
418
+ | `GoToTop` | `@trinityui/design-system` | Scroll-to-top floating button |
419
+
420
+ ---
421
+
422
+ ### Charts (17 components)
423
+
424
+ All charts are Recharts-based with Trinity theming applied automatically.
425
+
426
+ | Component | Description |
427
+ |---|---|
428
+ | `LineChart` | Line/time-series chart |
429
+ | `BarChart` | Vertical/horizontal bar chart |
430
+ | `AreaChart` | Filled area chart |
431
+ | `PieChart` | Pie chart |
432
+ | `DonutChart` | Donut variant |
433
+ | `ScatterChart` | Scatter plot |
434
+ | `BubbleChart` | Bubble chart |
435
+ | `RadialBarChart` | Radial/polar bar chart |
436
+ | `GaugeChart` | Gauge/meter chart |
437
+ | `ComposedChart` | Mixed line + bar + area chart |
438
+ | `Sparkline` | Inline mini chart for data cards |
439
+ | `ChartWrapper` | Chart container with consistent sizing |
440
+ | `CustomTooltip` / `SimpleTooltip` | Chart tooltip components |
441
+ | `CustomLegend` / `InteractiveLegend` / `PieLegend` | Chart legend components |
442
+
443
+ All import from `@trinityui/design-system`. Full type definitions for `DataPoint`, `SeriesConfig`, `AxisConfig`, and chart-specific props.
444
+
445
+ ---
446
+
447
+ ### Icon System
129
448
 
130
449
  ```tsx
131
- import { PredictiveTextInput, createOpenAIPredictor } from '@trinityui/design-system';
450
+ import { Icon, IconProvider } from '@trinityui/design-system';
132
451
 
133
- const predictor = createOpenAIPredictor({
134
- endpoint: '/api/predictive-text',
135
- maxSuggestions: 5,
136
- });
137
-
138
- <PredictiveTextInput
139
- label="Prompt"
140
- value={value}
141
- onChange={setValue}
142
- onPredict={predictor}
143
- />;
452
+ // Wrap with IconProvider to set the active icon library
453
+ <IconProvider library="feather">
454
+ <Icon name="check" size="md" />
455
+ </IconProvider>
144
456
  ```
145
457
 
146
- Azure Function template:
147
- - [`examples/azure-functions/predictive-text/index.ts`](./examples/azure-functions/predictive-text/index.ts)
148
- - [`examples/azure-functions/predictive-text/README.md`](./examples/azure-functions/predictive-text/README.md)
458
+ Supports multiple icon libraries via `IconProvider`. Six intent-based sizes: `inline` (14px), `xs` (16px), `sm` (18px), `md` (20px), `lg` (24px), `display` (36px).
459
+
460
+ ---
461
+
462
+ ## Hooks (18)
149
463
 
150
- ### URL mode
464
+ All hooks import from `@trinityui/design-system`.
465
+
466
+ | Hook | Description |
467
+ |---|---|
468
+ | `useDebounce` | Debounce a value by delay |
469
+ | `useDebouncedCallback` | Returns a debounced callback function |
470
+ | `useClipboard` | Copy text to clipboard with success feedback |
471
+ | `useLocalStorage` | Persist state to `localStorage` with SSR safety |
472
+ | `useTrinityBreakpoints` | Responsive flags: `isMobile`, `isTablet`, `isDesktop`, `isLargeDesktop` |
473
+ | `useToggle` | Boolean toggle: `[value, toggle, setValue]` |
474
+ | `usePrevious` | Access the previous render's value |
475
+ | `useOnClickOutside` | Detect clicks outside a ref element |
476
+ | `useKeyPress` | Detect a specific key press |
477
+ | `useInterval` | Declarative `setInterval` with cleanup |
478
+ | `useFocusTrap` | Trap keyboard focus within a container (accessibility) |
479
+ | `useReducedMotion` | Detect `prefers-reduced-motion` user preference |
480
+ | `useAriaLive` | Manage ARIA live region announcements for screen readers |
481
+ | `useRovingTabIndex` | Arrow-key navigation for composite widgets |
482
+ | `useConfirmDialog` | Imperatively open confirmation dialogs |
483
+ | `useToast` | Show toast notifications (requires `ToastProvider`) |
484
+ | `useTrinityPalette` | Access Trinity semantic palette from the current theme |
485
+ | `useFlowAutoLayout` | Auto-layout for React Flow / XYFlow diagrams |
486
+
487
+ ---
488
+
489
+ ## Accessibility
490
+
491
+ Trinity targets **WCAG 2.1 AA** compliance. The system provides:
492
+
493
+ | Feature | Details |
494
+ |---|---|
495
+ | **Automated testing** | `vitest-axe` (axe-core) a11y tests, dedicated `test:a11y` script |
496
+ | **Linting** | `eslint-plugin-jsx-a11y` enforced across all components |
497
+ | **Storybook addon** | `@storybook/addon-a11y` for interactive accessibility auditing |
498
+ | **ARIA hooks** | `useFocusTrap`, `useAriaLive`, `useRovingTabIndex`, `useReducedMotion` |
499
+ | **Skip links** | `SkipLink` component for keyboard-first navigation |
500
+ | **Accessible colors** | `accessibleCombinations` — pre-validated WCAG AA text/background pairs |
501
+ | **Contrast utilities** | `getContrastRatio()`, `validateAccessibility()`, `meetsWCAG()` |
502
+ | **Visual hiding** | `VisuallyHidden` component for screen-reader-only content |
151
503
 
152
504
  ```tsx
153
- <Autocomplete<UserOption, true, false, false>
154
- name="users-url"
155
- label="Users"
156
- options={[]}
157
- multiple
158
- value={[]}
159
- onHandleChange={(next) => setUsers(next as UserOption[])}
160
- labelProperty="name"
161
- valueProperty="id"
162
- async={{
163
- url: '/api/users/search',
164
- method: 'GET',
165
- queryParam: 'q',
166
- pageParam: 'page',
167
- pageSizeParam: 'pageSize',
168
- paginate: true,
169
- mapResponse: (response) => {
170
- const data = response as { results: UserOption[]; hasMore: boolean };
171
- return { options: data.results, hasMore: data.hasMore };
172
- },
173
- }}
174
- />;
505
+ import { accessibleCombinations } from '@trinityui/design-system';
506
+
507
+ // Pre-validated WCAG AA pairs
508
+ <Box sx={{
509
+ backgroundColor: accessibleCombinations.whiteOnNavy.bg,
510
+ color: accessibleCombinations.whiteOnNavy.text,
511
+ }}>
512
+ Guaranteed 4.5:1+ contrast ratio
513
+ </Box>
175
514
  ```
176
515
 
177
- ## Entry Points
516
+ For the full accessibility guide and component checklist, see [docs/ACCESSIBILITY.md](./docs/ACCESSIBILITY.md) and [docs/COMPONENT_A11Y_CHECKLIST.md](./docs/COMPONENT_A11Y_CHECKLIST.md).
178
517
 
179
- | Import | Purpose |
180
- |---|---|
181
- | `@trinityui/design-system` | Full API |
182
- | `@trinityui/design-system/essentials` | Lean entry for common setup and core components |
183
- | `@trinityui/design-system/theme` | Theme-only exports |
184
- | `@trinityui/design-system/tokens` | Token-only exports |
185
- | `@trinityui/design-system/data-table` | DataTable exports (AG Grid powered) |
186
- | `@trinityui/design-system/css` | CSS file from the React package |
518
+ ---
519
+
520
+ ## Design Tokens
187
521
 
188
- ## DataTable Entry
522
+ Trinity uses a **3-tier token architecture** (2,700+ lines) spanning colors, spacing, typography, shadows, motion, z-index, border radius, opacity, breakpoints, and effects.
189
523
 
190
- `DataTable` is intentionally isolated behind a subpath:
524
+ ### Token Tiers
525
+
526
+ | Tier | Purpose | Example |
527
+ |---|---|---|
528
+ | **Base** | Raw primitive values | `baseTokens.colors.navy[900]` → `#050742` |
529
+ | **Semantic** | Contextual meaning | `semanticTokens.colors.interactive.primary` |
530
+ | **Component** | Component-level defaults | `componentTokens.card.borderRadius` → `12px` |
531
+
532
+ ### Token Coverage
533
+
534
+ | Category | What's included |
535
+ |---|---|
536
+ | **Colors** | 6 brand palettes (navy, purple, indigo, coral, azure, gray) with full shade ranges |
537
+ | **Semantic colors** | Brand, text (11 variants), background (8), surface (7), border (6), interactive (5), status (4 × 3) |
538
+ | **Spacing** | 20-step scale (0–32), component spacing, layout spacing with dimensions, density scale |
539
+ | **Typography** | 10 sizes, 6 weights, 6 line heights, 6 letter spacings, semantic scales (display/heading/body/label) |
540
+ | **Border radius** | 9-step scale (none → 9999px), semantic radius (button, input, card, modal, badge, avatar, chip, tooltip) |
541
+ | **Shadows** | 8 levels + semantic (card, dropdown, modal, button, input), effect-based (surface, dialog, inset) |
542
+ | **Motion** | 7 durations (fastest → slowest) + 7 easings (linear, bounce, elastic, etc.) |
543
+ | **Z-index** | 7 numeric levels + 7 semantic (dropdown, sticky, modal, tooltip) |
544
+ | **Effects** | Overlay, onDark states, focus rings, status indicators |
545
+
546
+ ### Usage
191
547
 
192
548
  ```tsx
193
- import { DataTable } from '@trinityui/design-system/data-table';
549
+ import { baseTokens, semanticTokens, componentTokens } from '@trinityui/design-system/tokens';
194
550
  ```
195
551
 
196
- Set your AG Grid Enterprise license key once during app bootstrap:
552
+ All tokens are also available as CSS variables:
553
+
554
+ ```css
555
+ var(--trinity-color-navy-900) /* base */
556
+ var(--trinity-card-bg) /* semantic */
557
+ var(--trinity-switch-track-height) /* component */
558
+ ```
559
+
560
+ For token usage rules, see [docs/TOKEN_USAGE_RULES.md](./docs/TOKEN_USAGE_RULES.md).
561
+
562
+ ---
563
+
564
+ ## Theme Presets
565
+
566
+ Three pre-configured theme presets for different product contexts:
567
+
568
+ | Preset | Light / Dark | Use Case |
569
+ |---|---|---|
570
+ | **CRM** | `crmLightTheme` / `crmDarkTheme` | Compact tables, dense forms, high information density |
571
+ | **Portal** | `portalLightTheme` / `portalDarkTheme` | Large touch targets, accessible sizing, customer-facing |
572
+ | **Analytics** | `analyticsLightTheme` / `analyticsDarkTheme` | Data visualization optimized, chart-friendly palette |
197
573
 
198
574
  ```tsx
199
- import { setAgGridEnterpriseLicenseKey } from '@trinityui/design-system/data-table';
575
+ import { crmLightTheme, crmDarkTheme } from '@trinityui/design-system';
200
576
 
201
- setAgGridEnterpriseLicenseKey('<AG_GRID_ENTERPRISE_LICENSE_KEY>');
577
+ <ThemeProvider theme={isDarkMode ? crmDarkTheme : crmLightTheme}>
578
+ <App />
579
+ </ThemeProvider>
202
580
  ```
203
581
 
204
- For AG Grid Enterprise licensing, coordinate with Arun Manoharan, Rahul Desai, or Sangeetha.
582
+ You can also create custom presets with `createTrinityThemePreset()`.
583
+
584
+ ---
205
585
 
206
586
  ## CSS-Only Usage
207
587
 
208
- ### Option 1: package CSS import
588
+ For Angular, Vue, or static HTML projects:
209
589
 
210
590
  ```css
591
+ /* Option 1: package import */
211
592
  @import '@trinityui/design-system-css';
212
- ```
213
-
214
- ### Option 2: direct file path
215
593
 
216
- ```html
217
- <link rel="stylesheet" href="node_modules/@trinityui/design-system-css/dist/trinity.css" />
594
+ /* Option 2: direct file path */
595
+ @import 'node_modules/@trinityui/design-system-css/dist/trinity.css';
218
596
  ```
219
597
 
220
- ### Dark mode
221
-
222
598
  ```html
599
+ <!-- Dark mode: add data-theme attribute -->
223
600
  <html data-theme="dark">
224
601
  ```
225
602
 
226
- ## Theming
603
+ All design tokens are exposed as `--trinity-*` CSS variables. See the [CSS package README](./packages/design-system-css/README.md) for the full variable reference.
227
604
 
228
- ```tsx
229
- import { lightTheme, darkTheme } from '@trinityui/design-system';
605
+ ---
230
606
 
231
- const theme = isDarkMode ? darkTheme : lightTheme;
607
+ ## Storybook
608
+
609
+ Interactive component documentation with live controls, dark mode toggle, and accessibility audits:
610
+
611
+ ```bash
612
+ pnpm run start # Opens at http://localhost:6006
232
613
  ```
233
614
 
615
+ 93 stories covering every component with:
616
+ - Live prop controls and variant previews
617
+ - Dark mode toggle for all components
618
+ - Accessibility audit panel (axe-core integration)
619
+ - Code examples with copy-to-clipboard
620
+ - Autodocs — auto-generated API documentation from TypeScript types
621
+
622
+ ---
623
+
234
624
  ## Development
235
625
 
236
626
  ```bash
237
- pnpm install
238
- pnpm run start
239
- pnpm run build
240
- pnpm run test
241
- pnpm run lint
627
+ pnpm install # Install dependencies
628
+ pnpm run start # Storybook dev server (:6006)
629
+ pnpm run dev # Vite dev server (:5173)
630
+ pnpm run build # TypeScript + Vite production build
631
+ pnpm run test # Run all tests
632
+ pnpm run test:a11y # Run accessibility tests only
633
+ pnpm run lint # ESLint
634
+ pnpm run lint:tokens # Token usage rule validation
635
+ pnpm run size # Check bundle size limits
242
636
  ```
243
637
 
244
- ## Release and Publishing
638
+ ### Release and Publishing
639
+
640
+ - Push to `main` triggers publish workflows for both `@trinityui/design-system` and `@trinityui/design-system-css`
641
+ - Version is auto-bumped if the current version is already published
642
+ - `CHANGELOG.md` is generated during the release workflow
245
643
 
246
- - Push to `main` triggers publish workflows for:
247
- - `@trinityui/design-system`
248
- - `@trinityui/design-system-css`
249
- - Version is auto-bumped if the current version is already published.
250
- - `CHANGELOG.md` is generated during release workflow.
644
+ ---
251
645
 
252
- ## Support Docs
646
+ ## Documentation
253
647
 
254
- - [MIGRATION.md](./MIGRATION.md)
255
- - [CONTRIBUTING.md](./CONTRIBUTING.md)
256
- - [CHANGELOG.md](./CHANGELOG.md)
648
+ | Document | Description |
649
+ |---|---|
650
+ | [Quick Start](./docs/QUICK_START.md) | 5-minute getting-started guide |
651
+ | [Developer Guide](./docs/DEVELOPER_GUIDE.md) | Comprehensive development reference |
652
+ | [Accessibility](./docs/ACCESSIBILITY.md) | WCAG 2.1 AA compliance guide |
653
+ | [Component A11y Checklist](./docs/COMPONENT_A11Y_CHECKLIST.md) | Per-component accessibility requirements |
654
+ | [Token Usage Rules](./docs/TOKEN_USAGE_RULES.md) | When and how to use each token tier |
655
+ | [Storybook Standards](./docs/STORYBOOK_STANDARDS.md) | Story authoring conventions |
656
+ | [Testing Strategy](./docs/TESTING_STRATEGY.md) | Unit, a11y, and visual regression testing |
657
+ | [MUI Compatibility](./docs/MUI_COMPATIBILITY.md) | MUI version support matrix |
658
+ | [Integrating into Existing Apps](./docs/TRINITY_EXISTING_APP.md) | Migration guide for existing projects |
659
+ | [New App Setup](./docs/TRINITY_NEW_APP.md) | Starting a new project with Trinity |
660
+ | [Component Picker](./docs/COMPONENT_PICKER.md) | Decision tree: which component to use |
661
+ | [Governance](./docs/GOVERNANCE.md) | Contribution process, RFC, and deprecation policy |
662
+ | [Migration](./MIGRATION.md) | Version migration guides |
663
+ | [Contributing](./CONTRIBUTING.md) | How to contribute |
664
+ | [Changelog](./CHANGELOG.md) | Release history |
665
+
666
+ ---
257
667
 
258
668
  ## License
259
669