@moonwitness/ui 7.3.0 → 8.0.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.
Files changed (261) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/pixelfx-boundary.js +1 -1
  3. package/package.json +2 -3
  4. package/scripts/consumer-smoke.mjs +0 -45
  5. package/scripts/generate-icons.mjs +0 -110
  6. package/scripts/generate-token-artifacts.mjs +0 -90
  7. package/scripts/icon-svg-to-jsx.mjs +0 -249
  8. package/scripts/verification-diagnostics.mjs +0 -40
  9. package/scripts/verify-package.mjs +0 -412
  10. package/src/cartoon/anime-avatar.tsx +0 -628
  11. package/src/cartoon/anime-stage.tsx +0 -458
  12. package/src/cartoon/index.tsx +0 -542
  13. package/src/cartoon.tsx +0 -645
  14. package/src/characters.ts +0 -625
  15. package/src/components/accordion.tsx +0 -77
  16. package/src/components/alert.tsx +0 -139
  17. package/src/components/appearance-menu.tsx +0 -181
  18. package/src/components/artwork-frame.tsx +0 -49
  19. package/src/components/audio.tsx +0 -97
  20. package/src/components/avatar.tsx +0 -75
  21. package/src/components/badge.tsx +0 -94
  22. package/src/components/brand-mark.tsx +0 -73
  23. package/src/components/breadcrumbs.tsx +0 -98
  24. package/src/components/button.tsx +0 -340
  25. package/src/components/card.tsx +0 -171
  26. package/src/components/character-badge.tsx +0 -58
  27. package/src/components/character-preview.tsx +0 -104
  28. package/src/components/character-stage.tsx +0 -225
  29. package/src/components/chart.tsx +0 -481
  30. package/src/components/checkbox.tsx +0 -64
  31. package/src/components/comic-panel.tsx +0 -301
  32. package/src/components/comic-theater.tsx +0 -170
  33. package/src/components/command.tsx +0 -189
  34. package/src/components/confirm-dialog.tsx +0 -129
  35. package/src/components/copy-button.tsx +0 -62
  36. package/src/components/date-picker.tsx +0 -126
  37. package/src/components/dialog.tsx +0 -164
  38. package/src/components/dna-icon.tsx +0 -77
  39. package/src/components/dropdown-menu.tsx +0 -87
  40. package/src/components/effects.tsx +0 -1021
  41. package/src/components/empty-state.tsx +0 -93
  42. package/src/components/epistemic-branch-panel.tsx +0 -101
  43. package/src/components/error-state.tsx +0 -137
  44. package/src/components/field.tsx +0 -96
  45. package/src/components/filter-facet-bar.tsx +0 -91
  46. package/src/components/inbox-popover.tsx +0 -146
  47. package/src/components/input.tsx +0 -25
  48. package/src/components/kanban-board.tsx +0 -190
  49. package/src/components/label.tsx +0 -19
  50. package/src/components/layered-scene.tsx +0 -555
  51. package/src/components/log-console.tsx +0 -261
  52. package/src/components/metric-tile.tsx +0 -99
  53. package/src/components/mode-picker.tsx +0 -149
  54. package/src/components/motion-timeline.tsx +0 -848
  55. package/src/components/number-input.tsx +0 -104
  56. package/src/components/page-header.tsx +0 -123
  57. package/src/components/pagination.tsx +0 -83
  58. package/src/components/panel.tsx +0 -121
  59. package/src/components/paper-note.tsx +0 -77
  60. package/src/components/popover.tsx +0 -72
  61. package/src/components/progress.tsx +0 -127
  62. package/src/components/quest-card.tsx +0 -319
  63. package/src/components/radio-group.tsx +0 -50
  64. package/src/components/riot-sticker.tsx +0 -151
  65. package/src/components/scene-particles.tsx +0 -196
  66. package/src/components/scene-transitions.tsx +0 -130
  67. package/src/components/section-ribbon.tsx +0 -94
  68. package/src/components/select-field.tsx +0 -27
  69. package/src/components/select.tsx +0 -81
  70. package/src/components/separator.tsx +0 -58
  71. package/src/components/sheet.tsx +0 -96
  72. package/src/components/skeleton.tsx +0 -35
  73. package/src/components/sketch-annotation.tsx +0 -87
  74. package/src/components/smart-button-box.tsx +0 -114
  75. package/src/components/speech-bubble.tsx +0 -116
  76. package/src/components/spinner.tsx +0 -69
  77. package/src/components/sprite-player.tsx +0 -412
  78. package/src/components/status-bar.tsx +0 -63
  79. package/src/components/status-pill.tsx +0 -68
  80. package/src/components/switch.tsx +0 -76
  81. package/src/components/table.tsx +0 -163
  82. package/src/components/tabs.tsx +0 -101
  83. package/src/components/tag-input.tsx +0 -170
  84. package/src/components/textarea.tsx +0 -25
  85. package/src/components/toast.tsx +0 -14
  86. package/src/components/toolbar.tsx +0 -39
  87. package/src/components/tooltip.tsx +0 -49
  88. package/src/components/update-banner.tsx +0 -220
  89. package/src/components/xv-primitives.tsx +0 -256
  90. package/src/css-exports.ts +0 -142
  91. package/src/dna.tsx +0 -137
  92. package/src/game/boss-hud.tsx +0 -384
  93. package/src/game/index.tsx +0 -886
  94. package/src/game/tactical.tsx +0 -245
  95. package/src/game.tsx +0 -770
  96. package/src/icons/activity.tsx +0 -38
  97. package/src/icons/add.tsx +0 -38
  98. package/src/icons/addon.tsx +0 -37
  99. package/src/icons/anime-anger.tsx +0 -37
  100. package/src/icons/anime-shock.tsx +0 -37
  101. package/src/icons/anime-sparkle.tsx +0 -38
  102. package/src/icons/anime-sweatdrop.tsx +0 -38
  103. package/src/icons/archive.tsx +0 -37
  104. package/src/icons/arrow-left.tsx +0 -37
  105. package/src/icons/arrow-right.tsx +0 -37
  106. package/src/icons/attachment.tsx +0 -38
  107. package/src/icons/bank.tsx +0 -37
  108. package/src/icons/bolt.tsx +0 -37
  109. package/src/icons/book-open.tsx +0 -37
  110. package/src/icons/bookmark.tsx +0 -37
  111. package/src/icons/boss-skull.tsx +0 -40
  112. package/src/icons/calendar-clock.tsx +0 -40
  113. package/src/icons/calendar.tsx +0 -38
  114. package/src/icons/check-circle.tsx +0 -38
  115. package/src/icons/check-square.tsx +0 -38
  116. package/src/icons/check.tsx +0 -37
  117. package/src/icons/chevron-right.tsx +0 -37
  118. package/src/icons/chevrons-left.tsx +0 -37
  119. package/src/icons/chevrons-right.tsx +0 -37
  120. package/src/icons/clapperboard.tsx +0 -38
  121. package/src/icons/clock.tsx +0 -38
  122. package/src/icons/close.tsx +0 -37
  123. package/src/icons/code.tsx +0 -37
  124. package/src/icons/columns.tsx +0 -38
  125. package/src/icons/combo-flame.tsx +0 -38
  126. package/src/icons/company.tsx +0 -38
  127. package/src/icons/credit-card.tsx +0 -38
  128. package/src/icons/critical-star.tsx +0 -37
  129. package/src/icons/currency.tsx +0 -38
  130. package/src/icons/delete.tsx +0 -37
  131. package/src/icons/document.tsx +0 -38
  132. package/src/icons/download.tsx +0 -37
  133. package/src/icons/dpad.tsx +0 -38
  134. package/src/icons/edit.tsx +0 -38
  135. package/src/icons/element-fire.tsx +0 -37
  136. package/src/icons/element-ice.tsx +0 -38
  137. package/src/icons/element-solar.tsx +0 -38
  138. package/src/icons/element-void.tsx +0 -38
  139. package/src/icons/element-volt.tsx +0 -38
  140. package/src/icons/element-wind.tsx +0 -37
  141. package/src/icons/error.tsx +0 -38
  142. package/src/icons/external-link.tsx +0 -38
  143. package/src/icons/field.tsx +0 -38
  144. package/src/icons/file-spreadsheet.tsx +0 -38
  145. package/src/icons/filter.tsx +0 -37
  146. package/src/icons/gacha-ticket.tsx +0 -38
  147. package/src/icons/gamepad.tsx +0 -40
  148. package/src/icons/globe.tsx +0 -38
  149. package/src/icons/grid.tsx +0 -40
  150. package/src/icons/hash.tsx +0 -37
  151. package/src/icons/heart-hp.tsx +0 -38
  152. package/src/icons/history.tsx +0 -37
  153. package/src/icons/home.tsx +0 -37
  154. package/src/icons/image.tsx +0 -39
  155. package/src/icons/impact-slash.tsx +0 -38
  156. package/src/icons/inbox.tsx +0 -38
  157. package/src/icons/index.ts +0 -120
  158. package/src/icons/info.tsx +0 -38
  159. package/src/icons/jobs.tsx +0 -38
  160. package/src/icons/katana.tsx +0 -38
  161. package/src/icons/key.tsx +0 -38
  162. package/src/icons/keyboard.tsx +0 -38
  163. package/src/icons/keyframe-diamond.tsx +0 -38
  164. package/src/icons/knowledge.tsx +0 -38
  165. package/src/icons/language.tsx +0 -39
  166. package/src/icons/lock.tsx +0 -38
  167. package/src/icons/logout.tsx +0 -37
  168. package/src/icons/loot-chest.tsx +0 -39
  169. package/src/icons/mail.tsx +0 -38
  170. package/src/icons/mana-crystal.tsx +0 -38
  171. package/src/icons/map-pin.tsx +0 -38
  172. package/src/icons/mecha-helm.tsx +0 -38
  173. package/src/icons/menu.tsx +0 -37
  174. package/src/icons/message.tsx +0 -38
  175. package/src/icons/model.tsx +0 -38
  176. package/src/icons/moon.tsx +0 -37
  177. package/src/icons/notification.tsx +0 -38
  178. package/src/icons/partner.tsx +0 -41
  179. package/src/icons/pause.tsx +0 -37
  180. package/src/icons/phone.tsx +0 -37
  181. package/src/icons/play.tsx +0 -37
  182. package/src/icons/potion-flask.tsx +0 -40
  183. package/src/icons/quest-scroll.tsx +0 -39
  184. package/src/icons/radar-ping.tsx +0 -40
  185. package/src/icons/refresh.tsx +0 -38
  186. package/src/icons/relation.tsx +0 -40
  187. package/src/icons/save.tsx +0 -38
  188. package/src/icons/search.tsx +0 -38
  189. package/src/icons/security.tsx +0 -38
  190. package/src/icons/send.tsx +0 -38
  191. package/src/icons/settings.tsx +0 -39
  192. package/src/icons/shield-crest.tsx +0 -38
  193. package/src/icons/shuriken.tsx +0 -38
  194. package/src/icons/signal-off.tsx +0 -37
  195. package/src/icons/signal.tsx +0 -37
  196. package/src/icons/skill-node.tsx +0 -40
  197. package/src/icons/smartphone.tsx +0 -38
  198. package/src/icons/sort-ascending.tsx +0 -37
  199. package/src/icons/sort-descending.tsx +0 -37
  200. package/src/icons/sort.tsx +0 -37
  201. package/src/icons/sparkle.tsx +0 -38
  202. package/src/icons/speech-burst.tsx +0 -37
  203. package/src/icons/story.tsx +0 -37
  204. package/src/icons/sun.tsx +0 -38
  205. package/src/icons/tag.tsx +0 -38
  206. package/src/icons/team.tsx +0 -40
  207. package/src/icons/trophy-crown.tsx +0 -39
  208. package/src/icons/upload.tsx +0 -37
  209. package/src/icons/user.tsx +0 -38
  210. package/src/icons/users.tsx +0 -39
  211. package/src/icons/visibility-off.tsx +0 -38
  212. package/src/icons/visibility.tsx +0 -38
  213. package/src/icons/volume-off.tsx +0 -37
  214. package/src/icons/volume.tsx +0 -37
  215. package/src/icons/warning.tsx +0 -38
  216. package/src/icons/workflow.tsx +0 -40
  217. package/src/icons.tsx +0 -965
  218. package/src/index.ts +0 -89
  219. package/src/lib/asset-registry.ts +0 -534
  220. package/src/lib/audio-runtime.ts +0 -314
  221. package/src/lib/character-adapter.ts +0 -370
  222. package/src/lib/character-registry.ts +0 -2368
  223. package/src/lib/cn.ts +0 -6
  224. package/src/lib/compose-refs.ts +0 -16
  225. package/src/lib/sanitize-url.ts +0 -51
  226. package/src/lib/scene-camera.ts +0 -483
  227. package/src/lib/scene-playback.ts +0 -622
  228. package/src/lib/scene-soundscape.ts +0 -151
  229. package/src/lib/scene-test-harness.ts +0 -200
  230. package/src/lib/scene-timeline.ts +0 -398
  231. package/src/lib/use-animation-visibility.ts +0 -45
  232. package/src/lib/use-modal-focus.ts +0 -270
  233. package/src/lib/use-reduced-motion.ts +0 -37
  234. package/src/motion/easing-presets.ts +0 -262
  235. package/src/motion/index.tsx +0 -894
  236. package/src/motion/physics.ts +0 -259
  237. package/src/motion/timeline-math.ts +0 -358
  238. package/src/motion.tsx +0 -639
  239. package/src/pixelfx-boundary.ts +0 -188
  240. package/src/pixelfx-registry.ts +0 -1190
  241. package/src/pixelfx-types.d.ts +0 -73
  242. package/src/pixelfx.tsx +0 -1022
  243. package/src/provider.tsx +0 -63
  244. package/src/skin-catalog.ts +0 -306
  245. package/src/skin-tokens.ts +0 -425
  246. package/src/ssr/init-script.ts +0 -281
  247. package/src/ssr/resolve-skin.ts +0 -217
  248. package/src/ssr/theme-mismatch-dev.ts +0 -181
  249. package/src/templates/battle-arena.tsx +0 -688
  250. package/src/templates/index.tsx +0 -314
  251. package/src/templates.tsx +0 -225
  252. package/src/themes/dna-presets.ts +0 -119
  253. package/src/themes/index.ts +0 -56
  254. package/src/themes/provider.tsx +0 -183
  255. package/src/themes/types.ts +0 -111
  256. package/src/themes.ts +0 -9
  257. package/src/token-exporter.ts +0 -12
  258. package/src/token-exporters.ts +0 -343
  259. package/src/token-seeds.ts +0 -335
  260. package/src/token-snapshot.ts +0 -179
  261. package/src/utils.ts +0 -58
