hds-web 1.24.1 → 1.24.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/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/Tabs/tab.js +10 -8
- package/src/HDS/modules/navCard/navCard.js +14 -5
- package/src/styles/tailwind.css +4 -0
    
        package/package.json
    CHANGED
    
    
| @@ -10,20 +10,20 @@ export default function Tab(props) { | |
| 10 10 | 
             
                onTabClick,
         | 
| 11 11 | 
             
                pillColor,
         | 
| 12 12 | 
             
              } = props;
         | 
| 13 | 
            -
              const [activeTab, setActiveTab] = useState(tabs.find(tab => tab.current) | 
| 13 | 
            +
              const [activeTab, setActiveTab] = useState(tabs.find(tab => tab.current) || tabs[0].name);
         | 
| 14 14 | 
             
              let pillColorClass = '';
         | 
| 15 | 
            -
              if(pillColor){
         | 
| 16 | 
            -
             | 
| 15 | 
            +
              if (pillColor) {
         | 
| 16 | 
            +
                pillColorClass = HDSColor(pillColor);
         | 
| 17 17 | 
             
              }
         | 
| 18 | 
            -
             | 
| 18 | 
            +
             | 
| 19 19 | 
             
              const handleTabClick = (clickedTab) => {
         | 
| 20 20 | 
             
                setActiveTab(clickedTab.name);
         | 
| 21 21 | 
             
                if (onTabClick) {
         | 
| 22 22 | 
             
                  onTabClick(clickedTab);
         | 
| 23 23 | 
             
                }
         | 
| 24 | 
            -
             | 
| 24 | 
            +
             | 
| 25 25 | 
             
              };
         | 
| 26 | 
            -
              let tabTextClass = ''; | 
| 26 | 
            +
              let tabTextClass = '';
         | 
| 27 27 |  | 
| 28 28 | 
             
              return (
         | 
| 29 29 | 
             
                <div className="">
         | 
| @@ -35,17 +35,18 @@ export default function Tab(props) { | |
| 35 35 | 
             
                          onClick={() => {
         | 
| 36 36 | 
             
                            handleTabClick(tab);
         | 
| 37 37 | 
             
                          }}
         | 
| 38 | 
            -
                          className={`${activeTab === tab.name ? ' text-neutral-0' : ' | 
| 38 | 
            +
                          className={`${activeTab === tab.name ? ' text-neutral-0 transition-all duration-300' : ' hover:bg-neutral-500/30 text-neutral-400'} relative  px-3 py-1 whitespace-nowrap rounded-full hover:text-neutral-0`}
         | 
| 39 39 | 
             
                        >
         | 
| 40 40 | 
             
                          {activeTab === tab.name && (
         | 
| 41 41 | 
             
                            <motion.div
         | 
| 42 42 | 
             
                              layoutId="active-pill"
         | 
| 43 43 | 
             
                              className={`absolute inset-0 ${pillColorClass}`}
         | 
| 44 44 | 
             
                              style={{ borderRadius: 32 }}
         | 
| 45 | 
            +
                            //  transition={{ duration:1 }}
         | 
| 45 46 |  | 
| 46 47 | 
             
                            />
         | 
| 47 48 | 
             
                          )}
         | 
| 48 | 
            -
                          <Typography textStyle="body3c-medium" className= | 
| 49 | 
            +
                          <Typography textStyle="body3c-medium" className={`relative z-10 `}>
         | 
| 49 50 | 
             
                            {tab.name}
         | 
| 50 51 | 
             
                          </Typography>
         | 
| 51 52 | 
             
                        </button>
         | 
| @@ -56,6 +57,7 @@ export default function Tab(props) { | |
| 56 57 | 
             
              );
         | 
| 57 58 | 
             
            }
         | 
| 58 59 |  | 
| 60 | 
            +
             | 
| 59 61 | 
             
            Tab.defaultProps = {
         | 
| 60 62 | 
             
              pillColor: 'bg-blue-500',
         | 
| 61 63 | 
             
            }
         | 
| @@ -6,18 +6,19 @@ import { HDSColor } from '../../foundation/ColorPalette'; | |
| 6 6 | 
             
            import { Tab } from '../../components/Tabs';
         | 
| 7 7 | 
             
            import { Icon } from '../../components/common-components/Icon'
         | 
| 8 8 | 
             
            import PropTypes from 'prop-types';
         | 
| 9 | 
            +
            import { motion } from 'framer-motion';
         | 
| 9 10 |  | 
| 10 11 |  | 
| 11 12 | 
             
            export default function NavCard(props) {
         | 
| 12 13 | 
             
                const [showVideo, setShowVideo] = useState(false);
         | 
| 13 14 | 
             
                const TabCard = (tabContent) => {
         | 
| 14 | 
            -
             | 
| 15 | 
            +
             | 
| 15 16 | 
             
                    return (
         | 
| 16 17 | 
             
                        <>
         | 
| 17 18 | 
             
                            <div className=''>
         | 
| 18 19 | 
             
                                {tabContent.title && <Typography textStyle='body1c-semi-bold' className={HDSColor(tabContent.title_color)}>{tabContent.title}</Typography>}
         | 
| 19 20 |  | 
| 20 | 
            -
                                {tabContent.subTitle && <Typography textStyle='body3' className={ | 
| 21 | 
            +
                                {tabContent.subTitle && <Typography textStyle='body3' className={'mt-2 ' + HDSColor(tabContent.sub_title_color)}>{tabContent.subTitle}</Typography>}
         | 
| 21 22 | 
             
                                {tabContent.readMore_cta && <div className="flex">
         | 
| 22 23 | 
             
                                    <a href={tabContent.readMore_cta_link ?? ''} >
         | 
| 23 24 | 
             
                                        <HDSButton
         | 
| @@ -74,7 +75,7 @@ export default function NavCard(props) { | |
| 74 75 | 
             
                                        <div className="relative">
         | 
| 75 76 | 
             
                                            {
         | 
| 76 77 | 
             
                                                tabContent.img_url && (
         | 
| 77 | 
            -
                                                    <img src={tabContent.img_url} alt="Illustration" className=' rounded-2xl'/>
         | 
| 78 | 
            +
                                                    <img src={tabContent.img_url} alt="Illustration" className=' rounded-2xl' />
         | 
| 78 79 | 
             
                                                )
         | 
| 79 80 | 
             
                                            }
         | 
| 80 81 | 
             
                                            {
         | 
| @@ -126,13 +127,21 @@ export default function NavCard(props) { | |
| 126 127 | 
             
                                        bgColorTab={props.bgColorTab}
         | 
| 127 128 | 
             
                                    />
         | 
| 128 129 | 
             
                                </div>
         | 
| 129 | 
            -
                                <div | 
| 130 | 
            +
                                <motion.div
         | 
| 131 | 
            +
                                    key={activeTab}
         | 
| 132 | 
            +
                                    initial={{ opacity: 0.8 }} // Initial opacity when the component is rendered
         | 
| 133 | 
            +
                                    animate={{ opacity: 1 }} // Opacity when the tab switches
         | 
| 134 | 
            +
                                    exit={{ opacity: 0.8 }} // Opacity when exiting the component
         | 
| 135 | 
            +
                                    transition={{ duration: 1, ease: 'easeIn' }} // Tr
         | 
| 136 | 
            +
             | 
| 137 | 
            +
                                    className=''>
         | 
| 130 138 | 
             
                                    {props.tabContent &&
         | 
| 131 139 | 
             
                                        props.tabContent[activeTab] &&
         | 
| 132 140 | 
             
                                        TabCard(props.tabContent[activeTab])}
         | 
| 133 | 
            -
                                </div>
         | 
| 141 | 
            +
                                </motion.div>
         | 
| 134 142 |  | 
| 135 143 | 
             
                            </div>}
         | 
| 136 144 | 
             
                    </div>
         | 
| 137 145 | 
             
                )
         | 
| 138 146 | 
             
            }
         | 
| 147 | 
            +
             | 
    
        package/src/styles/tailwind.css
    CHANGED