@pieai/swimmer-ui-kit 3.0.0 → 3.1.0
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 +11 -2
- package/README.md +3 -3
- package/dist/GameAvatar-CRJ1r8l5.js +920 -0
- package/dist/GameStageTile-F41PxXDG.js +687 -0
- package/dist/{LiquidGroup-BXw1tv9H.js → LiquidGroup-RTK_Uvgw.js} +845 -376
- package/dist/index.d.ts +10 -1
- package/dist/index.js +159 -159
- package/dist/liquid-effects.js +36 -37
- package/dist/liquid-presence.d.ts +48 -0
- package/dist/liquid-presence.js +584 -413
- package/dist/preview.js +132 -132
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/GameStageTile-DwU_Vvi8.js +0 -1597
- package/dist/reducedMotion-B8kv-v64.js +0 -473
package/dist/index.d.ts
CHANGED
|
@@ -1146,12 +1146,21 @@ export declare interface GameToggleProps extends Pick<ButtonHTMLAttributes<HTMLB
|
|
|
1146
1146
|
hue?: GameUiHue;
|
|
1147
1147
|
}
|
|
1148
1148
|
|
|
1149
|
-
export declare function GameTooltip({ children, label }: GameTooltipProps): ReactNode;
|
|
1149
|
+
export declare function GameTooltip({ children, label, align, placement, }: GameTooltipProps): ReactNode;
|
|
1150
1150
|
|
|
1151
1151
|
export declare interface GameTooltipProps {
|
|
1152
1152
|
/** A single focusable trigger element (e.g. GameIconButton). */
|
|
1153
1153
|
children: ReactNode;
|
|
1154
|
+
/** Plain text; an explicit line break (\n) is kept. */
|
|
1154
1155
|
label: string;
|
|
1156
|
+
/**
|
|
1157
|
+
* Which edges meet the trigger. `center` (default) centres the bubble; `start`
|
|
1158
|
+
* aligns its left edge with the trigger and extends right; `end` aligns right
|
|
1159
|
+
* edges and extends left.
|
|
1160
|
+
*/
|
|
1161
|
+
align?: 'center' | 'start' | 'end';
|
|
1162
|
+
/** Above the trigger (default) or below it. */
|
|
1163
|
+
placement?: 'top' | 'bottom';
|
|
1155
1164
|
}
|
|
1156
1165
|
|
|
1157
1166
|
export declare interface GameUiHistoryEntry {
|
package/dist/index.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { createElement as
|
|
2
|
+
import { S as e, a as t, t as n } from "./LiquidGroup-RTK_Uvgw.js";
|
|
3
|
+
import { C as r, D as i, E as a, S as o, T as s, _ as c, a as l, b as u, c as d, d as f, f as p, g as m, h, i as g, l as _, m as v, n as y, o as b, p as x, r as S, s as C, t as w, u as T, v as E, x as D, y as O } from "./GameStageTile-F41PxXDG.js";
|
|
4
|
+
import { c as k, f as A, h as ee, i as j, m as te, n as M, o as N, p as ne, r as re, s as P, t as ie, y as ae } from "./GameAvatar-CRJ1r8l5.js";
|
|
5
|
+
import { createElement as oe, forwardRef as F, useCallback as I, useEffect as L, useId as R, useRef as z, useState as B } from "react";
|
|
6
6
|
import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
7
7
|
import { FloatingPortal as W, autoUpdate as G, flip as K, offset as q, safePolygon as se, shift as ce, useClick as le, useDismiss as ue, useFloating as de, useFocus as fe, useHover as pe, useInteractions as me, useRole as he } from "@floating-ui/react";
|
|
8
8
|
//#region src/controls/GameListRow/GameListRow.tsx
|
|
9
|
-
function ge({ title: e, description:
|
|
10
|
-
let
|
|
11
|
-
|
|
9
|
+
function ge({ title: e, description: t, thumbnail: n, current: r = !1, selected: i, disabled: a = !1, onSelect: o, selectLabel: s, actions: c, className: l, hue: u, ...d }) {
|
|
10
|
+
let f = z(null), p = /* @__PURE__ */ U(V, { children: [
|
|
11
|
+
n ? /* @__PURE__ */ H("span", {
|
|
12
12
|
className: "game-ui-list-row-thumbnail",
|
|
13
|
-
children:
|
|
13
|
+
children: n
|
|
14
14
|
}) : null,
|
|
15
15
|
/* @__PURE__ */ U("span", {
|
|
16
16
|
className: "game-ui-list-row-copy",
|
|
17
17
|
children: [/* @__PURE__ */ H("span", {
|
|
18
18
|
className: "game-ui-list-row-title",
|
|
19
19
|
children: e
|
|
20
|
-
}),
|
|
20
|
+
}), t ? /* @__PURE__ */ H("span", {
|
|
21
21
|
className: "game-ui-list-row-description",
|
|
22
|
-
children:
|
|
22
|
+
children: t
|
|
23
23
|
}) : null]
|
|
24
24
|
}),
|
|
25
|
-
|
|
25
|
+
r ? /* @__PURE__ */ H("span", {
|
|
26
26
|
className: "game-ui-list-row-current",
|
|
27
27
|
"aria-hidden": "true"
|
|
28
28
|
}) : null
|
|
29
29
|
] });
|
|
30
30
|
return /* @__PURE__ */ U("div", {
|
|
31
|
-
...
|
|
32
|
-
className: ["game-ui-list-row",
|
|
33
|
-
"data-selected":
|
|
34
|
-
"data-game-ui-disabled":
|
|
31
|
+
...d,
|
|
32
|
+
className: ["game-ui-list-row", l].filter(Boolean).join(" "),
|
|
33
|
+
"data-selected": i || void 0,
|
|
34
|
+
"data-game-ui-disabled": a || void 0,
|
|
35
35
|
"data-game-ui-paint": "",
|
|
36
36
|
style: {
|
|
37
|
-
...
|
|
38
|
-
...
|
|
37
|
+
...N(u),
|
|
38
|
+
...d.style
|
|
39
39
|
},
|
|
40
40
|
children: [
|
|
41
|
-
/* @__PURE__ */ H(
|
|
42
|
-
static: !
|
|
43
|
-
pressTarget:
|
|
41
|
+
/* @__PURE__ */ H(P, {
|
|
42
|
+
static: !o,
|
|
43
|
+
pressTarget: f
|
|
44
44
|
}),
|
|
45
|
-
|
|
45
|
+
o ? /* @__PURE__ */ U("button", {
|
|
46
46
|
type: "button",
|
|
47
47
|
className: "game-ui-list-row-main",
|
|
48
|
-
ref:
|
|
49
|
-
onClick:
|
|
50
|
-
disabled:
|
|
51
|
-
"aria-label":
|
|
52
|
-
"aria-current":
|
|
53
|
-
"aria-pressed":
|
|
54
|
-
children: [
|
|
48
|
+
ref: f,
|
|
49
|
+
onClick: o,
|
|
50
|
+
disabled: a,
|
|
51
|
+
"aria-label": s,
|
|
52
|
+
"aria-current": r ? "true" : void 0,
|
|
53
|
+
"aria-pressed": i,
|
|
54
|
+
children: [p, /* @__PURE__ */ H(k, {})]
|
|
55
55
|
}) : /* @__PURE__ */ U("div", {
|
|
56
56
|
className: "game-ui-list-row-main",
|
|
57
|
-
"aria-current":
|
|
58
|
-
children: [
|
|
57
|
+
"aria-current": r ? "true" : void 0,
|
|
58
|
+
children: [p, /* @__PURE__ */ H(k, {})]
|
|
59
59
|
}),
|
|
60
|
-
|
|
60
|
+
c ? /* @__PURE__ */ H("div", {
|
|
61
61
|
className: "game-ui-list-row-actions",
|
|
62
|
-
children:
|
|
62
|
+
children: c
|
|
63
63
|
}) : null
|
|
64
64
|
]
|
|
65
65
|
});
|
|
@@ -165,10 +165,10 @@ function _e({ length: e = 6, value: t, onChange: n, onComplete: r, invalid: i =
|
|
|
165
165
|
}
|
|
166
166
|
//#endregion
|
|
167
167
|
//#region src/controls/GameSelect/GameSelect.tsx
|
|
168
|
-
var ve =
|
|
168
|
+
var ve = F(function({ className: e, invalid: t, hue: n, style: r, ...i }, a) {
|
|
169
169
|
return /* @__PURE__ */ H("span", {
|
|
170
170
|
className: "game-ui-select-frame",
|
|
171
|
-
children: /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ oe("select", {
|
|
172
172
|
...i,
|
|
173
173
|
ref: a,
|
|
174
174
|
key: "control",
|
|
@@ -176,7 +176,7 @@ var ve = oe(function({ className: e, invalid: t, hue: n, style: r, ...i }, a) {
|
|
|
176
176
|
"data-invalid": t ? "true" : void 0,
|
|
177
177
|
"data-game-ui-paint": "",
|
|
178
178
|
style: {
|
|
179
|
-
...
|
|
179
|
+
...N(n),
|
|
180
180
|
...r
|
|
181
181
|
},
|
|
182
182
|
className: [
|
|
@@ -204,11 +204,11 @@ function ye({ heading: e, children: t, tone: n = "info", className: r, style: i,
|
|
|
204
204
|
"data-game-ui-meaning": n !== "neutral" && n !== "danger" ? "true" : void 0,
|
|
205
205
|
"data-game-ui-danger": n === "danger" ? "true" : void 0,
|
|
206
206
|
style: {
|
|
207
|
-
...
|
|
207
|
+
...N(n === "success" ? "leaf" : n === "warning" ? "sun" : "sky"),
|
|
208
208
|
...i
|
|
209
209
|
},
|
|
210
210
|
children: [
|
|
211
|
-
/* @__PURE__ */ H(
|
|
211
|
+
/* @__PURE__ */ H(P, { static: !0 }),
|
|
212
212
|
e ? /* @__PURE__ */ H("div", {
|
|
213
213
|
className: "game-ui-callout-title",
|
|
214
214
|
children: e
|
|
@@ -262,7 +262,7 @@ function be({ label: e, children: t }) {
|
|
|
262
262
|
n && e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), r(!1));
|
|
263
263
|
} }),
|
|
264
264
|
"data-game-ui-paint": "",
|
|
265
|
-
children: [/* @__PURE__ */ H(
|
|
265
|
+
children: [/* @__PURE__ */ H(P, {}), /* @__PURE__ */ U("svg", {
|
|
266
266
|
width: "20",
|
|
267
267
|
height: "20",
|
|
268
268
|
viewBox: "0 0 24 24",
|
|
@@ -307,7 +307,7 @@ function xe({ actionLabel: e, children: t, title: n }) {
|
|
|
307
307
|
return /* @__PURE__ */ U("section", {
|
|
308
308
|
"aria-label": n,
|
|
309
309
|
className: "game-ui-prompt",
|
|
310
|
-
children: [/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("h3", { children: n }), /* @__PURE__ */ H("p", { children: t })] }), e ? /* @__PURE__ */ H(
|
|
310
|
+
children: [/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("h3", { children: n }), /* @__PURE__ */ H("p", { children: t })] }), e ? /* @__PURE__ */ H(j, {
|
|
311
311
|
variant: "primary",
|
|
312
312
|
children: e
|
|
313
313
|
}) : null]
|
|
@@ -350,7 +350,7 @@ function Ce({ actions: e, children: t, className: n, defaultOpen: r = !0, labels
|
|
|
350
350
|
type: "button",
|
|
351
351
|
"data-game-ui-paint": "",
|
|
352
352
|
children: [
|
|
353
|
-
/* @__PURE__ */ H(
|
|
353
|
+
/* @__PURE__ */ H(P, {}),
|
|
354
354
|
/* @__PURE__ */ H("span", {
|
|
355
355
|
"aria-hidden": "true",
|
|
356
356
|
className: "game-ui-collapsible-chevron"
|
|
@@ -443,7 +443,7 @@ function Te({ children: e, className: t, closeLabel: n = "Close", closeOnBackdro
|
|
|
443
443
|
onClick: o,
|
|
444
444
|
type: "button",
|
|
445
445
|
"data-game-ui-paint": "",
|
|
446
|
-
children: [/* @__PURE__ */ H(
|
|
446
|
+
children: [/* @__PURE__ */ H(P, {}), /* @__PURE__ */ H(we, { kind: "close" })]
|
|
447
447
|
})]
|
|
448
448
|
}),
|
|
449
449
|
/* @__PURE__ */ H("div", {
|
|
@@ -565,42 +565,42 @@ function Ae() {
|
|
|
565
565
|
]
|
|
566
566
|
});
|
|
567
567
|
}
|
|
568
|
-
function je({ rarity: e, title:
|
|
569
|
-
let
|
|
568
|
+
function je({ rarity: e, title: n, caption: r, setLabel: i, rarityLabel: a, art: o, pips: s, sticker: c, back: l, label: u, faceDown: d, defaultFaceDown: f = !1, onFlip: p, spotlight: m = !1, sound: h = !1, tilt: g, className: _ }) {
|
|
569
|
+
let v = t(), [y, b] = B(f), x = d ?? y, [S, C] = B({
|
|
570
570
|
x: 50,
|
|
571
571
|
y: 50,
|
|
572
572
|
active: !1
|
|
573
|
-
}),
|
|
573
|
+
}), w = z(null);
|
|
574
574
|
L(() => {
|
|
575
|
-
|
|
575
|
+
v && C({
|
|
576
576
|
x: 50,
|
|
577
577
|
y: 50,
|
|
578
578
|
active: !1
|
|
579
579
|
});
|
|
580
|
-
}, [
|
|
580
|
+
}, [v]);
|
|
581
581
|
let T = (e) => {
|
|
582
|
-
let t =
|
|
583
|
-
if (t && Math.hypot(e.clientX - t.x, e.clientY - t.y) > De && (t.moved = !0),
|
|
582
|
+
let t = w.current;
|
|
583
|
+
if (t && Math.hypot(e.clientX - t.x, e.clientY - t.y) > De && (t.moved = !0), v) return;
|
|
584
584
|
let n = e.currentTarget.getBoundingClientRect();
|
|
585
585
|
if (n.width === 0 || n.height === 0) return;
|
|
586
586
|
let r = Math.min(100, Math.max(0, (e.clientX - n.left) / n.width * 100)), i = Math.min(100, Math.max(0, (e.clientY - n.top) / n.height * 100));
|
|
587
|
-
|
|
587
|
+
C({
|
|
588
588
|
x: r,
|
|
589
589
|
y: i,
|
|
590
590
|
active: !0
|
|
591
591
|
});
|
|
592
592
|
}, E = () => {
|
|
593
|
-
let t = !
|
|
594
|
-
|
|
595
|
-
}, D =
|
|
596
|
-
x: 50 + Math.min(1, Math.max(-1,
|
|
597
|
-
y: 50 + Math.min(1, Math.max(-1,
|
|
593
|
+
let t = !x;
|
|
594
|
+
d === void 0 && b(t), p?.(t), h && A(t ? "common" : e);
|
|
595
|
+
}, D = g && Number.isFinite(g.x) && Number.isFinite(g.y) ? {
|
|
596
|
+
x: 50 + Math.min(1, Math.max(-1, g.x)) * 50,
|
|
597
|
+
y: 50 + Math.min(1, Math.max(-1, g.y)) * 50,
|
|
598
598
|
active: !0
|
|
599
|
-
} : null, O =
|
|
599
|
+
} : null, O = v ? {
|
|
600
600
|
x: 50,
|
|
601
601
|
y: 50,
|
|
602
602
|
active: !1
|
|
603
|
-
} :
|
|
603
|
+
} : S.active ? S : D ?? S, k = {
|
|
604
604
|
"--card-mx": `${O.x}%`,
|
|
605
605
|
"--card-my": `${O.y}%`,
|
|
606
606
|
"--card-rx": `${O.active ? (50 - O.y) / 50 * X : 0}deg`,
|
|
@@ -611,16 +611,16 @@ function je({ rarity: e, title: t, caption: n, setLabel: r, rarityLabel: i, art:
|
|
|
611
611
|
className: [
|
|
612
612
|
"game-ui-collect-card",
|
|
613
613
|
`game-ui-collect-card--${e}`,
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
614
|
+
x ? "game-ui-collect-card--down" : null,
|
|
615
|
+
m ? "game-ui-collect-card--spotlight" : null,
|
|
616
|
+
_
|
|
617
617
|
].filter(Boolean).join(" "),
|
|
618
618
|
style: k,
|
|
619
|
-
"aria-label":
|
|
620
|
-
"aria-pressed":
|
|
619
|
+
"aria-label": u,
|
|
620
|
+
"aria-pressed": x,
|
|
621
621
|
"data-rarity": e,
|
|
622
622
|
onPointerDown: (e) => {
|
|
623
|
-
|
|
623
|
+
w.current = {
|
|
624
624
|
x: e.clientX,
|
|
625
625
|
y: e.clientY,
|
|
626
626
|
moved: !1
|
|
@@ -628,54 +628,54 @@ function je({ rarity: e, title: t, caption: n, setLabel: r, rarityLabel: i, art:
|
|
|
628
628
|
},
|
|
629
629
|
onPointerMove: T,
|
|
630
630
|
onPointerCancel: () => {
|
|
631
|
-
|
|
631
|
+
w.current = null, C((e) => ({
|
|
632
632
|
...e,
|
|
633
633
|
active: !1
|
|
634
634
|
}));
|
|
635
635
|
},
|
|
636
|
-
onPointerLeave: () =>
|
|
636
|
+
onPointerLeave: () => C((e) => ({
|
|
637
637
|
...e,
|
|
638
638
|
active: !1
|
|
639
639
|
})),
|
|
640
640
|
onClick: (e) => {
|
|
641
|
-
let t = e.detail !== 0 && (
|
|
642
|
-
|
|
641
|
+
let t = e.detail !== 0 && (w.current?.moved ?? !1);
|
|
642
|
+
w.current = null, t || E();
|
|
643
643
|
},
|
|
644
644
|
children: [/* @__PURE__ */ U("span", {
|
|
645
645
|
className: "game-ui-collect-card-face",
|
|
646
646
|
"aria-hidden": "true",
|
|
647
647
|
children: [
|
|
648
|
-
|
|
648
|
+
c ? /* @__PURE__ */ H("span", {
|
|
649
649
|
className: "game-ui-collect-card-sticker",
|
|
650
|
-
children:
|
|
650
|
+
children: c
|
|
651
651
|
}) : null,
|
|
652
652
|
/* @__PURE__ */ H(ke, { rarity: e }),
|
|
653
653
|
e === "legendary" ? /* @__PURE__ */ H("span", { className: "game-ui-collect-card-foil" }) : null,
|
|
654
654
|
/* @__PURE__ */ U("span", {
|
|
655
655
|
className: "game-ui-collect-card-inner",
|
|
656
656
|
children: [
|
|
657
|
-
|
|
657
|
+
i || a ? /* @__PURE__ */ U("span", {
|
|
658
658
|
className: "game-ui-collect-card-band",
|
|
659
|
-
children: [
|
|
659
|
+
children: [a ? /* @__PURE__ */ H("span", {
|
|
660
660
|
className: "game-ui-collect-card-chip",
|
|
661
|
-
children:
|
|
662
|
-
}) : null,
|
|
661
|
+
children: a
|
|
662
|
+
}) : null, i ? /* @__PURE__ */ H("span", { children: i }) : null]
|
|
663
663
|
}) : null,
|
|
664
664
|
/* @__PURE__ */ U("span", {
|
|
665
665
|
className: "game-ui-collect-card-art",
|
|
666
|
-
children: [
|
|
666
|
+
children: [o, e === "legendary" ? /* @__PURE__ */ H("span", { className: "game-ui-collect-card-foil" }) : null]
|
|
667
667
|
}),
|
|
668
668
|
/* @__PURE__ */ H("span", {
|
|
669
669
|
className: "game-ui-collect-card-title",
|
|
670
|
-
children:
|
|
670
|
+
children: n
|
|
671
671
|
}),
|
|
672
|
-
|
|
672
|
+
r ? /* @__PURE__ */ H("span", {
|
|
673
673
|
className: "game-ui-collect-card-caption",
|
|
674
|
-
children:
|
|
674
|
+
children: r
|
|
675
675
|
}) : null,
|
|
676
|
-
|
|
677
|
-
filled:
|
|
678
|
-
total:
|
|
676
|
+
s ? /* @__PURE__ */ H(Oe, {
|
|
677
|
+
filled: s.filled,
|
|
678
|
+
total: s.total
|
|
679
679
|
}) : null
|
|
680
680
|
]
|
|
681
681
|
}),
|
|
@@ -684,7 +684,7 @@ function je({ rarity: e, title: t, caption: n, setLabel: r, rarityLabel: i, art:
|
|
|
684
684
|
}), /* @__PURE__ */ H("span", {
|
|
685
685
|
className: "game-ui-collect-card-back",
|
|
686
686
|
"aria-hidden": "true",
|
|
687
|
-
children:
|
|
687
|
+
children: l ?? /* @__PURE__ */ H(Ae, {})
|
|
688
688
|
})]
|
|
689
689
|
});
|
|
690
690
|
}
|
|
@@ -709,72 +709,72 @@ function Me(e, t, n, r) {
|
|
|
709
709
|
};
|
|
710
710
|
}
|
|
711
711
|
function Ne() {
|
|
712
|
-
let e =
|
|
713
|
-
|
|
714
|
-
let
|
|
715
|
-
|
|
712
|
+
let e = t(), [n, r] = B("off"), [i, a] = B(null), o = z(!1), s = z(0), c = z(!1), l = z(e);
|
|
713
|
+
l.current = e;
|
|
714
|
+
let u = I(() => {
|
|
715
|
+
s.current++, c.current = !1;
|
|
716
716
|
}, []);
|
|
717
717
|
L(() => {
|
|
718
|
-
|
|
718
|
+
o.current = !0, Z() || r("unavailable");
|
|
719
719
|
let e = () => {
|
|
720
|
-
document.visibilityState !== "hidden" || !
|
|
720
|
+
document.visibilityState !== "hidden" || !c.current || (u(), r("off"), a(null));
|
|
721
721
|
};
|
|
722
722
|
return document.addEventListener("visibilitychange", e), () => {
|
|
723
|
-
document.removeEventListener("visibilitychange", e),
|
|
723
|
+
document.removeEventListener("visibilitychange", e), o.current = !1, u();
|
|
724
724
|
};
|
|
725
|
-
}, [
|
|
726
|
-
let
|
|
727
|
-
|
|
728
|
-
}, [
|
|
725
|
+
}, [u]);
|
|
726
|
+
let d = I(() => {
|
|
727
|
+
u(), a(null), r(Z() ? "off" : "unavailable");
|
|
728
|
+
}, [u]);
|
|
729
729
|
L(() => {
|
|
730
|
-
e &&
|
|
731
|
-
}, [e,
|
|
732
|
-
let
|
|
730
|
+
e && d();
|
|
731
|
+
}, [e, d]);
|
|
732
|
+
let f = I(async () => {
|
|
733
733
|
let e = Z();
|
|
734
|
-
if (!
|
|
735
|
-
if (!e) return
|
|
736
|
-
let t = ++
|
|
737
|
-
|
|
734
|
+
if (!o.current || c.current || l.current || Q()) return !1;
|
|
735
|
+
if (!e) return r("unavailable"), !1;
|
|
736
|
+
let t = ++s.current;
|
|
737
|
+
c.current = !0, r("requesting"), a(null);
|
|
738
738
|
try {
|
|
739
|
-
let
|
|
740
|
-
if (!
|
|
741
|
-
if (Q()) return
|
|
742
|
-
let i =
|
|
743
|
-
return
|
|
739
|
+
let n = e.requestPermission ? await e.requestPermission() : "granted";
|
|
740
|
+
if (!o.current || t !== s.current || l.current) return !1;
|
|
741
|
+
if (Q()) return d(), !1;
|
|
742
|
+
let i = n === "granted";
|
|
743
|
+
return r(i ? "enabled" : "denied"), i;
|
|
744
744
|
} catch {
|
|
745
|
-
return
|
|
745
|
+
return o.current && t === s.current && r("denied"), !1;
|
|
746
746
|
} finally {
|
|
747
|
-
t ===
|
|
747
|
+
t === s.current && (c.current = !1);
|
|
748
748
|
}
|
|
749
|
-
}, [
|
|
749
|
+
}, [d]);
|
|
750
750
|
return L(() => {
|
|
751
|
-
if (
|
|
752
|
-
let
|
|
751
|
+
if (n !== "enabled" || e) return;
|
|
752
|
+
let t = null, r = !1, i = -Infinity, o = (e) => {
|
|
753
753
|
if (document.visibilityState === "hidden" || e.beta === null || e.gamma === null || !Number.isFinite(e.beta) || !Number.isFinite(e.gamma)) return;
|
|
754
|
-
let
|
|
755
|
-
if (!Number.isFinite(
|
|
756
|
-
(!
|
|
754
|
+
let n = window.screen.orientation?.angle ?? 0;
|
|
755
|
+
if (!Number.isFinite(n)) return;
|
|
756
|
+
(!t || t.angle !== n) && (t = {
|
|
757
757
|
beta: e.beta,
|
|
758
758
|
gamma: e.gamma,
|
|
759
|
-
angle:
|
|
759
|
+
angle: n
|
|
760
760
|
});
|
|
761
761
|
let r = performance.now();
|
|
762
|
-
if (r -
|
|
763
|
-
|
|
764
|
-
let o = Me(e.beta, e.gamma,
|
|
765
|
-
o &&
|
|
762
|
+
if (r - i < 50) return;
|
|
763
|
+
i = r;
|
|
764
|
+
let o = Me(e.beta, e.gamma, t, n);
|
|
765
|
+
o && a((e) => e?.x === o.x && e.y === o.y ? e : o);
|
|
766
766
|
}, s = () => {
|
|
767
767
|
let e = document.visibilityState !== "hidden";
|
|
768
|
-
|
|
768
|
+
t = null, i = -Infinity, a(null), e && !r && (window.addEventListener("deviceorientation", o), r = !0), !e && r && (window.removeEventListener("deviceorientation", o), r = !1);
|
|
769
769
|
};
|
|
770
770
|
return s(), document.addEventListener("visibilitychange", s), () => {
|
|
771
771
|
r && window.removeEventListener("deviceorientation", o), document.removeEventListener("visibilitychange", s);
|
|
772
772
|
};
|
|
773
|
-
}, [
|
|
774
|
-
status:
|
|
775
|
-
tilt: e ||
|
|
776
|
-
enable:
|
|
777
|
-
disable:
|
|
773
|
+
}, [n, e]), {
|
|
774
|
+
status: n,
|
|
775
|
+
tilt: e || n !== "enabled" ? null : i,
|
|
776
|
+
enable: f,
|
|
777
|
+
disable: d,
|
|
778
778
|
reducedMotion: e
|
|
779
779
|
};
|
|
780
780
|
}
|
|
@@ -802,7 +802,7 @@ function Fe({ className: e, density: t = "comfortable", facts: n, label: r, vari
|
|
|
802
802
|
children: n.map((e) => /* @__PURE__ */ U("article", {
|
|
803
803
|
className: "game-ui-fact",
|
|
804
804
|
children: [
|
|
805
|
-
e.icon ? /* @__PURE__ */ H(
|
|
805
|
+
e.icon ? /* @__PURE__ */ H(E, {
|
|
806
806
|
icon: e.icon,
|
|
807
807
|
size: t === "dense" ? "sm" : "md"
|
|
808
808
|
}) : null,
|
|
@@ -814,7 +814,7 @@ function Fe({ className: e, density: t = "comfortable", facts: n, label: r, vari
|
|
|
814
814
|
e.meta ? /* @__PURE__ */ H("em", { children: e.meta }) : null
|
|
815
815
|
]
|
|
816
816
|
}),
|
|
817
|
-
e.tone ? /* @__PURE__ */ H(
|
|
817
|
+
e.tone ? /* @__PURE__ */ H(M, {
|
|
818
818
|
tone: e.tone,
|
|
819
819
|
children: i === "stats" ? e.label : e.value
|
|
820
820
|
}) : null
|
|
@@ -882,13 +882,13 @@ function $({ actions: e = Ie, className: t, density: n = "comfortable", disabled
|
|
|
882
882
|
tabIndex: 0,
|
|
883
883
|
children: [/* @__PURE__ */ H("div", {
|
|
884
884
|
className: "game-ui-movement-pad-grid",
|
|
885
|
-
children: e.map((e) => /* @__PURE__ */ U(
|
|
885
|
+
children: e.map((e) => /* @__PURE__ */ U(D, {
|
|
886
886
|
className: "game-ui-movement-button",
|
|
887
887
|
"data-direction": e.direction,
|
|
888
888
|
disabled: r || e.disabled,
|
|
889
889
|
label: e.label,
|
|
890
890
|
onClick: () => l(e.direction),
|
|
891
|
-
children: [e.icon ? /* @__PURE__ */ H(
|
|
891
|
+
children: [e.icon ? /* @__PURE__ */ H(E, {
|
|
892
892
|
icon: e.icon,
|
|
893
893
|
size: n === "dense" ? "sm" : "md"
|
|
894
894
|
}) : /* @__PURE__ */ H("span", {
|
|
@@ -912,8 +912,8 @@ function Re(e) {
|
|
|
912
912
|
e.text.slice(t + e.highlight.length)
|
|
913
913
|
] });
|
|
914
914
|
}
|
|
915
|
-
function ze({ title: e, lines:
|
|
916
|
-
let f = o === "transition" ?
|
|
915
|
+
function ze({ title: e, lines: n, progress: r, progressLabel: i, ready: a, mode: o = "opening", startLabel: s, onStart: c, autoStart: l = !1, lineSeconds: u = 2.6, className: d }) {
|
|
916
|
+
let f = o === "transition" ? n.slice(0, 1) : n, p = t(), [m, h] = B(0);
|
|
917
917
|
L(() => {
|
|
918
918
|
if (f.length < 2 || p) return;
|
|
919
919
|
let e = window.setInterval(() => h((e) => (e + 1) % f.length), Math.max(1, u) * 1e3);
|
|
@@ -931,7 +931,7 @@ function ze({ title: e, lines: t, progress: n, progressLabel: r, ready: a, mode:
|
|
|
931
931
|
l,
|
|
932
932
|
_
|
|
933
933
|
]);
|
|
934
|
-
let v = f[m % Math.max(1, f.length)],
|
|
934
|
+
let v = f[m % Math.max(1, f.length)], y = Math.round(Math.max(0, Math.min(1, Number.isFinite(r) ? r : 0)) * 100);
|
|
935
935
|
return /* @__PURE__ */ H("section", {
|
|
936
936
|
className: [
|
|
937
937
|
"game-ui-splash",
|
|
@@ -953,15 +953,15 @@ function ze({ title: e, lines: t, progress: n, progressLabel: r, ready: a, mode:
|
|
|
953
953
|
"aria-live": "polite",
|
|
954
954
|
children: Re(v)
|
|
955
955
|
}, m) : null,
|
|
956
|
-
/* @__PURE__ */ H(
|
|
956
|
+
/* @__PURE__ */ H(T, {
|
|
957
957
|
className: "game-ui-splash-progress",
|
|
958
|
-
label:
|
|
959
|
-
value:
|
|
960
|
-
valueLabel:
|
|
958
|
+
label: i,
|
|
959
|
+
value: y,
|
|
960
|
+
valueLabel: i
|
|
961
961
|
}),
|
|
962
962
|
o === "opening" && a && !l && c ? /* @__PURE__ */ H("div", {
|
|
963
963
|
className: "game-ui-splash-start",
|
|
964
|
-
children: /* @__PURE__ */ H(
|
|
964
|
+
children: /* @__PURE__ */ H(j, {
|
|
965
965
|
variant: "primary",
|
|
966
966
|
autoFocus: !0,
|
|
967
967
|
onClick: () => c(),
|
|
@@ -974,51 +974,51 @@ function ze({ title: e, lines: t, progress: n, progressLabel: r, ready: a, mode:
|
|
|
974
974
|
}
|
|
975
975
|
//#endregion
|
|
976
976
|
//#region src/controls/GameMaterialSwatches/GameMaterialSwatches.tsx
|
|
977
|
-
function Be({ activeMaterialId: e, className:
|
|
977
|
+
function Be({ activeMaterialId: e, className: t, disabled: n = !1, label: r, materials: i, onMaterialChange: a, variant: o = "desktop", "data-testid": s }) {
|
|
978
978
|
return /* @__PURE__ */ H("section", {
|
|
979
|
-
"aria-label":
|
|
980
|
-
className: ["game-ui-material-swatches",
|
|
979
|
+
"aria-label": r,
|
|
980
|
+
className: ["game-ui-material-swatches", t].filter(Boolean).join(" "),
|
|
981
981
|
"data-ui-hook": "material-swatches",
|
|
982
|
-
"data-variant":
|
|
983
|
-
"data-testid":
|
|
982
|
+
"data-variant": o,
|
|
983
|
+
"data-testid": s,
|
|
984
984
|
children: /* @__PURE__ */ H("div", {
|
|
985
985
|
className: "game-ui-material-swatch-grid",
|
|
986
986
|
role: "listbox",
|
|
987
|
-
"aria-label":
|
|
988
|
-
children:
|
|
989
|
-
let
|
|
990
|
-
"--swatch-color":
|
|
991
|
-
"--swatch-secondary-color":
|
|
987
|
+
"aria-label": r,
|
|
988
|
+
children: i.map((t) => {
|
|
989
|
+
let r = t.id === e, i = n || t.disabled, s = o === "small-mobile" ? t.compactLabel ?? t.label : t.label, c = {
|
|
990
|
+
"--swatch-color": t.color,
|
|
991
|
+
"--swatch-secondary-color": t.secondaryColor ?? t.color
|
|
992
992
|
};
|
|
993
993
|
return /* @__PURE__ */ U("button", {
|
|
994
|
-
"aria-describedby":
|
|
995
|
-
"aria-label":
|
|
996
|
-
"aria-selected":
|
|
994
|
+
"aria-describedby": t.meta ? `${t.id}-material-meta` : void 0,
|
|
995
|
+
"aria-label": t.label,
|
|
996
|
+
"aria-selected": r,
|
|
997
997
|
className: "game-ui-material-swatch",
|
|
998
|
-
"data-material-id":
|
|
999
|
-
disabled:
|
|
1000
|
-
onClick:
|
|
998
|
+
"data-material-id": t.id,
|
|
999
|
+
disabled: i,
|
|
1000
|
+
onClick: a && !i ? () => a(t.id) : void 0,
|
|
1001
1001
|
role: "option",
|
|
1002
1002
|
type: "button",
|
|
1003
1003
|
"data-game-ui-paint": "",
|
|
1004
1004
|
children: [
|
|
1005
|
-
/* @__PURE__ */ H(
|
|
1005
|
+
/* @__PURE__ */ H(P, {}),
|
|
1006
1006
|
/* @__PURE__ */ H("span", {
|
|
1007
1007
|
"aria-hidden": "true",
|
|
1008
1008
|
className: "game-ui-material-swatch-chip",
|
|
1009
|
-
"data-swatch-pattern":
|
|
1010
|
-
style:
|
|
1009
|
+
"data-swatch-pattern": t.pattern ?? "solid",
|
|
1010
|
+
style: c
|
|
1011
1011
|
}),
|
|
1012
1012
|
/* @__PURE__ */ U("span", {
|
|
1013
1013
|
className: "game-ui-material-swatch-copy",
|
|
1014
|
-
children: [/* @__PURE__ */ H("strong", { children:
|
|
1015
|
-
id: `${
|
|
1016
|
-
children:
|
|
1014
|
+
children: [/* @__PURE__ */ H("strong", { children: s }), t.meta ? /* @__PURE__ */ H("small", {
|
|
1015
|
+
id: `${t.id}-material-meta`,
|
|
1016
|
+
children: t.meta
|
|
1017
1017
|
}) : null]
|
|
1018
1018
|
}),
|
|
1019
|
-
/* @__PURE__ */ H(
|
|
1019
|
+
/* @__PURE__ */ H(k, {})
|
|
1020
1020
|
]
|
|
1021
|
-
},
|
|
1021
|
+
}, t.id);
|
|
1022
1022
|
})
|
|
1023
1023
|
})
|
|
1024
1024
|
});
|
|
@@ -1034,4 +1034,4 @@ var Ve = [
|
|
|
1034
1034
|
"ink"
|
|
1035
1035
|
], He = "pastel";
|
|
1036
1036
|
//#endregion
|
|
1037
|
-
export {
|
|
1037
|
+
export { S as FirstSessionOnboarding, O as GAME_ICON_NAMES, He as GAME_UI_DEFAULT_STYLE, Ve as GAME_UI_STYLES, s as GAME_UI_TARGETS, a as GAME_UI_THEME_CONTRACT, i as GAME_UI_TOKENS, ie as GameAvatar, M as GameBadge, j as GameButton, ye as GameCallout, r as GameCheckbox, Ce as GameCollapsiblePanel, je as GameCollectibleCard, Pe as GameCollectibleCardSlot, C as GameDialog, p as GameEmptyState, Fe as GameFactList, o as GameField, be as GameHelpTip, b as GameHistoryPanel, l as GameHudActions, E as GameIcon, D as GameIconButton, u as GameInput, c as GameLanguageMenu, ge as GameListRow, f as GameLoadingState, Be as GameMaterialSwatches, Te as GameModal, $ as GameMovementPad, _e as GameOtpInput, g as GamePanel, T as GameProgress, xe as GamePrompt, y as GameRadialMenu, m as GameSegmentedControl, ve as GameSelect, Ee as GameShell, h as GameSlider, ze as GameSplash, w as GameStageTile, re as GameTabs, v as GameTextArea, _ as GameToast, x as GameToggle, d as GameTooltip, n as LiquidGroup, ee as LiquidSurface, ae as liquidFormItem, A as playGameCardRevealSound, ne as playGameInteractionSound, te as playGameInteractionSoundForContext, e as setLiquidGooeyBudget, Ne as useGameCardOrientation };
|