package/src/cartoon.tsx DELETED
@@ -1,645 +0,0 @@
1
- import { useEffect, useState, type ReactNode } from "react";
2
- import { getCharacterById } from "./characters.js";
3
- import { Button } from "./components/button.js";
4
- import { Badge } from "./components/badge.js";
5
- import { PixelFxComponentLayer } from "./pixelfx.js";
6
- import { resolveComponentPixelFx } from "./pixelfx-registry.js";
7
-
8
- export type CartoonRigMood =
9
- | "neutral"
10
- | "happy"
11
- | "surprised"
12
- | "determined"
13
- | "angry"
14
- | "ko";
15
-
16
- export type CartoonRigPose =
17
- | "idle"
18
- | "attack"
19
- | "victory"
20
- | "hurt"
21
- | "guard";
22
-
23
- export type AnimeEmoteKind =
24
- | "sparkle"
25
- | "sweatdrop"
26
- | "anger"
27
- | "shock"
28
- | "exclaim"
29
- | "question";
30
-
31
- export type OnomatopoeiaTone = "impact" | "electric" | "speed" | "comic";
32
-
33
- const RIG_SIZES = { sm: 58, md: 92, lg: 136 };
34
-
35
- export type CartoonRigProps = {
36
- characterId: string;
37
- name?: string;
38
- mood?: CartoonRigMood;
39
- pose?: CartoonRigPose;
40
- emote?: AnimeEmoteKind;
41
- size?: "sm" | "md" | "lg";
42
- squashTrigger?: number;
43
- breathing?: boolean;
44
- fx?: boolean | "auto";
45
- className?: string;
46
- };
47
-
48
- export function CartoonRig({
49
- characterId,
50
- name,
51
- mood = "neutral",
52
- pose = "idle",
53
- emote,
54
- size = "md",
55
- squashTrigger = 0,
56
- breathing = true,
57
- fx = "auto",
58
- className = "",
59
- }: CartoonRigProps) {
60
- const [hovered, setHovered] = useState(false);
61
- const profile = getCharacterById(characterId);
62
- const dim = RIG_SIZES[size];
63
- const fxEnabled = fx !== false;
64
- const resolvedFx = resolveComponentPixelFx("cartoon-rig", emote);
65
- const primary = profile?.palette.primary ?? "var(--mw-magenta)";
66
- const accent = profile?.palette.accent ?? "var(--mw-cyan)";
67
- const hair = profile?.palette.hair ?? "var(--mw-night)";
68
- const eyeStyle =
69
- mood === "happy"
70
- ? "M36 46 Q41 40 46 46 M54 46 Q59 40 64 46"
71
- : mood === "angry"
72
- ? "M36 42 L46 46 M64 42 L54 46"
73
- : mood === "ko"
74
- ? "M37 42 L45 50 M45 42 L37 50 M55 42 L63 50 M63 42 L55 50"
75
- : null;
76
- const mouthPath =
77
- mood === "happy"
78
- ? "M42 60 Q50 69 58 60"
79
- : mood === "surprised"
80
- ? "M46 61 A4 5 0 1 0 54 61 A4 5 0 1 0 46 61"
81
- : mood === "angry"
82
- ? "M42 65 Q50 58 58 65"
83
- : mood === "determined"
84
- ? "M43 62 L57 60"
85
- : mood === "ko"
86
- ? "M44 64 Q50 60 56 64"
87
- : "M44 62 Q50 65 56 62";
88
-
89
- const poseTransform =
90
- pose === "attack"
91
- ? "rotate(-7deg) translateX(4px)"
92
- : pose === "hurt"
93
- ? "rotate(8deg) translateX(-4px)"
94
- : pose === "victory"
95
- ? "translateY(-4px) scale(1.04)"
96
- : "none";
97
-
98
- return (
99
- <div
100
- className={`mw-ui-cartoon-rig ${className}`.trim()}
101
- data-character-id={characterId}
102
- data-mood={mood}
103
- data-pose={pose}
104
- data-squash={squashTrigger}
105
- data-breathing={breathing ? "true" : "false"}
106
- data-pixelfx={fxEnabled ? resolvedFx.effectId : "none"}
107
- data-pixelfx-ready="true"
108
- aria-label={`${name ?? profile?.name ?? characterId} rig (${mood})`}
109
- onMouseEnter={() => setHovered(true)}
110
- onMouseLeave={() => setHovered(false)}
111
- style={{
112
- position: "relative",
113
- display: "inline-grid",
114
- placeItems: "center",
115
- width: `${dim}px`,
116
- height: `${dim}px`,
117
- transform: poseTransform,
118
- transition: "transform 160ms ease",
119
- }}
120
- >
121
- {fxEnabled ? (
122
- <PixelFxComponentLayer
123
- effectId={resolvedFx.effectId}
124
- paletteId={resolvedFx.paletteId}
125
- layer={resolvedFx.layer}
126
- loop
127
- active={Boolean(emote) || hovered}
128
- speed={resolvedFx.speed}
129
- seed={resolvedFx.seed}
130
- lightK={resolvedFx.lightK}
131
- placement="background"
132
- />
133
- ) : null}
134
- <svg
135
- viewBox="0 0 100 100"
136
- width={dim}
137
- height={dim}
138
- style={{ position: "relative", zIndex: 2 }}
139
- >
140
- <rect
141
- x="6"
142
- y="6"
143
- width="88"
144
- height="88"
145
- rx="14"
146
- fill={primary}
147
- fillOpacity="0.16"
148
- stroke={primary}
149
- strokeWidth="3"
150
- />
151
- {/* Hair silhouette */}
152
- <path
153
- d="M22 44 C22 18, 78 18, 78 44 L82 64 L18 64 Z"
154
- fill={hair}
155
- stroke="var(--mw-anime-ink)"
156
- strokeWidth="2.5"
157
- />
158
- {/* Face */}
159
- <circle
160
- cx="50"
161
- cy="52"
162
- r="22"
163
- fill="var(--mw-anime-face)"
164
- stroke="var(--mw-anime-ink)"
165
- strokeWidth="2.5"
166
- />
167
- {/* Forehead headband / visor accent */}
168
- <path
169
- d="M28 38 Q50 28 72 38"
170
- fill="none"
171
- stroke={accent}
172
- strokeWidth="4.5"
173
- strokeLinecap="round"
174
- />
175
- {/* Eyes */}
176
- {eyeStyle ? (
177
- <path
178
- d={eyeStyle}
179
- fill="none"
180
- stroke="var(--mw-anime-ink)"
181
- strokeWidth="3"
182
- strokeLinecap="round"
183
- />
184
- ) : (
185
- <>
186
- <circle cx="41" cy="48" r="3.4" fill="var(--mw-anime-ink)" />
187
- <circle cx="59" cy="48" r="3.4" fill="var(--mw-anime-ink)" />
188
- <circle cx="42" cy="46.8" r="1.1" fill="var(--mw-anime-highlight)" />
189
- <circle cx="60" cy="46.8" r="1.1" fill="var(--mw-anime-highlight)" />
190
- </>
191
- )}
192
- {/* Mouth */}
193
- <path
194
- d={mouthPath}
195
- fill="none"
196
- stroke="var(--mw-anime-ink)"
197
- strokeWidth="2.6"
198
- strokeLinecap="round"
199
- />
200
- {/* Collar / shoulders */}
201
- <path
202
- d="M26 88 C28 74, 72 74, 74 88 Z"
203
- fill={primary}
204
- stroke="var(--mw-anime-ink)"
205
- strokeWidth="2.5"
206
- />
207
- </svg>
208
- {emote ? <AnimeEmoteBubble kind={emote} /> : null}
209
- </div>
210
- );
211
- }
212
-
213
- export function AnimeEmoteBubble({
214
- kind,
215
- }: {
216
- kind: AnimeEmoteKind;
217
- }) {
218
- const symbolMap: Record<AnimeEmoteKind, string> = {
219
- sparkle: "✦",
220
- sweatdrop: "💧",
221
- anger: "💢",
222
- shock: "⚡",
223
- exclaim: "!!",
224
- question: "?",
225
- };
226
- return (
227
- <span
228
- aria-hidden="true"
229
- className="mw-ui-anime-emote"
230
- data-emote={kind}
231
- style={{
232
- position: "absolute",
233
- top: "-0.35rem",
234
- right: "-0.35rem",
235
- zIndex: 3,
236
- padding: "0.1rem 0.35rem",
237
- background: "var(--mw-yellow)",
238
- color: "var(--mw-on-accent)",
239
- border: "1.5px solid var(--mw-border-strong)",
240
- fontSize: "0.75rem",
241
- fontWeight: 800,
242
- boxShadow: "2px 2px 0 0 var(--mw-border-strong)",
243
- }}
244
- >
245
- {symbolMap[kind]}
246
- </span>
247
- );
248
- }
249
-
250
- export function OnomatopoeiaSFX({
251
- text,
252
- tone = "impact",
253
- tiltDeg = -8,
254
- fx = "auto",
255
- className = "",
256
- }: {
257
- text: string;
258
- tone?: OnomatopoeiaTone;
259
- tiltDeg?: number;
260
- fx?: boolean | "auto";
261
- className?: string;
262
- }) {
263
- const [hovered, setHovered] = useState(false);
264
- const fxEnabled = fx !== false;
265
- const resolvedFx = resolveComponentPixelFx("onomatopoeia", tone);
266
- const palette: Record<OnomatopoeiaTone, { bg: string; fg: string; stroke: string }> = {
267
- impact: {
268
- bg: "var(--mw-magenta)",
269
- fg: "var(--mw-on-magenta)",
270
- stroke: "var(--mw-border-strong)",
271
- },
272
- electric: {
273
- bg: "var(--mw-cyan)",
274
- fg: "var(--mw-on-accent)",
275
- stroke: "var(--mw-border-strong)",
276
- },
277
- speed: {
278
- bg: "var(--mw-yellow)",
279
- fg: "var(--mw-on-accent)",
280
- stroke: "var(--mw-border-strong)",
281
- },
282
- comic: {
283
- bg: "var(--mw-paper)",
284
- fg: "var(--mw-ink)",
285
- stroke: "var(--mw-magenta)",
286
- },
287
- };
288
- const colors = palette[tone];
289
-
290
- return (
291
- <span
292
- className={`mw-ui-onomatopoeia ${className}`.trim()}
293
- data-tone={tone}
294
- data-pixelfx={fxEnabled ? resolvedFx.effectId : "none"}
295
- data-pixelfx-ready="true"
296
- onMouseEnter={() => setHovered(true)}
297
- onMouseLeave={() => setHovered(false)}
298
- style={{
299
- position: "relative",
300
- overflow: "hidden",
301
- display: "inline-block",
302
- padding: "0.3rem 0.8rem",
303
- background: colors.bg,
304
- color: colors.fg,
305
- border: `2.5px solid ${colors.stroke}`,
306
- fontFamily: "var(--mw-font-brush)",
307
- fontSize: "1.35rem",
308
- letterSpacing: "0.06em",
309
- textTransform: "uppercase",
310
- transform: `rotate(${tiltDeg}deg)`,
311
- boxShadow: `4px 4px 0 0 ${colors.stroke}`,
312
- }}
313
- >
314
- {fxEnabled ? (
315
- <PixelFxComponentLayer
316
- effectId={resolvedFx.effectId}
317
- paletteId={resolvedFx.paletteId}
318
- layer={resolvedFx.layer}
319
- loop
320
- active={hovered}
321
- speed={resolvedFx.speed}
322
- seed={resolvedFx.seed}
323
- lightK={resolvedFx.lightK}
324
- placement="background"
325
- />
326
- ) : null}
327
- <span style={{ position: "relative", zIndex: 2 }}>{text}</span>
328
- </span>
329
- );
330
- }
331
-
332
- export function SmearFrame({
333
- active = false,
334
- direction = "right",
335
- children,
336
- }: {
337
- active?: boolean;
338
- direction?: "left" | "right";
339
- children: ReactNode;
340
- }) {
341
- return (
342
- <div
343
- className="mw-ui-smear-frame"
344
- data-active={active ? "true" : "false"}
345
- style={{
346
- display: "inline-block",
347
- transform: active
348
- ? `skewX(${direction === "right" ? -12 : 12}deg) scaleX(1.08)`
349
- : "none",
350
- filter: active
351
- ? "drop-shadow(-6px 0 0 color-mix(in srgb, var(--mw-magenta) 45%, transparent))"
352
- : undefined,
353
- transition: "transform 90ms ease-out",
354
- }}
355
- >
356
- {children}
357
- </div>
358
- );
359
- }
360
-
361
- export function ImpactFlash({ active = false }: { active?: boolean }) {
362
- if (!active) return null;
363
- return (
364
- <div
365
- aria-hidden="true"
366
- className="mw-ui-impact-flash"
367
- style={{
368
- position: "absolute",
369
- inset: 0,
370
- background: "color-mix(in srgb, var(--mw-moon) 72%, transparent)",
371
- pointerEvents: "none",
372
- zIndex: 9,
373
- }}
374
- />
375
- );
376
- }
377
-
378
- export function AnimeCutIn({
379
- active,
380
- characterId,
381
- onDismiss,
382
- fx = "auto",
383
- }: {
384
- active: boolean;
385
- characterId: string;
386
- onDismiss?: () => void;
387
- fx?: boolean | "auto";
388
- }) {
389
- const profile = getCharacterById(characterId);
390
- if (!active || !profile) return null;
391
- const fxEnabled = fx !== false;
392
- const resolvedFx = resolveComponentPixelFx("anime-cut-in");
393
-
394
- return (
395
- <div
396
- role="status"
397
- className="mw-ui-anime-cut-in"
398
- data-character-id={profile.id}
399
- data-pixelfx={fxEnabled ? resolvedFx.effectId : "none"}
400
- data-pixelfx-ready="true"
401
- style={{
402
- position: "relative",
403
- overflow: "hidden",
404
- display: "flex",
405
- flexWrap: "wrap",
406
- alignItems: "center",
407
- justifyContent: "space-between",
408
- gap: "0.85rem",
409
- padding: "0.85rem 1.1rem",
410
- border: `2.5px solid ${profile.palette.accent}`,
411
- background: `linear-gradient(115deg, var(--mw-night) 0%, ${profile.palette.primary} 100%)`,
412
- color: "var(--mw-moon)",
413
- boxShadow: "5px 5px 0 0 var(--mw-night)",
414
- }}
415
- >
416
- {fxEnabled ? (
417
- <PixelFxComponentLayer
418
- effectId={resolvedFx.effectId}
419
- paletteId={resolvedFx.paletteId}
420
- layer={resolvedFx.layer}
421
- loop
422
- active={active}
423
- speed={resolvedFx.speed}
424
- seed={resolvedFx.seed}
425
- lightK={resolvedFx.lightK}
426
- placement="background"
427
- />
428
- ) : null}
429
- <div
430
- style={{
431
- position: "relative",
432
- zIndex: 2,
433
- display: "flex",
434
- alignItems: "center",
435
- gap: "0.75rem",
436
- }}
437
- >
438
- <CartoonRig
439
- characterId={profile.id}
440
- mood="determined"
441
- pose="attack"
442
- size="sm"
443
- breathing={false}
444
- />
445
- <div style={{ display: "grid", gap: "0.15rem" }}>
446
- <small style={{ letterSpacing: "0.1em", opacity: 0.9 }}>
447
- {profile.ultimate.jpCallout}
448
- </small>
449
- <strong
450
- style={{
451
- fontFamily: "var(--mw-font-display)",
452
- fontSize: "1.25rem",
453
- letterSpacing: "0.04em",
454
- }}
455
- >
456
- {profile.name.toUpperCase()} — {profile.ultimate.name}
457
- </strong>
458
- <span style={{ fontSize: "0.82rem", opacity: 0.9 }}>
459
- “{profile.ultimate.quote}”
460
- </span>
461
- </div>
462
- </div>
463
- {onDismiss ? (
464
- <div style={{ position: "relative", zIndex: 2 }}>
465
- <Button size="xs" variant="outline" onClick={onDismiss}>
466
- Dismiss
467
- </Button>
468
- </div>
469
- ) : null}
470
- </div>
471
- );
472
- }
473
-
474
- export function StoryboardPlayer({
475
- frames,
476
- }: {
477
- frames?: ReadonlyArray<{ id: string; title: string; note: string }>;
478
- }) {
479
- const safeFrames = frames ?? [
480
- { id: "01", title: "Beat 1 · Establishing", note: "Moon City rooftop skyline." },
481
- { id: "02", title: "Beat 2 · Cut-In", note: "Kuro Signal locks the beacon." },
482
- { id: "03", title: "Beat 3 · Impact", note: "Halftone burst into title card." },
483
- ];
484
- const [idx, setIdx] = useState(0);
485
- const [playing, setPlaying] = useState(false);
486
-
487
- useEffect(() => {
488
- if (!playing || safeFrames.length <= 1) return;
489
- const timer = window.setInterval(() => {
490
- setIdx((i) => (i + 1) % safeFrames.length);
491
- }, 1200);
492
- return () => window.clearInterval(timer);
493
- }, [playing, safeFrames.length]);
494
-
495
- const current = safeFrames[idx] ?? safeFrames[0];
496
-
497
- return (
498
- <div
499
- style={{
500
- display: "grid",
501
- gap: "0.6rem",
502
- padding: "0.85rem",
503
- border: "1.5px solid var(--mw-border-strong)",
504
- background: "var(--mw-surface)",
505
- }}
506
- >
507
- <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
508
- <Badge size="sm" variant="cyan">
509
- FRAME {current.id}
510
- </Badge>
511
- <div style={{ display: "flex", gap: "0.35rem" }}>
512
- <Button
513
- size="xs"
514
- variant={playing ? "magenta" : "default"}
515
- onClick={() => setPlaying((p) => !p)}
516
- >
517
- {playing ? "Pause" : "Play"}
518
- </Button>
519
- <Button
520
- size="xs"
521
- variant="outline"
522
- disabled={idx === 0}
523
- onClick={() => setIdx((i) => Math.max(0, i - 1))}
524
- >
525
- Prev
526
- </Button>
527
- <Button
528
- size="xs"
529
- variant="outline"
530
- disabled={idx >= safeFrames.length - 1}
531
- onClick={() => setIdx((i) => Math.min(safeFrames.length - 1, i + 1))}
532
- >
533
- Next
534
- </Button>
535
- </div>
536
- </div>
537
- <strong>{current.title}</strong>
538
- <p style={{ margin: 0, fontSize: "0.84rem", color: "var(--mw-muted-foreground)" }}>
539
- {current.note}
540
- </p>
541
- </div>
542
- );
543
- }
544
-
545
- export function VisualNovelStage({
546
- characterId = "kuro-signal",
547
- dialogue = "Keep the signal clear and grounded.",
548
- }: {
549
- characterId?: string;
550
- dialogue?: string;
551
- }) {
552
- const profile = getCharacterById(characterId);
553
- return (
554
- <div
555
- style={{
556
- display: "flex",
557
- alignItems: "center",
558
- gap: "0.9rem",
559
- padding: "0.9rem",
560
- border: "2px solid var(--mw-border-strong)",
561
- background: "var(--mw-surface)",
562
- }}
563
- >
564
- <CartoonRig characterId={characterId} size="sm" />
565
- <div>
566
- <strong style={{ display: "block" }}>{profile?.name ?? characterId}</strong>
567
- <p style={{ margin: "0.2rem 0 0", fontSize: "0.86rem" }}>{dialogue}</p>
568
- </div>
569
- </div>
570
- );
571
- }
572
-
573
- export function EpisodeTitleCard({
574
- episode = "EPISODE 01",
575
- title = "SIGNAL IN THE SHADOW",
576
- fx = "auto",
577
- }: {
578
- episode?: string;
579
- title?: string;
580
- fx?: boolean | "auto";
581
- }) {
582
- const [hovered, setHovered] = useState(false);
583
- const fxEnabled = fx !== false;
584
- const resolvedFx = resolveComponentPixelFx("episode-title-card");
585
-
586
- return (
587
- <div
588
- className="mw-ui-episode-title-card"
589
- data-pixelfx={fxEnabled ? resolvedFx.effectId : "none"}
590
- data-pixelfx-ready="true"
591
- onMouseEnter={() => setHovered(true)}
592
- onMouseLeave={() => setHovered(false)}
593
- style={{
594
- position: "relative",
595
- overflow: "hidden",
596
- padding: "1rem 1.2rem",
597
- border: "2.5px solid var(--mw-border-strong)",
598
- background: "var(--mw-night)",
599
- color: "var(--mw-moon)",
600
- boxShadow: "4px 4px 0 0 var(--mw-magenta)",
601
- }}
602
- >
603
- {fxEnabled ? (
604
- <PixelFxComponentLayer
605
- effectId={resolvedFx.effectId}
606
- paletteId={resolvedFx.paletteId}
607
- layer={resolvedFx.layer}
608
- loop
609
- active={hovered}
610
- speed={resolvedFx.speed}
611
- seed={resolvedFx.seed}
612
- lightK={resolvedFx.lightK}
613
- placement="background"
614
- />
615
- ) : null}
616
- <div style={{ position: "relative", zIndex: 2 }}>
617
- <small style={{ color: "var(--mw-cyan)", letterSpacing: "0.12em" }}>
618
- {episode}
619
- </small>
620
- <h4
621
- style={{
622
- margin: "0.25rem 0 0",
623
- fontFamily: "var(--mw-font-display)",
624
- fontSize: "1.45rem",
625
- }}
626
- >
627
- {title}
628
- </h4>
629
- </div>
630
- </div>
631
- );
632
- }
633
-
634
- export function useLipSync(active: boolean) {
635
- const [open, setOpen] = useState(false);
636
- useEffect(() => {
637
- if (!active) {
638
- setOpen(false);
639
- return;
640
- }
641
- const timer = window.setInterval(() => setOpen((o) => !o), 150);
642
- return () => window.clearInterval(timer);
643
- }, [active]);
644
- return open;
645
- }