@npm_leadtech/legal-lib-components 5.10.0 → 5.11.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.
Files changed (22) hide show
  1. package/dist/images/svg/arrow-right-24px-outlined.svg +3 -0
  2. package/dist/src/components/molecules/Article/Article.js +3 -2
  3. package/dist/src/components/molecules/Article/Article.styled.js +31 -0
  4. package/dist/src/components/molecules/Article/Article.styled.ts +31 -0
  5. package/dist/src/components/molecules/Article/Article.tsx +24 -4
  6. package/dist/src/components/molecules/Article/ArticleProps.types.d.ts +1 -0
  7. package/dist/src/components/molecules/Article/ArticleProps.types.ts +1 -0
  8. package/dist/src/components/molecules/FaqItem/FaqItem.js +5 -4
  9. package/dist/src/components/molecules/FaqItem/FaqItem.tsx +7 -6
  10. package/dist/src/components/organisms/ArticlesList/ArticlesList.js +2 -2
  11. package/dist/src/components/organisms/ArticlesList/ArticlesList.tsx +2 -2
  12. package/dist/src/components/organisms/ArticlesList/ArticlesListProps.types.d.ts +1 -0
  13. package/dist/src/components/organisms/ArticlesList/ArticlesListProps.types.ts +1 -0
  14. package/dist/src/components/sections/BlogSection/BlogSection.js +5 -4
  15. package/dist/src/components/sections/BlogSection/BlogSection.scss +54 -0
  16. package/dist/src/components/sections/BlogSection/BlogSection.styled.js +21 -0
  17. package/dist/src/components/sections/BlogSection/BlogSection.styled.ts +21 -0
  18. package/dist/src/components/sections/BlogSection/BlogSection.tsx +10 -6
  19. package/dist/src/components/sections/BlogSection/BlogSectionProps.types.d.ts +2 -1
  20. package/dist/src/components/sections/BlogSection/BlogSectionProps.types.ts +2 -1
  21. package/dist/src/custom.d.ts +1 -1
  22. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M8.70531 0.705315C8.31578 0.31578 7.68422 0.31578 7.29468 0.705316C6.9054 1.0946 6.90511 1.72568 7.29405 2.11531L12.17 7H0.999999C0.447714 7 0 7.44772 0 8C0 8.55229 0.447715 9 1 9H12.17L7.29405 13.8847C6.90511 14.2743 6.9054 14.9054 7.29468 15.2947C7.68422 15.6842 8.31578 15.6842 8.70532 15.2947L15.2929 8.70711C15.6834 8.31658 15.6834 7.68342 15.2929 7.29289L8.70531 0.705315Z" fill="#078080"/>
3
+ </svg>
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import ArrowRight from '../../../../images/svg/arrow-right-24px-outlined.svg';
2
3
  import { ArticleStyled } from './Article.styled';
3
4
  import { Button } from '../../atoms';
