@stigg/react-sdk 4.11.0 → 4.12.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/components/common/Typography.d.ts +2 -0
- package/dist/react-sdk.cjs.development.js +41 -16
- package/dist/react-sdk.cjs.development.js.map +1 -1
- package/dist/react-sdk.cjs.production.min.js +1 -1
- package/dist/react-sdk.cjs.production.min.js.map +1 -1
- package/dist/react-sdk.esm.js +48 -17
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/common/TiersSelectContainer.tsx +1 -1
- package/src/components/common/Typography.tsx +3 -0
- package/src/components/customerPortal/billing/PaymentDetailsSection.tsx +8 -4
- package/src/components/customerPortal/subscriptionOverview/tabs/Promotions.tsx +3 -3
- package/src/components/customerPortal/subscriptionOverview/tabs/SubscriptionTabs.style.tsx +1 -1
- package/src/components/customerPortal/subscriptionOverview/upcomingBilling/NextEstimatedBill.tsx +1 -1
- package/src/components/customerPortal/usage/CustomerUsageData.tsx +1 -1
- package/src/components/customerPortal/usage/featureUsage/FeatureUsageProgressBar.tsx +3 -1
- package/src/components/paywall/PlanPrice.tsx +6 -4
- package/src/stories/Checkout.stories.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.
|
|
2
|
+
"version": "4.12.1",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"@emotion/react": "^11.10.5",
|
|
113
113
|
"@emotion/styled": "^11.10.5",
|
|
114
114
|
"@mui/material": "^5.12.0",
|
|
115
|
-
"@stigg/js-client-sdk": "2.24.
|
|
115
|
+
"@stigg/js-client-sdk": "2.24.6",
|
|
116
116
|
"@stripe/react-stripe-js": "^2.1.1",
|
|
117
117
|
"@stripe/stripe-js": "^1.54.1",
|
|
118
118
|
"@types/styled-components": "^5.1.26",
|
|
@@ -48,7 +48,7 @@ export function TiersSelectContainer({
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
|
-
<Typography className="stigg-price-tier-select" style={{ minHeight: '46px' }}>
|
|
51
|
+
<Typography as="div" className="stigg-price-tier-select" style={{ minHeight: '46px' }}>
|
|
52
52
|
{tiers ? (
|
|
53
53
|
<TierSelect
|
|
54
54
|
value={selectedTier ? selectedTier.upTo.toString() : tiers[0].upTo.toString()}
|
|
@@ -25,6 +25,7 @@ export type TypographyProps = {
|
|
|
25
25
|
className?: string;
|
|
26
26
|
bold?: boolean;
|
|
27
27
|
span?: boolean;
|
|
28
|
+
as?: 'div' | 'p' | 'span';
|
|
28
29
|
} & Omit<TypeProps, 'color' | 'level'>;
|
|
29
30
|
|
|
30
31
|
function getColor(theme: Theme, $color: Colors) {
|
|
@@ -105,6 +106,7 @@ export const Typography = forwardRef((props: TypographyProps, ref) => {
|
|
|
105
106
|
color = 'primary',
|
|
106
107
|
overrideColor,
|
|
107
108
|
bold,
|
|
109
|
+
as = 'p',
|
|
108
110
|
...rest
|
|
109
111
|
} = props;
|
|
110
112
|
const theme = useTheme();
|
|
@@ -114,6 +116,7 @@ export const Typography = forwardRef((props: TypographyProps, ref) => {
|
|
|
114
116
|
|
|
115
117
|
return (
|
|
116
118
|
<StyledText
|
|
119
|
+
as={as}
|
|
117
120
|
ref={ref}
|
|
118
121
|
{...rest}
|
|
119
122
|
className={className}
|
|
@@ -22,13 +22,13 @@ export function PaymentDetailsSection() {
|
|
|
22
22
|
if (isLoadingData) {
|
|
23
23
|
items.push(
|
|
24
24
|
...[
|
|
25
|
-
<InformationGridContainer>
|
|
25
|
+
<InformationGridContainer key="information-loading-data-top">
|
|
26
26
|
<Skeleton width={220} height={12} />
|
|
27
27
|
<Skeleton width={220} height={12} />
|
|
28
28
|
<Skeleton width={220} height={12} />
|
|
29
29
|
</InformationGridContainer>,
|
|
30
|
-
<Divider orientation="vertical" style={{ minHeight: 93 }} />,
|
|
31
|
-
<InformationGridContainer>
|
|
30
|
+
<Divider key="information-loading-data-divider" orientation="vertical" style={{ minHeight: 93 }} />,
|
|
31
|
+
<InformationGridContainer key="information-loading-data-bottom">
|
|
32
32
|
<Skeleton width={220} height={12} />
|
|
33
33
|
<Skeleton width={220} height={12} />
|
|
34
34
|
<Skeleton width={220} height={12} />
|
|
@@ -38,6 +38,7 @@ export function PaymentDetailsSection() {
|
|
|
38
38
|
} else {
|
|
39
39
|
items.push(
|
|
40
40
|
<InformationGrid
|
|
41
|
+
key="information-billing-data-billed-to"
|
|
41
42
|
title="Billed to"
|
|
42
43
|
rows={[
|
|
43
44
|
{
|
|
@@ -62,9 +63,12 @@ export function PaymentDetailsSection() {
|
|
|
62
63
|
billingInformation.defaultPaymentExpirationMonth &&
|
|
63
64
|
billingInformation.defaultPaymentExpirationYear
|
|
64
65
|
) {
|
|
65
|
-
items.unshift(
|
|
66
|
+
items.unshift(
|
|
67
|
+
<Divider key="information-billing-data-divider" orientation="vertical" style={{ minHeight: 93 }} />,
|
|
68
|
+
);
|
|
66
69
|
items.unshift(
|
|
67
70
|
<InformationGrid
|
|
71
|
+
key="information-billing-data-payment-method"
|
|
68
72
|
title="Payment method"
|
|
69
73
|
rows={[
|
|
70
74
|
{
|
|
@@ -13,7 +13,7 @@ const Row = styled.div<{ $borderColor: string }>`
|
|
|
13
13
|
border-bottom: ${({ $borderColor }) => `1px solid ${$borderColor}`};
|
|
14
14
|
padding: 16px 0;
|
|
15
15
|
|
|
16
|
-
& > *:first-
|
|
16
|
+
& > *:first-of-type {
|
|
17
17
|
max-width: 60%;
|
|
18
18
|
}
|
|
19
19
|
`;
|
|
@@ -47,8 +47,8 @@ export function Promotions() {
|
|
|
47
47
|
Expiration date
|
|
48
48
|
</Typography>
|
|
49
49
|
</Row>
|
|
50
|
-
{promotionalEntitlements?.map((promotionalEntitlement) => (
|
|
51
|
-
<Row $borderColor={theme.borderColor}>
|
|
50
|
+
{promotionalEntitlements?.map((promotionalEntitlement, index) => (
|
|
51
|
+
<Row key={`${promotionalEntitlement.displayName}-${index}`} $borderColor={theme.borderColor}>
|
|
52
52
|
<Typography variant="body1">{getPromotionTitle(promotionalEntitlement)}</Typography>
|
|
53
53
|
<Typography variant="body1" color="disabled">
|
|
54
54
|
{promotionalEntitlement.endDate
|
|
@@ -14,7 +14,7 @@ export const TabsLayout = styled.div`
|
|
|
14
14
|
margin-top: 16px;
|
|
15
15
|
`;
|
|
16
16
|
|
|
17
|
-
export const TabContent = styled(Box)<{ $maxHeight: string }>`
|
|
17
|
+
export const TabContent = styled(Box, { shouldForwardProp: (prop) => !prop.startsWith('$') })<{ $maxHeight: string }>`
|
|
18
18
|
margin-top: 16px;
|
|
19
19
|
max-height: ${({ $maxHeight }) => $maxHeight};
|
|
20
20
|
overflow-y: auto;
|
package/src/components/customerPortal/subscriptionOverview/upcomingBilling/NextEstimatedBill.tsx
CHANGED
|
@@ -16,7 +16,7 @@ export function NextEstimatedBill({ billingPeriod, rangeEnd, amount, currency }:
|
|
|
16
16
|
<>
|
|
17
17
|
<Typography variant="h6">Next estimated bill</Typography>
|
|
18
18
|
<Typography variant="h1">{currencyPriceFormatter({ amount, currency, maximumFractionDigits: 2 })}</Typography>
|
|
19
|
-
<Typography variant="body1" color="secondary">
|
|
19
|
+
<Typography as="div" variant="body1" color="secondary">
|
|
20
20
|
Billed {billingPeriod === BillingPeriod.Monthly ? 'monthly' : 'annually'} on{' '}
|
|
21
21
|
<Typography variant="body1" span color="primary">
|
|
22
22
|
{moment.utc(rangeEnd).format('MMM Do, YYYY')}
|
|
@@ -77,7 +77,7 @@ export function CustomerUsageData({ onManageSubscription, onBuyMore }: CustomerU
|
|
|
77
77
|
<>
|
|
78
78
|
<Grid container spacing={4}>
|
|
79
79
|
{entitlementsToShow.map((entitlement) => (
|
|
80
|
-
<Grid item xs={xs}>
|
|
80
|
+
<Grid key={entitlement.feature!.refId} item xs={xs}>
|
|
81
81
|
<FeatureUsage
|
|
82
82
|
key={entitlement.feature!.refId}
|
|
83
83
|
subscriptionPrice={subscriptionPriceByFeature[entitlement.feature!.refId]}
|
|
@@ -6,7 +6,9 @@ import Divider from '@mui/material/Divider';
|
|
|
6
6
|
import Color from 'color';
|
|
7
7
|
import { getUsagePercentage, getUsageProgressStatus } from './FeatureUsage.helper';
|
|
8
8
|
|
|
9
|
-
export const StyledLinearProgress = styled(LinearProgress
|
|
9
|
+
export const StyledLinearProgress = styled(LinearProgress, { shouldForwardProp: (prop) => !prop.startsWith('$') })<{
|
|
10
|
+
$progressStatus: 'standard' | 'warning' | 'error';
|
|
11
|
+
}>`
|
|
10
12
|
height: 4px;
|
|
11
13
|
background-color: ${({ theme }) => Color(theme.stigg.palette.primary).alpha(0.4).string()};
|
|
12
14
|
|
|
@@ -107,7 +107,7 @@ export const PlanPrice = ({
|
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
return (
|
|
110
|
-
<PlanPriceContainer className="stigg-price-text">
|
|
110
|
+
<PlanPriceContainer as="div" className="stigg-price-text">
|
|
111
111
|
<>
|
|
112
112
|
{withStartingAtRow && (
|
|
113
113
|
<Typography
|
|
@@ -119,11 +119,13 @@ export const PlanPrice = ({
|
|
|
119
119
|
</Typography>
|
|
120
120
|
)}
|
|
121
121
|
|
|
122
|
-
<PriceSpan variant="h1">
|
|
122
|
+
<PriceSpan className="stigg-price-point" variant="h1">
|
|
123
|
+
{price}
|
|
124
|
+
</PriceSpan>
|
|
123
125
|
|
|
124
126
|
{withUnitPriceRow && (
|
|
125
|
-
<Typography className="stigg-price-unit-and-billing-period-text" style={{ minHeight: '48px' }}>
|
|
126
|
-
<UnitSpan span variant="h6" color="secondary">
|
|
127
|
+
<Typography as="div" className="stigg-price-unit-and-billing-period-text" style={{ minHeight: '48px' }}>
|
|
128
|
+
<UnitSpan className="stigg-price-unit-text" span variant="h6" color="secondary">
|
|
127
129
|
{unit}
|
|
128
130
|
</UnitSpan>
|
|
129
131
|
|