@pieai/swimmer-ui-kit 3.1.0 → 3.2.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/CHANGELOG.md +24 -1
- package/README.md +1 -1
- package/dist/{GameAvatar-CRJ1r8l5.js → GameAvatar-Cs5KVYFf.js} +4 -1
- package/dist/{GameStageTile-F41PxXDG.js → GameStageTile-BdG3tMV-.js} +221 -174
- package/dist/index.d.ts +56 -0
- package/dist/index.js +465 -222
- package/dist/liquid-presence.js +1 -1
- package/dist/preview.js +66 -66
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { A as e, D as t, E as n, F as r, M as i, N as a, O as o, P as s, T as c, a as l, j as u, w as d } from "./LiquidGroup-RTK_Uvgw.js";
|
|
3
|
-
import { a as f, c as p, d as m, i as h, l as g, n as _, o as v, s as y, u as b } from "./GameAvatar-
|
|
4
|
-
import { A as x, B as S, C, D as w, E as ee, F as te, G as ne, H as re, I as ie, J as ae, K as oe, L as se, M as ce, N as le, O as ue, P as de, R as
|
|
5
|
-
import { cloneElement as
|
|
6
|
-
import { jsx as
|
|
3
|
+
import { a as f, c as p, d as m, i as h, l as g, n as _, o as v, s as y, u as b } from "./GameAvatar-Cs5KVYFf.js";
|
|
4
|
+
import { A as x, B as S, C, D as w, E as ee, F as te, G as ne, H as re, I as ie, J as ae, K as oe, L as se, M as ce, N as le, O as ue, P as de, R as fe, S as pe, T as me, U as he, V as T, W as E, _ as D, a as O, b as k, c as A, d as j, f as M, g as N, h as P, i as F, j as I, k as L, l as R, m as ge, n as _e, o as ve, p as ye, q as be, r as xe, s as Se, t as Ce, u as we, v as Te, w as Ee, x as De, y as Oe, z as ke } from "./paths-B7D0h7Mh.js";
|
|
5
|
+
import { cloneElement as Ae, forwardRef as z, isValidElement as B, useId as V, useLayoutEffect as H, useRef as U, useState as W } from "react";
|
|
6
|
+
import { jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
7
7
|
//#region src/tokens/index.ts
|
|
8
|
-
var
|
|
8
|
+
var q = {
|
|
9
9
|
...i,
|
|
10
10
|
...r,
|
|
11
11
|
...a,
|
|
@@ -19,13 +19,13 @@ var Oe = {
|
|
|
19
19
|
...n,
|
|
20
20
|
...d,
|
|
21
21
|
...t
|
|
22
|
-
},
|
|
22
|
+
}, je = {
|
|
23
23
|
toneAttr: "data-game-ui-tone",
|
|
24
24
|
toneGlass: "glass",
|
|
25
25
|
densityAttr: "data-game-ui-density",
|
|
26
26
|
densityCompact: "compact",
|
|
27
27
|
scopeClass: "game-ui-overlay-scope"
|
|
28
|
-
},
|
|
28
|
+
}, Me = s, Ne = [
|
|
29
29
|
"--game-ui-bg",
|
|
30
30
|
"--game-ui-surface",
|
|
31
31
|
"--game-ui-surface-raised",
|
|
@@ -52,20 +52,20 @@ var Oe = {
|
|
|
52
52
|
];
|
|
53
53
|
//#endregion
|
|
54
54
|
//#region src/controls/GameCheckbox/GameCheckbox.tsx
|
|
55
|
-
function
|
|
56
|
-
return /* @__PURE__ */
|
|
55
|
+
function Pe({ className: e, label: t, hue: n, ...r }) {
|
|
56
|
+
return /* @__PURE__ */ K("label", {
|
|
57
57
|
className: ["game-ui-checkbox", e].filter(Boolean).join(" "),
|
|
58
58
|
"data-game-ui-paint": "",
|
|
59
59
|
style: v(n),
|
|
60
60
|
children: [
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ G(y, {}),
|
|
62
|
+
/* @__PURE__ */ G("input", {
|
|
63
63
|
className: "game-ui-checkbox-input",
|
|
64
64
|
type: "checkbox",
|
|
65
65
|
...r
|
|
66
66
|
}),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ G(p, {}),
|
|
68
|
+
/* @__PURE__ */ G("span", {
|
|
69
69
|
className: "game-ui-checkbox-label",
|
|
70
70
|
children: t
|
|
71
71
|
})
|
|
@@ -74,25 +74,25 @@ function Me({ className: e, label: t, hue: n, ...r }) {
|
|
|
74
74
|
}
|
|
75
75
|
//#endregion
|
|
76
76
|
//#region src/controls/GameField/GameField.tsx
|
|
77
|
-
function
|
|
78
|
-
return /* @__PURE__ */
|
|
77
|
+
function Fe({ children: e, className: t, error: n, hint: r, label: i, required: a }) {
|
|
78
|
+
return /* @__PURE__ */ K("label", {
|
|
79
79
|
className: ["game-ui-field", t].filter(Boolean).join(" "),
|
|
80
80
|
"data-invalid": n ? "true" : void 0,
|
|
81
81
|
children: [
|
|
82
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ K("span", {
|
|
83
83
|
className: "game-ui-field-label",
|
|
84
|
-
children: [i, a ? /* @__PURE__ */
|
|
84
|
+
children: [i, a ? /* @__PURE__ */ K("span", {
|
|
85
85
|
"aria-hidden": "true",
|
|
86
86
|
className: "game-ui-field-required",
|
|
87
87
|
children: [" ", "*"]
|
|
88
88
|
}) : null]
|
|
89
89
|
}),
|
|
90
90
|
e,
|
|
91
|
-
r && !n ? /* @__PURE__ */
|
|
91
|
+
r && !n ? /* @__PURE__ */ G("span", {
|
|
92
92
|
className: "game-ui-field-hint",
|
|
93
93
|
children: r
|
|
94
94
|
}) : null,
|
|
95
|
-
n ? /* @__PURE__ */
|
|
95
|
+
n ? /* @__PURE__ */ G("span", {
|
|
96
96
|
className: "game-ui-field-error",
|
|
97
97
|
role: "alert",
|
|
98
98
|
children: n
|
|
@@ -102,8 +102,8 @@ function Ne({ children: e, className: t, error: n, hint: r, label: i, required:
|
|
|
102
102
|
}
|
|
103
103
|
//#endregion
|
|
104
104
|
//#region src/controls/GameIconButton/GameIconButton.tsx
|
|
105
|
-
var
|
|
106
|
-
return /* @__PURE__ */
|
|
105
|
+
var Ie = z(function({ children: e, className: t, label: n, hue: r, size: i = "md", style: a, ...o }, s) {
|
|
106
|
+
return /* @__PURE__ */ K(f, {
|
|
107
107
|
...o,
|
|
108
108
|
ref: s,
|
|
109
109
|
"aria-label": n,
|
|
@@ -115,13 +115,13 @@ var Pe = U(function({ children: e, className: t, label: n, hue: r, size: i = "md
|
|
|
115
115
|
...a
|
|
116
116
|
},
|
|
117
117
|
children: [
|
|
118
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ G(y, {}),
|
|
119
119
|
e,
|
|
120
|
-
o["aria-pressed"] === void 0 ? null : /* @__PURE__ */
|
|
120
|
+
o["aria-pressed"] === void 0 ? null : /* @__PURE__ */ G(p, {})
|
|
121
121
|
]
|
|
122
122
|
});
|
|
123
|
-
}),
|
|
124
|
-
return /* @__PURE__ */
|
|
123
|
+
}), Le = z(function({ className: e, invalid: t, hue: n, type: r = "text", ...i }, a) {
|
|
124
|
+
return /* @__PURE__ */ G("input", {
|
|
125
125
|
className: ["game-ui-input", e].filter(Boolean).join(" "),
|
|
126
126
|
"data-invalid": t ? "true" : void 0,
|
|
127
127
|
ref: a,
|
|
@@ -134,65 +134,65 @@ var Pe = U(function({ children: e, className: t, label: n, hue: r, size: i = "md
|
|
|
134
134
|
"aria-invalid": i["aria-invalid"] ?? (t || void 0),
|
|
135
135
|
"data-game-ui-paint": ""
|
|
136
136
|
});
|
|
137
|
-
}),
|
|
138
|
-
ai:
|
|
139
|
-
alert:
|
|
140
|
-
card:
|
|
141
|
-
chat:
|
|
142
|
-
check:
|
|
143
|
-
close:
|
|
144
|
-
coin:
|
|
145
|
-
compass:
|
|
146
|
-
copy:
|
|
147
|
-
crown:
|
|
148
|
-
energy:
|
|
149
|
-
gem:
|
|
150
|
-
gift:
|
|
151
|
-
globe:
|
|
152
|
-
history:
|
|
137
|
+
}), J = {
|
|
138
|
+
ai: Ce,
|
|
139
|
+
alert: _e,
|
|
140
|
+
card: O,
|
|
141
|
+
chat: ve,
|
|
142
|
+
check: Se,
|
|
143
|
+
close: we,
|
|
144
|
+
coin: j,
|
|
145
|
+
compass: M,
|
|
146
|
+
copy: ye,
|
|
147
|
+
crown: ge,
|
|
148
|
+
energy: N,
|
|
149
|
+
gem: Te,
|
|
150
|
+
gift: Oe,
|
|
151
|
+
globe: k,
|
|
152
|
+
history: De,
|
|
153
153
|
redo: ie,
|
|
154
154
|
undo: oe,
|
|
155
|
-
home:
|
|
155
|
+
home: pe,
|
|
156
156
|
hourglass: C,
|
|
157
|
-
laurel:
|
|
158
|
-
lock:
|
|
157
|
+
laurel: Ee,
|
|
158
|
+
lock: me,
|
|
159
159
|
lucky: ee,
|
|
160
160
|
mail: w,
|
|
161
161
|
medal: ue,
|
|
162
|
-
mission:
|
|
162
|
+
mission: I,
|
|
163
163
|
mobile: ce,
|
|
164
164
|
portal: te,
|
|
165
165
|
scroll: se,
|
|
166
|
-
settings:
|
|
166
|
+
settings: ke,
|
|
167
167
|
shirt: S,
|
|
168
|
-
shop:
|
|
168
|
+
shop: T,
|
|
169
169
|
smile: re,
|
|
170
|
-
timer:
|
|
170
|
+
timer: E,
|
|
171
171
|
trophy: ne,
|
|
172
172
|
vote: ae,
|
|
173
|
-
"arrow-left":
|
|
174
|
-
"arrow-right":
|
|
175
|
-
"chevron-down":
|
|
176
|
-
"chevron-up":
|
|
177
|
-
download:
|
|
178
|
-
external:
|
|
179
|
-
menu:
|
|
173
|
+
"arrow-left": xe,
|
|
174
|
+
"arrow-right": F,
|
|
175
|
+
"chevron-down": A,
|
|
176
|
+
"chevron-up": R,
|
|
177
|
+
download: P,
|
|
178
|
+
external: D,
|
|
179
|
+
menu: L,
|
|
180
180
|
minus: x,
|
|
181
181
|
moon: le,
|
|
182
182
|
plus: de,
|
|
183
|
-
search:
|
|
184
|
-
sun:
|
|
185
|
-
user:
|
|
186
|
-
},
|
|
183
|
+
search: fe,
|
|
184
|
+
sun: he,
|
|
185
|
+
user: be
|
|
186
|
+
}, Re = Object.keys(J);
|
|
187
187
|
//#endregion
|
|
188
188
|
//#region src/icons/GameIcon/GameIcon.tsx
|
|
189
|
-
function
|
|
190
|
-
let a = typeof e == "string" ?
|
|
189
|
+
function Y({ icon: e, size: t = "md", label: n, className: r, ...i }) {
|
|
190
|
+
let a = typeof e == "string" ? J[e] : e, o = {
|
|
191
191
|
sm: 16,
|
|
192
192
|
md: 20,
|
|
193
193
|
lg: 24
|
|
194
194
|
}[t];
|
|
195
|
-
return /* @__PURE__ */
|
|
195
|
+
return /* @__PURE__ */ G("svg", {
|
|
196
196
|
...i,
|
|
197
197
|
className: ["game-ui-icon", r].filter(Boolean).join(" "),
|
|
198
198
|
viewBox: "0 0 24 24",
|
|
@@ -209,18 +209,18 @@ function Z({ icon: e, size: t = "md", label: n, className: r, ...i }) {
|
|
|
209
209
|
"aria-hidden": !n || void 0,
|
|
210
210
|
"data-icon": a.name,
|
|
211
211
|
"data-icon-size": t,
|
|
212
|
-
children: a.paths.map((e, t) => /* @__PURE__ */
|
|
212
|
+
children: a.paths.map((e, t) => /* @__PURE__ */ G("path", { d: e }, t))
|
|
213
213
|
});
|
|
214
214
|
}
|
|
215
215
|
//#endregion
|
|
216
216
|
//#region src/controls/GameLanguageMenu/GameLanguageMenu.tsx
|
|
217
|
-
function
|
|
218
|
-
let [s, c] =
|
|
217
|
+
function ze({ className: e, currentLabel: t, label: n, options: r, value: i, defaultValue: a, onSelect: o }) {
|
|
218
|
+
let [s, c] = W(!1), [l, u] = W(a ?? r[0]?.id ?? ""), d = V(), f = ["game-ui-language-menu", e].filter(Boolean).join(" "), m = i ?? l, h = r.find((e) => e.id === m), g = t ?? h?.label ?? r[0]?.label ?? "", _ = (e) => {
|
|
219
219
|
i === void 0 && u(e), o?.(e), c(!1);
|
|
220
220
|
};
|
|
221
|
-
return /* @__PURE__ */
|
|
221
|
+
return /* @__PURE__ */ K("div", {
|
|
222
222
|
className: f,
|
|
223
|
-
children: [/* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ K("button", {
|
|
224
224
|
"aria-controls": d,
|
|
225
225
|
"aria-expanded": s,
|
|
226
226
|
className: "game-ui-language-trigger",
|
|
@@ -228,19 +228,19 @@ function Le({ className: e, currentLabel: t, label: n, options: r, value: i, def
|
|
|
228
228
|
type: "button",
|
|
229
229
|
"data-game-ui-paint": "",
|
|
230
230
|
children: [
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ G(y, {}),
|
|
232
|
+
/* @__PURE__ */ G(Y, {
|
|
233
233
|
icon: "globe",
|
|
234
234
|
size: "sm"
|
|
235
235
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ G("span", { children: g })
|
|
237
237
|
]
|
|
238
|
-
}), s ? /* @__PURE__ */
|
|
238
|
+
}), s ? /* @__PURE__ */ G("div", {
|
|
239
239
|
"aria-label": n,
|
|
240
240
|
className: "game-ui-language-popover",
|
|
241
241
|
id: d,
|
|
242
242
|
role: "menu",
|
|
243
|
-
children: r.map((e) => /* @__PURE__ */
|
|
243
|
+
children: r.map((e) => /* @__PURE__ */ K("button", {
|
|
244
244
|
"aria-checked": e.id === m,
|
|
245
245
|
"data-selected": e.id === m,
|
|
246
246
|
onClick: () => _(e.id),
|
|
@@ -248,9 +248,9 @@ function Le({ className: e, currentLabel: t, label: n, options: r, value: i, def
|
|
|
248
248
|
type: "button",
|
|
249
249
|
"data-game-ui-paint": "",
|
|
250
250
|
children: [
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ G(y, {}),
|
|
252
|
+
/* @__PURE__ */ K("span", { children: [/* @__PURE__ */ G("strong", { children: e.label }), /* @__PURE__ */ G("small", { children: e.meta })] }),
|
|
253
|
+
/* @__PURE__ */ G(p, {})
|
|
254
254
|
]
|
|
255
255
|
}, e.id))
|
|
256
256
|
}) : null]
|
|
@@ -258,12 +258,12 @@ function Le({ className: e, currentLabel: t, label: n, options: r, value: i, def
|
|
|
258
258
|
}
|
|
259
259
|
//#endregion
|
|
260
260
|
//#region src/controls/GameSegmentedControl/GameSegmentedControl.tsx
|
|
261
|
-
function
|
|
262
|
-
return /* @__PURE__ */
|
|
261
|
+
function Be({ activeId: e, label: t, onSelect: n, options: r, disabled: i, hue: a }) {
|
|
262
|
+
return /* @__PURE__ */ G("div", {
|
|
263
263
|
"aria-label": t,
|
|
264
264
|
className: "game-ui-segmented",
|
|
265
265
|
role: "group",
|
|
266
|
-
children: r.map((t) => /* @__PURE__ */
|
|
266
|
+
children: r.map((t) => /* @__PURE__ */ K("button", {
|
|
267
267
|
type: "button",
|
|
268
268
|
className: "game-ui-segmented-option",
|
|
269
269
|
"aria-pressed": t.id === e,
|
|
@@ -272,19 +272,19 @@ function Re({ activeId: e, label: t, onSelect: n, options: r, disabled: i, hue:
|
|
|
272
272
|
"data-game-ui-paint": "",
|
|
273
273
|
style: v(t.hue ?? a),
|
|
274
274
|
children: [
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ G(y, {}),
|
|
276
|
+
/* @__PURE__ */ G("span", { children: t.label }),
|
|
277
|
+
/* @__PURE__ */ G(p, {})
|
|
278
278
|
]
|
|
279
279
|
}, t.id))
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
//#endregion
|
|
283
283
|
//#region src/controls/GameSlider/GameSlider.tsx
|
|
284
|
-
function
|
|
285
|
-
return /* @__PURE__ */
|
|
284
|
+
function Ve({ label: e, max: t, min: n, step: r, disabled: i, name: a, id: o, onChange: s, value: c }) {
|
|
285
|
+
return /* @__PURE__ */ K("label", {
|
|
286
286
|
className: "game-ui-slider",
|
|
287
|
-
children: [/* @__PURE__ */
|
|
287
|
+
children: [/* @__PURE__ */ G("span", { children: e }), /* @__PURE__ */ G("input", {
|
|
288
288
|
"aria-label": e,
|
|
289
289
|
max: t,
|
|
290
290
|
min: n,
|
|
@@ -302,8 +302,8 @@ function ze({ label: e, max: t, min: n, step: r, disabled: i, name: a, id: o, on
|
|
|
302
302
|
}
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region src/controls/GameTextArea/GameTextArea.tsx
|
|
305
|
-
var
|
|
306
|
-
return /* @__PURE__ */
|
|
305
|
+
var He = z(function({ className: e, invalid: t, hue: n, rows: r = 3, ...i }, a) {
|
|
306
|
+
return /* @__PURE__ */ G("textarea", {
|
|
307
307
|
className: [
|
|
308
308
|
"game-ui-input",
|
|
309
309
|
"game-ui-textarea",
|
|
@@ -323,8 +323,8 @@ var Be = U(function({ className: e, invalid: t, hue: n, rows: r = 3, ...i }, a)
|
|
|
323
323
|
});
|
|
324
324
|
//#endregion
|
|
325
325
|
//#region src/controls/GameToggle/GameToggle.tsx
|
|
326
|
-
function
|
|
327
|
-
return /* @__PURE__ */
|
|
326
|
+
function Ue({ checked: e, disabled: t, label: n, onClick: r, hue: i }) {
|
|
327
|
+
return /* @__PURE__ */ K("button", {
|
|
328
328
|
type: "button",
|
|
329
329
|
className: "game-ui-toggle",
|
|
330
330
|
role: "switch",
|
|
@@ -334,36 +334,36 @@ function Ve({ checked: e, disabled: t, label: n, onClick: r, hue: i }) {
|
|
|
334
334
|
"data-game-ui-paint": "",
|
|
335
335
|
style: v(i),
|
|
336
336
|
children: [
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ G(y, {}),
|
|
338
|
+
/* @__PURE__ */ G("span", { children: n }),
|
|
339
|
+
/* @__PURE__ */ G(p, {}),
|
|
340
|
+
/* @__PURE__ */ G("span", {
|
|
341
341
|
className: "game-ui-toggle-track",
|
|
342
342
|
"aria-hidden": "true",
|
|
343
|
-
children: /* @__PURE__ */
|
|
343
|
+
children: /* @__PURE__ */ G("span", { className: "game-ui-toggle-thumb" })
|
|
344
344
|
})
|
|
345
345
|
]
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
348
|
//#endregion
|
|
349
349
|
//#region src/feedback/GameEmptyState/GameEmptyState.tsx
|
|
350
|
-
function
|
|
351
|
-
return /* @__PURE__ */
|
|
350
|
+
function We({ action: e, className: t, description: n, icon: r, title: i }) {
|
|
351
|
+
return /* @__PURE__ */ K("div", {
|
|
352
352
|
className: ["game-ui-empty-state", t].filter(Boolean).join(" "),
|
|
353
353
|
children: [
|
|
354
|
-
r ? /* @__PURE__ */
|
|
354
|
+
r ? /* @__PURE__ */ G(Y, {
|
|
355
355
|
icon: r,
|
|
356
356
|
size: "lg"
|
|
357
357
|
}) : null,
|
|
358
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ G("strong", {
|
|
359
359
|
className: "game-ui-empty-state-title",
|
|
360
360
|
children: i
|
|
361
361
|
}),
|
|
362
|
-
n ? /* @__PURE__ */
|
|
362
|
+
n ? /* @__PURE__ */ G("p", {
|
|
363
363
|
className: "game-ui-empty-state-body",
|
|
364
364
|
children: n
|
|
365
365
|
}) : null,
|
|
366
|
-
e ? /* @__PURE__ */
|
|
366
|
+
e ? /* @__PURE__ */ G("div", {
|
|
367
367
|
className: "game-ui-empty-state-action",
|
|
368
368
|
children: e
|
|
369
369
|
}) : null
|
|
@@ -371,16 +371,49 @@ function He({ action: e, className: t, description: n, icon: r, title: i }) {
|
|
|
371
371
|
});
|
|
372
372
|
}
|
|
373
373
|
//#endregion
|
|
374
|
+
//#region src/feedback/shared/trigger-slot.ts
|
|
375
|
+
var Ge = Symbol.for("react.lazy"), Ke = "a[href], button, [tabindex]:not([tabindex=\"-1\"])";
|
|
376
|
+
function X(e) {
|
|
377
|
+
return typeof e == "object" && !!e && !B(e) && e.$$typeof === Ge;
|
|
378
|
+
}
|
|
379
|
+
var Z = /* @__PURE__ */ new Set();
|
|
380
|
+
function qe(e) {
|
|
381
|
+
Z.has(e) || (Z.add(e), console.warn(`${e}: the trigger arrived as a lazy element from a Server Component. This is supported and works. Building the trigger inside a client component keeps the original element.`));
|
|
382
|
+
}
|
|
383
|
+
function Q(e, { component: t, lazy: n, active: r }) {
|
|
384
|
+
let [i, a] = W(null);
|
|
385
|
+
return H(() => {
|
|
386
|
+
let i = e.current;
|
|
387
|
+
if (!r || !i) return;
|
|
388
|
+
n && qe(t);
|
|
389
|
+
let o = null, s = () => {
|
|
390
|
+
let e = i.querySelector(Ke);
|
|
391
|
+
e !== o && (o = e, a(e));
|
|
392
|
+
};
|
|
393
|
+
s();
|
|
394
|
+
let c = new MutationObserver(s);
|
|
395
|
+
return c.observe(i, {
|
|
396
|
+
childList: !0,
|
|
397
|
+
subtree: !0
|
|
398
|
+
}), () => c.disconnect();
|
|
399
|
+
}, [
|
|
400
|
+
r,
|
|
401
|
+
t,
|
|
402
|
+
n,
|
|
403
|
+
e
|
|
404
|
+
]), r ? i : null;
|
|
405
|
+
}
|
|
406
|
+
//#endregion
|
|
374
407
|
//#region src/feedback/GameLoadingState/GameLoadingState.tsx
|
|
375
|
-
function
|
|
376
|
-
return /* @__PURE__ */
|
|
408
|
+
function Je({ label: e, tone: t = "loading" }) {
|
|
409
|
+
return /* @__PURE__ */ K("div", {
|
|
377
410
|
className: "game-ui-loading-state",
|
|
378
411
|
"data-loading-tone": t,
|
|
379
412
|
role: t === "error" ? "alert" : "status",
|
|
380
|
-
children: [/* @__PURE__ */
|
|
413
|
+
children: [/* @__PURE__ */ G(Y, {
|
|
381
414
|
icon: t === "error" ? "alert" : "timer",
|
|
382
415
|
size: "lg"
|
|
383
|
-
}), /* @__PURE__ */
|
|
416
|
+
}), /* @__PURE__ */ G("span", { children: e })]
|
|
384
417
|
});
|
|
385
418
|
}
|
|
386
419
|
//#endregion
|
|
@@ -394,7 +427,7 @@ function $(e, t, n = 0, r = 4) {
|
|
|
394
427
|
}
|
|
395
428
|
//#endregion
|
|
396
429
|
//#region src/feedback/GameProgress/controller.ts
|
|
397
|
-
function
|
|
430
|
+
function Ye(e, t, n, r) {
|
|
398
431
|
let i = e.parentElement, a = e.querySelector("[data-progress-track]"), o = e.querySelector("[data-progress-clip]"), s = e.querySelector("[data-progress-front]"), c = 0, l = n, u = n, d = n, f, p = 0, m = !1, h = (e, t) => {
|
|
399
432
|
e.getAttribute("d") !== t && e.setAttribute("d", t);
|
|
400
433
|
}, _ = (e = 0) => h(s, $(c || 100, l, e)), v = () => {
|
|
@@ -438,19 +471,19 @@ function Ue(e, t, n, r) {
|
|
|
438
471
|
}
|
|
439
472
|
//#endregion
|
|
440
473
|
//#region src/feedback/GameProgress/GameProgress.tsx
|
|
441
|
-
function
|
|
442
|
-
let o = !Number.isFinite(t) || t <= 0 ? 100 : t, s = Math.max(0, Math.min(o, Number.isFinite(e) ? e : 0)), c = s / o, u = c * 100, d = `progress-${
|
|
443
|
-
v.current = c,
|
|
474
|
+
function Xe({ value: e, max: t = 100, label: n, showValue: r = !1, valueLabel: i, className: a }) {
|
|
475
|
+
let o = !Number.isFinite(t) || t <= 0 ? 100 : t, s = Math.max(0, Math.min(o, Number.isFinite(e) ? e : 0)), c = s / o, u = c * 100, d = `progress-${V().replace(/[^a-zA-Z0-9_-]/g, "")}`, f = l(), p = U(null), h = U(null), _ = U(c).current, v = U(c);
|
|
476
|
+
v.current = c, H(() => {
|
|
444
477
|
if (!p.current) return;
|
|
445
|
-
let e =
|
|
478
|
+
let e = Ye(p.current, m(d), v.current, !f);
|
|
446
479
|
return h.current = e, () => {
|
|
447
480
|
e.dispose(), h.current = null;
|
|
448
481
|
};
|
|
449
|
-
}, [d, f]),
|
|
482
|
+
}, [d, f]), H(() => h.current?.update(c), [c, f]);
|
|
450
483
|
let y = b(g(100, 10, 5), 1, 0, m(d), 4);
|
|
451
|
-
return /* @__PURE__ */
|
|
484
|
+
return /* @__PURE__ */ K("div", {
|
|
452
485
|
className: ["game-ui-progress", a].filter(Boolean).join(" "),
|
|
453
|
-
children: [/* @__PURE__ */
|
|
486
|
+
children: [/* @__PURE__ */ G("div", {
|
|
454
487
|
role: "progressbar",
|
|
455
488
|
"aria-label": n,
|
|
456
489
|
"aria-valuemin": 0,
|
|
@@ -458,34 +491,34 @@ function We({ value: e, max: t = 100, label: n, showValue: r = !1, valueLabel: i
|
|
|
458
491
|
"aria-valuenow": s,
|
|
459
492
|
"aria-valuetext": i || void 0,
|
|
460
493
|
className: "game-ui-progress-track",
|
|
461
|
-
children: /* @__PURE__ */
|
|
494
|
+
children: /* @__PURE__ */ K("svg", {
|
|
462
495
|
ref: p,
|
|
463
496
|
viewBox: "0 0 108 18",
|
|
464
497
|
preserveAspectRatio: "none",
|
|
465
498
|
"aria-hidden": "true",
|
|
466
499
|
focusable: "false",
|
|
467
500
|
children: [
|
|
468
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ K("defs", { children: [/* @__PURE__ */ G("clipPath", {
|
|
469
502
|
id: `${d}-clip`,
|
|
470
|
-
children: /* @__PURE__ */
|
|
503
|
+
children: /* @__PURE__ */ G("path", {
|
|
471
504
|
"data-progress-clip": "",
|
|
472
505
|
d: y
|
|
473
506
|
})
|
|
474
|
-
}), /* @__PURE__ */
|
|
507
|
+
}), /* @__PURE__ */ K("linearGradient", {
|
|
475
508
|
id: `${d}-fill`,
|
|
476
|
-
children: [/* @__PURE__ */
|
|
509
|
+
children: [/* @__PURE__ */ G("stop", {
|
|
477
510
|
offset: "0%",
|
|
478
511
|
style: { stopColor: "var(--game-ui-cta-from)" }
|
|
479
|
-
}), /* @__PURE__ */
|
|
512
|
+
}), /* @__PURE__ */ G("stop", {
|
|
480
513
|
offset: "100%",
|
|
481
514
|
style: { stopColor: "var(--game-ui-cta-to)" }
|
|
482
515
|
})]
|
|
483
516
|
})] }),
|
|
484
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ G("path", {
|
|
485
518
|
"data-progress-track": "",
|
|
486
519
|
d: y
|
|
487
520
|
}),
|
|
488
|
-
/* @__PURE__ */
|
|
521
|
+
/* @__PURE__ */ G("path", {
|
|
489
522
|
"data-progress-front": "",
|
|
490
523
|
d: $(100, _),
|
|
491
524
|
clipPath: `url(#${d}-clip)`,
|
|
@@ -493,7 +526,7 @@ function We({ value: e, max: t = 100, label: n, showValue: r = !1, valueLabel: i
|
|
|
493
526
|
})
|
|
494
527
|
]
|
|
495
528
|
})
|
|
496
|
-
}), i || r ? /* @__PURE__ */
|
|
529
|
+
}), i || r ? /* @__PURE__ */ G("span", {
|
|
497
530
|
className: "game-ui-progress-value",
|
|
498
531
|
children: i || `${Math.round(u)}%`
|
|
499
532
|
}) : null]
|
|
@@ -501,8 +534,8 @@ function We({ value: e, max: t = 100, label: n, showValue: r = !1, valueLabel: i
|
|
|
501
534
|
}
|
|
502
535
|
//#endregion
|
|
503
536
|
//#region src/feedback/GameToast/GameToast.tsx
|
|
504
|
-
function
|
|
505
|
-
return /* @__PURE__ */
|
|
537
|
+
function Ze({ children: e, tone: t = "info" }) {
|
|
538
|
+
return /* @__PURE__ */ K("div", {
|
|
506
539
|
className: "game-ui-toast",
|
|
507
540
|
"data-toast-tone": t,
|
|
508
541
|
"data-game-ui-paint": "",
|
|
@@ -510,38 +543,52 @@ function Ge({ children: e, tone: t = "info" }) {
|
|
|
510
543
|
"data-game-ui-danger": t === "danger" ? "true" : void 0,
|
|
511
544
|
style: v(t === "success" ? "leaf" : "sky"),
|
|
512
545
|
role: t === "danger" ? "alert" : "status",
|
|
513
|
-
children: [/* @__PURE__ */
|
|
546
|
+
children: [/* @__PURE__ */ G(y, { static: !0 }), e]
|
|
514
547
|
});
|
|
515
548
|
}
|
|
516
549
|
//#endregion
|
|
517
550
|
//#region src/feedback/GameTooltip/GameTooltip.tsx
|
|
518
|
-
function
|
|
519
|
-
let i =
|
|
520
|
-
|
|
551
|
+
function Qe({ children: e, label: t, align: n = "center", placement: r = "top" }) {
|
|
552
|
+
let i = V(), a = U(null), o = Q(a, {
|
|
553
|
+
component: "GameTooltip",
|
|
554
|
+
lazy: !B(e) && X(e),
|
|
555
|
+
active: !B(e)
|
|
556
|
+
});
|
|
557
|
+
return H(() => {
|
|
558
|
+
if (!o) return;
|
|
559
|
+
let e = o.getAttribute("aria-describedby");
|
|
560
|
+
return o.setAttribute("aria-describedby", [e, i].filter(Boolean).join(" ")), () => {
|
|
561
|
+
e === null ? o.removeAttribute("aria-describedby") : o.setAttribute("aria-describedby", e);
|
|
562
|
+
};
|
|
563
|
+
}, [o, i]), /* @__PURE__ */ K("span", {
|
|
521
564
|
className: "game-ui-tooltip",
|
|
522
|
-
children: [
|
|
565
|
+
children: [B(e) ? Ae(e, { "aria-describedby": [e.props["aria-describedby"], i].filter(Boolean).join(" ") }) : /* @__PURE__ */ G("span", {
|
|
566
|
+
className: "game-ui-trigger-slot",
|
|
567
|
+
ref: a,
|
|
568
|
+
children: e
|
|
569
|
+
}), /* @__PURE__ */ K("span", {
|
|
523
570
|
id: i,
|
|
524
571
|
role: "tooltip",
|
|
525
572
|
"data-game-ui-paint": "",
|
|
526
573
|
"data-tooltip-align": n,
|
|
527
574
|
"data-tooltip-placement": r,
|
|
528
|
-
children: [/* @__PURE__ */
|
|
575
|
+
children: [/* @__PURE__ */ G(y, { static: !0 }), t]
|
|
529
576
|
})]
|
|
530
577
|
});
|
|
531
578
|
}
|
|
532
579
|
//#endregion
|
|
533
580
|
//#region src/containers/GameDialog/GameDialog.tsx
|
|
534
|
-
function
|
|
535
|
-
let r =
|
|
536
|
-
return /* @__PURE__ */
|
|
581
|
+
function $e({ children: e, className: t, title: n }) {
|
|
582
|
+
let r = V();
|
|
583
|
+
return /* @__PURE__ */ K("section", {
|
|
537
584
|
"aria-labelledby": r,
|
|
538
585
|
"aria-modal": "true",
|
|
539
586
|
className: ["game-ui-dialog", t].filter(Boolean).join(" "),
|
|
540
587
|
role: "dialog",
|
|
541
|
-
children: [/* @__PURE__ */
|
|
588
|
+
children: [/* @__PURE__ */ G("h2", {
|
|
542
589
|
id: r,
|
|
543
590
|
children: n
|
|
544
|
-
}), /* @__PURE__ */
|
|
591
|
+
}), /* @__PURE__ */ G("div", {
|
|
545
592
|
className: "game-ui-dialog-body",
|
|
546
593
|
children: e
|
|
547
594
|
})]
|
|
@@ -549,24 +596,24 @@ function qe({ children: e, className: t, title: n }) {
|
|
|
549
596
|
}
|
|
550
597
|
//#endregion
|
|
551
598
|
//#region src/containers/GameHistoryPanel/GameHistoryPanel.tsx
|
|
552
|
-
function
|
|
553
|
-
return /* @__PURE__ */
|
|
599
|
+
function et({ entries: e, label: t }) {
|
|
600
|
+
return /* @__PURE__ */ G("section", {
|
|
554
601
|
"aria-label": t,
|
|
555
602
|
className: "game-ui-history",
|
|
556
|
-
children: e.map((e) => /* @__PURE__ */
|
|
603
|
+
children: e.map((e) => /* @__PURE__ */ K("article", {
|
|
557
604
|
className: "game-ui-history-entry",
|
|
558
605
|
"data-entry-kind": e.kind,
|
|
559
|
-
children: [/* @__PURE__ */
|
|
606
|
+
children: [/* @__PURE__ */ K("div", {
|
|
560
607
|
className: "game-ui-history-entry-header",
|
|
561
|
-
children: [/* @__PURE__ */
|
|
562
|
-
}), /* @__PURE__ */
|
|
608
|
+
children: [/* @__PURE__ */ G("strong", { children: e.speaker }), /* @__PURE__ */ G("span", { children: e.meta })]
|
|
609
|
+
}), /* @__PURE__ */ G("p", { children: e.text })]
|
|
563
610
|
}, e.id))
|
|
564
611
|
});
|
|
565
612
|
}
|
|
566
613
|
//#endregion
|
|
567
614
|
//#region src/containers/GameHudActions/GameHudActions.tsx
|
|
568
|
-
function
|
|
569
|
-
return /* @__PURE__ */
|
|
615
|
+
function tt({ children: e, className: t, label: n, ...r }) {
|
|
616
|
+
return /* @__PURE__ */ G("nav", {
|
|
570
617
|
"aria-label": n,
|
|
571
618
|
className: ["game-ui-hud-actions", t].filter(Boolean).join(" "),
|
|
572
619
|
"data-safe-area": "hud-actions",
|
|
@@ -576,54 +623,54 @@ function Ye({ children: e, className: t, label: n, ...r }) {
|
|
|
576
623
|
}
|
|
577
624
|
//#endregion
|
|
578
625
|
//#region src/containers/GamePanel/GamePanel.tsx
|
|
579
|
-
function
|
|
626
|
+
function nt({ children: e, className: t, title: n, tone: r = "default", ...i }) {
|
|
580
627
|
let a = ["game-ui-panel", t].filter(Boolean).join(" ");
|
|
581
|
-
return /* @__PURE__ */
|
|
628
|
+
return /* @__PURE__ */ K("section", {
|
|
582
629
|
...i,
|
|
583
630
|
className: a,
|
|
584
631
|
"data-panel-tone": r,
|
|
585
|
-
children: [n ? /* @__PURE__ */
|
|
632
|
+
children: [n ? /* @__PURE__ */ G("h3", { children: n }) : null, e]
|
|
586
633
|
});
|
|
587
634
|
}
|
|
588
635
|
//#endregion
|
|
589
636
|
//#region src/game/FirstSessionOnboarding/FirstSessionOnboarding.tsx
|
|
590
|
-
function
|
|
591
|
-
return n ? /* @__PURE__ */
|
|
637
|
+
function rt({ labels: e, onDismiss: t, open: n }) {
|
|
638
|
+
return n ? /* @__PURE__ */ K("aside", {
|
|
592
639
|
"aria-labelledby": "swimmer-first-session-onboarding-title",
|
|
593
640
|
"aria-modal": "true",
|
|
594
641
|
className: "swimmer-first-session-onboarding",
|
|
595
642
|
role: "dialog",
|
|
596
|
-
children: [/* @__PURE__ */
|
|
643
|
+
children: [/* @__PURE__ */ G("div", { className: "swimmer-first-session-onboarding-scrim" }), /* @__PURE__ */ K("div", {
|
|
597
644
|
className: "swimmer-first-session-onboarding-card",
|
|
598
645
|
children: [
|
|
599
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ G(Y, {
|
|
600
647
|
icon: "trophy",
|
|
601
648
|
size: "lg"
|
|
602
649
|
}),
|
|
603
|
-
/* @__PURE__ */
|
|
650
|
+
/* @__PURE__ */ G(_, {
|
|
604
651
|
tone: "warning",
|
|
605
652
|
children: e.badge
|
|
606
653
|
}),
|
|
607
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ G("h2", {
|
|
608
655
|
id: "swimmer-first-session-onboarding-title",
|
|
609
656
|
children: e.title
|
|
610
657
|
}),
|
|
611
|
-
/* @__PURE__ */
|
|
612
|
-
/* @__PURE__ */
|
|
658
|
+
/* @__PURE__ */ G("p", { children: e.body }),
|
|
659
|
+
/* @__PURE__ */ G("ol", {
|
|
613
660
|
className: "swimmer-first-session-onboarding-steps",
|
|
614
|
-
children: e.steps.map((e, t) => /* @__PURE__ */
|
|
615
|
-
/* @__PURE__ */
|
|
616
|
-
/* @__PURE__ */
|
|
617
|
-
/* @__PURE__ */
|
|
661
|
+
children: e.steps.map((e, t) => /* @__PURE__ */ K("li", { children: [
|
|
662
|
+
/* @__PURE__ */ G("span", { children: String(t + 1).padStart(2, "0") }),
|
|
663
|
+
/* @__PURE__ */ G("strong", { children: e.title }),
|
|
664
|
+
/* @__PURE__ */ G("small", { children: e.body })
|
|
618
665
|
] }, e.title))
|
|
619
666
|
}),
|
|
620
|
-
/* @__PURE__ */
|
|
667
|
+
/* @__PURE__ */ K("div", {
|
|
621
668
|
className: "swimmer-first-session-onboarding-actions",
|
|
622
|
-
children: [/* @__PURE__ */
|
|
669
|
+
children: [/* @__PURE__ */ G(h, {
|
|
623
670
|
onClick: t,
|
|
624
671
|
variant: "primary",
|
|
625
672
|
children: e.start
|
|
626
|
-
}), /* @__PURE__ */
|
|
673
|
+
}), /* @__PURE__ */ G(h, {
|
|
627
674
|
onClick: t,
|
|
628
675
|
variant: "ghost",
|
|
629
676
|
children: e.skip
|
|
@@ -635,26 +682,26 @@ function Ze({ labels: e, onDismiss: t, open: n }) {
|
|
|
635
682
|
}
|
|
636
683
|
//#endregion
|
|
637
684
|
//#region src/game/GameRadialMenu/GameRadialMenu.tsx
|
|
638
|
-
function
|
|
639
|
-
return /* @__PURE__ */
|
|
685
|
+
function it({ items: e, label: t, onSelect: n }) {
|
|
686
|
+
return /* @__PURE__ */ G("div", {
|
|
640
687
|
"aria-label": t,
|
|
641
688
|
className: "game-ui-radial-menu",
|
|
642
689
|
role: "group",
|
|
643
690
|
style: { "--radial-count": e.length },
|
|
644
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
691
|
+
children: e.map((e, t) => /* @__PURE__ */ K("button", {
|
|
645
692
|
className: "game-ui-radial-item",
|
|
646
693
|
onClick: n ? () => n(e.id) : void 0,
|
|
647
694
|
style: { "--radial-index": t },
|
|
648
695
|
type: "button",
|
|
649
696
|
"data-game-ui-paint": "",
|
|
650
|
-
children: [/* @__PURE__ */
|
|
697
|
+
children: [/* @__PURE__ */ G(y, {}), e.label]
|
|
651
698
|
}, e.id))
|
|
652
699
|
});
|
|
653
700
|
}
|
|
654
701
|
//#endregion
|
|
655
702
|
//#region src/game/GameStageTile/GameStageTile.tsx
|
|
656
|
-
function
|
|
657
|
-
return /* @__PURE__ */
|
|
703
|
+
function at({ badge: e, className: t, icon: n, kicker: r, selected: i = !1, summary: a, title: o, tone: s = "daily", type: c = "button", ...l }) {
|
|
704
|
+
return /* @__PURE__ */ K("button", {
|
|
658
705
|
"aria-pressed": i,
|
|
659
706
|
className: ["game-ui-stage-tile", t].filter(Boolean).join(" "),
|
|
660
707
|
"data-stage-tone": s,
|
|
@@ -662,26 +709,26 @@ function $e({ badge: e, className: t, icon: n, kicker: r, selected: i = !1, summ
|
|
|
662
709
|
...l,
|
|
663
710
|
"data-game-ui-paint": "",
|
|
664
711
|
children: [
|
|
665
|
-
/* @__PURE__ */
|
|
666
|
-
n ? /* @__PURE__ */
|
|
712
|
+
/* @__PURE__ */ G(y, {}),
|
|
713
|
+
n ? /* @__PURE__ */ G(Y, {
|
|
667
714
|
icon: n,
|
|
668
715
|
size: "lg"
|
|
669
716
|
}) : null,
|
|
670
|
-
/* @__PURE__ */
|
|
717
|
+
/* @__PURE__ */ K("span", {
|
|
671
718
|
className: "game-ui-stage-tile-copy",
|
|
672
719
|
children: [
|
|
673
|
-
/* @__PURE__ */
|
|
674
|
-
/* @__PURE__ */
|
|
675
|
-
/* @__PURE__ */
|
|
720
|
+
/* @__PURE__ */ G("small", { children: r }),
|
|
721
|
+
/* @__PURE__ */ G("strong", { children: o }),
|
|
722
|
+
/* @__PURE__ */ G("span", { children: a })
|
|
676
723
|
]
|
|
677
724
|
}),
|
|
678
|
-
e ? /* @__PURE__ */
|
|
725
|
+
e ? /* @__PURE__ */ G(_, {
|
|
679
726
|
tone: i ? "success" : "neutral",
|
|
680
727
|
children: e
|
|
681
728
|
}) : null,
|
|
682
|
-
/* @__PURE__ */
|
|
729
|
+
/* @__PURE__ */ G(p, {})
|
|
683
730
|
]
|
|
684
731
|
});
|
|
685
732
|
}
|
|
686
733
|
//#endregion
|
|
687
|
-
export {
|
|
734
|
+
export { Ie as C, Me as D, je as E, Ne as O, Le as S, Pe as T, Ve as _, tt as a, Y as b, Qe as c, Je as d, X as f, He as g, Ue as h, nt as i, q as k, Ze as l, We as m, it as n, et as o, Q as p, rt as r, $e as s, at as t, Xe as u, Be as v, Fe as w, Re as x, ze as y };
|