4
- const Article = ({ imageUrl, title, articleUrl, summary }) => {
5
- return (_jsxs(ArticleStyled, { className: 'article', children: [_jsx("img", { src: imageUrl, className: 'image', loading: 'lazy', alt: title }), _jsxs("div", { className: 'information', children: [_jsx("a", { href: articleUrl, target: '_blank', rel: 'noreferrer', children: _jsxs("p", { className: 'title sans-serif --big', children: [title, " "] }) }), _jsx("div", { className: 'summary', children: summary }), _jsx(Button, { color: 'tertiary', label: 'Read more', dataQa: 'article-read-more', link: articleUrl, isExternal: true })] })] }));
5
+ const Article = ({ imageUrl, title, articleUrl, summary, isCategoryProductPage }) => {
6
+ return (_jsxs(ArticleStyled, { className: 'article', children: [_jsx("img", { src: imageUrl, className: isCategoryProductPage ? 'image image-category' : 'image', loading: 'lazy', alt: title }), _jsxs("div", { className: isCategoryProductPage ? 'information information-category' : 'information', children: [_jsx("a", { href: articleUrl, target: '_blank', rel: 'noreferrer', children: _jsxs("p", { className: 'title sans-serif --big', children: [title, " "] }) }), _jsx("div", { className: 'summary', children: summary }), isCategoryProductPage ? (_jsxs("div", { className: 'button-image-container', children: [_jsx(Button, { givenClass: 'thinner-letter', color: 'tertiary', label: 'Read more', dataQa: 'article-read-more', link: articleUrl, isExternal: true }), _jsx("img", { className: 'article__arrow-right', src: ArrowRight, alt: '' })] })) : (_jsx(Button, { color: 'tertiary', label: 'Read more', dataQa: 'article-read-more', link: articleUrl, isExternal: true }))] })] }));
6
7
  };
7
8
  export default Article;
@@ -25,6 +25,13 @@ export const ArticleStyled = styled.div `
25
25
  }
26
26
  }
27
27
 
28
+ .image-category {
29
+ @media ${device['landscape-tablets']} {
30
+ width: 100%;
31
+ height: 13em;
32
+ }
33
+ }
34
+
28
35
  .information {
29
36
  width: 100%;
30
37
  padding: 1rem 1.5rem 0;
@@ -61,5 +68,29 @@ export const ArticleStyled = styled.div `
61
68
  margin-top: 0;
62
69
  }
63
70
  }
71
+
72
+ .button-image-container {
73
+ align-items: center;
74
+ margin: 1rem 0 2rem 0;
75
+ display: flex;
76
+
77
+ .thinner-letter {
78
+ font-family: $font-sans;
79
+ font-size: 16px;
80
+ font-weight: 400;
81
+ line-height: 22px;
82
+ letter-spacing: -0.3px;
83
+ text-align: left;
84
+ margin: 0;
85
+ padding: 0 1rem 0 0;
86
+ }
87
+ }
88
+ }
89
+
90
+ .information-category {
91
+ @media ${device['landscape-tablets']} {
92
+ width: 100%;
93
+ height: auto;
94
+ }
64
95
  }
65
96
  `;
@@ -26,6 +26,13 @@ export const ArticleStyled = styled.div`
26
26
  }
27
27
  }
28
28
 
