@burdenoff/microfe-subscriberbot 2026.1102.4 → 2026.1102.5
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/stories/pages/DashboardPage.stories.d.ts +4 -0
- package/dist/stories/pages/DashboardPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/RelationshipsListPage.stories.d.ts +5 -0
- package/dist/stories/pages/RelationshipsListPage.stories.d.ts.map +1 -1
- package/dist/stories/support/phoneViewport.d.ts +4 -0
- package/dist/stories/support/phoneViewport.d.ts.map +1 -0
- package/dist/subscriberbot/components/PageLayout.d.ts.map +1 -1
- package/dist/subscriberbot/components/PageLayout.js +3 -3
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts +18 -0
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -0
- package/dist/subscriberbot/components/mobile/MobileDashboard.js +247 -0
- package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -0
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts +10 -0
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +1 -0
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +217 -0
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -0
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts +26 -0
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts.map +1 -0
- package/dist/subscriberbot/components/mobile/MobileScreen.js +46 -0
- package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -0
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts +10 -0
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts.map +1 -0
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js +25 -0
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js.map +1 -0
- package/dist/subscriberbot/components/mobile/index.d.ts +9 -0
- package/dist/subscriberbot/components/mobile/index.d.ts.map +1 -0
- package/dist/subscriberbot/components/mobile/index.js +4 -0
- package/dist/subscriberbot/hooks/index.d.ts +1 -0
- package/dist/subscriberbot/hooks/index.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/index.js +1 -0
- package/dist/subscriberbot/hooks/useCompactViewport.d.ts +13 -0
- package/dist/subscriberbot/hooks/useCompactViewport.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useCompactViewport.js +21 -0
- package/dist/subscriberbot/hooks/useCompactViewport.js.map +1 -0
- package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.js +166 -189
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +120 -119
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +226 -212
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/utils/portfolio.d.ts +106 -0
- package/dist/subscriberbot/utils/portfolio.d.ts.map +1 -0
- package/dist/subscriberbot/utils/portfolio.js +151 -0
- package/dist/subscriberbot/utils/portfolio.js.map +1 -0
- package/package.json +1 -1
|
@@ -9,4 +9,8 @@ export declare const QuickActionNavigates: Story;
|
|
|
9
9
|
export declare const Empty: Story;
|
|
10
10
|
export declare const Loading: Story;
|
|
11
11
|
export declare const ServiceUnavailable: Story;
|
|
12
|
+
/** Phone layout (BOFF-4010): hero spend, renewal cards, needs action, AI recommendations. */
|
|
13
|
+
export declare const MobileOverview: Story;
|
|
14
|
+
export declare const MobileRenewalOpensRelationship: Story;
|
|
15
|
+
export declare const MobileEmpty: Story;
|
|
12
16
|
//# sourceMappingURL=DashboardPage.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardPage.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/pages/DashboardPage.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"DashboardPage.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/pages/DashboardPage.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAMxE,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,aAAa,CAQpC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,SAAS,EAAE,KAcvB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAMlC,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAQnB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAQhC,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,cAAc,EAAE,KAoB5B,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,KAQ5C,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAYzB,CAAC"}
|
|
@@ -11,4 +11,9 @@ export declare const OpenRelationship: Story;
|
|
|
11
11
|
export declare const SearchWithNoMatches: Story;
|
|
12
12
|
export declare const Empty: Story;
|
|
13
13
|
export declare const ServiceUnavailable: Story;
|
|
14
|
+
/** Phone layout (BOFF-4010): swipeable cards with an overflow action sheet. */
|
|
15
|
+
export declare const MobileCards: Story;
|
|
16
|
+
export declare const MobileRowOpensDetail: Story;
|
|
17
|
+
export declare const MobilePauseFromActionSheet: Story;
|
|
18
|
+
export declare const MobileCancelAsksForConfirmation: Story;
|
|
14
19
|
//# sourceMappingURL=RelationshipsListPage.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelationshipsListPage.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/pages/RelationshipsListPage.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAC;
|
|
1
|
+
{"version":3,"file":"RelationshipsListPage.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/pages/RelationshipsListPage.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAC;AAQtG,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,qBAAqB,CAQ5C,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAa3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAa5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAM9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAWjC,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KASnB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAMhC,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,WAAW,EAAE,KAUzB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAQlC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,KAcxC,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,KAgB7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phoneViewport.d.ts","sourceRoot":"","sources":["../../../src/stories/support/phoneViewport.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AA4ClD,eAAO,MAAM,iBAAiB,EAAE,SAI/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.d.ts","sourceRoot":"","sources":["../../../src/subscriberbot/components/PageLayout.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3C,UAAU,eAAe;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"PageLayout.d.ts","sourceRoot":"","sources":["../../../src/subscriberbot/components/PageLayout.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3C,UAAU,eAAe;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAuC1C,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { AuroraBackground as r, GradientText as i } from "@burdenoff/fe-libs/ui"
|
|
|
5
5
|
var a = ({ title: a, description: o, actions: s, children: c, className: l, titleGradient: u = !1, aurora: d = !1 }) => /* @__PURE__ */ n("div", {
|
|
6
6
|
className: e("flex flex-col h-full", l),
|
|
7
7
|
children: [/* @__PURE__ */ n("div", {
|
|
8
|
-
className: e("relative flex
|
|
8
|
+
className: e("relative flex flex-col items-start gap-3 px-4 py-4 border-b border-border-seam sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:px-6", d ? "overflow-hidden bg-gloss-card" : "bg-bg-surface"),
|
|
9
9
|
children: [
|
|
10
10
|
d && /* @__PURE__ */ t(r, { intensity: "subtle" }),
|
|
11
11
|
/* @__PURE__ */ n("div", {
|
|
@@ -23,12 +23,12 @@ var a = ({ title: a, description: o, actions: s, children: c, className: l, titl
|
|
|
23
23
|
})]
|
|
24
24
|
}),
|
|
25
25
|
s && /* @__PURE__ */ t("div", {
|
|
26
|
-
className: "flex items-center gap-3 shrink-0",
|
|
26
|
+
className: "flex flex-wrap items-center gap-3 shrink-0",
|
|
27
27
|
children: s
|
|
28
28
|
})
|
|
29
29
|
]
|
|
30
30
|
}), /* @__PURE__ */ t("div", {
|
|
31
|
-
className: "flex-1 overflow-auto p-6",
|
|
31
|
+
className: "flex-1 overflow-auto p-4 sm:p-6",
|
|
32
32
|
children: c
|
|
33
33
|
})]
|
|
34
34
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.js","names":[],"sources":["../../../src/subscriberbot/components/PageLayout.tsx"],"sourcesContent":["/**\n * Page Layout Component\n * @module subscriberbot/components\n *\n * Boff UI 2.0 page wrapper. Supports a living-glass {@link AuroraBackground}\n * hero backdrop and a gradient hero title for the MFE's primary page.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { AuroraBackground, GradientText } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface PageLayoutProps {\n title: ReactNode;\n description?: string;\n actions?: ReactNode;\n children: ReactNode;\n className?: string;\n /**\n * Render the title as a gradient hero heading (Boff UI 2.0). Reserve for the\n * ONE primary page of the MFE so it stays a hero accent, never body copy.\n */\n titleGradient?: boolean;\n /**\n * Drop a subtle living-glass {@link AuroraBackground} behind the header.\n * Use on the MFE's primary page only (one aurora per MFE). Sits at -z-10 and\n * never moves content; auto-static under reduced motion.\n */\n aurora?: boolean;\n}\n\nexport const PageLayout: FC<PageLayoutProps> = ({\n title,\n description,\n actions,\n children,\n className,\n titleGradient = false,\n aurora = false,\n}) => {\n return (\n <div className={cn('flex flex-col h-full', className)}>\n {/* Page Header — optionally on a living-glass aurora hero backdrop. The\n aurora layer sits at -z-10 and never moves content. */}\n <div\n className={cn(\n 'relative flex
|
|
1
|
+
{"version":3,"file":"PageLayout.js","names":[],"sources":["../../../src/subscriberbot/components/PageLayout.tsx"],"sourcesContent":["/**\n * Page Layout Component\n * @module subscriberbot/components\n *\n * Boff UI 2.0 page wrapper. Supports a living-glass {@link AuroraBackground}\n * hero backdrop and a gradient hero title for the MFE's primary page.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { AuroraBackground, GradientText } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface PageLayoutProps {\n title: ReactNode;\n description?: string;\n actions?: ReactNode;\n children: ReactNode;\n className?: string;\n /**\n * Render the title as a gradient hero heading (Boff UI 2.0). Reserve for the\n * ONE primary page of the MFE so it stays a hero accent, never body copy.\n */\n titleGradient?: boolean;\n /**\n * Drop a subtle living-glass {@link AuroraBackground} behind the header.\n * Use on the MFE's primary page only (one aurora per MFE). Sits at -z-10 and\n * never moves content; auto-static under reduced motion.\n */\n aurora?: boolean;\n}\n\nexport const PageLayout: FC<PageLayoutProps> = ({\n title,\n description,\n actions,\n children,\n className,\n titleGradient = false,\n aurora = false,\n}) => {\n return (\n <div className={cn('flex flex-col h-full', className)}>\n {/* Page Header — optionally on a living-glass aurora hero backdrop. The\n aurora layer sits at -z-10 and never moves content. */}\n <div\n className={cn(\n // Phones stack the actions under the title so long titles and\n // action buttons never squeeze each other at 375px (BOFF-4010).\n 'relative flex flex-col items-start gap-3 px-4 py-4 border-b border-border-seam sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:px-6',\n aurora ? 'overflow-hidden bg-gloss-card' : 'bg-bg-surface'\n )}\n >\n {aurora && <AuroraBackground intensity=\"subtle\" />}\n <div className=\"min-w-0\">\n {titleGradient && typeof title === 'string' ? (\n <GradientText as=\"h1\" className=\"text-2xl font-semibold tracking-tight\">\n {title}\n </GradientText>\n ) : (\n <h1 className=\"text-2xl font-semibold text-text-primary\">{title}</h1>\n )}\n {description && <p className=\"mt-1 text-sm text-text-secondary\">{description}</p>}\n </div>\n {actions && <div className=\"flex flex-wrap items-center gap-3 shrink-0\">{actions}</div>}\n </div>\n\n {/* Page Content */}\n <div className=\"flex-1 overflow-auto p-4 sm:p-6\">{children}</div>\n </div>\n );\n};\n"],"mappings":";;;;AA+BA,IAAa,KAAmC,EAC9C,UACA,gBACA,YACA,aACA,cACA,mBAAgB,IAChB,YAAS,SAGP,kBAAC,OAAD;CAAK,WAAW,EAAG,wBAAwB,CAAS;WAApD,CAGE,kBAAC,OAAD;EACE,WAAW,EAGT,kJACA,IAAS,kCAAkC,eAC7C;YANF;GAQG,KAAU,kBAAC,GAAD,EAAkB,WAAU,SAAU,CAAA;GACjD,kBAAC,OAAD;IAAK,WAAU;cAAf,CACG,KAAiB,OAAO,KAAU,WACjC,kBAAC,GAAD;KAAc,IAAG;KAAK,WAAU;eAC7B;IACW,CAAA,IAEd,kBAAC,MAAD;KAAI,WAAU;eAA4C;IAAU,CAAA,GAErE,KAAe,kBAAC,KAAD;KAAG,WAAU;eAAoC;IAAe,CAAA,CAC7E;;GACJ,KAAW,kBAAC,OAAD;IAAK,WAAU;cAA8C;GAAa,CAAA;EACnF;KAGL,kBAAC,OAAD;EAAK,WAAU;EAAmC;CAAc,CAAA,CAC7D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { RecurringSpend, UpcomingRenewal } from '../../utils/portfolio';
|
|
3
|
+
import { SubDecision, SubInboxMessage } from '../../types';
|
|
4
|
+
|
|
5
|
+
export interface MobileDashboardProps {
|
|
6
|
+
greetingName?: string;
|
|
7
|
+
spend: RecurringSpend;
|
|
8
|
+
upcoming: UpcomingRenewal[];
|
|
9
|
+
actionMessages: SubInboxMessage[];
|
|
10
|
+
/** PROPOSED AI decisions, newest first. */
|
|
11
|
+
decisions: SubDecision[];
|
|
12
|
+
relationshipLabel: (relationshipId: string) => string | undefined;
|
|
13
|
+
openInvoiceCount: number;
|
|
14
|
+
openInvoiceTotal: number;
|
|
15
|
+
navigateTo: (relativePath: string) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const MobileDashboard: FC<MobileDashboardProps>;
|
|
18
|
+
//# sourceMappingURL=MobileDashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MobileDashboard.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/components/mobile/MobileDashboard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAmB3C,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,oBAAoB;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,cAAc,EAAE,eAAe,EAAE,CAAC;IAClC,2CAA2C;IAC3C,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,iBAAiB,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAClE,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAOD,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAkRpD,CAAC"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import { formatCurrency as t, formatIntervalSuffix as n } from "../../utils/formatters.js";
|
|
3
|
+
import { StatusBadge as r } from "../StatusBadge.js";
|
|
4
|
+
import { useTr as i } from "../../hooks/useTr.js";
|
|
5
|
+
import { daysUntil as a, renewalCountdown as o } from "../../utils/portfolio.js";
|
|
6
|
+
import { MobileScreen as s, MobileSection as c } from "./MobileScreen.js";
|
|
7
|
+
import { RelationshipGlyph as l } from "./RelationshipGlyph.js";
|
|
8
|
+
import { RECOMMENDATION_LABEL as u } from "../decisions/decisionModel.js";
|
|
9
|
+
import { AlertTriangle as d, ArrowRight as f, Bot as p, ChevronRight as m, Inbox as h, Lightbulb as g, PiggyBank as _, Plus as v, ShieldCheck as y } from "lucide-react";
|
|
10
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
11
|
+
//#region src/subscriberbot/components/mobile/MobileDashboard.tsx
|
|
12
|
+
var S = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle bg-bg-surface p-4 text-left shadow-sm transition-colors active:bg-bg-sunken", C = "inline-flex items-center gap-0.5 text-sm font-medium text-text-link", w = ({ greetingName: w, spend: T, upcoming: E, actionMessages: D, decisions: O, relationshipLabel: k, openInvoiceCount: A, openInvoiceTotal: j, navigateTo: M }) => {
|
|
13
|
+
let N = i(), P = [
|
|
14
|
+
{
|
|
15
|
+
id: "add",
|
|
16
|
+
label: N("mobile.dashboard.quick.add", "Add subscription"),
|
|
17
|
+
icon: /* @__PURE__ */ b(v, { className: "h-5 w-5" }),
|
|
18
|
+
path: "/relationships/new"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "inbox",
|
|
22
|
+
label: N("mobile.dashboard.quick.inbox", "Inbox"),
|
|
23
|
+
icon: /* @__PURE__ */ b(h, { className: "h-5 w-5" }),
|
|
24
|
+
path: "/inbox"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "savings",
|
|
28
|
+
label: N("mobile.dashboard.quick.savings", "Savings"),
|
|
29
|
+
icon: /* @__PURE__ */ b(_, { className: "h-5 w-5" }),
|
|
30
|
+
path: "/savings"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "agents",
|
|
34
|
+
label: N("mobile.dashboard.quick.agents", "Agents"),
|
|
35
|
+
icon: /* @__PURE__ */ b(p, { className: "h-5 w-5" }),
|
|
36
|
+
path: "/agents"
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
return /* @__PURE__ */ x(s, {
|
|
40
|
+
testId: "sb-mobile-dashboard",
|
|
41
|
+
title: N("dashboard.title", "Overview"),
|
|
42
|
+
eyebrow: w ? N("mobile.dashboard.greeting", "Hi, {{name}}", { name: w }) : void 0,
|
|
43
|
+
hero: /* @__PURE__ */ x("div", { children: [
|
|
44
|
+
/* @__PURE__ */ b("p", {
|
|
45
|
+
className: "text-sm opacity-80",
|
|
46
|
+
children: N("mobile.dashboard.totalSpend", "Total recurring spend")
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ x("p", {
|
|
49
|
+
className: "mt-1 font-bold tabular-nums",
|
|
50
|
+
"data-testid": "sb-mobile-total-spend",
|
|
51
|
+
children: [/* @__PURE__ */ b("span", {
|
|
52
|
+
className: "text-4xl",
|
|
53
|
+
children: t(T.monthly, T.currency)
|
|
54
|
+
}), /* @__PURE__ */ b("span", {
|
|
55
|
+
className: "text-base font-medium opacity-80",
|
|
56
|
+
children: N("mobile.dashboard.perMonth", "/month")
|
|
57
|
+
})]
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ b("p", {
|
|
60
|
+
className: "mt-1 text-xs opacity-80",
|
|
61
|
+
children: N(T.activeCount === 1 ? "mobile.dashboard.activeCountOne" : "mobile.dashboard.activeCount", T.activeCount === 1 ? "{{count}} active subscription" : "{{count}} active subscriptions", { count: T.activeCount })
|
|
62
|
+
})
|
|
63
|
+
] }),
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ b(c, {
|
|
66
|
+
title: N("dashboard.renewals.title", "Upcoming renewals"),
|
|
67
|
+
action: E.length > 0 ? /* @__PURE__ */ x("button", {
|
|
68
|
+
type: "button",
|
|
69
|
+
className: C,
|
|
70
|
+
onClick: () => M("/relationships"),
|
|
71
|
+
children: [
|
|
72
|
+
N("common.viewAll", "View all"),
|
|
73
|
+
" ",
|
|
74
|
+
/* @__PURE__ */ b(m, { className: "h-4 w-4" })
|
|
75
|
+
]
|
|
76
|
+
}) : void 0,
|
|
77
|
+
children: E.length === 0 ? /* @__PURE__ */ b("div", {
|
|
78
|
+
className: e(S, "text-sm text-text-secondary"),
|
|
79
|
+
children: N("dashboard.renewals.emptyDescription", "Renewals you track will appear here ahead of time.")
|
|
80
|
+
}) : /* @__PURE__ */ b("ul", {
|
|
81
|
+
className: "space-y-3",
|
|
82
|
+
"data-testid": "sb-mobile-renewals",
|
|
83
|
+
children: E.slice(0, 5).map((r) => {
|
|
84
|
+
let i = a(r.when), s = i == null ? null : o(i);
|
|
85
|
+
return /* @__PURE__ */ b("li", { children: /* @__PURE__ */ x("button", {
|
|
86
|
+
type: "button",
|
|
87
|
+
className: S,
|
|
88
|
+
onClick: () => M(`/relationships/${r.relationshipId}`),
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ b(l, { kind: r.kind }),
|
|
91
|
+
/* @__PURE__ */ x("span", {
|
|
92
|
+
className: "min-w-0 flex-1",
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ b("span", {
|
|
95
|
+
className: "block truncate font-semibold text-text-primary",
|
|
96
|
+
children: r.title
|
|
97
|
+
}),
|
|
98
|
+
r.amount != null && /* @__PURE__ */ x("span", {
|
|
99
|
+
className: "block text-base tabular-nums text-text-primary",
|
|
100
|
+
children: [t(r.amount, r.currency ?? T.currency), r.interval ? n(r.interval) : ""]
|
|
101
|
+
}),
|
|
102
|
+
s && /* @__PURE__ */ b("span", {
|
|
103
|
+
className: e("block text-sm", s.tone === "later" ? "text-text-secondary" : "text-status-warning-text"),
|
|
104
|
+
children: N(s.key, s.fallback, s.params)
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ b(m, { className: "h-4 w-4 shrink-0 text-text-secondary" })
|
|
109
|
+
]
|
|
110
|
+
}) }, r.id);
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
}),
|
|
114
|
+
/* @__PURE__ */ b(c, {
|
|
115
|
+
title: N("mobile.dashboard.needsAction", "Needs action"),
|
|
116
|
+
action: /* @__PURE__ */ x("button", {
|
|
117
|
+
type: "button",
|
|
118
|
+
className: C,
|
|
119
|
+
onClick: () => M("/inbox"),
|
|
120
|
+
children: [
|
|
121
|
+
N("dashboard.needsAttention.openInbox", "Open inbox"),
|
|
122
|
+
" ",
|
|
123
|
+
/* @__PURE__ */ b(m, { className: "h-4 w-4" })
|
|
124
|
+
]
|
|
125
|
+
}),
|
|
126
|
+
children: D.length === 0 ? /* @__PURE__ */ x("div", {
|
|
127
|
+
className: S,
|
|
128
|
+
children: [/* @__PURE__ */ b("span", {
|
|
129
|
+
className: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-status-success-bg-subtle text-status-success-text",
|
|
130
|
+
children: /* @__PURE__ */ b(y, { className: "h-5 w-5" })
|
|
131
|
+
}), /* @__PURE__ */ x("span", {
|
|
132
|
+
className: "min-w-0",
|
|
133
|
+
children: [/* @__PURE__ */ b("span", {
|
|
134
|
+
className: "block text-sm font-medium text-text-primary",
|
|
135
|
+
children: N("dashboard.needsAttention.allCaughtUp", "You're all caught up")
|
|
136
|
+
}), /* @__PURE__ */ b("span", {
|
|
137
|
+
className: "block text-xs text-text-secondary",
|
|
138
|
+
children: N("dashboard.needsAttention.allCaughtUpDescription", "Required actions across your channels will surface here.")
|
|
139
|
+
})]
|
|
140
|
+
})]
|
|
141
|
+
}) : /* @__PURE__ */ b("ul", {
|
|
142
|
+
className: "space-y-3",
|
|
143
|
+
children: D.slice(0, 3).map((e) => /* @__PURE__ */ b("li", { children: /* @__PURE__ */ x("button", {
|
|
144
|
+
type: "button",
|
|
145
|
+
className: S,
|
|
146
|
+
onClick: () => M("/inbox"),
|
|
147
|
+
children: [/* @__PURE__ */ x("span", {
|
|
148
|
+
className: "min-w-0 flex-1",
|
|
149
|
+
children: [/* @__PURE__ */ b("span", {
|
|
150
|
+
className: "block truncate font-semibold text-text-primary",
|
|
151
|
+
children: e.subject || N("dashboard.needsAttention.noSubject", "(no subject)")
|
|
152
|
+
}), e.preview && /* @__PURE__ */ b("span", {
|
|
153
|
+
className: "block truncate text-sm text-text-secondary",
|
|
154
|
+
children: e.preview
|
|
155
|
+
})]
|
|
156
|
+
}), /* @__PURE__ */ b(r, {
|
|
157
|
+
status: e.category,
|
|
158
|
+
className: "shrink-0"
|
|
159
|
+
})]
|
|
160
|
+
}) }, e.id))
|
|
161
|
+
})
|
|
162
|
+
}),
|
|
163
|
+
O.length > 0 && /* @__PURE__ */ b(c, {
|
|
164
|
+
title: N("mobile.dashboard.recommendations", "AI recommendations"),
|
|
165
|
+
action: /* @__PURE__ */ x("button", {
|
|
166
|
+
type: "button",
|
|
167
|
+
className: C,
|
|
168
|
+
onClick: () => M("/decisions"),
|
|
169
|
+
children: [
|
|
170
|
+
N("common.viewAll", "View all"),
|
|
171
|
+
" ",
|
|
172
|
+
/* @__PURE__ */ b(m, { className: "h-4 w-4" })
|
|
173
|
+
]
|
|
174
|
+
}),
|
|
175
|
+
children: /* @__PURE__ */ b("ul", {
|
|
176
|
+
className: "space-y-3",
|
|
177
|
+
"data-testid": "sb-mobile-decisions",
|
|
178
|
+
children: O.slice(0, 3).map((e) => {
|
|
179
|
+
let n = u[e.recommendation];
|
|
180
|
+
return /* @__PURE__ */ b("li", { children: /* @__PURE__ */ x("button", {
|
|
181
|
+
type: "button",
|
|
182
|
+
className: S,
|
|
183
|
+
onClick: () => M(`/decisions/${e.id}`),
|
|
184
|
+
children: [
|
|
185
|
+
/* @__PURE__ */ b("span", {
|
|
186
|
+
className: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-bg-sunken text-text-secondary",
|
|
187
|
+
children: /* @__PURE__ */ b(g, { className: "h-5 w-5" })
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ x("span", {
|
|
190
|
+
className: "min-w-0 flex-1",
|
|
191
|
+
children: [/* @__PURE__ */ b("span", {
|
|
192
|
+
className: "block truncate font-semibold text-text-primary",
|
|
193
|
+
children: n ? N(n.key, n.fallback) : e.recommendation
|
|
194
|
+
}), /* @__PURE__ */ b("span", {
|
|
195
|
+
className: "block truncate text-sm text-text-secondary",
|
|
196
|
+
children: k(e.relationshipId) ?? e.rationale
|
|
197
|
+
})]
|
|
198
|
+
}),
|
|
199
|
+
e.estimatedSavings > 0 && /* @__PURE__ */ b("span", {
|
|
200
|
+
className: "shrink-0 text-sm font-semibold tabular-nums text-status-success-text",
|
|
201
|
+
children: N("mobile.dashboard.savesPerYear", "Save {{amount}}/yr", { amount: t(e.estimatedSavings, e.currency, { maximumFractionDigits: 0 }) })
|
|
202
|
+
})
|
|
203
|
+
]
|
|
204
|
+
}) }, e.id);
|
|
205
|
+
})
|
|
206
|
+
})
|
|
207
|
+
}),
|
|
208
|
+
A > 0 && /* @__PURE__ */ x("button", {
|
|
209
|
+
type: "button",
|
|
210
|
+
onClick: () => M("/invoices"),
|
|
211
|
+
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-left",
|
|
212
|
+
children: [/* @__PURE__ */ x("span", {
|
|
213
|
+
className: "flex items-center gap-3",
|
|
214
|
+
children: [/* @__PURE__ */ b(d, { className: "h-5 w-5 shrink-0 text-status-warning-text" }), /* @__PURE__ */ b("span", {
|
|
215
|
+
className: "text-sm font-medium text-status-warning-text",
|
|
216
|
+
children: N("dashboard.openInvoices.label", "{{count}} open invoice · {{amount}} outstanding", {
|
|
217
|
+
count: A,
|
|
218
|
+
amount: t(j, T.currency)
|
|
219
|
+
})
|
|
220
|
+
})]
|
|
221
|
+
}), /* @__PURE__ */ b(f, { className: "h-4 w-4 shrink-0 text-status-warning-text" })]
|
|
222
|
+
}),
|
|
223
|
+
/* @__PURE__ */ b(c, {
|
|
224
|
+
title: N("dashboard.quickActions.title", "Quick actions"),
|
|
225
|
+
children: /* @__PURE__ */ b("div", {
|
|
226
|
+
className: "grid grid-cols-2 gap-3",
|
|
227
|
+
children: P.map((e) => /* @__PURE__ */ x("button", {
|
|
228
|
+
type: "button",
|
|
229
|
+
onClick: () => M(e.path),
|
|
230
|
+
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-left active:bg-bg-sunken",
|
|
231
|
+
children: [/* @__PURE__ */ b("span", {
|
|
232
|
+
className: "flex size-9 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
|
|
233
|
+
children: e.icon
|
|
234
|
+
}), /* @__PURE__ */ b("span", {
|
|
235
|
+
className: "text-sm font-medium text-text-primary",
|
|
236
|
+
children: e.label
|
|
237
|
+
})]
|
|
238
|
+
}, e.id))
|
|
239
|
+
})
|
|
240
|
+
})
|
|
241
|
+
]
|
|
242
|
+
});
|
|
243
|
+
};
|
|
244
|
+
//#endregion
|
|
245
|
+
export { w as MobileDashboard };
|
|
246
|
+
|
|
247
|
+
//# sourceMappingURL=MobileDashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MobileDashboard.js","names":[],"sources":["../../../../src/subscriberbot/components/mobile/MobileDashboard.tsx"],"sourcesContent":["/**\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';\nimport { formatCurrency, formatIntervalSuffix } from '../../utils/formatters';\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-left 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 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 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>\n <p className=\"text-sm opacity-80\">\n {tr('mobile.dashboard.totalSpend', 'Total recurring spend')}\n </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 opacity-80\">\n {tr('mobile.dashboard.perMonth', '/month')}\n </span>\n </p>\n <p className=\"mt-1 text-xs opacity-80\">\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 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=\"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=\"h-4 w-4 shrink-0 text-text-secondary\" />\n </button>\n </li>\n );\n })}\n </ul>\n )}\n </MobileSection>\n\n <MobileSection\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=\"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=\"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-left\"\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=\"h-4 w-4 shrink-0 text-status-warning-text\" />\n </button>\n )}\n\n <MobileSection title={tr('dashboard.quickActions.title', 'Quick actions')}>\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-left 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":";;;;;;;;;;;AAmDA,IAAM,IACJ,sJAEI,IAAU,uEAEH,KAA6C,EACxD,iBACA,UACA,aACA,mBACA,cACA,sBACA,qBACA,qBACA,oBACI;CACJ,IAAM,IAAK,EAAM,GAEX,IAAoF;EACxF;GACE,IAAI;GACJ,OAAO,EAAG,8BAA8B,kBAAkB;GAC1D,MAAM,k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EASF,CACT;IACE,CAAA;GACQ,CAAA;EACH;;AAElB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SubRelationship } from '../../types';
|
|
3
|
+
|
|
4
|
+
interface MobileRelationshipListProps {
|
|
5
|
+
items: SubRelationship[];
|
|
6
|
+
navigateTo: (relativePath: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const MobileRelationshipList: FC<MobileRelationshipListProps>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=MobileRelationshipList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MobileRelationshipList.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/components/mobile/MobileRelationshipList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAGL,KAAK,EAAE,EAGR,MAAM,OAAO,CAAC;AAkCf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAqCnD,UAAU,2BAA2B;IACnC,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,UAAU,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CA4IlE,CAAC"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import { formatCurrency as t, formatIntervalSuffix as n } from "../../utils/formatters.js";
|
|
3
|
+
import { StatusBadge as r } from "../StatusBadge.js";
|
|
4
|
+
import { useTr as i } from "../../hooks/useTr.js";
|
|
5
|
+
import { useCancelRelationship as a, useTransitionRelationship as o } from "../../hooks/useSubscriberBotApi.js";
|
|
6
|
+
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";
|
|
7
|
+
import { RelationshipGlyph as m } from "./RelationshipGlyph.js";
|
|
8
|
+
import { useRef as h, useState as g } from "react";
|
|
9
|
+
import { Ban as _, ChevronRight as v, MoreHorizontal as y, Pause as b, Play as x } from "lucide-react";
|
|
10
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
11
|
+
import { AlertDialog as T, AlertDialogAction as E, AlertDialogCancel as D, AlertDialogContent as O, AlertDialogDescription as k, AlertDialogFooter as A, AlertDialogHeader as j, AlertDialogTitle as M, BottomSheet as N, BottomSheetContent as P, BottomSheetDescription as F, BottomSheetHeader as I, BottomSheetTitle as L } from "@burdenoff/fe-libs/ui";
|
|
12
|
+
//#region src/subscriberbot/components/mobile/MobileRelationshipList.tsx
|
|
13
|
+
var R = 84, z = 8, B = {
|
|
14
|
+
activate: {
|
|
15
|
+
key: "relationships.detail.actions.activate",
|
|
16
|
+
fallback: "Activate",
|
|
17
|
+
icon: x,
|
|
18
|
+
tone: "bg-status-success-bg-subtle text-status-success-text"
|
|
19
|
+
},
|
|
20
|
+
resume: {
|
|
21
|
+
key: "mobile.relationships.resume",
|
|
22
|
+
fallback: "Resume",
|
|
23
|
+
icon: x,
|
|
24
|
+
tone: "bg-status-success-bg-subtle text-status-success-text"
|
|
25
|
+
},
|
|
26
|
+
pause: {
|
|
27
|
+
key: "relationships.detail.actions.pause",
|
|
28
|
+
fallback: "Pause",
|
|
29
|
+
icon: b,
|
|
30
|
+
tone: "bg-status-warning-bg-subtle text-status-warning-text"
|
|
31
|
+
},
|
|
32
|
+
cancel: {
|
|
33
|
+
key: "relationships.detail.actions.cancel",
|
|
34
|
+
fallback: "Cancel",
|
|
35
|
+
icon: _,
|
|
36
|
+
tone: "bg-status-error-bg-subtle text-status-error-text"
|
|
37
|
+
}
|
|
38
|
+
}, V = ({ items: r, navigateTo: s }) => {
|
|
39
|
+
let c = i(), u = o(), d = a(), [f, p] = g(null), [m, h] = g(null), [_, y] = g(null), [b, x] = g(null), R = u.isPending || d.isPending, z = (e) => x(e instanceof Error ? e.message : c("mobile.relationships.actionFailed", "That action could not be completed.")), V = (e, t) => {
|
|
40
|
+
if (p(null), h(null), x(null), t.destructive) {
|
|
41
|
+
y(e);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
u.mutate({
|
|
45
|
+
id: e.id,
|
|
46
|
+
status: t.target
|
|
47
|
+
}, { onError: z });
|
|
48
|
+
};
|
|
49
|
+
return /* @__PURE__ */ w(S, { children: [
|
|
50
|
+
b && /* @__PURE__ */ C("div", {
|
|
51
|
+
role: "alert",
|
|
52
|
+
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",
|
|
53
|
+
children: b
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ C("ul", {
|
|
56
|
+
className: "mt-4 space-y-3",
|
|
57
|
+
"data-testid": "sb-mobile-relationship-list",
|
|
58
|
+
children: r.map((e) => /* @__PURE__ */ C(H, {
|
|
59
|
+
relationship: e,
|
|
60
|
+
open: f === e.id,
|
|
61
|
+
busy: R,
|
|
62
|
+
onOpenChange: (t) => p(t ? e.id : null),
|
|
63
|
+
onSelect: () => s(`/relationships/${e.id}`),
|
|
64
|
+
onMore: () => {
|
|
65
|
+
p(null), h(e);
|
|
66
|
+
},
|
|
67
|
+
onAction: (t) => V(e, t)
|
|
68
|
+
}, e.id))
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ C(N, {
|
|
71
|
+
open: m != null,
|
|
72
|
+
onOpenChange: (e) => !e && h(null),
|
|
73
|
+
children: /* @__PURE__ */ C(P, {
|
|
74
|
+
"data-testid": "sb-mobile-relationship-actions",
|
|
75
|
+
children: m && /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ w(I, { children: [/* @__PURE__ */ C(L, { children: m.label }), /* @__PURE__ */ w(F, { children: [t(m.amount, m.currency), n(m.interval)] })] }), /* @__PURE__ */ w("div", {
|
|
76
|
+
className: "flex flex-col gap-2 py-2",
|
|
77
|
+
children: [/* @__PURE__ */ w("button", {
|
|
78
|
+
type: "button",
|
|
79
|
+
className: "flex min-h-12 items-center justify-between rounded-xl bg-bg-surface px-4 text-left text-sm font-medium text-text-primary active:bg-bg-sunken",
|
|
80
|
+
onClick: () => {
|
|
81
|
+
let e = m.id;
|
|
82
|
+
h(null), s(`/relationships/${e}`);
|
|
83
|
+
},
|
|
84
|
+
children: [c("mobile.relationships.viewDetails", "View details"), /* @__PURE__ */ C(v, { className: "h-4 w-4 text-text-secondary" })]
|
|
85
|
+
}), l(m.status).map((t) => {
|
|
86
|
+
let n = B[t.id], r = n.icon;
|
|
87
|
+
return /* @__PURE__ */ w("button", {
|
|
88
|
+
type: "button",
|
|
89
|
+
disabled: R,
|
|
90
|
+
className: e("flex min-h-12 items-center gap-3 rounded-xl px-4 text-left text-sm font-medium disabled:opacity-50", n.tone),
|
|
91
|
+
onClick: () => V(m, t),
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ C(r, { className: "h-4 w-4" }),
|
|
94
|
+
" ",
|
|
95
|
+
c(n.key, n.fallback)
|
|
96
|
+
]
|
|
97
|
+
}, t.id);
|
|
98
|
+
})]
|
|
99
|
+
})] })
|
|
100
|
+
})
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ C(T, {
|
|
103
|
+
open: _ != null,
|
|
104
|
+
onOpenChange: (e) => !e && y(null),
|
|
105
|
+
children: /* @__PURE__ */ w(O, { children: [/* @__PURE__ */ w(j, { children: [/* @__PURE__ */ C(M, { children: c("mobile.relationships.cancelTitle", "Cancel {{label}}?", { label: _?.label ?? "" }) }), /* @__PURE__ */ C(k, { children: c("mobile.relationships.cancelDescription", "This marks the relationship as cancelled in Subscriber Bot. A cancelled relationship cannot be reactivated.") })] }), /* @__PURE__ */ w(A, { children: [/* @__PURE__ */ C(D, { children: c("mobile.relationships.keep", "Keep it") }), /* @__PURE__ */ C(E, {
|
|
106
|
+
onClick: () => {
|
|
107
|
+
if (!_) return;
|
|
108
|
+
let e = _.id;
|
|
109
|
+
y(null), d.mutate(e, { onError: z });
|
|
110
|
+
},
|
|
111
|
+
children: c("mobile.relationships.confirmCancel", "Cancel relationship")
|
|
112
|
+
})] })] })
|
|
113
|
+
})
|
|
114
|
+
] });
|
|
115
|
+
}, H = ({ relationship: a, open: o, busy: _, onOpenChange: v, onSelect: b, onMore: x, onAction: S }) => {
|
|
116
|
+
let T = i(), E = l(a.status), D = E.length * R, [O, k] = g(null), A = h(null), j = h(0), M = O ?? (o ? -D : 0), N = s(a.renewsAt), P = N != null && (a.status === "ACTIVE" || a.status === "TRIAL") ? u(N) : null, F = (e) => {
|
|
117
|
+
D === 0 || e.pointerType === "mouse" || (A.current = {
|
|
118
|
+
x: e.clientX,
|
|
119
|
+
y: e.clientY,
|
|
120
|
+
swiping: !1,
|
|
121
|
+
moved: !1
|
|
122
|
+
});
|
|
123
|
+
}, I = (e) => {
|
|
124
|
+
let t = A.current;
|
|
125
|
+
if (!t) return;
|
|
126
|
+
let n = e.clientX - t.x, r = e.clientY - t.y;
|
|
127
|
+
if (!t.swiping) {
|
|
128
|
+
if (Math.abs(r) > z && Math.abs(r) > Math.abs(n)) {
|
|
129
|
+
A.current = null;
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (Math.abs(n) < z) return;
|
|
133
|
+
t.swiping = !0, e.currentTarget.setPointerCapture(e.pointerId);
|
|
134
|
+
}
|
|
135
|
+
t.moved = !0, k(f(n, o, D));
|
|
136
|
+
}, L = () => {
|
|
137
|
+
let e = A.current;
|
|
138
|
+
A.current = null, e?.swiping && O != null && v(p(O, D)), k(null), e?.moved && (j.current = d(Date.now()));
|
|
139
|
+
};
|
|
140
|
+
return /* @__PURE__ */ w("li", {
|
|
141
|
+
className: "relative overflow-hidden rounded-2xl border border-border-subtle bg-bg-sunken",
|
|
142
|
+
"data-testid": "sb-mobile-relationship-row",
|
|
143
|
+
"data-relationship-id": a.id,
|
|
144
|
+
children: [E.length > 0 && /* @__PURE__ */ C("div", {
|
|
145
|
+
className: "absolute inset-y-0 right-0 flex",
|
|
146
|
+
style: { width: D },
|
|
147
|
+
"aria-hidden": !o,
|
|
148
|
+
children: E.map((t) => {
|
|
149
|
+
let n = B[t.id], r = n.icon;
|
|
150
|
+
return /* @__PURE__ */ w("button", {
|
|
151
|
+
type: "button",
|
|
152
|
+
tabIndex: o ? 0 : -1,
|
|
153
|
+
disabled: _,
|
|
154
|
+
onClick: () => S(t),
|
|
155
|
+
className: e("flex h-full flex-col items-center justify-center gap-1 text-xs font-medium disabled:opacity-50", n.tone),
|
|
156
|
+
style: { width: R },
|
|
157
|
+
children: [/* @__PURE__ */ C(r, { className: "h-5 w-5" }), T(n.key, n.fallback)]
|
|
158
|
+
}, t.id);
|
|
159
|
+
})
|
|
160
|
+
}), /* @__PURE__ */ w("div", {
|
|
161
|
+
className: e("relative flex touch-pan-y items-center gap-3 bg-bg-surface p-4", O == null && "transition-transform duration-200 ease-out"),
|
|
162
|
+
style: { transform: `translateX(${M}px)` },
|
|
163
|
+
onPointerDown: F,
|
|
164
|
+
onPointerMove: I,
|
|
165
|
+
onPointerUp: L,
|
|
166
|
+
onPointerCancel: L,
|
|
167
|
+
onClickCapture: (e) => {
|
|
168
|
+
c(Date.now(), j.current) && (j.current = 0, e.preventDefault(), e.stopPropagation());
|
|
169
|
+
},
|
|
170
|
+
children: [/* @__PURE__ */ w("button", {
|
|
171
|
+
type: "button",
|
|
172
|
+
onClick: () => {
|
|
173
|
+
if (o) {
|
|
174
|
+
v(!1);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
b();
|
|
178
|
+
},
|
|
179
|
+
className: "flex min-w-0 flex-1 items-center gap-3 text-left",
|
|
180
|
+
children: [/* @__PURE__ */ C(m, { kind: a.kind }), /* @__PURE__ */ w("span", {
|
|
181
|
+
className: "min-w-0 flex-1",
|
|
182
|
+
children: [
|
|
183
|
+
/* @__PURE__ */ C("span", {
|
|
184
|
+
className: "block truncate font-semibold text-text-primary",
|
|
185
|
+
children: a.label
|
|
186
|
+
}),
|
|
187
|
+
/* @__PURE__ */ w("span", {
|
|
188
|
+
className: "block text-base tabular-nums text-text-primary",
|
|
189
|
+
children: [t(a.amount, a.currency), /* @__PURE__ */ C("span", {
|
|
190
|
+
className: "text-sm text-text-secondary",
|
|
191
|
+
children: n(a.interval)
|
|
192
|
+
})]
|
|
193
|
+
}),
|
|
194
|
+
/* @__PURE__ */ w("span", {
|
|
195
|
+
className: "mt-0.5 flex items-center gap-2",
|
|
196
|
+
children: [/* @__PURE__ */ C(r, { status: a.status }), P && /* @__PURE__ */ C("span", {
|
|
197
|
+
className: e("truncate text-xs", P.tone === "later" ? "text-text-secondary" : "text-status-warning-text"),
|
|
198
|
+
children: T(P.key, P.fallback, P.params)
|
|
199
|
+
})]
|
|
200
|
+
})
|
|
201
|
+
]
|
|
202
|
+
})]
|
|
203
|
+
}), /* @__PURE__ */ C("button", {
|
|
204
|
+
type: "button",
|
|
205
|
+
onClick: x,
|
|
206
|
+
"aria-label": T("mobile.relationships.moreActions", "More actions for {{label}}", { label: a.label }),
|
|
207
|
+
className: "flex size-11 shrink-0 items-center justify-center rounded-full text-text-secondary active:bg-bg-sunken",
|
|
208
|
+
"data-testid": "sb-mobile-relationship-more",
|
|
209
|
+
children: /* @__PURE__ */ C(y, { className: "h-5 w-5" })
|
|
210
|
+
})]
|
|
211
|
+
})]
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
//#endregion
|
|
215
|
+
export { V as MobileRelationshipList };
|
|
216
|
+
|
|
217
|
+
//# sourceMappingURL=MobileRelationshipList.js.map
|