@burdenoff/microfe-mybodyshield 2026.716.1 → 2026.720.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/mybodyshield/data/programTemplates.d.ts +23 -0
- package/dist/mybodyshield/data/programTemplates.d.ts.map +1 -0
- package/dist/mybodyshield/data/programTemplates.js +212 -0
- package/dist/mybodyshield/data/programTemplates.js.map +1 -0
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.d.ts +54 -5
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.d.ts.map +1 -1
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.js +101 -43
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.js.map +1 -1
- package/dist/mybodyshield/pages/DashboardPage.js +1 -1
- package/dist/mybodyshield/pages/DashboardPage.js.map +1 -1
- package/dist/mybodyshield/pages/coaching/CoachingPage.js +1 -1
- package/dist/mybodyshield/pages/coaching/CoachingPage.js.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramsPage.js +169 -121
- package/dist/mybodyshield/pages/programs/ProgramsPage.js.map +1 -1
- package/dist/mybodyshield/pages/recovery/RecoveryPage.js +1 -1
- package/dist/mybodyshield/pages/recovery/RecoveryPage.js.map +1 -1
- package/dist/mybodyshield/pages/train/SessionDetailPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/train/SessionDetailPage.js +438 -266
- package/dist/mybodyshield/pages/train/SessionDetailPage.js.map +1 -1
- package/dist/mybodyshield/types/assistant.d.ts.map +1 -1
- package/dist/mybodyshield/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -4,47 +4,48 @@ import { MetricsCard as n } from "../../components/MetricsCard.js";
|
|
|
4
4
|
import { formatEnumLabel as r, formatNumber as i, formatRelativeTime as a } from "../../utils/formatters.js";
|
|
5
5
|
import { StatusBadge as o } from "../../components/StatusBadge.js";
|
|
6
6
|
import { EmptyState as s } from "../../components/EmptyState.js";
|
|
7
|
-
import { ErrorView as
|
|
8
|
-
import { FilterTabs as
|
|
9
|
-
import { Pagination as
|
|
7
|
+
import { ErrorView as ee, LoadingView as c } from "../../components/StateViews.js";
|
|
8
|
+
import { FilterTabs as te } from "../../components/FilterTabs.js";
|
|
9
|
+
import { Pagination as ne } from "../../components/Pagination.js";
|
|
10
10
|
import "../../context/index.js";
|
|
11
|
-
import { useMybCreateProgram as
|
|
12
|
-
import { useOffsetPager as
|
|
13
|
-
import { useMyBodyShieldAnalytics as
|
|
11
|
+
import { useMybAddWorkout as re, useMybCreateProgram as ie, useMybPrograms as l } from "../../hooks/useMyBodyShieldApi.js";
|
|
12
|
+
import { useOffsetPager as ae } from "../../hooks/usePager.js";
|
|
13
|
+
import { useMyBodyShieldAnalytics as oe } from "../../hooks/useMyBodyShieldAnalytics.js";
|
|
14
14
|
import "../../hooks/index.js";
|
|
15
15
|
import "../../components/index.js";
|
|
16
|
-
import { motion as
|
|
17
|
-
import { useReducedMotion as
|
|
18
|
-
import { GOAL_TYPE_META as
|
|
16
|
+
import { motion as u } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
17
|
+
import { useReducedMotion as d } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
|
|
18
|
+
import { GOAL_TYPE_META as f, IconChip as p } from "../_shared/visuals.js";
|
|
19
|
+
import { PROGRAM_TEMPLATES as se, findProgramTemplate as m } from "../../data/programTemplates.js";
|
|
19
20
|
import { useMemo as h, useState as g } from "react";
|
|
20
|
-
import { Clock as _, Dumbbell as v, FilePenLine as
|
|
21
|
+
import { Clock as _, Dumbbell as v, FilePenLine as ce, Layers as le, Plus as y } from "lucide-react";
|
|
21
22
|
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
22
|
-
import { Button as S, GlassCard as C, Input as w, Label as T, ResponsiveDialog as
|
|
23
|
+
import { Button as S, GlassCard as C, Input as w, Label as T, ResponsiveDialog as ue, ResponsiveDialogContent as de, ResponsiveDialogDescription as fe, ResponsiveDialogFooter as pe, ResponsiveDialogHeader as me, ResponsiveDialogTitle as he, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A, Textarea as ge } from "@burdenoff/fe-libs/ui";
|
|
23
24
|
//#region src/mybodyshield/pages/programs/ProgramsPage.tsx
|
|
24
|
-
var
|
|
25
|
+
var j = "blank", M = 24, _e = [
|
|
25
26
|
"ALL",
|
|
26
27
|
"DRAFT",
|
|
27
28
|
"ACTIVE",
|
|
28
29
|
"COMPLETED",
|
|
29
30
|
"ARCHIVED"
|
|
30
|
-
],
|
|
31
|
+
], N = [
|
|
31
32
|
"WEIGHT_LOSS",
|
|
32
33
|
"MUSCLE_GAIN",
|
|
33
34
|
"STRENGTH",
|
|
34
35
|
"ENDURANCE",
|
|
35
36
|
"MOBILITY",
|
|
36
37
|
"GENERAL_FITNESS"
|
|
37
|
-
],
|
|
38
|
+
], ve = [
|
|
38
39
|
"BEGINNER",
|
|
39
40
|
"INTERMEDIATE",
|
|
40
41
|
"ADVANCED",
|
|
41
42
|
"ELITE"
|
|
42
|
-
],
|
|
43
|
+
], ye = [
|
|
43
44
|
"BUILD",
|
|
44
45
|
"PEAK",
|
|
45
46
|
"DELOAD",
|
|
46
47
|
"MAINTENANCE"
|
|
47
|
-
],
|
|
48
|
+
], P = {
|
|
48
49
|
name: "",
|
|
49
50
|
description: "",
|
|
50
51
|
goalType: "GENERAL_FITNESS",
|
|
@@ -53,19 +54,19 @@ var P = 24, de = [
|
|
|
53
54
|
weeks: "",
|
|
54
55
|
daysPerWeek: "",
|
|
55
56
|
startDate: ""
|
|
56
|
-
},
|
|
57
|
+
}, F = (e) => {
|
|
57
58
|
let t = e.trim();
|
|
58
59
|
if (t === "") return null;
|
|
59
60
|
let n = Number(t);
|
|
60
61
|
return Number.isFinite(n) ? n : null;
|
|
61
|
-
},
|
|
62
|
+
}, I = [
|
|
62
63
|
.22,
|
|
63
64
|
1,
|
|
64
65
|
.36,
|
|
65
66
|
1
|
|
66
|
-
],
|
|
67
|
-
let i =
|
|
68
|
-
return /* @__PURE__ */ b(
|
|
67
|
+
], L = ({ index: e = 0, hover: t = !1, className: n, children: r }) => {
|
|
68
|
+
let i = d();
|
|
69
|
+
return /* @__PURE__ */ b(u.div, {
|
|
69
70
|
className: n,
|
|
70
71
|
initial: i ? !1 : {
|
|
71
72
|
opacity: 0,
|
|
@@ -78,32 +79,32 @@ var P = 24, de = [
|
|
|
78
79
|
transition: i ? { duration: 0 } : {
|
|
79
80
|
duration: .35,
|
|
80
81
|
delay: Math.min(e * .05, .45),
|
|
81
|
-
ease:
|
|
82
|
+
ease: I
|
|
82
83
|
},
|
|
83
84
|
whileHover: i || !t ? void 0 : { y: -4 },
|
|
84
85
|
children: r
|
|
85
86
|
});
|
|
86
87
|
};
|
|
87
|
-
function
|
|
88
|
-
return /* @__PURE__ */ x(
|
|
88
|
+
function R({ id: e, value: t, onChange: n, options: i }) {
|
|
89
|
+
return /* @__PURE__ */ x(E, {
|
|
89
90
|
value: t,
|
|
90
91
|
onValueChange: (e) => n(e),
|
|
91
|
-
children: [/* @__PURE__ */ b(
|
|
92
|
+
children: [/* @__PURE__ */ b(k, {
|
|
92
93
|
id: e,
|
|
93
|
-
children: /* @__PURE__ */ b(
|
|
94
|
-
}), /* @__PURE__ */ b(
|
|
94
|
+
children: /* @__PURE__ */ b(A, {})
|
|
95
|
+
}), /* @__PURE__ */ b(D, { children: i.map((e) => /* @__PURE__ */ b(O, {
|
|
95
96
|
value: e,
|
|
96
97
|
children: r(e)
|
|
97
98
|
}, e)) })]
|
|
98
99
|
});
|
|
99
100
|
}
|
|
100
|
-
function
|
|
101
|
-
let s =
|
|
101
|
+
function be({ program: e, index: t, onOpen: n }) {
|
|
102
|
+
let s = f[e.goalType], ee = s.icon, c = [
|
|
102
103
|
e.phase,
|
|
103
104
|
e.level,
|
|
104
105
|
e.goalType
|
|
105
106
|
].map((e) => r(e)).join(" · ");
|
|
106
|
-
return /* @__PURE__ */ b(
|
|
107
|
+
return /* @__PURE__ */ b(L, {
|
|
107
108
|
index: t,
|
|
108
109
|
hover: !0,
|
|
109
110
|
className: "h-full",
|
|
@@ -119,8 +120,8 @@ function me({ program: e, index: t, onOpen: n }) {
|
|
|
119
120
|
className: "flex items-start justify-between gap-3",
|
|
120
121
|
children: [/* @__PURE__ */ x("div", {
|
|
121
122
|
className: "flex min-w-0 items-start gap-3",
|
|
122
|
-
children: [/* @__PURE__ */ b(
|
|
123
|
-
icon: /* @__PURE__ */ b(
|
|
123
|
+
children: [/* @__PURE__ */ b(p, {
|
|
124
|
+
icon: /* @__PURE__ */ b(ee, { className: "h-4 w-4" }),
|
|
124
125
|
tint: s.tint
|
|
125
126
|
}), /* @__PURE__ */ x("div", {
|
|
126
127
|
className: "min-w-0",
|
|
@@ -129,7 +130,7 @@ function me({ program: e, index: t, onOpen: n }) {
|
|
|
129
130
|
children: e.name
|
|
130
131
|
}), /* @__PURE__ */ b("p", {
|
|
131
132
|
className: "mt-0.5 truncate text-xs text-text-tertiary",
|
|
132
|
-
children:
|
|
133
|
+
children: c
|
|
133
134
|
})]
|
|
134
135
|
})]
|
|
135
136
|
}), /* @__PURE__ */ b(o, { status: e.status })]
|
|
@@ -166,8 +167,8 @@ function me({ program: e, index: t, onOpen: n }) {
|
|
|
166
167
|
})
|
|
167
168
|
});
|
|
168
169
|
}
|
|
169
|
-
function
|
|
170
|
-
let { navigateTo: a, workspaceId: o } = e(),
|
|
170
|
+
function z() {
|
|
171
|
+
let { navigateTo: a, workspaceId: o } = e(), u = ae(M), d = oe(), [f, p] = g("ALL"), [_, C] = g("ALL"), [I, z] = g(!1), [B, V] = g(P), [H, U] = g(j), [W, G] = g(null), K = ie(), q = re(), xe = l({ pagination: { limit: 100 } }), J = h(() => xe.data?.items ?? [], [xe.data]), Y = h(() => {
|
|
171
172
|
let e = (e) => J.filter((t) => t.status === e).length;
|
|
172
173
|
return {
|
|
173
174
|
ALL: J.length,
|
|
@@ -176,43 +177,63 @@ function V() {
|
|
|
176
177
|
COMPLETED: e("COMPLETED"),
|
|
177
178
|
ARCHIVED: e("ARCHIVED")
|
|
178
179
|
};
|
|
179
|
-
}, [J]), X =
|
|
180
|
-
status:
|
|
180
|
+
}, [J]), X = l({
|
|
181
|
+
status: f === "ALL" ? void 0 : f,
|
|
181
182
|
pagination: {
|
|
182
|
-
limit:
|
|
183
|
-
offset:
|
|
183
|
+
limit: M,
|
|
184
|
+
offset: u.offset
|
|
184
185
|
}
|
|
185
|
-
}), Z = X.data?.items ?? [], Q = _ === "ALL" ? Z : Z.filter((e) => e.goalType === _),
|
|
186
|
-
|
|
187
|
-
},
|
|
188
|
-
C(e),
|
|
186
|
+
}), Z = X.data?.items ?? [], Q = _ === "ALL" ? Z : Z.filter((e) => e.goalType === _), Se = (e) => {
|
|
187
|
+
p(e), u.reset();
|
|
188
|
+
}, Ce = (e) => {
|
|
189
|
+
C(e), u.reset();
|
|
189
190
|
}, $ = () => {
|
|
190
|
-
U(
|
|
191
|
-
},
|
|
192
|
-
if (
|
|
191
|
+
V(P), U(j), G(null), z(!0), d.emitIntent("program", "create", { workspaceId: o });
|
|
192
|
+
}, we = (e) => {
|
|
193
|
+
if (U(e), e === j) return;
|
|
194
|
+
let t = m(e);
|
|
195
|
+
t && V({
|
|
196
|
+
name: t.name,
|
|
197
|
+
description: t.description,
|
|
198
|
+
goalType: t.goalType,
|
|
199
|
+
level: t.level,
|
|
200
|
+
phase: "BUILD",
|
|
201
|
+
weeks: String(t.weeks),
|
|
202
|
+
daysPerWeek: String(t.daysPerWeek),
|
|
203
|
+
startDate: ""
|
|
204
|
+
});
|
|
205
|
+
}, Te = async () => {
|
|
206
|
+
if (!B.name.trim()) {
|
|
193
207
|
G("Program name is required.");
|
|
194
208
|
return;
|
|
195
209
|
}
|
|
196
210
|
let e = {
|
|
197
|
-
name:
|
|
198
|
-
description:
|
|
199
|
-
goalType:
|
|
200
|
-
level:
|
|
201
|
-
phase:
|
|
202
|
-
weeks:
|
|
203
|
-
daysPerWeek:
|
|
204
|
-
startDate:
|
|
211
|
+
name: B.name.trim(),
|
|
212
|
+
description: B.description.trim() || null,
|
|
213
|
+
goalType: B.goalType,
|
|
214
|
+
level: B.level,
|
|
215
|
+
phase: B.phase,
|
|
216
|
+
weeks: F(B.weeks),
|
|
217
|
+
daysPerWeek: F(B.daysPerWeek),
|
|
218
|
+
startDate: B.startDate ? new Date(B.startDate).toISOString() : null
|
|
205
219
|
};
|
|
206
220
|
try {
|
|
207
|
-
let t = await K.mutateAsync(e);
|
|
208
|
-
|
|
221
|
+
let t = await K.mutateAsync(e), n = H === j ? void 0 : m(H);
|
|
222
|
+
n && await Promise.allSettled(n.workouts.map((e) => q.mutateAsync({
|
|
223
|
+
programId: t.id,
|
|
224
|
+
name: e.name,
|
|
225
|
+
type: e.type,
|
|
226
|
+
dayOfWeek: e.dayOfWeek,
|
|
227
|
+
weekNumber: e.weekNumber,
|
|
228
|
+
durationMin: e.durationMin
|
|
229
|
+
}))), d.emitFact("program", "created", {
|
|
209
230
|
workspaceId: o,
|
|
210
231
|
entityId: t.id
|
|
211
|
-
}),
|
|
232
|
+
}), z(!1), a(`programs/${t.id}`);
|
|
212
233
|
} catch (e) {
|
|
213
234
|
G(e instanceof Error ? e.message : "Failed to create program.");
|
|
214
235
|
}
|
|
215
|
-
},
|
|
236
|
+
}, Ee = _e.map((e) => ({
|
|
216
237
|
value: e,
|
|
217
238
|
label: e === "ALL" ? "All" : r(e),
|
|
218
239
|
count: Y[e]
|
|
@@ -228,7 +249,7 @@ function V() {
|
|
|
228
249
|
/* @__PURE__ */ x("div", {
|
|
229
250
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
230
251
|
children: [
|
|
231
|
-
/* @__PURE__ */ b(
|
|
252
|
+
/* @__PURE__ */ b(L, {
|
|
232
253
|
index: 0,
|
|
233
254
|
className: "h-full",
|
|
234
255
|
children: /* @__PURE__ */ b(n, {
|
|
@@ -239,22 +260,22 @@ function V() {
|
|
|
239
260
|
accent: "success"
|
|
240
261
|
})
|
|
241
262
|
}),
|
|
242
|
-
/* @__PURE__ */ b(
|
|
263
|
+
/* @__PURE__ */ b(L, {
|
|
243
264
|
index: 1,
|
|
244
265
|
className: "h-full",
|
|
245
266
|
children: /* @__PURE__ */ b(n, {
|
|
246
267
|
className: "h-full",
|
|
247
|
-
icon: /* @__PURE__ */ b(
|
|
268
|
+
icon: /* @__PURE__ */ b(ce, { className: "h-5 w-5" }),
|
|
248
269
|
value: i(Y.DRAFT),
|
|
249
270
|
label: "Draft programs"
|
|
250
271
|
})
|
|
251
272
|
}),
|
|
252
|
-
/* @__PURE__ */ b(
|
|
273
|
+
/* @__PURE__ */ b(L, {
|
|
253
274
|
index: 2,
|
|
254
275
|
className: "h-full",
|
|
255
276
|
children: /* @__PURE__ */ b(n, {
|
|
256
277
|
className: "h-full",
|
|
257
|
-
icon: /* @__PURE__ */ b(
|
|
278
|
+
icon: /* @__PURE__ */ b(le, { className: "h-5 w-5" }),
|
|
258
279
|
value: i(Y.ALL),
|
|
259
280
|
label: "Total programs"
|
|
260
281
|
})
|
|
@@ -263,10 +284,10 @@ function V() {
|
|
|
263
284
|
}),
|
|
264
285
|
/* @__PURE__ */ x("div", {
|
|
265
286
|
className: "mt-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
266
|
-
children: [/* @__PURE__ */ b(
|
|
267
|
-
options:
|
|
268
|
-
value:
|
|
269
|
-
onChange:
|
|
287
|
+
children: [/* @__PURE__ */ b(te, {
|
|
288
|
+
options: Ee,
|
|
289
|
+
value: f,
|
|
290
|
+
onChange: Se
|
|
270
291
|
}), /* @__PURE__ */ x("div", {
|
|
271
292
|
className: "flex items-center gap-2",
|
|
272
293
|
children: [/* @__PURE__ */ b("span", {
|
|
@@ -274,13 +295,13 @@ function V() {
|
|
|
274
295
|
children: "Goal"
|
|
275
296
|
}), /* @__PURE__ */ b("div", {
|
|
276
297
|
className: "w-48",
|
|
277
|
-
children: /* @__PURE__ */ x(
|
|
298
|
+
children: /* @__PURE__ */ x(E, {
|
|
278
299
|
value: _,
|
|
279
|
-
onValueChange: (e) =>
|
|
280
|
-
children: [/* @__PURE__ */ b(
|
|
300
|
+
onValueChange: (e) => Ce(e),
|
|
301
|
+
children: [/* @__PURE__ */ b(k, { children: /* @__PURE__ */ b(A, {}) }), /* @__PURE__ */ x(D, { children: [/* @__PURE__ */ b(O, {
|
|
281
302
|
value: "ALL",
|
|
282
303
|
children: "All goals"
|
|
283
|
-
}),
|
|
304
|
+
}), N.map((e) => /* @__PURE__ */ b(O, {
|
|
284
305
|
value: e,
|
|
285
306
|
children: r(e)
|
|
286
307
|
}, e))] })]
|
|
@@ -290,13 +311,13 @@ function V() {
|
|
|
290
311
|
}),
|
|
291
312
|
/* @__PURE__ */ x("div", {
|
|
292
313
|
className: "mt-6",
|
|
293
|
-
children: [X.isLoading ? /* @__PURE__ */ b(
|
|
314
|
+
children: [X.isLoading ? /* @__PURE__ */ b(c, { label: "Loading programs…" }) : X.isError ? /* @__PURE__ */ b(ee, {
|
|
294
315
|
message: "We couldn't load your programs.",
|
|
295
316
|
onRetry: () => void X.refetch()
|
|
296
317
|
}) : Z.length === 0 ? /* @__PURE__ */ b(s, {
|
|
297
318
|
illustration: "empty-data",
|
|
298
319
|
icon: /* @__PURE__ */ b(v, { className: "h-10 w-10" }),
|
|
299
|
-
title:
|
|
320
|
+
title: f === "ALL" ? "No programs yet" : "No programs in this status",
|
|
300
321
|
description: "Create a structured training program to plan your workouts week by week.",
|
|
301
322
|
action: /* @__PURE__ */ x(S, {
|
|
302
323
|
onClick: $,
|
|
@@ -315,26 +336,26 @@ function V() {
|
|
|
315
336
|
]
|
|
316
337
|
}) : /* @__PURE__ */ b("div", {
|
|
317
338
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
318
|
-
children: Q.map((e, t) => /* @__PURE__ */ b(
|
|
339
|
+
children: Q.map((e, t) => /* @__PURE__ */ b(be, {
|
|
319
340
|
program: e,
|
|
320
341
|
index: t,
|
|
321
342
|
onOpen: (e) => a(`programs/${e}`)
|
|
322
343
|
}, e.id))
|
|
323
|
-
}), !X.isLoading && !X.isError && Z.length > 0 && /* @__PURE__ */ b(
|
|
324
|
-
page:
|
|
325
|
-
pageSize:
|
|
344
|
+
}), !X.isLoading && !X.isError && Z.length > 0 && /* @__PURE__ */ b(ne, {
|
|
345
|
+
page: u.page,
|
|
346
|
+
pageSize: M,
|
|
326
347
|
itemCount: Z.length,
|
|
327
348
|
hasMore: X.data?.pageInfo?.hasMore ?? !1,
|
|
328
|
-
onPageChange: (e) =>
|
|
349
|
+
onPageChange: (e) => u.onPageChange(e)
|
|
329
350
|
})]
|
|
330
351
|
}),
|
|
331
|
-
/* @__PURE__ */ b(
|
|
332
|
-
open:
|
|
333
|
-
onOpenChange:
|
|
334
|
-
children: /* @__PURE__ */ x(
|
|
352
|
+
/* @__PURE__ */ b(ue, {
|
|
353
|
+
open: I,
|
|
354
|
+
onOpenChange: z,
|
|
355
|
+
children: /* @__PURE__ */ x(de, {
|
|
335
356
|
className: "sm:max-w-lg",
|
|
336
357
|
children: [
|
|
337
|
-
/* @__PURE__ */ x(
|
|
358
|
+
/* @__PURE__ */ x(me, { children: [/* @__PURE__ */ b(he, { children: "New program" }), /* @__PURE__ */ b(fe, { children: "Define a structured training block. You can add workouts & exercises after creating it." })] }),
|
|
338
359
|
/* @__PURE__ */ x("div", {
|
|
339
360
|
className: "space-y-4 py-2",
|
|
340
361
|
children: [
|
|
@@ -342,6 +363,33 @@ function V() {
|
|
|
342
363
|
className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
343
364
|
children: W
|
|
344
365
|
}),
|
|
366
|
+
/* @__PURE__ */ x("div", {
|
|
367
|
+
className: "space-y-1.5",
|
|
368
|
+
children: [
|
|
369
|
+
/* @__PURE__ */ b(T, {
|
|
370
|
+
htmlFor: "myb-prog-template",
|
|
371
|
+
children: "Start from a template"
|
|
372
|
+
}),
|
|
373
|
+
/* @__PURE__ */ x(E, {
|
|
374
|
+
value: H,
|
|
375
|
+
onValueChange: we,
|
|
376
|
+
children: [/* @__PURE__ */ b(k, {
|
|
377
|
+
id: "myb-prog-template",
|
|
378
|
+
children: /* @__PURE__ */ b(A, {})
|
|
379
|
+
}), /* @__PURE__ */ x(D, { children: [/* @__PURE__ */ b(O, {
|
|
380
|
+
value: j,
|
|
381
|
+
children: "Blank program"
|
|
382
|
+
}), se.map((e) => /* @__PURE__ */ b(O, {
|
|
383
|
+
value: e.id,
|
|
384
|
+
children: e.name
|
|
385
|
+
}, e.id))] })]
|
|
386
|
+
}),
|
|
387
|
+
H !== j && /* @__PURE__ */ b("p", {
|
|
388
|
+
className: "text-xs text-text-tertiary",
|
|
389
|
+
children: "Fields below are pre-filled from the template and seed a starter week of workouts — edit anything before creating."
|
|
390
|
+
})
|
|
391
|
+
]
|
|
392
|
+
}),
|
|
345
393
|
/* @__PURE__ */ x("div", {
|
|
346
394
|
className: "space-y-1.5",
|
|
347
395
|
children: [/* @__PURE__ */ b(T, {
|
|
@@ -349,9 +397,9 @@ function V() {
|
|
|
349
397
|
children: "Name"
|
|
350
398
|
}), /* @__PURE__ */ b(w, {
|
|
351
399
|
id: "myb-prog-name",
|
|
352
|
-
value:
|
|
353
|
-
onChange: (e) =>
|
|
354
|
-
...
|
|
400
|
+
value: B.name,
|
|
401
|
+
onChange: (e) => V({
|
|
402
|
+
...B,
|
|
355
403
|
name: e.target.value
|
|
356
404
|
}),
|
|
357
405
|
placeholder: "e.g. Hypertrophy Block A"
|
|
@@ -362,12 +410,12 @@ function V() {
|
|
|
362
410
|
children: [/* @__PURE__ */ b(T, {
|
|
363
411
|
htmlFor: "myb-prog-desc",
|
|
364
412
|
children: "Description"
|
|
365
|
-
}), /* @__PURE__ */ b(
|
|
413
|
+
}), /* @__PURE__ */ b(ge, {
|
|
366
414
|
id: "myb-prog-desc",
|
|
367
415
|
rows: 3,
|
|
368
|
-
value:
|
|
369
|
-
onChange: (e) =>
|
|
370
|
-
...
|
|
416
|
+
value: B.description,
|
|
417
|
+
onChange: (e) => V({
|
|
418
|
+
...B,
|
|
371
419
|
description: e.target.value
|
|
372
420
|
}),
|
|
373
421
|
placeholder: "Focus, progression scheme, notes…"
|
|
@@ -381,14 +429,14 @@ function V() {
|
|
|
381
429
|
children: [/* @__PURE__ */ b(T, {
|
|
382
430
|
htmlFor: "myb-prog-goal",
|
|
383
431
|
children: "Goal type"
|
|
384
|
-
}), /* @__PURE__ */ b(
|
|
432
|
+
}), /* @__PURE__ */ b(R, {
|
|
385
433
|
id: "myb-prog-goal",
|
|
386
|
-
value:
|
|
387
|
-
onChange: (e) =>
|
|
388
|
-
...
|
|
434
|
+
value: B.goalType,
|
|
435
|
+
onChange: (e) => V({
|
|
436
|
+
...B,
|
|
389
437
|
goalType: e
|
|
390
438
|
}),
|
|
391
|
-
options:
|
|
439
|
+
options: N
|
|
392
440
|
})]
|
|
393
441
|
}),
|
|
394
442
|
/* @__PURE__ */ x("div", {
|
|
@@ -396,14 +444,14 @@ function V() {
|
|
|
396
444
|
children: [/* @__PURE__ */ b(T, {
|
|
397
445
|
htmlFor: "myb-prog-level",
|
|
398
446
|
children: "Level"
|
|
399
|
-
}), /* @__PURE__ */ b(
|
|
447
|
+
}), /* @__PURE__ */ b(R, {
|
|
400
448
|
id: "myb-prog-level",
|
|
401
|
-
value:
|
|
402
|
-
onChange: (e) =>
|
|
403
|
-
...
|
|
449
|
+
value: B.level,
|
|
450
|
+
onChange: (e) => V({
|
|
451
|
+
...B,
|
|
404
452
|
level: e
|
|
405
453
|
}),
|
|
406
|
-
options:
|
|
454
|
+
options: ve
|
|
407
455
|
})]
|
|
408
456
|
}),
|
|
409
457
|
/* @__PURE__ */ x("div", {
|
|
@@ -411,14 +459,14 @@ function V() {
|
|
|
411
459
|
children: [/* @__PURE__ */ b(T, {
|
|
412
460
|
htmlFor: "myb-prog-phase",
|
|
413
461
|
children: "Phase"
|
|
414
|
-
}), /* @__PURE__ */ b(
|
|
462
|
+
}), /* @__PURE__ */ b(R, {
|
|
415
463
|
id: "myb-prog-phase",
|
|
416
|
-
value:
|
|
417
|
-
onChange: (e) =>
|
|
418
|
-
...
|
|
464
|
+
value: B.phase,
|
|
465
|
+
onChange: (e) => V({
|
|
466
|
+
...B,
|
|
419
467
|
phase: e
|
|
420
468
|
}),
|
|
421
|
-
options:
|
|
469
|
+
options: ye
|
|
422
470
|
})]
|
|
423
471
|
})
|
|
424
472
|
]
|
|
@@ -435,9 +483,9 @@ function V() {
|
|
|
435
483
|
id: "myb-prog-weeks",
|
|
436
484
|
type: "number",
|
|
437
485
|
min: 1,
|
|
438
|
-
value:
|
|
439
|
-
onChange: (e) =>
|
|
440
|
-
...
|
|
486
|
+
value: B.weeks,
|
|
487
|
+
onChange: (e) => V({
|
|
488
|
+
...B,
|
|
441
489
|
weeks: e.target.value
|
|
442
490
|
}),
|
|
443
491
|
placeholder: "8"
|
|
@@ -453,9 +501,9 @@ function V() {
|
|
|
453
501
|
type: "number",
|
|
454
502
|
min: 1,
|
|
455
503
|
max: 7,
|
|
456
|
-
value:
|
|
457
|
-
onChange: (e) =>
|
|
458
|
-
...
|
|
504
|
+
value: B.daysPerWeek,
|
|
505
|
+
onChange: (e) => V({
|
|
506
|
+
...B,
|
|
459
507
|
daysPerWeek: e.target.value
|
|
460
508
|
}),
|
|
461
509
|
placeholder: "4"
|
|
@@ -469,9 +517,9 @@ function V() {
|
|
|
469
517
|
}), /* @__PURE__ */ b(w, {
|
|
470
518
|
id: "myb-prog-start",
|
|
471
519
|
type: "date",
|
|
472
|
-
value:
|
|
473
|
-
onChange: (e) =>
|
|
474
|
-
...
|
|
520
|
+
value: B.startDate,
|
|
521
|
+
onChange: (e) => V({
|
|
522
|
+
...B,
|
|
475
523
|
startDate: e.target.value
|
|
476
524
|
})
|
|
477
525
|
})]
|
|
@@ -480,15 +528,15 @@ function V() {
|
|
|
480
528
|
})
|
|
481
529
|
]
|
|
482
530
|
}),
|
|
483
|
-
/* @__PURE__ */ x(
|
|
531
|
+
/* @__PURE__ */ x(pe, { children: [/* @__PURE__ */ b(S, {
|
|
484
532
|
variant: "outline",
|
|
485
|
-
onClick: () =>
|
|
486
|
-
disabled: K.isPending,
|
|
533
|
+
onClick: () => z(!1),
|
|
534
|
+
disabled: K.isPending || q.isPending,
|
|
487
535
|
children: "Cancel"
|
|
488
536
|
}), /* @__PURE__ */ b(S, {
|
|
489
|
-
onClick: () => void
|
|
490
|
-
disabled: K.isPending,
|
|
491
|
-
children: K.isPending ? "Creating…" : "Create program"
|
|
537
|
+
onClick: () => void Te(),
|
|
538
|
+
disabled: K.isPending || q.isPending,
|
|
539
|
+
children: K.isPending || q.isPending ? "Creating…" : "Create program"
|
|
492
540
|
})] })
|
|
493
541
|
]
|
|
494
542
|
})
|
|
@@ -497,6 +545,6 @@ function V() {
|
|
|
497
545
|
});
|
|
498
546
|
}
|
|
499
547
|
//#endregion
|
|
500
|
-
export {
|
|
548
|
+
export { z as ProgramsPage };
|
|
501
549
|
|
|
502
550
|
//# sourceMappingURL=ProgramsPage.js.map
|