Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/clean-doodles-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@clerk/clerk-js': patch
'@clerk/types': patch
---

Exclude matrix variant of `<PricingTable />`.
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ const PricingTable = (props: __experimental_PricingTableProps) => {

return (
<>
{mode !== 'modal' && props.layout === 'matrix' ? (
{mode !== 'modal' && (props as any).layout === 'matrix' ? (
<PricingTableMatrix
plans={plans || []}
planPeriod={planPeriod}
setPlanPeriod={setPlanPeriod}
onSelect={selectPlan}
highlightedPlan={props.highlightPlan}
highlightedPlan={(props as any).highlightPlan}
/>
) : (
<PricingTableDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,8 @@ interface CardProps {

function Card(props: CardProps) {
const { plan, planPeriod, setPlanPeriod, onSelect, props: pricingTableProps, isCompact = false } = props;
const isDefaultLayout = pricingTableProps.layout === 'default';
const ctaPosition = (isDefaultLayout && pricingTableProps.ctaPosition) || 'top';
const collapseFeatures = (isDefaultLayout && pricingTableProps.collapseFeatures) || false;
const ctaPosition = pricingTableProps.ctaPosition || 'top';
const collapseFeatures = pricingTableProps.collapseFeatures || false;
const { id, slug, isDefault, features } = plan;
const totalFeatures = features.length;
const hasFeatures = totalFeatures > 0;
Expand Down
8 changes: 1 addition & 7 deletions packages/types/src/clerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1561,23 +1561,17 @@ export type WaitlistProps = {
export type WaitlistModalProps = WaitlistProps;

type __experimental_PricingTableDefaultProps = {
layout?: 'default';
ctaPosition?: 'top' | 'bottom';
collapseFeatures?: boolean;
};

type __experimental_PricingTableMatrixProps = {
layout?: 'matrix';
highlightPlan?: string;
};

type __experimental_PricingTableBaseProps = {
appearance?: PricingTableTheme;
checkoutProps?: Pick<__experimental_CheckoutProps, 'appearance'>;
};

export type __experimental_PricingTableProps = __experimental_PricingTableBaseProps &
(__experimental_PricingTableDefaultProps | __experimental_PricingTableMatrixProps);
__experimental_PricingTableDefaultProps;

export type __experimental_CheckoutProps = {
appearance?: CheckoutTheme;
Expand Down