@molecule/app-timeline-vue 0.0.0-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.
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,370 @@
1
- # Temporary Holding Version
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
+ -->
2
8
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
9
+ # @molecule/app-timeline-vue
10
+
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.
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')
54
+ ```
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
64
+ ```
65
+
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.
360
+
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).
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Vue vertical chronological list of events with optional date separators.
3
+ *
4
+ * Vue counterpart of `@molecule/app-timeline-react`'s `Timeline` — the same
5
+ * props (React names), the same DOM for the same input.
6
+ *
7
+ * @module
8
+ */
9
+ import { type PropType, type VNode, type VNodeChild } from 'vue';
10
+ import type { TimelineEventData } from './types.js';
11
+ /**
12
+ * Vertical chronological list of events. Each event renders with a
13
+ * marker + connector on the left (`<TimelineEvent>`). Optional date
14
+ * separators can be inserted by returning a node from `renderDateSeparator`.
15
+ *
16
+ * @param props - Component props (see {@link TimelineProps}).
17
+ * @returns The timeline component.
18
+ */
19
+ export declare const Timeline: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
20
+ events: {
21
+ type: PropType<TimelineEventData[]>;
22
+ required: true;
23
+ };
24
+ renderDateSeparator: {
25
+ type: PropType<(event: TimelineEventData, prev?: TimelineEventData) => VNodeChild>;
26
+ default: undefined;
27
+ };
28
+ emptyState: null;
29
+ className: {
30
+ type: StringConstructor;
31
+ default: undefined;
32
+ };
33
+ }>, () => VNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
34
+ events: {
35
+ type: PropType<TimelineEventData[]>;
36
+ required: true;
37
+ };
38
+ renderDateSeparator: {
39
+ type: PropType<(event: TimelineEventData, prev?: TimelineEventData) => VNodeChild>;
40
+ default: undefined;
41
+ };
42
+ emptyState: null;
43
+ className: {
44
+ type: StringConstructor;
45
+ default: undefined;
46
+ };
47
+ }>> & Readonly<{}>, {
48
+ className: string;
49
+ renderDateSeparator: (event: TimelineEventData, prev?: TimelineEventData) => VNodeChild;
50
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
51
+ //# sourceMappingURL=Timeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../src/Timeline.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAgC,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAA;AAK9F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAkBnD;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ;;cAIA,QAAQ,CAAC,iBAAiB,EAAE,CAAC;;;;cAI1B,QAAQ,CACxB,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,iBAAiB,KAAK,UAAU,CACnE;;;;;;;;UAYQ,KAAK;;cAlBC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;;;;cAI1B,QAAQ,CACxB,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,iBAAiB,KAAK,UAAU,CACnE;;;;;;;;;;iCADS,iBAAiB,SAAS,iBAAiB,KAAK,UAAU;4EA8BxE,CAAA"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Vue vertical chronological list of events with optional date separators.
3
+ *
4
+ * Vue counterpart of `@molecule/app-timeline-react`'s `Timeline` — the same
5
+ * props (React names), the same DOM for the same input.
6
+ *
7
+ * @module
8
+ */
9
+ import { defineComponent, Fragment, h } from 'vue';
10
+ import { getClassMap } from '@molecule/app-ui';
11
+ import { TimelineEvent } from './TimelineEvent.js';
12
+ /**
13
+ * The empty state's children: the `emptyState` slot wins over the prop, and an
14
+ * absent pair contributes nothing.
15
+ *
16
+ * @param slot - The slot render function, when the caller passed the slot.
17
+ * @param prop - The prop value, when the caller passed the prop.
18
+ * @returns The children React renders for `emptyState`.
19
+ */
20
+ const emptyChildren = (slot, prop) => {
21
+ if (slot)
22
+ return slot();
23
+ return prop != null ? [prop] : [];
24
+ };
25
+ /**
26
+ * Vertical chronological list of events. Each event renders with a
27
+ * marker + connector on the left (`<TimelineEvent>`). Optional date
28
+ * separators can be inserted by returning a node from `renderDateSeparator`.
29
+ *
30
+ * @param props - Component props (see {@link TimelineProps}).
31
+ * @returns The timeline component.
32
+ */
33
+ export const Timeline = defineComponent({
34
+ name: 'Timeline',
35
+ props: {
36
+ events: {
37
+ type: Array,
38
+ required: true,
39
+ },
40
+ renderDateSeparator: {
41
+ type: Function,
42
+ default: undefined,
43
+ },
44
+ emptyState: null,
45
+ className: {
46
+ type: String,
47
+ default: undefined,
48
+ },
49
+ },
50
+ setup(props, { slots }) {
51
+ const cm = getClassMap();
52
+ return () => {
53
+ const empty = emptyChildren(slots.emptyState, props.emptyState);
54
+ if (props.events.length === 0 && empty.length > 0)
55
+ return h(Fragment, empty);
56
+ return h('div', { class: cm.cn(cm.stack(0), props.className) }, props.events.map((event, i) => {
57
+ const prev = i > 0 ? props.events[i - 1] : undefined;
58
+ const separator = props.renderDateSeparator?.(event, prev);
59
+ return h('div', { key: event.id }, [
60
+ ...(separator != null ? [separator] : []),
61
+ h(TimelineEvent, { event, isLast: i === props.events.length - 1 }),
62
+ ]);
63
+ }));
64
+ };
65
+ },
66
+ });
67
+ //# sourceMappingURL=Timeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Timeline.js","sourceRoot":"","sources":["../src/Timeline.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,EAA8C,MAAM,KAAK,CAAA;AAE9F,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGlD;;;;;;;GAOG;AACH,MAAM,aAAa,GAAG,CACpB,IAAsC,EACtC,IAAmC,EACrB,EAAE;IAChB,IAAI,IAAI;QAAE,OAAO,IAAI,EAAE,CAAA;IACvB,OAAO,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACnC,CAAC,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC;IACtC,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE;QACL,MAAM,EAAE;YACN,IAAI,EAAE,KAAsC;YAC5C,QAAQ,EAAE,IAAI;SACf;QACD,mBAAmB,EAAE;YACnB,IAAI,EAAE,QAEL;YACD,OAAO,EAAE,SAAS;SACnB;QACD,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE;YACT,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,SAAS;SACnB;KACF;IACD,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE;QACpB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;QAExB,OAAO,GAAU,EAAE;YACjB,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;YAC/D,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;gBAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;YAC5E,OAAO,CAAC,CACN,KAAK,EACL,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,EACvD,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;gBAC5B,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;gBACpD,MAAM,SAAS,GAAG,KAAK,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;gBAC1D,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE;oBACjC,GAAG,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBACzC,CAAC,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;iBACnE,CAAC,CAAA;YACJ,CAAC,CAAC,CACH,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Vue date separator rendered between timeline groups.
3
+ *
4
+ * Vue counterpart of `@molecule/app-timeline-react`'s `TimelineDate` — the same
5
+ * props (React names), the same DOM for the same input.
6
+ *
7
+ * @module
8
+ */
9
+ import { type VNode } from 'vue';
10
+ /**
11
+ * Date separator rendered between timeline groups.
12
+ *
13
+ * @param props - Component props (see {@link TimelineDateProps}).
14
+ * @returns The date separator component.
15
+ */
16
+ export declare const TimelineDate: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
17
+ children: null;
18
+ className: {
19
+ type: StringConstructor;
20
+ default: undefined;
21
+ };
22
+ }>, () => VNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
23
+ children: null;
24
+ className: {
25
+ type: StringConstructor;
26
+ default: undefined;
27
+ };
28
+ }>> & Readonly<{}>, {
29
+ className: string;
30
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
31
+ //# sourceMappingURL=TimelineDate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimelineDate.d.ts","sourceRoot":"","sources":["../src/TimelineDate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAsB,KAAK,KAAK,EAAmB,MAAM,KAAK,CAAA;AAIrE;;;;;GAKG;AACH,eAAO,MAAM,YAAY;;;;;;UAYV,KAAK;;;;;;;;4EAqBlB,CAAA"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Vue date separator rendered between timeline groups.
3
+ *
4
+ * Vue counterpart of `@molecule/app-timeline-react`'s `TimelineDate` — the same
5
+ * props (React names), the same DOM for the same input.
6
+ *
7
+ * @module
8
+ */
9
+ import { defineComponent, h } from 'vue';
10
+ import { getClassMap } from '@molecule/app-ui';
11
+ /**
12
+ * Date separator rendered between timeline groups.
13
+ *
14
+ * @param props - Component props (see {@link TimelineDateProps}).
15
+ * @returns The date separator component.
16
+ */
17
+ export const TimelineDate = defineComponent({
18
+ name: 'TimelineDate',
19
+ props: {
20
+ children: null,
21
+ className: {
22
+ type: String,
23
+ default: undefined,
24
+ },
25
+ },
26
+ setup(props, { slots }) {
27
+ const cm = getClassMap();
28
+ return () => {
29
+ const content = slots.default
30
+ ? slots.default()
31
+ : props.children != null
32
+ ? [props.children]
33
+ : [];
34
+ return h('div', {
35
+ class: cm.cn(cm.flex({ align: 'center', gap: 'sm' }), cm.sp('py', 2), cm.textSize('xs'), cm.fontWeight('semibold'), props.className),
36
+ }, [h('span', { class: cm.flex1 }, content)]);
37
+ };
38
+ },
39
+ });
40
+ //# sourceMappingURL=TimelineDate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimelineDate.js","sourceRoot":"","sources":["../src/TimelineDate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC,EAA+B,MAAM,KAAK,CAAA;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,CAAC;IAC1C,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE;QACL,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE;YACT,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,SAAS;SACnB;KACF;IACD,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE;QACpB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;QAExB,OAAO,GAAU,EAAE;YACjB,MAAM,OAAO,GAAiB,KAAK,CAAC,OAAO;gBACzC,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE;gBACjB,CAAC,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI;oBACtB,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;oBAClB,CAAC,CAAC,EAAE,CAAA;YACR,OAAO,CAAC,CACN,KAAK,EACL;gBACE,KAAK,EAAE,EAAE,CAAC,EAAE,CACV,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EACvC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,EACd,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EACjB,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EACzB,KAAK,CAAC,SAAS,CAChB;aACF,EACD,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC,CAC1C,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Vue one row of a timeline: rail (marker + connector) + event content.
3
+ *
4
+ * Vue counterpart of `@molecule/app-timeline-react`'s `TimelineEvent` — the
5
+ * same props (React names), the same DOM for the same input.
6
+ *
7
+ * @module
8
+ */
9
+ import { type PropType, type VNode } from 'vue';
10
+ import type { TimelineEventData } from './types.js';
11
+ /**
12
+ * One row of a `<Timeline>`: [rail (marker + connector)] [timestamp / title / body].
13
+ *
14
+ * @param props - Component props (see {@link TimelineEventProps}).
15
+ * @returns The event component.
16
+ */
17
+ export declare const TimelineEvent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
18
+ event: {
19
+ type: PropType<TimelineEventData>;
20
+ required: true;
21
+ };
22
+ isLast: {
23
+ type: PropType<boolean>;
24
+ default: boolean;
25
+ };
26
+ className: {
27
+ type: StringConstructor;
28
+ default: undefined;
29
+ };
30
+ }>, () => VNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
31
+ event: {
32
+ type: PropType<TimelineEventData>;
33
+ required: true;
34
+ };
35
+ isLast: {
36
+ type: PropType<boolean>;
37
+ default: boolean;
38
+ };
39
+ className: {
40
+ type: StringConstructor;
41
+ default: undefined;
42
+ };
43
+ }>> & Readonly<{}>, {
44
+ className: string;
45
+ isLast: boolean;
46
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
47
+ //# sourceMappingURL=TimelineEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimelineEvent.d.ts","sourceRoot":"","sources":["../src/TimelineEvent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAsB,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,KAAK,CAAA;AAKnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,aAAa;;cAIJ,QAAQ,CAAC,iBAAiB,CAAC;;;;cAI1B,QAAQ,CAAC,OAAO,CAAC;;;;;;;UAWzB,KAAK;;cAfE,QAAQ,CAAC,iBAAiB,CAAC;;;;cAI1B,QAAQ,CAAC,OAAO,CAAC;;;;;;;;;;4EAyBtC,CAAA"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Vue one row of a timeline: rail (marker + connector) + event content.
3
+ *
4
+ * Vue counterpart of `@molecule/app-timeline-react`'s `TimelineEvent` — the
5
+ * same props (React names), the same DOM for the same input.
6
+ *
7
+ * @module
8
+ */
9
+ import { defineComponent, h } from 'vue';
10
+ import { getClassMap } from '@molecule/app-ui';
11
+ import { TimelineRail } from './TimelineRail.js';
12
+ /**
13
+ * One row of a `<Timeline>`: [rail (marker + connector)] [timestamp / title / body].
14
+ *
15
+ * @param props - Component props (see {@link TimelineEventProps}).
16
+ * @returns The event component.
17
+ */
18
+ export const TimelineEvent = defineComponent({
19
+ name: 'TimelineEvent',
20
+ props: {
21
+ event: {
22
+ type: Object,
23
+ required: true,
24
+ },
25
+ isLast: {
26
+ type: Boolean,
27
+ default: false,
28
+ },
29
+ className: {
30
+ type: String,
31
+ default: undefined,
32
+ },
33
+ },
34
+ setup(props) {
35
+ const cm = getClassMap();
36
+ return () => h('div', { class: cm.cn(cm.flex({ align: 'stretch', gap: 'sm' }), props.className) }, [
37
+ h(TimelineRail, { marker: props.event.marker, connector: !props.isLast }),
38
+ h('div', { class: cm.cn(cm.flex1, cm.stack(1), cm.sp('pb', 4)) }, [
39
+ h('div', { class: cm.cn(cm.textSize('xs'), cm.fontWeight('medium')) }, [
40
+ props.event.timestamp,
41
+ ]),
42
+ h('div', { class: cm.cn(cm.textSize('sm'), cm.fontWeight('semibold')) }, [
43
+ props.event.title,
44
+ ]),
45
+ ...(props.event.body ? [h('div', { class: cm.textSize('sm') }, [props.event.body])] : []),
46
+ ]),
47
+ ]);
48
+ },
49
+ });
50
+ //# sourceMappingURL=TimelineEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimelineEvent.js","sourceRoot":"","sources":["../src/TimelineEvent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC,EAA6B,MAAM,KAAK,CAAA;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGhD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;IAC3C,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE;QACL,KAAK,EAAE;YACL,IAAI,EAAE,MAAqC;YAC3C,QAAQ,EAAE,IAAI;SACf;QACD,MAAM,EAAE;YACN,IAAI,EAAE,OAA4B;YAClC,OAAO,EAAE,KAAK;SACf;QACD,SAAS,EAAE;YACT,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,SAAS;SACnB;KACF;IACD,KAAK,CAAC,KAAK;QACT,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;QAExB,OAAO,GAAU,EAAE,CACjB,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE;YACpF,CAAC,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YACzE,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAU,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;gBACzE,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE;oBACrE,KAAK,CAAC,KAAK,CAAC,SAAS;iBACtB,CAAC;gBACF,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE;oBACvE,KAAK,CAAC,KAAK,CAAC,KAAK;iBAClB,CAAC;gBACF,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aAC1F,CAAC;SACH,CAAC,CAAA;IACN,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Vue left-hand rail of a timeline row: the marker and an optional connector.
3
+ *
4
+ * Vue counterpart of `@molecule/app-timeline-react`'s `TimelineRail` — the same
5
+ * props (React names), the same DOM for the same input.
6
+ *
7
+ * @module
8
+ */
9
+ import { type PropType, type VNode } from 'vue';
10
+ /**
11
+ * Left-hand rail of a timeline row — renders the marker and an optional
12
+ * vertical connector extending downward.
13
+ *
14
+ * @param props - Component props (see {@link TimelineRailProps}).
15
+ * @returns The rail component.
16
+ */
17
+ export declare const TimelineRail: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
18
+ marker: null;
19
+ connector: {
20
+ type: PropType<boolean>;
21
+ default: boolean;
22
+ };
23
+ className: {
24
+ type: StringConstructor;
25
+ default: undefined;
26
+ };
27
+ }>, () => VNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
28
+ marker: null;
29
+ connector: {
30
+ type: PropType<boolean>;
31
+ default: boolean;
32
+ };
33
+ className: {
34
+ type: StringConstructor;
35
+ default: undefined;
36
+ };
37
+ }>> & Readonly<{}>, {
38
+ connector: boolean;
39
+ className: string;
40
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
41
+ //# sourceMappingURL=TimelineRail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimelineRail.d.ts","sourceRoot":"","sources":["../src/TimelineRail.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAsB,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAmB,MAAM,KAAK,CAAA;AAoBpF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;;cAKF,QAAQ,CAAC,OAAO,CAAC;;;;;;;UAWzB,KAAK;;;cAXG,QAAQ,CAAC,OAAO,CAAC;;;;;;;;;;4EAoCtC,CAAA"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Vue left-hand rail of a timeline row: the marker and an optional connector.
3
+ *
4
+ * Vue counterpart of `@molecule/app-timeline-react`'s `TimelineRail` — the same
5
+ * props (React names), the same DOM for the same input.
6
+ *
7
+ * @module
8
+ */
9
+ import { defineComponent, h } from 'vue';
10
+ import { getClassMap } from '@molecule/app-ui';
11
+ /**
12
+ * Resolves a node-valued prop that may also arrive as a same-named slot: the
13
+ * slot wins, and an absent pair contributes nothing.
14
+ *
15
+ * @param slot - The slot render function, when the caller passed the slot.
16
+ * @param prop - The prop value, when the caller passed the prop.
17
+ * @returns The children to render.
18
+ */
19
+ const slotOrProp = (slot, prop) => {
20
+ if (slot)
21
+ return slot();
22
+ return prop != null ? [prop] : [];
23
+ };
24
+ /**
25
+ * Left-hand rail of a timeline row — renders the marker and an optional
26
+ * vertical connector extending downward.
27
+ *
28
+ * @param props - Component props (see {@link TimelineRailProps}).
29
+ * @returns The rail component.
30
+ */
31
+ export const TimelineRail = defineComponent({
32
+ name: 'TimelineRail',
33
+ props: {
34
+ marker: null,
35
+ connector: {
36
+ type: Boolean,
37
+ default: true,
38
+ },
39
+ className: {
40
+ type: String,
41
+ default: undefined,
42
+ },
43
+ },
44
+ setup(props, { slots }) {
45
+ const cm = getClassMap();
46
+ return () => {
47
+ const marker = slotOrProp(slots.marker, props.marker);
48
+ return h('div', {
49
+ class: cm.cn(cm.flex({ direction: 'col', align: 'center' }), cm.shrink0, props.className),
50
+ }, [
51
+ h('div', {}, marker.length > 0 ? marker : [h('span', { 'aria-hidden': 'true' }, '•')]),
52
+ ...(props.connector
53
+ ? [
54
+ h('div', {
55
+ class: cm.cn(cm.w(0), cm.h('full')),
56
+ style: {
57
+ borderLeft: '1px solid currentColor',
58
+ opacity: '0.2',
59
+ minHeight: '24px',
60
+ },
61
+ }),
62
+ ]
63
+ : []),
64
+ ]);
65
+ };
66
+ },
67
+ });
68
+ //# sourceMappingURL=TimelineRail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimelineRail.js","sourceRoot":"","sources":["../src/TimelineRail.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC,EAA8C,MAAM,KAAK,CAAA;AAEpF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,CACjB,IAAsC,EACtC,IAAmC,EACrB,EAAE;IAChB,IAAI,IAAI;QAAE,OAAO,IAAI,EAAE,CAAA;IACvB,OAAO,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACnC,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,CAAC;IAC1C,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE;QACL,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE;YACT,IAAI,EAAE,OAA4B;YAClC,OAAO,EAAE,IAAI;SACd;QACD,SAAS,EAAE;YACT,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,SAAS;SACnB;KACF;IACD,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE;QACpB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;QAExB,OAAO,GAAU,EAAE;YACjB,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;YACrD,OAAO,CAAC,CACN,KAAK,EACL;gBACE,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;aAC1F,EACD;gBACE,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;gBACtF,GAAG,CAAC,KAAK,CAAC,SAAS;oBACjB,CAAC,CAAC;wBACE,CAAC,CAAC,KAAK,EAAE;4BACP,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAU,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;4BAC5C,KAAK,EAAE;gCACL,UAAU,EAAE,wBAAwB;gCACpC,OAAO,EAAE,KAAK;gCACd,SAAS,EAAE,MAAM;6BAClB;yBACF,CAAC;qBACH;oBACH,CAAC,CAAC,EAAE,CAAC;aACR,CACF,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Vue chronological timeline primitives.
3
+ *
4
+ * Exports:
5
+ * - `<Timeline>` — vertical list of events with optional date separators.
6
+ * - `<TimelineEvent>` — one event row with rail (marker + connector) + content.
7
+ * - `<TimelineRail>` — standalone rail (marker + connector) for custom rows.
8
+ * - `<TimelineDate>` — date separator rendered between groups.
9
+ * - `TimelineEventData` type for event records.
10
+ *
11
+ * Use for activity chronologies, deal timelines, order tracking, audit logs.
12
+ * It is the Vue counterpart of `@molecule/app-timeline-react`: the same props
13
+ * (React names) and the same DOM for the same input, so switching framework is
14
+ * changing the package name in the imports.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * import { createApp, defineComponent, h } from 'vue'
19
+ * import { Timeline, TimelineDate } from '@molecule/app-timeline-vue'
20
+ *
21
+ * const App = defineComponent({
22
+ * setup() {
23
+ * const events = [
24
+ * { id: '1', timestamp: '2 hours ago', title: 'Order placed' },
25
+ * { id: '2', timestamp: 'Yesterday', title: 'Payment confirmed', body: 'Visa ending 4242' },
26
+ * { id: '3', timestamp: 'Mar 12', title: 'Item shipped' },
27
+ * ]
28
+ * return () =>
29
+ * h(Timeline, {
30
+ * events,
31
+ * renderDateSeparator: (event, prev) =>
32
+ * prev ? null : h(TimelineDate, null, () => [event.timestamp]),
33
+ * emptyState: 'No activity yet.',
34
+ * })
35
+ * },
36
+ * })
37
+ *
38
+ * createApp(App).mount('#app')
39
+ * ```
40
+ *
41
+ * @remarks
42
+ * This is NOT the Vue binding for `@molecule/app-timeline` (the headless
43
+ * provider core wired via `setProvider`) — it is standalone presentational
44
+ * markup with no provider. For domain-specific rows see the sibling
45
+ * `@molecule/app-{activity,order,status,stage,day}-timeline-vue` packages.
46
+ *
47
+ * `TimelineEventData.accent` is currently INERT — no component reads it, so
48
+ * setting it changes nothing; color a row by passing a custom `marker` node
49
+ * instead. `timestamp` is a display node — format/translate it before
50
+ * passing. Node-valued props (`emptyState`, `marker`) may be passed as a prop
51
+ * or as the same-named slot; the default slot is `TimelineDate`'s children.
52
+ * The prop surface (documented on the exported `TimelineProps`,
53
+ * `TimelineEventProps`, `TimelineRailProps` and `TimelineDateProps`
54
+ * interfaces): Timeline(events, renderDateSeparator, emptyState, className),
55
+ * TimelineEvent(event, isLast, className), TimelineRail(marker, connector,
56
+ * className), TimelineDate(children, className).
57
+ *
58
+ * @module
59
+ */
60
+ export * from './Timeline.js';
61
+ export * from './TimelineDate.js';
62
+ export * from './TimelineEvent.js';
63
+ export * from './TimelineRail.js';
64
+ export * from './types.js';
65
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Vue chronological timeline primitives.
3
+ *
4
+ * Exports:
5
+ * - `<Timeline>` — vertical list of events with optional date separators.
6
+ * - `<TimelineEvent>` — one event row with rail (marker + connector) + content.
7
+ * - `<TimelineRail>` — standalone rail (marker + connector) for custom rows.
8
+ * - `<TimelineDate>` — date separator rendered between groups.
9
+ * - `TimelineEventData` type for event records.
10
+ *
11
+ * Use for activity chronologies, deal timelines, order tracking, audit logs.
12
+ * It is the Vue counterpart of `@molecule/app-timeline-react`: the same props
13
+ * (React names) and the same DOM for the same input, so switching framework is
14
+ * changing the package name in the imports.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * import { createApp, defineComponent, h } from 'vue'
19
+ * import { Timeline, TimelineDate } from '@molecule/app-timeline-vue'
20
+ *
21
+ * const App = defineComponent({
22
+ * setup() {
23
+ * const events = [
24
+ * { id: '1', timestamp: '2 hours ago', title: 'Order placed' },
25
+ * { id: '2', timestamp: 'Yesterday', title: 'Payment confirmed', body: 'Visa ending 4242' },
26
+ * { id: '3', timestamp: 'Mar 12', title: 'Item shipped' },
27
+ * ]
28
+ * return () =>
29
+ * h(Timeline, {
30
+ * events,
31
+ * renderDateSeparator: (event, prev) =>
32
+ * prev ? null : h(TimelineDate, null, () => [event.timestamp]),
33
+ * emptyState: 'No activity yet.',
34
+ * })
35
+ * },
36
+ * })
37
+ *
38
+ * createApp(App).mount('#app')
39
+ * ```
40
+ *
41
+ * @remarks
42
+ * This is NOT the Vue binding for `@molecule/app-timeline` (the headless
43
+ * provider core wired via `setProvider`) — it is standalone presentational
44
+ * markup with no provider. For domain-specific rows see the sibling
45
+ * `@molecule/app-{activity,order,status,stage,day}-timeline-vue` packages.
46
+ *
47
+ * `TimelineEventData.accent` is currently INERT — no component reads it, so
48
+ * setting it changes nothing; color a row by passing a custom `marker` node
49
+ * instead. `timestamp` is a display node — format/translate it before
50
+ * passing. Node-valued props (`emptyState`, `marker`) may be passed as a prop
51
+ * or as the same-named slot; the default slot is `TimelineDate`'s children.
52
+ * The prop surface (documented on the exported `TimelineProps`,
53
+ * `TimelineEventProps`, `TimelineRailProps` and `TimelineDateProps`
54
+ * interfaces): Timeline(events, renderDateSeparator, emptyState, className),
55
+ * TimelineEvent(event, isLast, className), TimelineRail(marker, connector,
56
+ * className), TimelineDate(children, className).
57
+ *
58
+ * @module
59
+ */
60
+ export * from './Timeline.js';
61
+ export * from './TimelineDate.js';
62
+ export * from './TimelineEvent.js';
63
+ export * from './TimelineRail.js';
64
+ export * from './types.js';
65
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Types for the Vue chronological timeline.
3
+ *
4
+ * @module
5
+ */
6
+ import type { VNodeChild } from 'vue';
7
+ /** One entry of a `<Timeline>`. */
8
+ export interface TimelineEventData {
9
+ /** Stable identifier for this event (used as the Vue key). */
10
+ id: string;
11
+ /** Marker icon / dot — defaults to a small dot. */
12
+ marker?: VNodeChild;
13
+ /** Display timestamp (ISO, relative, etc.). */
14
+ timestamp: VNodeChild;
15
+ /** Headline of the event. */
16
+ title: VNodeChild;
17
+ /** Optional body content. */
18
+ body?: VNodeChild;
19
+ /**
20
+ * Optional accent color hint. Currently INERT — no component consumes it,
21
+ * so setting it changes nothing; pass a custom `marker` node to color a row.
22
+ */
23
+ accent?: 'primary' | 'success' | 'warning' | 'error' | 'info' | 'neutral';
24
+ }
25
+ /** Props accepted by the {@link Timeline} component. */
26
+ export interface TimelineProps {
27
+ /** Events in display order. */
28
+ events: TimelineEventData[];
29
+ /** Optional renderer for date separators between consecutive events. */
30
+ renderDateSeparator?: (event: TimelineEventData, prev?: TimelineEventData) => VNodeChild;
31
+ /** Rendered when there are no events. Passed as a prop or as the `emptyState` slot. */
32
+ emptyState?: VNodeChild;
33
+ /** Extra classes on the outer wrapper. */
34
+ className?: string;
35
+ }
36
+ /** Props accepted by the {@link TimelineEvent} component. */
37
+ export interface TimelineEventProps {
38
+ /** The event to render. */
39
+ event: TimelineEventData;
40
+ /** Whether this is the last event in the list (suppresses the connector). */
41
+ isLast?: boolean;
42
+ /** Extra classes. */
43
+ className?: string;
44
+ }
45
+ /** Props accepted by the {@link TimelineRail} component. */
46
+ export interface TimelineRailProps {
47
+ /** Marker for this row — typically a dot or icon. Passed as a prop or as the `marker` slot. */
48
+ marker?: VNodeChild;
49
+ /** Whether to render the vertical connector below the marker. Defaults to `true`. */
50
+ connector?: boolean;
51
+ /** Extra classes on the outer wrapper. */
52
+ className?: string;
53
+ }
54
+ /** Props accepted by the {@link TimelineDate} component. */
55
+ export interface TimelineDateProps {
56
+ /** Date label ("Today", "Yesterday", "March 12, 2025"). */
57
+ children: VNodeChild;
58
+ /** Extra classes. */
59
+ className?: string;
60
+ }
61
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAErC,mCAAmC;AACnC,MAAM,WAAW,iBAAiB;IAChC,8DAA8D;IAC9D,EAAE,EAAE,MAAM,CAAA;IACV,mDAAmD;IACnD,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,+CAA+C;IAC/C,SAAS,EAAE,UAAU,CAAA;IACrB,6BAA6B;IAC7B,KAAK,EAAE,UAAU,CAAA;IACjB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;CAC1E;AAED,wDAAwD;AACxD,MAAM,WAAW,aAAa;IAC5B,+BAA+B;IAC/B,MAAM,EAAE,iBAAiB,EAAE,CAAA;IAC3B,wEAAwE;IACxE,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,iBAAiB,KAAK,UAAU,CAAA;IACxF,uFAAuF;IACvF,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,6DAA6D;AAC7D,MAAM,WAAW,kBAAkB;IACjC,2BAA2B;IAC3B,KAAK,EAAE,iBAAiB,CAAA;IACxB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,4DAA4D;AAC5D,MAAM,WAAW,iBAAiB;IAChC,+FAA+F;IAC/F,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,qFAAqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,4DAA4D;AAC5D,MAAM,WAAW,iBAAiB;IAChC,2DAA2D;IAC3D,QAAQ,EAAE,UAAU,CAAA;IACpB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
package/dist/types.js ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Types for the Vue chronological timeline.
3
+ *
4
+ * @module
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
package/package.json CHANGED
@@ -1,6 +1,65 @@
1
1
  {
2
2
  "name": "@molecule/app-timeline-vue",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.1.0",
4
+ "description": "Vue chronological timeline with event rails and date markers",
5
+ "homepage": "https://www.molecule.dev/packages/app-timeline-vue",
6
+ "type": "module",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc",
21
+ "dev": "vue-tsc --watch",
22
+ "test": "vitest run",
23
+ "test:watch": "vitest"
24
+ },
25
+ "keywords": [
26
+ "molecule",
27
+ "timeline-ui",
28
+ "vue"
29
+ ],
30
+ "author": "Molecule Dev, Inc. (https://molecule.dev)",
31
+ "license": "Apache-2.0",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/molecule-dev/molecule.git",
35
+ "directory": "packages/app/features/timeline-vue"
36
+ },
37
+ "engines": {
38
+ "node": ">=20"
39
+ },
40
+ "bugs": "https://github.com/molecule-dev/molecule/issues",
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "peerDependencies": {
45
+ "@molecule/app-ui": "^1.0.1",
46
+ "@molecule/app-ui-vue": "^1.1.0",
47
+ "@molecule/app-vue": "^3.5.0",
48
+ "vue": "^3.4.0"
49
+ },
50
+ "devDependencies": {
51
+ "@molecule/app-framework-conformance": "0.0.0",
52
+ "@molecule/app-i18n": "1.2.2",
53
+ "@molecule/app-icons": "1.0.4",
54
+ "@molecule/app-ui": "1.5.0",
55
+ "@molecule/app-ui-vue": "1.2.1",
56
+ "@molecule/app-vue": "3.9.0",
57
+ "@types/node": "26.6.5",
58
+ "jsdom": "30.1.3",
59
+ "typescript": "6.0.3",
60
+ "vite": "8.3.5",
61
+ "vitest": "4.1.12",
62
+ "vue": "3.5.44",
63
+ "vue-tsc": "3.3.13"
64
+ }
65
+ }