@molecule/app-list-item-row-svelte 1.1.0 → 1.1.1

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-15T07:09:48.962Z
6
+ Generated: 2026-11-17T04:21:40.230Z
7
7
  -->
8
8
 
9
9
  # @molecule/app-list-item-row-svelte
@@ -75,9 +75,13 @@ interface ListItemRowProps {
75
75
  leading?: Snippet | string | number
76
76
  /** Optional right-side actions (buttons, action menu). A snippet renders inline. */
77
77
  actions?: Snippet | string | number
78
- /** Called when the row body is clicked. */
78
+ /**
79
+ * Called when the row is activated. The whole row is clickable through a
80
+ * transparent native button over it, named by the title; the inner controls
81
+ * (the `actions` slot) sit above it and keep their own clicks.
82
+ */
79
83
  onClick?: () => void
80
- /** When true, sets `aria-selected` on the row — no built-in visual highlight; style it via `className` or host CSS. */
84
+ /** When true, sets `aria-current="true"` on the row — no built-in visual highlight; style it via `className` or host CSS. */
81
85
  selected?: boolean
82
86
  /** When true, renders in a disabled visual state. */
83
87
  disabled?: boolean
@@ -114,13 +118,16 @@ Peer dependencies:
114
118
  - `@molecule/app-ui-svelte`
115
119
  - `svelte`
116
120
 
117
- - `selected` only sets the `aria-selected` attribute — no built-in highlight.
118
- Pass a highlight class via `className` (or target `[aria-selected="true"]` in
119
- host CSS) to make selection visible.
120
- - Clicks inside `actions` are stopPropagation'd automatically, so action buttons
121
- never trigger the row `onClick`.
122
- - `disabled` halves the opacity and disables `onClick`; there is no
123
- `data-mol-id` prop.
121
+ - `selected` only sets the `aria-current="true"` attribute — no built-in
122
+ highlight. Pass a highlight class via `className` (or target
123
+ `[aria-current="true"]` in host CSS) to make selection visible.
124
+ - With `onClick` the whole row is clickable through a transparent native
125
+ button over it, named by the title (`aria-labelledby`); Enter / Space on
126
+ that button run the same handler a click anywhere on the row runs, and the
127
+ inner controls (the `actions` slot) sit above the button and keep their
128
+ own clicks.
129
+ - `disabled` halves the opacity and disables the open button (no pointer
130
+ cursor, no activation); there is no `data-mol-id` prop.
124
131
  - Styling resolves through `getClassMap()` — wire a ClassMap bond first.
125
132
  - Node-valued props (`title`, `leading`, `actions`, …) take a snippet or a
126
133
  plain value — both render inline.
@@ -2,11 +2,9 @@
2
2
  ListItemRow: the Svelte counterpart of `@molecule/app-list-item-row-react`'s
3
3
  `ListItemRow` — generic "thumbnail + text + actions" row: leading slot, up to
4
4
  three text lines (title / subtitle / metadata), right-side actions. Same
5
- props (React names), same DOM for the same input.
6
-
7
- The `svelte-ignore` pairs below mark the trade-off React's package documents:
8
- with `onClick` the row is a clickable div WITHOUT button semantics — wrap it
9
- in your own button/link (or add key handling) where keyboard access matters.
5
+ props (React names), same DOM for the same input. With `onClick` the whole
6
+ row is clickable through a transparent native button over it, named by the
7
+ title, and the `actions` slot sits above it and keeps its own clicks.
10
8
  -->
11
9
  <script lang="ts">
12
10
  import { getClassMap } from '@molecule/app-ui'
@@ -27,33 +25,51 @@
27
25
  }: ListItemRowProps = $props()
28
26
 
29
27
  const cm = $derived(getClassMap())
30
- const clickable = $derived(Boolean(onClick) && !disabled)
28
+ const nameId = $props.id()
31
29
  const padY = $derived(density === 'compact' ? 2 : 3)
32
30
  </script>
33
31
 
34
- <!-- svelte-ignore a11y_no_noninteractive_tabindex, a11y_click_events_have_key_events, a11y_no_static_element_interactions -->
35
32
  <div
