@rydr/game-sdk 3.0.1 → 3.1.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 (48) hide show
  1. package/README.md +34 -0
  2. package/dist/protocol/version.d.ts +1 -1
  3. package/dist/protocol/version.js +1 -1
  4. package/dist/ui/action-card.d.ts +39 -0
  5. package/dist/ui/action-card.d.ts.map +1 -0
  6. package/dist/ui/action-card.js +38 -0
  7. package/dist/ui/action-card.js.map +1 -0
  8. package/dist/ui/action-diamond.d.ts +41 -0
  9. package/dist/ui/action-diamond.d.ts.map +1 -0
  10. package/dist/ui/action-diamond.js +35 -0
  11. package/dist/ui/action-diamond.js.map +1 -0
  12. package/dist/ui/card.d.ts +45 -0
  13. package/dist/ui/card.d.ts.map +1 -0
  14. package/dist/ui/card.js +73 -0
  15. package/dist/ui/card.js.map +1 -0
  16. package/dist/ui/choice-card.d.ts +73 -0
  17. package/dist/ui/choice-card.d.ts.map +1 -0
  18. package/dist/ui/choice-card.js +141 -0
  19. package/dist/ui/choice-card.js.map +1 -0
  20. package/dist/ui/dialogue-card.d.ts +54 -0
  21. package/dist/ui/dialogue-card.d.ts.map +1 -0
  22. package/dist/ui/dialogue-card.js +107 -0
  23. package/dist/ui/dialogue-card.js.map +1 -0
  24. package/dist/ui/index.d.ts +31 -0
  25. package/dist/ui/index.d.ts.map +1 -0
  26. package/dist/ui/index.js +31 -0
  27. package/dist/ui/index.js.map +1 -0
  28. package/dist/ui/keycap.d.ts +77 -0
  29. package/dist/ui/keycap.d.ts.map +1 -0
  30. package/dist/ui/keycap.js +160 -0
  31. package/dist/ui/keycap.js.map +1 -0
  32. package/dist/ui/labeled-diamond.d.ts +32 -0
  33. package/dist/ui/labeled-diamond.d.ts.map +1 -0
  34. package/dist/ui/labeled-diamond.js +86 -0
  35. package/dist/ui/labeled-diamond.js.map +1 -0
  36. package/dist/ui/showcase/gallery.d.ts +56 -0
  37. package/dist/ui/showcase/gallery.d.ts.map +1 -0
  38. package/dist/ui/showcase/gallery.js +85 -0
  39. package/dist/ui/showcase/gallery.js.map +1 -0
  40. package/dist/ui/showcase/index.d.ts +29 -0
  41. package/dist/ui/showcase/index.d.ts.map +1 -0
  42. package/dist/ui/showcase/index.js +255 -0
  43. package/dist/ui/showcase/index.js.map +1 -0
  44. package/dist/ui/styles.d.ts +12 -0
  45. package/dist/ui/styles.d.ts.map +1 -0
  46. package/dist/ui/styles.js +183 -0
  47. package/dist/ui/styles.js.map +1 -0
  48. package/package.json +13 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labeled-diamond.js","sourceRoot":"","sources":["../../src/ui/labeled-diamond.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAa,MAAM,WAAW,CAAC;AACjD,OAAO,EAAqB,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,GAAG,GAA8B,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;AAClF,+FAA+F;AAC/F,MAAM,KAAK,GAAwB,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC;AACtG,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,uDAAuD;AACnF,MAAM,KAAK,GAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAqBnD,iHAAiH;AACjH,MAAM,UAAU,mBAAmB,CAAC,IAAiB,EAAE,OAA8B,EAAE;IACrF,SAAS,EAAE,CAAC;IAEZ,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,SAAS,GAAG,iBAAiB,GAAG,CAAC,IAAI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AAE,CAAC,CAAC,CAAC,MAAM,CAAC;QAC/C,IAAI,EAAE;YAAE,KAAK,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC,CAAC;IAEF,KAAK,MAAM,CAAC,IAAI,KAAK;QAAE,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;IAE9D,OAAO;QACL,IAAI;QACJ,QAAQ;QACR,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE;YAC1B,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAC9C,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;QAC3D,CAAC;QACD,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;QACjE,YAAY,CAAC,CAAC,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;YAC3B,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC;QAC5B,CAAC;QACD,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE;KAC7B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Minimal scrollable-gallery harness for {@link mountUiShowcase} — a header with an optional live
