@molecule/app-timeline-svelte 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.
package/README.md CHANGED
@@ -1,11 +1,206 @@
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:37.870Z
7
+ -->
8
+
1
9
  # @molecule/app-timeline-svelte
2
10
 
3
- Svelte chronological timeline with event rails and date markers
11
+ Svelte 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 Svelte counterpart of `@molecule/app-timeline-react`: the same
23
+ props (React names) and the same DOM for the same input, so switching
24
+ framework is 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
+ ```svelte
33
+ <script lang="ts">
34
+ import { Timeline, TimelineDate } from '@molecule/app-timeline-svelte'
4
35
 
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
+ </script>
42
+
43
+ <Timeline {events} emptyState="No activity yet.">
44
+ {#snippet renderDateSeparator(event, prev)}
45
+ {#if !prev}<TimelineDate>{event.timestamp}</TimelineDate>{/if}
46
+ {/snippet}
47
+ </Timeline>
5
48
  ```
6
- npm install @molecule/app-timeline-svelte
49
+
50
+ ## Type
51
+
52
+ `feature`
53
+
54
+ ## Installation
55
+
56
+ ```bash
57
+ npm install @molecule/app-timeline-svelte @molecule/app-svelte @molecule/app-ui @molecule/app-ui-svelte svelte
7
58
  ```
8
59
 
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.
60
+ ## API
61
+
62
+ ### Interfaces
63
+
64
+ #### `TimelineEventData`
65
+
66
+ One entry of a `<Timeline>`. Node fields may be plain text or a snippet.
67
+
68
+ ```typescript
69
+ interface TimelineEventData {
70
+ /** Stable identifier for this event (the row is keyed by it). */
71
+ id: string
72
+ /** Marker icon / dot — defaults to a small dot. */
73
+ marker?: string | number | Snippet
74
+ /** Display timestamp (ISO, relative, etc.). */
75
+ timestamp: string | number | Snippet
76
+ /** Headline of the event. */
77
+ title: string | number | Snippet
78
+ /** Optional body content. */
79
+ body?: string | number | Snippet
80
+ /**
81
+ * Optional accent color hint. Currently INERT — no component consumes it,
82
+ * so setting it changes nothing; pass a custom `marker` node to color a row.
83
+ */
84
+ accent?: 'primary' | 'success' | 'warning' | 'error' | 'info' | 'neutral'
85
+ }
86
+ ```
87
+
88
+ #### `TimelineProps`
89
+
90
+ Props accepted by the {@link Timeline} component.
91
+
92
+ ```typescript
93
+ interface TimelineProps {
94
+ /** Events in display order. */
95
+ events: TimelineEventData[]
96
+ /** Optional renderer for date separators between consecutive events. */
97
+ renderDateSeparator?: Snippet<[TimelineEventData, TimelineEventData | undefined]>
98
+ /** Rendered when there are no events. */
99
+ emptyState?: string | number | Snippet
100
+ /** Extra classes on the outer wrapper. */
101
+ className?: string
102
+ }
103
+ ```
104
+
105
+ #### `TimelineEventProps`
106
+
107
+ Props accepted by the {@link TimelineEvent} component.
108
+
109
+ ```typescript
110
+ interface TimelineEventProps {
111
+ /** The event to render. */
112
+ event: TimelineEventData
113
+ /** Whether this is the last event in the list (suppresses the connector). */
114
+ isLast?: boolean
115
+ /** Extra classes. */
116
+ className?: string
117
+ }
118
+ ```
119
+
120
+ #### `TimelineRailProps`
121
+
122
+ Props accepted by the {@link TimelineRail} component.
123
+
124
+ ```typescript
125
+ interface TimelineRailProps {
126
+ /** Marker for this row — typically a dot or icon. */
127
+ marker?: string | number | Snippet
128
+ /** Whether to render the vertical connector below the marker. Defaults to `true`. */
129
+ connector?: boolean
130
+ /** Extra classes on the outer wrapper. */
131
+ className?: string
132
+ }
133
+ ```
134
+
135
+ #### `TimelineDateProps`
136
+
137
+ Props accepted by the {@link TimelineDate} component.
138
+
139
+ ```typescript
140
+ interface TimelineDateProps {
141
+ /** Date label ("Today", "Yesterday", "March 12, 2025"). */
142
+ children: Snippet
143
+ /** Extra classes. */
144
+ className?: string
145
+ }
146
+ ```
147
+
148
+ ### Constants
149
+
150
+ #### `Timeline`
151
+
152
+ ```typescript
153
+ const Timeline: LegacyComponentType
154
+ ```
155
+
156
+ #### `TimelineDate`
157
+
158
+ ```typescript
159
+ const TimelineDate: LegacyComponentType
160
+ ```
161
+
162
+ #### `TimelineEvent`
163
+
164
+ ```typescript
165
+ const TimelineEvent: LegacyComponentType
166
+ ```
167
+
168
+ #### `TimelineRail`
169
+
170
+ ```typescript
171
+ const TimelineRail: LegacyComponentType
172
+ ```
173
+
174
+ ## Injection Notes
175
+
176
+ ### Requirements
177
+
178
+ Peer dependencies:
179
+
180
+ - `@molecule/app-svelte` ^3.5.0
181
+ - `@molecule/app-ui` ^1.0.1
182
+ - `@molecule/app-ui-svelte` ^1.1.0
183
+ - `svelte` ^5.0.0
184
+
185
+ ### Runtime Dependencies
186
+
187
+ - `@molecule/app-svelte`
188
+ - `@molecule/app-ui`
189
+ - `@molecule/app-ui-svelte`
190
+ - `svelte`
191
+
192
+ This is NOT the Svelte binding for `@molecule/app-timeline` (the headless
193
+ provider core wired via `setProvider`) — it is standalone presentational
194
+ markup with no provider. For domain-specific rows see the sibling
195
+ `@molecule/app-{activity,order,status,stage,day}-timeline-svelte` packages.
10
196
 
