@npm_leadtech/legal-lib-components 5.14.9 → 5.14.11

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.
@@ -3,11 +3,10 @@ import { Button } from '../../atoms';
3
3
  import { LayoutRatafiaSectionStyled } from './LayoutRatafiaSection.styled';
4
4
  import { TagsRatafiaList } from '../../molecules';
5
5
  import { useIsMobileOrTable } from '../../../hooks';
6
- const LayoutRatafiaSection = ({ title, children, tags, ctaLabel, ctaLink, ctaDataQa, media }) => {
6
+ const LayoutRatafiaSection = ({ title, children, tags = [], ctaLabel, ctaLink = '#', handleOnClick, ctaDataQa = 'ai-section-cta', image }) => {
7
7
  const { isMobile } = useIsMobileOrTable();
8
8
  if (children == undefined)
9
9
  return null;
10
- const existMediaNode = media !== undefined;
11
- return (_jsx(LayoutRatafiaSectionStyled, { className: 'layout-ratafia-section', children: _jsxs("div", { className: 'layout-ratafia-section__wrapper background-ratafia-animation', children: [_jsxs("div", { className: 'layout-ratafia-section__wrapper__info', children: [_jsxs("div", { className: 'layout-ratafia-section__wrapper__info__paragraph', children: [title && (_jsx("h2", { className: 'layout-ratafia-section__wrapper__info__paragraph__title sans-serif --super-large --bold-weight', children: title })), _jsx("div", { className: 'layout-ratafia-section__wrapper__info__paragraph__content sans-serif --super-medium', children: children })] }), tags?.length && (_jsx("div", { className: 'layout-ratafia-section__wrapper__info__tags', children: _jsx(TagsRatafiaList, { tags: tags }) })), ctaLabel && (_jsx("div", { className: 'layout-ratafia-section__wrapper__info__button', children: _jsx(Button, { givenClass: 'mid-banner-ratafia-content__cta', dataQa: ctaDataQa ?? 'layout-ratafia-cta', link: ctaLink ?? '#', color: 'primary', label: ctaLabel, fluid: isMobile }) }))] }), existMediaNode && _jsx("div", { className: 'layout-ratafia-section__wrapper__media', children: media })] }) }));
10
+ return (_jsx(LayoutRatafiaSectionStyled, { className: 'layout-ratafia-section', children: _jsxs("div", { className: 'layout-ratafia-section__wrapper background-ratafia-animation', children: [_jsxs("div", { className: 'layout-ratafia-section__wrapper__info', children: [_jsxs("div", { className: 'layout-ratafia-section__wrapper__info__paragraph', children: [title && (_jsx("h2", { className: 'layout-ratafia-section__wrapper__info__paragraph__title sans-serif --super-large --bold-weight', children: title })), _jsx("div", { className: 'layout-ratafia-section__wrapper__info__paragraph__content sans-serif --super-medium', children: children })] }), tags?.length > 0 && (_jsx("div", { className: 'layout-ratafia-section__wrapper__info__tags', children: _jsx(TagsRatafiaList, { tags: tags }) })), ctaLabel && (_jsx("div", { className: 'layout-ratafia-section__wrapper__info__button', children: _jsx(Button, { givenClass: 'mid-banner-ratafia-content__cta', dataQa: ctaDataQa, link: ctaLink, onClick: handleOnClick, color: 'primary', label: ctaLabel, fluid: isMobile }) }))] }), image !== null && _jsx("div", { className: 'layout-ratafia-section__wrapper__image', children: image })] }) }));
12
11
  };
13
12
  export default LayoutRatafiaSection;
@@ -66,7 +66,7 @@ export const LayoutRatafiaSectionStyled = styled.section `
66
66
  }
67
67
  }
68
68
 
69
- &__media {
69
+ &__image {
70
70
  display: flex;
71
71
  flex: 300px 0 0;
72
72
  }
@@ -67,7 +67,7 @@ export const LayoutRatafiaSectionStyled = styled.section`
67
67
  }
68
68
  }
69
69
 
