@burdenoff/microfe-mybodyshield 2026.706.2 → 2026.713.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/main.d.ts +2 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/generated/global-operations.d.ts +2 -0
- package/dist/generated/global-operations.d.ts.map +1 -0
- package/dist/generated/global-types.d.ts +18199 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +2 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-types.d.ts +43046 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -1
- package/dist/mybodyshield/MyBodyShieldRoot.d.ts +5 -0
- package/dist/mybodyshield/MyBodyShieldRoot.d.ts.map +1 -0
- package/dist/mybodyshield/MyBodyShieldRoutes.d.ts +4 -0
- package/dist/mybodyshield/MyBodyShieldRoutes.d.ts.map +1 -0
- package/dist/mybodyshield/MyBodyShieldRoutes.js +77 -36
- package/dist/mybodyshield/MyBodyShieldRoutes.js.map +1 -1
- package/dist/mybodyshield/components/DataTable.d.ts +28 -0
- package/dist/mybodyshield/components/DataTable.d.ts.map +1 -0
- package/dist/mybodyshield/components/EmptyState.d.ts +18 -0
- package/dist/mybodyshield/components/EmptyState.d.ts.map +1 -0
- package/dist/mybodyshield/components/EvidenceUpload.d.ts +14 -0
- package/dist/mybodyshield/components/EvidenceUpload.d.ts.map +1 -0
- package/dist/mybodyshield/components/FeatureFlagGuard.d.ts +11 -0
- package/dist/mybodyshield/components/FeatureFlagGuard.d.ts.map +1 -0
- package/dist/mybodyshield/components/FeatureFlagGuard.js +27 -0
- package/dist/mybodyshield/components/FeatureFlagGuard.js.map +1 -0
- package/dist/mybodyshield/components/FileLink.d.ts +15 -0
- package/dist/mybodyshield/components/FileLink.d.ts.map +1 -0
- package/dist/mybodyshield/components/FilterTabs.d.ts +18 -0
- package/dist/mybodyshield/components/FilterTabs.d.ts.map +1 -0
- package/dist/mybodyshield/components/MetricsCard.d.ts +23 -0
- package/dist/mybodyshield/components/MetricsCard.d.ts.map +1 -0
- package/dist/mybodyshield/components/MiniBar.d.ts +16 -0
- package/dist/mybodyshield/components/MiniBar.d.ts.map +1 -0
- package/dist/mybodyshield/components/MybDiscussion.d.ts +18 -0
- package/dist/mybodyshield/components/MybDiscussion.d.ts.map +1 -0
- package/dist/mybodyshield/components/MybDiscussion.js +5 -5
- package/dist/mybodyshield/components/MybTags.d.ts +17 -0
- package/dist/mybodyshield/components/MybTags.d.ts.map +1 -0
- package/dist/mybodyshield/components/PageDisabled.d.ts +9 -0
- package/dist/mybodyshield/components/PageDisabled.d.ts.map +1 -0
- package/dist/mybodyshield/components/PageDisabled.js +17 -0
- package/dist/mybodyshield/components/PageDisabled.js.map +1 -0
- package/dist/mybodyshield/components/PageLayout.d.ts +16 -0
- package/dist/mybodyshield/components/PageLayout.d.ts.map +1 -0
- package/dist/mybodyshield/components/Pagination.d.ts +22 -0
- package/dist/mybodyshield/components/Pagination.d.ts.map +1 -0
- package/dist/mybodyshield/components/StateViews.d.ts +25 -0
- package/dist/mybodyshield/components/StateViews.d.ts.map +1 -0
- package/dist/mybodyshield/components/StateViews.js +2 -1
- package/dist/mybodyshield/components/StateViews.js.map +1 -1
- package/dist/mybodyshield/components/StatusBadge.d.ts +9 -0
- package/dist/mybodyshield/components/StatusBadge.d.ts.map +1 -0
- package/dist/mybodyshield/components/Tabs.d.ts +17 -0
- package/dist/mybodyshield/components/Tabs.d.ts.map +1 -0
- package/dist/mybodyshield/components/UserSearchSelect.d.ts +28 -0
- package/dist/mybodyshield/components/UserSearchSelect.d.ts.map +1 -0
- package/dist/mybodyshield/components/index.d.ts +22 -0
- package/dist/mybodyshield/components/index.d.ts.map +1 -0
- package/dist/mybodyshield/components/index.js +4 -2
- package/dist/mybodyshield/context/MyBodyShieldContext.d.ts +16 -0
- package/dist/mybodyshield/context/MyBodyShieldContext.d.ts.map +1 -0
- package/dist/mybodyshield/context/index.d.ts +6 -0
- package/dist/mybodyshield/context/index.d.ts.map +1 -0
- package/dist/mybodyshield/hooks/index.d.ts +12 -0
- package/dist/mybodyshield/hooks/index.d.ts.map +1 -0
- package/dist/mybodyshield/hooks/index.js +1 -0
- package/dist/mybodyshield/hooks/useMyBodyShieldAnalytics.d.ts +21 -0
- package/dist/mybodyshield/hooks/useMyBodyShieldAnalytics.d.ts.map +1 -0
- package/dist/mybodyshield/hooks/useMyBodyShieldAnalytics.js +35 -0
- package/dist/mybodyshield/hooks/useMyBodyShieldAnalytics.js.map +1 -0
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.d.ts +83 -0
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.d.ts.map +1 -0
- package/dist/mybodyshield/hooks/useMybComments.d.ts +36 -0
- package/dist/mybodyshield/hooks/useMybComments.d.ts.map +1 -0
- package/dist/mybodyshield/hooks/useMybFiles.d.ts +47 -0
- package/dist/mybodyshield/hooks/useMybFiles.d.ts.map +1 -0
- package/dist/mybodyshield/hooks/useMybTags.d.ts +44 -0
- package/dist/mybodyshield/hooks/useMybTags.d.ts.map +1 -0
- package/dist/mybodyshield/hooks/useMybUsers.d.ts +27 -0
- package/dist/mybodyshield/hooks/useMybUsers.d.ts.map +1 -0
- package/dist/mybodyshield/hooks/usePager.d.ts +29 -0
- package/dist/mybodyshield/hooks/usePager.d.ts.map +1 -0
- package/dist/mybodyshield/index.d.ts +9 -0
- package/dist/mybodyshield/index.d.ts.map +1 -0
- package/dist/mybodyshield/pages/DashboardPage.d.ts +10 -0
- package/dist/mybodyshield/pages/DashboardPage.d.ts.map +1 -0
- package/dist/mybodyshield/pages/DashboardPage.js +91 -86
- package/dist/mybodyshield/pages/DashboardPage.js.map +1 -1
- package/dist/mybodyshield/pages/_shared/visuals.d.ts +77 -0
- package/dist/mybodyshield/pages/_shared/visuals.d.ts.map +1 -0
- package/dist/mybodyshield/pages/coaching/CoachingPage.d.ts +11 -0
- package/dist/mybodyshield/pages/coaching/CoachingPage.d.ts.map +1 -0
- package/dist/mybodyshield/pages/coaching/CoachingPage.js +60 -60
- package/dist/mybodyshield/pages/goals/GoalsPage.d.ts +11 -0
- package/dist/mybodyshield/pages/goals/GoalsPage.d.ts.map +1 -0
- package/dist/mybodyshield/pages/goals/GoalsPage.js +125 -125
- package/dist/mybodyshield/pages/goals/GoalsPage.js.map +1 -1
- package/dist/mybodyshield/pages/nutrition/NutritionPage.d.ts +13 -0
- package/dist/mybodyshield/pages/nutrition/NutritionPage.d.ts.map +1 -0
- package/dist/mybodyshield/pages/nutrition/NutritionPage.js +129 -129
- package/dist/mybodyshield/pages/nutrition/NutritionPage.js.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramDetailPage.d.ts +10 -0
- package/dist/mybodyshield/pages/programs/ProgramDetailPage.d.ts.map +1 -0
- package/dist/mybodyshield/pages/programs/ProgramDetailPage.js +218 -191
- package/dist/mybodyshield/pages/programs/ProgramDetailPage.js.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramsPage.d.ts +11 -0
- package/dist/mybodyshield/pages/programs/ProgramsPage.d.ts.map +1 -0
- package/dist/mybodyshield/pages/programs/ProgramsPage.js +197 -193
- package/dist/mybodyshield/pages/programs/ProgramsPage.js.map +1 -1
- package/dist/mybodyshield/pages/progress/ProgressPage.d.ts +13 -0
- package/dist/mybodyshield/pages/progress/ProgressPage.d.ts.map +1 -0
- package/dist/mybodyshield/pages/progress/ProgressPage.js +143 -143
- package/dist/mybodyshield/pages/progress/ProgressPage.js.map +1 -1
- package/dist/mybodyshield/pages/recovery/RecoveryPage.d.ts +11 -0
- package/dist/mybodyshield/pages/recovery/RecoveryPage.d.ts.map +1 -0
- package/dist/mybodyshield/pages/recovery/RecoveryPage.js +60 -60
- package/dist/mybodyshield/pages/recovery/RecoveryPage.js.map +1 -1
- package/dist/mybodyshield/pages/train/SessionDetailPage.d.ts +11 -0
- package/dist/mybodyshield/pages/train/SessionDetailPage.d.ts.map +1 -0
- package/dist/mybodyshield/pages/train/SessionDetailPage.js +184 -181
- package/dist/mybodyshield/pages/train/SessionDetailPage.js.map +1 -1
- package/dist/mybodyshield/pages/train/SessionsPage.d.ts +11 -0
- package/dist/mybodyshield/pages/train/SessionsPage.d.ts.map +1 -0
- package/dist/mybodyshield/pages/train/SessionsPage.js +119 -115
- package/dist/mybodyshield/pages/train/SessionsPage.js.map +1 -1
- package/dist/mybodyshield/services/createSandboxAssistantTransport.d.ts +24 -0
- package/dist/mybodyshield/services/createSandboxAssistantTransport.d.ts.map +1 -0
- package/dist/mybodyshield/services/createSandboxAssistantTransport.js +14 -0
- package/dist/mybodyshield/services/createSandboxAssistantTransport.js.map +1 -0
- package/dist/mybodyshield/types/assistant.d.ts +55 -0
- package/dist/mybodyshield/types/assistant.d.ts.map +1 -0
- package/dist/mybodyshield/types/index.d.ts +419 -0
- package/dist/mybodyshield/types/index.d.ts.map +1 -0
- package/dist/mybodyshield/utils/cn.d.ts +4 -0
- package/dist/mybodyshield/utils/cn.d.ts.map +1 -0
- package/dist/mybodyshield/utils/formatters.d.ts +32 -0
- package/dist/mybodyshield/utils/formatters.d.ts.map +1 -0
- package/dist/mybodyshield/utils/i18n.d.ts +6 -0
- package/dist/mybodyshield/utils/i18n.d.ts.map +1 -0
- package/dist/mybodyshield/utils/index.d.ts +9 -0
- package/dist/mybodyshield/utils/index.d.ts.map +1 -0
- package/dist/mybodyshield/utils/navigation.d.ts +14 -0
- package/dist/mybodyshield/utils/navigation.d.ts.map +1 -0
- package/dist/mybodyshield/utils/pageContext.d.ts +28 -0
- package/dist/mybodyshield/utils/pageContext.d.ts.map +1 -0
- package/dist/mybodyshield/utils/pageContext.js +62 -0
- package/dist/mybodyshield/utils/pageContext.js.map +1 -0
- package/package.json +8 -2
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { useOffsetPager as ee } from "../../hooks/usePager.js";
|
|
1
|
+
import { PageLayout as e } from "../../components/PageLayout.js";
|
|
2
|
+
import { MetricsCard as t } from "../../components/MetricsCard.js";
|
|
3
|
+
import { formatDate as n, formatEnumLabel as r, formatNumber as i, formatPercent as a, formatRelativeTime as o } from "../../utils/formatters.js";
|
|
4
|
+
import { StatusBadge as s } from "../../components/StatusBadge.js";
|
|
5
|
+
import { EmptyState as c } from "../../components/EmptyState.js";
|
|
6
|
+
import { ErrorView as l, LoadingView as u } from "../../components/StateViews.js";
|
|
7
|
+
import { FilterTabs as d } from "../../components/FilterTabs.js";
|
|
8
|
+
import { Pagination as f } from "../../components/Pagination.js";
|
|
9
|
+
import { MiniBar as p } from "../../components/MiniBar.js";
|
|
10
|
+
import { useMybAchieveGoal as m, useMybCreateGoal as h, useMybGoals as g, useMybUpdateGoal as _ } from "../../hooks/useMyBodyShieldApi.js";
|
|
11
|
+
import { useOffsetPager as v } from "../../hooks/usePager.js";
|
|
13
12
|
import "../../hooks/index.js";
|
|
14
|
-
import { FilterTabs as S } from "../../components/FilterTabs.js";
|
|
15
|
-
import { Pagination as C } from "../../components/Pagination.js";
|
|
16
13
|
import "../../components/index.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
14
|
+
import { motion as y } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
15
|
+
import { useReducedMotion as b } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
|
|
16
|
+
import { GOAL_TYPE_META as x, IconChip as S, Meter as C, computeGoalProgress as w } from "../_shared/visuals.js";
|
|
17
|
+
import { useMemo as ee, useState as T } from "react";
|
|
18
|
+
import { CalendarClock as E, CheckCircle2 as D, Plus as O, Target as k, TrendingUp as A, Trophy as te } from "lucide-react";
|
|
19
|
+
import { Fragment as ne, jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
20
20
|
import { Button as N, GlassCard as P, Input as F, Label as I, ResponsiveDialog as L, ResponsiveDialogContent as R, ResponsiveDialogDescription as z, ResponsiveDialogFooter as B, ResponsiveDialogHeader as V, ResponsiveDialogTitle as H, Select as U, SelectContent as W, SelectItem as G, SelectTrigger as K, SelectValue as q, Textarea as J } from "@burdenoff/fe-libs/ui";
|
|
21
21
|
//#region src/mybodyshield/pages/goals/GoalsPage.tsx
|
|
22
22
|
var Y = 12, X = 100, re = [
|
|
@@ -56,26 +56,26 @@ var Q = {
|
|
|
56
56
|
description: ""
|
|
57
57
|
};
|
|
58
58
|
function ae({ open: e, onOpenChange: t }) {
|
|
59
|
-
let n =
|
|
60
|
-
e || (
|
|
59
|
+
let n = h(), [i, a] = T(Q), [o, s] = T(null), c = (e) => {
|
|
60
|
+
e || (a(Q), s(null)), t(e);
|
|
61
61
|
}, l = async () => {
|
|
62
|
-
let e =
|
|
62
|
+
let e = i.title.trim();
|
|
63
63
|
if (!e) {
|
|
64
64
|
s("Goal title is required.");
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
s(null);
|
|
68
|
-
let
|
|
68
|
+
let r = {
|
|
69
69
|
title: e,
|
|
70
|
-
type:
|
|
71
|
-
description:
|
|
72
|
-
baselineValue: Z(
|
|
73
|
-
targetValue: Z(
|
|
74
|
-
unit:
|
|
75
|
-
targetDate:
|
|
70
|
+
type: i.type,
|
|
71
|
+
description: i.description.trim() || void 0,
|
|
72
|
+
baselineValue: Z(i.baselineValue),
|
|
73
|
+
targetValue: Z(i.targetValue),
|
|
74
|
+
unit: i.unit.trim() || void 0,
|
|
75
|
+
targetDate: i.targetDate ? new Date(i.targetDate).toISOString() : void 0
|
|
76
76
|
};
|
|
77
77
|
try {
|
|
78
|
-
await n.mutateAsync(
|
|
78
|
+
await n.mutateAsync(r), a(Q), t(!1);
|
|
79
79
|
} catch (e) {
|
|
80
80
|
s(e instanceof Error ? e.message : "Failed to create goal.");
|
|
81
81
|
}
|
|
@@ -100,8 +100,8 @@ function ae({ open: e, onOpenChange: t }) {
|
|
|
100
100
|
children: "Title"
|
|
101
101
|
}), /* @__PURE__ */ j(F, {
|
|
102
102
|
id: "myb-goal-title",
|
|
103
|
-
value:
|
|
104
|
-
onChange: (e) =>
|
|
103
|
+
value: i.title,
|
|
104
|
+
onChange: (e) => a((t) => ({
|
|
105
105
|
...t,
|
|
106
106
|
title: e.target.value
|
|
107
107
|
})),
|
|
@@ -114,8 +114,8 @@ function ae({ open: e, onOpenChange: t }) {
|
|
|
114
114
|
htmlFor: "myb-goal-type",
|
|
115
115
|
children: "Type"
|
|
116
116
|
}), /* @__PURE__ */ M(U, {
|
|
117
|
-
value:
|
|
118
|
-
onValueChange: (e) =>
|
|
117
|
+
value: i.type,
|
|
118
|
+
onValueChange: (e) => a((t) => ({
|
|
119
119
|
...t,
|
|
120
120
|
type: e
|
|
121
121
|
})),
|
|
@@ -124,7 +124,7 @@ function ae({ open: e, onOpenChange: t }) {
|
|
|
124
124
|
children: /* @__PURE__ */ j(q, { placeholder: "Select a goal type" })
|
|
125
125
|
}), /* @__PURE__ */ j(W, { children: ie.map((e) => /* @__PURE__ */ j(G, {
|
|
126
126
|
value: e,
|
|
127
|
-
children:
|
|
127
|
+
children: r(e)
|
|
128
128
|
}, e)) })]
|
|
129
129
|
})]
|
|
130
130
|
}),
|
|
@@ -140,8 +140,8 @@ function ae({ open: e, onOpenChange: t }) {
|
|
|
140
140
|
id: "myb-goal-baseline",
|
|
141
141
|
type: "number",
|
|
142
142
|
inputMode: "decimal",
|
|
143
|
-
value:
|
|
144
|
-
onChange: (e) =>
|
|
143
|
+
value: i.baselineValue,
|
|
144
|
+
onChange: (e) => a((t) => ({
|
|
145
145
|
...t,
|
|
146
146
|
baselineValue: e.target.value
|
|
147
147
|
})),
|
|
@@ -157,8 +157,8 @@ function ae({ open: e, onOpenChange: t }) {
|
|
|
157
157
|
id: "myb-goal-target",
|
|
158
158
|
type: "number",
|
|
159
159
|
inputMode: "decimal",
|
|
160
|
-
value:
|
|
161
|
-
onChange: (e) =>
|
|
160
|
+
value: i.targetValue,
|
|
161
|
+
onChange: (e) => a((t) => ({
|
|
162
162
|
...t,
|
|
163
163
|
targetValue: e.target.value
|
|
164
164
|
})),
|
|
@@ -172,8 +172,8 @@ function ae({ open: e, onOpenChange: t }) {
|
|
|
172
172
|
children: "Unit"
|
|
173
173
|
}), /* @__PURE__ */ j(F, {
|
|
174
174
|
id: "myb-goal-unit",
|
|
175
|
-
value:
|
|
176
|
-
onChange: (e) =>
|
|
175
|
+
value: i.unit,
|
|
176
|
+
onChange: (e) => a((t) => ({
|
|
177
177
|
...t,
|
|
178
178
|
unit: e.target.value
|
|
179
179
|
})),
|
|
@@ -190,8 +190,8 @@ function ae({ open: e, onOpenChange: t }) {
|
|
|
190
190
|
}), /* @__PURE__ */ j(F, {
|
|
191
191
|
id: "myb-goal-date",
|
|
192
192
|
type: "date",
|
|
193
|
-
value:
|
|
194
|
-
onChange: (e) =>
|
|
193
|
+
value: i.targetDate,
|
|
194
|
+
onChange: (e) => a((t) => ({
|
|
195
195
|
...t,
|
|
196
196
|
targetDate: e.target.value
|
|
197
197
|
}))
|
|
@@ -205,8 +205,8 @@ function ae({ open: e, onOpenChange: t }) {
|
|
|
205
205
|
}), /* @__PURE__ */ j(J, {
|
|
206
206
|
id: "myb-goal-desc",
|
|
207
207
|
rows: 3,
|
|
208
|
-
value:
|
|
209
|
-
onChange: (e) =>
|
|
208
|
+
value: i.description,
|
|
209
|
+
onChange: (e) => a((t) => ({
|
|
210
210
|
...t,
|
|
211
211
|
description: e.target.value
|
|
212
212
|
})),
|
|
@@ -229,8 +229,8 @@ function ae({ open: e, onOpenChange: t }) {
|
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
231
|
function oe({ goal: e, onOpenChange: t }) {
|
|
232
|
-
let n =
|
|
233
|
-
e && e.id !== c && (l(e.id),
|
|
232
|
+
let n = _(), [r, a] = T(""), [o, s] = T(null), [c, l] = T(null);
|
|
233
|
+
e && e.id !== c && (l(e.id), a(String(e.currentValue)), s(null));
|
|
234
234
|
let u = async () => {
|
|
235
235
|
if (!e) return;
|
|
236
236
|
let i = Z(r);
|
|
@@ -257,9 +257,9 @@ function oe({ goal: e, onOpenChange: t }) {
|
|
|
257
257
|
e.preventDefault(), u();
|
|
258
258
|
},
|
|
259
259
|
children: [
|
|
260
|
-
|
|
260
|
+
o && /* @__PURE__ */ j("p", {
|
|
261
261
|
className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
262
|
-
children:
|
|
262
|
+
children: o
|
|
263
263
|
}),
|
|
264
264
|
/* @__PURE__ */ M("div", {
|
|
265
265
|
className: "space-y-2",
|
|
@@ -274,14 +274,14 @@ function oe({ goal: e, onOpenChange: t }) {
|
|
|
274
274
|
inputMode: "decimal",
|
|
275
275
|
autoFocus: !0,
|
|
276
276
|
value: r,
|
|
277
|
-
onChange: (e) =>
|
|
277
|
+
onChange: (e) => a(e.target.value),
|
|
278
278
|
placeholder: "0"
|
|
279
279
|
}),
|
|
280
280
|
e && /* @__PURE__ */ M("p", {
|
|
281
281
|
className: "text-xs text-text-tertiary",
|
|
282
282
|
children: [
|
|
283
283
|
"Target: ",
|
|
284
|
-
|
|
284
|
+
i(e.targetValue),
|
|
285
285
|
e.unit ? ` ${e.unit}` : ""
|
|
286
286
|
]
|
|
287
287
|
})
|
|
@@ -307,11 +307,11 @@ var se = [
|
|
|
307
307
|
1,
|
|
308
308
|
.36,
|
|
309
309
|
1
|
|
310
|
-
], $ = ({ index:
|
|
311
|
-
let
|
|
312
|
-
return /* @__PURE__ */ j(
|
|
313
|
-
className:
|
|
314
|
-
initial:
|
|
310
|
+
], $ = ({ index: e = 0, hover: t = !1, className: n, children: r }) => {
|
|
311
|
+
let i = b();
|
|
312
|
+
return /* @__PURE__ */ j(y.div, {
|
|
313
|
+
className: n,
|
|
314
|
+
initial: i ? !1 : {
|
|
315
315
|
opacity: 0,
|
|
316
316
|
y: 12
|
|
317
317
|
},
|
|
@@ -319,31 +319,31 @@ var se = [
|
|
|
319
319
|
opacity: 1,
|
|
320
320
|
y: 0
|
|
321
321
|
},
|
|
322
|
-
transition:
|
|
322
|
+
transition: i ? { duration: 0 } : {
|
|
323
323
|
duration: .35,
|
|
324
|
-
delay: Math.min(
|
|
324
|
+
delay: Math.min(e * .05, .45),
|
|
325
325
|
ease: se
|
|
326
326
|
},
|
|
327
|
-
whileHover:
|
|
328
|
-
children:
|
|
327
|
+
whileHover: i || !t ? void 0 : { y: -4 },
|
|
328
|
+
children: r
|
|
329
329
|
});
|
|
330
330
|
};
|
|
331
|
-
function ce({ goal: e, index: t, onUpdateProgress:
|
|
332
|
-
let d =
|
|
331
|
+
function ce({ goal: e, index: t, onUpdateProgress: c, onAchieve: l, isAchieving: u }) {
|
|
332
|
+
let d = x[e.type], f = d.icon, p = w(e), m = e.unit ? ` ${e.unit}` : "", h = e.status === "ACHIEVED";
|
|
333
333
|
return /* @__PURE__ */ j($, {
|
|
334
334
|
index: t,
|
|
335
335
|
hover: !0,
|
|
336
336
|
className: "h-full",
|
|
337
337
|
children: /* @__PURE__ */ M(P, {
|
|
338
338
|
treatment: "glass",
|
|
339
|
-
glow:
|
|
339
|
+
glow: h,
|
|
340
340
|
className: "flex h-full flex-col gap-3.5 p-5 transition-shadow hover:shadow-[var(--shadow-pop-hover)]",
|
|
341
341
|
children: [
|
|
342
342
|
/* @__PURE__ */ M("div", {
|
|
343
343
|
className: "flex items-start justify-between gap-3",
|
|
344
344
|
children: [/* @__PURE__ */ M("div", {
|
|
345
345
|
className: "flex min-w-0 items-start gap-3",
|
|
346
|
-
children: [/* @__PURE__ */ j(
|
|
346
|
+
children: [/* @__PURE__ */ j(S, {
|
|
347
347
|
icon: /* @__PURE__ */ j(f, { className: "h-4 w-4" }),
|
|
348
348
|
tint: d.tint
|
|
349
349
|
}), /* @__PURE__ */ M("div", {
|
|
@@ -353,10 +353,10 @@ function ce({ goal: e, index: t, onUpdateProgress: n, onAchieve: r, isAchieving:
|
|
|
353
353
|
children: e.title
|
|
354
354
|
}), /* @__PURE__ */ j("span", {
|
|
355
355
|
className: "mt-1 inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
|
|
356
|
-
children:
|
|
356
|
+
children: r(e.type)
|
|
357
357
|
})]
|
|
358
358
|
})]
|
|
359
|
-
}), /* @__PURE__ */ j(
|
|
359
|
+
}), /* @__PURE__ */ j(s, { status: e.status })]
|
|
360
360
|
}),
|
|
361
361
|
e.description && /* @__PURE__ */ j("p", {
|
|
362
362
|
className: "line-clamp-2 text-xs text-text-secondary",
|
|
@@ -370,44 +370,44 @@ function ce({ goal: e, index: t, onUpdateProgress: n, onAchieve: r, isAchieving:
|
|
|
370
370
|
className: "tabular-nums text-sm text-text-secondary",
|
|
371
371
|
children: [/* @__PURE__ */ M("span", {
|
|
372
372
|
className: "font-semibold text-text-primary",
|
|
373
|
-
children: [
|
|
373
|
+
children: [i(e.currentValue), m]
|
|
374
374
|
}), /* @__PURE__ */ M("span", {
|
|
375
375
|
className: "text-text-tertiary",
|
|
376
376
|
children: [
|
|
377
377
|
" ",
|
|
378
378
|
"/ ",
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
i(e.targetValue),
|
|
380
|
+
m
|
|
381
381
|
]
|
|
382
382
|
})]
|
|
383
383
|
}), /* @__PURE__ */ j("span", {
|
|
384
384
|
className: "text-lg font-bold leading-none tabular-nums text-action-primary-bg",
|
|
385
|
-
children:
|
|
385
|
+
children: a(p)
|
|
386
386
|
})]
|
|
387
|
-
}), /* @__PURE__ */ j(
|
|
387
|
+
}), /* @__PURE__ */ j(C, {
|
|
388
388
|
value: p,
|
|
389
389
|
height: 10
|
|
390
390
|
})]
|
|
391
391
|
}),
|
|
392
|
-
(e.targetDate ||
|
|
392
|
+
(e.targetDate || h && e.achievedAt) && /* @__PURE__ */ M("div", {
|
|
393
393
|
className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-text-tertiary",
|
|
394
394
|
children: [e.targetDate && /* @__PURE__ */ M("span", {
|
|
395
395
|
className: "inline-flex items-center gap-1",
|
|
396
396
|
children: [
|
|
397
|
-
/* @__PURE__ */ j(
|
|
397
|
+
/* @__PURE__ */ j(E, { className: "h-3.5 w-3.5" }),
|
|
398
398
|
"Target ",
|
|
399
|
-
|
|
399
|
+
n(e.targetDate),
|
|
400
400
|
/* @__PURE__ */ M("span", {
|
|
401
401
|
className: "text-text-secondary",
|
|
402
|
-
children: ["· ",
|
|
402
|
+
children: ["· ", o(e.targetDate)]
|
|
403
403
|
})
|
|
404
404
|
]
|
|
405
|
-
}),
|
|
405
|
+
}), h && e.achievedAt && /* @__PURE__ */ M("span", {
|
|
406
406
|
className: "inline-flex items-center gap-1 text-status-success-text",
|
|
407
407
|
children: [
|
|
408
|
-
/* @__PURE__ */ j(
|
|
408
|
+
/* @__PURE__ */ j(D, { className: "h-3.5 w-3.5" }),
|
|
409
409
|
"Achieved ",
|
|
410
|
-
|
|
410
|
+
n(e.achievedAt)
|
|
411
411
|
]
|
|
412
412
|
})]
|
|
413
413
|
}),
|
|
@@ -416,11 +416,11 @@ function ce({ goal: e, index: t, onUpdateProgress: n, onAchieve: r, isAchieving:
|
|
|
416
416
|
children: [/* @__PURE__ */ j(N, {
|
|
417
417
|
variant: "outline",
|
|
418
418
|
size: "sm",
|
|
419
|
-
onClick: () =>
|
|
419
|
+
onClick: () => c(e),
|
|
420
420
|
children: "Update progress"
|
|
421
421
|
}), e.status === "ACTIVE" && /* @__PURE__ */ j(N, {
|
|
422
422
|
size: "sm",
|
|
423
|
-
onClick: () =>
|
|
423
|
+
onClick: () => l(e),
|
|
424
424
|
disabled: u,
|
|
425
425
|
children: u ? "Marking…" : "Mark achieved"
|
|
426
426
|
})]
|
|
@@ -430,36 +430,36 @@ function ce({ goal: e, index: t, onUpdateProgress: n, onAchieve: r, isAchieving:
|
|
|
430
430
|
});
|
|
431
431
|
}
|
|
432
432
|
function le() {
|
|
433
|
-
let [
|
|
434
|
-
status:
|
|
433
|
+
let [n, r] = T("ALL"), [o, s] = T(!1), [h, _] = T(null), [y, b] = T(null), [x, S] = T(null), C = v(Y), E = g({
|
|
434
|
+
status: n === "ALL" ? void 0 : n,
|
|
435
435
|
pagination: {
|
|
436
436
|
limit: Y,
|
|
437
|
-
offset:
|
|
437
|
+
offset: C.offset
|
|
438
438
|
}
|
|
439
|
-
}),
|
|
439
|
+
}), D = g({
|
|
440
440
|
status: "ACTIVE",
|
|
441
441
|
pagination: { limit: X }
|
|
442
|
-
}), P =
|
|
442
|
+
}), P = g({
|
|
443
443
|
status: "ACHIEVED",
|
|
444
444
|
pagination: { limit: X }
|
|
445
|
-
}), F =
|
|
446
|
-
|
|
445
|
+
}), F = m(), I = E.data?.items ?? [], L = D.data?.items ?? [], R = P.data?.items ?? [], z = ee(() => L.length === 0 ? 0 : L.reduce((e, t) => e + w(t), 0) / L.length, [L]), B = (e) => {
|
|
446
|
+
r(e), C.reset();
|
|
447
447
|
}, V = async (e) => {
|
|
448
|
-
|
|
448
|
+
b(e.id), S(null);
|
|
449
449
|
try {
|
|
450
450
|
await F.mutateAsync(e.id);
|
|
451
451
|
} catch (e) {
|
|
452
|
-
|
|
452
|
+
S(e instanceof Error ? e.message : "Failed to mark goal as achieved.");
|
|
453
453
|
} finally {
|
|
454
|
-
|
|
454
|
+
b(null);
|
|
455
455
|
}
|
|
456
|
-
}, H =
|
|
457
|
-
return /* @__PURE__ */ M(
|
|
456
|
+
}, H = E.isLoading && !E.data;
|
|
457
|
+
return /* @__PURE__ */ M(e, {
|
|
458
458
|
title: "Goals",
|
|
459
459
|
description: "Targets across training, nutrition and body composition.",
|
|
460
460
|
actions: /* @__PURE__ */ M(N, {
|
|
461
|
-
onClick: () =>
|
|
462
|
-
children: [/* @__PURE__ */ j(
|
|
461
|
+
onClick: () => s(!0),
|
|
462
|
+
children: [/* @__PURE__ */ j(O, { className: "mr-2 h-4 w-4" }), "New goal"]
|
|
463
463
|
}),
|
|
464
464
|
children: [
|
|
465
465
|
/* @__PURE__ */ M("div", {
|
|
@@ -468,20 +468,20 @@ function le() {
|
|
|
468
468
|
/* @__PURE__ */ j($, {
|
|
469
469
|
index: 0,
|
|
470
470
|
className: "h-full",
|
|
471
|
-
children: /* @__PURE__ */ j(
|
|
471
|
+
children: /* @__PURE__ */ j(t, {
|
|
472
472
|
className: "h-full",
|
|
473
|
-
icon: /* @__PURE__ */ j(
|
|
474
|
-
value:
|
|
473
|
+
icon: /* @__PURE__ */ j(k, { className: "h-5 w-5" }),
|
|
474
|
+
value: i(D.data ? L.length : void 0),
|
|
475
475
|
label: "Active goals"
|
|
476
476
|
})
|
|
477
477
|
}),
|
|
478
478
|
/* @__PURE__ */ j($, {
|
|
479
479
|
index: 1,
|
|
480
480
|
className: "h-full",
|
|
481
|
-
children: /* @__PURE__ */ j(
|
|
481
|
+
children: /* @__PURE__ */ j(t, {
|
|
482
482
|
className: "h-full",
|
|
483
|
-
icon: /* @__PURE__ */ j(
|
|
484
|
-
value:
|
|
483
|
+
icon: /* @__PURE__ */ j(te, { className: "h-5 w-5" }),
|
|
484
|
+
value: i(P.data ? R.length : void 0),
|
|
485
485
|
label: "Achieved",
|
|
486
486
|
accent: "success"
|
|
487
487
|
})
|
|
@@ -489,12 +489,12 @@ function le() {
|
|
|
489
489
|
/* @__PURE__ */ j($, {
|
|
490
490
|
index: 2,
|
|
491
491
|
className: "h-full",
|
|
492
|
-
children: /* @__PURE__ */ j(
|
|
492
|
+
children: /* @__PURE__ */ j(t, {
|
|
493
493
|
className: "h-full",
|
|
494
|
-
icon: /* @__PURE__ */ j(
|
|
495
|
-
value:
|
|
494
|
+
icon: /* @__PURE__ */ j(A, { className: "h-5 w-5" }),
|
|
495
|
+
value: D.data ? a(z) : "—",
|
|
496
496
|
label: "Avg progress (active)",
|
|
497
|
-
footer: /* @__PURE__ */ j(
|
|
497
|
+
footer: /* @__PURE__ */ j(p, {
|
|
498
498
|
value: z,
|
|
499
499
|
height: 4,
|
|
500
500
|
barClassName: "bg-action-primary-bg"
|
|
@@ -505,55 +505,55 @@ function le() {
|
|
|
505
505
|
}),
|
|
506
506
|
/* @__PURE__ */ j("div", {
|
|
507
507
|
className: "mt-6",
|
|
508
|
-
children: /* @__PURE__ */ j(
|
|
508
|
+
children: /* @__PURE__ */ j(d, {
|
|
509
509
|
options: re,
|
|
510
|
-
value:
|
|
510
|
+
value: n,
|
|
511
511
|
onChange: B
|
|
512
512
|
})
|
|
513
513
|
}),
|
|
514
|
-
|
|
514
|
+
x && /* @__PURE__ */ j("p", {
|
|
515
515
|
className: "mt-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
516
|
-
children:
|
|
516
|
+
children: x
|
|
517
517
|
}),
|
|
518
518
|
/* @__PURE__ */ j("div", {
|
|
519
519
|
className: "mt-4",
|
|
520
|
-
children: H ? /* @__PURE__ */ j(
|
|
520
|
+
children: H ? /* @__PURE__ */ j(u, { label: "Loading your goals…" }) : E.isError ? /* @__PURE__ */ j(l, {
|
|
521
521
|
message: "We couldn't load your goals.",
|
|
522
|
-
onRetry: () => void
|
|
523
|
-
}) : I.length === 0 ? /* @__PURE__ */ j(
|
|
522
|
+
onRetry: () => void E.refetch()
|
|
523
|
+
}) : I.length === 0 ? /* @__PURE__ */ j(c, {
|
|
524
524
|
illustration: "empty-data",
|
|
525
|
-
icon: /* @__PURE__ */ j(
|
|
526
|
-
title:
|
|
527
|
-
description:
|
|
525
|
+
icon: /* @__PURE__ */ j(k, { className: "h-10 w-10" }),
|
|
526
|
+
title: n === "ALL" ? "No goals yet" : "No goals match this filter",
|
|
527
|
+
description: n === "ALL" ? "Set a goal to give your training and nutrition a clear target to work toward." : "Try a different status filter, or create a new goal.",
|
|
528
528
|
action: /* @__PURE__ */ M(N, {
|
|
529
|
-
onClick: () =>
|
|
530
|
-
children: [/* @__PURE__ */ j(
|
|
529
|
+
onClick: () => s(!0),
|
|
530
|
+
children: [/* @__PURE__ */ j(O, { className: "mr-2 h-4 w-4" }), "New goal"]
|
|
531
531
|
})
|
|
532
|
-
}) : /* @__PURE__ */ M(
|
|
532
|
+
}) : /* @__PURE__ */ M(ne, { children: [/* @__PURE__ */ j("div", {
|
|
533
533
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
534
534
|
children: I.map((e, t) => /* @__PURE__ */ j(ce, {
|
|
535
535
|
goal: e,
|
|
536
536
|
index: t,
|
|
537
|
-
onUpdateProgress:
|
|
537
|
+
onUpdateProgress: _,
|
|
538
538
|
onAchieve: (e) => void V(e),
|
|
539
|
-
isAchieving:
|
|
539
|
+
isAchieving: y === e.id
|
|
540
540
|
}, e.id))
|
|
541
|
-
}), /* @__PURE__ */ j(
|
|
542
|
-
page:
|
|
541
|
+
}), /* @__PURE__ */ j(f, {
|
|
542
|
+
page: C.page,
|
|
543
543
|
pageSize: Y,
|
|
544
544
|
itemCount: I.length,
|
|
545
|
-
hasMore:
|
|
546
|
-
onPageChange: (e) =>
|
|
545
|
+
hasMore: E.data?.pageInfo?.hasMore ?? !1,
|
|
546
|
+
onPageChange: (e) => C.onPageChange(e)
|
|
547
547
|
})] })
|
|
548
548
|
}),
|
|
549
549
|
/* @__PURE__ */ j(ae, {
|
|
550
|
-
open:
|
|
551
|
-
onOpenChange:
|
|
550
|
+
open: o,
|
|
551
|
+
onOpenChange: s
|
|
552
552
|
}),
|
|
553
553
|
/* @__PURE__ */ j(oe, {
|
|
554
|
-
goal:
|
|
554
|
+
goal: h,
|
|
555
555
|
onOpenChange: (e) => {
|
|
556
|
-
e ||
|
|
556
|
+
e || _(null);
|
|
557
557
|
}
|
|
558
558
|
})
|
|
559
559
|
]
|