@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.
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { C as e, a as t, b as n, g as r, m as i, o as a, p as o, v as s, x as c } from "./LiquidGroup-RTK_Uvgw.js";
3
- import { i as l, n as u, o as d, r as f, s as p, t as m } from "./GameAvatar-CRJ1r8l5.js";
3
+ import { i as l, n as u, o as d, r as f, s as p, t as m } from "./GameAvatar-Cs5KVYFf.js";
4
4
  import { useCallback as h, useEffect as g, useId as _, useLayoutEffect as v, useRef as y, useState as b } from "react";
5
5
  import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
6
6
  import { createPortal as w } from "react-dom";
package/dist/preview.js CHANGED
@@ -1,7 +1,7 @@
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, _ as l, f as u, h as ee, i as d, j as f, k as te, t as p, w as ne } from "./LiquidGroup-RTK_Uvgw.js";
3
- import { C as re, S as m, _ as h, a as g, b as _, c as ie, d as v, f as ae, g as oe, h as se, i as y, l as b, m as ce, n as le, o as x, p as ue, r as de, s as fe, t as S, u as C, v as w, w as T, x as E, y as pe } from "./GameStageTile-F41PxXDG.js";
4
- import { _ as D, g as O, h as me, i as k, n as A, r as he, t as j, v as M, y as N } from "./GameAvatar-CRJ1r8l5.js";
3
+ import { C as m, E as h, S as g, T as re, _ as ie, a as _, b as v, c as ae, d as y, g as oe, h as se, i as b, l as x, m as ce, n as S, o as le, r as ue, s as de, t as C, u as w, v as fe, w as T, x as pe, y as E } from "./GameStageTile-BdG3tMV-.js";
4
+ import { _ as D, g as O, h as me, i as k, n as A, r as he, t as j, v as M, y as N } from "./GameAvatar-Cs5KVYFf.js";
5
5
  import { createContext as P, createElement as F, useContext as I, useEffect as L, useRef as R, useState as z } from "react";
6
6
  import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
7
7
  //#region src/preview/GameUiPreview/previewStates.ts
