mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-15 11:00:47 +02:00
SaaS fixes (#6578)
Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: James Brunton <[email protected]> Co-authored-by: Reece Browne <[email protected]> Co-authored-by: ConnorYoh <[email protected]> Co-authored-by: Reece <[email protected]> Co-authored-by: EthanHealy01 <[email protected]> Co-authored-by: Ludy <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
James Brunton
Reece Browne
ConnorYoh
Reece
EthanHealy01
Ludy
parent
96accea984
commit
ddf78d11ae
@@ -0,0 +1,43 @@
|
||||
import "@shared/components/StepIndicator.css";
|
||||
|
||||
export interface StepIndicatorProps {
|
||||
/** Total number of steps. */
|
||||
total: number;
|
||||
/** Current step, 1-based. */
|
||||
current: number;
|
||||
size?: "sm" | "md";
|
||||
className?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* A segmented step/progress rail for multi-step flows (wizards, onboarding).
|
||||
* Segments before `current` read as completed, the `current` segment is
|
||||
* emphasised, and the rest are upcoming.
|
||||
*/
|
||||
export function StepIndicator({
|
||||
total,
|
||||
current,
|
||||
size = "md",
|
||||
className,
|
||||
}: StepIndicatorProps) {
|
||||
return (
|
||||
<div
|
||||
className={["sui-steps", `sui-steps--${size}`, className ?? ""]
|
||||
.filter(Boolean)
|
||||
.join(" ")}
|
||||
role="progressbar"
|
||||
aria-valuemin={1}
|
||||
aria-valuemax={total}
|
||||
aria-valuenow={current}
|
||||
>
|
||||
{Array.from({ length: total }, (_, i) => {
|
||||
const step = i + 1;
|
||||
const state =
|
||||
step < current ? "done" : step === current ? "current" : "upcoming";
|
||||
return (
|
||||
<span key={step} className="sui-steps__bar" data-state={state} />
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user