my-animated-components 1.2.8 → 1.3.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.
- package/LICENSE +9 -0
- package/dist/index.js +61 -15
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Mukesh Kumar Singh
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is provided to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/dist/index.js
CHANGED
|
@@ -680,14 +680,21 @@ const Badge = ({ children, className = '', color = 'primary', size = 'md', motio
|
|
|
680
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));
|
|
681
681
|
};
|
|
682
682
|
|
|
683
|
-
const Breadcrumb = ({ className = '', items, motionVariant = 'fadeIn' }) => {
|
|
683
|
+
const Breadcrumb = ({ className = '', items, motionVariant = 'fadeIn', color = 'primary' }) => {
|
|
684
|
+
// Color classes for breadcrumb
|
|
685
|
+
const colorClasses = {
|
|
686
|
+
primary: 'text-blue-600 hover:text-blue-800',
|
|
687
|
+
secondary: 'text-gray-600 hover:text-gray-800',
|
|
688
|
+
success: 'text-green-600 hover:text-green-800',
|
|
689
|
+
danger: 'text-red-600 hover:text-red-800',
|
|
690
|
+
warning: 'text-yellow-600 hover:text-yellow-800',
|
|
691
|
+
info: 'text-blue-400 hover:text-blue-500',
|
|
692
|
+
};
|
|
684
693
|
return (React.createElement(motion.nav, { className: `flex ${className}`, "aria-label": "Breadcrumb", variants: motionVariants[motionVariant], initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: 0.3 } },
|
|
685
694
|
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" },
|
|
686
695
|
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" },
|
|
687
696
|
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" }))),
|
|
688
|
-
React.createElement("a", { href: item.href, className: `ml-1 text-sm font-medium ${index === items.length - 1
|
|
689
|
-
? 'text-gray-500 hover:text-gray-700'
|
|
690
|
-
: 'text-blue-600 hover:text-blue-800'}` }, item.label)))))));
|
|
697
|
+
React.createElement("a", { href: item.href, className: `ml-1 text-sm font-medium ${index === items.length - 1 ? 'text-gray-500 hover:text-gray-700' : colorClasses[color]}` }, item.label)))))));
|
|
691
698
|
};
|
|
692
699
|
|
|
693
700
|
const Card = ({ children, className = '', motionVariant = 'fadeIn' }) => {
|
|
@@ -768,7 +775,7 @@ motionVariant = 'fadeIn', // Default motion variant
|
|
|
768
775
|
React.createElement("input", { type: "file", ref: fileInputRef, onChange: handleChange, accept: accept, multiple: multiple, className: "hidden" })));
|
|
769
776
|
};
|
|
770
777
|
|
|
771
|
-
const Input = ({ className = '', size = 'md', type = 'text', placeholder, value, onChange, }) => {
|
|
778
|
+
const Input = ({ className = '', size = 'md', type = 'text', placeholder, value, onChange, color = 'primary', textColor = 'black', }) => {
|
|
772
779
|
const sizeClasses = {
|
|
773
780
|
xs: 'px-2 py-1 text-xs',
|
|
774
781
|
sm: 'px-3 py-2 text-sm',
|
|
@@ -776,8 +783,24 @@ const Input = ({ className = '', size = 'md', type = 'text', placeholder, value,
|
|
|
776
783
|
lg: 'px-4 py-3 text-lg',
|
|
777
784
|
xl: 'px-5 py-4 text-xl',
|
|
778
785
|
};
|
|
786
|
+
const colorClasses = {
|
|
787
|
+
primary: 'border-blue-300 focus:ring-blue-500 focus:border-blue-500',
|
|
788
|
+
secondary: 'border-gray-300 focus:ring-gray-500 focus:border-gray-500',
|
|
789
|
+
success: 'border-green-300 focus:ring-green-500 focus:border-green-500',
|
|
790
|
+
danger: 'border-red-300 focus:ring-red-500 focus:border-red-500',
|
|
791
|
+
warning: 'border-yellow-300 focus:ring-yellow-500 focus:border-yellow-500',
|
|
792
|
+
info: 'border-blue-400 focus:ring-blue-500 focus:border-blue-500',
|
|
793
|
+
};
|
|
794
|
+
const textColorClasses = {
|
|
795
|
+
black: 'text-black',
|
|
796
|
+
gray: 'text-gray-700',
|
|
797
|
+
white: 'text-white',
|
|
798
|
+
blue: 'text-blue-600',
|
|
799
|
+
green: 'text-green-600',
|
|
800
|
+
red: 'text-red-600',
|
|
801
|
+
};
|
|
779
802
|
return (React.createElement(motion.div, { initial: { opacity: 0, x: -20 }, animate: { opacity: 1, x: 0 }, transition: { duration: 0.3 } },
|
|
780
|
-
React.createElement("input", { type: type, className: `w-full
|
|
803
|
+
React.createElement("input", { type: type, className: `w-full rounded-md ${sizeClasses[size]} ${colorClasses[color]} ${textColorClasses[textColor]} ${className} focus:outline-none focus:ring-2`, placeholder: placeholder, value: value, onChange: onChange })));
|
|
781
804
|
};
|
|
782
805
|
|
|
783
806
|
const Radio = ({ className = '', label, name, value, checked, onChange, color = 'primary', size = 'md', motionVariant = 'fadeIn', }) => {
|
|
@@ -1079,17 +1102,40 @@ motionVariant = 'fadeIn', // Default motion variant
|
|
|
1079
1102
|
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" })));
|
|
1080
1103
|
};
|
|
1081
1104
|
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1105
|
+
const colorClasses = {
|
|
1106
|
+
primary: { active: 'bg-blue-600 text-white', inactive: 'bg-blue-200 text-white', connector: 'bg-blue-200' },
|
|
1107
|
+
secondary: { active: 'bg-gray-600 text-white', inactive: 'bg-gray-200 text-white', connector: 'bg-gray-200' },
|
|
1108
|
+
success: { active: 'bg-green-600 text-white', inactive: 'bg-green-200 text-white', connector: 'bg-green-200' },
|
|
1109
|
+
danger: { active: 'bg-red-600 text-white', inactive: 'bg-red-200 text-white', connector: 'bg-red-200' },
|
|
1110
|
+
warning: { active: 'bg-yellow-500 text-black', inactive: 'bg-yellow-100 text-black', connector: 'bg-yellow-100' },
|
|
1111
|
+
info: { active: 'bg-teal-500 text-white', inactive: 'bg-teal-200 text-white', connector: 'bg-teal-200' },
|
|
1112
|
+
};
|
|
1113
|
+
const Stepper = ({ className = '', steps, currentStep, color = {
|
|
1114
|
+
active: 'primary',
|
|
1115
|
+
inactive: 'primary',
|
|
1116
|
+
connector: 'primary',
|
|
1117
|
+
}, size = 'md', orientation = 'horizontal', }) => {
|
|
1118
|
+
const sizeClasses = {
|
|
1119
|
+
xs: 'w-5 h-5 text-xs',
|
|
1120
|
+
sm: 'w-6 h-6 text-sm',
|
|
1121
|
+
md: 'w-8 h-8 text-base',
|
|
1122
|
+
lg: 'w-10 h-10 text-lg',
|
|
1123
|
+
xl: 'w-12 h-12 text-xl',
|
|
1124
|
+
};
|
|
1125
|
+
const isVertical = orientation === 'vertical';
|
|
1126
|
+
const activeColorClass = colorClasses[color.active || 'primary'].active;
|
|
1127
|
+
const inactiveColorClass = colorClasses[color.inactive || 'primary'].inactive;
|
|
1128
|
+
const connectorColorClass = colorClasses[color.connector || 'primary'].connector;
|
|
1129
|
+
return (React.createElement("div", { className: `flex ${isVertical ? 'flex-col' : 'items-center'} ${className}` }, steps.map((step, index) => (React.createElement(React.Fragment, { key: index },
|
|
1130
|
+
React.createElement("div", { className: `flex ${isVertical ? 'flex-col items-center' : 'items-center'}` },
|
|
1131
|
+
React.createElement("div", { className: `flex items-center justify-center rounded-full ${index < currentStep
|
|
1132
|
+
? activeColorClass
|
|
1087
1133
|
: index === currentStep
|
|
1088
|
-
?
|
|
1089
|
-
:
|
|
1134
|
+
? `border-2 ${inactiveColorClass}`
|
|
1135
|
+
: inactiveColorClass} ${sizeClasses[size]}` }, index < currentStep ? (React.createElement("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20" },
|
|
1090
1136
|
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)),
|
|
1091
|
-
index < steps.length - 1 && (React.createElement("div", { className: `flex-1 h-1 mx-2 ${index < currentStep ?
|
|
1092
|
-
|
|
1137
|
+
index < steps.length - 1 && (React.createElement("div", { className: `flex-1 ${isVertical ? 'w-1 h-8' : 'h-1 mx-2'} ${index < currentStep ? activeColorClass : connectorColorClass}` }))),
|
|
1138
|
+
React.createElement("div", { className: `${isVertical ? 'text-center mt-2 mb-4' : 'hidden sm:block text-xs text-center mx-2'}` }, step))))));
|
|
1093
1139
|
};
|
|
1094
1140
|
|
|
1095
1141
|
const Table = ({ children, className = '', motionVariant = 'fadeIn', // Default motion variant
|