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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hds-web",
3
- "version": "1.29.9",
3
+ "version": "1.30.1",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -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-10 ml-6 w-10 rounded-full bg-purple-200 hover:bg-neutral-0 flex items-center justify-center';
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 sliderControl = isLeft => (
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
- <Icon height={'h-6 w-6'} variant={'chevronleft'} strokeColor='#00288E' />
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
- <Icon height={'h-6 w-6'} variant={'chevronright'} strokeColor='#00288E' />
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
- {sliderControl(true)}
134
- {sliderControl()}
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=" db:snap-center snap-center tb-m:snap-start mx-5 shrink-0" key={i} ref={refs[i]}>
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>
@@ -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
  }