@npm_leadtech/legal-lib-components 5.7.2 → 5.7.3

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/css/styles.css +0 -15
  2. package/dist/src/components/molecules/Article/Article.js +2 -3
  3. package/dist/src/components/molecules/Article/Article.scss +0 -17
  4. package/dist/src/components/molecules/Article/Article.tsx +2 -17
  5. package/dist/src/components/molecules/Article/ArticleProps.types.d.ts +0 -1
  6. package/dist/src/components/molecules/Article/ArticleProps.types.ts +0 -1
  7. package/dist/src/components/organisms/ArticlesList/ArticlesList.js +2 -2
  8. package/dist/src/components/organisms/ArticlesList/ArticlesList.tsx +2 -2
  9. package/dist/src/components/organisms/ArticlesList/ArticlesListProps.types.d.ts +0 -1
  10. package/dist/src/components/organisms/ArticlesList/ArticlesListProps.types.ts +0 -1
  11. package/dist/src/components/sections/BlogSection/BlogSection.js +4 -5
  12. package/dist/src/components/sections/BlogSection/BlogSection.styled.js +0 -21
  13. package/dist/src/components/sections/BlogSection/BlogSection.styled.ts +0 -21
  14. package/dist/src/components/sections/BlogSection/BlogSection.tsx +6 -10
  15. package/dist/src/components/sections/BlogSection/BlogSectionProps.types.d.ts +1 -2
  16. package/dist/src/components/sections/BlogSection/BlogSectionProps.types.ts +1 -2
  17. package/dist/src/components/sections/WhyLawDistrictSection/WhyLawDistrictSection.js +6 -1
  18. package/dist/src/components/sections/WhyLawDistrictSection/WhyLawDistrictSection.tsx +8 -2
  19. package/dist/src/custom.d.ts +1 -1
  20. package/package.json +1 -1
  21. package/dist/images/svg/arrow-right-24px-outlined.svg +0 -3
  22. package/dist/src/components/sections/BlogSection/BlogSection.scss +0 -54
@@ -2354,21 +2354,6 @@ h2.react-datepicker__current-month {
2354
2354
  margin-top: 0;
2355
2355
  }
2356
2356
  }
2357
- .article .information .button-image-container {
2358
- align-items: center;
2359
- margin: 1rem 0 2rem 0;
2360
- display: flex;
2361
- }
2362
- .article .information .button-image-container .thinner-letter {
2363
- font-family: "Inter", sans-serif;
2364
- font-size: 16px;
2365
- font-weight: 400;
2366
- line-height: 22px;
2367
- letter-spacing: -0.3px;
2368
- text-align: left;
2369
- margin: 0;
2370
- padding: 0 1rem 0 0;
2371
- }
2372
2357
  .base-box-group {
2373
2358
  display: block;
2374
2359
  }
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import ArrowRight from '../../../../images/svg/arrow-right-24px-outlined.svg';
3
2
  import { Button } from '../../atoms';
4
3
  // import './Article.scss'
5
- const Article = ({ imageUrl, title, articleUrl, summary, isCategoryProductPage }) => {
6
- return (_jsxs("div", { 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 }), 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 }))] })] }));
4
+ const Article = ({ imageUrl, title, articleUrl, summary }) => {
5
+ return (_jsxs("div", { 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 })] })] }));
7
6
  };
8
7
  export default Article;
@@ -62,22 +62,5 @@
62
62
  margin-top: 0;
63
63
  }
64
64
  }
65
-
66
- .button-image-container {
67
- align-items: center;
68
- margin: 1rem 0 2rem 0;
69
- display: flex;
70
-
71
- .thinner-letter {
72
- font-family: $font-sans;
73
- font-size: 16px;
74
- font-weight: 400;
75
- line-height: 22px;
76
- letter-spacing: -0.3px;
77
- text-align: left;
78
- margin: 0;
79
- padding: 0 1rem 0 0;
80
- }
81
- }
82
65
  }
83
66
  }
@@ -1,11 +1,10 @@
1
1
  import React, { type FC } from 'react'
2
2
 
3
- import ArrowRight from '../../../../images/svg/arrow-right-24px-outlined.svg'
4
3
  import { type ArticleProps } from './ArticleProps.types'
5
4
  import { Button } from '../../atoms'
6
5
  // import './Article.scss'
7
6
 
