@npm_leadtech/legal-lib-components 7.64.0 → 7.65.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 -18
- 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/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/globalStyles/themes.scss +0 -27
- 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,128 @@
|
|
|
1
|
+
import { FeatureItem, PlanCard } from '../../atoms'
|
|
2
|
+
import {
|
|
3
|
+
FeaturesGrid,
|
|
4
|
+
FeaturesSection,
|
|
5
|
+
PlanSelector,
|
|
6
|
+
PlanWrapper,
|
|
7
|
+
PlansWrapper,
|
|
8
|
+
PricingContainerStyled,
|
|
9
|
+
SelectorButton
|
|
10
|
+
} from './PricingPlansPage.styled'
|
|
11
|
+
import { PricingPageHeader } from '../../organisms'
|
|
12
|
+
import { PricingPlansPageProps } from './PricingPlansPageProps'
|
|
13
|
+
import React from 'react'
|
|
14
|
+
import { StickyPlanBar } from '../../molecules/StickyPlanBar'
|
|
15
|
+
import { throttle } from '../../../utils/throttle'
|
|
16
|
+
|
|
17
|
+
export const PricingPlansPage: React.FC<PricingPlansPageProps> = ({
|
|
18
|
+
subscriptionPlans,
|
|
19
|
+
features,
|
|
20
|
+
onPlanSelect,
|
|
21
|
+
headerDivider,
|
|
22
|
+
siteName = 'Legalfinity',
|
|
23
|
+
phoneNumber
|
|
24
|
+
}) => {
|
|
25
|
+
const [activePlanIndex, setActivePlanIndex] = React.useState(0)
|
|
26
|
+
const plansWrapperRef = React.useRef<HTMLDivElement | null>(null)
|
|
27
|
+
const lastScrollYRef = React.useRef(0)
|
|
28
|
+
const [showStickyBar, setShowStickyBar] = React.useState(false)
|
|
29
|
+
|
|
30
|
+
const activePlan = subscriptionPlans[activePlanIndex]
|
|
31
|
+
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
const handleScroll = () => {
|
|
34
|
+
if (!plansWrapperRef.current) return
|
|
35
|
+
|
|
36
|
+
const currentScrollY = window.scrollY
|
|
37
|
+
const isMobile = window.innerWidth < 720
|
|
38
|
+
|
|
39
|
+
if (!isMobile) {
|
|
40
|
+
if (showStickyBar) {
|
|
41
|
+
setShowStickyBar(false)
|
|
42
|
+
}
|
|
43
|
+
return
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const isScrollingUp = currentScrollY < lastScrollYRef.current - 10 ? 'up' : null
|
|
47
|
+
|
|
48
|
+
const scrollDirection = currentScrollY > lastScrollYRef.current + 10 ? 'down' : isScrollingUp
|
|
49
|
+
if (!scrollDirection) return
|
|
50
|
+
|
|
51
|
+
const targetRect = plansWrapperRef.current.getBoundingClientRect()
|
|
52
|
+
const isPastWrapper = targetRect.bottom < 400
|
|
53
|
+
|
|
54
|
+
if (scrollDirection === 'down' && isPastWrapper) {
|
|
55
|
+
if (!showStickyBar) {
|
|
56
|
+
setShowStickyBar(true)
|
|
57
|
+
}
|
|
58
|
+
} else if (scrollDirection === 'up' || !isPastWrapper) {
|
|
59
|
+
if (showStickyBar && !isPastWrapper) {
|
|
60
|
+
setShowStickyBar(false)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
lastScrollYRef.current = currentScrollY
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const handleResize = () => {
|
|
68
|
+
if (window.innerWidth >= 720) {
|
|
69
|
+
setShowStickyBar(false)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const throttledHandleScroll = throttle(handleScroll, 100)
|
|
74
|
+
|
|
75
|
+
window.addEventListener('scroll', throttledHandleScroll)
|
|
76
|
+
window.addEventListener('resize', handleResize)
|
|
77
|
+
|
|
78
|
+
return () => {
|
|
79
|
+
window.removeEventListener('scroll', throttledHandleScroll)
|
|
80
|
+
window.removeEventListener('resize', handleResize)
|
|
81
|
+
}
|
|
82
|
+
}, [showStickyBar])
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<>
|
|
86
|
+
<PricingPageHeader siteName={siteName} phoneNumber={phoneNumber} />
|
|
87
|
+
{headerDivider}
|
|
88
|
+
{subscriptionPlans?.length > 0 && (
|
|
89
|
+
<PricingContainerStyled>
|
|
90
|
+
<PlanSelector>
|
|
91
|
+
{subscriptionPlans.map((plan, index) => (
|
|
92
|
+
<SelectorButton
|
|
93
|
+
key={`selector-${plan?.pricingLabel}`}
|
|
94
|
+
isActive={index === activePlanIndex}
|
|
95
|
+
onClick={() => setActivePlanIndex(index)}
|
|
96
|
+
dataQa={`selector-${plan.subscription_type?.name.replaceAll(' ', '')}`}
|
|
97
|
+
>
|
|
98
|
+
{plan?.subscription_type?.name}
|
|
99
|
+
</SelectorButton>
|
|
100
|
+
))}
|
|
101
|
+
</PlanSelector>
|
|
102
|
+
<PlansWrapper ref={plansWrapperRef}>
|
|
103
|
+
{subscriptionPlans.map((plan, index) => (
|
|
104
|
+
<PlanWrapper
|
|
105
|
+
key={plan.pricingLabel}
|
|
106
|
+
isHighlighted={plan.highlightPlan}
|
|
107
|
+
isActive={index === activePlanIndex}
|
|
108
|
+
className={`pricing-plan__element-container ${plan?.highlightPlan ? 'highlight' : ''} ${index === activePlanIndex ? 'active' : ''}`}
|
|
109
|
+
>
|
|
110
|
+
<PlanCard onSelect={onPlanSelect ?? (() => {})} plan={plan} />
|
|
111
|
+
</PlanWrapper>
|
|
112
|
+
))}
|
|
113
|
+
</PlansWrapper>
|
|
114
|
+
{features && features.length > 0 && (
|
|
115
|
+
<FeaturesSection>
|
|
116
|
+
<FeaturesGrid>
|
|
117
|
+
{features.map((feature) => (
|
|
118
|
+
<FeatureItem feature={feature} key={feature.description} />
|
|
119
|
+
))}
|
|
120
|
+
</FeaturesGrid>
|
|
121
|
+
</FeaturesSection>
|
|
122
|
+
)}
|
|
123
|
+
<StickyPlanBar activePlan={activePlan} showStickyBar={showStickyBar} onPlanSelect={onPlanSelect} />
|
|
124
|
+
</PricingContainerStyled>
|
|
125
|
+
)}
|
|
126
|
+
</>
|
|
127
|
+
)
|
|
128
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FeatureItemProp, SubscriptionPlan } from '../../atoms';
|
|
2
|
+
export interface PricingPlansPageProps {
|
|
3
|
+
subscriptionPlans: SubscriptionPlan[];
|
|
4
|
+
features?: FeatureItemProp[];
|
|
5
|
+
onPlanSelect?: (sku: string) => void;
|
|
6
|
+
headerDivider?: React.ReactNode;
|
|
7
|
+
siteName?: string;
|
|
8
|
+
phoneNumber?: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FeatureItemProp, SubscriptionPlan } from '../../atoms'
|
|
2
|
+
|
|
3
|
+
export interface PricingPlansPageProps {
|
|
4
|
+
subscriptionPlans: SubscriptionPlan[]
|
|
5
|
+
features?: FeatureItemProp[]
|
|
6
|
+
onPlanSelect?: (sku: string) => void
|
|
7
|
+
headerDivider?: React.ReactNode
|
|
8
|
+
siteName?: string
|
|
9
|
+
phoneNumber?: string
|
|
10
|
+
}
|
|
@@ -52,9 +52,6 @@ html {
|
|
|
52
52
|
--others-white: #fff;
|
|
53
53
|
--others-disabled: #6b7280;
|
|
54
54
|
--others-black: #000;
|
|
55
|
-
|
|
56
|
-
--font-main: 'Inter', sans-serif;
|
|
57
|
-
--font-secondary: 'Lora', serif;
|
|
58
55
|
}
|
|
59
56
|
|
|
60
57
|
html[data-theme='districtlaws'] {
|
|
@@ -89,9 +86,6 @@ html[data-theme='districtlaws'] {
|
|
|
89
86
|
--others-white: #fff;
|
|
90
87
|
--others-disabled: #6b7280;
|
|
91
88
|
--others-black: #000;
|
|
92
|
-
|
|
93
|
-
--font-main: 'Inter', sans-serif;
|
|
94
|
-
--font-secondary: 'Lora', serif;
|
|
95
89
|
}
|
|
96
90
|
|
|
97
91
|
html[data-theme='lawdistricts'] {
|
|
@@ -126,9 +120,6 @@ html[data-theme='lawdistricts'] {
|
|
|
126
120
|
--others-white: #fff;
|
|
127
121
|
--others-disabled: #6b7280;
|
|
128
122
|
--others-black: #000;
|
|
129
|
-
|
|
130
|
-
--font-main: 'Inter', sans-serif;
|
|
131
|
-
--font-secondary: 'Lora', serif;
|
|
132
123
|
}
|
|
133
124
|
|
|
134
125
|
html[data-theme='lawdistrict'] {
|
|
@@ -163,9 +154,6 @@ html[data-theme='lawdistrict'] {
|
|
|
163
154
|
--others-white: #fff;
|
|
164
155
|
--others-disabled: #6b7280;
|
|
165
156
|
--others-black: #000;
|
|
166
|
-
|
|
167
|
-
--font-main: 'Inter', sans-serif;
|
|
168
|
-
--font-secondary: 'Lora', serif;
|
|
169
157
|
}
|
|
170
158
|
|
|
171
159
|
html[data-theme='lawdistrict'] {
|
|
@@ -226,9 +214,6 @@ html[data-theme='lawsdistrict'] {
|
|
|
226
214
|
--others-white: #fff;
|
|
227
215
|
--others-disabled: #6b7280;
|
|
228
216
|
--others-black: #000;
|
|
229
|
-
|
|
230
|
-
--font-main: 'Inter', sans-serif;
|
|
231
|
-
--font-secondary: 'Lora', serif;
|
|
232
217
|
}
|
|
233
218
|
|
|
234
219
|
html[data-theme='lawdistrictinfo'] {
|
|
@@ -263,9 +248,6 @@ html[data-theme='lawdistrictinfo'] {
|
|
|
263
248
|
--others-white: #fff;
|
|
264
249
|
--others-disabled: #6b7280;
|
|
265
250
|
--others-black: #000;
|
|
266
|
-
|
|
267
|
-
--font-main: 'Inter', sans-serif;
|
|
268
|
-
--font-secondary: 'Lora', serif;
|
|
269
251
|
}
|
|
270
252
|
|
|
271
253
|
html[data-theme='uslawdistrict'] {
|
|
@@ -300,9 +282,6 @@ html[data-theme='uslawdistrict'] {
|
|
|
300
282
|
--others-white: #fff;
|
|
301
283
|
--others-disabled: #6b7280;
|
|
302
284
|
--others-black: #000;
|
|
303
|
-
|
|
304
|
-
--font-main: 'Inter', sans-serif;
|
|
305
|
-
--font-secondary: 'Lora', serif;
|
|
306
285
|
}
|
|
307
286
|
|
|
308
287
|
html[data-theme='lawdistrictonline'] {
|
|
@@ -337,9 +316,6 @@ html[data-theme='lawdistrictonline'] {
|
|
|
337
316
|
--others-white: #fff;
|
|
338
317
|
--others-disabled: #6b7280;
|
|
339
318
|
--others-black: #000;
|
|
340
|
-
|
|
341
|
-
--font-main: 'Inter', sans-serif;
|
|
342
|
-
--font-secondary: 'Lora', serif;
|
|
343
319
|
}
|
|
344
320
|
|
|
345
321
|
html[data-theme='legalfinity'] {
|
|
@@ -392,7 +368,4 @@ html[data-theme='legalfinity'] {
|
|
|
392
368
|
--others-white: #ffffff;
|
|
393
369
|
--others-disabled: #6b7280;
|
|
394
370
|
--others-black: #000;
|
|
395
|
-
|
|
396
|
-
--font-main: 'Poppins', sans-serif;
|
|
397
|
-
--font-secondary: 'Poppins', sans-serif;
|
|
398
371
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function throttle<T extends (...args: unknown[]) => unknown>(func: T, limit: number): (this: ThisParameterType<T>, ...args: Parameters<T>) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function throttle<T extends (...args: unknown[]) => unknown>(func: T, limit: number) {
|
|
2
|
+
let inThrottle: boolean | undefined
|
|
3
|
+
|
|
4
|
+
return function (this: ThisParameterType<T>, ...args: Parameters<T>): void {
|
|
5
|
+
if (!inThrottle) {
|
|
6
|
+
func.apply(this, args)
|
|
7
|
+
inThrottle = true
|
|
8
|
+
setTimeout(() => (inThrottle = false), limit)
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|