hds-web 0.1.0 → 0.1.2

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": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -6,18 +6,18 @@ import { Icon } from '../common-components/Icon';
6
6
  export default function HasConAvatar({ name, designation, size, imageUrl }) {
7
7
  const hasImageUrl = imageUrl && imageUrl.length > 0;
8
8
  return (
9
- <div className="group flex-shrink-0 rounded-2xl flex items-center justify-between bg-neutral-0 desk:inline-flex desk:flex-col shadow hover:shadow-xl">
9
+ <div className={`${size} sm:w-52 group flex-shrink-0 rounded-2xl flex items-center justify-between bg-neutral-0 desk:inline-flex desk:flex-col shadow hover:shadow-xl desk:min-w-[18rem]`}>
10
10
 
11
- <div className="ml-5 desk:flex-col desk:flex desk:items-center desk:p-8 desk:ml-0 bg-neutral-0">
11
+ <div className="mx-5 desk:flex-col desk:flex desk:items-center desk:p-8 desk:ml-0 bg-neutral-0">
12
12
  <Typography textStyle='body1c-bold' className='text-blue-400'>{name}</Typography>
13
13
  <Typography textStyle='body3c-medium' className='text-blue-800'>{designation}</Typography>
14
14
  </div>
15
- <div className='relative'>
15
+ <div className='relative '>
16
16
  <img
17
- className={`inline-block max-w-[150px] desk:max-w-[289px] desk:rounded-2xl border-neutral-0 rounded-r-2xl hover:bg-gradient-to-t hover:from-amber-200 hover:from-0% hover:to-95% hover:to-neutral-0`}
17
+ className={`inline-block w-[9rem] desk:min-w-[18rem] desk:rounded-2xl border-neutral-0 rounded-r-2xl `}
18
18
  src={imageUrl}
19
19
  />
20
- <div className="absolute rounded-2xl inset-0 group-hover:bg-gradient-to-t group-hover:from-amber-200 group-hover:to-transparent group-hover:opacity-30" ></div>
20
+ <div className="absolute rounded-b-2xl inset-0 group-hover:bg-gradient-to-t group-hover:from-amber-200 group-hover:to-transparent group-hover:opacity-30" ></div>
21
21
  </div>
22
22
 
23
23
 
@@ -19,11 +19,13 @@ const Buttonclasses = {
19
19
  },
20
20
  'disabled': 'bg-neutral-200 text-neutral-400',
21
21
  },
22
- 'outline': {
22
+ 'secondary': {
23
23
  'default': {
24
- 'base': 'desk:w-fit tab:w-fit w-full justify-center border border-neutral-400 bg-neutral-0 text-neutral-800',
25
- 'hover': 'hover:text-neutral-800 hover:bg-neutral-100 hover:border hover:border-neutral-400 hover:drop-shadow-[0px 1px 3px rgba(28, 38, 63, 0.1), 0px 1px 2px rgba(28, 38, 63, 0.06)]',
26
- 'focus': 'focus:bg-neutral-0 focus:text-neutral-800 focus:border border-neutral-400 focus:shadow-[0px_0px_0px_4px_#F3F4F6] focus:outline-none',
24
+ 'base': 'desk:w-fit tab:w-fit w-full justify-center border-2 border-blue-500 bg-neutral-0 text-blue-500',
25
+
26
+ 'hover': 'hover:text-neutral-800 hover:bg-blue-200 hover:border-2 hover:border-blue-500 hover:shadow hover:text-blue-500',
27
+
28
+ 'focus': 'focus:bg-blue-200 focus:text-neutral-800 focus:border-2 border-blue-500 focus:shadow-[0px_0px_0px_4px_#DFE8FF] focus:outline-none focus:text-blue-500',
27
29
  },
28
30
  'disabled': 'bg-neutral-200 text-neutral-400',
29
31
  },
@@ -53,7 +55,7 @@ const Buttonclasses = {
53
55
  },
54
56
  'iconOnly': {
55
57
  'default': {
56
- 'base': 'desk:w-fit tab:w-fit w-full justify-center justify-center bg-blue-200 rounded-full',
58
+ 'base': 'w-fit justify-center justify-center bg-blue-200 rounded-full p-1.5',
57
59
 
58
60
  'hover': 'hover:bg-blue-600 hover:shadow',
59
61
 
@@ -80,15 +80,40 @@ export default function Carouseltest(props) {
80
80
  </button>
81
81
  );
82
82
  return (
83
- <div>
84
- <div className="flex">
85
- {sliderControl(true)}
86
- {sliderControl()}
87
- </div>
88
- <div className=" justify-center select-none items-center">
89
-
83
+ <div className="">
84
+ <div className="block sm:hidden">
85
+ {props.cards.map((item, i) => (
86
+ <div className="my-5" key={i} ref={refs[i]}>
87
+ <div className="rounded-3xl ">
88
+ {React.createElement(props.component, item)}
89
+ </div>
90
+
91
+ </div>
92
+ ))}
93
+ </div>
94
+
95
+ <div className="invisible sm:visible">
96
+ <div className="flex ">
97
+ {sliderControl(true)}
98
+ {sliderControl()}
99
+ </div>
100
+ <div className="justify-center select-none items-center"
101
+ onTouchStart={handleTouchStart}
102
+ onTouchMove={handleTouchMove}
103
+ onTouchEnd={handleTouchEnd}
104
+ onMouseDown={e => setTouchStart(e.clientX)}
105
+ onMouseUp={e => {
106
+ if (touchStart - e.clientX > 50) {
107
+ nextCard();
108
+ }
109
+
110
+ if (touchStart - e.clientX < -50) {
111
+ previousCard();
112
+ }
113
+ }}
114
+ >
90
115
  <div className="">
91
- <div className="snap-x w-1/2 inline-flex select-none overflow-x-hidden scrollbar-hide">
116
+ <div className={`snap-x ${props.carouselWidth} inline-flex select-none overflow-x-hidden scrollbar-hide`}>
92
117
 
93
118
  {props.cards.map((item, i) => (
94
119
  <div className="snap-center mx-5 shrink-0" key={i} ref={refs[i]}>
@@ -98,10 +123,12 @@ export default function Carouseltest(props) {
98
123
 
99
124
  </div>
100
125
  ))}
101
-
126
+
102
127
  </div>
103
128
  </div>
104
129
  </div>
130
+ </div>
131
+
105
132
  </div>
106
133
  );
107
134
  };
package/src/index.css CHANGED
@@ -2,11 +2,13 @@
2
2
  @tailwind components;
3
3
  @tailwind utilities;
4
4
  /* Typography classes */
5
+
5
6
  .scrollbar-hide::-webkit-scrollbar {
6
7
  width: 0;
7
8
  height: 0;
8
9
  }
9
-
10
+
11
+
10
12
  .display-2xl-bold {
11
13
  @apply text-7xl font-bold;
12
14
  letter-spacing: -0.015em;
@@ -178,38 +180,38 @@
178
180
  }
179
181
 
180
182
  .code-lg {
181
- @apply text-lg font-normal ;
182
-
183
+ @apply text-lg font-normal;
184
+
183
185
  }
184
186
 
185
187
  .code-md {
186
- @apply text-base font-normal ;
188
+ @apply text-base font-normal;
187
189
  }
188
190
 
189
191
  .code-sm {
190
- @apply text-sm font-normal ;
192
+ @apply text-sm font-normal;
191
193
  }
192
194
 
193
195
 
194
- .button-sm{
195
- @apply text-sm-medium py-2 px-4 rounded-full;
196
+ .button-sm {
197
+ @apply text-hds-d-body3c-medium py-1.5 px-4 rounded-full;
196
198
 
197
199
  }
198
200
 
199
- .button-md{
200
- @apply text-sm-medium rounded-full py-2.5 px-5;
201
+ .button-md {
202
+ @apply text-hds-d-body3c-medium rounded-full py-2.5 px-5;
201
203
  }
202
204
 
203
- .button-lg{
204
- @apply text-md-medium rounded-full py-2.5 px-6;
205
+ .button-lg {
206
+ @apply text-hds-d-body1c-medium rounded-full py-3 px-6;
205
207
 
206
208
  }
207
209
 
208
- .button-xl{
210
+ .button-xl {
209
211
  @apply text-md-medium rounded-full py-3 px-7;
210
212
  }
211
213
 
212
- .button-2xl{
214
+ .button-2xl {
213
215
  @apply text-lg-medium rounded-full py-4 px-8;
214
216
 
215
217
  }
@@ -217,8 +219,8 @@
217
219
  .language-javascript {
218
220
  background-color: transparent !important;
219
221
  padding: 0 !important;
220
- }
222
+ }
221
223
 
222
- .token.operator {
224
+ .token.operator {
223
225
  background: none !important;
224
226
  }