@burdenoff/microfe-timecampus 2026.820.3 → 2026.825.2
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/generated/wspace-operations.d.ts +726 -505
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +1434 -1434
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.js +9 -5
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroPage.d.ts.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroPage.js +291 -220
- package/dist/timecampus/pages/pomodoro/PomodoroPage.js.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroSettingsPage.d.ts.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroSettingsPage.js +80 -76
- package/dist/timecampus/pages/pomodoro/PomodoroSettingsPage.js.map +1 -1
- package/dist/timecampus/pages/pomodoro/pomodoroDuration.d.ts +11 -0
- package/dist/timecampus/pages/pomodoro/pomodoroDuration.d.ts.map +1 -0
- package/dist/timecampus/pages/pomodoro/pomodoroDuration.js +18 -0
- package/dist/timecampus/pages/pomodoro/pomodoroDuration.js.map +1 -0
- package/package.json +4 -3
|
@@ -1,152 +1,221 @@
|
|
|
1
1
|
import { useTimeCampus as e, useTimeCampusNavigate as t } from "../../providers/TimeCampusProvider.js";
|
|
2
2
|
import { StatCard as n } from "../../components/StatCard.js";
|
|
3
|
-
import { LoadingSkeleton as
|
|
4
|
-
import { useCompletePomodoroSessionMutation as
|
|
5
|
-
import { PageLayout as
|
|
6
|
-
import { Modal as
|
|
7
|
-
import { PomodoroGoalType as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
3
|
+
import { LoadingSkeleton as ee } from "../../components/LoadingSkeleton.js";
|
|
4
|
+
import { useCompletePomodoroSessionMutation as te, useCreatePomodoroGoalMutation as ne, useDeletePomodoroGoalMutation as re, useGetActivePomodoroSessionQuery as ie, useGetPomodoroSettingsQuery as ae, useGetPomodoroStatsQuery as oe, useInterruptPomodoroSessionMutation as se, useListPomodoroGoalsQuery as ce, useListPomodoroSessionsQuery as le, useStartPomodoroSessionMutation as ue, useUpdatePomodoroGoalMutation as de } from "../../../generated/wspace-operations.js";
|
|
5
|
+
import { PageLayout as r } from "../../components/PageLayout.js";
|
|
6
|
+
import { Modal as i } from "../../components/Modal.js";
|
|
7
|
+
import { PomodoroGoalType as a, PomodoroSessionOrderByField as fe, PomodoroSessionType as o, TimeCampusSortDirection as pe } from "../../../generated/wspace-types.js";
|
|
8
|
+
import { durationForSession as me, nextSessionAfter as s } from "./pomodoroDuration.js";
|
|
9
|
+
import { useCallback as c, useEffect as l, useRef as he, useState as u } from "react";
|
|
10
|
+
import { Pause as ge, Pencil as _e, Play as ve, Plus as ye, RotateCcw as be, SkipForward as xe, Target as Se, Trash2 as Ce } from "lucide-react";
|
|
11
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
12
|
+
import { GlassCard as m, NextSteps as we } from "@burdenoff/fe-libs/ui";
|
|
12
13
|
//#region src/timecampus/pages/pomodoro/PomodoroPage.tsx
|
|
13
|
-
var
|
|
14
|
-
function
|
|
14
|
+
var h = "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary", g = "block text-sm font-medium text-text-primary";
|
|
15
|
+
function _(e) {
|
|
15
16
|
let t = new Date(e);
|
|
16
17
|
return Number.isNaN(t.getTime()) ? "" : (/* @__PURE__ */ new Date(t.getTime() - t.getTimezoneOffset() * 6e4)).toISOString().slice(0, 10);
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function v() {
|
|
19
20
|
let e = /* @__PURE__ */ new Date();
|
|
20
21
|
return (/* @__PURE__ */ new Date(e.getTime() - e.getTimezoneOffset() * 6e4)).toISOString().slice(0, 10);
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
+
function y(e) {
|
|
23
24
|
let t = /* @__PURE__ */ new Date();
|
|
24
25
|
return t.setDate(t.getDate() + e), (/* @__PURE__ */ new Date(t.getTime() - t.getTimezoneOffset() * 6e4)).toISOString().slice(0, 10);
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function b(e) {
|
|
27
28
|
return {
|
|
28
|
-
type: e?.type ??
|
|
29
|
+
type: e?.type ?? a.Daily,
|
|
29
30
|
target: e?.target == null ? "8" : String(e.target),
|
|
30
31
|
period: e?.period ?? "DAILY",
|
|
31
|
-
startDate: e?.startDate ?
|
|
32
|
-
endDate: e?.endDate ?
|
|
32
|
+
startDate: e?.startDate ? _(e.startDate) : v(),
|
|
33
|
+
endDate: e?.endDate ? _(e.endDate) : y(0)
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
let { workspaceId:
|
|
37
|
-
variables: { workspaceId:
|
|
38
|
-
skip: !
|
|
39
|
-
}), { data:
|
|
40
|
-
variables: { workspaceId:
|
|
41
|
-
skip: !
|
|
42
|
-
}),
|
|
43
|
-
variables: { workspaceId:
|
|
44
|
-
skip: !
|
|
45
|
-
}),
|
|
36
|
+
function x() {
|
|
37
|
+
let { workspaceId: _ = "" } = e(), v = t(), { data: x, loading: Te, error: Ee } = oe({
|
|
38
|
+
variables: { workspaceId: _ },
|
|
39
|
+
skip: !_
|
|
40
|
+
}), { data: De, loading: Oe, error: ke } = ie({
|
|
41
|
+
variables: { workspaceId: _ },
|
|
42
|
+
skip: !_
|
|
43
|
+
}), { data: Ae, loading: je, error: Me } = ae({
|
|
44
|
+
variables: { workspaceId: _ },
|
|
45
|
+
skip: !_
|
|
46
|
+
}), { data: Ne } = le({
|
|
47
|
+
variables: {
|
|
48
|
+
workspaceId: _,
|
|
49
|
+
orderBy: {
|
|
50
|
+
field: fe.StartTime,
|
|
51
|
+
direction: pe.Desc
|
|
52
|
+
},
|
|
53
|
+
pagination: {
|
|
54
|
+
limit: 1,
|
|
55
|
+
offset: 0
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
skip: !_
|
|
59
|
+
}), [S] = ue(), [C] = te(), [Pe] = se(), { data: w, refetch: T } = ce({
|
|
60
|
+
variables: { workspaceId: _ },
|
|
61
|
+
skip: !_
|
|
62
|
+
}), E = w?.pomodoroGoals ?? [], [Fe, { loading: D, error: Ie }] = ne(), [Le, { loading: O, error: Re }] = de(), [ze, { loading: k, error: Be }] = re(), [Ve, A] = u(!1), [j, M] = u(null), [N, P] = u(null), [F, I] = u(b()), L = (e, t) => I((n) => ({
|
|
46
63
|
...n,
|
|
47
64
|
[e]: t
|
|
48
|
-
})),
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
if (!
|
|
54
|
-
let e = Number(
|
|
55
|
-
!e || e <= 0 || (
|
|
56
|
-
id:
|
|
57
|
-
workspaceId:
|
|
65
|
+
})), He = () => {
|
|
66
|
+
M(null), I(b()), A(!0);
|
|
67
|
+
}, Ue = (e) => {
|
|
68
|
+
M(e), I(b(e)), A(!0);
|
|
69
|
+
}, We = async () => {
|
|
70
|
+
if (!_) return;
|
|
71
|
+
let e = Number(F.target);
|
|
72
|
+
!e || e <= 0 || (j ? await Le({ variables: {
|
|
73
|
+
id: j.id,
|
|
74
|
+
workspaceId: _,
|
|
58
75
|
input: {
|
|
59
|
-
type:
|
|
76
|
+
type: F.type,
|
|
60
77
|
target: e,
|
|
61
|
-
period:
|
|
62
|
-
startDate: new Date(
|
|
63
|
-
endDate: new Date(
|
|
78
|
+
period: F.period.trim() || F.type,
|
|
79
|
+
startDate: new Date(F.startDate).toISOString(),
|
|
80
|
+
endDate: new Date(F.endDate).toISOString()
|
|
64
81
|
}
|
|
65
|
-
} }) : await
|
|
66
|
-
workspaceId:
|
|
67
|
-
type:
|
|
82
|
+
} }) : await Fe({ variables: { input: {
|
|
83
|
+
workspaceId: _,
|
|
84
|
+
type: F.type,
|
|
68
85
|
target: e,
|
|
69
|
-
period:
|
|
70
|
-
startDate: new Date(
|
|
71
|
-
endDate: new Date(
|
|
72
|
-
} } }),
|
|
73
|
-
},
|
|
74
|
-
!
|
|
75
|
-
id:
|
|
76
|
-
workspaceId:
|
|
77
|
-
} }),
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
period: F.period.trim() || F.type,
|
|
87
|
+
startDate: new Date(F.startDate).toISOString(),
|
|
88
|
+
endDate: new Date(F.endDate).toISOString()
|
|
89
|
+
} } }), A(!1), await T());
|
|
90
|
+
}, Ge = async () => {
|
|
91
|
+
!N || !_ || (await ze({ variables: {
|
|
92
|
+
id: N.id,
|
|
93
|
+
workspaceId: _
|
|
94
|
+
} }), P(null), await T());
|
|
95
|
+
}, R = x?.pomodoroStats, z = De?.activePomodoroSession, B = Ae?.pomodoroSettings, V = Ne?.pomodoroSessions[0], [H, U] = u(1500), [W, G] = u(!1), [K, q] = u(o.Focus), J = he(null), Y = c((e) => me(e, B), [B]), X = c((e) => {
|
|
96
|
+
let t = (R?.completedSessions ?? 0) + 1;
|
|
97
|
+
return s(e, t, B?.sessionsBeforeLongBreak ?? 4);
|
|
98
|
+
}, [B?.sessionsBeforeLongBreak, R?.completedSessions]);
|
|
99
|
+
l(() => {
|
|
100
|
+
if (z || !V?.completed) return;
|
|
101
|
+
let e = s(V.type, R?.completedSessions ?? 0, B?.sessionsBeforeLongBreak ?? 4);
|
|
102
|
+
q(e), U(Y(e));
|
|
103
|
+
}, [
|
|
104
|
+
z,
|
|
105
|
+
Y,
|
|
106
|
+
V,
|
|
107
|
+
B,
|
|
108
|
+
R
|
|
109
|
+
]), l(() => {
|
|
110
|
+
if (z && !z.completed) {
|
|
111
|
+
let e = Math.floor((Date.now() - new Date(z.startTime).getTime()) / 1e3), t = z.duration ?? Y(z.type), n = Math.max(0, t - e);
|
|
112
|
+
U(n), G(n > 0);
|
|
113
|
+
}
|
|
114
|
+
}, [z, Y]);
|
|
115
|
+
let Z = c(async () => {
|
|
116
|
+
if (!(!z || !_) && J.current !== z.id) {
|
|
117
|
+
J.current = z.id;
|
|
118
|
+
try {
|
|
119
|
+
await C({
|
|
120
|
+
variables: {
|
|
121
|
+
id: z.id,
|
|
122
|
+
workspaceId: _
|
|
123
|
+
},
|
|
124
|
+
refetchQueries: [
|
|
125
|
+
"GetActivePomodoroSession",
|
|
126
|
+
"GetPomodoroStats",
|
|
127
|
+
"ListPomodoroSessions"
|
|
128
|
+
],
|
|
129
|
+
awaitRefetchQueries: !0
|
|
130
|
+
});
|
|
131
|
+
let e = X(z.type);
|
|
132
|
+
q(e), U(Y(e)), G(!1);
|
|
133
|
+
} finally {
|
|
134
|
+
J.current = null;
|
|
135
|
+
}
|
|
83
136
|
}
|
|
84
|
-
}, [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
137
|
+
}, [
|
|
138
|
+
z,
|
|
139
|
+
C,
|
|
140
|
+
Y,
|
|
141
|
+
X,
|
|
142
|
+
_
|
|
143
|
+
]);
|
|
144
|
+
l(() => {
|
|
145
|
+
if (H <= 0) {
|
|
146
|
+
G(!1), Z();
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (!W) return;
|
|
150
|
+
let e = window.setTimeout(() => U((e) => Math.max(0, e - 1)), 1e3);
|
|
151
|
+
return () => window.clearTimeout(e);
|
|
152
|
+
}, [
|
|
153
|
+
Z,
|
|
154
|
+
W,
|
|
155
|
+
H
|
|
156
|
+
]);
|
|
157
|
+
let Ke = (e) => {
|
|
92
158
|
let t = Math.floor(e / 60), n = e % 60;
|
|
93
159
|
return `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
94
|
-
},
|
|
95
|
-
if (
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
await E({
|
|
101
|
-
variables: { input: {
|
|
102
|
-
workspaceId: x,
|
|
103
|
-
type: "FOCUS"
|
|
104
|
-
} },
|
|
105
|
-
refetchQueries: ["GetActivePomodoroSession", "GetPomodoroStats"]
|
|
106
|
-
}), X(1500), Q(!0);
|
|
160
|
+
}, Q = c(async () => {
|
|
161
|
+
if (!_) return;
|
|
162
|
+
if (z && !z.completed) {
|
|
163
|
+
G(!0);
|
|
164
|
+
return;
|
|
107
165
|
}
|
|
166
|
+
let e = K;
|
|
167
|
+
await S({
|
|
168
|
+
variables: { input: {
|
|
169
|
+
workspaceId: _,
|
|
170
|
+
type: e
|
|
171
|
+
} },
|
|
172
|
+
refetchQueries: ["GetActivePomodoroSession", "GetPomodoroStats"],
|
|
173
|
+
awaitRefetchQueries: !0
|
|
174
|
+
}), U(Y(e)), G(!0);
|
|
108
175
|
}, [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
176
|
+
_,
|
|
177
|
+
z,
|
|
178
|
+
Y,
|
|
179
|
+
K,
|
|
180
|
+
S
|
|
181
|
+
]), qe = async () => {
|
|
182
|
+
G(!1), z && _ && (await Pe({
|
|
114
183
|
variables: {
|
|
115
|
-
id:
|
|
116
|
-
workspaceId:
|
|
184
|
+
id: z.id,
|
|
185
|
+
workspaceId: _,
|
|
186
|
+
reason: "Reset by user"
|
|
117
187
|
},
|
|
118
|
-
refetchQueries: [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
Q(!1), X(1500);
|
|
188
|
+
refetchQueries: [
|
|
189
|
+
"GetActivePomodoroSession",
|
|
190
|
+
"GetPomodoroStats",
|
|
191
|
+
"ListPomodoroSessions"
|
|
192
|
+
],
|
|
193
|
+
awaitRefetchQueries: !0
|
|
194
|
+
}), q(z.type)), U(Y(z?.type ?? K));
|
|
126
195
|
};
|
|
127
|
-
if (
|
|
196
|
+
if (Te || Oe || je) return /* @__PURE__ */ f(r, {
|
|
128
197
|
title: "Pomodoro Timer",
|
|
129
198
|
description: "Focus with the Pomodoro Technique",
|
|
130
|
-
children: /* @__PURE__ */
|
|
199
|
+
children: /* @__PURE__ */ f(ee, {
|
|
131
200
|
variant: "card",
|
|
132
201
|
count: 3
|
|
133
202
|
})
|
|
134
203
|
});
|
|
135
|
-
if (
|
|
204
|
+
if (Ee || ke || Me) return /* @__PURE__ */ f(r, {
|
|
136
205
|
title: "Pomodoro Timer",
|
|
137
206
|
description: "Focus with the Pomodoro Technique",
|
|
138
|
-
children: /* @__PURE__ */
|
|
207
|
+
children: /* @__PURE__ */ f("div", {
|
|
139
208
|
className: "rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text",
|
|
140
209
|
children: "Failed to load pomodoro data. Please try again later."
|
|
141
210
|
})
|
|
142
211
|
});
|
|
143
|
-
let
|
|
144
|
-
return /* @__PURE__ */
|
|
212
|
+
let Je = Math.floor((R?.totalFocusMinutes ?? 0) / 60), Ye = (R?.totalFocusMinutes ?? 0) % 60, $ = z?.type ?? K, Xe = $ === o.ShortBreak ? z ? "Short Break" : "Short Break Ready" : $ === o.LongBreak ? z ? "Long Break" : "Long Break Ready" : z ? "Focus Session" : "Focus Ready", Ze = $ === o.ShortBreak ? "Start Short Break" : $ === o.LongBreak ? "Start Long Break" : "Start Focus";
|
|
213
|
+
return /* @__PURE__ */ p(r, {
|
|
145
214
|
title: "Pomodoro Timer",
|
|
146
215
|
description: "Focus with the Pomodoro Technique",
|
|
147
|
-
purpose: "Work in focused
|
|
216
|
+
purpose: "Work in focused sprints with prompted short and long breaks — configure a cadence that fits your rhythm and build a deep-work streak you can measure.",
|
|
148
217
|
children: [
|
|
149
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ f(we, {
|
|
150
219
|
storageKey: "timecampus-pomodoro",
|
|
151
220
|
className: "mb-6",
|
|
152
221
|
steps: [
|
|
@@ -154,122 +223,124 @@ function T() {
|
|
|
154
223
|
id: "start",
|
|
155
224
|
label: "Start a focus session",
|
|
156
225
|
description: "Begin a 25-minute sprint on one task.",
|
|
157
|
-
onClick: () =>
|
|
226
|
+
onClick: () => Q()
|
|
158
227
|
},
|
|
159
228
|
{
|
|
160
229
|
id: "analytics",
|
|
161
230
|
label: "Review your pomodoro stats",
|
|
162
231
|
description: "See streaks, completion rate and focus time.",
|
|
163
|
-
onClick: () =>
|
|
232
|
+
onClick: () => v("/pomodoro/analytics")
|
|
164
233
|
},
|
|
165
234
|
{
|
|
166
235
|
id: "settings",
|
|
167
236
|
label: "Tune your intervals",
|
|
168
237
|
description: "Adjust focus and break lengths to fit you.",
|
|
169
|
-
onClick: () =>
|
|
238
|
+
onClick: () => v("/pomodoro/settings")
|
|
170
239
|
}
|
|
171
240
|
]
|
|
172
241
|
}),
|
|
173
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ p("div", {
|
|
174
243
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
175
244
|
children: [
|
|
176
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ f(n, {
|
|
177
246
|
title: "Sessions Today",
|
|
178
|
-
value: String(
|
|
179
|
-
description: `Total: ${
|
|
247
|
+
value: String(R?.completedSessions ?? 0),
|
|
248
|
+
description: `Total: ${R?.totalSessions ?? 0} sessions`
|
|
180
249
|
}),
|
|
181
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ f(n, {
|
|
182
251
|
title: "Focus Time",
|
|
183
|
-
value: `${
|
|
252
|
+
value: `${Je}h ${Ye}m`,
|
|
184
253
|
trend: {
|
|
185
|
-
value:
|
|
254
|
+
value: R?.completionRate ?? 0,
|
|
186
255
|
label: "completion rate"
|
|
187
256
|
}
|
|
188
257
|
}),
|
|
189
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ f(n, {
|
|
190
259
|
title: "Current Streak",
|
|
191
|
-
value: `${
|
|
192
|
-
description: `Avg: ${
|
|
260
|
+
value: `${R?.streakDays ?? 0} days`,
|
|
261
|
+
description: `Avg: ${R?.averageSessionMinutes ?? 0}m per session`
|
|
193
262
|
})
|
|
194
263
|
]
|
|
195
264
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ f("div", {
|
|
197
266
|
className: "mx-auto max-w-md",
|
|
198
|
-
children: /* @__PURE__ */
|
|
267
|
+
children: /* @__PURE__ */ p(m, {
|
|
199
268
|
treatment: "glass",
|
|
200
269
|
glow: !0,
|
|
201
270
|
className: "p-8 text-center",
|
|
202
271
|
children: [
|
|
203
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ f("div", {
|
|
204
273
|
className: "mb-2",
|
|
205
|
-
children: /* @__PURE__ */
|
|
274
|
+
children: /* @__PURE__ */ f("span", {
|
|
275
|
+
"aria-live": "polite",
|
|
206
276
|
className: "inline-flex rounded-full bg-action-primary-bg/10 px-3 py-1 text-xs font-medium text-primary",
|
|
207
|
-
children:
|
|
277
|
+
children: Xe
|
|
208
278
|
})
|
|
209
279
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ f("p", {
|
|
211
281
|
className: "text-7xl font-mono font-bold text-text-primary",
|
|
212
|
-
children:
|
|
282
|
+
children: Ke(H)
|
|
213
283
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ f("p", {
|
|
215
285
|
className: "mt-2 text-sm text-text-secondary",
|
|
216
|
-
children:
|
|
286
|
+
children: R ? `${R.completedSessions} of ${R.totalSessions} sessions` : "No sessions yet"
|
|
217
287
|
}),
|
|
218
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ p("div", {
|
|
219
289
|
className: "mt-6 flex items-center justify-center gap-3",
|
|
220
290
|
children: [
|
|
221
|
-
|
|
222
|
-
onClick: () =>
|
|
291
|
+
W ? /* @__PURE__ */ p("button", {
|
|
292
|
+
onClick: () => G(!1),
|
|
223
293
|
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-6 py-3 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
|
|
224
|
-
children: [/* @__PURE__ */
|
|
225
|
-
}) : /* @__PURE__ */
|
|
226
|
-
onClick:
|
|
294
|
+
children: [/* @__PURE__ */ f(ge, { className: "h-4 w-4" }), "Pause"]
|
|
295
|
+
}) : /* @__PURE__ */ p("button", {
|
|
296
|
+
onClick: Q,
|
|
227
297
|
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-6 py-3 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
|
|
228
|
-
children: [/* @__PURE__ */
|
|
298
|
+
children: [/* @__PURE__ */ f(ve, { className: "h-4 w-4" }), Ze]
|
|
229
299
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
-
onClick:
|
|
232
|
-
|
|
233
|
-
|
|
300
|
+
/* @__PURE__ */ p("button", {
|
|
301
|
+
onClick: Z,
|
|
302
|
+
disabled: !z,
|
|
303
|
+
className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-3 text-sm font-medium text-text-primary hover:bg-bg-sunken/50 disabled:opacity-50",
|
|
304
|
+
children: [/* @__PURE__ */ f(xe, { className: "h-4 w-4" }), "Skip"]
|
|
234
305
|
}),
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
onClick:
|
|
306
|
+
/* @__PURE__ */ p("button", {
|
|
307
|
+
onClick: () => void qe(),
|
|
237
308
|
className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-3 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
309
|
+
children: [/* @__PURE__ */ f(be, { className: "h-4 w-4" }), "Reset"]
|
|
239
310
|
})
|
|
240
311
|
]
|
|
241
312
|
})
|
|
242
313
|
]
|
|
243
314
|
})
|
|
244
315
|
}),
|
|
245
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ p(m, {
|
|
246
317
|
treatment: "glass",
|
|
247
318
|
className: "p-6",
|
|
248
|
-
children: [/* @__PURE__ */
|
|
319
|
+
children: [/* @__PURE__ */ p("div", {
|
|
249
320
|
className: "mb-4 flex items-center justify-between",
|
|
250
|
-
children: [/* @__PURE__ */
|
|
321
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
251
322
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
252
|
-
children: [/* @__PURE__ */
|
|
253
|
-
}), /* @__PURE__ */
|
|
254
|
-
onClick:
|
|
323
|
+
children: [/* @__PURE__ */ f(Se, { className: "h-4 w-4" }), "Focus Goals"]
|
|
324
|
+
}), /* @__PURE__ */ p("button", {
|
|
325
|
+
onClick: He,
|
|
255
326
|
className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
|
|
256
|
-
children: [/* @__PURE__ */
|
|
327
|
+
children: [/* @__PURE__ */ f(ye, { className: "h-4 w-4" }), "Add Goal"]
|
|
257
328
|
})]
|
|
258
|
-
}),
|
|
329
|
+
}), E.length === 0 ? /* @__PURE__ */ f("p", {
|
|
259
330
|
className: "py-6 text-center text-sm text-text-secondary",
|
|
260
331
|
children: "No focus goals yet. Set a daily or weekly target to build a consistent focus habit."
|
|
261
|
-
}) : /* @__PURE__ */
|
|
332
|
+
}) : /* @__PURE__ */ f("div", {
|
|
262
333
|
className: "space-y-3",
|
|
263
|
-
children:
|
|
334
|
+
children: E.map((e) => {
|
|
264
335
|
let t = e.target ? Math.min(100, Math.round(e.current / e.target * 100)) : 0;
|
|
265
|
-
return /* @__PURE__ */
|
|
336
|
+
return /* @__PURE__ */ p("div", {
|
|
266
337
|
className: "rounded-lg border border-border-subtle p-4",
|
|
267
|
-
children: [/* @__PURE__ */
|
|
338
|
+
children: [/* @__PURE__ */ p("div", {
|
|
268
339
|
className: "flex items-center justify-between",
|
|
269
|
-
children: [/* @__PURE__ */
|
|
340
|
+
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("p", {
|
|
270
341
|
className: "text-sm font-medium capitalize text-text-primary",
|
|
271
342
|
children: [e.type.toLowerCase(), " goal"]
|
|
272
|
-
}), /* @__PURE__ */
|
|
343
|
+
}), /* @__PURE__ */ p("p", {
|
|
273
344
|
className: "text-xs text-text-secondary",
|
|
274
345
|
children: [
|
|
275
346
|
e.current,
|
|
@@ -277,30 +348,30 @@ function T() {
|
|
|
277
348
|
e.target,
|
|
278
349
|
" sessions"
|
|
279
350
|
]
|
|
280
|
-
})] }), /* @__PURE__ */
|
|
351
|
+
})] }), /* @__PURE__ */ p("div", {
|
|
281
352
|
className: "flex items-center gap-2",
|
|
282
353
|
children: [
|
|
283
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ p("span", {
|
|
284
355
|
className: "text-sm font-medium text-text-primary",
|
|
285
356
|
children: [t, "%"]
|
|
286
357
|
}),
|
|
287
|
-
/* @__PURE__ */
|
|
288
|
-
onClick: () =>
|
|
358
|
+
/* @__PURE__ */ f("button", {
|
|
359
|
+
onClick: () => Ue(e),
|
|
289
360
|
className: "rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary",
|
|
290
361
|
"aria-label": "Edit goal",
|
|
291
|
-
children: /* @__PURE__ */
|
|
362
|
+
children: /* @__PURE__ */ f(_e, { className: "h-4 w-4" })
|
|
292
363
|
}),
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
onClick: () =>
|
|
364
|
+
/* @__PURE__ */ f("button", {
|
|
365
|
+
onClick: () => P(e),
|
|
295
366
|
className: "rounded-md p-1.5 text-text-secondary hover:bg-status-error-bg hover:text-status-error-text",
|
|
296
367
|
"aria-label": "Delete goal",
|
|
297
|
-
children: /* @__PURE__ */
|
|
368
|
+
children: /* @__PURE__ */ f(Ce, { className: "h-4 w-4" })
|
|
298
369
|
})
|
|
299
370
|
]
|
|
300
371
|
})]
|
|
301
|
-
}), /* @__PURE__ */
|
|
372
|
+
}), /* @__PURE__ */ f("div", {
|
|
302
373
|
className: "mt-3 h-2 w-full rounded-full bg-bg-sunken",
|
|
303
|
-
children: /* @__PURE__ */
|
|
374
|
+
children: /* @__PURE__ */ f("div", {
|
|
304
375
|
className: "h-2 rounded-full bg-action-primary-bg",
|
|
305
376
|
style: { width: `${t}%` }
|
|
306
377
|
})
|
|
@@ -309,115 +380,115 @@ function T() {
|
|
|
309
380
|
})
|
|
310
381
|
})]
|
|
311
382
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
open:
|
|
314
|
-
onClose: () =>
|
|
315
|
-
title:
|
|
383
|
+
/* @__PURE__ */ p(i, {
|
|
384
|
+
open: Ve,
|
|
385
|
+
onClose: () => A(!1),
|
|
386
|
+
title: j ? "Edit Focus Goal" : "Add Focus Goal",
|
|
316
387
|
description: "Set a target number of focus sessions",
|
|
317
|
-
footer: /* @__PURE__ */
|
|
318
|
-
onClick: () =>
|
|
388
|
+
footer: /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("button", {
|
|
389
|
+
onClick: () => A(!1),
|
|
319
390
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
|
|
320
391
|
children: "Cancel"
|
|
321
|
-
}), /* @__PURE__ */
|
|
322
|
-
onClick:
|
|
323
|
-
disabled:
|
|
392
|
+
}), /* @__PURE__ */ f("button", {
|
|
393
|
+
onClick: We,
|
|
394
|
+
disabled: D || O || Number(F.target) <= 0,
|
|
324
395
|
className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
325
|
-
children:
|
|
396
|
+
children: D || O ? "Saving..." : j ? "Save Changes" : "Add Goal"
|
|
326
397
|
})] }),
|
|
327
|
-
children: [(
|
|
398
|
+
children: [(Ie || Re) && /* @__PURE__ */ f("div", {
|
|
328
399
|
className: "mb-4 rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text",
|
|
329
400
|
children: "Failed to save goal. Please try again."
|
|
330
|
-
}), /* @__PURE__ */
|
|
401
|
+
}), /* @__PURE__ */ p("div", {
|
|
331
402
|
className: "space-y-4",
|
|
332
403
|
children: [
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
className:
|
|
404
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
405
|
+
className: g,
|
|
335
406
|
children: "Goal Type"
|
|
336
|
-
}), /* @__PURE__ */
|
|
337
|
-
value:
|
|
407
|
+
}), /* @__PURE__ */ p("select", {
|
|
408
|
+
value: F.type,
|
|
338
409
|
onChange: (e) => {
|
|
339
410
|
let t = e.target.value;
|
|
340
|
-
|
|
411
|
+
I((e) => ({
|
|
341
412
|
...e,
|
|
342
413
|
type: t,
|
|
343
414
|
period: t,
|
|
344
|
-
endDate: t ===
|
|
415
|
+
endDate: t === a.Daily ? y(0) : t === a.Weekly ? y(7) : y(30)
|
|
345
416
|
}));
|
|
346
417
|
},
|
|
347
|
-
className:
|
|
418
|
+
className: h,
|
|
348
419
|
children: [
|
|
349
|
-
/* @__PURE__ */
|
|
350
|
-
value:
|
|
420
|
+
/* @__PURE__ */ f("option", {
|
|
421
|
+
value: a.Daily,
|
|
351
422
|
children: "Daily"
|
|
352
423
|
}),
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
-
value:
|
|
424
|
+
/* @__PURE__ */ f("option", {
|
|
425
|
+
value: a.Weekly,
|
|
355
426
|
children: "Weekly"
|
|
356
427
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
value:
|
|
428
|
+
/* @__PURE__ */ f("option", {
|
|
429
|
+
value: a.Monthly,
|
|
359
430
|
children: "Monthly"
|
|
360
431
|
})
|
|
361
432
|
]
|
|
362
433
|
})] }),
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
className:
|
|
434
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
435
|
+
className: g,
|
|
365
436
|
children: "Target Sessions"
|
|
366
|
-
}), /* @__PURE__ */
|
|
437
|
+
}), /* @__PURE__ */ f("input", {
|
|
367
438
|
type: "number",
|
|
368
439
|
min: "1",
|
|
369
440
|
placeholder: "8",
|
|
370
|
-
value:
|
|
371
|
-
onChange: (e) =>
|
|
372
|
-
className:
|
|
441
|
+
value: F.target,
|
|
442
|
+
onChange: (e) => L("target", e.target.value),
|
|
443
|
+
className: h
|
|
373
444
|
})] }),
|
|
374
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ p("div", {
|
|
375
446
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
376
|
-
children: [/* @__PURE__ */
|
|
377
|
-
className:
|
|
447
|
+
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
448
|
+
className: g,
|
|
378
449
|
children: "Start Date"
|
|
379
|
-
}), /* @__PURE__ */
|
|
450
|
+
}), /* @__PURE__ */ f("input", {
|
|
380
451
|
type: "date",
|
|
381
|
-
value:
|
|
382
|
-
onChange: (e) =>
|
|
383
|
-
className:
|
|
384
|
-
})] }), /* @__PURE__ */
|
|
385
|
-
className:
|
|
452
|
+
value: F.startDate,
|
|
453
|
+
onChange: (e) => L("startDate", e.target.value),
|
|
454
|
+
className: h
|
|
455
|
+
})] }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
456
|
+
className: g,
|
|
386
457
|
children: "End Date"
|
|
387
|
-
}), /* @__PURE__ */
|
|
458
|
+
}), /* @__PURE__ */ f("input", {
|
|
388
459
|
type: "date",
|
|
389
|
-
value:
|
|
390
|
-
onChange: (e) =>
|
|
391
|
-
className:
|
|
460
|
+
value: F.endDate,
|
|
461
|
+
onChange: (e) => L("endDate", e.target.value),
|
|
462
|
+
className: h
|
|
392
463
|
})] })]
|
|
393
464
|
})
|
|
394
465
|
]
|
|
395
466
|
})]
|
|
396
467
|
}),
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
open:
|
|
399
|
-
onClose: () =>
|
|
468
|
+
/* @__PURE__ */ p(i, {
|
|
469
|
+
open: N !== null,
|
|
470
|
+
onClose: () => P(null),
|
|
400
471
|
title: "Delete Focus Goal",
|
|
401
472
|
size: "sm",
|
|
402
|
-
footer: /* @__PURE__ */
|
|
403
|
-
onClick: () =>
|
|
473
|
+
footer: /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("button", {
|
|
474
|
+
onClick: () => P(null),
|
|
404
475
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
|
|
405
476
|
children: "Cancel"
|
|
406
|
-
}), /* @__PURE__ */
|
|
407
|
-
onClick:
|
|
408
|
-
disabled:
|
|
477
|
+
}), /* @__PURE__ */ f("button", {
|
|
478
|
+
onClick: Ge,
|
|
479
|
+
disabled: k,
|
|
409
480
|
className: "rounded-md bg-status-error-bg px-4 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg/90 disabled:opacity-50",
|
|
410
|
-
children:
|
|
481
|
+
children: k ? "Deleting..." : "Delete"
|
|
411
482
|
})] }),
|
|
412
|
-
children: [
|
|
483
|
+
children: [Be && /* @__PURE__ */ f("div", {
|
|
413
484
|
className: "mb-4 rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text",
|
|
414
485
|
children: "Failed to delete goal. Please try again."
|
|
415
|
-
}), /* @__PURE__ */
|
|
486
|
+
}), /* @__PURE__ */ p("p", {
|
|
416
487
|
className: "text-sm text-text-secondary",
|
|
417
488
|
children: [
|
|
418
489
|
"Are you sure you want to delete this",
|
|
419
490
|
" ",
|
|
420
|
-
|
|
491
|
+
N?.type.toLowerCase(),
|
|
421
492
|
" focus goal? This action cannot be undone."
|
|
422
493
|
]
|
|
423
494
|
})]
|
|
@@ -426,6 +497,6 @@ function T() {
|
|
|
426
497
|
});
|
|
427
498
|
}
|
|
428
499
|
//#endregion
|
|
429
|
-
export {
|
|
500
|
+
export { x as PomodoroPage };
|
|
430
501
|
|
|
431
502
|
//# sourceMappingURL=PomodoroPage.js.map
|