@moonwitness/ui 7.3.1 → 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 (260) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +2 -3
  3. package/scripts/consumer-smoke.mjs +0 -45
  4. package/scripts/generate-icons.mjs +0 -110
  5. package/scripts/generate-token-artifacts.mjs +0 -90
  6. package/scripts/icon-svg-to-jsx.mjs +0 -249
  7. package/scripts/verification-diagnostics.mjs +0 -40
  8. package/scripts/verify-package.mjs +0 -412
  9. package/src/cartoon/anime-avatar.tsx +0 -628
  10. package/src/cartoon/anime-stage.tsx +0 -458
  11. package/src/cartoon/index.tsx +0 -542
  12. package/src/cartoon.tsx +0 -645
  13. package/src/characters.ts +0 -625
  14. package/src/components/accordion.tsx +0 -77
  15. package/src/components/alert.tsx +0 -139
  16. package/src/components/appearance-menu.tsx +0 -181
  17. package/src/components/artwork-frame.tsx +0 -49
  18. package/src/components/audio.tsx +0 -97
  19. package/src/components/avatar.tsx +0 -75
  20. package/src/components/badge.tsx +0 -94
  21. package/src/components/brand-mark.tsx +0 -73
  22. package/src/components/breadcrumbs.tsx +0 -98
  23. package/src/components/button.tsx +0 -340
  24. package/src/components/card.tsx +0 -171
  25. package/src/components/character-badge.tsx +0 -58
  26. package/src/components/character-preview.tsx +0 -104
  27. package/src/components/character-stage.tsx +0 -225
  28. package/src/components/chart.tsx +0 -481
  29. package/src/components/checkbox.tsx +0 -64
  30. package/src/components/comic-panel.tsx +0 -301
  31. package/src/components/comic-theater.tsx +0 -170
  32. package/src/components/command.tsx +0 -189
  33. package/src/components/confirm-dialog.tsx +0 -129
  34. package/src/components/copy-button.tsx +0 -62
  35. package/src/components/date-picker.tsx +0 -126
  36. package/src/components/dialog.tsx +0 -164
  37. package/src/components/dna-icon.tsx +0 -77
  38. package/src/components/dropdown-menu.tsx +0 -87
  39. package/src/components/effects.tsx +0 -1021
  40. package/src/components/empty-state.tsx +0 -93
  41. package/src/components/epistemic-branch-panel.tsx +0 -101
  42. package/src/components/error-state.tsx +0 -137
  43. package/src/components/field.tsx +0 -96
  44. package/src/components/filter-facet-bar.tsx +0 -91
  45. package/src/components/inbox-popover.tsx +0 -146
  46. package/src/components/input.tsx +0 -25
  47. package/src/components/kanban-board.tsx +0 -190
  48. package/src/components/label.tsx +0 -19
  49. package/src/components/layered-scene.tsx +0 -555
  50. package/src/components/log-console.tsx +0 -261
  51. package/src/components/metric-tile.tsx +0 -99
  52. package/src/components/mode-picker.tsx +0 -149
  53. package/src/components/motion-timeline.tsx +0 -848
  54. package/src/components/number-input.tsx +0 -104
  55. package/src/components/page-header.tsx +0 -123
  56. package/src/components/pagination.tsx +0 -83
  57. package/src/components/panel.tsx +0 -121
  58. package/src/components/paper-note.tsx +0 -77
  59. package/src/components/popover.tsx +0 -72
  60. package/src/components/progress.tsx +0 -127
  61. package/src/components/quest-card.tsx +0 -319
  62. package/src/components/radio-group.tsx +0 -50
  63. package/src/components/riot-sticker.tsx +0 -151
  64. package/src/components/scene-particles.tsx +0 -196
  65. package/src/components/scene-transitions.tsx +0 -130
  66. package/src/components/section-ribbon.tsx +0 -94
  67. package/src/components/select-field.tsx +0 -27
  68. package/src/components/select.tsx +0 -81
  69. package/src/components/separator.tsx +0 -58
  70. package/src/components/sheet.tsx +0 -96
  71. package/src/components/skeleton.tsx +0 -35
  72. package/src/components/sketch-annotation.tsx +0 -87
  73. package/src/components/smart-button-box.tsx +0 -114
  74. package/src/components/speech-bubble.tsx +0 -116
  75. package/src/components/spinner.tsx +0 -69
  76. package/src/components/sprite-player.tsx +0 -412
  77. package/src/components/status-bar.tsx +0 -63
  78. package/src/components/status-pill.tsx +0 -68
  79. package/src/components/switch.tsx +0 -76
  80. package/src/components/table.tsx +0 -163
  81. package/src/components/tabs.tsx +0 -101
  82. package/src/components/tag-input.tsx +0 -170
  83. package/src/components/textarea.tsx +0 -25
  84. package/src/components/toast.tsx +0 -14
  85. package/src/components/toolbar.tsx +0 -39
  86. package/src/components/tooltip.tsx +0 -49
  87. package/src/components/update-banner.tsx +0 -220
  88. package/src/components/xv-primitives.tsx +0 -256
  89. package/src/css-exports.ts +0 -142
  90. package/src/dna.tsx +0 -137
  91. package/src/game/boss-hud.tsx +0 -384
  92. package/src/game/index.tsx +0 -886
  93. package/src/game/tactical.tsx +0 -245
  94. package/src/game.tsx +0 -770
  95. package/src/icons/activity.tsx +0 -38
  96. package/src/icons/add.tsx +0 -38
  97. package/src/icons/addon.tsx +0 -37
  98. package/src/icons/anime-anger.tsx +0 -37
  99. package/src/icons/anime-shock.tsx +0 -37
  100. package/src/icons/anime-sparkle.tsx +0 -38
  101. package/src/icons/anime-sweatdrop.tsx +0 -38
  102. package/src/icons/archive.tsx +0 -37
  103. package/src/icons/arrow-left.tsx +0 -37
  104. package/src/icons/arrow-right.tsx +0 -37
  105. package/src/icons/attachment.tsx +0 -38
  106. package/src/icons/bank.tsx +0 -37
  107. package/src/icons/bolt.tsx +0 -37
  108. package/src/icons/book-open.tsx +0 -37
  109. package/src/icons/bookmark.tsx +0 -37
  110. package/src/icons/boss-skull.tsx +0 -40
  111. package/src/icons/calendar-clock.tsx +0 -40
  112. package/src/icons/calendar.tsx +0 -38
  113. package/src/icons/check-circle.tsx +0 -38
  114. package/src/icons/check-square.tsx +0 -38
  115. package/src/icons/check.tsx +0 -37
  116. package/src/icons/chevron-right.tsx +0 -37
  117. package/src/icons/chevrons-left.tsx +0 -37
  118. package/src/icons/chevrons-right.tsx +0 -37
  119. package/src/icons/clapperboard.tsx +0 -38
  120. package/src/icons/clock.tsx +0 -38
  121. package/src/icons/close.tsx +0 -37
  122. package/src/icons/code.tsx +0 -37
  123. package/src/icons/columns.tsx +0 -38
  124. package/src/icons/combo-flame.tsx +0 -38
  125. package/src/icons/company.tsx +0 -38
  126. package/src/icons/credit-card.tsx +0 -38
  127. package/src/icons/critical-star.tsx +0 -37
  128. package/src/icons/currency.tsx +0 -38
  129. package/src/icons/delete.tsx +0 -37
  130. package/src/icons/document.tsx +0 -38
  131. package/src/icons/download.tsx +0 -37
  132. package/src/icons/dpad.tsx +0 -38
  133. package/src/icons/edit.tsx +0 -38
  134. package/src/icons/element-fire.tsx +0 -37
  135. package/src/icons/element-ice.tsx +0 -38
  136. package/src/icons/element-solar.tsx +0 -38
  137. package/src/icons/element-void.tsx +0 -38
  138. package/src/icons/element-volt.tsx +0 -38
  139. package/src/icons/element-wind.tsx +0 -37
  140. package/src/icons/error.tsx +0 -38
  141. package/src/icons/external-link.tsx +0 -38
  142. package/src/icons/field.tsx +0 -38
  143. package/src/icons/file-spreadsheet.tsx +0 -38
  144. package/src/icons/filter.tsx +0 -37
  145. package/src/icons/gacha-ticket.tsx +0 -38
  146. package/src/icons/gamepad.tsx +0 -40
  147. package/src/icons/globe.tsx +0 -38
  148. package/src/icons/grid.tsx +0 -40
  149. package/src/icons/hash.tsx +0 -37
  150. package/src/icons/heart-hp.tsx +0 -38
  151. package/src/icons/history.tsx +0 -37
  152. package/src/icons/home.tsx +0 -37
  153. package/src/icons/image.tsx +0 -39
  154. package/src/icons/impact-slash.tsx +0 -38
  155. package/src/icons/inbox.tsx +0 -38
  156. package/src/icons/index.ts +0 -120
  157. package/src/icons/info.tsx +0 -38
  158. package/src/icons/jobs.tsx +0 -38
  159. package/src/icons/katana.tsx +0 -38
  160. package/src/icons/key.tsx +0 -38
  161. package/src/icons/keyboard.tsx +0 -38
  162. package/src/icons/keyframe-diamond.tsx +0 -38
  163. package/src/icons/knowledge.tsx +0 -38
  164. package/src/icons/language.tsx +0 -39
  165. package/src/icons/lock.tsx +0 -38
  166. package/src/icons/logout.tsx +0 -37
  167. package/src/icons/loot-chest.tsx +0 -39
  168. package/src/icons/mail.tsx +0 -38
  169. package/src/icons/mana-crystal.tsx +0 -38
  170. package/src/icons/map-pin.tsx +0 -38
  171. package/src/icons/mecha-helm.tsx +0 -38
  172. package/src/icons/menu.tsx +0 -37
  173. package/src/icons/message.tsx +0 -38
  174. package/src/icons/model.tsx +0 -38
  175. package/src/icons/moon.tsx +0 -37
  176. package/src/icons/notification.tsx +0 -38
  177. package/src/icons/partner.tsx +0 -41
  178. package/src/icons/pause.tsx +0 -37
  179. package/src/icons/phone.tsx +0 -37
  180. package/src/icons/play.tsx +0 -37
  181. package/src/icons/potion-flask.tsx +0 -40
  182. package/src/icons/quest-scroll.tsx +0 -39
  183. package/src/icons/radar-ping.tsx +0 -40
  184. package/src/icons/refresh.tsx +0 -38
  185. package/src/icons/relation.tsx +0 -40
  186. package/src/icons/save.tsx +0 -38
  187. package/src/icons/search.tsx +0 -38
  188. package/src/icons/security.tsx +0 -38
  189. package/src/icons/send.tsx +0 -38
  190. package/src/icons/settings.tsx +0 -39
  191. package/src/icons/shield-crest.tsx +0 -38
  192. package/src/icons/shuriken.tsx +0 -38
  193. package/src/icons/signal-off.tsx +0 -37
  194. package/src/icons/signal.tsx +0 -37
  195. package/src/icons/skill-node.tsx +0 -40
  196. package/src/icons/smartphone.tsx +0 -38
  197. package/src/icons/sort-ascending.tsx +0 -37
  198. package/src/icons/sort-descending.tsx +0 -37
  199. package/src/icons/sort.tsx +0 -37
  200. package/src/icons/sparkle.tsx +0 -38
  201. package/src/icons/speech-burst.tsx +0 -37
  202. package/src/icons/story.tsx +0 -37
  203. package/src/icons/sun.tsx +0 -38
  204. package/src/icons/tag.tsx +0 -38
  205. package/src/icons/team.tsx +0 -40
  206. package/src/icons/trophy-crown.tsx +0 -39
  207. package/src/icons/upload.tsx +0 -37
  208. package/src/icons/user.tsx +0 -38
  209. package/src/icons/users.tsx +0 -39
  210. package/src/icons/visibility-off.tsx +0 -38
  211. package/src/icons/visibility.tsx +0 -38
  212. package/src/icons/volume-off.tsx +0 -37
  213. package/src/icons/volume.tsx +0 -37
  214. package/src/icons/warning.tsx +0 -38
  215. package/src/icons/workflow.tsx +0 -40
  216. package/src/icons.tsx +0 -965
  217. package/src/index.ts +0 -89
  218. package/src/lib/asset-registry.ts +0 -534
  219. package/src/lib/audio-runtime.ts +0 -314
  220. package/src/lib/character-adapter.ts +0 -370
  221. package/src/lib/character-registry.ts +0 -2368
  222. package/src/lib/cn.ts +0 -6
  223. package/src/lib/compose-refs.ts +0 -16
  224. package/src/lib/sanitize-url.ts +0 -51
  225. package/src/lib/scene-camera.ts +0 -483
  226. package/src/lib/scene-playback.ts +0 -622
  227. package/src/lib/scene-soundscape.ts +0 -151
  228. package/src/lib/scene-test-harness.ts +0 -200
  229. package/src/lib/scene-timeline.ts +0 -398
  230. package/src/lib/use-animation-visibility.ts +0 -45
  231. package/src/lib/use-modal-focus.ts +0 -270
  232. package/src/lib/use-reduced-motion.ts +0 -37
  233. package/src/motion/easing-presets.ts +0 -262
  234. package/src/motion/index.tsx +0 -894
  235. package/src/motion/physics.ts +0 -259
  236. package/src/motion/timeline-math.ts +0 -358
  237. package/src/motion.tsx +0 -639
  238. package/src/pixelfx-boundary.ts +0 -188
  239. package/src/pixelfx-registry.ts +0 -1190
  240. package/src/pixelfx-types.d.ts +0 -73
  241. package/src/pixelfx.tsx +0 -1022
  242. package/src/provider.tsx +0 -63
  243. package/src/skin-catalog.ts +0 -306
  244. package/src/skin-tokens.ts +0 -425
  245. package/src/ssr/init-script.ts +0 -281
  246. package/src/ssr/resolve-skin.ts +0 -217
  247. package/src/ssr/theme-mismatch-dev.ts +0 -181
  248. package/src/templates/battle-arena.tsx +0 -688
  249. package/src/templates/index.tsx +0 -314
  250. package/src/templates.tsx +0 -225
  251. package/src/themes/dna-presets.ts +0 -119
  252. package/src/themes/index.ts +0 -56
  253. package/src/themes/provider.tsx +0 -183
  254. package/src/themes/types.ts +0 -111
  255. package/src/themes.ts +0 -9
  256. package/src/token-exporter.ts +0 -12
  257. package/src/token-exporters.ts +0 -343
  258. package/src/token-seeds.ts +0 -335
  259. package/src/token-snapshot.ts +0 -179
  260. package/src/utils.ts +0 -58
