@growth-operations/ui-shared 1.8.0 → 1.9.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@growth-operations/ui-shared",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "Shared HubSpot UI-extension modules (Home, Billing) for Growth Operations apps.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -118,15 +118,24 @@ function PlanCard({
118
118
  const leg = interval === "annual" ? plan.annual : plan.monthly;
119
119
  const periodLabel = interval === "annual" ? "/yr" : "/mo";
120
120
 
121
+ // Annual is billed as one yearly charge, but SaaS pricing convention shows
122
+ // it as an equivalent MONTHLY rate up front (the full annual total reads as
123
+ // sticker shock) — the actual "$X/yr" total moves to a smaller line below.
124
+ const monthlyEquivalent =
125
+ interval === "annual" && leg ? Math.round(leg.unit_amount / 12) : null;
126
+
121
127
  const priceText = plan.talk_to_sales
122
128
  ? "Custom"
123
129
  : leg
124
- ? `${fmtMoney(leg.unit_amount, leg.currency)}${periodLabel}`
130
+ ? monthlyEquivalent != null
131
+ ? `${fmtMoney(monthlyEquivalent, leg.currency)}/mo`
132
+ : `${fmtMoney(leg.unit_amount, leg.currency)}${periodLabel}`
125
133
  : "Free";
126
134
 
127
135
  // Annual savings vs. paying monthly for a year. Only when this card is showing
128
- // annual AND has both legs to compare. annualFull = the struck-through "12×
129
- // monthly" reference price; pct = the highlighted discount.
136
+ // annual AND has both legs to compare. annualFull = the un-discounted "12×
137
+ // monthly" reference used only to compute savingsPct — never rendered as a
138
+ // dollar figure itself (see the "no full-year price shown" note above).
130
139
  const showAnnualSavings =
131
140
  interval === "annual" && hasMonthly && hasAnnual && plan.annual?.unit_amount;
132
141
  const annualFull = showAnnualSavings ? plan.monthly.unit_amount * 12 : null;
@@ -185,10 +194,16 @@ function PlanCard({
185
194
  <StatusTag variant="success">Save {savingsPct}%</StatusTag>
186
195
  )}
187
196
  </Flex>
188
- {/* Struck-through "12× monthly" reference so the annual discount reads. */}
189
- {savingsPct > 0 && (
190
- <Text format={{ lineDecoration: "strikethrough", fontStyle: "italic" }}>
191
- {fmtMoney(annualFull, plan.annual.currency)}/yr
197
+ {/* Annual is billed as one yearly charge — show the real total in a
198
+ lighter line under the monthly-equivalent headline price, instead
199
+ of a struck-through full-year dollar figure. Deliberately no
200
+ "$X/yr" reference price shown as a big number anywhere on this
201
+ card — only the small parenthetical and the Save % badge above.
202
+ variant "microcopy" is the SDK's de-emphasized text style (no
203
+ fontColor option exists on Text). */}
204
+ {monthlyEquivalent != null && (
205
+ <Text variant="microcopy">
206
+ (or {fmtMoney(leg.unit_amount, leg.currency)}/yr)
192
207
  </Text>
193
208
  )}
194
209