@rydr/game-sdk 7.1.0 → 8.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 (50) hide show
  1. package/README.md +28 -4
  2. package/dist/client/PlatformClient.d.ts +14 -7
  3. package/dist/client/PlatformClient.d.ts.map +1 -1
  4. package/dist/client/PlatformClient.js.map +1 -1
  5. package/dist/difficulty/index.d.ts +141 -0
  6. package/dist/difficulty/index.d.ts.map +1 -0
  7. package/dist/difficulty/index.js +300 -0
  8. package/dist/difficulty/index.js.map +1 -0
  9. package/dist/nav/README.md +14 -3
  10. package/dist/nav/motion.d.ts +10 -0
  11. package/dist/nav/motion.d.ts.map +1 -0
  12. package/dist/nav/motion.js +16 -0
  13. package/dist/nav/motion.js.map +1 -0
  14. package/dist/nav/scroll-nav.d.ts.map +1 -1
  15. package/dist/nav/scroll-nav.js +2 -6
  16. package/dist/nav/scroll-nav.js.map +1 -1
  17. package/dist/nav/spatial-nav.d.ts +12 -1
  18. package/dist/nav/spatial-nav.d.ts.map +1 -1
  19. package/dist/nav/spatial-nav.js +19 -5
  20. package/dist/nav/spatial-nav.js.map +1 -1
  21. package/dist/protocol/version.d.ts +1 -1
  22. package/dist/protocol/version.js +1 -1
  23. package/dist/ui/README.md +28 -15
  24. package/dist/ui/action-diamond.js +1 -1
  25. package/dist/ui/action-diamond.js.map +1 -1
  26. package/dist/ui/controller/input-chip.d.ts +2 -1
  27. package/dist/ui/controller/input-chip.d.ts.map +1 -1
  28. package/dist/ui/controller/input-chip.js +9 -8
  29. package/dist/ui/controller/input-chip.js.map +1 -1
  30. package/dist/ui/index.d.ts +1 -1
  31. package/dist/ui/index.d.ts.map +1 -1
  32. package/dist/ui/index.js +1 -1
  33. package/dist/ui/index.js.map +1 -1
  34. package/dist/ui/keycap.d.ts +51 -20
  35. package/dist/ui/keycap.d.ts.map +1 -1
  36. package/dist/ui/keycap.js +94 -28
  37. package/dist/ui/keycap.js.map +1 -1
  38. package/dist/ui/{pause-menu.d.ts → option-menu.d.ts} +34 -24
  39. package/dist/ui/option-menu.d.ts.map +1 -0
  40. package/dist/ui/{pause-menu.js → option-menu.js} +134 -90
  41. package/dist/ui/option-menu.js.map +1 -0
  42. package/dist/ui/showcase/index.js +9 -9
  43. package/dist/ui/showcase/index.js.map +1 -1
  44. package/dist/ui/solo-labeled-diamond.js +1 -1
  45. package/dist/ui/solo-labeled-diamond.js.map +1 -1
  46. package/dist/ui/styles.js +14 -9
  47. package/dist/ui/styles.js.map +1 -1
  48. package/package.json +5 -1
  49. package/dist/ui/pause-menu.d.ts.map +0 -1
  50. package/dist/ui/pause-menu.js.map +0 -1
@@ -176,5 +176,5 @@
176
176
  export const RYDR_PROTOCOL_VERSION = 30;
177
177
  /** Semver of this SDK build. Sent in the handshake for telemetry/debugging.
178
178
  * (Bumped to 2.0.0 by `npm version major` on release — see CHANGELOG [Unreleased].) */
179
- export const RYDR_SDK_VERSION = "7.1.0";
179
+ export const RYDR_SDK_VERSION = "8.1.0";
180
180
  //# sourceMappingURL=version.js.map
package/dist/ui/README.md CHANGED
@@ -51,33 +51,35 @@ feed its `{x, y, onScreen}` into `setScreenPos`/`setVisible` — don't compute p
51
51
  | `mountHeatVignette(host, opts)` | fn | **Screen-edge heat vignette alone** — the peripheral amber→orange→red glow that escalates with heat. Take this when your game draws its own heat bar. `setHeat(heat01, locked)` per frame. |
52
52
  | `mountOverheatGlitch(host, opts)` | fn | **Lockout glitch overlay alone** — one-shot RGB chromatic burst on entry, then scanlines + red noise for the lockout. `setLocked(bool)` per frame. |
53
53
  | `mountOverheatHudBar(host, opts)` | fn | **The whole overheat package**: centred inferno bar + label + COOLING DOWN countdown, composing the vignette and glitch above. One `update(heat01, locked, lockoutRemaining)` per frame. |
54
- | `createLabelKeycap(button, opts)` | fn | A keycap for a button printed with a WORD, not a letter `OPTIONS` ("Menu"/"Options"/"+"), `LT`/`RT`, the stick clicks. A pill, not a pip. |
55
- | `mountPauseMenu(host, opts)` | fn | **The in-game menu**, opened by the game's own `OPTIONS` button: game name big in YOUR font, a free `Resume` row + your own rows, each able to advertise its in-game `shortcut`. Takes the controller over while up and eases the trainer. See below. |
54
+ | `createButtonKeycap(button, opts)` | fn | A keycap for the buttons that are neither a face letter nor a direction, drawn as the pad draws them: `OPTIONS` → a round pip with the pad's ICON (`☰` on Xbox/DualSense, `+` on Switch); `LT`/`RT` and the stick clicks a text pill ("LT"/"L2"/"LS"), since those are printed with a word. |
55
+ | `mountOptionMenu(host, opts)` | fn | **The in-game menu**, opened by the game's own `OPTIONS` button: game name big in YOUR font, a free `Resume` row + your own rows, each able to advertise its in-game `shortcut`. Takes the controller over while up; leaves the trainer alone. See below. |
56
56
  | `mountControllerPad(host, opts)` | fn | **The rider's controller, drawn live** — buttons light while held, stick caps follow the real axes. Pass `press: session`. |
