@npm_leadtech/legal-lib-components 5.16.10 → 5.17.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 (23) hide show
  1. package/dist/css/styles.css +1 -1
  2. package/dist/src/components/atoms/DisclaimerRatafia/DisclaimerRatafia.js +1 -1
  3. package/dist/src/components/atoms/DisclaimerRatafia/DisclaimerRatafia.tsx +3 -0
  4. package/dist/src/components/atoms/GoogleButton/GoogleButton.js +2 -2
  5. package/dist/src/components/atoms/GoogleButton/GoogleButton.tsx +2 -2
  6. package/dist/src/components/atoms/GoogleButton/GoogleButtonProps.types.d.ts +0 -1
  7. package/dist/src/components/atoms/GoogleButton/GoogleButtonProps.types.ts +0 -1
  8. package/dist/src/components/atoms/MenuItems/MenuItemProps.types.d.ts +1 -0
  9. package/dist/src/components/atoms/MenuItems/MenuItemProps.types.ts +1 -0
  10. package/dist/src/components/atoms/SearchSelect/SearchSelect.styled.js +1 -1
  11. package/dist/src/components/atoms/SearchSelect/SearchSelect.styled.ts +1 -1
  12. package/dist/src/components/molecules/BottomOverlay/BottomOverlay.js +12 -0
  13. package/dist/src/components/molecules/BottomOverlay/BottomOverlay.tsx +12 -0
  14. package/dist/src/components/molecules/RatafiaSubscriptionCard/RatafiaSubscriptionCard.styled.js +8 -1
  15. package/dist/src/components/molecules/RatafiaSubscriptionCard/RatafiaSubscriptionCard.styled.ts +8 -1
  16. package/dist/src/components/molecules/TextInput/TextInput.scss +1 -1
  17. package/dist/src/components/organisms/LoginRatafiaContent/LoginRatafiaContent.js +3 -4
  18. package/dist/src/components/organisms/LoginRatafiaContent/LoginRatafiaContent.styled.js +0 -7
  19. package/dist/src/components/organisms/LoginRatafiaContent/LoginRatafiaContent.styled.ts +0 -7
  20. package/dist/src/components/organisms/LoginRatafiaContent/LoginRatafiaContent.tsx +2 -8
  21. package/dist/src/components/pages/LoginRatafiaPage/LoginRatafiaPage.styled.js +2 -11
  22. package/dist/src/components/pages/LoginRatafiaPage/LoginRatafiaPage.styled.ts +2 -11
  23. package/package.json +1 -1
