hds-web 1.5.2 → 1.5.4
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/dist/index.css +2 -2
- package/dist/index.es.css +2 -2
- package/dist/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/HDS/components/Hero/h3.js +38 -28
- package/src/HDS/components/Tables/tableB.js +8 -8
- package/src/HDS/components/Tables/tableD.js +2 -2
- package/src/HDS/components/Tabs/tab.js +35 -14
- package/src/styles/tailwind.css +26 -41
@@ -7,27 +7,28 @@ import { Tab } from '../../components/Tabs';
|
|
7
7
|
import PropTypes from 'prop-types';
|
8
8
|
import { LinkCard } from '../Cards/Link';
|
9
9
|
|
10
|
-
|
10
|
+
|
11
|
+
const tabCard = (Content) => (
|
11
12
|
<>
|
12
13
|
<div className='tb:px-3'>
|
13
|
-
{
|
14
|
+
{Content.title &&
|
14
15
|
<Typography
|
15
16
|
textStyle='h2'
|
16
|
-
className={HDSColor(
|
17
|
-
{
|
17
|
+
className={HDSColor(Content.titleTextColor)}>
|
18
|
+
{Content.title}
|
18
19
|
</Typography>}
|
19
20
|
|
20
|
-
{
|
21
|
+
{Content.subTitle &&
|
21
22
|
<Typography
|
22
23
|
textStyle='sub2'
|
23
|
-
className={`mt-2 ${HDSColor(
|
24
|
-
{
|
24
|
+
className={`mt-2 ${HDSColor(Content.subTitleTextColor)}`}>
|
25
|
+
{Content.subTitle}
|
25
26
|
</Typography>}
|
26
27
|
</div>
|
27
|
-
{
|
28
|
+
{Content.btnLabel &&
|
28
29
|
<div className='flex pl-3 pt-6'>
|
29
30
|
<HDSButton
|
30
|
-
label={
|
31
|
+
label={Content.btnLabel}
|
31
32
|
type='secondary'
|
32
33
|
leftIconVariant='none'
|
33
34
|
rightIconVariant='none'
|
@@ -46,15 +47,16 @@ const tabCard = (tabContent) => (
|
|
46
47
|
)
|
47
48
|
|
48
49
|
export default function HeroCapability(props) {
|
50
|
+
console.log(props.heroData);
|
49
51
|
|
50
52
|
const LinkCardsFn = (heroData) => {
|
51
53
|
return (
|
52
54
|
heroData.linkCards && (
|
53
|
-
<div className="flex px-8 tb:px-0 tb:justify-center overflow-
|
55
|
+
<div className="flex px-8 tb:px-0 tb:justify-center overflow-auto scrollbar-hide flex-row mt-16 gap-6 tb:flex-row ">
|
54
56
|
{heroData.linkCards.map((card, index) => (
|
55
57
|
<div key={index} className="w-full pb-2 min-w-[11.5rem] max-w-[22.313rem]">
|
56
58
|
<LinkCard
|
57
|
-
|
59
|
+
titleTextColor= {card.titleTextColor}
|
58
60
|
descTextColor={card.descTextColor}
|
59
61
|
linkUrl={card.linkUrl}
|
60
62
|
cardBgColor={card.cardBgColor}
|
@@ -90,38 +92,45 @@ export default function HeroCapability(props) {
|
|
90
92
|
else return;
|
91
93
|
// Perform any other actions based on the clicked tab
|
92
94
|
}
|
93
|
-
let
|
95
|
+
let heroBgColorClass = '';
|
94
96
|
let bgTabClass = '';
|
95
|
-
let
|
96
|
-
let
|
97
|
+
let videoUrl = '';
|
98
|
+
let videoPoster = '';
|
97
99
|
let img_url = '';
|
98
|
-
|
99
|
-
|
100
|
+
let pillColorClass= '';
|
101
|
+
if(props.heroData && props.heroData.tabContent && props.heroData.tabContent[activeTab] && props.heroData.tabContent[activeTab]['heroBgColor']){
|
102
|
+
heroBgColorClass = HDSColor(props.heroData.tabContent[activeTab]['heroBgColor'])
|
100
103
|
}
|
101
|
-
if(props.heroData && props.heroData.tabContent && props.heroData.tabContent[activeTab] && props.heroData.tabContent[activeTab]['
|
102
|
-
bgTabClass = HDSColor(props.heroData.tabContent[activeTab]['
|
104
|
+
if(props.heroData && props.heroData.tabContent && props.heroData.tabContent[activeTab] && props.heroData.tabContent[activeTab]['bgColorTab']){
|
105
|
+
bgTabClass = HDSColor(props.heroData.tabContent[activeTab]['bgColorTab'])
|
103
106
|
}
|
104
|
-
if(props.heroData && props.heroData.tabContent && props.heroData.tabContent[activeTab] && props.heroData.tabContent[activeTab]['
|
105
|
-
|
107
|
+
if(props.heroData && props.heroData.tabContent && props.heroData.tabContent[activeTab] && props.heroData.tabContent[activeTab]['videoUrl']){
|
108
|
+
videoUrl = props.heroData.tabContent[activeTab]['videoUrl']
|
106
109
|
}
|
107
|
-
if(props.heroData && props.heroData.tabContent && props.heroData.tabContent[activeTab] && props.heroData.tabContent[activeTab]['
|
108
|
-
|
110
|
+
if(props.heroData && props.heroData.tabContent && props.heroData.tabContent[activeTab] && props.heroData.tabContent[activeTab]['videoPoster']){
|
111
|
+
videoPoster = props.heroData.tabContent[activeTab]['videoPoster']
|
109
112
|
}
|
110
113
|
if(props.heroData && props.heroData.tabContent && props.heroData.tabContent[activeTab] && props.heroData.tabContent[activeTab]['img_url']){
|
111
114
|
img_url = props.heroData.tabContent[activeTab]['img_url']
|
112
115
|
}
|
116
|
+
if(props.heroData && props.heroData.tabContent && props.heroData.tabContent[activeTab] && props.heroData.tabContent[activeTab]['pillColor']){
|
117
|
+
pillColorClass = props.heroData.tabContent[activeTab]['pillColor']
|
118
|
+
}
|
113
119
|
|
114
120
|
return (
|
115
|
-
<div className={`${
|
121
|
+
<div className={`${(heroBgColorClass)} max-w-7xl rounded-3xl`} >
|
122
|
+
{/* <div className={`${(heroBgColorClass)} max-w-7xl rounded-3xl bg-gradient-to-br from-green-500 to-green-900`} > */}
|
116
123
|
{props.heroData.navTabs &&
|
117
124
|
|
118
125
|
<div className='py-5 db:p-20 tb:p-10 flex flex-col shadow rounded-2xl'>
|
119
126
|
|
120
127
|
<div className='flex px-8 tb:px-0 overflow-scroll scrollbar-hide tb-l:justify-center justify-start'>
|
121
|
-
<div className={`${bgTabClass}
|
128
|
+
<div className={`${bgTabClass} p-1 rounded-[32px]`}>
|
122
129
|
<Tab
|
123
130
|
onTabClick={handleTabClick}
|
124
131
|
tabs={props.heroData.navTabs}
|
132
|
+
bgColorTab={props.heroData.bgColorTab}
|
133
|
+
pillColor={pillColorClass}
|
125
134
|
/>
|
126
135
|
</div>
|
127
136
|
</div>
|
@@ -133,15 +142,16 @@ export default function HeroCapability(props) {
|
|
133
142
|
</div>
|
134
143
|
<div className=' db:max-w-[540px] tb:w-1/2 '>
|
135
144
|
<MediaBox
|
136
|
-
video_url = {
|
137
|
-
video_poster = {
|
138
|
-
|
145
|
+
video_url = {videoUrl}
|
146
|
+
video_poster = {videoPoster}
|
147
|
+
|
139
148
|
/>
|
140
149
|
</div>
|
141
150
|
</div>
|
142
151
|
|
143
152
|
<div>
|
144
|
-
{
|
153
|
+
{props.heroData.tabContent[activeTab] &&
|
154
|
+
LinkCardsFn(props.heroData.tabContent[activeTab])}
|
145
155
|
</div>
|
146
156
|
</div>
|
147
157
|
|
@@ -7,9 +7,9 @@ import { Tab } from '../Tabs'
|
|
7
7
|
import ReactMarkdown from "react-markdown";
|
8
8
|
|
9
9
|
const tabs = [
|
10
|
-
{ name: '
|
11
|
-
{ name: '
|
12
|
-
{ name: '
|
10
|
+
{ name: 'Tier 1', href: '', current: true },
|
11
|
+
{ name: 'Tier 2', href: '', current: false },
|
12
|
+
{ name: 'Tier 3', href: '', current: false },
|
13
13
|
]
|
14
14
|
|
15
15
|
|
@@ -66,9 +66,9 @@ export default function TableB(props) {
|
|
66
66
|
const [activeTab, setActiveTab] = useState(1);
|
67
67
|
|
68
68
|
function handleTabClick(tab) {
|
69
|
-
if (tab.name === '
|
70
|
-
if (tab.name === '
|
71
|
-
if (tab.name === '
|
69
|
+
if (tab.name === 'Tier 1') setActiveTab(1);
|
70
|
+
if (tab.name === 'Tier 2') setActiveTab(2);
|
71
|
+
if (tab.name === 'Tier 3') setActiveTab(3);
|
72
72
|
// Perform any other actions based on the clicked tab
|
73
73
|
}
|
74
74
|
|
@@ -179,7 +179,7 @@ export default function TableB(props) {
|
|
179
179
|
>
|
180
180
|
<div className=''>
|
181
181
|
<div className='flex flex-col justify-center items-center text-center'>
|
182
|
-
<div className={'flex items-center gap-2'}>
|
182
|
+
<div className={'flex items-center gap-2 w-full justify-center'}>
|
183
183
|
{TABLE_HEADER[key]['icon'] &&
|
184
184
|
(
|
185
185
|
<Icon
|
@@ -192,7 +192,7 @@ export default function TableB(props) {
|
|
192
192
|
TABLE_HEADER[key]['title'] && key == 0 && (
|
193
193
|
<Typography
|
194
194
|
textStyle='h5'
|
195
|
-
className={HDSColor(TABLE_HEADER[key]['title_text_color'])}>
|
195
|
+
className={`w-full text-left ${HDSColor(TABLE_HEADER[key]['title_text_color'])}`}>
|
196
196
|
{TABLE_HEADER[key]['title']}
|
197
197
|
</Typography>)
|
198
198
|
}
|
@@ -54,7 +54,7 @@ const levelCalc = (arr, index) => {
|
|
54
54
|
|
55
55
|
}
|
56
56
|
|
57
|
-
export default function
|
57
|
+
export default function TablePlatform(props) {
|
58
58
|
const {
|
59
59
|
title,
|
60
60
|
title_color,
|
@@ -375,7 +375,7 @@ export default function TableB(props) {
|
|
375
375
|
)
|
376
376
|
}
|
377
377
|
|
378
|
-
|
378
|
+
TablePlatform.defaultProps = {
|
379
379
|
title_color: 'text-blue-800',
|
380
380
|
desc_color: 'text-blue-600'
|
381
381
|
}
|
@@ -1,11 +1,22 @@
|
|
1
1
|
import React, { useState, useRef } from 'react';
|
2
|
+
import { HDSColor } from '../../foundation/ColorPalette';
|
2
3
|
import { Typography } from '../../foundation/Typography'
|
4
|
+
import PropTypes from 'prop-types';
|
3
5
|
|
4
6
|
export default function Tab(props) {
|
5
|
-
const {
|
7
|
+
const {
|
8
|
+
tabs,
|
9
|
+
onTabClick,
|
10
|
+
pillColor
|
11
|
+
|
12
|
+
} = props;
|
6
13
|
const [activeTab, setActiveTab] = useState(tabs.find(tab => tab.current) || tabs[0]);
|
7
14
|
const pillRef = useRef(null);
|
8
|
-
|
15
|
+
let pillColorClass = '';
|
16
|
+
if(pillColor){
|
17
|
+
pillColorClass = HDSColor(pillColor);
|
18
|
+
}
|
19
|
+
|
9
20
|
const handleTabClick = (event, clickedTab) => {
|
10
21
|
event.preventDefault();
|
11
22
|
setActiveTab(clickedTab);
|
@@ -19,35 +30,41 @@ export default function Tab(props) {
|
|
19
30
|
const pillWidth = event.currentTarget.offsetWidth;
|
20
31
|
const clickedTabOffset = event.currentTarget.offsetLeft;
|
21
32
|
const pillOffset = pill.parentElement.offsetLeft;
|
22
|
-
const translateX = clickedTabOffset
|
33
|
+
const translateX = clickedTabOffset;
|
23
34
|
|
24
35
|
pill.style.transform = `translateX(${translateX}px)`;
|
25
36
|
pill.style.width = `${pillWidth}px`;
|
26
37
|
}
|
27
38
|
};
|
28
39
|
|
40
|
+
function tabClass(name) {
|
41
|
+
let classActive = ' text-neutral-0 transition-all rounded-full ' + pillColorClass;
|
42
|
+
let clasnInActive = ' text-neutral-500 flex-nowrap rounded-full';
|
43
|
+
|
44
|
+
console.log(classActive, clasnInActive, 'heeelo');
|
45
|
+
|
46
|
+
if (activeTab.name === name) {
|
47
|
+
return classActive;
|
48
|
+
}
|
49
|
+
else {
|
50
|
+
return clasnInActive;
|
51
|
+
}
|
52
|
+
}
|
29
53
|
return (
|
30
54
|
<div className=''>
|
31
55
|
<div className="block">
|
32
56
|
<nav className="relative inline-flex gap-2 rounded-full" aria-label="Tabs">
|
33
57
|
{tabs.map(tab => (
|
34
|
-
<
|
58
|
+
<div
|
35
59
|
key={tab.name}
|
36
|
-
href="#"
|
37
|
-
className={`px-3 py-1 font-medium text-sm rounded-full ${
|
38
|
-
activeTab === tab
|
39
|
-
? ' first:bg-blue-500 text-neutral-0 transition-all'
|
40
|
-
: 'text-neutral-500 transition-all flex-nowrap '
|
41
|
-
}`}
|
42
|
-
aria-current={activeTab === tab ? 'page' : undefined}
|
43
60
|
onClick={(event) => handleTabClick(event, tab)}
|
44
61
|
>
|
45
|
-
<Typography className=
|
46
|
-
</
|
62
|
+
<Typography className={`${tabClass(tab.name)} cursor-pointer px-3 py-1 z-[2] relative whitespace-nowrap`} textStyle='body3c-medium'>{tab.name}</Typography>
|
63
|
+
</div>
|
47
64
|
))}
|
48
65
|
<span
|
49
66
|
ref={pillRef}
|
50
|
-
className=
|
67
|
+
className={`absolute left-0 z-[1] ${pillColorClass} rounded-full transition-all ease-in duration-150`}
|
51
68
|
style={{
|
52
69
|
left: `${activeTab.index * 100}%`,
|
53
70
|
width: `${activeTab.width}px`, // Use the width of the clicked tab
|
@@ -59,3 +76,7 @@ export default function Tab(props) {
|
|
59
76
|
</div>
|
60
77
|
);
|
61
78
|
}
|
79
|
+
|
80
|
+
Tab.defaultProps = {
|
81
|
+
pillColor: 'bg-blue-500'
|
82
|
+
}
|
package/src/styles/tailwind.css
CHANGED
@@ -1868,10 +1868,6 @@ select {
|
|
1868
1868
|
gap: 3rem;
|
1869
1869
|
}
|
1870
1870
|
|
1871
|
-
.gap-16 {
|
1872
|
-
gap: 4rem;
|
1873
|
-
}
|
1874
|
-
|
1875
1871
|
.gap-2 {
|
1876
1872
|
gap: 0.5rem;
|
1877
1873
|
}
|
@@ -2003,6 +1999,12 @@ select {
|
|
2003
1999
|
margin-bottom: calc(1.25rem * var(--tw-space-y-reverse));
|
2004
2000
|
}
|
2005
2001
|
|
2002
|
+
.space-x-2 > :not([hidden]) ~ :not([hidden]) {
|
2003
|
+
--tw-space-x-reverse: 0;
|
2004
|
+
margin-right: calc(0.5rem * var(--tw-space-x-reverse));
|
2005
|
+
margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
|
2006
|
+
}
|
2007
|
+
|
2006
2008
|
.divide-x > :not([hidden]) ~ :not([hidden]) {
|
2007
2009
|
--tw-divide-x-reverse: 0;
|
2008
2010
|
border-right-width: calc(1px * var(--tw-divide-x-reverse));
|
@@ -2816,6 +2818,10 @@ select {
|
|
2816
2818
|
background-image: linear-gradient(to bottom, var(--tw-gradient-stops));
|
2817
2819
|
}
|
2818
2820
|
|
2821
|
+
.bg-gradient-to-br {
|
2822
|
+
background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
|
2823
|
+
}
|
2824
|
+
|
2819
2825
|
.from-amber-100 {
|
2820
2826
|
--tw-gradient-from: #FFF3D4 var(--tw-gradient-from-position);
|
2821
2827
|
--tw-gradient-from-position: ;
|
@@ -5460,14 +5466,6 @@ select {
|
|
5460
5466
|
padding-top: 1.5rem;
|
5461
5467
|
}
|
5462
5468
|
|
5463
|
-
.pt-8 {
|
5464
|
-
padding-top: 2rem;
|
5465
|
-
}
|
5466
|
-
|
5467
|
-
.pb-3 {
|
5468
|
-
padding-bottom: 0.75rem;
|
5469
|
-
}
|
5470
|
-
|
5471
5469
|
.text-left {
|
5472
5470
|
text-align: left;
|
5473
5471
|
}
|
@@ -6469,6 +6467,10 @@ select {
|
|
6469
6467
|
transition-duration: 500ms;
|
6470
6468
|
}
|
6471
6469
|
|
6470
|
+
.duration-1000 {
|
6471
|
+
transition-duration: 1000ms;
|
6472
|
+
}
|
6473
|
+
|
6472
6474
|
.ease-in {
|
6473
6475
|
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
6474
6476
|
}
|
@@ -7425,11 +7427,6 @@ select {
|
|
7425
7427
|
border-bottom-left-radius: 9999px;
|
7426
7428
|
}
|
7427
7429
|
|
7428
|
-
.first\:bg-blue-500:first-child {
|
7429
|
-
--tw-bg-opacity: 1;
|
7430
|
-
background-color: rgb(57 112 253 / var(--tw-bg-opacity));
|
7431
|
-
}
|
7432
|
-
|
7433
7430
|
.last\:mr-0:last-child {
|
7434
7431
|
margin-right: 0px;
|
7435
7432
|
}
|
@@ -8289,10 +8286,6 @@ select {
|
|
8289
8286
|
border-right-width: 1px;
|
8290
8287
|
}
|
8291
8288
|
|
8292
|
-
.tb\:border-t {
|
8293
|
-
border-top-width: 1px;
|
8294
|
-
}
|
8295
|
-
|
8296
8289
|
.tb\:border-r-neutral-150 {
|
8297
8290
|
--tw-border-opacity: 1;
|
8298
8291
|
border-right-color: rgb(236 237 240 / var(--tw-border-opacity));
|
@@ -8330,6 +8323,10 @@ select {
|
|
8330
8323
|
padding-right: 2rem;
|
8331
8324
|
}
|
8332
8325
|
|
8326
|
+
.tb\:pb-0 {
|
8327
|
+
padding-bottom: 0px;
|
8328
|
+
}
|
8329
|
+
|
8333
8330
|
.tb\:pb-8 {
|
8334
8331
|
padding-bottom: 2rem;
|
8335
8332
|
}
|
@@ -8338,6 +8335,10 @@ select {
|
|
8338
8335
|
padding-right: 0px;
|
8339
8336
|
}
|
8340
8337
|
|
8338
|
+
.tb\:pt-0 {
|
8339
|
+
padding-top: 0px;
|
8340
|
+
}
|
8341
|
+
|
8341
8342
|
.tb\:pt-10 {
|
8342
8343
|
padding-top: 2.5rem;
|
8343
8344
|
}
|
@@ -8354,22 +8355,6 @@ select {
|
|
8354
8355
|
padding-top: 2.875rem;
|
8355
8356
|
}
|
8356
8357
|
|
8357
|
-
.tb\:pt-6 {
|
8358
|
-
padding-top: 1.5rem;
|
8359
|
-
}
|
8360
|
-
|
8361
|
-
.tb\:pb-6 {
|
8362
|
-
padding-bottom: 1.5rem;
|
8363
|
-
}
|
8364
|
-
|
8365
|
-
.tb\:pb-0 {
|
8366
|
-
padding-bottom: 0px;
|
8367
|
-
}
|
8368
|
-
|
8369
|
-
.tb\:pt-0 {
|
8370
|
-
padding-top: 0px;
|
8371
|
-
}
|
8372
|
-
|
8373
8358
|
.tb\:text-left {
|
8374
8359
|
text-align: left;
|
8375
8360
|
}
|
@@ -9085,6 +9070,10 @@ select {
|
|
9085
9070
|
padding-bottom: 5rem;
|
9086
9071
|
}
|
9087
9072
|
|
9073
|
+
.db\:pb-0 {
|
9074
|
+
padding-bottom: 0px;
|
9075
|
+
}
|
9076
|
+
|
9088
9077
|
.db\:pb-10 {
|
9089
9078
|
padding-bottom: 2.5rem;
|
9090
9079
|
}
|
@@ -9113,10 +9102,6 @@ select {
|
|
9113
9102
|
padding-top: 8rem;
|
9114
9103
|
}
|
9115
9104
|
|
9116
|
-
.db\:pb-0 {
|
9117
|
-
padding-bottom: 0px;
|
9118
|
-
}
|
9119
|
-
|
9120
9105
|
.db\:text-left {
|
9121
9106
|
text-align: left;
|
9122
9107
|
}
|