@j3m-quantum/ui 0.7.1 → 0.7.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/README.md +50 -7
- package/dist/styles/index.css +122 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -9,11 +9,12 @@ J3M Quantum UI - A themed component library based on shadcn/ui with J3M design t
|
|
|
9
9
|
- ✨ **Glass Mode** - Frosted glass effects via `.theme-glass` class
|
|
10
10
|
- 📦 **55+ Components** - All shadcn/ui components with J3M styling
|
|
11
11
|
- 🎯 **TweakCN Style** - Single CSS import for complete theming
|
|
12
|
+
- 🎬 **Smooth Animations** - Powered by tw-animate-css
|
|
12
13
|
|
|
13
14
|
## Installation
|
|
14
15
|
|
|
15
16
|
```bash
|
|
16
|
-
npm install @j3m-quantum/ui
|
|
17
|
+
npm install @j3m-quantum/ui tw-animate-css
|
|
17
18
|
```
|
|
18
19
|
|
|
19
20
|
### Peer Dependencies
|
|
@@ -27,8 +28,19 @@ npm install react react-dom tailwindcss lucide-react
|
|
|
27
28
|
Plus Radix UI primitives for each component you use:
|
|
28
29
|
|
|
29
30
|
```bash
|
|
30
|
-
#
|
|
31
|
+
# Core components
|
|
31
32
|
npm install @radix-ui/react-slot @radix-ui/react-dialog @radix-ui/react-select
|
|
33
|
+
|
|
34
|
+
# All Radix packages (if using all components)
|
|
35
|
+
npm install @radix-ui/react-accordion @radix-ui/react-alert-dialog @radix-ui/react-avatar \
|
|
36
|
+
@radix-ui/react-checkbox @radix-ui/react-collapsible @radix-ui/react-context-menu \
|
|
37
|
+
@radix-ui/react-dialog @radix-ui/react-dropdown-menu @radix-ui/react-hover-card \
|
|
38
|
+
@radix-ui/react-label @radix-ui/react-menubar @radix-ui/react-navigation-menu \
|
|
39
|
+
@radix-ui/react-popover @radix-ui/react-progress @radix-ui/react-radio-group \
|
|
40
|
+
@radix-ui/react-scroll-area @radix-ui/react-select @radix-ui/react-separator \
|
|
41
|
+
@radix-ui/react-slider @radix-ui/react-slot @radix-ui/react-switch \
|
|
42
|
+
@radix-ui/react-tabs @radix-ui/react-toggle @radix-ui/react-toggle-group \
|
|
43
|
+
@radix-ui/react-tooltip
|
|
32
44
|
```
|
|
33
45
|
|
|
34
46
|
## Quick Start
|
|
@@ -55,24 +67,34 @@ export default defineConfig({
|
|
|
55
67
|
})
|
|
56
68
|
```
|
|
57
69
|
|
|
58
|
-
### 3. Import Styles
|
|
70
|
+
### 3. Import Styles (IMPORTANT ORDER)
|
|
59
71
|
|
|
60
72
|
```css
|
|
61
73
|
/* src/index.css */
|
|
62
74
|
@import "tailwindcss";
|
|
63
|
-
@import "
|
|
75
|
+
@import "tw-animate-css"; /* Required for animations */
|
|
76
|
+
@import "@j3m-quantum/ui/styles"; /* J3M theme and tokens */
|
|
64
77
|
```
|
|
65
78
|
|
|
79
|
+
> ⚠️ **Order matters!** Import `tw-animate-css` before `@j3m-quantum/ui/styles` to ensure animations work correctly on Dialog, Sheet, Select, Popover, and other overlay components.
|
|
80
|
+
|
|
66
81
|
### 4. Use Components
|
|
67
82
|
|
|
68
83
|
```tsx
|
|
69
|
-
import { Button, Card, Input } from '@j3m-quantum/ui'
|
|
84
|
+
import { Button, Card, Input, Dialog, DialogTrigger, DialogContent } from '@j3m-quantum/ui'
|
|
70
85
|
|
|
71
86
|
function App() {
|
|
72
87
|
return (
|
|
73
88
|
<Card>
|
|
74
89
|
<Input placeholder="Enter email" />
|
|
75
|
-
<
|
|
90
|
+
<Dialog>
|
|
91
|
+
<DialogTrigger asChild>
|
|
92
|
+
<Button>Open Dialog</Button>
|
|
93
|
+
</DialogTrigger>
|
|
94
|
+
<DialogContent>
|
|
95
|
+
<p>This dialog has smooth animations!</p>
|
|
96
|
+
</DialogContent>
|
|
97
|
+
</Dialog>
|
|
76
98
|
</Card>
|
|
77
99
|
)
|
|
78
100
|
}
|
|
@@ -151,6 +173,7 @@ Override CSS variables after the import:
|
|
|
151
173
|
|
|
152
174
|
```css
|
|
153
175
|
@import "tailwindcss";
|
|
176
|
+
@import "tw-animate-css";
|
|
154
177
|
@import "@j3m-quantum/ui/styles";
|
|
155
178
|
|
|
156
179
|
/* Custom overrides */
|
|
@@ -160,7 +183,27 @@ Override CSS variables after the import:
|
|
|
160
183
|
}
|
|
161
184
|
```
|
|
162
185
|
|
|
186
|
+
## Troubleshooting
|
|
187
|
+
|
|
188
|
+
### Animations not working (Dialog, Sheet, Select, etc.)
|
|
189
|
+
Make sure you've:
|
|
190
|
+
1. Installed `tw-animate-css`: `npm install tw-animate-css`
|
|
191
|
+
2. Imported it **before** the J3M styles:
|
|
192
|
+
```css
|
|
193
|
+
@import "tw-animate-css";
|
|
194
|
+
@import "@j3m-quantum/ui/styles";
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### "Invalid hook call" error
|
|
198
|
+
If using local file links during development, add `dedupe` to your Vite config:
|
|
199
|
+
```typescript
|
|
200
|
+
export default defineConfig({
|
|
201
|
+
resolve: {
|
|
202
|
+
dedupe: ["react", "react-dom"],
|
|
203
|
+
},
|
|
204
|
+
})
|
|
205
|
+
```
|
|
206
|
+
|
|
163
207
|
## License
|
|
164
208
|
|
|
165
209
|
MIT
|
|
166
|
-
|
package/dist/styles/index.css
CHANGED
|
@@ -822,3 +822,125 @@ textarea,
|
|
|
822
822
|
.animate-spin {
|
|
823
823
|
animation: spin 1s linear infinite;
|
|
824
824
|
}
|
|
825
|
+
|
|
826
|
+
/* ========================================
|
|
827
|
+
DATA-STATE ANIMATION VARIANTS
|
|
828
|
+
For Radix UI components (Dialog, Select, Popover, etc.)
|
|
829
|
+
These match Tailwind's data-[state=*] variants
|
|
830
|
+
======================================== */
|
|
831
|
+
|
|
832
|
+
/* Open state - apply enter animation */
|
|
833
|
+
[data-state="open"].animate-in,
|
|
834
|
+
[data-state="open"] .animate-in {
|
|
835
|
+
animation-name: enter;
|
|
836
|
+
animation-duration: 150ms;
|
|
837
|
+
animation-timing-function: ease-out;
|
|
838
|
+
animation-fill-mode: forwards;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
/* Closed state - apply exit animation */
|
|
842
|
+
[data-state="closed"].animate-out,
|
|
843
|
+
[data-state="closed"] .animate-out {
|
|
844
|
+
animation-name: exit;
|
|
845
|
+
animation-duration: 150ms;
|
|
846
|
+
animation-timing-function: ease-in;
|
|
847
|
+
animation-fill-mode: forwards;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
/* Fade in/out with data-state */
|
|
851
|
+
[data-state="open"].fade-in-0,
|
|
852
|
+
[data-state="open"] .fade-in-0 { --tw-enter-opacity: 0; }
|
|
853
|
+
|
|
854
|
+
[data-state="closed"].fade-out-0,
|
|
855
|
+
[data-state="closed"] .fade-out-0 { --tw-exit-opacity: 0; }
|
|
856
|
+
|
|
857
|
+
/* Zoom in/out with data-state */
|
|
858
|
+
[data-state="open"].zoom-in-95,
|
|
859
|
+
[data-state="open"] .zoom-in-95 { --tw-enter-scale: 0.95; }
|
|
860
|
+
|
|
861
|
+
[data-state="open"].zoom-in-90,
|
|
862
|
+
[data-state="open"] .zoom-in-90 { --tw-enter-scale: 0.90; }
|
|
863
|
+
|
|
864
|
+
[data-state="closed"].zoom-out-95,
|
|
865
|
+
[data-state="closed"] .zoom-out-95 { --tw-exit-scale: 0.95; }
|
|
866
|
+
|
|
867
|
+
[data-state="closed"].zoom-out-90,
|
|
868
|
+
[data-state="closed"] .zoom-out-90 { --tw-exit-scale: 0.90; }
|
|
869
|
+
|
|
870
|
+
/* Slide in from directions with data-state */
|
|
871
|
+
[data-state="open"].slide-in-from-top-2,
|
|
872
|
+
[data-state="open"] .slide-in-from-top-2,
|
|
873
|
+
[data-side="bottom"].slide-in-from-top-2 { --tw-enter-translate-y: -0.5rem; }
|
|
874
|
+
|
|
875
|
+
[data-state="open"].slide-in-from-bottom-2,
|
|
876
|
+
[data-state="open"] .slide-in-from-bottom-2,
|
|
877
|
+
[data-side="top"].slide-in-from-bottom-2 { --tw-enter-translate-y: 0.5rem; }
|
|
878
|
+
|
|
879
|
+
[data-state="open"].slide-in-from-left-2,
|
|
880
|
+
[data-state="open"] .slide-in-from-left-2,
|
|
881
|
+
[data-side="right"].slide-in-from-left-2 { --tw-enter-translate-x: -0.5rem; }
|
|
882
|
+
|
|
883
|
+
[data-state="open"].slide-in-from-right-2,
|
|
884
|
+
[data-state="open"] .slide-in-from-right-2,
|
|
885
|
+
[data-side="left"].slide-in-from-right-2 { --tw-enter-translate-x: 0.5rem; }
|
|
886
|
+
|
|
887
|
+
/* Sheet/Drawer slide animations */
|
|
888
|
+
[data-state="open"].slide-in-from-right,
|
|
889
|
+
[data-state="open"] .slide-in-from-right { --tw-enter-translate-x: 100%; }
|
|
890
|
+
|
|
891
|
+
[data-state="open"].slide-in-from-left,
|
|
892
|
+
[data-state="open"] .slide-in-from-left { --tw-enter-translate-x: -100%; }
|
|
893
|
+
|
|
894
|
+
[data-state="open"].slide-in-from-top,
|
|
895
|
+
[data-state="open"] .slide-in-from-top { --tw-enter-translate-y: -100%; }
|
|
896
|
+
|
|
897
|
+
[data-state="open"].slide-in-from-bottom,
|
|
898
|
+
[data-state="open"] .slide-in-from-bottom { --tw-enter-translate-y: 100%; }
|
|
899
|
+
|
|
900
|
+
[data-state="closed"].slide-out-to-right,
|
|
901
|
+
[data-state="closed"] .slide-out-to-right { --tw-exit-translate-x: 100%; }
|
|
902
|
+
|
|
903
|
+
[data-state="closed"].slide-out-to-left,
|
|
904
|
+
[data-state="closed"] .slide-out-to-left { --tw-exit-translate-x: -100%; }
|
|
905
|
+
|
|
906
|
+
[data-state="closed"].slide-out-to-top,
|
|
907
|
+
[data-state="closed"] .slide-out-to-top { --tw-exit-translate-y: -100%; }
|
|
908
|
+
|
|
909
|
+
[data-state="closed"].slide-out-to-bottom,
|
|
910
|
+
[data-state="closed"] .slide-out-to-bottom { --tw-exit-translate-y: 100%; }
|
|
911
|
+
|
|
912
|
+
/* Navigation menu motion variants */
|
|
913
|
+
[data-motion^="from-"].animate-in,
|
|
914
|
+
[data-motion="from-start"].slide-in-from-left-52 { --tw-enter-translate-x: -13rem; }
|
|
915
|
+
[data-motion="from-end"].slide-in-from-right-52 { --tw-enter-translate-x: 13rem; }
|
|
916
|
+
|
|
917
|
+
[data-motion^="to-"].animate-out,
|
|
918
|
+
[data-motion="to-start"].slide-out-to-left-52 { --tw-exit-translate-x: -13rem; }
|
|
919
|
+
[data-motion="to-end"].slide-out-to-right-52 { --tw-exit-translate-x: 13rem; }
|
|
920
|
+
|
|
921
|
+
/* Data-side variants (for popovers, dropdowns, tooltips) */
|
|
922
|
+
[data-side="bottom"] {
|
|
923
|
+
--tw-enter-translate-y: -0.5rem;
|
|
924
|
+
}
|
|
925
|
+
[data-side="top"] {
|
|
926
|
+
--tw-enter-translate-y: 0.5rem;
|
|
927
|
+
}
|
|
928
|
+
[data-side="left"] {
|
|
929
|
+
--tw-enter-translate-x: 0.5rem;
|
|
930
|
+
}
|
|
931
|
+
[data-side="right"] {
|
|
932
|
+
--tw-enter-translate-x: -0.5rem;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
/* Visible/hidden states (for NavigationMenu indicator) */
|
|
936
|
+
[data-state="visible"].animate-in,
|
|
937
|
+
[data-state="visible"] .animate-in {
|
|
938
|
+
animation-name: enter;
|
|
939
|
+
animation-duration: 150ms;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
[data-state="hidden"].animate-out,
|
|
943
|
+
[data-state="hidden"] .animate-out {
|
|
944
|
+
animation-name: exit;
|
|
945
|
+
animation-duration: 150ms;
|
|
946
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@j3m-quantum/ui",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "J3M UI Component Library - themed shadcn/ui components with design tokens",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"react": ">=18",
|
|
54
54
|
"react-dom": ">=18",
|
|
55
55
|
"tailwindcss": ">=4",
|
|
56
|
+
"tw-animate-css": "^1.0.0",
|
|
56
57
|
"@radix-ui/react-accordion": "^1.2.0",
|
|
57
58
|
"@radix-ui/react-alert-dialog": "^1.1.0",
|
|
58
59
|
"@radix-ui/react-aspect-ratio": "^1.1.0",
|