@npm_leadtech/legal-lib-components 5.31.7 → 5.31.8

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.
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { AddButtonStyled } from './AddButton.styled';
3
3
  // import './AddButton.scss'
4
- const AddButton = ({ label = '', className = '', items, name = '', onChange, value = '', disabled = false, tooltip = undefined }) => {
5
- return (_jsxs(AddButtonStyled, { className: `e-addButton ${className}`, children: [items.addButton.value !== '' && (_jsxs("div", { className: 'e-addButton__inner', children: [_jsx("input", { type: 'radio', id: `${name}_${items.addButton.value}`, name: name, onChange: onChange, value: items.addButton.value, checked: items.addButton.value === value, disabled: disabled, "data-qa": `${name}_${items.addButton.value}` }), _jsx("label", { htmlFor: `${name}_${items.addButton.value}`, children: label })] })), tooltip !== undefined && _jsx("p", { className: 'tooltip sans-serif --extra-small', children: tooltip })] }));
4
+ const AddButton = ({ label = '', className = '', items, name = '', onChange, value = '', disabled = false, tooltip = undefined, index = 0, total = 1 }) => {
5
+ return (_jsxs(AddButtonStyled, { className: `e-addButton ${className} ${index === 0 && total > 1 ? 'hidden' : ''}`, children: [items.addButton.value !== '' && (_jsxs("div", { className: 'e-addButton__inner', children: [_jsx("input", { type: 'radio', id: `${name}_${items.addButton.value}`, name: name, onChange: onChange, value: items.addButton.value, checked: items.addButton.value === value, disabled: disabled, "data-qa": `${name}_${items.addButton.value}` }), _jsx("label", { htmlFor: `${name}_${items.addButton.value}`, children: label })] })), tooltip !== undefined && _jsx("p", { className: 'tooltip sans-serif --extra-small', children: tooltip })] }));
6
6
  };
7
7
  export default AddButton;
@@ -2,6 +2,10 @@ import styled from 'styled-components';
2
2
  export const AddButtonStyled = styled.div `
3
3
  display: inline-block;
4
4
 
5
+ .hidden {
6
+ display: none;
7
+ }
8
+
5
9
  .tooltip {
6
10
  margin-top: 0.5rem;
7
11
  }
@@ -3,6 +3,10 @@ import styled from 'styled-components'
3
3
  export const AddButtonStyled = styled.div`
4
4
  display: inline-block;
5
5
 
6
+ .hidden {
7
+ display: none;
8
+ }
9
+
6
10
  .tooltip {
7
11
  margin-top: 0.5rem;
8
12
  }
@@ -12,10 +12,12 @@ const AddButton: FC<AddButtonProps> = ({
12
12
  onChange,
13
13
  value = '',
14
14
  disabled = false,
15
- tooltip = undefined
15
+ tooltip = undefined,
16
+ index = 0,
17
+ total = 1
16
18
  }) => {
17
19
  return (
18
- <AddButtonStyled className={`e-addButton ${className}`}>
20
+ <AddButtonStyled className={`e-addButton ${className} ${index === 0 && total > 1 ? 'hidden' : ''}`}>
19
21
  {items.addButton.value !== '' && (
20
22
  <div className={'e-addButton__inner'}>
21
23
  <input
@@ -12,4 +12,6 @@ export interface AddButtonProps {
12
12
  value?: string;
13
13
  tooltip?: string;
14
14
  disabled?: boolean;
15
+ index?: number;
16
+ total?: number;
15
17
  }
@@ -12,4 +12,6 @@ export interface AddButtonProps {
12
12
  value?: string
13
13
  tooltip?: string
14
14
  disabled?: boolean
15
+ index?: number
16
+ total?: number
15
17
  }
@@ -1,8 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Button, Tag } from '../../atoms';
3
3
  import { CardFunctionalityStyled } from './CardFunctionality.styled';
4
- export const CardFunctionality = ({ icon, title, text, tags, cta, isHidden = false }) => {
5
- if (isHidden)
6
- return null;
4
+ export const CardFunctionality = ({ icon, title, text, tags, cta }) => {
7
5
  return (_jsxs(CardFunctionalityStyled, { children: [_jsxs("div", { className: 'content-tags', children: [_jsxs("div", { className: 'content', children: [_jsxs("div", { className: 'header', children: [_jsx("div", { className: 'icon', children: icon }), _jsx("p", { className: 'title', children: title })] }), _jsx("div", { title: text, className: 'text', children: text })] }), _jsx("div", { className: 'tags', children: tags.map((tag) => (_jsx(Tag, { ...tag }, tag.id))) })] }), _jsx(Button, { ...cta, givenClass: 'cta-card' })] }));
8
6
  };
@@ -6,7 +6,6 @@ export const CardFunctionalityStyled = styled.article `
6
6
  flex-direction: column;
7
7
  gap: var(--global-gap);
8
8
  padding: 1em;
9
- width: 50%;
10
9
 
11
10
  .content-tags {
12
11
  display: flex;
@@ -7,7 +7,6 @@ export const CardFunctionalityStyled = styled.article`
7
7
  flex-direction: column;
8
8
  gap: var(--global-gap);
9
9
  padding: 1em;
10
- width: 50%;
11
10
 
12
11
  .content-tags {
13
12
  display: flex;
@@ -4,15 +4,7 @@ import { Button, Tag } from '../../atoms'
4
4
  import { type CardFunctionalityProps } from './CardFunctionalityProps'
5
5
  import { CardFunctionalityStyled } from './CardFunctionality.styled'
6
6
 
7
- export const CardFunctionality: React.FC<CardFunctionalityProps> = ({
8
- icon,
9
- title,
10
- text,
11
- tags,
12
- cta,
13
- isHidden = false
14
- }) => {
15
- if (isHidden) return null
7
+ export const CardFunctionality: React.FC<CardFunctionalityProps> = ({ icon, title, text, tags, cta }) => {
16
8
  return (
17
9
  <CardFunctionalityStyled>
18
10
  <div className='content-tags'>
@@ -6,5 +6,4 @@ export interface CardFunctionalityProps {
6
6
  tags: TagProps[];
7
7
  cta: ButtonProps;
8
8
  id: string;
9
- isHidden: boolean;
10
9
  }
@@ -7,5 +7,4 @@ export interface CardFunctionalityProps {
7
7
  tags: TagProps[]
8
8
  cta: ButtonProps
9
9
  id: string
10
- isHidden: boolean
11
10
  }
@@ -3,11 +3,12 @@ import styled from 'styled-components';
3
3
  export const FunctionalityCardsSectionStyled = styled.section `
4
4
  display: flex;
5
5
  flex-direction: column;
6
- gap: var(--global-gap);
6
+ gap: $global-gap;
7
7
  margin-bottom: 2rem;
8
8
  width: 100%;
9
9
 
10
10
  @media ${device.laptop} {
11
11
  flex-direction: row;
12
+ width: 50%;
12
13
  }
13
14
  `;
@@ -4,11 +4,12 @@ import styled from 'styled-components'
4
4
  export const FunctionalityCardsSectionStyled = styled.section`
5
5
  display: flex;
6
6
  flex-direction: column;
7
- gap: var(--global-gap);
7
+ gap: $global-gap;
8
8
  margin-bottom: 2rem;
9
9
  width: 100%;
10
10
 
11
11
  @media ${device.laptop} {
12
12
  flex-direction: row;
13
+ width: 50%;
13
14
  }
14
15
  `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "5.31.7",
3
+ "version": "5.31.8",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",