hds-web 1.29.9 → 1.30.1
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.css +1 -1
- package/dist/index.es.css +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/HDS/components/Carousels/carouselB.js +47 -17
- package/src/styles/tailwind.css +5 -5
package/package.json
CHANGED
@@ -58,25 +58,55 @@ export default function HomePageCarousel(props) {
|
|
58
58
|
|
59
59
|
const maxVisibleCards = 6;
|
60
60
|
|
61
|
-
const arrowStyle = ' text-2xl z-10 bg-black h-
|
61
|
+
const arrowStyle = ' text-2xl z-10 bg-black h-12 w-12 ml-6 w-10 rounded-full bg-neutral-0 hover:bg-neutral-0 flex items-center justify-center shadow';
|
62
62
|
|
63
|
-
const
|
63
|
+
const disableButton = (current, dir) => {
|
64
|
+
if (dir === 'isLeft') {
|
65
|
+
if (current === 0) return true;
|
66
|
+
else return false
|
67
|
+
}
|
68
|
+
|
69
|
+
if (dir === 'isRight') {
|
70
|
+
if (current === 2) return true;
|
71
|
+
else return false
|
72
|
+
}
|
73
|
+
|
74
|
+
|
75
|
+
}
|
76
|
+
|
77
|
+
const sliderLeftControl = () => (
|
64
78
|
<button
|
65
79
|
type="button"
|
66
|
-
onClick={isLeft ? previousCard : nextCard}
|
67
|
-
className={`flex ${arrowStyle} ${isLeft ? '' : ''}`}
|
68
|
-
|
69
|
-
>
|
70
|
-
<span role="img" aria-label={`Arrow ${isLeft ? 'left' : 'right'}`}>
|
71
|
-
{isLeft ?
|
72
80
|
|
73
|
-
|
81
|
+
onClick={() => {
|
74
82
|
|
75
|
-
|
83
|
+
previousCard();
|
84
|
+
}}
|
85
|
+
className={`flex bg-blue-600 ${arrowStyle} disabled:bg-neutral-200 `}
|
86
|
+
disabled={disableButton(currentCard, 'isLeft')} // Disable the button if it's the last card
|
87
|
+
>
|
88
|
+
<span role="img" aria-label={`Arrow left `}>
|
89
|
+
{(
|
90
|
+
<Icon height={'h-6 w-6 stroke-[1.5]'} variant={'arrowleft'} strokeColor='#1F2A37' />
|
91
|
+
)}
|
92
|
+
</span>
|
93
|
+
</button>
|
94
|
+
);
|
95
|
+
const sliderRightControl = () => (
|
96
|
+
<button
|
97
|
+
type="button"
|
76
98
|
|
77
|
-
|
99
|
+
onClick={() => {
|
78
100
|
|
79
|
-
|
101
|
+
nextCard();
|
102
|
+
}}
|
103
|
+
className={`flex bg-blue-600 ${arrowStyle} disabled:bg-neutral-200 `}
|
104
|
+
disabled={disableButton(currentCard, 'isRight')} // Disable the button if it's the last card
|
105
|
+
>
|
106
|
+
<span role="img" aria-label={`Arrow right `}>
|
107
|
+
{(
|
108
|
+
<Icon height={'h-6 w-6 stroke-[1.5]'} variant={'arrowright'} strokeColor='#1F2A37' />
|
109
|
+
)}
|
80
110
|
</span>
|
81
111
|
</button>
|
82
112
|
);
|
@@ -130,8 +160,8 @@ export default function HomePageCarousel(props) {
|
|
130
160
|
<div className="flex pt-10 justify-center items-center">
|
131
161
|
{/* {slider()} */}
|
132
162
|
<div className="flex">
|
133
|
-
{
|
134
|
-
{
|
163
|
+
{sliderLeftControl()}
|
164
|
+
{sliderRightControl()}
|
135
165
|
</div>
|
136
166
|
</div>
|
137
167
|
<div className="justify-center select-none items-center"
|
@@ -143,18 +173,18 @@ export default function HomePageCarousel(props) {
|
|
143
173
|
>
|
144
174
|
|
145
175
|
{props.cards.map((item, i) => (
|
146
|
-
<div className="
|
176
|
+
<div className="snap-center mx-5 shrink-0" key={i} ref={refs[i]}>
|
147
177
|
<div className="w-full select-none rounded-3xl object-contain">
|
148
178
|
{React.createElement(props.component, item)}
|
149
179
|
</div>
|
150
180
|
|
151
181
|
</div>
|
152
182
|
))}
|
153
|
-
<div className="db:snap-center snap-center tb-m:snap-start mx-5 shrink-0" key={totalCards}>
|
183
|
+
{/* <div className="db:snap-center snap-center tb-m:snap-start mx-5 shrink-0" key={totalCards}>
|
154
184
|
<div className="w-full select-none rounded-3xl object-contain">
|
155
185
|
{React.createElement(props.component, props.cards[0])}
|
156
186
|
</div>
|
157
|
-
</div>
|
187
|
+
</div> */}
|
158
188
|
|
159
189
|
|
160
190
|
</div>
|
package/src/styles/tailwind.css
CHANGED
@@ -11298,6 +11298,11 @@ select{
|
|
11298
11298
|
padding-right: 2.5rem;
|
11299
11299
|
}
|
11300
11300
|
|
11301
|
+
.tb\:px-2{
|
11302
|
+
padding-left: 0.5rem;
|
11303
|
+
padding-right: 0.5rem;
|
11304
|
+
}
|
11305
|
+
|
11301
11306
|
.tb\:px-3{
|
11302
11307
|
padding-left: 0.75rem;
|
11303
11308
|
padding-right: 0.75rem;
|
@@ -11343,11 +11348,6 @@ select{
|
|
11343
11348
|
padding-bottom: 0.5rem;
|
11344
11349
|
}
|
11345
11350
|
|
11346
|
-
.tb\:px-2{
|
11347
|
-
padding-left: 0.5rem;
|
11348
|
-
padding-right: 0.5rem;
|
11349
|
-
}
|
11350
|
-
|
11351
11351
|
.tb\:pb-0{
|
11352
11352
|
padding-bottom: 0px;
|
11353
11353
|
}
|