@npm_leadtech/legal-lib-components 7.106.11 → 7.106.17
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/README.md +6 -0
- package/dist/css/styles.css +3 -0
- package/dist/images/componentsSvg/BenefitsAi.d.ts +2 -0
- package/dist/images/componentsSvg/BenefitsAi.js +2 -0
- package/dist/images/componentsSvg/BenefitsAi.tsx +12 -0
- package/dist/images/componentsSvg/BenefitsCheck.d.ts +2 -0
- package/dist/images/componentsSvg/BenefitsCheck.js +2 -0
- package/dist/images/componentsSvg/BenefitsCheck.tsx +10 -0
- package/dist/images/componentsSvg/__tests__/BenefitsAi.test.tsx +18 -0
- package/dist/images/componentsSvg/__tests__/BenefitsCheck.test.tsx +18 -0
- package/dist/src/components/atoms/Button/Button.js +19 -6
- package/dist/src/components/atoms/Button/Button.scss +4 -0
- package/dist/src/components/atoms/Button/Button.tsx +59 -13
- package/dist/src/components/atoms/Button/ButtonProps.types.d.ts +1 -0
- package/dist/src/components/atoms/Button/ButtonProps.types.ts +1 -0
- package/dist/src/components/atoms/Spinner/Spinner.js +1 -1
- package/dist/src/components/atoms/Spinner/Spinner.tsx +9 -2
- package/dist/src/components/molecules/BenefitsCheckout/BenefitsCheckout.js +8 -5
- package/dist/src/components/molecules/BenefitsCheckout/BenefitsCheckout.styled.js +1 -1
- package/dist/src/components/molecules/BenefitsCheckout/BenefitsCheckout.styled.ts +1 -1
- package/dist/src/components/molecules/BenefitsCheckout/BenefitsCheckout.tsx +14 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,3 +51,9 @@ npx sonarqube-scanner -Dsonar.host.url=http://sonar.legal-contracts.com:9000 -Ds
|
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
- Ejecutar en consola `yarn sonar`
|
|
54
|
+
|
|
55
|
+
yarn reinstall-force && yarn build && git add . && git commit -m "checkout" --allow-empty && npm config set tag-version-prefix ''
|
|
56
|
+
npm version patch -m "Update patch version number" && git push && git push --tags
|
|
57
|
+
npm publish
|
|
58
|
+
|
|
59
|
+
yarn upgrade @npm_leadtech/legal-lib-components --latest
|
package/dist/css/styles.css
CHANGED
|
@@ -1039,6 +1039,9 @@ html[data-theme=primarygreen] .e-button.--primary-3 {
|
|
|
1039
1039
|
color: var(--neutral-neutral-1);
|
|
1040
1040
|
pointer-events: none;
|
|
1041
1041
|
}
|
|
1042
|
+
.e-button.--processing {
|
|
1043
|
+
pointer-events: none;
|
|
1044
|
+
}
|
|
1042
1045
|
.e-button.--error {
|
|
1043
1046
|
border-color: var(--error-main);
|
|
1044
1047
|
color: var(--error-main);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const BenefitsAi = () => (_jsx("svg", { width: '18', height: '18', viewBox: '0 0 18 18', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', children: _jsx("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M14.8205 1.28252C14.5643 0.572493 13.5602 0.572493 13.304 1.28252L12.9295 2.32031C12.8481 2.54592 12.6704 2.72356 12.4448 2.80497L11.407 3.17946C10.697 3.43567 10.697 4.43983 11.407 4.69604L12.4448 5.07053C12.6704 5.15194 12.8481 5.32958 12.9295 5.55519L13.304 6.59298C13.5602 7.303 14.5643 7.303 14.8205 6.59298L15.195 5.55519C15.2764 5.32958 15.4541 5.15194 15.6797 5.07053L16.7175 4.69604C17.4275 4.43983 17.4275 3.43567 16.7175 3.17946L15.6797 2.80497C15.4541 2.72356 15.2764 2.54592 15.195 2.32031L14.8205 1.28252ZM9.03846 4.77127C8.52604 3.35122 6.51773 3.35122 6.0053 4.77127L5.15122 7.13813C4.9884 7.58935 4.63312 7.94463 4.1819 8.10745L1.81504 8.96153C0.394985 9.47396 0.394987 11.4823 1.81504 11.9947L4.1819 12.8488C4.63312 13.0116 4.9884 13.3669 5.15122 13.8181L6.0053 16.185C6.51773 17.605 8.52604 17.605 9.03846 16.185L9.89254 13.8181C10.0554 13.3669 10.4107 13.0116 10.8619 12.8488L13.2287 11.9947C14.6488 11.4823 14.6488 9.47396 13.2287 8.96153L10.8619 8.10745C10.4107 7.94463 10.0554 7.58935 9.89254 7.13813L9.03846 4.77127Z', fill: 'var(--primary-main-light-1)' }) }));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { type FC } from 'react'
|
|
2
|
+
|
|
3
|
+
export const BenefitsAi: FC = () => (
|
|
4
|
+
<svg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'>
|
|
5
|
+
<path
|
|
6
|
+
fillRule='evenodd'
|
|
7
|
+
clipRule='evenodd'
|
|
8
|
+
d='M14.8205 1.28252C14.5643 0.572493 13.5602 0.572493 13.304 1.28252L12.9295 2.32031C12.8481 2.54592 12.6704 2.72356 12.4448 2.80497L11.407 3.17946C10.697 3.43567 10.697 4.43983 11.407 4.69604L12.4448 5.07053C12.6704 5.15194 12.8481 5.32958 12.9295 5.55519L13.304 6.59298C13.5602 7.303 14.5643 7.303 14.8205 6.59298L15.195 5.55519C15.2764 5.32958 15.4541 5.15194 15.6797 5.07053L16.7175 4.69604C17.4275 4.43983 17.4275 3.43567 16.7175 3.17946L15.6797 2.80497C15.4541 2.72356 15.2764 2.54592 15.195 2.32031L14.8205 1.28252ZM9.03846 4.77127C8.52604 3.35122 6.51773 3.35122 6.0053 4.77127L5.15122 7.13813C4.9884 7.58935 4.63312 7.94463 4.1819 8.10745L1.81504 8.96153C0.394985 9.47396 0.394987 11.4823 1.81504 11.9947L4.1819 12.8488C4.63312 13.0116 4.9884 13.3669 5.15122 13.8181L6.0053 16.185C6.51773 17.605 8.52604 17.605 9.03846 16.185L9.89254 13.8181C10.0554 13.3669 10.4107 13.0116 10.8619 12.8488L13.2287 11.9947C14.6488 11.4823 14.6488 9.47396 13.2287 8.96153L10.8619 8.10745C10.4107 7.94463 10.0554 7.58935 9.89254 7.13813L9.03846 4.77127Z'
|
|
9
|
+
fill='var(--primary-main-light-1)'
|
|
10
|
+
/>
|
|
11
|
+
</svg>
|
|
12
|
+
)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const BenefitsCheck = () => (_jsx("svg", { width: '18', height: '18', viewBox: '0 0 18 18', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', children: _jsx("path", { d: 'M6.60002 11.925L3.97502 9.29998C3.68508 9.01003 3.21497 9.01003 2.92502 9.29998C2.63507 9.58992 2.63507 10.06 2.92502 10.35L6.40002 13.825C6.51048 13.9354 6.68957 13.9354 6.80002 13.825L15.075 5.54997C15.365 5.26003 15.365 4.78993 15.075 4.49998C14.7851 4.21003 14.315 4.21003 14.025 4.49998L6.60002 11.925Z', fill: 'var(--primary-main-light-1)' }) }));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { type FC } from 'react'
|
|
2
|
+
|
|
3
|
+
export const BenefitsCheck: FC = () => (
|
|
4
|
+
<svg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'>
|
|
5
|
+
<path
|
|
6
|
+
d='M6.60002 11.925L3.97502 9.29998C3.68508 9.01003 3.21497 9.01003 2.92502 9.29998C2.63507 9.58992 2.63507 10.06 2.92502 10.35L6.40002 13.825C6.51048 13.9354 6.68957 13.9354 6.80002 13.825L15.075 5.54997C15.365 5.26003 15.365 4.78993 15.075 4.49998C14.7851 4.21003 14.315 4.21003 14.025 4.49998L6.60002 11.925Z'
|
|
7
|
+
fill='var(--primary-main-light-1)'
|
|
8
|
+
/>
|
|
9
|
+
</svg>
|
|
10
|
+
)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { BenefitsAi } from '../BenefitsAi'
|
|
5
|
+
|
|
6
|
+
describe('BenefitsAi', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders the 18x18 ai icon svg with the themed fill', () => {
|
|
10
|
+
const { container } = render(<BenefitsAi />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '18')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '18')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 18 18')
|
|
16
|
+
expect(svg?.querySelector('path[fill="var(--primary-main-light-1)"]')).toBeInTheDocument()
|
|
17
|
+
})
|
|
18
|
+
})
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cleanup, render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { BenefitsCheck } from '../BenefitsCheck'
|
|
5
|
+
|
|
6
|
+
describe('BenefitsCheck', () => {
|
|
7
|
+
afterEach(cleanup)
|
|
8
|
+
|
|
9
|
+
test('renders the 18x18 check icon svg with the themed fill', () => {
|
|
10
|
+
const { container } = render(<BenefitsCheck />)
|
|
11
|
+
const svg = container.querySelector('svg')
|
|
12
|
+
|
|
13
|
+
expect(svg).toHaveAttribute('width', '18')
|
|
14
|
+
expect(svg).toHaveAttribute('height', '18')
|
|
15
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 18 18')
|
|
16
|
+
expect(svg?.querySelector('path[fill="var(--primary-main-light-1)"]')).toBeInTheDocument()
|
|
17
|
+
})
|
|
18
|
+
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
|
|
3
|
+
import { Spinner } from '../Spinner';
|
|
4
|
+
const Button = ({ label, dataQa, labelMobile, link, LinkComponent = null, noLink = false, noLinkNoFunc = false, onClick = undefined, functionParameters, color = 'primary', error, disabled = false, isProcessing = false, fluid, givenClass, children, size = undefined, isExternal = false, centered = false, gtmTag = undefined, hasNoFollow = false, target = '_self' }) => {
|
|
4
5
|
const sizes = {
|
|
5
6
|
S: 'button--small',
|
|
6
7
|
M: 'button--medium'
|
|
@@ -24,11 +25,14 @@ const Button = ({ label, dataQa, labelMobile, link, LinkComponent = null, noLink
|
|
|
24
25
|
'--styleless': color === 'styleless',
|
|
25
26
|
'--transparent': color === 'transparent',
|
|
26
27
|
'--disabled': disabled,
|
|
28
|
+
'--processing': isProcessing,
|
|
27
29
|
'button--center': centered,
|
|
28
30
|
'--error': error,
|
|
29
31
|
'e-button--fluid': fluid
|
|
30
32
|
});
|
|
31
33
|
const onButtonClick = () => {
|
|
34
|
+
if (isProcessing)
|
|
35
|
+
return;
|
|
32
36
|
if (onClick !== undefined)
|
|
33
37
|
onClick(functionParameters);
|
|
34
38
|
if (gtmTag !== undefined) {
|
|
@@ -40,16 +44,25 @@ const Button = ({ label, dataQa, labelMobile, link, LinkComponent = null, noLink
|
|
|
40
44
|
});
|
|
41
45
|
}
|
|
42
46
|
};
|
|
43
|
-
const
|
|
47
|
+
const onAnchorClick = (event) => {
|
|
48
|
+
if (isProcessing) {
|
|
49
|
+
event?.preventDefault();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
onButtonClick();
|
|
53
|
+
};
|
|
54
|
+
const ariaProcessing = isProcessing || undefined;
|
|
55
|
+
const labelContent = labelMobile !== undefined ? (_jsxs(_Fragment, { children: [_jsx("label", { className: 'e-button-labelMobile', children: labelMobile }), _jsx("label", { className: 'e-button-labelDesktop', children: label })] })) : (_jsx("label", { children: label }));
|
|
56
|
+
const buttonContent = (_jsxs(_Fragment, { children: [isProcessing ? _jsx(Spinner, {}) : null, children && label === '' ? (children) : (_jsxs(_Fragment, { children: [children ?? null, labelContent] }))] }));
|
|
44
57
|
if (isExternal || (!LinkComponent && link)) {
|
|
45
|
-
return (_jsx("a", { className: `e-button ${classnames}`, href: link ?? '', onClick:
|
|
58
|
+
return (_jsx("a", { className: `e-button ${classnames}`, href: link ?? '', onClick: onAnchorClick, "data-qa": dataQa, rel: hasNoFollow ? 'nofollow' : '', target: target, tabIndex: isProcessing ? -1 : undefined, "aria-busy": ariaProcessing, "aria-disabled": ariaProcessing, children: buttonContent }));
|
|
46
59
|
}
|
|
47
60
|
if (noLink) {
|
|
48
|
-
return (_jsx("button", { className: `e-button --noLink ${classnames}`, "data-qa": dataQa, onClick: onButtonClick,
|
|
61
|
+
return (_jsx("button", { className: `e-button --noLink ${classnames}`, "data-qa": dataQa, onClick: onButtonClick, disabled: isProcessing, "aria-busy": ariaProcessing, children: buttonContent }));
|
|
49
62
|
}
|
|
50
63
|
if (noLinkNoFunc) {
|
|
51
|
-
return (_jsx("button", { className: `e-button --noLinkNoFunc ${classnames}`, "data-qa": dataQa,
|
|
64
|
+
return (_jsx("button", { className: `e-button --noLinkNoFunc ${classnames}`, "data-qa": dataQa, disabled: isProcessing, "aria-busy": ariaProcessing, children: buttonContent }));
|
|
52
65
|
}
|
|
53
|
-
return (_jsx(LinkComponent, { className: `e-button ${classnames}`, to: link ?? '', onClick:
|
|
66
|
+
return (_jsx(LinkComponent, { className: `e-button ${classnames}`, to: link ?? '', onClick: onAnchorClick, "data-qa": dataQa, tabIndex: isProcessing ? -1 : undefined, "aria-busy": ariaProcessing, "aria-disabled": ariaProcessing, children: buttonContent }));
|
|
54
67
|
};
|
|
55
68
|
export default Button;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import React, { type FC } from 'react'
|
|
3
3
|
import classNames from 'classnames'
|
|
4
4
|
|
|
5
|
+
import { Spinner } from '../Spinner'
|
|
5
6
|
import { type ButtonProps } from './ButtonProps.types'
|
|
6
7
|
|
|
7
8
|
const Button: FC<ButtonProps> = ({
|
|
@@ -17,6 +18,7 @@ const Button: FC<ButtonProps> = ({
|
|
|
17
18
|
color = 'primary',
|
|
18
19
|
error,
|
|
19
20
|
disabled = false,
|
|
21
|
+
isProcessing = false,
|
|
20
22
|
fluid,
|
|
21
23
|
givenClass,
|
|
22
24
|
children,
|
|
@@ -52,12 +54,14 @@ const Button: FC<ButtonProps> = ({
|
|
|
52
54
|
'--styleless': color === 'styleless',
|
|
53
55
|
'--transparent': color === 'transparent',
|
|
54
56
|
'--disabled': disabled,
|
|
57
|
+
'--processing': isProcessing,
|
|
55
58
|
'button--center': centered,
|
|
56
59
|
'--error': error,
|
|
57
60
|
'e-button--fluid': fluid
|
|
58
61
|
})
|
|
59
62
|
|
|
60
63
|
const onButtonClick = (): void => {
|
|
64
|
+
if (isProcessing) return
|
|
61
65
|
if (onClick !== undefined) onClick(functionParameters)
|
|
62
66
|
if (gtmTag !== undefined) {
|
|
63
67
|
if (typeof window !== 'undefined') {
|
|
@@ -69,16 +73,36 @@ const Button: FC<ButtonProps> = ({
|
|
|
69
73
|
}
|
|
70
74
|
}
|
|
71
75
|
|
|
76
|
+
const onAnchorClick = (event?: React.MouseEvent<HTMLAnchorElement>): void => {
|
|
77
|
+
if (isProcessing) {
|
|
78
|
+
event?.preventDefault()
|
|
79
|
+
return
|
|
80
|
+
}
|
|
81
|
+
onButtonClick()
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const ariaProcessing = isProcessing || undefined
|
|
85
|
+
|
|
86
|
+
const labelContent =
|
|
87
|
+
labelMobile !== undefined ? (
|
|
88
|
+
<>
|
|
89
|
+
<label className='e-button-labelMobile'>{labelMobile}</label>
|
|
90
|
+
<label className='e-button-labelDesktop'>{label}</label>
|
|
91
|
+
</>
|
|
92
|
+
) : (
|
|
93
|
+
<label>{label}</label>
|
|
94
|
+
)
|
|
95
|
+
|
|
72
96
|
const buttonContent = (
|
|
73
97
|
<>
|
|
74
|
-
{
|
|
75
|
-
{
|
|
98
|
+
{isProcessing ? <Spinner /> : null}
|
|
99
|
+
{children && label === '' ? (
|
|
100
|
+
children
|
|
101
|
+
) : (
|
|
76
102
|
<>
|
|
77
|
-
|
|
78
|
-
|
|
103
|
+
{children ?? null}
|
|
104
|
+
{labelContent}
|
|
79
105
|
</>
|
|
80
|
-
) : (
|
|
81
|
-
<label>{label}</label>
|
|
82
106
|
)}
|
|
83
107
|
</>
|
|
84
108
|
)
|
|
@@ -88,34 +112,56 @@ const Button: FC<ButtonProps> = ({
|
|
|
88
112
|
<a
|
|
89
113
|
className={`e-button ${classnames}`}
|
|
90
114
|
href={link ?? ''}
|
|
91
|
-
onClick={
|
|
115
|
+
onClick={onAnchorClick}
|
|
92
116
|
data-qa={dataQa}
|
|
93
117
|
rel={hasNoFollow ? 'nofollow' : ''}
|
|
94
118
|
target={target}
|
|
119
|
+
tabIndex={isProcessing ? -1 : undefined}
|
|
120
|
+
aria-busy={ariaProcessing}
|
|
121
|
+
aria-disabled={ariaProcessing}
|
|
95
122
|
>
|
|
96
|
-
{
|
|
123
|
+
{buttonContent}
|
|
97
124
|
</a>
|
|
98
125
|
)
|
|
99
126
|
}
|
|
100
127
|
|
|
101
128
|
if (noLink) {
|
|
102
129
|
return (
|
|
103
|
-
<button
|
|
104
|
-
{
|
|
130
|
+
<button
|
|
131
|
+
className={`e-button --noLink ${classnames}`}
|
|
132
|
+
data-qa={dataQa}
|
|
133
|
+
onClick={onButtonClick}
|
|
134
|
+
disabled={isProcessing}
|
|
135
|
+
aria-busy={ariaProcessing}
|
|
136
|
+
>
|
|
137
|
+
{buttonContent}
|
|
105
138
|
</button>
|
|
106
139
|
)
|
|
107
140
|
}
|
|
108
141
|
|
|
109
142
|
if (noLinkNoFunc) {
|
|
110
143
|
return (
|
|
111
|
-
<button
|
|
112
|
-
{
|
|
144
|
+
<button
|
|
145
|
+
className={`e-button --noLinkNoFunc ${classnames}`}
|
|
146
|
+
data-qa={dataQa}
|
|
147
|
+
disabled={isProcessing}
|
|
148
|
+
aria-busy={ariaProcessing}
|
|
149
|
+
>
|
|
150
|
+
{buttonContent}
|
|
113
151
|
</button>
|
|
114
152
|
)
|
|
115
153
|
}
|
|
116
154
|
|
|
117
155
|
return (
|
|
118
|
-
<LinkComponent
|
|
156
|
+
<LinkComponent
|
|
157
|
+
className={`e-button ${classnames}`}
|
|
158
|
+
to={link ?? ''}
|
|
159
|
+
onClick={onAnchorClick}
|
|
160
|
+
data-qa={dataQa}
|
|
161
|
+
tabIndex={isProcessing ? -1 : undefined}
|
|
162
|
+
aria-busy={ariaProcessing}
|
|
163
|
+
aria-disabled={ariaProcessing}
|
|
164
|
+
>
|
|
119
165
|
{buttonContent}
|
|
120
166
|
</LinkComponent>
|
|
121
167
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { SpinnerStyled } from './Spinner.styled';
|
|
3
3
|
const Spinner = ({ className = '', big = false }) => {
|
|
4
|
-
return !big ? (_jsx(SpinnerStyled, { className: `e-spinner ${className}`, width: '24', height: '24', viewBox: '0 0 24 24', fill: 'none', children: _jsx("path", { d: 'M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 11.3864 2.49746 10.8889 3.11111 10.8889C3.72476 10.8889 4.22222 11.3864 4.22222 12C4.22222 16.2955 7.70445 19.7778 12 19.7778C16.2955 19.7778 19.7778 16.2955 19.7778 12C19.7778 7.70445 16.2955 4.22222 12 4.22222C11.3864 4.22222 10.8889 3.72476 10.8889 3.11111C10.8889 2.49746 11.3864 2 12 2Z', fill: '#6D7275' }) })) : (_jsx(SpinnerStyled, { className: `e-spinner big ${className}`, viewBox: '0 0 24 24', fill: 'none', children: _jsx("path", { d: 'M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 11.3864 2.49746 10.8889 3.11111 10.8889C3.72476 10.8889 4.22222 11.3864 4.22222 12C4.22222 16.2955 7.70445 19.7778 12 19.7778C16.2955 19.7778 19.7778 16.2955 19.7778 12C19.7778 7.70445 16.2955 4.22222 12 4.22222C11.3864 4.22222 10.8889 3.72476 10.8889 3.11111C10.8889 2.49746 11.3864 2 12 2Z', fill: '#6D7275' }) }));
|
|
4
|
+
return !big ? (_jsx(SpinnerStyled, { className: `e-spinner ${className}`, width: '24', height: '24', viewBox: '0 0 24 24', fill: 'none', "aria-hidden": 'true', children: _jsx("path", { d: 'M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 11.3864 2.49746 10.8889 3.11111 10.8889C3.72476 10.8889 4.22222 11.3864 4.22222 12C4.22222 16.2955 7.70445 19.7778 12 19.7778C16.2955 19.7778 19.7778 16.2955 19.7778 12C19.7778 7.70445 16.2955 4.22222 12 4.22222C11.3864 4.22222 10.8889 3.72476 10.8889 3.11111C10.8889 2.49746 11.3864 2 12 2Z', fill: '#6D7275' }) })) : (_jsx(SpinnerStyled, { className: `e-spinner big ${className}`, viewBox: '0 0 24 24', fill: 'none', "aria-hidden": 'true', children: _jsx("path", { d: 'M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 11.3864 2.49746 10.8889 3.11111 10.8889C3.72476 10.8889 4.22222 11.3864 4.22222 12C4.22222 16.2955 7.70445 19.7778 12 19.7778C16.2955 19.7778 19.7778 16.2955 19.7778 12C19.7778 7.70445 16.2955 4.22222 12 4.22222C11.3864 4.22222 10.8889 3.72476 10.8889 3.11111C10.8889 2.49746 11.3864 2 12 2Z', fill: '#6D7275' }) }));
|
|
5
5
|
};
|
|
6
6
|
export default Spinner;
|
|
@@ -5,14 +5,21 @@ import { SpinnerStyled } from './Spinner.styled'
|
|
|
5
5
|
|
|
6
6
|
const Spinner: FC<SpinnerProps> = ({ className = '', big = false }) => {
|
|
7
7
|
return !big ? (
|
|
8
|
-
<SpinnerStyled
|
|
8
|
+
<SpinnerStyled
|
|
9
|
+
className={`e-spinner ${className}`}
|
|
10
|
+
width='24'
|
|
11
|
+
height='24'
|
|
12
|
+
viewBox='0 0 24 24'
|
|
13
|
+
fill='none'
|
|
14
|
+
aria-hidden='true'
|
|
15
|
+
>
|
|
9
16
|
<path
|
|
10
17
|
d='M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 11.3864 2.49746 10.8889 3.11111 10.8889C3.72476 10.8889 4.22222 11.3864 4.22222 12C4.22222 16.2955 7.70445 19.7778 12 19.7778C16.2955 19.7778 19.7778 16.2955 19.7778 12C19.7778 7.70445 16.2955 4.22222 12 4.22222C11.3864 4.22222 10.8889 3.72476 10.8889 3.11111C10.8889 2.49746 11.3864 2 12 2Z'
|
|
11
18
|
fill='#6D7275'
|
|
12
19
|
/>
|
|
13
20
|
</SpinnerStyled>
|
|
14
21
|
) : (
|
|
15
|
-
<SpinnerStyled className={`e-spinner big ${className}`} viewBox='0 0 24 24' fill='none'>
|
|
22
|
+
<SpinnerStyled className={`e-spinner big ${className}`} viewBox='0 0 24 24' fill='none' aria-hidden='true'>
|
|
16
23
|
<path
|
|
17
24
|
d='M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 11.3864 2.49746 10.8889 3.11111 10.8889C3.72476 10.8889 4.22222 11.3864 4.22222 12C4.22222 16.2955 7.70445 19.7778 12 19.7778C16.2955 19.7778 19.7778 16.2955 19.7778 12C19.7778 7.70445 16.2955 4.22222 12 4.22222C11.3864 4.22222 10.8889 3.72476 10.8889 3.11111C10.8889 2.49746 11.3864 2 12 2Z'
|
|
18
25
|
fill='#6D7275'
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from 'react';
|
|
3
|
+
import { BenefitsAi } from '../../../../images/componentsSvg/BenefitsAi';
|
|
4
|
+
import { BenefitsCheck } from '../../../../images/componentsSvg/BenefitsCheck';
|
|
3
5
|
import { BenefitsCheckoutStyled } from './BenefitsCheckout.styled';
|
|
4
|
-
import aiIcon from '../../../../images/BenefitsCheckout/benefits-ai.svg';
|
|
5
|
-
import checkIcon from '../../../../images/BenefitsCheckout/benefits-check.svg';
|
|
6
6
|
const iconByType = {
|
|
7
|
-
ai:
|
|
8
|
-
check:
|
|
7
|
+
ai: BenefitsAi,
|
|
8
|
+
check: BenefitsCheck
|
|
9
9
|
};
|
|
10
10
|
export const BenefitsCheckout = ({ title, benefits, className }) => {
|
|
11
11
|
const titleId = useId();
|
|
12
|
-
return (_jsxs(BenefitsCheckoutStyled, { className: ['benefits-checkout', className].filter(Boolean).join(' '), "aria-labelledby": titleId, children: [_jsx("h2", { className: 'benefits-checkout__title', id: titleId, children: title }), _jsx("ul", { className: 'benefits-checkout__list', children: benefits.map((benefit, index) =>
|
|
12
|
+
return (_jsxs(BenefitsCheckoutStyled, { className: ['benefits-checkout', className].filter(Boolean).join(' '), "aria-labelledby": titleId, children: [_jsx("h2", { className: 'benefits-checkout__title', id: titleId, children: title }), _jsx("ul", { className: 'benefits-checkout__list', children: benefits.map((benefit, index) => {
|
|
13
|
+
const Icon = iconByType[benefit.icon ?? 'check'];
|
|
14
|
+
return (_jsxs("li", { className: 'benefits-checkout__item', children: [_jsx(Icon, {}), _jsx("span", { children: benefit.text })] }, `${benefit.icon ?? 'check'}-${index}-${benefit.text}`));
|
|
15
|
+
}) })] }));
|
|
13
16
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { type FC, useId } from 'react'
|
|
2
2
|
|
|
3
|
+
import { BenefitsAi } from '../../../../images/componentsSvg/BenefitsAi'
|
|
4
|
+
import { BenefitsCheck } from '../../../../images/componentsSvg/BenefitsCheck'
|
|
3
5
|
import { type BenefitsCheckoutProps } from './BenefitsCheckoutProps.types'
|
|
4
6
|
import { BenefitsCheckoutStyled } from './BenefitsCheckout.styled'
|
|
5
|
-
import aiIcon from '../../../../images/BenefitsCheckout/benefits-ai.svg'
|
|
6
|
-
import checkIcon from '../../../../images/BenefitsCheckout/benefits-check.svg'
|
|
7
7
|
|
|
8
8
|
const iconByType = {
|
|
9
|
-
ai:
|
|
10
|
-
check:
|
|
9
|
+
ai: BenefitsAi,
|
|
10
|
+
check: BenefitsCheck
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const BenefitsCheckout: FC<BenefitsCheckoutProps> = ({ title, benefits, className }) => {
|
|
@@ -22,12 +22,16 @@ export const BenefitsCheckout: FC<BenefitsCheckoutProps> = ({ title, benefits, c
|
|
|
22
22
|
{title}
|
|
23
23
|
</h2>
|
|
24
24
|
<ul className='benefits-checkout__list'>
|
|
25
|
-
{benefits.map((benefit, index) =>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
{benefits.map((benefit, index) => {
|
|
26
|
+
const Icon = iconByType[benefit.icon ?? 'check']
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<li className='benefits-checkout__item' key={`${benefit.icon ?? 'check'}-${index}-${benefit.text}`}>
|
|
30
|
+
<Icon />
|
|
31
|
+
<span>{benefit.text}</span>
|
|
32
|
+
</li>
|
|
33
|
+
)
|
|
34
|
+
})}
|
|
31
35
|
</ul>
|
|
32
36
|
</BenefitsCheckoutStyled>
|
|
33
37
|
)
|