@molecule/app-list-item-row-react 1.0.0 → 1.0.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 +137 -0
- package/package.json +14 -8
package/README.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
3
|
+
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
|
+
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
|
+
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
+
Generated: 2026-08-04T01:51:15.164Z
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# @molecule/app-list-item-row-react
|
|
10
|
+
|
|
11
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
12
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
13
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
14
|
+
|
|
15
|
+
Generic list-item row.
|
|
16
|
+
|
|
17
|
+
Exports `<ListItemRow>` — leading slot (icon/avatar/thumbnail) + up to three
|
|
18
|
+
text lines (title / subtitle / metadata) + right-side actions. Props: `title`,
|
|
19
|
+
`subtitle?`, `metadata?`, `leading?`, `actions?`, `onClick?`, `selected?`,
|
|
20
|
+
`disabled?`, `density?` (`'comfortable'` default | `'compact'`), `className?`.
|
|
21
|
+
Use for nav lists, mobile menus, search results, picker dialogs, inbox threads.
|
|
22
|
+
For table rows use `<RowWithActions>` from `@molecule/app-data-table-ui-react`
|
|
23
|
+
instead — this component is not a `<tr>`.
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { ListItemRow } from '@molecule/app-list-item-row-react'
|
|
29
|
+
|
|
30
|
+
;<ListItemRow
|
|
31
|
+
title="Project Alpha"
|
|
32
|
+
subtitle="Last edited 2 hours ago"
|
|
33
|
+
metadata="3 collaborators · 12 files"
|
|
34
|
+
leading={<img src="/icons/folder.svg" alt="" width={32} height={32} />}
|
|
35
|
+
actions={<button onClick={() => openMenu('alpha')}>Menu</button>}
|
|
36
|
+
onClick={() => navigate('/projects/alpha')}
|
|
37
|
+
/>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Type
|
|
41
|
+
|
|
42
|
+
`feature`
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm install @molecule/app-list-item-row-react @molecule/app-react @molecule/app-ui @molecule/app-ui-react react
|
|
48
|
+
npm install -D @types/react
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## API
|
|
52
|
+
|
|
53
|
+
### Interfaces
|
|
54
|
+
|
|
55
|
+
#### `ListItemRowProps`
|
|
56
|
+
|
|
57
|
+
Props for {@link ListItemRow}.
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
interface ListItemRowProps {
|
|
61
|
+
/** Title — first line. */
|
|
62
|
+
title: ReactNode
|
|
63
|
+
/** Optional second line (excerpt, description). */
|
|
64
|
+
subtitle?: ReactNode
|
|
65
|
+
/** Optional third line (metadata — timestamps, counts, tags). */
|
|
66
|
+
metadata?: ReactNode
|
|
67
|
+
/** Optional leading slot — icon, avatar, thumbnail image. */
|
|
68
|
+
leading?: ReactNode
|
|
69
|
+
/** Optional right-side actions (buttons, action menu). */
|
|
70
|
+
actions?: ReactNode
|
|
71
|
+
/** Called when the row body is clicked. */
|
|
72
|
+
onClick?: () => void
|
|
73
|
+
/** When true, sets `aria-selected` on the row — no built-in visual highlight; style it via `className` or host CSS. */
|
|
74
|
+
selected?: boolean
|
|
75
|
+
/** When true, renders in a disabled visual state. */
|
|
76
|
+
disabled?: boolean
|
|
77
|
+
/** Dense vs comfortable spacing. Defaults to `'comfortable'`. */
|
|
78
|
+
density?: 'comfortable' | 'compact'
|
|
79
|
+
/** Extra classes. */
|
|
80
|
+
className?: string
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Functions
|
|
85
|
+
|
|
86
|
+
#### `ListItemRow(props)`
|
|
87
|
+
|
|
88
|
+
Generic "thumbnail + text + actions" row — used everywhere:
|
|
89
|
+
navigation lists, mobile menus, inbox-style threads, search
|
|
90
|
+
results, picker dialogs, bookmark lists, etc.
|
|
91
|
+
|
|
92
|
+
Different from `<RowWithActions>` in `@molecule/app-data-table-ui-react`
|
|
93
|
+
in NOT being a `<tr>` — use this for non-table lists.
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
function ListItemRow({
|
|
97
|
+
title,
|
|
98
|
+
subtitle,
|
|
99
|
+
metadata,
|
|
100
|
+
leading,
|
|
101
|
+
actions,
|
|
102
|
+
onClick,
|
|
103
|
+
selected,
|
|
104
|
+
disabled,
|
|
105
|
+
density = 'comfortable',
|
|
106
|
+
className,
|
|
107
|
+
}: ListItemRowProps): JSX.Element
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
- `props` — Component props (see {@link ListItemRowProps}).
|
|
111
|
+
|
|
112
|
+
## Injection Notes
|
|
113
|
+
|
|
114
|
+
### Requirements
|
|
115
|
+
|
|
116
|
+
Peer dependencies:
|
|
117
|
+
|
|
118
|
+
- `@molecule/app-react` ^1.0.1
|
|
119
|
+
- `@molecule/app-ui` ^1.0.1
|
|
120
|
+
- `@molecule/app-ui-react` ^1.0.1
|
|
121
|
+
- `react` ^18.0.0 || ^19.0.0
|
|
122
|
+
|
|
123
|
+
### Runtime Dependencies
|
|
124
|
+
|
|
125
|
+
- `@molecule/app-react`
|
|
126
|
+
- `@molecule/app-ui`
|
|
127
|
+
- `@molecule/app-ui-react`
|
|
128
|
+
- `react`
|
|
129
|
+
|
|
130
|
+
- `selected` only sets the `aria-selected` attribute — no built-in highlight.
|
|
131
|
+
Pass a highlight class via `className` (or target `[aria-selected="true"]` in
|
|
132
|
+
host CSS) to make selection visible.
|
|
133
|
+
- Clicks inside `actions` are stopPropagation'd automatically, so action buttons
|
|
134
|
+
never trigger the row `onClick`.
|
|
135
|
+
- `disabled` halves the opacity and disables `onClick`; there is no
|
|
136
|
+
`data-mol-id` prop.
|
|
137
|
+
- Styling resolves through `getClassMap()` — wire a ClassMap bond first.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-list-item-row-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Thumbnail + title + subtitle + metadata + actions row (nav lists, mobile menus)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
|
-
"dist"
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
21
22
|
],
|
|
22
23
|
"keywords": [
|
|
23
24
|
"molecule",
|
|
@@ -25,16 +26,21 @@
|
|
|
25
26
|
"react"
|
|
26
27
|
],
|
|
27
28
|
"license": "Apache-2.0",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/molecule-dev/molecule.git",
|
|
32
|
+
"directory": "packages/app/features/list-item-row-react"
|
|
33
|
+
},
|
|
28
34
|
"peerDependencies": {
|
|
29
|
-
"@molecule/app-react": "^1.0.
|
|
30
|
-
"@molecule/app-ui": "^1.0.
|
|
31
|
-
"@molecule/app-ui-react": "^1.0.
|
|
35
|
+
"@molecule/app-react": "^1.0.1",
|
|
36
|
+
"@molecule/app-ui": "^1.0.1",
|
|
37
|
+
"@molecule/app-ui-react": "^1.0.1",
|
|
32
38
|
"react": "^18.0.0 || ^19.0.0"
|
|
33
39
|
},
|
|
34
40
|
"devDependencies": {
|
|
35
|
-
"@molecule/app-react": "1.0.
|
|
36
|
-
"@molecule/app-ui": "1.0.
|
|
37
|
-
"@molecule/app-ui-react": "1.0.
|
|
41
|
+
"@molecule/app-react": "1.0.1",
|
|
42
|
+
"@molecule/app-ui": "1.0.1",
|
|
43
|
+
"@molecule/app-ui-react": "1.0.1",
|
|
38
44
|
"@types/node": "26.1.2",
|
|
39
45
|
"@types/react": "19.2.17",
|
|
40
46
|
"@types/react-dom": "19.2.3",
|