@@ -2225,7 +2225,7 @@ h2.react-datepicker__current-month {
2225
2225
  .e-text {
2226
2226
  display: flex;
2227
2227
  flex-direction: column-reverse;
2228
- margin-bottom: 2rem;
2228
+ margin-bottom: 1rem;
2229
2229
  position: relative;
2230
2230
  }
2231
2231
  .e-text input {
@@ -16,6 +16,6 @@ export const DisclaimerRatafia = ({ icon, text, ctaTextShowDisclaimer, ctaTextCl
16
16
  ctaTextCloseDisclaimer.onClick();
17
17
  };
18
18
  const existLegalAdviceText = Boolean(legalAdviceText);
19
- return (_jsxs(DisclaimerRatafiaStyled, { className: 'disclaimer-ratafia', children: [_jsxs("div", { className: 'disclaimer-ratafia__text-desktop', children: [_jsxs("div", { className: 'disclaimer-ratafia__text', children: [_jsx("div", { className: 'disclaimer-ratafia__text__icon', children: icon }), _jsx("p", { className: 'sans-serif --small disclaimer-ratafia__text__text', children: text })] }), existLegalAdviceText && (_jsx("div", { className: 'disclaimer-ratafia__legal-advice', children: _jsx("span", { className: 'sans-serif --extra-small disclaimer-ratafia__copyright__text', children: legalAdviceText }) })), _jsx("div", { className: 'disclaimer-ratafia__copyright', children: _jsx("span", { className: 'sans-serif --extra-small disclaimer-ratafia__copyright__text', children: copyrightText }) })] }), _jsxs("div", { className: 'disclaimer-ratafia__text-mobile', children: [_jsx("div", { className: 'disclaimer-ratafia__text-mobile-text', children: _jsxs("button", { "data-qa": ctaTextShowDisclaimer.dataQa, className: 'sans-serif --small disclaimer-ratafia__text__text', onClick: handleShowDisclaimer, children: [_jsx("div", { className: 'disclaimer-ratafia__text__icon', children: icon }), ctaTextShowDisclaimer.text, _jsx("div", { className: 'disclaimer-ratafia__text__arrow', children: _jsx(ChevronRight, {}) })] }) }), disclaimer && (_jsxs(_Fragment, { children: [_jsx("div", { className: 'disclaimer-ratafia__disclaimer-background' }), _jsxs("div", { className: 'disclaimer-ratafia__disclaimer-fixed', children: [_jsx("p", { className: 'disclaimer-ratafia__disclaimer-fixed__title', children: ctaTextShowDisclaimer.text }), _jsx("p", { className: 'sans-serif --small disclaimer-ratafia__disclaimer-fixed__subTitle', children: text }), _jsx("div", { className: 'sans-serif --small disclaimer-ratafia__disclaimer-fixed__text', children: copyrightText }), _jsx(Button, { color: 'primary', label: ctaTextCloseDisclaimer.text, givenClass: 'disclaimer-ratafia__disclaimer-fixed__cta', onClick: handleCloseDisclaimer, noLink: true, dataQa: ctaTextCloseDisclaimer.dataQa })] })] }))] })] }));
19
+ return (_jsxs(DisclaimerRatafiaStyled, { className: 'disclaimer-ratafia', children: [_jsxs("div", { className: 'disclaimer-ratafia__text-desktop', children: [_jsxs("div", { className: 'disclaimer-ratafia__text', children: [_jsx("div", { className: 'disclaimer-ratafia__text__icon', children: icon }), _jsx("p", { className: 'sans-serif --small disclaimer-ratafia__text__text', children: text })] }), existLegalAdviceText && (_jsx("div", { className: 'disclaimer-ratafia__legal-advice', children: _jsx("span", { className: 'sans-serif --extra-small disclaimer-ratafia__copyright__text', children: legalAdviceText }) })), _jsx("div", { className: 'disclaimer-ratafia__copyright', children: _jsx("span", { className: 'sans-serif --extra-small disclaimer-ratafia__copyright__text', children: copyrightText }) })] }), _jsxs("div", { className: 'disclaimer-ratafia__text-mobile', children: [_jsx("div", { className: 'disclaimer-ratafia__text-mobile-text', children: _jsxs("button", { "data-qa": ctaTextShowDisclaimer.dataQa, className: 'sans-serif --small disclaimer-ratafia__text__text', onClick: handleShowDisclaimer, children: [_jsx("div", { className: 'disclaimer-ratafia__text__icon', children: icon }), ctaTextShowDisclaimer.text, _jsx("div", { className: 'disclaimer-ratafia__text__arrow', children: _jsx(ChevronRight, {}) })] }) }), disclaimer && (_jsxs(_Fragment, { children: [_jsx("div", { className: 'disclaimer-ratafia__disclaimer-background' }), _jsxs("div", { className: 'disclaimer-ratafia__disclaimer-fixed', children: [_jsx("p", { className: 'disclaimer-ratafia__disclaimer-fixed__title', children: ctaTextShowDisclaimer.text }), _jsx("p", { className: 'sans-serif --small disclaimer-ratafia__disclaimer-fixed__subTitle', children: text }), existLegalAdviceText && (_jsx("div", { className: 'sans-serif --small disclaimer-ratafia__disclaimer-fixed__text', children: legalAdviceText })), _jsx("div", { className: 'sans-serif --small disclaimer-ratafia__disclaimer-fixed__text', children: copyrightText }), _jsx(Button, { color: 'primary', label: ctaTextCloseDisclaimer.text, givenClass: 'disclaimer-ratafia__disclaimer-fixed__cta', onClick: handleCloseDisclaimer, noLink: true, dataQa: ctaTextCloseDisclaimer.dataQa })] })] }))] })] }));
20
20
  };
21
21
  export default DisclaimerRatafia;
@@ -65,6 +65,9 @@ export const DisclaimerRatafia: React.FC<DisclaimerRatafiaProps> = ({
65
65
  <div className='disclaimer-ratafia__disclaimer-fixed'>
66
66
  <p className='disclaimer-ratafia__disclaimer-fixed__title'>{ctaTextShowDisclaimer.text}</p>
67
67
  <p className='sans-serif --small disclaimer-ratafia__disclaimer-fixed__subTitle'>{text}</p>
68
+ {existLegalAdviceText && (
69
+ <div className='sans-serif --small disclaimer-ratafia__disclaimer-fixed__text'>{legalAdviceText}</div>
70
+ )}
68
71
  <div className='sans-serif --small disclaimer-ratafia__disclaimer-fixed__text'>{copyrightText}</div>
69
72
  <Button
70
73
  color='primary'
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { GoogleButtonStyled } from './GoogleButton.styled';
3
3
  import logoGoogle from '../../../../images/svg/logo-google.svg';
4
- const GoogleButton = ({ onClick, label = 'Log In with Google', dataQa = 'google_sign_in' }) => {
5
- return (_jsxs(GoogleButtonStyled, { type: 'button', className: 'google-button', onClick: onClick, "data-qa": dataQa, children: [_jsx("img", { className: 'google-logo', src: logoGoogle, alt: '' }), _jsx("span", { children: label })] }));
4
+ const GoogleButton = ({ onClick, label = 'Log In with Google' }) => {
5
+ return (_jsxs(GoogleButtonStyled, { type: 'button', className: 'google-button', onClick: onClick, children: [_jsx("img", { className: 'google-logo', src: logoGoogle, alt: '' }), _jsx("span", { children: label })] }));
6
6
  };
7
7
  export default GoogleButton;
@@ -4,9 +4,9 @@ import { type GoogleButtonProps } from './GoogleButtonProps.types'
4
4
  import { GoogleButtonStyled } from './GoogleButton.styled'
5
5
  import logoGoogle from '../../../../images/svg/logo-google.svg'
6
6
 
7
- const GoogleButton: FC<GoogleButtonProps> = ({ onClick, label = 'Log In with Google', dataQa = 'google_sign_in' }) => {
7
+ const GoogleButton: FC<GoogleButtonProps> = ({ onClick, label = 'Log In with Google' }) => {
8
8
  return (
9
- <GoogleButtonStyled type='button' className='google-button' onClick={onClick} data-qa={dataQa}>
9
+ <GoogleButtonStyled type='button' className='google-button' onClick={onClick}>
10
10
  <img className='google-logo' src={logoGoogle} alt=''></img>
11
11
  <span>{label}</span>
12
12
  </GoogleButtonStyled>
@@ -1,5 +1,4 @@
1
1
  export interface GoogleButtonProps {
2
2
  label?: string;
3
3
  onClick?: () => void;
4
- dataQa?: string;
5
4
  }
@@ -1,5 +1,4 @@
1
1
  export interface GoogleButtonProps {
2
2
  label?: string
3
3
  onClick?: () => void
4
- dataQa?: string
5
4
  }
@@ -1,4 +1,5 @@
1
1
  export interface MenuItemProps {
2
+ className?: string;
2
3
  spacing?: boolean;
3
4
  hasBullets?: boolean;
4
5
  initialActiveContent?: string;
@@ -1,5 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  export interface MenuItemProps {
3
+ className?: string
3
4
  spacing?: boolean
4
5
  hasBullets?: boolean
5
6
  initialActiveContent?: string
@@ -6,7 +6,7 @@ export const SearchSelectStyled = styled.div `
6
6
  .e-searchselect {
7
7
  display: flex;
8
8
  flex-direction: column-reverse;
9
- margin-bottom: 2rem;
9
+ margin-bottom: 1rem;
10
10
  position: relative;
11
11
 
12
12
  @media ${device.laptop} {
@@ -7,7 +7,7 @@ export const SearchSelectStyled = styled.div`
7
7
  .e-searchselect {
8
8
  display: flex;
9
9
  flex-direction: column-reverse;
10
- margin-bottom: 2rem;
10
+ margin-bottom: 1rem;
11
11
  position: relative;
12
12
 
13
13
  @media ${device.laptop} {
@@ -9,6 +9,7 @@ const BottomOverlay = ({ givenClass, header, body, open = false, onClose, footer
9
9
  const overlayBackground = useRef(null);
10
10
  const overlayMessage = useRef(null);
11
11
  useEffect(() => {
12
+ handleBodyScroll(open);
12
13
  if (open) {
13
14
  const backgroundElement = overlayBackground.current;
14
15
  backgroundElement.addEventListener('mousedown', handleCloseModal);
@@ -17,6 +18,17 @@ const BottomOverlay = ({ givenClass, header, body, open = false, onClose, footer
17
18
  };
18
19
  }
19
20
  }, [open]);
21
+ const handleBodyScroll = (disableScroll) => {
22
+ if (disableScroll) {
23
+ document.body.style.overflow = 'hidden';
24
+ document.body.style.position = 'fixed';
25
+ }
26
+ else {
27
+ document.body.style.overflow = 'unset';
28
+ document.body.style.position = 'relative';
29
+ document.body.style.width = '100%';
30
+ }
31
+ };
20
32
  const handleCloseModal = (event) => {
21
33
  if (onClose != null)
22
34
  onClose();
@@ -12,6 +12,7 @@ const BottomOverlay: FC<BottomOverlayProps> = ({ givenClass, header, body, open
12
12
  const overlayMessage = useRef<HTMLDivElement | null>(null)
13
13
 
14
14
  useEffect(() => {
15
+ handleBodyScroll(open)
15
16
  if (open) {
16
17
  const backgroundElement = overlayBackground.current as HTMLElement
17
18
  backgroundElement.addEventListener('mousedown', handleCloseModal)
@@ -21,6 +22,17 @@ const BottomOverlay: FC<BottomOverlayProps> = ({ givenClass, header, body, open
21
22
  }
22
23
  }, [open])
23
24
 
25
+ const handleBodyScroll = (disableScroll: boolean): void => {
26
+ if (disableScroll) {
27
+ document.body.style.overflow = 'hidden'
28
+ document.body.style.position = 'fixed'
29
+ } else {
30
+ document.body.style.overflow = 'unset'
31
+ document.body.style.position = 'relative'
32
+ document.body.style.width = '100%'
33
+ }
34
+ }
35
+
24
36
  const handleCloseModal = (event: MouseEvent): void => {
25
37
  if (onClose != null) onClose()
26
38
  }
@@ -1,10 +1,11 @@
1
+ import { device } from '../../../globalStyles/breakpoints';
1
2
  import styled from 'styled-components';
2
3
  export const RatafiaSubscriptionCardStyled = styled.div `
3
4
  display: flex;
4
5
  flex-flow: column nowrap;
5
6
  flex: 1;
6
7
  gap: 0.5rem;
7
- min-width: 320px;
8
+ min-width: 270px;
8
9
  padding: 1rem;
9
10
  border-radius: var(--global-border-radius);
10
11
 
@@ -90,5 +91,11 @@ export const RatafiaSubscriptionCardStyled = styled.div `
90
91
  display: flex;
91
92
  margin-top: 1.5rem;
92
93
  }
94
+
95
+ @media ${device.mobile} {
96
+ &__button {
97
+ flex: 1;
98
+ }
99
+ }
93
100
  }
94
101
  `;
@@ -1,3 +1,4 @@
1
+ import { device } from '../../../globalStyles/breakpoints'
1
2
  import styled from 'styled-components'
2
3
 
3
4
  export const RatafiaSubscriptionCardStyled = styled.div`
@@ -5,7 +6,7 @@ export const RatafiaSubscriptionCardStyled = styled.div`
5
6
  flex-flow: column nowrap;
6
7
  flex: 1;
7
8
  gap: 0.5rem;
8
- min-width: 320px;
9
+ min-width: 270px;
9
10
  padding: 1rem;
10
11
  border-radius: var(--global-border-radius);
11
12
 
@@ -91,5 +92,11 @@ export const RatafiaSubscriptionCardStyled = styled.div`
91
92
  display: flex;
92
93
  margin-top: 1.5rem;
93
94
  }
95
+
96
+ @media ${device.mobile} {
97
+ &__button {
98
+ flex: 1;
99
+ }
100
+ }
94
101
  }
95
102
  `
@@ -7,7 +7,7 @@
7
7
  .e-text {
8
8
  display: flex;
9
9
  flex-direction: column-reverse;
10
- margin-bottom: 2rem;
10
+ margin-bottom: 1rem;
11
11
  position: relative;
12
12
 
13
13
  input {
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Checkbox } from '../../atoms';
3
- import { TextInput } from '../../molecules';
4
2
  import { LoginRatafiaContentStyled } from './LoginRatafiaContent.styled';
5
- const LoginRatafiaContent = ({ title, email, policy }) => {
6
- return (_jsxs(LoginRatafiaContentStyled, { children: [_jsx("h2", { className: 'login-ratafia-content__title', children: title }), _jsx("div", { className: 'login-ratafia-content__email', children: _jsx(TextInput, { ...email }) }), _jsx("div", { className: 'login-ratafia-content__policy', children: _jsx(Checkbox, { ...policy }) })] }));
3
+ import { TextInput } from '../../molecules';
4
+ const LoginRatafiaContent = ({ title, email }) => {
5
+ return (_jsxs(LoginRatafiaContentStyled, { children: [_jsx("h2", { className: 'login-ratafia-content__title', children: title }), _jsx("div", { className: 'login-ratafia-content__email', children: _jsx(TextInput, { ...email }) })] }));
7
6
  };
8
7
  export default LoginRatafiaContent;
@@ -1,4 +1,3 @@
1
- import { device } from '../../../globalStyles/breakpoints';
2
1
  import styled from 'styled-components';
3
2
  export const LoginRatafiaContentStyled = styled.div `
4
3
  width: 100%;
@@ -12,10 +11,4 @@ export const LoginRatafiaContentStyled = styled.div `
12
11
  margin-bottom: 0.5rem;
13
12
  }
14
13
  }
15
- .login-ratafia-content__policy {
16
- margin-top: 1rem;
17
- @media ${device['portrait-tablets']} {
18
- display: none;
19
- }
20
- }
21
14
  `;
@@ -1,4 +1,3 @@
1
- import { device } from '../../../globalStyles/breakpoints'
2
1
  import styled from 'styled-components'
3
2
 
4
3
  export const LoginRatafiaContentStyled = styled.div`
@@ -13,10 +12,4 @@ export const LoginRatafiaContentStyled = styled.div`
13
12
  margin-bottom: 0.5rem;
14
13
  }
15
14
  }
16
- .login-ratafia-content__policy {
17
- margin-top: 1rem;
18
- @media ${device['portrait-tablets']} {
19
- display: none;
20
- }
21
- }
22
15
  `
@@ -1,22 +1,16 @@
1
1
  import React, { type FC } from 'react'
2
2
 
3
3
  import { type LoginRatafiaContentProps } from './LoginRatafiaContentProps.types'
4
-
5
- import { Checkbox } from '../../atoms'
6
- import { TextInput } from '../../molecules'
7
-
8
4
  import { LoginRatafiaContentStyled } from './LoginRatafiaContent.styled'
5
+ import { TextInput } from '../../molecules'
9
6
 
10
- const LoginRatafiaContent: FC<LoginRatafiaContentProps> = ({ title, email, policy }) => {
7
+ const LoginRatafiaContent: FC<LoginRatafiaContentProps> = ({ title, email }) => {
11
8
  return (
12
9
  <LoginRatafiaContentStyled>
13
10
  <h2 className='login-ratafia-content__title'>{title}</h2>
14
11
  <div className='login-ratafia-content__email'>
15
12
  <TextInput {...email} />
16
13
  </div>
17
- <div className='login-ratafia-content__policy'>
18
- <Checkbox {...policy} />
19
- </div>
20
14
  </LoginRatafiaContentStyled>
21
15
  )
22
16
  }
@@ -1,24 +1,15 @@
1
- import { device } from '../../../globalStyles/breakpoints';
2
1
  import styled from 'styled-components';
3
2
  export const LoginRatafiaPageStyled = styled.div `
4
- display: flex;
5
- flex-direction: column;
6
- align-items: flex-start;
7
- flex: 1 0 0;
8
- align-self: stretch;
9
- gap: 1.5rem;
10
3
  background-color: var(--neutral-neutral-6);
11
4
 
12
- .login-ratafia-page__ctas {
5
+ &__ctas {
13
6
  text-align: center;
14
7
  &__button {
15
8
  display: block;
16
9
  width: 100%;
17
- @media ${device['portrait-tablets']} {
18
- width: 12.5rem;
19
- }
20
10
  margin-bottom: 1rem;
21
11
  }
12
+
22
13
  &__signIn {
23
14
  &__button {
24
15
  background: none;
@@ -1,25 +1,16 @@
1
- import { device } from '../../../globalStyles/breakpoints'
2
1
  import styled from 'styled-components'
3
2
 
4
3
  export const LoginRatafiaPageStyled = styled.div`
5
- display: flex;
6
- flex-direction: column;
7
- align-items: flex-start;
8
- flex: 1 0 0;
9
- align-self: stretch;
10
- gap: 1.5rem;
11
4
  background-color: var(--neutral-neutral-6);
12
5
 
13
- .login-ratafia-page__ctas {
6
+ &__ctas {
14
7
  text-align: center;
15
8
  &__button {
16
9
  display: block;
17
10
  width: 100%;
18
- @media ${device['portrait-tablets']} {
19
- width: 12.5rem;
20
- }
21
11
  margin-bottom: 1rem;
22
12
  }
13
+
23
14
  &__signIn {
24
15
  &__button {
25
16
  background: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "5.16.10",
3
+ "version": "5.17.0",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",