@moontra/moonui 2.4.5 → 2.4.7

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 CHANGED
@@ -9,24 +9,28 @@ A premium React component library built for modern web applications. MoonUI prov
9
9
  ## ✨ Features
10
10
 
11
11
  ### 🎨 **Beautiful Design**
12
+
12
13
  - **50+ Premium Components** - Carefully crafted with attention to detail
13
14
  - **Modern Aesthetics** - Clean, minimalist design that works everywhere
14
15
  - **Consistent Typography** - Harmonious text hierarchy and spacing
15
16
  - **Smooth Animations** - Delightful micro-interactions powered by Framer Motion
16
17
 
17
18
  ### 🌙 **Dark Mode Ready**
19
+
18
20
  - **Built-in Dark Mode** - Seamless light/dark theme switching
19
21
  - **CSS Variables** - Easy customization with design tokens
20
22
  - **Theme Provider** - Consistent theming across your application
21
23
  - **Custom Themes** - Create your own color palettes
22
24
 
23
25
  ### ♿ **Accessibility First**
26
+
24
27
  - **WCAG Compliant** - Meets accessibility standards
25
28
  - **Keyboard Navigation** - Full keyboard support
26
29
  - **Screen Reader Friendly** - Proper ARIA labels and descriptions
27
30
  - **Focus Management** - Intuitive focus handling
28
31
 
29
32
  ### 🔧 **Developer Experience**
33
+
30
34
  - **TypeScript** - Full type safety and IntelliSense
31
35
  - **Tree Shaking** - Import only what you use
32
36
  - **Zero Config** - Works out of the box
@@ -34,6 +38,7 @@ A premium React component library built for modern web applications. MoonUI prov
34
38
  - **Storybook** - Interactive component documentation
35
39
 
36
40
  ### 📱 **Responsive & Performance**
41
+
37
42
  - **Mobile First** - Optimized for all screen sizes
38
43
  - **Lightweight** - Minimal bundle impact
39
44
  - **React 18+ Compatible** - Latest React features
@@ -57,22 +62,30 @@ For quick prototyping or artifact environments:
57
62
 
58
63
  ```html
59
64
  <!-- Dependencies -->
60
- <script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
61
- <script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
65
+ <script
66
+ crossorigin
67
+ src="https://unpkg.com/react@18/umd/react.production.min.js"
68
+ ></script>
69
+ <script
70
+ crossorigin
71
+ src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"
72
+ ></script>
62
73
 
63
74
  <!-- MoonUI -->
64
75
  <script src="https://cdn.jsdelivr.net/npm/@moontra/moonui@2.3.2/dist/index.global.js"></script>
65
76
 
66
77
  <script>
67
- const { Button, Card } = window.MoonUI;
68
-
69
- function App() {
70
- return React.createElement(Card, null,
71
- React.createElement(Button, { variant: 'default' }, 'Hello MoonUI!')
72
- );
73
- }
74
-
75
- ReactDOM.render(React.createElement(App), document.getElementById('root'));
78
+ const { Button, Card } = window.MoonUI;
79
+
80
+ function App() {
81
+ return React.createElement(
82
+ Card,
83
+ null,
84
+ React.createElement(Button, { variant: "default" }, "Hello MoonUI!")
85
+ );
86
+ }
87
+
88
+ ReactDOM.render(React.createElement(App), document.getElementById("root"));
76
89
  </script>
77
90
  ```
78
91
 
@@ -83,21 +96,21 @@ For quick prototyping or artifact environments:
83
96
  ```javascript
84
97
  // tailwind.config.js
85
98
  module.exports = {
86
- content: [
87
- "./src/**/*.{js,ts,jsx,tsx}",
88
- "./node_modules/@moontra/moonui/**/*.{js,mjs}"
89
- ],
90
- theme: {
91
- extend: {},
92
- },
93
- plugins: [],
94
- }
99
+ content: [
100
+ "./src/**/*.{js,ts,jsx,tsx}",
101
+ "./node_modules/@moontra/moonui/**/*.{js,mjs}",
102
+ ],
103
+ theme: {
104
+ extend: {},
105
+ },
106
+ plugins: [],
107
+ };
95
108
  ```
96
109
 
97
110
  2. **Import styles** (in your main CSS file)
98
111
 
99
112
  ```css
100
- @import '@moontra/moonui/styles';
113
+ @import "@moontra/moonui/styles";
101
114
  @tailwind base;
102
115
  @tailwind components;
103
116
  @tailwind utilities;
@@ -106,38 +119,41 @@ module.exports = {
106
119
  3. **Start using components**
107
120
 
108
121
  ```jsx
