@idosgames/react 0.5.0 → 0.5.2
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/ui/index.cjs +8 -2
- package/dist/ui/index.d.cts +210 -5
- package/dist/ui/index.d.ts +210 -5
- package/dist/ui/index.js +8 -2
- package/package.json +2 -2
package/dist/ui/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, CSSProperties, MouseEvent, SelectHTMLAttributes, TextareaHTMLAttributes, InputHTMLAttributes } from 'react';
|
|
1
|
+
import { ReactNode, CSSProperties, MouseEvent, SelectHTMLAttributes, TextareaHTMLAttributes, InputHTMLAttributes, ButtonHTMLAttributes, ComponentProps } from 'react';
|
|
2
2
|
import { TitlePublicConfigurationModel, IDosGamesClient, ResourceConsume, ResourceGrant } from '@idosgames/core';
|
|
3
3
|
|
|
4
4
|
/** Interface sound events. Components of the kit play theirs by themselves. */
|
|
@@ -612,12 +612,16 @@ declare function isGlyph(value: string): value is Glyph;
|
|
|
612
612
|
/** Glyph for a currency id: gems for "premium-looking" ids, energy for dice/energy, coins for the rest. */
|
|
613
613
|
declare function currencyGlyph(currencyID: string): Glyph;
|
|
614
614
|
/** Glyph for an item by its tags or class (first known wins), else a box. */
|
|
615
|
-
declare function itemGlyph(tags: readonly string[] | null | undefined, itemClass?: string | null
|
|
615
|
+
declare function itemGlyph(tags: readonly string[] | null | undefined, itemClass?: string | null,
|
|
616
|
+
/** An engine resource path or id to guess from ("Sprites/Chest/Chest_Wood" → chest). */
|
|
617
|
+
hint?: string | null): Glyph;
|
|
616
618
|
/** A glyph by name, an image by URL ("https://…", "/…", "data:…"), or any other text (an emoji). */
|
|
617
|
-
declare function Icon({ glyph, size, color, }: {
|
|
619
|
+
declare function Icon({ glyph: requested, size, color, fallback, }: {
|
|
618
620
|
glyph: Glyph | string;
|
|
619
621
|
size?: number;
|
|
620
622
|
color?: string;
|
|
623
|
+
/** Drawn instead of text that is not a symbol (a resource path, a word). */
|
|
624
|
+
fallback?: Glyph;
|
|
621
625
|
}): ReactNode;
|
|
622
626
|
|
|
623
627
|
type ButtonTone = "green" | "gold" | "blue" | "red" | "grey";
|
|
@@ -835,6 +839,8 @@ declare const EN: {
|
|
|
835
839
|
readonly free: "Free";
|
|
836
840
|
readonly claim: "Claim";
|
|
837
841
|
readonly claimAll: "Claim all";
|
|
842
|
+
readonly rewards: "Rewards";
|
|
843
|
+
readonly premium: "Premium";
|
|
838
844
|
readonly tokenEvent: "Event points";
|
|
839
845
|
readonly tokenSeason: "Season status";
|
|
840
846
|
readonly tokenQuest: "Quest points";
|
|
@@ -846,7 +852,7 @@ declare const EN: {
|
|
|
846
852
|
};
|
|
847
853
|
type UiStringKey = keyof typeof EN;
|
|
848
854
|
/** Strings of the kit itself. */
|
|
849
|
-
declare const uiT: (key: "close" | "claim" | "error" | "events" | "cancel" | "offline" | "other" | "back" | "confirm" | "youGot" | "great" | "loading" | "ok" | "loadingNamed" | "stillLoading" | "retry" | "notEnough" | "dailyLimitReached" | "more" | "menu" | "nothingHere" | "economy" | "social" | "profile" | "free" | "claimAll" | "tokenEvent" | "tokenSeason" | "tokenQuest" | "tokenScore" | "cryptoTotal" | "cryptoBacked" | "cryptoUnbacked" | "cryptoIouHint") => string;
|
|
855
|
+
declare const uiT: (key: "close" | "claim" | "error" | "events" | "cancel" | "offline" | "other" | "back" | "confirm" | "youGot" | "great" | "loading" | "ok" | "loadingNamed" | "stillLoading" | "retry" | "notEnough" | "dailyLimitReached" | "more" | "menu" | "nothingHere" | "economy" | "social" | "profile" | "free" | "claimAll" | "rewards" | "premium" | "tokenEvent" | "tokenSeason" | "tokenQuest" | "tokenScore" | "cryptoTotal" | "cryptoBacked" | "cryptoUnbacked" | "cryptoIouHint") => string;
|
|
850
856
|
/** Turns a server error into words the player understands; long texts are cut. */
|
|
851
857
|
declare function errorText(error: string | null | undefined): string;
|
|
852
858
|
|
|
@@ -1033,4 +1039,203 @@ declare function FeatureGrid({ items, onOpen, }: {
|
|
|
1033
1039
|
/** The theme tone of each level: colour of its badge, its stripe, its main button. */
|
|
1034
1040
|
declare const LEVEL_TONE: Record<NotificationLevel, ButtonTone>;
|
|
1035
1041
|
|
|
1036
|
-
|
|
1042
|
+
declare const U: {
|
|
1043
|
+
readonly ink: "#10172e";
|
|
1044
|
+
readonly navy: "#1f2440";
|
|
1045
|
+
readonly navyDeep: "#1a1f38";
|
|
1046
|
+
readonly blue: "#0d80f2";
|
|
1047
|
+
readonly blueBody: "#0897f7";
|
|
1048
|
+
readonly sky: "#00aeff";
|
|
1049
|
+
readonly topbar: "#33364a";
|
|
1050
|
+
readonly tabOn: "#3082ff";
|
|
1051
|
+
readonly tabOff: "#363650";
|
|
1052
|
+
readonly bg: "#0340a3";
|
|
1053
|
+
readonly bgDeep: "#032b73";
|
|
1054
|
+
readonly gold: "#ffce0d";
|
|
1055
|
+
readonly listLight: "#d9e8f2";
|
|
1056
|
+
readonly listBlue: "#00ccff";
|
|
1057
|
+
readonly listBlueInner: "#0099ff";
|
|
1058
|
+
readonly listYellow: "#fffed6";
|
|
1059
|
+
readonly listYellowInner: "#fffc54";
|
|
1060
|
+
readonly sliderBg: "#212130";
|
|
1061
|
+
readonly fillGreen: "#47d61e";
|
|
1062
|
+
readonly fillOrange: "#ff9a1a";
|
|
1063
|
+
};
|
|
1064
|
+
/** The reference's outlined game text (TMP with outline + a drop shadow). */
|
|
1065
|
+
declare function uText(size: number, color?: string, stroke?: string): CSSProperties;
|
|
1066
|
+
/** The faint diagonal pattern laid over the blue backgrounds (Pattern01_s, white at ~8 %). */
|
|
1067
|
+
declare const U_PATTERN = "repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 14px, rgba(255,255,255,0) 14px 28px)";
|
|
1068
|
+
/** Gradient_Panel01 tinted: a radial glow over a solid, with the pattern on top. */
|
|
1069
|
+
declare function uBackdrop(color?: string, glow?: string): CSSProperties;
|
|
1070
|
+
/**
|
|
1071
|
+
* A lobby screen in the reference's look: the blue patterned window background from edge to edge,
|
|
1072
|
+
* at least as tall as the lobby's scroll box (a short list does not leave the lobby's own colour
|
|
1073
|
+
* under it), with `footer` pinned to the bottom of the box (Unity's bottom tabs / my row). The pin
|
|
1074
|
+
* offset is read from the box's padding, so it lands flush whatever the lobby's spacing is.
|
|
1075
|
+
*/
|
|
1076
|
+
declare function UScreen({ children, footer, background, }: {
|
|
1077
|
+
children: ReactNode;
|
|
1078
|
+
footer?: ReactNode;
|
|
1079
|
+
background?: string;
|
|
1080
|
+
}): ReactNode;
|
|
1081
|
+
type UTone = "green" | "sky" | "yellow" | "purple" | "red" | "gray" | "orange";
|
|
1082
|
+
declare function UButton({ tone, size, busy, disabled, attract, children, style, onClick, ...rest }: {
|
|
1083
|
+
tone?: UTone;
|
|
1084
|
+
size?: "s" | "m" | "l";
|
|
1085
|
+
busy?: boolean;
|
|
1086
|
+
attract?: boolean;
|
|
1087
|
+
} & ButtonHTMLAttributes<HTMLButtonElement>): ReactNode;
|
|
1088
|
+
/** The round close button under a popup / at the bottom bar (Button_Circle118 + Icon_Close02). */
|
|
1089
|
+
declare function UCloseCircle({ onClick, size, }: {
|
|
1090
|
+
onClick: () => void;
|
|
1091
|
+
size?: number;
|
|
1092
|
+
}): ReactNode;
|
|
1093
|
+
/**
|
|
1094
|
+
* The reference's popup: a body (blue or navy), a blue top bar with the title and a light streak, an
|
|
1095
|
+
* optional icon before the title (inline: a bottom sheet clips anything above its edge). The kit's Popup underneath — closing, the exit
|
|
1096
|
+
* animation and usePopupClose() work as everywhere else.
|
|
1097
|
+
*/
|
|
1098
|
+
declare function UPopup({ title, icon, tone, children, panelStyle, ...rest }: ComponentProps<typeof Popup> & {
|
|
1099
|
+
icon?: string;
|
|
1100
|
+
tone?: "navy" | "blue";
|
|
1101
|
+
}): ReactNode;
|
|
1102
|
+
/** PanelFrame03 top bar: the title on the left, a black oblique corner with a counter on the right. */
|
|
1103
|
+
declare function UTopBar({ title, corner, cornerLabel, children, }: {
|
|
1104
|
+
title: ReactNode;
|
|
1105
|
+
corner?: ReactNode;
|
|
1106
|
+
cornerLabel?: ReactNode;
|
|
1107
|
+
children?: ReactNode;
|
|
1108
|
+
}): ReactNode;
|
|
1109
|
+
/** Bottom pill tabs (Button_Round10: blue when focused, slate otherwise, a red alert dot). */
|
|
1110
|
+
declare function UTabs<T extends string>({ tabs, value, onChange, }: {
|
|
1111
|
+
tabs: Array<{
|
|
1112
|
+
id: T;
|
|
1113
|
+
label: ReactNode;
|
|
1114
|
+
alert?: boolean;
|
|
1115
|
+
}>;
|
|
1116
|
+
value: T;
|
|
1117
|
+
onChange: (id: T) => void;
|
|
1118
|
+
}): ReactNode;
|
|
1119
|
+
type URowTone = "light" | "blue" | "yellow" | "navy";
|
|
1120
|
+
/** ListFrame04 (quests) / ListFrame01 (leaderboard rows): an outer rim, an inner plate, a dim when done. */
|
|
1121
|
+
declare function URow({ tone, dim, children, style, }: {
|
|
1122
|
+
tone?: URowTone;
|
|
1123
|
+
dim?: boolean;
|
|
1124
|
+
children: ReactNode;
|
|
1125
|
+
style?: CSSProperties;
|
|
1126
|
+
}): ReactNode;
|
|
1127
|
+
/** ListFrame00~02 tints: [rim, inner plate, oblique right end] as the reference scene sets them. */
|
|
1128
|
+
type URankTone = "gold" | "silver" | "bronze" | "blue" | "entry" | "me";
|
|
1129
|
+
/**
|
|
1130
|
+
* ListFrame00~02 (leaderboard entries, rank rewards): a dark rim, a bright inner plate, a darker
|
|
1131
|
+
* oblique block at the right end holding `right` (the score / the reward).
|
|
1132
|
+
*/
|
|
1133
|
+
declare function URankRow({ tone, children, right, height, rightWidth, }: {
|
|
1134
|
+
tone: URankTone;
|
|
1135
|
+
children: ReactNode;
|
|
1136
|
+
right?: ReactNode;
|
|
1137
|
+
height?: number;
|
|
1138
|
+
rightWidth?: number;
|
|
1139
|
+
}): ReactNode;
|
|
1140
|
+
/** ItemIcon_Medal_Gold/Silver/Bronze_2: a ribbon and a disc with the place. */
|
|
1141
|
+
declare function UMedal({ place, size, }: {
|
|
1142
|
+
place: 1 | 2 | 3;
|
|
1143
|
+
size?: number;
|
|
1144
|
+
}): ReactNode;
|
|
1145
|
+
/** BasicFrame_Hexagon87 with the place inside (the leaderboard entry's rank). */
|
|
1146
|
+
declare function UHexRank({ children, color, size, }: {
|
|
1147
|
+
children: ReactNode;
|
|
1148
|
+
color?: string;
|
|
1149
|
+
size?: number;
|
|
1150
|
+
}): ReactNode;
|
|
1151
|
+
/** ProfileFrame01: a navy rim, a coloured inner square, the player's picture or initial. */
|
|
1152
|
+
declare function UAvatar({ name, src, inner, size, }: {
|
|
1153
|
+
name: string;
|
|
1154
|
+
src?: string | null;
|
|
1155
|
+
inner?: string;
|
|
1156
|
+
size?: number;
|
|
1157
|
+
}): ReactNode;
|
|
1158
|
+
/** BorderFrame_Flag Blue / Red / Green: the podium's hanging banner (gold bar on top, notched tail). */
|
|
1159
|
+
declare function UFlag({ color, height, children, }: {
|
|
1160
|
+
color: "blue" | "red" | "green";
|
|
1161
|
+
height?: number;
|
|
1162
|
+
children: ReactNode;
|
|
1163
|
+
}): ReactNode;
|
|
1164
|
+
/** A reward/item in a navy frame with its amount under the icon. */
|
|
1165
|
+
declare function UItemFrame({ line, size, glyph, label, onClick, }: {
|
|
1166
|
+
line?: ResourceLine | null;
|
|
1167
|
+
size?: number;
|
|
1168
|
+
glyph?: string;
|
|
1169
|
+
label?: ReactNode;
|
|
1170
|
+
onClick?: () => void;
|
|
1171
|
+
}): ReactNode;
|
|
1172
|
+
/** Slider_Basic02: a dark rounded track with a green (or orange) fill and the count in the middle. */
|
|
1173
|
+
declare function USlider({ value, max, tone, label, height, }: {
|
|
1174
|
+
value: number;
|
|
1175
|
+
max: number;
|
|
1176
|
+
tone?: "green" | "orange" | "blue";
|
|
1177
|
+
label?: ReactNode;
|
|
1178
|
+
height?: number;
|
|
1179
|
+
}): ReactNode;
|
|
1180
|
+
/** Slider_Icon01: a slider with a framed icon at its left end (the quests / leaderboard milestone track). */
|
|
1181
|
+
declare function UIconSlider({ glyph, value, max, label, onClick, }: {
|
|
1182
|
+
glyph: string;
|
|
1183
|
+
value: number;
|
|
1184
|
+
max: number;
|
|
1185
|
+
label?: ReactNode;
|
|
1186
|
+
onClick?: () => void;
|
|
1187
|
+
}): ReactNode;
|
|
1188
|
+
/** Title_Ribbon01 (orange / plum / sky): a raised plate with folded ends. */
|
|
1189
|
+
declare function URibbon({ tone, children, width, }: {
|
|
1190
|
+
tone?: "orange" | "plum" | "sky";
|
|
1191
|
+
children: ReactNode;
|
|
1192
|
+
width?: number;
|
|
1193
|
+
}): ReactNode;
|
|
1194
|
+
/** BorderFrame_Oval timer: a dark pill with a clock. */
|
|
1195
|
+
declare function UTimer({ children }: {
|
|
1196
|
+
children: ReactNode;
|
|
1197
|
+
}): ReactNode;
|
|
1198
|
+
/** Title_Line01: "REWARDS" between two golden dividers. */
|
|
1199
|
+
declare function UDivider({ children }: {
|
|
1200
|
+
children: ReactNode;
|
|
1201
|
+
}): ReactNode;
|
|
1202
|
+
/** Image_Effect_Rotate: soft rays turning behind a prize. */
|
|
1203
|
+
declare function URays({ size, color, }: {
|
|
1204
|
+
size?: number;
|
|
1205
|
+
color?: string;
|
|
1206
|
+
}): ReactNode;
|
|
1207
|
+
type UMilestoneState = "locked" | "ready" | "claimed";
|
|
1208
|
+
interface UMilestone {
|
|
1209
|
+
id: string;
|
|
1210
|
+
/** Points (or rank) needed — shown in the left badge. */
|
|
1211
|
+
required: number;
|
|
1212
|
+
/** Shown instead of the number (e.g. "Top 3"). */
|
|
1213
|
+
label?: ReactNode;
|
|
1214
|
+
free: ResourceLine[];
|
|
1215
|
+
state: UMilestoneState;
|
|
1216
|
+
/** The premium column (events / season pass); omitted — the window has one column. */
|
|
1217
|
+
premium?: ResourceLine[];
|
|
1218
|
+
premiumState?: UMilestoneState;
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
* The reference's milestone window: a row per milestone — the required points in a badge, the free
|
|
1222
|
+
* reward, the premium reward (locked without the pass) — each with its Claim. `onClaim` returns
|
|
1223
|
+
* whether it succeeded; the row stays busy until then.
|
|
1224
|
+
*/
|
|
1225
|
+
declare function UMilestonesPopup({ title, glyph, value, milestones, premiumOwned, onPremiumLock, onClaim, onClose, }: {
|
|
1226
|
+
title?: ReactNode;
|
|
1227
|
+
glyph?: string;
|
|
1228
|
+
value: number;
|
|
1229
|
+
milestones: UMilestone[];
|
|
1230
|
+
premiumOwned?: boolean;
|
|
1231
|
+
/** A tap on a locked premium reward — the game opens its pass offer (VIP). */
|
|
1232
|
+
onPremiumLock?: () => void;
|
|
1233
|
+
onClaim: (id: string, track: "free" | "premium") => Promise<boolean>;
|
|
1234
|
+
onClose: () => void;
|
|
1235
|
+
}): ReactNode;
|
|
1236
|
+
/** Keyframes the U* components use; a screen drawing them renders this once. */
|
|
1237
|
+
declare const U_CSS = "\n@keyframes idos-u-spin { to { transform: rotate(360deg); } }\n@keyframes idos-u-attract { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }\n@keyframes idos-u-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }\n@keyframes idos-u-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }\n@keyframes idos-u-shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }\n";
|
|
1238
|
+
/** Renders U_CSS once per page (each U screen calls it; the tag is shared by id). */
|
|
1239
|
+
declare function UStyles(): ReactNode;
|
|
1240
|
+
|
|
1241
|
+
export { Badge, type Burst, Button, type ButtonProps, type ButtonTone, Card, type Catalog, type CelebrateOptions, Center, ConfirmPopup, CryptoBalanceChip, type CryptoBalanceView, type CurrencySection, DEFAULT_PLAYER_PREFS, DEFAULT_UI_CONFIG, DESKTOP_MIN_PX, EASE_IN, EASE_OUT, EASE_POP, EmptyState, FeatureGrid, type FeatureMenuItem, Field, type Flight, FxStore, GLYPHS, type Glyph, Icon, IconButton, type ItemDefinitionView, type ItemSection, ItemTile, KIT_CSS, type KitNotify, type KitOverlayState, KitPortal, LANGUAGE_EVENT, LANGUAGE_KEY, LEVEL_TONE, LanguageSwitch, type Layout, type NotificationAction, type NotificationInput, type NotificationLevel, type NotificationSource, NotificationStore, ON_TONE, type Point, Popup, type PopupProps, ProgressBar, RARITY_ORDER, type ResolvedSound, ResourceBadge, ResourceCounter, type ResourceKind, type ResourceLine, ResourceList, SOUND_PRESETS, SectionTitle, Select, type ShownNotification, Spinner, type SynthNoise, type SynthNote, type SynthPreset, TABLET_MIN_PX, TOAST_DURATION, type TabItem, Tabs, TextArea, TextInput, Timer, type TitleSections, U, UAvatar, UButton, UCloseCircle, UDivider, UFlag, UHexRank, UI_SOUND_EVENTS, UIconSlider, UItemFrame, UMedal, type UMilestone, type UMilestoneState, UMilestonesPopup, UPopup, URankRow, type URankTone, URays, URibbon, URow, type URowTone, UScreen, USlider, UStyles, UTabs, UTimer, type UTone, UTopBar, U_CSS, U_PATTERN, type UiKitConfig, type UiKitConfigInput, UiKitProvider, type UiKitProviderProps, type UiKitValue, type UiLanguage, type UiMotion, type UiMotionConfig, type UiPlayerPrefs, type UiSoundConfig, UiSoundEngine, type UiSoundEvent, type UiSoundSpec, type UiStringKey, type UiThemeConfig, Window, bundleLines, buttonStyle, canAfford, configSection, costLines, countdown, counterKeys, createNotificationStore, cryptoBalance, currencyGlyph, defineUiConfig, effectiveVolume, errorText, formatAmount, formatCryptoAmount, grantLines, grantedBy, groupBy, iconsFor, iouCurrencies, iouCurrencyOf, isGlyph, itemDefinitions, itemGlyph, layoutFor, makeT, mergeLines, motionDurations, onLanguageChange, outlined, panel, parsePlayerPrefs, pickLanguage, plural, rarityRank, renderKitOverlays, resolveSound, resolveUiConfig, resourceName, screenBackground, setAutoPopupsHeld, setLanguage, sortFeatures, themeVars, tokenGlyph, tokenName, tokenParts, toneSurface, uBackdrop, uText, uiT, useAnimatedNumber, useBalances, useCatalog, useCelebrate, useCounterValue, useGameLayout, useLanguage, useLayout, useMotion, useNotify, useNow, usePlayerPrefs, usePopupClose, usePresence, useSound, useStagger, useToast, useUiKit, v, well };
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, CSSProperties, MouseEvent, SelectHTMLAttributes, TextareaHTMLAttributes, InputHTMLAttributes } from 'react';
|
|
1
|
+
import { ReactNode, CSSProperties, MouseEvent, SelectHTMLAttributes, TextareaHTMLAttributes, InputHTMLAttributes, ButtonHTMLAttributes, ComponentProps } from 'react';
|
|
2
2
|
import { TitlePublicConfigurationModel, IDosGamesClient, ResourceConsume, ResourceGrant } from '@idosgames/core';
|
|
3
3
|
|
|
4
4
|
/** Interface sound events. Components of the kit play theirs by themselves. */
|
|
@@ -612,12 +612,16 @@ declare function isGlyph(value: string): value is Glyph;
|
|
|
612
612
|
/** Glyph for a currency id: gems for "premium-looking" ids, energy for dice/energy, coins for the rest. */
|
|
613
613
|
declare function currencyGlyph(currencyID: string): Glyph;
|
|
614
614
|
/** Glyph for an item by its tags or class (first known wins), else a box. */
|
|
615
|
-
declare function itemGlyph(tags: readonly string[] | null | undefined, itemClass?: string | null
|
|
615
|
+
declare function itemGlyph(tags: readonly string[] | null | undefined, itemClass?: string | null,
|
|
616
|
+
/** An engine resource path or id to guess from ("Sprites/Chest/Chest_Wood" → chest). */
|
|
617
|
+
hint?: string | null): Glyph;
|
|
616
618
|
/** A glyph by name, an image by URL ("https://…", "/…", "data:…"), or any other text (an emoji). */
|
|
617
|
-
declare function Icon({ glyph, size, color, }: {
|
|
619
|
+
declare function Icon({ glyph: requested, size, color, fallback, }: {
|
|
618
620
|
glyph: Glyph | string;
|
|
619
621
|
size?: number;
|
|
620
622
|
color?: string;
|
|
623
|
+
/** Drawn instead of text that is not a symbol (a resource path, a word). */
|
|
624
|
+
fallback?: Glyph;
|
|
621
625
|
}): ReactNode;
|
|
622
626
|
|
|
623
627
|
type ButtonTone = "green" | "gold" | "blue" | "red" | "grey";
|
|
@@ -835,6 +839,8 @@ declare const EN: {
|
|
|
835
839
|
readonly free: "Free";
|
|
836
840
|
readonly claim: "Claim";
|
|
837
841
|
readonly claimAll: "Claim all";
|
|
842
|
+
readonly rewards: "Rewards";
|
|
843
|
+
readonly premium: "Premium";
|
|
838
844
|
readonly tokenEvent: "Event points";
|
|
839
845
|
readonly tokenSeason: "Season status";
|
|
840
846
|
readonly tokenQuest: "Quest points";
|
|
@@ -846,7 +852,7 @@ declare const EN: {
|
|
|
846
852
|
};
|
|
847
853
|
type UiStringKey = keyof typeof EN;
|
|
848
854
|
/** Strings of the kit itself. */
|
|
849
|
-
declare const uiT: (key: "close" | "claim" | "error" | "events" | "cancel" | "offline" | "other" | "back" | "confirm" | "youGot" | "great" | "loading" | "ok" | "loadingNamed" | "stillLoading" | "retry" | "notEnough" | "dailyLimitReached" | "more" | "menu" | "nothingHere" | "economy" | "social" | "profile" | "free" | "claimAll" | "tokenEvent" | "tokenSeason" | "tokenQuest" | "tokenScore" | "cryptoTotal" | "cryptoBacked" | "cryptoUnbacked" | "cryptoIouHint") => string;
|
|
855
|
+
declare const uiT: (key: "close" | "claim" | "error" | "events" | "cancel" | "offline" | "other" | "back" | "confirm" | "youGot" | "great" | "loading" | "ok" | "loadingNamed" | "stillLoading" | "retry" | "notEnough" | "dailyLimitReached" | "more" | "menu" | "nothingHere" | "economy" | "social" | "profile" | "free" | "claimAll" | "rewards" | "premium" | "tokenEvent" | "tokenSeason" | "tokenQuest" | "tokenScore" | "cryptoTotal" | "cryptoBacked" | "cryptoUnbacked" | "cryptoIouHint") => string;
|
|
850
856
|
/** Turns a server error into words the player understands; long texts are cut. */
|
|
851
857
|
declare function errorText(error: string | null | undefined): string;
|
|
852
858
|
|
|
@@ -1033,4 +1039,203 @@ declare function FeatureGrid({ items, onOpen, }: {
|
|
|
1033
1039
|
/** The theme tone of each level: colour of its badge, its stripe, its main button. */
|
|
1034
1040
|
declare const LEVEL_TONE: Record<NotificationLevel, ButtonTone>;
|
|
1035
1041
|
|
|
1036
|
-
|
|
1042
|
+
declare const U: {
|
|
1043
|
+
readonly ink: "#10172e";
|
|
1044
|
+
readonly navy: "#1f2440";
|
|
1045
|
+
readonly navyDeep: "#1a1f38";
|
|
1046
|
+
readonly blue: "#0d80f2";
|
|
1047
|
+
readonly blueBody: "#0897f7";
|
|
1048
|
+
readonly sky: "#00aeff";
|
|
1049
|
+
readonly topbar: "#33364a";
|
|
1050
|
+
readonly tabOn: "#3082ff";
|
|
1051
|
+
readonly tabOff: "#363650";
|
|
1052
|
+
readonly bg: "#0340a3";
|
|
1053
|
+
readonly bgDeep: "#032b73";
|
|
1054
|
+
readonly gold: "#ffce0d";
|
|
1055
|
+
readonly listLight: "#d9e8f2";
|
|
1056
|
+
readonly listBlue: "#00ccff";
|
|
1057
|
+
readonly listBlueInner: "#0099ff";
|
|
1058
|
+
readonly listYellow: "#fffed6";
|
|
1059
|
+
readonly listYellowInner: "#fffc54";
|
|
1060
|
+
readonly sliderBg: "#212130";
|
|
1061
|
+
readonly fillGreen: "#47d61e";
|
|
1062
|
+
readonly fillOrange: "#ff9a1a";
|
|
1063
|
+
};
|
|
1064
|
+
/** The reference's outlined game text (TMP with outline + a drop shadow). */
|
|
1065
|
+
declare function uText(size: number, color?: string, stroke?: string): CSSProperties;
|
|
1066
|
+
/** The faint diagonal pattern laid over the blue backgrounds (Pattern01_s, white at ~8 %). */
|
|
1067
|
+
declare const U_PATTERN = "repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 14px, rgba(255,255,255,0) 14px 28px)";
|
|
1068
|
+
/** Gradient_Panel01 tinted: a radial glow over a solid, with the pattern on top. */
|
|
1069
|
+
declare function uBackdrop(color?: string, glow?: string): CSSProperties;
|
|
1070
|
+
/**
|
|
1071
|
+
* A lobby screen in the reference's look: the blue patterned window background from edge to edge,
|
|
1072
|
+
* at least as tall as the lobby's scroll box (a short list does not leave the lobby's own colour
|
|
1073
|
+
* under it), with `footer` pinned to the bottom of the box (Unity's bottom tabs / my row). The pin
|
|
1074
|
+
* offset is read from the box's padding, so it lands flush whatever the lobby's spacing is.
|
|
1075
|
+
*/
|
|
1076
|
+
declare function UScreen({ children, footer, background, }: {
|
|
1077
|
+
children: ReactNode;
|
|
1078
|
+
footer?: ReactNode;
|
|
1079
|
+
background?: string;
|
|
1080
|
+
}): ReactNode;
|
|
1081
|
+
type UTone = "green" | "sky" | "yellow" | "purple" | "red" | "gray" | "orange";
|
|
1082
|
+
declare function UButton({ tone, size, busy, disabled, attract, children, style, onClick, ...rest }: {
|
|
1083
|
+
tone?: UTone;
|
|
1084
|
+
size?: "s" | "m" | "l";
|
|
1085
|
+
busy?: boolean;
|
|
1086
|
+
attract?: boolean;
|
|
1087
|
+
} & ButtonHTMLAttributes<HTMLButtonElement>): ReactNode;
|
|
1088
|
+
/** The round close button under a popup / at the bottom bar (Button_Circle118 + Icon_Close02). */
|
|
1089
|
+
declare function UCloseCircle({ onClick, size, }: {
|
|
1090
|
+
onClick: () => void;
|
|
1091
|
+
size?: number;
|
|
1092
|
+
}): ReactNode;
|
|
1093
|
+
/**
|
|
1094
|
+
* The reference's popup: a body (blue or navy), a blue top bar with the title and a light streak, an
|
|
1095
|
+
* optional icon before the title (inline: a bottom sheet clips anything above its edge). The kit's Popup underneath — closing, the exit
|
|
1096
|
+
* animation and usePopupClose() work as everywhere else.
|
|
1097
|
+
*/
|
|
1098
|
+
declare function UPopup({ title, icon, tone, children, panelStyle, ...rest }: ComponentProps<typeof Popup> & {
|
|
1099
|
+
icon?: string;
|
|
1100
|
+
tone?: "navy" | "blue";
|
|
1101
|
+
}): ReactNode;
|
|
1102
|
+
/** PanelFrame03 top bar: the title on the left, a black oblique corner with a counter on the right. */
|
|
1103
|
+
declare function UTopBar({ title, corner, cornerLabel, children, }: {
|
|
1104
|
+
title: ReactNode;
|
|
1105
|
+
corner?: ReactNode;
|
|
1106
|
+
cornerLabel?: ReactNode;
|
|
1107
|
+
children?: ReactNode;
|
|
1108
|
+
}): ReactNode;
|
|
1109
|
+
/** Bottom pill tabs (Button_Round10: blue when focused, slate otherwise, a red alert dot). */
|
|
1110
|
+
declare function UTabs<T extends string>({ tabs, value, onChange, }: {
|
|
1111
|
+
tabs: Array<{
|
|
1112
|
+
id: T;
|
|
1113
|
+
label: ReactNode;
|
|
1114
|
+
alert?: boolean;
|
|
1115
|
+
}>;
|
|
1116
|
+
value: T;
|
|
1117
|
+
onChange: (id: T) => void;
|
|
1118
|
+
}): ReactNode;
|
|
1119
|
+
type URowTone = "light" | "blue" | "yellow" | "navy";
|
|
1120
|
+
/** ListFrame04 (quests) / ListFrame01 (leaderboard rows): an outer rim, an inner plate, a dim when done. */
|
|
1121
|
+
declare function URow({ tone, dim, children, style, }: {
|
|
1122
|
+
tone?: URowTone;
|
|
1123
|
+
dim?: boolean;
|
|
1124
|
+
children: ReactNode;
|
|
1125
|
+
style?: CSSProperties;
|
|
1126
|
+
}): ReactNode;
|
|
1127
|
+
/** ListFrame00~02 tints: [rim, inner plate, oblique right end] as the reference scene sets them. */
|
|
1128
|
+
type URankTone = "gold" | "silver" | "bronze" | "blue" | "entry" | "me";
|
|
1129
|
+
/**
|
|
1130
|
+
* ListFrame00~02 (leaderboard entries, rank rewards): a dark rim, a bright inner plate, a darker
|
|
1131
|
+
* oblique block at the right end holding `right` (the score / the reward).
|
|
1132
|
+
*/
|
|
1133
|
+
declare function URankRow({ tone, children, right, height, rightWidth, }: {
|
|
1134
|
+
tone: URankTone;
|
|
1135
|
+
children: ReactNode;
|
|
1136
|
+
right?: ReactNode;
|
|
1137
|
+
height?: number;
|
|
1138
|
+
rightWidth?: number;
|
|
1139
|
+
}): ReactNode;
|
|
1140
|
+
/** ItemIcon_Medal_Gold/Silver/Bronze_2: a ribbon and a disc with the place. */
|
|
1141
|
+
declare function UMedal({ place, size, }: {
|
|
1142
|
+
place: 1 | 2 | 3;
|
|
1143
|
+
size?: number;
|
|
1144
|
+
}): ReactNode;
|
|
1145
|
+
/** BasicFrame_Hexagon87 with the place inside (the leaderboard entry's rank). */
|
|
1146
|
+
declare function UHexRank({ children, color, size, }: {
|
|
1147
|
+
children: ReactNode;
|
|
1148
|
+
color?: string;
|
|
1149
|
+
size?: number;
|
|
1150
|
+
}): ReactNode;
|
|
1151
|
+
/** ProfileFrame01: a navy rim, a coloured inner square, the player's picture or initial. */
|
|
1152
|
+
declare function UAvatar({ name, src, inner, size, }: {
|
|
1153
|
+
name: string;
|
|
1154
|
+
src?: string | null;
|
|
1155
|
+
inner?: string;
|
|
1156
|
+
size?: number;
|
|
1157
|
+
}): ReactNode;
|
|
1158
|
+
/** BorderFrame_Flag Blue / Red / Green: the podium's hanging banner (gold bar on top, notched tail). */
|
|
1159
|
+
declare function UFlag({ color, height, children, }: {
|
|
1160
|
+
color: "blue" | "red" | "green";
|
|
1161
|
+
height?: number;
|
|
1162
|
+
children: ReactNode;
|
|
1163
|
+
}): ReactNode;
|
|
1164
|
+
/** A reward/item in a navy frame with its amount under the icon. */
|
|
1165
|
+
declare function UItemFrame({ line, size, glyph, label, onClick, }: {
|
|
1166
|
+
line?: ResourceLine | null;
|
|
1167
|
+
size?: number;
|
|
1168
|
+
glyph?: string;
|
|
1169
|
+
label?: ReactNode;
|
|
1170
|
+
onClick?: () => void;
|
|
1171
|
+
}): ReactNode;
|
|
1172
|
+
/** Slider_Basic02: a dark rounded track with a green (or orange) fill and the count in the middle. */
|
|
1173
|
+
declare function USlider({ value, max, tone, label, height, }: {
|
|
1174
|
+
value: number;
|
|
1175
|
+
max: number;
|
|
1176
|
+
tone?: "green" | "orange" | "blue";
|
|
1177
|
+
label?: ReactNode;
|
|
1178
|
+
height?: number;
|
|
1179
|
+
}): ReactNode;
|
|
1180
|
+
/** Slider_Icon01: a slider with a framed icon at its left end (the quests / leaderboard milestone track). */
|
|
1181
|
+
declare function UIconSlider({ glyph, value, max, label, onClick, }: {
|
|
1182
|
+
glyph: string;
|
|
1183
|
+
value: number;
|
|
1184
|
+
max: number;
|
|
1185
|
+
label?: ReactNode;
|
|
1186
|
+
onClick?: () => void;
|
|
1187
|
+
}): ReactNode;
|
|
1188
|
+
/** Title_Ribbon01 (orange / plum / sky): a raised plate with folded ends. */
|
|
1189
|
+
declare function URibbon({ tone, children, width, }: {
|
|
1190
|
+
tone?: "orange" | "plum" | "sky";
|
|
1191
|
+
children: ReactNode;
|
|
1192
|
+
width?: number;
|
|
1193
|
+
}): ReactNode;
|
|
1194
|
+
/** BorderFrame_Oval timer: a dark pill with a clock. */
|
|
1195
|
+
declare function UTimer({ children }: {
|
|
1196
|
+
children: ReactNode;
|
|
1197
|
+
}): ReactNode;
|
|
1198
|
+
/** Title_Line01: "REWARDS" between two golden dividers. */
|
|
1199
|
+
declare function UDivider({ children }: {
|
|
1200
|
+
children: ReactNode;
|
|
1201
|
+
}): ReactNode;
|
|
1202
|
+
/** Image_Effect_Rotate: soft rays turning behind a prize. */
|
|
1203
|
+
declare function URays({ size, color, }: {
|
|
1204
|
+
size?: number;
|
|
1205
|
+
color?: string;
|
|
1206
|
+
}): ReactNode;
|
|
1207
|
+
type UMilestoneState = "locked" | "ready" | "claimed";
|
|
1208
|
+
interface UMilestone {
|
|
1209
|
+
id: string;
|
|
1210
|
+
/** Points (or rank) needed — shown in the left badge. */
|
|
1211
|
+
required: number;
|
|
1212
|
+
/** Shown instead of the number (e.g. "Top 3"). */
|
|
1213
|
+
label?: ReactNode;
|
|
1214
|
+
free: ResourceLine[];
|
|
1215
|
+
state: UMilestoneState;
|
|
1216
|
+
/** The premium column (events / season pass); omitted — the window has one column. */
|
|
1217
|
+
premium?: ResourceLine[];
|
|
1218
|
+
premiumState?: UMilestoneState;
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
* The reference's milestone window: a row per milestone — the required points in a badge, the free
|
|
1222
|
+
* reward, the premium reward (locked without the pass) — each with its Claim. `onClaim` returns
|
|
1223
|
+
* whether it succeeded; the row stays busy until then.
|
|
1224
|
+
*/
|
|
1225
|
+
declare function UMilestonesPopup({ title, glyph, value, milestones, premiumOwned, onPremiumLock, onClaim, onClose, }: {
|
|
1226
|
+
title?: ReactNode;
|
|
1227
|
+
glyph?: string;
|
|
1228
|
+
value: number;
|
|
1229
|
+
milestones: UMilestone[];
|
|
1230
|
+
premiumOwned?: boolean;
|
|
1231
|
+
/** A tap on a locked premium reward — the game opens its pass offer (VIP). */
|
|
1232
|
+
onPremiumLock?: () => void;
|
|
1233
|
+
onClaim: (id: string, track: "free" | "premium") => Promise<boolean>;
|
|
1234
|
+
onClose: () => void;
|
|
1235
|
+
}): ReactNode;
|
|
1236
|
+
/** Keyframes the U* components use; a screen drawing them renders this once. */
|
|
1237
|
+
declare const U_CSS = "\n@keyframes idos-u-spin { to { transform: rotate(360deg); } }\n@keyframes idos-u-attract { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }\n@keyframes idos-u-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }\n@keyframes idos-u-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }\n@keyframes idos-u-shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }\n";
|
|
1238
|
+
/** Renders U_CSS once per page (each U screen calls it; the tag is shared by id). */
|
|
1239
|
+
declare function UStyles(): ReactNode;
|
|
1240
|
+
|
|
1241
|
+
export { Badge, type Burst, Button, type ButtonProps, type ButtonTone, Card, type Catalog, type CelebrateOptions, Center, ConfirmPopup, CryptoBalanceChip, type CryptoBalanceView, type CurrencySection, DEFAULT_PLAYER_PREFS, DEFAULT_UI_CONFIG, DESKTOP_MIN_PX, EASE_IN, EASE_OUT, EASE_POP, EmptyState, FeatureGrid, type FeatureMenuItem, Field, type Flight, FxStore, GLYPHS, type Glyph, Icon, IconButton, type ItemDefinitionView, type ItemSection, ItemTile, KIT_CSS, type KitNotify, type KitOverlayState, KitPortal, LANGUAGE_EVENT, LANGUAGE_KEY, LEVEL_TONE, LanguageSwitch, type Layout, type NotificationAction, type NotificationInput, type NotificationLevel, type NotificationSource, NotificationStore, ON_TONE, type Point, Popup, type PopupProps, ProgressBar, RARITY_ORDER, type ResolvedSound, ResourceBadge, ResourceCounter, type ResourceKind, type ResourceLine, ResourceList, SOUND_PRESETS, SectionTitle, Select, type ShownNotification, Spinner, type SynthNoise, type SynthNote, type SynthPreset, TABLET_MIN_PX, TOAST_DURATION, type TabItem, Tabs, TextArea, TextInput, Timer, type TitleSections, U, UAvatar, UButton, UCloseCircle, UDivider, UFlag, UHexRank, UI_SOUND_EVENTS, UIconSlider, UItemFrame, UMedal, type UMilestone, type UMilestoneState, UMilestonesPopup, UPopup, URankRow, type URankTone, URays, URibbon, URow, type URowTone, UScreen, USlider, UStyles, UTabs, UTimer, type UTone, UTopBar, U_CSS, U_PATTERN, type UiKitConfig, type UiKitConfigInput, UiKitProvider, type UiKitProviderProps, type UiKitValue, type UiLanguage, type UiMotion, type UiMotionConfig, type UiPlayerPrefs, type UiSoundConfig, UiSoundEngine, type UiSoundEvent, type UiSoundSpec, type UiStringKey, type UiThemeConfig, Window, bundleLines, buttonStyle, canAfford, configSection, costLines, countdown, counterKeys, createNotificationStore, cryptoBalance, currencyGlyph, defineUiConfig, effectiveVolume, errorText, formatAmount, formatCryptoAmount, grantLines, grantedBy, groupBy, iconsFor, iouCurrencies, iouCurrencyOf, isGlyph, itemDefinitions, itemGlyph, layoutFor, makeT, mergeLines, motionDurations, onLanguageChange, outlined, panel, parsePlayerPrefs, pickLanguage, plural, rarityRank, renderKitOverlays, resolveSound, resolveUiConfig, resourceName, screenBackground, setAutoPopupsHeld, setLanguage, sortFeatures, themeVars, tokenGlyph, tokenName, tokenParts, toneSurface, uBackdrop, uText, uiT, useAnimatedNumber, useBalances, useCatalog, useCelebrate, useCounterValue, useGameLayout, useLanguage, useLayout, useMotion, useNotify, useNow, usePlayerPrefs, usePopupClose, usePresence, useSound, useStagger, useToast, useUiKit, v, well };
|