@burdenoff/microfe-timecampus 2026.1031.11 → 2026.1031.13

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.
Files changed (41) hide show
  1. package/dist/timecampus/TimeCampusRoot.d.ts.map +1 -1
  2. package/dist/timecampus/TimeCampusRoot.js +121 -80
  3. package/dist/timecampus/TimeCampusRoot.js.map +1 -1
  4. package/dist/timecampus/TimeCampusRoutes.d.ts.map +1 -1
  5. package/dist/timecampus/TimeCampusRoutes.js +24 -5
  6. package/dist/timecampus/TimeCampusRoutes.js.map +1 -1
  7. package/dist/timecampus/pages/lifetime/LifeBalancePage.d.ts.map +1 -1
  8. package/dist/timecampus/pages/lifetime/LifeBalancePage.js +34 -31
  9. package/dist/timecampus/pages/lifetime/LifeBalancePage.js.map +1 -1
  10. package/dist/timecampus/pages/mobile/MobileLifeBalancePage.d.ts +8 -0
  11. package/dist/timecampus/pages/mobile/MobileLifeBalancePage.d.ts.map +1 -0
  12. package/dist/timecampus/pages/mobile/MobileLifeBalancePage.js +224 -0
  13. package/dist/timecampus/pages/mobile/MobileLifeBalancePage.js.map +1 -0
  14. package/dist/timecampus/pages/mobile/MobileScreen.d.ts +32 -0
  15. package/dist/timecampus/pages/mobile/MobileScreen.d.ts.map +1 -0
  16. package/dist/timecampus/pages/mobile/MobileScreen.js +89 -0
  17. package/dist/timecampus/pages/mobile/MobileScreen.js.map +1 -0
  18. package/dist/timecampus/pages/mobile/MobileTimelinePage.d.ts +8 -0
  19. package/dist/timecampus/pages/mobile/MobileTimelinePage.d.ts.map +1 -0
  20. package/dist/timecampus/pages/mobile/MobileTimelinePage.js +341 -0
  21. package/dist/timecampus/pages/mobile/MobileTimelinePage.js.map +1 -0
  22. package/dist/timecampus/pages/mobile/MobileTimerPage.d.ts +8 -0
  23. package/dist/timecampus/pages/mobile/MobileTimerPage.d.ts.map +1 -0
  24. package/dist/timecampus/pages/mobile/MobileTimerPage.js +226 -0
  25. package/dist/timecampus/pages/mobile/MobileTimerPage.js.map +1 -0
  26. package/dist/timecampus/pages/mobile/mobileModel.d.ts +121 -0
  27. package/dist/timecampus/pages/mobile/mobileModel.d.ts.map +1 -0
  28. package/dist/timecampus/pages/mobile/mobileModel.js +129 -0
  29. package/dist/timecampus/pages/mobile/mobileModel.js.map +1 -0
  30. package/dist/timecampus/pages/pomodoro/PomodoroPage.d.ts.map +1 -1
  31. package/dist/timecampus/pages/pomodoro/PomodoroPage.js +46 -44
  32. package/dist/timecampus/pages/pomodoro/PomodoroPage.js.map +1 -1
  33. package/dist/timecampus/pages/time/TimerPage.d.ts.map +1 -1
  34. package/dist/timecampus/pages/time/TimerPage.js +34 -32
  35. package/dist/timecampus/pages/time/TimerPage.js.map +1 -1
  36. package/dist/timecampus/pages/timeline/TimelinePage.d.ts.map +1 -1
  37. package/dist/timecampus/pages/timeline/TimelinePage.js +324 -319
  38. package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
  39. package/dist/timecampus/types/index.d.ts +5 -0
  40. package/dist/timecampus/types/index.d.ts.map +1 -1
  41. package/package.json +1 -1