3
+ * watts readout, a column of captioned sections, and a `requestAnimationFrame` clock that drives the
4
+ * live demos (cooldown rings, the typewriter dialogue). Self-contained: it injects its own `gw-*`
5
+ * chrome CSS. Not exported from the package — internal to the showcase entry.
6
+ */
7
+ import type { ButtonName, ButtonEdge } from "../../protocol/index.js";
8
+ /**
9
+ * The thin slice of a `PlatformSession` the showcase consumes — so a host can pass its real session
10
+ * (live watts + real button reflection) and a `PlatformSession` satisfies this structurally, while a
11
+ * standalone dev page can pass a tiny keyboard-driven stand-in. Omit it and the catalog renders static.
12
+ */
13
+ export interface ShowcaseSession {
14
+ onButton(cb: (e: {
15
+ name: ButtonName;
16
+ edge: ButtonEdge;
17
+ }) => void): () => void;
18
+ hardware: {
19
+ current: {
20
+ power: number;
21
+ };
22
+ };
23
+ identity: {
24
+ ftp: number;
25
+ };
26
+ }
27
+ /** Append a classed element (optionally with innerHTML) to `parent` and return it. */
28
+ export declare function el(parent: HTMLElement, tag: string, className: string, html?: string): HTMLElement;
29
+ /** A dpr-aware smooth 2D canvas; draw at logical px. */
30
+ export declare function makeCanvas(logicalW: number, logicalH: number): {
31
+ canvas: HTMLCanvasElement;
32
+ c: CanvasRenderingContext2D;
33
+ };
34
+ export interface GalleryRunOpts {
35
+ /** A real (or stand-in) session — drives the live watts readout and wires keycaps to real presses. */
36
+ session?: ShowcaseSession;
37
+ /** Per-frame work (e.g. ticking the cooldown rings + the demo dialogue), `dt` in seconds. */
38
+ perFrame?: (dt: number) => void;
39
+ }
40
+ /** A scrollable gallery: a chrome + captioned sections, then `run` the RAF loop. */
41
+ export declare class Gallery {
42
+ readonly list: HTMLElement;
43
+ private style;
44
+ private powerB;
45
+ private raf;
46
+ private last;
47
+ constructor(host: HTMLElement, opts: {
48
+ title: string;
49
+ sub: string;
50
+ css?: string;
51
+ });
52
+ section(title: string, sub: string): HTMLElement;
53
+ run(opts?: GalleryRunOpts): void;
54
+ dispose(): void;
55
+ }
56
+ //# sourceMappingURL=gallery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../../../src/ui/showcase/gallery.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,yBAAyB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,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW;IAIhD,GAAG,CAAC,IAAI,GAAE,cAAmB,GAAG,IAAI;IAYpC,OAAO,IAAI,IAAI;CAKhB"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Minimal scrollable-gallery harness for {@link mountUiShowcase} — a header with an optional live
3
+ * watts readout, a column of captioned sections, and a `requestAnimationFrame` clock that drives the
4
+ * live demos (cooldown rings, the typewriter dialogue). Self-contained: it injects its own `gw-*`
5
+ * chrome CSS. Not exported from the package — internal to the showcase entry.
6
+ */
7
+ /** Append a classed element (optionally with innerHTML) to `parent` and return it. */
8
+ export function el(parent, tag, className, html) {
9
+ const e = document.createElement(tag);
10
+ e.className = className;
11
+ if (html != null)
12
+ e.innerHTML = html;
13
+ parent.appendChild(e);
14
+ return e;
15
+ }
16
+ /** A dpr-aware smooth 2D canvas; draw at logical px. */
17
+ export function makeCanvas(logicalW, logicalH) {
18
+ const dpr = Math.min(window.devicePixelRatio || 1, 2);
19
+ const canvas = document.createElement("canvas");
20
+ canvas.width = Math.round(logicalW * dpr);
21
+ canvas.height = Math.round(logicalH * dpr);
22
+ canvas.style.width = logicalW + "px";
23
+ canvas.style.height = logicalH + "px";
24
+ const c = canvas.getContext("2d");
25
+ if (!c)
26
+ throw new Error("2D canvas context unavailable");
27
+ c.scale(dpr, dpr);
28
+ c.imageSmoothingEnabled = true;
29
+ return { canvas, c };
30
+ }
31
+ /** A scrollable gallery: a chrome + captioned sections, then `run` the RAF loop. */
32
+ export class Gallery {
33
+ list;
34
+ style;
35
+ powerB;
36
+ raf = 0;
37
+ last = 0;
38
+ constructor(host, opts) {
39
+ this.style = document.createElement("style");
40
+ this.style.textContent = BASE_CSS + (opts.css ?? "");
41
+ host.appendChild(this.style);
42
+ this.list = document.createElement("div");
43
+ this.list.className = "gw-list";
44
+ host.appendChild(this.list);
45
+ el(this.list, "div", "gw-head", `<div><div class="gw-title">${opts.title}</div><div class="gw-sub">${opts.sub}</div></div>` +
46
+ `<div class="gw-power"><b>—</b> W</div>`);
47
+ this.powerB = this.list.querySelector(".gw-power b");
48
+ }
49
+ section(title, sub) {
50
+ return el(this.list, "div", "gw-section", `<div class="gw-section-title">${title}</div><div class="gw-section-sub">${sub}</div>`);
51
+ }
52
+ run(opts = {}) {
53
+ const { session } = opts;
54
+ const loop = (ts) => {
55
+ this.raf = requestAnimationFrame(loop);
56
+ const dt = this.last ? Math.min(0.05, (ts - this.last) / 1000) : 0;
57
+ this.last = ts;
58
+ opts.perFrame?.(dt);
59
+ if (session)
60
+ this.powerB.textContent = String(Math.round(session.hardware.current.power));
61
+ };
62
+ this.raf = requestAnimationFrame(loop);
63
+ }
64
+ dispose() {
65
+ cancelAnimationFrame(this.raf);
66
+ this.list.remove();
67
+ this.style.remove();
68
+ }
69
+ }
70
+ /** Shared chrome styles (`gw-` prefix). */
71
+ const BASE_CSS = `
72
+ .gw-list { position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden; z-index: 1;
73
+ padding: clamp(1rem, 4vw, 3rem) clamp(1rem, 4vw, 3rem) 4rem; color: #eef4ff;
74
+ font-family: system-ui, sans-serif;
75
+ display: flex; flex-direction: column; gap: 1rem; }
76
+ .gw-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
77
+ .gw-title { font-size: clamp(1.3rem, 4vw, 2rem); font-weight: 800; letter-spacing: -0.01em; }
78
+ .gw-sub { opacity: 0.55; font-size: 0.85rem; }
79
+ .gw-power { font-variant-numeric: tabular-nums; opacity: 0.75; font-size: 0.9rem; }
80
+ .gw-power b { font-size: 1.3rem; font-weight: 800; }
81
+ .gw-section { margin-top: 1rem; }
82
+ .gw-section-title { font-size: 1.1rem; font-weight: 700; }
83
+ .gw-section-sub { opacity: 0.5; font-size: 0.82rem; margin-top: 0.15rem; }
84
+ `;
85
+ //# sourceMappingURL=gallery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../../src/ui/showcase/g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ACvC,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACnE,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;YACf,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;YACpB,IAAI,OAAO;gBAAE,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5F,CAAC,CAAC;QACF,IAAI,CAAC,GAAG,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,OAAO;QACL,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACnB,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IACtB,CAAC;CACF;AAED,2CAA2C;AAC3C,MAAM,QAAQ,GAAG;;;;;;;;;;;;;CAahB,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * `@rydr/game-sdk/ui/showcase` — a live catalog of every `@rydr/game-sdk/ui` component in every state,
3
+ * rendered into a host-provided element by {@link mountUiShowcase}. The SDK owns *what* the catalog
4
+ * shows (so it versions with the components and stays the single source of truth); a host provides
5
+ * only *where*:
6
+ *
7
+ * • a standalone dev page in this repo (`examples/ui`) for fast local iteration — see its `main.ts`;
8
+ * • the platform shell, mounting this at an admin-gated route to review the components in the real
9
+ * trainer-screen chrome.
10
+ *
11
+ * This entry is intentionally NOT re-exported from `@rydr/game-sdk/ui`, so a game importing the actual
12
+ * components never pulls the catalog into its bundle. Pass a real `session` for live watts + real
13
+ * button reflection; omit it and the catalog renders static.
14
+ */
15
+ import { type ShowcaseSession } from "./gallery.js";
16
+ export type { ShowcaseSession } from "./gallery.js";
17
+ export interface UiShowcaseOptions {
18
+ /**
19
+ * A real `PlatformSession` (or a stand-in) — drives the live watts readout and wires every keycap to
20
+ * real controller presses (`UP`/`DOWN`/`A` also drive the choice menu). Omit for a static catalog.
21
+ */
22
+ session?: ShowcaseSession;
23
+ }
24
+ export interface UiShowcase {
25
+ dispose(): void;
26
+ }
27
+ /** Mount the full UI catalog into `host`. Returns a handle whose `dispose()` tears it all down. */
28
+ export declare function mountUiShowcase(host: HTMLElement, opts?: UiShowcaseOptions): UiShowcase;
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/showcase/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAiBH,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAE7E,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAoBpD,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,mGAAmG;AACnG,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,GAAE,iBAAsB,GAAG,UAAU,CAiN3F"}
@@ -0,0 +1,255 @@
1
+ /**
2
+ * `@rydr/game-sdk/ui/showcase` — a live catalog of every `@rydr/game-sdk/ui` component in every state,
3
+ * rendered into a host-provided element by {@link mountUiShowcase}. The SDK owns *what* the catalog
4
+ * shows (so it versions with the components and stays the single source of truth); a host provides
5
+ * only *where*:
6
+ *
7
+ * • a standalone dev page in this repo (`examples/ui`) for fast local iteration — see its `main.ts`;
8
+ * • the platform shell, mounting this at an admin-gated route to review the components in the real
9
+ * trainer-screen chrome.
10
+ *
11
+ * This entry is intentionally NOT re-exported from `@rydr/game-sdk/ui`, so a game importing the actual
12
+ * components never pulls the catalog into its bundle. Pass a real `session` for live watts + real
13
+ * button reflection; omit it and the catalog renders static.
14
+ */
15
+ import { createKeycap, createDpadKeycap, mountCard, mountActionCard, mountActionDiamond, mountDialogueCard, mountChoiceCard, mountLabeledDiamond, } from "../index.js";
16
+ import { Gallery, el, makeCanvas } from "./gallery.js";
17
+ const FACES = ["A", "B", "Y", "Z"];
18
+ const DIRS = ["UP", "RIGHT", "DOWN", "LEFT"];
19
+ const READY_HOLD = 2; // seconds a keycap stays "ready" (full colour) between cooldown cycles
20
+ const DLG_STEP = 2.6; // seconds between auto-advances of the demo dialogue
21
+ const DLG_LINES = [
22
+ "There you are at last. I have waited since dawn, and was beginning to lose hope that a new challenger would walk through the village gates.",
23
+ "Come closer.",
24
+ "Out in the tall grass to the north sleep creatures that wait for a spark to bind themselves to a worthy hand.",
25
+ "Choose well.",
26
+ "Remember the one rule that truly matters: push hard when you feel the resistance rise, for your power decides the outcome.",
27
+ "Good luck.",
28
+ ];
29
+ const CHOICE_PROMPT = "Which path would you like to take?";
30
+ const CHOICE_OPTIONS = ["The northern grass", "The river crossing", "The old mine"];
31
+ /** Mount the full UI catalog into `host`. Returns a handle whose `dispose()` tears it all down. */
32
+ export function mountUiShowcase(host, opts = {}) {
33
+ const session = opts.session;
34
+ const press = session; // a session satisfies the components' structural `ButtonSource`
35
+ const g = new Gallery(host, {
36
+ title: "RYDR — controller-button UI",
37
+ sub: "The same components everywhere: pick a shape + state, fill the content slot. Tuned for a trainer screen — don't restyle the type.",
38
+ css: BS_CSS,
39
+ });
40
+ let clock = 0;
41
+ const cooldowns = [];
42
+ let dialogue;
43
+ let dlgT = 0;
44
+ let choice;
45
+ let offButton;
46
+ // a captioned cell holding a centred node
47
+ const cell = (grid, caption, node) => {
48
+ const c = el(grid, "div", "bs-cell");
49
+ const stage = el(c, "div", "bs-stage");
50
+ stage.appendChild(node);
51
+ el(c, "div", "bs-cap", caption);
52
+ };
53
+ // a captioned cell with extra room for a card's floating keycap; returns the stage to mount into
54
+ const cardCell = (grid, caption) => {
55
+ const c = el(grid, "div", "bs-cell");
56
+ const stage = el(c, "div", "bs-stage card");
57
+ el(c, "div", "bs-cap", caption);
58
+ return stage;
59
+ };
60
+ // a generic "icon + name" node — the consumer's OWN content fitted inside a card's fixed slot
61
+ const iconLabel = (name, color) => {
62
+ const { canvas, c } = makeCanvas(20, 20);
63
+ c.fillStyle = color;
64
+ c.beginPath();
65
+ c.moveTo(10, 1);
66
+ c.lineTo(19, 10);
67
+ c.lineTo(10, 19);
68
+ c.lineTo(1, 10);
69
+ c.closePath();
70
+ c.fill();
71
+ const wrap = document.createElement("div");
72
+ wrap.style.cssText = "display:flex;align-items:center;gap:7px;font:800 16px system-ui,sans-serif;";
73
+ const span = document.createElement("span");
74
+ span.textContent = name;
75
+ wrap.append(canvas, span);
76
+ return wrap;
77
+ };
78
+ // --- Solo keycap: every state ------------------------------------------
79
+ g.section("Single button (solo)", "One key. The base states.");
80
+ {
81
+ const grid = el(g.list, "div", "bs-grid");
82
+ cell(grid, "Idle (press A)", createKeycap("A", { animate: false, press }).el);
83
+ cell(grid, "Pulse", createKeycap("A", { animate: true }).el);
84
+ const pressed = createKeycap("A", { animate: false });
85
+ pressed.setPressed(true);
86
+ cell(grid, "Pressed", pressed.el);
87
+ const cd = createKeycap("A", { animate: false });
88
+ cooldowns.push({ kc: cd, total: 5 });
89
+ cell(grid, "Cooldown", cd.el);
90
+ const off = createKeycap("A", { animate: false });
91
+ off.setDisabled(true);
92
+ cell(grid, "Disabled", off.el);
93
+ }
94
+ // --- Full A/B/Y/Z diamond ----------------------------------------------
95
+ g.section("A/B/Y/Z diamond", "All four keys, one active. Colour vs mono, and cooldown.");
96
+ {
97
+ const grid = el(g.list, "div", "bs-grid");
98
+ for (const f of FACES)
99
+ cell(grid, `Active: ${f}`, createKeycap(f, { variant: "full", animate: false }).el);
100
+ cell(grid, "Colour", createKeycap("A", { variant: "full", colored: true, animate: false }).el);
101
+ cell(grid, "Mono", createKeycap("A", { variant: "full", colored: false, animate: false }).el);
102
+ const cd = createKeycap("A", { variant: "full", animate: false });
103
+ cooldowns.push({ kc: cd, total: 6 });
104
+ cell(grid, "Cooldown (on the key)", cd.el);
105
+ }
106
+ // --- Directional buttons -----------------------------------------------
107
+ g.section("Directional buttons", "The same state machine as the face buttons (solo/full, pulse, pressed, cooldown). A white chevron on a steel pip, not the bright key hues.");
108
+ {
109
+ const grid = el(g.list, "div", "bs-grid");
110
+ for (const d of DIRS)
111
+ cell(grid, `Solo: ${d}`, createDpadKeycap(d, { animate: false }).el);
112
+ cell(grid, "Pulse (UP)", createDpadKeycap("UP", { animate: true }).el);
113
+ const pressed = createDpadKeycap("UP", { animate: false });
114
+ pressed.setPressed(true);
115
+ cell(grid, "Pressed (UP)", pressed.el);
116
+ const cd = createDpadKeycap("UP", { animate: false });
117
+ cooldowns.push({ kc: cd, total: 5 });
118
+ cell(grid, "Cooldown (UP)", cd.el);
119
+ cell(grid, "Diamond (UP active)", createDpadKeycap("UP", { variant: "full", animate: false }).el);
120
+ }
121
+ // --- Action card: slot content -----------------------------------------
122
+ g.section("Action card (content slot)", "The frame + the key are provided; the game fills the slot.");
123
+ {
124
+ const grid = el(g.list, "div", "bs-grid");
125
+ const plain = cardCell(grid, "Plain label");
126
+ mountActionCard(plain, "A", { label: "Attack", inline: true, press });
127
+ const custom = cardCell(grid, "Custom (icon + text)");
128
+ const card = mountActionCard(custom, "A", { inline: true, animate: false, press });
129
+ card.setContent(iconLabel("Ember", "#FF7A0C"));
130
+ cooldowns.push({ kc: card.keycap, total: 4 });
131
+ const off = cardCell(grid, "Disabled (action unavailable)");
132
+ const disabled = mountActionCard(off, "A", { label: "Attack", inline: true, animate: false });
133
+ disabled.setDisabled(true);
134
+ }
135
+ // --- the dark card ALONE (no keycap) -----------------------------------
136
+ g.section("Card alone (no key)", "Just a dark padded container, no key. Size it however: hug the content, or fix it. Reuse it for labels, dialogue boxes, etc.");
137
+ {
138
+ const grid = el(g.list, "div", "bs-grid");
139
+ mountCard(cardCell(grid, "Hugs content"), { content: iconLabel("Ember", "#FF7A0C"), inline: true });
140
+ mountCard(cardCell(grid, "Fixed size (200×84)"), { content: iconLabel("Ember", "#FF7A0C"), inline: true, width: 200, height: 84 });
141
+ }
142
+ // --- the dialogue card -------------------------------------------------
143
+ g.section("Dialogue card", "NPC dialogue box: name + line (typewriter) + an A key to continue. The cue flips from ▸ (more) to ✓ (last line). Auto-advances in a loop here.");
144
+ {
145
+ const stage = el(g.list, "div", "bs-dialog");
146
+ dialogue = mountDialogueCard(stage, { inline: true, press });
147
+ dialogue.open("Master Orsane", DLG_LINES);
148
+ }
149
+ // --- the choice card ---------------------------------------------------
150
+ g.section("Choice card (player menu)", "The PLAYER's menu: name + question + a list of options. ▲▼ move the (clamped) selection, and the A key sits to the right of the active option and follows it. Arrows show only on the active option.");
151
+ {
152
+ const stage = el(g.list, "div", "bs-dialog");
153
+ const status = el(g.list, "div", "bs-cap");
154
+ choice = mountChoiceCard(stage, { inline: true, press });
155
+ choice.open({
156
+ name: "Player",
157
+ prompt: CHOICE_PROMPT,
158
+ options: CHOICE_OPTIONS,
159
+ onConfirm: (_i, label) => { status.textContent = `Confirmed: ${label}`; },
160
+ });
161
+ if (session) {
162
+ offButton = session.onButton((e) => {
163
+ if (e.edge !== "down" || !choice)
164
+ return;
165
+ if (e.name === "UP")
166
+ choice.moveBy(-1);
167
+ else if (e.name === "DOWN")
168
+ choice.moveBy(1);
169
+ else if (e.name === "A")
170
+ choice.confirm();
171
+ });
172
+ }
173
+ else {
174
+ status.textContent = "(pass a session to drive ▲▼ / A)";
175
+ }
176
+ }
177
+ // --- the WHOLE move diamond --------------------------------------------
178
+ g.section("Move diamond (HUD)", "The A/B/Y/Z diamond: Z left · Y+B stacked centre · A right. Four content cards. A = selected, Z = cooling, B = disabled. Press the keys → the card sinks.");
179
+ {
180
+ const stage = el(g.list, "div", "bs-diamond");
181
+ const dia = mountActionDiamond(stage, { press, cards: { Y: { label: "Spark" }, A: { label: "Quake" }, B: {}, Z: { label: "Blaze" } } });
182
+ dia.cards.A.setActive(true);
183
+ cooldowns.push({ kc: dia.cards.Z.keycap, total: 6 });
184
+ dia.cards.B.setDisabled(true);
185
+ }
186
+ g.section("Move diamond (HUD) — mono", "The same diamond in mono: white keys with a dark letter instead of the bright hues. Same states.");
187
+ {
188
+ const stage = el(g.list, "div", "bs-diamond");
189
+ const dia = mountActionDiamond(stage, { press, colored: false, cards: { Y: { label: "Spark" }, A: { label: "Quake" }, B: {}, Z: { label: "Blaze" } } });
190
+ dia.cards.A.setActive(true);
191
+ cooldowns.push({ kc: dia.cards.Z.keycap, total: 6 });
192
+ dia.cards.B.setDisabled(true);
193
+ }
194
+ // --- the labeled diamond -----------------------------------------------
195
+ g.section("Labeled diamond", "A central A/B/Y/Z pip cluster, any number of buttons active at once, each label radiating from its key (Y above, B below, Z left, A right) and seated in the dark card. Toggle disables the Y action.");
196
+ {
197
+ const cellWrap = el(g.list, "div", "bs-cell ld-cell");
198
+ const stage = el(cellWrap, "div", "bs-ld");
199
+ const ld = mountLabeledDiamond(stage, { inline: true, actions: { Y: "Inspect", A: "Equip", B: "Inventory" } });
200
+ let disabled = false;
201
+ const btn = el(cellWrap, "button", "bs-btn");
202
+ const sync = () => {
203
+ ld.setDisabled("Y", disabled);
204
+ btn.textContent = disabled ? "Enable “Inspect”" : "Disable “Inspect”";
205
+ };
206
+ btn.addEventListener("click", () => { disabled = !disabled; sync(); });
207
+ sync();
208
+ }
209
+ g.run({
210
+ session,
211
+ perFrame: (dt) => {
212
+ clock += dt;
213
+ for (const { kc, total } of cooldowns) {
214
+ const phase = clock % (total + READY_HOLD);
215
+ if (phase < total)
216
+ kc.setCooldown((total - phase) / total, Math.ceil(total - phase));
217
+ else
218
+ kc.setCooldown(null);
219
+ }
220
+ dlgT += dt;
221
+ if (dialogue && dlgT >= DLG_STEP) {
222
+ dlgT = 0;
223
+ if (!dialogue.advance())
224
+ dialogue.open("Master Orsane", DLG_LINES);
225
+ }
226
+ },
227
+ });
228
+ return {
229
+ dispose: () => {
230
+ offButton?.();
231
+ choice?.dispose();
232
+ dialogue?.dispose();
233
+ g.dispose();
234
+ },
235
+ };
236
+ }
237
+ const BS_CSS = `
238
+ .bs-grid { display: grid; gap: 0.85rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
239
+ .bs-cell { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
240
+ border-radius: 14px; padding: 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.85rem; }
241
+ .bs-stage { min-height: 96px; display: flex; align-items: flex-end; justify-content: center; padding: 14px 0 22px; }
242
+ .bs-stage.card { min-height: 120px; padding-bottom: 42px; }
243
+ .bs-cap { font-size: 0.8rem; font-weight: 700; opacity: 0.8; text-align: center; }
244
+ .bs-diamond { position: relative; width: 100%; height: min(64vh, 480px);
245
+ background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1);
246
+ border-radius: 16px; padding: 1.25rem; box-sizing: border-box; }
247
+ .bs-dialog { display: flex; justify-content: center; padding: 1.5rem 0 2.5rem; }
248
+ .ld-cell { grid-column: 1 / -1; }
249
+ .bs-ld { display: flex; justify-content: center; width: 100%; min-height: 220px; }
250
+ .bs-btn { margin-top: 4px; padding: 7px 14px; border-radius: 10px; cursor: pointer;
251
+ font: 700 0.82rem system-ui, sans-serif; color: #eef4ff;
252
+ background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.18); }
253
+ .bs-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); }
254
+ `;
255
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/showcase/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,kBAAkB,EA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I,CAAC,QAAQ,CAAC,OAAO,EAAE;oBAAE,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;KACF,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE,GAAG,EAAE;YACZ,SAAS,EAAE,EAAE,CAAC;YACd,MAAM,EAAE,OAAO,EAAE,CAAC;YAClB,QAAQ,EAAE,OAAO,EAAE,CAAC;YACpB,CAAC,CAAC,OAAO,EAAE,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;CAiBd,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Shared scoped `.rydr-ui-*` CSS for the controller-button UI (keycap · card · action card · action
3
+ * diamond · dialogue · choice · labeled diamond), injected once into <head>. Self-contained, like the
4
+ * perf-overlay: it injects no global styles and depends on no CSS variables, so any game gets the look
5
+ * just by constructing a component. Keep it dependency-free.
6
+ *
7
+ * The font sizes, paddings, and dimensions here are TUNED FOR A TRAINER SCREEN read from a few feet
8
+ * away while pedaling — they are part of the component contract, not defaults to be overridden.
9
+ * Consumers fill the content slot; they must not restyle the `.rydr-ui-*` type/sizing.
10
+ */
11
+ export declare function injectCss(): void;
12
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/ui/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,wBAAgB,SAAS,IAAI,IAAI,CAOhC"}