@pieai/swimmer-ui-kit 1.0.1 → 1.2.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/dist/index.d.ts CHANGED
@@ -55,7 +55,7 @@ export declare const CLAY_ASSETS: {
55
55
 
56
56
  export declare const CLAY_COLOR_TOKENS: {
57
57
  readonly ink: "#3b2d23";
58
- readonly inkMuted: "#7b6652";
58
+ readonly inkMuted: "#786250";
59
59
  readonly parchment: "#fff8ec";
60
60
  readonly parchmentDeep: "#f4e2c6";
61
61
  readonly cream: "#f3e8d8";
@@ -72,6 +72,9 @@ export declare const CLAY_COLOR_TOKENS: {
72
72
  readonly shadow: "rgba(76, 52, 28, 0.24)";
73
73
  readonly glass: "rgba(255, 248, 236, 0.82)";
74
74
  readonly nightGlass: "rgba(31, 24, 18, 0.76)";
75
+ /** Official HUD-on-scene glass fill (matches SupaLuv stage chrome). */
76
+ readonly overlayGlass: "rgba(12, 14, 20, 0.72)";
77
+ readonly overlayGlassText: "#fff6ee";
75
78
  };
76
79
 
77
80
  export declare const CLAY_ELEVATION_TOKENS: {
@@ -268,6 +271,26 @@ export declare const CLAY_MOTION_TOKENS: {
268
271
  readonly reducedMotion: "var(--game-ui-reduced-motion-policy)";
269
272
  };
270
273
 
274
+ /**
275
+ * Semantic CSS vars for the official overlay-glass HUD tone
276
+ * (`data-game-ui-tone="glass"` / `.game-ui-overlay-scope`).
277
+ */
278
+ declare const CLAY_OVERLAY_GLASS_TOKENS: {
279
+ readonly bg: "var(--game-ui-overlay-glass-bg)";
280
+ readonly bgHover: "var(--game-ui-overlay-glass-bg-hover)";
281
+ readonly bgStrong: "var(--game-ui-overlay-glass-bg-strong)";
282
+ readonly bgPanel: "var(--game-ui-overlay-glass-bg-panel)";
283
+ readonly border: "var(--game-ui-overlay-glass-border)";
284
+ readonly borderHover: "var(--game-ui-overlay-glass-border-hover)";
285
+ readonly text: "var(--game-ui-overlay-glass-text)";
286
+ readonly textMuted: "var(--game-ui-overlay-glass-text-muted)";
287
+ readonly blur: "var(--game-ui-overlay-glass-blur)";
288
+ readonly focusRing: "var(--game-ui-overlay-glass-focus-ring)";
289
+ readonly primaryFill: "var(--game-ui-overlay-glass-primary-fill)";
290
+ };
291
+ export { CLAY_OVERLAY_GLASS_TOKENS }
292
+ export { CLAY_OVERLAY_GLASS_TOKENS as GAME_UI_OVERLAY_GLASS_TOKENS }
293
+
271
294
  export declare const CLAY_RADIUS_TOKENS: {
272
295
  readonly bead: "var(--game-ui-radius-bead)";
273
296
  readonly control: "var(--game-ui-radius-control)";
@@ -346,7 +369,7 @@ export declare const CLAY_TYPE_TOKENS: {
346
369
  export declare const CLAY_UI_TOKENS: {
347
370
  readonly colors: {
348
371
  readonly ink: "#3b2d23";
349
- readonly inkMuted: "#7b6652";
372
+ readonly inkMuted: "#786250";
350
373
  readonly parchment: "#fff8ec";
351
374
  readonly parchmentDeep: "#f4e2c6";
352
375
  readonly cream: "#f3e8d8";
@@ -363,6 +386,9 @@ export declare const CLAY_UI_TOKENS: {
363
386
  readonly shadow: "rgba(76, 52, 28, 0.24)";
364
387
  readonly glass: "rgba(255, 248, 236, 0.82)";
365
388
  readonly nightGlass: "rgba(31, 24, 18, 0.76)";
389
+ /** Official HUD-on-scene glass fill (matches SupaLuv stage chrome). */
390
+ readonly overlayGlass: "rgba(12, 14, 20, 0.72)";
391
+ readonly overlayGlassText: "#fff6ee";
366
392
  };
367
393
  readonly semantic: {
368
394
  readonly background: "var(--game-ui-bg)";
@@ -470,6 +496,19 @@ export declare const CLAY_UI_TOKENS: {
470
496
  readonly buildRailCardSize: "var(--game-ui-build-rail-card-size)";
471
497
  readonly brushNumberWidth: "var(--game-ui-brush-number-width)";
472
498
  };
499
+ readonly overlayGlass: {
500
+ readonly bg: "var(--game-ui-overlay-glass-bg)";
501
+ readonly bgHover: "var(--game-ui-overlay-glass-bg-hover)";
502
+ readonly bgStrong: "var(--game-ui-overlay-glass-bg-strong)";
503
+ readonly bgPanel: "var(--game-ui-overlay-glass-bg-panel)";
504
+ readonly border: "var(--game-ui-overlay-glass-border)";
505
+ readonly borderHover: "var(--game-ui-overlay-glass-border-hover)";
506
+ readonly text: "var(--game-ui-overlay-glass-text)";
507
+ readonly textMuted: "var(--game-ui-overlay-glass-text-muted)";
508
+ readonly blur: "var(--game-ui-overlay-glass-blur)";
509
+ readonly focusRing: "var(--game-ui-overlay-glass-focus-ring)";
510
+ readonly primaryFill: "var(--game-ui-overlay-glass-primary-fill)";
511
+ };
473
512
  };
474
513
 
475
514
  export declare type ClayAssetGroup = keyof typeof CLAY_ASSETS;
@@ -507,7 +546,7 @@ export declare type ClayIconStyle = 'game' | 'line';
507
546
 
508
547
  export declare type ClayTokenCategory = keyof typeof CLAY_UI_TOKENS;
509
548
 
510
- export declare function FirstSessionHud({ authenticated, batteryCount, className, dailyStreak, iconSlots, labels, onHistory, onSettings, onWardrobe, playerName }: FirstSessionHudProps): ReactNode;
549
+ export declare function FirstSessionHud({ authenticated, batteryCount, className, dailyStreak, iconSlots, labels, onHistory, onSettings, onWardrobe, playerName, }: FirstSessionHudProps): ReactNode;
511
550
 
512
551
  export declare interface FirstSessionHudIconSlots {
513
552
  history?: ReactNode;
@@ -556,7 +595,7 @@ export declare interface FirstSessionHudProps {
556
595
  playerName: string;
557
596
  }
558
597
 
559
- export declare function FirstSessionOnboarding({ labels, onDismiss, open }: FirstSessionOnboardingProps): ReactNode;
598
+ export declare function FirstSessionOnboarding({ labels, onDismiss, open, }: FirstSessionOnboardingProps): ReactNode;
560
599
 
561
600
  export declare interface FirstSessionOnboardingLabels {
562
601
  badge: string;
@@ -578,6 +617,15 @@ export declare interface FirstSessionOnboardingStep {
578
617
  title: string;
579
618
  }
580
619
 
620
+ /** Opt-in attribute values for the official overlay-glass HUD scope. */
621
+ export declare const GAME_UI_OVERLAY: {
622
+ readonly toneAttr: "data-game-ui-tone";
623
+ readonly toneGlass: "glass";
624
+ readonly densityAttr: "data-game-ui-density";
625
+ readonly densityCompact: "compact";
626
+ readonly scopeClass: "game-ui-overlay-scope";
627
+ };
628
+
581
629
  export declare const GAME_UI_PREVIEW_MESSAGES: readonly GameUiHistoryEntry[];
582
630
 
583
631
  export declare const GAME_UI_TARGETS: {
@@ -593,6 +641,17 @@ export declare const GAME_UI_TARGETS: {
593
641
  readonly mobileLandscapeProofHeightPx: 390;
594
642
  };
595
643
 
644
+ /**
645
+ * The semantic `--game-ui-*` custom properties a *complete* theme must
646
+ * override for full fidelity — this is the same list the official
647
+ * `[data-game-ui-theme='night']` block in theme.css satisfies, enforced by
648
+ * a guard test in src/tokens.test.ts. A downstream product building its own
649
+ * full theme (e.g. `[data-game-ui-theme='abyss']`) can reuse this constant
650
+ * to check its own CSS for the same completeness instead of eyeballing it —
651
+ * see "自定义第三主题" in design-system-guide.md for a usage example.
652
+ */
653
+ export declare const GAME_UI_THEME_CONTRACT: readonly ["--game-ui-bg", "--game-ui-surface", "--game-ui-surface-raised", "--game-ui-panel", "--game-ui-panel-strong", "--game-ui-panel-deep", "--game-ui-text", "--game-ui-text-muted", "--game-ui-accent", "--game-ui-accent-bright", "--game-ui-secondary", "--game-ui-success", "--game-ui-success-bright", "--game-ui-danger", "--game-ui-danger-bright", "--game-ui-warning", "--game-ui-focus-ring", "--game-ui-border-subtle", "--game-ui-border-strong", "--game-ui-disabled", "--game-ui-ink-deep", "--game-ui-border-ink", "--game-ui-wood", "--game-ui-ink-title", "--game-ui-ink-heading"];
654
+
596
655
  export declare const GAME_UI_TOKENS: {
597
656
  readonly iconSm: "var(--game-ui-asset-icon-sm)";
598
657
  readonly iconMd: "var(--game-ui-asset-icon-md)";
@@ -670,7 +729,7 @@ export declare const GAME_UI_TOKENS: {
670
729
  readonly disabled: "var(--game-ui-disabled)";
671
730
  };
672
731
 
673
- export declare function GameActionGrid({ actions, className, density, iconLabelMode, label, style }: GameActionGridProps): ReactNode;
732
+ export declare function GameActionGrid({ actions, className, density, iconLabelMode, label, style, }: GameActionGridProps): ReactNode;
674
733
 
675
734
  export declare interface GameActionGridProps {
676
735
  actions: readonly GameUiAction[];
@@ -725,7 +784,7 @@ export declare interface GameAssetGroup {
725
784
  source?: GameAssetSource;
726
785
  }
727
786
 
728
- export declare function GameAssetIcon({ className, icon, label, size, style, useSourceAsset }: GameAssetIconProps): ReactNode;
787
+ export declare function GameAssetIcon({ className, icon, label, size, style, useSourceAsset, }: GameAssetIconProps): ReactNode;
729
788
 
730
789
  export declare interface GameAssetIconProps {
731
790
  className?: string;
@@ -762,7 +821,7 @@ export declare type GameAssetSource = 'starter' | 'generated' | 'imported';
762
821
 
763
822
  export declare type GameAssetStatus = 'ready' | 'generating' | 'missing' | 'placed' | 'selected' | 'error';
764
823
 
765
- export declare function GameAvatar({ className, name, size, src, status }: GameAvatarProps): ReactNode;
824
+ export declare function GameAvatar({ className, name, size, src, status, }: GameAvatarProps): ReactNode;
766
825
 
767
826
  export declare interface GameAvatarProps {
768
827
  /** Display name — used as image alt text and for the initials fallback. */
@@ -1144,7 +1203,7 @@ export declare interface GameDialogProps {
1144
1203
  title: string;
1145
1204
  }
1146
1205
 
1147
- export declare function GameEmptyState({ action, className, description, icon, title }: GameEmptyStateProps): ReactNode;
1206
+ export declare function GameEmptyState({ action, className, description, icon, title, }: GameEmptyStateProps): ReactNode;
1148
1207
 
1149
1208
  export declare interface GameEmptyStateProps {
1150
1209
  /** Optional clay icon shown above the title. */
@@ -1165,7 +1224,7 @@ export declare interface GameFactItem {
1165
1224
  value: ReactNode;
1166
1225
  }
1167
1226
 
1168
- export declare function GameFactList({ className, density, facts, label, variant }: GameFactListProps): ReactNode;
1227
+ export declare function GameFactList({ className, density, facts, label, variant, }: GameFactListProps): ReactNode;
1169
1228
 
1170
1229
  export declare interface GameFactListProps {
1171
1230
  className?: string;
@@ -1175,7 +1234,7 @@ export declare interface GameFactListProps {
1175
1234
  variant?: 'facts' | 'stats';
1176
1235
  }
1177
1236
 
1178
- export declare function GameField({ children, className, error, hint, label, required }: GameFieldProps): ReactNode;
1237
+ export declare function GameField({ children, className, error, hint, label, required, }: GameFieldProps): ReactNode;
1179
1238
 
1180
1239
  export declare interface GameFieldProps {
1181
1240
  /** The input/textarea this field labels. Rendered inside the <label>. */
@@ -1275,7 +1334,7 @@ export declare interface GameInteractionSoundOptions {
1275
1334
  sfxVolume?: number;
1276
1335
  }
1277
1336
 
1278
- export declare function GameLanguageMenu({ className, currentLabel, label, options, value, defaultValue, onSelect }: GameLanguageMenuProps): ReactNode;
1337
+ export declare function GameLanguageMenu({ className, currentLabel, label, options, value, defaultValue, onSelect, }: GameLanguageMenuProps): ReactNode;
1279
1338
 
1280
1339
  export declare interface GameLanguageMenuProps {
1281
1340
  className?: string;
@@ -1315,7 +1374,7 @@ export declare interface GameMaterialSwatchesProps {
1315
1374
  'data-testid'?: string | undefined;
1316
1375
  }
1317
1376
 
1318
- export declare function GameModal({ children, className, closeLabel, closeOnBackdrop, footer, onClose, open, size, title, }: GameModalProps): ReactNode;
1377
+ export declare function GameModal({ children, className, closeLabel, closeOnBackdrop, footer, onClose, open, position, size, title, }: GameModalProps): ReactNode;
1319
1378
 
1320
1379
  export declare interface GameModalProps {
1321
1380
  children: ReactNode;
@@ -1327,6 +1386,13 @@ export declare interface GameModalProps {
1327
1386
  /** Called for every close intent: Esc, backdrop click, and close button. */
1328
1387
  onClose: () => void;
1329
1388
  open: boolean;
1389
+ /**
1390
+ * `'bottom'` anchors the frame to the viewport's bottom edge (rounded top
1391
+ * corners only, safe-area-aware padding, slide-up entrance) for mobile
1392
+ * action sheets — same native <dialog> underneath, so focus trap/Esc/
1393
+ * backdrop/top-layer come free either way. Defaults to `'center'`.
1394
+ */
1395
+ position?: 'center' | 'bottom';
1330
1396
  size?: 'sm' | 'md' | 'lg';
1331
1397
  title: string;
1332
1398
  }
@@ -1359,7 +1425,7 @@ export declare const GameObjectToolbar: typeof GamePlacementToolbar;
1359
1425
 
1360
1426
  export declare type GameObjectToolbarProps = GamePlacementToolbarProps;
1361
1427
 
1362
- export declare function GameOrientationGate({ body, cta, badgeLabel, manualHint, preview, title }: GameOrientationGateProps): ReactNode;
1428
+ export declare function GameOrientationGate({ body, cta, badgeLabel, manualHint, preview, title, }: GameOrientationGateProps): ReactNode;
1363
1429
 
1364
1430
  export declare interface GameOrientationGateProps {
1365
1431
  body: string;
@@ -1399,7 +1465,7 @@ export declare interface GamePlacementToolbarProps {
1399
1465
  title: string;
1400
1466
  }
1401
1467
 
1402
- export declare function GameProgress({ className, label, max, showValue, tone, value }: GameProgressProps): ReactNode;
1468
+ export declare function GameProgress({ className, label, max, showValue, tone, value, }: GameProgressProps): ReactNode;
1403
1469
 
1404
1470
  export declare interface GameProgressProps {
1405
1471
  /** Current value, between 0 and `max`. */
@@ -1421,7 +1487,7 @@ export declare interface GamePromptProps {
1421
1487
  title: string;
1422
1488
  }
1423
1489
 
1424
- export declare function GameRadialMenu({ items, label }: GameRadialMenuProps): ReactNode;
1490
+ export declare function GameRadialMenu({ items, label, onSelect }: GameRadialMenuProps): ReactNode;
1425
1491
 
1426
1492
  declare interface GameRadialMenuItem {
1427
1493
  id: string;
@@ -1431,6 +1497,7 @@ declare interface GameRadialMenuItem {
1431
1497
  export declare interface GameRadialMenuProps {
1432
1498
  items: readonly GameRadialMenuItem[];
1433
1499
  label: string;
1500
+ onSelect?: (id: string) => void;
1434
1501
  }
1435
1502
 
1436
1503
  export declare interface GameRobotCrewMember {
@@ -1461,7 +1528,7 @@ export declare const GameSceneHudLayout: typeof GameShell;
1461
1528
 
1462
1529
  export declare type GameSceneHudLayoutProps = GameShellProps;
1463
1530
 
1464
- export declare function GameSegmentedControl({ activeId, label, onSelect, options }: GameSegmentedControlProps): ReactNode;
1531
+ export declare function GameSegmentedControl({ activeId, label, onSelect, options, }: GameSegmentedControlProps): ReactNode;
1465
1532
 
1466
1533
  export declare interface GameSegmentedControlProps {
1467
1534
  activeId: string;
@@ -1529,12 +1596,21 @@ export declare type GameSurfaceLayout = 'auto' | 'desktop' | 'mobile';
1529
1596
  export declare interface GameTabItem {
1530
1597
  id: string;
1531
1598
  label: string;
1599
+ /** id of the tabpanel this tab controls; wires aria-controls when set. */
1600
+ panelId?: string;
1532
1601
  }
1533
1602
 
1534
- export declare function GameTabs({ activeId, onSelect, tabs }: GameTabsProps): ReactNode;
1603
+ export declare function GameTabs({ activeId, id, onSelect, tabs }: GameTabsProps): ReactNode;
1535
1604
 
1536
1605
  export declare interface GameTabsProps {
1537
1606
  activeId: string;
1607
+ /**
1608
+ * Base id for this tabs instance (defaults to a generated one). Each tab
1609
+ * button's DOM id is `${id}-${tab.id}` — pass an explicit id so your own
1610
+ * `role="tabpanel"` elements can reference it via aria-labelledby (and set
1611
+ * GameTabItem.panelId so the tab points back via aria-controls).
1612
+ */
1613
+ id?: string;
1538
1614
  onSelect?: (id: string) => void;
1539
1615
  tabs: readonly GameTabItem[];
1540
1616
  }
@@ -1682,6 +1758,7 @@ export declare interface GameToggleProps extends Pick<ButtonHTMLAttributes<HTMLB
1682
1758
  export declare function GameTooltip({ children, label }: GameTooltipProps): ReactNode;
1683
1759
 
1684
1760
  export declare interface GameTooltipProps {
1761
+ /** A single focusable trigger element (e.g. GameIconButton). */
1685
1762
  children: ReactNode;
1686
1763
  label: string;
1687
1764
  }