8
- const Article: FC<ArticleProps> = ({ imageUrl, title, articleUrl, summary, isCategoryProductPage }) => {
7
+ const Article: FC<ArticleProps> = ({ imageUrl, title, articleUrl, summary }) => {
9
8
  return (
10
9
  <div className='article'>
11
10
  <img src={imageUrl} className='image' loading='lazy' alt={title} />
@@ -14,21 +13,7 @@ const Article: FC<ArticleProps> = ({ imageUrl, title, articleUrl, summary, isCat
14
13
  <p className='title sans-serif --big'>{title} </p>
15
14
  </a>
16
15
  <div className='summary'>{summary}</div>
17
- {isCategoryProductPage ? (
18
- <div className='button-image-container'>
19
- <Button
20
- givenClass='thinner-letter'
21
- color='tertiary'
22
- label={'Read more'}
23
- dataQa='article-read-more'
24
- link={articleUrl}
25
- isExternal
26
- />
27
- <img className='article__arrow-right' src={ArrowRight} alt=''></img>
28
- </div>
29
- ) : (
30
- <Button color='tertiary' label={'Read more'} dataQa='article-read-more' link={articleUrl} isExternal />
31
- )}
16
+ <Button color='tertiary' label={'Read more'} dataQa='article-read-more' link={articleUrl} isExternal />
32
17
  </div>
33
18
  </div>
34
19
  )
@@ -4,5 +4,4 @@ export interface ArticleProps {
4
4
  articleUrl: string;
5
5
  summary: string;
6
6
  id: string;
7
- isCategoryProductPage: boolean;
8
7
  }
@@ -4,5 +4,4 @@ export interface ArticleProps {
4
4
  articleUrl: string
5
5
  summary: string
6
6
  id: string
7
- isCategoryProductPage: boolean
8
7
  }
@@ -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 = [], isCategoryProductPage = false }) => {
4
+ const ArticlesList = ({ articles = [] }) => {
5
5
  if (articles?.length === 0)
6
6
  return null;
7
- return (_jsx("div", { className: 'articles_wrapper', children: articles.map((article) => (_jsx(Article, { ...article, isCategoryProductPage: isCategoryProductPage }, `article_${article?.id}`))) }));
7
+ return (_jsx("div", { className: 'articles_wrapper', children: articles.map((article) => (_jsx(Article, { ...article }, `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 = [], isCategoryProductPage = false }) => {
8
+ const ArticlesList: FC<ArticlesListProps> = ({ articles = [] }) => {
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} isCategoryProductPage={isCategoryProductPage} />
14
+ <Article key={`article_${article?.id}`} {...article} />
15
15
  ))}
16
16
  </div>
17
17
  )
@@ -1,5 +1,4 @@
1
1
  import { type ArticleProps } from '../../molecules';
2
2
  export interface ArticlesListProps {
3
3
  articles: ArticleProps[];
4
- isCategoryProductPage?: boolean;
5
4
  }
@@ -2,5 +2,4 @@ import { type ArticleProps } from '../../molecules'
2
2
 
3
3
  export interface ArticlesListProps {
4
4
  articles: ArticleProps[]
5
- isCategoryProductPage?: boolean
6
5
  }
@@ -1,12 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, RichTextStrapi } from '../../atoms';
3
2
  import { ArticlesList } from '../../organisms';
4
3
  import { BlogSectionStyled } from './BlogSection.styled';
4
+ import { Button } from '../../atoms';
5
5
  // import './BlogSection.scss'
6
- const BlogSection = ({ blogTitle, blogCta = null, blogDescription = null, articles }) => {
6
+ const BlogSection = ({ blogTitle, blogCta, articles }) => {
7
7
  if (articles.articles?.length === 0)
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' })] }));
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' })] }));
11
10
  };
12
11
  export default BlogSection;
@@ -19,27 +19,6 @@ 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;
43
22
  }
44
23
 
45
24
  .cta-button {
@@ -20,27 +20,6 @@ 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;
44
23
  }
45
24
 
46
25
  .cta-button {
@@ -1,24 +1,20 @@
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'
5
4
  import { ArticlesList } from '../../organisms'
6
5
  import { type BlogSectionProps } from './BlogSectionProps.types'
7
6
  import { BlogSectionStyled } from './BlogSection.styled'
7
+ import { Button } from '../../atoms'
8
8
  // import './BlogSection.scss'
9
9
 
10
- const BlogSection: FC<BlogSectionProps> = ({ blogTitle, blogCta = null, blogDescription = null, articles }) => {
11
- if (articles.articles?.length === 0) return
12
- const categoryProductTitle = !!blogDescription
10
+ const BlogSection: FC<BlogSectionProps> = ({ blogTitle, blogCta, articles }) => {
11
+ if (articles.articles?.length === 0) return null
13
12
 
14
13
  return (
15
14
  <BlogSectionStyled className={'blog'}>
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'} />}
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'} />
22
18
  </BlogSectionStyled>
23
19
  )
24
20
  }
@@ -1,7 +1,6 @@
1
1
  import { type ArticlesListProps } from '../../organisms';
2
2
  export interface BlogSectionProps {
3
3
  blogTitle: string;
4
- blogCta?: string | null;
5
- blogDescription?: string | null;
4
+ blogCta: string;
6
5
  articles: ArticlesListProps;
7
6
  }
@@ -2,7 +2,6 @@ import { type ArticlesListProps } from '../../organisms'
2
2
 
3
3
  export interface BlogSectionProps {
4
4
  blogTitle: string
5
- blogCta?: string | null
6
- blogDescription?: string | null
5
+ blogCta: string
7
6
  articles: ArticlesListProps
8
7
  }
@@ -1,10 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
2
3
  import { Button } from '../../atoms/Button';
3
4
  import { WhyLawDistrictItems } from '../../atoms/WhyLawDistrictItems';
4
5
  import { WhyLawDistrictSectionStyled } from './WhyLawDistrictSection.styled';
5
6
  export const WhyLawDistrictSection = ({ title, items, userActive, link }) => {
6
7
  if (items.length === 0)
7
8
  return null;
8
- return (_jsxs(WhyLawDistrictSectionStyled, { className: 'whyLawDistrictSection', children: [_jsx("h2", { className: 'why-lawDistrict__title serif --hero', children: title }), _jsx(WhyLawDistrictItems, { items: items }), !userActive && (_jsx(Button, { givenClass: 'whyLawDistrictSection__button', label: link.cta, link: link.url, onClick: link.onClick, dataQa: link.dataQa, isExternal: true, hasNoFollow: true }))] }));
9
+ const [isUserActive, setIsUserActive] = useState(false);
10
+ useEffect(() => {
11
+ setIsUserActive(userActive);
12
+ }, [userActive]);
13
+ return (_jsxs(WhyLawDistrictSectionStyled, { className: 'whyLawDistrictSection', children: [_jsx("h2", { className: 'why-lawDistrict__title serif --hero', children: title }), _jsx(WhyLawDistrictItems, { items: items }), !isUserActive && (_jsx(Button, { givenClass: 'whyLawDistrictSection__button', label: link.cta, link: link.url, onClick: link.onClick, dataQa: link.dataQa, isExternal: true, hasNoFollow: true }))] }));
9
14
  };
10
15
  export default WhyLawDistrictSection;
@@ -1,4 +1,4 @@
1
- import React from 'react'
1
+ import React, { useEffect, useState } from 'react'
2
2
 
3
3
  import { Button } from '../../atoms/Button'
4
4
  import { WhyLawDistrictItems } from '../../atoms/WhyLawDistrictItems'
@@ -8,12 +8,18 @@ import { WhyLawDistrictSectionStyled } from './WhyLawDistrictSection.styled'
8
8
  export const WhyLawDistrictSection: React.FC<WhyLawDistrictSectionProps> = ({ title, items, userActive, link }) => {
9
9
  if (items.length === 0) return null
10
10
 
11
+ const [isUserActive, setIsUserActive] = useState(false)
12
+
13
+ useEffect(() => {
14
+ setIsUserActive(userActive)
15
+ }, [userActive])
16
+
11
17
  return (
12
18
  <WhyLawDistrictSectionStyled className={'whyLawDistrictSection'}>
13
19
  <h2 className={'why-lawDistrict__title serif --hero'}>{title}</h2>
14
20
  <WhyLawDistrictItems items={items} />
15
21
 
16
- {!userActive && (
22
+ {!isUserActive && (
17
23
  <Button
18
24
  givenClass='whyLawDistrictSection__button'
19
25
  label={link.cta}
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  declare module '*.svg' {
3
- const content: string
3
+ const content: any
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.7.2",
3
+ "version": "5.7.3",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,3 +0,0 @@
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,54 +0,0 @@
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
- }