@npm_leadtech/legal-lib-components 7.70.0 → 7.70.2

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.
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Benefit, BenefitsList, Divider, PlanCardContainer, PlanTitle, Price, PriceLabel, PricingInfo } from './PlanCard.styled';
3
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", { className: 'benefit-text', dangerouslySetInnerHTML: { __html: item?.benefit } })] }, item?.benefit))) })] }));
4
+ export const PlanCard = ({ plan, onSelect, isRedirectingToPayment }) => {
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', disabled: isRedirectingToPayment }), _jsx(Divider, {}), _jsx(BenefitsList, { children: plan?.benefits?.map((item) => (_jsxs(Benefit, { className: item?.type == 'default' ? 'default' : 'ai-benefit', children: [item?.icon, _jsx("p", { className: 'benefit-text', dangerouslySetInnerHTML: { __html: item?.benefit } })] }, item?.benefit))) })] }));
6
6
  };
@@ -12,7 +12,7 @@ import { Button } from '../Button'
12
12
  import { PlanCardProps } from './PlanCardProps'
13
13
  import React from 'react'
14
14
 
15
- export const PlanCard: React.FC<PlanCardProps> = ({ plan, onSelect }) => {
15
+ export const PlanCard: React.FC<PlanCardProps> = ({ plan, onSelect, isRedirectingToPayment }) => {
16
16
  return (
17
17
  <PlanCardContainer>
18
18
  <PlanTitle className={plan?.highlightPlan ? 'highlight' : 'asdfasdf'}>{plan?.subscription_type?.name}</PlanTitle>
@@ -27,6 +27,7 @@ export const PlanCard: React.FC<PlanCardProps> = ({ plan, onSelect }) => {
27
27
  onClick={() => onSelect?.(plan?.subscription_type?.sku ?? '')}
28
28
  givenClass='pricing-plan__button'
29
29
  color={plan?.highlightPlan ? 'primary' : 'transparent'}
30
+ disabled={isRedirectingToPayment}
30
31
  />
31
32
  <Divider />
32
33
  <BenefitsList>
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
2
2
  export interface PlanCardProps {
3
3
  plan: SubscriptionPlan;
4
4
  onSelect?: (sku: string) => void;
5
+ isRedirectingToPayment?: boolean;
5
6
  }
6
7
  export interface SubscriptionPlan {
7
8
  benefits?: Benefit[];
@@ -3,6 +3,7 @@ import { ReactNode } from 'react'
3
3
  export interface PlanCardProps {
4
4
  plan: SubscriptionPlan
5
5
  onSelect?: (sku: string) => void
6
+ isRedirectingToPayment?: boolean
6
7
  }
7
8
 
8
9
  export interface SubscriptionPlan {
@@ -5,7 +5,7 @@ import { PricingPageHeader } from '../../organisms';
5
5
  import React from 'react';
6
6
  import { StickyPlanBar } from '../../molecules/StickyPlanBar';
7
7
  import { throttle } from '../../../utils/throttle';
8
- export const PricingPlansPage = ({ subscriptionPlans, features, onPlanSelect, headerDivider, siteName = 'Legalfinity', phoneNumber }) => {
8
+ export const PricingPlansPage = ({ subscriptionPlans, features, onPlanSelect, headerDivider, siteName = 'Legalfinity', phoneNumber, isRedirectingToPayment }) => {
9
9
  const [activePlanIndex, setActivePlanIndex] = React.useState(0);
10
10
  const plansWrapperRef = React.useRef(null);
11
11
  const lastScrollYRef = React.useRef(0);
@@ -54,5 +54,5 @@ export const PricingPlansPage = ({ subscriptionPlans, features, onPlanSelect, he
54
54
  window.removeEventListener('resize', handleResize);
55
55
  };
56
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 })] }))] }));
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, { isRedirectingToPayment: isRedirectingToPayment, 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
58
  };
@@ -20,7 +20,8 @@ export const PricingPlansPage: React.FC<PricingPlansPageProps> = ({
20
20
  onPlanSelect,
21
21
  headerDivider,
22
22
  siteName = 'Legalfinity',
23
- phoneNumber
23
+ phoneNumber,
24
+ isRedirectingToPayment
24
25
  }) => {
25
26
  const [activePlanIndex, setActivePlanIndex] = React.useState(0)
26
27
  const plansWrapperRef = React.useRef<HTMLDivElement | null>(null)
@@ -107,7 +108,11 @@ export const PricingPlansPage: React.FC<PricingPlansPageProps> = ({
107
108
  isActive={index === activePlanIndex}
108
109
  className={`pricing-plan__element-container ${plan?.highlightPlan ? 'highlight' : ''} ${index === activePlanIndex ? 'active' : ''}`}
109
110
  >
110
- <PlanCard onSelect={onPlanSelect ?? (() => {})} plan={plan} />
111
+ <PlanCard
112
+ isRedirectingToPayment={isRedirectingToPayment}
113
+ onSelect={onPlanSelect ?? (() => {})}
114
+ plan={plan}
115
+ />
111
116
  </PlanWrapper>
112
117
  ))}
113
118
  </PlansWrapper>
@@ -6,4 +6,5 @@ export interface PricingPlansPageProps {
6
6
  headerDivider?: React.ReactNode;
7
7
  siteName?: string;
8
8
  phoneNumber?: string;
9
+ isRedirectingToPayment?: boolean;
9
10
  }
@@ -7,4 +7,5 @@ export interface PricingPlansPageProps {
7
7
  headerDivider?: React.ReactNode
8
8
  siteName?: string
9
9
  phoneNumber?: string
10
+ isRedirectingToPayment?: boolean
10
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "7.70.0",
3
+ "version": "7.70.2",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",