@molecule/app-timeline-solid 0.0.1-stage → 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.
Files changed (2) hide show
  1. package/README.md +251 -4
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -1,11 +1,258 @@
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-11-28T22:55:48.671Z
7
+ -->
8
+
1
9
  # @molecule/app-timeline-solid
2
10
 
3
- Solid chronological timeline with event rails and date markers
11
+ Solid chronological timeline primitives.
12
+
13
+ Exports:
14
+
15
+ - `<Timeline>` — vertical list of events with optional date separators.
16
+ - `<TimelineEvent>` — one event row with rail (marker + connector) + content.
17
+ - `<TimelineRail>` — standalone rail (marker + connector) for custom rows.
18
+ - `<TimelineDate>` — date separator rendered between groups.
19
+ - `TimelineEventData` type for event records.
20
+
21
+ Use for activity chronologies, deal timelines, order tracking, audit logs.
22
+ It is the Solid counterpart of `@molecule/app-timeline-react`: the same props
23
+ (React names) and the same DOM for the same input, so switching framework is
24
+ changing the package name in the imports.
25
+
26
+ > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
27
+ > It is written to be read by coding agents as much as by people, and is generated from this
28
+ > package's source — edit `src/index.ts` JSDoc, not this file.
29
+
30
+ ## Quick Start
31
+
32
+ ```tsx
33
+ import { Timeline, TimelineDate } from '@molecule/app-timeline-solid'
34
+
35
+ export function Activity() {
36
+ const events = [
37
+ { id: '1', timestamp: '2 hours ago', title: 'Order placed' },
38
+ { id: '2', timestamp: 'Yesterday', title: 'Payment confirmed', body: 'Visa ending 4242' },
39
+ { id: '3', timestamp: 'Mar 12', title: 'Item shipped' },
40
+ ]
41
+ return (
42
+ <Timeline
43
+ events={events}
44
+ renderDateSeparator={(event, prev) =>
45
+ prev ? undefined : <TimelineDate>{event.timestamp}</TimelineDate>
46
+ }
47
+ emptyState={<p>No activity yet.</p>}
48
+ />
49
+ )
50
+ }
51
+ ```
52
+
53
+ ## Type
54
+
55
+ `feature`
56
+
57
+ ## Installation
4
58
 
59
+ ```bash
60
+ npm install @molecule/app-timeline-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js
5
61
  ```
6
- npm install @molecule/app-timeline-solid
62
+
63
+ ## API
64
+
65
+ ### Interfaces
66
+
67
+ #### `TimelineEventData`
68
+
69
+ One entry of a `<Timeline>`.
70
+
71
+ ```typescript
72
+ interface TimelineEventData {
73
+ /** Stable identifier for this event (the row is keyed by it). */
74
+ id: string
75
+ /** Marker icon / dot — defaults to a small dot. */
76
+ marker?: JSX.Element
77
+ /** Display timestamp (ISO, relative, etc.). */
78
+ timestamp: JSX.Element
79
+ /** Headline of the event. */
80
+ title: JSX.Element
81
+ /** Optional body content. */
82
+ body?: JSX.Element
83
+ /**
84
+ * Optional accent color hint. Currently INERT — no component consumes it,
85
+ * so setting it changes nothing; pass a custom `marker` node to color a row.
86
+ */
87
+ accent?: 'primary' | 'success' | 'warning' | 'error' | 'info' | 'neutral'
88
+ }
7
89
  ```
8
90
 
