@@ -28,11 +28,13 @@ import {
2828 * Abstract base class for all card-family components. Owns the semantics
2929 * shared across every card type: sizing, visual variant, and density.
3030 *
31- * `swc-card`, `swc-asset-card`, `swc-user-card`, and `swc-product-card` each
32- * extend this base directly and render the shared anatomy via
33- * `renderCardTemplate()` in `swc/components/card/card-template.ts`. That
34- * template also carries a collection placeholder and an avatar/thumbnail
35- * glyph, each supplied per-component via `renderCollection`/`renderGlyph`.
31+ * `swc-card`, `swc-user-card`, and `swc-product-card` each extend this base
32+ * directly and render the shared anatomy via `renderCardTemplate()` in
33+ * `swc/components/card/card-template.ts`. That template also carries a
34+ * collection placeholder and an avatar/thumbnail glyph, each supplied
35+ * per-component via `renderCollection`/`renderGlyph`.
36+ *
37+ * @attribute {ElementSize} size - The size of the card.
3638 *
3739 * @slot preview - Primary preview content
3840 * @slot title - Card title
@@ -226,7 +228,13 @@ export abstract class CardBase extends SizedMixin(SpectrumElement, {
226228 return node instanceof HTMLElement && node . tabIndex >= 0 ;
227229 }
228230
229- private readonly handleSurfaceClick = ( event : Event ) : void => {
231+ /**
232+ * Proxies a qualifying surface click to `titleAsLink`'s link and/or
233+ * dispatches `swc-card-click` for `selectable`, after filtering out
234+ * clicks that landed on a nested interactive target (see `isFocusable()`
235+ * and the `actions`-slot exclusion above).
236+ */
237+ protected readonly handleSurfaceClick = ( event : Event ) : void => {
230238 if ( ! this . titleAsLink && ! this . selectable ) {
231239 return ;
232240 }
@@ -262,7 +270,7 @@ export abstract class CardBase extends SizedMixin(SpectrumElement, {
262270 * `selectable` makes the card itself the focused target, regardless of
263271 * what that activation happens to proxy to.
264272 */
265- private readonly handleSelectableKeydown = ( event : KeyboardEvent ) : void => {
273+ protected readonly handleSelectableKeydown = ( event : KeyboardEvent ) : void => {
266274 if ( event . code === 'Enter' || event . code === 'Space' ) {
267275 event . preventDefault ( ) ;
268276 this . handleSurfaceClick ( event ) ;
0 commit comments