@orion-ds/react 2.0.0 → 2.0.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 (76) hide show
  1. package/AI_COMPONENTS.md +68 -1
  2. package/AI_QUICKREF.md +1 -1
  3. package/README.md +111 -15
  4. package/dist/components/Chat/Chat.d.ts +45 -0
  5. package/dist/components/Chat/Chat.d.ts.map +1 -0
  6. package/dist/components/Chat/Chat.types.d.ts +392 -0
  7. package/dist/components/Chat/Chat.types.d.ts.map +1 -0
  8. package/dist/components/Chat/components/ChatAttachment.d.ts +10 -0
  9. package/dist/components/Chat/components/ChatAttachment.d.ts.map +1 -0
  10. package/dist/components/Chat/components/ChatAudioPlayer.d.ts +9 -0
  11. package/dist/components/Chat/components/ChatAudioPlayer.d.ts.map +1 -0
  12. package/dist/components/Chat/components/ChatCodeBlock.d.ts +10 -0
  13. package/dist/components/Chat/components/ChatCodeBlock.d.ts.map +1 -0
  14. package/dist/components/Chat/components/ChatFileUpload.d.ts +9 -0
  15. package/dist/components/Chat/components/ChatFileUpload.d.ts.map +1 -0
  16. package/dist/components/Chat/components/ChatHeader.d.ts +9 -0
  17. package/dist/components/Chat/components/ChatHeader.d.ts.map +1 -0
  18. package/dist/components/Chat/components/ChatImagePreview.d.ts +9 -0
  19. package/dist/components/Chat/components/ChatImagePreview.d.ts.map +1 -0
  20. package/dist/components/Chat/components/ChatInput.d.ts +10 -0
  21. package/dist/components/Chat/components/ChatInput.d.ts.map +1 -0
  22. package/dist/components/Chat/components/ChatLightbox.d.ts +9 -0
  23. package/dist/components/Chat/components/ChatLightbox.d.ts.map +1 -0
  24. package/dist/components/Chat/components/ChatMarkdown.d.ts +10 -0
  25. package/dist/components/Chat/components/ChatMarkdown.d.ts.map +1 -0
  26. package/dist/components/Chat/components/ChatMessage.d.ts +10 -0
  27. package/dist/components/Chat/components/ChatMessage.d.ts.map +1 -0
  28. package/dist/components/Chat/components/ChatMessages.d.ts +10 -0
  29. package/dist/components/Chat/components/ChatMessages.d.ts.map +1 -0
  30. package/dist/components/Chat/components/ChatSidebar.d.ts +10 -0
  31. package/dist/components/Chat/components/ChatSidebar.d.ts.map +1 -0
  32. package/dist/components/Chat/components/ChatTypingIndicator.d.ts +14 -0
  33. package/dist/components/Chat/components/ChatTypingIndicator.d.ts.map +1 -0
  34. package/dist/components/Chat/components/ChatVoiceRecorder.d.ts +9 -0
  35. package/dist/components/Chat/components/ChatVoiceRecorder.d.ts.map +1 -0
  36. package/dist/components/Chat/components/index.d.ts +18 -0
  37. package/dist/components/Chat/components/index.d.ts.map +1 -0
  38. package/dist/components/Chat/hooks/index.d.ts +12 -0
  39. package/dist/components/Chat/hooks/index.d.ts.map +1 -0
  40. package/dist/components/Chat/hooks/useAutoScroll.d.ts +24 -0
  41. package/dist/components/Chat/hooks/useAutoScroll.d.ts.map +1 -0
  42. package/dist/components/Chat/hooks/useChatInput.d.ts +43 -0
  43. package/dist/components/Chat/hooks/useChatInput.d.ts.map +1 -0
  44. package/dist/components/Chat/hooks/useStreamingText.d.ts +22 -0
  45. package/dist/components/Chat/hooks/useStreamingText.d.ts.map +1 -0
  46. package/dist/components/Chat/hooks/useVoiceRecorder.d.ts +31 -0
  47. package/dist/components/Chat/hooks/useVoiceRecorder.d.ts.map +1 -0
  48. package/dist/components/Chat/index.d.ts +28 -0
  49. package/dist/components/Chat/index.d.ts.map +1 -0
  50. package/dist/components/Chat/utils.d.ts +16 -0
  51. package/dist/components/Chat/utils.d.ts.map +1 -0
  52. package/dist/components/index.d.ts +3 -0
  53. package/dist/components/index.d.ts.map +1 -1
  54. package/dist/docs/DocComponents.d.ts +60 -0
  55. package/dist/docs/DocComponents.d.ts.map +1 -0
  56. package/dist/index.cjs +60 -24
  57. package/dist/index.cjs.map +1 -1
  58. package/dist/index.d.ts +4 -0
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.mjs +51573 -18518
  61. package/dist/index.mjs.map +1 -1
  62. package/dist/react.css +1 -1
  63. package/dist/sections/Chat/ChatSection.d.ts +22 -0
  64. package/dist/sections/Chat/ChatSection.d.ts.map +1 -0
  65. package/dist/sections/Chat/index.d.ts +19 -0
  66. package/dist/sections/Chat/index.d.ts.map +1 -0
  67. package/dist/sections/index.d.ts +2 -0
  68. package/dist/sections/index.d.ts.map +1 -1
  69. package/dist/styles.css +65 -57
  70. package/dist/templates/app/ChatPageTemplate/ChatPageTemplate.d.ts +21 -0
  71. package/dist/templates/app/ChatPageTemplate/ChatPageTemplate.d.ts.map +1 -0
  72. package/dist/templates/app/ChatPageTemplate/index.d.ts +19 -0
  73. package/dist/templates/app/ChatPageTemplate/index.d.ts.map +1 -0
  74. package/dist/templates/app/index.d.ts +2 -0
  75. package/dist/templates/app/index.d.ts.map +1 -1
  76. package/package.json +6 -2
