@pieai/swimmer-ui-kit 3.0.0 → 3.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
@@ -6,6 +6,7 @@ import { ForwardRefExoticComponent } from 'react';
6
6
  import { HTMLAttributes } from 'react';
7
7
  import { InputHTMLAttributes } from 'react';
8
8
  import { JSX } from 'react';
9
+ import { ReactElement } from 'react';
9
10
  import { ReactNode } from 'react';
10
11
  import { Ref } from 'react';
11
12
  import { RefAttributes } from 'react';
@@ -691,6 +692,61 @@ export declare interface GameFieldProps {
691
692
  className?: string;
692
693
  }
693
694
 
695
+ /**
696
+ * A non-modal hover/focus/tap card that teaches one short idea. Floating UI owns
697
+ * collision, hover intent, focus order and dismissal, as in GameHelpTip. The
698
+ * card is portalled into the closest native dialog and built on the static
699
+ * droplet surface, so it adds no liquid engine and no LiquidPopover.
700
+ */
701
+ export declare function GameHelpCard({ children, label, topics, link, placement, align, openDelay, }: GameHelpCardProps): ReactNode;
702
+
703
+ export declare interface GameHelpCardProps {
704
+ /** One focusable trigger element (e.g. a GameIconButton link or button). */
705
+ children: ReactElement;
706
+ /** Accessible name of the card, e.g. "怎么用". */
707
+ label: string;
708
+ /** 1 to 4 topics; more than one shows tabs. */
709
+ topics: readonly GameHelpCardTopic[];
710
+ /** Optional link at the bottom, e.g. the full guide. */
711
+ link?: {
712
+ href: string;
713
+ label: string;
714
+ };
715
+ placement?: 'top' | 'bottom';
716
+ align?: 'start' | 'center' | 'end';
717
+ /** Hover intent delay in ms; default 200. */
718
+ openDelay?: number;
719
+ }
720
+
721
+ export declare interface GameHelpCardTopic {
722
+ id: string;
723
+ /** Tab label when there are several topics. */
724
+ label: string;
725
+ title: string;
726
+ /** 1–3 short lines; "\n" breaks a line. */
727
+ body: string;
728
+ media?: GameHelpMedia;
729
+ }
730
+
731
+ export declare type GameHelpMedia = {
732
+ kind: 'video';
733
+ /** Ordered sources, e.g. webm then mp4. */
734
+ sources: readonly {
735
+ src: string;
736
+ type: 'video/webm' | 'video/mp4';
737
+ }[];
738
+ poster: string;
739
+ alt: string;
740
+ width: number;
741
+ height: number;
742
+ } | {
743
+ kind: 'image';
744
+ src: string;
745
+ alt: string;
746
+ width: number;
747
+ height: number;
748
+ };
749
+
694
750
  /** Optional help, not an action menu or a place to hide required information.
695
751
  * Floating UI owns collision avoidance, hover/focus/click and dismissal. The
696
752
  * native help button never submits its surrounding form. Inside a native modal
@@ -1146,12 +1202,21 @@ export declare interface GameToggleProps extends Pick<ButtonHTMLAttributes<HTMLB
1146
1202
  hue?: GameUiHue;
1147
1203
  }
1148
1204
 
1149
- export declare function GameTooltip({ children, label }: GameTooltipProps): ReactNode;
1205
+ export declare function GameTooltip({ children, label, align, placement, }: GameTooltipProps): ReactNode;
1150
1206
 
1151
1207
  export declare interface GameTooltipProps {
1152
1208
  /** A single focusable trigger element (e.g. GameIconButton). */
1153
1209
  children: ReactNode;
1210
+ /** Plain text; an explicit line break (\n) is kept. */
1154
1211
  label: string;
1212
+ /**
1213
+ * Which edges meet the trigger. `center` (default) centres the bubble; `start`
1214
+ * aligns its left edge with the trigger and extends right; `end` aligns right
1215
+ * edges and extends left.
1216
+ */
1217
+ align?: 'center' | 'start' | 'end';
1218
+ /** Above the trigger (default) or below it. */
1219
+ placement?: 'top' | 'bottom';
1155
1220
  }
1156
1221
 
1157
1222
  export declare interface GameUiHistoryEntry {