@molecule/app-leaderboard-row-angular 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-11-16T01:05:59.906Z
6
+ Generated: 2026-11-17T00:29:39.514Z
7
7
  -->
8
8
 
9
9
  # @molecule/app-leaderboard-row-angular
@@ -83,8 +83,8 @@ interface LeaderboardRowProps {
83
83
  subtitle?: unknown
84
84
  /** Whether this row represents the current user (highlighted). */
85
85
  isMe?: boolean
86
- /** Click handler (a native click on the row, with the DOM event). */
87
- onClick?: (event: MouseEvent) => void
86
+ /** Click handler (a native click on the row, with the DOM event; also runs, with no event, on Enter / Space). */
87
+ onClick?: (event?: MouseEvent) => void
88
88
  /** Extra classes. */
89
89
  className?: string
90
90
  }
@@ -99,10 +99,11 @@ LeaderboardRow component.
99
99
  Leaderboard row — rank + avatar + name + score + optional rank-delta
100
100
  arrow. Top 3 ranks render a medal in place of the numeric rank. The host IS
101
101
  the row's root `<div>` (`div[mol-leaderboard-row]`), matching React's root
102
- exactly; `onClick` is a native click on the host with no keyboard handler
103
- or role — a documented gap of the React package the DOM must match. When
104
- `name` is not a plain string the Avatar alt falls back to hardcoded
105
- 'Player'. Same props, same DOM as
102
+ exactly. With `onClick` the row is promoted to a real button in the a11y
103
+ tree — `role="button"`, `tabindex="0"`, the pointer cursor — and Enter /
104
+ Space activate it (the click handler runs with no event), matching native
105
+ button keyboard semantics. When `name` is not a plain string the Avatar alt
106
+ falls back to hardcoded 'Player'. Same props, same DOM as
106
107
  `@molecule/app-leaderboard-row-react`'s `LeaderboardRow`. Node-valued
107
108
  `name`, `score` and `subtitle` content is projected (`[slot=<name>]`); a
108
109
  string or number input renders as text. The optional subtitle span renders
@@ -128,15 +129,17 @@ all for an absent or empty subtitle.
128
129
  ],
129
130
  host: {
130
131
  '[class]': 'classes()',
131
- '[style.background]': "isMe ? 'rgba(96,165,250,0.1)' : ''",
132
132
  '[style.borderRadius]': "isMe ? '8px' : ''",
133
+ '[attr.role]': 'role()',
134
+ '[attr.tabindex]': 'tabindex()',
133
135
  '(click)': 'rowClick($event)',
136
+ '(keydown)': 'handleKeyDown($event)',
134
137
  },
135
138
  // prettier-ignore
136
139
  template: `<span [class]="rankClass()" style="min-width: 32px">{{ rankText() }}</span>
137
140
  <div mol-avatar [src]="avatarSrc" [alt]="displayName()" [name]="displayName()" [size]="'sm'"></div>
138
141
  <div [class]="nameColumnClass()"><span [class]="nameClass()">@if (hasName) {<ng-container>{{ name }}</ng-container>}<ng-content select="[slot=name]" /></span>@if (showSubtitle) {<span #subtitleEl [class]="subtitleClass()">@if (hasSubtitle) {<ng-container>{{ subtitle }}</ng-container>}<ng-content select="[slot=subtitle]" /></span>}</div>
139
- @if (hasDelta) {<span [class]="deltaClass()" [style.color]="deltaColor()">{{ deltaArrow() + ' ' + deltaText() }}</span>}
142
+ @if (hasDelta) {<span [class]="deltaClass()">{{ deltaArrow() + ' ' + deltaText() }}</span>}
140
143
  <span [class]="scoreClass()">@if (hasScore) {<ng-container>{{ score }}</ng-container>}<ng-content select="[slot=score]" /></span>`,
141
144
  })