36
- role={onClick ? 'button' : undefined}
37
- tabindex={clickable ? 0 : undefined}
38
- aria-selected={selected}
33
+ aria-current={selected ? 'true' : undefined}
39
34
  aria-disabled={disabled}
40
- onclick={disabled ? undefined : onClick}
41
35
  class={cm.cn(
42
36
  cm.flex({ align: 'center', gap: 'sm' }),
43
37
  cm.sp('px', 3),
44
38
  cm.sp('py', padY),
45
- clickable ? cm.cursorPointer : undefined,
39
+ onClick ? cm.position('relative') : undefined,
46
40
  className,
47
41
  )}
48
42
  style:opacity={disabled ? 0.5 : undefined}
49
43
  >
44
+ {#if onClick}
45
+ <!-- mol-bespoke-button: the whole row is the hit area, not a CTA — an
46
+ empty, transparent button over the row; the inline background/border/
47
+ padding are native resets. React writes the shorthand `border: 'none'`
48
+ and `padding: 0`, which the CSSOM serializes as `border: medium` and
49
+ `0px` — Svelte writes the style attribute directly, so the port writes
50
+ that same serialized form (identical computed style). -->
51
+ <button
52
+ type="button"
53
+ aria-labelledby={nameId}
54
+ data-mol-id="list-item-row-open"
55
+ {disabled}
56
+ onclick={() => {
57
+ if (!disabled) onClick?.()
58
+ }}
59
+ class={cm.cn(cm.position('absolute'), cm.inset0, disabled ? undefined : cm.cursorPointer)}
60
+ style="background: transparent; border: medium; padding: 0px"
61
+ ></button>
62
+ {/if}
50
63
  {#if leading}
51
64
  <div class={cm.shrink0}>
52
65
  {#if typeof leading === 'function'}{@render leading()}{:else}{leading}{/if}
53
66
  </div>
54
67
  {/if}
55
68
  <div class={cm.cn(cm.flex1, cm.stack(0))}>
56
- <div class={cm.cn(cm.textSize('sm'), cm.fontWeight('semibold'))}>
69
+ <div
70
+ id={onClick ? nameId : undefined}
71
+ class={cm.cn(cm.textSize('sm'), cm.fontWeight('semibold'))}
72
+ >
57
73
  {#if typeof title === 'function'}{@render title()}{:else}{title}{/if}
58
74
  </div>
59
75
  {#if subtitle}
@@ -68,8 +84,7 @@
68
84
  {/if}
69
85
  </div>
70
86
  {#if actions}
71
- <!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_static_element_interactions -->
72
- <div class={cm.shrink0} onclick={(event) => event.stopPropagation()}>
87
+ <div class={cm.cn(cm.shrink0, cm.position('relative'))}>
73
88
  {#if typeof actions === 'function'}{@render actions()}{:else}{actions}{/if}
74
89
  </div>
75
90
  {/if}
@@ -1 +1 @@
1
- {"version":3,"file":"ListItemRow.svelte.d.ts","sourceRoot":"","sources":["../src/ListItemRow.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAgEnD,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"ListItemRow.svelte.d.ts","sourceRoot":"","sources":["../src/ListItemRow.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAoEnD,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
package/dist/index.d.ts CHANGED
@@ -32,13 +32,16 @@
32
32
  * ```
33
33
  *
34
34
  * @remarks
35
- * - `selected` only sets the `aria-selected` attribute — no built-in highlight.
36
- * Pass a highlight class via `className` (or target `[aria-selected="true"]` in
37
- * host CSS) to make selection visible.
38
- * - Clicks inside `actions` are stopPropagation'd automatically, so action buttons
39
- * never trigger the row `onClick`.
40
- * - `disabled` halves the opacity and disables `onClick`; there is no
41
- * `data-mol-id` prop.
35
+ * - `selected` only sets the `aria-current="true"` attribute — no built-in
36
+ * highlight. Pass a highlight class via `className` (or target
37
+ * `[aria-current="true"]` in host CSS) to make selection visible.
38
+ * - With `onClick` the whole row is clickable through a transparent native
39
+ * button over it, named by the title (`aria-labelledby`); Enter / Space on
40
+ * that button run the same handler a click anywhere on the row runs, and the
41
+ * inner controls (the `actions` slot) sit above the button and keep their
42
+ * own clicks.
43
+ * - `disabled` halves the opacity and disables the open button (no pointer
44
+ * cursor, no activation); there is no `data-mol-id` prop.
42
45
  * - Styling resolves through `getClassMap()` — wire a ClassMap bond first.
43
46
  * - Node-valued props (`title`, `leading`, `actions`, …) take a snippet or a
44
47
  * plain value — both render inline.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA"}
package/dist/index.js CHANGED
@@ -32,13 +32,16 @@
32
32
  * ```
33
33
  *
34
34
  * @remarks
35
- * - `selected` only sets the `aria-selected` attribute — no built-in highlight.
36
- * Pass a highlight class via `className` (or target `[aria-selected="true"]` in
37
- * host CSS) to make selection visible.
38
- * - Clicks inside `actions` are stopPropagation'd automatically, so action buttons
39
- * never trigger the row `onClick`.
40
- * - `disabled` halves the opacity and disables `onClick`; there is no
41
- * `data-mol-id` prop.
35
+ * - `selected` only sets the `aria-current="true"` attribute — no built-in
36
+ * highlight. Pass a highlight class via `className` (or target
37
+ * `[aria-current="true"]` in host CSS) to make selection visible.
38
+ * - With `onClick` the whole row is clickable through a transparent native
39
+ * button over it, named by the title (`aria-labelledby`); Enter / Space on
40
+ * that button run the same handler a click anywhere on the row runs, and the
41
+ * inner controls (the `actions` slot) sit above the button and keep their
42
+ * own clicks.
43
+ * - `disabled` halves the opacity and disables the open button (no pointer
44
+ * cursor, no activation); there is no `data-mol-id` prop.
42
45
  * - Styling resolves through `getClassMap()` — wire a ClassMap bond first.
43
46
  * - Node-valued props (`title`, `leading`, `actions`, …) take a snippet or a
44
47
  * plain value — both render inline.
package/dist/types.d.ts CHANGED
@@ -16,9 +16,13 @@ export interface ListItemRowProps {
16
16
  leading?: Snippet | string | number;
17
17
  /** Optional right-side actions (buttons, action menu). A snippet renders inline. */
18
18
  actions?: Snippet | string | number;
19
- /** Called when the row body is clicked. */
19
+ /**
20
+ * Called when the row is activated. The whole row is clickable through a
21
+ * transparent native button over it, named by the title; the inner controls
22
+ * (the `actions` slot) sit above it and keep their own clicks.
23
+ */
20
24
  onClick?: () => void;
21
- /** When true, sets `aria-selected` on the row — no built-in visual highlight; style it via `className` or host CSS. */
25
+ /** When true, sets `aria-current="true"` on the row — no built-in visual highlight; style it via `className` or host CSS. */
22
26
  selected?: boolean;
23
27
  /** When true, renders in a disabled visual state. */
24
28
  disabled?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAErC,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;IAChC,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;IACpC,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;IACpC,uFAAuF;IACvF,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;IACnC,oFAAoF;IACpF,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;IACnC,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,uHAAuH;IACvH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iEAAiE;IACjE,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,CAAA;IACnC,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,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAErC,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;IAChC,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;IACpC,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;IACpC,uFAAuF;IACvF,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;IACnC,oFAAoF;IACpF,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,6HAA6H;IAC7H,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iEAAiE;IACjE,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,CAAA;IACnC,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-list-item-row-svelte",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Thumbnail + title + subtitle + metadata + actions row (nav lists, mobile menus)",
5
5
  "homepage": "https://www.molecule.dev/packages/app-list-item-row-svelte",
6
6
  "type": "module",
@@ -59,7 +59,7 @@
59
59
  "@molecule/app-icons": "1.0.4",
60
60
  "@molecule/app-svelte": "3.7.1",
61
61
  "@molecule/app-ui": "1.4.0",
62
- "@molecule/app-ui-svelte": "1.1.5",
62
+ "@molecule/app-ui-svelte": "1.1.6",
63
63
  "@sveltejs/package": "3.0.2",
64
64
  "@sveltejs/vite-plugin-svelte": "7.1.2",
65
65
  "@types/node": "26.6.5",