@molecule/app-stage-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.
- package/README.md +211 -4
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,11 +1,218 @@
|
|
|
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:26.531Z
|
|
7
|
+
-->
|
|
8
|
+
|
|
1
9
|
# @molecule/app-stage-timeline-vue
|
|
2
10
|
|
|
3
|
-
|
|
11
|
+
Vue multi-stage horizontal progress timeline with a current-stage marker.
|
|
12
|
+
Used by employee-onboarding, applicant-tracking, kanban-board status
|
|
13
|
+
flows, and order-fulfillment progress trackers.
|
|
14
|
+
|
|
15
|
+
Exports `<StageTimeline>` and `statusOf` — the Vue counterpart of
|
|
16
|
+
`@molecule/app-stage-timeline-react`, with the same props (React names) and
|
|
17
|
+
the same DOM for the same input.
|
|
18
|
+
|
|
19
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
20
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
21
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { createApp, defineComponent, h } from 'vue'
|
|
27
|
+
import { StageTimeline } from '@molecule/app-stage-timeline-vue'
|
|
28
|
+
|
|
29
|
+
const Timeline = defineComponent({
|
|
30
|
+
setup() {
|
|
31
|
+
return () =>
|
|
32
|
+
h(StageTimeline, {
|
|
33
|
+
currentIndex: 2,
|
|
34
|
+
stages: [
|
|
35
|
+
{ id: 'applied', label: 'Applied' },
|
|
36
|
+
{ id: 'screen', label: 'Phone Screen' },
|
|
37
|
+
{ id: 'onsite', label: 'On-site' },
|
|
38
|
+
{ id: 'offer', label: 'Offer' },
|
|
39
|
+
],
|
|
40
|
+
})
|
|
41
|
+
},
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
createApp(Timeline).mount('#app')
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Type
|
|
48
|
+
|
|
49
|
+
`feature`
|
|
50
|
+
|
|
51
|
+
## Installation
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm install @molecule/app-stage-timeline-vue @molecule/app-i18n @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## API
|
|
58
|
+
|
|
59
|
+
### Interfaces
|
|
60
|
+
|
|
61
|
+
#### `StageTimelineStage`
|
|
62
|
+
|
|
63
|
+
A single stage on the timeline.
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
interface StageTimelineStage {
|
|
67
|
+
/** Stable id (used as the render key + `data-stage-id`). */
|
|
68
|
+
id: string
|
|
69
|
+
/** Stage label (e.g. "Applied", "Phone Screen", "Offer"). */
|
|
70
|
+
label: VNodeChild
|
|
71
|
+
/** Optional secondary line (timestamp, owner, etc.). */
|
|
72
|
+
subtitle?: VNodeChild
|
|
73
|
+
/** Optional click handler. */
|
|
74
|
+
onClick?: () => void
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### `StageTimelineProps`
|
|
79
|
+
|
|
80
|
+
Props for {@link StageTimeline}.
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
interface StageTimelineProps {
|
|
84
|
+
/** Ordered stages to render, left-to-right. */
|
|
85
|
+
stages: StageTimelineStage[]
|
|
86
|
+
/**
|
|
87
|
+
* Index of the **current** stage (0-based). Stages before this index
|
|
88
|
+
* are rendered as `completed`; stages after are rendered as `upcoming`.
|
|
89
|
+
* Pass `-1` to render every stage as upcoming (e.g. before kickoff).
|
|
90
|
+
* Pass `stages.length` to render every stage as completed (process done).
|
|
91
|
+
*/
|
|
92
|
+
currentIndex: number
|
|
93
|
+
/** `data-mol-id` attribute for AI-agent selectors. */
|
|
94
|
+
dataMolId?: string
|
|
95
|
+
/** Extra classes appended via the ClassMap `cn()` helper. */
|
|
96
|
+
className?: string
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Types
|
|
101
|
+
|
|
102
|
+
#### `StageStatus`
|
|
103
|
+
|
|
104
|
+
Per-stage rendering state.
|
|
4
105
|
|
|
106
|
+
```typescript
|
|
107
|
+
type StageStatus = 'completed' | 'current' | 'upcoming'
|
|
5
108
|
```
|
|
6
|
-
|
|
109
|
+
|
|
110
|
+
### Functions
|
|
111
|
+
|
|
112
|
+
#### `statusOf(i, currentIndex)`
|
|
113
|
+
|
|
114
|
+
Resolve a stage's rendering status given its index and the current index.
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
function statusOf(i: number, currentIndex: number): StageStatus
|
|
7
118
|
```
|
|
8
119
|
|
|
9
|
-
|
|
120
|
+
- `i` — Zero-based stage index.
|
|
121
|
+
- `currentIndex` — Index of the current stage (`-1` = none, `len` = all done).
|
|
122
|
+
|
|
123
|
+
**Returns:** The rendering status for stage `i`.
|
|
124
|
+
|
|
125
|
+
### Constants
|
|
126
|
+
|
|
127
|
+
#### `StageTimeline`
|
|
128
|
+
|
|
129
|
+
Multi-stage horizontal progress timeline with a current-stage marker.
|
|
130
|
+
Each stage renders as a labeled circle on a connecting rail; completed
|
|
131
|
+
stages fill in, the current stage gets a highlighted ring, and upcoming
|
|
132
|
+
stages stay outlined.
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
const StageTimeline: DefineComponent<
|
|
136
|
+
ExtractPropTypes<{
|
|
137
|
+
stages: { type: PropType<StageTimelineStage[]>; required: true }
|
|
138
|
+
currentIndex: { type: NumberConstructor; required: true }
|
|
139
|
+
dataMolId: StringConstructor
|
|
140
|
+
className: StringConstructor
|
|
141
|
+
}>,
|
|
142
|
+
() => VNode,
|
|
143
|
+
{},
|
|
144
|
+
{},
|
|
145
|
+
{},
|
|
146
|
+
ComponentOptionsMixin,
|
|
147
|
+
ComponentOptionsMixin,
|
|
148
|
+
{},
|
|
149
|
+
string,
|
|
150
|
+
PublicProps,
|
|
151
|
+
Readonly<
|
|
152
|
+
ExtractPropTypes<{
|
|
153
|
+
stages: { type: PropType<StageTimelineStage[]>; required: true }
|
|
154
|
+
currentIndex: { type: NumberConstructor; required: true }
|
|
155
|
+
dataMolId: StringConstructor
|
|
156
|
+
className: StringConstructor
|
|
157
|
+
}>
|
|
158
|
+
> &
|
|
159
|
+
Readonly<{}>,
|
|
160
|
+
{},
|
|
161
|
+
{},
|
|
162
|
+
{},
|
|
163
|
+
{},
|
|
164
|
+
string,
|
|
165
|
+
ComponentProvideOptions,
|
|
166
|
+
true,
|
|
167
|
+
{},
|
|
168
|
+
any
|
|
169
|
+
>
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
- `props` — Component props (see {@link StageTimelineProps}).
|
|
173
|
+
|
|
174
|
+
**Returns:** The timeline component.
|
|
175
|
+
|
|
176
|
+
## Injection Notes
|
|
177
|
+
|
|
178
|
+
### Requirements
|
|
179
|
+
|
|
180
|
+
Peer dependencies:
|
|
181
|
+
|
|
182
|
+
- `@molecule/app-i18n` ^1.0.1
|
|
183
|
+
- `@molecule/app-ui` ^1.0.1
|
|
184
|
+
- `@molecule/app-ui-vue` ^1.1.0
|
|
185
|
+
- `@molecule/app-vue` ^3.5.0
|
|
186
|
+
- `vue` ^3.4.0
|
|
187
|
+
|
|
188
|
+
### Runtime Dependencies
|
|
189
|
+
|
|
190
|
+
- `@molecule/app-i18n`
|
|
191
|
+
- `@molecule/app-ui`
|
|
192
|
+
- `@molecule/app-ui-vue`
|
|
193
|
+
- `@molecule/app-vue`
|
|
194
|
+
- `vue`
|
|
195
|
+
|
|
196
|
+
- Must render inside the app's i18n provider and with a ClassMap bond
|
|
197
|
+
wired (`useTranslation()` / `getClassMap()` throw otherwise).
|
|
198
|
+
- Colors are read from `--mol-color-primary`, `--mol-color-on-primary`,
|
|
199
|
+
`--mol-color-primary-container`, `--mol-color-outline`,
|
|
200
|
+
`--mol-color-surface(-variant)`, `--mol-color-on-surface(-variant)`
|
|
201
|
+
CSS custom properties with hardcoded light-theme fallbacks
|
|
202
|
+
(blue #3366ff, black-alpha grays). Define those `--mol-color-*`
|
|
203
|
+
variables in your theme (both light and dark) or the timeline stays
|
|
204
|
+
default-blue and looks wrong in dark mode.
|
|
205
|
+
- `currentIndex` semantics: stages before it render completed, after
|
|
206
|
+
it upcoming; pass `-1` for "not started" and `stages.length` for
|
|
207
|
+
"all done".
|
|
208
|
+
- Stage dots render as buttons but are disabled unless that stage has
|
|
209
|
+
an `onClick`.
|
|
210
|
+
- Labels and subtitles are VNodes (or plain text), as React's `ReactNode`
|
|
211
|
+
fields are.
|
|
212
|
+
- This is the horizontal stage/pipeline marker; for a vertical
|
|
213
|
+
ordered-step list use `@molecule/app-status-timeline-vue`, and for
|
|
214
|
+
wizard/checkout progress chrome use `@molecule/app-stepper-vue`.
|
|
215
|
+
|
|
216
|
+
## Translations
|
|
10
217
|
|
|
11
|
-
|
|
218
|
+
Translation strings are provided by `@molecule/app-locales-stage-timeline`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-stage-timeline-vue",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Multi-stage horizontal progress timeline with current marker — onboarding, applicant tracking, kanban status flow",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-stage-timeline-vue",
|
|
6
6
|
"type": "module",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"@molecule/app-framework-conformance": "0.0.0",
|
|
55
55
|
"@molecule/app-i18n": "1.2.2",
|
|
56
56
|
"@molecule/app-icons": "1.0.4",
|
|
57
|
-
"@molecule/app-ui": "1.
|
|
57
|
+
"@molecule/app-ui": "1.5.0",
|
|
58
58
|
"@molecule/app-ui-tailwind": "1.3.0",
|
|
59
|
-
"@molecule/app-ui-vue": "1.1
|
|
60
|
-
"@molecule/app-vue": "3.
|
|
59
|
+
"@molecule/app-ui-vue": "1.2.1",
|
|
60
|
+
"@molecule/app-vue": "3.9.0",
|
|
61
61
|
"@testing-library/dom": "10.4.2",
|
|
62
62
|
"@types/node": "26.6.5",
|
|
63
63
|
"jsdom": "30.1.3",
|