hds-web 1.0.0 → 1.0.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.
Files changed (32) hide show
  1. package/.github/workflows/chromatic.yml +26 -0
  2. package/dist/index.css +4 -2
  3. package/dist/index.es.css +4 -2
  4. package/dist/index.es.js +11 -3
  5. package/dist/index.js +11 -3
  6. package/package.json +7 -3
  7. package/src/HDS/assets/icons/HasuraPrimary.svg +10 -0
  8. package/src/HDS/components/BadgesCaption/badges.js +1 -1
  9. package/src/HDS/components/Buttons/button.js +7 -7
  10. package/src/HDS/components/Cards/Menu/flyoutB.js +63 -0
  11. package/src/HDS/components/Cards/Menu/index.js +2 -1
  12. package/src/HDS/components/Cards/Misc/iconCard.js +22 -0
  13. package/src/HDS/components/Cards/Misc/index.js +2 -1
  14. package/src/HDS/components/Cards/Misc/talkCard.js +48 -27
  15. package/src/HDS/components/Carousels/carouselCard.js +24 -13
  16. package/src/HDS/components/Headers/customHeader.js +50 -41
  17. package/src/HDS/components/Headers/v3Header.js +127 -100
  18. package/src/HDS/components/Hero/h1.js +189 -0
  19. package/src/HDS/components/Hero/index.js +1 -0
  20. package/src/HDS/components/Snippet/CodeSnippet.js +58 -58
  21. package/src/HDS/components/Snippet/index.js +1 -1
  22. package/src/HDS/components/common-components/Icon/IconMap.js +2 -0
  23. package/src/HDS/components/index.js +2 -1
  24. package/src/HDS/foundation/Animations/featureCard.js +77 -0
  25. package/src/HDS/foundation/Animations/index.js +1 -0
  26. package/src/HDS/helpers/Time/time.js +48 -70
  27. package/src/index.css +154 -0
  28. package/src/styles/tailwind.css +1022 -199
  29. package/src/HDS/components/Avatars/selectors.js +0 -0
  30. package/src/HDS/components/Buttons/socialMediaButton.js +0 -78
  31. package/src/HDS/components/Cards/Misc/featureCard.js +0 -0
  32. package/src/HDS/foundation/Typography/translated.js +0 -20
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hds-web",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -25,7 +25,8 @@
25
25
  "watch:storybook": "start-storybook -p 6006 -s public",
26
26
  "watch:tailwind": "npx tailwindcss -i ./src/index.css -o ./src/styles/tailwind.css --watch",
27
27
  "build-storybook": "build-storybook -s public",
28
- "build-lib": "rollup -c"
28
+ "build-lib": "rollup -c",
29
+ "chromatic": "npx chromatic --project-token=chpt_522a228102c089e"
29
30
  },
30
31
  "eslintConfig": {
31
32
  "extends": [
@@ -80,6 +81,7 @@
80
81
  "autoprefixer": "^10.4.13",
81
82
  "babel-loader": "^8.2.2",
82
83
  "babel-plugin-named-exports-order": "^0.0.2",
84
+ "chromatic": "^6.17.4",
83
85
  "concurrently": "^7.6.0",
84
86
  "postcss": "^8.4.21",
85
87
  "postcss-import": "^15.1.0",
@@ -97,5 +99,7 @@
97
99
  "peerDependencies": {
98
100
  "react": "^17.0.1",
99
101
  "react-dom": "^17.0.1"
100
- }
102
+ },
103
+ "readme": "ERROR: No README data found!",
104
+ "_id": "hds-web@1.0.0"
101
105
  }