@@ -435,7 +435,7 @@ var U = [
435
435
  //#region src/preview/GameUiPreview/sections/ButtonStates.tsx
436
436
  function ge() {
437
437
  let { buttons: e } = K();
438
- return /* @__PURE__ */ H(y, {
438
+ return /* @__PURE__ */ H(b, {
439
439
  title: e.panelTitle,
440
440
  tone: "strong",
441
441
  children: [
@@ -472,19 +472,19 @@ function ge() {
472
472
  /* @__PURE__ */ H("div", {
473
473
  className: "game-ui-component-row",
474
474
  children: [
475
- /* @__PURE__ */ V(ie, {
475
+ /* @__PURE__ */ V(ae, {
476
476
  label: e.settingsTip,
477
- children: /* @__PURE__ */ V(E, {
477
+ children: /* @__PURE__ */ V(m, {
478
478
  label: e.settingsTip,
479
- children: /* @__PURE__ */ V(w, {
479
+ children: /* @__PURE__ */ V(v, {
480
480
  icon: "settings",
481
481
  size: "sm"
482
482
  })
483
483
  })
484
484
  }),
485
- /* @__PURE__ */ V(E, {
485
+ /* @__PURE__ */ V(m, {
486
486
  label: e.copyInvite,
487
- children: /* @__PURE__ */ V(w, {
487
+ children: /* @__PURE__ */ V(v, {
488
488
  icon: "copy",
489
489
  size: "sm"
490
490
  })
@@ -503,7 +503,7 @@ function ge() {
503
503
  })
504
504
  ]
505
505
  }),
506
- /* @__PURE__ */ V(oe, {
506
+ /* @__PURE__ */ V(fe, {
507
507
  activeId: "live",
508
508
  label: e.segmentedLabel,
509
509
  options: [
@@ -538,7 +538,7 @@ function ge() {
538
538
  }
539
539
  ]
540
540
  }),
541
- /* @__PURE__ */ V(le, {
541
+ /* @__PURE__ */ V(S, {
542
542
  items: [
543
543
  {
544
544
  id: "wave",
@@ -555,13 +555,13 @@ function ge() {
555
555
  ],
556
556
  label: e.radialLabel
557
557
  }),
558
- /* @__PURE__ */ V(se, {
558
+ /* @__PURE__ */ V(ie, {
559
559
  label: e.sliderLabel,
560
560
  max: 100,
561
561
  min: 0,
562
562
  value: 68
563
563
  }),
564
- /* @__PURE__ */ V(ue, {
564
+ /* @__PURE__ */ V(se, {
565
565
  checked: !0,
566
566
  label: e.toggleLabel
567
567
  })
@@ -576,7 +576,7 @@ function _e() {
576
576
  className: "game-ui-first-session-preview",
577
577
  children: [/* @__PURE__ */ V("div", { className: "game-ui-first-session-world" }), /* @__PURE__ */ V("div", {
578
578
  className: "game-ui-first-session-modal-slot",
579
- children: /* @__PURE__ */ V(de, {
579
+ children: /* @__PURE__ */ V(ue, {
580
580
  open: !0,
581
581
  onDismiss: () => void 0,
582
582
  labels: {
@@ -610,24 +610,24 @@ function ve() {
610
610
  let { forms: e } = K();
611
611
  return /* @__PURE__ */ H("div", {
612
612
  className: "game-ui-preview-two-up",
613
- children: [/* @__PURE__ */ H(y, {
613
+ children: [/* @__PURE__ */ H(b, {
614
614
  title: e.formsTitle,
615
615
  tone: "strong",
616
616
  children: [
617
- /* @__PURE__ */ V(m, {
617
+ /* @__PURE__ */ V(T, {
618
618
  hint: e.roomCodeHint,
619
619
  label: e.roomCodeLabel,
620
- children: /* @__PURE__ */ V(_, { placeholder: e.roomCodePlaceholder })
620
+ children: /* @__PURE__ */ V(g, { placeholder: e.roomCodePlaceholder })
621
621
  }),
622
- /* @__PURE__ */ V(m, {
622
+ /* @__PURE__ */ V(T, {
623
623
  label: e.nameLabel,
624
624
  required: !0,
625
- children: /* @__PURE__ */ V(_, { placeholder: e.namePlaceholder })
625
+ children: /* @__PURE__ */ V(g, { placeholder: e.namePlaceholder })
626
626
  }),
627
- /* @__PURE__ */ V(m, {
627
+ /* @__PURE__ */ V(T, {
628
628
  error: e.readError,
629
629
  label: e.readLabel,
630
- children: /* @__PURE__ */ V(ce, {
630
+ children: /* @__PURE__ */ V(oe, {
631
631
  invalid: !0,
632
632
  placeholder: e.readPlaceholder
633
633
  })
@@ -637,7 +637,7 @@ function ve() {
637
637
  label: e.rememberLabel
638
638
  })
639
639
  ]
640
- }), /* @__PURE__ */ H(y, {
640
+ }), /* @__PURE__ */ H(b, {
641
641
  title: e.displayTitle,
642
642
  tone: "strong",
643
643
  children: [
@@ -663,18 +663,18 @@ function ve() {
663
663
  })
664
664
  ]
665
665
  }),
666
- /* @__PURE__ */ V(C, {
666
+ /* @__PURE__ */ V(w, {
667
667
  label: e.revealLabel,
668
668
  showValue: !0,
669
669
  value: 64
670
670
  }),
671
- /* @__PURE__ */ V(C, {
671
+ /* @__PURE__ */ V(w, {
672
672
  label: e.batteryLabel,
673
673
  max: 20,
674
674
  showValue: !0,
675
675
  value: 14
676
676
  }),
677
- /* @__PURE__ */ V(ae, {
677
+ /* @__PURE__ */ V(ce, {
678
678
  action: /* @__PURE__ */ V(k, {
679
679
  variant: "primary",
680
680
  children: e.emptyCta
@@ -697,17 +697,17 @@ function q() {
697
697
  "aria-label": "Flat world HUD preview",
698
698
  className: "game-ui-stage-world",
699
699
  children: [
700
- /* @__PURE__ */ H(g, {
700
+ /* @__PURE__ */ H(_, {
701
701
  label: e.tools,
702
- children: [/* @__PURE__ */ V(E, {
702
+ children: [/* @__PURE__ */ V(m, {
703
703
  label: e.history,
704
- children: /* @__PURE__ */ V(w, {
704
+ children: /* @__PURE__ */ V(v, {
705
705
  icon: "scroll",
706
706
  size: "sm"
707
707
  })
708
- }), /* @__PURE__ */ V(E, {
708
+ }), /* @__PURE__ */ V(m, {
709
709
  label: e.settings,
710
- children: /* @__PURE__ */ V(w, {
710
+ children: /* @__PURE__ */ V(v, {
711
711
  icon: "settings",
712
712
  size: "sm"
713
713
  })
@@ -744,7 +744,7 @@ function q() {
744
744
  }), /* @__PURE__ */ H("div", {
745
745
  className: "game-ui-stage-sidecar",
746
746
  children: [
747
- /* @__PURE__ */ V(S, {
747
+ /* @__PURE__ */ V(C, {
748
748
  badge: t.daily.badge,
749
749
  icon: "scroll",
750
750
  kicker: t.daily.kicker,
@@ -753,7 +753,7 @@ function q() {
753
753
  title: t.daily.title,
754
754
  tone: "daily"
755
755
  }),
756
- /* @__PURE__ */ V(S, {
756
+ /* @__PURE__ */ V(C, {
757
757
  badge: t.portal.badge,
758
758
  icon: "portal",
759
759
  kicker: t.portal.kicker,
@@ -761,7 +761,7 @@ function q() {
761
761
  title: t.portal.title,
762
762
  tone: "portal"
763
763
  }),
764
- /* @__PURE__ */ V(S, {
764
+ /* @__PURE__ */ V(C, {
765
765
  icon: "energy",
766
766
  kicker: t.host.kicker,
767
767
  summary: t.host.summary,
@@ -780,7 +780,7 @@ function ye() {
780
780
  "aria-label": "全部线条图标",
781
781
  children: pe.map((e) => /* @__PURE__ */ H("figure", {
782
782
  className: "game-ui-icon-cell",
783
- children: [/* @__PURE__ */ V(w, {
783
+ children: [/* @__PURE__ */ V(v, {
784
784
  icon: e,
785
785
  size: "lg"
786
786
  }), /* @__PURE__ */ V("figcaption", { children: e })]
@@ -794,7 +794,7 @@ function be() {
794
794
  return /* @__PURE__ */ H("div", {
795
795
  className: "game-ui-liquid-showcase",
796
796
  children: [
797
- /* @__PURE__ */ V(y, {
797
+ /* @__PURE__ */ V(b, {
798
798
  title: e.surfacesTitle,
799
799
  tone: "strong",
800
800
  children: /* @__PURE__ */ V("div", {
@@ -820,7 +820,7 @@ function be() {
820
820
  }, t))
821
821
  })
822
822
  }),
823
- /* @__PURE__ */ H(y, {
823
+ /* @__PURE__ */ H(b, {
824
824
  title: e.disabledTitle,
825
825
  tone: "strong",
826
826
  children: [/* @__PURE__ */ V("p", {
@@ -842,7 +842,7 @@ function be() {
842
842
  })
843
843
  })]
844
844
  }),
845
- /* @__PURE__ */ H(y, {
845
+ /* @__PURE__ */ H(b, {
846
846
  title: e.moreTitle,
847
847
  tone: "strong",
848
848
  children: [/* @__PURE__ */ V("p", {
@@ -863,9 +863,9 @@ function xe() {
863
863
  let { modals: e } = K();
864
864
  return /* @__PURE__ */ H("div", {
865
865
  className: "game-ui-preview-two-up",
866
- children: [/* @__PURE__ */ H(fe, {
866
+ children: [/* @__PURE__ */ H(de, {
867
867
  title: e.dialogTitle,
868
- children: [/* @__PURE__ */ V("p", { children: e.dialogBody }), /* @__PURE__ */ H(g, {
868
+ children: [/* @__PURE__ */ V("p", { children: e.dialogBody }), /* @__PURE__ */ H(_, {
869
869
  label: e.actionsLabel,
870
870
  children: [/* @__PURE__ */ V(k, {
871
871
  variant: "primary",
@@ -875,20 +875,20 @@ function xe() {
875
875
  children: e.back
876
876
  })]
877
877
  })]
878
- }), /* @__PURE__ */ H(y, {
878
+ }), /* @__PURE__ */ H(b, {
879
879
  title: e.panelTitle,
880
880
  tone: "strong",
881
881
  children: [
882
- /* @__PURE__ */ V(b, {
882
+ /* @__PURE__ */ V(x, {
883
883
  tone: "success",
884
884
  children: e.toastOk
885
885
  }),
886
- /* @__PURE__ */ V(b, {
886
+ /* @__PURE__ */ V(x, {
887
887
  tone: "danger",
888
888
  children: e.toastErr
889
889
  }),
890
- /* @__PURE__ */ V(v, { label: e.loading }),
891
- /* @__PURE__ */ V(v, {
890
+ /* @__PURE__ */ V(y, { label: e.loading }),
891
+ /* @__PURE__ */ V(y, {
892
892
  label: e.loadingErr,
893
893
  tone: "error"
894
894
  })
@@ -906,28 +906,28 @@ function Se() {
906
906
  className: [
907
907
  "game-ui-stage-world",
908
908
  "game-ui-overlay-glass-proof",
909
- r ? T.scopeClass : void 0
909
+ r ? h.scopeClass : void 0
910
910
  ].filter(Boolean).join(" "),
911
911
  ...r ? {
912
- [T.toneAttr]: T.toneGlass,
913
- [T.densityAttr]: T.densityCompact
912
+ [h.toneAttr]: h.toneGlass,
913
+ [h.densityAttr]: h.densityCompact
914
914
  } : {},
915
- children: [/* @__PURE__ */ H(g, {
915
+ children: [/* @__PURE__ */ H(_, {
916
916
  label: e.tools,
917
- children: [/* @__PURE__ */ V(E, {
917
+ children: [/* @__PURE__ */ V(m, {
918
918
  label: e.history,
919
- children: /* @__PURE__ */ V(w, {
919
+ children: /* @__PURE__ */ V(v, {
920
920
  icon: "scroll",
921
921
  size: "sm"
922
922
  })
923
- }), /* @__PURE__ */ V(E, {
923
+ }), /* @__PURE__ */ V(m, {
924
924
  label: e.settings,
925
- children: /* @__PURE__ */ V(w, {
925
+ children: /* @__PURE__ */ V(v, {
926
926
  icon: "settings",
927
927
  size: "sm"
928
928
  })
929
929
  })]
930
- }), /* @__PURE__ */ H(y, {
930
+ }), /* @__PURE__ */ H(b, {
931
931
  title: t.panelTitle,
932
932
  children: [/* @__PURE__ */ H("div", {
933
933
  className: "game-ui-preview-actions",
@@ -940,7 +940,7 @@ function Se() {
940
940
  tone: "success",
941
941
  children: t.readyBadge
942
942
  }),
943
- /* @__PURE__ */ V(C, {
943
+ /* @__PURE__ */ V(w, {
944
944
  label: e.reveal,
945
945
  value: 68
946
946
  })
@@ -978,14 +978,14 @@ function Se() {
978
978
  children: [/* @__PURE__ */ H("header", { children: [/* @__PURE__ */ V("strong", { children: "Overlay glass + compact" }), /* @__PURE__ */ H("span", {
979
979
  className: "game-ui-small-copy",
980
980
  children: [
981
- T.toneAttr,
981
+ h.toneAttr,
982
982
  "=\"",
983
- T.toneGlass,
983
+ h.toneGlass,
984
984
  "\" ·",
985
985
  " ",
986
- T.densityAttr,
986
+ h.densityAttr,
987
987
  "=\"",
988
- T.densityCompact,
988
+ h.densityCompact,
989
989
  "\""
990
990
  ]
991
991
  })] }), n("glass")]
@@ -1120,7 +1120,7 @@ function Oe({ title: e, body: t }) {
1120
1120
  tone: "ai",
1121
1121
  children: "@pieai/swimmer-ui-kit"
1122
1122
  }),
1123
- /* @__PURE__ */ V(h, {
1123
+ /* @__PURE__ */ V(E, {
1124
1124
  currentLabel: i.triggerLabel,
1125
1125
  label: i.langMenuLabel,
1126
1126
  onSelect: (e) => r(e),
@@ -1183,13 +1183,13 @@ function Oe({ title: e, body: t }) {
1183
1183
  }),
1184
1184
  /* @__PURE__ */ H("div", {
1185
1185
  className: "game-ui-preview-two-up",
1186
- children: [/* @__PURE__ */ H(y, {
1186
+ children: [/* @__PURE__ */ H(b, {
1187
1187
  title: n === "zh-CN" ? "普通主按钮" : "Ordinary primary action",
1188
1188
  children: [/* @__PURE__ */ V(k, {
1189
1189
  variant: "primary",
1190
1190
  children: n === "zh-CN" ? "开始学习" : "Start learning"
1191
1191
  }), /* @__PURE__ */ V("pre", { children: /* @__PURE__ */ V("code", { children: "<GameButton variant=\"primary\">Start learning</GameButton>" }) })]
1192
- }), /* @__PURE__ */ H(y, {
1192
+ }), /* @__PURE__ */ H(b, {
1193
1193
  title: n === "zh-CN" ? "全宽液体主按钮" : "Full-width liquid CTA",
1194
1194
  children: [/* @__PURE__ */ V(k, {
1195
1195
  fullWidth: !0,
@@ -1253,7 +1253,7 @@ function Oe({ title: e, body: t }) {
1253
1253
  /* @__PURE__ */ V(ge, {}),
1254
1254
  /* @__PURE__ */ V(q, {}),
1255
1255
  /* @__PURE__ */ V(xe, {}),
1256
- /* @__PURE__ */ V(x, {
1256
+ /* @__PURE__ */ V(le, {
1257
1257
  entries: i.history,
1258
1258
  label: i.historyLabel
1259
1259
  })
@@ -1643,7 +1643,7 @@ function $({ kind: e, copy: t, tone: n }) {
1643
1643
  className: "game-ui-liquid-page__shelf",
1644
1644
  children: a.filter((e) => e === o).map((e) => {
1645
1645
  let a = r.has(e);
1646
- return /* @__PURE__ */ H(y, {
1646
+ return /* @__PURE__ */ H(b, {
1647
1647
  className: "game-ui-liquid-page__tile",
1648
1648
  tone: "strong",
1649
1649
  children: [
@@ -1691,7 +1691,7 @@ function Pe({ copy: e }) {
1691
1691
  className: "game-ui-liquid-page__sizes",
1692
1692
  children: r.filter((e) => e === i).map((r) => {
1693
1693
  let i = t.has(r), { blob: a } = O[r].group;
1694
- return /* @__PURE__ */ H(y, {
1694
+ return /* @__PURE__ */ H(b, {
1695
1695
  className: "game-ui-liquid-page__size-row",
1696
1696
  tone: "strong",
1697
1697
  children: [/* @__PURE__ */ H("header", { children: [/* @__PURE__ */ V("h4", { children: r }), /* @__PURE__ */ V(k, {
@@ -1751,7 +1751,7 @@ function Fe({ copy: e }) {
1751
1751
  }, e))
1752
1752
  }), /* @__PURE__ */ V("div", {
1753
1753
  className: "game-ui-liquid-page__tones",
1754
- children: J.filter((e) => e === t).map((t) => /* @__PURE__ */ H(y, {
1754
+ children: J.filter((e) => e === t).map((t) => /* @__PURE__ */ H(b, {
1755
1755
  className: "game-ui-liquid-page__tone",
1756
1756
  tone: "strong",
1757
1757
  children: [
@@ -1779,7 +1779,7 @@ function Fe({ copy: e }) {
1779
1779
  //#region src/preview/LiquidPreview/States.tsx
1780
1780
  function Ie({ copy: e }) {
1781
1781
  let [t, n] = z(!1), [r, i] = z(0);
1782
- return /* @__PURE__ */ H(y, {
1782
+ return /* @__PURE__ */ H(b, {
1783
1783
  className: "game-ui-liquid-page__states",
1784
1784
  title: e.rest,
1785
1785
  children: [
@@ -1819,7 +1819,7 @@ function Le() {
1819
1819
  tone: "ai",
1820
1820
  children: "@pieai/swimmer-ui-kit"
1821
1821
  }),
1822
- /* @__PURE__ */ V(h, {
1822
+ /* @__PURE__ */ V(E, {
1823
1823
  currentLabel: o.triggerLabel,
1824
1824
  label: o.langMenuLabel,
1825
1825
  onSelect: (e) => t(e),