hds-web 0.1.4 → 0.1.5

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.4",
3
+ "version": "0.1.5",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -0,0 +1,4 @@
1
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M6.90242 4.54755L7.31044 5.17685C8.69886 4.27665 10.3575 3.75351 12.1427 3.75351C13.9278 3.75351 15.5864 4.27665 16.9749 5.17685L16.9753 5.17712C17.7616 5.68623 18.8113 5.5224 19.3973 4.78435L19.4205 4.75511L19.4407 4.72371L20.4859 3.09894C20.7832 3.70359 21.0075 4.58795 21.1085 5.56141C21.2297 6.72912 21.1571 7.86576 20.9257 8.57919L20.9256 8.57948C20.6977 9.28328 20.6295 10.0391 20.7649 10.7837L20.7656 10.7873C20.8793 11.3956 20.98 12.0679 20.98 12.5018C20.98 17.3253 17.0299 21.2502 12.1404 21.2502C7.25292 21.2502 3.30071 17.3274 3.30071 12.5018C3.30071 12.0679 3.40144 11.3956 3.51518 10.7873L3.51536 10.7863C3.65353 10.0418 3.58819 9.28511 3.35967 8.57948L3.35949 8.57893C3.12825 7.86674 3.05558 6.73078 3.17677 5.56302C3.2778 4.58962 3.50216 3.70474 3.79965 3.09928L4.84456 4.72371L4.86593 4.75693L4.89067 4.78773C5.47582 5.516 6.52292 5.68922 7.31143 5.17621L6.90242 4.54755ZM6.90242 4.54755C6.43885 4.84916 5.82074 4.74787 5.47533 4.31797L3.37457 2.33707C2.38099 3.80178 2.09419 7.11061 2.64616 8.81055C2.83931 9.40701 2.89158 10.0372 2.77796 10.6494C2.66434 11.2572 2.55071 11.9909 2.55071 12.5018C2.55071 17.7484 6.84561 22.0002 12.1404 22.0002C17.4374 22.0002 21.73 17.7462 21.73 12.5018C21.73 11.9909 21.6164 11.2572 21.5028 10.6494C21.3914 10.0372 21.446 9.40701 21.6391 8.81055C22.1911 7.10851 21.9043 3.79969 20.9108 2.33684C20.8129 2.19276 20.641 2.12476 20.4674 2.13837C20.2979 2.15166 20.1444 2.24341 20.0525 2.38638L18.81 4.31797C18.4668 4.75012 17.8487 4.84916 17.3829 4.54755C15.8763 3.57071 14.0765 3.00351 12.1427 3.00351C10.2088 3.00351 8.40904 3.57071 6.90242 4.54755Z" stroke-width="1.5"/>
3
+ <path d="M12.4 12.5L10 15M10.8 10L14 15" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M6.90242 4.54755L7.31044 5.17685C8.69886 4.27665 10.3575 3.75351 12.1427 3.75351C13.9278 3.75351 15.5864 4.27665 16.9749 5.17685L16.9753 5.17712C17.7616 5.68623 18.8113 5.5224 19.3973 4.78435L19.4205 4.75511L19.4407 4.72371L20.4859 3.09894C20.7832 3.70359 21.0075 4.58795 21.1085 5.56141C21.2297 6.72912 21.1571 7.86576 20.9257 8.57919L20.9256 8.57948C20.6977 9.28328 20.6295 10.0391 20.7649 10.7837L20.7656 10.7873C20.8793 11.3956 20.98 12.0679 20.98 12.5018C20.98 17.3253 17.0299 21.2502 12.1404 21.2502C7.25292 21.2502 3.30071 17.3274 3.30071 12.5018C3.30071 12.0679 3.40144 11.3956 3.51518 10.7873L3.51536 10.7863C3.65353 10.0418 3.58819 9.28511 3.35967 8.57948L3.35949 8.57893C3.12825 7.86674 3.05558 6.73078 3.17677 5.56302C3.2778 4.58962 3.50216 3.70474 3.79965 3.09928L4.84456 4.72371L4.86593 4.75693L4.89067 4.78773C5.47582 5.516 6.52292 5.68922 7.31143 5.17621L6.90242 4.54755ZM6.90242 4.54755C6.43885 4.84916 5.82074 4.74787 5.47533 4.31797L3.37457 2.33707C2.38099 3.80178 2.09419 7.11061 2.64616 8.81055C2.83931 9.40701 2.89158 10.0372 2.77796 10.6494C2.66434 11.2572 2.55071 11.9909 2.55071 12.5018C2.55071 17.7484 6.84561 22.0002 12.1404 22.0002C17.4374 22.0002 21.73 17.7462 21.73 12.5018C21.73 11.9909 21.6164 11.2572 21.5028 10.6494C21.3914 10.0372 21.446 9.40701 21.6391 8.81055C22.1911 7.10851 21.9043 3.79969 20.9108 2.33684C20.8129 2.19276 20.641 2.12476 20.4674 2.13837C20.2979 2.15166 20.1444 2.24341 20.0525 2.38638L18.81 4.31797C18.4668 4.75012 17.8487 4.84916 17.3829 4.54755C15.8763 3.57071 14.0765 3.00351 12.1427 3.00351C10.2088 3.00351 8.40904 3.57071 6.90242 4.54755Z" stroke="black" stroke-width="1.5"/>
3
+ <path d="M12.4 12.5L10 15M10.8 10L14 15" stroke="#000615" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4
+ </svg>
@@ -1,3 +1,3 @@
1
1
  <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M9 18L15 12L9 6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
