@pieai/swimmer-ui-kit 2.12.0 → 2.13.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 +18 -0
- package/README.md +10 -2
- package/dist/index.d.ts +46 -7
- package/dist/index.js +1080 -924
- package/dist/liquid-presence.js +39 -39
- package/dist/styles.css +1 -1
- package/package.json +2 -1
package/dist/liquid-presence.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as e, g as t, m as n, p as r, r as i, s as a, t as o, u as s } from "./liquidGooeySpring-WwyGKGPL.js";
|
|
2
2
|
import { useEffect as c, useId as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
4
|
+
import { createPortal as g } from "react-dom";
|
|
5
5
|
import { FloatingPortal as _, autoUpdate as v, computePosition as y, flip as b, hide as x, offset as S, shift as C, size as w } from "@floating-ui/react";
|
|
6
6
|
function T(e, t, n) {
|
|
7
7
|
return Number.isFinite(e) ? Math.max(t, Math.min(n, e)) : t;
|
|
@@ -702,26 +702,26 @@ function q(t) {
|
|
|
702
702
|
"--liquid-presence-from": "var(--game-ui-warning)",
|
|
703
703
|
"--liquid-presence-to": "var(--game-ui-warning)"
|
|
704
704
|
} : {}
|
|
705
|
-
}, y = (e, t) => /* @__PURE__ */
|
|
705
|
+
}, y = (e, t) => /* @__PURE__ */ h("defs", { children: [/* @__PURE__ */ h("linearGradient", {
|
|
706
706
|
id: `${i}-${e}-fill`,
|
|
707
707
|
gradientUnits: "userSpaceOnUse",
|
|
708
708
|
x1: e === "core" ? 24 : -24,
|
|
709
709
|
y1: e === "core" ? 16 : -18,
|
|
710
710
|
x2: e === "core" ? 136 : 24,
|
|
711
711
|
y2: e === "core" ? 146 : 18,
|
|
712
|
-
children: [/* @__PURE__ */
|
|
712
|
+
children: [/* @__PURE__ */ m("stop", {
|
|
713
713
|
offset: "0",
|
|
714
714
|
stopColor: "var(--liquid-presence-from, var(--game-ui-secondary))"
|
|
715
|
-
}), /* @__PURE__ */
|
|
715
|
+
}), /* @__PURE__ */ m("stop", {
|
|
716
716
|
offset: "1",
|
|
717
717
|
stopColor: "var(--liquid-presence-to, var(--game-ui-secondary))"
|
|
718
718
|
})]
|
|
719
|
-
}), /* @__PURE__ */
|
|
719
|
+
}), /* @__PURE__ */ m("filter", {
|
|
720
720
|
id: `${i}-${e}-goo`,
|
|
721
721
|
filterUnits: "userSpaceOnUse",
|
|
722
722
|
...t,
|
|
723
723
|
colorInterpolationFilters: "sRGB",
|
|
724
|
-
children: /* @__PURE__ */
|
|
724
|
+
children: /* @__PURE__ */ m(s, {
|
|
725
725
|
blur: e === "core" ? 5 : 2,
|
|
726
726
|
contrast: 18,
|
|
727
727
|
gloss: 3.5,
|
|
@@ -730,13 +730,13 @@ function q(t) {
|
|
|
730
730
|
waviness: 0
|
|
731
731
|
})
|
|
732
732
|
})] });
|
|
733
|
-
return /* @__PURE__ */
|
|
733
|
+
return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("span", {
|
|
734
734
|
ref: a,
|
|
735
735
|
className: `game-ui-liquid-presence ${t.className ?? ""}`,
|
|
736
736
|
style: v,
|
|
737
737
|
"data-activity": t.activity ?? "idle",
|
|
738
738
|
"aria-hidden": "true",
|
|
739
|
-
children: /* @__PURE__ */
|
|
739
|
+
children: /* @__PURE__ */ h("svg", {
|
|
740
740
|
viewBox: "0 0 160 160",
|
|
741
741
|
focusable: "false",
|
|
742
742
|
children: [y("core", {
|
|
@@ -744,15 +744,15 @@ function q(t) {
|
|
|
744
744
|
y: -80,
|
|
745
745
|
width: 320,
|
|
746
746
|
height: 320
|
|
747
|
-
}), /* @__PURE__ */
|
|
747
|
+
}), /* @__PURE__ */ h("g", {
|
|
748
748
|
fill: `url(#${i}-core-fill)`,
|
|
749
749
|
filter: `url(#${i}-core-goo)`,
|
|
750
750
|
children: [
|
|
751
|
-
/* @__PURE__ */
|
|
751
|
+
/* @__PURE__ */ m("path", {
|
|
752
752
|
"data-presence-body": "",
|
|
753
753
|
d: M()
|
|
754
754
|
}),
|
|
755
|
-
/* @__PURE__ */
|
|
755
|
+
/* @__PURE__ */ m("circle", {
|
|
756
756
|
"data-presence-bud": "",
|
|
757
757
|
cx: "80",
|
|
758
758
|
cy: "80",
|
|
@@ -763,7 +763,7 @@ function q(t) {
|
|
|
763
763
|
0,
|
|
764
764
|
1,
|
|
765
765
|
2
|
|
766
|
-
].map((e) => /* @__PURE__ */
|
|
766
|
+
].map((e) => /* @__PURE__ */ m("circle", {
|
|
767
767
|
"data-presence-satellite": "",
|
|
768
768
|
cx: "80",
|
|
769
769
|
cy: "80",
|
|
@@ -773,7 +773,7 @@ function q(t) {
|
|
|
773
773
|
]
|
|
774
774
|
})]
|
|
775
775
|
})
|
|
776
|
-
}), u &&
|
|
776
|
+
}), u && g(/* @__PURE__ */ h("div", {
|
|
777
777
|
ref: o,
|
|
778
778
|
className: "game-ui-liquid-presence-overlay",
|
|
779
779
|
style: {
|
|
@@ -783,7 +783,7 @@ function q(t) {
|
|
|
783
783
|
},
|
|
784
784
|
"data-presence-overlay": "",
|
|
785
785
|
children: [
|
|
786
|
-
/* @__PURE__ */
|
|
786
|
+
/* @__PURE__ */ h("svg", {
|
|
787
787
|
className: "game-ui-liquid-presence-flight",
|
|
788
788
|
viewBox: "-48 -36 96 72",
|
|
789
789
|
"aria-hidden": "true",
|
|
@@ -794,18 +794,18 @@ function q(t) {
|
|
|
794
794
|
y: -36,
|
|
795
795
|
width: 96,
|
|
796
796
|
height: 72
|
|
797
|
-
}), /* @__PURE__ */
|
|
797
|
+
}), /* @__PURE__ */ m("g", {
|
|
798
798
|
fill: `url(#${i}-flight-fill)`,
|
|
799
799
|
filter: `url(#${i}-flight-goo)`,
|
|
800
|
-
children: /* @__PURE__ */
|
|
800
|
+
children: /* @__PURE__ */ h("g", {
|
|
801
801
|
"data-presence-flight-body": "",
|
|
802
|
-
children: [/* @__PURE__ */
|
|
802
|
+
children: [/* @__PURE__ */ m("circle", { r: "16" }), /* @__PURE__ */ h("g", {
|
|
803
803
|
"data-presence-trail": "",
|
|
804
|
-
children: [/* @__PURE__ */
|
|
804
|
+
children: [/* @__PURE__ */ m("circle", {
|
|
805
805
|
cx: "-27",
|
|
806
806
|
cy: "5",
|
|
807
807
|
r: "4.5"
|
|
808
|
-
}), /* @__PURE__ */
|
|
808
|
+
}), /* @__PURE__ */ m("circle", {
|
|
809
809
|
cx: "-36",
|
|
810
810
|
cy: "8",
|
|
811
811
|
r: "2.5"
|
|
@@ -814,7 +814,7 @@ function q(t) {
|
|
|
814
814
|
})
|
|
815
815
|
})]
|
|
816
816
|
}),
|
|
817
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ h("svg", {
|
|
818
818
|
className: "game-ui-liquid-presence-seat",
|
|
819
819
|
viewBox: "-56 -28 112 56",
|
|
820
820
|
"aria-hidden": "true",
|
|
@@ -825,14 +825,14 @@ function q(t) {
|
|
|
825
825
|
y: -28,
|
|
826
826
|
width: 112,
|
|
827
827
|
height: 56
|
|
828
|
-
}), /* @__PURE__ */
|
|
828
|
+
}), /* @__PURE__ */ m("path", {
|
|
829
829
|
"data-presence-seat-body": "",
|
|
830
830
|
d: N(48, 1),
|
|
831
831
|
fill: `url(#${i}-seat-fill)`,
|
|
832
832
|
filter: `url(#${i}-seat-goo)`
|
|
833
833
|
})]
|
|
834
834
|
}),
|
|
835
|
-
/* @__PURE__ */
|
|
835
|
+
/* @__PURE__ */ m("div", {
|
|
836
836
|
className: `game-ui-liquid-presence-label${t.guideContent ? " game-ui-liquid-presence-label--guide" : ""}${t.guideContent && t.guideSize === "expanded" ? " game-ui-liquid-presence-label--expanded" : ""}`,
|
|
837
837
|
role: t.guideContent ? void 0 : "status",
|
|
838
838
|
"aria-atomic": !t.guideContent || void 0,
|
|
@@ -1056,7 +1056,7 @@ function Q(e, r, i, a, o, s, c, l, f = 1) {
|
|
|
1056
1056
|
}
|
|
1057
1057
|
//#endregion
|
|
1058
1058
|
//#region src/LiquidReveal.tsx
|
|
1059
|
-
function de({ children: t, source: n, revealKey: i = "initial", variant: a = "content", surface: o = "dark", reducedMotion: c, idleMotion: p = "still", colorFrom:
|
|
1059
|
+
function de({ children: t, source: n, revealKey: i = "initial", variant: a = "content", surface: o = "dark", reducedMotion: c, idleMotion: p = "still", colorFrom: g, colorTo: _, motionIntensity: v = 1, motionSpeed: y = 1, className: b = "" }) {
|
|
1060
1060
|
let x = e() || c === !0, S = T(v, .25, 1.25), C = T(y, .5, 1.5), w = d(null), [E, D] = f({
|
|
1061
1061
|
width: 0,
|
|
1062
1062
|
height: 0
|
|
@@ -1076,20 +1076,20 @@ function de({ children: t, source: n, revealKey: i = "initial", variant: a = "co
|
|
|
1076
1076
|
return n.observe(e), () => n.disconnect();
|
|
1077
1077
|
}, []), Q(w, n, i, E.width, E.height, x, o === "material", a === "input", S);
|
|
1078
1078
|
let k = Math.max(44, E.width), A = Math.max(44, E.height), ee = Y(w, !x && p === "breathe", E.width, E.height, a === "input", S, C), j = J(k, A, a === "input", ee.current, S), M = (k + 24) * (A + 24) <= r().maxFilterArea;
|
|
1079
|
-
return /* @__PURE__ */
|
|
1079
|
+
return /* @__PURE__ */ h("div", {
|
|
1080
1080
|
ref: w,
|
|
1081
1081
|
className: `game-ui-liquid-reveal ${b}`,
|
|
1082
1082
|
style: {
|
|
1083
|
-
...
|
|
1083
|
+
...g ? { "--liquid-presence-from": g } : {},
|
|
1084
1084
|
..._ ? { "--liquid-presence-to": _ } : {}
|
|
1085
1085
|
},
|
|
1086
1086
|
"data-reveal-variant": a,
|
|
1087
1087
|
"data-reveal-surface": o,
|
|
1088
1088
|
"data-reveal-filter": M ? "volume" : "flat",
|
|
1089
|
-
children: [/* @__PURE__ */
|
|
1089
|
+
children: [/* @__PURE__ */ m("div", {
|
|
1090
1090
|
className: "game-ui-liquid-reveal-content",
|
|
1091
1091
|
children: t
|
|
1092
|
-
}), E.width > 0 && /* @__PURE__ */
|
|
1092
|
+
}), E.width > 0 && /* @__PURE__ */ h("svg", {
|
|
1093
1093
|
className: "game-ui-liquid-reveal-ink",
|
|
1094
1094
|
width: k,
|
|
1095
1095
|
height: A,
|
|
@@ -1097,20 +1097,20 @@ function de({ children: t, source: n, revealKey: i = "initial", variant: a = "co
|
|
|
1097
1097
|
"aria-hidden": "true",
|
|
1098
1098
|
focusable: "false",
|
|
1099
1099
|
children: [
|
|
1100
|
-
/* @__PURE__ */
|
|
1100
|
+
/* @__PURE__ */ h("defs", { children: [/* @__PURE__ */ h("linearGradient", {
|
|
1101
1101
|
id: `${O}-fill`,
|
|
1102
1102
|
x1: "0",
|
|
1103
1103
|
y1: "0",
|
|
1104
1104
|
x2: "1",
|
|
1105
1105
|
y2: "1",
|
|
1106
|
-
children: [/* @__PURE__ */
|
|
1106
|
+
children: [/* @__PURE__ */ m("stop", {
|
|
1107
1107
|
offset: "0",
|
|
1108
1108
|
stopColor: "var(--liquid-presence-from, var(--game-ui-secondary))"
|
|
1109
|
-
}), /* @__PURE__ */
|
|
1109
|
+
}), /* @__PURE__ */ m("stop", {
|
|
1110
1110
|
offset: "1",
|
|
1111
1111
|
stopColor: "var(--liquid-presence-to, var(--game-ui-secondary))"
|
|
1112
1112
|
})]
|
|
1113
|
-
}), /* @__PURE__ */
|
|
1113
|
+
}), /* @__PURE__ */ m("filter", {
|
|
1114
1114
|
id: `${O}-finish`,
|
|
1115
1115
|
x: "-12",
|
|
1116
1116
|
y: "-12",
|
|
@@ -1118,7 +1118,7 @@ function de({ children: t, source: n, revealKey: i = "initial", variant: a = "co
|
|
|
1118
1118
|
height: A + 24,
|
|
1119
1119
|
filterUnits: "userSpaceOnUse",
|
|
1120
1120
|
colorInterpolationFilters: "sRGB",
|
|
1121
|
-
children: /* @__PURE__ */
|
|
1121
|
+
children: /* @__PURE__ */ m(s, {
|
|
1122
1122
|
blur: 1.2,
|
|
1123
1123
|
contrast: 18,
|
|
1124
1124
|
gloss: 3.5,
|
|
@@ -1127,20 +1127,20 @@ function de({ children: t, source: n, revealKey: i = "initial", variant: a = "co
|
|
|
1127
1127
|
waviness: 0
|
|
1128
1128
|
})
|
|
1129
1129
|
})] }),
|
|
1130
|
-
o === "material" && /* @__PURE__ */
|
|
1130
|
+
o === "material" && /* @__PURE__ */ m("path", {
|
|
1131
1131
|
"data-reveal-body": "",
|
|
1132
1132
|
d: j.outline,
|
|
1133
1133
|
fill: `url(#${O}-fill)`
|
|
1134
1134
|
}),
|
|
1135
|
-
/* @__PURE__ */
|
|
1135
|
+
/* @__PURE__ */ h("g", {
|
|
1136
1136
|
"data-reveal-material": "",
|
|
1137
1137
|
filter: M ? `url(#${O}-finish)` : void 0,
|
|
1138
|
-
children: [/* @__PURE__ */
|
|
1138
|
+
children: [/* @__PURE__ */ m("path", {
|
|
1139
1139
|
"data-reveal-ribbon": "",
|
|
1140
1140
|
d: j.ribbon,
|
|
1141
1141
|
fillRule: "evenodd",
|
|
1142
1142
|
fill: `url(#${O}-fill)`
|
|
1143
|
-
}), /* @__PURE__ */
|
|
1143
|
+
}), /* @__PURE__ */ m("path", {
|
|
1144
1144
|
"data-reveal-outline": "",
|
|
1145
1145
|
d: j.outline,
|
|
1146
1146
|
pathLength: "1",
|
|
@@ -1258,10 +1258,10 @@ function fe({ source: e, children: t, placement: n = "top-end", onBoundsChange:
|
|
|
1258
1258
|
i,
|
|
1259
1259
|
n,
|
|
1260
1260
|
e
|
|
1261
|
-
]), s ? /* @__PURE__ */
|
|
1261
|
+
]), s ? /* @__PURE__ */ m(_, {
|
|
1262
1262
|
root: s,
|
|
1263
1263
|
preserveTabOrder: !1,
|
|
1264
|
-
children: /* @__PURE__ */
|
|
1264
|
+
children: /* @__PURE__ */ m("div", {
|
|
1265
1265
|
ref: a,
|
|
1266
1266
|
className: "game-ui-liquid-anchor",
|
|
1267
1267
|
style: {
|