-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Story file * Add prop documentation * Add missing value prop * Add id to explicitly link to label Bug: T289141
- Loading branch information
Showing
3 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import TextArea from '@/components/TextArea'; | ||
import { Component } from 'vue'; | ||
|
||
export default { | ||
component: TextArea, | ||
title: 'TextArea', | ||
}; | ||
|
||
export function basic( args: object ): Component { | ||
return { | ||
data(): object { | ||
return { args }; | ||
}, | ||
components: { TextArea }, | ||
props: Object.keys( args ), | ||
template: ` | ||
<div style="max-width: 75%"> | ||
<TextArea | ||
:label="label" | ||
:placeholder="placeholder" | ||
:rows="rows" | ||
:resize="resize" | ||
/> | ||
</div> | ||
`, | ||
}; | ||
} | ||
|
||
basic.args = { | ||
label: 'Label', | ||
placeholder: 'Placeholder' | ||
}; | ||
|
||
basic.argTypes = { | ||
value: { | ||
control: false | ||
}, | ||
label: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
placeholder: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
rows: { | ||
control: { | ||
type: 'number', | ||
}, | ||
}, | ||
resize: { | ||
table: { | ||
defaultValue: { | ||
summary: 'vertical' | ||
} | ||
}, | ||
control: { | ||
type: 'select', | ||
options: ['vertical', 'horizontal', 'none'], | ||
default: 'vertical' | ||
}, | ||
}, | ||
input : { | ||
description: 'Emitted on each character input to the textarea, contains the entire string value of the textarea itself.', | ||
table: { | ||
type: { | ||
summary: 'string' | ||
} | ||
} | ||
} | ||
}; | ||
|
||
export function all(): Component { | ||
return { | ||
components: { TextArea }, | ||
template: ` | ||
<div style="max-width: 95%"> | ||
<TextArea label="Label" placeholder="Placeholder" /> | ||
</div> | ||
`, | ||
}; | ||
} |
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