57
57
  | `mountControllerMap(host, opts)` | fn | **The controls screen** — that pad flanked by action callouts, each joined by a line to its button. Takes a declarative `ControlAction[]`. |
58
58
  | `mountComboDemo(host, opts)` | fn | **"Do this" animation** — loops the combination one action requires: buttons sink in, the stick swings, release, repeat. |
59
59
  | `mountControlTrainer(host, opts)` | fn | **Guided lesson** — a title, one panel per step side by side, one shared controller below. Watches the rider: white "do this" → blue "doing it" → green ✓. Fires `onComplete` when every step is done. |
60
60
  | `createComboStrip(action, opts)` | fn | Just the chip row for one action (`[L2] + [✕]`), for embedding in your own layout. |
61
- | `createInputChip(token, opts)` | fn | One control's pictogram, for embedding in your own layout. Delegates to `createKeycap` / `createDpadKeycap` / `createLabelKeycap` for the buttons, and draws its own stick pictograms. The atom the two views are built from. |
61
+ | `createInputChip(token, opts)` | fn | One control's pictogram, for embedding in your own layout. Delegates to `createKeycap` / `createDpadKeycap` / `createButtonKeycap` for the buttons, and draws its own stick pictograms. The atom the two views are built from. |
62
62
  | `DEFAULT_STICK_STYLE` | const | The joystick drawing convention the kit uses (`"profile"`). Override per-call with `stickStyle`. |
63
63
  | `injectCss()` | fn | Force the `.rydr-ui-*` CSS into `<head>` early (components call it for you). |
64
64
 
65
65
  Types: `DiamondButton` (`"DIAMOND_UP"\|"DIAMOND_DOWN"\|"DIAMOND_LEFT"\|"DIAMOND_RIGHT"`), `DirButton`, `KeycapVariant` (`"full"\|"solo"`),
66
66
  `ButtonSource`, `Keycap`, `Card`, `ActionCard`, `ButtonPrompt`, `DialogueCard`, `ChoiceCard`,
67
- `LabeledDiamond`, `ActionDiamond`, `Rarity`, `RarityCard`, `PauseMenu`, `PauseMenuItem`, `PauseMenuOptions`.
67
+ `LabeledDiamond`, `ActionDiamond`, `Rarity`, `RarityCard`, `OptionMenu`, `OptionMenuItem`, `OptionMenuOptions`,
68
+ `ControlAction`, `ComboToken`, `StickDir`, `StickPictogramStyle`, `PadInputSource`, `PadBrandKey`, `PadPart`, `PadLayout`,
69
+ `ControllerPad`, `ControllerMap`, `ComboDemo`, `InputChip`, `ComboStrip`.
68
70
 
69
71
  ---
70
72
 
71
- ## The in-game menu (`mountPauseMenu`)
73
+ ## The in-game menu (`mountOptionMenu`)
72
74
 
73
75
  The GAME's menu, deliberately distinct from the PLATFORM's overlay (which the shell opens on `MENU` /
74
76
  `M` and which never reaches a game). The platform overlay carries the rider's concerns — activity,
75
77
  hardware, volume, exit; this one carries the game's.
76
78
 
77
79
  ```ts
78
- import { mountPauseMenu } from "@rydr/game-sdk/ui";
80
+ import { mountOptionMenu } from "@rydr/game-sdk/ui";
79
81
 
80
- const pause = mountPauseMenu(document.body, {
82
+ const menu = mountOptionMenu(document.body, {
81
83
  session,
82
84
  title: "Split Racing", // printed big, in YOUR font
83
85
  canOpen: () => phase === "playing", // so it never stacks on your own menus
@@ -95,21 +97,28 @@ const pause = mountPauseMenu(document.body, {
95
97
  `open()`/`close()`/`toggle()`/`setItems()`, or `handleButton(name)` if your host routes input itself.
96
98
 
97
99
  **It renders in the game's font.** The title and every row inherit the host's `font-family` — set the
98
- `font` option or the `--rydr-pause-font` custom property to force one. The keycaps keep their own RYDR
100
+ `font` option or the `--rydr-option-font` custom property to force one. The keycaps keep their own RYDR
99
101
  type on purpose: they are pictures of the rider's physical controller, not your copy.
100
102
 
103
+ > **So your page must actually declare a font.** Inheritance is the whole mechanism: if nothing up the
104
+ > tree sets `font-family`, the menu inherits the browser default and renders in **Times**. Every real
105
+ > game sets a body font, so this is normally free — but if the menu looks like a legal document, that's
106
+ > the cause, and the fix is a `font-family` on your `body` (or the `font` option).
107
+
101
108
  **`shortcut` is a teaching aid.** It renders as `Shortcut [Y]` — the button that does the same thing
102
109
  *during play*. Binding it in gameplay stays your job; the menu advertises it and honours it while open.
103
110
 
104
111
  **What it does NOT do: stop your game.** No library can — your loop, timers and physics are yours, so
105
112
  freeze them in `onOpen`/`onClose`. What it *guarantees* is that a game which keeps running cannot be
106
113
  **driven**: it takes the controller over for the duration (`session.grabInput`), so your `onButton`
107
- handlers go quiet, `isDown`/`stick` read resting, and anything held is released first. It also declares
108
- `setActivity("menu")` while up and `"playing"` on close, so trainer resistance eases like on any other
109
- non-racing screen.
110
- `LabeledDiamond`, `ActionDiamond`, `Rarity`, `RarityCard`,
111
- `ControlAction`, `ComboToken`, `StickDir`, `StickPictogramStyle`, `PadInputSource`, `PadBrandKey`, `PadPart`, `PadLayout`,
112
- `ControllerPad`, `ControllerMap`, `ComboDemo`, `InputChip`, `ComboStrip`.
114
+ handlers go quiet, `isDown`/`stick` read resting, and anything held is released first.
115
+
116
+ **It also does NOT touch the trainer.** The activity state is left exactly as your game set it, so a
117
+ rider who opens this mid-run keeps the resistance they were riding. This menu is an overlay over LIVE
118
+ gameplay, not a screen they navigated to — they're still on the bike with their legs turning, and
119
+ easing under them (then snapping back on Resume) would change the difficulty of the run they're
120
+ deciding whether to restart. If your game does want easing while it's up, call
121
+ `session.setActivity("menu")` in `onOpen` and `"playing"` in `onClose` — each game decides.
113
122
 
114
123
  ---
115
124
 
@@ -234,7 +243,11 @@ createKeycap("DIAMOND_DOWN", { press: session });
234
243
  ```