109
- import { Button, Card, Input } from '@moontra/moonui';
122
+ import { Button, Card, Input } from "@moontra/moonui";
110
123
 
111
124
  function App() {
112
- return (
113
- <Card className="p-6">
114
- <h1 className="text-2xl font-bold mb-4">Welcome to MoonUI</h1>
115
- <div className="space-y-4">
116
- <Input placeholder="Enter your name" />
117
- <Button variant="default" size="lg">
118
- Get Started
119
- </Button>
120
- </div>
121
- </Card>
122
- );
125
+ return (
126
+ <Card className="p-6">
127
+ <h1 className="text-2xl font-bold mb-4">Welcome to MoonUI</h1>
128
+ <div className="space-y-4">
129
+ <Input placeholder="Enter your name" />
130
+ <Button variant="default" size="lg">
131
+ Get Started
132
+ </Button>
133
+ </div>
134
+ </Card>
135
+ );
123
136
  }
124
137
  ```
125
138
 
126
139
  ## 📚 Components
127
140
 
128
141
  ### Layout & Structure
142
+
129
143
  - **Card** - Flexible content containers
130
144
  - **Separator** - Visual content dividers
131
145
  - **AspectRatio** - Responsive aspect ratio containers
132
146
  - **ScrollArea** - Custom scrollable areas
133
147
 
134
148
  ### Navigation
149
+
135
150
  - **Breadcrumb** - Hierarchical navigation
136
151
  - **Pagination** - Page navigation controls
137
152
  - **Tabs** - Tabbed interfaces
138
153
  - **Navigation Menu** - Complex navigation structures
139
154
 
140
155
  ### Form Controls
156
+
141
157
  - **Button** - Interactive buttons with variants
142
158
  - **Input** - Text input fields
143
159
  - **Textarea** - Multi-line text input
@@ -149,6 +165,7 @@ function App() {
149
165
  - **Label** - Form field labels
150
166
 
151
167
  ### Feedback & Overlays
168
+
152
169
  - **Dialog** - Modal dialogs
153
170
  - **AlertDialog** - Confirmation dialogs
154
171
  - **Toast** - Notification messages
@@ -158,6 +175,7 @@ function App() {
158
175
  - **HoverCard** - Hover-triggered content
159
176
 
160
177
  ### Data Display
178
+
161
179
  - **Avatar** - User profile images
162
180
  - **Badge** - Status indicators
163
181
  - **Progress** - Loading indicators
@@ -167,12 +185,14 @@ function App() {
167
185
  - **Accordion** - Collapsible content
168
186
 
169
187
  ### Media & Graphics
188
+
170
189
  - **Calendar** - Date selection
171
190
  - **DatePicker** - Date input controls
172
191
  - **ColorPicker** - Color selection
173
192
  - **FileUpload** - File upload interface
174
193
 
175
194
  ### Advanced
195
+
176
196
  - **Command** - Command palette interface
177
197
  - **Collapsible** - Expandable content
178
198
  - **DropdownMenu** - Context menus
@@ -186,31 +206,31 @@ MoonUI uses CSS variables for easy theming:
186
206
 
187
207
  ```css
188
208
  :root {
189
- --background: 0 0% 100%;
190
- --foreground: 222.2 84% 4.9%;
191
- --primary: 222.2 47.4% 11.2%;
192
- --primary-foreground: 210 40% 98%;
193
- /* ... more variables */
209
+ --background: 0 0% 100%;
210
+ --foreground: 222.2 84% 4.9%;
211
+ --primary: 222.2 47.4% 11.2%;
212
+ --primary-foreground: 210 40% 98%;
213
+ /* ... more variables */
194
214
  }
195
215
 
196
216
  .dark {
197
- --background: 222.2 84% 4.9%;
198
- --foreground: 210 40% 98%;
199
- /* ... dark theme variables */
217
+ --background: 222.2 84% 4.9%;
218
+ --foreground: 210 40% 98%;
219
+ /* ... dark theme variables */
200
220
  }
201
221
  ```
202
222
 
203
223
  ### Theme Provider
204
224
 
205
225
  ```jsx
206
- import { ThemeProvider } from '@moontra/moonui/theme';
226
+ import { ThemeProvider } from "@moontra/moonui/theme";
207
227
 
208
228
  function App() {
209
- return (
210
- <ThemeProvider attribute="class" defaultTheme="system">
211
- <YourApp />
212
- </ThemeProvider>
213
- );
229
+ return (
230
+ <ThemeProvider attribute="class" defaultTheme="system">
231
+ <YourApp />
232
+ </ThemeProvider>
233
+ );
214
234
  }
