@molecule/app-timeline-vue 0.0.1-stage → 1.1.0

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 +363 -4
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,11 +1,370 @@
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-21T12:47:38.162Z
7
+ -->
8
+
1
9
  # @molecule/app-timeline-vue
2
10
 
3
- Vue chronological timeline with event rails and date markers
11
+ Vue 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 Vue 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.
4
29
 
30
+ ## Quick Start
31
+
32
+ ```ts
33
+ import { createApp, defineComponent, h } from 'vue'
34
+ import { Timeline, TimelineDate } from '@molecule/app-timeline-vue'
35
+
36
+ const App = defineComponent({
37
+ setup() {
38
+ const events = [
39
+ { id: '1', timestamp: '2 hours ago', title: 'Order placed' },
40
+ { id: '2', timestamp: 'Yesterday', title: 'Payment confirmed', body: 'Visa ending 4242' },
41
+ { id: '3', timestamp: 'Mar 12', title: 'Item shipped' },
42
+ ]
43
+ return () =>
44
+ h(Timeline, {
45
+ events,
46
+ renderDateSeparator: (event, prev) =>
47
+ prev ? null : h(TimelineDate, null, () => [event.timestamp]),
48
+ emptyState: 'No activity yet.',
49
+ })
50
+ },
51
+ })
52
+
53
+ createApp(App).mount('#app')
5
54
  ```
6
- npm install @molecule/app-timeline-vue
55
+
56
+ ## Type
57
+
58
+ `feature`
59
+
60
+ ## Installation
61
+
62
+ ```bash
63
+ npm install @molecule/app-timeline-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue
7
64
  ```
