@burdenoff/microfe-subscriberbot 2026.1107.7 → 2026.1110.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/dist/node_modules/clsx/dist/clsx.js +8 -7
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +134 -151
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoot.js +10 -7
- package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoutes.js +1 -2
- package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.js +9 -10
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/admin/AdminRoot.js +2 -3
- package/dist/subscriberbot/admin/AdminRoot.js.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js +56 -57
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js +107 -108
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/index.js +1 -1
- package/dist/subscriberbot/components/EmptyState.js +1 -2
- package/dist/subscriberbot/components/EmptyState.js.map +1 -1
- package/dist/subscriberbot/components/MetricsCard.js +1 -2
- package/dist/subscriberbot/components/MetricsCard.js.map +1 -1
- package/dist/subscriberbot/components/Modal.js +2 -3
- package/dist/subscriberbot/components/Modal.js.map +1 -1
- package/dist/subscriberbot/components/PageLayout.js +1 -2
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.js +7 -8
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
- package/dist/subscriberbot/components/StateViews.js +1 -2
- package/dist/subscriberbot/components/StateViews.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.js +2 -3
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.js +7 -8
- package/dist/subscriberbot/components/decisions/DecisionBanners.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionCard.js +65 -66
- package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
- package/dist/subscriberbot/components/decisions/decisionModel.js +2 -3
- package/dist/subscriberbot/components/decisions/decisionModel.js.map +1 -1
- package/dist/subscriberbot/components/decisions/index.js +4 -3
- package/dist/subscriberbot/components/index.js +8 -7
- package/dist/subscriberbot/components/mobile/MobileDashboard.js +23 -24
- package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +40 -49
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.js +1 -2
- package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js +1 -2
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js.map +1 -1
- package/dist/subscriberbot/components/mobile/index.js +4 -3
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +1 -2
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +4 -5
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js +4 -5
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/index.js +5 -4
- package/dist/subscriberbot/components/negotiations/labels.js +1 -2
- package/dist/subscriberbot/components/negotiations/labels.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +4 -5
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +1 -2
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementThread.js +4 -5
- package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
- package/dist/subscriberbot/components/procurement/index.js +5 -4
- package/dist/subscriberbot/components/procurement/labels.js +1 -2
- package/dist/subscriberbot/components/procurement/labels.js.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.js +90 -91
- package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
- package/dist/subscriberbot/components/savings/index.js +3 -2
- package/dist/subscriberbot/components/savings/savingsModel.js +2 -3
- package/dist/subscriberbot/components/savings/savingsModel.js.map +1 -1
- package/dist/subscriberbot/components/viz.js +2 -3
- package/dist/subscriberbot/components/viz.js.map +1 -1
- package/dist/subscriberbot/context/SubscriberBotContext.js +3 -3
- package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
- package/dist/subscriberbot/context/index.js +1 -1
- package/dist/subscriberbot/hooks/index.js +2 -2
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js +2 -3
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js.map +1 -1
- package/dist/subscriberbot/hooks/useBankingApi.js +2 -3
- package/dist/subscriberbot/hooks/useBankingApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useCompactViewport.js +1 -2
- package/dist/subscriberbot/hooks/useCompactViewport.js.map +1 -1
- package/dist/subscriberbot/hooks/useFormError.js +1 -2
- package/dist/subscriberbot/hooks/useFormError.js.map +1 -1
- package/dist/subscriberbot/hooks/useFormatters.js +1 -2
- package/dist/subscriberbot/hooks/useFormatters.js.map +1 -1
- package/dist/subscriberbot/hooks/useNegotiationApi.js +2 -3
- package/dist/subscriberbot/hooks/useNegotiationApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useProcurementApi.js +2 -3
- package/dist/subscriberbot/hooks/useProcurementApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useRouteSelection.js +3 -3
- package/dist/subscriberbot/hooks/useRouteSelection.js.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +1 -2
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useTr.js +1 -2
- package/dist/subscriberbot/hooks/useTr.js.map +1 -1
- package/dist/subscriberbot/index.js +9 -8
- package/dist/subscriberbot/pages/AssetVaultPage.js +34 -35
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.js +86 -87
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +194 -199
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.js +28 -29
- package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.js +179 -188
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.js +293 -298
- package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.js +25 -26
- package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +67 -68
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +126 -127
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +10 -11
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +23 -24
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +337 -359
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/ConnectBankModal.js +22 -27
- package/dist/subscriberbot/pages/banking/ConnectBankModal.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +25 -26
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js +34 -35
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +125 -130
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +94 -95
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +15 -16
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +20 -21
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +86 -87
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +164 -165
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js +20 -21
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +350 -351
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderInsights.js +95 -96
- package/dist/subscriberbot/pages/providers/ProviderInsights.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +11 -12
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +62 -63
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +166 -172
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +12 -13
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +21 -22
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +242 -255
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +2 -3
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
- package/dist/subscriberbot/services/createSandboxAssistantTransport.js +1 -2
- package/dist/subscriberbot/services/createSandboxAssistantTransport.js.map +1 -1
- package/dist/subscriberbot/store/index.js +1 -1
- package/dist/subscriberbot/store/subscriberbotStore.js +1 -2
- package/dist/subscriberbot/store/subscriberbotStore.js.map +1 -1
- package/dist/subscriberbot/utils/bankRedirectLink.js +18 -19
- package/dist/subscriberbot/utils/bankRedirectLink.js.map +1 -1
- package/dist/subscriberbot/utils/chartScale.js +1 -2
- package/dist/subscriberbot/utils/chartScale.js.map +1 -1
- package/dist/subscriberbot/utils/cn.js +2 -3
- package/dist/subscriberbot/utils/cn.js.map +1 -1
- package/dist/subscriberbot/utils/formatters.js +4 -5
- package/dist/subscriberbot/utils/formatters.js.map +1 -1
- package/dist/subscriberbot/utils/navigation.js +1 -2
- package/dist/subscriberbot/utils/navigation.js.map +1 -1
- package/dist/subscriberbot/utils/pageContext.js +3 -4
- package/dist/subscriberbot/utils/pageContext.js.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.js +21 -22
- package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
- package/dist/subscriberbot/utils/portfolio.d.ts +4 -3
- package/dist/subscriberbot/utils/portfolio.d.ts.map +1 -1
- package/dist/subscriberbot/utils/portfolio.js +10 -11
- package/dist/subscriberbot/utils/portfolio.js.map +1 -1
- package/dist/subscriberbot/utils/renewals.js +1 -2
- package/dist/subscriberbot/utils/renewals.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { useFormatters as e } from "../../hooks/useFormatters.js";
|
|
2
|
+
import { StatusBadge as t } from "../StatusBadge.js";
|
|
3
|
+
import { MobileScreen as n, MobileSection as r } from "./MobileScreen.js";
|
|
4
|
+
import { RelationshipGlyph as i } from "./RelationshipGlyph.js";
|
|
5
|
+
import { RECOMMENDATION_LABEL as a } from "../decisions/decisionModel.js";
|
|
6
|
+
import { useTr as o } from "../../hooks/useTr.js";
|
|
7
|
+
import { cn as s } from "../../utils/cn.js";
|
|
8
|
+
import { daysUntil as c, renewalCountdown as l } from "../../utils/portfolio.js";
|
|
9
9
|
import { AlertTriangle as u, ArrowRight as d, Bot as f, ChevronRight as p, Inbox as m, Lightbulb as h, PiggyBank as g, Plus as _, ShieldCheck as v } from "lucide-react";
|
|
10
10
|
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
11
|
-
|
|
11
|
+
// src/subscriberbot/components/mobile/MobileDashboard.tsx
|
|
12
12
|
var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle bg-bg-surface p-4 text-start shadow-sm transition-colors active:bg-bg-sunken", S = "inline-flex items-center gap-0.5 text-sm font-medium text-text-link", C = ({ greetingName: C, spend: w, upcoming: T, actionMessages: E, decisions: D, relationshipLabel: O, openInvoiceCount: k, openInvoiceTotal: A, navigateTo: j }) => {
|
|
13
|
-
let { formatCurrency: M, formatIntervalSuffix: N } =
|
|
13
|
+
let { formatCurrency: M, formatIntervalSuffix: N } = e(), P = o(), F = [
|
|
14
14
|
{
|
|
15
15
|
id: "add",
|
|
16
16
|
label: P("mobile.dashboard.quick.add", "Add subscription"),
|
|
@@ -36,7 +36,7 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
36
36
|
path: "/agents"
|
|
37
37
|
}
|
|
38
38
|
];
|
|
39
|
-
return /* @__PURE__ */ b(
|
|
39
|
+
return /* @__PURE__ */ b(n, {
|
|
40
40
|
dataTour: "subscriberbot-home",
|
|
41
41
|
testId: "sb-mobile-dashboard",
|
|
42
42
|
title: P("dashboard.title", "Overview"),
|
|
@@ -67,7 +67,7 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
67
67
|
]
|
|
68
68
|
}),
|
|
69
69
|
children: [
|
|
70
|
-
/* @__PURE__ */ y(
|
|
70
|
+
/* @__PURE__ */ y(r, {
|
|
71
71
|
dataTour: "subscriberbot-home-renewals",
|
|
72
72
|
title: P("dashboard.renewals.title", "Upcoming renewals"),
|
|
73
73
|
action: T.length > 0 ? /* @__PURE__ */ b("button", {
|
|
@@ -81,19 +81,19 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
81
81
|
]
|
|
82
82
|
}) : void 0,
|
|
83
83
|
children: T.length === 0 ? /* @__PURE__ */ y("div", {
|
|
84
|
-
className:
|
|
84
|
+
className: s(x, "text-sm text-text-secondary"),
|
|
85
85
|
children: P("dashboard.renewals.emptyDescription", "Renewals you track will appear here ahead of time.")
|
|
86
86
|
}) : /* @__PURE__ */ y("ul", {
|
|
87
87
|
className: "space-y-3",
|
|
88
88
|
"data-testid": "sb-mobile-renewals",
|
|
89
89
|
children: T.slice(0, 5).map((e) => {
|
|
90
|
-
let t =
|
|
90
|
+
let t = c(e.when), n = t == null ? null : l(t);
|
|
91
91
|
return /* @__PURE__ */ y("li", { children: /* @__PURE__ */ b("button", {
|
|
92
92
|
type: "button",
|
|
93
93
|
className: x,
|
|
94
94
|
onClick: () => j(`/relationships/${e.relationshipId}`),
|
|
95
95
|
children: [
|
|
96
|
-
/* @__PURE__ */ y(
|
|
96
|
+
/* @__PURE__ */ y(i, { kind: e.kind }),
|
|
97
97
|
/* @__PURE__ */ b("span", {
|
|
98
98
|
className: "min-w-0 flex-1",
|
|
99
99
|
children: [
|
|
@@ -105,9 +105,9 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
105
105
|
className: "block text-base tabular-nums text-text-primary",
|
|
106
106
|
children: [M(e.amount, e.currency ?? w.currency), e.interval ? N(e.interval) : ""]
|
|
107
107
|
}),
|
|
108
|
-
|
|
109
|
-
className:
|
|
110
|
-
children: P(
|
|
108
|
+
n && /* @__PURE__ */ y("span", {
|
|
109
|
+
className: s("block text-sm", n.tone === "later" ? "text-text-secondary" : "text-status-warning-text"),
|
|
110
|
+
children: P(n.key, n.fallback, n.params)
|
|
111
111
|
})
|
|
112
112
|
]
|
|
113
113
|
}),
|
|
@@ -117,7 +117,7 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
117
117
|
})
|
|
118
118
|
})
|
|
119
119
|
}),
|
|
120
|
-
/* @__PURE__ */ y(
|
|
120
|
+
/* @__PURE__ */ y(r, {
|
|
121
121
|
dataTour: "subscriberbot-home-needs-attention",
|
|
122
122
|
title: P("mobile.dashboard.needsAction", "Needs action"),
|
|
123
123
|
action: /* @__PURE__ */ b("button", {
|
|
@@ -160,14 +160,14 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
160
160
|
className: "block truncate text-sm text-text-secondary",
|
|
161
161
|
children: e.preview
|
|
162
162
|
})]
|
|
163
|
-
}), /* @__PURE__ */ y(
|
|
163
|
+
}), /* @__PURE__ */ y(t, {
|
|
164
164
|
status: e.category,
|
|
165
165
|
className: "shrink-0"
|
|
166
166
|
})]
|
|
167
167
|
}) }, e.id))
|
|
168
168
|
})
|
|
169
169
|
}),
|
|
170
|
-
D.length > 0 && /* @__PURE__ */ y(
|
|
170
|
+
D.length > 0 && /* @__PURE__ */ y(r, {
|
|
171
171
|
title: P("mobile.dashboard.recommendations", "AI recommendations"),
|
|
172
172
|
action: /* @__PURE__ */ b("button", {
|
|
173
173
|
type: "button",
|
|
@@ -183,7 +183,7 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
183
183
|
className: "space-y-3",
|
|
184
184
|
"data-testid": "sb-mobile-decisions",
|
|
185
185
|
children: D.slice(0, 3).map((e) => {
|
|
186
|
-
let t =
|
|
186
|
+
let t = a[e.recommendation];
|
|
187
187
|
return /* @__PURE__ */ y("li", { children: /* @__PURE__ */ b("button", {
|
|
188
188
|
type: "button",
|
|
189
189
|
className: x,
|
|
@@ -227,7 +227,7 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
227
227
|
})]
|
|
228
228
|
}), /* @__PURE__ */ y(d, { className: "rtl:rotate-180 h-4 w-4 shrink-0 text-status-warning-text" })]
|
|
229
229
|
}),
|
|
230
|
-
/* @__PURE__ */ y(
|
|
230
|
+
/* @__PURE__ */ y(r, {
|
|
231
231
|
title: P("dashboard.quickActions.title", "Quick actions"),
|
|
232
232
|
dataTour: "subscriberbot-home-quick-actions",
|
|
233
233
|
children: /* @__PURE__ */ y("div", {
|
|
@@ -249,7 +249,6 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
249
249
|
]
|
|
250
250
|
});
|
|
251
251
|
};
|
|
252
|
-
//#endregion
|
|
253
252
|
export { C as MobileDashboard };
|
|
254
253
|
|
|
255
254
|
//# sourceMappingURL=MobileDashboard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileDashboard.js","names":[],"sources":["../../../../src/subscriberbot/components/mobile/MobileDashboard.tsx"],"sourcesContent":["import { useFormatters } from '../../hooks/useFormatters';\n/**\n * Mobile overview\n * @module subscriberbot/components/mobile\n *\n * The phone overview from `sb-24-mobile-app.jpg`: total recurring spend in the\n * hero, then card-first sections for upcoming renewals, what needs action in\n * the Universal Inbox, open AI recommendations, and quick actions. Every\n * number comes from the same real queries the desktop dashboard uses — the\n * page computes once and hands the results down.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport {\n AlertTriangle,\n ArrowRight,\n Bot,\n ChevronRight,\n Inbox,\n Lightbulb,\n PiggyBank,\n Plus,\n ShieldCheck,\n} from 'lucide-react';\nimport { StatusBadge } from '../StatusBadge';\nimport { MobileScreen, MobileSection } from './MobileScreen';\nimport { RelationshipGlyph } from './RelationshipGlyph';\nimport { RECOMMENDATION_LABEL } from '../decisions/decisionModel';\nimport { useTr } from '../../hooks/useTr';\nimport { cn } from '../../utils/cn';\n\nimport {\n daysUntil,\n renewalCountdown,\n type RecurringSpend,\n type UpcomingRenewal,\n} from '../../utils/portfolio';\nimport type { SubDecision, SubInboxMessage } from '../../types';\n\nexport interface MobileDashboardProps {\n greetingName?: string;\n spend: RecurringSpend;\n upcoming: UpcomingRenewal[];\n actionMessages: SubInboxMessage[];\n /** PROPOSED AI decisions, newest first. */\n decisions: SubDecision[];\n relationshipLabel: (relationshipId: string) => string | undefined;\n openInvoiceCount: number;\n openInvoiceTotal: number;\n navigateTo: (relativePath: string) => void;\n}\n\nconst cardCls =\n 'flex w-full items-center gap-3 rounded-2xl border border-border-subtle bg-bg-surface p-4 text-start shadow-sm transition-colors active:bg-bg-sunken';\n\nconst linkCls = 'inline-flex items-center gap-0.5 text-sm font-medium text-text-link';\n\nexport const MobileDashboard: FC<MobileDashboardProps> = ({\n greetingName,\n spend,\n upcoming,\n actionMessages,\n decisions,\n relationshipLabel,\n openInvoiceCount,\n openInvoiceTotal,\n navigateTo,\n}) => {\n const { formatCurrency, formatIntervalSuffix } = useFormatters();\n\n const tr = useTr();\n\n const quickActions: Array<{ id: string; label: string; icon: ReactNode; path: string }> = [\n {\n id: 'add',\n label: tr('mobile.dashboard.quick.add', 'Add subscription'),\n icon: <Plus className=\"h-5 w-5\" />,\n path: '/relationships/new',\n },\n {\n id: 'inbox',\n label: tr('mobile.dashboard.quick.inbox', 'Inbox'),\n icon: <Inbox className=\"h-5 w-5\" />,\n path: '/inbox',\n },\n {\n id: 'savings',\n label: tr('mobile.dashboard.quick.savings', 'Savings'),\n icon: <PiggyBank className=\"h-5 w-5\" />,\n path: '/savings',\n },\n {\n id: 'agents',\n label: tr('mobile.dashboard.quick.agents', 'Agents'),\n icon: <Bot className=\"h-5 w-5\" />,\n path: '/agents',\n },\n ];\n\n return (\n <MobileScreen\n dataTour=\"subscriberbot-home\"\n testId=\"sb-mobile-dashboard\"\n title={tr('dashboard.title', 'Overview')}\n eyebrow={\n greetingName\n ? tr('mobile.dashboard.greeting', 'Hi, {{name}}', { name: greetingName })\n : undefined\n }\n hero={\n <div data-tour=\"subscriberbot-home-metrics\">\n <p className=\"text-sm\">{tr('mobile.dashboard.totalSpend', 'Total recurring spend')}</p>\n <p className=\"mt-1 font-bold tabular-nums\" data-testid=\"sb-mobile-total-spend\">\n <span className=\"text-4xl\">{formatCurrency(spend.monthly, spend.currency)}</span>\n <span className=\"text-base font-medium\">\n {tr('mobile.dashboard.perMonth', '/month')}\n </span>\n </p>\n <p className=\"mt-1 text-xs\" data-tour=\"subscriberbot-home-portfolio\">\n {tr(\n spend.activeCount === 1\n ? 'mobile.dashboard.activeCountOne'\n : 'mobile.dashboard.activeCount',\n spend.activeCount === 1\n ? '{{count}} active subscription'\n : '{{count}} active subscriptions',\n { count: spend.activeCount }\n )}\n </p>\n </div>\n }\n >\n <MobileSection\n dataTour=\"subscriberbot-home-renewals\"\n title={tr('dashboard.renewals.title', 'Upcoming renewals')}\n action={\n upcoming.length > 0 ? (\n <button type=\"button\" className={linkCls} onClick={() => navigateTo('/relationships')}>\n {tr('common.viewAll', 'View all')} <ChevronRight className=\"rtl:rotate-180 h-4 w-4\" />\n </button>\n ) : undefined\n }\n >\n {upcoming.length === 0 ? (\n <div className={cn(cardCls, 'text-sm text-text-secondary')}>\n {tr(\n 'dashboard.renewals.emptyDescription',\n 'Renewals you track will appear here ahead of time.'\n )}\n </div>\n ) : (\n <ul className=\"space-y-3\" data-testid=\"sb-mobile-renewals\">\n {upcoming.slice(0, 5).map((u) => {\n const days = daysUntil(u.when);\n const countdown = days == null ? null : renewalCountdown(days);\n return (\n <li key={u.id}>\n <button\n type=\"button\"\n className={cardCls}\n onClick={() => navigateTo(`/relationships/${u.relationshipId}`)}\n >\n <RelationshipGlyph kind={u.kind} />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-semibold text-text-primary\">\n {u.title}\n </span>\n {u.amount != null && (\n <span className=\"block text-base tabular-nums text-text-primary\">\n {formatCurrency(u.amount, u.currency ?? spend.currency)}\n {u.interval ? formatIntervalSuffix(u.interval) : ''}\n </span>\n )}\n {countdown && (\n <span\n className={cn(\n 'block text-sm',\n countdown.tone === 'later'\n ? 'text-text-secondary'\n : 'text-status-warning-text'\n )}\n >\n {tr(countdown.key, countdown.fallback, countdown.params)}\n </span>\n )}\n </span>\n <ChevronRight className=\"rtl:rotate-180 h-4 w-4 shrink-0 text-text-secondary\" />\n </button>\n </li>\n );\n })}\n </ul>\n )}\n </MobileSection>\n\n <MobileSection\n dataTour=\"subscriberbot-home-needs-attention\"\n title={tr('mobile.dashboard.needsAction', 'Needs action')}\n action={\n <button type=\"button\" className={linkCls} onClick={() => navigateTo('/inbox')}>\n {tr('dashboard.needsAttention.openInbox', 'Open inbox')}{' '}\n <ChevronRight className=\"rtl:rotate-180 h-4 w-4\" />\n </button>\n }\n >\n {actionMessages.length === 0 ? (\n <div className={cardCls}>\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-xl bg-status-success-bg-subtle text-status-success-text\">\n <ShieldCheck className=\"h-5 w-5\" />\n </span>\n <span className=\"min-w-0\">\n <span className=\"block text-sm font-medium text-text-primary\">\n {tr('dashboard.needsAttention.allCaughtUp', \"You're all caught up\")}\n </span>\n <span className=\"block text-xs text-text-secondary\">\n {tr(\n 'dashboard.needsAttention.allCaughtUpDescription',\n 'Required actions across your channels will surface here.'\n )}\n </span>\n </span>\n </div>\n ) : (\n <ul className=\"space-y-3\">\n {actionMessages.slice(0, 3).map((m) => (\n <li key={m.id}>\n <button type=\"button\" className={cardCls} onClick={() => navigateTo('/inbox')}>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-semibold text-text-primary\">\n {m.subject || tr('dashboard.needsAttention.noSubject', '(no subject)')}\n </span>\n {m.preview && (\n <span className=\"block truncate text-sm text-text-secondary\">\n {m.preview}\n </span>\n )}\n </span>\n <StatusBadge status={m.category} className=\"shrink-0\" />\n </button>\n </li>\n ))}\n </ul>\n )}\n </MobileSection>\n\n {decisions.length > 0 && (\n <MobileSection\n title={tr('mobile.dashboard.recommendations', 'AI recommendations')}\n action={\n <button type=\"button\" className={linkCls} onClick={() => navigateTo('/decisions')}>\n {tr('common.viewAll', 'View all')} <ChevronRight className=\"rtl:rotate-180 h-4 w-4\" />\n </button>\n }\n >\n <ul className=\"space-y-3\" data-testid=\"sb-mobile-decisions\">\n {decisions.slice(0, 3).map((d) => {\n const rec = RECOMMENDATION_LABEL[d.recommendation];\n return (\n <li key={d.id}>\n <button\n type=\"button\"\n className={cardCls}\n onClick={() => navigateTo(`/decisions/${d.id}`)}\n >\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-xl bg-bg-sunken text-text-secondary\">\n <Lightbulb className=\"h-5 w-5\" />\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-semibold text-text-primary\">\n {rec ? tr(rec.key, rec.fallback) : d.recommendation}\n </span>\n <span className=\"block truncate text-sm text-text-secondary\">\n {relationshipLabel(d.relationshipId) ?? d.rationale}\n </span>\n </span>\n {d.estimatedSavings > 0 && (\n <span className=\"shrink-0 text-sm font-semibold tabular-nums text-status-success-text\">\n {tr('mobile.dashboard.savesPerYear', 'Save {{amount}}/yr', {\n amount: formatCurrency(d.estimatedSavings, d.currency, {\n maximumFractionDigits: 0,\n }),\n })}\n </span>\n )}\n </button>\n </li>\n );\n })}\n </ul>\n </MobileSection>\n )}\n\n {openInvoiceCount > 0 && (\n <button\n type=\"button\"\n onClick={() => navigateTo('/invoices')}\n className=\"mt-6 flex w-full items-center justify-between gap-3 rounded-2xl border border-status-warning-text/30 bg-status-warning-bg-subtle px-4 py-3 text-start\"\n >\n <span className=\"flex items-center gap-3\">\n <AlertTriangle className=\"h-5 w-5 shrink-0 text-status-warning-text\" />\n <span className=\"text-sm font-medium text-status-warning-text\">\n {tr(\n 'dashboard.openInvoices.label',\n '{{count}} open invoice · {{amount}} outstanding',\n {\n count: openInvoiceCount,\n amount: formatCurrency(openInvoiceTotal, spend.currency),\n }\n )}\n </span>\n </span>\n <ArrowRight className=\"rtl:rotate-180 h-4 w-4 shrink-0 text-status-warning-text\" />\n </button>\n )}\n\n <MobileSection\n title={tr('dashboard.quickActions.title', 'Quick actions')}\n dataTour=\"subscriberbot-home-quick-actions\"\n >\n <div className=\"grid grid-cols-2 gap-3\">\n {quickActions.map((qa) => (\n <button\n key={qa.id}\n type=\"button\"\n onClick={() => navigateTo(qa.path)}\n className=\"flex min-h-20 flex-col items-start justify-between gap-2 rounded-2xl border border-border-subtle bg-bg-surface p-4 text-start active:bg-bg-sunken\"\n >\n <span className=\"flex size-9 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary\">\n {qa.icon}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">{qa.label}</span>\n </button>\n ))}\n </div>\n </MobileSection>\n </MobileScreen>\n );\n};\n"],"mappings":";;;;;;;;;;;AAoDA,IAAM,IACJ,uJAEI,IAAU,uEAEH,KAA6C,EACxD,iBACA,UACA,aACA,mBACA,cACA,sBACA,qBACA,qBACA,oBACI;CACJ,IAAM,EAAE,mBAAgB,4BAAyB,EAAc,GAEzD,IAAK,EAAM,GAEX,IAAoF;EACxF;GACE,IAAI;GACJ,OAAO,EAAG,8BAA8B,kBAAkB;GAC1D,MAAM,kBAAC,GAAD,EAAM,WAAU,UAAW,CAAA;GACjC,MAAM;EACR;EACA;GACE,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,EASF,CACT;IACE,CAAA;GACQ,CAAA;EACH;;AAElB"}
|
|
1
|
+
{"version":3,"file":"MobileDashboard.js","names":["cardCls","linkCls","MobileDashboard","useFormatters","tr","useTr","quickActions","Plus","Inbox","PiggyBank","Bot","MobileScreen","greetingName","formatCurrency","spend","MobileSection","upcoming","navigateTo","ChevronRight","cn","days","daysUntil","u","countdown","renewalCountdown","RelationshipGlyph","formatIntervalSuffix","actionMessages","ShieldCheck","m","StatusBadge","decisions","rec","RECOMMENDATION_LABEL","d","Lightbulb","relationshipLabel","openInvoiceCount","AlertTriangle","openInvoiceTotal","ArrowRight","qa"],"sources":["../../../../src/subscriberbot/components/mobile/MobileDashboard.tsx"],"sourcesContent":["import { useFormatters } from '../../hooks/useFormatters';\n/**\n * Mobile overview\n * @module subscriberbot/components/mobile\n *\n * The phone overview from `sb-24-mobile-app.jpg`: total recurring spend in the\n * hero, then card-first sections for upcoming renewals, what needs action in\n * the Universal Inbox, open AI recommendations, and quick actions. Every\n * number comes from the same real queries the desktop dashboard uses — the\n * page computes once and hands the results down.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport {\n AlertTriangle,\n ArrowRight,\n Bot,\n ChevronRight,\n Inbox,\n Lightbulb,\n PiggyBank,\n Plus,\n ShieldCheck,\n} from 'lucide-react';\nimport { StatusBadge } from '../StatusBadge';\nimport { MobileScreen, MobileSection } from './MobileScreen';\nimport { RelationshipGlyph } from './RelationshipGlyph';\nimport { RECOMMENDATION_LABEL } from '../decisions/decisionModel';\nimport { useTr } from '../../hooks/useTr';\nimport { cn } from '../../utils/cn';\n\nimport {\n daysUntil,\n renewalCountdown,\n type RecurringSpend,\n type UpcomingRenewal,\n} from '../../utils/portfolio';\nimport type { SubDecision, SubInboxMessage } from '../../types';\n\nexport interface MobileDashboardProps {\n greetingName?: string;\n spend: RecurringSpend;\n upcoming: UpcomingRenewal[];\n actionMessages: SubInboxMessage[];\n /** PROPOSED AI decisions, newest first. */\n decisions: SubDecision[];\n relationshipLabel: (relationshipId: string) => string | undefined;\n openInvoiceCount: number;\n openInvoiceTotal: number;\n navigateTo: (relativePath: string) => void;\n}\n\nconst cardCls =\n 'flex w-full items-center gap-3 rounded-2xl border border-border-subtle bg-bg-surface p-4 text-start shadow-sm transition-colors active:bg-bg-sunken';\n\nconst linkCls = 'inline-flex items-center gap-0.5 text-sm font-medium text-text-link';\n\nexport const MobileDashboard: FC<MobileDashboardProps> = ({\n greetingName,\n spend,\n upcoming,\n actionMessages,\n decisions,\n relationshipLabel,\n openInvoiceCount,\n openInvoiceTotal,\n navigateTo,\n}) => {\n const { formatCurrency, formatIntervalSuffix } = useFormatters();\n\n const tr = useTr();\n\n const quickActions: Array<{ id: string; label: string; icon: ReactNode; path: string }> = [\n {\n id: 'add',\n label: tr('mobile.dashboard.quick.add', 'Add subscription'),\n icon: <Plus className=\"h-5 w-5\" />,\n path: '/relationships/new',\n },\n {\n id: 'inbox',\n label: tr('mobile.dashboard.quick.inbox', 'Inbox'),\n icon: <Inbox className=\"h-5 w-5\" />,\n path: '/inbox',\n },\n {\n id: 'savings',\n label: tr('mobile.dashboard.quick.savings', 'Savings'),\n icon: <PiggyBank className=\"h-5 w-5\" />,\n path: '/savings',\n },\n {\n id: 'agents',\n label: tr('mobile.dashboard.quick.agents', 'Agents'),\n icon: <Bot className=\"h-5 w-5\" />,\n path: '/agents',\n },\n ];\n\n return (\n <MobileScreen\n dataTour=\"subscriberbot-home\"\n testId=\"sb-mobile-dashboard\"\n title={tr('dashboard.title', 'Overview')}\n eyebrow={\n greetingName\n ? tr('mobile.dashboard.greeting', 'Hi, {{name}}', { name: greetingName })\n : undefined\n }\n hero={\n <div data-tour=\"subscriberbot-home-metrics\">\n <p className=\"text-sm\">{tr('mobile.dashboard.totalSpend', 'Total recurring spend')}</p>\n <p className=\"mt-1 font-bold tabular-nums\" data-testid=\"sb-mobile-total-spend\">\n <span className=\"text-4xl\">{formatCurrency(spend.monthly, spend.currency)}</span>\n <span className=\"text-base font-medium\">\n {tr('mobile.dashboard.perMonth', '/month')}\n </span>\n </p>\n <p className=\"mt-1 text-xs\" data-tour=\"subscriberbot-home-portfolio\">\n {tr(\n spend.activeCount === 1\n ? 'mobile.dashboard.activeCountOne'\n : 'mobile.dashboard.activeCount',\n spend.activeCount === 1\n ? '{{count}} active subscription'\n : '{{count}} active subscriptions',\n { count: spend.activeCount }\n )}\n </p>\n </div>\n }\n >\n <MobileSection\n dataTour=\"subscriberbot-home-renewals\"\n title={tr('dashboard.renewals.title', 'Upcoming renewals')}\n action={\n upcoming.length > 0 ? (\n <button type=\"button\" className={linkCls} onClick={() => navigateTo('/relationships')}>\n {tr('common.viewAll', 'View all')} <ChevronRight className=\"rtl:rotate-180 h-4 w-4\" />\n </button>\n ) : undefined\n }\n >\n {upcoming.length === 0 ? (\n <div className={cn(cardCls, 'text-sm text-text-secondary')}>\n {tr(\n 'dashboard.renewals.emptyDescription',\n 'Renewals you track will appear here ahead of time.'\n )}\n </div>\n ) : (\n <ul className=\"space-y-3\" data-testid=\"sb-mobile-renewals\">\n {upcoming.slice(0, 5).map((u) => {\n const days = daysUntil(u.when);\n const countdown = days == null ? null : renewalCountdown(days);\n return (\n <li key={u.id}>\n <button\n type=\"button\"\n className={cardCls}\n onClick={() => navigateTo(`/relationships/${u.relationshipId}`)}\n >\n <RelationshipGlyph kind={u.kind} />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-semibold text-text-primary\">\n {u.title}\n </span>\n {u.amount != null && (\n <span className=\"block text-base tabular-nums text-text-primary\">\n {formatCurrency(u.amount, u.currency ?? spend.currency)}\n {u.interval ? formatIntervalSuffix(u.interval) : ''}\n </span>\n )}\n {countdown && (\n <span\n className={cn(\n 'block text-sm',\n countdown.tone === 'later'\n ? 'text-text-secondary'\n : 'text-status-warning-text'\n )}\n >\n {tr(countdown.key, countdown.fallback, countdown.params)}\n </span>\n )}\n </span>\n <ChevronRight className=\"rtl:rotate-180 h-4 w-4 shrink-0 text-text-secondary\" />\n </button>\n </li>\n );\n })}\n </ul>\n )}\n </MobileSection>\n\n <MobileSection\n dataTour=\"subscriberbot-home-needs-attention\"\n title={tr('mobile.dashboard.needsAction', 'Needs action')}\n action={\n <button type=\"button\" className={linkCls} onClick={() => navigateTo('/inbox')}>\n {tr('dashboard.needsAttention.openInbox', 'Open inbox')}{' '}\n <ChevronRight className=\"rtl:rotate-180 h-4 w-4\" />\n </button>\n }\n >\n {actionMessages.length === 0 ? (\n <div className={cardCls}>\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-xl bg-status-success-bg-subtle text-status-success-text\">\n <ShieldCheck className=\"h-5 w-5\" />\n </span>\n <span className=\"min-w-0\">\n <span className=\"block text-sm font-medium text-text-primary\">\n {tr('dashboard.needsAttention.allCaughtUp', \"You're all caught up\")}\n </span>\n <span className=\"block text-xs text-text-secondary\">\n {tr(\n 'dashboard.needsAttention.allCaughtUpDescription',\n 'Required actions across your channels will surface here.'\n )}\n </span>\n </span>\n </div>\n ) : (\n <ul className=\"space-y-3\">\n {actionMessages.slice(0, 3).map((m) => (\n <li key={m.id}>\n <button type=\"button\" className={cardCls} onClick={() => navigateTo('/inbox')}>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-semibold text-text-primary\">\n {m.subject || tr('dashboard.needsAttention.noSubject', '(no subject)')}\n </span>\n {m.preview && (\n <span className=\"block truncate text-sm text-text-secondary\">\n {m.preview}\n </span>\n )}\n </span>\n <StatusBadge status={m.category} className=\"shrink-0\" />\n </button>\n </li>\n ))}\n </ul>\n )}\n </MobileSection>\n\n {decisions.length > 0 && (\n <MobileSection\n title={tr('mobile.dashboard.recommendations', 'AI recommendations')}\n action={\n <button type=\"button\" className={linkCls} onClick={() => navigateTo('/decisions')}>\n {tr('common.viewAll', 'View all')} <ChevronRight className=\"rtl:rotate-180 h-4 w-4\" />\n </button>\n }\n >\n <ul className=\"space-y-3\" data-testid=\"sb-mobile-decisions\">\n {decisions.slice(0, 3).map((d) => {\n const rec = RECOMMENDATION_LABEL[d.recommendation];\n return (\n <li key={d.id}>\n <button\n type=\"button\"\n className={cardCls}\n onClick={() => navigateTo(`/decisions/${d.id}`)}\n >\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-xl bg-bg-sunken text-text-secondary\">\n <Lightbulb className=\"h-5 w-5\" />\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-semibold text-text-primary\">\n {rec ? tr(rec.key, rec.fallback) : d.recommendation}\n </span>\n <span className=\"block truncate text-sm text-text-secondary\">\n {relationshipLabel(d.relationshipId) ?? d.rationale}\n </span>\n </span>\n {d.estimatedSavings > 0 && (\n <span className=\"shrink-0 text-sm font-semibold tabular-nums text-status-success-text\">\n {tr('mobile.dashboard.savesPerYear', 'Save {{amount}}/yr', {\n amount: formatCurrency(d.estimatedSavings, d.currency, {\n maximumFractionDigits: 0,\n }),\n })}\n </span>\n )}\n </button>\n </li>\n );\n })}\n </ul>\n </MobileSection>\n )}\n\n {openInvoiceCount > 0 && (\n <button\n type=\"button\"\n onClick={() => navigateTo('/invoices')}\n className=\"mt-6 flex w-full items-center justify-between gap-3 rounded-2xl border border-status-warning-text/30 bg-status-warning-bg-subtle px-4 py-3 text-start\"\n >\n <span className=\"flex items-center gap-3\">\n <AlertTriangle className=\"h-5 w-5 shrink-0 text-status-warning-text\" />\n <span className=\"text-sm font-medium text-status-warning-text\">\n {tr(\n 'dashboard.openInvoices.label',\n '{{count}} open invoice · {{amount}} outstanding',\n {\n count: openInvoiceCount,\n amount: formatCurrency(openInvoiceTotal, spend.currency),\n }\n )}\n </span>\n </span>\n <ArrowRight className=\"rtl:rotate-180 h-4 w-4 shrink-0 text-status-warning-text\" />\n </button>\n )}\n\n <MobileSection\n title={tr('dashboard.quickActions.title', 'Quick actions')}\n dataTour=\"subscriberbot-home-quick-actions\"\n >\n <div className=\"grid grid-cols-2 gap-3\">\n {quickActions.map((qa) => (\n <button\n key={qa.id}\n type=\"button\"\n onClick={() => navigateTo(qa.path)}\n className=\"flex min-h-20 flex-col items-start justify-between gap-2 rounded-2xl border border-border-subtle bg-bg-surface p-4 text-start active:bg-bg-sunken\"\n >\n <span className=\"flex size-9 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary\">\n {qa.icon}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">{qa.label}</span>\n </button>\n ))}\n </div>\n </MobileSection>\n </MobileScreen>\n );\n};\n"],"mappings":";;;;;;;;;;;AAoDA,IAAMA,IACJ,uJAEIC,IAAU,uEAEHC,KAA6C,EACxD,iBACA,UACA,aACA,mBACA,cACA,sBACA,qBACA,qBACA,oBACI;CACJ,IAAM,EAAE,mBAAgB,4BAAyBC,EAAc,GAEzDC,IAAKC,EAAM,GAEXC,IAAoF;EACxF;GACE,IAAI;GACJ,OAAOF,EAAG,8BAA8B,kBAAkB;GAC1D,MAAM,kBAACG,GAAD,EAAM,WAAU,UAAW,CAAA;GACjC,MAAM;EACR;EACA;GACE,IAAI;GACJ,OAAOH,EAAG,gCAAgC,OAAO;GACjD,MAAM,kBAACI,GAAD,EAAO,WAAU,UAAW,CAAA;GAClC,MAAM;EACR;EACA;GACE,IAAI;GACJ,OAAOJ,EAAG,kCAAkC,SAAS;GACrD,MAAM,kBAACK,GAAD,EAAW,WAAU,UAAW,CAAA;GACtC,MAAM;EACR;EACA;GACE,IAAI;GACJ,OAAOL,EAAG,iCAAiC,QAAQ;GACnD,MAAM,kBAACM,GAAD,EAAK,WAAU,UAAW,CAAA;GAChC,MAAM;EACR;CACF;CAEA,OACE,kBAACC,GAAD;EACE,UAAS;EACT,QAAO;EACP,OAAOP,EAAG,mBAAmB,UAAU;EACvC,SACEQ,IACIR,EAAG,6BAA6B,gBAAgB,EAAE,MAAMQ,EAAa,CAAC,IACtE,KAAA;EAEN,MACE,kBAAC,OAAD;GAAK,aAAU;GAAf,UAAA;IACE,kBAAC,KAAD;KAAG,WAAU;KAAW,UAAAR,EAAG,+BAA+B,uBAAuB;IAAK,CAAA;IACtF,kBAAC,KAAD;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-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { useFormatters as e } from "../../hooks/useFormatters.js";
|
|
2
|
+
import { StatusBadge as t } from "../StatusBadge.js";
|
|
3
|
+
import { RelationshipGlyph as n } from "./RelationshipGlyph.js";
|
|
4
|
+
import { useCancelRelationship as r, useTransitionRelationship as i } from "../../hooks/useSubscriberBotApi.js";
|
|
5
|
+
import { useTr as a } from "../../hooks/useTr.js";
|
|
6
|
+
import { cn as o } from "../../utils/cn.js";
|
|
7
|
+
import { daysUntil as s, isSwipeTrailingClick as c, quickActionsFor as l, renewalCountdown as u, swipeClickDeadline as d, swipeOffset as f, swipeSettlesOpen as p } from "../../utils/portfolio.js";
|
|
8
8
|
import { useRef as m, useState as h } from "react";
|
|
9
9
|
import { Ban as g, ChevronRight as _, MoreHorizontal as v, Pause as y, Play as b } from "lucide-react";
|
|
10
10
|
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
11
11
|
import { AlertDialog as w, AlertDialogAction as T, AlertDialogCancel as E, AlertDialogContent as D, AlertDialogDescription as O, AlertDialogFooter as k, AlertDialogHeader as A, AlertDialogTitle as j, BottomSheet as M, BottomSheetContent as N, BottomSheetDescription as P, BottomSheetHeader as F, BottomSheetTitle as I } from "@burdenoff/fe-libs/ui";
|
|
12
|
-
|
|
12
|
+
// src/subscriberbot/components/mobile/MobileRelationshipList.tsx
|
|
13
13
|
var L = 84, R = 8, z = {
|
|
14
14
|
activate: {
|
|
15
15
|
key: "relationships.detail.actions.activate",
|
|
@@ -35,13 +35,9 @@ var L = 84, R = 8, z = {
|
|
|
35
35
|
icon: g,
|
|
36
36
|
tone: "bg-status-error-bg-subtle text-status-error-text"
|
|
37
37
|
}
|
|
38
|
-
}, B = ({ items:
|
|
39
|
-
let { formatCurrency: s, formatIntervalSuffix:
|
|
40
|
-
|
|
41
|
-
b(e);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
d.mutate({
|
|
38
|
+
}, B = ({ items: t, navigateTo: n }) => {
|
|
39
|
+
let { formatCurrency: s, formatIntervalSuffix: c } = e(), u = a(), d = i(), f = r(), [p, m] = h(null), [g, v] = h(null), [y, b] = h(null), [L, R] = h(null), B = d.isPending || f.isPending, H = (e) => R(e instanceof Error ? e.message : u("mobile.relationships.actionFailed", "That action could not be completed.")), U = (e, t) => {
|
|
40
|
+
m(null), v(null), R(null), t.destructive ? b(e) : d.mutate({
|
|
45
41
|
id: e.id,
|
|
46
42
|
status: t.target
|
|
47
43
|
}, { onError: H });
|
|
@@ -55,12 +51,12 @@ var L = 84, R = 8, z = {
|
|
|
55
51
|
/* @__PURE__ */ S("ul", {
|
|
56
52
|
className: "mt-4 space-y-3",
|
|
57
53
|
"data-testid": "sb-mobile-relationship-list",
|
|
58
|
-
children:
|
|
54
|
+
children: t.map((e) => /* @__PURE__ */ S(V, {
|
|
59
55
|
relationship: e,
|
|
60
56
|
open: p === e.id,
|
|
61
57
|
busy: B,
|
|
62
58
|
onOpenChange: (t) => m(t ? e.id : null),
|
|
63
|
-
onSelect: () =>
|
|
59
|
+
onSelect: () => n(`/relationships/${e.id}`),
|
|
64
60
|
onMore: () => {
|
|
65
61
|
m(null), v(e);
|
|
66
62
|
},
|
|
@@ -72,25 +68,25 @@ var L = 84, R = 8, z = {
|
|
|
72
68
|
onOpenChange: (e) => !e && v(null),
|
|
73
69
|
children: /* @__PURE__ */ S(N, {
|
|
74
70
|
"data-testid": "sb-mobile-relationship-actions",
|
|
75
|
-
children: g && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ C(F, { children: [/* @__PURE__ */ S(I, { children: g.label }), /* @__PURE__ */ C(P, { children: [s(g.amount, g.currency),
|
|
71
|
+
children: g && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ C(F, { children: [/* @__PURE__ */ S(I, { children: g.label }), /* @__PURE__ */ C(P, { children: [s(g.amount, g.currency), c(g.interval)] })] }), /* @__PURE__ */ C("div", {
|
|
76
72
|
className: "flex flex-col gap-2 py-2",
|
|
77
73
|
children: [/* @__PURE__ */ C("button", {
|
|
78
74
|
type: "button",
|
|
79
75
|
className: "flex min-h-12 items-center justify-between rounded-xl bg-bg-surface px-4 text-start text-sm font-medium text-text-primary active:bg-bg-sunken",
|
|
80
76
|
onClick: () => {
|
|
81
77
|
let e = g.id;
|
|
82
|
-
v(null),
|
|
78
|
+
v(null), n(`/relationships/${e}`);
|
|
83
79
|
},
|
|
84
80
|
children: [u("mobile.relationships.viewDetails", "View details"), /* @__PURE__ */ S(_, { className: "rtl:rotate-180 h-4 w-4 text-text-secondary" })]
|
|
85
|
-
}),
|
|
86
|
-
let t = z[e.id],
|
|
81
|
+
}), l(g.status).map((e) => {
|
|
82
|
+
let t = z[e.id], n = t.icon;
|
|
87
83
|
return /* @__PURE__ */ C("button", {
|
|
88
84
|
type: "button",
|
|
89
85
|
disabled: B,
|
|
90
|
-
className:
|
|
86
|
+
className: o("flex min-h-12 items-center gap-3 rounded-xl px-4 text-start text-sm font-medium disabled:opacity-50", t.tone),
|
|
91
87
|
onClick: () => U(g, e),
|
|
92
88
|
children: [
|
|
93
|
-
/* @__PURE__ */ S(
|
|
89
|
+
/* @__PURE__ */ S(n, { className: "h-4 w-4" }),
|
|
94
90
|
" ",
|
|
95
91
|
u(t.key, t.fallback)
|
|
96
92
|
]
|
|
@@ -112,9 +108,9 @@ var L = 84, R = 8, z = {
|
|
|
112
108
|
})] })] })
|
|
113
109
|
})
|
|
114
110
|
] });
|
|
115
|
-
}, V = ({ relationship:
|
|
116
|
-
let { formatCurrency: w, formatIntervalSuffix: T } =
|
|
117
|
-
O
|
|
111
|
+
}, V = ({ relationship: r, open: i, busy: g, onOpenChange: _, onSelect: y, onMore: b, onAction: x }) => {
|
|
112
|
+
let { formatCurrency: w, formatIntervalSuffix: T } = e(), E = a(), D = l(r.status), O = D.length * L, [k, A] = h(null), j = m(null), M = m(0), N = k ?? (i ? -O : 0), P = s(r.renewsAt), F = P != null && (r.status === "ACTIVE" || r.status === "TRIAL") ? u(P) : null, I = (e) => {
|
|
113
|
+
O !== 0 && e.pointerType !== "mouse" && (j.current = {
|
|
118
114
|
x: e.clientX,
|
|
119
115
|
y: e.clientY,
|
|
120
116
|
swiping: !1,
|
|
@@ -132,69 +128,65 @@ var L = 84, R = 8, z = {
|
|
|
132
128
|
if (Math.abs(n) < R) return;
|
|
133
129
|
t.swiping = !0, e.currentTarget.setPointerCapture(e.pointerId);
|
|
134
130
|
}
|
|
135
|
-
t.moved = !0, A(
|
|
131
|
+
t.moved = !0, A(f(n, i, O));
|
|
136
132
|
}, V = () => {
|
|
137
133
|
let e = j.current;
|
|
138
|
-
j.current = null, e?.swiping && k != null && _(
|
|
134
|
+
j.current = null, e?.swiping && k != null && _(p(k, O)), A(null), e?.moved && (M.current = d(Date.now()));
|
|
139
135
|
};
|
|
140
136
|
return /* @__PURE__ */ C("li", {
|
|
141
137
|
className: "relative overflow-hidden rounded-2xl border border-border-subtle bg-bg-sunken",
|
|
142
138
|
"data-testid": "sb-mobile-relationship-row",
|
|
143
|
-
"data-relationship-id":
|
|
139
|
+
"data-relationship-id": r.id,
|
|
144
140
|
children: [D.length > 0 && /* @__PURE__ */ S("div", {
|
|
145
141
|
className: "absolute inset-y-0 right-0 flex",
|
|
146
142
|
style: { width: O },
|
|
147
|
-
"aria-hidden": !
|
|
143
|
+
"aria-hidden": !i,
|
|
148
144
|
children: D.map((e) => {
|
|
149
|
-
let t = z[e.id],
|
|
145
|
+
let t = z[e.id], n = t.icon;
|
|
150
146
|
return /* @__PURE__ */ C("button", {
|
|
151
147
|
type: "button",
|
|
152
|
-
tabIndex:
|
|
148
|
+
tabIndex: i ? 0 : -1,
|
|
153
149
|
disabled: g,
|
|
154
150
|
onClick: () => x(e),
|
|
155
|
-
className:
|
|
151
|
+
className: o("flex h-full flex-col items-center justify-center gap-1 text-xs font-medium disabled:opacity-50", t.tone),
|
|
156
152
|
style: { width: L },
|
|
157
|
-
children: [/* @__PURE__ */ S(
|
|
153
|
+
children: [/* @__PURE__ */ S(n, { className: "h-5 w-5" }), E(t.key, t.fallback)]
|
|
158
154
|
}, e.id);
|
|
159
155
|
})
|
|
160
156
|
}), /* @__PURE__ */ C("div", {
|
|
161
|
-
className:
|
|
157
|
+
className: o("relative flex touch-pan-y items-center gap-3 bg-bg-surface p-4", k == null && "transition-transform duration-200 ease-out"),
|
|
162
158
|
style: { transform: `translateX(${N}px)` },
|
|
163
159
|
onPointerDown: I,
|
|
164
160
|
onPointerMove: B,
|
|
165
161
|
onPointerUp: V,
|
|
166
162
|
onPointerCancel: V,
|
|
167
163
|
onClickCapture: (e) => {
|
|
168
|
-
|
|
164
|
+
c(Date.now(), M.current) && (M.current = 0, e.preventDefault(), e.stopPropagation());
|
|
169
165
|
},
|
|
170
166
|
children: [/* @__PURE__ */ C("button", {
|
|
171
167
|
type: "button",
|
|
172
168
|
onClick: () => {
|
|
173
|
-
|
|
174
|
-
_(!1);
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
y();
|
|
169
|
+
i ? _(!1) : y();
|
|
178
170
|
},
|
|
179
171
|
className: "flex min-w-0 flex-1 items-center gap-3 text-start",
|
|
180
|
-
children: [/* @__PURE__ */ S(
|
|
172
|
+
children: [/* @__PURE__ */ S(n, { kind: r.kind }), /* @__PURE__ */ C("span", {
|
|
181
173
|
className: "min-w-0 flex-1",
|
|
182
174
|
children: [
|
|
183
175
|
/* @__PURE__ */ S("span", {
|
|
184
176
|
className: "block truncate font-semibold text-text-primary",
|
|
185
|
-
children:
|
|
177
|
+
children: r.label
|
|
186
178
|
}),
|
|
187
179
|
/* @__PURE__ */ C("span", {
|
|
188
180
|
className: "block text-base tabular-nums text-text-primary",
|
|
189
|
-
children: [w(
|
|
181
|
+
children: [w(r.amount, r.currency), /* @__PURE__ */ S("span", {
|
|
190
182
|
className: "text-sm text-text-secondary",
|
|
191
|
-
children: T(
|
|
183
|
+
children: T(r.interval)
|
|
192
184
|
})]
|
|
193
185
|
}),
|
|
194
186
|
/* @__PURE__ */ C("span", {
|
|
195
187
|
className: "mt-0.5 flex items-center gap-2",
|
|
196
|
-
children: [/* @__PURE__ */ S(
|
|
197
|
-
className:
|
|
188
|
+
children: [/* @__PURE__ */ S(t, { status: r.status }), F && /* @__PURE__ */ S("span", {
|
|
189
|
+
className: o("truncate text-xs", F.tone === "later" ? "text-text-secondary" : "text-status-warning-text"),
|
|
198
190
|
children: E(F.key, F.fallback, F.params)
|
|
199
191
|
})]
|
|
200
192
|
})
|
|
@@ -203,7 +195,7 @@ var L = 84, R = 8, z = {
|
|
|
203
195
|
}), /* @__PURE__ */ S("button", {
|
|
204
196
|
type: "button",
|
|
205
197
|
onClick: b,
|
|
206
|
-
"aria-label": E("mobile.relationships.moreActions", "More actions for {{label}}", { label:
|
|
198
|
+
"aria-label": E("mobile.relationships.moreActions", "More actions for {{label}}", { label: r.label }),
|
|
207
199
|
className: "flex size-11 shrink-0 items-center justify-center rounded-full text-text-secondary active:bg-bg-sunken",
|
|
208
200
|
"data-testid": "sb-mobile-relationship-more",
|
|
209
201
|
children: /* @__PURE__ */ S(v, { className: "h-5 w-5" })
|
|
@@ -211,7 +203,6 @@ var L = 84, R = 8, z = {
|
|
|
211
203
|
})]
|
|
212
204
|
});
|
|
213
205
|
};
|
|
214
|
-
//#endregion
|
|
215
206
|
export { B as MobileRelationshipList };
|
|
216
207
|
|
|
217
208
|
//# sourceMappingURL=MobileRelationshipList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileRelationshipList.js","names":[],"sources":["../../../../src/subscriberbot/components/mobile/MobileRelationshipList.tsx"],"sourcesContent":["import { useFormatters } from '../../hooks/useFormatters';\n/**\n * Mobile relationship list\n * @module subscriberbot/components/mobile\n *\n * Card rows for phone widths. Each row opens the relationship on tap, reveals\n * its lifecycle actions on a left swipe, and offers the same actions through\n * an overflow (⋯) button that opens a bottom sheet — so the actions stay\n * reachable without the gesture (keyboard, screen readers, desktop browsers\n * resized to phone width). Actions are filtered through the svc state machine\n * (`quickActionsFor`); cancelling asks for confirmation first.\n */\n\nimport {\n useRef,\n useState,\n type FC,\n type MouseEvent as ReactMouseEvent,\n type PointerEvent as ReactPointerEvent,\n} from 'react';\nimport { Ban, ChevronRight, MoreHorizontal, Pause, Play, type LucideIcon } from 'lucide-react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n BottomSheet,\n BottomSheetContent,\n BottomSheetDescription,\n BottomSheetHeader,\n BottomSheetTitle,\n} from '@burdenoff/fe-libs/ui';\nimport { StatusBadge } from '../StatusBadge';\nimport { RelationshipGlyph } from './RelationshipGlyph';\nimport { useCancelRelationship, useTransitionRelationship } from '../../hooks/useSubscriberBotApi';\nimport { useTr } from '../../hooks/useTr';\nimport { cn } from '../../utils/cn';\n\nimport {\n daysUntil,\n isSwipeTrailingClick,\n quickActionsFor,\n renewalCountdown,\n swipeClickDeadline,\n swipeOffset,\n swipeSettlesOpen,\n type QuickAction,\n type QuickActionId,\n} from '../../utils/portfolio';\nimport type { SubRelationship } from '../../types';\n\n/** Width of one revealed action button. */\nconst ACTION_WIDTH = 84;\n/** Horizontal travel before a touch counts as a swipe rather than a tap/scroll. */\nconst SWIPE_SLOP = 8;\n\nconst ACTION_META: Record<\n QuickActionId,\n { key: string; fallback: string; icon: LucideIcon; tone: string }\n> = {\n activate: {\n key: 'relationships.detail.actions.activate',\n fallback: 'Activate',\n icon: Play,\n tone: 'bg-status-success-bg-subtle text-status-success-text',\n },\n resume: {\n key: 'mobile.relationships.resume',\n fallback: 'Resume',\n icon: Play,\n tone: 'bg-status-success-bg-subtle text-status-success-text',\n },\n pause: {\n key: 'relationships.detail.actions.pause',\n fallback: 'Pause',\n icon: Pause,\n tone: 'bg-status-warning-bg-subtle text-status-warning-text',\n },\n cancel: {\n key: 'relationships.detail.actions.cancel',\n fallback: 'Cancel',\n icon: Ban,\n tone: 'bg-status-error-bg-subtle text-status-error-text',\n },\n};\n\ninterface MobileRelationshipListProps {\n items: SubRelationship[];\n navigateTo: (relativePath: string) => void;\n}\n\nexport const MobileRelationshipList: FC<MobileRelationshipListProps> = ({ items, navigateTo }) => {\n const { formatCurrency, formatIntervalSuffix } = useFormatters();\n\n const tr = useTr();\n const transition = useTransitionRelationship();\n const cancel = useCancelRelationship();\n const [openRowId, setOpenRowId] = useState<string | null>(null);\n const [sheetFor, setSheetFor] = useState<SubRelationship | null>(null);\n const [confirmCancel, setConfirmCancel] = useState<SubRelationship | null>(null);\n const [error, setError] = useState<string | null>(null);\n const busy = transition.isPending || cancel.isPending;\n\n const onError = (e: unknown) =>\n setError(\n e instanceof Error\n ? e.message\n : tr('mobile.relationships.actionFailed', 'That action could not be completed.')\n );\n\n const run = (relationship: SubRelationship, action: QuickAction) => {\n setOpenRowId(null);\n setSheetFor(null);\n setError(null);\n if (action.destructive) {\n setConfirmCancel(relationship);\n return;\n }\n transition.mutate({ id: relationship.id, status: action.target }, { onError });\n };\n\n const confirmCancellation = () => {\n if (!confirmCancel) return;\n const id = confirmCancel.id;\n setConfirmCancel(null);\n cancel.mutate(id, { onError });\n };\n\n return (\n <>\n {error && (\n <div\n role=\"alert\"\n className=\"mt-4 rounded-xl border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text\"\n >\n {error}\n </div>\n )}\n\n <ul className=\"mt-4 space-y-3\" data-testid=\"sb-mobile-relationship-list\">\n {items.map((r) => (\n <SwipeRow\n key={r.id}\n relationship={r}\n open={openRowId === r.id}\n busy={busy}\n onOpenChange={(open) => setOpenRowId(open ? r.id : null)}\n onSelect={() => navigateTo(`/relationships/${r.id}`)}\n onMore={() => {\n setOpenRowId(null);\n setSheetFor(r);\n }}\n onAction={(action) => run(r, action)}\n />\n ))}\n </ul>\n\n <BottomSheet open={sheetFor != null} onOpenChange={(open) => !open && setSheetFor(null)}>\n <BottomSheetContent data-testid=\"sb-mobile-relationship-actions\">\n {sheetFor && (\n <>\n <BottomSheetHeader>\n <BottomSheetTitle>{sheetFor.label}</BottomSheetTitle>\n <BottomSheetDescription>\n {formatCurrency(sheetFor.amount, sheetFor.currency)}\n {formatIntervalSuffix(sheetFor.interval)}\n </BottomSheetDescription>\n </BottomSheetHeader>\n <div className=\"flex flex-col gap-2 py-2\">\n <button\n type=\"button\"\n className=\"flex min-h-12 items-center justify-between rounded-xl bg-bg-surface px-4 text-start text-sm font-medium text-text-primary active:bg-bg-sunken\"\n onClick={() => {\n const id = sheetFor.id;\n setSheetFor(null);\n navigateTo(`/relationships/${id}`);\n }}\n >\n {tr('mobile.relationships.viewDetails', 'View details')}\n <ChevronRight className=\"rtl:rotate-180 h-4 w-4 text-text-secondary\" />\n </button>\n {quickActionsFor(sheetFor.status).map((action) => {\n const meta = ACTION_META[action.id];\n const Icon = meta.icon;\n return (\n <button\n key={action.id}\n type=\"button\"\n disabled={busy}\n className={cn(\n 'flex min-h-12 items-center gap-3 rounded-xl px-4 text-start text-sm font-medium disabled:opacity-50',\n meta.tone\n )}\n onClick={() => run(sheetFor, action)}\n >\n <Icon className=\"h-4 w-4\" /> {tr(meta.key, meta.fallback)}\n </button>\n );\n })}\n </div>\n </>\n )}\n </BottomSheetContent>\n </BottomSheet>\n\n <AlertDialog\n open={confirmCancel != null}\n onOpenChange={(open) => !open && setConfirmCancel(null)}\n >\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>\n {tr('mobile.relationships.cancelTitle', 'Cancel {{label}}?', {\n label: confirmCancel?.label ?? '',\n })}\n </AlertDialogTitle>\n <AlertDialogDescription>\n {tr(\n 'mobile.relationships.cancelDescription',\n 'This marks the relationship as cancelled in Subscriber Bot. A cancelled relationship cannot be reactivated.'\n )}\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>{tr('mobile.relationships.keep', 'Keep it')}</AlertDialogCancel>\n <AlertDialogAction onClick={confirmCancellation}>\n {tr('mobile.relationships.confirmCancel', 'Cancel relationship')}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </>\n );\n};\n\ninterface SwipeRowProps {\n relationship: SubRelationship;\n open: boolean;\n busy: boolean;\n onOpenChange: (open: boolean) => void;\n onSelect: () => void;\n onMore: () => void;\n onAction: (action: QuickAction) => void;\n}\n\nconst SwipeRow: FC<SwipeRowProps> = ({\n relationship: r,\n open,\n busy,\n onOpenChange,\n onSelect,\n onMore,\n onAction,\n}) => {\n const { formatCurrency, formatIntervalSuffix } = useFormatters();\n\n const tr = useTr();\n const actions = quickActionsFor(r.status);\n const revealWidth = actions.length * ACTION_WIDTH;\n const [dragOffset, setDragOffset] = useState<number | null>(null);\n const gesture = useRef<{ x: number; y: number; swiping: boolean; moved: boolean } | null>(null);\n\n // A swipe ends with a synthetic click. While the pointer is captured that\n // click targets the capturing card element rather than the inner button,\n // so it is swallowed in the card's capture phase, and only within a short\n // window after the gesture — a later deliberate tap always goes through,\n // and a cancelled swipe (which dispatches no click) leaves nothing pending.\n const swipeClickUntil = useRef(0);\n\n const offset = dragOffset ?? (open ? -revealWidth : 0);\n const days = daysUntil(r.renewsAt);\n const countdown =\n days != null && (r.status === 'ACTIVE' || r.status === 'TRIAL') ? renewalCountdown(days) : null;\n\n const onPointerDown = (e: ReactPointerEvent<HTMLDivElement>) => {\n if (revealWidth === 0 || e.pointerType === 'mouse') return;\n gesture.current = { x: e.clientX, y: e.clientY, swiping: false, moved: false };\n };\n\n const onPointerMove = (e: ReactPointerEvent<HTMLDivElement>) => {\n const g = gesture.current;\n if (!g) return;\n const dx = e.clientX - g.x;\n const dy = e.clientY - g.y;\n if (!g.swiping) {\n if (Math.abs(dy) > SWIPE_SLOP && Math.abs(dy) > Math.abs(dx)) {\n // Vertical scroll — let the page have it.\n gesture.current = null;\n return;\n }\n if (Math.abs(dx) < SWIPE_SLOP) return;\n g.swiping = true;\n e.currentTarget.setPointerCapture(e.pointerId);\n }\n g.moved = true;\n setDragOffset(swipeOffset(dx, open, revealWidth));\n };\n\n const endGesture = () => {\n const g = gesture.current;\n gesture.current = null;\n if (g?.swiping && dragOffset != null) {\n onOpenChange(swipeSettlesOpen(dragOffset, revealWidth));\n }\n setDragOffset(null);\n if (g?.moved) swipeClickUntil.current = swipeClickDeadline(Date.now());\n };\n\n const onClickCapture = (e: ReactMouseEvent<HTMLDivElement>) => {\n if (!isSwipeTrailingClick(Date.now(), swipeClickUntil.current)) return;\n swipeClickUntil.current = 0;\n e.preventDefault();\n e.stopPropagation();\n };\n\n const handleSelect = () => {\n if (open) {\n onOpenChange(false);\n return;\n }\n onSelect();\n };\n\n return (\n <li\n className=\"relative overflow-hidden rounded-2xl border border-border-subtle bg-bg-sunken\"\n data-testid=\"sb-mobile-relationship-row\"\n data-relationship-id={r.id}\n >\n {/* Action tray, revealed under the card by a left swipe. Hidden from\n assistive tech and the tab order while closed — the ⋯ sheet is the\n accessible path to the same actions. */}\n {actions.length > 0 && (\n <div\n className=\"absolute inset-y-0 right-0 flex\"\n style={{ width: revealWidth }}\n aria-hidden={!open}\n >\n {actions.map((action) => {\n const meta = ACTION_META[action.id];\n const Icon = meta.icon;\n return (\n <button\n key={action.id}\n type=\"button\"\n tabIndex={open ? 0 : -1}\n disabled={busy}\n onClick={() => onAction(action)}\n className={cn(\n 'flex h-full flex-col items-center justify-center gap-1 text-xs font-medium disabled:opacity-50',\n meta.tone\n )}\n style={{ width: ACTION_WIDTH }}\n >\n <Icon className=\"h-5 w-5\" />\n {tr(meta.key, meta.fallback)}\n </button>\n );\n })}\n </div>\n )}\n\n <div\n className={cn(\n 'relative flex touch-pan-y items-center gap-3 bg-bg-surface p-4',\n dragOffset == null && 'transition-transform duration-200 ease-out'\n )}\n style={{ transform: `translateX(${offset}px)` }}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={endGesture}\n onPointerCancel={endGesture}\n onClickCapture={onClickCapture}\n >\n <button\n type=\"button\"\n onClick={handleSelect}\n className=\"flex min-w-0 flex-1 items-center gap-3 text-start\"\n >\n <RelationshipGlyph kind={r.kind} />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-semibold text-text-primary\">{r.label}</span>\n <span className=\"block text-base tabular-nums text-text-primary\">\n {formatCurrency(r.amount, r.currency)}\n <span className=\"text-sm text-text-secondary\">\n {formatIntervalSuffix(r.interval)}\n </span>\n </span>\n <span className=\"mt-0.5 flex items-center gap-2\">\n <StatusBadge status={r.status} />\n {countdown && (\n <span\n className={cn(\n 'truncate text-xs',\n countdown.tone === 'later' ? 'text-text-secondary' : 'text-status-warning-text'\n )}\n >\n {tr(countdown.key, countdown.fallback, countdown.params)}\n </span>\n )}\n </span>\n </span>\n </button>\n <button\n type=\"button\"\n onClick={onMore}\n aria-label={tr('mobile.relationships.moreActions', 'More actions for {{label}}', {\n label: r.label,\n })}\n className=\"flex size-11 shrink-0 items-center justify-center rounded-full text-text-secondary active:bg-bg-sunken\"\n data-testid=\"sb-mobile-relationship-more\"\n >\n <MoreHorizontal className=\"h-5 w-5\" />\n </button>\n </div>\n </li>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAwDA,IAAM,IAAe,IAEf,IAAa,GAEb,IAGF;CACF,UAAU;EACR,KAAK;EACL,UAAU;EACV,MAAM;EACN,MAAM;CACR;CACA,QAAQ;EACN,KAAK;EACL,UAAU;EACV,MAAM;EACN,MAAM;CACR;CACA,OAAO;EACL,KAAK;EACL,UAAU;EACV,MAAM;EACN,MAAM;CACR;CACA,QAAQ;EACN,KAAK;EACL,UAAU;EACV,MAAM;EACN,MAAM;CACR;AACF,GAOa,KAA2D,EAAE,UAAO,oBAAiB;CAChG,IAAM,EAAE,mBAAgB,4BAAyB,EAAc,GAEzD,IAAK,EAAM,GACX,IAAa,EAA0B,GACvC,IAAS,EAAsB,GAC/B,CAAC,GAAW,KAAgB,EAAwB,IAAI,GACxD,CAAC,GAAU,KAAe,E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,EAAE,QAAQ,GACpC,kBAAC,QAAD;QAAM,WAAU;kBACb,EAAqB,EAAE,QAAQ;OAC5B,CAAA,CACF;;MACN,kBAAC,QAAD;OAAM,WAAU;iBAAhB,CACE,kBAAC,GAAD,EAAa,QAAQ,EAAE,OAAS,CAAA,GAC/B,KACC,kBAAC,QAAD;QACE,WAAW,EACT,oBACA,EAAU,SAAS,UAAU,wBAAwB,0BACvD;kBAEC,EAAG,EAAU,KAAK,EAAU,UAAU,EAAU,MAAM;OACnD,CAAA,CAEJ;;KACF;MACA;OACR,kBAAC,UAAD;IACE,MAAK;IACL,SAAS;IACT,cAAY,EAAG,oCAAoC,8BAA8B,EAC/E,OAAO,EAAE,MACX,CAAC;IACD,WAAU;IACV,eAAY;cAEZ,kBAAC,GAAD,EAAgB,WAAU,UAAW,CAAA;GAC/B,CAAA,CACL;IACH;;AAER"}
|
|
1
|
+
{"version":3,"file":"MobileRelationshipList.js","names":["_Fragment","Fragment$1","ACTION_WIDTH","SWIPE_SLOP","ACTION_META","Play","Pause","Ban","MobileRelationshipList","useFormatters","tr","useTr","transition","useTransitionRelationship","cancel","useCancelRelationship","openRowId","setOpenRowId","useState","sheetFor","setSheetFor","confirmCancel","setConfirmCancel","error","setError","busy","onError","run","action","relationship","items","SwipeRow","r","open","navigateTo","BottomSheet","BottomSheetContent","BottomSheetHeader","BottomSheetTitle","BottomSheetDescription","formatCurrency","formatIntervalSuffix","id","ChevronRight","quickActionsFor","meta","Icon","cn","AlertDialog","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","actions","revealWidth","dragOffset","setDragOffset","gesture","useRef","swipeClickUntil","offset","days","daysUntil","countdown","renewalCountdown","onPointerDown","onPointerMove","g","dx","dy","swipeOffset","endGesture","onOpenChange","swipeSettlesOpen","swipeClickDeadline","onAction","isSwipeTrailingClick","onSelect","RelationshipGlyph","StatusBadge","onMore","MoreHorizontal"],"sources":["../../../../src/subscriberbot/components/mobile/MobileRelationshipList.tsx"],"sourcesContent":["import { useFormatters } from '../../hooks/useFormatters';\n/**\n * Mobile relationship list\n * @module subscriberbot/components/mobile\n *\n * Card rows for phone widths. Each row opens the relationship on tap, reveals\n * its lifecycle actions on a left swipe, and offers the same actions through\n * an overflow (⋯) button that opens a bottom sheet — so the actions stay\n * reachable without the gesture (keyboard, screen readers, desktop browsers\n * resized to phone width). Actions are filtered through the svc state machine\n * (`quickActionsFor`); cancelling asks for confirmation first.\n */\n\nimport {\n useRef,\n useState,\n type FC,\n type MouseEvent as ReactMouseEvent,\n type PointerEvent as ReactPointerEvent,\n} from 'react';\nimport { Ban, ChevronRight, MoreHorizontal, Pause, Play, type LucideIcon } from 'lucide-react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n BottomSheet,\n BottomSheetContent,\n BottomSheetDescription,\n BottomSheetHeader,\n BottomSheetTitle,\n} from '@burdenoff/fe-libs/ui';\nimport { StatusBadge } from '../StatusBadge';\nimport { RelationshipGlyph } from './RelationshipGlyph';\nimport { useCancelRelationship, useTransitionRelationship } from '../../hooks/useSubscriberBotApi';\nimport { useTr } from '../../hooks/useTr';\nimport { cn } from '../../utils/cn';\n\nimport {\n daysUntil,\n isSwipeTrailingClick,\n quickActionsFor,\n renewalCountdown,\n swipeClickDeadline,\n swipeOffset,\n swipeSettlesOpen,\n type QuickAction,\n type QuickActionId,\n} from '../../utils/portfolio';\nimport type { SubRelationship } from '../../types';\n\n/** Width of one revealed action button. */\nconst ACTION_WIDTH = 84;\n/** Horizontal travel before a touch counts as a swipe rather than a tap/scroll. */\nconst SWIPE_SLOP = 8;\n\nconst ACTION_META: Record<\n QuickActionId,\n { key: string; fallback: string; icon: LucideIcon; tone: string }\n> = {\n activate: {\n key: 'relationships.detail.actions.activate',\n fallback: 'Activate',\n icon: Play,\n tone: 'bg-status-success-bg-subtle text-status-success-text',\n },\n resume: {\n key: 'mobile.relationships.resume',\n fallback: 'Resume',\n icon: Play,\n tone: 'bg-status-success-bg-subtle text-status-success-text',\n },\n pause: {\n key: 'relationships.detail.actions.pause',\n fallback: 'Pause',\n icon: Pause,\n tone: 'bg-status-warning-bg-subtle text-status-warning-text',\n },\n cancel: {\n key: 'relationships.detail.actions.cancel',\n fallback: 'Cancel',\n icon: Ban,\n tone: 'bg-status-error-bg-subtle text-status-error-text',\n },\n};\n\ninterface MobileRelationshipListProps {\n items: SubRelationship[];\n navigateTo: (relativePath: string) => void;\n}\n\nexport const MobileRelationshipList: FC<MobileRelationshipListProps> = ({ items, navigateTo }) => {\n const { formatCurrency, formatIntervalSuffix } = useFormatters();\n\n const tr = useTr();\n const transition = useTransitionRelationship();\n const cancel = useCancelRelationship();\n const [openRowId, setOpenRowId] = useState<string | null>(null);\n const [sheetFor, setSheetFor] = useState<SubRelationship | null>(null);\n const [confirmCancel, setConfirmCancel] = useState<SubRelationship | null>(null);\n const [error, setError] = useState<string | null>(null);\n const busy = transition.isPending || cancel.isPending;\n\n const onError = (e: unknown) =>\n setError(\n e instanceof Error\n ? e.message\n : tr('mobile.relationships.actionFailed', 'That action could not be completed.')\n );\n\n const run = (relationship: SubRelationship, action: QuickAction) => {\n setOpenRowId(null);\n setSheetFor(null);\n setError(null);\n if (action.destructive) {\n setConfirmCancel(relationship);\n return;\n }\n transition.mutate({ id: relationship.id, status: action.target }, { onError });\n };\n\n const confirmCancellation = () => {\n if (!confirmCancel) return;\n const id = confirmCancel.id;\n setConfirmCancel(null);\n cancel.mutate(id, { onError });\n };\n\n return (\n <>\n {error && (\n <div\n role=\"alert\"\n className=\"mt-4 rounded-xl border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text\"\n >\n {error}\n </div>\n )}\n\n <ul className=\"mt-4 space-y-3\" data-testid=\"sb-mobile-relationship-list\">\n {items.map((r) => (\n <SwipeRow\n key={r.id}\n relationship={r}\n open={openRowId === r.id}\n busy={busy}\n onOpenChange={(open) => setOpenRowId(open ? r.id : null)}\n onSelect={() => navigateTo(`/relationships/${r.id}`)}\n onMore={() => {\n setOpenRowId(null);\n setSheetFor(r);\n }}\n onAction={(action) => run(r, action)}\n />\n ))}\n </ul>\n\n <BottomSheet open={sheetFor != null} onOpenChange={(open) => !open && setSheetFor(null)}>\n <BottomSheetContent data-testid=\"sb-mobile-relationship-actions\">\n {sheetFor && (\n <>\n <BottomSheetHeader>\n <BottomSheetTitle>{sheetFor.label}</BottomSheetTitle>\n <BottomSheetDescription>\n {formatCurrency(sheetFor.amount, sheetFor.currency)}\n {formatIntervalSuffix(sheetFor.interval)}\n </BottomSheetDescription>\n </BottomSheetHeader>\n <div className=\"flex flex-col gap-2 py-2\">\n <button\n type=\"button\"\n className=\"flex min-h-12 items-center justify-between rounded-xl bg-bg-surface px-4 text-start text-sm font-medium text-text-primary active:bg-bg-sunken\"\n onClick={() => {\n const id = sheetFor.id;\n setSheetFor(null);\n navigateTo(`/relationships/${id}`);\n }}\n >\n {tr('mobile.relationships.viewDetails', 'View details')}\n <ChevronRight className=\"rtl:rotate-180 h-4 w-4 text-text-secondary\" />\n </button>\n {quickActionsFor(sheetFor.status).map((action) => {\n const meta = ACTION_META[action.id];\n const Icon = meta.icon;\n return (\n <button\n key={action.id}\n type=\"button\"\n disabled={busy}\n className={cn(\n 'flex min-h-12 items-center gap-3 rounded-xl px-4 text-start text-sm font-medium disabled:opacity-50',\n meta.tone\n )}\n onClick={() => run(sheetFor, action)}\n >\n <Icon className=\"h-4 w-4\" /> {tr(meta.key, meta.fallback)}\n </button>\n );\n })}\n </div>\n </>\n )}\n </BottomSheetContent>\n </BottomSheet>\n\n <AlertDialog\n open={confirmCancel != null}\n onOpenChange={(open) => !open && setConfirmCancel(null)}\n >\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>\n {tr('mobile.relationships.cancelTitle', 'Cancel {{label}}?', {\n label: confirmCancel?.label ?? '',\n })}\n </AlertDialogTitle>\n <AlertDialogDescription>\n {tr(\n 'mobile.relationships.cancelDescription',\n 'This marks the relationship as cancelled in Subscriber Bot. A cancelled relationship cannot be reactivated.'\n )}\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>{tr('mobile.relationships.keep', 'Keep it')}</AlertDialogCancel>\n <AlertDialogAction onClick={confirmCancellation}>\n {tr('mobile.relationships.confirmCancel', 'Cancel relationship')}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </>\n );\n};\n\ninterface SwipeRowProps {\n relationship: SubRelationship;\n open: boolean;\n busy: boolean;\n onOpenChange: (open: boolean) => void;\n onSelect: () => void;\n onMore: () => void;\n onAction: (action: QuickAction) => void;\n}\n\nconst SwipeRow: FC<SwipeRowProps> = ({\n relationship: r,\n open,\n busy,\n onOpenChange,\n onSelect,\n onMore,\n onAction,\n}) => {\n const { formatCurrency, formatIntervalSuffix } = useFormatters();\n\n const tr = useTr();\n const actions = quickActionsFor(r.status);\n const revealWidth = actions.length * ACTION_WIDTH;\n const [dragOffset, setDragOffset] = useState<number | null>(null);\n const gesture = useRef<{ x: number; y: number; swiping: boolean; moved: boolean } | null>(null);\n\n // A swipe ends with a synthetic click. While the pointer is captured that\n // click targets the capturing card element rather than the inner button,\n // so it is swallowed in the card's capture phase, and only within a short\n // window after the gesture — a later deliberate tap always goes through,\n // and a cancelled swipe (which dispatches no click) leaves nothing pending.\n const swipeClickUntil = useRef(0);\n\n const offset = dragOffset ?? (open ? -revealWidth : 0);\n const days = daysUntil(r.renewsAt);\n const countdown =\n days != null && (r.status === 'ACTIVE' || r.status === 'TRIAL') ? renewalCountdown(days) : null;\n\n const onPointerDown = (e: ReactPointerEvent<HTMLDivElement>) => {\n if (revealWidth === 0 || e.pointerType === 'mouse') return;\n gesture.current = { x: e.clientX, y: e.clientY, swiping: false, moved: false };\n };\n\n const onPointerMove = (e: ReactPointerEvent<HTMLDivElement>) => {\n const g = gesture.current;\n if (!g) return;\n const dx = e.clientX - g.x;\n const dy = e.clientY - g.y;\n if (!g.swiping) {\n if (Math.abs(dy) > SWIPE_SLOP && Math.abs(dy) > Math.abs(dx)) {\n // Vertical scroll — let the page have it.\n gesture.current = null;\n return;\n }\n if (Math.abs(dx) < SWIPE_SLOP) return;\n g.swiping = true;\n e.currentTarget.setPointerCapture(e.pointerId);\n }\n g.moved = true;\n setDragOffset(swipeOffset(dx, open, revealWidth));\n };\n\n const endGesture = () => {\n const g = gesture.current;\n gesture.current = null;\n if (g?.swiping && dragOffset != null) {\n onOpenChange(swipeSettlesOpen(dragOffset, revealWidth));\n }\n setDragOffset(null);\n if (g?.moved) swipeClickUntil.current = swipeClickDeadline(Date.now());\n };\n\n const onClickCapture = (e: ReactMouseEvent<HTMLDivElement>) => {\n if (!isSwipeTrailingClick(Date.now(), swipeClickUntil.current)) return;\n swipeClickUntil.current = 0;\n e.preventDefault();\n e.stopPropagation();\n };\n\n const handleSelect = () => {\n if (open) {\n onOpenChange(false);\n return;\n }\n onSelect();\n };\n\n return (\n <li\n className=\"relative overflow-hidden rounded-2xl border border-border-subtle bg-bg-sunken\"\n data-testid=\"sb-mobile-relationship-row\"\n data-relationship-id={r.id}\n >\n {/* Action tray, revealed under the card by a left swipe. Hidden from\n assistive tech and the tab order while closed — the ⋯ sheet is the\n accessible path to the same actions. */}\n {actions.length > 0 && (\n <div\n className=\"absolute inset-y-0 right-0 flex\"\n style={{ width: revealWidth }}\n aria-hidden={!open}\n >\n {actions.map((action) => {\n const meta = ACTION_META[action.id];\n const Icon = meta.icon;\n return (\n <button\n key={action.id}\n type=\"button\"\n tabIndex={open ? 0 : -1}\n disabled={busy}\n onClick={() => onAction(action)}\n className={cn(\n 'flex h-full flex-col items-center justify-center gap-1 text-xs font-medium disabled:opacity-50',\n meta.tone\n )}\n style={{ width: ACTION_WIDTH }}\n >\n <Icon className=\"h-5 w-5\" />\n {tr(meta.key, meta.fallback)}\n </button>\n );\n })}\n </div>\n )}\n\n <div\n className={cn(\n 'relative flex touch-pan-y items-center gap-3 bg-bg-surface p-4',\n dragOffset == null && 'transition-transform duration-200 ease-out'\n )}\n style={{ transform: `translateX(${offset}px)` }}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={endGesture}\n onPointerCancel={endGesture}\n onClickCapture={onClickCapture}\n >\n <button\n type=\"button\"\n onClick={handleSelect}\n className=\"flex min-w-0 flex-1 items-center gap-3 text-start\"\n >\n <RelationshipGlyph kind={r.kind} />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-semibold text-text-primary\">{r.label}</span>\n <span className=\"block text-base tabular-nums text-text-primary\">\n {formatCurrency(r.amount, r.currency)}\n <span className=\"text-sm text-text-secondary\">\n {formatIntervalSuffix(r.interval)}\n </span>\n </span>\n <span className=\"mt-0.5 flex items-center gap-2\">\n <StatusBadge status={r.status} />\n {countdown && (\n <span\n className={cn(\n 'truncate text-xs',\n countdown.tone === 'later' ? 'text-text-secondary' : 'text-status-warning-text'\n )}\n >\n {tr(countdown.key, countdown.fallback, countdown.params)}\n </span>\n )}\n </span>\n </span>\n </button>\n <button\n type=\"button\"\n onClick={onMore}\n aria-label={tr('mobile.relationships.moreActions', 'More actions for {{label}}', {\n label: r.label,\n })}\n className=\"flex size-11 shrink-0 items-center justify-center rounded-full text-text-secondary active:bg-bg-sunken\"\n data-testid=\"sb-mobile-relationship-more\"\n >\n <MoreHorizontal className=\"h-5 w-5\" />\n </button>\n </div>\n </li>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAwDA,IAAME,IAAe,IAEfC,IAAa,GAEbC,IAGF;CACF,UAAU;EACR,KAAK;EACL,UAAU;EACV,MAAMC;EACN,MAAM;CACR;CACA,QAAQ;EACN,KAAK;EACL,UAAU;EACV,MAAMA;EACN,MAAM;CACR;CACA,OAAO;EACL,KAAK;EACL,UAAU;EACV,MAAMC;EACN,MAAM;CACR;CACA,QAAQ;EACN,KA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D,EAAgB,WAAU,UAAW,CAAA;GAC/B,CAAA,CACL;EACH,CAAA,CAAA;;AAER"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn as e } from "../../utils/cn.js";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/subscriberbot/components/mobile/MobileScreen.tsx
|
|
4
4
|
var r = ({ title: r, eyebrow: i, hero: a, action: o, children: s, className: c, testId: l, dataTour: u }) => /* @__PURE__ */ n("div", {
|
|
5
5
|
className: e("flex min-h-full flex-col", c),
|
|
6
6
|
"data-testid": l,
|
|
@@ -42,7 +42,6 @@ var r = ({ title: r, eyebrow: i, hero: a, action: o, children: s, className: c,
|
|
|
42
42
|
}), i]
|
|
43
43
|
}), a]
|
|
44
44
|
});
|
|
45
|
-
//#endregion
|
|
46
45
|
export { r as MobileScreen, i as MobileSection };
|
|
47
46
|
|
|
48
47
|
//# sourceMappingURL=MobileScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileScreen.js","names":[],"sources":["../../../../src/subscriberbot/components/mobile/MobileScreen.tsx"],"sourcesContent":["/**\n * Mobile screen frame\n * @module subscriberbot/components/mobile\n *\n * The phone layout from the approved mobile mock (`sb-24-mobile-app.jpg`): a\n * brand-coloured hero band carrying the screen title (and, on the overview,\n * the headline number), with the content on a rounded sheet that overlaps the\n * band. Used below the `md` breakpoint only; desktop pages keep PageLayout.\n *\n * Semantic tokens only — the hero uses the product's action-primary pairing\n * so it follows the active brand and colour mode.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\n\ninterface MobileScreenProps {\n title: string;\n /** Small line above the title (e.g. the greeting). */\n eyebrow?: ReactNode;\n /** Optional hero content under the title (e.g. the recurring-spend figure). */\n hero?: ReactNode;\n /** Optional trailing control in the hero (e.g. an add button). */\n action?: ReactNode;\n children: ReactNode;\n className?: string;\n /** Stable hook for Playwright and the assistant page context. */\n testId?: string;\n /** Product-tour prefix; the header renders `{dataTour}-header`. */\n dataTour?: string;\n}\n\nexport const MobileScreen: FC<MobileScreenProps> = ({\n title,\n eyebrow,\n hero,\n action,\n children,\n className,\n testId,\n dataTour,\n}) => (\n <div className={cn('flex min-h-full flex-col', className)} data-testid={testId}>\n <header\n className=\"bg-action-primary-bg px-4 pb-10 pt-5 text-action-primary-text\"\n data-tour={dataTour ? `${dataTour}-header` : undefined}\n >\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n {eyebrow ? <p className=\"text-sm\">{eyebrow}</p> : null}\n <h1 className=\"text-2xl font-bold tracking-tight\">{title}</h1>\n </div>\n {action ? <div className=\"shrink-0\">{action}</div> : null}\n </div>\n {hero ? <div className=\"mt-4\">{hero}</div> : null}\n </header>\n <div className=\"-mt-6 flex-1 rounded-t-3xl bg-bg-canvas px-4 pb-6 pt-5\">{children}</div>\n </div>\n);\n\ninterface MobileSectionProps {\n title: string;\n action?: ReactNode;\n children: ReactNode;\n className?: string;\n dataTour?: string;\n}\n\n/** A titled group on the mobile sheet (\"Upcoming renewals\", \"Needs action\"). */\nexport const MobileSection: FC<MobileSectionProps> = ({\n title,\n action,\n children,\n className,\n dataTour,\n}) => (\n <section className={cn('mt-6 first:mt-0', className)} aria-label={title} data-tour={dataTour}>\n <div className=\"mb-3 flex items-center justify-between gap-3\">\n <h2 className=\"text-lg font-semibold text-text-primary\">{title}</h2>\n {action}\n </div>\n {children}\n </section>\n);\n"],"mappings":";;;AAgCA,
|
|
1
|
+
{"version":3,"file":"MobileScreen.js","names":["MobileScreen","cn","className","testId","dataTour","eyebrow","title","action","hero","MobileSection","children"],"sources":["../../../../src/subscriberbot/components/mobile/MobileScreen.tsx"],"sourcesContent":["/**\n * Mobile screen frame\n * @module subscriberbot/components/mobile\n *\n * The phone layout from the approved mobile mock (`sb-24-mobile-app.jpg`): a\n * brand-coloured hero band carrying the screen title (and, on the overview,\n * the headline number), with the content on a rounded sheet that overlaps the\n * band. Used below the `md` breakpoint only; desktop pages keep PageLayout.\n *\n * Semantic tokens only — the hero uses the product's action-primary pairing\n * so it follows the active brand and colour mode.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\n\ninterface MobileScreenProps {\n title: string;\n /** Small line above the title (e.g. the greeting). */\n eyebrow?: ReactNode;\n /** Optional hero content under the title (e.g. the recurring-spend figure). */\n hero?: ReactNode;\n /** Optional trailing control in the hero (e.g. an add button). */\n action?: ReactNode;\n children: ReactNode;\n className?: string;\n /** Stable hook for Playwright and the assistant page context. */\n testId?: string;\n /** Product-tour prefix; the header renders `{dataTour}-header`. */\n dataTour?: string;\n}\n\nexport const MobileScreen: FC<MobileScreenProps> = ({\n title,\n eyebrow,\n hero,\n action,\n children,\n className,\n testId,\n dataTour,\n}) => (\n <div className={cn('flex min-h-full flex-col', className)} data-testid={testId}>\n <header\n className=\"bg-action-primary-bg px-4 pb-10 pt-5 text-action-primary-text\"\n data-tour={dataTour ? `${dataTour}-header` : undefined}\n >\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n {eyebrow ? <p className=\"text-sm\">{eyebrow}</p> : null}\n <h1 className=\"text-2xl font-bold tracking-tight\">{title}</h1>\n </div>\n {action ? <div className=\"shrink-0\">{action}</div> : null}\n </div>\n {hero ? <div className=\"mt-4\">{hero}</div> : null}\n </header>\n <div className=\"-mt-6 flex-1 rounded-t-3xl bg-bg-canvas px-4 pb-6 pt-5\">{children}</div>\n </div>\n);\n\ninterface MobileSectionProps {\n title: string;\n action?: ReactNode;\n children: ReactNode;\n className?: string;\n dataTour?: string;\n}\n\n/** A titled group on the mobile sheet (\"Upcoming renewals\", \"Needs action\"). */\nexport const MobileSection: FC<MobileSectionProps> = ({\n title,\n action,\n children,\n className,\n dataTour,\n}) => (\n <section className={cn('mt-6 first:mt-0', className)} aria-label={title} data-tour={dataTour}>\n <div className=\"mb-3 flex items-center justify-between gap-3\">\n <h2 className=\"text-lg font-semibold text-text-primary\">{title}</h2>\n {action}\n </div>\n {children}\n </section>\n);\n"],"mappings":";;;AAgCA,IAAaA,KAAuC,EAClD,UACA,YACA,SACA,WACA,aACA,cACA,WACA,kBAEA,kBAAC,OAAD;CAAK,WAAWC,EAAG,4BAA4BC,CAAS;CAAG,eAAaC;CAAxE,UAAA,CACE,kBAAC,UAAD;EACE,WAAU;EACV,aAAWC,IAAW,GAAGA,EAAS,WAAW,KAAA;EAF/C,UAAA,CAIE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACGC,IAAU,kBAAC,KAAD;KAAG,WAAU;KAAW,UAAAA;IAAW,CAAA,IAAI,MAClD,kBAAC,MAAD;KAAI,WAAU;KAAqC,UAAAC;IAAU,CAAA,CAC1D;GACJ,CAAA,GAAAC,IAAS,kBAAC,OAAD;IAAK,WAAU;IAAY,UAAAA;GAAY,CAAA,IAAI,IAClD;EACJ,CAAA,GAAAC,IAAO,kBAAC,OAAD;GAAK,WAAU;GAAQ,UAAAA;EAAU,CAAA,IAAI,IACvC;CACR,CAAA,GAAA,kBAAC,OAAD;EAAK,WAAU;EAA0D;CAAc,CAAA,CACpF;A,IAYMC,KAAyC,EACpD,UACA,WACA,aACA,cACA,kBAEA,kBAAC,WAAD;CAAS,WAAWR,EAAG,mBAAmBC,CAAS;CAAG,cAAYI;CAAO,aAAWF;CAApF,UAAA,CACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,kBAAC,MAAD;GAAI,WAAU;GAA2C,UAAAE;EAAU,CAAA,GAClEC,CACE;CACJ,CAAA,GAAAG,CACM"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn as e } from "../../utils/cn.js";
|
|
2
2
|
import { BadgeCheck as t, CreditCard as n, FileSignature as r, GraduationCap as i, Hourglass as a, KeyRound as o, Newspaper as s, Repeat2 as c } from "lucide-react";
|
|
3
3
|
import { jsx as l } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/subscriberbot/components/mobile/RelationshipGlyph.tsx
|
|
5
5
|
var u = {
|
|
6
6
|
SUBSCRIPTION: c,
|
|
7
7
|
MEMBERSHIP: t,
|
|
@@ -19,7 +19,6 @@ var u = {
|
|
|
19
19
|
children: /* @__PURE__ */ l(r, { className: "h-6 w-6" })
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { d as RelationshipGlyph };
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=RelationshipGlyph.js.map
|