@orion-ds/react 1.2.1 → 1.2.3
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.
- package/AI_COMPONENTS.md +651 -0
- package/AI_QUICKREF.md +59 -0
- package/README.md +16 -1
- package/dist/contexts/ThemeContext.d.ts +7 -1
- package/dist/contexts/ThemeContext.d.ts.map +1 -1
- package/dist/index.cjs +24 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +14 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1887 -1864
- package/dist/index.mjs.map +1 -1
- package/dist/react.css +1 -1
- package/package.json +16 -2
package/AI_COMPONENTS.md
ADDED
|
@@ -0,0 +1,651 @@
|
|
|
1
|
+
# @orion/react AI Component Guide
|
|
2
|
+
|
|
3
|
+
> **READ THIS FIRST** before generating any React code with Orion Design System.
|
|
4
|
+
|
|
5
|
+
This document is the authoritative reference for AI agents building UIs with @orion/react. It prevents hallucination by providing a complete inventory of available components and sections.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Quick Start (Required Setup)
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
// 1. REQUIRED: Import both CSS files
|
|
13
|
+
import '@orion/core/theme.css'; // Design tokens
|
|
14
|
+
import '@orion/react/dist/react.css'; // Component styles
|
|
15
|
+
|
|
16
|
+
// 2. REQUIRED: Wrap app with ThemeProvider
|
|
17
|
+
import { ThemeProvider } from '@orion/react';
|
|
18
|
+
|
|
19
|
+
function App() {
|
|
20
|
+
return (
|
|
21
|
+
<ThemeProvider>
|
|
22
|
+
<YourComponents />
|
|
23
|
+
</ThemeProvider>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Missing CSS = Unstyled Components.** Both imports are mandatory.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Anti-Hallucination Rules
|
|
33
|
+
|
|
34
|
+
### NEVER Do These
|
|
35
|
+
|
|
36
|
+
| Rule | Bad Example | Why It's Wrong |
|
|
37
|
+
|------|-------------|----------------|
|
|
38
|
+
| Pass `brand` prop to components | `<Button brand="red">` | Brand is GLOBAL, set on ThemeProvider |
|
|
39
|
+
| Pass `theme` prop to components | `<Card theme="dark">` | Theme is GLOBAL, set on ThemeProvider |
|
|
40
|
+
| Hardcode colors | `style={{ color: '#1B5BFF' }}` | Use CSS variables: `var(--text-brand)` |
|
|
41
|
+
| Hardcode pixels | `style={{ padding: '16px' }}` | Use tokens: `var(--spacing-4)` |
|
|
42
|
+
| Create custom sections | `<MyHeroSection>` | Use pre-built: `<Hero>` |
|
|
43
|
+
| Invent component variants | `<Button variant="success">` | Only: primary, secondary, ghost, danger |
|
|
44
|
+
| Skip ThemeProvider | Render components without provider | Will cause hydration/context errors |
|
|
45
|
+
| Use children in Field | `<Field><input /></Field>` | Field is self-contained, use props |
|
|
46
|
+
|
|
47
|
+
### ALWAYS Do These
|
|
48
|
+
|
|
49
|
+
| Rule | Good Example |
|
|
50
|
+
|------|--------------|
|
|
51
|
+
| Import both CSS files | `import '@orion/core/theme.css'; import '@orion/react/dist/react.css';` |
|
|
52
|
+
| Wrap with ThemeProvider | `<ThemeProvider><App /></ThemeProvider>` |
|
|
53
|
+
| Use pre-built sections | `<Hero>`, `<Features>`, `<Pricing>`, `<CTA>`, `<Footer>` |
|
|
54
|
+
| Use CSS variables | `style={{ color: 'var(--text-primary)' }}` |
|
|
55
|
+
| Add aria-label for icon-only | `<Button iconOnly icon={<X />} aria-label="Close" />` |
|
|
56
|
+
| Check this doc first | Before creating ANY component |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Component Inventory
|
|
61
|
+
|
|
62
|
+
### Actions
|
|
63
|
+
|
|
64
|
+
| Component | Use When | Variants |
|
|
65
|
+
|-----------|----------|----------|
|
|
66
|
+
| `Button` | User triggers an action | `primary`, `secondary`, `ghost`, `danger` |
|
|
67
|
+
| `Link` | Navigation to another page/section | `default`, `subtle`, `brand` |
|
|
68
|
+
|
|
69
|
+
### Forms
|
|
70
|
+
|
|
71
|
+
| Component | Use When | Key Props |
|
|
72
|
+
|-----------|----------|-----------|
|
|
73
|
+
| `Field` | Single-line text input with label | `label`, `error`, `helperText`, `leftIcon`, `rightIcon` |
|
|
74
|
+
| `Textarea` | Multi-line text input | `label`, `error`, `resize` |
|
|
75
|
+
| `Select` | Dropdown selection | `options`, `label`, `placeholder` |
|
|
76
|
+
| `Checkbox` | Boolean toggle with label | `label`, `checked`, `indeterminate` |
|
|
77
|
+
| `Radio` | Single choice from options | `label`, `name`, `value` |
|
|
78
|
+
| `Switch` | On/off toggle | `label`, `checked` |
|
|
79
|
+
| `SearchInput` | Search with icon | `placeholder`, `onSearch` |
|
|
80
|
+
| `Slider` | Range/value selection | `min`, `max`, `value` |
|
|
81
|
+
| `Combobox` | Autocomplete/typeahead | `options`, `onSelect` |
|
|
82
|
+
|
|
83
|
+
### Layout
|
|
84
|
+
|
|
85
|
+
| Component | Use When | Variants |
|
|
86
|
+
|-----------|----------|----------|
|
|
87
|
+
| `Card` | Container for related content | `base`, `glass`, `elevated`, `outlined`, `image` |
|
|
88
|
+
| `Divider` | Visual separation | `solid`, `dashed`, `dotted` |
|
|
89
|
+
| `Accordion` | Collapsible content sections | `default`, `bordered`, `separated` |
|
|
90
|
+
|
|
91
|
+
### Feedback
|
|
92
|
+
|
|
93
|
+
| Component | Use When | Variants |
|
|
94
|
+
|-----------|----------|----------|
|
|
95
|
+
| `Alert` | System messages/notifications | `info`, `success`, `warning`, `error` |
|
|
96
|
+
| `Badge` | Status indicators, counts | `default`, `success`, `warning`, `error`, `brand` |
|
|
97
|
+
| `Spinner` | Loading state | `default`, `brand` |
|
|
98
|
+
| `ProgressBar` | Progress indication | `default`, `success`, `brand` |
|
|
99
|
+
| `Tooltip` | Hover information | Position: `top`, `bottom`, `left`, `right` |
|
|
100
|
+
| `Toast` | Temporary notifications | `info`, `success`, `warning`, `error` |
|
|
101
|
+
| `Skeleton` | Loading placeholder | `text`, `circle`, `rectangle` |
|
|
102
|
+
| `EmptyState` | No data available | `sm`, `md`, `lg` |
|
|
103
|
+
|
|
104
|
+
### Navigation
|
|
105
|
+
|
|
106
|
+
| Component | Use When | Key Props |
|
|
107
|
+
|-----------|----------|-----------|
|
|
108
|
+
| `Navbar` | Site/app header | `variant`: `solid`, `transparent`, `glass` |
|
|
109
|
+
| `Tabs` | Content switching | `items`, `activeTab` |
|
|
110
|
+
| `Breadcrumb` | Location hierarchy | `items`, `separator` |
|
|
111
|
+
| `Pagination` | Page navigation | `total`, `current`, `onPageChange` |
|
|
112
|
+
| `Stepper` | Multi-step processes | `steps`, `current` |
|
|
113
|
+
|
|
114
|
+
### Overlays
|
|
115
|
+
|
|
116
|
+
| Component | Use When | Key Props |
|
|
117
|
+
|-----------|----------|-----------|
|
|
118
|
+
| `Modal` | Dialogs, confirmations | `isOpen`, `onClose`, `size` |
|
|
119
|
+
| `Drawer` | Side panels | `isOpen`, `placement`, `size` |
|
|
120
|
+
| `Popover` | Contextual content | `trigger`, `content` |
|
|
121
|
+
| `Dropdown` | Action menus | `items`, `trigger` |
|
|
122
|
+
|
|
123
|
+
### Data Display
|
|
124
|
+
|
|
125
|
+
| Component | Use When | Key Props |
|
|
126
|
+
|-----------|----------|-----------|
|
|
127
|
+
| `Avatar` | User/entity images | `src`, `name`, `size` |
|
|
128
|
+
| `Table` | Tabular data | `columns`, `data`, `sortable` |
|
|
129
|
+
| `List` | Vertical item lists | `items`, `variant` |
|
|
130
|
+
| `Chip` | Tags, filters | `variant`, `onRemove` |
|
|
131
|
+
|
|
132
|
+
### Utilities
|
|
133
|
+
|
|
134
|
+
| Component | Use When |
|
|
135
|
+
|-----------|----------|
|
|
136
|
+
| `ThemeController` | Theme/brand switcher UI |
|
|
137
|
+
| `FontLoader` | Ensure fonts are loaded |
|
|
138
|
+
| `Icon` | Render Lucide icons |
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Pre-built Sections Inventory
|
|
143
|
+
|
|
144
|
+
Use these for landing pages, marketing sites, and product pages. **DO NOT create custom equivalents.**
|
|
145
|
+
|
|
146
|
+
### Core Sections (Landing Pages)
|
|
147
|
+
|
|
148
|
+
| Section | Use When | Required Props |
|
|
149
|
+
|---------|----------|----------------|
|
|
150
|
+
| `Hero` | Landing page header | `headline` |
|
|
151
|
+
| `Features` | Feature showcase | `items` |
|
|
152
|
+
| `CTA` | Call-to-action block | `headline` |
|
|
153
|
+
| `Footer` | Page footer | `brand`, `linkGroups` |
|
|
154
|
+
|
|
155
|
+
### Engagement Sections
|
|
156
|
+
|
|
157
|
+
| Section | Use When | Required Props |
|
|
158
|
+
|---------|----------|----------------|
|
|
159
|
+
| `Pricing` | Pricing tiers | `plans` |
|
|
160
|
+
| `Testimonials` | Customer quotes | `items` |
|
|
161
|
+
| `Stats` | Key metrics | `items` |
|
|
162
|
+
| `FAQ` | Common questions | `items` |
|
|
163
|
+
| `Carousel` | Image/content slider | `items` |
|
|
164
|
+
|
|
165
|
+
### Content Sections
|
|
166
|
+
|
|
167
|
+
| Section | Use When | Required Props |
|
|
168
|
+
|---------|----------|----------------|
|
|
169
|
+
| `Team` | Team members | `members` |
|
|
170
|
+
| `Contact` | Contact form | `onSubmit` |
|
|
171
|
+
| `Newsletter` | Email signup | `onSubmit` |
|
|
172
|
+
| `LogoCloud` | Partner/client logos | `logos` |
|
|
173
|
+
| `Blog` | Article previews | `articles` |
|
|
174
|
+
| `Gallery` | Image gallery | `images` |
|
|
175
|
+
| `Timeline` | Chronological events | `events` |
|
|
176
|
+
| `Comparison` | Feature comparison | `features`, `columns` |
|
|
177
|
+
| `Banner` | Announcements | `children` |
|
|
178
|
+
| `SocialProof` | Trust indicators | At least one of: `logos`, `testimonials`, `stats` |
|
|
179
|
+
| `AppDownload` | App store links | `badges` |
|
|
180
|
+
|
|
181
|
+
### Layout Utilities
|
|
182
|
+
|
|
183
|
+
| Component | Use When |
|
|
184
|
+
|-----------|----------|
|
|
185
|
+
| `Container` | Constrain content width |
|
|
186
|
+
| `Section` | Vertical section with spacing |
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Complete Landing Page Example
|
|
191
|
+
|
|
192
|
+
Copy this template for any landing page:
|
|
193
|
+
|
|
194
|
+
```tsx
|
|
195
|
+
import {
|
|
196
|
+
// Provider
|
|
197
|
+
ThemeProvider,
|
|
198
|
+
// Components
|
|
199
|
+
Button,
|
|
200
|
+
Badge,
|
|
201
|
+
Navbar,
|
|
202
|
+
// Sections
|
|
203
|
+
Hero,
|
|
204
|
+
Features,
|
|
205
|
+
Pricing,
|
|
206
|
+
Testimonials,
|
|
207
|
+
FAQ,
|
|
208
|
+
CTA,
|
|
209
|
+
Footer,
|
|
210
|
+
} from '@orion/react';
|
|
211
|
+
import { Zap, Shield, Rocket, Star } from 'lucide-react';
|
|
212
|
+
|
|
213
|
+
// REQUIRED CSS
|
|
214
|
+
import '@orion/core/theme.css';
|
|
215
|
+
import '@orion/react/dist/react.css';
|
|
216
|
+
|
|
217
|
+
function LandingPage() {
|
|
218
|
+
return (
|
|
219
|
+
<ThemeProvider>
|
|
220
|
+
{/* Navigation */}
|
|
221
|
+
<Navbar variant="solid" sticky>
|
|
222
|
+
<Navbar.Brand href="/">
|
|
223
|
+
<img src="/logo.svg" alt="Acme" height={32} />
|
|
224
|
+
</Navbar.Brand>
|
|
225
|
+
<Navbar.Nav>
|
|
226
|
+
<Navbar.Link href="#features">Features</Navbar.Link>
|
|
227
|
+
<Navbar.Link href="#pricing">Pricing</Navbar.Link>
|
|
228
|
+
<Navbar.Link href="#faq">FAQ</Navbar.Link>
|
|
229
|
+
</Navbar.Nav>
|
|
230
|
+
<Navbar.Actions>
|
|
231
|
+
<Button variant="ghost">Sign In</Button>
|
|
232
|
+
<Button variant="primary">Get Started</Button>
|
|
233
|
+
</Navbar.Actions>
|
|
234
|
+
</Navbar>
|
|
235
|
+
|
|
236
|
+
{/* Hero Section */}
|
|
237
|
+
<Hero
|
|
238
|
+
badge={<Badge variant="brand">New Release</Badge>}
|
|
239
|
+
headline="Build Products Faster Than Ever"
|
|
240
|
+
description="The AI-first design system that eliminates guesswork and accelerates development."
|
|
241
|
+
primaryAction={<Button size="lg">Start Free Trial</Button>}
|
|
242
|
+
secondaryAction={<Button variant="ghost" size="lg">Watch Demo</Button>}
|
|
243
|
+
align="center"
|
|
244
|
+
size="lg"
|
|
245
|
+
/>
|
|
246
|
+
|
|
247
|
+
{/* Features Section */}
|
|
248
|
+
<Features
|
|
249
|
+
eyebrow="Features"
|
|
250
|
+
title="Everything you need"
|
|
251
|
+
description="Built for modern teams who ship fast."
|
|
252
|
+
items={[
|
|
253
|
+
{
|
|
254
|
+
icon: <Zap size={24} />,
|
|
255
|
+
title: 'Lightning Fast',
|
|
256
|
+
description: 'Optimized for speed at every level.',
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
icon: <Shield size={24} />,
|
|
260
|
+
title: 'Secure by Default',
|
|
261
|
+
description: 'Enterprise-grade security built in.',
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
icon: <Rocket size={24} />,
|
|
265
|
+
title: 'Scale Infinitely',
|
|
266
|
+
description: 'Grows with your business needs.',
|
|
267
|
+
},
|
|
268
|
+
]}
|
|
269
|
+
columns={3}
|
|
270
|
+
/>
|
|
271
|
+
|
|
272
|
+
{/* Pricing Section */}
|
|
273
|
+
<Pricing
|
|
274
|
+
eyebrow="Pricing"
|
|
275
|
+
title="Simple, transparent pricing"
|
|
276
|
+
description="No hidden fees. Cancel anytime."
|
|
277
|
+
plans={[
|
|
278
|
+
{
|
|
279
|
+
name: 'Starter',
|
|
280
|
+
price: '$9',
|
|
281
|
+
period: '/month',
|
|
282
|
+
description: 'Perfect for individuals',
|
|
283
|
+
features: [
|
|
284
|
+
{ text: '5 projects', included: true },
|
|
285
|
+
{ text: 'Basic analytics', included: true },
|
|
286
|
+
{ text: 'Email support', included: true },
|
|
287
|
+
{ text: 'API access', included: false },
|
|
288
|
+
],
|
|
289
|
+
action: <Button variant="secondary" fullWidth>Get Started</Button>,
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
name: 'Pro',
|
|
293
|
+
price: '$29',
|
|
294
|
+
period: '/month',
|
|
295
|
+
description: 'For growing teams',
|
|
296
|
+
features: [
|
|
297
|
+
{ text: 'Unlimited projects', included: true },
|
|
298
|
+
{ text: 'Advanced analytics', included: true },
|
|
299
|
+
{ text: 'Priority support', included: true },
|
|
300
|
+
{ text: 'API access', included: true },
|
|
301
|
+
],
|
|
302
|
+
action: <Button variant="primary" fullWidth>Start Free Trial</Button>,
|
|
303
|
+
popular: true,
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: 'Enterprise',
|
|
307
|
+
price: 'Custom',
|
|
308
|
+
description: 'For large organizations',
|
|
309
|
+
features: [
|
|
310
|
+
{ text: 'Everything in Pro', included: true },
|
|
311
|
+
{ text: 'Custom integrations', included: true },
|
|
312
|
+
{ text: 'Dedicated support', included: true },
|
|
313
|
+
{ text: 'SLA guarantee', included: true },
|
|
314
|
+
],
|
|
315
|
+
action: <Button variant="secondary" fullWidth>Contact Sales</Button>,
|
|
316
|
+
},
|
|
317
|
+
]}
|
|
318
|
+
/>
|
|
319
|
+
|
|
320
|
+
{/* Testimonials Section */}
|
|
321
|
+
<Testimonials
|
|
322
|
+
eyebrow="Testimonials"
|
|
323
|
+
title="Loved by teams worldwide"
|
|
324
|
+
testimonials={[
|
|
325
|
+
{
|
|
326
|
+
quote: "This transformed how we build products. Shipped 3x faster.",
|
|
327
|
+
author: {
|
|
328
|
+
name: 'Sarah Chen',
|
|
329
|
+
role: 'CTO',
|
|
330
|
+
company: 'TechCorp',
|
|
331
|
+
avatar: <img src="/avatars/sarah.jpg" alt="" />,
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
quote: "The best design system we've ever used. Period.",
|
|
336
|
+
author: {
|
|
337
|
+
name: 'Mike Johnson',
|
|
338
|
+
role: 'Lead Designer',
|
|
339
|
+
company: 'StartupXYZ',
|
|
340
|
+
avatar: <img src="/avatars/mike.jpg" alt="" />,
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
]}
|
|
344
|
+
/>
|
|
345
|
+
|
|
346
|
+
{/* FAQ Section */}
|
|
347
|
+
<FAQ
|
|
348
|
+
eyebrow="FAQ"
|
|
349
|
+
title="Common questions"
|
|
350
|
+
items={[
|
|
351
|
+
{
|
|
352
|
+
question: 'How do I get started?',
|
|
353
|
+
answer: 'Sign up for a free trial and follow our quick start guide.',
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
question: 'Can I cancel anytime?',
|
|
357
|
+
answer: 'Yes, you can cancel your subscription at any time with no penalties.',
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
question: 'Is there a free tier?',
|
|
361
|
+
answer: 'Yes! Our Starter plan is free for individual use.',
|
|
362
|
+
},
|
|
363
|
+
]}
|
|
364
|
+
/>
|
|
365
|
+
|
|
366
|
+
{/* CTA Section */}
|
|
367
|
+
<CTA
|
|
368
|
+
headline="Ready to get started?"
|
|
369
|
+
description="Join thousands of teams building with Orion."
|
|
370
|
+
actions={
|
|
371
|
+
<>
|
|
372
|
+
<Button size="lg">Start Free Trial</Button>
|
|
373
|
+
<Button variant="ghost" size="lg">Talk to Sales</Button>
|
|
374
|
+
</>
|
|
375
|
+
}
|
|
376
|
+
/>
|
|
377
|
+
|
|
378
|
+
{/* Footer */}
|
|
379
|
+
<Footer
|
|
380
|
+
brand={{
|
|
381
|
+
name: 'Acme Inc',
|
|
382
|
+
logo: '/logo.svg',
|
|
383
|
+
description: 'Building the future of design systems.',
|
|
384
|
+
}}
|
|
385
|
+
linkGroups={[
|
|
386
|
+
{
|
|
387
|
+
title: 'Product',
|
|
388
|
+
links: [
|
|
389
|
+
{ label: 'Features', href: '#features' },
|
|
390
|
+
{ label: 'Pricing', href: '#pricing' },
|
|
391
|
+
{ label: 'Changelog', href: '/changelog' },
|
|
392
|
+
],
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
title: 'Company',
|
|
396
|
+
links: [
|
|
397
|
+
{ label: 'About', href: '/about' },
|
|
398
|
+
{ label: 'Blog', href: '/blog' },
|
|
399
|
+
{ label: 'Careers', href: '/careers' },
|
|
400
|
+
],
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
title: 'Legal',
|
|
404
|
+
links: [
|
|
405
|
+
{ label: 'Privacy', href: '/privacy' },
|
|
406
|
+
{ label: 'Terms', href: '/terms' },
|
|
407
|
+
],
|
|
408
|
+
},
|
|
409
|
+
]}
|
|
410
|
+
socialLinks={[
|
|
411
|
+
{ label: 'Twitter', href: 'https://twitter.com/acme', icon: <Twitter /> },
|
|
412
|
+
{ label: 'GitHub', href: 'https://github.com/acme', icon: <Github /> },
|
|
413
|
+
{ label: 'LinkedIn', href: 'https://linkedin.com/company/acme', icon: <Linkedin /> },
|
|
414
|
+
]}
|
|
415
|
+
copyright="2024 Acme Inc. All rights reserved."
|
|
416
|
+
/>
|
|
417
|
+
</ThemeProvider>
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export default LandingPage;
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
## Compound Components Pattern
|
|
427
|
+
|
|
428
|
+
Some components use the compound pattern with dot notation:
|
|
429
|
+
|
|
430
|
+
### Card
|
|
431
|
+
|
|
432
|
+
```tsx
|
|
433
|
+
<Card variant="base">
|
|
434
|
+
<Card.Header>Title</Card.Header>
|
|
435
|
+
<Card.Body>Content goes here</Card.Body>
|
|
436
|
+
<Card.Footer>Footer actions</Card.Footer>
|
|
437
|
+
</Card>
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
### Navbar
|
|
441
|
+
|
|
442
|
+
```tsx
|
|
443
|
+
<Navbar variant="solid" sticky>
|
|
444
|
+
<Navbar.Brand href="/">Logo</Navbar.Brand>
|
|
445
|
+
<Navbar.Nav>
|
|
446
|
+
<Navbar.Link href="/features">Features</Navbar.Link>
|
|
447
|
+
<Navbar.Link href="/pricing">Pricing</Navbar.Link>
|
|
448
|
+
</Navbar.Nav>
|
|
449
|
+
<Navbar.Actions>
|
|
450
|
+
<Button>Sign In</Button>
|
|
451
|
+
</Navbar.Actions>
|
|
452
|
+
</Navbar>
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
### Modal
|
|
456
|
+
|
|
457
|
+
```tsx
|
|
458
|
+
<Modal isOpen={isOpen} onClose={handleClose}>
|
|
459
|
+
<Modal.Header>Confirm Action</Modal.Header>
|
|
460
|
+
<Modal.Body>Are you sure you want to proceed?</Modal.Body>
|
|
461
|
+
<Modal.Footer>
|
|
462
|
+
<Button variant="ghost" onClick={handleClose}>Cancel</Button>
|
|
463
|
+
<Button variant="primary" onClick={handleConfirm}>Confirm</Button>
|
|
464
|
+
</Modal.Footer>
|
|
465
|
+
</Modal>
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### Drawer
|
|
469
|
+
|
|
470
|
+
```tsx
|
|
471
|
+
<Drawer isOpen={isOpen} onClose={handleClose} placement="right">
|
|
472
|
+
<Drawer.Header>Settings</Drawer.Header>
|
|
473
|
+
<Drawer.Body>Settings content</Drawer.Body>
|
|
474
|
+
<Drawer.Footer>
|
|
475
|
+
<Button onClick={handleClose}>Close</Button>
|
|
476
|
+
</Drawer.Footer>
|
|
477
|
+
</Drawer>
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## Icons (Lucide)
|
|
483
|
+
|
|
484
|
+
All icons come from [Lucide](https://lucide.dev). Import directly:
|
|
485
|
+
|
|
486
|
+
```tsx
|
|
487
|
+
import { Search, Settings, User, ChevronDown } from 'lucide-react';
|
|
488
|
+
|
|
489
|
+
// Use with Button
|
|
490
|
+
<Button icon={<Search size={20} />}>Search</Button>
|
|
491
|
+
<Button iconOnly icon={<Settings size={20} />} aria-label="Settings" />
|
|
492
|
+
|
|
493
|
+
// Use with Field
|
|
494
|
+
<Field leftIcon={<Search size={18} />} placeholder="Search..." />
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
**Common icons:**
|
|
498
|
+
- Navigation: `Menu`, `X`, `ChevronDown`, `ChevronRight`, `ArrowLeft`
|
|
499
|
+
- Actions: `Plus`, `Minus`, `Check`, `Copy`, `Download`, `Trash2`, `Edit`
|
|
500
|
+
- Status: `AlertCircle`, `CheckCircle`, `XCircle`, `Info`
|
|
501
|
+
- User: `User`, `LogIn`, `LogOut`, `Settings`
|
|
502
|
+
|
|
503
|
+
---
|
|
504
|
+
|
|
505
|
+
## Theme & Brand (Global Only)
|
|
506
|
+
|
|
507
|
+
Theme and brand are **always global**. Set them on ThemeProvider, not on individual components.
|
|
508
|
+
|
|
509
|
+
```tsx
|
|
510
|
+
// Set default brand and theme
|
|
511
|
+
<ThemeProvider options={{ defaultBrand: 'red', defaultTheme: 'dark' }}>
|
|
512
|
+
<App />
|
|
513
|
+
</ThemeProvider>
|
|
514
|
+
|
|
515
|
+
// Access/change theme in any component
|
|
516
|
+
import { useThemeContext } from '@orion/react';
|
|
517
|
+
|
|
518
|
+
function ThemeSwitcher() {
|
|
519
|
+
const { theme, brand, setTheme, setBrand } = useThemeContext();
|
|
520
|
+
|
|
521
|
+
return (
|
|
522
|
+
<>
|
|
523
|
+
<button onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}>
|
|
524
|
+
Toggle Theme
|
|
525
|
+
</button>
|
|
526
|
+
<button onClick={() => setBrand('deepblue')}>
|
|
527
|
+
Switch to DeepBlue
|
|
528
|
+
</button>
|
|
529
|
+
</>
|
|
530
|
+
);
|
|
531
|
+
}
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
**Available brands:** `orion`, `red`, `deepblue`, `orange`
|
|
535
|
+
**Available themes:** `light`, `dark`
|
|
536
|
+
|
|
537
|
+
---
|
|
538
|
+
|
|
539
|
+
## Mode-Aware Styling
|
|
540
|
+
|
|
541
|
+
Components automatically adapt to the current mode (`display`, `product`, `app`):
|
|
542
|
+
|
|
543
|
+
| Mode | Context | Button Height | Visual Style |
|
|
544
|
+
|------|---------|---------------|--------------|
|
|
545
|
+
| `display` | Marketing pages | 56px | Atmospheric, hover lifts |
|
|
546
|
+
| `product` | Dashboards | 32px | Flat, minimal motion |
|
|
547
|
+
| `app` | Mobile apps | 44px | Tactile, subtle lifts |
|
|
548
|
+
|
|
549
|
+
Set mode on the HTML element:
|
|
550
|
+
```html
|
|
551
|
+
<html data-mode="display">
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
Or via ThemeProvider:
|
|
555
|
+
```tsx
|
|
556
|
+
<ThemeProvider options={{ defaultMode: 'display' }}>
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
---
|
|
560
|
+
|
|
561
|
+
## Common Mistakes & Fixes
|
|
562
|
+
|
|
563
|
+
### Missing Styles
|
|
564
|
+
|
|
565
|
+
**Problem:** Components render but look unstyled.
|
|
566
|
+
|
|
567
|
+
**Fix:** Ensure both CSS imports are present:
|
|
568
|
+
```tsx
|
|
569
|
+
import '@orion/core/theme.css';
|
|
570
|
+
import '@orion/react/dist/react.css';
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
### Brand Prop on Components
|
|
574
|
+
|
|
575
|
+
**Problem:** `<Button brand="red">` doesn't work.
|
|
576
|
+
|
|
577
|
+
**Fix:** Brand is global. Use ThemeProvider:
|
|
578
|
+
```tsx
|
|
579
|
+
<ThemeProvider options={{ defaultBrand: 'red' }}>
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
### Custom Section Components
|
|
583
|
+
|
|
584
|
+
**Problem:** Created `<MyHero>` instead of using `<Hero>`.
|
|
585
|
+
|
|
586
|
+
**Fix:** Always use pre-built sections from this inventory.
|
|
587
|
+
|
|
588
|
+
### Icon-Only Button Without Label
|
|
589
|
+
|
|
590
|
+
**Problem:** `<Button iconOnly icon={<X />} />` - no accessibility.
|
|
591
|
+
|
|
592
|
+
**Fix:** Always add aria-label:
|
|
593
|
+
```tsx
|
|
594
|
+
<Button iconOnly icon={<X size={20} />} aria-label="Close" />
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
### Using Field Children
|
|
598
|
+
|
|
599
|
+
**Problem:** `<Field><input /></Field>` - Field isn't a wrapper.
|
|
600
|
+
|
|
601
|
+
**Fix:** Field is self-contained:
|
|
602
|
+
```tsx
|
|
603
|
+
<Field label="Email" type="email" placeholder="Enter email" />
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
---
|
|
607
|
+
|
|
608
|
+
## Quick Reference Card
|
|
609
|
+
|
|
610
|
+
```
|
|
611
|
+
IMPORTS (Required):
|
|
612
|
+
import '@orion/core/theme.css';
|
|
613
|
+
import '@orion/react/dist/react.css';
|
|
614
|
+
import { ThemeProvider, Button, ... } from '@orion/react';
|
|
615
|
+
|
|
616
|
+
LANDING PAGE SECTIONS (In Order):
|
|
617
|
+
<Navbar> - Navigation header
|
|
618
|
+
<Hero> - Main headline + CTA
|
|
619
|
+
<LogoCloud> - Trust logos (optional)
|
|
620
|
+
<Features> - Feature showcase
|
|
621
|
+
<Stats> - Key metrics (optional)
|
|
622
|
+
<Pricing> - Pricing tiers
|
|
623
|
+
<Testimonials> - Customer quotes
|
|
624
|
+
<FAQ> - Common questions
|
|
625
|
+
<CTA> - Final call-to-action
|
|
626
|
+
<Footer> - Links + copyright
|
|
627
|
+
|
|
628
|
+
BUTTON VARIANTS:
|
|
629
|
+
primary - Main CTA (Submit, Save)
|
|
630
|
+
secondary - Supporting action (Cancel)
|
|
631
|
+
ghost - Subtle action (Close)
|
|
632
|
+
danger - Destructive (Delete)
|
|
633
|
+
|
|
634
|
+
CARD VARIANTS:
|
|
635
|
+
base - Standard container
|
|
636
|
+
glass - Frosted glass (Display mode only)
|
|
637
|
+
elevated - Shadow elevation
|
|
638
|
+
outlined - Border only
|
|
639
|
+
image - Background image
|
|
640
|
+
|
|
641
|
+
ALERT VARIANTS:
|
|
642
|
+
info, success, warning, error
|
|
643
|
+
|
|
644
|
+
THEME CONTROL:
|
|
645
|
+
const { theme, brand, setTheme, setBrand } = useThemeContext();
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
---
|
|
649
|
+
|
|
650
|
+
**Last Updated:** 2024
|
|
651
|
+
**Version:** 1.0.0
|
package/AI_QUICKREF.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Orion DS - AI Quick Reference
|
|
2
|
+
|
|
3
|
+
## Setup (Required)
|
|
4
|
+
```tsx
|
|
5
|
+
import '@orion-ds/core/theme.css';
|
|
6
|
+
import '@orion-ds/react/dist/react.css';
|
|
7
|
+
import { ThemeProvider } from '@orion-ds/react';
|
|
8
|
+
|
|
9
|
+
<ThemeProvider>
|
|
10
|
+
<App />
|
|
11
|
+
</ThemeProvider>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Core Components
|
|
15
|
+
Button, Card, Field, Select, Switch, Checkbox, Radio, Textarea, SearchInput, Slider, Combobox
|
|
16
|
+
|
|
17
|
+
## Layout
|
|
18
|
+
Navbar, Modal, Drawer, Tabs, Breadcrumb, Container, Section, Accordion, Divider, Popover, Dropdown
|
|
19
|
+
|
|
20
|
+
## Feedback
|
|
21
|
+
Alert, Badge, Spinner, ProgressBar, Tooltip, Toast, Skeleton, EmptyState
|
|
22
|
+
|
|
23
|
+
## Data Display
|
|
24
|
+
Avatar, Table, List, Chip, Pagination, Stepper
|
|
25
|
+
|
|
26
|
+
## Sections (Landing Pages)
|
|
27
|
+
Hero, Features, CTA, Footer, Pricing, Testimonials, Stats, FAQ, Carousel, Team, Contact, Newsletter, LogoCloud, Blog, Gallery, Timeline, Comparison, Banner, SocialProof, AppDownload
|
|
28
|
+
|
|
29
|
+
## Icon Usage
|
|
30
|
+
```tsx
|
|
31
|
+
import { Search } from 'lucide-react';
|
|
32
|
+
<Button icon={<Search size={20} />}>Search</Button>
|
|
33
|
+
<Button iconOnly icon={<Search size={20} />} aria-label="Search" />
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Theme Switching
|
|
37
|
+
```tsx
|
|
38
|
+
const { theme, brand, setTheme, setBrand } = useThemeContext();
|
|
39
|
+
// brands: orion, red, deepblue, orange
|
|
40
|
+
// themes: light, dark
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Button Variants
|
|
44
|
+
`primary` | `secondary` | `ghost` | `danger`
|
|
45
|
+
|
|
46
|
+
## Card Variants
|
|
47
|
+
`base` | `glass` | `elevated` | `outlined` | `image`
|
|
48
|
+
|
|
49
|
+
## Alert Variants
|
|
50
|
+
`info` | `success` | `warning` | `error`
|
|
51
|
+
|
|
52
|
+
## Anti-Hallucination Rules
|
|
53
|
+
- NEVER pass `brand` or `theme` props to components (they're global)
|
|
54
|
+
- NEVER hardcode colors (`#fff`) - use `var(--text-primary)`
|
|
55
|
+
- NEVER skip ThemeProvider wrapper
|
|
56
|
+
- ALWAYS import both CSS files
|
|
57
|
+
- ALWAYS add `aria-label` to iconOnly buttons
|
|
58
|
+
|
|
59
|
+
## Full docs: AI_COMPONENTS.md
|