-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement
UsaStepIndicatorSegment
component
ISSUES CLOSED: #70
- Loading branch information
1 parent
a97ca6d
commit 13d914c
Showing
3 changed files
with
81 additions
and
41 deletions.
There are no files selected for viewing
44 changes: 39 additions & 5 deletions
44
src/components/UsaStepIndicatorSegment/UsaStepIndicatorSegment.stories.js
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 |
---|---|---|
@@ -1,31 +1,65 @@ | ||
import UsaStepIndicatorSegment from './UsaStepIndicatorSegment.vue' | ||
import UsaStepIndicator from '@/components/UsaStepIndicator' | ||
|
||
const defaultProps = {} | ||
const defaultProps = { | ||
status: '', | ||
label: '', | ||
} | ||
|
||
export default { | ||
component: UsaStepIndicatorSegment, | ||
title: 'Components/UsaStepIndicatorSegment', | ||
argTypes: { | ||
defaultSlot: { | ||
status: { | ||
control: { | ||
options: ['', 'current', 'completed'], | ||
type: 'select', | ||
labels: { | ||
'': 'not completed', | ||
}, | ||
}, | ||
}, | ||
label: { | ||
control: { type: 'text' }, | ||
}, | ||
}, | ||
args: { | ||
defaultSlot: 'Test', | ||
status: defaultProps.status, | ||
}, | ||
} | ||
|
||
const DefaultTemplate = (args, { argTypes }) => ({ | ||
components: { UsaStepIndicatorSegment }, | ||
components: { UsaStepIndicator, UsaStepIndicatorSegment }, | ||
props: Object.keys(argTypes), | ||
setup() { | ||
return { ...args } | ||
}, | ||
template: `<UsaStepIndicatorSegment>${args.defaultSlot}</UsaStepIndicatorSegment>`, | ||
template: ` | ||
<UsaStepIndicator counters> | ||
<UsaStepIndicatorSegment :status="status" :label="label"></UsaStepIndicatorSegment> | ||
<template #header> </template> | ||
</UsaStepIndicator>`, | ||
}) | ||
|
||
export const DefaultStepIndicatorSegment = DefaultTemplate.bind({}) | ||
DefaultStepIndicatorSegment.args = { | ||
...defaultProps, | ||
label: 'Test Step 1', | ||
} | ||
DefaultStepIndicatorSegment.storyName = 'Default' | ||
|
||
export const CurrentStepIndicatorSegment = DefaultTemplate.bind({}) | ||
CurrentStepIndicatorSegment.args = { | ||
...defaultProps, | ||
status: 'current', | ||
label: 'Test Current Step 1', | ||
} | ||
CurrentStepIndicatorSegment.storyName = 'Current' | ||
|
||
export const CompletedStepIndicatorSegment = DefaultTemplate.bind({}) | ||
CompletedStepIndicatorSegment.args = { | ||
...defaultProps, | ||
status: 'completed', | ||
label: 'Test Completed Step 1', | ||
} | ||
CompletedStepIndicatorSegment.storyName = 'Completed' |
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
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