215
235
  ```
216
236
 
@@ -218,8 +238,8 @@ function App() {
218
238
 
219
239
  ```css
220
240
  :root {
221
- --primary: 142 76% 36%; /* Custom green */
222
- --secondary: 210 40% 95%;
241
+ --primary: 142 76% 36%; /* Custom green */
242
+ --secondary: 210 40% 95%;
223
243
  }
224
244
  ```
225
245
 
@@ -266,6 +286,7 @@ npm install -g @moontra/moonui-mcp-server
266
286
  ```
267
287
 
268
288
  AI assistants can then help you:
289
+
269
290
  - 🎯 Find the right components for your use case
270
291
  - 🔧 Generate component code automatically
271
292
  - 🐛 Fix import issues
@@ -293,7 +314,7 @@ Upgrade to MoonUI Pro for advanced components:
293
314
 
294
315
  ### Requirements
295
316
 
296
- - Node.js 18+
317
+ - Node.js 18+
297
318
  - React 18+
298
319
  - TypeScript 5+
299
320
  - Tailwind CSS 3+
@@ -357,6 +378,7 @@ Licensed under the [MIT License](LICENSE).
357
378
  ## 🙏 Acknowledgments
358
379
 
359
380
  Built with:
381
+
360
382
  - [React](https://reactjs.org/)
361
383
  - [Radix UI](https://radix-ui.com/)
362
384
  - [Tailwind CSS](https://tailwindcss.com/)
@@ -371,4 +393,4 @@ Built with:
371
393
 
372
394
  Made with ❤️ by the MoonUI team
373
395
 
374
- </div>
396
+ </div>
package/dist/index.d.mts CHANGED
@@ -15,7 +15,7 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
15
15
  import * as LabelPrimitive from '@radix-ui/react-label';
16
16
  import * as PopoverPrimitive from '@radix-ui/react-popover';
17
17
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
18
- import { Variants } from 'framer-motion';
18
+ import { Variants, UseInViewOptions } from 'framer-motion';
19
19
  import * as SelectPrimitive from '@radix-ui/react-select';
20
20
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
21
21
  import * as SwitchPrimitives from '@radix-ui/react-switch';
@@ -1128,38 +1128,116 @@ declare function RichTextEditor({ value, onChange, placeholder, className, disab
1128
1128
  declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<never>>;
1129
1129
  declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<never>>;
1130
1130
 
1131
+ /**
1132
+ * ScrollReveal Component
1133
+ *
1134
+ * Reveals content with smooth animations when scrolling into view
1135
+ * Built with Framer Motion for performance and flexibility
1136
+ *
1137
+ * @example
1138
+ * ```tsx
1139
+ * <ScrollReveal direction="up" delay={0.2}>
1140
+ * <Card>Your content</Card>
1141
+ * </ScrollReveal>
1142
+ * ```
1143
+ */
1131
1144
  interface ScrollRevealProps {
1145
+ /** Content to reveal */
1132
1146
  children: React.ReactNode;
1133
- direction?: "up" | "down" | "left" | "right";
1147
+ /** Animation direction */
1148
+ direction?: "up" | "down" | "left" | "right" | "fade" | "scale" | "blur";
1149
+ /** Animation delay in seconds */
1134
1150
  delay?: number;
1151
+ /** Animation duration in seconds */
1135
1152
  duration?: number;
1153
+ /** Distance to animate from (pixels) */
1136
1154
  distance?: number;
1155
+ /** Viewport threshold for trigger (0-1) */
1137
1156
  threshold?: number;
1157
+ /** Trigger animation only once */
1158
+ once?: boolean;
1159
+ /** Deprecated: Use 'once' instead */
1138
1160
  triggerOnce?: boolean;
1161
+ /** Stagger delay for multiple children (deprecated: use ScrollRevealContainer) */
1139
1162
  stagger?: number;
1163
+ /** Additional CSS classes */
1140
1164
  className?: string;
1165
+ /** Custom animation variants */
1141
1166
  variants?: Variants;
1167
+ /** Enable/disable animations */
1142
1168
  animate?: boolean;
1169
+ /** Custom styles */
1143
1170
  style?: React.CSSProperties;
1171
+ /** Element ID */
1144
1172
  id?: string;
1173
+ /** Viewport options for intersection observer */
1174
+ viewport?: UseInViewOptions;
1145
1175
  }
1146
1176
  declare const ScrollReveal: React.ForwardRefExoticComponent<ScrollRevealProps & React.RefAttributes<HTMLDivElement>>;
1177
+ /**
1178
+ * ScrollRevealContainer Component
1179
+ *
1180
+ * Container for orchestrating staggered scroll reveal animations
1181
+ * Uses Framer Motion's staggerChildren for better performance
1182
+ *
1183
+ * @example
1184
+ * ```tsx
1185
+ * <ScrollRevealContainer stagger={0.1}>
1186
+ * <ScrollRevealItem>Item 1</ScrollRevealItem>
1187
+ * <ScrollRevealItem>Item 2</ScrollRevealItem>
1188
+ * </ScrollRevealContainer>
1189
+ * ```
1190
+ */
1147
1191
  interface ScrollRevealContainerProps {
1192
+ /** ScrollRevealItem components */
1148
1193
  children: React.ReactNode;
1194
+ /** Delay between child animations (seconds) */
1149
1195
  stagger?: number;
1196
+ /** Additional CSS classes */
1150
1197
  className?: string;
1198
+ /** Custom styles */
1151
1199
  style?: React.CSSProperties;
1200
+ /** Element ID */
1152
1201
  id?: string;
1202
+ /** Viewport threshold for trigger (0-1) */
1203
+ threshold?: number;
1204
+ /** Trigger animation only once */
1205
+ once?: boolean;
1206
+ /** Deprecated: Use 'once' instead */
1207
+ triggerOnce?: boolean;
1208
+ /** Viewport options for intersection observer */
1209
+ viewport?: UseInViewOptions;
1153
1210
  }
1154
1211
  declare const ScrollRevealContainer: React.ForwardRefExoticComponent<ScrollRevealContainerProps & React.RefAttributes<HTMLDivElement>>;
1212
+ /**
1213
+ * ScrollRevealItem Component
1214
+ *
1215
+ * Individual item within a ScrollRevealContainer
1216
+ * Automatically inherits timing from parent container
1217
+ *
1218
+ * @example
1219
+ * ```tsx
1220
+ * <ScrollRevealItem direction="up">
1221
+ * <Card>Item content</Card>
1222
+ * </ScrollRevealItem>
1223
+ * ```
1224
+ */
1155
1225
  interface ScrollRevealItemProps {
1226
+ /** Content to animate */
1156
1227
  children: React.ReactNode;
1157
- direction?: "up" | "down" | "left" | "right";
1228
+ /** Animation direction */
1229
+ direction?: "up" | "down" | "left" | "right" | "fade" | "scale" | "blur";
1230
+ /** Animation duration in seconds */
1158
1231
  duration?: number;
1232
+ /** Distance to animate from (pixels) */
1159
1233
  distance?: number;
1234
+ /** Additional CSS classes */
1160
1235
  className?: string;
1236
+ /** Custom animation variants */
1161
1237
  variants?: Variants;
1238
+ /** Custom styles */
1162
1239
  style?: React.CSSProperties;
1240
+ /** Element ID */
1163
1241
  id?: string;
1164
1242
  }
1165
1243
  declare const ScrollRevealItem: React.ForwardRefExoticComponent<ScrollRevealItemProps & React.RefAttributes<HTMLDivElement>>;
package/dist/index.d.ts CHANGED
@@ -15,7 +15,7 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
15
15
  import * as LabelPrimitive from '@radix-ui/react-label';
16
16
  import * as PopoverPrimitive from '@radix-ui/react-popover';
17
17
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
18
- import { Variants } from 'framer-motion';
18
+ import { Variants, UseInViewOptions } from 'framer-motion';
19
19
  import * as SelectPrimitive from '@radix-ui/react-select';
20
20
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
21
21
  import * as SwitchPrimitives from '@radix-ui/react-switch';
@@ -1128,38 +1128,116 @@ declare function RichTextEditor({ value, onChange, placeholder, className, disab
1128
1128
  declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<never>>;
1129
1129
  declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<never>>;
1130
1130
 
1131
+ /**
1132
+ * ScrollReveal Component
1133
+ *
1134
+ * Reveals content with smooth animations when scrolling into view
1135
+ * Built with Framer Motion for performance and flexibility
1136
+ *
1137
+ * @example
1138
+ * ```tsx
1139
+ * <ScrollReveal direction="up" delay={0.2}>
1140
+ * <Card>Your content</Card>
1141
+ * </ScrollReveal>
1142
+ * ```
1143
+ */
1131
1144
  interface ScrollRevealProps {
1145
+ /** Content to reveal */
1132
1146
  children: React.ReactNode;
1133
- direction?: "up" | "down" | "left" | "right";
1147
+ /** Animation direction */
1148
+ direction?: "up" | "down" | "left" | "right" | "fade" | "scale" | "blur";
1149
+ /** Animation delay in seconds */
1134
1150
  delay?: number;
1151
+ /** Animation duration in seconds */
1135
1152
  duration?: number;
1153
+ /** Distance to animate from (pixels) */
1136
1154
  distance?: number;
1155
+ /** Viewport threshold for trigger (0-1) */
1137
1156
  threshold?: number;
1157
+ /** Trigger animation only once */
1158
+ once?: boolean;
1159
+ /** Deprecated: Use 'once' instead */
1138
1160
  triggerOnce?: boolean;
1161
+ /** Stagger delay for multiple children (deprecated: use ScrollRevealContainer) */
1139
1162
  stagger?: number;
1163
+ /** Additional CSS classes */
1140
1164
  className?: string;
1165
+ /** Custom animation variants */
1141
1166
  variants?: Variants;
1167
+ /** Enable/disable animations */
1142
1168
  animate?: boolean;
1169
+ /** Custom styles */
1143
1170
  style?: React.CSSProperties;
1171
+ /** Element ID */
1144
1172
  id?: string;
1173
+ /** Viewport options for intersection observer */
1174
+ viewport?: UseInViewOptions;
1145
1175
  }
1146
1176
  declare const ScrollReveal: React.ForwardRefExoticComponent<ScrollRevealProps & React.RefAttributes<HTMLDivElement>>;
1177
+ /**
1178
+ * ScrollRevealContainer Component
1179
+ *
1180
+ * Container for orchestrating staggered scroll reveal animations
1181
+ * Uses Framer Motion's staggerChildren for better performance
1182
+ *
1183
+ * @example
1184
+ * ```tsx
1185
+ * <ScrollRevealContainer stagger={0.1}>
1186
+ * <ScrollRevealItem>Item 1</ScrollRevealItem>
1187
+ * <ScrollRevealItem>Item 2</ScrollRevealItem>
1188
+ * </ScrollRevealContainer>
1189
+ * ```
1190
+ */
1147
1191
  interface ScrollRevealContainerProps {
1192
+ /** ScrollRevealItem components */
1148
1193
  children: React.ReactNode;
1194
+ /** Delay between child animations (seconds) */
1149
1195
  stagger?: number;
1196
+ /** Additional CSS classes */
1150
1197
  className?: string;
1198
+ /** Custom styles */
1151
1199
  style?: React.CSSProperties;
1200
+ /** Element ID */
1152
1201
  id?: string;
1202
+ /** Viewport threshold for trigger (0-1) */
1203
+ threshold?: number;
1204
+ /** Trigger animation only once */
1205
+ once?: boolean;
1206
+ /** Deprecated: Use 'once' instead */
1207
+ triggerOnce?: boolean;
1208
+ /** Viewport options for intersection observer */
1209
+ viewport?: UseInViewOptions;
1153
1210
  }
1154
1211
  declare const ScrollRevealContainer: React.ForwardRefExoticComponent<ScrollRevealContainerProps & React.RefAttributes<HTMLDivElement>>;
1212
+ /**
1213
+ * ScrollRevealItem Component
1214
+ *
1215
+ * Individual item within a ScrollRevealContainer
1216
+ * Automatically inherits timing from parent container
1217
+ *
1218
+ * @example
1219
+ * ```tsx
1220
+ * <ScrollRevealItem direction="up">
1221
+ * <Card>Item content</Card>
1222
+ * </ScrollRevealItem>
1223
+ * ```
1224
+ */
1155
1225
  interface ScrollRevealItemProps {
1226
+ /** Content to animate */
1156
1227
  children: React.ReactNode;
1157
- direction?: "up" | "down" | "left" | "right";
1228
+ /** Animation direction */
1229
+ direction?: "up" | "down" | "left" | "right" | "fade" | "scale" | "blur";
1230
+ /** Animation duration in seconds */
1158
1231
  duration?: number;
1232
+ /** Distance to animate from (pixels) */
1159
1233
  distance?: number;
1234
+ /** Additional CSS classes */
1160
1235
  className?: string;
1236
+ /** Custom animation variants */
1161
1237
  variants?: Variants;
1238
+ /** Custom styles */
1162
1239
  style?: React.CSSProperties;
1240
+ /** Element ID */
1163
1241
  id?: string;
1164
1242
  }
1165
1243
  declare const ScrollRevealItem: React.ForwardRefExoticComponent<ScrollRevealItemProps & React.RefAttributes<HTMLDivElement>>;