package/AI_COMPONENTS.md CHANGED
@@ -187,6 +187,13 @@ Use these for landing pages, marketing sites, and product pages. **DO NOT create
187
187
  | `Container` | Constrain content width |
188
188
  | `Section` | Vertical section with spacing |
189
189
 
190
+ ### AI Chat Sections
191
+
192
+ | Section | Use When | Required Props |
193
+ |---------|----------|----------------|
194
+ | `ChatSection` | Chat UI with sidebar | `messages`, `onSendMessage` |
195
+ | `ChatPageTemplate` | Full-page chat app | `messages`, `onSendMessage` |
196
+
190
197
  ---
191
198
 
192
199
  ## Complete Landing Page Example
@@ -478,6 +485,66 @@ Some components use the compound pattern with dot notation:
478
485
  </Drawer>
479
486
  ```
480
487
 
488
+ ### Chat (AI Chat Interface)
489
+
490
+ Full-featured chat interface with multimodal support (text, images, audio, files, code).
491
+
492
+ ```tsx
493
+ <Chat>
494
+ <Chat.Header title="AI Assistant" subtitle="Online" />
495
+ <Chat.Messages>
496
+ {messages.map(msg => (
497
+ <Chat.Message
498
+ key={msg.id}
499
+ role={msg.role}
500
+ content={msg.content}
501
+ timestamp={msg.timestamp}
502
+ attachments={msg.attachments}
503
+ />
504
+ ))}
505
+ {isTyping && <Chat.TypingIndicator />}
506
+ </Chat.Messages>
507
+ <Chat.Input
508
+ onSend={handleSend}
509
+ allowAttachments
510
+ allowVoiceRecording
511
+ />
512
+ </Chat>
513
+ ```
514
+
515
+ **Chat Sub-components:**
516
+ - `Chat.Header` - Title, avatar, and actions
517
+ - `Chat.Messages` - Scrollable message container with auto-scroll
518
+ - `Chat.Message` - Individual message (user/assistant/system)
519
+ - `Chat.Input` - Multi-line input with attachments and voice
520
+ - `Chat.TypingIndicator` - Animated "typing" dots
521
+ - `Chat.CodeBlock` - Syntax-highlighted code
522
+ - `Chat.Markdown` - Markdown rendering
523
+ - `Chat.ImagePreview` - Image with lightbox
524
+ - `Chat.AudioPlayer` - Audio playback
525
+ - `Chat.VoiceRecorder` - Voice recording
526
+ - `Chat.FileUpload` - Drag-and-drop file upload
527
+ - `Chat.Attachment` - Attachment preview
528
+ - `Chat.Sidebar` - Conversation history list
529
+
530
+ **Pre-built Sections:**
531
+ - `ChatSection` - Chat with sidebar layout
532
+ - `ChatPageTemplate` - Full-page ChatGPT-style layout
533
+
534
+ ```tsx
535
+ // Full-page template (ChatGPT-style)
536
+ <ChatPageTemplate
537
+ conversations={conversations}
538
+ activeConversationId={activeId}
539
+ messages={messages}
540
+ onSendMessage={handleSend}
541
+ onSelectConversation={handleSelect}
542
+ onNewConversation={handleNew}
543
+ isTyping={isTyping}
544
+ user={{ name: 'John', avatar: '...' }}
545
+ />
546
+ ```
547
+
481
548
  ---
482
549
 
483
550
  ## Icons (Lucide)
@@ -535,7 +602,7 @@ function ThemeSwitcher() {
535
602
  }
536
603
  ```
