-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
packages/dnb-eufemia/src/components/timeline/stories/Timeline.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React from 'react' | ||
import Section from '../../Section' | ||
import Timeline from '../Timeline' | ||
import FormRow from '../../FormRow' | ||
import Input from '../../Input' | ||
|
||
export default { | ||
title: 'Eufemia/Components/Timeline', | ||
} | ||
|
||
export const TimelineTest = () => { | ||
const [value, setValue] = React.useState('123') | ||
return ( | ||
<> | ||
<Section> | ||
<Timeline space> | ||
<Timeline.Item | ||
title="Completed event" | ||
subtitle="10. september 2021" | ||
state="completed" | ||
/> | ||
<Timeline.Item | ||
title="Current event" | ||
infoMessage="Additional information about this step if needed." | ||
state="current" | ||
subtitle={ | ||
<FormRow top vertical> | ||
<Input | ||
value={value} | ||
on_change={({ value }) => { | ||
setValue(value) | ||
}} | ||
label="Should be able to change next subtitle input value from here" | ||
/> | ||
</FormRow> | ||
} | ||
/> | ||
<Timeline.Item | ||
title="Upcoming event" | ||
state="upcoming" | ||
subtitle={ | ||
<FormRow top vertical> | ||
<Input value={value} label="Should work" /> | ||
</FormRow> | ||
} | ||
/> | ||
</Timeline> | ||
</Section> | ||
|
||
<FormRow top left vertical> | ||
<Input | ||
value={value} | ||
on_change={({ value }) => { | ||
setValue(value) | ||
}} | ||
label="Works" | ||
/> | ||
</FormRow> | ||
</> | ||
) | ||
} |