@@ -0,0 +1,10 @@
1
+ <svg width="105" height="33" viewBox="0 0 105 33" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M30.2318 11.3966C31.1444 8.52639 30.5954 2.80038 28.8272 0.686435C28.5954 0.409138 28.1641 0.448752 27.9715 0.754859L25.7933 4.20847C25.255 4.89991 24.2853 5.05837 23.5544 4.5758C21.1908 3.01285 18.3673 2.10533 15.3334 2.10533C12.2996 2.10533 9.47604 3.01285 7.11241 4.5758C6.38514 5.05837 5.41545 4.89631 4.87356 4.20847L2.69531 0.754859C2.5028 0.448752 2.07143 0.412739 1.8397 0.686435C0.0714324 2.80398 -0.477586 8.52999 0.435068 11.3966C0.738097 12.3509 0.820094 13.3593 0.641841 14.3388C0.463588 15.3112 0.285336 16.4852 0.285336 17.3027C0.285336 25.6972 7.02329 32.5 15.3299 32.5C23.64 32.5 30.3744 25.6936 30.3744 17.3027C30.3744 16.4852 30.1961 15.3112 30.0179 14.3388C29.8432 13.3593 29.9288 12.3509 30.2318 11.3966ZM15.3299 29.1076C8.90564 29.1076 3.68283 23.8282 3.68283 17.3387C3.68283 17.1262 3.68996 16.9173 3.70066 16.7085C3.93239 12.2861 6.59192 8.50838 10.353 6.70775C11.8611 5.98029 13.5509 5.57695 15.3334 5.57695C17.116 5.57695 18.8022 5.98029 20.3138 6.71135C24.0749 8.51198 26.7345 12.2933 26.9662 16.7121C26.9769 16.9209 26.984 17.1334 26.984 17.3423C26.9805 23.8282 21.7541 29.1076 15.3299 29.1076Z" fill="#3970FD"/>
3
+ <path d="M20.3769 21.8691L17.4001 16.6545L14.8475 12.3077C14.7869 12.2033 14.6764 12.1421 14.5588 12.1421H12.1203C11.9991 12.1421 11.8885 12.2069 11.8279 12.315C11.7673 12.4194 11.7709 12.549 11.8315 12.6535L14.2736 16.7985L10.9973 21.8475C10.9295 21.9519 10.926 22.0852 10.983 22.1932C11.0401 22.3013 11.1541 22.3697 11.2789 22.3697H13.7352C13.8493 22.3697 13.9563 22.3121 14.0169 22.2148L15.7887 19.4202L17.3787 22.204C17.4393 22.3085 17.5498 22.3733 17.6675 22.3733H20.0882C20.2094 22.3733 20.3199 22.3085 20.3769 22.204C20.4375 22.1032 20.4375 21.9735 20.3769 21.8691Z" fill="#3970FD"/>
4
+ <path d="M43.2929 8.5H46.4041V25.5632H43.2929V18.2927H39.7782V25.5667H36.667V8.5H39.7782V15.9098H43.2929V8.5Z" fill="black"/>
5
+ <path d="M56.0018 25.5666L55.3517 22.0225H51.619L51.0225 25.5666H47.9114L51.344 8.50342H55.5339L59.1308 25.5666H56.0018ZM52.0263 19.6681H54.9195L53.4336 11.5009L52.0263 19.6681Z" fill="black"/>
6
+ <path d="M66.0606 22.4548V18.8035C66.0606 18.5141 66.007 18.3212 65.8999 18.2211C65.7927 18.1211 65.5927 18.0711 65.3034 18.0711H63.1138C61.2563 18.0711 60.3276 17.1708 60.3276 15.3665V11.1794C60.3276 9.39302 61.2992 8.50342 63.2459 8.50342H66.2213C68.168 8.50342 69.1396 9.39659 69.1396 11.1794V13.5588H66.0035V11.6117C66.0035 11.3223 65.9499 11.1293 65.8427 11.0293C65.7356 10.9293 65.5355 10.8793 65.2462 10.8793H64.2175C63.9103 10.8793 63.7031 10.9293 63.596 11.0293C63.4888 11.1293 63.4352 11.3223 63.4352 11.6117V15.045C63.4352 15.3344 63.4888 15.5273 63.596 15.6274C63.7031 15.7274 63.9103 15.7774 64.2175 15.7774H66.3535C68.2466 15.7774 69.1932 16.6599 69.1932 18.4283V22.8906C69.1932 24.677 68.2109 25.5666 66.2463 25.5666H63.3245C61.3599 25.5666 60.3776 24.6734 60.3776 22.8906V20.5362H63.4852V22.4548C63.4852 22.7441 63.5388 22.9371 63.646 23.0371C63.7531 23.1371 63.9603 23.1872 64.2675 23.1872H65.2962C65.5855 23.1872 65.782 23.1371 65.8927 23.0371C66.0035 22.9371 66.0606 22.7441 66.0606 22.4548Z" fill="black"/>
7
+ <path d="M77.4944 8.5H80.602V22.8872C80.602 24.6735 79.6197 25.5632 77.6551 25.5632H74.3582C72.3937 25.5632 71.4114 24.67 71.4114 22.8872V8.5H74.5225V22.4549C74.5225 22.7443 74.5761 22.9372 74.6833 23.0373C74.7904 23.1373 74.9905 23.1873 75.2798 23.1873H76.7121C77.0193 23.1873 77.2265 23.1373 77.3336 23.0373C77.4408 22.9372 77.4944 22.7443 77.4944 22.4549V8.5V8.5Z" fill="black"/>
8
+ <path d="M86.2817 18.9144V25.5667H83.1741V8.5H89.4464C91.411 8.5 92.3932 9.39317 92.3932 11.1759V16.2349C92.3932 17.714 91.736 18.5785 90.418 18.8322L93.2577 25.5667H89.9036L87.3068 18.9144H86.2817ZM86.2817 10.8794V16.6136H88.5248C88.8142 16.6136 89.0106 16.5636 89.1213 16.4635C89.2285 16.3635 89.2821 16.1706 89.2821 15.8812V11.6118C89.2821 11.3224 89.2285 11.1295 89.1213 11.0295C89.0142 10.9294 88.8142 10.8794 88.5248 10.8794H86.2817Z" fill="black"/>
9
+ <path d="M101.801 25.5666L101.151 22.0225H97.4187L96.8222 25.5666H93.7146L97.1472 8.50342H101.337L104.934 25.5666H101.801ZM97.8295 19.6681H100.723L99.2368 11.5009L97.8295 19.6681Z" fill="black"/>
10
+ </svg>
@@ -52,7 +52,7 @@ export default function Badge({
52
52
  >
53
53
  {leftIconVariant && leftIconVariant !== 'none' && (
54
54
  <div className='mr-1'>
55
- <Icon height={'h-4'} variant={leftIconVariant} strokeColor={leftIconColor} />
55
+ <Icon height={'h-4 w-4'} variant={leftIconVariant} strokeColor={leftIconColor} />
56
56
  </div>
57
57
  )}
58
58
  {children}
@@ -20,7 +20,7 @@ const Buttonclasses = {
20
20
  'primary': {
21
21
  'default': {
22
22
  'base': 'db:w-fit tb:w-fit w-full justify-center justify-center bg-blue-500 text-neutral-0',
23
- 'hover': 'hover:bg-blue-700 hover:text-neutral-0 hover:shadow-md hover:shadow hover:transition-all hover:ease-out hover:delay-300 hover:duration-300',
23
+ 'hover': 'hover:bg-blue-700 hover:text-neutral-0 hover:shadow-md hover:shadow hover:transition-all hover:ease-out hover:duration-300',
24
24
  'focus': 'focus:bg-blue-600 focus:shadow-[0_0px_0px_4px_#DFE8FF] focus:text-neutral-0 focus:outline-none active:bg-blue-600 active:text-neutral-0 active:outline-none',
25
25
 
26
26
  },
@@ -29,7 +29,7 @@ const Buttonclasses = {
29
29
  'tonal': {
30
30
  'default': {
31
31
  'base': 'db:w-fit tb:w-fit w-full justify-center bg-blue-100 text-blue-600',
32
- 'hover': 'hover:bg-blue-200 hover:text-blue-600 hover:shadow-md hover:shadow hover:transition-all hover:ease-out hover:delay-300 hover:duration-300',
32
+ 'hover': 'hover:bg-blue-700 hover:text-neutral-0 hover:shadow-md hover:shadow hover:transition-all hover:ease-out hover:duration-300',
33
33
  'focus': 'focus:bg-blue-100 focus:text-blue-600 focus:shadow-[0px_0px_0px_4px_#DFE8FF] focus:outline-none',
34
34
  },
35
35
  'disabled': 'bg-neutral-200 text-neutral-400',
@@ -72,7 +72,7 @@ const Buttonclasses = {
72
72
  'default': {
73
73
  'base': 'w-fit justify-center justify-center bg-blue-200 rounded-full p-1.5',
74
74
 
75
- 'hover': 'hover:bg-blue-600 hover:shadow-md hover:shadow hover:transition-all hover:ease-out hover:delay-300 hover:duration-300',
75
+ 'hover': 'hover:bg-blue-600 hover:shadow-md hover:shadow hover:transition-all hover:ease-in-out hover:duration-300',
76
76
 
77
77
  'focus': 'focus:bg-blue-600 focus:shadow-[0_0px_0px_4px_#DFE8FF] focus:text-neutral-0 focus:outline-none',
78
78
  },
@@ -129,7 +129,7 @@ export default function Button(props) {
129
129
 
130
130
 
131
131
  const buttonClasses = [
132
- 'inline-flex items-center',
132
+ 'inline-flex items-center whitespace-pre',
133
133
  'rounded-full',
134
134
  Buttonclasses['buttonSizes'][`${sizeType}`][`${size}`],
135
135
  'group',
@@ -146,14 +146,14 @@ export default function Button(props) {
146
146
  {...rest}
147
147
  >
148
148
  {leftIconVariant && leftIconVariant !== 'none' && type!='iconOnly' && (
149
- <div className={`-ml-0.5 mr-2 ${ANIMATED_ARR_CLASSES['icon1'][`${size}`]} `}>
149
+ <div className={`-ml-0.5 mr-2 ${ANIMATED_ARR_CLASSES['icon1'][`${size}`]} `}>
150
150
  <Icon variant={leftIconVariant} strokeColor={leftIconColor} />
151
151
  </div>
152
152
  )}
153
153
 
154
154
  {leftIconVariant && leftIconVariant !== 'none' && type=='iconOnly' && (
155
155
  <div className={`${ANIMATED_ARR_CLASSES['icon1'][`${size}`]} `}>
156
- <Icon variant={leftIconVariant} height='group-active:stroke-neutral-0 group-hover:transition-all group-hover:ease-out group-hover:delay-300 group-hover:duration-300 group-hover:stroke-neutral-0 group-focus:stroke-neutral-0' strokeColor={leftIconColor} />
156
+ <Icon variant={leftIconVariant} height='group-active:stroke-neutral-0 group-hover:transition-all group-hover:ease-in-out group-hover:duration-100 group-hover:stroke-neutral-0 group-focus:stroke-neutral-0' strokeColor={leftIconColor} />
157
157
  </div>
158
158
  )}
159
159
  {label}
@@ -162,7 +162,7 @@ export default function Button(props) {
162
162
  <div className={ `group-hover:transition-all ${animatedHoverStroke}`}>
163
163
  <Icon className='z-10 stroke-2 group-hover:translate-x-[0.15rem] group-hover:transition-all group-hover:duration-300' height={`${ANIMATED_ARR_CLASSES['icon1'][`${size}`]} ${animatedHoverStroke}`} variant={'chevronright'} strokeColor={rightAnimatedArrowColor} />
164
164
 
165
- <Icon className='invisible stroke-2 group-hover:transition-all group-hover:delay-300 group-hover:visible ' height={`${ANIMATED_ARR_CLASSES['icon2'][`${size}`]} ${animatedHoverStroke}`} variant='minus01' strokeColor={rightAnimatedArrowColor} />
165
+ <Icon className='invisible stroke-2 group-hover:transition-all group-hover:delay-100 group-hover:visible ' height={`${ANIMATED_ARR_CLASSES['icon2'][`${size}`]} ${animatedHoverStroke}`} variant='minus01' strokeColor={rightAnimatedArrowColor} />
166
166
 
167
167
  </div>
168
168
  )}
@@ -0,0 +1,63 @@
1
+ import React from "react";
2
+ import { Badges } from '../../BadgesCaption';
3
+ import { Typography } from '../../../foundation/Typography'
4
+ import { ProfileAvatar } from '../../Avatars'
5
+ import { Time } from "../../../helpers/Time";
6
+ import { HDSButton } from '../../Buttons'
7
+ import { Icon } from "../../common-components";
8
+
9
+ export default function FlyoutB(props) {
10
+ const {
11
+ iconVariant = 'home03',
12
+ strokeColor = '#C6D6FF',
13
+ primaryBtnLabel = 'label1',
14
+ mainDescription = 'Choose from our open source community edition, fully managed cloud edition or custom enterprise',
15
+ secondaryBtn = [
16
+ { cta_leftVariantIcon: 'home03', cta_leftVariantIconColor: '#6C737F', cta_text: 'Button 1' },
17
+ { cta_leftVariantIcon: 'home04', cta_leftVariantIconColor: '#6C737F', cta_text: 'Button 2' }
18
+ ]
19
+ } = props;
20
+
21
+ return (
22
+ <div>
23
+ <div className="">
24
+ <div className="bg-neutral-0 shadow-sm rounded-2xl">
25
+ <div className="p-6">
26
+ <Icon height='h-10 w-10' variant={iconVariant} strokeColor={strokeColor} />
27
+ <div>
28
+ <HDSButton
29
+ label={primaryBtnLabel}
30
+ type='secondaryLink'
31
+ leftIconVariant='none'
32
+ rightIconVariant='none'
33
+ state='default'
34
+ size='sm'
35
+ rightAnimatedArrow={true}
36
+ rightAnimatedArrowColor='#6C737F'
37
+ />
38
+ </div>
39
+ <Typography className='mt-2 text-neutral-800' textStyle='body3'>{mainDescription}</Typography>
40
+ </div>
41
+
42
+ <div className="grid grid-cols-2 justify-around border-t divide-x divide-neutral-150 border-neutral-150">
43
+ {secondaryBtn.map((btn, index) => (
44
+ <a key={index} href='#' className=" p-6 flex justify-center ">
45
+ <HDSButton
46
+ leftIconVariant={btn.cta_leftVariantIcon}
47
+ leftIconColor={btn.cta_leftVariantIconColor}
48
+ rightIconVariant='none'
49
+ type='secondaryLink'
50
+ label={btn.cta_text}
51
+ state='default'
52
+ size='lg'
53
+ rightAnimatedArrow={true}
54
+ rightAnimatedArrowColor='#6C737F'
55
+ />
56
+ </a>
57
+ ))}
58
+ </div>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ );
63
+ }
@@ -1 +1,2 @@
1
- export {default as Flyout} from './flyout';
1
+ export {default as Flyout} from './flyout';
2
+ export {default as FlyoutB} from './flyoutB';
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import { Icon } from "../../common-components/Icon";
3
+ import {HDSColor} from '../../../foundation/ColorPalette'
4
+ import { Typography } from '../../../foundation/Typography'
5
+
6
+
7
+ export default function TalkCard(props) {
8
+ const iconBG = HDSColor(props.iconBg);
9
+ return (
10
+ <div className='bg-neutral-0 rounded-3xl shadow p-6'>
11
+ <div className={`${iconBG} w-12 h-12 flex items-center justify-center rounded-full mb-6`}>
12
+ <Icon height={'w-6 h-6 stroke-neutral-800 stroke-[1.5px]'} variant={props.iconVariant} strokeColor={props.iconStroke} />
13
+ </div>
14
+ <div className="flex-1">
15
+ <Typography textStyle="h5" as="h5" className="mb-1 text-blue-600">{props.title}</Typography>
16
+ <Typography textStyle="body1" className="text-neutral-1000">{props.description}</Typography>
17
+ </div>
18
+ </div>
19
+
20
+ )
21
+
22
+ }
@@ -1 +1,2 @@
1
- export {default as TalkCard} from './talkCard';
1
+ export {default as TalkCard} from './talkCard';
2
+ export {default as IconCard} from './iconCard';
@@ -2,38 +2,59 @@ import React from "react";
2
2
  import { Badges } from '../../BadgesCaption';
3
3
  import { Typography } from '../../../foundation/Typography'
4
4
  import { ProfileAvatar } from '../../Avatars'
5
+ import { Time } from "../../../helpers/Time";
6
+ import { HDSButton } from '../../Buttons'
5
7
 
6
8
  export default function TalkCard(props) {
7
9
  return (
8
10
 
9
- <div className=" flex-col p-6 border border-neutral-200 rounded-3xl shadow bg-neutral-0">
10
- <Badges
11
- size={props.badges.size}
12
- color={props.badges.color}
13
- leftIconVariant={props.badges.leftIconVariant}
14
- leftIconColor={props.badges.leftIconColor}
15
- children={props.badges.label}
16
- />
17
- <Typography className='my-2 text-neutral-800' textStyle='h5'>{props.title}</Typography>
18
- <Typography className='my-2 text-neutral-600' textStyle='body1'>{props.para}</Typography>
19
-
20
-
21
- <div className="grid grid-cols-2 my-6 gap-4">
22
- {props.speakerSet.map((value,i) => (
23
-
24
- <ProfileAvatar
25
- name={value.name}
26
- size='md'
27
- designation={value.designation}
28
- imageUrl={value.imageUrl}
29
- />
30
-
31
- ))}
11
+ <div className=" ">
12
+
13
+ <div className="grid rounded-3xl shadow bg-neutral-0 grid-cols-2 border border-neutral-200 min-w-[882px] ">
14
+ <div className="px-8 py-6 border-r border-r-neutral-150" >
15
+
16
+
17
+ <Badges
18
+ size={props.badges.size}
19
+ color={props.badges.color}
20
+ leftIconVariant={props.badges.leftIconVariant}
21
+ leftIconColor={props.badges.leftIconColor}
22
+ children={props.badges.label}
23
+ />
24
+
25
+ <Typography className='my-2 text-neutral-800' textStyle='h5'>{props.title}</Typography>
26
+ <Typography className='my-2 text-neutral-600' textStyle='body1'>{props.para}</Typography>
27
+ </div>
28
+
29
+ <div className="flex flex-col pt-[2.875rem] justify-between">
30
+ <div className="pl-6 flex gap-6 mb-9 flex-col ">
31
+ {props.speakerSet.map((value, i) => (
32
+ <div key={i} className="">
33
+
34
+ <ProfileAvatar
35
+ name={value.name}
36
+ size='md'
37
+ designation={value.designation}
38
+ imageUrl={value.imageUrl}
39
+ />
40
+ </div>
41
+
42
+ ))}
43
+ </div>
44
+ <div className=" w-full border-t border-t-neutral-150 p-6 flex flex-row justify-between items-center">
45
+ <Typography textStyle='h6' className='text-blue-800'>{props.eventTime}</Typography>
46
+ <HDSButton
47
+ leftIconVariant='calendarplus02'
48
+ leftIconColor="#1E56E3"
49
+ rightIconVariant='none'
50
+ state='default'
51
+ size='sm'
52
+ type="iconOnly"
53
+
54
+ />
55
+ </div>
56
+ </div>
32
57
  </div>
33
-
34
-
35
-
36
-
37
58
  </div>
38
59
 
39
60
  )
@@ -8,6 +8,8 @@ export default function Carouseltest(props) {
8
8
  const [visibleCardsContainerWidth, setvisibleCardsContainerWidth] = React.useState(0);
9
9
  const [cardWidth, setcardWidth] = React.useState(0);
10
10
  const [totalContainerWidth, setTotalContainerWidth] = React.useState(0);
11
+ const [totalClick, setTotalClick] = React.useState(1);
12
+ const [totalCards, setTotalCards] = React.useState(0);
11
13
  React.useEffect(() => {
12
14
  const visibleCardsContainerWidth = refs[0]?.current?.parentNode?.offsetWidth;
13
15
  setvisibleCardsContainerWidth(visibleCardsContainerWidth);
@@ -19,6 +21,15 @@ export default function Carouseltest(props) {
19
21
  return acc + rect.width + parseFloat(getComputedStyle(ref.current).marginLeft) + parseFloat(getComputedStyle(ref.current).marginRight);
20
22
  }, 0);
21
23
  setTotalContainerWidth(totalCardsWidth);
24
+ const noOfcardsinaview = (visibleCardsContainerWidth/cardWidth);
25
+ console.log('noOfcardsinaview',noOfcardsinaview)
26
+ const cardLength = props.length;
27
+ setTotalCards(cardLength);
28
+ console.log('cardLength',cardLength)
29
+ setTotalClick(2*(cardLength/noOfcardsinaview));
30
+
31
+
32
+
22
33
  }, []);
23
34
 
24
35
 
@@ -56,9 +67,9 @@ export default function Carouseltest(props) {
56
67
  });
57
68
  };
58
69
 
59
- const totalCards = props.cards.length;
60
70
  const nextCard = () => {
61
- if (currentCard >= totalCards - 1) {
71
+ console.log('currentCard', currentCard,'totalClick', totalClick );
72
+ if (currentCard >= totalCards-1 || currentCard > totalClick+1) {
62
73
  scrollToCard(0);
63
74
  } else {
64
75
  scrollToCard(currentCard + 1);
@@ -76,24 +87,24 @@ export default function Carouseltest(props) {
76
87
 
77
88
  let x = visibleCardsContainerWidth;
78
89
  let noOfcardsinaview = visibleCardsContainerWidth/cardWidth;
90
+
79
91
  let y = 1;
80
- console.log('noOfcardsinaview*currentCard',noOfcardsinaview*(currentCard+1));
92
+
81
93
  // if((noOfcardsinaview*(currentCard+1))<=totalCards){
82
94
  // let y = (totalContainerWidth/(noOfcardsinaview*visibleCardsContainerWidth))*(noOfcardsinaview*(currentCard+1));
83
95
 
84
96
  // }
85
97
  console.log(totalContainerWidth, visibleCardsContainerWidth, currentCard )
86
- let slider1 = (384/(totalCards*cardWidth)) * (328)* (currentCard+3);
98
+ let slider1 = (384/(totalCards*cardWidth)) * (328)* (currentCard+noOfcardsinaview);
87
99
  if(slider1>384){
88
100
  slider1 = 384;
89
101
  }
90
-
91
-
92
- console.log('x',x, 'slider1', slider1 );
93
-
94
-
95
-
96
- let sliderWidth = slider1+ 'px';
102
+ let roundOff = Math.floor(totalClick);
103
+ let slider2 = 384/(roundOff+Math.floor(noOfcardsinaview)+1);
104
+ let sliderWidth = 1;
105
+ sliderWidth = (slider2 * (currentCard+1))+ 'px';
106
+
107
+
97
108
  return (
98
109
  <div className=' '>
99
110
  <div className='bg-pink-500 w-96 rounded-md content-center h-1'>
@@ -115,11 +126,11 @@ export default function Carouseltest(props) {
115
126
  <span role="img" aria-label={`Arrow ${isLeft ? 'left' : 'right'}`}>
116
127
  {isLeft ?
117
128
 
118
- <Icon height={'h-6'} variant={'chevronleft'} strokeColor='#1F2A37' />
129
+ <Icon height={'h-6 w-6'} variant={'chevronleft'} strokeColor='#1F2A37' />
119
130
 
120
131
  :
121
132
 
122
- <Icon height={'h-6'} variant={'chevronright'} strokeColor='#1F2A37' />
133
+ <Icon height={'h-6 w-6'} variant={'chevronright'} strokeColor='#1F2A37' />
123
134
 
124
135
  }
125
136
  </span>
@@ -2,7 +2,8 @@ import React from 'react';
2
2
  import { useState } from 'react';
3
3
  import { Dialog } from '@headlessui/react';
4
4
  import { Icon } from '../common-components/Icon';
5
- import { Typography } from '../../foundation/Typography'
5
+ import { Typography } from '../../foundation/Typography';
6
+ import {HDSButton} from '../Buttons'
6
7
 
7
8
  export default function CustomHeader(props) {
8
9
  const {
@@ -15,8 +16,7 @@ export default function CustomHeader(props) {
15
16
  <header className="bg-white">
16
17
  <nav className="mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8" aria-label="Global">
17
18
  <a href="#" className="-m-1.5 p-1.5 flex">
18
- <Icon variant={'HasuraBlueLogo'} strokeColor={'#1EA7FD'} />
19
- <Typography className='ml-1.5' textStyle='h4'>{label}</Typography>
19
+ <Icon variant={'hasuraPrimary'} strokeColor={''} />
20
20
  </a>
21
21
  <div className="flex lg:hidden">
22
22
  <button
@@ -26,7 +26,7 @@ export default function CustomHeader(props) {
26
26
  >
27
27
  <span className="sr-only">Open main menu</span>
28
28
 
29
- <Icon height={'h-6'} variant={'searchsm'} strokeColor={'#3970FD'} />
29
+ <Icon height={'h-6'} variant={'menu05'} strokeColor={'#3970FD'} />
30
30
  </button>
31
31
  </div>
32
32
  <div className="hidden lg:flex lg:gap-x-12">
@@ -40,11 +40,12 @@ export default function CustomHeader(props) {
40
40
  </a>
41
41
  </div>
42
42
  </nav>
43
- <Dialog as="div" className="lg:hidden" open={mobileMenuOpen} onClose={setMobileMenuOpen}>
44
- <div className="fixed inset-0 z-10" />
45
- <Dialog.Panel className="fixed inset-y-0 right-0 z-10 w-full overflow-y-auto bg-white px-6 py-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10">
46
- <div className="flex items-center justify-between">
47
- {/* <a href="#" className="-m-1.5 p-1.5">
43
+ <div className='transition-all '>
44
+ <Dialog as="div" className="lg:hidden" open={mobileMenuOpen} onClose={setMobileMenuOpen}>
45
+ <div className="fixed inset-0 z-10" />
46
+ <Dialog.Panel className="fixed border rounded-l-3xl inset-y-0 bg-neutral-0 max-w-min min-w-fit right-0 z-10 w-full overflow-y-auto bg-white px-6 py-6 sm:ring-1 sm:ring-gray-900/10">
47
+ <div className="flex items-center justify-end">
48
+ {/* <a href="#" className="-m-1.5 p-1.5">
48
49
  <span className="sr-only">Your Company</span>
49
50
  <img
50
51
  className="h-8 w-auto"
@@ -52,41 +53,49 @@ export default function CustomHeader(props) {
52
53
  alt=""
53
54
  />
54
55
  </a> */}
55
- <button
56
- type="button"
57
- className="-m-2.5 rounded-md p-2.5 text-gray-700"
58
- onClick={() => setMobileMenuOpen(false)}
59
- >
60
- <span className="sr-only">Close menu</span>
56
+ <button
57
+ type="button"
58
+ className="-m-2.5 rounded-md p-2.5 text-gray-700"
59
+ onClick={() => setMobileMenuOpen(false)}
60
+ >
61
+ <span className="sr-only">Close menu</span>
61
62
 
62
- <Icon height={'h-6'} variant={'home03'} strokeColor={'#3970FD'} />
63
- </button>
64
- </div>
65
- <div className="mt-6 flow-root">
66
- <div className="-my-6 divide-y divide-gray-500/10">
67
- <div className="space-y-2 py-6">
68
- {childArray.map((item) => (
69
- <a
70
- key={item.name}
71
- href={item.href}
72
- className="-mx-3 block rounded-lg py-2 px-3 text-base font-semibold leading-7 text-gray-900 hover:bg-gray-50"
73
- >
74
- {item.name}
75
- </a>
76
- ))}
77
- </div>
78
- <div className="py-6">
79
- <a
80
- href="#"
81
- className="-mx-3 block rounded-lg py-2.5 px-3 text-base font-semibold leading-7 text-gray-900 hover:bg-gray-50"
82
- >
83
- Log in
84
- </a>
63
+ <Icon height={'h-6'} variant={'xclose'} strokeColor={'#3970FD'} />
64
+ </button>
65
+ </div>
66
+ <div className="mt-6 flow-root">
67
+ <Typography textStyle='h6' className='text-neutral-400'>MENU</Typography>
68
+ <div className=" flex-col divide-y divide-blue-600/10">
69
+ <div className="space-y-2 py-6 pr-48">
70
+ {childArray.map((item) => (
71
+ <a
72
+ key={item.name}
73
+ href={item.href}
74
+ className="-mx-3 rounded-lg flex gap-5 py-2 px-3 text-base font-semibold leading-7 text-gray-900 hover:bg-gray-50"
75
+ >
76
+ <Icon height={'h-6'} variant={'home03'} strokeColor={'#6C737F'} />
77
+ {item.name}
78
+ </a>
79
+ ))}
80
+ </div>
81
+ <div className="py-6">
82
+ <HDSButton
83
+ leftIconVariant = 'none'
84
+ rightIconVariant = 'none'
85
+ label = 'Log In'
86
+ state = 'default'
87
+ size = 'sm'
88
+ rightAnimatedArrow = 'true'
89
+ rightAnimatedArrowColor = '#ffffff'
90
+ animatedHoverStroke = 'group-hover:stroke-neutral-0'
91
+ />
92
+ </div>
85
93
  </div>
86
94
  </div>
87
- </div>
88
- </Dialog.Panel>
89
- </Dialog>
95
+ </Dialog.Panel>
96
+ </Dialog>
97
+ </div>
98
+
90
99
  </header>
91
100
  )
92
101
  }