github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/ui/stories/components/copy-button.stories.js (about) 1 import hbs from 'htmlbars-inline-precompile'; 2 import { withKnobs, text } from '@storybook/addon-knobs'; 3 4 export default { 5 title: 'Components|Copy Button', 6 decorators: [withKnobs], 7 }; 8 9 export let CopyButton = () => { 10 return { 11 template: hbs` 12 <h5 class="title is-5">Copy Button</h5> 13 <span class="tag is-hollow is-small no-text-transform"> 14 {{clipboardText}} 15 <CopyButton @clipboardText={{clipboardText}} /> 16 </span> 17 <h5 class="title is-5">Copy Button with content</h5> 18 <span class="tag is-hollow is-small no-text-transform"> 19 <CopyButton @clipboardText={{clipboardText}}>{{clipboardText}}</CopyButton> 20 </span> 21 `, 22 context: { 23 clipboardText: text('Clipboard Text', 'e8c898a0-794b-9063-7a7f-bf0c4a405f83'), 24 }, 25 }; 26 };