9
- Part of the [Molecule](https://www.molecule.dev) package fleet. This page carries the manifest summary; the full generated documentation ships with the package's first committed version.
91
+ #### `TimelineProps`
92
+
93
+ Props accepted by the {@link Timeline} component.
94
+
95
+ ```typescript
96
+ interface TimelineProps {
97
+ /** Events in display order. */
98
+ events: TimelineEventData[]
99
+ /** Optional renderer for date separators between consecutive events. */
100
+ renderDateSeparator?: (event: TimelineEventData, prev?: TimelineEventData) => JSX.Element
101
+ /** Rendered when there are no events. */
102
+ emptyState?: JSX.Element
103
+ /** Extra classes on the outer wrapper. */
104
+ className?: string
105
+ }
106
+ ```
107
+
108
+ #### `TimelineEventProps`
109
+
110
+ Props accepted by the {@link TimelineEvent} component.
111
+
112
+ ```typescript
113
+ interface TimelineEventProps {
114
+ /** The event to render. */
115
+ event: TimelineEventData
116
+ /** Whether this is the last event in the list (suppresses the connector). */
117
+ isLast?: boolean
118
+ /** Extra classes. */
119
+ className?: string
120
+ }
121
+ ```
122
+
123
+ #### `TimelineRailProps`
124
+
125
+ Props accepted by the {@link TimelineRail} component.
126
+
127
+ ```typescript
128
+ interface TimelineRailProps {
129
+ /** Marker for this row — typically a dot or icon. */
130
+ marker?: JSX.Element
131
+ /** Whether to render the vertical connector below the marker. Defaults to `true`. */
132
+ connector?: boolean
133
+ /** Extra classes on the outer wrapper. */
134
+ className?: string
135
+ }
136
+ ```
137
+
138
+ #### `TimelineDateProps`
139
+
140
+ Props accepted by the {@link TimelineDate} component.
141
+
142
+ ```typescript
143
+ interface TimelineDateProps {
144
+ /** Date label ("Today", "Yesterday", "March 12, 2025"). */
145
+ children: JSX.Element
146
+ /** Extra classes. */
147
+ className?: string
148
+ }
149
+ ```
150
+
151
+ ### Functions
152
+
153
+ #### `Timeline(props)`
154
+
155
+ Vertical chronological list of events. Each event renders with a
156
+ marker + connector on the left (`<TimelineEvent>`). Optional date separators
157
+ can be inserted by returning a node from `renderDateSeparator`.
158
+
159
+ React keys each row by the event's `id` value, so a re-passed or re-ordered
160
+ array keeps (and on a reorder, moves) the rendered rows. Solid's `For` keys
161
+ by reference, so the rows are keyed through stable per-id records: the record
162
+ for an id is created once and reused, while the row's content reads the
163
+ CURRENT event for that id reactively (a changed title updates in place).
164
+
165
+ This is the Solid counterpart of `@molecule/app-timeline-react`'s `Timeline`:
166
+ the same props (React names), the same ClassMap tokens, and the same DOM for
167
+ the same input.
168
+
169
+ ```typescript
170
+ function Timeline(props: TimelineProps): JSX.Element
171
+ ```
172
+
173
+ - `props` — Component props (see {@link TimelineProps}).
174
+
175
+ **Returns:** The rendered timeline.
176
+
177
+ #### `TimelineDate(props)`
178
+
179
+ Date separator rendered between timeline groups.
180
+
181
+ This is the Solid counterpart of `@molecule/app-timeline-react`'s
182
+ `TimelineDate`: the same props (React names), the same ClassMap tokens, and
183
+ the same DOM for the same input.
184
+
185
+ ```typescript
186
+ function TimelineDate(props: TimelineDateProps): JSX.Element
187
+ ```
188
+
189
+ - `props` — Component props (see {@link TimelineDateProps}).
190
+
191
+ **Returns:** The rendered date separator.
192
+
193
+ #### `TimelineEvent(props)`
194
+
195
+ One row of a `<Timeline>`: [rail (marker + connector)] [timestamp / title /
196
+ body].
197
+
198
+ This is the Solid counterpart of `@molecule/app-timeline-react`'s
199
+ `TimelineEvent`: the same props (React names), the same ClassMap tokens, and
200
+ the same DOM for the same input.
201
+
202
+ ```typescript
203
+ function TimelineEvent(props: TimelineEventProps): JSX.Element
204
+ ```
205
+
206
+ - `props` — Component props (see {@link TimelineEventProps}).
207
+
208
+ **Returns:** The rendered event row.
209
+
210
+ #### `TimelineRail(props)`
211
+
212
+ Left-hand rail of a timeline row — renders the marker and an optional
213
+ vertical connector extending downward.
214
+
215
+ This is the Solid counterpart of `@molecule/app-timeline-react`'s
216
+ `TimelineRail`: the same props (React names), the same ClassMap tokens, and
217
+ the same DOM for the same input (including the connector's inline style).
218
+
219
+ ```typescript
220
+ function TimelineRail(props: TimelineRailProps): JSX.Element
221
+ ```
222
+
223
+ - `props` — Component props (see {@link TimelineRailProps}).
224
+
225
+ **Returns:** The rendered rail.
226
+
227
+ ## Injection Notes
228
+
229
+ ### Requirements
230
+
231
+ Peer dependencies:
232
+
233
+ - `@molecule/app-solid` ^3.5.0 || ^4.0.0
234
+ - `@molecule/app-ui` ^1.0.1
235
+ - `@molecule/app-ui-solid` ^1.1.0
236
+ - `solid-js` ^1.8.0
237
+
238
+ ### Runtime Dependencies
239
+
240
+ - `@molecule/app-solid`
241
+ - `@molecule/app-ui`
242
+ - `@molecule/app-ui-solid`
243
+ - `solid-js`
244
+
245
+ This is NOT the Solid binding for `@molecule/app-timeline` (the headless
246
+ provider core wired via `setProvider`) — it is standalone presentational
247
+ markup with no provider. For domain-specific rows see the sibling
248
+ `@molecule/app-{activity,order,status,stage,day}-timeline-solid` packages.
10
249
 
11
- License: Apache-2.0
250
+ `TimelineEventData.accent` is currently INERT — no component reads it, so
251
+ setting it changes nothing; color a row by passing a custom `marker` node
252
+ instead. `timestamp` is a display node — format/translate it before
253
+ passing. `Timeline` keys each row by the event's `id` value, like React. The
254
+ prop surface (documented on the exported `TimelineProps`,
255
+ `TimelineEventProps`, `TimelineRailProps` and `TimelineDateProps`
256
+ interfaces): Timeline(events, renderDateSeparator, emptyState, className),
257
+ TimelineEvent(event, isLast, className), TimelineRail(marker, connector,
258
+ className), TimelineDate(children, className).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-timeline-solid",
3
- "version": "0.0.1-stage",
3
+ "version": "1.1.1",
4
4
  "description": "Solid chronological timeline with event rails and date markers",
5
5
  "homepage": "https://www.molecule.dev/packages/app-timeline-solid",
6
6
  "type": "module",
@@ -42,20 +42,20 @@
42
42
  "access": "public"
43
43
  },
44
44
  "peerDependencies": {
45
- "@molecule/app-solid": "^3.5.0",
45
+ "@molecule/app-solid": "^3.5.0 || ^4.0.0",
46
46
  "@molecule/app-ui": "^1.0.1",
47
47
  "@molecule/app-ui-solid": "^1.1.0",
48
48
  "solid-js": "^1.8.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@molecule/app-framework-conformance": "0.0.0",
52
- "@molecule/app-i18n": "1.2.2",
52
+ "@molecule/app-i18n": "1.4.0",
53
53
  "@molecule/app-icons": "1.0.4",
54
- "@molecule/app-solid": "3.7.2",
55
- "@molecule/app-ui": "1.4.0",
56
- "@molecule/app-ui-solid": "1.1.5",
54
+ "@molecule/app-solid": "4.0.0",
55
+ "@molecule/app-ui": "1.17.0",
56
+ "@molecule/app-ui-solid": "1.12.2",
57
57
  "@types/node": "26.6.5",
58
- "jsdom": "30.1.3",
58
+ "jsdom": "31.0.1",
59
59
  "solid-js": "1.9.17",
60
60
  "typescript": "6.0.3",
61
61
  "vite-plugin-solid": "2.11.15",