@molecule/app-billing-react 1.0.2 → 1.0.4

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 +1 @@
1
- {"version":3,"file":"PricingPage.d.ts","sourceRoot":"","sources":["../src/PricingPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOtC,OAAO,KAAK,EAAoB,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAEpE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,KAAK,CAAC,YAAY,CAOpF;AAED,gCAAgC;AAChC,MAAM,WAAW,eAAe;IAC9B,2DAA2D;IAC3D,QAAQ,EAAE,SAAS,CAAA;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,QAAe,EAAE,EAAE,eAAe,GAAG,KAAK,CAAC,YAAY,CAmB7F;AAwBD,mCAAmC;AACnC,MAAM,WAAW,gBAAgB,CAAC,OAAO,GAAG,OAAO;IACjD;;;;OAIG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAA;IAEnC;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,KAAK,CAAC,SAAS,CAAA;IAEnD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB,mFAAmF;IACnF,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IA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,CAAA;IAEnB,mFAAmF;IACnF,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAEvC;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAE9B;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACnC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAG,OAAO,EAC3C,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,GAC/B,KAAK,CAAC,YAAY,CAuJpB"}
@@ -118,7 +118,7 @@ export function PricingPage(props) {
118
118
  window.location.reload();
119
119
  }
120
120
  };
