@growth-operations/ui-shared 1.30.1 → 1.31.1

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.30.1",
3
+ "version": "1.31.1",
4
4
  "description": "Shared HubSpot UI-extension modules (Home, Billing) for Growth Operations apps.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -17,7 +17,8 @@
17
17
  },
18
18
  "repository": {
19
19
  "type": "git",
20
- "url": "git+https://github.com/growth-operations/ui-shared.git"
20
+ "url": "git+https://github.com/growth-operations/growth-ops.git",
21
+ "directory": "packages/ui-shared"
21
22
  },
22
23
  "peerDependencies": {
23
24
  "@hubspot/ui-extensions": ">=0.13.0",
@@ -7,6 +7,7 @@ import { SyncPulse } from "./SyncPulse";
7
7
  import { FeatureUsage } from "./FeatureUsage";
8
8
  import { PlanFitBanner } from "./PlanFitBanner";
9
9
  import { PeriodComparison } from "./PeriodComparison";
10
+ import { BillingPeriodUsage } from "../usage/BillingPeriodUsage";
10
11
  import { FeatureNudges } from "./FeatureNudges";
11
12
  import { HelpfulLinks } from "./HelpfulLinks";
12
13
 
@@ -53,7 +54,14 @@ function ArchetypeTile({ state }) {
53
54
  // (it owns context.portal.id + the app's docs/support); it can
54
55
  // also come from a state.helpful_links block if the backend
55
56
  // builds one.
56
- export function AppHome({ state, onNavigate, appName, onRetry, helpfulLinks }) {
57
+ // usageExplorer — optional { context, basePath, portalId }: swap the fixed
58
+ // last-vs-current PeriodComparison for the billing-period
59
+ // explorer chart (BillingPeriodUsage, Current/Last 2/3/6/12
60
+ // dropdown). Requires the host's usage endpoint to serve
61
+ // ?periods= (common v1.35.0+ backends). Jasper 2026-10-14:
62
+ // ATS Home uses this; the Usage tab keeps the rolling-days
63
+ // LineChart.
64
+ export function AppHome({ state, onNavigate, appName, onRetry, helpfulLinks, usageExplorer }) {
57
65
  if (!state) {
58
66
  return <LoadingSpinner showLabel label="Loading…" />;
59
67
  }
@@ -116,9 +124,25 @@ export function AppHome({ state, onNavigate, appName, onRetry, helpfulLinks }) {
116
124
 
117
125
  <ArchetypeTile state={state} />
118
126
 
119
- {/* Post-checklist: the period-over-period comparison (null until the
120
- install has one full closed period). */}
121
- {onboardingComplete && <PeriodComparison state={state} />}
127
+ {/* Post-checklist: the period chart. Default is the fixed
128
+ period-over-period comparison (null until the install has one full
129
+ closed period); usageExplorer hosts get the billing-period explorer
130
+ instead (it self-fetches, so it renders its own empty state rather
131
+ than gating on a closed period). */}
132
+ {onboardingComplete &&
133
+ (usageExplorer ? (
134
+ <BillingPeriodUsage
135
+ context={usageExplorer.context}
136
+ basePath={usageExplorer.basePath}
137
+ portalId={usageExplorer.portalId}
138
+ appName={appName}
139
+ title="Usage over time"
140
+ titleAs="text"
141
+ showStats={false}
142
+ />
143
+ ) : (
144
+ <PeriodComparison state={state} />
145
+ ))}
122
146
 
123
147
  {/* Most used / recommended-to-explore (state.feature_usage) — renders
124
148
  nothing on backends without the block or for legacy installs. Gated