@burdenoff/microfe-atheletebridge 2026.827.1 → 2026.829.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/atheletebridge/components/LoadingState.d.ts.map +1 -1
- package/dist/atheletebridge/components/LoadingState.js +39 -32
- package/dist/atheletebridge/components/LoadingState.js.map +1 -1
- package/dist/atheletebridge/components/TeamCard.d.ts.map +1 -1
- package/dist/atheletebridge/components/TeamCard.js +45 -49
- package/dist/atheletebridge/components/TeamCard.js.map +1 -1
- package/dist/atheletebridge/pages/DashboardPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/DashboardPage.js +56 -24
- package/dist/atheletebridge/pages/DashboardPage.js.map +1 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js +58 -56
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +110 -106
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.js +80 -71
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.js.map +1 -1
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.js +244 -210
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.js.map +1 -1
- package/dist/atheletebridge/pages/performance/PerformancePage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/performance/PerformancePage.js +197 -148
- package/dist/atheletebridge/pages/performance/PerformancePage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js +169 -143
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramsListPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramsListPage.js +77 -72
- package/dist/atheletebridge/pages/programs/ProgramsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js +104 -86
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionsListPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js +54 -49
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js +286 -267
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamFormPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamFormPage.js +185 -180
- package/dist/atheletebridge/pages/teams/TeamFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamsListPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamsListPage.js +70 -74
- package/dist/atheletebridge/pages/teams/TeamsListPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { useAbTranslate as e } from "../../i18n.js";
|
|
2
|
+
import { useAthleteBridge as t } from "../../context/AthleteBridgeContext.js";
|
|
3
|
+
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
+
import { SPORT_ICONS as r, SPORT_LABELS as i } from "../../components/domain.js";
|
|
5
|
+
import { UserAvatar as a } from "../../components/UserAvatar.js";
|
|
6
|
+
import { ErrorState as o, LoadingState as s } from "../../components/LoadingState.js";
|
|
7
|
+
import { directoryUserName as c, useCreateTeam as l, useTeam as u, useUpdateTeam as d, useUserDirectory as f, useUserSearch as p } from "../../hooks/useAthleteBridgeApi.js";
|
|
8
|
+
import { FormField as m, fieldInputClass as h } from "../../components/form.js";
|
|
9
|
+
import { useEffect as g, useState as _ } from "react";
|
|
10
|
+
import { ArrowLeft as v, CalendarDays as y, Loader2 as b, MapPin as x, Save as S, Search as C, X as w } from "lucide-react";
|
|
11
|
+
import { useParams as T } from "react-router";
|
|
12
|
+
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
13
|
+
import { GlassCard as O } from "@burdenoff/fe-libs/ui";
|
|
13
14
|
//#region src/atheletebridge/pages/teams/TeamFormPage.tsx
|
|
14
|
-
var
|
|
15
|
+
var k = Object.keys(i), A = [
|
|
15
16
|
"FORMING",
|
|
16
17
|
"ACTIVE",
|
|
17
18
|
"INACTIVE",
|
|
18
19
|
"ARCHIVED"
|
|
19
|
-
],
|
|
20
|
-
function
|
|
21
|
-
let t =
|
|
22
|
-
return /* @__PURE__ */
|
|
20
|
+
], j = 300;
|
|
21
|
+
function M({ sport: e }) {
|
|
22
|
+
let t = r[e];
|
|
23
|
+
return /* @__PURE__ */ E(t, {
|
|
23
24
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-muted",
|
|
24
25
|
"aria-hidden": "true"
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
-
let [r,
|
|
29
|
-
return e ? /* @__PURE__ */
|
|
28
|
+
function N({ userId: e, displayName: t, onSelect: n }) {
|
|
29
|
+
let [r, i] = _(""), o = p(r), s = o.data ?? [], l = r.trim().length >= 2, u = o.isError;
|
|
30
|
+
return e ? /* @__PURE__ */ E(m, {
|
|
30
31
|
label: "Head coach",
|
|
31
32
|
hint: "Optional — the coach who leads this squad.",
|
|
32
|
-
children: /* @__PURE__ */
|
|
33
|
+
children: /* @__PURE__ */ D("div", {
|
|
33
34
|
className: "flex items-center gap-2.5 rounded-lg border border-border-seam bg-bg-surface px-3 py-2",
|
|
34
35
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ E(a, {
|
|
36
37
|
name: t,
|
|
37
38
|
id: e,
|
|
38
39
|
size: "sm"
|
|
39
40
|
}),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ D("div", {
|
|
41
42
|
className: "min-w-0 flex-1",
|
|
42
|
-
children: [/* @__PURE__ */
|
|
43
|
+
children: [/* @__PURE__ */ E("p", {
|
|
43
44
|
className: "truncate text-sm font-medium text-text-primary",
|
|
44
45
|
children: t || "Selected coach"
|
|
45
|
-
}), /* @__PURE__ */
|
|
46
|
+
}), /* @__PURE__ */ E("p", {
|
|
46
47
|
className: "truncate text-xs text-text-secondary",
|
|
47
48
|
children: e
|
|
48
49
|
})]
|
|
49
50
|
}),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ E("button", {
|
|
51
52
|
type: "button",
|
|
52
53
|
"aria-label": "Clear head coach",
|
|
53
54
|
onClick: () => n({
|
|
@@ -55,17 +56,17 @@ function M({ userId: e, displayName: t, onSelect: n }) {
|
|
|
55
56
|
displayName: ""
|
|
56
57
|
}),
|
|
57
58
|
className: "rounded-md p-1 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ E(w, { className: "h-4 w-4" })
|
|
59
60
|
})
|
|
60
61
|
]
|
|
61
62
|
})
|
|
62
|
-
}) : u ? /* @__PURE__ */
|
|
63
|
+
}) : u ? /* @__PURE__ */ E(m, {
|
|
63
64
|
label: "Head coach",
|
|
64
65
|
htmlFor: "headCoachId",
|
|
65
66
|
hint: "Optional — directory unavailable here; paste the auth-svc user id.",
|
|
66
|
-
children: /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ E("input", {
|
|
67
68
|
id: "headCoachId",
|
|
68
|
-
className:
|
|
69
|
+
className: h,
|
|
69
70
|
value: e,
|
|
70
71
|
onChange: (e) => n({
|
|
71
72
|
userId: e.target.value,
|
|
@@ -73,30 +74,30 @@ function M({ userId: e, displayName: t, onSelect: n }) {
|
|
|
73
74
|
}),
|
|
74
75
|
placeholder: "user-uuid"
|
|
75
76
|
})
|
|
76
|
-
}) : /* @__PURE__ */
|
|
77
|
+
}) : /* @__PURE__ */ E(m, {
|
|
77
78
|
label: "Head coach",
|
|
78
79
|
hint: "Optional — the coach who leads this squad.",
|
|
79
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ D("div", {
|
|
80
81
|
className: "space-y-2",
|
|
81
82
|
children: [
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ D("div", {
|
|
83
84
|
className: "relative",
|
|
84
85
|
children: [
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ E(C, {
|
|
86
87
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-muted",
|
|
87
88
|
"aria-hidden": "true"
|
|
88
89
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
className: `${
|
|
90
|
+
/* @__PURE__ */ E("input", {
|
|
91
|
+
className: `${h} pl-9`,
|
|
91
92
|
value: r,
|
|
92
|
-
onChange: (e) =>
|
|
93
|
+
onChange: (e) => i(e.target.value),
|
|
93
94
|
placeholder: "Search coaches by name or email…",
|
|
94
95
|
"aria-label": "Search for a head coach"
|
|
95
96
|
}),
|
|
96
|
-
o.isFetching && /* @__PURE__ */
|
|
97
|
+
o.isFetching && /* @__PURE__ */ E(b, { className: "absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin text-text-muted" })
|
|
97
98
|
]
|
|
98
99
|
}),
|
|
99
|
-
l && !o.isFetching &&
|
|
100
|
+
l && !o.isFetching && s.length === 0 && /* @__PURE__ */ D("p", {
|
|
100
101
|
className: "text-xs text-text-secondary",
|
|
101
102
|
children: [
|
|
102
103
|
"No users match “",
|
|
@@ -104,27 +105,27 @@ function M({ userId: e, displayName: t, onSelect: n }) {
|
|
|
104
105
|
"”."
|
|
105
106
|
]
|
|
106
107
|
}),
|
|
107
|
-
|
|
108
|
+
s.length > 0 && /* @__PURE__ */ E("ul", {
|
|
108
109
|
className: "max-h-56 divide-y divide-border-seam overflow-auto rounded-lg border border-border-seam bg-bg-surface",
|
|
109
|
-
children:
|
|
110
|
+
children: s.map((e) => /* @__PURE__ */ E("li", { children: /* @__PURE__ */ D("button", {
|
|
110
111
|
type: "button",
|
|
111
112
|
onClick: () => {
|
|
112
113
|
n({
|
|
113
114
|
userId: e.id,
|
|
114
|
-
displayName:
|
|
115
|
-
}),
|
|
115
|
+
displayName: c(e)
|
|
116
|
+
}), i("");
|
|
116
117
|
},
|
|
117
118
|
className: "flex w-full items-center gap-2.5 px-3 py-2 text-left transition-colors hover:bg-bg-sunken",
|
|
118
|
-
children: [/* @__PURE__ */
|
|
119
|
-
name:
|
|
119
|
+
children: [/* @__PURE__ */ E(a, {
|
|
120
|
+
name: c(e),
|
|
120
121
|
id: e.id,
|
|
121
122
|
size: "sm"
|
|
122
|
-
}), /* @__PURE__ */
|
|
123
|
+
}), /* @__PURE__ */ D("span", {
|
|
123
124
|
className: "min-w-0 flex-1",
|
|
124
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ E("span", {
|
|
125
126
|
className: "block truncate text-sm font-medium text-text-primary",
|
|
126
|
-
children:
|
|
127
|
-
}), /* @__PURE__ */
|
|
127
|
+
children: c(e)
|
|
128
|
+
}), /* @__PURE__ */ E("span", {
|
|
128
129
|
className: "block truncate text-xs text-text-secondary",
|
|
129
130
|
children: e.email
|
|
130
131
|
})]
|
|
@@ -135,7 +136,7 @@ function M({ userId: e, displayName: t, onSelect: n }) {
|
|
|
135
136
|
})
|
|
136
137
|
});
|
|
137
138
|
}
|
|
138
|
-
var
|
|
139
|
+
var P = {
|
|
139
140
|
name: "",
|
|
140
141
|
sport: "OTHER",
|
|
141
142
|
status: "FORMING",
|
|
@@ -147,11 +148,11 @@ var N = {
|
|
|
147
148
|
headCoachName: "",
|
|
148
149
|
tags: []
|
|
149
150
|
};
|
|
150
|
-
function
|
|
151
|
-
let { id:
|
|
152
|
-
|
|
153
|
-
let e =
|
|
154
|
-
|
|
151
|
+
function F() {
|
|
152
|
+
let r = e(), { id: a } = T(), c = !!a, { navigateTo: p } = t(), C = u(a), F = l(), I = d(), [L, R] = _(P), [z, B] = _(""), [V, H] = _(null), U = f(c ? [C.data?.headCoachId] : []).nameOf(C.data?.headCoachId ?? void 0);
|
|
153
|
+
g(() => {
|
|
154
|
+
let e = C.data;
|
|
155
|
+
c && e && R((t) => ({
|
|
155
156
|
name: e.name,
|
|
156
157
|
sport: e.sport,
|
|
157
158
|
status: e.status,
|
|
@@ -160,247 +161,251 @@ function P() {
|
|
|
160
161
|
season: e.season ?? "",
|
|
161
162
|
homeVenue: e.homeVenue ?? "",
|
|
162
163
|
headCoachId: e.headCoachId ?? "",
|
|
163
|
-
headCoachName:
|
|
164
|
+
headCoachName: U ?? t.headCoachName,
|
|
164
165
|
tags: e.tags
|
|
165
166
|
}));
|
|
166
167
|
}, [
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
c,
|
|
169
|
+
C.data,
|
|
170
|
+
U
|
|
170
171
|
]);
|
|
171
|
-
let
|
|
172
|
+
let W = (e, t) => R((n) => ({
|
|
172
173
|
...n,
|
|
173
174
|
[e]: t
|
|
174
|
-
})),
|
|
175
|
+
})), G = (e) => {
|
|
175
176
|
let t = e.trim();
|
|
176
|
-
t && (
|
|
177
|
+
t && (R((e) => e.tags.some((e) => e.toLowerCase() === t.toLowerCase()) ? e : {
|
|
177
178
|
...e,
|
|
178
179
|
tags: [...e.tags, t]
|
|
179
|
-
}),
|
|
180
|
-
},
|
|
180
|
+
}), B(""));
|
|
181
|
+
}, K = (e) => R((t) => ({
|
|
181
182
|
...t,
|
|
182
183
|
tags: t.tags.filter((t) => t !== e)
|
|
183
|
-
})),
|
|
184
|
-
e.key === "Enter" || e.key === "," ? (e.preventDefault(),
|
|
185
|
-
},
|
|
186
|
-
if (e.preventDefault(),
|
|
187
|
-
|
|
184
|
+
})), q = (e) => {
|
|
185
|
+
e.key === "Enter" || e.key === "," ? (e.preventDefault(), G(z)) : e.key === "Backspace" && !z && L.tags.length && K(L.tags[L.tags.length - 1]);
|
|
186
|
+
}, J = async (e) => {
|
|
187
|
+
if (e.preventDefault(), H(null), !L.name.trim()) {
|
|
188
|
+
H("Team name is required.");
|
|
188
189
|
return;
|
|
189
190
|
}
|
|
190
|
-
let t =
|
|
191
|
-
name:
|
|
192
|
-
sport:
|
|
193
|
-
status:
|
|
194
|
-
description:
|
|
195
|
-
ageGroup:
|
|
196
|
-
season:
|
|
197
|
-
homeVenue:
|
|
198
|
-
headCoachId:
|
|
199
|
-
tags:
|
|
191
|
+
let t = z.trim(), n = t && !L.tags.some((e) => e.toLowerCase() === t.toLowerCase()) ? [...L.tags, t] : L.tags, r = {
|
|
192
|
+
name: L.name.trim(),
|
|
193
|
+
sport: L.sport,
|
|
194
|
+
status: L.status,
|
|
195
|
+
description: L.description.trim() || void 0,
|
|
196
|
+
ageGroup: L.ageGroup.trim() || void 0,
|
|
197
|
+
season: L.season.trim() || void 0,
|
|
198
|
+
homeVenue: L.homeVenue.trim() || void 0,
|
|
199
|
+
headCoachId: L.headCoachId.trim() || void 0,
|
|
200
|
+
tags: n
|
|
200
201
|
};
|
|
201
202
|
try {
|
|
202
|
-
|
|
203
|
-
id:
|
|
204
|
-
input:
|
|
205
|
-
}),
|
|
203
|
+
c && a ? (await I.mutateAsync({
|
|
204
|
+
id: a,
|
|
205
|
+
input: r
|
|
206
|
+
}), p(`/teams/${a}`)) : p(`/teams/${(await F.mutateAsync(r)).id}`);
|
|
206
207
|
} catch (e) {
|
|
207
|
-
|
|
208
|
+
H(e instanceof Error ? e.message : "Failed to save team.");
|
|
208
209
|
}
|
|
209
|
-
},
|
|
210
|
-
return
|
|
211
|
-
title: "Edit team",
|
|
212
|
-
children: /* @__PURE__ */
|
|
213
|
-
}) :
|
|
214
|
-
title: "Edit team",
|
|
215
|
-
children: /* @__PURE__ */
|
|
216
|
-
title: "Team not found",
|
|
217
|
-
message: "This team does not exist or you do not have access to it.",
|
|
218
|
-
onRetry: () =>
|
|
210
|
+
}, Y = F.isPending || I.isPending;
|
|
211
|
+
return c && C.isLoading ? /* @__PURE__ */ E(n, {
|
|
212
|
+
title: r("atheletebridge.pages.teamForm.editTitle", "Edit team"),
|
|
213
|
+
children: /* @__PURE__ */ E(s, { label: r("atheletebridge.pages.teamForm.loading", "Loading team…") })
|
|
214
|
+
}) : c && (C.isError || !C.isLoading && !C.data) ? /* @__PURE__ */ E(n, {
|
|
215
|
+
title: r("atheletebridge.pages.teamForm.editTitle", "Edit team"),
|
|
216
|
+
children: /* @__PURE__ */ E(o, {
|
|
217
|
+
title: r("atheletebridge.pages.teamForm.notFoundTitle", "Team not found"),
|
|
218
|
+
message: r("atheletebridge.pages.teamForm.notFoundMessage", "This team does not exist or you do not have access to it."),
|
|
219
|
+
onRetry: () => p("/teams")
|
|
219
220
|
})
|
|
220
|
-
}) : /* @__PURE__ */
|
|
221
|
-
title:
|
|
222
|
-
description:
|
|
223
|
-
actions: /* @__PURE__ */
|
|
221
|
+
}) : /* @__PURE__ */ E(n, {
|
|
222
|
+
title: c ? r("atheletebridge.pages.teamForm.editTitle", "Edit team") : r("atheletebridge.pages.teamForm.newTitle", "New team"),
|
|
223
|
+
description: c ? r("atheletebridge.pages.teamForm.editDescription", "Update the squad details.") : r("atheletebridge.pages.teamForm.newDescription", "Create a new squad to build a roster."),
|
|
224
|
+
actions: /* @__PURE__ */ D("button", {
|
|
224
225
|
type: "button",
|
|
225
|
-
onClick: () =>
|
|
226
|
+
onClick: () => p(c && a ? `/teams/${a}` : "/teams"),
|
|
226
227
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
227
|
-
children: [
|
|
228
|
+
children: [
|
|
229
|
+
/* @__PURE__ */ E(v, { className: "h-4 w-4" }),
|
|
230
|
+
" ",
|
|
231
|
+
r("common.cancel", "Cancel")
|
|
232
|
+
]
|
|
228
233
|
}),
|
|
229
|
-
children: /* @__PURE__ */
|
|
230
|
-
onSubmit:
|
|
234
|
+
children: /* @__PURE__ */ E("form", {
|
|
235
|
+
onSubmit: J,
|
|
231
236
|
className: "mx-auto max-w-3xl",
|
|
232
|
-
children: /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ D(O, {
|
|
233
238
|
treatment: "insight",
|
|
234
239
|
className: "p-6 sm:p-8",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
240
|
+
children: [/* @__PURE__ */ D("div", {
|
|
236
241
|
className: "space-y-5",
|
|
237
242
|
children: [
|
|
238
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ D("div", {
|
|
239
244
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
240
|
-
children: [/* @__PURE__ */
|
|
245
|
+
children: [/* @__PURE__ */ E(m, {
|
|
241
246
|
label: "Team name",
|
|
242
247
|
htmlFor: "name",
|
|
243
248
|
required: !0,
|
|
244
|
-
children: /* @__PURE__ */
|
|
249
|
+
children: /* @__PURE__ */ E("input", {
|
|
245
250
|
id: "name",
|
|
246
|
-
className:
|
|
247
|
-
value:
|
|
248
|
-
onChange: (e) =>
|
|
251
|
+
className: h,
|
|
252
|
+
value: L.name,
|
|
253
|
+
onChange: (e) => W("name", e.target.value),
|
|
249
254
|
placeholder: "e.g. Riverside United U18"
|
|
250
255
|
})
|
|
251
|
-
}), /* @__PURE__ */
|
|
256
|
+
}), /* @__PURE__ */ E(m, {
|
|
252
257
|
label: "Sport",
|
|
253
258
|
htmlFor: "sport",
|
|
254
|
-
children: /* @__PURE__ */
|
|
259
|
+
children: /* @__PURE__ */ D("div", {
|
|
255
260
|
className: "relative",
|
|
256
|
-
children: [/* @__PURE__ */
|
|
261
|
+
children: [/* @__PURE__ */ E(M, { sport: L.sport }), /* @__PURE__ */ E("select", {
|
|
257
262
|
id: "sport",
|
|
258
|
-
className: `${
|
|
259
|
-
value:
|
|
260
|
-
onChange: (e) =>
|
|
261
|
-
children:
|
|
263
|
+
className: `${h} pl-9`,
|
|
264
|
+
value: L.sport,
|
|
265
|
+
onChange: (e) => W("sport", e.target.value),
|
|
266
|
+
children: k.map((e) => /* @__PURE__ */ E("option", {
|
|
262
267
|
value: e,
|
|
263
|
-
children:
|
|
268
|
+
children: i[e]
|
|
264
269
|
}, e))
|
|
265
270
|
})]
|
|
266
271
|
})
|
|
267
272
|
})]
|
|
268
273
|
}),
|
|
269
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ D("div", {
|
|
270
275
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
276
|
+
children: [/* @__PURE__ */ E(m, {
|
|
272
277
|
label: "Status",
|
|
273
278
|
htmlFor: "status",
|
|
274
|
-
children: /* @__PURE__ */
|
|
279
|
+
children: /* @__PURE__ */ E("select", {
|
|
275
280
|
id: "status",
|
|
276
|
-
className:
|
|
277
|
-
value:
|
|
278
|
-
onChange: (e) =>
|
|
279
|
-
children:
|
|
281
|
+
className: h,
|
|
282
|
+
value: L.status,
|
|
283
|
+
onChange: (e) => W("status", e.target.value),
|
|
284
|
+
children: A.map((e) => /* @__PURE__ */ E("option", {
|
|
280
285
|
value: e,
|
|
281
286
|
children: e.charAt(0) + e.slice(1).toLowerCase()
|
|
282
287
|
}, e))
|
|
283
288
|
})
|
|
284
|
-
}), /* @__PURE__ */
|
|
289
|
+
}), /* @__PURE__ */ E(m, {
|
|
285
290
|
label: "Age group",
|
|
286
291
|
htmlFor: "ageGroup",
|
|
287
|
-
children: /* @__PURE__ */
|
|
292
|
+
children: /* @__PURE__ */ E("input", {
|
|
288
293
|
id: "ageGroup",
|
|
289
|
-
className:
|
|
290
|
-
value:
|
|
291
|
-
onChange: (e) =>
|
|
294
|
+
className: h,
|
|
295
|
+
value: L.ageGroup,
|
|
296
|
+
onChange: (e) => W("ageGroup", e.target.value),
|
|
292
297
|
placeholder: "e.g. U18"
|
|
293
298
|
})
|
|
294
299
|
})]
|
|
295
300
|
}),
|
|
296
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ D("div", {
|
|
297
302
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
298
|
-
children: [/* @__PURE__ */
|
|
303
|
+
children: [/* @__PURE__ */ E(m, {
|
|
299
304
|
label: "Season",
|
|
300
305
|
htmlFor: "season",
|
|
301
|
-
children: /* @__PURE__ */
|
|
306
|
+
children: /* @__PURE__ */ D("div", {
|
|
302
307
|
className: "relative",
|
|
303
|
-
children: [/* @__PURE__ */
|
|
308
|
+
children: [/* @__PURE__ */ E(y, {
|
|
304
309
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-muted",
|
|
305
310
|
"aria-hidden": "true"
|
|
306
|
-
}), /* @__PURE__ */
|
|
311
|
+
}), /* @__PURE__ */ E("input", {
|
|
307
312
|
id: "season",
|
|
308
|
-
className: `${
|
|
309
|
-
value:
|
|
310
|
-
onChange: (e) =>
|
|
313
|
+
className: `${h} pl-9`,
|
|
314
|
+
value: L.season,
|
|
315
|
+
onChange: (e) => W("season", e.target.value),
|
|
311
316
|
placeholder: "e.g. 2025/26"
|
|
312
317
|
})]
|
|
313
318
|
})
|
|
314
|
-
}), /* @__PURE__ */
|
|
319
|
+
}), /* @__PURE__ */ E(m, {
|
|
315
320
|
label: "Home venue",
|
|
316
321
|
htmlFor: "homeVenue",
|
|
317
|
-
children: /* @__PURE__ */
|
|
322
|
+
children: /* @__PURE__ */ D("div", {
|
|
318
323
|
className: "relative",
|
|
319
|
-
children: [/* @__PURE__ */
|
|
324
|
+
children: [/* @__PURE__ */ E(x, {
|
|
320
325
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-muted",
|
|
321
326
|
"aria-hidden": "true"
|
|
322
|
-
}), /* @__PURE__ */
|
|
327
|
+
}), /* @__PURE__ */ E("input", {
|
|
323
328
|
id: "homeVenue",
|
|
324
|
-
className: `${
|
|
325
|
-
value:
|
|
326
|
-
onChange: (e) =>
|
|
329
|
+
className: `${h} pl-9`,
|
|
330
|
+
value: L.homeVenue,
|
|
331
|
+
onChange: (e) => W("homeVenue", e.target.value),
|
|
327
332
|
placeholder: "e.g. Riverside Stadium"
|
|
328
333
|
})]
|
|
329
334
|
})
|
|
330
335
|
})]
|
|
331
336
|
}),
|
|
332
|
-
/* @__PURE__ */
|
|
333
|
-
userId:
|
|
334
|
-
displayName:
|
|
335
|
-
onSelect: ({ userId: e, displayName: t }) =>
|
|
337
|
+
/* @__PURE__ */ E(N, {
|
|
338
|
+
userId: L.headCoachId,
|
|
339
|
+
displayName: L.headCoachName,
|
|
340
|
+
onSelect: ({ userId: e, displayName: t }) => R((n) => ({
|
|
336
341
|
...n,
|
|
337
342
|
headCoachId: e,
|
|
338
343
|
headCoachName: t
|
|
339
344
|
}))
|
|
340
345
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ D(m, {
|
|
342
347
|
label: "Description",
|
|
343
348
|
htmlFor: "description",
|
|
344
|
-
children: [/* @__PURE__ */
|
|
349
|
+
children: [/* @__PURE__ */ E("textarea", {
|
|
345
350
|
id: "description",
|
|
346
|
-
className:
|
|
351
|
+
className: h,
|
|
347
352
|
rows: 3,
|
|
348
|
-
maxLength:
|
|
349
|
-
value:
|
|
350
|
-
onChange: (e) =>
|
|
353
|
+
maxLength: j,
|
|
354
|
+
value: L.description,
|
|
355
|
+
onChange: (e) => W("description", e.target.value),
|
|
351
356
|
placeholder: "A short description of the team."
|
|
352
|
-
}), /* @__PURE__ */
|
|
357
|
+
}), /* @__PURE__ */ D("div", {
|
|
353
358
|
className: "mt-1 text-right text-xs tabular-nums text-text-muted",
|
|
354
359
|
children: [
|
|
355
|
-
|
|
360
|
+
L.description.length,
|
|
356
361
|
"/",
|
|
357
|
-
|
|
362
|
+
j
|
|
358
363
|
]
|
|
359
364
|
})]
|
|
360
365
|
}),
|
|
361
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ E(m, {
|
|
362
367
|
label: "Tags",
|
|
363
368
|
htmlFor: "tags",
|
|
364
369
|
hint: "Type a tag and press Enter to add it; click × to remove.",
|
|
365
|
-
children: /* @__PURE__ */
|
|
370
|
+
children: /* @__PURE__ */ D("div", {
|
|
366
371
|
className: "flex flex-wrap items-center gap-1.5 rounded-lg border border-border-seam bg-bg-surface px-2 py-1.5 focus-within:ring-2 focus-within:ring-[var(--color-focus-ring)]",
|
|
367
|
-
children: [
|
|
372
|
+
children: [L.tags.map((e) => /* @__PURE__ */ D("span", {
|
|
368
373
|
className: "inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
|
|
369
|
-
children: [e, /* @__PURE__ */
|
|
374
|
+
children: [e, /* @__PURE__ */ E("button", {
|
|
370
375
|
type: "button",
|
|
371
|
-
onClick: () =>
|
|
376
|
+
onClick: () => K(e),
|
|
372
377
|
"aria-label": `Remove tag ${e}`,
|
|
373
378
|
className: "rounded-full text-text-muted transition-colors hover:text-status-error-text",
|
|
374
|
-
children: /* @__PURE__ */
|
|
379
|
+
children: /* @__PURE__ */ E(w, { className: "h-3 w-3" })
|
|
375
380
|
})]
|
|
376
|
-
}, e)), /* @__PURE__ */
|
|
381
|
+
}, e)), /* @__PURE__ */ E("input", {
|
|
377
382
|
id: "tags",
|
|
378
383
|
className: "min-w-[8rem] flex-1 bg-transparent px-1 py-0.5 text-sm text-text-primary placeholder:text-text-muted focus:outline-none",
|
|
379
|
-
value:
|
|
380
|
-
onChange: (e) =>
|
|
381
|
-
onKeyDown:
|
|
382
|
-
onBlur: () =>
|
|
383
|
-
placeholder:
|
|
384
|
+
value: z,
|
|
385
|
+
onChange: (e) => B(e.target.value),
|
|
386
|
+
onKeyDown: q,
|
|
387
|
+
onBlur: () => G(z),
|
|
388
|
+
placeholder: L.tags.length ? "Add tag and press Enter…" : "youth, development"
|
|
384
389
|
})]
|
|
385
390
|
})
|
|
386
391
|
}),
|
|
387
|
-
|
|
392
|
+
V && /* @__PURE__ */ E("p", {
|
|
388
393
|
className: "text-sm text-status-error-text",
|
|
389
|
-
children:
|
|
394
|
+
children: V
|
|
390
395
|
})
|
|
391
396
|
]
|
|
392
|
-
}), /* @__PURE__ */
|
|
397
|
+
}), /* @__PURE__ */ D("div", {
|
|
393
398
|
className: "mt-6 flex items-center justify-end gap-3 border-t border-border-seam pt-5",
|
|
394
|
-
children: [/* @__PURE__ */
|
|
399
|
+
children: [/* @__PURE__ */ E("button", {
|
|
395
400
|
type: "button",
|
|
396
|
-
onClick: () =>
|
|
401
|
+
onClick: () => p(c && a ? `/teams/${a}` : "/teams"),
|
|
397
402
|
className: "rounded-lg px-4 py-2 text-sm font-medium text-text-secondary transition-colors hover:text-text-primary",
|
|
398
|
-
children: "Cancel"
|
|
399
|
-
}), /* @__PURE__ */
|
|
403
|
+
children: r("common.cancel", "Cancel")
|
|
404
|
+
}), /* @__PURE__ */ D("button", {
|
|
400
405
|
type: "submit",
|
|
401
|
-
disabled:
|
|
406
|
+
disabled: Y,
|
|
402
407
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-5 py-2 text-sm font-semibold text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-60",
|
|
403
|
-
children: [
|
|
408
|
+
children: [Y ? /* @__PURE__ */ E(b, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ E(S, { className: "h-4 w-4" }), c ? r("atheletebridge.pages.teamForm.saveChanges", "Save changes") : r("atheletebridge.pages.teamForm.createTeam", "Create team")]
|
|
404
409
|
})]
|
|
405
410
|
})]
|
|
406
411
|
})
|
|
@@ -408,6 +413,6 @@ function P() {
|
|
|
408
413
|
});
|
|
409
414
|
}
|
|
410
415
|
//#endregion
|
|
411
|
-
export {
|
|
416
|
+
export { F as TeamFormPage };
|
|
412
417
|
|
|
413
418
|
//# sourceMappingURL=TeamFormPage.js.map
|