8
65
 
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.
66
+ ## API
67
+
68
+ ### Interfaces
69
+
70
+ #### `TimelineEventData`
71
+
72
+ One entry of a `<Timeline>`.
73
+
74
+ ```typescript
75
+ interface TimelineEventData {
76
+ /** Stable identifier for this event (used as the Vue key). */
77
+ id: string
78
+ /** Marker icon / dot — defaults to a small dot. */
79
+ marker?: VNodeChild
80
+ /** Display timestamp (ISO, relative, etc.). */
81
+ timestamp: VNodeChild
82
+ /** Headline of the event. */
83
+ title: VNodeChild
84
+ /** Optional body content. */
85
+ body?: VNodeChild
86
+ /**
87
+ * Optional accent color hint. Currently INERT — no component consumes it,
88
+ * so setting it changes nothing; pass a custom `marker` node to color a row.
89
+ */
90
+ accent?: 'primary' | 'success' | 'warning' | 'error' | 'info' | 'neutral'
91
+ }
92
+ ```
93
+
94
+ #### `TimelineProps`
95
+
96
+ Props accepted by the {@link Timeline} component.
97
+
98
+ ```typescript
99
+ interface TimelineProps {
100
+ /** Events in display order. */
101
+ events: TimelineEventData[]
102
+ /** Optional renderer for date separators between consecutive events. */
103
+ renderDateSeparator?: (event: TimelineEventData, prev?: TimelineEventData) => VNodeChild
104
+ /** Rendered when there are no events. Passed as a prop or as the `emptyState` slot. */
105
+ emptyState?: VNodeChild
106
+ /** Extra classes on the outer wrapper. */
107
+ className?: string
108
+ }
109
+ ```
110
+
111
+ #### `TimelineEventProps`
112
+
113
+ Props accepted by the {@link TimelineEvent} component.
114
+
115
+ ```typescript
116
+ interface TimelineEventProps {
117
+ /** The event to render. */
118
+ event: TimelineEventData
119
+ /** Whether this is the last event in the list (suppresses the connector). */
120
+ isLast?: boolean
121
+ /** Extra classes. */
122
+ className?: string
123
+ }
124
+ ```
125
+
126
+ #### `TimelineRailProps`
127
+
128
+ Props accepted by the {@link TimelineRail} component.
129
+
130
+ ```typescript
131
+ interface TimelineRailProps {
132
+ /** Marker for this row — typically a dot or icon. Passed as a prop or as the `marker` slot. */
133
+ marker?: VNodeChild
134
+ /** Whether to render the vertical connector below the marker. Defaults to `true`. */
135
+ connector?: boolean
136
+ /** Extra classes on the outer wrapper. */
137
+ className?: string
138
+ }
139
+ ```
140
+
141
+ #### `TimelineDateProps`
142
+
143
+ Props accepted by the {@link TimelineDate} component.
144
+
145
+ ```typescript
146
+ interface TimelineDateProps {
147
+ /** Date label ("Today", "Yesterday", "March 12, 2025"). */
148
+ children: VNodeChild
149
+ /** Extra classes. */
150
+ className?: string
151
+ }
152
+ ```
153
+
154
+ ### Constants
155
+
156
+ #### `Timeline`
157
+
158
+ Vertical chronological list of events. Each event renders with a
159
+ marker + connector on the left (`<TimelineEvent>`). Optional date
160
+ separators can be inserted by returning a node from `renderDateSeparator`.
161
+
162
+ ```typescript
163
+ const Timeline: DefineComponent<
164
+ ExtractPropTypes<{
165
+ events: { type: PropType<TimelineEventData[]>; required: true }
166
+ renderDateSeparator: {
167
+ type: PropType<(event: TimelineEventData, prev?: TimelineEventData) => VNodeChild>
168
+ default: undefined
169
+ }
170
+ emptyState: null
171
+ className: { type: StringConstructor; default: undefined }
172
+ }>,
173
+ () => VNode,
174
+ {},
175
+ {},
176
+ {},
177
+ ComponentOptionsMixin,
178
+ ComponentOptionsMixin,
179
+ {},
180
+ string,
181
+ PublicProps,
182
+ Readonly<
183
+ ExtractPropTypes<{
184
+ events: { type: PropType<TimelineEventData[]>; required: true }
185
+ renderDateSeparator: {
186
+ type: PropType<(event: TimelineEventData, prev?: TimelineEventData) => VNodeChild>
187
+ default: undefined
188
+ }
189
+ emptyState: null
190
+ className: { type: StringConstructor; default: undefined }
191
+ }>
192
+ > &
193
+ Readonly<{}>,
194
+ {
195
+ renderDateSeparator: (event: TimelineEventData, prev?: TimelineEventData) => VNodeChild
196
+ className: string
197
+ },
198
+ {},
199
+ {},
200
+ {},
201
+ string,
202
+ ComponentProvideOptions,
203
+ true,
204
+ {},
205
+ any
206
+ >
207
+ ```
208
+
209
+ - `props` — Component props (see {@link TimelineProps}).
210
+
211
+ **Returns:** The timeline component.
212
+
213
+ #### `TimelineDate`
214
+
215
+ Date separator rendered between timeline groups.
216
+
217
+ ```typescript
218
+ const TimelineDate: DefineComponent<
219
+ ExtractPropTypes<{ children: null; className: { type: StringConstructor; default: undefined } }>,
220
+ () => VNode,
221
+ {},
222
+ {},
223
+ {},
224
+ ComponentOptionsMixin,
225
+ ComponentOptionsMixin,
226
+ {},
227
+ string,
228
+ PublicProps,
229
+ Readonly<
230
+ ExtractPropTypes<{ children: null; className: { type: StringConstructor; default: undefined } }>
231
+ > &
232
+ Readonly<{}>,
233
+ { className: string },
234
+ {},
235
+ {},
236
+ {},
237
+ string,
238
+ ComponentProvideOptions,
239
+ true,
240
+ {},
241
+ any
242
+ >
243
+ ```
244
+
245
+ - `props` — Component props (see {@link TimelineDateProps}).
246
+
247
+ **Returns:** The date separator component.
248
+
249
+ #### `TimelineEvent`
250
+
251
+ One row of a `<Timeline>`: [rail (marker + connector)] [timestamp / title / body].
252
+
253
+ ```typescript
254
+ const TimelineEvent: DefineComponent<
255
+ ExtractPropTypes<{
256
+ event: { type: PropType<TimelineEventData>; required: true }
257
+ isLast: { type: PropType<boolean>; default: boolean }
258
+ className: { type: StringConstructor; default: undefined }
259
+ }>,
260
+ () => VNode,
261
+ {},
262
+ {},
263
+ {},
264
+ ComponentOptionsMixin,
265
+ ComponentOptionsMixin,
266
+ {},
267
+ string,
268
+ PublicProps,
269
+ Readonly<
270
+ ExtractPropTypes<{
271
+ event: { type: PropType<TimelineEventData>; required: true }
272
+ isLast: { type: PropType<boolean>; default: boolean }
273
+ className: { type: StringConstructor; default: undefined }
274
+ }>
275
+ > &
276
+ Readonly<{}>,
277
+ { className: string; isLast: boolean },
278
+ {},
279
+ {},
280
+ {},
281
+ string,
282
+ ComponentProvideOptions,
283
+ true,
284
+ {},
285
+ any
286
+ >
287
+ ```
288
+
289
+ - `props` — Component props (see {@link TimelineEventProps}).
290
+
291
+ **Returns:** The event component.
292
+
293
+ #### `TimelineRail`
294
+
295
+ Left-hand rail of a timeline row — renders the marker and an optional
296
+ vertical connector extending downward.
297
+
298
+ ```typescript
299
+ const TimelineRail: DefineComponent<
300
+ ExtractPropTypes<{
301
+ marker: null
302
+ connector: { type: PropType<boolean>; default: boolean }
303
+ className: { type: StringConstructor; default: undefined }
304
+ }>,
305
+ () => VNode,
306
+ {},
307
+ {},
308
+ {},
309
+ ComponentOptionsMixin,
310
+ ComponentOptionsMixin,
311
+ {},
312
+ string,
313
+ PublicProps,
314
+ Readonly<
315
+ ExtractPropTypes<{
316
+ marker: null
317
+ connector: { type: PropType<boolean>; default: boolean }
318
+ className: { type: StringConstructor; default: undefined }
319
+ }>
320
+ > &
321
+ Readonly<{}>,
322
+ { className: string; connector: boolean },
323
+ {},
324
+ {},
325
+ {},
326
+ string,
327
+ ComponentProvideOptions,
328
+ true,
329
+ {},
330
+ any
331
+ >
332
+ ```
333
+
334
+ - `props` — Component props (see {@link TimelineRailProps}).
335
+
336
+ **Returns:** The rail component.
337
+
338
+ ## Injection Notes
339
+
340
+ ### Requirements
341
+
342
+ Peer dependencies:
343
+
344
+ - `@molecule/app-ui` ^1.0.1
345
+ - `@molecule/app-ui-vue` ^1.1.0
346
+ - `@molecule/app-vue` ^3.5.0
347
+ - `vue` ^3.4.0
348
+
349
+ ### Runtime Dependencies
350
+
351
+ - `@molecule/app-ui`
352
+ - `@molecule/app-ui-vue`
353
+ - `@molecule/app-vue`
354
+ - `vue`
355
+
356
+ This is NOT the Vue binding for `@molecule/app-timeline` (the headless
357
+ provider core wired via `setProvider`) — it is standalone presentational
358
+ markup with no provider. For domain-specific rows see the sibling
359
+ `@molecule/app-{activity,order,status,stage,day}-timeline-vue` packages.
10
360
 
