@npm_leadtech/legal-lib-components 7.64.0 → 7.65.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.
Files changed (85) hide show
  1. package/dist/css/styles.css +30 -17
  2. package/dist/src/components/atoms/FeatureItem/FeatureItem.d.ts +3 -0
  3. package/dist/src/components/atoms/FeatureItem/FeatureItem.js +5 -0
  4. package/dist/src/components/atoms/FeatureItem/FeatureItem.styled.d.ts +1 -0
  5. package/dist/src/components/atoms/FeatureItem/FeatureItem.styled.js +18 -0
  6. package/dist/src/components/atoms/FeatureItem/FeatureItem.styled.ts +19 -0
  7. package/dist/src/components/atoms/FeatureItem/FeatureItem.tsx +12 -0
  8. package/dist/src/components/atoms/FeatureItem/FeatureItemProps.d.ts +9 -0
  9. package/dist/src/components/atoms/FeatureItem/FeatureItemProps.js +1 -0
  10. package/dist/src/components/atoms/FeatureItem/FeatureItemProps.ts +10 -0
  11. package/dist/src/components/atoms/FeatureItem/index.d.ts +2 -0
  12. package/dist/src/components/atoms/FeatureItem/index.js +2 -0
  13. package/dist/src/components/atoms/FeatureItem/index.ts +2 -0
  14. package/dist/src/components/atoms/Logo/Logo.js +4 -2
  15. package/dist/src/components/atoms/Logo/Logo.tsx +4 -2
  16. package/dist/src/components/atoms/Logo/svg/legalfinity-logo.svg +15 -0
  17. package/dist/src/components/atoms/Logo/svg/legalfinity-white-logo.svg +15 -0
  18. package/dist/src/components/atoms/PlanCard/PlanCard.d.ts +3 -0
  19. package/dist/src/components/atoms/PlanCard/PlanCard.js +6 -0
  20. package/dist/src/components/atoms/PlanCard/PlanCard.styled.d.ts +8 -0
  21. package/dist/src/components/atoms/PlanCard/PlanCard.styled.js +75 -0
  22. package/dist/src/components/atoms/PlanCard/PlanCard.styled.ts +83 -0
  23. package/dist/src/components/atoms/PlanCard/PlanCard.tsx +42 -0
  24. package/dist/src/components/atoms/PlanCard/PlanCardProps.d.ts +23 -0
  25. package/dist/src/components/atoms/PlanCard/PlanCardProps.js +1 -0
  26. package/dist/src/components/atoms/PlanCard/PlanCardProps.ts +26 -0
  27. package/dist/src/components/atoms/PlanCard/index.d.ts +2 -0
  28. package/dist/src/components/atoms/PlanCard/index.js +2 -0
  29. package/dist/src/components/atoms/PlanCard/index.ts +2 -0
  30. package/dist/src/components/atoms/index.d.ts +2 -0
  31. package/dist/src/components/atoms/index.js +2 -0
  32. package/dist/src/components/atoms/index.ts +2 -0
  33. package/dist/src/components/molecules/StickyPlanBar/StickyPlanBar.d.ts +3 -0
  34. package/dist/src/components/molecules/StickyPlanBar/StickyPlanBar.js +5 -0
  35. package/dist/src/components/molecules/StickyPlanBar/StickyPlanBar.styled.d.ts +3 -0
  36. package/dist/src/components/molecules/StickyPlanBar/StickyPlanBar.styled.js +69 -0
  37. package/dist/src/components/molecules/StickyPlanBar/StickyPlanBar.styled.ts +72 -0
  38. package/dist/src/components/molecules/StickyPlanBar/StickyPlanBar.tsx +23 -0
  39. package/dist/src/components/molecules/StickyPlanBar/StickyPlanBarProps.d.ts +6 -0
  40. package/dist/src/components/molecules/StickyPlanBar/StickyPlanBarProps.js +1 -0
  41. package/dist/src/components/molecules/StickyPlanBar/StickyPlanBarProps.ts +7 -0
  42. package/dist/src/components/molecules/StickyPlanBar/index.d.ts +2 -0
  43. package/dist/src/components/molecules/StickyPlanBar/index.js +2 -0
  44. package/dist/src/components/molecules/StickyPlanBar/index.ts +2 -0
  45. package/dist/src/components/molecules/index.d.ts +1 -0
  46. package/dist/src/components/molecules/index.js +1 -0
  47. package/dist/src/components/molecules/index.ts +1 -0
  48. package/dist/src/components/organisms/PricingPageHeader/PricingPageHeader.d.ts +3 -0
  49. package/dist/src/components/organisms/PricingPageHeader/PricingPageHeader.js +7 -0
  50. package/dist/src/components/organisms/PricingPageHeader/PricingPageHeader.styled.d.ts +3 -0
  51. package/dist/src/components/organisms/PricingPageHeader/PricingPageHeader.styled.js +35 -0
  52. package/dist/src/components/organisms/PricingPageHeader/PricingPageHeader.styled.tsx +38 -0
  53. package/dist/src/components/organisms/PricingPageHeader/PricingPageHeader.tsx +21 -0
  54. package/dist/src/components/organisms/PricingPageHeader/PricingPageHeaderProps.d.ts +4 -0
  55. package/dist/src/components/organisms/PricingPageHeader/PricingPageHeaderProps.js +1 -0
  56. package/dist/src/components/organisms/PricingPageHeader/PricingPageHeaderProps.ts +4 -0
  57. package/dist/src/components/organisms/PricingPageHeader/index.d.ts +2 -0
  58. package/dist/src/components/organisms/PricingPageHeader/index.js +2 -0
  59. package/dist/src/components/organisms/PricingPageHeader/index.ts +2 -0
  60. package/dist/src/components/organisms/index.d.ts +1 -0
  61. package/dist/src/components/organisms/index.js +1 -0
  62. package/dist/src/components/organisms/index.ts +1 -0
  63. package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.d.ts +3 -0
  64. package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.js +58 -0
  65. package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.styled.d.ts +16 -0
  66. package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.styled.js +88 -0
  67. package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.styled.ts +107 -0
  68. package/dist/src/components/pages/PricingPlansPage/PricingPlansPage.tsx +128 -0
  69. package/dist/src/components/pages/PricingPlansPage/PricingPlansPageProps.d.ts +9 -0
  70. package/dist/src/components/pages/PricingPlansPage/PricingPlansPageProps.js +1 -0
  71. package/dist/src/components/pages/PricingPlansPage/PricingPlansPageProps.ts +10 -0
  72. package/dist/src/components/pages/PricingPlansPage/index.d.ts +2 -0
  73. package/dist/src/components/pages/PricingPlansPage/index.js +2 -0
  74. package/dist/src/components/pages/PricingPlansPage/index.ts +2 -0
  75. package/dist/src/components/pages/index.d.ts +1 -0
  76. package/dist/src/components/pages/index.js +1 -0
  77. package/dist/src/components/pages/index.ts +1 -0
  78. package/dist/src/globalStyles/animations.scss +8 -3
  79. package/dist/src/globalStyles/themes.scss +10 -19
  80. package/dist/src/globalStyles/variablesCss.scss +17 -0
  81. package/dist/src/utils/throttle.d.ts +1 -0
  82. package/dist/src/utils/throttle.js +10 -0
  83. package/dist/src/utils/throttle.ts +11 -0
  84. package/dist/tsconfig.build.tsbuildinfo +1 -1
  85. 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,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
