@sreedev/my3dui 0.1.4 → 0.1.6
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 +37 -21
- package/dist/index.cjs +3671 -763
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +682 -14
- package/dist/index.d.ts +682 -14
- package/dist/index.js +3379 -695
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,11 +34,11 @@ A TypeScript React component library combining beautiful 2D UI components with c
|
|
|
34
34
|
## Installation
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
npm install my3dui react react-dom
|
|
37
|
+
npm install @sreedev/my3dui react react-dom
|
|
38
38
|
# or
|
|
39
|
-
yarn add my3dui react react-dom
|
|
39
|
+
yarn add @sreedev/my3dui react react-dom
|
|
40
40
|
# or
|
|
41
|
-
pnpm add my3dui react react-dom
|
|
41
|
+
pnpm add @sreedev/my3dui react react-dom
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
### Optional Dependencies
|
|
@@ -49,13 +49,29 @@ For 3D component support, install the following packages:
|
|
|
49
49
|
npm install three @react-three/fiber @react-three/drei
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
## Exported Components
|
|
53
|
+
|
|
54
|
+
All components are exported from the main entry. Use tree-shaking for optimal bundle size.
|
|
55
|
+
|
|
56
|
+
**Layout:** `Container`, `Grid`, `Stack`, `Section`, `PageLayout`, `Stage`, `Viewport`, `Container3D`, `Grid3D`, `CameraController`, `Scene3D`
|
|
57
|
+
|
|
58
|
+
**3D UI:** `Button3D`, `Card3D`, `Accordion3D`, `Badge3D`, `Input3D`, `Slider3D`, `Tabs3D`, `Toggle3D`, `Modal3D`, `Menu3D`, `Menu3DItem`, `Menu3DLabel`, `Menu3DSeparator`, `Tooltip3D`, `Progress3D`, `ResizablePanelGroup`, `ResizablePanel`, `ResizableHandle`, `Select3D`, `Spinner3D`, `Stepper3D`, `NavBar3D`, `Timeline3D`
|
|
59
|
+
|
|
60
|
+
**Standard UI:** `Tooltip`, `TooltipProvider`, `Slider`, `Toggle`, `Badge`, `Input`, `Select`, `Table`, `Pagination`, `Progress`, `Skeleton`, `Toast`, `Toaster`, `SonnerToaster`, `sonnerToast`, `Popover`, `Sheet`, `Dialog`, `Breadcrumb`, `Label`, `Checkbox`, `Switch`, `Textarea`, `Separator`, `ScrollArea`, `ScrollBar`, `RadioGroup`, `ToggleGroup`, `Alert`, `Avatar`, `Card`, `Collapsible`, `AspectRatio`, `HoverCard`, `AlertDialog`, `Command`, `Form`, `DropdownMenu`, `ContextMenu`, `Drawer`, `Menubar`, `NavigationMenu`, `Calendar`, `Sidebar`, `Carousel`, `InputOTP`, and subcomponents.
|
|
61
|
+
|
|
62
|
+
**Data viz:** `BarChart3D`, `LineChart3D`, `PieChart3D`, `ScatterPlot3D`, `Graph3D`, `Map3D`
|
|
63
|
+
|
|
64
|
+
**Media:** `Gallery3D`, `ModelViewer`, `VideoPlane`, `ImagePlane`, `AudioVisualizer`
|
|
65
|
+
|
|
66
|
+
**Effects:** `Particles`, `Bloom`, `Reflection`, `Fog`, `ShadowSystem`, `GlowEffect`, `WaveEffect`, `NoiseField`
|
|
67
|
+
|
|
52
68
|
## Quick Start
|
|
53
69
|
|
|
54
70
|
### Basic Button3D Component
|
|
55
71
|
|
|
56
72
|
```tsx
|
|
57
73
|
import React from 'react';
|
|
58
|
-
import { Button3D } from 'my3dui';
|
|
74
|
+
import { Button3D } from '@sreedev/my3dui';
|
|
59
75
|
|
|
60
76
|
export function MyComponent() {
|
|
61
77
|
return (
|
|
@@ -73,7 +89,7 @@ export function MyComponent() {
|
|
|
73
89
|
### Card3D Component
|
|
74
90
|
|
|
75
91
|
```tsx
|
|
76
|
-
import { Card3D } from 'my3dui';
|
|
92
|
+
import { Card3D } from '@sreedev/my3dui';
|
|
77
93
|
|
|
78
94
|
export function MyCard() {
|
|
79
95
|
return (
|
|
@@ -91,12 +107,12 @@ export function MyCard() {
|
|
|
91
107
|
|
|
92
108
|
```tsx
|
|
93
109
|
import {
|
|
94
|
-
|
|
110
|
+
Button3D,
|
|
95
111
|
Input,
|
|
96
112
|
Select,
|
|
97
113
|
Badge,
|
|
98
114
|
Card
|
|
99
|
-
} from 'my3dui';
|
|
115
|
+
} from '@sreedev/my3dui';
|
|
100
116
|
|
|
101
117
|
export function StandardUI() {
|
|
102
118
|
return (
|
|
@@ -107,7 +123,7 @@ export function StandardUI() {
|
|
|
107
123
|
<option>Option 1</option>
|
|
108
124
|
<option>Option 2</option>
|
|
109
125
|
</Select>
|
|
110
|
-
<
|
|
126
|
+
<Button3D>Submit</Button3D>
|
|
111
127
|
</div>
|
|
112
128
|
</Card>
|
|
113
129
|
);
|
|
@@ -118,11 +134,11 @@ export function StandardUI() {
|
|
|
118
134
|
|
|
119
135
|
### Using 3D Effects with Canvas
|
|
120
136
|
|
|
121
|
-
|
|
137
|
+
My3DUI 3D components require a `<Canvas>` from @react-three/fiber:
|
|
122
138
|
|
|
123
139
|
```tsx
|
|
124
140
|
import { Canvas } from '@react-three/fiber';
|
|
125
|
-
import { Bloom } from 'my3dui';
|
|
141
|
+
import { Bloom } from '@sreedev/my3dui';
|
|
126
142
|
|
|
127
143
|
export function MyScene() {
|
|
128
144
|
return (
|
|
@@ -138,7 +154,7 @@ export function MyScene() {
|
|
|
138
154
|
|
|
139
155
|
```tsx
|
|
140
156
|
import { Canvas } from '@react-three/fiber';
|
|
141
|
-
import { Bloom } from 'my3dui';
|
|
157
|
+
import { Bloom } from '@sreedev/my3dui';
|
|
142
158
|
|
|
143
159
|
export function BloomExample() {
|
|
144
160
|
return (
|
|
@@ -161,7 +177,7 @@ export function BloomExample() {
|
|
|
161
177
|
|
|
162
178
|
```tsx
|
|
163
179
|
import { Canvas } from '@react-three/fiber';
|
|
164
|
-
import { ImagePlane, VideoPlane } from 'my3dui';
|
|
180
|
+
import { ImagePlane, VideoPlane } from '@sreedev/my3dui';
|
|
165
181
|
|
|
166
182
|
export function MediaPlanes() {
|
|
167
183
|
return (
|
|
@@ -180,7 +196,7 @@ export function MediaPlanes() {
|
|
|
180
196
|
|
|
181
197
|
```tsx
|
|
182
198
|
import { Canvas } from '@react-three/fiber';
|
|
183
|
-
import { Gallery3D } from 'my3dui';
|
|
199
|
+
import { Gallery3D } from '@sreedev/my3dui';
|
|
184
200
|
|
|
185
201
|
export function MyGallery() {
|
|
186
202
|
const images = [
|
|
@@ -201,7 +217,7 @@ export function MyGallery() {
|
|
|
201
217
|
|
|
202
218
|
```tsx
|
|
203
219
|
import { Canvas } from '@react-three/fiber';
|
|
204
|
-
import { Map3D } from 'my3dui';
|
|
220
|
+
import { Map3D } from '@sreedev/my3dui';
|
|
205
221
|
|
|
206
222
|
export function InteractiveMap() {
|
|
207
223
|
return (
|
|
@@ -220,7 +236,7 @@ export function InteractiveMap() {
|
|
|
220
236
|
|
|
221
237
|
```tsx
|
|
222
238
|
import { Canvas } from '@react-three/fiber';
|
|
223
|
-
import { Particles } from 'my3dui';
|
|
239
|
+
import { Particles } from '@sreedev/my3dui';
|
|
224
240
|
|
|
225
241
|
export function ParticleEffect() {
|
|
226
242
|
return (
|
|
@@ -293,7 +309,7 @@ interface ParticlesProps {
|
|
|
293
309
|
|
|
294
310
|
### Using next-themes
|
|
295
311
|
|
|
296
|
-
|
|
312
|
+
My3DUI supports dark mode seamlessly via next-themes:
|
|
297
313
|
|
|
298
314
|
```tsx
|
|
299
315
|
import { ThemeProvider } from 'next-themes';
|
|
@@ -314,7 +330,7 @@ export function App() {
|
|
|
314
330
|
// tailwind.config.js
|
|
315
331
|
module.exports = {
|
|
316
332
|
content: [
|
|
317
|
-
'./node_modules/my3dui/**/*.{js,ts,jsx,tsx}',
|
|
333
|
+
'./node_modules/@sreedev/my3dui/**/*.{js,ts,jsx,tsx}',
|
|
318
334
|
],
|
|
319
335
|
theme: {
|
|
320
336
|
extend: {
|
|
@@ -450,14 +466,14 @@ src/
|
|
|
450
466
|
|
|
451
467
|
### From shadcn/ui
|
|
452
468
|
|
|
453
|
-
All
|
|
469
|
+
All My3DUI components maintain compatibility with shadcn/ui styling:
|
|
454
470
|
|
|
455
471
|
```tsx
|
|
456
472
|
// Before
|
|
457
473
|
import { Button } from '@/components/ui/button';
|
|
458
474
|
|
|
459
475
|
// After - with enhanced features
|
|
460
|
-
import { Button3D } from 'my3dui';
|
|
476
|
+
import { Button3D } from '@sreedev/my3dui';
|
|
461
477
|
```
|
|
462
478
|
|
|
463
479
|
### Variant Changes
|
|
@@ -484,9 +500,9 @@ For 3D features, WebGL support is required.
|
|
|
484
500
|
|
|
485
501
|
1. **Code Splitting**: Import components individually
|
|
486
502
|
```tsx
|
|
487
|
-
import { Button3D } from 'my3dui'; // Better
|
|
503
|
+
import { Button3D } from '@sreedev/my3dui'; // Better
|
|
488
504
|
// vs
|
|
489
|
-
import * as My3DUI from 'my3dui'; // Avoids this
|
|
505
|
+
import * as My3DUI from '@sreedev/my3dui'; // Avoids this
|
|
490
506
|
```
|
|
491
507
|
|
|
492
508
|
2. **Lazy Load 3D Components**: Use React.lazy for 3D canvas
|