apex-ui-kit 2.0.5 → 2.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apex-ui-kit",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "license": "MIT",
5
5
  "description": "Apex UI Kit - A React component library for building modern user interfaces",
6
6
  "keywords": [
@@ -1,111 +0,0 @@
1
- /* eslint-disable no-unused-vars */
2
- import React, { useState, useEffect, useRef } from "react";
3
- import { motion, AnimatePresence } from "framer-motion";
4
- import { FaExternalLinkAlt, FaGithub, FaRegImage } from "react-icons/fa";
5
- const CARD_STACK_OFFSET = 32;
6
- const CARD_SCALE_STEP = 0.08;
7
- const AUTO_CYCLE_INTERVAL = 5000;
8
- export default function GlassCardStack({
9
- cards = [],
10
- autoCycle = true,
11
- cycleInterval = AUTO_CYCLE_INTERVAL,
12
- }) {
13
- const [active, setActive] = useState(0);
14
- const [paused, setPaused] = useState(false);
15
- const timeoutRef = useRef();
16
-
17
- useEffect(() => {
18
- if (!autoCycle || paused) return;
19
- timeoutRef.current = setTimeout(() => {
20
- setActive((prev) => (prev + 1) % cards.length);
21
- }, cycleInterval);
22
- return () => clearTimeout(timeoutRef.current);
23
- }, [active, paused, autoCycle, cycleInterval, cards.length]);
24
-
25
- // For cycling animation
26
- const getCardIndex = (i) => (active + i) % cards.length;
27
-
28
- return (
29
- <div
30
- className="relative flex justify-center items-center h-[340px] md:h-[400px] w-full max-w-lg mx-auto select-none"
31
- onMouseEnter={() => setPaused(true)}
32
- onMouseLeave={() => setPaused(false)}
33
- >
34
- {cards.map((_, i) => {
35
- // Stack order: 0 is top, 1 is next, etc.
36
- const idx = getCardIndex(i);
37
- const isTop = i === 0;
38
- const z = cards.length - i;
39
- const offset = i * CARD_STACK_OFFSET;
40
- const scale = 1 - i * CARD_SCALE_STEP;
41
- const card = cards[idx];
42
- return (
43
- <AnimatePresence key={idx}>
44
- <motion.div
45
- key={idx}
46
- initial={{
47
- y: 60,
48
- opacity: 0,
49
- scale: scale * 0.95,
50
- }}
51
- animate={{
52
- y: -offset,
53
- opacity: 1,
54
- scale,
55
- zIndex: z,
56
- filter: isTop ? "none" : "blur(2px)",
57
- }}
58
- exit={{
59
- y: -100,
60
- opacity: 0,
61
- scale: scale * 0.95,
62
- }}
63
- transition={{ type: "spring", stiffness: 300, damping: 30 }}
64
- className={`absolute left-0 right-0 mx-auto w-11/12 md:w-96 h-48 md:h-60 rounded-3xl shadow-xl bg-gradient-to-br ${card.color} backdrop-blur-lg border border-white/20 flex flex-row items-center px-3 md:px-6 py-4 cursor-pointer select-none ${isTop ? "" : "pointer-events-none"}`}
65
- style={{ zIndex: z }}
66
- >
67
- {/* Left: Responsive Image */}
68
- <div className="flex-shrink-0 flex items-center justify-center w-16 h-16 md:w-24 md:h-24 lg:w-28 lg:h-28 rounded-xl overflow-hidden bg-white/10 border border-white/20 mr-3 md:mr-6">
69
- {card.image ? (
70
- <img
71
- src={card.image}
72
- alt={card.title}
73
- className="object-cover w-full h-full"
74
- />
75
- ) : (
76
- <FaRegImage className="text-3xl text-white/40" />
77
- )}
78
- </div>
79
- {/* Right: Info */}
80
- <div className="flex-1 flex flex-col justify-center gap-1 md:gap-2">
81
- <div className="flex items-center gap-2">
82
- <h2 className="text-base md:text-xl font-bold text-white drop-shadow">
83
- {card.title}
84
- </h2>
85
- {card.github && (
86
- <a href={card.github} target="_blank" rel="noopener noreferrer" className="text-white/70 hover:text-white ml-1">
87
- <FaGithub className="inline-block align-middle text-lg md:text-xl" />
88
- </a>
89
- )}
90
- </div>
91
- <p className="text-xs md:text-sm text-white/60 mb-1">{card.subtitle}</p>
92
- <p className="text-xs md:text-base text-white/80 mb-1 line-clamp-2">{card.desc}</p>
93
- {card.link && (
94
- <a
95
- href={card.link}
96
- target="_blank"
97
- rel="noopener noreferrer"
98
- className="inline-flex items-center gap-1 text-xs md:text-sm px-2 py-1 rounded bg-blue-500/80 hover:bg-blue-600/90 text-white font-semibold shadow transition w-fit mt-1"
99
- >
100
- <FaExternalLinkAlt className="inline-block mr-1 text-xs md:text-sm" />
101
- Visit
102
- </a>
103
- )}
104
- </div>
105
- </motion.div>
106
- </AnimatePresence>
107
- );
108
- })}
109
- </div>
110
- );
111
- }