537
604
 
538
- **Available brands:** `orion`, `red`, `deepblue`, `orange`
605
+ **Available brands:** `orion`, `red`, `deepblue`, `orange`, `lemon`
539
606
  **Available themes:** `light`, `dark`
540
607
 
541
608
  ---
package/AI_QUICKREF.md CHANGED
@@ -46,7 +46,7 @@ import { Search } from 'lucide-react';
46
46
  ## Theme Switching
47
47
  ```tsx
48
48
  const { theme, brand, setTheme, setBrand } = useThemeContext();
49
- // brands: orion, red, deepblue, orange
49
+ // brands: orion, red, deepblue, orange, lemon
50
50
  // themes: light, dark
51
51
  ```
52
52
 
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # @orion/react
1
+ # @orion-ds/react
2
2
 
3
- > **Orion Design System** - React Component Library
3
+ > **Orion Design System** - AI-First React Component Library
4
4
 
5
- TypeScript-first React component library built on the Orion Design System tokens. Features 22 production-ready components with full type safety, theme switching, and multi-brand support.
5
+ TypeScript-first React component library built on the Orion Design System. Features 40+ components, 30+ sections, and 9 page templates with full type safety, theme switching, and multi-brand support.
6
6
 
7
7
  [![TypeScript](https://img.shields.io/badge/TypeScript-100%25-blue)](https://www.typescriptlang.org/)
8
8
  [![Tests](https://img.shields.io/badge/tests-passing-brightgreen)](#)
@@ -10,18 +10,20 @@ TypeScript-first React component library built on the Orion Design System tokens
10
10
 
11
11
  ## Features
12
12
 
13
- - **22 TypeScript Components** - Fully typed with IntelliSense support
13
+ - 🤖 **AI-First Design** - Optimized for AI/LLM code generation (see AI_GUIDE.md)
14
+ - ✅ **40+ Components** - Fully typed with IntelliSense support
15
+ - 📐 **30+ Sections** - Pre-built page sections (Hero, Features, Pricing, etc.)
16
+ - 📄 **9 Templates** - Complete page templates (Landing, Dashboard, Profile, etc.)
14
17
  - 🎨 **Theme Switching** - Light/Dark modes with CSS variables
15
- - 🏢 **Multi-Brand** - Orion, UVM, Unitec, Laureate brands
16
- - 🎯 **Lucide Icons** - 5000+ icons built-in (icon support in Button, Field, Alert, etc.)
17
- - ♿ **Accessible** - WCAG AA compliant, keyboard navigation
18
- - 📦 **Tree-Shakeable** - Import only what you need (ESM + CJS)
19
- - 🎭 **CSS Modules** - Scoped styling, no conflicts
20
- - 🧪 **Tested** - 19+ unit tests with Vitest
21
- - 📚 **Documented** - 50+ Storybook stories
18
+ - 🏢 **Multi-Brand** - orion, red, deepblue, orange, lemon brands
19
+ - 🎯 **Lucide Icons** - 5000+ icons built-in
20
+ - ♿ **Accessible** - WCAG AA compliant
21
+ - 📦 **Tree-Shakeable** - ESM + CJS
22
22
 
23
23
  ## Installation
24
24
 
25
+ ### Option A: npm install (full library)
26
+
25
27
  \`\`\`bash
26
28
  npm install @orion-ds/react @orion-ds/core
27
29
  # or
@@ -32,6 +34,18 @@ yarn add @orion-ds/react @orion-ds/core
32
34
 
33
35
  > **Note**: `@orion-ds/core` is a peer dependency that must be installed alongside `@orion-ds/react`.
34
36
 
37
+ ### Option B: CLI copy (own the code)
38
+
39
+ Copy individual components into your project, shadcn-style. You own the source and can modify freely.
40
+
41
+ \`\`\`bash
42
+ npx @orion-ds/cli init # Creates orion.json, installs @orion-ds/core
43
+ npx @orion-ds/cli add button card modal # Copies component source files
44
+ npx @orion-ds/cli list # Shows all 90 available items
45
+ \`\`\`
46
+
47
+ See [@orion-ds/cli README](../cli/README.md) for full documentation.
48
+
35
49
  ## CSS Setup
36
50
 
37
51
  ### Option 1: Single Import (Recommended)
@@ -88,6 +102,18 @@ function MyApp() {
88
102
  }
89
103
  \`\`\`
90
104
 
105
+ ## AI / LLM Integration
106
+
107
+ This library is optimized for AI code generation. When using with Claude, Cursor, Copilot, or other AI tools:
108
+
109
+ | Document | Purpose |
110
+ |----------|---------|
111
+ | `AI_GUIDE.md` | Complete integration guide, decision trees, anti-patterns |
112
+ | `AI_QUICKREF.md` | Quick reference for common patterns |
113
+ | `AI_COMPONENTS.md` | All components with examples |
114
+
115
+ These files are included in the npm package.
116
+
91
117
  ## Google Fonts (Automatic)
92
118
 
93
119
  **Fonts are loaded automatically by `ThemeProvider`** (since v1.1.4). No manual setup required!
@@ -180,12 +206,58 @@ if (missing.length > 0) {
180
206
  - **ThemeController** - Theme & brand selector
181
207
  - **useTheme** - Theme management hook
182
208
 
209
+ ## Sections
210
+
211
+ Pre-built page sections for rapid development:
212
+
213
+ | Category | Sections |
214
+ |----------|----------|
215
+ | **Marketing** | Hero, Features, Pricing, CTA, Testimonials, FAQ, Footer |
216
+ | **App** | Sidebar, Header, DetailPanel, StatCards |
217
+ | **Content** | ArticleContent, MediaGallery, Timeline |
218
+
219
+ \`\`\`tsx
220
+ import { Hero, Features, Pricing } from '@orion-ds/react';
221
+
222
+ <Hero title="Welcome" description="Build faster" />
223
+ <Features items={[...]} columns={3} />
224
+ <Pricing plans={[...]} />
225
+ \`\`\`
226
+
227
+ [View all 30+ sections in AI_COMPONENTS.md](./AI_COMPONENTS.md)
228
+
229
+ ## Templates
230
+
231
+ Complete page templates ready to use:
232
+
233
+ | Template | Use Case |
234
+ |----------|----------|
235
+ | `LandingPageTemplate` | Marketing landing pages |
236
+ | `DashboardTemplate` | Admin dashboards |
237
+ | `ProfilePageTemplate` | User profile pages |
238
+ | `SettingsTemplate` | Settings pages |
239
+ | `LoginTemplate` | Authentication pages |
240
+ | `OnboardingTemplate` | User onboarding flows |
241
+ | `NotFoundTemplate` | 404 error pages |
242
+ | `MaintenanceTemplate` | Maintenance pages |
243
+ | `ComingSoonTemplate` | Pre-launch pages |
244
+
245
+ \`\`\`tsx
246
+ import { LandingPageTemplate } from '@orion-ds/react';
247
+
248
+ <LandingPageTemplate
249
+ hero={{ title: 'Welcome', description: '...' }}
250
+ features={{ items: [...] }}
251
+ pricing={{ plans: [...] }}
252
+ />
253
+ \`\`\`
254
+
183
255
  ## Lucide Icons
184
256
 
185
257
  All components support **Lucide icons** - 5000+ beautiful, consistent icons.
186
258
 
187
259
  \`\`\`tsx
188
- import { Button, Field, Alert } from '@orion/react';
260
+ import { Button, Field, Alert } from '@orion-ds/react';
189
261
  import { Search, Download, AlertCircle } from 'lucide-react';
190
262
 
191
263
  // Icon in button (left side)
@@ -217,7 +289,7 @@ See [LUCIDE_ICONS.md](./LUCIDE_ICONS.md) for complete icon documentation.
217
289
  ### Using the Hook
218
290
 
219
291
  \`\`\`tsx
220
- import { useTheme } from '@orion/react';
292
+ import { useTheme } from '@orion-ds/react';
221
293
 
222
294
  function ThemeSwitcher() {
223
295
  const { theme, brand, setTheme, setBrand, toggleTheme } = useTheme();
@@ -227,14 +299,38 @@ function ThemeSwitcher() {
227
299
  <button onClick={toggleTheme}>
228
300
  Current: {theme}
229
301
  </button>
230
- <button onClick={() => setBrand('uvm')}>
231
- Switch to UVM Brand
302
+ <button onClick={() => setBrand('deepblue')}>
303
+ Switch to Deepblue Brand
232
304
  </button>
233
305
  </>
234
306
  );
235
307
  }
236
308
  \`\`\`
237
309
 
310
+ ## v2.0.0 Migration Guide
311
+
312
+ ### Breaking Changes
313
+
314
+ #### Hero & CTA: `headline` → `title`
315
+ \`\`\`diff
316
+ - <Hero headline="Welcome" description="..." />
317
+ + <Hero title="Welcome" description="..." />
318
+ \`\`\`
319
+
320
+ #### DetailPanel: `subtitle` → `description`
321
+ \`\`\`diff
322
+ - <DetailPanel title="Edit" subtitle="User profile" />
323
+ + <DetailPanel title="Edit" description="User profile" />
324
+ \`\`\`
325
+
326
+ #### ThemeProvider: Flat Props (Optional)
327
+ \`\`\`diff
328
+ - <ThemeProvider options={{ defaultBrand: 'red' }}>
329
+ + <ThemeProvider defaultBrand="red">
330
+ \`\`\`
331
+
332
+ > **Backward Compatibility**: The old props still work but show deprecation warnings in development.
333
+
238
334
  ## License
239
335
 
240
336
  MIT © Orion Team
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Chat Component
3
+ *
4
+ * A flexible compound component for building AI chat interfaces.
5
+ * Supports multimodal content including text, images, audio, files, and code.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * <Chat>
10
+ * <Chat.Header title="AI Assistant" />
11
+ * <Chat.Messages>
12
+ * {messages.map(msg => (
13
+ * <Chat.Message
14
+ * key={msg.id}
15
+ * role={msg.role}
16
+ * content={msg.content}
17
+ * />
18
+ * ))}
19
+ * {isTyping && <Chat.TypingIndicator />}
20
+ * </Chat.Messages>
21
+ * <Chat.Input onSend={handleSend} />
22
+ * </Chat>
23
+ * ```
24
+ */
25
+ import React from 'react';
26
+ import type { ChatProps } from './Chat.types';
27
+ import { ChatMessage, ChatMessages, ChatInput, ChatHeader, ChatTypingIndicator, ChatCodeBlock, ChatMarkdown, ChatImagePreview, ChatAudioPlayer, ChatVoiceRecorder, ChatFileUpload, ChatAttachment, ChatSidebar } from './components';
28
+ type ChatComponent = React.FC<ChatProps> & {
29
+ Header: typeof ChatHeader;
30
+ Messages: typeof ChatMessages;
31
+ Message: typeof ChatMessage;
32
+ Input: typeof ChatInput;
33
+ TypingIndicator: typeof ChatTypingIndicator;
34
+ CodeBlock: typeof ChatCodeBlock;
35
+ Markdown: typeof ChatMarkdown;
36
+ ImagePreview: typeof ChatImagePreview;
37
+ AudioPlayer: typeof ChatAudioPlayer;
38
+ VoiceRecorder: typeof ChatVoiceRecorder;
39
+ FileUpload: typeof ChatFileUpload;
40
+ Attachment: typeof ChatAttachment;
41
+ Sidebar: typeof ChatSidebar;
42
+ };
43
+ export declare const Chat: ChatComponent;
44
+ export {};
45
+ //# sourceMappingURL=Chat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Chat.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,WAAW,EACZ,MAAM,cAAc,CAAC;AAwBtB,KAAK,aAAa,GAAG,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG;IACzC,MAAM,EAAE,OAAO,UAAU,CAAC;IAC1B,QAAQ,EAAE,OAAO,YAAY,CAAC;IAC9B,OAAO,EAAE,OAAO,WAAW,CAAC;IAC5B,KAAK,EAAE,OAAO,SAAS,CAAC;IACxB,eAAe,EAAE,OAAO,mBAAmB,CAAC;IAC5C,SAAS,EAAE,OAAO,aAAa,CAAC;IAChC,QAAQ,EAAE,OAAO,YAAY,CAAC;IAC9B,YAAY,EAAE,OAAO,gBAAgB,CAAC;IACtC,WAAW,EAAE,OAAO,eAAe,CAAC;IACpC,aAAa,EAAE,OAAO,iBAAiB,CAAC;IACxC,UAAU,EAAE,OAAO,cAAc,CAAC;IAClC,UAAU,EAAE,OAAO,cAAc,CAAC;IAClC,OAAO,EAAE,OAAO,WAAW,CAAC;CAC7B,CAAC;AAGF,eAAO,MAAM,IAAI,EAAe,aAAa,CAAC"}