@molecule/app-stage-timeline-solid 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,182 @@
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:25.740Z
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-solid
10
+
11
+ Solid 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 Solid 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
+ ```tsx
26
+ import { StageTimeline } from '@molecule/app-stage-timeline-solid'
27
+
28
+ ;<StageTimeline
29
+ currentIndex={2}
30
+ stages={[
31
+ { id: 'applied', label: 'Applied' },
32
+ { id: 'screen', label: 'Phone Screen' },
33
+ { id: 'onsite', label: 'On-site' },
34
+ { id: 'offer', label: 'Offer' },
35
+ ]}
36
+ />
37
+ ```
38
+
39
+ ## Type
40
+
41
+ `feature`
42
+
43
+ ## Installation
44
+
45
+ ```bash
46
+ npm install @molecule/app-stage-timeline-solid @molecule/app-i18n @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js
47
+ ```
48
+
49
+ ## API
50
+
51
+ ### Interfaces
52
+
53
+ #### `StageTimelineStage`
54
+
55
+ A single stage on the timeline.
56
+
57
+ ```typescript
58
+ interface StageTimelineStage {
59
+ /** Stable id (used as the render key + `data-stage-id`). */
60
+ id: string
61
+ /** Stage label (e.g. "Applied", "Phone Screen", "Offer"). */
62
+ label: JSX.Element
63
+ /** Optional secondary line (timestamp, owner, etc.). */
64
+ subtitle?: JSX.Element
65
+ /** Optional click handler. */
66
+ onClick?: () => void
67
+ }
68
+ ```
69
+
70
+ #### `StageTimelineProps`
71
+
72
+ Props for {@link StageTimeline}.
73
+
74
+ ```typescript
75
+ interface StageTimelineProps {
76
+ /** Ordered stages to render, left-to-right. */
77
+ stages: StageTimelineStage[]
78
+ /**
79
+ * Index of the **current** stage (0-based). Stages before this index
80
+ * are rendered as `completed`; stages after are rendered as `upcoming`.
81
+ * Pass `-1` to render every stage as upcoming (e.g. before kickoff).
82
+ * Pass `stages.length` to render every stage as completed (process done).
83
+ */
84
+ currentIndex: number
85
+ /** `data-mol-id` attribute for AI-agent selectors. */
86
+ dataMolId?: string
87
+ /** Extra classes appended via the ClassMap `cn()` helper. */
88
+ className?: string
89
+ }
90
+ ```
91
+
92
+ ### Types
93
+
94
+ #### `StageStatus`
95
+
96
+ Per-stage rendering state.
97
+
98
+ ```typescript
99
+ type StageStatus = 'completed' | 'current' | 'upcoming'
100
+ ```
101
+
102
+ ### Functions
103
+
104
+ #### `statusOf(i, currentIndex)`
105
+
106
+ Resolve a stage's rendering status given its index and the current index.
107
+
108
+ ```typescript
109
+ function statusOf(i: number, currentIndex: number): StageStatus
110
+ ```
111
+
112
+ - `i` — Zero-based stage index.
113
+ - `currentIndex` — Index of the current stage (`-1` = none, `len` = all done).
114
+
115
+ **Returns:** The rendering status for stage `i`.
116
+
117
+ #### `StageTimeline(props)`
118
+
119
+ Multi-stage horizontal progress timeline with a current-stage marker.
120
+ Each stage renders as a labeled circle on a connecting rail; completed
121
+ stages fill in, the current stage gets a highlighted ring, and upcoming
122
+ stages stay outlined.
123
+
124
+ React keys each stage by its `id`, so a re-passed or re-ordered stage list
125
+ keeps the rendered markers per id. Solid's `For` keys by reference, so the
126
+ rows are keyed through stable per-id records: the record for an id is created
127
+ once and reused, while the stage's content reads the CURRENT stage for that
128
+ id reactively.
129
+
130
+ ```typescript
131
+ function StageTimeline(props: StageTimelineProps): JSX.Element
132
+ ```
133
+
134
+ - `props` — Component props (see {@link StageTimelineProps}).
135
+
136
+ **Returns:** The rendered timeline.
137
+
138
+ ## Injection Notes
139
+
140
+ ### Requirements
141
+
142
+ Peer dependencies:
143
+
144
+ - `@molecule/app-i18n` ^1.0.1
145
+ - `@molecule/app-solid` ^3.5.0
146
+ - `@molecule/app-ui` ^1.0.1
147
+ - `@molecule/app-ui-solid` ^1.1.0
148
+ - `solid-js` ^1.8.0
149
+
150
+ ### Runtime Dependencies
151
+
152
+ - `@molecule/app-i18n`
153
+ - `@molecule/app-solid`
154
+ - `@molecule/app-ui`
155
+ - `@molecule/app-ui-solid`
156
+ - `solid-js`
157
+
158
+ - Must render inside the app's i18n provider and with a ClassMap bond
159
+ wired (`useTranslation()` / `getClassMap()` throw otherwise).
160
+ - Colors are read from `--mol-color-primary`, `--mol-color-on-primary`,
161
+ `--mol-color-primary-container`, `--mol-color-outline`,
162
+ `--mol-color-surface(-variant)`, `--mol-color-on-surface(-variant)`
163
+ CSS custom properties with hardcoded light-theme fallbacks
164
+ (blue #3366ff, black-alpha grays). Define those `--mol-color-*`
165
+ variables in your theme (both light and dark) or the timeline stays
166
+ default-blue and looks wrong in dark mode.
167
+ - `currentIndex` semantics: stages before it render completed, after
168
+ it upcoming; pass `-1` for "not started" and `stages.length` for
169
+ "all done".
170
+ - Stage dots render as buttons but are disabled unless that stage has
171
+ an `onClick`.
172
+ - Labels and subtitles are JSX values, as React's `ReactNode` fields are.
173
+ - Stages are keyed by `id` through stable per-id records (Solid's `For`
174
+ keys by reference), so a re-passed or re-ordered list keeps each marker's
175
+ DOM the way React's `key` does.
176
+ - This is the horizontal stage/pipeline marker; for a vertical
177
+ ordered-step list use `@molecule/app-status-timeline-solid`, and for
178
+ wizard/checkout progress chrome use `@molecule/app-stepper-solid`.
179
+
180
+ ## Translations
181
+
182
+ Translation strings are provided by `@molecule/app-locales-stage-timeline`.
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Solid multi-stage horizontal progress timeline with a current-stage marker.
3
+ *
4
+ * Solid 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 Component } from 'solid-js';
11
+ import type { StageStatus, StageTimelineProps } 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
+ * React keys each stage by its `id`, so a re-passed or re-ordered stage list
27
+ * keeps the rendered markers per id. Solid's `For` keys by reference, so the
28
+ * rows are keyed through stable per-id records: the record for an id is created
29
+ * once and reused, while the stage's content reads the CURRENT stage for that
30
+ * id reactively.
31
+ *
32
+ * @param props - Component props (see {@link StageTimelineProps}).
33
+ * @returns The rendered timeline.
34
+ */
35
+ export declare const StageTimeline: Component<StageTimelineProps>;
36
+ //# sourceMappingURL=StageTimeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StageTimeline.d.ts","sourceRoot":"","sources":["../src/StageTimeline.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAiB,MAAM,UAAU,CAAA;AAKxD,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAsB,MAAM,YAAY,CAAA;AAErF;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,WAAW,CAIrE;AAwID;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,kBAAkB,CA8FvD,CAAA"}
@@ -0,0 +1,185 @@
1
+ /**
2
+ * Solid multi-stage horizontal progress timeline with a current-stage marker.
3
+ *
4
+ * Solid 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 { For } from 'solid-js';
11
+ import { useTranslation } from '@molecule/app-solid';
12
+ import { getClassMap } from '@molecule/app-ui';
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
+ * One stage marker + its label, as React's internal `StageDot` renders it.
29
+ *
30
+ * @param props - The stage, its index and the timeline's current index.
31
+ * @returns The rendered stage marker.
32
+ */
33
+ const StageDot = (props) => {
34
+ const cm = getClassMap();
35
+ const { t } = useTranslation();
36
+ const status = () => statusOf(props.index, props.currentIndex);
37
+ const isCompleted = () => status() === 'completed';
38
+ const isCurrent = () => status() === 'current';
39
+ /** The stage's accessible label, built from React's i18n key and default message. */
40
+ const ariaLabel = () => t('stageTimeline.stage', {
41
+ label: typeof props.stage.label === 'string' ? props.stage.label : '',
42
+ index: props.index + 1,
43
+ total: props.total,
44
+ status: status(),
45
+ }, { defaultValue: 'Stage {{index}} of {{total}}: {{label}} ({{status}})' });
46
+ /** The dot's inline style; the connector geometry has no ClassMap resolver. */
47
+ const dotStyle = () => {
48
+ const completed = isCompleted();
49
+ const current = isCurrent();
50
+ return {
51
+ width: '28px',
52
+ height: '28px',
53
+ 'border-radius': '50%',
54
+ border: `2px solid ${completed || current
55
+ ? 'var(--mol-color-primary, #3366ff)'
56
+ : 'var(--mol-color-outline, rgba(0,0,0,0.25))'}`,
57
+ background: completed
58
+ ? 'var(--mol-color-primary, #3366ff)'
59
+ : current
60
+ ? 'var(--mol-color-primary-container, rgba(51,102,255,0.18))'
61
+ : 'var(--mol-color-surface, transparent)',
62
+ color: completed ? 'var(--mol-color-on-primary, #fff)' : 'inherit',
63
+ display: 'inline-flex',
64
+ 'align-items': 'center',
65
+ 'justify-content': 'center',
66
+ 'font-size': '14px',
67
+ 'font-weight': '700',
68
+ cursor: props.stage.onClick ? 'pointer' : 'default',
69
+ ...(current
70
+ ? { 'box-shadow': '0 0 0 4px var(--mol-color-primary-container, rgba(51,102,255,0.18))' }
71
+ : {}),
72
+ transition: 'box-shadow 200ms ease, background 200ms ease',
73
+ // React merges `{ ...dotStyle, padding: 0 }` onto the button.
74
+ padding: '0px',
75
+ };
76
+ };
77
+ /** The wrapper column's inline style. */
78
+ const wrapperStyle = () => ({
79
+ position: 'relative',
80
+ 'z-index': '1',
81
+ display: 'flex',
82
+ 'flex-direction': 'column',
83
+ 'align-items': 'center',
84
+ gap: '6px',
85
+ 'min-width': '0px',
86
+ });
87
+ return (<div role="listitem" data-stage-id={props.stage.id} data-stage-status={status()} data-mol-id="stage-timeline-stage" aria-current={isCurrent() ? 'step' : undefined} aria-label={ariaLabel()} style={wrapperStyle()}>
88
+ <button type="button" onClick={props.stage.onClick} disabled={!props.stage.onClick} aria-label={ariaLabel()} data-mol-id="stage-timeline-dot" style={dotStyle()}>
89
+ {isCompleted() ? '✓' : props.index + 1}
90
+ </button>
91
+ <span class={cm.cn(cm.textSize('xs'), cm.fontWeight(isCurrent() ? 'semibold' : 'normal'))} data-mol-id="stage-timeline-label" style={{
92
+ 'text-align': 'center',
93
+ color: isCurrent()
94
+ ? 'var(--mol-color-primary, #3366ff)'
95
+ : isCompleted()
96
+ ? 'var(--mol-color-on-surface, inherit)'
97
+ : 'var(--mol-color-on-surface-variant, #666)',
98
+ }}>
99
+ {props.stage.label}
100
+ </span>
101
+ {props.stage.subtitle ? (<span class={cm.textSize('xs')} data-mol-id="stage-timeline-subtitle" style={{
102
+ 'text-align': 'center',
103
+ color: 'var(--mol-color-on-surface-variant, #888)',
104
+ }}>
105
+ {props.stage.subtitle}
106
+ </span>) : null}
107
+ </div>);
108
+ };
109
+ /**
110
+ * Multi-stage horizontal progress timeline with a current-stage marker.
111
+ * Each stage renders as a labeled circle on a connecting rail; completed
112
+ * stages fill in, the current stage gets a highlighted ring, and upcoming
113
+ * stages stay outlined.
114
+ *
115
+ * React keys each stage by its `id`, so a re-passed or re-ordered stage list
116
+ * keeps the rendered markers per id. Solid's `For` keys by reference, so the
117
+ * rows are keyed through stable per-id records: the record for an id is created
118
+ * once and reused, while the stage's content reads the CURRENT stage for that
119
+ * id reactively.
120
+ *
121
+ * @param props - Component props (see {@link StageTimelineProps}).
122
+ * @returns The rendered timeline.
123
+ */
124
+ export const StageTimeline = (props) => {
125
+ const cm = getClassMap();
126
+ const { t } = useTranslation();
127
+ const records = new Map();
128
+ const keyedRows = () => {
129
+ const seen = new Set();
130
+ const rows = props.stages.map((stage) => {
131
+ seen.add(stage.id);
132
+ let row = records.get(stage.id);
133
+ if (!row) {
134
+ row = { id: stage.id };
135
+ records.set(stage.id, row);
136
+ }
137
+ return row;
138
+ });
139
+ for (const id of [...records.keys()])
140
+ if (!seen.has(id))
141
+ records.delete(id);
142
+ return rows;
143
+ };
144
+ const stageFor = (id) => props.stages.find((stage) => stage.id === id);
145
+ /** The wrapper's inline style — the rail geometry has no ClassMap resolver. */
146
+ const wrapperStyle = () => ({
147
+ position: 'relative',
148
+ display: 'grid',
149
+ 'grid-template-columns': `repeat(${props.stages.length}, minmax(0, 1fr))`,
150
+ 'align-items': 'start',
151
+ });
152
+ /** The connector rail's inline style (hidden behind the dots). */
153
+ const railStyle = () => ({
154
+ position: 'absolute',
155
+ top: '14px', // line up with dot center (dot is 28 ⇒ radius 14)
156
+ left: `${(0.5 / props.stages.length) * 100}%`,
157
+ right: `${(0.5 / props.stages.length) * 100}%`,
158
+ height: '2px',
159
+ 'pointer-events': 'none',
160
+ });
161
+ return (<div class={cm.cn(props.className)} role="list" aria-label={t('stageTimeline.group', {}, { defaultValue: 'Stage timeline' })} data-mol-id={props.dataMolId ?? 'stage-timeline'} style={props.stages.length === 0 ? undefined : wrapperStyle()}>
162
+ {props.stages.length === 0 ? null : (<>
163
+ <div aria-hidden="true" style={railStyle()} data-mol-id="stage-timeline-rail">
164
+ <div style={{
165
+ position: 'absolute',
166
+ inset: '0px',
167
+ background: 'var(--mol-color-surface-variant, rgba(0,0,0,0.12))',
168
+ }}/>
169
+ <div style={{
170
+ position: 'absolute',
171
+ top: '0px',
172
+ bottom: '0px',
173
+ left: '0px',
174
+ width: `${Math.max(0, Math.min(1, props.currentIndex / Math.max(1, props.stages.length - 1))) * 100}%`,
175
+ background: 'var(--mol-color-primary, #3366ff)',
176
+ transition: 'width 200ms ease',
177
+ }} data-mol-id="stage-timeline-rail-fill"/>
178
+ </div>
179
+ <For each={keyedRows()}>
180
+ {(row, index) => (<StageDot stage={stageFor(row.id)} index={index()} total={props.stages.length} currentIndex={props.currentIndex}/>)}
181
+ </For>
182
+ </>)}
183
+ </div>);
184
+ };
185
+ //# sourceMappingURL=StageTimeline.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StageTimeline.jsx","sourceRoot":"","sources":["../src/StageTimeline.tsx"],"names":[],"mapp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,CAAC,CACxB,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CACf,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAC3B,YAAY,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,EACjC,CACH,CACH;UAAA,EAAE,GAAG,CACP;QAAA,GAAG,CACJ,CACH;IAAA,EAAE,GAAG,CAAC,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Solid 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 Solid 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
+ * ```tsx
12
+ * import { StageTimeline } from '@molecule/app-stage-timeline-solid'
13
+ *
14
+ * <StageTimeline
15
+ * currentIndex={2}
16
+ * stages={[
17
+ * { id: 'applied', label: 'Applied' },
18
+ * { id: 'screen', label: 'Phone Screen' },
19
+ * { id: 'onsite', label: 'On-site' },
20
+ * { id: 'offer', label: 'Offer' },
21
+ * ]}
22
+ * />
23
+ * ```
24
+ *
25
+ * @remarks
26
+ * - Must render inside the app's i18n provider and with a ClassMap bond
27
+ * wired (`useTranslation()` / `getClassMap()` throw otherwise).
28
+ * - Colors are read from `--mol-color-primary`, `--mol-color-on-primary`,
29
+ * `--mol-color-primary-container`, `--mol-color-outline`,
30
+ * `--mol-color-surface(-variant)`, `--mol-color-on-surface(-variant)`
31
+ * CSS custom properties with hardcoded light-theme fallbacks
32
+ * (blue #3366ff, black-alpha grays). Define those `--mol-color-*`
33
+ * variables in your theme (both light and dark) or the timeline stays
34
+ * default-blue and looks wrong in dark mode.
35
+ * - `currentIndex` semantics: stages before it render completed, after
36
+ * it upcoming; pass `-1` for "not started" and `stages.length` for
37
+ * "all done".
38
+ * - Stage dots render as buttons but are disabled unless that stage has
39
+ * an `onClick`.
40
+ * - Labels and subtitles are JSX values, as React's `ReactNode` fields are.
41
+ * - Stages are keyed by `id` through stable per-id records (Solid's `For`
42
+ * keys by reference), so a re-passed or re-ordered list keeps each marker's
43
+ * DOM the way React's `key` does.
44
+ * - This is the horizontal stage/pipeline marker; for a vertical
45
+ * ordered-step list use `@molecule/app-status-timeline-solid`, and for
46
+ * wizard/checkout progress chrome use `@molecule/app-stepper-solid`.
47
+ *
48
+ * @module
49
+ */
50
+ export * from './StageTimeline.jsx';
51
+ export * from './types.js';
52
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Solid 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 Solid 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
+ * ```tsx
12
+ * import { StageTimeline } from '@molecule/app-stage-timeline-solid'
13
+ *
14
+ * <StageTimeline
15
+ * currentIndex={2}
16
+ * stages={[
17
+ * { id: 'applied', label: 'Applied' },
18
+ * { id: 'screen', label: 'Phone Screen' },
19
+ * { id: 'onsite', label: 'On-site' },
20
+ * { id: 'offer', label: 'Offer' },
21
+ * ]}
22
+ * />
23
+ * ```
24
+ *
25
+ * @remarks
26
+ * - Must render inside the app's i18n provider and with a ClassMap bond
27
+ * wired (`useTranslation()` / `getClassMap()` throw otherwise).
28
+ * - Colors are read from `--mol-color-primary`, `--mol-color-on-primary`,
29
+ * `--mol-color-primary-container`, `--mol-color-outline`,
30
+ * `--mol-color-surface(-variant)`, `--mol-color-on-surface(-variant)`
31
+ * CSS custom properties with hardcoded light-theme fallbacks
32
+ * (blue #3366ff, black-alpha grays). Define those `--mol-color-*`
33
+ * variables in your theme (both light and dark) or the timeline stays
34
+ * default-blue and looks wrong in dark mode.
35
+ * - `currentIndex` semantics: stages before it render completed, after
36
+ * it upcoming; pass `-1` for "not started" and `stages.length` for
37
+ * "all done".
38
+ * - Stage dots render as buttons but are disabled unless that stage has
39
+ * an `onClick`.
40
+ * - Labels and subtitles are JSX values, as React's `ReactNode` fields are.
41
+ * - Stages are keyed by `id` through stable per-id records (Solid's `For`
42
+ * keys by reference), so a re-passed or re-ordered list keeps each marker's
43
+ * DOM the way React's `key` does.
44
+ * - This is the horizontal stage/pipeline marker; for a vertical
45
+ * ordered-step list use `@molecule/app-status-timeline-solid`, and for
46
+ * wizard/checkout progress chrome use `@molecule/app-stepper-solid`.
47
+ *
48
+ * @module
49
+ */
50
+ export * from './StageTimeline.jsx';
51
+ export * from './types.js';
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Types for the Solid stage timeline — the Solid counterpart of
3
+ * `@molecule/app-stage-timeline-react`'s types, with Solid JSX values where
4
+ * React has `ReactNode`.
5
+ *
6
+ * @module
7
+ */
8
+ import type { JSX } from 'solid-js';
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: JSX.Element;
15
+ /** Optional secondary line (timestamp, owner, etc.). */
16
+ subtitle?: JSX.Element;
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,GAAG,EAAE,MAAM,UAAU,CAAA;AAEnC,sCAAsC;AACtC,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAA;IACV,6DAA6D;IAC7D,KAAK,EAAE,GAAG,CAAC,OAAO,CAAA;IAClB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACtB,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
+ * Types for the Solid stage timeline — the Solid counterpart of
3
+ * `@molecule/app-stage-timeline-react`'s types, with Solid JSX values 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,69 @@
1
1
  {
2
2
  "name": "@molecule/app-stage-timeline-solid",
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-solid",
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": "tsc --watch",
22
+ "test": "vitest run",
23
+ "test:watch": "vitest"
24
+ },
25
+ "keywords": [
26
+ "molecule",
27
+ "stage-timeline",
28
+ "stepper",
29
+ "progress",
30
+ "solid"
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-solid"
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-solid": "^3.5.0",
49
+ "@molecule/app-ui": "^1.0.1",
50
+ "@molecule/app-ui-solid": "^1.1.0",
51
+ "solid-js": "^1.8.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-solid": "3.9.0",
58
+ "@molecule/app-ui": "1.5.0",
59
+ "@molecule/app-ui-solid": "1.2.1",
60
+ "@molecule/app-ui-tailwind": "1.3.0",
61
+ "@testing-library/dom": "10.4.2",
62
+ "@types/node": "26.6.5",
63
+ "jsdom": "30.1.3",
64
+ "solid-js": "1.9.17",
65
+ "typescript": "6.0.3",
66
+ "vite-plugin-solid": "2.11.15",
67
+ "vitest": "4.1.12"
68
+ }
69
+ }