my-animated-components 1.2.1 → 1.2.2

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/dist/index.js CHANGED
@@ -1,36 +1,6 @@
1
1
  import React, { useState, useRef, useEffect } from 'react';
2
2
  import { motion, AnimatePresence } from 'framer-motion';
3
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
4
  const motionVariants = {
35
5
  null: {},
36
6
  fadeIn: {
@@ -675,22 +645,39 @@ const Avatar = ({ className = '', size = 'md', src, alt, initials }) => {
675
645
 
676
646
  const Badge = ({ children, className = '', color = 'primary', size = 'md', motionVariant = 'fadeIn', // Default motion variant
677
647
  }) => {
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',
648
+ // Define the colors
649
+ const colorStyles = {
650
+ primary: '#E0F7FA', // bg-blue-100
651
+ secondary: '#F1F1F1', // bg-gray-100
652
+ success: '#E8F5E9', // bg-green-100
653
+ danger: '#FFEBEE', // bg-red-100
654
+ warning: '#FFFDE7', // bg-yellow-100
655
+ info: '#E8EAF6', // bg-indigo-100
685
656
  };
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',
657
+ const textColor = {
658
+ primary: '#00796B', // text-blue-800
659
+ secondary: '#757575', // text-gray-800
660
+ success: '#388E3C', // text-green-800
661
+ danger: '#C62828', // text-red-800
662
+ warning: '#FBC02D', // text-yellow-800
663
+ info: '#1976D2', // text-indigo-800
664
+ };
665
+ // Define the sizes
666
+ const sizeStyles = {
667
+ xs: { padding: '0.125rem 0.5rem', fontSize: '0.75rem' },
668
+ sm: { padding: '0.25rem 0.75rem', fontSize: '0.875rem' },
669
+ md: { padding: '0.375rem 1rem', fontSize: '1rem' },
670
+ lg: { padding: '0.5rem 1.25rem', fontSize: '1.125rem' },
671
+ xl: { padding: '0.625rem 1.5rem', fontSize: '1.25rem' },
672
+ };
673
+ // Generate custom styles dynamically
674
+ const customStyle = {
675
+ backgroundColor: colorStyles[color] || colorStyles.primary,
676
+ color: textColor[color] || textColor.primary,
677
+ padding: sizeStyles[size].padding,
678
+ fontSize: sizeStyles[size].fontSize,
692
679
  };
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));
680
+ return (React.createElement(motion.span, { className: `inline-flex items-center font-medium rounded-full ${className}`, style: customStyle, variants: motionVariants[motionVariant], initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: 0.3 } }, children));
694
681
  };
695
682
 
696
683
  const Breadcrumb = ({ className = '', items, motionVariant = 'fadeIn' }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-animated-components",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
@@ -1,7 +1,7 @@
1
1
  /** @type {import('tailwindcss').Config} */
2
2
  export default {
3
3
  content: [
4
- "./src/**/*.{js,jsx,ts,tsx}" // Update this based on your file structure
4
+ './src/**/*.{html,js,ts,tsx,jsx}',
5
5
  ],
6
6
  theme: {
7
7
  extend: {},