next-helios-fe 1.4.16 → 1.4.17
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
@@ -5,6 +5,7 @@ import { Carousel as Cr } from "flowbite-react";
|
|
5
5
|
interface CarouselProps {
|
6
6
|
children: React.ReactNode;
|
7
7
|
options?: {
|
8
|
+
variant?: "basic" | "primary";
|
8
9
|
interval?: number;
|
9
10
|
pauseOnHover?: boolean;
|
10
11
|
};
|
@@ -12,18 +13,54 @@ interface CarouselProps {
|
|
12
13
|
|
13
14
|
export const Carousel: React.FC<CarouselProps> = ({ children, options }) => {
|
14
15
|
const childrenList = React.Children.toArray(children);
|
16
|
+
const variant =
|
17
|
+
options?.variant === "primary"
|
18
|
+
? "bg-gradient-to-r from-primary to-primary-dark text-white"
|
19
|
+
: "bg-secondary-bg";
|
15
20
|
|
16
21
|
return (
|
17
|
-
<div className="h-full">
|
22
|
+
<div className="h-full overflow-hidden">
|
18
23
|
<Cr
|
19
24
|
slideInterval={options?.interval || 5000}
|
20
25
|
pauseOnHover={options?.pauseOnHover ?? false}
|
26
|
+
theme={{
|
27
|
+
root: {
|
28
|
+
base: "relative h-full w-full shadow-md",
|
29
|
+
leftControl:
|
30
|
+
"absolute left-0 top-0 flex h-full items-center justify-center px-4 focus:outline-none",
|
31
|
+
rightControl:
|
32
|
+
"absolute right-0 top-0 flex h-full items-center justify-center px-4 focus:outline-none",
|
33
|
+
},
|
34
|
+
indicators: {
|
35
|
+
active: {
|
36
|
+
off:
|
37
|
+
options?.variant === "primary"
|
38
|
+
? "bg-white/50 hover:bg-white/70"
|
39
|
+
: "bg-primary-transparent hover:bg-primary-light",
|
40
|
+
on: options?.variant === "primary" ? "bg-white" : "bg-primary",
|
41
|
+
},
|
42
|
+
base: "h-3 w-3 rounded-full",
|
43
|
+
wrapper: `absolute bottom-4 left-1/2 flex -translate-x-1/2 space-x-3 px-2 py-0.5 rounded-full ${
|
44
|
+
options?.variant === "primary" ? "bg-white/30" : "bg-primary-transparent"
|
45
|
+
}`,
|
46
|
+
},
|
47
|
+
control: {
|
48
|
+
base:
|
49
|
+
options?.variant === "primary"
|
50
|
+
? "inline-flex h-8 w-8 items-center justify-center rounded-full bg-white/30 group-hover:bg-white/50 group-focus:outline-none sm:h-10 sm:w-10"
|
51
|
+
: "inline-flex h-8 w-8 items-center justify-center rounded-full bg-primary-transparent group-hover:bg-primary-light group-focus:outline-none sm:h-10 sm:w-10",
|
52
|
+
icon:
|
53
|
+
options?.variant === "primary"
|
54
|
+
? "h-5 w-5 text-white sm:h-6 sm:w-6"
|
55
|
+
: "h-5 w-5 text-primary sm:h-6 sm:w-6",
|
56
|
+
},
|
57
|
+
}}
|
21
58
|
>
|
22
59
|
{childrenList?.map((item, index) => {
|
23
60
|
return (
|
24
61
|
<div
|
25
62
|
key={index}
|
26
|
-
className=
|
63
|
+
className={`relative grid w-full h-full p-6 rounded-md shadow-md overflow-hidden ${variant}`}
|
27
64
|
>
|
28
65
|
{item}
|
29
66
|
</div>
|