142
145
  export class LeaderboardRow implements AfterViewInit {
@@ -154,8 +157,8 @@ export class LeaderboardRow implements AfterViewInit {
154
157
  subtitle?: unknown
155
158
  /** Whether this row represents the current user (highlighted). */
156
159
  isMe?: boolean
157
- /** Click handler, called with the native click event. */
158
- onClick?: (event: MouseEvent) => void
160
+ /** Click handler, called with the native click event; also runs, with no event, on Enter / Space. */
161
+ onClick?: (event?: MouseEvent) => void
159
162
  /** Extra classes. */
160
163
  className?: string
161
164
 
@@ -165,12 +168,7 @@ export class LeaderboardRow implements AfterViewInit {
165
168
  /** Whether a `[slot=subtitle]` projection landed (true until proven otherwise). */
166
169
  private readonly subtitleProjected = signal(true)
167
170
 
168
- /**
169
- * Withdraws the optimistic subtitle span when its slot projection did not
170
- * land: when neither a text input nor projected content is present, React
171
- * renders no span at all. View queries resolve at view init, and a
172
- * projected slot's content is in place by then.
173
- */
171
+ /** Withdraws the optimistic subtitle span when its slot projection did not land: when neither a text input nor projected content is present, React renders no span… */
174
172
  ngAfterViewInit(): void {
175
173
  const subtitle = this.subtitleEl?.nativeElement
176
174
  if (subtitle && !this.hasSubtitle && !hasRenderableContent(subtitle)) {
@@ -178,172 +176,136 @@ export class LeaderboardRow implements AfterViewInit {
178
176
  }
179
177
  }
180
178
 
181
- /**
182
- * Forwards a native click on the row to the `onClick` input (React calls
183
- * the handler with the event).
184
- * @param event - The native click event.
185
- */
179
+ /** Whether the row is interactive (`onClick` supplied): React renders the button role, tab stop and pointer cursor only then. */
180
+ interactive(): boolean {
181
+ return typeof this.onClick === 'function'
182
+ }
183
+
184
+ /** The host element's `role` (a button only when clickable). */
185
+ role(): string | null {
186
+ return this.interactive() ? 'button' : null
187
+ }
188
+
189
+ /** The host element's tab stop (only when clickable). */
190
+ tabindex(): number | null {
191
+ return this.interactive() ? 0 : null
192
+ }
193
+
194
+ /** Forwards a native click on the row to the `onClick` input (React calls the handler with the event). */
186
195
  rowClick(event: MouseEvent): void {
187
196
  this.onClick?.(event)
188
197
  }
189
198
 
190
- /**
191
- * The current class map.
192
- * @returns The UIClassMap.
193
- */
199
+ /** Activates the row on Enter / Space (React's `handleKeyDown`): preventDefault, then the click handler with no event. */
200
+ handleKeyDown(event: KeyboardEvent): void {
201
+ const onClick = this.onClick
202
+ if (!onClick) return
203
+ if (event.key === 'Enter' || event.key === ' ') {
204
+ event.preventDefault()
205
+ onClick()
206
+ }
207
+ }
208
+
209
+ /** The current class map. */
194
210
  cm(): UIClassMap {
195
211
  return getClassMap()
196
212
  }
197
213
 
198
- /**
199
- * Computes the row's root class list, with the pointer cursor only when an
200
- * `onClick` handler is set (React's conditional `cm.cursorPointer`).
201
- * @returns The class string.
202
- */
214
+ /** Computes the row's root class list, with the pointer cursor only when an `onClick` handler is set (React's conditional `cm.cursorPointer`). */
203
215
  classes(): string {
204
216
  return this.cm().cn(
205
217
  this.cm().flex({ align: 'center', gap: 'sm' }),
206
218
  this.cm().sp('px', 3),
207
219
  this.cm().sp('py', 2),
208
220
  this.onClick ? this.cm().cursorPointer : undefined,
221
+ this.isMe ? this.cm().bgTone('info', { subtle: true }) : undefined,
209
222
  this.className,
210
223
  )
211
224
  }
212
225
 
213
- /**
214
- * The rank cell's class.
215
- * @returns The class string.
216
- */
226
+ /** The rank cell's class. */
217
227
  rankClass(): string {
218
228
  return this.cm().cn(this.cm().shrink0, this.cm().fontWeight('bold'), this.cm().textCenter)
219
229
  }
220
230
 
221
- /**
222
- * The rank cell's text: a medal for the top three, `#n` otherwise (React's
223
- * `MEDAL[rank] ?? '#' + rank`).
224
- * @returns The rank display.
225
- */
231
+ /** The rank cell's text: a medal for the top three, `#n` otherwise (React's `MEDAL[rank] ?? */
226
232
  rankText(): string {
227
233
  return MEDAL[this.rank as number] ?? `#${this.rank}`
228
234
  }
229
235
 
230
- /**
231
- * The Avatar's alt/name (React's `typeof name === 'string' ? name :
232
- * 'Player'`).
233
- * @returns The display name.
234
- */
236
+ /** The Avatar's alt/name (React's `typeof name === 'string' ? name : 'Player'`). */
235
237
  displayName(): string {
236
238
  return typeof this.name === 'string' ? this.name : 'Player'
237
239
  }
238
240
 
239
- /**
240
- * The name column's class.
241
- * @returns The class string.
242
- */
241
+ /** The name column's class. */
243
242
  nameColumnClass(): string {
244
243
  return this.cm().cn(this.cm().flex1, this.cm().stack(0 as const))
245
244
  }
246
245
 
247
- /**
248
- * The name span's class.
249
- * @returns The class string.
250
- */
246
+ /** The name span's class. */
251
247
  nameClass(): string {
252
248
  return this.cm().cn(this.cm().textSize('sm'), this.cm().fontWeight('semibold'))
253
249
  }
254
250
 
255
- /**
256
- * The subtitle span's class.
257
- * @returns The class string.
258
- */
251
+ /** The subtitle span's class. */
259
252
  subtitleClass(): string {
260
253
  return this.cm().textSize('xs')
261
254
  }
262
255
 
263
- /**
264
- * Whether a text name input is present (a projected name is not).
265
- * @returns True when the name renders as text.
266
- */
256
+ /** Whether a text name input is present (a projected name is not). */
267
257
  get hasName(): boolean {
268
258
  return this.name !== undefined && this.name !== null
269
259
  }
270
260
 
271
- /**
272
- * Whether a text score input is present (a projected score is not).
273
- * @returns True when the score renders as text.
274
- */
261
+ /** Whether a text score input is present (a projected score is not). */
275
262
  get hasScore(): boolean {
276
263
  return this.score !== undefined && this.score !== null
277
264
  }
278
265
 
279
- /**
280
- * Whether the subtitle renders as text: React's `subtitle && …` truthiness.
281
- * @returns True when the subtitle text shows.
282
- */
266
+ /** Whether the subtitle renders as text: React's `subtitle && …` truthiness. */
283
267
  get hasSubtitle(): boolean {
284
268
  return this.subtitle !== undefined && this.subtitle !== null && this.subtitle !== ''
285
269
  }
286
270
 
287
- /**
288
- * Whether the subtitle span renders at all: the text input or projected
289
- * `[slot=subtitle]` content.
290
- * @returns True when the subtitle shows.
291
- */
271
+ /** Whether the subtitle span renders at all: the text input or projected `[slot=subtitle]` content. */
292
272
  get showSubtitle(): boolean {
293
273
  return this.hasSubtitle || this.subtitleProjected()
294
274
  }
295
275
 
296
- /**
297
- * Whether a delta indicator renders: React's `rankDelta !== undefined &&
298
- * rankDelta !== 0` (a zero delta renders nothing).
299
- * @returns True when the ▲/▼ chip shows.
300
- */
276
+ /** Whether a delta indicator renders: React's `rankDelta !== undefined && rankDelta !== 0` (a zero delta renders nothing). */
301
277
  get hasDelta(): boolean {
302
278
  return this.rankDelta !== undefined && this.rankDelta !== 0
303
279
  }
304
280
 
305
- /**
306
- * The delta chip's class.
307
- * @returns The class string.
308
- */
281
+ /** The delta chip's class: the text size and weight, plus the semantic tone (React's `cm.textTone(rankDelta > 0 ? */
309
282
  deltaClass(): string {
310
- return this.cm().cn(this.cm().textSize('xs'), this.cm().fontWeight('semibold'))
311
- }
312
-
313
- /**
314
- * The delta arrow's color (React's hardcoded green/red hex).
315
- * @returns The CSS color.
316
- */
317
- deltaColor(): string {
318
- return (this.rankDelta as number) > 0 ? '#22c55e' : '#ef4444'
283
+ return this.cm().cn(
284
+ this.cm().textSize('xs'),
285
+ this.cm().fontWeight('semibold'),
286
+ this.cm().textTone((this.rankDelta as number) > 0 ? 'success' : 'error'),
287
+ )
319
288
  }
320
289
 
321
- /**
322
- * The delta's arrow (React's `rankDelta > 0 ? '▲' : '▼'`).
323
- * @returns The arrow character.
324
- */
290
+ /** The delta's arrow (React's `rankDelta > 0 ? */
325
291
  deltaArrow(): string {
326
292
  return (this.rankDelta as number) > 0 ? '▲' : '▼'
327
293
  }
328
294
 
329
- /**
330
- * The delta's magnitude (React's `Math.abs(rankDelta)`).
331
- * @returns The number of ranks climbed or dropped.
332
- */
295
+ /** The delta's magnitude (React's `Math.abs(rankDelta)`). */
333
296
  deltaText(): number {
334
297
  return Math.abs(this.rankDelta as number)
335
298
  }
336
299
 
337
- /**
338
- * The score span's class.
339
- * @returns The class string.
340
- */
300
+ /** The score span's class. */
341
301
  scoreClass(): string {
342
302
  return this.cm().cn(this.cm().textSize('sm'), this.cm().fontWeight('bold'))
343
303
  }
344
304
  }
345
305
  ```
346
306
 
307
+ _(Member comments are shortened to their first sentence to fit; the full declaration is in `node_modules/@molecule/app-leaderboard-row-angular/dist/leaderboard-row.component.d.ts`.)_
308
+
347
309
  ## Injection Notes
348
310
 
349
311
  ### Requirements
@@ -375,10 +337,12 @@ Peer dependencies:
375
337
  - When `name` is not a plain string the avatar's accessible name falls back
376
338
  to the hardcoded English string 'Player' — pass a string `name` in
377
339
  localized apps.
378
- - `onClick` gives the row a pointer cursor but no keyboard/role semantics
379
- (a documented gap of the React package the DOM must match); it is called
380
- with the native click event. The host IS the row's root `<div>`, so a
381
- click anywhere on the row fires it.
340
+ - With `onClick` the row is promoted to a real button in the a11y tree —
341
+ `role="button"`, `tabindex="0"`, the pointer cursor — and Enter / Space
342
+ activate it (the click handler runs with no event), matching native
343
+ button keyboard semantics; on a click it is called with the native click
344
+ event. The host IS the row's root `<div>`, so a click anywhere on the row
345
+ fires it.
382
346
  - Requires a wired ClassMap bond; `<Avatar>` comes from
383
347
  `@molecule/app-ui-angular`. Node props are projected content: `name`,
384
348
  `score` and `subtitle` are selected by `[slot=<name>]`, everything else
package/dist/index.d.ts CHANGED
@@ -42,10 +42,12 @@
42
42
  * - When `name` is not a plain string the avatar's accessible name falls back
43
43
  * to the hardcoded English string 'Player' — pass a string `name` in
44
44
  * localized apps.
45
- * - `onClick` gives the row a pointer cursor but no keyboard/role semantics
46
- * (a documented gap of the React package the DOM must match); it is called
47
- * with the native click event. The host IS the row's root `<div>`, so a
48
- * click anywhere on the row fires it.
45
+ * - With `onClick` the row is promoted to a real button in the a11y tree —
46
+ * `role="button"`, `tabindex="0"`, the pointer cursor — and Enter / Space
47
+ * activate it (the click handler runs with no event), matching native
48
+ * button keyboard semantics; on a click it is called with the native click
49
+ * event. The host IS the row's root `<div>`, so a click anywhere on the row
50
+ * fires it.
49
51
  * - Requires a wired ClassMap bond; `<Avatar>` comes from
50
52
  * `@molecule/app-ui-angular`. Node props are projected content: `name`,
51
53
  * `score` and `subtitle` are selected by `[slot=<name>]`, everything else
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,cAAc,gCAAgC,CAAA;AAC9C,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,cAAc,gCAAgC,CAAA;AAC9C,cAAc,YAAY,CAAA"}
package/dist/index.js CHANGED
@@ -42,10 +42,12 @@
42
42
  * - When `name` is not a plain string the avatar's accessible name falls back
43
43
  * to the hardcoded English string 'Player' — pass a string `name` in
44
44
  * localized apps.
45
- * - `onClick` gives the row a pointer cursor but no keyboard/role semantics
46
- * (a documented gap of the React package the DOM must match); it is called
47
- * with the native click event. The host IS the row's root `<div>`, so a
48
- * click anywhere on the row fires it.
45
+ * - With `onClick` the row is promoted to a real button in the a11y tree —
46
+ * `role="button"`, `tabindex="0"`, the pointer cursor — and Enter / Space
47
+ * activate it (the click handler runs with no event), matching native
48
+ * button keyboard semantics; on a click it is called with the native click
49
+ * event. The host IS the row's root `<div>`, so a click anywhere on the row
50
+ * fires it.
49
51
  * - Requires a wired ClassMap bond; `<Avatar>` comes from
50
52
  * `@molecule/app-ui-angular`. Node props are projected content: `name`,
51
53
  * `score` and `subtitle` are selected by `[slot=<name>]`, everything else
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,cAAc,gCAAgC,CAAA;AAC9C,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,cAAc,gCAAgC,CAAA;AAC9C,cAAc,YAAY,CAAA"}
@@ -12,10 +12,11 @@ import * as i0 from "@angular/core";
12
12
  * Leaderboard row — rank + avatar + name + score + optional rank-delta
13
13
  * arrow. Top 3 ranks render a medal in place of the numeric rank. The host IS
14
14
  * the row's root `<div>` (`div[mol-leaderboard-row]`), matching React's root
15
- * exactly; `onClick` is a native click on the host with no keyboard handler
16
- * or role — a documented gap of the React package the DOM must match. When
17
- * `name` is not a plain string the Avatar alt falls back to hardcoded
18
- * 'Player'. Same props, same DOM as
15
+ * exactly. With `onClick` the row is promoted to a real button in the a11y
16
+ * tree — `role="button"`, `tabindex="0"`, the pointer cursor — and Enter /
17
+ * Space activate it (the click handler runs with no event), matching native
18
+ * button keyboard semantics. When `name` is not a plain string the Avatar alt
19
+ * falls back to hardcoded 'Player'. Same props, same DOM as
19
20
  * `@molecule/app-leaderboard-row-react`'s `LeaderboardRow`. Node-valued
20
21
  * `name`, `score` and `subtitle` content is projected (`[slot=<name>]`); a
21
22
  * string or number input renders as text. The optional subtitle span renders
@@ -38,8 +39,8 @@ export declare class LeaderboardRow implements AfterViewInit {
38
39
  subtitle?: unknown;
39
40
  /** Whether this row represents the current user (highlighted). */
40
41
  isMe?: boolean;
41
- /** Click handler, called with the native click event. */
42
- onClick?: (event: MouseEvent) => void;
42
+ /** Click handler, called with the native click event; also runs, with no event, on Enter / Space. */
43
+ onClick?: (event?: MouseEvent) => void;
43
44
  /** Extra classes. */
44
45
  className?: string;
45
46
  /** The optional subtitle span (projected content lands here). */
@@ -53,12 +54,34 @@ export declare class LeaderboardRow implements AfterViewInit {
53
54
  * projected slot's content is in place by then.
54
55
  */
55
56
  ngAfterViewInit(): void;
57
+ /**
58
+ * Whether the row is interactive (`onClick` supplied): React renders the
59
+ * button role, tab stop and pointer cursor only then.
60
+ * @returns True when clickable.
61
+ */
62
+ interactive(): boolean;
63
+ /**
64
+ * The host element's `role` (a button only when clickable).
65
+ * @returns `'button'` or null for no attribute.
66
+ */
67
+ role(): string | null;
68
+ /**
69
+ * The host element's tab stop (only when clickable).
70
+ * @returns 0 or null for no attribute.
71
+ */
72
+ tabindex(): number | null;
56
73
  /**
57
74
  * Forwards a native click on the row to the `onClick` input (React calls
58
75
  * the handler with the event).
59
76
  * @param event - The native click event.
60
77
  */
61
78
  rowClick(event: MouseEvent): void;
79
+ /**
80
+ * Activates the row on Enter / Space (React's `handleKeyDown`):
81
+ * preventDefault, then the click handler with no event.
82
+ * @param event - The keydown.
83
+ */
84
+ handleKeyDown(event: KeyboardEvent): void;
62
85
  /**
63
86
  * The current class map.
64
87
  * @returns The UIClassMap.
@@ -130,15 +153,11 @@ export declare class LeaderboardRow implements AfterViewInit {
130
153
  */
131
154
  get hasDelta(): boolean;
132
155
  /**
133
- * The delta chip's class.
156
+ * The delta chip's class: the text size and weight, plus the semantic tone
157
+ * (React's `cm.textTone(rankDelta > 0 ? 'success' : 'error')`).
134
158
  * @returns The class string.
135
159
  */
136
160
  deltaClass(): string;
137
- /**
138
- * The delta arrow's color (React's hardcoded green/red hex).
139
- * @returns The CSS color.
140
- */
141
- deltaColor(): string;
142
161
  /**
143
162
  * The delta's arrow (React's `rankDelta > 0 ? '▲' : '▼'`).
144
163
  * @returns The arrow character.
@@ -1 +1 @@
1
- {"version":3,"file":"leaderboard-row.component.d.ts","sourceRoot":"","sources":["../src/leaderboard-row.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAiD,MAAM,eAAe,CAAA;AAEjG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;AAsBlD;;;;;;;;;;;;;;;;GAgBG;AACH,qBA4Ba,cAAe,YAAW,aAAa;IAClD,oBAAoB;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oDAAoD;IACpD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uDAAuD;IACvD,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kEAAkE;IAClE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,yDAAyD;IACzD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IACrC,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,iEAAiE;IACxC,OAAO,CAAC,UAAU,CAAC,CAA6B;IAEzE,mFAAmF;IACnF,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAe;IAEjD;;;;;OAKG;IACH,eAAe,IAAI,IAAI;IAOvB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAIjC;;;OAGG;IACH,EAAE,IAAI,UAAU;IAIhB;;;;OAIG;IACH,OAAO,IAAI,MAAM;IAUjB;;;OAGG;IACH,SAAS,IAAI,MAAM;IAInB;;;;OAIG;IACH,QAAQ,IAAI,MAAM;IAIlB;;;;OAIG;IACH,WAAW,IAAI,MAAM;IAIrB;;;OAGG;IACH,eAAe,IAAI,MAAM;IAIzB;;;OAGG;IACH,SAAS,IAAI,MAAM;IAInB;;;OAGG;IACH,aAAa,IAAI,MAAM;IAIvB;;;OAGG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED;;;;OAIG;IACH,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;;OAGG;IACH,UAAU,IAAI,MAAM;IAIpB;;;OAGG;IACH,UAAU,IAAI,MAAM;IAIpB;;;OAGG;IACH,UAAU,IAAI,MAAM;IAIpB;;;OAGG;IACH,SAAS,IAAI,MAAM;IAInB;;;OAGG;IACH,UAAU,IAAI,MAAM;yCAvMT,cAAc;2CAAd,cAAc;CA0M1B"}
1
+ {"version":3,"file":"leaderboard-row.component.d.ts","sourceRoot":"","sources":["../src/leaderboard-row.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAiD,MAAM,eAAe,CAAA;AAEjG,OAAO,KAAK,EA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eAAe,IAAI,MAAM;IAIzB;;;OAGG;IACH,SAAS,IAAI,MAAM;IAInB;;;OAGG;IACH,aAAa,IAAI,MAAM;IAIvB;;;OAGG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED;;;;OAIG;IACH,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;;;OAIG;IACH,UAAU,IAAI,MAAM;IAQpB;;;OAGG;IACH,UAAU,IAAI,MAAM;IAIpB;;;OAGG;IACH,SAAS,IAAI,MAAM;IAInB;;;OAGG;IACH,UAAU,IAAI,MAAM;yCA5OT,cAAc;2CAAd,cAAc;CA+O1B"}
@@ -46,7 +46,6 @@ function LeaderboardRow_Conditional_8_Template(rf, ctx) { if (rf & 1) {
46
46
  } if (rf & 2) {
47
47
  const ctx_r0 = i0.ɵɵnextContext();
48
48
  i0.ɵɵclassMap(ctx_r0.deltaClass());
49
- i0.ɵɵstyleProp("color", ctx_r0.deltaColor());
50
49
  i0.ɵɵadvance();
51
50
  i0.ɵɵtextInterpolate(ctx_r0.deltaArrow() + " " + ctx_r0.deltaText());
52
51
  } }
@@ -77,10 +76,11 @@ const MEDAL = { 1: '🥇', 2: '🥈', 3: '🥉' };
77
76
  * Leaderboard row — rank + avatar + name + score + optional rank-delta
78
77
  * arrow. Top 3 ranks render a medal in place of the numeric rank. The host IS
79
78
  * the row's root `<div>` (`div[mol-leaderboard-row]`), matching React's root
80
- * exactly; `onClick` is a native click on the host with no keyboard handler
81
- * or role — a documented gap of the React package the DOM must match. When
82
- * `name` is not a plain string the Avatar alt falls back to hardcoded
83
- * 'Player'. Same props, same DOM as
79
+ * exactly. With `onClick` the row is promoted to a real button in the a11y
80
+ * tree — `role="button"`, `tabindex="0"`, the pointer cursor — and Enter /
81
+ * Space activate it (the click handler runs with no event), matching native
82
+ * button keyboard semantics. When `name` is not a plain string the Avatar alt
83
+ * falls back to hardcoded 'Player'. Same props, same DOM as
84
84
  * `@molecule/app-leaderboard-row-react`'s `LeaderboardRow`. Node-valued
85
85
  * `name`, `score` and `subtitle` content is projected (`[slot=<name>]`); a
86
86
  * string or number input renders as text. The optional subtitle span renders
@@ -103,7 +103,7 @@ export class LeaderboardRow {
103
103
  subtitle;
104
104
  /** Whether this row represents the current user (highlighted). */
105
105
  isMe;
106
- /** Click handler, called with the native click event. */
106
+ /** Click handler, called with the native click event; also runs, with no event, on Enter / Space. */
107
107
  onClick;
108
108
  /** Extra classes. */
109
109
  className;
@@ -124,6 +124,28 @@ export class LeaderboardRow {
124
124
  this.subtitleProjected.set(false);
125
125
  }
126
126
  }
127
+ /**
128
+ * Whether the row is interactive (`onClick` supplied): React renders the
129
+ * button role, tab stop and pointer cursor only then.
130
+ * @returns True when clickable.
131
+ */
132
+ interactive() {
133
+ return typeof this.onClick === 'function';
134
+ }
135
+ /**
136
+ * The host element's `role` (a button only when clickable).
137
+ * @returns `'button'` or null for no attribute.
138
+ */
139
+ role() {
140
+ return this.interactive() ? 'button' : null;
141
+ }
142
+ /**
143
+ * The host element's tab stop (only when clickable).
144
+ * @returns 0 or null for no attribute.
145
+ */
146
+ tabindex() {
147
+ return this.interactive() ? 0 : null;
148
+ }
127
149
  /**
128
150
  * Forwards a native click on the row to the `onClick` input (React calls
129
151
  * the handler with the event).
@@ -132,6 +154,20 @@ export class LeaderboardRow {
132
154
  rowClick(event) {
133
155
  this.onClick?.(event);
134
156
  }
157
+ /**
158
+ * Activates the row on Enter / Space (React's `handleKeyDown`):
159
+ * preventDefault, then the click handler with no event.
160
+ * @param event - The keydown.
161
+ */
162
+ handleKeyDown(event) {
163
+ const onClick = this.onClick;
164
+ if (!onClick)
165
+ return;
166
+ if (event.key === 'Enter' || event.key === ' ') {
167
+ event.preventDefault();
168
+ onClick();
169
+ }
170
+ }
135
171
  /**
136
172
  * The current class map.
137
173
  * @returns The UIClassMap.
@@ -145,7 +181,7 @@ export class LeaderboardRow {
145
181
  * @returns The class string.
146
182
  */
147
183
  classes() {
148
- return this.cm().cn(this.cm().flex({ align: 'center', gap: 'sm' }), this.cm().sp('px', 3), this.cm().sp('py', 2), this.onClick ? this.cm().cursorPointer : undefined, this.className);
184
+ return this.cm().cn(this.cm().flex({ align: 'center', gap: 'sm' }), this.cm().sp('px', 3), this.cm().sp('py', 2), this.onClick ? this.cm().cursorPointer : undefined, this.isMe ? this.cm().bgTone('info', { subtle: true }) : undefined, this.className);
149
185
  }
150
186
  /**
151
187
  * The rank cell's class.
@@ -229,18 +265,12 @@ export class LeaderboardRow {
229
265
  return this.rankDelta !== undefined && this.rankDelta !== 0;
230
266
  }
231
267
  /**
232
- * The delta chip's class.
268
+ * The delta chip's class: the text size and weight, plus the semantic tone
269
+ * (React's `cm.textTone(rankDelta > 0 ? 'success' : 'error')`).
233
270
  * @returns The class string.
234
271
  */
235
272
  deltaClass() {
236
- return this.cm().cn(this.cm().textSize('xs'), this.cm().fontWeight('semibold'));
237
- }
238
- /**
239
- * The delta arrow's color (React's hardcoded green/red hex).
240
- * @returns The CSS color.
241
- */
242
- deltaColor() {
243
- return this.rankDelta > 0 ? '#22c55e' : '#ef4444';
273
+ return this.cm().cn(this.cm().textSize('xs'), this.cm().fontWeight('semibold'), this.cm().textTone(this.rankDelta > 0 ? 'success' : 'error'));
244
274
  }
245
275
  /**
246
276
  * The delta's arrow (React's `rankDelta > 0 ? '▲' : '▼'`).
@@ -270,11 +300,12 @@ export class LeaderboardRow {
270
300
  let _t;
271
301
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.subtitleEl = _t.first);
272
302
  } }, hostVars: 6, hostBindings: function LeaderboardRow_HostBindings(rf, ctx) { if (rf & 1) {
273
- i0.ɵɵlistener("click", function LeaderboardRow_click_HostBindingHandler($event) { return ctx.rowClick($event); });
303
+ i0.ɵɵlistener("click", function LeaderboardRow_click_HostBindingHandler($event) { return ctx.rowClick($event); })("keydown", function LeaderboardRow_keydown_HostBindingHandler($event) { return ctx.handleKeyDown($event); });
274
304
  } if (rf & 2) {
305
+ i0.ɵɵattribute("role", ctx.role())("tabindex", ctx.tabindex());
275
306
  i0.ɵɵclassMap(ctx.classes());
276
- i0.ɵɵstyleProp("background", ctx.isMe ? "rgba(96,165,250,0.1)" : "")("border-radius", ctx.isMe ? "8px" : "");
277
- } }, inputs: { rank: "rank", name: "name", avatarSrc: "avatarSrc", score: "score", rankDelta: "rankDelta", subtitle: "subtitle", isMe: "isMe", onClick: "onClick", className: "className" }, ngContentSelectors: _c2, decls: 12, vars: 17, consts: [["subtitleEl", ""], [2, "min-width", "32px"], ["mol-avatar", "", 3, "src", "alt", "name", "size"], [3, "class"], [3, "class", "color"]], template: function LeaderboardRow_Template(rf, ctx) { if (rf & 1) {
307
+ i0.ɵɵstyleProp("border-radius", ctx.isMe ? "8px" : "");
308
+ } }, inputs: { rank: "rank", name: "name", avatarSrc: "avatarSrc", score: "score", rankDelta: "rankDelta", subtitle: "subtitle", isMe: "isMe", onClick: "onClick", className: "className" }, ngContentSelectors: _c2, decls: 12, vars: 17, consts: [["subtitleEl", ""], [2, "min-width", "32px"], ["mol-avatar", "", 3, "src", "alt", "name", "size"], [3, "class"]], template: function LeaderboardRow_Template(rf, ctx) { if (rf & 1) {
278
309
  i0.ɵɵprojectionDef(_c1);
279
310
  i0.ɵɵelementStart(0, "span", 1);
280
311
  i0.ɵɵtext(1);
@@ -286,7 +317,7 @@ export class LeaderboardRow {
286
317
  i0.ɵɵelementEnd();
287
318
  i0.ɵɵconditionalCreate(7, LeaderboardRow_Conditional_7_Template, 4, 3, "span", 3);
288
319
  i0.ɵɵelementEnd();
289
- i0.ɵɵconditionalCreate(8, LeaderboardRow_Conditional_8_Template, 2, 5, "span", 4);
320
+ i0.ɵɵconditionalCreate(8, LeaderboardRow_Conditional_8_Template, 2, 3, "span", 3);
290
321
  i0.ɵɵelementStart(9, "span");
291
322
  i0.ɵɵconditionalCreate(10, LeaderboardRow_Conditional_10_Template, 2, 1, "ng-container");
292
323
  i0.ɵɵprojection(11, 1);
@@ -332,20 +363,22 @@ export class LeaderboardRow {
332
363
  ],
333
364
  host: {
334
365
  '[class]': 'classes()',
335
- '[style.background]': "isMe ? 'rgba(96,165,250,0.1)' : ''",
336
366
  '[style.borderRadius]': "isMe ? '8px' : ''",
367
+ '[attr.role]': 'role()',
368
+ '[attr.tabindex]': 'tabindex()',
337
369
  '(click)': 'rowClick($event)',
370
+ '(keydown)': 'handleKeyDown($event)',
338
371
  },
339
372
  // prettier-ignore
340
373
  template: `<span [class]="rankClass()" style="min-width: 32px">{{ rankText() }}</span>
341
374
  <div mol-avatar [src]="avatarSrc" [alt]="displayName()" [name]="displayName()" [size]="'sm'"></div>
342
375
  <div [class]="nameColumnClass()"><span [class]="nameClass()">@if (hasName) {<ng-container>{{ name }}</ng-container>}<ng-content select="[slot=name]" /></span>@if (showSubtitle) {<span #subtitleEl [class]="subtitleClass()">@if (hasSubtitle) {<ng-container>{{ subtitle }}</ng-container>}<ng-content select="[slot=subtitle]" /></span>}</div>
343
- @if (hasDelta) {<span [class]="deltaClass()" [style.color]="deltaColor()">{{ deltaArrow() + ' ' + deltaText() }}</span>}
376
+ @if (hasDelta) {<span [class]="deltaClass()">{{ deltaArrow() + ' ' + deltaText() }}</span>}
344
377
  <span [class]="scoreClass()">@if (hasScore) {<ng-container>{{ score }}</ng-container>}<ng-content select="[slot=score]" /></span>`,
345
378
  }]
346
379
  }], null, { subtitleEl: [{
347
380
  type: ViewChild,
348
381
  args: ['subtitleEl']
349
382
  }] }); })();
350
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LeaderboardRow, { className: "LeaderboardRow", filePath: "leaderboard-row.component.ts", lineNumber: 76 }); })();
383
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LeaderboardRow, { className: "LeaderboardRow", filePath: "leaderboard-row.component.ts", lineNumber: 79 }); })();
351
384
  //# sourceMappingURL=leaderboard-row.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"leaderboard-row.component.js","sourceRoot":"","sources":["../src/leaderboard-row.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAsB,SAAS,EAAmB,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAGjG,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;;;;;;IA6D+B,6BAAc;IAAA,YAAU;;;;IAAV,cAAU;IAAV,iCAAU;;;IAA6I,6BAAc;IAAA,YAAc;;;;IAAd,cAAc;IAAd,qCAAc;;;IAA3F,qCAA4C;IAAA,oGAAmB;IAA4C,qBAAuC;IAAA,iBAAO;;;IAAvI,qCAAyB;IAAC,eAA+D;IAA/D,6CAA+D;;;IAC7Q,4BAA0D;IAAA,YAAsC;IAAA,iBAAO;;;IAAjG,kCAAsB;IAAC,4CAA4B;IAAC,cAAsC;IAAtC,oEAAsC;;;IACnE,6BAAc;IAAA,YAAW;;;;IAAX,cAAW;IAAX,kCAAW;;AA7D1E;;;;;;;GAOG;AACH,MAAM,oBAAoB,GAAG,CAAC,EAAe,EAAW,EAAE,CACxD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,CAC5B,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY;IACnC,CAAC,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CACnF,CAAA;AAEH,uEAAuE;AACvE,MAAM,KAAK,GAA2B,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EA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@@ export interface LeaderboardRowProps {
23
23
  subtitle?: unknown;
24
24
  /** Whether this row represents the current user (highlighted). */
25
25
  isMe?: boolean;
26
- /** Click handler (a native click on the row, with the DOM event). */
27
- onClick?: (event: MouseEvent) => void;
26
+ /** Click handler (a native click on the row, with the DOM event; also runs, with no event, on Enter / Space). */
27
+ onClick?: (event?: MouseEvent) => void;
28
28
  /** Extra classes. */
29
29
  className?: string;
30
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,oDAAoD;IACpD,IAAI,EAAE,OAAO,CAAA;IACb,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uDAAuD;IACvD,KAAK,EAAE,OAAO,CAAA;IACd,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kEAAkE;IAClE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,qEAAqE;IACrE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IACrC,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,oDAAoD;IACpD,IAAI,EAAE,OAAO,CAAA;IACb,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uDAAuD;IACvD,KAAK,EAAE,OAAO,CAAA;IACd,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kEAAkE;IAClE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,iHAAiH;IACjH,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,CAAA;IACtC,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-leaderboard-row-angular",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Leaderboard row — rank, avatar, name, score, optional change indicator",
5
5
  "homepage": "https://www.molecule.dev/packages/app-leaderboard-row-angular",
6
6
  "type": "module",