11
- License: Apache-2.0
197
+ `TimelineEventData.accent` is currently INERT — no component reads it, so
198
+ setting it changes nothing; color a row by passing a custom `marker` node
199
+ instead. `timestamp` is a display node — format/translate it before
200
+ passing. Every node-valued prop is a snippet (plain text works too), and
201
+ `Timeline` keys each row by the event's `id` value, like React. The prop
202
+ surface (documented on the exported `TimelineProps`, `TimelineEventProps`,
203
+ `TimelineRailProps` and `TimelineDateProps` interfaces):
204
+ Timeline(events, renderDateSeparator, emptyState, className),
205
+ TimelineEvent(event, isLast, className), TimelineRail(marker, connector,
206
+ className), TimelineDate(children, className).
@@ -21,14 +21,14 @@
21
21
  {#if typeof emptyState === 'string' || typeof emptyState === 'number'}
22
22
  {emptyState}
23
23
  {:else}
24
- {@render emptyState()}
24
+ {@render emptyState?.()}
25
25
  {/if}
26
26
  {:else}
27
27
  <div class={cm.cn(cm.stack(0 as const), className)}>
28
28
  {#each events as event, i (event.id)}
29
29
  {@const prev = i > 0 ? events[i - 1] : undefined}
30
30
  <div>
31
- {#if renderDateSeparator}{@render renderDateSeparator(event, prev)}{/if}
31
+ {#if renderDateSeparator}{@render renderDateSeparator?.(event, prev)}{/if}
32
32
  <TimelineEvent {event} isLast={i === events.length - 1} />
33
33
  </div>
34
34
  {/each}
@@ -22,5 +22,5 @@
22
22
  className,
23
23
  )}
24
24
  >
25
- <span class={cm.flex1}>{@render children()}</span>
25
+ <span class={cm.flex1}>{@render children?.()}</span>
26
26
  </div>
@@ -22,14 +22,14 @@
22
22
  {#if typeof event.timestamp === 'string' || typeof event.timestamp === 'number'}
23
23
  {event.timestamp}
24
24
  {:else}
25
- {@render event.timestamp()}
25
+ {@render event.timestamp?.()}
26
26
  {/if}
27
27
  </div>
28
28
  <div class={cm.cn(cm.textSize('sm'), cm.fontWeight('semibold'))}>
29
29
  {#if typeof event.title === 'string' || typeof event.title === 'number'}
30
30
  {event.title}
31
31
  {:else}
32
- {@render event.title()}
32
+ {@render event.title?.()}
33
33
  {/if}
34
34
  </div>
35
35
  {#if event.body}
@@ -37,7 +37,7 @@
37
37
  {#if typeof event.body === 'string' || typeof event.body === 'number'}
38
38
  {event.body}
39
39
  {:else}
40
- {@render event.body()}
40
+ {@render event.body?.()}
41
41
  {/if}
42
42
  </div>
43
43
  {/if}
@@ -29,7 +29,7 @@
29
29
  {:else if typeof marker === 'string' || typeof marker === 'number'}
30
30
  {marker}
31
31
  {:else}
32
- {@render marker()}
32
+ {@render marker?.()}
33
33
  {/if}
34
34
  </div>
35
35
  {#if connector}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-timeline-svelte",
3
- "version": "0.0.1-stage",
3
+ "version": "1.1.1",
4
4
  "description": "Svelte chronological timeline with event rails and date markers",
5
5
  "homepage": "https://www.molecule.dev/packages/app-timeline-svelte",
6
6
  "type": "module",
@@ -57,13 +57,13 @@
57
57
  "@molecule/app-framework-conformance": "0.0.0",
58
58
  "@molecule/app-i18n": "1.2.2",
59
59
  "@molecule/app-icons": "1.0.4",
60
- "@molecule/app-svelte": "3.7.2",
61
- "@molecule/app-ui": "1.4.0",
62
- "@molecule/app-ui-svelte": "1.1.7",
60
+ "@molecule/app-svelte": "3.13.0",
61
+ "@molecule/app-ui": "1.5.0",
62
+ "@molecule/app-ui-svelte": "1.4.1",
63
63
  "@sveltejs/package": "3.0.2",
64
64
  "@sveltejs/vite-plugin-svelte": "7.1.2",
65
65
  "@types/node": "26.6.5",
66
- "jsdom": "30.1.3",
66
+ "jsdom": "31.0.1",
67
67
  "svelte": "5.57.2",
68
68
  "svelte-check": "4.7.7",
69
69
  "typescript": "6.0.3",