Skip to content

Commit 5d78b28

Browse files
authored
fix(clerk-js,types): Exclude matrix variant from the public api (#5724)
1 parent 0b7e106 commit 5d78b28

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

.changeset/clean-doodles-thank.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
'@clerk/types': patch
4+
---
5+
6+
Exclude matrix variant of `<PricingTable />`.

packages/clerk-js/src/ui/components/PricingTable/PricingTable.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ const PricingTable = (props: __experimental_PricingTableProps) => {
4343

4444
return (
4545
<>
46-
{mode !== 'modal' && props.layout === 'matrix' ? (
46+
{mode !== 'modal' && (props as any).layout === 'matrix' ? (
4747
<PricingTableMatrix
4848
plans={plans || []}
4949
planPeriod={planPeriod}
5050
setPlanPeriod={setPlanPeriod}
5151
onSelect={selectPlan}
52-
highlightedPlan={props.highlightPlan}
52+
highlightedPlan={(props as any).highlightPlan}
5353
/>
5454
) : (
5555
<PricingTableDefault

packages/clerk-js/src/ui/components/PricingTable/PricingTableDefault.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,8 @@ interface CardProps {
100100

101101
function Card(props: CardProps) {
102102
const { plan, planPeriod, setPlanPeriod, onSelect, props: pricingTableProps, isCompact = false } = props;
103-
const isDefaultLayout = pricingTableProps.layout === 'default';
104-
const ctaPosition = (isDefaultLayout && pricingTableProps.ctaPosition) || 'top';
105-
const collapseFeatures = (isDefaultLayout && pricingTableProps.collapseFeatures) || false;
103+
const ctaPosition = pricingTableProps.ctaPosition || 'top';
104+
const collapseFeatures = pricingTableProps.collapseFeatures || false;
106105
const { id, slug, isDefault, features } = plan;
107106
const totalFeatures = features.length;
108107
const hasFeatures = totalFeatures > 0;

packages/types/src/clerk.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -1561,23 +1561,17 @@ export type WaitlistProps = {
15611561
export type WaitlistModalProps = WaitlistProps;
15621562

15631563
type __experimental_PricingTableDefaultProps = {
1564-
layout?: 'default';
15651564
ctaPosition?: 'top' | 'bottom';
15661565
collapseFeatures?: boolean;
15671566
};
15681567

1569-
type __experimental_PricingTableMatrixProps = {
1570-
layout?: 'matrix';
1571-
highlightPlan?: string;
1572-
};
1573-
15741568
type __experimental_PricingTableBaseProps = {
15751569
appearance?: PricingTableTheme;
15761570
checkoutProps?: Pick<__experimental_CheckoutProps, 'appearance'>;
15771571
};
15781572

15791573
export type __experimental_PricingTableProps = __experimental_PricingTableBaseProps &
1580-
(__experimental_PricingTableDefaultProps | __experimental_PricingTableMatrixProps);
1574+
__experimental_PricingTableDefaultProps;
15811575

15821576
export type __experimental_CheckoutProps = {
15831577
appearance?: CheckoutTheme;

0 commit comments

Comments
 (0)