235
244
 
236
245
  The keycap is a small state machine — pressed sink, bouncing attract pulse (`setAnimated`), a
237
- depleting cooldown ring + countdown (`setCooldown(frac, label)`), colored/mono (`setColored`),
246
+ depleting cooldown ring + countdown (`setCooldown(frac, label)`), mono/colored (`setColored` — **mono
247
+ is the default**: a white face with a dark letter, as everywhere else in RYDR; the per-button role hues
248
+ are opt-in via `colored: true`), and `scale` (a size multiplier — the **only** sanctioned way to shrink a
249
+ cap, since it resizes the real geometry; never `transform: scale()`, which keeps a full-size box and
250
+ blurs the text. Secondary hints only: a "press this now" prompt stays at `1`),
238
251
  disabled (`setDisabled`), and show/hide (`setVisible`).
239
252
 
240
253
  ## Common recipes
@@ -16,7 +16,7 @@ const POS_CLASS = {
16
16
  * the move state.
17
17
  */
18
18
  export function mountActionDiamond(host, opts = {}) {
19
- const colored = opts.colored ?? true;
19
+ const colored = opts.colored ?? false; // mono by default, like every keycap — see KeycapOptions.colored
20
20
  const root = document.createElement("div");
21
21
  root.className = "rydr-ui-dia";
22
22
  if (opts.rowGap != null)
@@ -1 +1 @@
1
- {"version":3,"file":"action-diamond.js","sourceRoot":"","sources":["../../src/ui/action-diamond.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAyC,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,eAAe,EAAmB,MAAM,kBAAkB,CAAC;AAEpE,MAAM,SAAS,GAAkC;IAC/C,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS;CAClG,CAAC;AA2BF;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAiB,EAAE,OAA6B,EAAE;IACnF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC;IACrC,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;IAC/B,IAAI,IAAI,CAAC,MAAM,IAAI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AC,kBAAkB,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,SAAS,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAClE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;AACvD,CAAC"}
@@ -5,7 +5,8 @@
5
5
  *
6
6
  * DIAMOND_* → `createKeycap` (the kit's existing face-button keycap)
7
7
  * UP/DOWN/LEFT/RIGHT, R* → `createDpadKeycap` (the kit's chevron-on-steel keycap)
8
- * LT / RT / OPTIONS → `createLabelKeycap` (the kit's pill: "L2"/"ZL", "Menu"/"Options"/"+")
8
+ * LT / RT / OPTIONS → `createButtonKeycap` (the kit's pill "L2"/"ZL" for a trigger, the
9
+ * pad's round ☰ / + icon pip for OPTIONS)
9
10
  * LSTICK / RSTICK → a stick pictogram, cap centred inside four outward arrows
10
11
  * LSTICK / RSTICK :direction → the same pictogram with ONE arrow, cap already slid that way
11
12
  * LSTICK_PRESS / RSTICK_PRESS → a stick pictogram of the cap CLICKED: sunk inside a collar,
@@ -1 +1 @@
1
- {"version":3,"file":"input-chip.d.ts","sourceRoot":"","sources":["../../../src/ui/controller/input-chip.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAA+C,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGtG,OAAO,EAAgD,KAAK,UAAU,EAAE,KAAK,WAAW,EAAiB,MAAM,aAAa,CAAC;A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E,wDAAwD;AACxD,eAAO,MAAM,mBAAmB,EAAE,mBAA+B,CAAC;AA8KlE;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,GAAE,gBAAqB,GAAG,SAAS,CAmHzF"}
@@ -5,7 +5,8 @@
5
5
  *
6
6
  * DIAMOND_* → `createKeycap` (the kit's existing face-button keycap)
7
7
  * UP/DOWN/LEFT/RIGHT, R* → `createDpadKeycap` (the kit's chevron-on-steel keycap)
8
- * LT / RT / OPTIONS → `createLabelKeycap` (the kit's pill: "L2"/"ZL", "Menu"/"Options"/"+")
8
+ * LT / RT / OPTIONS → `createButtonKeycap` (the kit's pill "L2"/"ZL" for a trigger, the
9
+ * pad's round ☰ / + icon pip for OPTIONS)
9
10
  * LSTICK / RSTICK → a stick pictogram, cap centred inside four outward arrows
10
11
  * LSTICK / RSTICK :direction → the same pictogram with ONE arrow, cap already slid that way
11
12
  * LSTICK_PRESS / RSTICK_PRESS → a stick pictogram of the cap CLICKED: sunk inside a collar,
@@ -27,7 +28,7 @@
27
28
  * exactly the same `setPressed` path that real input drives.
28
29
  */
29
30
  import { bumperLabel, buttonLabel, DEFAULT_GLYPH_SET } from "../../protocol/glyphs.js";
30
- import { createKeycap, createDpadKeycap, createLabelKeycap } from "../keycap.js";
31
+ import { createKeycap, createDpadKeycap, createButtonKeycap } from "../keycap.js";
31
32
  import { injectPadCss } from "./styles.js";
32
33
  import { isShellControl, parseToken, STICK_DIR_VECTOR } from "./tokens.js";
33
34
  const NS = "http://www.w3.org/2000/svg";
@@ -277,12 +278,12 @@ export function createInputChip(token, opts = {}) {
277
278
  pressName = parsed.name;
278
279
  }
279
280
  else if (parsed.name === "LT" || parsed.name === "RT" || parsed.name === "OPTIONS") {
280
- // The kit's own LABEL keycap a pill for a button printed with a word rather than a letter: "L2" /
281
- // "ZL" / "LT" for a trigger, "Menu" / "Options" / "+" for OPTIONS. This used to be a hand-rolled
282
- // rectangle here, which duplicated `createLabelKeycap` outright once 7.0.0 added it; reusing it also
283
- // means a shoulder reads identically in a legend and in an in-game prompt, and OPTIONS prints its
284
- // real printed word instead of a generic ☰.
285
- const keycap = createLabelKeycap(parsed.name, { animate: false, glyphSet: set });
281
+ // The kit's own keycap for the buttons that carry neither a face letter nor a direction a text
282
+ // pill for a trigger ("L2" / "ZL" / "LT"), the pad's round ☰ / + icon pip for OPTIONS. This used to
283
+ // be a hand-rolled rectangle here, which duplicated `createButtonKeycap` outright once the kit
284
+ // grew it; reusing it means a shoulder or an OPTIONS reads identically in a legend and in an
285
+ // in-game prompt.
286
+ const keycap = createButtonKeycap(parsed.name, { animate: false, glyphSet: set });
286
287
  el = keycap.el;
287
288
  el.title =
288
289
  parsed.name === "OPTIONS" ? "Options" : parsed.name === "LT" ? "Left trigger" : "Right trigger";
@@ -1 +1 @@
1
- {"version":3,"file":"input-chip.js","sourceRoot":"","sources":["../../../src/ui/controller/input-chip.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAC;AACtG,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAsC,MAAM,cAAc,CAAC;AACrH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,gBAAgB,EAAoD,MAAM,aAAa,CAAC;AA4C7H,MAAM,EAAE,GAAG,4BAA4B,CAAC;AAqBxC,wDAAwD;AACxD,MAAM,CAAC,MAAM,mBAAmB,GAAwB,SAAS,CAAC;AAElE;;;;;;;GAOG;AACH,MAAM,MAAM,GAAG,GAAG,CAAC;AACnB,MAAM,KAAK,GAAG,GAAG,CAAC;AAClB,+DAA+D;AAC/D,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAC3C,qFAAqF;AACrF,MAAM,SAAS,GAAG,0BAA0B,CAAC;A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QACR,OAAO,EAAE,GAAG,EAAE;YACZ,GAAG,EAAE,EAAE,CAAC;YACR,YAAY,EAAE,CAAC;YACf,EAAE,CAAC,MAAM,EAAE,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -43,7 +43,7 @@ export * from "./choice-card.js";
43
43
  export * from "./labeled-diamond.js";
44
44
  export * from "./solo-labeled-diamond.js";
45
45
  export * from "./rarity-card.js";
46
- export * from "./pause-menu.js";
46
+ export * from "./option-menu.js";
47
47
  export * from "./power-race.js";
48
48
  export * from "./admin-nav.js";
49
49
  export * from "./heat-vignette.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
package/dist/ui/index.js CHANGED
@@ -43,7 +43,7 @@ export * from "./choice-card.js";
43
43
  export * from "./labeled-diamond.js";
44
44
  export * from "./solo-labeled-diamond.js";
45
45
  export * from "./rarity-card.js";
46
- export * from "./pause-menu.js";
46
+ export * from "./option-menu.js";
47
47
  export * from "./power-race.js";
48
48
  export * from "./admin-nav.js";
49
49
  export * from "./heat-vignette.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
@@ -2,20 +2,26 @@
2
2
  * KEYCAP — a DOM/CSS keycap of the controller face buttons (zero dependencies), so a game can show
3
3
  * "which button to press" in a consistent visual language. Two shapes:
4
4
  *
5
- * • "full" — the classic diamond: the active button enlarged + coloured, the other three small + grey.
5
+ * • "full" — the classic diamond: the active button enlarged, the other three small + grey.
6
6
  * • "solo" — light variation: JUST the active button (the idle siblings removed).
7
7
  *
8
8
  * The keycap is a small STATE MACHINE: it can pulse (the bouncing attract animation), show a pressed
9
- * sink, run a depleting COOLDOWN ring + countdown, render colored or neutral ("mono"), and hide.
9
+ * sink, run a depleting COOLDOWN ring + countdown, and hide.
10
+ *
11
+ * **Mono by default** — a white face with a dark letter, which is the RYDR look everywhere (the shell
12
+ * draws all of its own chrome that way). The per-button role hues still exist behind
13
+ * `colored: true`, for a deliberately loud isolated affordance or to show the palette itself.
10
14
  *
11
15
  * Two button families share that machine: `createKeycap` for the A/B/Y/Z face buttons (a letter on
12
16
  * the active pip) and `createDpadKeycap` for the UP/DOWN/LEFT/RIGHT directional buttons (a white
13
17
  * chevron on a steel-grey pip, rotated per direction). They differ ONLY in the face drawn and the
14
18
  * button name the press-wiring listens for; everything else is identical.
15
19
  *
16
- * A third factory, `createLabelKeycap`, covers the buttons whose printed name is a WORD rather than a
17
- * letterthe system/options button, the shoulder triggers, the stick clicks as a PILL instead of a
18
- * circle, since "Options" cannot fit in a pip sized for one glyph.
20
+ * A third factory, `createButtonKeycap`, covers what's left the system/options button, the shoulder
21
+ * triggers, the stick clicks and draws each the way the pad does: `OPTIONS` as a round pip with the
22
+ * pad's ICON (`☰` on Xbox/DualSense, `+` on a Switch Pro), since it's a small round key like the
23
+ * others; the triggers and stick clicks as a text PILL, since those are printed with a word ("LT",
24
+ * "L2", "LS") that no pip sized for one glyph could hold.
19
25
  */
20
26
  import type { ButtonName, ButtonEdge } from "../protocol/index.js";
21
27
  import { type GlyphSet } from "../protocol/glyphs.js";
@@ -40,7 +46,12 @@ export interface ButtonSource {
40
46
  export interface KeycapOptions {
41
47
  /** "solo" (default) shows only the active button; "full" shows the 4-button diamond. */
42
48
  variant?: KeycapVariant;
43
- /** Per-button hue (default true). `false` → a neutral palette (full colour can be too loud). */
49
+ /**
50
+ * Per-button hue. **Default `false` — mono** (a white face with a dark letter), which is the RYDR
51
+ * look: the shell draws every keycap in its chrome that way, so a coloured cap is the one loud key
52
+ * on the screen. Pass `true` only for a deliberately loud, isolated affordance (or to show the
53
+ * palette itself, as the showcase does).
54
+ */
44
55
  colored?: boolean;
45
56
  /** Run the bouncing pulse on the active button (default true). */
46
57
  animate?: boolean;
@@ -55,6 +66,20 @@ export interface KeycapOptions {
55
66
  * a settings screen, a showcase, a screenshot.
56
67
  */
57
68
  glyphSet?: GlyphSet;
69
+ /**
70
+ * Size multiplier for the whole keycap — pip diameter, letter, glyph and (on the pill shape) its
71
+ * height, padding and type. Default `1`.
72
+ *
73
+ * **This is the ONLY sanctioned way to make a keycap smaller.** The kit's rule against restyling
74
+ * stands: don't override the `.rydr-ui-*` sizes and never wrap a cap in `transform: scale()`, which
75
+ * leaves a full-size layout box, blurs the text and breaks any positioning done against it. This
76
+ * option resizes the real geometry instead, so layout stays honest.
77
+ *
78
+ * For **secondary** emphasis only — a hint the rider *may* use (the option menu's `Shortcut` caps ride
79
+ * at `0.65`), never a primary prompt. A prompt telling the rider what to press now stays at `1`: full
80
+ * size is what keeps it legible from a few feet away on a trainer.
81
+ */
82
+ scale?: number;
58
83
  }
59
84
  /** A bare keycap with its state setters. */
60
85
  export interface Keycap {
@@ -101,24 +126,30 @@ export interface Keycap {
101
126
  */
102
127
  export declare function createKeycap(button: DiamondButton, opts?: KeycapOptions): Keycap;
103
128
  /**
104
- * Build a keycap for a button whose printed name is a **word, not a letter** — the system/options
105
- * button (`OPTIONS` → "Menu" / "Options" / "+"), the shoulder triggers (`LT`/`RT` "LT" / "L2" / "ZL")
106
- * and the stick clicks (`LSTICK_PRESS`/`RSTICK_PRESS` "LS" / "L3" / "L").
129
+ * Build a keycap for the buttons that carry neither a face letter nor a direction — the system/options
130
+ * button (`OPTIONS`), the shoulder triggers (`LT`/`RT`) and the stick clicks
131
+ * (`LSTICK_PRESS`/`RSTICK_PRESS`) drawn the way the rider's pad actually draws them:
132
+ *
133
+ * • **`OPTIONS` → a round pip with the pad's ICON** (`☰` on Xbox/DualSense, `+` on a Switch Pro).
134
+ * It is a small round key on every pad, so it gets the same circular pip as the d-pad's chevron and
135
+ * sits in the same visual family as the face buttons.
136
+ * • **everything else → a text PILL** carrying {@link buttonLabel} ("LT" / "L2" / "ZL", "LS" / "L3"),
137
+ * because those buttons really are printed with a *word*, and no word fits a pip sized for one
138
+ * glyph. The trigger hardware isn't round either.
107
139
  *
108
- * A **pill** rather than a circular pip, because "Options" does not fit in a pip sized for one glyph.
109
- * Everything else is the pip's own language reused verbatim (raised lip, pulse, pressed sink, inert
110
- * grey), so the two shapes read as one family, and the text still comes from {@link buttonLabel} — the
111
- * rule that no letter is ever hardcoded holds here too.
140
+ * Either way the state machine is the pip's, reused verbatim (raised lip, pulse, pressed sink, inert
141
+ * grey), and nothing is hardcoded per brand: the icon comes from {@link SYSTEM_ICON} and the text from
142
+ * {@link buttonLabel}.
112
143
  *
113
- * Steel-grey by default (a system button is never the confirm/back hue), and — unlike the pip
114
- * factories — the attract pulse is **off** unless asked for: these caps label a shortcut the rider can
115
- * take, not an action being demanded of them. `setCooldown` is accepted for interface parity but draws
116
- * nothing: these buttons open menus, they don't gate timed abilities.
144
+ * Steel-grey (these are never the confirm/back hues), and — unlike the pip factories — the attract
145
+ * pulse is **off** unless asked for: these caps label a shortcut the rider *can* take, not an action
146
+ * being demanded of them. `setCooldown` is accepted for interface parity but draws nothing on the pill:
147
+ * these buttons open menus, they don't gate timed abilities.
117
148
  *
118
- * Pass a face-diamond or d-pad button here and you get its letter/arrow in a pill — legal, but prefer
119
- * {@link createKeycap} / {@link createDpadKeycap}, which draw the real button shape.
149
+ * Pass a face-diamond or d-pad button here and you get its letter in a pill — legal, but prefer
150
+ * {@link createKeycap} / {@link createDpadKeycap}, which draw those buttons' real shapes.
120
151
  */
121
- export declare function createLabelKeycap(button: ButtonName, opts?: KeycapOptions): Keycap;
152
+ export declare function createButtonKeycap(button: ButtonName, opts?: KeycapOptions): Keycap;
122
153
  /**
123
154
  * Build a bare directional (UP/DOWN/LEFT/RIGHT) keycap. Identical state machine to {@link createKeycap}
124
155
  * — solo/full, pulse, pressed, cooldown ring — only the active button shows a WHITE chevron (rotated
@@ -1 +1 @@
1
- {"version":3,"file":"keycap.d.ts","sourceRoot":"","sources":["../../src/ui/keycap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAkC,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtF,+FAA+F;AAC/F,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,GAAG,cAAc,GAAG,eAAe,CAAC;AAC7F,8EAA8E;AAC9E,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AACzD,sEAAsE;AACtE,MAAM,MAAM,aAA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AAS,EAAE,IAAI,GAAE,aAAkB,GAAG,MAAM,CAEjF"}
package/dist/ui/keycap.js CHANGED
@@ -2,20 +2,26 @@
2
2
  * KEYCAP — a DOM/CSS keycap of the controller face buttons (zero dependencies), so a game can show
3
3
  * "which button to press" in a consistent visual language. Two shapes:
4
4
  *
5
- * • "full" — the classic diamond: the active button enlarged + coloured, the other three small + grey.
5
+ * • "full" — the classic diamond: the active button enlarged, the other three small + grey.
6
6
  * • "solo" — light variation: JUST the active button (the idle siblings removed).
7
7
  *
8
8
  * The keycap is a small STATE MACHINE: it can pulse (the bouncing attract animation), show a pressed
9
- * sink, run a depleting COOLDOWN ring + countdown, render colored or neutral ("mono"), and hide.
9
+ * sink, run a depleting COOLDOWN ring + countdown, and hide.
10
+ *
11
+ * **Mono by default** — a white face with a dark letter, which is the RYDR look everywhere (the shell
12
+ * draws all of its own chrome that way). The per-button role hues still exist behind
13
+ * `colored: true`, for a deliberately loud isolated affordance or to show the palette itself.
10
14
  *
11
15
  * Two button families share that machine: `createKeycap` for the A/B/Y/Z face buttons (a letter on
12
16
  * the active pip) and `createDpadKeycap` for the UP/DOWN/LEFT/RIGHT directional buttons (a white
13
17
  * chevron on a steel-grey pip, rotated per direction). They differ ONLY in the face drawn and the
14
18
  * button name the press-wiring listens for; everything else is identical.
15
19
  *
16
- * A third factory, `createLabelKeycap`, covers the buttons whose printed name is a WORD rather than a
17
- * letterthe system/options button, the shoulder triggers, the stick clicks as a PILL instead of a
18
- * circle, since "Options" cannot fit in a pip sized for one glyph.
20
+ * A third factory, `createButtonKeycap`, covers what's left the system/options button, the shoulder
21
+ * triggers, the stick clicks and draws each the way the pad does: `OPTIONS` as a round pip with the
22
+ * pad's ICON (`☰` on Xbox/DualSense, `+` on a Switch Pro), since it's a small round key like the
23
+ * others; the triggers and stick clicks as a text PILL, since those are printed with a word ("LT",
24
+ * "L2", "LS") that no pip sized for one glyph could hold.
19
25
  */
20
26
  import { buttonLabel, DEFAULT_GLYPH_SET } from "../protocol/glyphs.js";
21
27
  import { injectCss } from "./styles.js";
@@ -70,6 +76,29 @@ const ROT = { top: 0, rgt: 90, bot: 180, lft: 270 };
70
76
  const CHEVRON = `<polyline points="5,15 12,8 19,15" fill="none" stroke="currentColor" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"/>`;
71
77
  /** Background tone of a directional keycap's active pip ("acier" / steel-grey); the glyph stays white. */
72
78
  const DPAD_TONE = "#566273";
79
+ /**
80
+ * The ICON a pad prints on its system button, per family — because the button itself is a small round
81
+ * key, drawn with a symbol rather than lettered: `☰` on an Xbox pad's Menu button and on a DualSense's
82
+ * Options button, `+` on a Switch Pro. Only the RYDR-historic Zwift pad has no such button at all, and
83
+ * it borrows the hamburger.
84
+ *
85
+ * This is the ICON, not the NAME: prose still says "press Menu" / "press Options" / "press +" via
86
+ * {@link buttonLabel}, which stays the single home for a button's printed *text*. A button with an
87
+ * entry here is drawn as a round pip like the d-pad's chevron; one without (the shoulder triggers, the
88
+ * stick clicks) falls back to a text pill, because those really are printed with a word.
89
+ */
90
+ const SYSTEM_ICON = (() => {
91
+ const HAMBURGER = `<g fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round">` +
92
+ `<line x1="6" y1="8" x2="18" y2="8"/><line x1="6" y1="12" x2="18" y2="12"/><line x1="6" y1="16" x2="18" y2="16"/></g>`;
93
+ const PLUS = `<g fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round">` +
94
+ `<line x1="12" y1="6" x2="12" y2="18"/><line x1="6" y1="12" x2="18" y2="12"/></g>`;
95
+ return {
96
+ xbox: { OPTIONS: HAMBURGER },
97
+ playstation: { OPTIONS: HAMBURGER },
98
+ nintendo: { OPTIONS: PLUS },
99
+ zwift: { OPTIONS: HAMBURGER },
100
+ };
101
+ })();
73
102
  const PIP = 20, PIP_ACTIVE = 38, LETTER_FONT = 23;
74
103
  const NEUTRAL_ACTIVE = "#ffffff"; // mono active button: white face (the letter stays dark)
75
104
  const INACTIVE = "#3a424e"; // the idle siblings in a full diamond
@@ -80,14 +109,29 @@ const INACTIVE = "#3a424e"; // the idle siblings in a full diamond
80
109
  * A factory rather than a constant because the letter depends on which controller is paired; the set
81
110
  * is resolved once when the keycap is built. See {@link buttonLabel}.
82
111
  */
83
- const letterFaceFor = (set) => (pos, active) => {
112
+ const letterFaceFor = (set) => (pos, active, size) => {
84
113
  const lt = document.createElement("span");
85
114
  lt.className = "rydr-ui-pip-letter";
115
+ // Sized from the pip it sits on, not from the constant, so a `scale`d cap keeps the same
116
+ // letter-to-key proportion. At the default pip this is exactly LETTER_FONT.
86
117
  if (active)
87
- lt.style.fontSize = `${LETTER_FONT}px`;
118
+ lt.style.fontSize = `${(size * LETTER_FONT) / PIP_ACTIVE}px`;
88
119
  lt.textContent = buttonLabel(set, BUTTON_AT[pos]);
89
120
  return lt;
90
121
  };
122
+ /** System face — the white icon the pad prints on that button (see {@link SYSTEM_ICON}). */
123
+ const iconFaceFor = (svgBody) => (_pos, active, size) => {
124
+ if (!active)
125
+ return null;
126
+ const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
127
+ svg.setAttribute("viewBox", "0 0 24 24");
128
+ svg.setAttribute("width", String(Math.round(size * 0.62)));
129
+ svg.setAttribute("height", String(Math.round(size * 0.62)));
130
+ svg.setAttribute("class", "rydr-ui-pip-glyph");
131
+ svg.style.color = "#ffffff"; // white icon on the steel pip, exactly like the chevron
132
+ svg.innerHTML = svgBody;
133
+ return svg;
134
+ };
91
135
  /** Directional face — a white chevron (only on the active button; siblings stay blank). */
92
136
  const chevronFace = (pos, active, size) => {
93
137
  if (!active)
@@ -122,19 +166,22 @@ function makePip(active, color, pos, size, animate, face) {
122
166
  return pip;
123
167
  }
124
168
  /** Build the keycap for `activePos`; returns the element + a reference to the active pip (for state). */
125
- function buildPips(activePos, variant, colored, animate, face, accent) {
169
+ function buildPips(activePos, variant, colored, animate, face, scale, accent) {
126
170
  const diamond = document.createElement("div");
127
171
  diamond.className = "rydr-ui-diamond";
128
172
  // `accent` (used by the directional keycap) overrides the per-button hue with a fixed tone.
129
173
  const activeColor = accent ?? (colored ? COLOR[activePos] : NEUTRAL_ACTIVE);
174
+ // Every dimension below derives from these two, so `scale` resizes the real geometry (and the faces,
175
+ // which size themselves off the pip they're drawn on) rather than transforming a full-size box.
176
+ const pipIdle = PIP * scale, pipActive = PIP_ACTIVE * scale;
130
177
  if (variant === "solo") {
131
- diamond.style.width = diamond.style.height = `${PIP_ACTIVE}px`;
132
- const pip = makePip(true, activeColor, activePos, PIP_ACTIVE, animate, face);
178
+ diamond.style.width = diamond.style.height = `${pipActive}px`;
179
+ const pip = makePip(true, activeColor, activePos, pipActive, animate, face);
133
180
  pip.style.left = pip.style.top = "0px";
134
181
  diamond.appendChild(pip);
135
182
  return { el: diamond, activePip: pip };
136
183
  }
137
- const ri = PIP / 2, Ra = PIP_ACTIVE / 2, r0 = Ra, D = r0 + ri;
184
+ const ri = pipIdle / 2, Ra = pipActive / 2, r0 = Ra, D = r0 + ri;
138
185
  let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
139
186
  const pts = {};
140
187
  for (const k of ["top", "lft", "rgt", "bot"]) {
@@ -169,9 +216,13 @@ function build(activePos, pressName, face, opts, accent) {
169
216
  injectCss();
170
217
  const variant = opts.variant ?? "solo";
171
218
  const animate = opts.animate ?? true;
172
- const colored = opts.colored ?? true;
173
- const { el, activePip } = buildPips(activePos, variant, colored, animate, face, accent);
219
+ const colored = opts.colored ?? false; // mono is the RYDR look — see KeycapOptions.colored
220
+ const scale = opts.scale ?? 1;
221
+ const { el, activePip } = buildPips(activePos, variant, colored, animate, face, scale, accent);
174
222
  const num = activePip.querySelector(".rydr-ui-cd-num");
223
+ // The countdown's type lives in CSS; scale it with the pip so a small cap's number still fits inside.
224
+ if (num && scale !== 1)
225
+ num.style.fontSize = `${18 * scale}px`;
175
226
  const setPressed = (on) => activePip.classList.toggle("pressed", on);
176
227
  // wire to real controller input: pressed while THIS button is held (down → pressed, up → released)
177
228
  const off = opts.press?.onButton((e) => { if (e.name === pressName)
@@ -209,29 +260,44 @@ export function createKeycap(button, opts = {}) {
209
260
  return build(POS_OF[button], button, letterFaceFor(resolveGlyphSet(opts)), opts);
210
261
  }
211
262
  /**
212
- * Build a keycap for a button whose printed name is a **word, not a letter** — the system/options
213
- * button (`OPTIONS` → "Menu" / "Options" / "+"), the shoulder triggers (`LT`/`RT` "LT" / "L2" / "ZL")
214
- * and the stick clicks (`LSTICK_PRESS`/`RSTICK_PRESS` "LS" / "L3" / "L").
263
+ * Build a keycap for the buttons that carry neither a face letter nor a direction — the system/options
264
+ * button (`OPTIONS`), the shoulder triggers (`LT`/`RT`) and the stick clicks
265
+ * (`LSTICK_PRESS`/`RSTICK_PRESS`) drawn the way the rider's pad actually draws them:
266
+ *
267
+ * • **`OPTIONS` → a round pip with the pad's ICON** (`☰` on Xbox/DualSense, `+` on a Switch Pro).
268
+ * It is a small round key on every pad, so it gets the same circular pip as the d-pad's chevron and
269
+ * sits in the same visual family as the face buttons.
270
+ * • **everything else → a text PILL** carrying {@link buttonLabel} ("LT" / "L2" / "ZL", "LS" / "L3"),
271
+ * because those buttons really are printed with a *word*, and no word fits a pip sized for one
272
+ * glyph. The trigger hardware isn't round either.
215
273
  *
216
- * A **pill** rather than a circular pip, because "Options" does not fit in a pip sized for one glyph.
217
- * Everything else is the pip's own language reused verbatim (raised lip, pulse, pressed sink, inert
218
- * grey), so the two shapes read as one family, and the text still comes from {@link buttonLabel} — the
219
- * rule that no letter is ever hardcoded holds here too.
274
+ * Either way the state machine is the pip's, reused verbatim (raised lip, pulse, pressed sink, inert
275
+ * grey), and nothing is hardcoded per brand: the icon comes from {@link SYSTEM_ICON} and the text from
276
+ * {@link buttonLabel}.
220
277
  *
221
- * Steel-grey by default (a system button is never the confirm/back hue), and — unlike the pip
222
- * factories — the attract pulse is **off** unless asked for: these caps label a shortcut the rider can
223
- * take, not an action being demanded of them. `setCooldown` is accepted for interface parity but draws
224
- * nothing: these buttons open menus, they don't gate timed abilities.
278
+ * Steel-grey (these are never the confirm/back hues), and — unlike the pip factories — the attract
279
+ * pulse is **off** unless asked for: these caps label a shortcut the rider *can* take, not an action
280
+ * being demanded of them. `setCooldown` is accepted for interface parity but draws nothing on the pill:
281
+ * these buttons open menus, they don't gate timed abilities.
225
282
  *
226
- * Pass a face-diamond or d-pad button here and you get its letter/arrow in a pill — legal, but prefer
227
- * {@link createKeycap} / {@link createDpadKeycap}, which draw the real button shape.
283
+ * Pass a face-diamond or d-pad button here and you get its letter in a pill — legal, but prefer
284
+ * {@link createKeycap} / {@link createDpadKeycap}, which draw those buttons' real shapes.
228
285
  */
229
- export function createLabelKeycap(button, opts = {}) {
286
+ export function createButtonKeycap(button, opts = {}) {
287
+ const set = resolveGlyphSet(opts);
288
+ const icon = SYSTEM_ICON[SYSTEM_ICON[set] ? set : DEFAULT_GLYPH_SET][button];
289
+ // A button the pad draws with a symbol is a ROUND KEY: reuse the pip machinery (solo variant, steel
290
+ // tone, icon face). `activePos` only picks the hue and the sibling layout, neither of which a solo
291
+ // accented pip uses — "bot" is an inert placeholder, not a claim about where the button sits.
292
+ if (icon)
293
+ return build("bot", button, iconFaceFor(icon), { ...opts, variant: "solo", animate: opts.animate ?? false }, DPAD_TONE);
230
294
  injectCss();
231
295
  const el = document.createElement("span");
232
296
  el.className = "rydr-ui-cap" + (opts.animate ?? false ? " anim" : "");
233
297
  el.style.setProperty("--c", DPAD_TONE);
234
- el.textContent = buttonLabel(resolveGlyphSet(opts), button);
298
+ if (opts.scale != null && opts.scale !== 1)
299
+ el.style.setProperty("--s", String(opts.scale));
300
+ el.textContent = buttonLabel(set, button);
235
301
  const setPressed = (on) => { el.classList.toggle("pressed", on); };
236
302
  const off = opts.press?.onButton((e) => { if (e.name === button)
237
303
  setPressed(e.edge === "down"); });