11
- License: Apache-2.0
361
+ `TimelineEventData.accent` is currently INERT — no component reads it, so
362
+ setting it changes nothing; color a row by passing a custom `marker` node
363
+ instead. `timestamp` is a display node — format/translate it before
364
+ passing. Node-valued props (`emptyState`, `marker`) may be passed as a prop
365
+ or as the same-named slot; the default slot is `TimelineDate`'s children.
366
+ The prop surface (documented on the exported `TimelineProps`,
367
+ `TimelineEventProps`, `TimelineRailProps` and `TimelineDateProps`
368
+ interfaces): Timeline(events, renderDateSeparator, emptyState, className),
369
+ TimelineEvent(event, isLast, className), TimelineRail(marker, connector,
370
+ className), TimelineDate(children, className).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-timeline-vue",
3
- "version": "0.0.1-stage",
3
+ "version": "1.1.0",
4
4
  "description": "Vue chronological timeline with event rails and date markers",
5
5
  "homepage": "https://www.molecule.dev/packages/app-timeline-vue",
6
6
  "type": "module",
@@ -51,9 +51,9 @@
51
51
  "@molecule/app-framework-conformance": "0.0.0",
52
52
  "@molecule/app-i18n": "1.2.2",
53
53
  "@molecule/app-icons": "1.0.4",
54
- "@molecule/app-ui": "1.4.0",
55
- "@molecule/app-ui-vue": "1.1.5",
56
- "@molecule/app-vue": "3.7.2",
54
+ "@molecule/app-ui": "1.5.0",
55
+ "@molecule/app-ui-vue": "1.2.1",
56
+ "@molecule/app-vue": "3.9.0",
57
57
  "@types/node": "26.6.5",
58
58
  "jsdom": "30.1.3",
59
59
  "typescript": "6.0.3",