@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MobileRelationshipList.js","names":[],"sources":["../../../../src/subscriberbot/components/mobile/MobileRelationshipList.tsx"],"sourcesContent":["/**\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';\nimport { formatCurrency, formatIntervalSuffix } from '../../utils/formatters';\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 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-left 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=\"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-left 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 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-left\"\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":";;;;;;;;;;;;AAuDA,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,IAAK,EAAM,GACX,IAAa,EAA0B,GACvC,IAAS,EAAsB,GAC/B,CAAC,GAAW,KAAgB,EAAwB,IAAI,GACxD,CAAC,GAAU,KAAe,EAAiC,IAAI,GAC/D,CAAC,GAAe,KAAoB,EAAiC,IAAI,GACzE,CAAC,GAAO,KAAY,EAAwB,IAAI,GAChD,IAAO,EAAW,aAAa,EAAO,WAEtC,KA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AE,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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface MobileScreenProps {
|
|
4
|
+
title: string;
|
|
5
|
+
/** Small line above the title (e.g. the greeting). */
|
|
6
|
+
eyebrow?: ReactNode;
|
|
7
|
+
/** Optional hero content under the title (e.g. the recurring-spend figure). */
|
|
8
|
+
hero?: ReactNode;
|
|
9
|
+
/** Optional trailing control in the hero (e.g. an add button). */
|
|
10
|
+
action?: ReactNode;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Stable hook for Playwright and the assistant page context. */
|
|
14
|
+
testId?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const MobileScreen: FC<MobileScreenProps>;
|
|
17
|
+
interface MobileSectionProps {
|
|
18
|
+
title: string;
|
|
19
|
+
action?: ReactNode;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/** A titled group on the mobile sheet ("Upcoming renewals", "Needs action"). */
|
|
24
|
+
export declare const MobileSection: FC<MobileSectionProps>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=MobileScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MobileScreen.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/components/mobile/MobileScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG3C,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,kEAAkE;IAClE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAsB9C,CAAC;AAEF,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,gFAAgF;AAChF,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAQhD,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/subscriberbot/components/mobile/MobileScreen.tsx
|
|
4
|
+
var r = ({ title: r, eyebrow: i, hero: a, action: o, children: s, className: c, testId: l }) => /* @__PURE__ */ n("div", {
|
|
5
|
+
className: e("flex min-h-full flex-col", c),
|
|
6
|
+
"data-testid": l,
|
|
7
|
+
children: [/* @__PURE__ */ n("header", {
|
|
8
|
+
className: "bg-action-primary-bg px-4 pb-10 pt-5 text-action-primary-text",
|
|
9
|
+
children: [/* @__PURE__ */ n("div", {
|
|
10
|
+
className: "flex items-start justify-between gap-3",
|
|
11
|
+
children: [/* @__PURE__ */ n("div", {
|
|
12
|
+
className: "min-w-0",
|
|
13
|
+
children: [i ? /* @__PURE__ */ t("p", {
|
|
14
|
+
className: "text-sm opacity-80",
|
|
15
|
+
children: i
|
|
16
|
+
}) : null, /* @__PURE__ */ t("h1", {
|
|
17
|
+
className: "text-2xl font-bold tracking-tight",
|
|
18
|
+
children: r
|
|
19
|
+
})]
|
|
20
|
+
}), o ? /* @__PURE__ */ t("div", {
|
|
21
|
+
className: "shrink-0",
|
|
22
|
+
children: o
|
|
23
|
+
}) : null]
|
|
24
|
+
}), a ? /* @__PURE__ */ t("div", {
|
|
25
|
+
className: "mt-4",
|
|
26
|
+
children: a
|
|
27
|
+
}) : null]
|
|
28
|
+
}), /* @__PURE__ */ t("div", {
|
|
29
|
+
className: "-mt-6 flex-1 rounded-t-3xl bg-bg-canvas px-4 pb-6 pt-5",
|
|
30
|
+
children: s
|
|
31
|
+
})]
|
|
32
|
+
}), i = ({ title: r, action: i, children: a, className: o }) => /* @__PURE__ */ n("section", {
|
|
33
|
+
className: e("mt-6 first:mt-0", o),
|
|
34
|
+
"aria-label": r,
|
|
35
|
+
children: [/* @__PURE__ */ n("div", {
|
|
36
|
+
className: "mb-3 flex items-center justify-between gap-3",
|
|
37
|
+
children: [/* @__PURE__ */ t("h2", {
|
|
38
|
+
className: "text-lg font-semibold text-text-primary",
|
|
39
|
+
children: r
|
|
40
|
+
}), i]
|
|
41
|
+
}), a]
|
|
42
|
+
});
|
|
43
|
+
//#endregion
|
|
44
|
+
export { r as MobileScreen, i as MobileSection };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=MobileScreen.js.map
|
|
@@ -0,0 +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}\n\nexport const MobileScreen: FC<MobileScreenProps> = ({\n title,\n eyebrow,\n hero,\n action,\n children,\n className,\n testId,\n}) => (\n <div className={cn('flex min-h-full flex-col', className)} data-testid={testId}>\n <header className=\"bg-action-primary-bg px-4 pb-10 pt-5 text-action-primary-text\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n {eyebrow ? <p className=\"text-sm opacity-80\">{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}\n\n/** A titled group on the mobile sheet (\"Upcoming renewals\", \"Needs action\"). */\nexport const MobileSection: FC<MobileSectionProps> = ({ title, action, children, className }) => (\n <section className={cn('mt-6 first:mt-0', className)} aria-label={title}>\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":";;;AA8BA,IAAa,KAAuC,EAClD,UACA,YACA,SACA,WACA,aACA,cACA,gBAEA,kBAAC,OAAD;CAAK,WAAW,EAAG,4BAA4B,CAAS;CAAG,eAAa;WAAxE,CACE,kBAAC,UAAD;EAAQ,WAAU;YAAlB,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACG,IAAU,kBAAC,KAAD;KAAG,WAAU;eAAsB;IAAW,CAAA,IAAI,MAC7D,kBAAC,MAAD;KAAI,WAAU;eAAqC;IAAU,CAAA,CAC1D;OACJ,IAAS,kBAAC,OAAD;IAAK,WAAU;cAAY;GAAY,CAAA,IAAI,IAClD;MACJ,IAAO,kBAAC,OAAD;GAAK,WAAU;aAAQ;EAAU,CAAA,IAAI,IACvC;KACR,kBAAC,OAAD;EAAK,WAAU;EAA0D;CAAc,CAAA,CACpF;IAWM,KAAyC,EAAE,UAAO,WAAQ,aAAU,mBAC/E,kBAAC,WAAD;CAAS,WAAW,EAAG,mBAAmB,CAAS;CAAG,cAAY;WAAlE,CACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,MAAD;GAAI,WAAU;aAA2C;EAAU,CAAA,GAClE,CACE;KACJ,CACM"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SubRelationshipKind } from '../../types';
|
|
3
|
+
|
|
4
|
+
interface RelationshipGlyphProps {
|
|
5
|
+
kind: SubRelationshipKind | null;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const RelationshipGlyph: FC<RelationshipGlyphProps>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=RelationshipGlyph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RelationshipGlyph.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/components/mobile/RelationshipGlyph.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAYhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAcvD,UAAU,sBAAsB;IAC9B,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAaxD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
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
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
4
|
+
//#region src/subscriberbot/components/mobile/RelationshipGlyph.tsx
|
|
5
|
+
var u = {
|
|
6
|
+
SUBSCRIPTION: c,
|
|
7
|
+
MEMBERSHIP: t,
|
|
8
|
+
LICENSE: o,
|
|
9
|
+
CONTRACT: r,
|
|
10
|
+
NEWSLETTER: s,
|
|
11
|
+
RECURRING_PAYMENT: n,
|
|
12
|
+
ENROLLMENT: i,
|
|
13
|
+
TRIAL: a
|
|
14
|
+
}, d = ({ kind: t, className: n }) => {
|
|
15
|
+
let r = t && u[t] || c;
|
|
16
|
+
return /* @__PURE__ */ l("span", {
|
|
17
|
+
"aria-hidden": "true",
|
|
18
|
+
className: e("flex size-12 shrink-0 items-center justify-center rounded-xl bg-bg-sunken text-text-secondary", n),
|
|
19
|
+
children: /* @__PURE__ */ l(r, { className: "h-6 w-6" })
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { d as RelationshipGlyph };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=RelationshipGlyph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RelationshipGlyph.js","names":[],"sources":["../../../../src/subscriberbot/components/mobile/RelationshipGlyph.tsx"],"sourcesContent":["/**\n * Relationship glyph — the square icon tile on mobile renewal and list cards.\n * @module subscriberbot/components/mobile\n */\n\nimport type { FC } from 'react';\nimport {\n BadgeCheck,\n CreditCard,\n FileSignature,\n GraduationCap,\n Hourglass,\n KeyRound,\n Newspaper,\n Repeat2,\n type LucideIcon,\n} from 'lucide-react';\nimport type { SubRelationshipKind } from '../../types';\nimport { cn } from '../../utils/cn';\n\nconst KIND_ICON: Record<SubRelationshipKind, LucideIcon> = {\n SUBSCRIPTION: Repeat2,\n MEMBERSHIP: BadgeCheck,\n LICENSE: KeyRound,\n CONTRACT: FileSignature,\n NEWSLETTER: Newspaper,\n RECURRING_PAYMENT: CreditCard,\n ENROLLMENT: GraduationCap,\n TRIAL: Hourglass,\n};\n\ninterface RelationshipGlyphProps {\n kind: SubRelationshipKind | null;\n className?: string;\n}\n\nexport const RelationshipGlyph: FC<RelationshipGlyphProps> = ({ kind, className }) => {\n const Icon = (kind && KIND_ICON[kind]) || Repeat2;\n return (\n <span\n aria-hidden=\"true\"\n className={cn(\n 'flex size-12 shrink-0 items-center justify-center rounded-xl bg-bg-sunken text-text-secondary',\n className\n )}\n >\n <Icon className=\"h-6 w-6\" />\n </span>\n );\n};\n"],"mappings":";;;;AAoBA,IAAM,IAAqD;CACzD,cAAc;CACd,YAAY;CACZ,SAAS;CACT,UAAU;CACV,YAAY;CACZ,mBAAmB;CACnB,YAAY;CACZ,OAAO;AACT,GAOa,KAAiD,EAAE,SAAM,mBAAgB;CACpF,IAAM,IAAQ,KAAQ,EAAU,MAAU;CAC1C,OACE,kBAAC,QAAD;EACE,eAAY;EACZ,WAAW,EACT,iGACA,CACF;YAEA,kBAAC,GAAD,EAAM,WAAU,UAAW,CAAA;CACvB,CAAA;AAEV"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mobile (phone-width) screens and building blocks
|
|
3
|
+
* @module subscriberbot/components/mobile
|
|
4
|
+
*/
|
|
5
|
+
export { MobileScreen, MobileSection } from './MobileScreen';
|
|
6
|
+
export { MobileDashboard, type MobileDashboardProps } from './MobileDashboard';
|
|
7
|
+
export { MobileRelationshipList } from './MobileRelationshipList';
|
|
8
|
+
export { RelationshipGlyph } from './RelationshipGlyph';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/components/mobile/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @module subscriberbot/hooks
|
|
4
4
|
*/
|
|
5
5
|
export { useTr } from './useTr';
|
|
6
|
+
export { useCompactViewport, COMPACT_VIEWPORT_QUERY } from './useCompactViewport';
|
|
6
7
|
export { useRouteSelection } from './useRouteSelection';
|
|
7
8
|
export type { SelectableSection } from './useRouteSelection';
|
|
8
9
|
export { useAutonomousAgentMode, isPostureSelectable, AUTONOMOUS_AGENT_FLAG, } from './useAutonomousAgentMode';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/subscriberbot/hooks/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEL,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,aAAa,EACb,kBAAkB,EAElB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,QAAQ,EACR,aAAa,EACb,sBAAsB,EAEtB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAEhB,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAEhB,qBAAqB,EACrB,0BAA0B,EAC1B,0BAA0B,EAC1B,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAEhB,SAAS,EACT,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,eAAe,EAEf,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAElB,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EAEnB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAElB,2BAA2B,EAC3B,eAAe,EACf,iBAAiB,EAEjB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/subscriberbot/hooks/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,iBA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akpoint (768px) — phones, and the installed app
|
|
3
|
+
* on a phone. The shell's bottom tab bar uses the same breakpoint, so a
|
|
4
|
+
* screen that branches on this hook switches layout exactly when the shell
|
|
5
|
+
* swaps its chrome.
|
|
6
|
+
*/
|
|
7
|
+
export declare const COMPACT_VIEWPORT_QUERY = "(max-width: 767.98px)";
|
|
8
|
+
/**
|
|
9
|
+
* useCompactViewport — true when the viewport is phone-width, live-updating
|
|
10
|
+
* on rotation and window resizes.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useCompactViewport(): boolean;
|
|
13
|
+
//# sourceMappingURL=useCompactViewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCompactViewport.d.ts","sourceRoot":"","sources":["../../../src/subscriberbot/hooks/useCompactViewport.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAqB9D;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useSyncExternalStore as e } from "react";
|
|
2
|
+
//#region src/subscriberbot/hooks/useCompactViewport.ts
|
|
3
|
+
var t = "(max-width: 767.98px)";
|
|
4
|
+
function n(e) {
|
|
5
|
+
if (typeof window > "u" || typeof window.matchMedia != "function") return () => void 0;
|
|
6
|
+
let n = window.matchMedia(t);
|
|
7
|
+
return n.addEventListener("change", e), () => n.removeEventListener("change", e);
|
|
8
|
+
}
|
|
9
|
+
function r() {
|
|
10
|
+
return typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia(t).matches;
|
|
11
|
+
}
|
|
12
|
+
function i() {
|
|
13
|
+
return !1;
|
|
14
|
+
}
|
|
15
|
+
function a() {
|
|
16
|
+
return e(n, r, i);
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { t as COMPACT_VIEWPORT_QUERY, a as useCompactViewport };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=useCompactViewport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCompactViewport.js","names":[],"sources":["../../../src/subscriberbot/hooks/useCompactViewport.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react';\n\n/**\n * Below Tailwind's `md` breakpoint (768px) — phones, and the installed app\n * on a phone. The shell's bottom tab bar uses the same breakpoint, so a\n * screen that branches on this hook switches layout exactly when the shell\n * swaps its chrome.\n */\nexport const COMPACT_VIEWPORT_QUERY = '(max-width: 767.98px)';\n\nfunction subscribe(onChange: () => void): () => void {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {\n return () => undefined;\n }\n const mql = window.matchMedia(COMPACT_VIEWPORT_QUERY);\n mql.addEventListener('change', onChange);\n return () => mql.removeEventListener('change', onChange);\n}\n\nfunction getSnapshot(): boolean {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return false;\n return window.matchMedia(COMPACT_VIEWPORT_QUERY).matches;\n}\n\n/** SSR and environments without matchMedia render the desktop layout. */\nfunction getServerSnapshot(): boolean {\n return false;\n}\n\n/**\n * useCompactViewport — true when the viewport is phone-width, live-updating\n * on rotation and window resizes.\n */\nexport function useCompactViewport(): boolean {\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n"],"mappings":";;AAQA,IAAa,IAAyB;AAEtC,SAAS,EAAU,GAAkC;CACnD,IAAI,OAAO,SAAW,OAAe,OAAO,OAAO,cAAe,YAChE,aAAa,KAAA;CAEf,IAAM,IAAM,OAAO,WAAW,CAAsB;CAEpD,OADA,EAAI,iBAAiB,UAAU,CAAQ,SAC1B,EAAI,oBAAoB,UAAU,CAAQ;AACzD;AAEA,SAAS,IAAuB;CAE9B,OADI,OAAO,SAAW,OAAe,OAAO,OAAO,cAAe,aAAmB,KAC9E,OAAO,WAAW,CAAsB,EAAE;AACnD;AAGA,SAAS,IAA6B;CACpC,OAAO;AACT;AAMA,SAAgB,IAA8B;CAC5C,OAAO,EAAqB,GAAW,GAAa,CAAiB;AACvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardPage.d.ts","sourceRoot":"","sources":["../../../src/subscriberbot/pages/DashboardPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"DashboardPage.d.ts","sourceRoot":"","sources":["../../../src/subscriberbot/pages/DashboardPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA6CH,wBAAgB,aAAa,gCA0b5B"}
|