@@ -0,0 +1,341 @@
1
+ import { useTimeCampus as e, useTimeCampusNavigate as t } from "../../providers/TimeCampusProvider.js";
2
+ import { cn as n, formatTime as r } from "../../utils/helpers.js";
3
+ import { LoadingSkeleton as i } from "../../components/LoadingSkeleton.js";
4
+ import { EmptyState as a } from "../../components/EmptyState.js";
5
+ import { useGetTimeCampusTimelineQuery as o, useListProjectsQuery as ee } from "../../../generated/wspace-operations.js";
6
+ import { useTr as s } from "../../shared/hooks/useTr.js";
7
+ import "../../hooks/index.js";
8
+ import { MobileScreen as c } from "./MobileScreen.js";
9
+ import { compactDuration as l, dayHeading as u, filterSegments as d, focusSummary as te, localDayBounds as ne, longDayLabel as f, parseLocalDateKey as p, shiftDateKey as m, sortByStart as h, toLocalDateKey as g } from "./mobileModel.js";
10
+ import { useEffect as _, useMemo as v, useState as y } from "react";
11
+ import { Activity as b, Brain as x, CalendarClock as S, ChevronLeft as C, ChevronRight as w, Coffee as T, MessageSquare as E, Search as D, Users as O, X as k } from "lucide-react";
12
+ import { useSearchParams as re } from "react-router";
13
+ import { jsx as A, jsxs as j } from "react/jsx-runtime";
14
+ import { GlassCard as ie } from "@burdenoff/fe-libs/ui";
15
+ //#region src/timecampus/pages/mobile/MobileTimelinePage.tsx
16
+ var M = {
17
+ label: "Other",
18
+ icon: b,
19
+ card: "border-border-subtle bg-bg-surface",
20
+ accent: "text-text-secondary"
21
+ }, N = {
22
+ DEEP_WORK: {
23
+ label: "Deep work",
24
+ icon: x,
25
+ card: "border-status-success-text/40 bg-status-success-bg",
26
+ accent: "text-status-success-text"
27
+ },
28
+ MEETING: {
29
+ label: "Meeting",
30
+ icon: O,
31
+ card: "border-status-info-text/40 bg-status-info-bg",
32
+ accent: "text-status-info-text"
33
+ },
34
+ COMMUNICATION: {
35
+ label: "Communication",
36
+ icon: E,
37
+ card: "border-status-warning-text/40 bg-status-warning-bg",
38
+ accent: "text-status-warning-text"
39
+ },
40
+ BREAK: {
41
+ label: "Break",
42
+ icon: T,
43
+ card: "border-border-subtle bg-bg-sunken",
44
+ accent: "text-text-secondary"
45
+ },
46
+ OTHER: M
47
+ }, P = (e) => N[e] ?? M, F = (e) => P(e).label;
48
+ function I(e) {
49
+ return e.title ? e.title : e.app ? e.app : e.isPlanned ? "Planned focus block" : F(e.category);
50
+ }
51
+ function L(e) {
52
+ let t = r(e.startTime);
53
+ return e.endTime ? `${t} – ${r(e.endTime)}` : t;
54
+ }
55
+ function R() {
56
+ let { workspaceId: b = "" } = e(), x = t(), T = s(), [E, O] = re(), k = g(/* @__PURE__ */ new Date()), M = E.get("date"), N = p(M) && M <= k ? M : k, R = (e) => {
57
+ let t = new URLSearchParams(E);
58
+ e === k ? t.delete("date") : t.set("date", e), O(t, { replace: !0 });
59
+ }, [B, V] = y(""), [H, U] = y(null);
60
+ _(() => U(null), [N]);
61
+ let { from: W, to: G } = v(() => ne(N), [N]), { data: K, loading: q, error: J } = o({
62
+ variables: {
63
+ from: W,
64
+ to: G
65
+ },
66
+ skip: !b,
67
+ fetchPolicy: "cache-and-network"
68
+ }), { data: Y } = ee({
69
+ variables: { pagination: { limit: 200 } },
70
+ skip: !b
71
+ }), X = v(() => {
72
+ let e = /* @__PURE__ */ new Map();
73
+ for (let t of Y?.projects?.items ?? []) e.set(t.id, t.name);
74
+ return e;
75
+ }, [Y?.projects?.items]), Z = K?.timeCampusTimeline, Q = te(Z?.summary), $ = v(() => d(h(Z?.segments ?? []), B, X, F), [
76
+ Z?.segments,
77
+ B,
78
+ X
79
+ ]);
80
+ return /* @__PURE__ */ j(c, {
81
+ active: "timeline",
82
+ title: T("timecampus.mobile.timeline.title", "Timeline"),
83
+ fullViewPath: N === k ? "/timeline" : `/timeline?date=${N}`,
84
+ children: [
85
+ /* @__PURE__ */ j("label", {
86
+ className: "relative block",
87
+ children: [
88
+ /* @__PURE__ */ A("span", {
89
+ className: "sr-only",
90
+ children: T("timecampus.mobile.timeline.searchLabel", "Search this day")
91
+ }),
92
+ /* @__PURE__ */ A(D, { className: "pointer-events-none absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-text-secondary" }),
93
+ /* @__PURE__ */ A("input", {
94
+ type: "search",
95
+ value: B,
96
+ onChange: (e) => V(e.target.value),
97
+ placeholder: T("timecampus.mobile.timeline.searchPlaceholder", "Search events, apps, projects…"),
98
+ className: "min-h-12 w-full rounded-2xl border border-border-subtle bg-bg-surface pl-10 pr-3 text-base text-text-primary placeholder:text-text-secondary",
99
+ "data-testid": "mobile-timeline-search"
100
+ })
101
+ ]
102
+ }),
103
+ /* @__PURE__ */ j(ie, {
104
+ treatment: "glass",
105
+ glow: !0,
106
+ className: "p-4",
107
+ "data-testid": "mobile-timeline-summary",
108
+ children: [/* @__PURE__ */ A("p", {
109
+ className: "text-sm font-semibold text-text-primary",
110
+ children: T("timecampus.mobile.timeline.focusSummary", "Focus summary")
111
+ }), /* @__PURE__ */ j("dl", {
112
+ className: "mt-2 grid grid-cols-3 gap-2",
113
+ children: [
114
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("dt", {
115
+ className: "text-xs text-text-secondary",
116
+ children: T("timecampus.mobile.timeline.focusShare", "Focus share")
117
+ }), /* @__PURE__ */ A("dd", {
118
+ className: "text-xl font-bold tabular-nums text-text-primary",
119
+ children: Q.focusPercent === null ? "—" : `${Q.focusPercent}%`
120
+ })] }),
121
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("dt", {
122
+ className: "text-xs text-text-secondary",
123
+ children: T("timecampus.mobile.timeline.deepWork", "Deep work")
124
+ }), /* @__PURE__ */ A("dd", {
125
+ className: "text-xl font-bold tabular-nums text-text-primary",
126
+ children: l(Q.deepWorkSeconds)
127
+ })] }),
128
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("dt", {
129
+ className: "text-xs text-text-secondary",
130
+ children: T("timecampus.mobile.timeline.meetings", "Meetings")
131
+ }), /* @__PURE__ */ A("dd", {
132
+ className: "text-xl font-bold tabular-nums text-text-primary",
133
+ children: l(Q.meetingSeconds)
134
+ })] })
135
+ ]
136
+ })]
137
+ }),
138
+ /* @__PURE__ */ j("div", {
139
+ className: "flex items-center justify-between gap-2",
140
+ children: [
141
+ /* @__PURE__ */ A("button", {
142
+ type: "button",
143
+ onClick: () => R(m(N, -1)),
144
+ className: "inline-flex h-11 w-11 items-center justify-center rounded-full border border-border-subtle text-text-primary",
145
+ "aria-label": T("timecampus.mobile.timeline.previousDay", "Previous day"),
146
+ children: /* @__PURE__ */ A(C, { className: "h-5 w-5" })
147
+ }),
148
+ /* @__PURE__ */ j("div", {
149
+ className: "min-w-0 text-center",
150
+ children: [/* @__PURE__ */ A("h2", {
151
+ className: "truncate text-lg font-bold text-text-primary",
152
+ "data-testid": "mobile-timeline-day",
153
+ children: u(N)
154
+ }), /* @__PURE__ */ A("p", {
155
+ className: "truncate text-xs text-text-secondary",
156
+ children: f(N)
157
+ })]
158
+ }),
159
+ /* @__PURE__ */ A("button", {
160
+ type: "button",
161
+ onClick: () => R(m(N, 1)),
162
+ disabled: N >= k,
163
+ className: "inline-flex h-11 w-11 items-center justify-center rounded-full border border-border-subtle text-text-primary disabled:opacity-40",
164
+ "aria-label": T("timecampus.mobile.timeline.nextDay", "Next day"),
165
+ children: /* @__PURE__ */ A(w, { className: "h-5 w-5" })
166
+ })
167
+ ]
168
+ }),
169
+ J ? /* @__PURE__ */ A("p", {
170
+ className: "rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text",
171
+ children: T("timecampus.mobile.timeline.error", "Couldn't load this day. Pull down or try again in a moment.")
172
+ }) : q && !Z ? /* @__PURE__ */ A(i, {
173
+ variant: "list",
174
+ count: 4
175
+ }) : $.length === 0 ? /* @__PURE__ */ A(a, {
176
+ illustration: "empty-sessions",
177
+ title: B ? T("timecampus.mobile.timeline.noMatches", "Nothing matches that search") : T("timecampus.mobile.timeline.emptyTitle", "Nothing tracked this day"),
178
+ description: B ? T("timecampus.mobile.timeline.noMatchesHint", "Try a different word, or clear the search.") : T("timecampus.mobile.timeline.emptyHint", "Start the timer or connect a capture channel and your day fills in here.")
179
+ }) : /* @__PURE__ */ A("ol", {
180
+ className: "relative ml-14 border-l border-border-seam",
181
+ "data-testid": "mobile-timeline-list",
182
+ children: $.map((e) => {
183
+ let t = P(e.category), i = e.isPlanned ? S : t.icon, a = e.projectId ? X.get(e.projectId) : void 0;
184
+ return /* @__PURE__ */ j("li", {
185
+ className: "relative pb-3 pl-3",
186
+ children: [
187
+ /* @__PURE__ */ A("span", {
188
+ className: "absolute -left-14 top-3 w-12 text-right text-xs tabular-nums text-text-secondary",
189
+ children: r(e.startTime)
190
+ }),
191
+ /* @__PURE__ */ A("span", { className: "absolute -left-[5px] top-4 h-2.5 w-2.5 rounded-full border border-border-seam bg-bg-surface" }),
192
+ /* @__PURE__ */ j("button", {
193
+ type: "button",
194
+ onClick: () => U(e),
195
+ className: n("w-full rounded-2xl border p-3 text-left", t.card, e.isPlanned && "border-dashed bg-transparent"),
196
+ "data-testid": "mobile-timeline-segment",
197
+ children: [
198
+ /* @__PURE__ */ j("div", {
199
+ className: "flex items-start justify-between gap-2",
200
+ children: [/* @__PURE__ */ A("p", {
201
+ className: "text-xs tabular-nums text-text-secondary",
202
+ children: L(e)
203
+ }), /* @__PURE__ */ A(i, { className: n("h-4 w-4 shrink-0", t.accent) })]
204
+ }),
205
+ /* @__PURE__ */ A("p", {
206
+ className: "mt-1 truncate text-base font-semibold text-text-primary",
207
+ children: I(e)
208
+ }),
209
+ a && /* @__PURE__ */ A("p", {
210
+ className: "truncate text-sm text-text-secondary",
211
+ children: a
212
+ }),
213
+ /* @__PURE__ */ j("p", {
214
+ className: n("mt-1 text-sm", t.accent),
215
+ children: [
216
+ l(e.durationSeconds),
217
+ " · ",
218
+ t.label,
219
+ e.isPlanned ? ` · ${T("timecampus.mobile.timeline.planned", "Planned")}` : ""
220
+ ]
221
+ })
222
+ ]
223
+ })
224
+ ]
225
+ }, e.id);
226
+ })
227
+ }),
228
+ H && /* @__PURE__ */ A(z, {
229
+ segment: H,
230
+ project: H.projectId ? X.get(H.projectId) : void 0,
231
+ onClose: () => U(null),
232
+ onOpenFull: () => x(N === k ? "/timeline" : `/timeline?date=${N}`)
233
+ })
234
+ ]
235
+ });
236
+ }
237
+ function z({ segment: e, project: t, onClose: n, onOpenFull: r }) {
238
+ let i = s(), a = P(e.category);
239
+ return _(() => {
240
+ let e = (e) => {
241
+ e.key === "Escape" && n();
242
+ };
243
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
244
+ }, [n]), /* @__PURE__ */ j("div", {
245
+ className: "fixed inset-0 z-50 flex items-end justify-center",
246
+ children: [/* @__PURE__ */ A("button", {
247
+ type: "button",
248
+ className: "absolute inset-0 bg-overlay-scrim",
249
+ onClick: n,
250
+ "aria-label": i("timecampus.mobile.timeline.closeSheet", "Close details")
251
+ }), /* @__PURE__ */ j("div", {
252
+ role: "dialog",
253
+ "aria-modal": "true",
254
+ "aria-labelledby": "mobile-segment-title",
255
+ className: "relative w-full max-w-md rounded-t-3xl border border-border-subtle bg-bg-surface px-5 pb-[calc(env(safe-area-inset-bottom)+1.25rem)] pt-3 shadow-lg",
256
+ "data-testid": "mobile-timeline-sheet",
257
+ children: [
258
+ /* @__PURE__ */ A("div", { className: "mx-auto mb-3 h-1.5 w-10 rounded-full bg-bg-sunken" }),
259
+ /* @__PURE__ */ j("div", {
260
+ className: "flex items-start justify-between gap-3",
261
+ children: [/* @__PURE__ */ A("h3", {
262
+ id: "mobile-segment-title",
263
+ className: "text-lg font-semibold text-text-primary",
264
+ children: I(e)
265
+ }), /* @__PURE__ */ A("button", {
266
+ type: "button",
267
+ onClick: n,
268
+ className: "-mr-2 inline-flex h-11 w-11 items-center justify-center rounded-full text-text-secondary",
269
+ "aria-label": i("timecampus.mobile.timeline.closeSheet", "Close details"),
270
+ children: /* @__PURE__ */ A(k, { className: "h-5 w-5" })
271
+ })]
272
+ }),
273
+ /* @__PURE__ */ j("dl", {
274
+ className: "mt-2 space-y-2 text-sm",
275
+ children: [
276
+ /* @__PURE__ */ j("div", {
277
+ className: "flex justify-between gap-3",
278
+ children: [/* @__PURE__ */ A("dt", {
279
+ className: "text-text-secondary",
280
+ children: i("timecampus.mobile.timeline.when", "When")
281
+ }), /* @__PURE__ */ A("dd", {
282
+ className: "tabular-nums text-text-primary",
283
+ children: L(e)
284
+ })]
285
+ }),
286
+ /* @__PURE__ */ j("div", {
287
+ className: "flex justify-between gap-3",
288
+ children: [/* @__PURE__ */ A("dt", {
289
+ className: "text-text-secondary",
290
+ children: i("timecampus.mobile.timeline.duration", "Duration")
291
+ }), /* @__PURE__ */ A("dd", {
292
+ className: "tabular-nums text-text-primary",
293
+ children: l(e.durationSeconds)
294
+ })]
295
+ }),
296
+ /* @__PURE__ */ j("div", {
297
+ className: "flex justify-between gap-3",
298
+ children: [/* @__PURE__ */ A("dt", {
299
+ className: "text-text-secondary",
300
+ children: i("timecampus.mobile.timeline.category", "Category")
301
+ }), /* @__PURE__ */ A("dd", {
302
+ className: a.accent,
303
+ children: a.label
304
+ })]
305
+ }),
306
+ t && /* @__PURE__ */ j("div", {
307
+ className: "flex justify-between gap-3",
308
+ children: [/* @__PURE__ */ A("dt", {
309
+ className: "text-text-secondary",
310
+ children: i("timecampus.mobile.timeline.project", "Project")
311
+ }), /* @__PURE__ */ A("dd", {
312
+ className: "truncate text-text-primary",
313
+ children: t
314
+ })]
315
+ }),
316
+ e.app && /* @__PURE__ */ j("div", {
317
+ className: "flex justify-between gap-3",
318
+ children: [/* @__PURE__ */ A("dt", {
319
+ className: "text-text-secondary",
320
+ children: i("timecampus.mobile.timeline.app", "App")
321
+ }), /* @__PURE__ */ A("dd", {
322
+ className: "truncate text-text-primary",
323
+ children: e.app
324
+ })]
325
+ })
326
+ ]
327
+ }),
328
+ /* @__PURE__ */ A("button", {
329
+ type: "button",
330
+ onClick: r,
331
+ className: "mt-5 min-h-12 w-full rounded-2xl bg-action-primary-bg text-base font-semibold text-action-primary-text",
332
+ children: e.isRecategorizable ? i("timecampus.mobile.timeline.editInFull", "Edit on the full timeline") : i("timecampus.mobile.timeline.openFull", "Open the full timeline")
333
+ })
334
+ ]
335
+ })]
336
+ });
337
+ }
338
+ //#endregion
339
+ export { R as MobileTimelinePage };
340
+
341
+ //# sourceMappingURL=MobileTimelinePage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MobileTimelinePage.js","names":[],"sources":["../../../../src/timecampus/pages/mobile/MobileTimelinePage.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { useSearchParams } from \"react-router\";\nimport {\n Activity,\n Brain,\n CalendarClock,\n ChevronLeft,\n ChevronRight,\n Coffee,\n MessageSquare,\n Search,\n Users,\n X,\n} from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport { EmptyState } from \"../../components/EmptyState\";\nimport { LoadingSkeleton } from \"../../components/LoadingSkeleton\";\nimport {\n useTimeCampus,\n useTimeCampusNavigate,\n} from \"../../providers/TimeCampusProvider\";\nimport { useTr } from \"../../hooks\";\nimport { cn, formatTime } from \"../../utils/helpers\";\nimport {\n useGetTimeCampusTimelineQuery,\n useListProjectsQuery,\n type TimelineSegmentFieldsFragment,\n} from \"@/generated/wspace-operations\";\nimport { MobileScreen } from \"./MobileScreen\";\nimport {\n compactDuration,\n dayHeading,\n filterSegments,\n focusSummary,\n localDayBounds,\n longDayLabel,\n parseLocalDateKey,\n shiftDateKey,\n sortByStart,\n toLocalDateKey,\n} from \"./mobileModel\";\n\ntype Segment = TimelineSegmentFieldsFragment;\n\ninterface CategoryMeta {\n label: string;\n icon: typeof Brain;\n card: string;\n accent: string;\n}\n\nconst OTHER_CATEGORY: CategoryMeta = {\n label: \"Other\",\n icon: Activity,\n card: \"border-border-subtle bg-bg-surface\",\n accent: \"text-text-secondary\",\n};\n\nconst CATEGORY: Record<string, CategoryMeta> = {\n DEEP_WORK: {\n label: \"Deep work\",\n icon: Brain,\n card: \"border-status-success-text/40 bg-status-success-bg\",\n accent: \"text-status-success-text\",\n },\n MEETING: {\n label: \"Meeting\",\n icon: Users,\n card: \"border-status-info-text/40 bg-status-info-bg\",\n accent: \"text-status-info-text\",\n },\n COMMUNICATION: {\n label: \"Communication\",\n icon: MessageSquare,\n card: \"border-status-warning-text/40 bg-status-warning-bg\",\n accent: \"text-status-warning-text\",\n },\n BREAK: {\n label: \"Break\",\n icon: Coffee,\n card: \"border-border-subtle bg-bg-sunken\",\n accent: \"text-text-secondary\",\n },\n OTHER: OTHER_CATEGORY,\n};\n\nconst categoryMeta = (category: string): CategoryMeta =>\n CATEGORY[category] ?? OTHER_CATEGORY;\nconst categoryLabel = (category: string) => categoryMeta(category).label;\n\nfunction segmentTitle(segment: Segment): string {\n if (segment.title) return segment.title;\n if (segment.app) return segment.app;\n return segment.isPlanned\n ? \"Planned focus block\"\n : categoryLabel(segment.category);\n}\n\nfunction timeWindow(segment: Segment): string {\n const start = formatTime(segment.startTime);\n return segment.endTime ? `${start} – ${formatTime(segment.endTime)}` : start;\n}\n\n/**\n * Phone timeline: the day as a vertical stack of thumb-sized cards on a time\n * rail, a focus summary on top, search, day paging, and a bottom sheet with a\n * segment's details. Editing (recategorise, assign project, drag) stays on the\n * full timeline, which the sheet links to.\n */\nexport function MobileTimelinePage() {\n const { workspaceId = \"\" } = useTimeCampus();\n const navigate = useTimeCampusNavigate();\n const t = useTr();\n const [searchParams, setSearchParams] = useSearchParams();\n\n const todayKey = toLocalDateKey(new Date());\n const linked = searchParams.get(\"date\");\n const dateKey =\n parseLocalDateKey(linked) && (linked as string) <= todayKey\n ? (linked as string)\n : todayKey;\n const setDateKey = (key: string) => {\n const next = new URLSearchParams(searchParams);\n if (key === todayKey) next.delete(\"date\");\n else next.set(\"date\", key);\n setSearchParams(next, { replace: true });\n };\n\n const [query, setQuery] = useState(\"\");\n const [selected, setSelected] = useState<Segment | null>(null);\n useEffect(() => setSelected(null), [dateKey]);\n\n const { from, to } = useMemo(() => localDayBounds(dateKey), [dateKey]);\n const { data, loading, error } = useGetTimeCampusTimelineQuery({\n variables: { from, to },\n skip: !workspaceId,\n fetchPolicy: \"cache-and-network\",\n });\n const { data: projectsData } = useListProjectsQuery({\n variables: { pagination: { limit: 200 } },\n skip: !workspaceId,\n });\n\n const projectNameById = useMemo(() => {\n const map = new Map<string, string>();\n for (const project of projectsData?.projects?.items ?? []) {\n map.set(project.id, project.name);\n }\n return map;\n }, [projectsData?.projects?.items]);\n\n const timeline = data?.timeCampusTimeline;\n const summary = focusSummary(timeline?.summary);\n const segments = useMemo(\n () =>\n filterSegments<Segment>(\n sortByStart<Segment>(timeline?.segments ?? []),\n query,\n projectNameById,\n categoryLabel,\n ),\n [timeline?.segments, query, projectNameById],\n );\n\n return (\n <MobileScreen\n active=\"timeline\"\n title={t(\"timecampus.mobile.timeline.title\", \"Timeline\")}\n fullViewPath={\n dateKey === todayKey ? \"/timeline\" : `/timeline?date=${dateKey}`\n }\n >\n <label className=\"relative block\">\n <span className=\"sr-only\">\n {t(\"timecampus.mobile.timeline.searchLabel\", \"Search this day\")}\n </span>\n <Search className=\"pointer-events-none absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-text-secondary\" />\n <input\n type=\"search\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder={t(\n \"timecampus.mobile.timeline.searchPlaceholder\",\n \"Search events, apps, projects…\",\n )}\n className=\"min-h-12 w-full rounded-2xl border border-border-subtle bg-bg-surface pl-10 pr-3 text-base text-text-primary placeholder:text-text-secondary\"\n data-testid=\"mobile-timeline-search\"\n />\n </label>\n\n <GlassCard\n treatment=\"glass\"\n glow\n className=\"p-4\"\n data-testid=\"mobile-timeline-summary\"\n >\n <p className=\"text-sm font-semibold text-text-primary\">\n {t(\"timecampus.mobile.timeline.focusSummary\", \"Focus summary\")}\n </p>\n <dl className=\"mt-2 grid grid-cols-3 gap-2\">\n <div>\n <dt className=\"text-xs text-text-secondary\">\n {t(\"timecampus.mobile.timeline.focusShare\", \"Focus share\")}\n </dt>\n <dd className=\"text-xl font-bold tabular-nums text-text-primary\">\n {summary.focusPercent === null ? \"—\" : `${summary.focusPercent}%`}\n </dd>\n </div>\n <div>\n <dt className=\"text-xs text-text-secondary\">\n {t(\"timecampus.mobile.timeline.deepWork\", \"Deep work\")}\n </dt>\n <dd className=\"text-xl font-bold tabular-nums text-text-primary\">\n {compactDuration(summary.deepWorkSeconds)}\n </dd>\n </div>\n <div>\n <dt className=\"text-xs text-text-secondary\">\n {t(\"timecampus.mobile.timeline.meetings\", \"Meetings\")}\n </dt>\n <dd className=\"text-xl font-bold tabular-nums text-text-primary\">\n {compactDuration(summary.meetingSeconds)}\n </dd>\n </div>\n </dl>\n </GlassCard>\n\n <div className=\"flex items-center justify-between gap-2\">\n <button\n type=\"button\"\n onClick={() => setDateKey(shiftDateKey(dateKey, -1))}\n className=\"inline-flex h-11 w-11 items-center justify-center rounded-full border border-border-subtle text-text-primary\"\n aria-label={t(\n \"timecampus.mobile.timeline.previousDay\",\n \"Previous day\",\n )}\n >\n <ChevronLeft className=\"h-5 w-5\" />\n </button>\n <div className=\"min-w-0 text-center\">\n <h2\n className=\"truncate text-lg font-bold text-text-primary\"\n data-testid=\"mobile-timeline-day\"\n >\n {dayHeading(dateKey)}\n </h2>\n <p className=\"truncate text-xs text-text-secondary\">\n {longDayLabel(dateKey)}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={() => setDateKey(shiftDateKey(dateKey, 1))}\n disabled={dateKey >= todayKey}\n className=\"inline-flex h-11 w-11 items-center justify-center rounded-full border border-border-subtle text-text-primary disabled:opacity-40\"\n aria-label={t(\"timecampus.mobile.timeline.nextDay\", \"Next day\")}\n >\n <ChevronRight className=\"h-5 w-5\" />\n </button>\n </div>\n\n {error ? (\n <p className=\"rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text\">\n {t(\n \"timecampus.mobile.timeline.error\",\n \"Couldn't load this day. Pull down or try again in a moment.\",\n )}\n </p>\n ) : loading && !timeline ? (\n <LoadingSkeleton variant=\"list\" count={4} />\n ) : segments.length === 0 ? (\n <EmptyState\n illustration=\"empty-sessions\"\n title={\n query\n ? t(\n \"timecampus.mobile.timeline.noMatches\",\n \"Nothing matches that search\",\n )\n : t(\n \"timecampus.mobile.timeline.emptyTitle\",\n \"Nothing tracked this day\",\n )\n }\n description={\n query\n ? t(\n \"timecampus.mobile.timeline.noMatchesHint\",\n \"Try a different word, or clear the search.\",\n )\n : t(\n \"timecampus.mobile.timeline.emptyHint\",\n \"Start the timer or connect a capture channel and your day fills in here.\",\n )\n }\n />\n ) : (\n <ol\n className=\"relative ml-14 border-l border-border-seam\"\n data-testid=\"mobile-timeline-list\"\n >\n {segments.map((segment) => {\n const meta = categoryMeta(segment.category);\n const Icon = segment.isPlanned ? CalendarClock : meta.icon;\n const project = segment.projectId\n ? projectNameById.get(segment.projectId)\n : undefined;\n return (\n <li key={segment.id} className=\"relative pb-3 pl-3\">\n <span className=\"absolute -left-14 top-3 w-12 text-right text-xs tabular-nums text-text-secondary\">\n {formatTime(segment.startTime)}\n </span>\n <span className=\"absolute -left-[5px] top-4 h-2.5 w-2.5 rounded-full border border-border-seam bg-bg-surface\" />\n <button\n type=\"button\"\n onClick={() => setSelected(segment)}\n className={cn(\n \"w-full rounded-2xl border p-3 text-left\",\n meta.card,\n segment.isPlanned && \"border-dashed bg-transparent\",\n )}\n data-testid=\"mobile-timeline-segment\"\n >\n <div className=\"flex items-start justify-between gap-2\">\n <p className=\"text-xs tabular-nums text-text-secondary\">\n {timeWindow(segment)}\n </p>\n <Icon className={cn(\"h-4 w-4 shrink-0\", meta.accent)} />\n </div>\n <p className=\"mt-1 truncate text-base font-semibold text-text-primary\">\n {segmentTitle(segment)}\n </p>\n {project && (\n <p className=\"truncate text-sm text-text-secondary\">\n {project}\n </p>\n )}\n <p className={cn(\"mt-1 text-sm\", meta.accent)}>\n {compactDuration(segment.durationSeconds)} · {meta.label}\n {segment.isPlanned\n ? ` · ${t(\"timecampus.mobile.timeline.planned\", \"Planned\")}`\n : \"\"}\n </p>\n </button>\n </li>\n );\n })}\n </ol>\n )}\n\n {selected && (\n <SegmentSheet\n segment={selected}\n project={\n selected.projectId\n ? projectNameById.get(selected.projectId)\n : undefined\n }\n onClose={() => setSelected(null)}\n onOpenFull={() =>\n navigate(\n dateKey === todayKey ? \"/timeline\" : `/timeline?date=${dateKey}`,\n )\n }\n />\n )}\n </MobileScreen>\n );\n}\n\nfunction SegmentSheet({\n segment,\n project,\n onClose,\n onOpenFull,\n}: {\n segment: Segment;\n project?: string;\n onClose: () => void;\n onOpenFull: () => void;\n}) {\n const t = useTr();\n const meta = categoryMeta(segment.category);\n\n useEffect(() => {\n const onKey = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") onClose();\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [onClose]);\n\n return (\n <div className=\"fixed inset-0 z-50 flex items-end justify-center\">\n <button\n type=\"button\"\n className=\"absolute inset-0 bg-overlay-scrim\"\n onClick={onClose}\n aria-label={t(\"timecampus.mobile.timeline.closeSheet\", \"Close details\")}\n />\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"mobile-segment-title\"\n className=\"relative w-full max-w-md rounded-t-3xl border border-border-subtle bg-bg-surface px-5 pb-[calc(env(safe-area-inset-bottom)+1.25rem)] pt-3 shadow-lg\"\n data-testid=\"mobile-timeline-sheet\"\n >\n <div className=\"mx-auto mb-3 h-1.5 w-10 rounded-full bg-bg-sunken\" />\n <div className=\"flex items-start justify-between gap-3\">\n <h3\n id=\"mobile-segment-title\"\n className=\"text-lg font-semibold text-text-primary\"\n >\n {segmentTitle(segment)}\n </h3>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"-mr-2 inline-flex h-11 w-11 items-center justify-center rounded-full text-text-secondary\"\n aria-label={t(\n \"timecampus.mobile.timeline.closeSheet\",\n \"Close details\",\n )}\n >\n <X className=\"h-5 w-5\" />\n </button>\n </div>\n <dl className=\"mt-2 space-y-2 text-sm\">\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-text-secondary\">\n {t(\"timecampus.mobile.timeline.when\", \"When\")}\n </dt>\n <dd className=\"tabular-nums text-text-primary\">\n {timeWindow(segment)}\n </dd>\n </div>\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-text-secondary\">\n {t(\"timecampus.mobile.timeline.duration\", \"Duration\")}\n </dt>\n <dd className=\"tabular-nums text-text-primary\">\n {compactDuration(segment.durationSeconds)}\n </dd>\n </div>\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-text-secondary\">\n {t(\"timecampus.mobile.timeline.category\", \"Category\")}\n </dt>\n <dd className={meta.accent}>{meta.label}</dd>\n </div>\n {project && (\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-text-secondary\">\n {t(\"timecampus.mobile.timeline.project\", \"Project\")}\n </dt>\n <dd className=\"truncate text-text-primary\">{project}</dd>\n </div>\n )}\n {segment.app && (\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-text-secondary\">\n {t(\"timecampus.mobile.timeline.app\", \"App\")}\n </dt>\n <dd className=\"truncate text-text-primary\">{segment.app}</dd>\n </div>\n )}\n </dl>\n <button\n type=\"button\"\n onClick={onOpenFull}\n className=\"mt-5 min-h-12 w-full rounded-2xl bg-action-primary-bg text-base font-semibold text-action-primary-text\"\n >\n {segment.isRecategorizable\n ? t(\n \"timecampus.mobile.timeline.editInFull\",\n \"Edit on the full timeline\",\n )\n : t(\n \"timecampus.mobile.timeline.openFull\",\n \"Open the full timeline\",\n )}\n </button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmDA,IAAM,IAA+B;CACnC,OAAO;CACP,MAAM;CACN,MAAM;CACN,QAAQ;AACV,GAEM,IAAyC;CAC7C,WAAW;EACT,OAAO;EACP,MAAM;EACN,MAAM;EACN,QAAQ;CACV;CACA,SAAS;EACP,OAAO;EACP,MAAM;EACN,MAAM;EACN,QAAQ;CACV;CACA,eAAe;EACb,OAAO;EACP,MAAM;EACN,MAAM;EACN,QAAQ;CACV;CACA,OAAO;EACL,OAAO;EACP,MAAM;EACN,MAAM;EACN,QAAQ;CACV;CACA,OAAO;AACT,GAEM,KAAgB,MACpB,EAAS,MAAa,GAClB,KAAiB,MAAqB,EAAa,CAAQ,CAAC,CAAC;AAEnE,SAAS,EAAa,GAA0B;CAG9C,OAFI,EAAQ,QAAc,EAAQ,QAC9B,EAAQ,MAAY,EAAQ,MACzB,EAAQ,YACX,wBACA,EAAc,EAAQ,QAAQ;AACpC;AAEA,SAAS,EAAW,GAA0B;CAC5C,IAAM,IAAQ,EAAW,EAAQ,SAAS;CAC1C,OAAO,EAAQ,UAAU,GAAG,EAAM,KAAK,EAAW,EAAQ,OAAO,MAAM;AACzE;AAQA,SAAgB,IAAqB;CACnC,IAAM,EAAE,iBAAc,OAAO,EAAc,GACr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A8B,UAAA;OAAY,CAAA,CACrD;;MAEN,EAAQ,OACP,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,MAAD;QAAI,WAAU;QACX,UAAA,EAAE,kCAAkC,KAAK;OACxC,CAAA,GACJ,kBAAC,MAAD;QAAI,WAAU;QAA8B,UAAA,EAAQ;OAAQ,CAAA,CACzD;;KAEL;;IACJ,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;KAET,UAAA,EAAQ,oBACL,EACE,yCACA,2BACF,IACA,EACE,uCACA,wBACF;IACE,CAAA;GACL;EACF,CAAA,CAAA;;AAET"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Phone focus timer: one big countdown ring, a Work/Break switch and
3
+ * thumb-sized Start/Stop controls. Sessions are real pomodoro sessions on the
4
+ * backend, so a session started here continues on the desktop Pomodoro page
5
+ * (and vice versa).
6
+ */
7
+ export declare function MobileTimerPage(): import("react").JSX.Element;
8
+ //# sourceMappingURL=MobileTimerPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MobileTimerPage.d.ts","sourceRoot":"","sources":["../../../../src/timecampus/pages/mobile/MobileTimerPage.tsx"],"names":[],"mappings":"AAgDA;;;;;GAKG;AACH,wBAAgB,eAAe,gCAwS9B"}
@@ -0,0 +1,226 @@
1
+ import { useTimeCampus as e, useTimeCampusNavigate as t } from "../../providers/TimeCampusProvider.js";
2
+ import { cn as n } from "../../utils/helpers.js";
3
+ import { useCompletePomodoroSessionMutation as ee, useGetActivePomodoroSessionQuery as te, useGetPomodoroSettingsQuery as r, useGetPomodoroStatsQuery as i, useInterruptPomodoroSessionMutation as a, useListPomodoroGoalsQuery as ne, useStartPomodoroSessionMutation as re } from "../../../generated/wspace-operations.js";
4
+ import { useTr as ie } from "../../shared/hooks/useTr.js";
5
+ import "../../hooks/index.js";
6
+ import { chartTokens as o } from "../../components/charts/chartTheme.js";
7
+ import { PomodoroSessionType as s } from "../../../generated/wspace-types.js";
8
+ import { MobileScreen as c } from "./MobileScreen.js";
9
+ import { formatCountdown as l, localDayBounds as u, remainingSeconds as d, ringFraction as f, toLocalDateKey as p, todaysGoal as m } from "./mobileModel.js";
10
+ import { durationForSession as h } from "../pomodoro/pomodoroDuration.js";
11
+ import { useCallback as ae, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
12
+ import { Play as oe, Settings as se, Square as ce } from "lucide-react";
13
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
14
+ import { GlassCard as le } from "@burdenoff/fe-libs/ui";
15
+ //#region src/timecampus/pages/mobile/MobileTimerPage.tsx
16
+ var S = 46, C = 2 * Math.PI * S, w = [
17
+ "GetActivePomodoroSession",
18
+ "GetPomodoroStats",
19
+ "ListPomodoroGoals",
20
+ "ListPomodoroSessions"
21
+ ];
22
+ function T(e) {
23
+ return e === s.Focus || e === void 0 ? "work" : "break";
24
+ }
25
+ function E() {
26
+ let { workspaceId: E = "" } = e(), D = t(), O = ie(), k = _(() => u(p(/* @__PURE__ */ new Date())), []), { data: A, loading: j } = te({
27
+ variables: { workspaceId: E },
28
+ skip: !E,
29
+ fetchPolicy: "cache-and-network"
30
+ }), { data: M } = r({
31
+ variables: { workspaceId: E },
32
+ skip: !E
33
+ }), { data: N } = i({
34
+ variables: {
35
+ workspaceId: E,
36
+ startDate: k.from,
37
+ endDate: k.to
38
+ },
39
+ skip: !E,
40
+ fetchPolicy: "cache-and-network"
41
+ }), { data: P } = ne({
42
+ variables: { workspaceId: E },
43
+ skip: !E
44
+ }), [F, { loading: I, error: L }] = re(), [R] = ee(), [z, { loading: B }] = a(), V = M?.pomodoroSettings ?? null, H = A?.activePomodoroSession && !A.activePomodoroSession.completed && !A.activePomodoroSession.interrupted ? A.activePomodoroSession : null, [U, W] = y("work"), G = U === "work" ? s.Focus : s.ShortBreak, ue = H?.type ?? G, de = H?.duration ?? h(ue, V), [fe, K] = y(() => Date.now());
45
+ g(() => {
46
+ if (!H) return;
47
+ K(Date.now());
48
+ let e = window.setInterval(() => K(Date.now()), 1e3);
49
+ return () => window.clearInterval(e);
50
+ }, [H]);
51
+ let q = H ? d(H, h(H.type, V), fe) : h(G, V), J = v(null), Y = ae(async (e) => {
52
+ if (J.current !== e) {
53
+ J.current = e;
54
+ try {
55
+ await R({
56
+ variables: {
57
+ id: e,
58
+ workspaceId: E
59
+ },
60
+ refetchQueries: w,
61
+ awaitRefetchQueries: !0
62
+ });
63
+ } finally {
64
+ J.current = null;
65
+ }
66
+ }
67
+ }, [R, E]);
68
+ g(() => {
69
+ H && q <= 0 && Y(H.id);
70
+ }, [
71
+ H,
72
+ q,
73
+ Y
74
+ ]);
75
+ let X = async () => {
76
+ !E || H || await F({
77
+ variables: { input: {
78
+ workspaceId: E,
79
+ type: G
80
+ } },
81
+ refetchQueries: w,
82
+ awaitRefetchQueries: !0
83
+ });
84
+ }, pe = async () => {
85
+ H && await z({
86
+ variables: {
87
+ id: H.id,
88
+ workspaceId: E,
89
+ reason: "Stopped from the phone timer"
90
+ },
91
+ refetchQueries: w,
92
+ awaitRefetchQueries: !0
93
+ });
94
+ }, Z = m(P?.pomodoroGoals ?? []), Q = N?.pomodoroStats.completedSessions ?? 0, $ = H ? T(H.type) : U, me = f(q, de), he = Math.round(h(s.Focus, V) / 60), ge = Math.round(h(s.ShortBreak, V) / 60);
95
+ return /* @__PURE__ */ x(c, {
96
+ active: "timer",
97
+ title: O("timecampus.mobile.timer.title", "Focus session"),
98
+ fullViewPath: "/pomodoro",
99
+ trailing: /* @__PURE__ */ b("button", {
100
+ type: "button",
101
+ onClick: () => D("/pomodoro/settings"),
102
+ className: "inline-flex h-11 w-11 items-center justify-center rounded-full text-text-secondary hover:text-text-primary",
103
+ "aria-label": O("timecampus.mobile.timer.settings", "Timer settings"),
104
+ children: /* @__PURE__ */ b(se, { className: "h-5 w-5" })
105
+ }),
106
+ children: [
107
+ /* @__PURE__ */ b(le, {
108
+ treatment: "glass",
109
+ glow: !!H,
110
+ className: "flex flex-col items-center px-4 py-8",
111
+ children: /* @__PURE__ */ x("div", {
112
+ className: "relative aspect-square w-full max-w-[18rem]",
113
+ role: "timer",
114
+ "aria-live": "off",
115
+ "aria-label": O("timecampus.mobile.timer.remainingAria", "{{time}} remaining", { time: l(q) }),
116
+ children: [/* @__PURE__ */ x("svg", {
117
+ viewBox: "0 0 100 100",
118
+ className: "h-full w-full -rotate-90",
119
+ children: [/* @__PURE__ */ b("circle", {
120
+ cx: "50",
121
+ cy: "50",
122
+ r: S,
123
+ fill: "none",
124
+ strokeWidth: "5",
125
+ stroke: o.track
126
+ }), /* @__PURE__ */ b("circle", {
127
+ cx: "50",
128
+ cy: "50",
129
+ r: S,
130
+ fill: "none",
131
+ strokeWidth: "5",
132
+ strokeLinecap: "round",
133
+ strokeDasharray: C,
134
+ strokeDashoffset: C * (1 - me),
135
+ stroke: $ === "work" ? o.brand : o.series[1],
136
+ className: "motion-safe:transition-[stroke-dashoffset] motion-safe:duration-1000"
137
+ })]
138
+ }), /* @__PURE__ */ x("div", {
139
+ className: "absolute inset-0 flex flex-col items-center justify-center",
140
+ children: [
141
+ /* @__PURE__ */ b("p", {
142
+ className: "font-mono text-6xl font-bold tabular-nums text-text-primary",
143
+ "data-testid": "mobile-timer-countdown",
144
+ children: l(q)
145
+ }),
146
+ /* @__PURE__ */ b("p", {
147
+ className: "mt-1 text-base text-text-secondary",
148
+ children: O("timecampus.mobile.timer.pomodoro", "Pomodoro")
149
+ }),
150
+ /* @__PURE__ */ b("p", {
151
+ className: n("text-lg font-semibold uppercase tracking-wide", $ === "work" ? "text-primary" : "text-text-secondary"),
152
+ children: $ === "work" ? O("timecampus.mobile.timer.work", "Work") : O("timecampus.mobile.timer.break", "Break")
153
+ })
154
+ ]
155
+ })]
156
+ })
157
+ }),
158
+ /* @__PURE__ */ b("div", {
159
+ role: "radiogroup",
160
+ "aria-label": O("timecampus.mobile.timer.type", "Session type"),
161
+ className: "grid grid-cols-2 gap-1 rounded-full border border-border-subtle bg-bg-sunken/50 p-1",
162
+ children: ["work", "break"].map((e) => {
163
+ let t = $ === e;
164
+ return /* @__PURE__ */ b("button", {
165
+ type: "button",
166
+ role: "radio",
167
+ "aria-checked": t,
168
+ disabled: !!H,
169
+ onClick: () => W(e),
170
+ className: n("min-h-12 rounded-full text-base font-medium transition-colors disabled:cursor-not-allowed", t ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary"),
171
+ children: e === "work" ? O("timecampus.mobile.timer.workOption", "Work ({{min}}m)", { min: he }) : O("timecampus.mobile.timer.breakOption", "Break ({{min}}m)", { min: ge })
172
+ }, e);
173
+ })
174
+ }),
175
+ L && /* @__PURE__ */ b("p", {
176
+ className: "rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text",
177
+ children: O("timecampus.mobile.timer.startError", "Couldn't start the session. Please try again.")
178
+ }),
179
+ /* @__PURE__ */ x("div", {
180
+ className: "grid grid-cols-2 gap-3",
181
+ children: [/* @__PURE__ */ x("button", {
182
+ type: "button",
183
+ onClick: X,
184
+ disabled: !!H || I || j || !E,
185
+ className: "inline-flex min-h-14 items-center justify-center gap-2 rounded-2xl bg-action-primary-bg text-base font-semibold uppercase text-action-primary-text disabled:opacity-50",
186
+ "data-testid": "mobile-timer-start",
187
+ children: [/* @__PURE__ */ b(oe, { className: "h-5 w-5" }), I ? O("timecampus.mobile.timer.starting", "Starting…") : O("timecampus.mobile.timer.start", "Start")]
188
+ }), /* @__PURE__ */ x("button", {
189
+ type: "button",
190
+ onClick: pe,
191
+ disabled: !H || B,
192
+ className: "inline-flex min-h-14 items-center justify-center gap-2 rounded-2xl border border-border-subtle bg-bg-surface text-base font-semibold uppercase text-text-primary disabled:opacity-50",
193
+ "data-testid": "mobile-timer-stop",
194
+ children: [/* @__PURE__ */ b(ce, { className: "h-5 w-5" }), B ? O("timecampus.mobile.timer.stopping", "Stopping…") : O("timecampus.mobile.timer.stop", "Stop")]
195
+ })]
196
+ }),
197
+ /* @__PURE__ */ x("div", {
198
+ className: "text-center",
199
+ "data-testid": "mobile-timer-goal",
200
+ children: [
201
+ /* @__PURE__ */ b("p", {
202
+ className: "text-base font-semibold text-text-primary",
203
+ children: O("timecampus.mobile.timer.goalsToday", "Focus today")
204
+ }),
205
+ /* @__PURE__ */ b("p", {
206
+ className: "text-sm text-text-secondary",
207
+ children: Z ? O("timecampus.mobile.timer.goalProgress", "{{done}} of {{target}} focus sessions completed", {
208
+ done: Q,
209
+ target: Z.target
210
+ }) : O("timecampus.mobile.timer.sessionsDone", "{{done}} focus sessions completed", { done: Q })
211
+ }),
212
+ !Z && /* @__PURE__ */ b("button", {
213
+ type: "button",
214
+ onClick: () => D("/pomodoro"),
215
+ className: "mt-1 min-h-11 text-sm font-medium text-primary",
216
+ children: O("timecampus.mobile.timer.setGoal", "Set a daily goal")
217
+ })
218
+ ]
219
+ })
220
+ ]
221
+ });
222
+ }
223
+ //#endregion
224
+ export { E as MobileTimerPage };
225
+
226
+ //# sourceMappingURL=MobileTimerPage.js.map