@@ -1,314 +0,0 @@
1
- "use client";
2
-
3
- import { useCallback, useState } from "react";
4
- import { Badge } from "../components/badge.js";
5
- import { Button } from "../components/button.js";
6
- import {
7
- Card,
8
- CardContent,
9
- CardDescription,
10
- CardHeader,
11
- CardTitle,
12
- } from "../components/card.js";
13
- import {
14
- Sheet,
15
- SheetContent,
16
- SheetDescription,
17
- SheetHeader,
18
- SheetTitle,
19
- SheetTrigger,
20
- } from "../components/sheet.js";
21
- import {
22
- Tabs,
23
- TabsContent,
24
- TabsList,
25
- TabsTrigger,
26
- } from "../components/tabs.js";
27
- import {
28
- AnimatedNumber,
29
- KineticText,
30
- MarqueeRibbon,
31
- PageTransitionCurtain,
32
- ScrollReveal,
33
- StaggerGroup,
34
- StateMorphButton,
35
- useMotion,
36
- type MorphButtonStatus,
37
- type PageTransitionVariant,
38
- } from "../motion/index.js";
39
- export { CartoonStudioTemplate, GameBattleTemplate } from "./battle-arena.js";
40
-
41
- export function WebLandingTemplate() {
42
- const { triggerSfx } = useMotion();
43
- const [ctaStatus, setCtaStatus] = useState<MorphButtonStatus>("idle");
44
- const [curtainVariant, setCurtainVariant] =
45
- useState<PageTransitionVariant>("ink-wipe");
46
- const [curtainActive, setCurtainActive] = useState(false);
47
-
48
- const handleLaunch = useCallback(() => {
49
- setCtaStatus("loading");
50
- window.setTimeout(() => {
51
- setCtaStatus("success");
52
- triggerSfx("success-chime");
53
- window.setTimeout(() => setCtaStatus("idle"), 1600);
54
- }, 650);
55
- }, [triggerSfx]);
56
-
57
- const previewCurtain = useCallback(
58
- (variant: PageTransitionVariant) => {
59
- setCurtainVariant(variant);
60
- setCurtainActive(true);
61
- triggerSfx("drawer-whoosh");
62
- window.setTimeout(() => setCurtainActive(false), 680);
63
- },
64
- [triggerSfx],
65
- );
66
-
67
- return (
68
- <div className="mw-ui-template-shell" data-testid="template-web-landing">
69
- <PageTransitionCurtain
70
- active={curtainActive}
71
- variant={curtainVariant}
72
- label="SCENE SHIFT"
73
- />
74
- <header className="mw-ui-template-hero">
75
- <div className="mw-ui-template-hero-copy">
76
- <Badge variant="magenta" size="sm">
77
- WEB MOTION TEMPLATE
78
- </Badge>
79
- <h3 className="mw-ui-template-hero-title">
80
- <KineticText
81
- text="SHIP LIVING INTERFACES"
82
- variant="stamp-drop"
83
- splitBy="word"
84
- />
85
- </h3>
86
- <p className="mw-ui-template-hero-lead">
87
- Zero-Tailwind animated hero built with KineticText, StaggerGroup,
88
- MarqueeRibbon, and accessible reduced-motion fallbacks.
89
- </p>
90
- <div className="mw-ui-template-actions">
91
- <StateMorphButton
92
- status={ctaStatus}
93
- idleLabel="Deploy Starter"
94
- loadingLabel="Deploying…"
95
- successLabel="Live on Edge"
96
- onClick={handleLaunch}
97
- />
98
- <Button
99
- size="sm"
100
- variant="outline"
101
- onClick={() => previewCurtain("ink-wipe")}
102
- >
103
- Ink Wipe Transition
104
- </Button>
105
- <Button
106
- size="sm"
107
- variant="outline"
108
- onClick={() => previewCurtain("iris-circle")}
109
- >
110
- Iris Transition
111
- </Button>
112
- </div>
113
- </div>
114
- </header>
115
-
116
- <MarqueeRibbon
117
- items={[
118
- "SPRING PHYSICS",
119
- "12FPS CARTOON EASING",
120
- "ZERO TAILWIND CSS",
121
- "WCAG AA CONTRAST",
122
- "SSR READY",
123
- "GAME & WEBTEMPLATES",
124
- ]}
125
- />
126
-
127
- <ScrollReveal preset="slide-snap">
128
- <StaggerGroup preset="pop-in" className="mw-ui-template-bento">
129
- <Card variant="elevated">
130
- <CardHeader>
131
- <CardTitle>01 · Kinetic Typography</CardTitle>
132
- <CardDescription>
133
- Word or character stagger with intact screen-reader label.
134
- </CardDescription>
135
- </CardHeader>
136
- <CardContent>
137
- <KineticText
138
- text="FRAME BY FRAME"
139
- variant="wave-bounce"
140
- splitBy="word"
141
- />
142
- </CardContent>
143
- </Card>
144
- <Card variant="elevated">
145
- <CardHeader>
146
- <CardTitle>02 · Motion Profiles</CardTitle>
147
- <CardDescription>
148
- Switch off, subtle, expressive, or cartoon scale globally.
149
- </CardDescription>
150
- </CardHeader>
151
- <CardContent>
152
- <Badge variant="cyan" size="sm">
153
- Respects prefers-reduced-motion
154
- </Badge>
155
- </CardContent>
156
- </Card>
157
- <Card variant="elevated">
158
- <CardHeader>
159
- <CardTitle>03 · Audio Ready</CardTitle>
160
- <CardDescription>
161
- Procedural WebAudio cues opt-in with zero external MP3s.
162
- </CardDescription>
163
- </CardHeader>
164
- <CardContent>
165
- <Badge variant="success" size="sm">
166
- 13 Built-in SFX Presets
167
- </Badge>
168
- </CardContent>
169
- </Card>
170
- </StaggerGroup>
171
- </ScrollReveal>
172
- </div>
173
- );
174
- }
175
-
176
- export function AppCommandTemplate() {
177
- const { triggerSfx } = useMotion();
178
- const [revenue, setRevenue] = useState(48290);
179
- const [activeUsers, setActiveUsers] = useState(1428);
180
- const [latencyMs, setLatencyMs] = useState(34);
181
- const [syncStatus, setSyncStatus] = useState<MorphButtonStatus>("idle");
182
- const [tasks, setTasks] = useState([
183
- { id: "t1", title: "Publish @moonwitness/ui v1.0.0", status: "Ready" },
184
- {
185
- id: "t2",
186
- title: "Verify multi-genre skin contrast matrix",
187
- status: "Passed",
188
- },
189
- { id: "t3", title: "Sync W3C design token artifacts", status: "Synced" },
190
- ]);
191
-
192
- const simulatePulse = useCallback(() => {
193
- triggerSfx("coin-pickup");
194
- setRevenue((v) => v + 640);
195
- setActiveUsers((v) => v + 19);
196
- setLatencyMs((v) => (v <= 24 ? 38 : v - 4));
197
- }, [triggerSfx]);
198
-
199
- const runSync = useCallback(() => {
200
- setSyncStatus("loading");
201
- window.setTimeout(() => {
202
- setSyncStatus("success");
203
- triggerSfx("success-chime");
204
- setTasks((prev) => [
205
- {
206
- id: `t-${Date.now()}`,
207
- title: `Synced release snapshot #${prev.length + 1}`,
208
- status: "Live",
209
- },
210
- ...prev.slice(0, 3),
211
- ]);
212
- window.setTimeout(() => setSyncStatus("idle"), 1400);
213
- }, 550);
214
- }, [triggerSfx]);
215
-
216
- return (
217
- <div className="mw-ui-template-shell" data-testid="template-app-command">
218
- <div className="mw-ui-template-app-bar">
219
- <div>
220
- <Badge variant="cyan" size="sm">
221
- APP / SAAS MOTION SHELL
222
- </Badge>
223
- <h3 className="mw-ui-template-section-title">Command Workspace</h3>
224
- </div>
225
- <div className="mw-ui-template-actions">
226
- <Button size="sm" variant="outline" onClick={simulatePulse}>
227
- Simulate Live Tick
228
- </Button>
229
- <StateMorphButton
230
- status={syncStatus}
231
- idleLabel="Sync Workspace"
232
- loadingLabel="Syncing…"
233
- successLabel="Synced"
234
- onClick={runSync}
235
- />
236
- <Sheet>
237
- <SheetTrigger asChild>
238
- <Button size="sm" variant="default">
239
- Open Inspector
240
- </Button>
241
- </SheetTrigger>
242
- <SheetContent data-side="right">
243
- <SheetHeader>
244
- <SheetTitle>Workspace Inspector</SheetTitle>
245
- <SheetDescription>
246
- Standalone CSS Sheet drawer with zero Tailwind dependency and
247
- smooth slide motion.
248
- </SheetDescription>
249
- </SheetHeader>
250
- <div className="mw-ui-template-inspector-body">
251
- <p>Active sessions: {activeUsers}</p>
252
- <p>Current p95 latency: {latencyMs} ms</p>
253
- </div>
254
- </SheetContent>
255
- </Sheet>
256
- </div>
257
- </div>
258
-
259
- <StaggerGroup preset="pop-in" className="mw-ui-template-kpi-grid">
260
- <Card variant="elevated">
261
- <CardHeader>
262
- <CardDescription>Monthly Recurring</CardDescription>
263
- <CardTitle>
264
- <AnimatedNumber value={revenue} prefix="$" />
265
- </CardTitle>
266
- </CardHeader>
267
- </Card>
268
- <Card variant="elevated">
269
- <CardHeader>
270
- <CardDescription>Active Operators</CardDescription>
271
- <CardTitle>
272
- <AnimatedNumber value={activeUsers} />
273
- </CardTitle>
274
- </CardHeader>
275
- </Card>
276
- <Card variant="elevated">
277
- <CardHeader>
278
- <CardDescription>Edge Latency</CardDescription>
279
- <CardTitle>
280
- <AnimatedNumber value={latencyMs} suffix=" ms" />
281
- </CardTitle>
282
- </CardHeader>
283
- </Card>
284
- </StaggerGroup>
285
-
286
- <Tabs defaultValue="queue">
287
- <TabsList>
288
- <TabsTrigger value="queue">
289
- Dispatch Queue ({tasks.length})
290
- </TabsTrigger>
291
- <TabsTrigger value="telemetry">Motion Telemetry</TabsTrigger>
292
- </TabsList>
293
- <TabsContent value="queue">
294
- <ul className="mw-ui-template-list">
295
- {tasks.map((task) => (
296
- <li key={task.id} className="mw-ui-template-list-item">
297
- <span>{task.title}</span>
298
- <Badge size="sm" variant="success">
299
- {task.status}
300
- </Badge>
301
- </li>
302
- ))}
303
- </ul>
304
- </TabsContent>
305
- <TabsContent value="telemetry">
306
- <p className="mw-ui-template-hero-lead">
307
- All numeric KPI counters, tabs, and overlays honor global
308
- MotionProfile and prefers-reduced-motion automatically.
309
- </p>
310
- </TabsContent>
311
- </Tabs>
312
- </div>
313
- );
314
- }
package/src/templates.tsx DELETED
@@ -1,225 +0,0 @@
1
- import { useState } from "react";
2
- import { Badge } from "./components/badge.js";
3
- import { Button } from "./components/button.js";
4
- import { Card, CardContent, CardHeader, CardTitle } from "./components/card.js";
5
- import { KineticText } from "./motion.js";
6
- import {
7
- ActionHotbar,
8
- BossHealthBar,
9
- ComboCounter,
10
- StatGauge,
11
- TurnOrderStrip,
12
- } from "./game.js";
13
- import {
14
- CartoonRig,
15
- EpisodeTitleCard,
16
- OnomatopoeiaSFX,
17
- StoryboardPlayer,
18
- } from "./cartoon.js";
19
-
20
- export function WebLandingTemplate() {
21
- return (
22
- <div
23
- style={{
24
- display: "grid",
25
- gap: "1rem",
26
- padding: "1.25rem",
27
- background: "var(--mw-background)",
28
- border: "1.5px solid var(--mw-border)",
29
- }}
30
- >
31
- <div style={{ display: "flex", flexWrap: "wrap", justifyContent: "space-between", alignItems: "center", gap: "0.75rem" }}>
32
- <Badge variant="magenta" size="sm">
33
- WEB LANDING STARTER
34
- </Badge>
35
- <div style={{ display: "flex", gap: "0.5rem" }}>
36
- <Button size="xs" variant="outline">
37
- Docs
38
- </Button>
39
- <Button size="xs" variant="default">
40
- Launch
41
- </Button>
42
- </div>
43
- </div>
44
- <div style={{ display: "grid", gap: "0.55rem" }}>
45
- <KineticText text="BUILD DISTINCTIVE INTERFACES" splitBy="word" />
46
- <p style={{ margin: 0, maxWidth: "40rem", color: "var(--mw-muted-foreground)", fontSize: "0.9rem" }}>
47
- Shared design tokens, accessible primitives, and expressive motion
48
- packed into one cohesive starter layout.
49
- </p>
50
- </div>
51
- <div
52
- style={{
53
- display: "grid",
54
- gridTemplateColumns: "repeat(auto-fit, minmax(12rem, 1fr))",
55
- gap: "0.75rem",
56
- }}
57
- >
58
- {[
59
- ["Tokens", "Multi-skin & Genre DNA"],
60
- ["Motion", "12 deterministic easing curves"],
61
- ["A11y", "Keyboard & contrast verified"],
62
- ].map(([title, copy]) => (
63
- <Card key={title} padding="sm">
64
- <CardHeader>
65
- <CardTitle>{title}</CardTitle>
66
- </CardHeader>
67
- <CardContent>
68
- <small style={{ color: "var(--mw-muted-foreground)" }}>{copy}</small>
69
- </CardContent>
70
- </Card>
71
- ))}
72
- </div>
73
- </div>
74
- );
75
- }
76
-
77
- export function AppCommandTemplate() {
78
- const [activeTab, setActiveTab] = useState<"queue" | "releases">("queue");
79
- return (
80
- <div
81
- style={{
82
- display: "grid",
83
- gap: "0.9rem",
84
- padding: "1.15rem",
85
- background: "var(--mw-background)",
86
- border: "1.5px solid var(--mw-border)",
87
- }}
88
- >
89
- <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", flexWrap: "wrap", gap: "0.5rem" }}>
90
- <strong style={{ fontFamily: "var(--mw-font-display)", fontSize: "1.15rem" }}>
91
- APP COMMAND SHELL
92
- </strong>
93
- <div style={{ display: "flex", gap: "0.35rem" }}>
94
- <Button
95
- size="xs"
96
- variant={activeTab === "queue" ? "default" : "outline"}
97
- onClick={() => setActiveTab("queue")}
98
- >
99
- Review Queue
100
- </Button>
101
- <Button
102
- size="xs"
103
- variant={activeTab === "releases" ? "default" : "outline"}
104
- onClick={() => setActiveTab("releases")}
105
- >
106
- Releases
107
- </Button>
108
- </div>
109
- </div>
110
- <div
111
- style={{
112
- display: "grid",
113
- gridTemplateColumns: "repeat(auto-fit, minmax(13rem, 1fr))",
114
- gap: "0.75rem",
115
- }}
116
- >
117
- <Card padding="sm">
118
- <CardHeader>
119
- <CardTitle>
120
- {activeTab === "queue" ? "Active Specimens" : "Release Channel"}
121
- </CardTitle>
122
- </CardHeader>
123
- <CardContent>
124
- <strong style={{ fontSize: "1.5rem" }}>
125
- {activeTab === "queue" ? "34" : "v1.0.0-rc.1"}
126
- </strong>
127
- </CardContent>
128
- </Card>
129
- <Card padding="sm">
130
- <CardHeader>
131
- <CardTitle>Gate Health</CardTitle>
132
- </CardHeader>
133
- <CardContent>
134
- <Badge variant="success" size="sm">
135
- ALL GATES PASSING
136
- </Badge>
137
- </CardContent>
138
- </Card>
139
- </div>
140
- </div>
141
- );
142
- }
143
-
144
- export function GameBattleTemplate() {
145
- const [bossHp, setBossHp] = useState(290);
146
- const [combo, setCombo] = useState(4);
147
-
148
- return (
149
- <div
150
- style={{
151
- display: "grid",
152
- gap: "0.9rem",
153
- padding: "1.1rem",
154
- background: "var(--mw-night-raised)",
155
- color: "var(--mw-moon)",
156
- border: "2px solid var(--mw-border-strong)",
157
- }}
158
- >
159
- <BossHealthBar
160
- characterId="lord-null"
161
- hp={bossHp}
162
- maxHp={380}
163
- phases={3}
164
- stagger={Math.min(100, combo * 14)}
165
- broken={combo * 14 >= 100}
166
- />
167
- <div style={{ display: "flex", flexWrap: "wrap", alignItems: "center", justifyContent: "space-between", gap: "0.75rem" }}>
168
- <TurnOrderStrip
169
- characterIds={["kuro-signal", "vesper-ink", "rocksoul-witness", "lord-null"]}
170
- activeIndex={0}
171
- />
172
- <ComboCounter count={combo} />
173
- </div>
174
- <div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(12rem, 1fr))", gap: "0.75rem" }}>
175
- <StatGauge label="KURO HP" value={88} max={100} tone="hp" segments={4} />
176
- <StatGauge label="SIGNAL MP" value={72} max={100} tone="mp" segments={4} />
177
- </div>
178
- <ActionHotbar
179
- slots={[
180
- { id: "slash", key: "1", label: "Signal Slash" },
181
- { id: "guard", key: "2", label: "Ink Guard" },
182
- { id: "reset", key: "R", label: "Reset Boss" },
183
- ]}
184
- onTrigger={(id) => {
185
- if (id === "slash") {
186
- setBossHp((hp) => Math.max(0, hp - 34));
187
- setCombo((c) => c + 1);
188
- } else if (id === "reset") {
189
- setBossHp(380);
190
- setCombo(1);
191
- }
192
- }}
193
- />
194
- </div>
195
- );
196
- }
197
-
198
- export function CartoonStudioTemplate() {
199
- return (
200
- <div
201
- style={{
202
- display: "grid",
203
- gap: "0.9rem",
204
- padding: "1.1rem",
205
- background: "var(--mw-background)",
206
- border: "1.5px solid var(--mw-border)",
207
- }}
208
- >
209
- <EpisodeTitleCard episode="ACT 01 · STUDIO" title="MOONWITNESS SIGNAL" />
210
- <div
211
- style={{
212
- display: "flex",
213
- flexWrap: "wrap",
214
- alignItems: "center",
215
- gap: "1rem",
216
- }}
217
- >
218
- <CartoonRig characterId="kuro-signal" mood="happy" emote="sparkle" size="md" />
219
- <CartoonRig characterId="vesper-ink" mood="determined" size="md" />
220
- <OnomatopoeiaSFX text="ZAP!!" tone="electric" tiltDeg={-6} />
221
- </div>
222
- <StoryboardPlayer />
223
- </div>
224
- );
225
- }
@@ -1,119 +0,0 @@
1
- import type { BuiltinSkinId, SkinDensity } from "./types.js";
2
- import type { ThemeMode } from "./provider.js";
3
- import type { MotionProfile } from "../motion/physics.js";
4
-
5
- export type GenreDnaPresetId =
6
- | "signal-riot-zine"
7
- | "shonen-anime"
8
- | "arcade-fighter"
9
- | "cozy-jrpg"
10
- | "saturday-cartoon"
11
- | "doodlebook-funky-grunge";
12
-
13
- export interface GenreDnaPreset {
14
- readonly id: GenreDnaPresetId;
15
- readonly label: string;
16
- readonly badge: string;
17
- readonly description: string;
18
- readonly skin: BuiltinSkinId;
19
- readonly mode: ThemeMode;
20
- readonly density: SkinDensity;
21
- readonly motionProfile: MotionProfile;
22
- readonly dnaAttribute: GenreDnaPresetId;
23
- }
24
-
25
- export const GENRE_DNA_PRESETS: readonly GenreDnaPreset[] = Object.freeze([
26
- Object.freeze({
27
- id: "signal-riot-zine",
28
- label: "Signal Riot Zine",
29
- badge: "ZINE",
30
- description:
31
- "Razor ink borders, Ben-Day halftone, electric magenta & canary punch.",
32
- skin: "moonwitness-riot",
33
- mode: "dark",
34
- density: "comfortable",
35
- motionProfile: "expressive",
36
- dnaAttribute: "signal-riot-zine",
37
- }),
38
- Object.freeze({
39
- id: "shonen-anime",
40
- label: "Shonen Anime",
41
- badge: "ANIME",
42
- description:
43
- "Manga ink paper, kinetic diagonal cut-ins, speedlines, and 12fps snaps.",
44
- skin: "moonwitness-ink",
45
- mode: "light",
46
- density: "comfortable",
47
- motionProfile: "cartoon",
48
- dnaAttribute: "shonen-anime",
49
- }),
50
- Object.freeze({
51
- id: "arcade-fighter",
52
- label: "Arcade Fighter",
53
- badge: "ARCADE",
54
- description:
55
- "Obsidian cyber-cabinet HUD, skewed combo meters, scanlines, and chromatic hit.",
56
- skin: "arcade-neon",
57
- mode: "dark",
58
- density: "compact",
59
- motionProfile: "expressive",
60
- dnaAttribute: "arcade-fighter",
61
- }),
62
- Object.freeze({
63
- id: "cozy-jrpg",
64
- label: "Cozy JRPG",
65
- badge: "JRPG",
66
- description:
67
- "Warm storybook parchment, gilded quest crests, and gentle dialogue cadence.",
68
- skin: "cozy-rpg",
69
- mode: "light",
70
- density: "comfortable",
71
- motionProfile: "subtle",
72
- dnaAttribute: "cozy-jrpg",
73
- }),
74
- Object.freeze({
75
- id: "saturday-cartoon",
76
- label: "Saturday Cartoon",
77
- badge: "TOON",
78
- description:
79
- "Chunky cel-shaded ink outlines, squash-stretch springs, and starburst SFX.",
80
- skin: "cartoon-pop",
81
- mode: "light",
82
- density: "comfortable",
83
- motionProfile: "cartoon",
84
- dnaAttribute: "saturday-cartoon",
85
- }),
86
- Object.freeze({
87
- id: "doodlebook-funky-grunge",
88
- label: "Doodlebook Funky Grunge",
89
- badge: "DOODLE",
90
- description:
91
- "Classroom activity-book energy with chunky ink, bright doodles, and playful zine motion.",
92
- skin: "doodlebook",
93
- mode: "light",
94
- density: "comfortable",
95
- motionProfile: "cartoon",
96
- dnaAttribute: "doodlebook-funky-grunge",
97
- }),
98
- ]);
99
-
100
- export function getGenreDnaPresetById(
101
- id?: string | null,
102
- ): GenreDnaPreset | undefined {
103
- if (!id) return undefined;
104
- return GENRE_DNA_PRESETS.find((preset) => preset.id === id);
105
- }
106
-
107
- export function applyGenreDnaAttribute(
108
- presetId: GenreDnaPresetId | null,
109
- root: HTMLElement | null = typeof document !== "undefined"
110
- ? document.documentElement
111
- : null,
112
- ): void {
113
- if (!root) return;
114
- if (!presetId) {
115
- delete root.dataset.dna;
116
- return;
117
- }
118
- root.dataset.dna = presetId;
119
- }