29
+ .image-category {
30
+ @media ${device['landscape-tablets']} {
31
+ width: 100%;
32
+ height: 13em;
33
+ }
34
+ }
35
+
29
36
  .information {
30
37
  width: 100%;
31
38
  padding: 1rem 1.5rem 0;
@@ -62,5 +69,29 @@ export const ArticleStyled = styled.div`
62
69
  margin-top: 0;
63
70
  }
64
71
  }
72
+
73
+ .button-image-container {
74
+ align-items: center;
75
+ margin: 1rem 0 2rem 0;
76
+ display: flex;
77
+
78
+ .thinner-letter {
79
+ font-family: $font-sans;
80
+ font-size: 16px;
81
+ font-weight: 400;
82
+ line-height: 22px;
83
+ letter-spacing: -0.3px;
84
+ text-align: left;
85
+ margin: 0;
86
+ padding: 0 1rem 0 0;
87
+ }
88
+ }
89
+ }
90
+
91
+ .information-category {
92
+ @media ${device['landscape-tablets']} {
93
+ width: 100%;
94
+ height: auto;
95
+ }
65
96
  }
66
97
  `
@@ -1,19 +1,39 @@
1
1
  import React, { type FC } from 'react'
2
2
 
3
+ import ArrowRight from '../../../../images/svg/arrow-right-24px-outlined.svg'
3
4
  import { type ArticleProps } from './ArticleProps.types'
4
5
  import { ArticleStyled } from './Article.styled'
5
6
  import { Button } from '../../atoms'
6
7
 
7
- const Article: FC<ArticleProps> = ({ imageUrl, title, articleUrl, summary }) => {
8
+ const Article: FC<ArticleProps> = ({ imageUrl, title, articleUrl, summary, isCategoryProductPage }) => {
8
9
  return (
9
10
  <ArticleStyled className='article'>
10
- <img src={imageUrl} className='image' loading='lazy' alt={title} />
11
- <div className='information'>
11
+ <img
12
+ src={imageUrl}
13
+ className={isCategoryProductPage ? 'image image-category' : 'image'}
14
+ loading='lazy'
15
+ alt={title}
16
+ />
17
+ <div className={isCategoryProductPage ? 'information information-category' : 'information'}>
12
18
  <a href={articleUrl} target='_blank' rel='noreferrer'>
13
19
  <p className='title sans-serif --big'>{title} </p>
14
20
  </a>
15
21
  <div className='summary'>{summary}</div>
16
- <Button color='tertiary' label={'Read more'} dataQa='article-read-more' link={articleUrl} isExternal />
22
+ {isCategoryProductPage ? (
23
+ <div className='button-image-container'>
24
+ <Button
25
+ givenClass='thinner-letter'
26
+ color='tertiary'
27
+ label={'Read more'}
28
+ dataQa='article-read-more'
29
+ link={articleUrl}
30
+ isExternal
31
+ />
32
+ <img className='article__arrow-right' src={ArrowRight} alt=''></img>
33
+ </div>
34
+ ) : (
35
+ <Button color='tertiary' label={'Read more'} dataQa='article-read-more' link={articleUrl} isExternal />
36
+ )}
17
37
  </div>
18
38
  </ArticleStyled>
19
39
  )
@@ -4,4 +4,5 @@ export interface ArticleProps {
4
4
  articleUrl: string;
5
5
  summary: string;
6
6
  id: string;
7
+ isCategoryProductPage: boolean;
7
8
  }
@@ -4,4 +4,5 @@ export interface ArticleProps {
4
4
  articleUrl: string
5
5
  summary: string
6
6
  id: string
7
+ isCategoryProductPage: boolean
7
8
  }
@@ -2,11 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import { ChevronRight24px } from '../../../../images/componentsSvg/ChevronRight24px';
4
4
  import { FaqItemStyled } from './FaqItem.styled';
5
- export const FaqItem = ({ slug, title, children, index }) => {
6
- const [isOpen, setIsOpen] = React.useState(index === 0);
7
- return (_jsxs(FaqItemStyled, { className: `faqItem ${isOpen ? 'open' : ''}`, children: [_jsx("div", { id: slug, className: 'fakeAnchor' }), _jsxs("details", { itemProp: 'mainEntity', itemScope: true, itemType: 'https://www.schema.org/Question', className: 'content', open: index === 0, children: [_jsxs("summary", { role: 'button', tabIndex: index === 0 ? 0 : -1, onClick: () => {
5
+ export const FaqItem = ({ slug, title, children }) => {
6
+ const [isOpen, setIsOpen] = React.useState(false);
7
+ return (_jsxs(FaqItemStyled, { className: `faqItem ${isOpen ? 'open' : ''}`, children: [_jsx("div", { id: slug, className: 'fakeAnchor' }), _jsxs("details", { itemProp: 'mainEntity', itemScope: true, itemType: 'https://www.schema.org/Question', className: 'content', open: isOpen, children: [_jsxs("summary", { role: 'button', tabIndex: isOpen ? 0 : -1, onClick: (e) => {
8
+ e.preventDefault();
8
9
  setIsOpen(!isOpen);
9
10
  }, onKeyUp: () => {
10
11
  setIsOpen(!isOpen);
11
- }, className: 'question', children: [_jsx("h3", { tabIndex: index === 0 ? 0 : -1, itemProp: 'name', className: 'title', children: title }), _jsx(ChevronRight24px, {})] }), _jsx("div", { itemScope: true, itemProp: 'acceptedAnswer', itemType: 'https://www.schema.org/Answer', className: 'answer', children: _jsx("span", { itemProp: 'text', children: children }) })] })] }));
12
+ }, className: 'question', children: [_jsx("h3", { itemProp: 'name', className: 'title', children: title }), _jsx(ChevronRight24px, {})] }), _jsx("div", { itemScope: true, itemProp: 'acceptedAnswer', itemType: 'https://www.schema.org/Answer', className: 'answer', children: _jsx("span", { itemProp: 'text', children: children }) })] })] }));
12
13
  };
@@ -4,8 +4,8 @@ import { ChevronRight24px } from '../../../../images/componentsSvg/ChevronRight2
4
4
  import { type FaqItemProps } from './FaqItemProps'
5
5
  import { FaqItemStyled } from './FaqItem.styled'
6
6
 
7
- export const FaqItem: React.FC<FaqItemProps> = ({ slug, title, children, index }) => {
8
- const [isOpen, setIsOpen] = React.useState<boolean>(index === 0)
7
+ export const FaqItem: React.FC<FaqItemProps> = ({ slug, title, children }) => {
8
+ const [isOpen, setIsOpen] = React.useState<boolean>(false)
9
9
 
10
10
  return (
11
11
  <FaqItemStyled className={`faqItem ${isOpen ? 'open' : ''}`}>
@@ -15,12 +15,13 @@ export const FaqItem: React.FC<FaqItemProps> = ({ slug, title, children, index }
15
15
  itemScope
16
16
  itemType='https://www.schema.org/Question'
17
17
  className='content'
18
- open={index === 0}
18
+ open={isOpen}
19
19
  >
20
20
  <summary
21
21
  role='button'
22
- tabIndex={index === 0 ? 0 : -1}
23
- onClick={() => {
22
+ tabIndex={isOpen ? 0 : -1}
23
+ onClick={(e) => {
24
+ e.preventDefault()
24
25
  setIsOpen(!isOpen)
25
26
  }}
26
27
  onKeyUp={() => {
@@ -28,7 +29,7 @@ export const FaqItem: React.FC<FaqItemProps> = ({ slug, title, children, index }
28
29
  }}
29
30
  className='question'
30
31
  >
31
- <h3 tabIndex={index === 0 ? 0 : -1} itemProp='name' className='title'>
32
+ <h3 itemProp='name' className='title'>
32
33
  {title}
33
34
  </h3>
34
35
  <ChevronRight24px />
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Article } from '../../molecules';
3
3
  // import './ArticlesList.scss'
4
- const ArticlesList = ({ articles = [] }) => {
4
+ const ArticlesList = ({ articles = [], isCategoryProductPage = false }) => {
5
5
  if (articles?.length === 0)
6
6
  return null;
7
- return (_jsx("div", { className: 'articles_wrapper', children: articles.map((article) => (_jsx(Article, { ...article }, `article_${article?.id}`))) }));
7
+ return (_jsx("div", { className: 'articles_wrapper', children: articles.map((article) => (_jsx(Article, { ...article, isCategoryProductPage: isCategoryProductPage }, `article_${article?.id}`))) }));
8
8
  };
9
9
  export default ArticlesList;
@@ -5,13 +5,13 @@ import { Article, type ArticleProps } from '../../molecules'
5
5
  import { type ArticlesListProps } from './ArticlesListProps.types'
6
6
  // import './ArticlesList.scss'
7
7
 
8
- const ArticlesList: FC<ArticlesListProps> = ({ articles = [] }) => {
8
+ const ArticlesList: FC<ArticlesListProps> = ({ articles = [], isCategoryProductPage = false }) => {
9
9
  if (articles?.length === 0) return null
10
10
 
11
11
  return (
12
12
  <div className='articles_wrapper'>
13
13
  {articles.map((article: ArticleProps) => (
14
- <Article key={`article_${article?.id}`} {...article} />
14
+ <Article key={`article_${article?.id}`} {...article} isCategoryProductPage={isCategoryProductPage} />
15
15
  ))}
16
16
  </div>
17
17
  )
@@ -1,4 +1,5 @@
1
1
  import { type ArticleProps } from '../../molecules';
2
2
  export interface ArticlesListProps {
3
3
  articles: ArticleProps[];
4
+ isCategoryProductPage?: boolean;
4
5
  }
@@ -2,4 +2,5 @@ import { type ArticleProps } from '../../molecules'
2
2
 
3
3
  export interface ArticlesListProps {
4
4
  articles: ArticleProps[]
5
+ isCategoryProductPage?: boolean
5
6
  }
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, RichTextStrapi } from '../../atoms';
2
3
  import { ArticlesList } from '../../organisms';
3
4
  import { BlogSectionStyled } from './BlogSection.styled';
4
- import { Button } from '../../atoms';
5
5
  // import './BlogSection.scss'
6
- const BlogSection = ({ blogTitle, blogCta, articles }) => {
6
+ const BlogSection = ({ blogTitle, blogCta = null, blogDescription = null, articles }) => {
7
7
  if (articles.articles?.length === 0)
8
- return null;
9
- return (_jsxs(BlogSectionStyled, { className: 'blog', children: [_jsx("h2", { className: 'serif --super-large blog__title', children: blogTitle }), _jsx(ArticlesList, { articles: articles.articles }), _jsx(Button, { dataQa: '', color: 'secondary', label: blogCta, givenClass: 'cta-button', link: '/articles' })] }));
8
+ return;
9
+ const categoryProductTitle = !!blogDescription;
10
+ return (_jsxs(BlogSectionStyled, { className: 'blog', children: [_jsx("h2", { className: `serif --super-large blog__title ${categoryProductTitle ? 'category-product-title' : ''}`, children: blogTitle }), blogDescription && _jsx(RichTextStrapi, { className: 'blog__description', html: blogDescription }), _jsx(ArticlesList, { articles: articles.articles, isCategoryProductPage: categoryProductTitle }), blogCta && _jsx(Button, { dataQa: '', color: 'secondary', label: blogCta, givenClass: 'cta-button', link: '/articles' })] }));
10
11
  };
11
12
  export default BlogSection;
@@ -0,0 +1,54 @@
1
+ @import '../../../globalStyles/variables.scss';
2
+ @import '../../../globalStyles/mediaqueries.scss';
3
+
4
+ .blog {
5
+ text-align: center;
6
+ margin: 0 auto 3rem;
7
+ padding: 0 1rem;
8
+ max-width: $md;
9
+
10
+ @include laptop {
11
+ padding: 0;
12
+ }
13
+ @include desktop {
14
+ max-width: $lg;
15
+ }
16
+
17
+ .blog__description {
18
+ font-family: $font-sans;
19
+ font-size: 16px;
20
+ font-weight: 400;
21
+ line-height: 22px;
22
+ letter-spacing: -0.3px;
23
+ text-align: left;
24
+ color: #6d7275;
25
+ margin: 1rem 0 1.5rem 0;
26
+ }
27
+
28
+ .blog__title {
29
+ color: var(--primary-main-dark-1);
30
+
31
+ @include laptop {
32
+ margin-bottom: 3rem;
33
+ }
34
+
35
+ &.category-product-title {
36
+ margin-bottom: 0;
37
+ font-family: $font-sans;
38
+ font-size: 28px;
39
+ font-weight: 700;
40
+ line-height: 32px;
41
+ letter-spacing: -0.3px;
42
+ text-align: left;
43
+ }
44
+ }
45
+
46
+ .cta-button {
47
+ width: 100%;
48
+ margin-top: 3rem;
49
+ display: inline-block;
50
+ @include landscape-tablets {
51
+ width: auto;
52
+ }
53
+ }
54
+ }
@@ -19,6 +19,27 @@ export const BlogSectionStyled = styled.div `
19
19
  @media ${device.laptop} {
20
20
  margin-bottom: 3rem;
21
21
  }
22
+
23
+ &.category-product-title {
24
+ margin-bottom: 0;
25
+ font-family: var(--font-sans);
26
+ font-size: 28px;
27
+ font-weight: 700;
28
+ line-height: 32px;
29
+ letter-spacing: -0.3px;
30
+ text-align: left;
31
+ }
32
+ }
33
+
34
+ .blog__description {
35
+ font-family: var(--font-sans);
36
+ font-size: 16px;
37
+ font-weight: 400;
38
+ line-height: 22px;
39
+ letter-spacing: -0.3px;
40
+ text-align: left;
41
+ color: #3d4042;
42
+ margin: 1rem 0 1.5rem 0;
22
43
  }
23
44
 
24
45
  .cta-button {
@@ -20,6 +20,27 @@ export const BlogSectionStyled = styled.div`
20
20
  @media ${device.laptop} {
21
21
  margin-bottom: 3rem;
22
22
  }
23
+
24
+ &.category-product-title {
25
+ margin-bottom: 0;
26
+ font-family: var(--font-sans);
27
+ font-size: 28px;
28
+ font-weight: 700;
29
+ line-height: 32px;
30
+ letter-spacing: -0.3px;
31
+ text-align: left;
32
+ }
33
+ }
34
+
35
+ .blog__description {
36
+ font-family: var(--font-sans);
37
+ font-size: 16px;
38
+ font-weight: 400;
39
+ line-height: 22px;
40
+ letter-spacing: -0.3px;
41
+ text-align: left;
42
+ color: #3d4042;
43
+ margin: 1rem 0 1.5rem 0;
23
44
  }
24
45
 
25
46
  .cta-button {
@@ -1,20 +1,24 @@
1
1
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
2
2
  import React, { type FC } from 'react'
3
3
 
4
+ import { Button, RichTextStrapi } from '../../atoms'
4
5
  import { ArticlesList } from '../../organisms'
5
6
  import { type BlogSectionProps } from './BlogSectionProps.types'
6
7
  import { BlogSectionStyled } from './BlogSection.styled'
7
- import { Button } from '../../atoms'
8
8
  // import './BlogSection.scss'
9
9
 
10
- const BlogSection: FC<BlogSectionProps> = ({ blogTitle, blogCta, articles }) => {
11
- if (articles.articles?.length === 0) return null
10
+ const BlogSection: FC<BlogSectionProps> = ({ blogTitle, blogCta = null, blogDescription = null, articles }) => {
11
+ if (articles.articles?.length === 0) return
12
+ const categoryProductTitle = !!blogDescription
12
13
 
13
14
  return (
14
15
  <BlogSectionStyled className={'blog'}>
15
- <h2 className={'serif --super-large blog__title'}>{blogTitle}</h2>
16
- <ArticlesList articles={articles.articles} />
17
- <Button dataQa='' color='secondary' label={blogCta} givenClass='cta-button' link={'/articles'} />
16
+ <h2 className={`serif --super-large blog__title ${categoryProductTitle ? 'category-product-title' : ''}`}>
17
+ {blogTitle}
18
+ </h2>
19
+ {blogDescription && <RichTextStrapi className='blog__description' html={blogDescription} />}
20
+ <ArticlesList articles={articles.articles} isCategoryProductPage={categoryProductTitle} />
21
+ {blogCta && <Button dataQa='' color='secondary' label={blogCta} givenClass='cta-button' link={'/articles'} />}
18
22
  </BlogSectionStyled>
19
23
  )
20
24
  }
@@ -1,6 +1,7 @@
1
1
  import { type ArticlesListProps } from '../../organisms';
2
2
  export interface BlogSectionProps {
3
3
  blogTitle: string;
4
- blogCta: string;
4
+ blogCta?: string | null;
5
+ blogDescription?: string | null;
5
6
  articles: ArticlesListProps;
6
7
  }
@@ -2,6 +2,7 @@ import { type ArticlesListProps } from '../../organisms'
2
2
 
3
3
  export interface BlogSectionProps {
4
4
  blogTitle: string
5
- blogCta: string
5
+ blogCta?: string | null
6
+ blogDescription?: string | null
6
7
  articles: ArticlesListProps
7
8
  }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  declare module '*.svg' {
3
- const content: any
3
+ const content: string
4
4
  export default content
5
5
  }
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "5.10.0",
3
+ "version": "5.11.0",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",