hds-web 1.2.9 → 1.3.0

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.2.9",
3
+ "version": "1.3.0",
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={`${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]`}>
9
+ <div className={`${size} group rounded-3xl 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 tb:flex-col tb:flex tb:items-center tb:p-8 tb:ml-0 bg-neutral-0">
11
+ <div className="tb:flex-col tb:flex tb:items-center tb:px-8 tb:pb-8 tb:mt-8 tb:ml-0 bg-neutral-0 text-center">
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] tb:min-w-[18rem] tb:rounded-2xl border-neutral-0 rounded-r-2xl `}
17
+ className={`inline-block w-[9rem] tb:min-w-[18rem] tb:rounded border-neutral-0 rounded-r-2xl `}
18
18
  src={imageUrl}
19
19
  />
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>
20
+ <div className="absolute rounded-b-3xl 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
 
@@ -44,6 +44,7 @@ const Buttonclasses = {
44
44
  },
45
45
  'disabled': 'bg-neutral-200 text-neutral-400',
46
46
  },
47
+
47
48
  'ghost': {
48
49
  'default': {
49
50
  'base': 'db:w-fit tb:w-fit w-full justify-center text-blue-600',
@@ -13,7 +13,7 @@ export default function LinkCard(props) {
13
13
  <>
14
14
  <a
15
15
  href={props.linkUrl}
16
- className={`${cardHoverClasses} ${cardBgColorClass} min-w-[15rem] rounded-2xl border border-neutral-150 p-6 block`}
16
+ className={`${cardHoverClasses} ${cardBgColorClass} min-w-[11.5rem] rounded-2xl border border-neutral-150 p-6 block`}
17
17
  >
18
18
  {props.brandImageUrl ?
19
19
  (
@@ -45,7 +45,7 @@ export default function LinkCard(props) {
45
45
  <Typography
46
46
  as="h5"
47
47
  textStyle="body1c-bold"
48
- className="text-neutral-1000">
48
+ className={HDSColor(props.titleTextColor)}>
49
49
  {props.title}
50
50
  </Typography>
51
51
  </div>
@@ -60,7 +60,7 @@ export default function LinkCard(props) {
60
60
  {props.description &&
61
61
  (<Typography
62
62
  textStyle="body3"
63
- className="text-neutral-1000 mt-2">
63
+ className={`${HDSColor(props.descTextColor)} mt-2`}>
64
64
  {props.description}
65
65
  </Typography>)}
66
66
  </>
@@ -75,7 +75,6 @@ LinkCard.defaultProps = {
75
75
  brandImageUrl: '',
76
76
  brandImageAlt:'',
77
77
  linkUrl: '#',
78
- cardBgColor: 'bg-neutral-0',
79
78
  cardHoverBg: 'bg-neutral-0',
80
79
  iconVariant: 'videorecorder',
81
80
  iconStrokeColor: 'blue-500',
@@ -3,7 +3,7 @@ import { Icon } from "../../common-components/Icon";
3
3
  import { HDSColor } from '../../../foundation/ColorPalette'
4
4
  import { Typography } from '../../../foundation/Typography'
5
5
  import { HDSButton } from "../../Buttons";
6
-
6
+ import ReactMarkdown from "react-markdown";
7
7
  const cardVariant = {
8
8
  "withButton": {
9
9
  'cardStyle': 'p-10 ',
@@ -63,12 +63,14 @@ export default function IconCard(props) {
63
63
  >
64
64
  {props.title}
65
65
  </Typography>
66
+
66
67
  <Typography
67
68
  textStyle={cardVariant[props.cardType]['descTextStyle']}
68
- className={cardVariant[props.cardType]['descClasses']}
69
-
69
+ className={`${cardVariant[props.cardType]['descClasses']} [&>p]:pb-2 last:[&>p]:pb-0 [&>ul]:ps-4 [&>ul>li]:list-disc [&>ul>li]:pb-2 last:[&>ul>li]:pb-0 [&>p>a]:text-blue-600`}
70
70
  >
71
- {props.description}
71
+ <ReactMarkdown>
72
+ {props.description}
73
+ </ReactMarkdown>
72
74
  </Typography>
73
75
  </>
74
76
  )
@@ -5,6 +5,7 @@ import { Icon } from '../common-components/Icon';
5
5
  import { Typography } from '../../foundation/Typography';
6
6
  import { HDSButton } from '../Buttons';
7
7
  import { V3Dropdown } from '../Cards/Dropdown'
8
+ import { HDSColor } from '../../foundation/ColorPalette';
8
9
 
9
10
  const solutions = [
10
11
  {
@@ -45,11 +46,11 @@ export default function V3Header(props) {
45
46
  leaveTo="opacity-0 translate-y-1"
46
47
  >
47
48
  <Popover.Panel className="fixed left-0 ml z-10 mt-3 transform ">
48
- <div className='ml-[9.55rem]'>
49
- <Icon variant='triangle' height='h-6 w-6 fill-neutral-100' strokeClass='stroke-neutral-100'/>
50
- </div>
49
+ <div className='ml-[9.55rem]'>
50
+ <Icon variant='triangle' height='h-6 w-6 fill-neutral-100' strokeClass='stroke-neutral-100' />
51
+ </div>
51
52
  <div className=" p-2 bg-neutral-100 rounded-lg">
52
-
53
+
53
54
  <V3Dropdown
54
55
  primaryCard={{
55
56
  iconVariant: 'home03',
@@ -106,7 +107,7 @@ export default function V3Header(props) {
106
107
  }
107
108
  ]}
108
109
  />
109
-
110
+
110
111
  </div>
111
112
  </Popover.Panel>
112
113
  </Transition>
@@ -121,7 +122,7 @@ export default function V3Header(props) {
121
122
  <>
122
123
  <Popover.Button
123
124
  className={classNames(
124
- open ? 'text-pink-800' : 'text-gray-500',
125
+ open ? '' : 'text-gray-500',
125
126
  'group inline-flex items-center rounded-md bg-white hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2'
126
127
  )}
127
128
  >
@@ -143,58 +144,70 @@ export default function V3Header(props) {
143
144
 
144
145
  return (
145
146
  <Popover className="relative">
146
- <div className="flex items-center bg-neutral-50 justify-between p-6 md:justify-start md:space-x-6">
147
- <div>
147
+ <div className={`flex items-center ${HDSColor(props.headerBg)} justify-between p-6 tb-l:justify-between tb-l:space-x-6`}>
148
+ <div className='flex items-center'>
148
149
  <a href={props.headerUrl} className="flex items-center">
149
150
  <Icon height='w-[103px] h-[33px]' variant={'hasuraPrimary'} strokeColor={''} />
150
151
  </a>
151
- </div>
152
- <div className="tb:hidden">
153
- <Popover.Button className="inline-flex items-center justify-center rounded-md bg-white p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500">
154
- <span className="sr-only">Open menu</span>
155
- <div className=' gap-6 flex'>
156
- {/* <Icon height={'h-5 w-5'} variant={'searchsm'} strokeColor={'#3970FD'} /> */}
157
- <Icon height={'h-5 w-5'} variant={'menu05'} strokeColor={'#3970FD'} />
158
- </div>
159
- </Popover.Button>
160
- </div>
161
- <div className="hidden tb:flex tb:flex-1 tb:items-center tb:justify-between">
162
- <Popover.Group as="nav" className="flex space-x-6">
152
+ <Popover.Group as="nav" className="hidden tb-l:pl-8 tb-l:flex tb-l:space-x-6">
163
153
  {headerListfn(props.HEADER_LIST)}
164
154
  </Popover.Group>
155
+ </div>
156
+ <div className='flex tb-l:justify-between'>
157
+ <div className=" tb-l:flex tb-l:flex-1 tb-l:items-center tb-l:justify-between">
165
158
 
159
+ <div className="flex items-center gap-4 tb-l:ml-12">
166
160
 
167
- <div className="flex items-center gap-6 md:ml-12">
168
-
169
- {/* <Icon height={'h-6'} variant={'searchsm'} strokeColor={'#3970FD'} /> */}
170
- <HDSButton
171
- label="Log In"
172
- type='tonal'
173
- leftIconVariant='none'
174
- rightIconVariant='none'
175
- state='default'
176
- size='sm'
177
- rightAnimatedArrow='true'
178
- rightAnimatedArrowColor='#3970FD'
179
- animatedHoverStroke='group-hover:stroke-neutral-0'
180
- />
181
- <HDSButton
182
- label="Get Started"
183
- type='primary'
184
- leftIconVariant='none'
185
- rightIconVariant='none'
186
- state='default'
187
- size='sm'
188
- rightAnimatedArrow='true'
189
- rightAnimatedArrowColor='#ffffff'
190
- animatedHoverStroke='group-hover:stroke-neutral-0'
191
- />
161
+ {/* <Icon height={'h-6'} variant={'searchsm'} strokeColor={'#3970FD'} /> */}
162
+ <div>
192
163
 
193
- </div>
164
+ </div>
165
+ <a href='' className='hidden tb:flex'>
166
+ <Typography textStyle='body3c-medium' className='text-neutral-800'>
167
+ Contact Sales
168
+ </Typography>
169
+ </a>
170
+ <HDSButton
171
+ label="Log In"
172
+ type='tonal'
173
+ leftIconVariant='none'
174
+ rightIconVariant='none'
175
+ state='default'
176
+ size='sm'
177
+ rightAnimatedArrow='true'
178
+ rightAnimatedArrowColor='#3970FD'
179
+ animatedHoverStroke='group-hover:stroke-neutral-0'
180
+ className='hidden tb-l:flex'
181
+ />
182
+ <HDSButton
183
+ label="Get Started"
184
+ type='primary'
185
+ leftIconVariant='none'
186
+ rightIconVariant='none'
187
+ state='default'
188
+ size='sm'
189
+ rightAnimatedArrow='true'
190
+ rightAnimatedArrowColor='#ffffff'
191
+ animatedHoverStroke='group-hover:stroke-neutral-0'
192
+ className='hidden tb:flex'
193
+ />
194
+
195
+ </div>
194
196
 
195
197
 
196
198
 
199
+ </div>
200
+ <div className="tb-l:hidden flex items-center">
201
+ <Popover.Button className="inline-flex items-center justify-center rounded-md bg-white pl-6 text-gray-400 hover:bg-gray-100 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500">
202
+ <span className="sr-only">Open menu</span>
203
+ <div className=' gap-6 flex'>
204
+ {/* <Icon height={'h-5 w-5'} variant={'searchsm'} strokeColor={'#3970FD'} /> */}
205
+ <Icon height={'h-5 w-5'} variant={'menu05'} strokeColor={'#3970FD'} />
206
+ </div>
207
+ </Popover.Button>
208
+ </div>
197
209
  </div>
210
+
198
211
  </div>
199
212
 
200
213
  <Transition
@@ -206,12 +219,12 @@ export default function V3Header(props) {
206
219
  leaveFrom="opacity-100 scale-100"
207
220
  leaveTo="opacity-0 scale-95"
208
221
  >
209
- <Popover.Panel focus className="absolute h-[calc(100%-112px)] bg-base-0 z-[1] inset-x-0 top-0 origin-top-right transform transition md:hidden">
210
- <div className=" rounded-lg bg-white h-[calc(100%-112px)] shadow-lg">
211
- <div className="">
222
+ <Popover.Panel focus className="absolute h-[calc(100%-112px)] bg-base-0 z-[1] inset-x-0 top-0 origin-top-right transform transition tb-l:hidden">
223
+ <div className=" rounded-lg bg-neutral-0 h-[calc(100%-112px)] shadow-lg">
224
+ <div className="bg-neutral-0">
212
225
  <div className="flex items-center justify-end">
213
226
  <div className="">
214
- <Popover.Button className="inline-flex items-center justify-center rounded-md bg-white p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-500 w-full">
227
+ <Popover.Button className="inline-flex items-center justify-center pt-4 pr-4 w-full focus:ring-0">
215
228
  <Icon height={'h-5 w-5'} variant={'xclose'} strokeColor={'#3970FD'} />
216
229
  </Popover.Button>
217
230
  </div>
@@ -252,33 +265,35 @@ export default function V3Header(props) {
252
265
  <div className="py-6 px-5 ">
253
266
  <div className="mt-6 ">
254
267
  <div className='flex flex-row justify-around'>
255
- <div className='w-full '>
256
- <HDSButton
257
- label="Log In"
258
- type='tonal'
259
- leftIconVariant='none'
260
- rightIconVariant='none'
261
- state='default'
262
- size='sm'
263
- rightAnimatedArrow='true'
264
- rightAnimatedArrowColor='#3970FD'
265
- animatedHoverStroke='group-hover:stroke-neutral-0'
266
-
267
- />
268
- </div>
269
- <div className='w-full'>
270
- <HDSButton
271
- label="Sign up"
272
- type='primary'
273
- leftIconVariant='none'
274
- rightIconVariant='none'
275
- state='default'
276
- size='sm'
277
- rightAnimatedArrow='true'
278
- rightAnimatedArrowColor='#ffffff'
279
- animatedHoverStroke='group-hover:stroke-neutral-0'
280
-
281
- />
268
+ <div className='w-full flex gap-2'>
269
+ <div className='w-1/2'>
270
+ <HDSButton
271
+ label="Log In"
272
+ type='tonal'
273
+ leftIconVariant='none'
274
+ rightIconVariant='none'
275
+ state='default'
276
+ size='sm'
277
+ rightAnimatedArrow='true'
278
+ rightAnimatedArrowColor='#3970FD'
279
+ animatedHoverStroke='group-hover:stroke-neutral-0'
280
+
281
+
282
+ />
283
+ </div>
284
+ <div className='w-1/2'>
285
+ <HDSButton
286
+ label="Sign up"
287
+ type='primary'
288
+ leftIconVariant='none'
289
+ rightIconVariant='none'
290
+ state='default'
291
+ size='sm'
292
+ rightAnimatedArrow='true'
293
+ rightAnimatedArrowColor='#ffffff'
294
+ animatedHoverStroke='group-hover:stroke-neutral-0'
295
+ />
296
+ </div>
282
297
  </div>
283
298
  </div>
284
299
  </div>
@@ -365,5 +380,5 @@ V3Header.defaultProps = {
365
380
  },
366
381
 
367
382
  ],
368
- headerUrl:'https://hasura.io/'
383
+ headerUrl: 'https://hasura.io/'
369
384
  }
@@ -0,0 +1,152 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import { MediaBox } from '../../helpers/Media';
3
+ import { Typography } from '../../foundation/Typography';
4
+ import { HDSButton } from '../../components/Buttons';
5
+ import { HDSColor } from '../../foundation/ColorPalette';
6
+ import { Tab } from '../../components/Tabs';
7
+ import PropTypes from 'prop-types';
8
+ import { LinkCard } from '../Cards/Link';
9
+
10
+ const tabCard = (tabContent) => (
11
+ <>
12
+ <div className='tb:px-3'>
13
+ {tabContent.title &&
14
+ <Typography
15
+ textStyle='h2'
16
+ className={HDSColor(tabContent.title_color)}>
17
+ {tabContent.title}
18
+ </Typography>}
19
+
20
+ {tabContent.sub_title &&
21
+ <Typography
22
+ textStyle='sub2'
23
+ className={`mt-2 ${HDSColor(tabContent.sub_title_color)}`}>
24
+ {tabContent.sub_title}
25
+ </Typography>}
26
+ </div>
27
+ {tabContent.btnLabel &&
28
+ <div className='flex pl-3 pt-6'>
29
+ <HDSButton
30
+ label={tabContent.btnLabel}
31
+ type='secondary'
32
+ leftIconVariant='none'
33
+ rightIconVariant='none'
34
+ state='default'
35
+ size='sm'
36
+ rightAnimatedArrow={true}
37
+ rightAnimatedArrowColor='#1E56E3'
38
+ animatedHoverStroke='group-hover:stroke-blue-600'
39
+ className='flex'
40
+ btnTextColorClass='text-blue-600'
41
+ />
42
+ </div>
43
+ }
44
+
45
+ </>
46
+ )
47
+
48
+ export default function HeroCapability(props) {
49
+
50
+ const LinkCardsFn = (heroData) => {
51
+ return (
52
+ heroData.linkCards && (
53
+ <div className="flex mt-16 gap-6 justify-center">
54
+ {heroData.linkCards.map((card, index) => (
55
+ <div key={index} className="w-full">
56
+ <LinkCard
57
+ titleTextColor= {card.titleTextColor}
58
+ descTextColor={card.descTextColor}
59
+ linkUrl={card.linkUrl}
60
+ cardBgColor={card.cardBgColor}
61
+ cardHoverBg={card.cardHoverBg}
62
+ iconVariant={card.iconVariant}
63
+ iconStrokeColor={card.iconStrokeColor}
64
+ iconArrowVariant={card.iconArrowVariant}
65
+ iconArrowStrokeColor={card.iconArrowStrokeColor}
66
+ title={card.title}
67
+ description={card.description}
68
+ />
69
+ </div>
70
+ ))}
71
+ </div>
72
+ )
73
+ );
74
+ };
75
+
76
+
77
+ const [activeTab, setActiveTab] = useState('');
78
+
79
+ useEffect(() => {
80
+ if (props.heroData.tabContent) {
81
+ const tabNames = Object.keys(props.heroData.tabContent);
82
+ setActiveTab(tabNames[0]);
83
+ }
84
+ }, [props.heroData.tabContent]);
85
+
86
+ const handleTabClick = (tab) => {
87
+ if (tab.name) {
88
+ setActiveTab(tab.name);
89
+ }
90
+ else return;
91
+ // Perform any other actions based on the clicked tab
92
+ }
93
+ let bgClass = '';
94
+ let bgTabClass = '';
95
+ let video_url = '';
96
+ let video_poster = '';
97
+ let img_url = '';
98
+ if(props.heroData && props.heroData.tabContent && props.heroData.tabContent[activeTab] && props.heroData.tabContent[activeTab]['bg_color']){
99
+ bgClass = HDSColor(props.heroData.tabContent[activeTab]['bg_color'])
100
+ }
101
+ if(props.heroData && props.heroData.tabContent && props.heroData.tabContent[activeTab] && props.heroData.tabContent[activeTab]['bg_color_tab']){
102
+ bgTabClass = HDSColor(props.heroData.tabContent[activeTab]['bg_color_tab'])
103
+ }
104
+ if(props.heroData && props.heroData.tabContent && props.heroData.tabContent[activeTab] && props.heroData.tabContent[activeTab]['video_url']){
105
+ video_url = props.heroData.tabContent[activeTab]['video_url']
106
+ }
107
+ if(props.heroData && props.heroData.tabContent && props.heroData.tabContent[activeTab] && props.heroData.tabContent[activeTab]['video_poster']){
108
+ video_poster = props.heroData.tabContent[activeTab]['video_poster']
109
+ }
110
+ if(props.heroData && props.heroData.tabContent && props.heroData.tabContent[activeTab] && props.heroData.tabContent[activeTab]['img_url']){
111
+ img_url = props.heroData.tabContent[activeTab]['img_url']
112
+ }
113
+
114
+ return (
115
+ <div className={`${bgClass} max-w-7xl rounded-3xl`} >
116
+ {props.heroData.navTabs &&
117
+
118
+ <div className='pt-5 px-8 db:p-20 tb:p-10 flex flex-col shadow rounded-2xl'>
119
+
120
+ <div className='flex overflow-visible scrollbar-hide tb-l:justify-center justify-start'>
121
+ <div className={`${bgTabClass} rounded-[32px]`}>
122
+ <Tab
123
+ onTabClick={handleTabClick}
124
+ tabs={props.heroData.navTabs}
125
+ />
126
+ </div>
127
+ </div>
128
+ <div className='flex flex-col-reverse pt-6 tb:flex tb:flex-row tb:items-center tb:pt-10 tb:justify-between'>
129
+ <div className=' mt-3 db:max-w-[488px] tb:w-1/2'>
130
+ {props.heroData.tabContent &&
131
+ props.heroData.tabContent[activeTab] &&
132
+ tabCard(props.heroData.tabContent[activeTab])}
133
+ </div>
134
+ <div className=' db:max-w-[540px] tb:w-1/2 '>
135
+ <MediaBox
136
+ video_url = {video_url}
137
+ video_poster = {video_poster}
138
+ img_url = {img_url}
139
+ />
140
+ </div>
141
+ </div>
142
+
143
+ <div>
144
+ {LinkCardsFn(props.heroData)}
145
+ </div>
146
+ </div>
147
+
148
+ }
149
+
150
+ </div>
151
+ )
152
+ }
@@ -1,2 +1,3 @@
1
1
  export {default as Hero1} from './h1'
2
- export {default as HeroSecondary} from './h2'
2
+ export {default as HeroSecondary} from './h2'
3
+ export {default as HeroCapability} from './h3'
@@ -27,7 +27,7 @@ export default function Tab(props) {
27
27
  };
28
28
 
29
29
  return (
30
- <div>
30
+ <div className=''>
31
31
  <div className="block">
32
32
  <nav className="relative inline-flex gap-2 rounded-full" aria-label="Tabs">
33
33
  {tabs.map(tab => (
@@ -36,8 +36,8 @@ export default function Tab(props) {
36
36
  href="#"
37
37
  className={`px-3 py-1 font-medium text-sm rounded-full ${
38
38
  activeTab === tab
39
- ? ' first:bg-blue-500 text-neutral-0 transition-all delay-100 duration-100 '
40
- : 'text-neutral-500 transition-all delay-200 flex-nowrap '
39
+ ? ' first:bg-blue-500 text-neutral-0 transition-all delay-500 duration-100 '
40
+ : 'text-neutral-500 transition-all flex-nowrap '
41
41
  }`}
42
42
  aria-current={activeTab === tab ? 'page' : undefined}
43
43
  onClick={(event) => handleTabClick(event, tab)}
@@ -16,6 +16,7 @@ export default function Typography(props) {
16
16
  'h4': 'text-hds-m-h4 tb:text-hds-t-h4 db:text-hds-d-h4',
17
17
  'h5': 'text-hds-m-h5 tb:text-hds-t-h5 db:text-hds-d-h5',
18
18
  'h6': 'text-hds-m-h6 tb:text-hds-t-h6 db:text-hds-d-h6',
19
+ 'h7': 'text-hds-m-h7 tb:text-hds-t-h7 db:text-hds-d-h7',
19
20
  'sub1': 'text-hds-m-sub1 tb:text-hds-t-sub1 db:text-hds-d-sub1',
20
21
  'sub2': 'text-hds-m-sub2 tb:text-hds-t-sub2 db:text-hds-d-sub2',
21
22
  'body1': 'text-hds-m-body1 tb:text-hds-t-body1 db:text-hds-d-body1',
@@ -0,0 +1,61 @@
1
+ import React from 'react';
2
+
3
+ const GridComponent = ({ cards, gridSize }) => {
4
+ const numCards = cards.length;
5
+ const cardsLeftInLastRow = numCards % gridSize;
6
+ const lastRowColSpan = `col-span-${gridSize / cardsLeftInLastRow}`;
7
+
8
+ const renderCards = () => {
9
+ return cards.map((card, index) => (
10
+ <div
11
+ className='gridClass'
12
+ key={index}
13
+ >
14
+ {/* Render card content */}
15
+ {card}
16
+ </div>
17
+ ));
18
+ };
19
+
20
+ return (
21
+ <div className='flex flex-wrap'>
22
+ {renderCards()}
23
+ </div>
24
+ );
25
+ };
26
+
27
+ export default GridComponent;
28
+
29
+
30
+
31
+
32
+ // 2x2, 3x3, 4x4
33
+ // odd even
34
+
35
+ //2x2 -odd grid grid-cols-2
36
+ //case 1: NOC = 3
37
+ // .... ....
38
+ // ......... colr-span-2
39
+
40
+
41
+ //3x3 -odd
42
+ //case 1: noc:5
43
+ /// ... ... ...
44
+ // ..... ..... col-span-1.5 col-span-1.5
45
+ //case 2: noc:4
46
+ /// ... ... ...
47
+ // ........... col-span-3
48
+
49
+
50
+
51
+ //4x4
52
+
53
+ // case1: noc 5:
54
+ // .. .. .. ..
55
+ // ........... col-span-4
56
+ // case2: noc 6:
57
+ // .. .. .. ..
58
+ // ..... ..... col-span-2 col span-2
59
+ // case1: noc 7:
60
+ // .. .. .. ..
61
+ // ... ... ... col-span-4/3 col-span-4/3 col-span-4/3
@@ -0,0 +1 @@
1
+ export {default as GridComponent} from './grid';
@@ -20,7 +20,7 @@ export default function MediaViewer ({ img_url, video_url, video_poster, width }
20
20
  </div>
21
21
  )}
22
22
 
23
- {video_url && video_poster && (
23
+ {video_url && !img_url && video_poster && (
24
24
  <div>
25
25
  {!isVideoPlaying ? (
26
26
  <div className='relative flex justify-center'>
package/src/index.css CHANGED
@@ -3,6 +3,15 @@
3
3
  @tailwind utilities;
4
4
  /* Typography classes */
5
5
 
6
+ .gridAutoClass {
7
+ flex: 1 0 30%;
8
+ margin-top: 40px;
9
+ margin-right: 32px;
10
+ background: blue;
11
+ justify-content: center;
12
+ display: flex;
13
+ }
14
+
6
15
  @keyframes pill-move-left {
7
16
  0% {
8
17
  left: 0;