@npm_leadtech/legal-lib-components 7.60.0 → 7.61.1
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 +17 -0
- package/dist/src/components/atoms/FeatureItem/FeatureItem.d.ts +3 -0
- package/dist/src/components/atoms/FeatureItem/FeatureItem.js +5 -0
- package/dist/src/components/atoms/FeatureItem/FeatureItem.styled.d.ts +1 -0
- package/dist/src/components/atoms/FeatureItem/FeatureItem.styled.js +18 -0
- package/dist/src/components/atoms/FeatureItem/FeatureItem.styled.ts +19 -0
- package/dist/src/components/atoms/FeatureItem/FeatureItem.tsx +12 -0
- package/dist/src/components/atoms/FeatureItem/FeatureItemProps.d.ts +9 -0
- package/dist/src/components/atoms/FeatureItem/FeatureItemProps.js +1 -0
- package/dist/src/components/atoms/FeatureItem/FeatureItemProps.ts +10 -0
- package/dist/src/components/atoms/FeatureItem/index.d.ts +2 -0
- package/dist/src/components/atoms/FeatureItem/index.js +2 -0
- package/dist/src/components/atoms/FeatureItem/index.ts +2 -0
- package/dist/src/components/atoms/PlanCard/PlanCard.d.ts +3 -0
- package/dist/src/components/atoms/PlanCard/PlanCard.js +6 -0
- package/dist/src/components/atoms/PlanCard/PlanCard.styled.d.ts +8 -0
- package/dist/src/components/atoms/PlanCard/PlanCard.styled.js +75 -0
- package/dist/src/components/atoms/PlanCard/PlanCard.styled.ts +83 -0
- package/dist/src/components/atoms/PlanCard/PlanCard.tsx +42 -0
- package/dist/src/components/atoms/PlanCard/PlanCardProps.d.ts +23 -0
- package/dist/src/components/atoms/PlanCard/PlanCardProps.js +1 -0
- package/dist/src/components/atoms/PlanCard/PlanCardProps.ts +26 -0
- package/dist/src/components/atoms/PlanCard/index.d.ts +2 -0
- package/dist/src/components/atoms/PlanCard/index.js +2 -0
- package/dist/src/components/atoms/PlanCard/index.ts +2 -0
- package/dist/src/components/atoms/index.d.ts +2 -0
- package/dist/src/components/atoms/index.js +2 -0
- package/dist/src/components/atoms/index.ts +2 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.d.ts +3 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.js +8 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.styled.d.ts +16 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.styled.js +87 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.styled.ts +106 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.tsx +64 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPageProps.d.ts +7 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPageProps.js +1 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPageProps.ts +8 -0
- package/dist/src/components/pages/PricingPlansPage/index.d.ts +2 -0
- package/dist/src/components/pages/PricingPlansPage/index.js +2 -0
- package/dist/src/components/pages/PricingPlansPage/index.ts +2 -0
- package/dist/src/components/pages/index.d.ts +1 -0
- package/dist/src/components/pages/index.js +1 -0
- package/dist/src/components/pages/index.ts +1 -0
- package/dist/src/globalStyles/themes.scss +18 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -1
package/dist/css/styles.css
CHANGED
|
@@ -532,6 +532,23 @@ html[data-theme=lawdistrictonline] {
|
|
|
532
532
|
--others-black: #000;
|
|
533
533
|
}
|
|
534
534
|
html[data-theme=legalfinity] {
|
|
535
|
+
--button: #1039f5;
|
|
536
|
+
--button-secondary: #1039f5;
|
|
537
|
+
--button-hover: #3970ff;
|
|
538
|
+
--button-tertiary: #3970ff;
|
|
539
|
+
--button-2: #07144b;
|
|
540
|
+
--button-4: #07144b;
|
|
541
|
+
--button-2-hover: #163399;
|
|
542
|
+
--button-4-hover: #163399;
|
|
543
|
+
--snackbar-success-color: #163399;
|
|
544
|
+
--button-4-color: #e9f5ff;
|
|
545
|
+
--button-secondary-hover: #d7ecff;
|
|
546
|
+
--feeback-success: #d7ecff;
|
|
547
|
+
--button-tertiary-hover: #b7daff;
|
|
548
|
+
--snackbar-success-bg: #8bc1ff;
|
|
549
|
+
--snackbar-success-border: #5e99ff;
|
|
550
|
+
--snackbar-reminder-bg: #f98116;
|
|
551
|
+
--snackbar-reminder-border: #ea660c;
|
|
535
552
|
--primary-main-light-6: #e9f5ff;
|
|
536
553
|
--primary-main-light-5: #d7ecff;
|
|
537
554
|
--primary-main-light-4: #b7daff;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FeatureCard } from './FeatureItem.styled';
|
|
3
|
+
export const FeatureItem = ({ feature }) => {
|
|
4
|
+
return (_jsxs(FeatureCard, { children: [_jsx("img", { src: feature?.icon?.url, alt: 'Feature Icon', width: 16, height: 16 }), _jsx("span", { children: feature?.description })] }));
|
|
5
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FeatureCard: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, never>> & string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
export const FeatureCard = styled.li `
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
flex: 1;
|
|
6
|
+
padding: 1rem 0.5rem 1rem 1rem;
|
|
7
|
+
border-radius: 1rem;
|
|
8
|
+
background-color: white;
|
|
9
|
+
|
|
10
|
+
img {
|
|
11
|
+
margin-bottom: 0.5rem;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
span {
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
font-weight: 400;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import styled from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const FeatureCard = styled.li`
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
flex: 1;
|
|
7
|
+
padding: 1rem 0.5rem 1rem 1rem;
|
|
8
|
+
border-radius: 1rem;
|
|
9
|
+
background-color: white;
|
|
10
|
+
|
|
11
|
+
img {
|
|
12
|
+
margin-bottom: 0.5rem;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
span {
|
|
16
|
+
font-size: 14px;
|
|
17
|
+
font-weight: 400;
|
|
18
|
+
}
|
|
19
|
+
`
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FeatureCard } from './FeatureItem.styled'
|
|
2
|
+
import { FeatureItemProps } from './FeatureItemProps'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
export const FeatureItem: React.FC<FeatureItemProps> = ({ feature }) => {
|
|
6
|
+
return (
|
|
7
|
+
<FeatureCard>
|
|
8
|
+
<img src={feature?.icon?.url} alt='Feature Icon' width={16} height={16} />
|
|
9
|
+
<span>{feature?.description}</span>
|
|
10
|
+
</FeatureCard>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Benefit, BenefitsList, Divider, PlanCardContainer, PlanTitle, Price, PriceLabel, PricingInfo } from './PlanCard.styled';
|
|
3
|
+
import { Button } from '../Button';
|
|
4
|
+
export const PlanCard = ({ plan, onSelect }) => {
|
|
5
|
+
return (_jsxs(PlanCardContainer, { children: [_jsx(PlanTitle, { className: plan?.highlightPlan ? 'highlight' : 'asdfasdf', children: plan?.subscription_type?.name }), _jsxs(PricingInfo, { children: [_jsx(Price, { children: plan?.pricing }), _jsx(PriceLabel, { children: plan?.pricingLabel })] }), _jsx(Button, { label: plan?.buttonText ?? '', dataQa: `${plan?.subscription_type?.name.replaceAll(' ', '')}-button`, noLink: true, onClick: () => onSelect?.(plan?.subscription_type?.sku ?? ''), givenClass: 'pricing-plan__button', color: plan?.highlightPlan ? 'primary' : 'transparent' }), _jsx(Divider, {}), _jsx(BenefitsList, { children: plan?.benefits?.map((item) => (_jsxs(Benefit, { className: item?.type == 'default' ? 'default' : 'ai-benefit', children: [item?.icon, _jsx("p", { dangerouslySetInnerHTML: { __html: item?.benefit } })] }, item?.benefit))) })] }));
|
|
6
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const PlanCardContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
export declare const PlanTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
3
|
+
export declare const PricingInfo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
export declare const Price: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
|
|
5
|
+
export declare const PriceLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
6
|
+
export declare const Divider: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHRElement>, HTMLHRElement>, never>> & string;
|
|
7
|
+
export declare const BenefitsList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, never>> & string;
|
|
8
|
+
export declare const Benefit: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, never>> & string;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
export const PlanCardContainer = styled.div `
|
|
3
|
+
text-align: center;
|
|
4
|
+
gap: 2rem;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
padding: 1.5rem;
|
|
11
|
+
|
|
12
|
+
.pricing-plan__button {
|
|
13
|
+
width: 100%;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
export const PlanTitle = styled.span `
|
|
17
|
+
border-radius: 8px;
|
|
18
|
+
padding: 0.5rem 1rem;
|
|
19
|
+
background-color: var(--neutral-neutral-4);
|
|
20
|
+
font-size: large;
|
|
21
|
+
font-weight: 700;
|
|
22
|
+
&.highlight {
|
|
23
|
+
background-color: var(--primary-main-light-4);
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
export const PricingInfo = styled.div `
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
align-items: center;
|
|
30
|
+
`;
|
|
31
|
+
export const Price = styled.h4 `
|
|
32
|
+
font-size: 36px;
|
|
33
|
+
font-weight: 700;
|
|
34
|
+
margin: 0 0 -0.5rem 0;
|
|
35
|
+
`;
|
|
36
|
+
export const PriceLabel = styled.span `
|
|
37
|
+
font-size: 14px;
|
|
38
|
+
`;
|
|
39
|
+
export const Divider = styled.hr `
|
|
40
|
+
border: 1px solid black;
|
|
41
|
+
width: 100%;
|
|
42
|
+
`;
|
|
43
|
+
export const BenefitsList = styled.ul `
|
|
44
|
+
list-style: none;
|
|
45
|
+
padding: 0;
|
|
46
|
+
margin: 0;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
gap: 0.5rem;
|
|
50
|
+
`;
|
|
51
|
+
export const Benefit = styled.li `
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: start;
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
padding: 0 1rem;
|
|
56
|
+
|
|
57
|
+
&.ai-benefit {
|
|
58
|
+
background-color: var(--primary-main-light-5);
|
|
59
|
+
padding: 1rem;
|
|
60
|
+
border-radius: 0.5rem;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
p {
|
|
64
|
+
text-align: left;
|
|
65
|
+
font-size: 14px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
svg {
|
|
69
|
+
flex-shrink: 0;
|
|
70
|
+
width: 16px;
|
|
71
|
+
height: 16px;
|
|
72
|
+
margin-top: 0.3rem;
|
|
73
|
+
margin-right: 0.5rem;
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import styled from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const PlanCardContainer = styled.div`
|
|
4
|
+
text-align: center;
|
|
5
|
+
gap: 2rem;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
padding: 1.5rem;
|
|
12
|
+
|
|
13
|
+
.pricing-plan__button {
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|
|
16
|
+
`
|
|
17
|
+
|
|
18
|
+
export const PlanTitle = styled.span`
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
padding: 0.5rem 1rem;
|
|
21
|
+
background-color: var(--neutral-neutral-4);
|
|
22
|
+
font-size: large;
|
|
23
|
+
font-weight: 700;
|
|
24
|
+
&.highlight {
|
|
25
|
+
background-color: var(--primary-main-light-4);
|
|
26
|
+
}
|
|
27
|
+
`
|
|
28
|
+
|
|
29
|
+
export const PricingInfo = styled.div`
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
align-items: center;
|
|
33
|
+
`
|
|
34
|
+
|
|
35
|
+
export const Price = styled.h4`
|
|
36
|
+
font-size: 36px;
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
margin: 0 0 -0.5rem 0;
|
|
39
|
+
`
|
|
40
|
+
|
|
41
|
+
export const PriceLabel = styled.span`
|
|
42
|
+
font-size: 14px;
|
|
43
|
+
`
|
|
44
|
+
|
|
45
|
+
export const Divider = styled.hr`
|
|
46
|
+
border: 1px solid black;
|
|
47
|
+
width: 100%;
|
|
48
|
+
`
|
|
49
|
+
|
|
50
|
+
export const BenefitsList = styled.ul`
|
|
51
|
+
list-style: none;
|
|
52
|
+
padding: 0;
|
|
53
|
+
margin: 0;
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
gap: 0.5rem;
|
|
57
|
+
`
|
|
58
|
+
|
|
59
|
+
export const Benefit = styled.li`
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: start;
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
padding: 0 1rem;
|
|
64
|
+
|
|
65
|
+
&.ai-benefit {
|
|
66
|
+
background-color: var(--primary-main-light-5);
|
|
67
|
+
padding: 1rem;
|
|
68
|
+
border-radius: 0.5rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
p {
|
|
72
|
+
text-align: left;
|
|
73
|
+
font-size: 14px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
svg {
|
|
77
|
+
flex-shrink: 0;
|
|
78
|
+
width: 16px;
|
|
79
|
+
height: 16px;
|
|
80
|
+
margin-top: 0.3rem;
|
|
81
|
+
margin-right: 0.5rem;
|
|
82
|
+
}
|
|
83
|
+
`
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Benefit,
|
|
3
|
+
BenefitsList,
|
|
4
|
+
Divider,
|
|
5
|
+
PlanCardContainer,
|
|
6
|
+
PlanTitle,
|
|
7
|
+
Price,
|
|
8
|
+
PriceLabel,
|
|
9
|
+
PricingInfo
|
|
10
|
+
} from './PlanCard.styled'
|
|
11
|
+
import { Button } from '../Button'
|
|
12
|
+
import { PlanCardProps } from './PlanCardProps'
|
|
13
|
+
import React from 'react'
|
|
14
|
+
|
|
15
|
+
export const PlanCard: React.FC<PlanCardProps> = ({ plan, onSelect }) => {
|
|
16
|
+
return (
|
|
17
|
+
<PlanCardContainer>
|
|
18
|
+
<PlanTitle className={plan?.highlightPlan ? 'highlight' : 'asdfasdf'}>{plan?.subscription_type?.name}</PlanTitle>
|
|
19
|
+
<PricingInfo>
|
|
20
|
+
<Price>{plan?.pricing}</Price>
|
|
21
|
+
<PriceLabel>{plan?.pricingLabel}</PriceLabel>
|
|
22
|
+
</PricingInfo>
|
|
23
|
+
<Button
|
|
24
|
+
label={plan?.buttonText ?? ''}
|
|
25
|
+
dataQa={`${plan?.subscription_type?.name.replaceAll(' ', '')}-button`}
|
|
26
|
+
noLink
|
|
27
|
+
onClick={() => onSelect?.(plan?.subscription_type?.sku ?? '')}
|
|
28
|
+
givenClass='pricing-plan__button'
|
|
29
|
+
color={plan?.highlightPlan ? 'primary' : 'transparent'}
|
|
30
|
+
/>
|
|
31
|
+
<Divider />
|
|
32
|
+
<BenefitsList>
|
|
33
|
+
{plan?.benefits?.map((item) => (
|
|
34
|
+
<Benefit key={item?.benefit} className={item?.type == 'default' ? 'default' : 'ai-benefit'}>
|
|
35
|
+
{item?.icon}
|
|
36
|
+
<p dangerouslySetInnerHTML={{ __html: item?.benefit }}></p>
|
|
37
|
+
</Benefit>
|
|
38
|
+
))}
|
|
39
|
+
</BenefitsList>
|
|
40
|
+
</PlanCardContainer>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface PlanCardProps {
|
|
3
|
+
plan: SubscriptionPlan;
|
|
4
|
+
onSelect?: (sku: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export interface SubscriptionPlan {
|
|
7
|
+
benefits?: Benefit[];
|
|
8
|
+
pricing?: string;
|
|
9
|
+
pricingLabel?: string;
|
|
10
|
+
buttonText?: string;
|
|
11
|
+
highlightPlan?: boolean;
|
|
12
|
+
subscription_type?: SubscriptionType;
|
|
13
|
+
}
|
|
14
|
+
interface Benefit {
|
|
15
|
+
type: 'default' | 'lawgenius';
|
|
16
|
+
benefit: string;
|
|
17
|
+
icon: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
interface SubscriptionType {
|
|
20
|
+
name: string;
|
|
21
|
+
sku: string;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react'
|
|
2
|
+
|
|
3
|
+
export interface PlanCardProps {
|
|
4
|
+
plan: SubscriptionPlan
|
|
5
|
+
onSelect?: (sku: string) => void
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface SubscriptionPlan {
|
|
9
|
+
benefits?: Benefit[]
|
|
10
|
+
pricing?: string
|
|
11
|
+
pricingLabel?: string
|
|
12
|
+
buttonText?: string
|
|
13
|
+
highlightPlan?: boolean
|
|
14
|
+
subscription_type?: SubscriptionType
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface Benefit {
|
|
18
|
+
type: 'default' | 'lawgenius'
|
|
19
|
+
benefit: string
|
|
20
|
+
icon: ReactNode
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface SubscriptionType {
|
|
24
|
+
name: string
|
|
25
|
+
sku: string
|
|
26
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { FeatureItem, PlanCard } from '../../atoms';
|
|
3
|
+
import { FeaturesGrid, FeaturesSection, PlanSelector, PlanWrapper, PlansWrapper, PricingContainerStyled, SelectorButton } from './PricingPlansPage.styled';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export const PricingPlansPage = ({ subscriptionPlans, features, onPlanSelect, header }) => {
|
|
6
|
+
const [activePlanIndex, setActivePlanIndex] = React.useState(0);
|
|
7
|
+
return (_jsxs(_Fragment, { children: [header, subscriptionPlans?.length > 0 && (_jsxs(PricingContainerStyled, { children: [_jsx(PlanSelector, { children: subscriptionPlans.map((plan, index) => (_jsx(SelectorButton, { isActive: index === activePlanIndex, onClick: () => setActivePlanIndex(index), dataQa: `selector-${plan.subscription_type?.name.replaceAll(' ', '')}`, children: plan?.subscription_type?.name }, `selector-${plan?.pricingLabel}`))) }), _jsx(PlansWrapper, { children: subscriptionPlans.map((plan, index) => (_jsx(PlanWrapper, { isHighlighted: plan.highlightPlan, isActive: index === activePlanIndex, className: `pricing-plan__element-container ${plan?.highlightPlan ? 'highlight' : ''} ${index === activePlanIndex ? 'active' : ''}`, children: _jsx(PlanCard, { onSelect: onPlanSelect ?? (() => { }), plan: plan }) }, plan.pricingLabel))) }), features && features.length > 0 && (_jsx(FeaturesSection, { children: _jsx(FeaturesGrid, { children: features.map((feature) => (_jsx(FeatureItem, { feature: feature }, feature.description))) }) }))] }))] }));
|
|
8
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type PlanWrapperProps = {
|
|
2
|
+
isActive: boolean;
|
|
3
|
+
isHighlighted?: boolean;
|
|
4
|
+
};
|
|
5
|
+
type SelectorButton = {
|
|
6
|
+
isActive: boolean;
|
|
7
|
+
dataQa: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const PricingContainerStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
10
|
+
export declare const PlanSelector: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
11
|
+
export declare const SelectorButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, SelectorButton>> & string;
|
|
12
|
+
export declare const PlansWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
13
|
+
export declare const PlanWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, PlanWrapperProps>> & string;
|
|
14
|
+
export declare const FeaturesSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
15
|
+
export declare const FeaturesGrid: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, never>> & string;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
export const PricingContainerStyled = styled.section `
|
|
3
|
+
margin: 0 auto 0 auto;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
align-items: center;
|
|
8
|
+
max-width: 996px;
|
|
9
|
+
gap: 1.5rem;
|
|
10
|
+
margin-bottom: 3rem;
|
|
11
|
+
padding: 0 1.5rem;
|
|
12
|
+
`;
|
|
13
|
+
export const PlanSelector = styled.div `
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
gap: 0.5rem;
|
|
17
|
+
border-radius: 1rem;
|
|
18
|
+
padding: 0.5rem;
|
|
19
|
+
|
|
20
|
+
@media (min-width: 768px) {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
export const SelectorButton = styled.button `
|
|
25
|
+
padding: 0.5rem;
|
|
26
|
+
border-radius: 0.5rem;
|
|
27
|
+
border: none;
|
|
28
|
+
outline: inherit;
|
|
29
|
+
flex: 1;
|
|
30
|
+
font-size: 12px;
|
|
31
|
+
font-weight: 700;
|
|
32
|
+
background-color: var(--neutral-neutral-4);
|
|
33
|
+
color: var(--neutral-neutral-1);
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
transition: background-color 0.3s;
|
|
36
|
+
|
|
37
|
+
${({ isActive }) => isActive &&
|
|
38
|
+
css `
|
|
39
|
+
background-color: var(--primary-main);
|
|
40
|
+
color: white;
|
|
41
|
+
`}
|
|
42
|
+
`;
|
|
43
|
+
export const PlansWrapper = styled.div `
|
|
44
|
+
display: flex;
|
|
45
|
+
height: 100%;
|
|
46
|
+
gap: 1rem;
|
|
47
|
+
width: 100%;
|
|
48
|
+
max-width: 327px;
|
|
49
|
+
|
|
50
|
+
@media (min-width: 768px) {
|
|
51
|
+
max-width: none;
|
|
52
|
+
gap: 20px;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
export const PlanWrapper = styled.div `
|
|
56
|
+
max-width: 327px;
|
|
57
|
+
border-radius: 1rem;
|
|
58
|
+
flex: 1;
|
|
59
|
+
display: ${({ isActive }) => (isActive ? 'block' : 'none')};
|
|
60
|
+
background-color: white;
|
|
61
|
+
|
|
62
|
+
${({ isHighlighted }) => isHighlighted &&
|
|
63
|
+
css `
|
|
64
|
+
border: 2px solid var(--primary-main);
|
|
65
|
+
`}
|
|
66
|
+
|
|
67
|
+
@media (min-width: 768px) {
|
|
68
|
+
display: block;
|
|
69
|
+
max-width: none;
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
export const FeaturesSection = styled.div `
|
|
73
|
+
width: 100%;
|
|
74
|
+
`;
|
|
75
|
+
export const FeaturesGrid = styled.ul `
|
|
76
|
+
display: grid;
|
|
77
|
+
grid-template-columns: repeat(2, 1fr);
|
|
78
|
+
gap: 0.5rem;
|
|
79
|
+
list-style: none;
|
|
80
|
+
padding: 0;
|
|
81
|
+
margin: 0;
|
|
82
|
+
|
|
83
|
+
@media (min-width: 768px) {
|
|
84
|
+
display: flex;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
}
|
|
87
|
+
`;
|