70
- &__media {
70
+ &__image {
71
71
  display: flex;
72
72
  flex: 300px 0 0;
73
73
  }
@@ -9,16 +9,16 @@ import { useIsMobileOrTable } from '../../../hooks'
9
9
  const LayoutRatafiaSection: FC<LayoutRatafiaSectionProps> = ({
10
10
  title,
11
11
  children,
12
- tags,
12
+ tags = [],
13
13
  ctaLabel,
14
- ctaLink,
15
- ctaDataQa,
16
- media
14
+ ctaLink = '#',
15
+ handleOnClick,
16
+ ctaDataQa = 'ai-section-cta',
17
+ image
17
18
  }) => {
18
19
  const { isMobile } = useIsMobileOrTable()
19
20
  if (children == undefined) return null
20
21
 
21
- const existMediaNode = media !== undefined
22
22
  return (
23
23
  <LayoutRatafiaSectionStyled className='layout-ratafia-section'>
24
24
  <div className='layout-ratafia-section__wrapper background-ratafia-animation'>
@@ -33,7 +33,7 @@ const LayoutRatafiaSection: FC<LayoutRatafiaSectionProps> = ({
33
33
  {children}
34
34
  </div>
35
35
  </div>
36
- {tags?.length && (
36
+ {tags?.length > 0 && (
37
37
  <div className='layout-ratafia-section__wrapper__info__tags'>
38
38
  <TagsRatafiaList tags={tags} />
39
39
  </div>
@@ -42,8 +42,9 @@ const LayoutRatafiaSection: FC<LayoutRatafiaSectionProps> = ({
42
42
  <div className='layout-ratafia-section__wrapper__info__button'>
43
43
  <Button
44
44
  givenClass='mid-banner-ratafia-content__cta'
45
- dataQa={ctaDataQa ?? 'layout-ratafia-cta'}
46
- link={ctaLink ?? '#'}
45
+ dataQa={ctaDataQa}
46
+ link={ctaLink}
47
+ onClick={handleOnClick}
47
48
  color='primary'
48
49
  label={ctaLabel}
49
50
  fluid={isMobile}
@@ -51,7 +52,7 @@ const LayoutRatafiaSection: FC<LayoutRatafiaSectionProps> = ({
51
52
  </div>
52
53
  )}
53
54
  </div>
54
- {existMediaNode && <div className='layout-ratafia-section__wrapper__media'>{media}</div>}
55
+ {image !== null && <div className='layout-ratafia-section__wrapper__image'>{image}</div>}
55
56
  </div>
56
57
  </LayoutRatafiaSectionStyled>
57
58
  )
@@ -1,3 +1,4 @@
1
+ import { MouseEventHandler } from 'react';
1
2
  import { TagRatafiaItemProps } from 'src/components/atoms';
2
3
  export interface LayoutRatafiaSectionProps {
3
4
  title?: string;
@@ -5,6 +6,7 @@ export interface LayoutRatafiaSectionProps {
5
6
  tags?: TagRatafiaItemProps[];
6
7
  ctaLabel?: string;
7
8
  ctaLink?: string;
9
+ handleOnClick?: MouseEventHandler;
8
10
  ctaDataQa?: string;
9
- media?: React.ReactNode;
11
+ image?: React.ReactNode;
10
12
  }
@@ -1,3 +1,4 @@
1
+ import { MouseEventHandler } from 'react'
1
2
  import { TagRatafiaItemProps } from 'src/components/atoms'
2
3
 
3
4
  export interface LayoutRatafiaSectionProps {
@@ -6,6 +7,7 @@ export interface LayoutRatafiaSectionProps {
6
7
  tags?: TagRatafiaItemProps[]
7
8
  ctaLabel?: string
8
9
  ctaLink?: string
10
+ handleOnClick?: MouseEventHandler
9
11
  ctaDataQa?: string
10
- media?: React.ReactNode
12
+ image?: React.ReactNode
11
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "5.14.9",
3
+ "version": "5.14.11",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -91,7 +91,7 @@
91
91
  "node-fetch": "^3.3.2",
92
92
  "prettier": "^3.3.3",
93
93
  "react": "18.3.1",
94
- "react-datepicker": "^7.4.0",
94
+ "react-datepicker": "^7.5.0",
95
95
  "react-dom": "18.3.1",
96
96
  "react-test-renderer": "18.3.1",
97
97
  "rimraf": "^6.0.1",