overleaf/services/web/frontend/js/shared/components/stepper.tsx
Domagoj Kriskovic b516363e45 Onboarding data collection form (#15164)
* onboarding data collection react

* added stepper component

* stepper completed step

* move useValidateField to shared

* Revert "move useValidateField to shared"

This reverts commit 68fafd934dafedab8d61f581beb7bfdd8a0674c0.

* added multistep hook

* add story

* fix storybook

* img path

* remove pug page

* formatting

* using translations

* formating

* linting

* use small classname

* Onboarding data collection form - Step 2 (#15182)

* step 2 of onbarding data collection form

* sort locals

* styling changes

* checkbox font size

* aria-progressbar, bsStyle=null

GitOrigin-RevId: 9ee84b4631b30b670280cfa2086385274652b21e
2023-10-18 08:04:16 +00:00

23 lines
518 B
TypeScript

import classNames from 'classnames'
export function Stepper({ steps, active }: { steps: number; active: number }) {
return (
<div
className="stepper"
role="progressbar"
aria-valuenow={active + 1}
aria-valuemax={steps}
>
{Array.from({ length: steps }).map((_, i) => (
<div
key={i}
className={classNames({
step: true,
active: i === active,
completed: i < active,
})}
/>
))}
</div>
)
}