2
+ <path d="M9 18L15 12L9 6" stroke-linecap="round" stroke-linejoin="round"/>
3
3
  </svg>
@@ -1,4 +1,11 @@
1
- <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M6.90242 4.54755L7.31044 5.17685C8.69886 4.27665 10.3575 3.75351 12.1427 3.75351C13.9278 3.75351 15.5864 4.27665 16.9749 5.17685L16.9753 5.17712C17.7616 5.68623 18.8113 5.5224 19.3973 4.78435L19.4205 4.75511L19.4407 4.72371L20.4859 3.09894C20.7832 3.70359 21.0075 4.58795 21.1085 5.56141C21.2297 6.72912 21.1571 7.86576 20.9257 8.57919L20.9256 8.57948C20.6977 9.28328 20.6295 10.0391 20.7649 10.7837L20.7656 10.7873C20.8793 11.3956 20.98 12.0679 20.98 12.5018C20.98 17.3253 17.0299 21.2502 12.1404 21.2502C7.25292 21.2502 3.30071 17.3274 3.30071 12.5018C3.30071 12.0679 3.40144 11.3956 3.51518 10.7873L3.51536 10.7863C3.65353 10.0418 3.58819 9.28511 3.35967 8.57948L3.35949 8.57893C3.12825 7.86674 3.05558 6.73078 3.17677 5.56302C3.2778 4.58962 3.50216 3.70474 3.79965 3.09928L4.84456 4.72371L4.86593 4.75693L4.89067 4.78773C5.47582 5.516 6.52292 5.68922 7.31143 5.17621L6.90242 4.54755ZM6.90242 4.54755C6.43885 4.84916 5.82074 4.74787 5.47533 4.31797L3.37457 2.33707C2.38099 3.80178 2.09419 7.11061 2.64616 8.81055C2.83931 9.40701 2.89158 10.0372 2.77796 10.6494C2.66434 11.2572 2.55071 11.9909 2.55071 12.5018C2.55071 17.7484 6.84561 22.0002 12.1404 22.0002C17.4374 22.0002 21.73 17.7462 21.73 12.5018C21.73 11.9909 21.6164 11.2572 21.5028 10.6494C21.3914 10.0372 21.446 9.40701 21.6391 8.81055C22.1911 7.10851 21.9043 3.79969 20.9108 2.33684C20.8129 2.19276 20.641 2.12476 20.4674 2.13837C20.2979 2.15166 20.1444 2.24341 20.0525 2.38638L18.81 4.31797C18.4668 4.75012 17.8487 4.84916 17.3829 4.54755C15.8763 3.57071 14.0765 3.00351 12.1427 3.00351C10.2088 3.00351 8.40904 3.57071 6.90242 4.54755Z" stroke-width="1.5"/>
3
- <path d="M12.4 12.5L10 15M10.8 10L14 15" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_2560_5349)">
3
+ <path d="M12.0331 3.54417C10.1934 3.54417 8.4776 4.0875 7.03826 5.01211C6.59026 5.29807 6.0088 5.20275 5.67518 4.79287L4.4932 2.95318C4.40741 2.81973 4.2549 2.73395 4.09286 2.71488C3.93081 2.70535 3.75924 2.76254 3.67345 2.90552C2.72977 4.2972 2.45334 7.45231 2.97761 9.07276C3.15872 9.64469 3.21591 10.2452 3.11106 10.8267C3.0062 11.4081 2.89182 12.104 2.89182 12.5901C2.89182 17.5944 6.98107 21.6455 12.0331 21.6455H12.2428C17.2948 21.6455 21.384 17.5944 21.384 12.5901C21.384 12.104 21.2792 11.4081 21.1648 10.8267C21.0599 10.2452 21.1076 9.64469 21.2982 9.07276C21.8225 7.45231 21.5556 4.2972 20.6024 2.90552C20.5071 2.77207 20.345 2.70535 20.183 2.71488C20.0209 2.72441 19.8779 2.81973 19.7826 2.95318L18.6006 4.79287C18.2766 5.20275 17.6856 5.29807 17.2376 5.01211C15.7982 4.07797 14.0824 3.54417 12.2428 3.54417H12.0235H12.0331Z" stroke="#1F2A37" stroke-width="1.5"/>
4
+ <path d="M14.0443 15.0302L10.9941 10.2642L12.5192 12.6472L10.2315 15.0302" stroke="#1F2A37" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </g>
6
+ <defs>
7
+ <clipPath id="clip0_2560_5349">
8
+ <rect width="20.2842" height="20.37" fill="white" transform="translate(1.99579 2)"/>
9
+ </clipPath>
10
+ </defs>
4
11
  </svg>