121
- return (_jsxs("section", { className: cm.cn(cm.maxW('6xl'), cm.mxAuto, cm.sp('px', 6), cm.sp('py', 12), className), "data-mol-id": "pricing-page", children: [_jsxs("header", { className: cm.cn(cm.textCenter, cm.sp('mb', 10)), children: [_jsx("h1", { className: cm.cn(cm.textSize('4xl'), cm.fontWeight('bold'), cm.sp('mb', 3)), style: headlineStyle, "data-mol-id": "pricing-page-heading", children: t(headingKey, undefined, { defaultValue: headingDefault }) }), subheadingKey !== null && (_jsx("p", { className: cm.cn(cm.textSize('lg'), cm.textMuted, cm.maxW('2xl'), cm.mxAuto), "data-mol-id": "pricing-page-subheading", children: t(subheadingKey, undefined, { defaultValue: subheadingDefault }) }))] }), _jsx("div", { className: cm.flex({
121
+ return (_jsxs("section", { className: cm.cn(cm.maxW('6xl'), cm.mxAuto, cm.sp('px', 6), cm.sp('py', 12), className), "data-mol-id": "pricing-page", children: [_jsxs("section", { className: cm.cn(cm.textCenter, cm.sp('mb', 10)), children: [_jsx("h1", { className: cm.cn(cm.textSize('4xl'), cm.fontWeight('bold'), cm.sp('mb', 3)), style: headlineStyle, "data-mol-id": "pricing-page-heading", children: t(headingKey, undefined, { defaultValue: headingDefault }) }), subheadingKey !== null && (_jsx("p", { className: cm.cn(cm.textSize('lg'), cm.textMuted, cm.maxW('2xl'), cm.mxAuto), "data-mol-id": "pricing-page-subheading", children: t(subheadingKey, undefined, { defaultValue: subheadingDefault }) }))] }), _jsx("div", { className: cm.flex({
122
122
  direction: 'row',
123
123
  wrap: 'wrap',
124
124
  gap: 'lg',
@@ -179,23 +179,20 @@ function TierCard({ tier, period, cm, t, renderLimits, onUpgrade, starting, popu
179
179
  borderRadius: '999px',
180
180
  lineHeight: 1.2,
181
181
  zIndex: 1,
182
- }, "data-mol-id": `pricing-tier-${tier.key}-popular-badge`, children: t('billing.pricing.mostPopular', undefined, { defaultValue: 'Most popular' }) })), _jsxs("header", { className: cm.cardHeader, children: [!popular && (_jsx("p", { className: cm.cn(cm.textSize('xs'), cm.textSubtle, cm.fontWeight('semibold'), cm.uppercase, cm.trackingWide, cm.sp('mb', 2)), "data-mol-id": `pricing-tier-${tier.key}-eyebrow`, children: t('billing.pricing.tierEyebrow', undefined, { defaultValue: 'Tier' }) })), _jsx("h2", { className: cm.cn(cm.textSize('2xl'), cm.italic, cm.fontWeight('semibold'), cm.sp('mb', 4)), style: headlineStyle, children: tier.name }), _jsxs("p", { children: [_jsx("span", { className: cm.cn(cm.textSize('5xl'), cm.fontWeight('bold'), popular && cm.textPrimary), style: headlineStyle, children: price?.price ?? '—' }), tier.perSeat && (_jsxs("span", { className: cm.cn(cm.textSize('sm'), cm.textMuted, cm.fontWeight('normal')), children: [' ', t('billing.pricing.perSeat', undefined, { defaultValue: 'per seat' })] }))] }), _jsxs("p", { className: cm.cn(cm.textSize('xs'), cm.textSubtle, cm.fontWeight('semibold'), cm.uppercase, cm.trackingWide, cm.sp('mt', 2)), children: [t(`billing.pricing.billed.${price?.period ?? 'month'}`, undefined, {
182
+ }, "data-mol-id": `pricing-tier-${tier.key}-popular-badge`, children: t('billing.pricing.mostPopular', undefined, { defaultValue: 'Most popular' }) })), _jsxs("div", { className: cm.cardHeader, children: [!popular && (_jsx("p", { className: cm.cn(cm.textSize('xs'), cm.textSubtle, cm.fontWeight('semibold'), cm.uppercase, cm.trackingWide, cm.sp('mb', 2)), "data-mol-id": `pricing-tier-${tier.key}-eyebrow`, children: t('billing.pricing.tierEyebrow', undefined, { defaultValue: 'Tier' }) })), _jsx("h2", { className: cm.cn(cm.textSize('2xl'), cm.italic, cm.fontWeight('semibold'), cm.sp('mb', 4)), style: headlineStyle, children: tier.name }), _jsxs("p", { children: [_jsx("span", { className: cm.cn(cm.textSize('5xl'), cm.fontWeight('bold'), popular && cm.textPrimary), style: headlineStyle, children: price?.price ?? '—' }), tier.perSeat && (_jsxs("span", { className: cm.cn(cm.textSize('sm'), cm.textMuted, cm.fontWeight('normal')), children: [' ', t('billing.pricing.perSeat', undefined, { defaultValue: 'per seat' })] }))] }), _jsxs("p", { className: cm.cn(cm.textSize('xs'), cm.textSubtle, cm.fontWeight('semibold'), cm.uppercase, cm.trackingWide, cm.sp('mt', 2)), children: [t(`billing.pricing.billed.${price?.period ?? 'month'}`, undefined, {
183
183
  defaultValue: price?.period === 'year' ? 'Billed annually' : 'Billed monthly',
184
- }), price?.savings && (_jsxs(_Fragment, { children: [' · ', _jsx("span", { className: cm.textSuccess, children: price.savings.toUpperCase() })] }))] })] }), _jsx("div", { className: cm.cn(cm.cardContent, cm.flex1), children: renderLimits ? (renderLimits(tier.limits)) : (_jsx(DefaultLimits, { limits: tier.limits, cm: cm })) }), _jsx("footer", { className: cm.cardFooter, children: _jsx("button", { type: "button", className: cm.cn(cm.button({
184
+ }), price?.savings && (_jsxs(_Fragment, { children: [' · ', _jsx("span", { className: cm.textSuccess, children: price.savings.toUpperCase() })] }))] })] }), _jsx("div", { className: cm.cn(cm.cardContent, cm.flex1), children: renderLimits ? (renderLimits(tier.limits)) : (_jsx(DefaultLimits, { limits: tier.limits, cm: cm })) }), _jsx("footer", { className: cm.cardFooter, children: _jsx("button", { type: "button",
185
+ // A page-level CTA takes the design system's largest tier. It used
186
+ // to hand-override height and padding inline, which silently beat
187
+ // whatever the ClassMap resolved (AGENTS.md anti-pattern 12) and
188
+ // made this button a different size from every other Upgrade CTA
189
+ // in the fleet — `pricing-page-react`'s identical action included.
190
+ className: cm.cn(cm.button({
185
191
  variant: popular ? 'solid' : 'outline',
186
- size: 'md',
192
+ color: popular ? 'primary' : undefined,
193
+ size: 'lg',
187
194
  fullWidth: true,
188
- }), popular && cm.gradientPrimary, cm.uppercase, cm.trackingWide, cm.fontWeight('semibold'), cm.textSize('sm')),
189
- // Override the cramped default size — `cm.button({size: 'md'})`
190
- // gives `h-[30px] px-2.5` which feels like a tag, not a CTA.
191
- // Real button padding: ~14px vertical, ~20px horizontal.
192
- style: {
193
- height: 'auto',
194
- paddingTop: '0.875rem',
195
- paddingBottom: '0.875rem',
196
- paddingLeft: '1.25rem',
197
- paddingRight: '1.25rem',
198
- }, disabled: !price?.stripePriceId || starting, onClick: () => onUpgrade(price?.stripePriceId ?? null), "data-mol-id": `pricing-cta-${tier.key}`, children: price?.stripePriceId
195
+ }), popular && cm.gradientPrimary, cm.uppercase, cm.trackingWide, cm.fontWeight('semibold'), cm.touchTargetCompact), disabled: !price?.stripePriceId || starting, onClick: () => onUpgrade(price?.stripePriceId ?? null), "data-mol-id": `pricing-cta-${tier.key}`, children: price?.stripePriceId
199
196
  ? t('billing.pricing.upgradeCta', { tierName: tier.name }, { defaultValue: 'Upgrade to {{tierName}}' })
200
197
  : t('billing.pricing.currentCta', undefined, { defaultValue: 'Current plan' }) }) })] }) }));
201
198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-billing-react",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "React pricing page + checkout flow that consumes /api/billing/* (provided by @molecule/api-entitlements + @molecule/api-payments-stripe)",
5
5
  "homepage": "https://www.molecule.dev/packages/app-billing-react",
6
6
  "type": "module",
@@ -43,9 +43,9 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@molecule/app-http": "1.0.2",
46
- "@molecule/app-react": "1.5.1",
47
- "@molecule/app-ui": "1.1.1",
48
- "@molecule/app-ui-react": "1.0.2",
46
+ "@molecule/app-react": "1.6.0",
47
+ "@molecule/app-ui": "1.2.1",
48
+ "@molecule/app-ui-react": "1.2.1",
49
49
  "@types/node": "26.1.2",
50
50
  "@types/react": "19.2.17",
51
51
  "react": "19.2.8",