my-animated-components 1.1.9 → 1.2.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/dist/index.js +0 -1210
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-animated-components",
3
- "version": "1.1.9",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
package/dist/index.js DELETED
@@ -1,1210 +0,0 @@
1
- import React, { useState, useRef, useEffect } from 'react';
2
- import { motion, AnimatePresence } from 'framer-motion';
3
-
4
- function styleInject(css, ref) {
5
- if ( ref === undefined ) ref = {};
6
- var insertAt = ref.insertAt;
7
-
8
- if (typeof document === 'undefined') { return; }
9
-
10
- var head = document.head || document.getElementsByTagName('head')[0];
11
- var style = document.createElement('style');
12
- style.type = 'text/css';
13
-
14
- if (insertAt === 'top') {
15
- if (head.firstChild) {
16
- head.insertBefore(style, head.firstChild);
17
- } else {
18
- head.appendChild(style);
19
- }
20
- } else {
21
- head.appendChild(style);
22
- }
23
-
24
- if (style.styleSheet) {
25
- style.styleSheet.cssText = css;
26
- } else {
27
- style.appendChild(document.createTextNode(css));
28
- }
29
- }
30
-
31
- var css_248z = "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n";
32
- styleInject(css_248z);
33
-
34
- const motionVariants = {
35
- null: {},
36
- fadeIn: {
37
- hidden: { opacity: 0 },
38
- visible: { opacity: 1, transition: { duration: 0.5 } },
39
- },
40
- zoomIn: {
41
- hidden: { scale: 0.8, opacity: 0 },
42
- visible: { scale: 1, opacity: 1, transition: { duration: 0.5 } },
43
- },
44
- slideUp: {
45
- hidden: { y: 50, opacity: 0 },
46
- visible: { y: 0, opacity: 1, transition: { duration: 0.5 } },
47
- },
48
- slideDown: {
49
- hidden: { y: -50, opacity: 0 },
50
- visible: { y: 0, opacity: 1, transition: { duration: 0.5 } },
51
- },
52
- slideLeft: {
53
- hidden: { x: 50, opacity: 0 },
54
- visible: { x: 0, opacity: 1, transition: { duration: 0.5 } },
55
- },
56
- slideRight: {
57
- hidden: { x: -50, opacity: 0 },
58
- visible: { x: 0, opacity: 1, transition: { duration: 0.5 } },
59
- },
60
- bounce: {
61
- hidden: { scale: 0.8 },
62
- visible: { scale: 1, transition: { type: 'spring', stiffness: 100 } },
63
- },
64
- rotateIn: {
65
- hidden: { rotate: -90, opacity: 0 },
66
- visible: { rotate: 0, opacity: 1, transition: { duration: 0.5 } },
67
- },
68
- stagger: {
69
- hidden: { opacity: 0 },
70
- visible: {
71
- opacity: 1,
72
- transition: { staggerChildren: 0.2 },
73
- },
74
- },
75
- flip: {
76
- hidden: { rotateY: 90, opacity: 0 },
77
- visible: { rotateY: 0, opacity: 1, transition: { duration: 0.5 } },
78
- },
79
- fadeOut: {
80
- hidden: { opacity: 1 },
81
- visible: { opacity: 0, transition: { duration: 0.5 } },
82
- },
83
- zoomOut: {
84
- hidden: { scale: 1, opacity: 1 },
85
- visible: { scale: 0.8, opacity: 0, transition: { duration: 0.5 } },
86
- },
87
- scaleUp: {
88
- hidden: { scale: 0.5, opacity: 0 },
89
- visible: { scale: 1, opacity: 1, transition: { duration: 0.5 } },
90
- },
91
- scaleDown: {
92
- hidden: { scale: 1.2, opacity: 0 },
93
- visible: { scale: 1, opacity: 1, transition: { duration: 0.5 } },
94
- },
95
- fadeInUp: {
96
- hidden: { opacity: 0, y: 50 },
97
- visible: { opacity: 1, y: 0, transition: { duration: 0.5 } },
98
- },
99
- fadeInDown: {
100
- hidden: { opacity: 0, y: -50 },
101
- visible: { opacity: 1, y: 0, transition: { duration: 0.5 } },
102
- },
103
- fadeInLeft: {
104
- hidden: { opacity: 0, x: -50 },
105
- visible: { opacity: 1, x: 0, transition: { duration: 0.5 } },
106
- },
107
- fadeInRight: {
108
- hidden: { opacity: 0, x: 50 },
109
- visible: { opacity: 1, x: 0, transition: { duration: 0.5 } },
110
- },
111
- rotateBounce: {
112
- hidden: { rotate: -45, opacity: 0 },
113
- visible: { rotate: 0, opacity: 1, transition: { type: 'spring', stiffness: 100 } },
114
- },
115
- scaleBounce: {
116
- hidden: { scale: 0.5 },
117
- visible: { scale: 1.2, transition: { type: 'spring', stiffness: 100 } },
118
- },
119
- fadeInScale: {
120
- hidden: { opacity: 0, scale: 0.8 },
121
- visible: { opacity: 1, scale: 1, transition: { duration: 0.5 } },
122
- },
123
- bounceOut: {
124
- hidden: { scale: 1.2 },
125
- visible: { scale: 0.8, transition: { type: 'spring', stiffness: 100 } },
126
- },
127
- shake: {
128
- hidden: { x: 0 },
129
- visible: { x: [0, -10, 10, -10, 10, 0], transition: { duration: 0.6, repeat: Infinity } },
130
- },
131
- pulse: {
132
- hidden: { scale: 1 },
133
- visible: { scale: [1, 1.1, 1], transition: { duration: 1.5, repeat: Infinity } },
134
- },
135
- fadeInFast: {
136
- hidden: { opacity: 0 },
137
- visible: { opacity: 1, transition: { duration: 0.2 } },
138
- },
139
- slideUpFast: {
140
- hidden: { y: 30, opacity: 0 },
141
- visible: { y: 0, opacity: 1, transition: { duration: 0.3 } },
142
- },
143
- fadeUp: {
144
- hidden: { opacity: 0, y: 50 },
145
- visible: { opacity: 1, y: 0, transition: { duration: 0.4 } },
146
- },
147
- zoomInFast: {
148
- hidden: { scale: 0.6, opacity: 0 },
149
- visible: { scale: 1, opacity: 1, transition: { duration: 0.3 } },
150
- },
151
- zoomOutFast: {
152
- hidden: { scale: 1, opacity: 1 },
153
- visible: { scale: 0.6, opacity: 0, transition: { duration: 0.3 } },
154
- },
155
- slideDownFast: {
156
- hidden: { y: -30, opacity: 0 },
157
- visible: { y: 0, opacity: 1, transition: { duration: 0.3 } },
158
- },
159
- rotateOut: {
160
- hidden: { rotate: 180, opacity: 0 },
161
- visible: { rotate: 0, opacity: 1, transition: { duration: 0.5 } },
162
- },
163
- flipFast: {
164
- hidden: { rotateY: 90, opacity: 0 },
165
- visible: { rotateY: 0, opacity: 1, transition: { duration: 0.3 } },
166
- },
167
- staggerUp: {
168
- hidden: { opacity: 0 },
169
- visible: {
170
- opacity: 1,
171
- transition: { staggerChildren: 0.15 },
172
- },
173
- },
174
- flipIn: {
175
- hidden: { rotateY: 180, opacity: 0 },
176
- visible: { rotateY: 0, opacity: 1, transition: { duration: 0.5 } },
177
- },
178
- fadeInSlow: {
179
- hidden: { opacity: 0 },
180
- visible: { opacity: 1, transition: { duration: 1.5 } },
181
- },
182
- slideUpSlow: {
183
- hidden: { y: 50, opacity: 0 },
184
- visible: { y: 0, opacity: 1, transition: { duration: 1.5 } },
185
- },
186
- slideDownSlow: {
187
- hidden: { y: -50, opacity: 0 },
188
- visible: { y: 0, opacity: 1, transition: { duration: 1.5 } },
189
- },
190
- slideLeftSlow: {
191
- hidden: { x: 50, opacity: 0 },
192
- visible: { x: 0, opacity: 1, transition: { duration: 1.5 } },
193
- },
194
- slideRightSlow: {
195
- hidden: { x: -50, opacity: 0 },
196
- visible: { x: 0, opacity: 1, transition: { duration: 1.5 } },
197
- },
198
- bounceSlow: {
199
- hidden: { scale: 0.8 },
200
- visible: { scale: 1, transition: { type: 'spring', stiffness: 50 } },
201
- },
202
- rotateInSlow: {
203
- hidden: { rotate: -90, opacity: 0 },
204
- visible: { rotate: 0, opacity: 1, transition: { duration: 1.5 } },
205
- },
206
- staggerSlow: {
207
- hidden: { opacity: 0 },
208
- visible: {
209
- opacity: 1,
210
- transition: { staggerChildren: 0.5 },
211
- },
212
- },
213
- flipSlow: {
214
- hidden: { rotateY: 90, opacity: 0 },
215
- visible: { rotateY: 0, opacity: 1, transition: { duration: 1.5 } },
216
- },
217
- scaleBounceSlow: {
218
- hidden: { scale: 0.6 },
219
- visible: { scale: 1, transition: { type: 'spring', stiffness: 50 } },
220
- },
221
- rotateOutFast: {
222
- hidden: { rotate: 180, opacity: 0 },
223
- visible: { rotate: 0, opacity: 1, transition: { duration: 0.3 } },
224
- },
225
- scaleUpFast: {
226
- hidden: { scale: 0.5, opacity: 0 },
227
- visible: { scale: 1, opacity: 1, transition: { duration: 0.3 } },
228
- },
229
- scaleDownFast: {
230
- hidden: { scale: 1.2, opacity: 0 },
231
- visible: { scale: 1, opacity: 1, transition: { duration: 0.3 } },
232
- },
233
- bounceFast: {
234
- hidden: { scale: 0.8 },
235
- visible: { scale: 1, transition: { type: 'spring', stiffness: 100 } },
236
- },
237
- flipInFast: {
238
- hidden: { rotateY: 180, opacity: 0 },
239
- visible: { rotateY: 0, opacity: 1, transition: { duration: 0.3 } },
240
- },
241
- fadeInLeftFast: {
242
- hidden: { opacity: 0, x: -50 },
243
- visible: { opacity: 1, x: 0, transition: { duration: 0.3 } },
244
- },
245
- fadeInRightFast: {
246
- hidden: { opacity: 0, x: 50 },
247
- visible: { opacity: 1, x: 0, transition: { duration: 0.3 } },
248
- },
249
- fadeInUpFast: {
250
- hidden: { opacity: 0, y: 30 },
251
- visible: { opacity: 1, y: 0, transition: { duration: 0.3 } },
252
- },
253
- fadeInDownFast: {
254
- hidden: { opacity: 0, y: -30 },
255
- visible: { opacity: 1, y: 0, transition: { duration: 0.3 } },
256
- },
257
- scaleUpSlow: {
258
- hidden: { scale: 0.5, opacity: 0 },
259
- visible: { scale: 1, opacity: 1, transition: { duration: 1.5 } },
260
- },
261
- scaleDownSlow: {
262
- hidden: { scale: 1.2, opacity: 0 },
263
- visible: { scale: 1, opacity: 1, transition: { duration: 1.5 } },
264
- },
265
- rotateInFast: {
266
- hidden: { rotate: -90, opacity: 0 },
267
- visible: { rotate: 0, opacity: 1, transition: { duration: 0.3 } },
268
- },
269
- staggerChildren: {
270
- hidden: { opacity: 0 },
271
- visible: {
272
- opacity: 1,
273
- transition: { staggerChildren: 0.25 },
274
- },
275
- },
276
- fadeUpSlow: {
277
- hidden: { opacity: 0, y: 50 },
278
- visible: { opacity: 1, y: 0, transition: { duration: 1.5 } },
279
- },
280
- slideInFromLeft: {
281
- hidden: { x: -100, opacity: 0 },
282
- visible: { x: 0, opacity: 1, transition: { duration: 0.5 } },
283
- },
284
- slideInFromRight: {
285
- hidden: { x: 100, opacity: 0 },
286
- visible: { x: 0, opacity: 1, transition: { duration: 0.5 } },
287
- },
288
- slideInFromTop: {
289
- hidden: { y: -100, opacity: 0 },
290
- visible: { y: 0, opacity: 1, transition: { duration: 0.5 } },
291
- },
292
- slideInFromBottom: {
293
- hidden: { y: 100, opacity: 0 },
294
- visible: { y: 0, opacity: 1, transition: { duration: 0.5 } },
295
- },
296
- fadeInSlowFromTop: {
297
- hidden: { opacity: 0, y: -50 },
298
- visible: { opacity: 1, y: 0, transition: { duration: 1.5 } },
299
- },
300
- fadeInSlowFromBottom: {
301
- hidden: { opacity: 0, y: 50 },
302
- visible: { opacity: 1, y: 0, transition: { duration: 1.5 } },
303
- },
304
- fadeInSlowFromLeft: {
305
- hidden: { opacity: 0, x: -50 },
306
- visible: { opacity: 1, x: 0, transition: { duration: 1.5 } },
307
- },
308
- fadeInSlowFromRight: {
309
- hidden: { opacity: 0, x: 50 },
310
- visible: { opacity: 1, x: 0, transition: { duration: 1.5 } },
311
- },
312
- bounceIn: {
313
- hidden: { scale: 0.8 },
314
- visible: { scale: 1, transition: { type: 'spring', stiffness: 150 } },
315
- },
316
- zoomOutSlow: {
317
- hidden: { scale: 1, opacity: 1 },
318
- visible: { scale: 0.6, opacity: 0, transition: { duration: 1.5 } },
319
- },
320
- fadeInFastFromTop: {
321
- hidden: { opacity: 0, y: -30 },
322
- visible: { opacity: 1, y: 0, transition: { duration: 0.3 } },
323
- },
324
- fadeInFastFromBottom: {
325
- hidden: { opacity: 0, y: 30 },
326
- visible: { opacity: 1, y: 0, transition: { duration: 0.3 } },
327
- },
328
- slideInLeftFast: {
329
- hidden: { x: -50, opacity: 0 },
330
- visible: { x: 0, opacity: 1, transition: { duration: 0.3 } },
331
- },
332
- slideInRightFast: {
333
- hidden: { x: 50, opacity: 0 },
334
- visible: { x: 0, opacity: 1, transition: { duration: 0.3 } },
335
- },
336
- fadeInRotate: {
337
- hidden: { opacity: 0, rotate: -45 },
338
- visible: { opacity: 1, rotate: 0, transition: { duration: 0.5 } },
339
- },
340
- scaleInFast: {
341
- hidden: { scale: 0.8 },
342
- visible: { scale: 1, transition: { duration: 0.3 } },
343
- },
344
- zoomInBig: {
345
- hidden: { scale: 0.3 },
346
- visible: { scale: 1, transition: { duration: 1.5 } },
347
- },
348
- slideInDiagonal: {
349
- hidden: { x: -100, y: -100, opacity: 0 },
350
- visible: { x: 0, y: 0, opacity: 1, transition: { duration: 0.5 } },
351
- },
352
- rotate360: {
353
- hidden: { rotate: 0, opacity: 0 },
354
- visible: { rotate: 360, opacity: 1, transition: { duration: 1 } },
355
- },
356
- flipInX: {
357
- hidden: { rotateX: 90, opacity: 0 },
358
- visible: { rotateX: 0, opacity: 1, transition: { duration: 0.5 } },
359
- },
360
- staggerChildrenFast: {
361
- hidden: { opacity: 0 },
362
- visible: {
363
- opacity: 1,
364
- transition: { staggerChildren: 0.15, duration: 0.3 },
365
- },
366
- },
367
- pulseFast: {
368
- hidden: { scale: 1 },
369
- visible: { scale: [1, 1.1, 1], transition: { duration: 0.8, repeat: Infinity } },
370
- },
371
- slideInDiagonalFast: {
372
- hidden: { x: -80, y: -80, opacity: 0 },
373
- visible: { x: 0, y: 0, opacity: 1, transition: { duration: 0.3 } },
374
- },
375
- fadeInRightSlow: {
376
- hidden: { opacity: 0, x: 50 },
377
- visible: { opacity: 1, x: 0, transition: { duration: 1.5 } },
378
- },
379
- zoomOutSlowFromCenter: {
380
- hidden: { scale: 1.2, opacity: 0 },
381
- visible: { scale: 1, opacity: 1, transition: { duration: 1.5 } },
382
- },
383
- flipBounce: {
384
- hidden: { rotateY: 90, opacity: 0 },
385
- visible: { rotateY: 0, opacity: 1, transition: { type: 'spring', stiffness: 150 } },
386
- },
387
- slideInFromTopFast: {
388
- hidden: { y: -50, opacity: 0 },
389
- visible: { y: 0, opacity: 1, transition: { duration: 0.3 } },
390
- },
391
- fadeInDiagonal: {
392
- hidden: { opacity: 0, x: -50, y: -50 },
393
- visible: { opacity: 1, x: 0, y: 0, transition: { duration: 0.5 } },
394
- },
395
- zoomInBounce: {
396
- hidden: { scale: 0.5, opacity: 0 },
397
- visible: { scale: 1.1, opacity: 1, transition: { type: 'spring', stiffness: 150 } },
398
- },
399
- rotateInOut: {
400
- hidden: { rotate: -180, opacity: 0 },
401
- visible: { rotate: 0, opacity: 1, transition: { duration: 1 } },
402
- },
403
- staggerUpFast: {
404
- hidden: { opacity: 0 },
405
- visible: {
406
- opacity: 1,
407
- transition: { staggerChildren: 0.1, duration: 0.3 },
408
- },
409
- },
410
- fadeInRotateIn: {
411
- hidden: { opacity: 0, rotate: -45 },
412
- visible: { opacity: 1, rotate: 0, transition: { duration: 0.5 } },
413
- },
414
- scaleInQuick: {
415
- hidden: { scale: 0.7, opacity: 0 },
416
- visible: { scale: 1, opacity: 1, transition: { duration: 0.2 } },
417
- },
418
- slideInFromBottomSlow: {
419
- hidden: { y: 80, opacity: 0 },
420
- visible: { y: 0, opacity: 1, transition: { duration: 1.5 } },
421
- },
422
- flipRotateOut: {
423
- hidden: { rotateY: 180, opacity: 0 },
424
- visible: { rotateY: 0, opacity: 1, transition: { duration: 0.5 } },
425
- },
426
- slideLeftFast: {
427
- hidden: { x: -50, opacity: 0 },
428
- visible: { x: 0, opacity: 1, transition: { duration: 0.3 } },
429
- },
430
- zoomInBigFast: {
431
- hidden: { scale: 0.4, opacity: 0 },
432
- visible: { scale: 1, opacity: 1, transition: { duration: 0.2 } },
433
- },
434
- fadeInUpFastSlow: {
435
- hidden: { opacity: 0, y: 30 },
436
- visible: { opacity: 1, y: 0, transition: { duration: 0.4 } },
437
- },
438
- rotateOutSlow: {
439
- hidden: { rotate: 90, opacity: 0 },
440
- visible: { rotate: 0, opacity: 1, transition: { duration: 1.5 } },
441
- },
442
- staggerLeft: {
443
- hidden: { opacity: 0 },
444
- visible: {
445
- opacity: 1,
446
- transition: { staggerChildren: 0.2, duration: 0.6 },
447
- },
448
- },
449
- rotateOutFastReverse: {
450
- hidden: { rotate: 180, opacity: 0 },
451
- visible: { rotate: 0, opacity: 1, transition: { duration: 0.3 } },
452
- },
453
- scaleDownBounce: {
454
- hidden: { scale: 1.2 },
455
- visible: { scale: 0.9, transition: { type: 'spring', stiffness: 100 } },
456
- },
457
- fadeInFastFromLeft: {
458
- hidden: { opacity: 0, x: -50 },
459
- visible: { opacity: 1, x: 0, transition: { duration: 0.2 } },
460
- },
461
- fadeInFastFromRight: {
462
- hidden: { opacity: 0, x: 50 },
463
- visible: { opacity: 1, x: 0, transition: { duration: 0.2 } },
464
- },
465
- bounceSlowFast: {
466
- hidden: { scale: 0.6 },
467
- visible: { scale: 1, transition: { type: 'spring', stiffness: 75 } },
468
- },
469
- slideInFromTopFastReverse: {
470
- hidden: { y: -80, opacity: 0 },
471
- visible: { y: 0, opacity: 1, transition: { duration: 0.3 } },
472
- },
473
- fadeOutFast: {
474
- hidden: { opacity: 1 },
475
- visible: { opacity: 0, transition: { duration: 0.3 } },
476
- },
477
- flipScaleUp: {
478
- hidden: { rotateY: 90, opacity: 0, scale: 0.7 },
479
- visible: { rotateY: 0, opacity: 1, scale: 1, transition: { duration: 0.5 } },
480
- },
481
- slideOutRight: {
482
- hidden: { x: 0, opacity: 1 },
483
- visible: { x: 100, opacity: 0, transition: { duration: 0.5 } },
484
- },
485
- zoomOutBounce: {
486
- hidden: { scale: 1, opacity: 1 },
487
- visible: { scale: 0.5, opacity: 0, transition: { type: 'spring', stiffness: 150 } },
488
- },
489
- fadeUpReverse: {
490
- hidden: { opacity: 0, y: -50 },
491
- visible: { opacity: 1, y: 0, transition: { duration: 0.5 } },
492
- },
493
- staggerUpReverse: {
494
- hidden: { opacity: 0 },
495
- visible: {
496
- opacity: 1,
497
- transition: { staggerChildren: 0.2, duration: 0.4 },
498
- },
499
- },
500
- scaleInFromLeft: {
501
- hidden: { scale: 0.7, opacity: 0 },
502
- visible: { scale: 1, opacity: 1, transition: { duration: 0.5 } },
503
- },
504
- flipOut: {
505
- hidden: { rotateY: 0, opacity: 1 },
506
- visible: { rotateY: 90, opacity: 0, transition: { duration: 0.3 } },
507
- },
508
- };
509
-
510
- const Button = ({ children, className = '', color = 'primary', size = 'md', onClick, disabled = false, variant = 'solid', motionVariant = 'fadeIn', // Default motion variant
511
- }) => {
512
- const baseClasses = 'font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2';
513
- const colorClasses = {
514
- primary: {
515
- solid: 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500',
516
- outline: 'border border-blue-600 text-blue-600 hover:bg-blue-50 focus:ring-blue-500',
517
- ghost: 'text-blue-600 hover:bg-blue-50 focus:ring-blue-500',
518
- },
519
- secondary: {
520
- solid: 'bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500',
521
- outline: 'border border-gray-600 text-gray-600 hover:bg-gray-50 focus:ring-gray-500',
522
- ghost: 'text-gray-600 hover:bg-gray-50 focus:ring-gray-500',
523
- },
524
- success: {
525
- solid: 'bg-green-600 text-white hover:bg-green-700 focus:ring-green-500',
526
- outline: 'border border-green-600 text-green-600 hover:bg-green-50 focus:ring-green-500',
527
- ghost: 'text-green-600 hover:bg-green-50 focus:ring-green-500',
528
- },
529
- danger: {
530
- solid: 'bg-red-600 text-white hover:bg-red-700 focus:ring-red-500',
531
- outline: 'border border-red-600 text-red-600 hover:bg-red-50 focus:ring-red-500',
532
- ghost: 'text-red-600 hover:bg-red-50 focus:ring-red-500',
533
- },
534
- warning: {
535
- solid: 'bg-yellow-500 text-white hover:bg-yellow-600 focus:ring-yellow-400',
536
- outline: 'border border-yellow-500 text-yellow-500 hover:bg-yellow-50 focus:ring-yellow-400',
537
- ghost: 'text-yellow-500 hover:bg-yellow-50 focus:ring-yellow-400',
538
- },
539
- info: {
540
- solid: 'bg-blue-400 text-white hover:bg-blue-500 focus:ring-blue-300',
541
- outline: 'border border-blue-400 text-blue-400 hover:bg-blue-50 focus:ring-blue-300',
542
- ghost: 'text-blue-400 hover:bg-blue-50 focus:ring-blue-300',
543
- },
544
- };
545
- const sizeClasses = {
546
- xs: 'px-2.5 py-1.5 text-xs',
547
- sm: 'px-3 py-2 text-sm',
548
- md: 'px-4 py-2 text-base',
549
- lg: 'px-4 py-2 text-lg',
550
- xl: 'px-6 py-3 text-xl',
551
- };
552
- return (React.createElement(motion.button, { className: `${baseClasses} ${colorClasses[color][variant]} ${sizeClasses[size]} ${className}`, onClick: onClick, disabled: disabled, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible" }, children));
553
- };
554
-
555
- const IconButton = ({ className = '', color = 'primary', size = 'md', icon, onClick, disabled = false, variant = 'solid', motionVariant = 'fadeIn', // Default motion variant
556
- }) => {
557
- const baseClasses = 'rounded-full focus:outline-none focus:ring-2 focus:ring-offset-2';
558
- const colorClasses = {
559
- primary: {
560
- solid: 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500',
561
- outline: 'border border-blue-600 text-blue-600 hover:bg-blue-50 focus:ring-blue-500',
562
- ghost: 'text-blue-600 hover:bg-blue-50 focus:ring-blue-500',
563
- },
564
- secondary: {
565
- solid: 'bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500',
566
- outline: 'border border-gray-600 text-gray-600 hover:bg-gray-50 focus:ring-gray-500',
567
- ghost: 'text-gray-600 hover:bg-gray-50 focus:ring-gray-500',
568
- },
569
- success: {
570
- solid: 'bg-green-600 text-white hover:bg-green-700 focus:ring-green-500',
571
- outline: 'border border-green-600 text-green-600 hover:bg-green-50 focus:ring-green-500',
572
- ghost: 'text-green-600 hover:bg-green-50 focus:ring-green-500',
573
- },
574
- danger: {
575
- solid: 'bg-red-600 text-white hover:bg-red-700 focus:ring-red-500',
576
- outline: 'border border-red-600 text-red-600 hover:bg-red-50 focus:ring-red-500',
577
- ghost: 'text-red-600 hover:bg-red-50 focus:ring-red-500',
578
- },
579
- warning: {
580
- solid: 'bg-yellow-500 text-white hover:bg-yellow-600 focus:ring-yellow-400',
581
- outline: 'border border-yellow-500 text-yellow-500 hover:bg-yellow-50 focus:ring-yellow-400',
582
- ghost: 'text-yellow-500 hover:bg-yellow-50 focus:ring-yellow-400',
583
- },
584
- info: {
585
- solid: 'bg-blue-400 text-white hover:bg-blue-500 focus:ring-blue-300',
586
- outline: 'border border-blue-400 text-blue-400 hover:bg-blue-50 focus:ring-blue-300',
587
- ghost: 'text-blue-400 hover:bg-blue-50 focus:ring-blue-300',
588
- },
589
- };
590
- const sizeClasses = {
591
- xs: 'p-1',
592
- sm: 'p-1.5',
593
- md: 'p-2',
594
- lg: 'p-2.5',
595
- xl: 'p-3',
596
- };
597
- return (React.createElement(motion.button, { className: `${baseClasses} ${colorClasses[color][variant]} ${sizeClasses[size]} ${className}`, onClick: onClick, disabled: disabled, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible", whileHover: { scale: 1.1 }, whileTap: { scale: 0.95 } }, icon));
598
- };
599
-
600
- const Accordion = ({ className = '', items, color = 'primary', variant = 'solid', motionVariant = 'fadeIn', }) => {
601
- const [openIndex, setOpenIndex] = useState(null);
602
- const toggleItem = (index) => {
603
- setOpenIndex(openIndex === index ? null : index);
604
- };
605
- const colors = {
606
- primary: {
607
- solid: 'bg-blue-100 border-blue-400 text-blue-900',
608
- outline: 'border-blue-400 text-blue-600',
609
- ghost: 'text-blue-600 hover:bg-blue-50',
610
- },
611
- secondary: {
612
- solid: 'bg-gray-100 border-gray-400 text-gray-900',
613
- outline: 'border-gray-400 text-gray-600',
614
- ghost: 'text-gray-600 hover:bg-gray-50',
615
- },
616
- danger: {
617
- solid: 'bg-red-100 border-red-400 text-red-900',
618
- outline: 'border-red-400 text-red-600',
619
- ghost: 'text-red-600 hover:bg-red-50',
620
- },
621
- success: {
622
- solid: 'bg-green-100 border-green-400 text-green-900',
623
- outline: 'border-green-400 text-green-600',
624
- ghost: 'text-green-600 hover:bg-green-50',
625
- },
626
- info: {
627
- solid: 'bg-blue-100 border-blue-400 text-blue-900',
628
- outline: 'border-blue-400 text-blue-600',
629
- ghost: 'text-blue-600 hover:bg-blue-50',
630
- },
631
- warning: {
632
- solid: 'bg-yellow-100 border-yellow-400 text-yellow-900',
633
- outline: 'border-yellow-400 text-yellow-600',
634
- ghost: 'text-yellow-600 hover:bg-yellow-50',
635
- },
636
- };
637
- const variantClasses = colors[color][variant];
638
- return (React.createElement("div", { className: `space-y-2 ${className}` }, items.map((item, index) => (React.createElement("div", { key: index, className: `border rounded-md ${variantClasses}` },
639
- React.createElement("button", { className: `flex justify-between items-center w-full px-4 py-2 text-left focus:outline-none`, onClick: () => toggleItem(index) },
640
- React.createElement("span", null, item.title),
641
- React.createElement(motion.svg, { className: "w-5 h-5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", animate: { rotate: openIndex === index ? 180 : 0 }, transition: { duration: 0.3 } },
642
- React.createElement("path", { fillRule: "evenodd", d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z", clipRule: "evenodd" }))),
643
- React.createElement(AnimatePresence, null, openIndex === index && (React.createElement(motion.div, { variants: motionVariants[motionVariant], initial: "hidden", animate: "visible", exit: "hidden", className: "px-4 py-2 border-t" }, item.content))))))));
644
- };
645
-
646
- const Alert = ({ children, className = '', color = 'primary', onClose, motionVariant = 'fadeIn', // Default motion variant
647
- }) => {
648
- const colorClasses = {
649
- primary: 'bg-blue-100 text-blue-700',
650
- secondary: 'bg-gray-100 text-gray-700',
651
- success: 'bg-green-100 text-green-700',
652
- danger: 'bg-red-100 text-red-700',
653
- warning: 'bg-yellow-100 text-yellow-700',
654
- info: 'bg-indigo-100 text-indigo-700',
655
- };
656
- return (React.createElement(motion.div, { className: `p-4 rounded-md ${colorClasses[color]} ${className}`, role: "alert", variants: motionVariants[motionVariant], initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: 0.3 } },
657
- React.createElement("div", { className: "flex" },
658
- React.createElement("div", { className: "flex-grow" }, children),
659
- onClose && (React.createElement("button", { type: "button", className: "ml-auto -mx-1.5 -my-1.5 rounded-lg focus:ring-2 focus:ring-blue-400 p-1.5 inline-flex h-8 w-8", onClick: onClose, "aria-label": "Close" },
660
- React.createElement("span", { className: "sr-only" }, "Close"),
661
- React.createElement("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg" },
662
- React.createElement("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" })))))));
663
- };
664
-
665
- const Avatar = ({ className = '', size = 'md', src, alt, initials }) => {
666
- const sizeClasses = {
667
- xs: 'w-6 h-6 text-xs',
668
- sm: 'w-8 h-8 text-sm',
669
- md: 'w-10 h-10 text-base',
670
- lg: 'w-12 h-12 text-lg',
671
- xl: 'w-14 h-14 text-xl',
672
- };
673
- return (React.createElement("div", { className: `relative inline-flex items-center justify-center ${sizeClasses[size]} ${className} rounded-full bg-gray-200 overflow-hidden` }, src ? (React.createElement("img", { src: src, alt: alt || 'Avatar', className: "w-full h-full object-cover" })) : (React.createElement("span", { className: "font-medium text-gray-600" }, initials))));
674
- };
675
-
676
- const Badge = ({ children, className = '', color = 'primary', size = 'md', motionVariant = 'fadeIn', // Default motion variant
677
- }) => {
678
- const colorClasses = {
679
- primary: 'bg-blue-100 text-blue-800',
680
- secondary: 'bg-gray-100 text-gray-800',
681
- success: 'bg-green-100 text-green-800',
682
- danger: 'bg-red-100 text-red-800',
683
- warning: 'bg-yellow-100 text-yellow-800',
684
- info: 'bg-indigo-100 text-indigo-800',
685
- };
686
- const sizeClasses = {
687
- xs: 'px-2 py-0.5 text-xs',
688
- sm: 'px-2.5 py-0.5 text-sm',
689
- md: 'px-3 py-1 text-sm',
690
- lg: 'px-3.5 py-1.5 text-base',
691
- xl: 'px-4 py-2 text-lg',
692
- };
693
- return (React.createElement(motion.span, { className: `inline-flex items-center font-medium rounded-full ${colorClasses[color]} ${sizeClasses[size]} ${className}`, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: 0.3 } }, children));
694
- };
695
-
696
- const Breadcrumb = ({ className = '', items, motionVariant = 'fadeIn' }) => {
697
- return (React.createElement(motion.nav, { className: `flex ${className}`, "aria-label": "Breadcrumb", variants: motionVariants[motionVariant], initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: 0.3 } },
698
- React.createElement("ol", { className: "inline-flex items-center space-x-1 md:space-x-3" }, items.map((item, index) => (React.createElement("li", { key: index, className: "inline-flex items-center" },
699
- index > 0 && (React.createElement("svg", { className: "w-6 h-6 text-gray-400", fill: "currentColor", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg" },
700
- React.createElement("path", { fillRule: "evenodd", d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z", clipRule: "evenodd" }))),
701
- React.createElement("a", { href: item.href, className: `ml-1 text-sm font-medium ${index === items.length - 1
702
- ? 'text-gray-500 hover:text-gray-700'
703
- : 'text-blue-600 hover:text-blue-800'}` }, item.label)))))));
704
- };
705
-
706
- const Card = ({ children, className = '', motionVariant = 'fadeIn' }) => {
707
- return (React.createElement(motion.div, { className: `bg-white shadow rounded-lg overflow-hidden ${className}`, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: 0.3 } }, children));
708
- };
709
-
710
- const CardBody = ({ children, className = '', motionVariant = 'fadeIn' }) => {
711
- return (React.createElement(motion.div, { className: `px-4 py-5 sm:p-6 ${className}`, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: 0.3 } }, children));
712
- };
713
-
714
- const CardFooter = ({ children, className = '', motionVariant = 'fadeIn' }) => {
715
- return (React.createElement(motion.div, { className: `px-4 py-4 sm:px-6 ${className}`, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: 0.3 } }, children));
716
- };
717
-
718
- const CardHeader = ({ children, className = '', motionVariant = 'fadeIn' }) => {
719
- return (React.createElement(motion.div, { className: `px-4 py-5 sm:px-6 ${className}`, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: 0.3 } }, children));
720
- };
721
-
722
- const Dropdown = ({ children, className = '', trigger, motionVariant = 'fadeIn' }) => {
723
- const [isOpen, setIsOpen] = useState(false);
724
- const dropdownRef = useRef(null);
725
- useEffect(() => {
726
- const handleClickOutside = (event) => {
727
- if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
728
- setIsOpen(false);
729
- }
730
- };
731
- document.addEventListener('mousedown', handleClickOutside);
732
- return () => {
733
- document.removeEventListener('mousedown', handleClickOutside);
734
- };
735
- }, []);
736
- return (React.createElement("div", { className: `relative inline-block text-left ${className}`, ref: dropdownRef },
737
- React.createElement("div", null,
738
- React.createElement("button", { type: "button", onClick: () => setIsOpen(prev => !prev) }, trigger),
739
- React.createElement(AnimatePresence, null, isOpen && (React.createElement(motion.div, { variants: motionVariants[motionVariant], initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: 0.3 } }, children))))));
740
- };
741
-
742
- const DropdownItem = ({ children, className = '' }) => {
743
- return (React.createElement("a", { href: "#", className: `block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 ${className}`, role: "menuitem" }, children));
744
- };
745
-
746
- const Checkbox = ({ className = '', label, checked, onChange, color = 'primary', // Default color
747
- motionVariant = 'fadeIn', // Default motion variant
748
- }) => {
749
- const colorClasses = {
750
- primary: 'text-blue-600',
751
- secondary: 'text-gray-600',
752
- success: 'text-green-600',
753
- danger: 'text-red-600',
754
- warning: 'text-yellow-500',
755
- info: 'text-blue-400',
756
- };
757
- return (React.createElement(motion.label, { className: `inline-flex items-center ${className}`, initial: { opacity: 0, x: -20 }, animate: { opacity: 1, x: 0 }, transition: { duration: 0.3 }, variants: motionVariants[motionVariant] },
758
- React.createElement("input", { type: "checkbox", className: `form-checkbox h-5 w-5 ${colorClasses[color]}`, checked: checked, onChange: onChange }),
759
- React.createElement("span", { className: "ml-2 text-gray-700" }, label)));
760
- };
761
-
762
- const FileUpload = ({ className = '', onChange, accept, multiple, buttonColor = 'primary', // Default button color
763
- motionVariant = 'fadeIn', // Default motion variant
764
- }) => {
765
- const fileInputRef = useRef(null);
766
- const handleClick = () => {
767
- fileInputRef.current?.click();
768
- };
769
- const handleChange = (event) => {
770
- const file = event.target.files?.[0] || null;
771
- onChange(file);
772
- };
773
- const buttonColorClasses = {
774
- primary: 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500',
775
- secondary: 'bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500',
776
- success: 'bg-green-600 text-white hover:bg-green-700 focus:ring-green-500',
777
- danger: 'bg-red-600 text-white hover:bg-red-700 focus:ring-red-500',
778
- warning: 'bg-yellow-500 text-white hover:bg-yellow-600 focus:ring-yellow-400',
779
- info: 'bg-blue-400 text-white hover:bg-blue-500 focus:ring-blue-300',
780
- };
781
- return (React.createElement(motion.div, { className: `flex items-center ${className}`, initial: { opacity: 0, x: -20 }, animate: { opacity: 1, x: 0 }, transition: { duration: 0.3 }, variants: motionVariants[motionVariant] },
782
- React.createElement("button", { type: "button", onClick: handleClick, className: `px-4 py-2 text-sm font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 ${buttonColorClasses[buttonColor]}` }, "Choose File"),
783
- React.createElement("input", { type: "file", ref: fileInputRef, onChange: handleChange, accept: accept, multiple: multiple, className: "hidden" })));
784
- };
785
-
786
- const Input = ({ className = '', size = 'md', type = 'text', placeholder, value, onChange, }) => {
787
- const sizeClasses = {
788
- xs: 'px-2 py-1 text-xs',
789
- sm: 'px-3 py-2 text-sm',
790
- md: 'px-4 py-2 text-base',
791
- lg: 'px-4 py-3 text-lg',
792
- xl: 'px-5 py-4 text-xl',
793
- };
794
- return (React.createElement(motion.div, { initial: { opacity: 0, x: -20 }, animate: { opacity: 1, x: 0 }, transition: { duration: 0.3 } },
795
- React.createElement("input", { type: type, className: `w-full border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500 ${sizeClasses[size]} ${className}`, placeholder: placeholder, value: value, onChange: onChange })));
796
- };
797
-
798
- const Radio = ({ className = '', label, name, value, checked, onChange, color = 'primary', size = 'md', motionVariant = 'fadeIn', // Default motion variant
799
- }) => {
800
- const baseClasses = 'inline-flex items-center';
801
- const colorClasses = {
802
- primary: 'text-blue-600',
803
- secondary: 'text-gray-600',
804
- success: 'text-green-600',
805
- danger: 'text-red-600',
806
- warning: 'text-yellow-500',
807
- info: 'text-blue-400',
808
- };
809
- const sizeClasses = {
810
- xs: 'h-4 w-4',
811
- sm: 'h-5 w-5',
812
- md: 'h-6 w-6',
813
- lg: 'h-7 w-7',
814
- xl: 'h-8 w-8',
815
- };
816
- return (React.createElement(motion.label, { className: `${baseClasses} ${colorClasses[color]} ${sizeClasses[size]} ${className}`, initial: { opacity: 0, x: -20 }, animate: { opacity: 1, x: 0 }, variants: motionVariants[motionVariant], transition: { duration: 0.3 } },
817
- React.createElement("input", { type: "radio", className: "form-radio", name: name, value: value, checked: checked, onChange: onChange }),
818
- React.createElement("span", { className: "ml-2 text-gray-700" }, label)));
819
- };
820
-
821
- const Select = ({ className = '', size = 'md', options, value, onChange, color = 'primary', motionVariant = 'fadeIn', // Default motion variant
822
- }) => {
823
- const baseClasses = 'w-full border rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2';
824
- const colorClasses = {
825
- primary: 'border-blue-600 focus:ring-blue-500 text-blue-600',
826
- secondary: 'border-gray-600 focus:ring-gray-500 text-gray-600',
827
- success: 'border-green-600 focus:ring-green-500 text-green-600',
828
- danger: 'border-red-600 focus:ring-red-500 text-red-600',
829
- warning: 'border-yellow-500 focus:ring-yellow-400 text-yellow-500',
830
- info: 'border-blue-400 focus:ring-blue-300 text-blue-400',
831
- };
832
- const sizeClasses = {
833
- xs: 'px-2 py-1 text-xs',
834
- sm: 'px-3 py-2 text-sm',
835
- md: 'px-4 py-2 text-base',
836
- lg: 'px-4 py-3 text-lg',
837
- xl: 'px-5 py-4 text-xl',
838
- };
839
- return (React.createElement(motion.div, { initial: { opacity: 0, x: -20 }, animate: { opacity: 1, x: 0 }, variants: motionVariants[motionVariant], transition: { duration: 0.3 } },
840
- React.createElement("select", { className: `${baseClasses} ${colorClasses[color]} ${sizeClasses[size]} ${className}`, value: value, onChange: onChange }, options.map((option) => (React.createElement("option", { key: option.value, value: option.value }, option.label))))));
841
- };
842
-
843
- const Switch = ({ className = '', checked, onChange, label, color = 'primary', motionVariant = 'fadeIn', // Default motion variant
844
- }) => {
845
- const baseClasses = 'inline-flex items-center cursor-pointer';
846
- const colorClasses = {
847
- primary: 'bg-blue-600',
848
- secondary: 'bg-gray-600',
849
- success: 'bg-green-600',
850
- danger: 'bg-red-600',
851
- warning: 'bg-yellow-500',
852
- info: 'bg-blue-400',
853
- };
854
- return (React.createElement(motion.label, { className: `${baseClasses} ${className}`, initial: { opacity: 0, x: -20 }, animate: { opacity: 1, x: 0 }, variants: motionVariants[motionVariant], transition: { duration: 0.3 } },
855
- React.createElement("div", { className: "relative" },
856
- React.createElement("input", { type: "checkbox", className: "sr-only", checked: checked, onChange: (e) => onChange(e.target.checked) }),
857
- React.createElement("div", { className: `w-10 h-6 bg-gray-200 rounded-full shadow-inner ${checked ? colorClasses[color] : ''}` }),
858
- React.createElement("div", { className: `absolute w-4 h-4 bg-white rounded-full shadow inset-y-1 left-1 transition-transform duration-200 ease-in-out ${checked ? 'transform translate-x-4' : ''}` })),
859
- label && React.createElement("span", { className: "ml-3 text-sm font-medium text-gray-900" }, label)));
860
- };
861
-
862
- const Textarea = ({ className = '', size = 'md', placeholder, value, onChange, rows = 4, color = 'primary', motionVariant = 'fadeIn', // Default motion variant
863
- }) => {
864
- const baseClasses = 'w-full border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500';
865
- const colorClasses = {
866
- primary: 'focus:ring-blue-500 focus:border-blue-500',
867
- secondary: 'focus:ring-gray-500 focus:border-gray-500',
868
- success: 'focus:ring-green-500 focus:border-green-500',
869
- danger: 'focus:ring-red-500 focus:border-red-500',
870
- warning: 'focus:ring-yellow-400 focus:border-yellow-400',
871
- info: 'focus:ring-blue-300 focus:border-blue-300',
872
- };
873
- const sizeClasses = {
874
- xs: 'px-2 py-1 text-xs',
875
- sm: 'px-3 py-2 text-sm',
876
- md: 'px-4 py-2 text-base',
877
- lg: 'px-4 py-3 text-lg',
878
- xl: 'px-5 py-4 text-xl',
879
- };
880
- return (React.createElement(motion.div, { initial: { opacity: 0, x: -20 }, animate: { opacity: 1, x: 0 }, variants: motionVariants[motionVariant], transition: { duration: 0.3 } },
881
- React.createElement("textarea", { className: `${baseClasses} ${colorClasses[color]} ${sizeClasses[size]} ${className}`, placeholder: placeholder, value: value, onChange: onChange, rows: rows })));
882
- };
883
-
884
- const Container = ({ children, className = '', fluid = false, motionVariant = 'fadeIn' }) => {
885
- const containerClass = fluid ? 'w-full' : 'max-w-7xl mx-auto px-4 sm:px-6 lg:px-8';
886
- return (React.createElement(motion.div, { className: `${containerClass} ${className}`, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible", exit: "hidden" }, children));
887
- };
888
-
889
- const Flex = ({ children, className = '', direction = 'row', justify = 'start', align = 'start', wrap = false, }) => {
890
- const flexClass = `
891
- flex
892
- ${direction === 'col' ? 'flex-col' : 'flex-row'}
893
- ${`justify-${justify}`}
894
- ${`items-${align}`}
895
- ${wrap ? 'flex-wrap' : 'flex-nowrap'}
896
- `;
897
- return (React.createElement("div", { className: `${flexClass} ${className}` }, children));
898
- };
899
-
900
- const Grid = ({ children, className = '', cols = 3, gap = 4 }) => {
901
- return (React.createElement("div", { className: `grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-${cols} gap-${gap} ${className}` }, children));
902
- };
903
-
904
- const List = ({ children, className = '', as = 'ul' }) => {
905
- const Tag = as;
906
- return (React.createElement(motion.div, { initial: { opacity: 0, y: 20 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3 } },
907
- React.createElement(Tag, { className: `space-y-1 ${className}` }, children)));
908
- };
909
-
910
- const ListItem = ({ children, className = '' }) => {
911
- return (React.createElement(motion.li, { className: className, initial: { opacity: 0, x: -20 }, animate: { opacity: 1, x: 0 }, transition: { duration: 0.3 } }, children));
912
- };
913
-
914
- const Modal = ({ children, className = '', isOpen, onClose }) => {
915
- return (React.createElement(AnimatePresence, null, isOpen && (React.createElement(motion.div, { className: "fixed inset-0 z-50 overflow-y-auto", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 } },
916
- React.createElement("div", { className: "flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0" },
917
- React.createElement("div", { className: "fixed inset-0 transition-opacity", "aria-hidden": "true" },
918
- React.createElement("div", { className: "absolute inset-0 bg-gray-500 opacity-75", onClick: onClose })),
919
- React.createElement("span", { className: "hidden sm:inline-block sm:align-middle sm:h-screen", "aria-hidden": "true" }, "\u200B"),
920
- React.createElement(motion.div, { className: `inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full ${className}`, initial: { opacity: 0, scale: 0.95 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: 0.95 } }, children))))));
921
- };
922
-
923
- const ModalBody = ({ children, className = '' }) => {
924
- return (React.createElement("div", { className: `px-4 pt-5 pb-4 sm:p-6 sm:pb-4 ${className}` }, children));
925
- };
926
-
927
- const ModalFooter = ({ children, className = '' }) => {
928
- return (React.createElement("div", { className: `px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse ${className}` }, children));
929
- };
930
-
931
- const ModalHeader = ({ children, className = '' }) => {
932
- return (React.createElement("div", { className: `px-4 pt-5 pb-4 sm:p-6 sm:pb-4 ${className}` },
933
- React.createElement("h3", { className: "text-lg leading-6 font-medium text-gray-900" }, children)));
934
- };
935
-
936
- const NavItem = ({ children, className = '', href, active = false, size = 'md', motionVariant = 'fadeIn', }) => {
937
- const activeClass = active ? 'text-gray-900 border-b-2 border-blue-500' : 'text-gray-500 hover:text-gray-700';
938
- const sizeClasses = {
939
- xs: 'text-xs px-1 py-0.5',
940
- sm: 'text-sm px-2 py-1',
941
- md: 'text-base px-3 py-2',
942
- lg: 'text-lg px-4 py-3',
943
- xl: 'text-xl px-5 py-4',
944
- };
945
- return (React.createElement(motion.a, { href: href, className: `inline-flex items-center ${sizeClasses[size]} ${activeClass} ${className}`, whileHover: { scale: 1.05 }, whileTap: { scale: 0.95 }, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible" }, children));
946
- };
947
-
948
- const Navbar = ({ children, className = '', brand }) => {
949
- return (React.createElement(motion.nav, { className: `bg-white shadow ${className}`, initial: { opacity: 0, y: -50 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.5 } },
950
- React.createElement("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8" },
951
- React.createElement("div", { className: "flex justify-between h-16" },
952
- React.createElement("div", { className: "flex-shrink-0 flex items-center" }, brand),
953
- React.createElement("div", { className: "flex items-center" }, children)))));
954
- };
955
-
956
- const Offcanvas = ({ children, className = '', isOpen, onClose, position = 'left' }) => {
957
- const positionClasses = {
958
- left: 'left-0 top-0 h-full',
959
- right: 'right-0 top-0 h-full',
960
- top: 'top-0 left-0 w-full',
961
- bottom: 'bottom-0 left-0 w-full',
962
- };
963
- const variants = {
964
- left: { x: '-100%' },
965
- right: { x: '100%' },
966
- top: { y: '-100%' },
967
- bottom: { y: '100%' },
968
- };
969
- return (React.createElement(AnimatePresence, null, isOpen && (React.createElement("div", { className: "fixed inset-0 z-50 overflow-hidden" },
970
- React.createElement("div", { className: "absolute inset-0 overflow-hidden" },
971
- React.createElement(motion.div, { className: "absolute inset-0 bg-gray-500 bg-opacity-75 transition-opacity", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: onClose }),
972
- React.createElement("section", { className: `absolute ${positionClasses[position]} max-w-md` },
973
- React.createElement(motion.div, { className: `h-full w-full transform transition ease-in-out duration-300 ${className}`, initial: variants[position], animate: { x: 0, y: 0 }, exit: variants[position], transition: { duration: 0.3 } },
974
- React.createElement("div", { className: "h-full bg-white shadow-xl" }, children))))))));
975
- };
976
-
977
- const OffcanvasBody = ({ children, className = '' }) => {
978
- return (React.createElement("div", { className: `p-4 overflow-y-auto ${className}` }, children));
979
- };
980
-
981
- const OffcanvasHeader = ({ children, className = '', onClose }) => {
982
- return (React.createElement("div", { className: `px-4 py-3 border-b border-gray-200 flex items-center justify-between ${className}` },
983
- React.createElement("h2", { className: "text-lg font-semibold" }, children),
984
- React.createElement("button", { onClick: onClose, className: "text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500" },
985
- React.createElement("span", { className: "sr-only" }, "Close panel"),
986
- React.createElement("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" },
987
- React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" })))));
988
- };
989
-
990
- const Pagination = ({ className = '', currentPage, totalPages, onPageChange, color = 'primary', motionVariant = 'fadeIn', // Default motion variant
991
- }) => {
992
- const pageNumbers = [];
993
- for (let i = 1; i <= totalPages; i++) {
994
- pageNumbers.push(i);
995
- }
996
- const colorClasses = {
997
- primary: 'text-blue-600 bg-blue-50 hover:bg-blue-100 hover:text-blue-700',
998
- secondary: 'text-gray-600 bg-gray-50 hover:bg-gray-100 hover:text-gray-700',
999
- success: 'text-green-600 bg-green-50 hover:bg-green-100 hover:text-green-700',
1000
- danger: 'text-red-600 bg-red-50 hover:bg-red-100 hover:text-red-700',
1001
- warning: 'text-yellow-600 bg-yellow-50 hover:bg-yellow-100 hover:text-yellow-700',
1002
- info: 'text-blue-400 bg-blue-50 hover:bg-blue-100 hover:text-blue-500',
1003
- };
1004
- return (React.createElement(motion.nav, { className: `flex justify-center ${className}`, initial: { opacity: 0, y: -50 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.5 }, variants: motionVariants[motionVariant] },
1005
- React.createElement("ul", { className: "flex items-center -space-x-px" },
1006
- React.createElement("li", null,
1007
- React.createElement(motion.button, { onClick: () => onPageChange(currentPage - 1), disabled: currentPage === 1, className: `block px-3 py-2 ml-0 leading-tight border border-gray-300 rounded-l-lg ${colorClasses[color]} ${currentPage === 1 && 'cursor-not-allowed opacity-50'}`, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible" }, "Previous")),
1008
- pageNumbers.map((number) => (React.createElement("li", { key: number },
1009
- React.createElement(motion.button, { onClick: () => onPageChange(number), className: `px-3 py-2 leading-tight border border-gray-300 ${colorClasses[color]} ${currentPage === number
1010
- ? 'bg-blue-100 text-blue-700 hover:bg-blue-200'
1011
- : 'bg-white hover:bg-gray-100'}`, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible" }, number)))),
1012
- React.createElement("li", null,
1013
- React.createElement(motion.button, { onClick: () => onPageChange(currentPage + 1), disabled: currentPage === totalPages, className: `block px-3 py-2 leading-tight border border-gray-300 rounded-r-lg ${colorClasses[color]} ${currentPage === totalPages && 'cursor-not-allowed opacity-50'}`, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible" }, "Next")))));
1014
- };
1015
-
1016
- const ProgressBar = ({ className = '', color = 'primary', value, max = 100, motionVariant = 'fadeIn', // Default motion variant
1017
- }) => {
1018
- const percentage = Math.min(100, Math.max(0, (value / max) * 100));
1019
- const colorClasses = {
1020
- primary: 'bg-blue-600',
1021
- secondary: 'bg-gray-600',
1022
- success: 'bg-green-600',
1023
- danger: 'bg-red-600',
1024
- warning: 'bg-yellow-600',
1025
- info: 'bg-indigo-600',
1026
- };
1027
- return (React.createElement("div", { className: `w-full bg-gray-200 rounded-full h-2.5 ${className}` },
1028
- React.createElement(motion.div, { className: `h-2.5 rounded-full ${colorClasses[color]}`, style: { width: `${percentage}%` }, initial: { width: 0 }, animate: { width: `${percentage}%` }, transition: { duration: 0.5 }, variants: motionVariants[motionVariant], role: "progressbar", "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": max })));
1029
- };
1030
-
1031
- const Skeleton = ({ className = '', width = '100%', height = '20px', color = 'primary', motionVariant = 'fadeIn', // Default motion variant
1032
- }) => {
1033
- const colorClasses = {
1034
- primary: 'bg-blue-200',
1035
- secondary: 'bg-gray-300',
1036
- success: 'bg-green-200',
1037
- danger: 'bg-red-200',
1038
- warning: 'bg-yellow-200',
1039
- info: 'bg-indigo-200',
1040
- };
1041
- return (React.createElement(motion.div, { className: `animate-pulse rounded ${colorClasses[color]} ${className}`, style: { width, height }, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible" }));
1042
- };
1043
-
1044
- const Slider = ({ className = '', min, max, value, onChange, step = 1, color = 'primary', // Default color set to primary
1045
- motionVariant = 'fadeIn', // Default motion variant
1046
- }) => {
1047
- const percentage = ((value - min) / (max - min)) * 100;
1048
- const colorClasses = {
1049
- primary: 'bg-blue-600',
1050
- secondary: 'bg-gray-600',
1051
- success: 'bg-green-600',
1052
- danger: 'bg-red-600',
1053
- warning: 'bg-yellow-600',
1054
- info: 'bg-indigo-600',
1055
- };
1056
- return (React.createElement("div", { className: `relative w-full h-2 bg-gray-200 rounded-full ${className}` },
1057
- React.createElement(motion.div, { className: `absolute h-full ${colorClasses[color]} rounded-full`, style: { width: `${percentage}%` }, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible", transition: { duration: 0.3 } }),
1058
- React.createElement("input", { type: "range", min: min, max: max, value: value, onChange: (e) => onChange(Number(e.target.value)), step: step, className: "absolute w-full h-full opacity-0 cursor-pointer" })));
1059
- };
1060
-
1061
- const RangeSlider = ({ className = '', min, max, values, onChange, step = 1, color = 'primary', // Default color set to primary
1062
- motionVariant = 'fadeIn', // Default motion variant
1063
- }) => {
1064
- const [minValue, maxValue] = values;
1065
- const minPercentage = ((minValue - min) / (max - min)) * 100;
1066
- const maxPercentage = ((maxValue - min) / (max - min)) * 100;
1067
- const colorClasses = {
1068
- primary: 'bg-blue-600',
1069
- secondary: 'bg-gray-600',
1070
- success: 'bg-green-600',
1071
- danger: 'bg-red-600',
1072
- warning: 'bg-yellow-600',
1073
- info: 'bg-indigo-600',
1074
- };
1075
- const handleMinChange = (e) => {
1076
- const newMinValue = Math.min(Number(e.target.value), maxValue - step);
1077
- onChange([newMinValue, maxValue]);
1078
- };
1079
- const handleMaxChange = (e) => {
1080
- const newMaxValue = Math.max(Number(e.target.value), minValue + step);
1081
- onChange([minValue, newMaxValue]);
1082
- };
1083
- return (React.createElement("div", { className: `relative w-full h-2 bg-gray-200 rounded-full ${className}` },
1084
- React.createElement(motion.div, { className: `absolute h-full ${colorClasses[color]} rounded-full`, style: { left: `${minPercentage}%`, right: `${100 - maxPercentage}%` }, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible", transition: { duration: 0.3 } }),
1085
- React.createElement("input", { type: "range", min: min, max: max, value: minValue, onChange: handleMinChange, step: step, className: "absolute w-full h-full opacity-0 cursor-pointer" }),
1086
- React.createElement("input", { type: "range", min: min, max: max, value: maxValue, onChange: handleMaxChange, step: step, className: "absolute w-full h-full opacity-0 cursor-pointer" })));
1087
- };
1088
-
1089
- const Stepper = ({ className = '', steps, currentStep }) => {
1090
- return (React.createElement("div", { className: `flex items-center ${className}` }, steps.map((step, index) => (React.createElement(React.Fragment, { key: index },
1091
- React.createElement("div", { className: "flex items-center" },
1092
- React.createElement("div", { className: `flex items-center justify-center w-8 h-8 rounded-full ${index < currentStep
1093
- ? 'bg-blue-600 text-white'
1094
- : index === currentStep
1095
- ? 'bg-blue-200 text-blue-600'
1096
- : 'bg-gray-200 text-gray-600'}` }, index < currentStep ? (React.createElement("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20" },
1097
- React.createElement("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }))) : (index + 1)),
1098
- index < steps.length - 1 && (React.createElement("div", { className: `flex-1 h-1 mx-2 ${index < currentStep ? 'bg-blue-600' : 'bg-gray-200'}` }))),
1099
- index < steps.length - 1 && (React.createElement("div", { className: "hidden sm:block text-xs text-center text-gray-500 mt-2" }, step)))))));
1100
- };
1101
-
1102
- const Table = ({ children, className = '', motionVariant = 'fadeIn', // Default motion variant
1103
- color = 'primary', // Color customization
1104
- }) => {
1105
- const baseClasses = 'overflow-x-auto';
1106
- const colorClasses = {
1107
- primary: 'border-blue-600 text-blue-600',
1108
- secondary: 'border-gray-600 text-gray-600',
1109
- success: 'border-green-600 text-green-600',
1110
- danger: 'border-red-600 text-red-600',
1111
- warning: 'border-yellow-500 text-yellow-500',
1112
- info: 'border-blue-400 text-blue-400',
1113
- };
1114
- return (React.createElement(motion.div, { className: `${baseClasses} ${colorClasses[color]} ${className}`, initial: { opacity: 0, y: 20 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3 }, variants: motionVariants[motionVariant] },
1115
- React.createElement("table", { className: "min-w-full divide-y divide-gray-200" }, children)));
1116
- };
1117
-
1118
- const TableBody = ({ children, className = '' }) => {
1119
- return (React.createElement("tbody", { className: `bg-white divide-y divide-gray-200 ${className}` }, children));
1120
- };
1121
-
1122
- const TableCell = ({ children, className = '', as = 'td' }) => {
1123
- const Tag = as;
1124
- const baseClass = as === 'th' ? 'px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider' : 'px-6 py-4 whitespace-nowrap text-sm text-gray-500';
1125
- return (React.createElement(Tag, { className: `${baseClass} ${className}` }, children));
1126
- };
1127
-
1128
- const TableHead = ({ children, className = '' }) => {
1129
- return (React.createElement("thead", { className: `bg-gray-50 ${className}` }, children));
1130
- };
1131
-
1132
- const TableRow = ({ children, className = '' }) => {
1133
- return (React.createElement(motion.tr, { className: className, initial: { opacity: 0, x: -20 }, animate: { opacity: 1, x: 0 }, transition: { duration: 0.3 } }, children));
1134
- };
1135
-
1136
- const Tabs = ({ className = '', tabs, motionVariant = 'fadeIn', // Default motion variant
1137
- color = 'primary', // Color customization
1138
- }) => {
1139
- const [activeTab, setActiveTab] = useState(0);
1140
- const colorClasses = {
1141
- primary: 'text-blue-600 border-blue-500',
1142
- secondary: 'text-gray-600 border-gray-500',
1143
- success: 'text-green-600 border-green-500',
1144
- danger: 'text-red-600 border-red-500',
1145
- warning: 'text-yellow-600 border-yellow-500',
1146
- info: 'text-blue-400 border-blue-400',
1147
- };
1148
- return (React.createElement("div", { className: className },
1149
- React.createElement("div", { className: "border-b border-gray-200" },
1150
- React.createElement("nav", { className: "-mb-px flex space-x-8", "aria-label": "Tabs" }, tabs.map((tab, index) => (React.createElement("button", { key: index, className: `
1151
- whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm
1152
- ${activeTab === index
1153
- ? `${colorClasses[color]}`
1154
- : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'}
1155
- `, onClick: () => setActiveTab(index) }, tab.label))))),
1156
- React.createElement(motion.div, { key: activeTab, initial: { opacity: 0, y: 20 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3 }, variants: motionVariants[motionVariant], className: "mt-4" }, tabs[activeTab].content)));
1157
- };
1158
-
1159
- const Tooltip = ({ children, className = '', content, position = 'top', color = 'primary', motionVariant = 'fadeIn', }) => {
1160
- const [isVisible, setIsVisible] = useState(false);
1161
- const positionClasses = {
1162
- top: 'bottom-full left-1/2 transform -translate-x-1/2 mb-2',
1163
- right: 'left-full top-1/2 transform -translate-y-1/2 ml-2',
1164
- bottom: 'top-full left-1/2 transform -translate-x-1/2 mt-2',
1165
- left: 'right-full top-1/2 transform -translate-y-1/2 mr-2',
1166
- };
1167
- const colorClasses = {
1168
- primary: 'bg-blue-600',
1169
- secondary: 'bg-gray-600',
1170
- success: 'bg-green-600',
1171
- danger: 'bg-red-600',
1172
- warning: 'bg-yellow-500',
1173
- info: 'bg-blue-400',
1174
- };
1175
- return (React.createElement("div", { className: "relative inline-block" },
1176
- React.createElement("div", { onMouseEnter: () => setIsVisible(true), onMouseLeave: () => setIsVisible(false) }, children),
1177
- React.createElement(AnimatePresence, null, isVisible && (React.createElement(motion.div, { className: `absolute z-10 px-3 py-2 text-sm font-medium text-white rounded-lg shadow-sm ${positionClasses[position]} ${colorClasses[color]} ${className}`, initial: { opacity: 0, scale: 0.8 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: 0.8 }, transition: { duration: 0.2 }, variants: motionVariants[motionVariant] }, content)))));
1178
- };
1179
-
1180
- const Heading = ({ children, className = '', as = 'h2', size = 'md' }) => {
1181
- const Tag = as;
1182
- const sizeClasses = {
1183
- xs: 'text-lg',
1184
- sm: 'text-xl',
1185
- md: 'text-2xl',
1186
- lg: 'text-3xl',
1187
- xl: 'text-4xl',
1188
- };
1189
- return (React.createElement(motion.div, { initial: { opacity: 0, y: -20 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.5 } },
1190
- React.createElement(Tag, { className: `font-bold ${sizeClasses[size]} ${className}` }, children)));
1191
- };
1192
-
1193
- const Text = ({ children, className = '', size = 'md', weight = 'normal' }) => {
1194
- const sizeClasses = {
1195
- xs: 'text-xs',
1196
- sm: 'text-sm',
1197
- md: 'text-base',
1198
- lg: 'text-lg',
1199
- xl: 'text-xl',
1200
- };
1201
- const weightClasses = {
1202
- normal: 'font-normal',
1203
- medium: 'font-medium',
1204
- semibold: 'font-semibold',
1205
- bold: 'font-bold',
1206
- };
1207
- return (React.createElement("p", { className: `${sizeClasses[size]} ${weightClasses[weight]} ${className}` }, children));
1208
- };
1209
-
1210
- export { Accordion, Alert, Avatar, Badge, Breadcrumb, Button, Card, CardBody, CardFooter, CardHeader, Checkbox, Container, Dropdown, DropdownItem, FileUpload, Flex, Grid, Heading, IconButton, Input, List, ListItem, Modal, ModalBody, ModalFooter, ModalHeader, NavItem, Navbar, Offcanvas, OffcanvasBody, OffcanvasHeader, Pagination, ProgressBar, Radio, RangeSlider, Select, Skeleton, Slider, Stepper, Switch, Table, TableBody, TableCell, TableHead, TableRow, Tabs, Text, Textarea, Tooltip, motionVariants };