@npm_leadtech/legal-lib-components 7.63.8 → 7.63.10
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/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/Logo/Logo.js +4 -2
- package/dist/src/components/atoms/Logo/Logo.tsx +4 -2
- package/dist/src/components/atoms/Logo/svg/legalfinity-logo.svg +15 -0
- package/dist/src/components/atoms/Logo/svg/legalfinity-white-logo.svg +15 -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/molecules/AccordionItem/AccordionItem.styled.js +1 -6
- package/dist/src/components/molecules/AccordionItem/AccordionItem.styled.ts +1 -6
- package/dist/src/components/molecules/BoxForm/BoxForm.styled.js +8 -2
- package/dist/src/components/molecules/BoxForm/BoxForm.styled.ts +8 -2
- package/dist/src/components/molecules/StickyPlanBar/StickyPlanBar.d.ts +3 -0
- package/dist/src/components/molecules/StickyPlanBar/StickyPlanBar.js +5 -0
- package/dist/src/components/molecules/StickyPlanBar/StickyPlanBar.styled.d.ts +3 -0
- package/dist/src/components/molecules/StickyPlanBar/StickyPlanBar.styled.js +69 -0
- package/dist/src/components/molecules/StickyPlanBar/StickyPlanBar.styled.ts +72 -0
- package/dist/src/components/molecules/StickyPlanBar/StickyPlanBar.tsx +23 -0
- package/dist/src/components/molecules/StickyPlanBar/StickyPlanBarProps.d.ts +6 -0
- package/dist/src/components/molecules/StickyPlanBar/StickyPlanBarProps.js +1 -0
- package/dist/src/components/molecules/StickyPlanBar/StickyPlanBarProps.ts +7 -0
- package/dist/src/components/molecules/StickyPlanBar/index.d.ts +2 -0
- package/dist/src/components/molecules/StickyPlanBar/index.js +2 -0
- package/dist/src/components/molecules/StickyPlanBar/index.ts +2 -0
- package/dist/src/components/molecules/index.d.ts +1 -0
- package/dist/src/components/molecules/index.js +1 -0
- package/dist/src/components/molecules/index.ts +1 -0
- package/dist/src/components/organisms/PricingPageHeader/PricingPageHeader.d.ts +3 -0
- package/dist/src/components/organisms/PricingPageHeader/PricingPageHeader.js +7 -0
- package/dist/src/components/organisms/PricingPageHeader/PricingPageHeader.styled.d.ts +3 -0
- package/dist/src/components/organisms/PricingPageHeader/PricingPageHeader.styled.js +35 -0
- package/dist/src/components/organisms/PricingPageHeader/PricingPageHeader.styled.tsx +38 -0
- package/dist/src/components/organisms/PricingPageHeader/PricingPageHeader.tsx +21 -0
- package/dist/src/components/organisms/PricingPageHeader/PricingPageHeaderProps.d.ts +4 -0
- package/dist/src/components/organisms/PricingPageHeader/PricingPageHeaderProps.js +1 -0
- package/dist/src/components/organisms/PricingPageHeader/PricingPageHeaderProps.ts +4 -0
- package/dist/src/components/organisms/PricingPageHeader/index.d.ts +2 -0
- package/dist/src/components/organisms/PricingPageHeader/index.js +2 -0
- package/dist/src/components/organisms/PricingPageHeader/index.ts +2 -0
- package/dist/src/components/organisms/index.d.ts +1 -0
- package/dist/src/components/organisms/index.js +1 -0
- package/dist/src/components/organisms/index.ts +1 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.d.ts +3 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.js +58 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.styled.d.ts +16 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.styled.js +88 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.styled.ts +107 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.tsx +128 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPageProps.d.ts +9 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPageProps.js +1 -0
- package/dist/src/components/pages/PricingPlansPage/PricingPlansPageProps.ts +10 -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/utils/throttle.d.ts +1 -0
- package/dist/src/utils/throttle.js +10 -0
- package/dist/src/utils/throttle.ts +11 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { size } from '../../../globalStyles/breakpoints';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
export const StickyPlanBarStyled = styled.div `
|
|
4
|
+
position: fixed;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
width: 100%;
|
|
8
|
+
z-index: 100;
|
|
9
|
+
padding: 1rem;
|
|
10
|
+
gap: 1rem;
|
|
11
|
+
|
|
12
|
+
background-color: #ffffff;
|
|
13
|
+
border-radius: 1rem 1rem 0 0;
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: space-between;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
align-items: center;
|
|
18
|
+
|
|
19
|
+
transform: translateY(100%);
|
|
20
|
+
transition: transform 0.3s ease-in-out;
|
|
21
|
+
|
|
22
|
+
&.visible {
|
|
23
|
+
transform: translateY(0);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (min-width: ${size.sm}) {
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
export const StickyPlanContent = styled.div `
|
|
31
|
+
display: flex;
|
|
32
|
+
width: 100%;
|
|
33
|
+
justify-content: space-between;
|
|
34
|
+
|
|
35
|
+
.sticky-plan-name {
|
|
36
|
+
padding: 0.25rem 0.5rem;
|
|
37
|
+
background-color: var(--primary-main-light-5);
|
|
38
|
+
color: var(--primary-main-dark-1);
|
|
39
|
+
font-size: 12px;
|
|
40
|
+
font-weight: 700;
|
|
41
|
+
border-radius: 8px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.sticky-plan-pricing {
|
|
45
|
+
display: flex;
|
|
46
|
+
gap: 4px;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.sticky-plan-price {
|
|
52
|
+
font-size: 12px;
|
|
53
|
+
font-weight: 700;
|
|
54
|
+
}
|
|
55
|
+
.sticky-plan-priceLabel {
|
|
56
|
+
font-size: 12px;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
export const StickySelectButton = styled.button `
|
|
60
|
+
background-color: var(--primary-main-light-1);
|
|
61
|
+
color: white;
|
|
62
|
+
border: none;
|
|
63
|
+
border-radius: 4px;
|
|
64
|
+
padding: 0.68rem 1rem;
|
|
65
|
+
font-weight: 700;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
transition: background-color 0.2s;
|
|
68
|
+
width: 100%;
|
|
69
|
+
`;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { size } from '../../../globalStyles/breakpoints'
|
|
2
|
+
import styled from 'styled-components'
|
|
3
|
+
|
|
4
|
+
export const StickyPlanBarStyled = styled.div`
|
|
5
|
+
position: fixed;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
width: 100%;
|
|
9
|
+
z-index: 100;
|
|
10
|
+
padding: 1rem;
|
|
11
|
+
gap: 1rem;
|
|
12
|
+
|
|
13
|
+
background-color: #ffffff;
|
|
14
|
+
border-radius: 1rem 1rem 0 0;
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
align-items: center;
|
|
19
|
+
|
|
20
|
+
transform: translateY(100%);
|
|
21
|
+
transition: transform 0.3s ease-in-out;
|
|
22
|
+
|
|
23
|
+
&.visible {
|
|
24
|
+
transform: translateY(0);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@media (min-width: ${size.sm}) {
|
|
28
|
+
display: none;
|
|
29
|
+
}
|
|
30
|
+
`
|
|
31
|
+
|
|
32
|
+
export const StickyPlanContent = styled.div`
|
|
33
|
+
display: flex;
|
|
34
|
+
width: 100%;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
|
|
37
|
+
.sticky-plan-name {
|
|
38
|
+
padding: 0.25rem 0.5rem;
|
|
39
|
+
background-color: var(--primary-main-light-5);
|
|
40
|
+
color: var(--primary-main-dark-1);
|
|
41
|
+
font-size: 12px;
|
|
42
|
+
font-weight: 700;
|
|
43
|
+
border-radius: 8px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.sticky-plan-pricing {
|
|
47
|
+
display: flex;
|
|
48
|
+
gap: 4px;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.sticky-plan-price {
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
font-weight: 700;
|
|
56
|
+
}
|
|
57
|
+
.sticky-plan-priceLabel {
|
|
58
|
+
font-size: 12px;
|
|
59
|
+
}
|
|
60
|
+
`
|
|
61
|
+
|
|
62
|
+
export const StickySelectButton = styled.button`
|
|
63
|
+
background-color: var(--primary-main-light-1);
|
|
64
|
+
color: white;
|
|
65
|
+
border: none;
|
|
66
|
+
border-radius: 4px;
|
|
67
|
+
padding: 0.68rem 1rem;
|
|
68
|
+
font-weight: 700;
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
transition: background-color 0.2s;
|
|
71
|
+
width: 100%;
|
|
72
|
+
`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StickyPlanBarStyled, StickyPlanContent, StickySelectButton } from './StickyPlanBar.styled'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { StickyPlanBarProps } from './StickyPlanBarProps'
|
|
4
|
+
|
|
5
|
+
export const StickyPlanBar: React.FC<StickyPlanBarProps> = ({ activePlan, showStickyBar, onPlanSelect }) => {
|
|
6
|
+
return (
|
|
7
|
+
<StickyPlanBarStyled className={`sticky-plan-bar ${showStickyBar ? 'visible' : ''}`}>
|
|
8
|
+
<StickyPlanContent className='sticky-plan-info'>
|
|
9
|
+
<span className='sticky-plan-name'>{activePlan.subscription_type?.name}</span>
|
|
10
|
+
<div className='sticky-plan-pricing'>
|
|
11
|
+
<span className='sticky-plan-price'>{activePlan.pricing}</span>
|
|
12
|
+
<span className='sticky-plan-priceLabel'>{activePlan.pricingLabel}</span>
|
|
13
|
+
</div>
|
|
14
|
+
</StickyPlanContent>
|
|
15
|
+
<StickySelectButton
|
|
16
|
+
className='sticky-select-button'
|
|
17
|
+
onClick={() => (onPlanSelect ? onPlanSelect(activePlan?.subscription_type?.sku ?? '') : undefined)}
|
|
18
|
+
>
|
|
19
|
+
Select
|
|
20
|
+
</StickySelectButton>
|
|
21
|
+
</StickyPlanBarStyled>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PhoneButtonStyled, PhoneNumberStyled, PricingHeaderStyled } from './PricingPageHeader.styled';
|
|
3
|
+
import { Logo } from '../../atoms';
|
|
4
|
+
import { PhoneIcon } from '../../../../images/componentsSvg/PhoneIcon';
|
|
5
|
+
export const PricingPageHeader = ({ siteName = 'Legalfinity', phoneNumber }) => {
|
|
6
|
+
return (_jsxs(PricingHeaderStyled, { children: [_jsx(Logo, { siteName: siteName, width: '150', height: '26' }), _jsxs(PhoneNumberStyled, { children: [_jsx(PhoneIcon, { width: 16, height: 16, fill: '#6d7275' }), _jsx("strong", { children: phoneNumber })] }), _jsxs(PhoneButtonStyled, { href: `tel:${phoneNumber}`, target: '__self', children: [_jsx(PhoneIcon, { width: 24, height: 24, fill: 'currentColor' }), _jsx("strong", { children: 'Call Us' })] })] }));
|
|
7
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const PricingHeaderStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
2
|
+
export declare const PhoneButtonStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, never>> & string;
|
|
3
|
+
export declare const PhoneNumberStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { size } from '../../../globalStyles/breakpoints';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
export const PricingHeaderStyled = styled.header `
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
align-items: center;
|
|
7
|
+
padding: 1rem 1.5rem;
|
|
8
|
+
`;
|
|
9
|
+
export const PhoneButtonStyled = styled.a `
|
|
10
|
+
display: none;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: 0.25rem;
|
|
13
|
+
height: 2.5rem;
|
|
14
|
+
border-radius: 0.25rem;
|
|
15
|
+
padding: 0.25rem 0.5rem;
|
|
16
|
+
text-decoration: none;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
border: 1px solid var(--neutral-neutral-4);
|
|
19
|
+
font-size: 14px;
|
|
20
|
+
color: var(--primary-main);
|
|
21
|
+
@media (max-width: ${size.tab}) {
|
|
22
|
+
display: flex;
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
export const PhoneNumberStyled = styled.div `
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
gap: 0.5rem;
|
|
29
|
+
color: var(--neutral-neutral-2);
|
|
30
|
+
height: 2.5rem;
|
|
31
|
+
|
|
32
|
+
@media (max-width: ${size.tab}) {
|
|
33
|
+
display: none;
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { size } from '../../../globalStyles/breakpoints'
|
|
2
|
+
import styled from 'styled-components'
|
|
3
|
+
|
|
4
|
+
export const PricingHeaderStyled = styled.header`
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
align-items: center;
|
|
8
|
+
padding: 1rem 1.5rem;
|
|
9
|
+
`
|
|
10
|
+
|
|
11
|
+
export const PhoneButtonStyled = styled.a`
|
|
12
|
+
display: none;
|
|
13
|
+
align-items: center;
|
|
14
|
+
gap: 0.25rem;
|
|
15
|
+
height: 2.5rem;
|
|
16
|
+
border-radius: 0.25rem;
|
|
17
|
+
padding: 0.25rem 0.5rem;
|
|
18
|
+
text-decoration: none;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
border: 1px solid var(--neutral-neutral-4);
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
color: var(--primary-main);
|
|
23
|
+
@media (max-width: ${size.tab}) {
|
|
24
|
+
display: flex;
|
|
25
|
+
}
|
|
26
|
+
`
|
|
27
|
+
|
|
28
|
+
export const PhoneNumberStyled = styled.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: 0.5rem;
|
|
32
|
+
color: var(--neutral-neutral-2);
|
|
33
|
+
height: 2.5rem;
|
|
34
|
+
|
|
35
|
+
@media (max-width: ${size.tab}) {
|
|
36
|
+
display: none;
|
|
37
|
+
}
|
|
38
|
+
`
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PhoneButtonStyled, PhoneNumberStyled, PricingHeaderStyled } from './PricingPageHeader.styled'
|
|
2
|
+
import { Logo } from '../../atoms'
|
|
3
|
+
import { PhoneIcon } from '../../../../images/componentsSvg/PhoneIcon'
|
|
4
|
+
import { PricingHeaderProps } from './PricingPageHeaderProps'
|
|
5
|
+
import React from 'react'
|
|
6
|
+
|
|
7
|
+
export const PricingPageHeader: React.FC<PricingHeaderProps> = ({ siteName = 'Legalfinity', phoneNumber }) => {
|
|
8
|
+
return (
|
|
9
|
+
<PricingHeaderStyled>
|
|
10
|
+
<Logo siteName={siteName} width='150' height='26' />
|
|
11
|
+
<PhoneNumberStyled>
|
|
12
|
+
<PhoneIcon width={16} height={16} fill='#6d7275' />
|
|
13
|
+
<strong>{phoneNumber}</strong>
|
|
14
|
+
</PhoneNumberStyled>
|
|
15
|
+
<PhoneButtonStyled href={`tel:${phoneNumber}`} target='__self'>
|
|
16
|
+
<PhoneIcon width={24} height={24} fill='currentColor' />
|
|
17
|
+
<strong>{'Call Us'}</strong>
|
|
18
|
+
</PhoneButtonStyled>
|
|
19
|
+
</PricingHeaderStyled>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
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 { PricingPageHeader } from '../../organisms';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { StickyPlanBar } from '../../molecules/StickyPlanBar';
|
|
7
|
+
import { throttle } from '../../../utils/throttle';
|
|
8
|
+
export const PricingPlansPage = ({ subscriptionPlans, features, onPlanSelect, headerDivider, siteName = 'Legalfinity', phoneNumber }) => {
|
|
9
|
+
const [activePlanIndex, setActivePlanIndex] = React.useState(0);
|
|
10
|
+
const plansWrapperRef = React.useRef(null);
|
|
11
|
+
const lastScrollYRef = React.useRef(0);
|
|
12
|
+
const [showStickyBar, setShowStickyBar] = React.useState(false);
|
|
13
|
+
const activePlan = subscriptionPlans[activePlanIndex];
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
const handleScroll = () => {
|
|
16
|
+
if (!plansWrapperRef.current)
|
|
17
|
+
return;
|
|
18
|
+
const currentScrollY = window.scrollY;
|
|
19
|
+
const isMobile = window.innerWidth < 720;
|
|
20
|
+
if (!isMobile) {
|
|
21
|
+
if (showStickyBar) {
|
|
22
|
+
setShowStickyBar(false);
|
|
23
|
+
}
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const isScrollingUp = currentScrollY < lastScrollYRef.current - 10 ? 'up' : null;
|
|
27
|
+
const scrollDirection = currentScrollY > lastScrollYRef.current + 10 ? 'down' : isScrollingUp;
|
|
28
|
+
if (!scrollDirection)
|
|
29
|
+
return;
|
|
30
|
+
const targetRect = plansWrapperRef.current.getBoundingClientRect();
|
|
31
|
+
const isPastWrapper = targetRect.bottom < 400;
|
|
32
|
+
if (scrollDirection === 'down' && isPastWrapper) {
|
|
33
|
+
if (!showStickyBar) {
|
|
34
|
+
setShowStickyBar(true);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else if (scrollDirection === 'up' || !isPastWrapper) {
|
|
38
|
+
if (showStickyBar && !isPastWrapper) {
|
|
39
|
+
setShowStickyBar(false);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
lastScrollYRef.current = currentScrollY;
|
|
43
|
+
};
|
|
44
|
+
const handleResize = () => {
|
|
45
|
+
if (window.innerWidth >= 720) {
|
|
46
|
+
setShowStickyBar(false);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const throttledHandleScroll = throttle(handleScroll, 100);
|
|
50
|
+
window.addEventListener('scroll', throttledHandleScroll);
|
|
51
|
+
window.addEventListener('resize', handleResize);
|
|
52
|
+
return () => {
|
|
53
|
+
window.removeEventListener('scroll', throttledHandleScroll);
|
|
54
|
+
window.removeEventListener('resize', handleResize);
|
|
55
|
+
};
|
|
56
|
+
}, [showStickyBar]);
|
|
57
|
+
return (_jsxs(_Fragment, { children: [_jsx(PricingPageHeader, { siteName: siteName, phoneNumber: phoneNumber }), headerDivider, 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, { ref: plansWrapperRef, 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))) }) })), _jsx(StickyPlanBar, { activePlan: activePlan, showStickyBar: showStickyBar, onPlanSelect: onPlanSelect })] }))] }));
|
|
58
|
+
};
|
|
@@ -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,88 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { size } from '../../../globalStyles/breakpoints';
|
|
3
|
+
export const PricingContainerStyled = styled.section `
|
|
4
|
+
margin: 0 auto 0 auto;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
max-width: 996px;
|
|
10
|
+
gap: 1.5rem;
|
|
11
|
+
margin-bottom: 3rem;
|
|
12
|
+
padding: 0 1.5rem;
|
|
13
|
+
`;
|
|
14
|
+
export const PlanSelector = styled.div `
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
gap: 0.5rem;
|
|
18
|
+
border-radius: 1rem;
|
|
19
|
+
padding: 0.5rem;
|
|
20
|
+
|
|
21
|
+
@media (min-width: ${size.sm}) {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
export const SelectorButton = styled.button `
|
|
26
|
+
padding: 0.5rem;
|
|
27
|
+
border-radius: 0.5rem;
|
|
28
|
+
border: none;
|
|
29
|
+
outline: inherit;
|
|
30
|
+
flex: 1;
|
|
31
|
+
font-size: 12px;
|
|
32
|
+
font-weight: 700;
|
|
33
|
+
background-color: var(--neutral-neutral-4);
|
|
34
|
+
color: var(--neutral-neutral-1);
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
transition: background-color 0.3s;
|
|
37
|
+
|
|
38
|
+
${({ isActive }) => isActive &&
|
|
39
|
+
css `
|
|
40
|
+
background-color: var(--primary-main);
|
|
41
|
+
color: white;
|
|
42
|
+
`}
|
|
43
|
+
`;
|
|
44
|
+
export const PlansWrapper = styled.div `
|
|
45
|
+
display: flex;
|
|
46
|
+
height: 100%;
|
|
47
|
+
gap: 1rem;
|
|
48
|
+
width: 100%;
|
|
49
|
+
max-width: 327px;
|
|
50
|
+
|
|
51
|
+
@media (min-width: ${size.sm}) {
|
|
52
|
+
max-width: none;
|
|
53
|
+
gap: 20px;
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
export const PlanWrapper = styled.div `
|
|
57
|
+
max-width: 327px;
|
|
58
|
+
border-radius: 1rem;
|
|
59
|
+
flex: 1;
|
|
60
|
+
display: ${({ isActive }) => (isActive ? 'block' : 'none')};
|
|
61
|
+
background-color: white;
|
|
62
|
+
|
|
63
|
+
${({ isHighlighted }) => isHighlighted &&
|
|
64
|
+
css `
|
|
65
|
+
border: 2px solid var(--primary-main);
|
|
66
|
+
`}
|
|
67
|
+
|
|
68
|
+
@media (min-width: ${size.sm}) {
|
|
69
|
+
display: block;
|
|
70
|
+
max-width: none;
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
export const FeaturesSection = styled.div `
|
|
74
|
+
width: 100%;
|
|
75
|
+
`;
|
|
76
|
+
export const FeaturesGrid = styled.ul `
|
|
77
|
+
display: grid;
|
|
78
|
+
grid-template-columns: repeat(2, 1fr);
|
|
79
|
+
gap: 0.5rem;
|
|
80
|
+
list-style: none;
|
|
81
|
+
padding: 0;
|
|
82
|
+
margin: 0;
|
|
83
|
+
|
|
84
|
+
@media (min-width: ${size.sm}) {
|
|
85
|
+
display: flex;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
import { size } from '../../../globalStyles/breakpoints'
|
|
3
|
+
|
|
4
|
+
type PlanWrapperProps = {
|
|
5
|
+
isActive: boolean
|
|
6
|
+
isHighlighted?: boolean
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type SelectorButton = {
|
|
10
|
+
isActive: boolean
|
|
11
|
+
dataQa: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const PricingContainerStyled = styled.section`
|
|
15
|
+
margin: 0 auto 0 auto;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
align-items: center;
|
|
20
|
+
max-width: 996px;
|
|
21
|
+
gap: 1.5rem;
|
|
22
|
+
margin-bottom: 3rem;
|
|
23
|
+
padding: 0 1.5rem;
|
|
24
|
+
`
|
|
25
|
+
|
|
26
|
+
export const PlanSelector = styled.div`
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
gap: 0.5rem;
|
|
30
|
+
border-radius: 1rem;
|
|
31
|
+
padding: 0.5rem;
|
|
32
|
+
|
|
33
|
+
@media (min-width: ${size.sm}) {
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
36
|
+
`
|
|
37
|
+
|
|
38
|
+
export const SelectorButton = styled.button<SelectorButton>`
|
|
39
|
+
padding: 0.5rem;
|
|
40
|
+
border-radius: 0.5rem;
|
|
41
|
+
border: none;
|
|
42
|
+
outline: inherit;
|
|
43
|
+
flex: 1;
|
|
44
|
+
font-size: 12px;
|
|
45
|
+
font-weight: 700;
|
|
46
|
+
background-color: var(--neutral-neutral-4);
|
|
47
|
+
color: var(--neutral-neutral-1);
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
transition: background-color 0.3s;
|
|
50
|
+
|
|
51
|
+
${({ isActive }) =>
|
|
52
|
+
isActive &&
|
|
53
|
+
css`
|
|
54
|
+
background-color: var(--primary-main);
|
|
55
|
+
color: white;
|
|
56
|
+
`}
|
|
57
|
+
`
|
|
58
|
+
|
|
59
|
+
export const PlansWrapper = styled.div`
|
|
60
|
+
display: flex;
|
|
61
|
+
height: 100%;
|
|
62
|
+
gap: 1rem;
|
|
63
|
+
width: 100%;
|
|
64
|
+
max-width: 327px;
|
|
65
|
+
|
|
66
|
+
@media (min-width: ${size.sm}) {
|
|
67
|
+
max-width: none;
|
|
68
|
+
gap: 20px;
|
|
69
|
+
}
|
|
70
|
+
`
|
|
71
|
+
|
|
72
|
+
export const PlanWrapper = styled.div<PlanWrapperProps>`
|
|
73
|
+
max-width: 327px;
|
|
74
|
+
border-radius: 1rem;
|
|
75
|
+
flex: 1;
|
|
76
|
+
display: ${({ isActive }) => (isActive ? 'block' : 'none')};
|
|
77
|
+
background-color: white;
|
|
78
|
+
|
|
79
|
+
${({ isHighlighted }) =>
|
|
80
|
+
isHighlighted &&
|
|
81
|
+
css`
|
|
82
|
+
border: 2px solid var(--primary-main);
|
|
83
|
+
`}
|
|
84
|
+
|
|
85
|
+
@media (min-width: ${size.sm}) {
|
|
86
|
+
display: block;
|
|
87
|
+
max-width: none;
|
|
88
|
+
}
|
|
89
|
+
`
|
|
90
|
+
|
|
91
|
+
export const FeaturesSection = styled.div`
|
|
92
|
+
width: 100%;
|
|
93
|
+
`
|
|
94
|
+
|
|
95
|
+
export const FeaturesGrid = styled.ul`
|
|
96
|
+
display: grid;
|
|
97
|
+
grid-template-columns: repeat(2, 1fr);
|
|
98
|
+
gap: 0.5rem;
|
|
99
|
+
list-style: none;
|
|
100
|
+
padding: 0;
|
|
101
|
+
margin: 0;
|
|
102
|
+
|
|
103
|
+
@media (min-width: ${size.sm}) {
|
|
104
|
+
display: flex;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
}
|
|
107
|
+
`
|