@npm_leadtech/legal-lib-components 7.89.10 → 7.90.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.
- package/dist/css/styles.css +0 -16
- package/dist/images/componentsSvg/ArrowRight.js +1 -1
- package/dist/images/componentsSvg/ArrowRight.tsx +1 -1
- package/dist/images/componentsSvg/CloseIcon.js +1 -1
- package/dist/images/componentsSvg/CloseIcon.tsx +6 -3
- package/dist/images/componentsSvg/Delete24p.tsx +2 -1
- package/dist/images/componentsSvg/Done24px.d.ts +1 -1
- package/dist/images/componentsSvg/Done24px.js +1 -1
- package/dist/images/componentsSvg/Done24px.tsx +7 -4
- package/dist/images/componentsSvg/Edit24p.tsx +1 -1
- package/dist/images/componentsSvg/EditText24px.tsx +1 -1
- package/dist/images/componentsSvg/Eye24pxOptimized.tsx +1 -1
- package/dist/images/componentsSvg/IconDuplicate24px.tsx +1 -1
- package/dist/images/componentsSvg/InfoError24pxOutlined.js +1 -1
- package/dist/images/componentsSvg/InfoError24pxOutlined.tsx +1 -1
- package/dist/images/componentsSvg/MenuCollapse24p.js +1 -1
- package/dist/images/componentsSvg/MenuCollapse24p.tsx +1 -1
- package/dist/images/componentsSvg/NewRelease24p.d.ts +1 -1
- package/dist/images/componentsSvg/NewRelease24p.js +2 -2
- package/dist/images/componentsSvg/NewRelease24p.tsx +19 -4
- package/dist/images/componentsSvg/RatafiaIcon24px.tsx +3 -3
- package/dist/images/componentsSvg/Sign24px.d.ts +2 -2
- package/dist/images/componentsSvg/Sign24px.js +1 -1
- package/dist/images/componentsSvg/Sign24px.tsx +6 -7
- package/dist/images/componentsSvg/Time24px.d.ts +1 -1
- package/dist/images/componentsSvg/Time24px.js +2 -2
- package/dist/images/componentsSvg/Time24px.tsx +26 -8
- package/dist/src/components/atoms/Button/Button.js +1 -1
- package/dist/src/components/atoms/Button/Button.scss +0 -19
- package/dist/src/components/atoms/Button/Button.tsx +1 -1
- package/dist/src/components/atoms/Button/ButtonProps.types.d.ts +1 -1
- package/dist/src/components/atoms/Button/ButtonProps.types.ts +0 -1
- package/dist/src/components/atoms/DocumentStatus/DocumentStatus.js +15 -5
- package/dist/src/components/atoms/DocumentStatus/DocumentStatus.styled.js +40 -41
- package/dist/src/components/atoms/DocumentStatus/DocumentStatus.styled.ts +40 -41
- package/dist/src/components/atoms/DocumentStatus/DocumentStatus.tsx +35 -7
- package/dist/src/components/atoms/DocumentStatus/DocumentStatusProps.types.d.ts +6 -4
- package/dist/src/components/atoms/DocumentStatus/DocumentStatusProps.types.ts +6 -5
- package/dist/src/components/atoms/PreFooter/PreFooter.js +3 -3
- package/dist/src/components/atoms/PreFooter/PreFooter.tsx +2 -2
- package/dist/src/components/atoms/PreFooter/PreFooterProps.d.ts +1 -1
- package/dist/src/components/atoms/PreFooter/PreFooterProps.ts +1 -1
- package/dist/src/components/atoms/Tooltip/Tooltip.js +2 -0
- package/dist/src/components/atoms/Tooltip/Tooltip.tsx +2 -0
- package/dist/src/components/molecules/TextInput/tests/Input.test.tsx +18 -29
- package/dist/src/components/molecules/TextInput/tests/TextInput.test.tsx +9 -16
- package/dist/src/components/molecules/TextInput/tests/TextInputMessage.test.tsx +2 -2
- package/dist/src/components/molecules/TextInput/tests/TextInputTooltip.test.tsx +1 -1
- package/dist/src/components/molecules/index.d.ts +0 -1
- package/dist/src/components/molecules/index.js +0 -1
- package/dist/src/components/molecules/index.ts +0 -1
- package/dist/src/globalStyles/variables.scss +31 -12
- package/dist/src/globalStyles/variablesCss.scss +10 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -5
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItem.d.ts +0 -3
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItem.js +0 -16
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItem.styled.d.ts +0 -1
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItem.styled.js +0 -60
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItem.styled.ts +0 -61
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItem.tsx +0 -28
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItemProps.types.d.ts +0 -6
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItemProps.types.js +0 -1
- package/dist/src/components/atoms/SignerStatusItem/SignerStatusItemProps.types.ts +0 -7
- package/dist/src/components/atoms/SignerStatusItem/index.d.ts +0 -2
- package/dist/src/components/atoms/SignerStatusItem/index.js +0 -1
- package/dist/src/components/atoms/SignerStatusItem/index.ts +0 -2
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContent.d.ts +0 -3
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContent.js +0 -7
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContent.styled.d.ts +0 -1
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContent.styled.js +0 -22
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContent.styled.ts +0 -23
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContent.tsx +0 -38
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContentProps.types.d.ts +0 -9
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContentProps.types.js +0 -1
- package/dist/src/components/molecules/SignersStatusTooltipContent/SignersStatusTooltipContentProps.types.ts +0 -10
- package/dist/src/components/molecules/SignersStatusTooltipContent/index.d.ts +0 -2
- package/dist/src/components/molecules/SignersStatusTooltipContent/index.js +0 -1
- package/dist/src/components/molecules/SignersStatusTooltipContent/index.ts +0 -2
|
@@ -9,13 +9,8 @@ export const DocumentStatusStyled = styled.div `
|
|
|
9
9
|
align-items: center;
|
|
10
10
|
align-self: center;
|
|
11
11
|
padding: 0.125rem 0.5rem 0.125rem 0.25rem;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
background-color: var(--neutral-neutral-4);
|
|
16
|
-
border-color: var(--neutral-neutral-2);
|
|
17
|
-
color: var(--neutral-neutral-1);
|
|
18
|
-
|
|
12
|
+
margin-right: 0.5rem;
|
|
13
|
+
width: 7.36rem;
|
|
19
14
|
@include laptop {
|
|
20
15
|
align-self: flex-start;
|
|
21
16
|
}
|
|
@@ -25,56 +20,60 @@ export const DocumentStatusStyled = styled.div `
|
|
|
25
20
|
}
|
|
26
21
|
|
|
27
22
|
&.document-status {
|
|
28
|
-
& > .document-status__icon > path {
|
|
29
|
-
fill: var(--neutral-neutral-1);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
23
|
span {
|
|
33
24
|
font-weight: bold;
|
|
34
25
|
}
|
|
35
26
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
border-color: var(--neutral-neutral-4);
|
|
39
|
-
color: var(--neutral-neutral-2);
|
|
40
|
-
& > .document-status__icon > path {
|
|
41
|
-
fill: var(--neutral-neutral-2);
|
|
42
|
-
}
|
|
27
|
+
.icon {
|
|
28
|
+
margin-right: 0.25rem;
|
|
43
29
|
}
|
|
44
30
|
|
|
45
|
-
|
|
46
|
-
background-color: var(--
|
|
47
|
-
border-color: var(--
|
|
48
|
-
color: var(--
|
|
49
|
-
|
|
50
|
-
|
|
31
|
+
&.--is-completed {
|
|
32
|
+
background-color: var(--primary-main-light-5);
|
|
33
|
+
border-color: var(--primary-main-light-3);
|
|
34
|
+
color: var(--primary-main);
|
|
35
|
+
|
|
36
|
+
svg {
|
|
37
|
+
path {
|
|
38
|
+
fill: var(--primary-main);
|
|
39
|
+
}
|
|
51
40
|
}
|
|
52
41
|
}
|
|
53
42
|
|
|
54
|
-
|
|
55
|
-
background-color: var(--neutral-neutral-
|
|
56
|
-
border-color: var(--neutral-neutral-
|
|
43
|
+
&.--in-progress {
|
|
44
|
+
background-color: var(--neutral-neutral-5);
|
|
45
|
+
border-color: var(--neutral-neutral-3);
|
|
57
46
|
color: var(--neutral-neutral-1);
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
|
|
48
|
+
svg {
|
|
49
|
+
g > g {
|
|
50
|
+
fill: var(--neutral-neutral-1);
|
|
51
|
+
}
|
|
60
52
|
}
|
|
61
53
|
}
|
|
62
54
|
|
|
63
|
-
|
|
64
|
-
background-color: var(--
|
|
65
|
-
border-color: var(--
|
|
66
|
-
color: var(--
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
&.--is-new {
|
|
56
|
+
background-color: var(--primary-main-light-1);
|
|
57
|
+
border-color: var(--primary-main);
|
|
58
|
+
color: var(--secondary-main-light-4);
|
|
59
|
+
|
|
60
|
+
.icon {
|
|
61
|
+
margin-right: 1.4rem;
|
|
69
62
|
}
|
|
70
63
|
}
|
|
71
64
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
color: var(--primary-main-
|
|
76
|
-
|
|
77
|
-
|
|
65
|
+
&.--is-signed {
|
|
66
|
+
width: fit-content;
|
|
67
|
+
background-color: var(--primary-main-dark-2);
|
|
68
|
+
border-color: var(--primary-main-dark-2);
|
|
69
|
+
color: var(--others-white);
|
|
70
|
+
|
|
71
|
+
svg {
|
|
72
|
+
margin-right: 0.25rem;
|
|
73
|
+
|
|
74
|
+
path {
|
|
75
|
+
fill: var(--others-white);
|
|
76
|
+
}
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
}
|
|
@@ -10,13 +10,8 @@ export const DocumentStatusStyled = styled.div`
|
|
|
10
10
|
align-items: center;
|
|
11
11
|
align-self: center;
|
|
12
12
|
padding: 0.125rem 0.5rem 0.125rem 0.25rem;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
background-color: var(--neutral-neutral-4);
|
|
17
|
-
border-color: var(--neutral-neutral-2);
|
|
18
|
-
color: var(--neutral-neutral-1);
|
|
19
|
-
|
|
13
|
+
margin-right: 0.5rem;
|
|
14
|
+
width: 7.36rem;
|
|
20
15
|
@include laptop {
|
|
21
16
|
align-self: flex-start;
|
|
22
17
|
}
|
|
@@ -26,56 +21,60 @@ export const DocumentStatusStyled = styled.div`
|
|
|
26
21
|
}
|
|
27
22
|
|
|
28
23
|
&.document-status {
|
|
29
|
-
& > .document-status__icon > path {
|
|
30
|
-
fill: var(--neutral-neutral-1);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
24
|
span {
|
|
34
25
|
font-weight: bold;
|
|
35
26
|
}
|
|
36
27
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
border-color: var(--neutral-neutral-4);
|
|
40
|
-
color: var(--neutral-neutral-2);
|
|
41
|
-
& > .document-status__icon > path {
|
|
42
|
-
fill: var(--neutral-neutral-2);
|
|
43
|
-
}
|
|
28
|
+
.icon {
|
|
29
|
+
margin-right: 0.25rem;
|
|
44
30
|
}
|
|
45
31
|
|
|
46
|
-
|
|
47
|
-
background-color: var(--
|
|
48
|
-
border-color: var(--
|
|
49
|
-
color: var(--
|
|
50
|
-
|
|
51
|
-
|
|
32
|
+
&.--is-completed {
|
|
33
|
+
background-color: var(--primary-main-light-5);
|
|
34
|
+
border-color: var(--primary-main-light-3);
|
|
35
|
+
color: var(--primary-main);
|
|
36
|
+
|
|
37
|
+
svg {
|
|
38
|
+
path {
|
|
39
|
+
fill: var(--primary-main);
|
|
40
|
+
}
|
|
52
41
|
}
|
|
53
42
|
}
|
|
54
43
|
|
|
55
|
-
|
|
56
|
-
background-color: var(--neutral-neutral-
|
|
57
|
-
border-color: var(--neutral-neutral-
|
|
44
|
+
&.--in-progress {
|
|
45
|
+
background-color: var(--neutral-neutral-5);
|
|
46
|
+
border-color: var(--neutral-neutral-3);
|
|
58
47
|
color: var(--neutral-neutral-1);
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
|
|
49
|
+
svg {
|
|
50
|
+
g > g {
|
|
51
|
+
fill: var(--neutral-neutral-1);
|
|
52
|
+
}
|
|
61
53
|
}
|
|
62
54
|
}
|
|
63
55
|
|
|
64
|
-
|
|
65
|
-
background-color: var(--
|
|
66
|
-
border-color: var(--
|
|
67
|
-
color: var(--
|
|
68
|
-
|
|
69
|
-
|
|
56
|
+
&.--is-new {
|
|
57
|
+
background-color: var(--primary-main-light-1);
|
|
58
|
+
border-color: var(--primary-main);
|
|
59
|
+
color: var(--secondary-main-light-4);
|
|
60
|
+
|
|
61
|
+
.icon {
|
|
62
|
+
margin-right: 1.4rem;
|
|
70
63
|
}
|
|
71
64
|
}
|
|
72
65
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
color: var(--primary-main-
|
|
77
|
-
|
|
78
|
-
|
|
66
|
+
&.--is-signed {
|
|
67
|
+
width: fit-content;
|
|
68
|
+
background-color: var(--primary-main-dark-2);
|
|
69
|
+
border-color: var(--primary-main-dark-2);
|
|
70
|
+
color: var(--others-white);
|
|
71
|
+
|
|
72
|
+
svg {
|
|
73
|
+
margin-right: 0.25rem;
|
|
74
|
+
|
|
75
|
+
path {
|
|
76
|
+
fill: var(--others-white);
|
|
77
|
+
}
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
80
|
}
|
|
@@ -1,16 +1,44 @@
|
|
|
1
1
|
import React, { type FC } from 'react'
|
|
2
2
|
|
|
3
3
|
import { type DocumentStatusProps } from './DocumentStatusProps.types'
|
|
4
|
-
import { Sign24px } from '../../../../images/componentsSvg/Sign24px'
|
|
5
|
-
|
|
6
4
|
import { DocumentStatusStyled } from './DocumentStatus.styled'
|
|
5
|
+
import { Done24px } from '../../../../images/componentsSvg/Done24px'
|
|
6
|
+
import { NewRelease24p } from '../../../../images/componentsSvg/NewRelease24p'
|
|
7
|
+
import { Sign24px } from '../../../../images/componentsSvg/Sign24px'
|
|
8
|
+
import { Time24px } from '../../../../images/componentsSvg/Time24px'
|
|
7
9
|
|
|
8
|
-
const DocumentStatus: FC<DocumentStatusProps> = ({
|
|
9
|
-
|
|
10
|
+
const DocumentStatus: FC<DocumentStatusProps> = ({
|
|
11
|
+
type,
|
|
12
|
+
statusCompletedText,
|
|
13
|
+
statusNewText,
|
|
14
|
+
statusInProgressText,
|
|
15
|
+
statusSignedText
|
|
16
|
+
}) => {
|
|
17
|
+
if (type === 'complete' || type === 'downloaded' || type === 'pdf_processing' || type === 'pdf_generated') {
|
|
18
|
+
return (
|
|
19
|
+
<DocumentStatusStyled data-testid='document-status' className={'document-status --is-completed'}>
|
|
20
|
+
<Done24px className='icon' /> <span className={'sans-serif --small'}>{statusCompletedText}</span>
|
|
21
|
+
</DocumentStatusStyled>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
if (type === 'new') {
|
|
25
|
+
return (
|
|
26
|
+
<DocumentStatusStyled data-testid='document-status' className={'document-status --is-new'}>
|
|
27
|
+
<NewRelease24p className='icon' /> <span className={'sans-serif --small'}>{statusNewText}</span>
|
|
28
|
+
</DocumentStatusStyled>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
if (type === 'signed') {
|
|
32
|
+
return (
|
|
33
|
+
<DocumentStatusStyled data-testid='document-status' className={'document-status --is-signed'}>
|
|
34
|
+
<Sign24px className='icon' /> <span className={'sans-serif --small'}>{statusSignedText}</span>
|
|
35
|
+
</DocumentStatusStyled>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
10
38
|
return (
|
|
11
|
-
<DocumentStatusStyled data-testid='document-status' className={
|
|
12
|
-
<
|
|
13
|
-
<span className={'sans-serif --small'}>{
|
|
39
|
+
<DocumentStatusStyled data-testid='document-status' className={'document-status --in-progress'}>
|
|
40
|
+
<Time24px className='icon' />
|
|
41
|
+
<span className={'sans-serif --small'}>{statusInProgressText}</span>
|
|
14
42
|
</DocumentStatusStyled>
|
|
15
43
|
)
|
|
16
44
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export interface DocumentStatusProps {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
type: string;
|
|
3
|
+
statusCompletedText: string;
|
|
4
|
+
statusNewText: string;
|
|
5
|
+
statusInProgressText: string;
|
|
6
|
+
statusAIReviewedText: string;
|
|
7
|
+
statusSignedText: string;
|
|
5
8
|
}
|
|
6
|
-
export type DocumentStatusType = 'default' | 'in-progress' | 'awaiting' | 'no-response' | 'declined' | 'signed';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export interface DocumentStatusProps {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
type: string
|
|
3
|
+
statusCompletedText: string
|
|
4
|
+
statusNewText: string
|
|
5
|
+
statusInProgressText: string
|
|
6
|
+
statusAIReviewedText: string
|
|
7
|
+
statusSignedText: string
|
|
5
8
|
}
|
|
6
|
-
|
|
7
|
-
export type DocumentStatusType = 'default' | 'in-progress' | 'awaiting' | 'no-response' | 'declined' | 'signed'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from '../Button';
|
|
3
3
|
import { PreFooterStyled } from './PreFooter.styled';
|
|
4
|
-
export const PreFooter = ({
|
|
5
|
-
return (_jsx(PreFooterStyled, { children: _jsx("div", { className: 'wrapper', children: _jsxs("div", { className: 'prefooter', children: [
|
|
4
|
+
export const PreFooter = ({ siteTitle, content, ctaLabel, ctaOnClick, ctaDataQa, ctaLink }) => {
|
|
5
|
+
return (_jsx(PreFooterStyled, { children: _jsx("div", { className: 'wrapper', children: _jsxs("div", { className: 'prefooter', children: [_jsx("div", { className: 'serif --hero prefooter__title', children: siteTitle }), _jsx("div", { className: 'prefooter__columns', children: content.map((text, index) => {
|
|
6
6
|
return (_jsx("p", { className: 'prefooter__columns__text', children: text }, index));
|
|
7
7
|
}) }), _jsx(Button, { label: ctaLabel, onClick: ctaOnClick, link: ctaLink, dataQa: ctaDataQa, isExternal: true, hasNoFollow: true })] }) }) }));
|
|
8
8
|
};
|
|
@@ -5,7 +5,7 @@ import { PreFooterProps } from './PreFooterProps'
|
|
|
5
5
|
import { PreFooterStyled } from './PreFooter.styled'
|
|
6
6
|
|
|
7
7
|
export const PreFooter: React.FC<PreFooterProps> = ({
|
|
8
|
-
|
|
8
|
+
siteTitle,
|
|
9
9
|
content,
|
|
10
10
|
ctaLabel,
|
|
11
11
|
ctaOnClick,
|
|
@@ -16,7 +16,7 @@ export const PreFooter: React.FC<PreFooterProps> = ({
|
|
|
16
16
|
<PreFooterStyled>
|
|
17
17
|
<div className='wrapper'>
|
|
18
18
|
<div className='prefooter'>
|
|
19
|
-
<div className='serif --hero prefooter__title'>
|
|
19
|
+
<div className='serif --hero prefooter__title'>{siteTitle}</div>
|
|
20
20
|
<div className='prefooter__columns'>
|
|
21
21
|
{content.map((text, index) => {
|
|
22
22
|
return (
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Tippy from '@tippyjs/react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
+
// import 'tippy.js/dist/tippy.css'
|
|
5
|
+
// import './Tooltip.scss'
|
|
4
6
|
const Tooltip = ({ children, position = 'top', inverted, trigger = 'hover', ...rest }) => {
|
|
5
7
|
if (children === undefined)
|
|
6
8
|
return null;
|
|
@@ -3,6 +3,8 @@ import Tippy from '@tippyjs/react'
|
|
|
3
3
|
import classNames from 'classnames'
|
|
4
4
|
|
|
5
5
|
import { type TooltipProps } from './TooltipProps.types'
|
|
6
|
+
// import 'tippy.js/dist/tippy.css'
|
|
7
|
+
// import './Tooltip.scss'
|
|
6
8
|
|
|
7
9
|
const Tooltip: FC<TooltipProps> = ({ children, position = 'top', inverted, trigger = 'hover', ...rest }) => {
|
|
8
10
|
if (children === undefined) return null
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { cleanup, fireEvent, render, waitFor } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
2
3
|
|
|
3
4
|
import { Input } from '../Input'
|
|
4
5
|
|
|
@@ -7,50 +8,38 @@ afterEach(cleanup)
|
|
|
7
8
|
const testName = 'name'
|
|
8
9
|
const testValue = 'value'
|
|
9
10
|
|
|
10
|
-
const defaultInputProps = {
|
|
11
|
-
name: '',
|
|
12
|
-
placeholder: '',
|
|
13
|
-
prefix: '',
|
|
14
|
-
value: '',
|
|
15
|
-
type: 'text' as const,
|
|
16
|
-
disabled: false,
|
|
17
|
-
className: '',
|
|
18
|
-
onChange: jest.fn(),
|
|
19
|
-
onClick: jest.fn(),
|
|
20
|
-
onBlur: jest.fn(),
|
|
21
|
-
onKeyDown: jest.fn(),
|
|
22
|
-
onKeyUp: jest.fn(),
|
|
23
|
-
country: ''
|
|
24
|
-
}
|
|
25
|
-
|
|
26
11
|
describe('will return the component', () => {
|
|
27
12
|
test('without props', () => {
|
|
28
|
-
const { getByRole } = render(<Input
|
|
13
|
+
const { getByRole } = render(<Input />)
|
|
29
14
|
expect(getByRole('textbox')).toBeInTheDocument()
|
|
30
15
|
expect(getByRole('textbox')).toHaveAttribute('type', 'text')
|
|
31
16
|
})
|
|
32
17
|
test('of type password: with the eyeIcon rendered', async () => {
|
|
33
|
-
const { container } = render(<Input
|
|
18
|
+
const { container, getByRole } = render(<Input type='password' value={testValue} />)
|
|
34
19
|
expect(container.firstChild).toHaveAttribute('type', 'password')
|
|
35
20
|
|
|
36
|
-
const
|
|
37
|
-
expect(
|
|
38
|
-
|
|
21
|
+
const img = getByRole('img')
|
|
22
|
+
expect(img).toHaveClass('input-icon-password')
|
|
23
|
+
fireEvent.click(img)
|
|
39
24
|
|
|
40
25
|
await waitFor(() => {
|
|
41
26
|
expect(container.firstChild).toHaveAttribute('type', 'text')
|
|
42
27
|
})
|
|
43
28
|
})
|
|
44
|
-
test('of type password: with the eyeIcon rendered but
|
|
45
|
-
const { container } = render(<Input
|
|
46
|
-
|
|
47
|
-
|
|
29
|
+
test('of type password: with the eyeIcon rendered but is not enabled without value', async () => {
|
|
30
|
+
const { container, getByRole } = render(<Input type='password' />)
|
|
31
|
+
expect(container.firstChild).toHaveAttribute('type', 'password')
|
|
32
|
+
|
|
33
|
+
const img = getByRole('img')
|
|
34
|
+
expect(img).toHaveClass('input-icon-password')
|
|
35
|
+
fireEvent.click(img)
|
|
48
36
|
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
await waitFor(() => {
|
|
38
|
+
expect(container.firstChild).toHaveAttribute('type', 'password')
|
|
39
|
+
})
|
|
51
40
|
})
|
|
52
41
|
test('of type password: with the eyeIcon rendered', () => {
|
|
53
|
-
const { container } = render(<Input
|
|
42
|
+
const { container } = render(<Input name={testName} />)
|
|
54
43
|
expect(container.firstChild).toHaveAttribute('data-qa', testName)
|
|
55
44
|
})
|
|
56
45
|
})
|
|
@@ -11,50 +11,43 @@ const testErrorMessage = 'Error message'
|
|
|
11
11
|
const testLabel = 'Label'
|
|
12
12
|
const testNotes = 'Notes'
|
|
13
13
|
|
|
14
|
-
const defaultTextInputProps = {
|
|
15
|
-
onChange: (): void => {},
|
|
16
|
-
country: ''
|
|
17
|
-
}
|
|
18
|
-
|
|
19
14
|
describe('will return the component', () => {
|
|
20
15
|
test('without props', () => {
|
|
21
|
-
const { getByRole, container } = render(<TextInput
|
|
16
|
+
const { getByRole, container } = render(<TextInput />)
|
|
22
17
|
expect(container.firstChild).toHaveClass('e-text')
|
|
23
18
|
expect(getByRole('textbox')).toHaveAttribute('type', 'text')
|
|
24
19
|
})
|
|
25
20
|
|
|
26
21
|
test('NumberFormat input if the format prop is passed', () => {
|
|
27
|
-
const { getByRole } = render(<TextInput
|
|
22
|
+
const { getByRole } = render(<TextInput format={testFormat} />)
|
|
28
23
|
expect(getByRole('textbox')).toHaveClass('e-text-input')
|
|
29
24
|
expect(getByRole('textbox')).toHaveAttribute('type', 'text')
|
|
30
25
|
expect(getByRole('textbox')).toHaveAttribute('inputmode', 'numeric')
|
|
31
26
|
})
|
|
32
27
|
|
|
33
28
|
test('with a tooltip', () => {
|
|
34
|
-
const { getByText } = render(<TextInput
|
|
29
|
+
const { getByText } = render(<TextInput tooltip={testTooltip} />)
|
|
35
30
|
expect(getByText(testTooltip)).toHaveClass('tooltip-form')
|
|
36
31
|
})
|
|
37
32
|
|
|
38
33
|
test('with a error message', () => {
|
|
39
|
-
const { getByText } = render(
|
|
40
|
-
<TextInput {...defaultTextInputProps} errorMessage={testErrorMessage} validate={false} />
|
|
41
|
-
)
|
|
34
|
+
const { getByText } = render(<TextInput errorMessage={testErrorMessage} validate={false} />)
|
|
42
35
|
expect(getByText(testErrorMessage)).toHaveClass('e-text__error-label')
|
|
43
36
|
})
|
|
44
37
|
|
|
45
38
|
test('with a label', () => {
|
|
46
|
-
const { getByText } = render(<TextInput
|
|
39
|
+
const { getByText } = render(<TextInput label={testLabel} />)
|
|
47
40
|
expect(getByText(testLabel)).toHaveClass('form-group__label')
|
|
48
41
|
})
|
|
49
42
|
|
|
50
43
|
test('with notes', () => {
|
|
51
|
-
const { getByText } = render(<TextInput
|
|
44
|
+
const { getByText } = render(<TextInput notes={testNotes} />)
|
|
52
45
|
expect(getByText(testNotes)).toHaveClass('e-text__inner__notes')
|
|
53
46
|
})
|
|
54
47
|
|
|
55
48
|
test('should have children', () => {
|
|
56
49
|
const { getByText } = render(
|
|
57
|
-
<TextInput
|
|
50
|
+
<TextInput>
|
|
58
51
|
<span>test children</span>
|
|
59
52
|
</TextInput>
|
|
60
53
|
)
|
|
@@ -62,10 +55,10 @@ describe('will return the component', () => {
|
|
|
62
55
|
})
|
|
63
56
|
|
|
64
57
|
test('should have id in input and for in label', () => {
|
|
65
|
-
const { getByText, getByLabelText } = render(<TextInput
|
|
58
|
+
const { getByText, getByLabelText } = render(<TextInput name='cvv' label='CVV' />)
|
|
66
59
|
|
|
67
60
|
const label = getByText('CVV')
|
|
68
|
-
const input = getByLabelText('CVV')
|
|
61
|
+
const input = getByLabelText('CVV')
|
|
69
62
|
|
|
70
63
|
expect(label).toBeDefined()
|
|
71
64
|
expect(label).toHaveAttribute('for', 'cvv')
|
|
@@ -9,11 +9,11 @@ const testErrorMessage = 'Error message'
|
|
|
9
9
|
|
|
10
10
|
describe('will return null', () => {
|
|
11
11
|
test('if no prop is passed', () => {
|
|
12
|
-
const { container } = render(<TextInputMessage
|
|
12
|
+
const { container } = render(<TextInputMessage />)
|
|
13
13
|
expect(container.firstChild).toBe(null)
|
|
14
14
|
})
|
|
15
15
|
test('if errorMessage is passed and validate is true', () => {
|
|
16
|
-
const { container } = render(<TextInputMessage errorMessage={testErrorMessage}
|
|
16
|
+
const { container } = render(<TextInputMessage errorMessage={testErrorMessage} />)
|
|
17
17
|
expect(container.firstChild).toBe(null)
|
|
18
18
|
})
|
|
19
19
|
})
|
|
@@ -9,7 +9,7 @@ const testTooltip = 'Tooltip'
|
|
|
9
9
|
|
|
10
10
|
describe('will return null', () => {
|
|
11
11
|
test('if no prop is passed', () => {
|
|
12
|
-
const { container } = render(<TextInputTooltip
|
|
12
|
+
const { container } = render(<TextInputTooltip />)
|
|
13
13
|
expect(container.firstChild).toBe(null)
|
|
14
14
|
})
|
|
15
15
|
})
|
|
@@ -43,7 +43,6 @@ export * from './RatafiaResultCardList';
|
|
|
43
43
|
export * from './RatafiaResultTabList';
|
|
44
44
|
export * from './SocialLinks';
|
|
45
45
|
export * from './SubscriptionCard';
|
|
46
|
-
export * from './SignersStatusTooltipContent';
|
|
47
46
|
export * from './Snackbar';
|
|
48
47
|
export * from './SearchBar';
|
|
49
48
|
export * from './StepGetForm';
|
|
@@ -43,7 +43,6 @@ export * from './RatafiaResultCardList';
|
|
|
43
43
|
export * from './RatafiaResultTabList';
|
|
44
44
|
export * from './SocialLinks';
|
|
45
45
|
export * from './SubscriptionCard';
|
|
46
|
-
export * from './SignersStatusTooltipContent';
|
|
47
46
|
export * from './Snackbar';
|
|
48
47
|
export * from './SearchBar';
|
|
49
48
|
export * from './StepGetForm';
|
|
@@ -43,7 +43,6 @@ export * from './RatafiaResultCardList'
|
|
|
43
43
|
export * from './RatafiaResultTabList'
|
|
44
44
|
export * from './SocialLinks'
|
|
45
45
|
export * from './SubscriptionCard'
|
|
46
|
-
export * from './SignersStatusTooltipContent'
|
|
47
46
|
export * from './Snackbar'
|
|
48
47
|
export * from './SearchBar'
|
|
49
48
|
export * from './StepGetForm'
|