@orion-ds/react 5.5.1 → 5.5.4
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/README.md +130 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,6 +32,58 @@ The library uses standard React APIs (`forwardRef`, `useState`, `useEffect`, `us
|
|
|
32
32
|
|
|
33
33
|
## Installation
|
|
34
34
|
|
|
35
|
+
### ⚠️ CRITICAL: @orion-ds/react is a **Runtime Dependency**, NOT a Dev Tool
|
|
36
|
+
|
|
37
|
+
**@orion-ds/react must be installed in `dependencies`**, not `devDependencies`. It contains UI components and styles needed in production.
|
|
38
|
+
|
|
39
|
+
#### ✅ CORRECT Installation
|
|
40
|
+
|
|
41
|
+
\`\`\`bash
|
|
42
|
+
npm install @orion-ds/react
|
|
43
|
+
\`\`\`
|
|
44
|
+
|
|
45
|
+
This puts it in `dependencies` where it belongs.
|
|
46
|
+
|
|
47
|
+
**Your `package.json` should show:**
|
|
48
|
+
\`\`\`json
|
|
49
|
+
{
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@orion-ds/react": "^5.5.2",
|
|
52
|
+
"react": "^19.0.0",
|
|
53
|
+
"react-dom": "^19.0.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/react": "^19.0.0",
|
|
57
|
+
"@types/react-dom": "^19.0.0",
|
|
58
|
+
"typescript": "^5.0.0"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
\`\`\`
|
|
62
|
+
|
|
63
|
+
#### ❌ WRONG: Using --save-dev (Will Break in Production!)
|
|
64
|
+
|
|
65
|
+
\`\`\`bash
|
|
66
|
+
|
|
67
|
+
# ❌ DON'T DO THIS
|
|
68
|
+
|
|
69
|
+
npm install --save-dev @orion-ds/react
|
|
70
|
+
\`\`\`
|
|
71
|
+
|
|
72
|
+
If you accidentally installed it as a dev dependency, fix it:
|
|
73
|
+
\`\`\`bash
|
|
74
|
+
npm uninstall --save-dev @orion-ds/react
|
|
75
|
+
npm install @orion-ds/react
|
|
76
|
+
\`\`\`
|
|
77
|
+
|
|
78
|
+
#### Why This Matters
|
|
79
|
+
|
|
80
|
+
| Location | Behavior | Use Case |
|
|
81
|
+
| ----------------- | ---------------------------------- | ------------------------------------- |
|
|
82
|
+
| `dependencies` | ✅ Included in production builds | **UI libraries, components, styling** |
|
|
83
|
+
| `devDependencies` | ❌ Excluded from production builds | Testing tools, linters, TypeScript |
|
|
84
|
+
|
|
85
|
+
**If @orion-ds/react is in `devDependencies`, your components will be missing from the production build!**
|
|
86
|
+
|
|
35
87
|
### Option A: npm install (Recommended)
|
|
36
88
|
|
|
37
89
|
\`\`\`bash
|
|
@@ -78,6 +130,84 @@ This single import includes:
|
|
|
78
130
|
|
|
79
131
|
> **⚠️ IMPORTANT**: Don't forget the CSS import! Without it, components will be unstyled. In development, ThemeProvider will warn you if styles are missing.
|
|
80
132
|
|
|
133
|
+
## ⚠️ Common Setup Mistakes
|
|
134
|
+
|
|
135
|
+
### Mistake 1: @orion-ds/react in devDependencies (CRITICAL!)
|
|
136
|
+
|
|
137
|
+
**❌ WRONG:**
|
|
138
|
+
\`\`\`bash
|
|
139
|
+
npm install --save-dev @orion-ds/react
|
|
140
|
+
\`\`\`
|
|
141
|
+
|
|
142
|
+
**Why it breaks**: devDependencies are excluded from production builds. Your components won't be available in production!
|
|
143
|
+
|
|
144
|
+
**✅ FIX:**
|
|
145
|
+
\`\`\`bash
|
|
146
|
+
npm uninstall --save-dev @orion-ds/react
|
|
147
|
+
npm install @orion-ds/react
|
|
148
|
+
\`\`\`
|
|
149
|
+
|
|
150
|
+
Check your `package.json` - should be in `dependencies`:
|
|
151
|
+
\`\`\`json
|
|
152
|
+
{
|
|
153
|
+
"dependencies": {
|
|
154
|
+
"@orion-ds/react": "^5.5.2" // ✅ Runtime dependency
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
\`\`\`
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
### Mistake 2: Forgot CSS imports
|
|
162
|
+
|
|
163
|
+
**❌ WRONG:**
|
|
164
|
+
\`\`\`tsx
|
|
165
|
+
import { Button, Card } from '@orion-ds/react';
|
|
166
|
+
// Forgot to import styles! Components will be unstyled
|
|
167
|
+
\`\`\`
|
|
168
|
+
|
|
169
|
+
**✅ CORRECT:**
|
|
170
|
+
\`\`\`tsx
|
|
171
|
+
import '@orion-ds/react/styles.css'; // Must come first
|
|
172
|
+
import { Button, Card } from '@orion-ds/react';
|
|
173
|
+
\`\`\`
|
|
174
|
+
|
|
175
|
+
**Or in your app entry file:**
|
|
176
|
+
\`\`\`tsx
|
|
177
|
+
// main.tsx or index.tsx (root of your app)
|
|
178
|
+
import '@orion-ds/react/styles.css';
|
|
179
|
+
import App from './App';
|
|
180
|
+
\`\`\`
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
### Mistake 3: Using Tailwind utilities alongside Orion
|
|
185
|
+
|
|
186
|
+
**❌ WRONG:**
|
|
187
|
+
\`\`\`tsx
|
|
188
|
+
<Button className="gap-4 p-8">Click me</Button>
|
|
189
|
+
\`\`\`
|
|
190
|
+
|
|
191
|
+
**Why it breaks**: Tailwind utilities (gap-_, p-_, etc.) conflict with Orion's CSS variables.
|
|
192
|
+
|
|
193
|
+
**✅ CORRECT - Use Orion tokens:**
|
|
194
|
+
\`\`\`tsx
|
|
195
|
+
<Button style={{ gap: 'var(--spacing-4)', padding: 'var(--spacing-8)' }}>
|
|
196
|
+
Click me
|
|
197
|
+
</Button>
|
|
198
|
+
\`\`\`
|
|
199
|
+
|
|
200
|
+
Or use Orion's built-in responsive system:
|
|
201
|
+
\`\`\`tsx
|
|
202
|
+
import { Stack } from '@orion-ds/react';
|
|
203
|
+
|
|
204
|
+
<Stack gap="spacing-4" padding="spacing-8">
|
|
205
|
+
<Button>Click me</Button>
|
|
206
|
+
</Stack>
|
|
207
|
+
\`\`\`
|
|
208
|
+
|
|
209
|
+
For detailed Tailwind compatibility, see [COMPATIBILITY.md](./COMPATIBILITY.md).
|
|
210
|
+
|
|
81
211
|
## Quick Start
|
|
82
212
|
|
|
83
213
|
````tsx
|
package/package.json
CHANGED