@molecule/app-stage-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,218 @@
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:26.531Z
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-stage-timeline-vue
10
+
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.
105
+
106
+ ```typescript
107
+ type StageStatus = 'completed' | 'current' | 'upcoming'
108
+ ```
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
118
+ ```
119
+
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
217
+
218
+ Translation strings are provided by `@molecule/app-locales-stage-timeline`.
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Vue multi-stage horizontal progress timeline with a current-stage marker.
3
+ *
4
+ * Vue counterpart of `@molecule/app-stage-timeline-react`'s `StageTimeline` —
5
+ * the same props (React names), the same ClassMap tokens, the same inline
6
+ * styles, and the same DOM for the same input.
7
+ *
8
+ * @module
9
+ */
10
+ import { type PropType, type VNode } from 'vue';
11
+ import type { StageStatus, StageTimelineStage } from './types.js';
12
+ /**
13
+ * Resolve a stage's rendering status given its index and the current index.
14
+ *
15
+ * @param i - Zero-based stage index.
16
+ * @param currentIndex - Index of the current stage (`-1` = none, `len` = all done).
17
+ * @returns The rendering status for stage `i`.
18
+ */
19
+ export declare function statusOf(i: number, currentIndex: number): StageStatus;
20
+ /**
21
+ * Multi-stage horizontal progress timeline with a current-stage marker.
22
+ * Each stage renders as a labeled circle on a connecting rail; completed
23
+ * stages fill in, the current stage gets a highlighted ring, and upcoming
24
+ * stages stay outlined.
25
+ *
26
+ * @param props - Component props (see {@link StageTimelineProps}).
27
+ * @returns The timeline component.
28
+ */
29
+ export declare const StageTimeline: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
30
+ stages: {
31
+ type: PropType<StageTimelineStage[]>;
32
+ required: true;
33
+ };
34
+ currentIndex: {
35
+ type: NumberConstructor;
36
+ required: true;
37
+ };
38
+ dataMolId: StringConstructor;
39
+ className: StringConstructor;
40
+ }>, () => VNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
41
+ stages: {
42
+ type: PropType<StageTimelineStage[]>;
43
+ required: true;
44
+ };
45
+ currentIndex: {
46
+ type: NumberConstructor;
47
+ required: true;
48
+ };
49
+ dataMolId: StringConstructor;
50
+ className: StringConstructor;
51
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
52
+ //# sourceMappingURL=StageTimeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StageTimeline.d.ts","sourceRoot":"","sources":["../src/StageTimeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAsB,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAmB,MAAM,KAAK,CAAA;AAKpF,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AASjE;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,WAAW,CAIrE;AAkGD;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa;;cAGG,QAAQ,CAAC,kBAAkB,EAAE,CAAC;;;;;;;;;UAmF5C,KAAK;;cAnFS,QAAQ,CAAC,kBAAkB,EAAE,CAAC;;;;;;;;;iGAkJzD,CAAA"}
@@ -0,0 +1,238 @@
1
+ /**
2
+ * Vue multi-stage horizontal progress timeline with a current-stage marker.
3
+ *
4
+ * Vue counterpart of `@molecule/app-stage-timeline-react`'s `StageTimeline` —
5
+ * the same props (React names), the same ClassMap tokens, the same inline
6
+ * styles, and the same DOM for the same input.
7
+ *
8
+ * @module
9
+ */
10
+ import { defineComponent, h } from 'vue';
11
+ import { getClassMap } from '@molecule/app-ui';
12
+ import { useTranslation } from '@molecule/app-vue';
13
+ /**
14
+ * Resolve a stage's rendering status given its index and the current index.
15
+ *
16
+ * @param i - Zero-based stage index.
17
+ * @param currentIndex - Index of the current stage (`-1` = none, `len` = all done).
18
+ * @returns The rendering status for stage `i`.
19
+ */
20
+ export function statusOf(i, currentIndex) {
21
+ if (i < currentIndex)
22
+ return 'completed';
23
+ if (i === currentIndex)
24
+ return 'current';
25
+ return 'upcoming';
26
+ }
27
+ /**
28
+ * Children for an element: an array stays as it is, `null`/`undefined`
29
+ * contribute nothing, anything else becomes one child.
30
+ *
31
+ * @param value - A node-valued field.
32
+ * @returns The element's children.
33
+ */
34
+ const childrenOf = (value) => value == null ? [] : Array.isArray(value) ? value : [value];
35
+ /**
36
+ * One stage marker's dot style, as Vue's style object. Numbers are written
37
+ * with their unit as strings, because only React's style object adds `px` to a
38
+ * bare number; the serialized style is what every framework must match.
39
+ *
40
+ * @param stage - The stage the dot belongs to.
41
+ * @param status - The stage's rendering status.
42
+ * @returns The dot's inline style.
43
+ */
44
+ const dotStyle = (stage, status) => {
45
+ const isCompleted = status === 'completed';
46
+ const isCurrent = status === 'current';
47
+ const style = {
48
+ width: '28px',
49
+ height: '28px',
50
+ borderRadius: '50%',
51
+ border: `2px solid ${isCompleted || isCurrent
52
+ ? 'var(--mol-color-primary, #3366ff)'
53
+ : 'var(--mol-color-outline, rgba(0,0,0,0.25))'}`,
54
+ background: isCompleted
55
+ ? 'var(--mol-color-primary, #3366ff)'
56
+ : isCurrent
57
+ ? 'var(--mol-color-primary-container, rgba(51,102,255,0.18))'
58
+ : 'var(--mol-color-surface, transparent)',
59
+ color: isCompleted ? 'var(--mol-color-on-primary, #fff)' : 'inherit',
60
+ display: 'inline-flex',
61
+ alignItems: 'center',
62
+ justifyContent: 'center',
63
+ fontSize: '14px',
64
+ fontWeight: '700',
65
+ cursor: stage.onClick ? 'pointer' : 'default',
66
+ transition: 'box-shadow 200ms ease, background 200ms ease',
67
+ // React merges `{ ...dotStyle, padding: 0 }` onto the button.
68
+ padding: '0px',
69
+ };
70
+ if (isCurrent)
71
+ style.boxShadow = '0 0 0 4px var(--mol-color-primary-container, rgba(51,102,255,0.18))';
72
+ return style;
73
+ };
74
+ /**
75
+ * The status-independent style of a stage's wrapper column.
76
+ *
77
+ * @returns The wrapper's inline style.
78
+ */
79
+ const stageWrapperStyle = () => ({
80
+ position: 'relative',
81
+ zIndex: '1',
82
+ display: 'flex',
83
+ flexDirection: 'column',
84
+ alignItems: 'center',
85
+ gap: '6px',
86
+ minWidth: '0px',
87
+ });
88
+ /**
89
+ * The stage's accessible label, built from the same i18n key and default
90
+ * message React uses (only a plain string label is carried into it).
91
+ *
92
+ * @param t - The translation function.
93
+ * @param stage - The stage.
94
+ * @param index - The stage's zero-based index.
95
+ * @param total - The number of stages.
96
+ * @param status - The stage's rendering status.
97
+ * @returns The aria label.
98
+ */
99
+ const stageAria = (t, stage, index, total, status) => t('stageTimeline.stage', {
100
+ label: typeof stage.label === 'string' ? stage.label : '',
101
+ index: index + 1,
102
+ total,
103
+ status,
104
+ }, { defaultValue: 'Stage {{index}} of {{total}}: {{label}} ({{status}})' });
105
+ /**
106
+ * Multi-stage horizontal progress timeline with a current-stage marker.
107
+ * Each stage renders as a labeled circle on a connecting rail; completed
108
+ * stages fill in, the current stage gets a highlighted ring, and upcoming
109
+ * stages stay outlined.
110
+ *
111
+ * @param props - Component props (see {@link StageTimelineProps}).
112
+ * @returns The timeline component.
113
+ */
114
+ export const StageTimeline = defineComponent({
115
+ name: 'StageTimeline',
116
+ props: {
117
+ stages: { type: Array, required: true },
118
+ currentIndex: { type: Number, required: true },
119
+ dataMolId: String,
120
+ className: String,
121
+ },
122
+ setup(props) {
123
+ const cm = getClassMap();
124
+ const { t } = useTranslation();
125
+ /**
126
+ * One stage marker + its label, as a Vue vnode.
127
+ *
128
+ * @param stage - The stage.
129
+ * @param index - The stage's zero-based index.
130
+ * @returns The rendered stage marker.
131
+ */
132
+ const stageDot = (stage, index) => {
133
+ const status = statusOf(index, props.currentIndex);
134
+ const isCompleted = status === 'completed';
135
+ const isCurrent = status === 'current';
136
+ const ariaLabel = stageAria(t, stage, index, props.stages.length, status);
137
+ return h('div', {
138
+ // React keys each stage by `stage.id`; Vue keeps the same nodes only
139
+ // when the vnode carries the same key.
140
+ key: stage.id,
141
+ role: 'listitem',
142
+ 'data-stage-id': stage.id,
143
+ 'data-stage-status': status,
144
+ 'data-mol-id': 'stage-timeline-stage',
145
+ 'aria-current': isCurrent ? 'step' : undefined,
146
+ 'aria-label': ariaLabel,
147
+ style: stageWrapperStyle(),
148
+ }, [
149
+ h('button', {
150
+ type: 'button',
151
+ onClick: stage.onClick,
152
+ disabled: !stage.onClick,
153
+ 'aria-label': ariaLabel,
154
+ 'data-mol-id': 'stage-timeline-dot',
155
+ style: dotStyle(stage, status),
156
+ }, [isCompleted ? '✓' : index + 1]),
157
+ h('span', {
158
+ class: cm.cn(cm.textSize('xs'), cm.fontWeight(isCurrent ? 'semibold' : 'normal')),
159
+ 'data-mol-id': 'stage-timeline-label',
160
+ style: {
161
+ textAlign: 'center',
162
+ color: isCurrent
163
+ ? 'var(--mol-color-primary, #3366ff)'
164
+ : isCompleted
165
+ ? 'var(--mol-color-on-surface, inherit)'
166
+ : 'var(--mol-color-on-surface-variant, #666)',
167
+ },
168
+ }, childrenOf(stage.label)),
169
+ stage.subtitle
170
+ ? h('span', {
171
+ class: cm.textSize('xs'),
172
+ 'data-mol-id': 'stage-timeline-subtitle',
173
+ style: {
174
+ textAlign: 'center',
175
+ color: 'var(--mol-color-on-surface-variant, #888)',
176
+ },
177
+ }, childrenOf(stage.subtitle))
178
+ : null,
179
+ ]);
180
+ };
181
+ return () => {
182
+ const attributes = {
183
+ class: cm.cn(props.className),
184
+ role: 'list',
185
+ 'aria-label': t('stageTimeline.group', {}, { defaultValue: 'Stage timeline' }),
186
+ 'data-mol-id': props.dataMolId ?? 'stage-timeline',
187
+ };
188
+ if (props.stages.length === 0)
189
+ return h('div', attributes);
190
+ // Total fill ratio: how full the connector rail should be (0–1).
191
+ const denom = Math.max(1, props.stages.length - 1);
192
+ const fillRatio = Math.max(0, Math.min(1, props.currentIndex / denom));
193
+ const inset = `${(0.5 / props.stages.length) * 100}%`;
194
+ attributes.style = {
195
+ position: 'relative',
196
+ display: 'grid',
197
+ gridTemplateColumns: `repeat(${props.stages.length}, minmax(0, 1fr))`,
198
+ alignItems: 'start',
199
+ };
200
+ return h('div', attributes, [
201
+ h('div', {
202
+ 'aria-hidden': 'true',
203
+ style: {
204
+ position: 'absolute',
205
+ top: '14px', // line up with dot center (dot is 28 ⇒ radius 14)
206
+ left: inset,
207
+ right: inset,
208
+ height: '2px',
209
+ pointerEvents: 'none',
210
+ },
211
+ 'data-mol-id': 'stage-timeline-rail',
212
+ }, [
213
+ h('div', {
214
+ style: {
215
+ position: 'absolute',
216
+ inset: '0px',
217
+ background: 'var(--mol-color-surface-variant, rgba(0,0,0,0.12))',
218
+ },
219
+ }),
220
+ h('div', {
221
+ style: {
222
+ position: 'absolute',
223
+ top: '0px',
224
+ bottom: '0px',
225
+ left: '0px',
226
+ width: `${fillRatio * 100}%`,
227
+ background: 'var(--mol-color-primary, #3366ff)',
228
+ transition: 'width 200ms ease',
229
+ },
230
+ 'data-mol-id': 'stage-timeline-rail-fill',
231
+ }),
232
+ ]),
233
+ ...props.stages.map((stage, i) => stageDot(stage, i)),
234
+ ]);
235
+ };
236
+ },
237
+ });
238
+ //# sourceMappingURL=StageTimeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StageTimeline.js","sourceRoot":"","sources":["../src/StageTimeline.ts"],"names":[],"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,KAAK;4BACX,KAAK,EAAE,GAAG,SAAS,GAAG,GAAG,GAAG;4BAC5B,UAAU,EAAE,mCAAmC;4BAC/C,UAAU,EAAE,kBAAkB;yBAC/B;wBACD,aAAa,EAAE,0BAA0B;qBAC1C,CAAC;iBACH,CACF;gBACD,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;aACtD,CAAC,CAAA;QACJ,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Vue multi-stage horizontal progress timeline with a current-stage marker.
3
+ * Used by employee-onboarding, applicant-tracking, kanban-board status
4
+ * flows, and order-fulfillment progress trackers.
5
+ *
6
+ * Exports `<StageTimeline>` and `statusOf` — the Vue counterpart of
7
+ * `@molecule/app-stage-timeline-react`, with the same props (React names) and
8
+ * the same DOM for the same input.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { createApp, defineComponent, h } from 'vue'
13
+ * import { StageTimeline } from '@molecule/app-stage-timeline-vue'
14
+ *
15
+ * const Timeline = defineComponent({
16
+ * setup() {
17
+ * return () =>
18
+ * h(StageTimeline, {
19
+ * currentIndex: 2,
20
+ * stages: [
21
+ * { id: 'applied', label: 'Applied' },
22
+ * { id: 'screen', label: 'Phone Screen' },
23
+ * { id: 'onsite', label: 'On-site' },
24
+ * { id: 'offer', label: 'Offer' },
25
+ * ],
26
+ * })
27
+ * },
28
+ * })
29
+ *
30
+ * createApp(Timeline).mount('#app')
31
+ * ```
32
+ *
33
+ * @remarks
34
+ * - Must render inside the app's i18n provider and with a ClassMap bond
35
+ * wired (`useTranslation()` / `getClassMap()` throw otherwise).
36
+ * - Colors are read from `--mol-color-primary`, `--mol-color-on-primary`,
37
+ * `--mol-color-primary-container`, `--mol-color-outline`,
38
+ * `--mol-color-surface(-variant)`, `--mol-color-on-surface(-variant)`
39
+ * CSS custom properties with hardcoded light-theme fallbacks
40
+ * (blue #3366ff, black-alpha grays). Define those `--mol-color-*`
41
+ * variables in your theme (both light and dark) or the timeline stays
42
+ * default-blue and looks wrong in dark mode.
43
+ * - `currentIndex` semantics: stages before it render completed, after
44
+ * it upcoming; pass `-1` for "not started" and `stages.length` for
45
+ * "all done".
46
+ * - Stage dots render as buttons but are disabled unless that stage has
47
+ * an `onClick`.
48
+ * - Labels and subtitles are VNodes (or plain text), as React's `ReactNode`
49
+ * fields are.
50
+ * - This is the horizontal stage/pipeline marker; for a vertical
51
+ * ordered-step list use `@molecule/app-status-timeline-vue`, and for
52
+ * wizard/checkout progress chrome use `@molecule/app-stepper-vue`.
53
+ *
54
+ * @module
55
+ */
56
+ export * from './StageTimeline.js';
57
+ export * from './types.js';
58
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Vue multi-stage horizontal progress timeline with a current-stage marker.
3
+ * Used by employee-onboarding, applicant-tracking, kanban-board status
4
+ * flows, and order-fulfillment progress trackers.
5
+ *
6
+ * Exports `<StageTimeline>` and `statusOf` — the Vue counterpart of
7
+ * `@molecule/app-stage-timeline-react`, with the same props (React names) and
8
+ * the same DOM for the same input.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { createApp, defineComponent, h } from 'vue'
13
+ * import { StageTimeline } from '@molecule/app-stage-timeline-vue'
14
+ *
15
+ * const Timeline = defineComponent({
16
+ * setup() {
17
+ * return () =>
18
+ * h(StageTimeline, {
19
+ * currentIndex: 2,
20
+ * stages: [
21
+ * { id: 'applied', label: 'Applied' },
22
+ * { id: 'screen', label: 'Phone Screen' },
23
+ * { id: 'onsite', label: 'On-site' },
24
+ * { id: 'offer', label: 'Offer' },
25
+ * ],
26
+ * })
27
+ * },
28
+ * })
29
+ *
30
+ * createApp(Timeline).mount('#app')
31
+ * ```
32
+ *
33
+ * @remarks
34
+ * - Must render inside the app's i18n provider and with a ClassMap bond
35
+ * wired (`useTranslation()` / `getClassMap()` throw otherwise).
36
+ * - Colors are read from `--mol-color-primary`, `--mol-color-on-primary`,
37
+ * `--mol-color-primary-container`, `--mol-color-outline`,
38
+ * `--mol-color-surface(-variant)`, `--mol-color-on-surface(-variant)`
39
+ * CSS custom properties with hardcoded light-theme fallbacks
40
+ * (blue #3366ff, black-alpha grays). Define those `--mol-color-*`
41
+ * variables in your theme (both light and dark) or the timeline stays
42
+ * default-blue and looks wrong in dark mode.
43
+ * - `currentIndex` semantics: stages before it render completed, after
44
+ * it upcoming; pass `-1` for "not started" and `stages.length` for
45
+ * "all done".
46
+ * - Stage dots render as buttons but are disabled unless that stage has
47
+ * an `onClick`.
48
+ * - Labels and subtitles are VNodes (or plain text), as React's `ReactNode`
49
+ * fields are.
50
+ * - This is the horizontal stage/pipeline marker; for a vertical
51
+ * ordered-step list use `@molecule/app-status-timeline-vue`, and for
52
+ * wizard/checkout progress chrome use `@molecule/app-stepper-vue`.
53
+ *
54
+ * @module
55
+ */
56
+ export * from './StageTimeline.js';
57
+ export * from './types.js';
58
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Vue types for `<StageTimeline>` — the Vue counterpart of
3
+ * `@molecule/app-stage-timeline-react`'s public types, with Vue nodes where
4
+ * React has `ReactNode`.
5
+ *
6
+ * @module
7
+ */
8
+ import type { VNodeChild } from 'vue';
9
+ /** A single stage on the timeline. */
10
+ export interface StageTimelineStage {
11
+ /** Stable id (used as the render key + `data-stage-id`). */
12
+ id: string;
13
+ /** Stage label (e.g. "Applied", "Phone Screen", "Offer"). */
14
+ label: VNodeChild;
15
+ /** Optional secondary line (timestamp, owner, etc.). */
16
+ subtitle?: VNodeChild;
17
+ /** Optional click handler. */
18
+ onClick?: () => void;
19
+ }
20
+ /** Per-stage rendering state. */
21
+ export type StageStatus = 'completed' | 'current' | 'upcoming';
22
+ /** Props for {@link StageTimeline}. */
23
+ export interface StageTimelineProps {
24
+ /** Ordered stages to render, left-to-right. */
25
+ stages: StageTimelineStage[];
26
+ /**
27
+ * Index of the **current** stage (0-based). Stages before this index
28
+ * are rendered as `completed`; stages after are rendered as `upcoming`.
29
+ * Pass `-1` to render every stage as upcoming (e.g. before kickoff).
30
+ * Pass `stages.length` to render every stage as completed (process done).
31
+ */
32
+ currentIndex: number;
33
+ /** `data-mol-id` attribute for AI-agent selectors. */
34
+ dataMolId?: string;
35
+ /** Extra classes appended via the ClassMap `cn()` helper. */
36
+ className?: string;
37
+ }
38
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAErC,sCAAsC;AACtC,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAA;IACV,6DAA6D;IAC7D,KAAK,EAAE,UAAU,CAAA;IACjB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,iCAAiC;AACjC,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAA;AAE9D,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,MAAM,EAAE,kBAAkB,EAAE,CAAA;IAC5B;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
package/dist/types.js ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Vue types for `<StageTimeline>` — the Vue counterpart of
3
+ * `@molecule/app-stage-timeline-react`'s public types, with Vue nodes where
4
+ * React has `ReactNode`.
5
+ *
6
+ * @module
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
package/package.json CHANGED
@@ -1,6 +1,70 @@
1
1
  {
2
2
  "name": "@molecule/app-stage-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": "Multi-stage horizontal progress timeline with current marker — onboarding, applicant tracking, kanban status flow",
5
+ "homepage": "https://www.molecule.dev/packages/app-stage-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
+ "stage-timeline",
28
+ "stepper",
29
+ "progress",
30
+ "vue"
31
+ ],
32
+ "author": "Molecule Dev, Inc. (https://molecule.dev)",
33
+ "license": "Apache-2.0",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/molecule-dev/molecule.git",
37
+ "directory": "packages/app/features/stage-timeline-vue"
38
+ },
39
+ "engines": {
40
+ "node": ">=20"
41
+ },
42
+ "bugs": "https://github.com/molecule-dev/molecule/issues",
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "peerDependencies": {
47
+ "@molecule/app-i18n": "^1.0.1",
48
+ "@molecule/app-ui": "^1.0.1",
49
+ "@molecule/app-ui-vue": "^1.1.0",
50
+ "@molecule/app-vue": "^3.5.0",
51
+ "vue": "^3.4.0"
52
+ },
53
+ "devDependencies": {
54
+ "@molecule/app-framework-conformance": "0.0.0",
55
+ "@molecule/app-i18n": "1.2.2",
56
+ "@molecule/app-icons": "1.0.4",
57
+ "@molecule/app-ui": "1.5.0",
58
+ "@molecule/app-ui-tailwind": "1.3.0",
59
+ "@molecule/app-ui-vue": "1.2.1",
60
+ "@molecule/app-vue": "3.9.0",
61
+ "@testing-library/dom": "10.4.2",
62
+ "@types/node": "26.6.5",
63
+ "jsdom": "30.1.3",
64
+ "typescript": "6.0.3",
65
+ "vite": "8.3.5",
66
+ "vitest": "4.1.12",
67
+ "vue": "3.5.44",
68
+ "vue-tsc": "3.3.13"
69
+ }
70
+ }