From 0364a4b89e91eca5d54bf0dba13fce20feb5bfcb Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Sat, 3 May 2025 22:26:29 -0500 Subject: [PATCH 01/28] pricing card layout tweaks --- .../PricingTable/PricingTableDefault.tsx | 108 ++++++++++-------- 1 file changed, 60 insertions(+), 48 deletions(-) diff --git a/packages/clerk-js/src/ui/components/PricingTable/PricingTableDefault.tsx b/packages/clerk-js/src/ui/components/PricingTable/PricingTableDefault.tsx index 7cf0dec27b5..84abe07e4c5 100644 --- a/packages/clerk-js/src/ui/components/PricingTable/PricingTableDefault.tsx +++ b/packages/clerk-js/src/ui/components/PricingTable/PricingTableDefault.tsx @@ -63,6 +63,7 @@ export function PricingTableDefault({ '--column-width': 'max(var(--max-column-width), min(var(--grid-min-size, 10rem), 100%))', display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(var(--column-width), 1fr))', + gridTemplateRows: 'auto 1fr', gap: `var(--grid-gap-y, var(--grid-gap, ${t.space.$4})) var(--grid-gap, ${t.space.$4})`, alignItems: 'stretch', width: '100%', @@ -130,8 +131,10 @@ function Card(props: CardProps) { elementDescriptor={descriptors.pricingTableCard} elementId={descriptors.pricingTableCard.setId(slug)} sx={t => ({ - display: 'flex', - flexDirection: 'column', + display: 'grid', + gap: 0, + gridTemplateRows: 'subgrid', + gridRow: 'span 2', background: common.mergedColorsBackground( colors.setAlpha(t.colors.$colorBackground, 1), t.colors.$neutralAlpha50, @@ -152,52 +155,60 @@ function Card(props: CardProps) { planPeriod={planPeriod} setPlanPeriod={setPlanPeriod} /> - - {!collapseFeatures ? ( - ({ - display: 'flex', - flexDirection: 'column', - flex: '1', - padding: hasFeatures ? (isCompact ? t.space.$3 : t.space.$4) : 0, - backgroundColor: hasFeatures ? t.colors.$colorBackground : undefined, - borderTopWidth: hasFeatures ? t.borderWidths.$normal : 0, - borderTopStyle: t.borderStyles.$solid, - borderTopColor: t.colors.$neutralAlpha100, - })} - data-variant={isCompact ? 'compact' : 'default'} - > - - - ) : null} - {(!plan.isDefault || !isDefaultPlanImplicitlyActiveOrUpcoming) && ( - ({ - marginTop: 'auto', - padding: isCompact ? t.space.$3 : t.space.$4, - borderTopWidth: hasFeatures ? t.borderWidths.$normal : 0, - borderTopStyle: t.borderStyles.$solid, - borderTopColor: t.colors.$neutralAlpha100, - background: undefined, - })} - > -