@@ -1,3 +1,3 @@
1
1
  <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M7 12H17" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
2
+ <path d="M7 12H17" stroke-linecap="round" stroke-linejoin="round"/>
3
3
  </svg>
@@ -6,15 +6,15 @@ 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={`${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]`}>
9
+ <div className={`${size} group flex-shrink-0 rounded-2xl flex items-center justify-between bg-neutral-0 tb:inline-flex tb:flex-col shadow hover:shadow-xl tb:min-w-[18rem]`}>
10
10
 
11
- <div className="mx-5 desk:flex-col desk:flex desk:items-center desk:p-8 desk:ml-0 bg-neutral-0">
11
+ <div className="mx-5 tb:flex-col tb:flex tb:items-center tb:p-8 tb: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
15
  <div className='relative '>
16
16
  <img
17
- className={`inline-block w-[9rem] desk:min-w-[18rem] desk:rounded-2xl border-neutral-0 rounded-r-2xl `}
17
+ className={`inline-block w-[9rem] tb:min-w-[18rem] tb:rounded-2xl border-neutral-0 rounded-r-2xl `}
18
18
  src={imageUrl}
19
19
  />
20
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>
@@ -5,7 +5,7 @@ import { Icon } from '../common-components/Icon';
5
5
  const Buttonclasses = {
6
6
  'primary': {
7
7
  'default': {
8
- 'base': 'desk:w-fit tab:w-fit w-full justify-center justify-center bg-blue-500 text-neutral-0',
8
+ 'base': 'db:w-fit tb:w-fit w-full justify-center justify-center bg-blue-500 text-neutral-0',
9
9
  'hover': 'hover:bg-blue-700 hover:text-neutral-0',
10
10
  'focus': 'focus:bg-blue-600 focus:shadow-[0_0px_0px_4px_#80A3FF] focus:text-neutral-0 focus:outline-none',
11
11
  },
@@ -13,7 +13,7 @@ const Buttonclasses = {
13
13
  },
14
14
  'tonal': {
15
15
  'default': {
16
- 'base': 'desk:w-fit tab:w-fit w-full justify-center bg-blue-100 text-blue-600',
16
+ 'base': 'db:w-fit tb:w-fit w-full justify-center bg-blue-100 text-blue-600',
17
17
  'hover': 'hover:bg-blue-200 hover:text-blue-600',
18
18
  'focus': 'focus:bg-blue-100 focus:text-blue-600 focus:shadow-[0px_0px_0px_4px_#DFE8FF] focus:outline-none',
19
19
  },
@@ -21,7 +21,7 @@ const Buttonclasses = {
21
21
  },
22
22
  'secondary': {
23
23
  'default': {
24
- 'base': 'desk:w-fit tab:w-fit w-full justify-center border-2 border-blue-500 bg-neutral-0 text-blue-500',
24
+ 'base': 'db:w-fit tb:w-fit w-full justify-center border-2 border-blue-500 bg-neutral-0 text-blue-500',
25
25
 
26
26
  'hover': 'hover:text-neutral-800 hover:bg-blue-200 hover:border-2 hover:border-blue-500 hover:shadow hover:text-blue-500',
27
27
 
@@ -31,7 +31,7 @@ const Buttonclasses = {
31
31
  },
32
32
  'ghost': {
33
33
  'default': {
34
- 'base': 'desk:w-fit tab:w-fit w-full justify-center text-blue-600',
34
+ 'base': 'db:w-fit tb:w-fit w-full justify-center text-blue-600',
35
35
  'hover': 'hover:bg-blue-100 hover:text-blue-600',
36
36
  'focus': 'focus:text-blue-700 focus:outline-none',
37
37
  },
@@ -39,7 +39,7 @@ const Buttonclasses = {
39
39
  },
40
40
  'primaryLink': {
41
41
  'default': {
42
- 'base': 'desk:w-fit tab:w-fit w-full justify-center text-blue-600',
42
+ 'base': 'db:w-fit tb:w-fit w-full justify-center text-blue-600',
43
43
  'hover': 'hover:text-blue-700',
44
44
  'focus': 'focus:text-blue-700 focus:outline-none',
45
45
  },
@@ -47,7 +47,7 @@ const Buttonclasses = {
47
47
  },
48
48
  'secondaryLink': {
49
49
  'default': {
50
- 'base': 'desk:w-fit tab:w-fit w-full justify-center text-neutral-800',
50
+ 'base': 'db:w-fit tb:w-fit w-full justify-center text-neutral-800',
51
51
  'hover': 'hover:text-neutral-900 hover:underline',
52
52
  'focus': 'focus:text-neutral-900 focus:underline focus:outline-none',
53
53
  },
@@ -118,10 +118,10 @@ export default function Button(props) {
118
118
  {label}
119
119
 
120
120
  {rightAnimatedArrow && rightAnimatedArrow !== 'none' && (
121
- <div className=' ml-1.5 hover:transition-all '>
122
- <Icon className=' z-10 group-hover:translate-x-[0.098rem] group-hover:transition-all' height='h-4' variant={'chevronright'} strokeColor={rightAnimatedArrowColor} />
121
+ <div className=' hover:transition-all '>
122
+ <Icon className='z-10 stroke-2 group-hover:translate-x-[0.098rem] group-hover:transition-all' height='h-4' variant={'chevronright'} strokeColor={rightAnimatedArrowColor} />
123
123
 
124
- <Icon className='invisible -mt-4 group-hover:transition-all group-hover:delay-100 group-hover:visible ' height='h-4' variant='minus01' strokeColor={rightAnimatedArrowColor} />
124
+ <Icon className='invisible stroke-2 -mt-4 group-hover:transition-all group-hover:delay-100 group-hover:visible ' height='h-4' variant='minus01' strokeColor={rightAnimatedArrowColor} />
125
125
 
126
126
  </div>
127
127
  )}
@@ -80,7 +80,7 @@ export default function Carouseltest(props) {
80
80
  <button
81
81
  type="button"
82
82
  onClick={isLeft ? previousImage : nextImage}
83
- className={`${arrowStyle} ${isLeft ? 'left-2 desk:-left-5' : 'right-2 desk:-right-5'}`}
83
+ className={`${arrowStyle} ${isLeft ? 'left-2 db:-left-5' : 'right-2 db:-right-5'}`}
84
84
  style={{ top: '40%' }}
85
85
  >
86
86
  <span role="img" aria-label={`Arrow ${isLeft ? 'left' : 'right'}`}>
@@ -57,15 +57,16 @@ export default function Carouseltest(props) {
57
57
  }
58
58
  };
59
59
  const slider = () => {
60
- return(
61
- <div className=' '>
62
- <div
63
- className='bg-blue-100 w-96 rounded-md content-center h-1'>
64
- <div className="bg-blue-600 rounded-md h-1 w-6">
60
+ let sliderWidth = 24/(totalCards-1) * (currentCard) + 'rem';
61
+ let sliderClass = 'w-[' + sliderWidth +'rem]';
62
+ console.log(sliderClass);
63
+ return (
64
+ <div className=' '>
65
+ <div className='bg-blue-100 w-96 rounded-md content-center h-1'>
66
+ <div className={`bg-blue-600 rounded-md h-1 `} style={{ width: `${sliderWidth}` }} />
67
+ </div>
65
68
  </div>
66
- </div>
67
- </div>
68
- )
69
+ )
69
70
  };
70
71
 
71
72
  const arrowStyle = ' text-2xl z-10 bg-black h-10 w-10 rounded-full bg-neutral-0 flex items-center justify-center';
@@ -92,7 +93,7 @@ export default function Carouseltest(props) {
92
93
  );
93
94
  return (
94
95
  <div className="">
95
- <div className="block sm:hidden">
96
+ <div className="block tb:hidden">
96
97
  {props.cards.map((item, i) => (
97
98
  <div className="my-5" key={i} ref={refs[i]}>
98
99
  <div className="rounded-3xl ">
@@ -103,7 +104,7 @@ export default function Carouseltest(props) {
103
104
  ))}
104
105
  </div>
105
106
 
106
- <div className="invisible flex flex-col-reverse sm:visible">
107
+ <div className="invisible flex flex-col-reverse tb:visible">
107
108
  <div className="flex items-center justify-around mt-20 ">
108
109
  {slider()}
109
110
  <div className="flex">
@@ -127,7 +128,7 @@ export default function Carouseltest(props) {
127
128
  }}
128
129
  >
129
130
  <div className="">
130
- <div className={`snap-x ${props.carouselWidth} inline-flex select-none overflow-x-hidden scrollbar-hide`}>
131
+ <div className={`snap-x w-full inline-flex select-none overflow-x-hidden scrollbar-hide`}>
131
132
 
132
133
  {props.cards.map((item, i) => (
133
134
  <div className="snap-center mx-5 shrink-0" key={i} ref={refs[i]}>
@@ -10,41 +10,41 @@ export default function Typography(props) {
10
10
 
11
11
  const ComponentType = Component;
12
12
  const TYPOGRAPHY_CLASSES = {
13
- 'h1': 'text-hds-m-h1 tab:text-hds-t-h1 desk:text-hds-d-h1',
14
- 'h2': 'text-hds-m-h2 tab:text-hds-t-h2 desk:text-hds-d-h2',
15
- 'h3': 'text-hds-m-h3 tab:text-hds-t-h3 desk:text-hds-d-h3',
16
- 'h4': 'text-hds-m-h4 tab:text-hds-t-h4 desk:text-hds-d-h4',
17
- 'h5': 'text-hds-m-h5 tab:text-hds-t-h5 desk:text-hds-d-h5',
18
- 'h6': 'text-hds-m-h6 tab:text-hds-t-h6 desk:text-hds-d-h6',
19
- 'sub1': 'text-hds-m-sub1 tab:text-hds-t-sub1 desk:text-hds-d-sub1',
20
- 'sub2': 'text-hds-m-sub2 tab:text-hds-t-sub2 desk:text-hds-d-sub2',
21
- 'body1': 'text-hds-m-body1 tab:text-hds-t-body1 desk:text-hds-d-body1',
22
- 'body1-medium': 'text-hds-m-body1-medium tab:text-hds-t-body1-medium desk:text-hds-d-body1-medium',
23
- 'body1-semi-bold': 'text-hds-m-body1-semi-bold tab:text-hds-t-body1-semi-bold desk:text-hds-d-body1-semi-bold',
24
- 'body1-bold': 'text-hds-m-body1-bold tab:text-hds-t-body1-bold desk:text-hds-d-body1-bold',
25
- 'body1c': 'text-hds-m-body1c tab:text-hds-t-body1c desk:text-hds-d-body1c',
26
- 'body1c-medium': 'text-hds-m-body1c-medium tab:text-hds-t-body1c-medium desk:text-hds-d-body1c-medium',
27
- 'body1c-semi-bold': 'text-hds-m-body1c-semi-bold tab:text-hds-t-body1c-semi-bold desk:text-hds-d-body1c-semi-bold',
28
- 'body1c-bold': 'text-hds-m-body1c-bold tab:text-hds-t-body1c-bold desk:text-hds-d-body1c-bold',
29
- 'body2': 'text-hds-m-body2 tab:text-hds-t-body2 desk:text-hds-d-body2',
30
- 'body2-medium': 'text-hds-m-body2-medium tab:text-hds-t-body2-medium desk:text-hds-d-body2-medium',
31
- 'body2-semi-bold': 'text-hds-m-body2-semi-bold tab:text-hds-t-body2-semi-bold desk:text-hds-d-body2-semi-bold',
32
- 'body2-bold': 'text-hds-m-body2-bold tab:text-hds-t-body2-bold desk:text-hds-d-body2-bold',
33
- 'body2c': 'text-hds-m-body2c tab:text-hds-t-body2c desk:text-hds-d-body2c',
34
- 'body2c-medium': 'text-hds-m-body2c-medium tab:text-hds-t-body2c-medium desk:text-hds-d-body2c-medium',
35
- 'body2c-semi-bold': 'text-hds-m-body2c-semi-bold tab:text-hds-t-body2c-semi-bold desk:text-hds-d-body2c-semi-bold',
36
- 'body2c-bold': 'text-hds-m-body2c-bold tab:text-hds-t-body2c-bold desk:text-hds-d-body2c-bold',
37
- 'body3': 'text-hds-m-body3 tab:text-hds-t-body3 desk:text-hds-d-body3',
38
- 'body3-medium': 'text-hds-m-body3-medium tab:text-hds-t-body3-medium desk:text-hds-d-body3-medium',
39
- 'body3-semi-bold': 'text-hds-m-body3-semi-bold tab:text-hds-t-body3-semi-bold desk:text-hds-d-body3-semi-bold',
40
- 'body3-bold': 'text-hds-m-body3-bold tab:text-hds-t-body3-bold desk:text-hds-d-body3-bold',
41
- 'body3c': 'text-hds-m-body3c tab:text-hds-t-body3c desk:text-hds-d-body3c',
42
- 'body3c-medium': 'text-hds-m-body3c-medium tab:text-hds-t-body3c-medium desk:text-hds-d-body3c-medium',
43
- 'body3c-semi-bold': 'text-hds-m-body3c-semi-bold tab:text-hds-t-body3c-semi-bold desk:text-hds-d-body3c-semi-bold',
44
- 'body3c-bold': 'text-hds-m-body3c-bold tab:text-hds-t-body3c-bold desk:text-hds-d-body3c-bold',
45
- 'quote': 'text-hds-m-quote tab:text-hds-t-quote desk:text-hds-d-quote',
46
- 'code1': 'text-hds-m-code1 tab:text-hds-t-code1 desk:text-hds-d-code1',
47
- 'code2': 'text-hds-m-code2 tab:text-hds-t-code2 desk:text-hds-d-code2',
13
+ 'h1': 'text-hds-m-h1 tb:text-hds-t-h1 db:text-hds-d-h1',
14
+ 'h2': 'text-hds-m-h2 tb:text-hds-t-h2 db:text-hds-d-h2',
15
+ 'h3': 'text-hds-m-h3 tb:text-hds-t-h3 db:text-hds-d-h3',
16
+ 'h4': 'text-hds-m-h4 tb:text-hds-t-h4 db:text-hds-d-h4',
17
+ 'h5': 'text-hds-m-h5 tb:text-hds-t-h5 db:text-hds-d-h5',
18
+ 'h6': 'text-hds-m-h6 tb:text-hds-t-h6 db:text-hds-d-h6',
19
+ 'sub1': 'text-hds-m-sub1 tb:text-hds-t-sub1 db:text-hds-d-sub1',
20
+ 'sub2': 'text-hds-m-sub2 tb:text-hds-t-sub2 db:text-hds-d-sub2',
21
+ 'body1': 'text-hds-m-body1 tb:text-hds-t-body1 db:text-hds-d-body1',
22
+ 'body1-medium': 'text-hds-m-body1-medium tb:text-hds-t-body1-medium db:text-hds-d-body1-medium',
23
+ 'body1-semi-bold': 'text-hds-m-body1-semi-bold tb:text-hds-t-body1-semi-bold db:text-hds-d-body1-semi-bold',
24
+ 'body1-bold': 'text-hds-m-body1-bold tb:text-hds-t-body1-bold db:text-hds-d-body1-bold',
25
+ 'body1c': 'text-hds-m-body1c tb:text-hds-t-body1c db:text-hds-d-body1c',
26
+ 'body1c-medium': 'text-hds-m-body1c-medium tb:text-hds-t-body1c-medium db:text-hds-d-body1c-medium',
27
+ 'body1c-semi-bold': 'text-hds-m-body1c-semi-bold tb:text-hds-t-body1c-semi-bold db:text-hds-d-body1c-semi-bold',
28
+ 'body1c-bold': 'text-hds-m-body1c-bold tb:text-hds-t-body1c-bold db:text-hds-d-body1c-bold',
29
+ 'body2': 'text-hds-m-body2 tb:text-hds-t-body2 db:text-hds-d-body2',
30
+ 'body2-medium': 'text-hds-m-body2-medium tb:text-hds-t-body2-medium db:text-hds-d-body2-medium',
31
+ 'body2-semi-bold': 'text-hds-m-body2-semi-bold tb:text-hds-t-body2-semi-bold db:text-hds-d-body2-semi-bold',
32
+ 'body2-bold': 'text-hds-m-body2-bold tb:text-hds-t-body2-bold db:text-hds-d-body2-bold',
33
+ 'body2c': 'text-hds-m-body2c tb:text-hds-t-body2c db:text-hds-d-body2c',
34
+ 'body2c-medium': 'text-hds-m-body2c-medium tb:text-hds-t-body2c-medium db:text-hds-d-body2c-medium',
35
+ 'body2c-semi-bold': 'text-hds-m-body2c-semi-bold tb:text-hds-t-body2c-semi-bold db:text-hds-d-body2c-semi-bold',
36
+ 'body2c-bold': 'text-hds-m-body2c-bold tb:text-hds-t-body2c-bold db:text-hds-d-body2c-bold',
37
+ 'body3': 'text-hds-m-body3 tb:text-hds-t-body3 db:text-hds-d-body3',
38
+ 'body3-medium': 'text-hds-m-body3-medium tb:text-hds-t-body3-medium db:text-hds-d-body3-medium',
39
+ 'body3-semi-bold': 'text-hds-m-body3-semi-bold tb:text-hds-t-body3-semi-bold db:text-hds-d-body3-semi-bold',
40
+ 'body3-bold': 'text-hds-m-body3-bold tb:text-hds-t-body3-bold db:text-hds-d-body3-bold',
41
+ 'body3c': 'text-hds-m-body3c tb:text-hds-t-body3c db:text-hds-d-body3c',
42
+ 'body3c-medium': 'text-hds-m-body3c-medium tb:text-hds-t-body3c-medium db:text-hds-d-body3c-medium',
43
+ 'body3c-semi-bold': 'text-hds-m-body3c-semi-bold tb:text-hds-t-body3c-semi-bold db:text-hds-d-body3c-semi-bold',
44
+ 'body3c-bold': 'text-hds-m-body3c-bold tb:text-hds-t-body3c-bold db:text-hds-d-body3c-bold',
45
+ 'quote': 'text-hds-m-quote tb:text-hds-t-quote db:text-hds-d-quote',
46
+ 'code1': 'text-hds-m-code1 tb:text-hds-t-code1 db:text-hds-d-code1',
47
+ 'code2': 'text-hds-m-code2 tb:text-hds-t-code2 db:text-hds-d-code2',
48
48
  }
49
49
  return React.createElement(
50
50
  ComponentType,
@@ -0,0 +1 @@
1
+ export {default as Time} from './time';
@@ -0,0 +1,97 @@
1
+ import React, { useState, useEffect } from 'react';
2
+
3
+ const TimeComponent = ({ format, countdownTime }) => {
4
+ const [currentTime, setCurrentTime] = useState(new Date());
5
+
6
+ useEffect(() => {
7
+ const interval = setInterval(() => {
8
+ setCurrentTime(new Date());
9
+ }, 1000);
10
+ return () => clearInterval(interval);
11
+ }, []);
12
+
13
+ const formatTime = () => {
14
+ switch (format) {
15
+ case 'MM/dd/yyyy hh:mm:ss tt':
16
+ return currentTime.toLocaleString('en-US', {
17
+ month: '2-digit',
18
+ day: '2-digit',
19
+ year: 'numeric',
20
+ hour: 'numeric',
21
+ minute: 'numeric',
22
+ second: 'numeric',
23
+ hour12: true,
24
+ });
25
+ case 'yyyy-mm-dd hh:mm:ss':
26
+ return currentTime.toLocaleString('en-US', {
27
+ year: 'numeric',
28
+ month: '2-digit',
29
+ day: '2-digit',
30
+ hour: 'numeric',
31
+ minute: 'numeric',
32
+ second: 'numeric',
33
+ }).replace(/,/g, '');
34
+ case 'yyyy-mm-dd HH:MM:SS tt':
35
+ return currentTime.toLocaleString('en-US', {
36
+ year: 'numeric',
37
+ month: '2-digit',
38
+ day: '2-digit',
39
+ hour: 'numeric',
40
+ minute: 'numeric',
41
+ second: 'numeric',
42
+ hour12: false,
43
+ });
44
+ case 'm/d/yyyy':
45
+ return currentTime.toLocaleString('en-US', {
46
+ month: 'numeric',
47
+ day: 'numeric',
48
+ year: 'numeric',
49
+ });
50
+ case 'yyyy-mm-dd':
51
+ return currentTime.toLocaleString('en-US', {
52
+ year: 'numeric',
53
+ month: '2-digit',
54
+ day: '2-digit',
55
+ });
56
+ default:
57
+ return currentTime.toLocaleString();
58
+ }
59
+ };
60
+
61
+ const countdown = () => {
62
+ if (!countdownTime) {
63
+ return null;
64
+ }
65
+
66
+ const remainingTime = countdownTime - currentTime;
67
+
68
+ if (remainingTime <= 0) {
69
+ return <div>Time's up!</div>;
70
+ }
71
+
72
+ const seconds = Math.floor(remainingTime / 1000) % 60;
73
+ const minutes = Math.floor(remainingTime / 1000 / 60) % 60;
74
+ const hours = Math.floor(remainingTime / 1000 / 60 / 60) % 24;
75
+ const days = Math.floor(remainingTime / 1000 / 60 / 60 / 24);
76
+
77
+ return (
78
+ <div>
79
+ <div>{days} days</div>
80
+ <div>
81
+ {hours.toString().padStart(2, '0')}:
82
+ {minutes.toString().padStart(2, '0')}:
83
+ {seconds.toString().padStart(2, '0')}
84
+ </div>
85
+ </div>
86
+ );
87
+ };
88
+
89
+ return (
90
+ <div>
91
+ <div>{formatTime()}</div>
92
+ {countdown()}
93
+ </div>
94
+ );
95
+ };
96
+
97
+ export default TimeComponent;