+ }
@@ -0,0 +1,2 @@
1
+ export * from './PricingPlansPage';
2
+ export * from './PricingPlansPageProps';
@@ -0,0 +1,2 @@
1
+ export * from './PricingPlansPage';
2
+ export * from './PricingPlansPageProps';
@@ -0,0 +1,2 @@
1
+ export * from './PricingPlansPage'
2
+ export * from './PricingPlansPageProps'
@@ -12,3 +12,4 @@ export * from './RatafiaResultPage';
12
12
  export * from './UnsubscribePage';
13
13
  export * from './LoginRatafiaPage';
14
14
  export * from './PricingPage';
15
+ export * from './PricingPlansPage';
@@ -12,3 +12,4 @@ export * from './RatafiaResultPage';
12
12
  export * from './UnsubscribePage';
13
13
  export * from './LoginRatafiaPage';
14
14
  export * from './PricingPage';
15
+ export * from './PricingPlansPage';
@@ -12,3 +12,4 @@ export * from './RatafiaResultPage'
12
12
  export * from './UnsubscribePage'
13
13
  export * from './LoginRatafiaPage'
14
14
  export * from './PricingPage'
15
+ export * from './PricingPlansPage'
@@ -55,9 +55,14 @@
55
55
  }
56
56
 
57
57
  .background-ratafia-animation {
58
- background: radial-gradient(90.31% 103.09% at 74.2% -62.04%, rgba(7, 128, 128, 0.3) 0%, #062f3c 100%),
59
- radial-gradient(80.63% 44.37% at 73.54% 70.76%, #078080 0%, #052a37 100%),
60
- radial-gradient(92.19% 33.51% at 0% 0%, #078080 0%, #042b39 100%), #032a38;
58
+ background: radial-gradient(
59
+ 90.31% 103.09% at 74.2% -62.04%,
60
+ var(--primary-main-dark-2) 0%,
61
+ var(--primary-main-dark-1) 100%
62
+ ),
63
+ radial-gradient(80.63% 44.37% at 73.54% 70.76%, var(--primary-main) 0%, var(--primary-main-dark-2) 100%),
64
+ radial-gradient(92.19% 33.51% at 0% 0%, var(--primary-main) 0%, var(--primary-main-dark-1) 100%),
65
+ var(--primary-main-dark-2);
61
66
  background-blend-mode: lighten, lighten, lighten, normal;
62
67
  background-size: 150% 150%;
63
68
  animation: gradientAnimation 4s ease infinite;
@@ -52,8 +52,7 @@ html {
52
52
  --others-white: #fff;
53
53
  --others-disabled: #6b7280;
54
54
  --others-black: #000;
55
-
56
- --font-main: 'Inter', sans-serif;
55
+ --font-primary: 'Inter', sans-serif;
57
56
  --font-secondary: 'Lora', serif;
58
57
  }
59
58
 
@@ -89,8 +88,7 @@ html[data-theme='districtlaws'] {
89
88
  --others-white: #fff;
90
89
  --others-disabled: #6b7280;
91
90
  --others-black: #000;
92
-
93
- --font-main: 'Inter', sans-serif;
91
+ --font-primary: 'Inter', sans-serif;
94
92
  --font-secondary: 'Lora', serif;
95
93
  }
96
94
 
@@ -126,8 +124,7 @@ html[data-theme='lawdistricts'] {
126
124
  --others-white: #fff;
127
125
  --others-disabled: #6b7280;
128
126
  --others-black: #000;
129
-
130
- --font-main: 'Inter', sans-serif;
127
+ --font-primary: 'Inter', sans-serif;
131
128
  --font-secondary: 'Lora', serif;
132
129
  }
133
130
 
@@ -163,8 +160,7 @@ html[data-theme='lawdistrict'] {
163
160
  --others-white: #fff;
164
161
  --others-disabled: #6b7280;
165
162
  --others-black: #000;
166
-
167
- --font-main: 'Inter', sans-serif;
163
+ --font-primary: 'Inter', sans-serif;
168
164
  --font-secondary: 'Lora', serif;
169
165
  }
170
166
 
@@ -226,8 +222,7 @@ html[data-theme='lawsdistrict'] {
226
222
  --others-white: #fff;
227
223
  --others-disabled: #6b7280;
228
224
  --others-black: #000;
229
-
230
- --font-main: 'Inter', sans-serif;
225
+ --font-primary: 'Inter', sans-serif;
231
226
  --font-secondary: 'Lora', serif;
232
227
  }
233
228
 
@@ -263,8 +258,7 @@ html[data-theme='lawdistrictinfo'] {
263
258
  --others-white: #fff;
264
259
  --others-disabled: #6b7280;
265
260
  --others-black: #000;
266
-
267
- --font-main: 'Inter', sans-serif;
261
+ --font-primary: 'Inter', sans-serif;
268
262
  --font-secondary: 'Lora', serif;
269
263
  }
270
264
 
@@ -300,8 +294,7 @@ html[data-theme='uslawdistrict'] {
300
294
  --others-white: #fff;
301
295
  --others-disabled: #6b7280;
302
296
  --others-black: #000;
303
-
304
- --font-main: 'Inter', sans-serif;
297
+ --font-primary: 'Inter', sans-serif;
305
298
  --font-secondary: 'Lora', serif;
306
299
  }
307
300
 
@@ -337,8 +330,7 @@ html[data-theme='lawdistrictonline'] {
337
330
  --others-white: #fff;
338
331
  --others-disabled: #6b7280;
339
332
  --others-black: #000;
340
-
341
- --font-main: 'Inter', sans-serif;
333
+ --font-primary: 'Inter', sans-serif;
342
334
  --font-secondary: 'Lora', serif;
343
335
  }
344
336
 
@@ -392,7 +384,6 @@ html[data-theme='legalfinity'] {
392
384
  --others-white: #ffffff;
393
385
  --others-disabled: #6b7280;
394
386
  --others-black: #000;
395
-
396
- --font-main: 'Poppins', sans-serif;
397
- --font-secondary: 'Poppins', sans-serif;
387
+ --font-primary: 'Poppins', sans-serif;
388
+ --font-secondary: 'Poppins', serif;
398
389
  }
@@ -14,3 +14,20 @@ html {
14
14
 
15
15
  --global-gap: 1rem;
16
16
  }
17
+
18
+ html[data-theme='legalfinity'] {
19
+ --font-sans: 'Poppins', sans-serif;
20
+ --font-serif: 'Poppins', serif;
21
+
22
+ --s-border-radius: 0.25rem;
23
+ --m-border-radius: 0.5rem;
24
+ --l-border-radius: 1rem;
25
+
26
+ --box-shadow-small: 0 0.125rem 0.375rem 0 rgba(var(--primary-main-dark-1-rgb), 0.25);
27
+ --box-shadow-medium: 0 0.25rem 0.5rem 0 rgba(var(--primary-main-dark-1-rgb), 0.2);
28
+ --box-shadow-menu: 0 0.25rem 0.5rem -0.5rem rgba(var(--primary-main-dark-1-rgb), 0.2);
29
+ --box-shadow-tippy-box: 0 0.25rem 0.5rem 0.25rem rgba(var(--primary-main-dark-1-rgb), 0.2);
30
+ --box-shadow-container: 0px 2px 6px 0px rgba(var(--primary-main-dark-1-rgb), 0.25);
31
+
32
+ --global-gap: 1rem;
33
+ }
@@ -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,10 @@
1
+ export function throttle(func, limit) {
2
+ let inThrottle;
3
+ return function (...args) {
4
+ if (!inThrottle) {
5
+ func.apply(this, args);
6
+ inThrottle = true;
7
+ setTimeout(() => (inThrottle = false), limit);
8
+ }
9
+ };
10
+ }
@@ -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
+ }