Skip to content

Commit

Permalink
Fix lint findings
Browse files Browse the repository at this point in the history
  • Loading branch information
KorvinSzanto committed Jan 28, 2024
1 parent 409dbbc commit d98a513
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions stories/ExampleStories.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
// See docs for CSF files https://storybook.js.org/docs/api/csf

// Set up the default options for all stories in this file
import {ref} from "vue";
import IconButton, {types as buttonTypes} from "../assets/cms/components/IconButton.vue";
import {icons, types} from "../assets/cms/components/iconlist"
import {action} from "@storybook/addon-actions";
import {rest} from "msw";
import { ref } from 'vue'
import IconButton, { types as buttonTypes } from '../assets/cms/components/IconButton.vue'
import { icons, types } from '../assets/cms/components/iconlist'
import { action } from '@storybook/addon-actions'
import { rest } from 'msw'

// Use `ref` to make a dynamic value like you would with a `script setup` component
const clicks = ref(0)

// Set up the default options for all stories in this file
export default {
components: {IconButton},
components: { IconButton },
title: 'Parent Directory/Subdirectory',
component: IconButton,
tags: ['autodocs'], // Add the 'autodocs' tag in order to generate a `Docs` page automatically,
argTypes: { // Use argtypes to change how Controls are rendered in storybook
argTypes: { // Use argtypes to change how Controls are rendered in storybook
type: {
options: buttonTypes,
control: 'inline-radio'
Expand All @@ -31,12 +30,12 @@ export default {
},
decorators: [ // Use decorators to wrap the component in elements / functionality
() => ({
setup: () => ({clicks}), // https://vuejs.org/api/composition-api-setup
setup: () => ({ clicks }), // https://vuejs.org/api/composition-api-setup
template: `
<div class="text-center border d-inline-block p-3 bg-dark bg-gradient text-white border-dark">
<div>Clicked <em>{{clicks}}</em> times</div>
<story/>
</div>`,
</div>`
})
]
}
Expand All @@ -57,12 +56,12 @@ export const customRender = {
iconType: types.fas,
class: 'btn-sm',
style: 'font-size: .5rem',
onClick: action('click'), // Use `action` to expose events and similar to the storybook frontend. https://storybook.js.org/docs/essentials/actions
onClick: action('click') // Use `action` to expose events and similar to the storybook frontend. https://storybook.js.org/docs/essentials/actions
},
render: args => ({
components: {IconButton},
setup: () => ({args}),
template: `<IconButton v-bind="args">Useful if there's a slot filled</IconButton>`
components: { IconButton },
setup: () => ({ args }),
template: '<IconButton v-bind="args">Useful if there\'s a slot filled</IconButton>'
})
}

Expand All @@ -81,17 +80,17 @@ export const restTriggeringExample = {
},
decorators: [
() => ({
setup: () => ({result}),
template: `Got "{{result}}"<br><story/>`
setup: () => ({ result }),
template: 'Got "{{result}}"<br><story/>'
})
],
parameters: {
msw: [ // Use MSW to mock fetch / XMLHttpRequest
rest.get('/the-path', function (req, res, ctx) {
return res(ctx.json({
result: 'Mock Worked 👍 ' + Math.floor(Math.random() * 50),
result: 'Mock Worked 👍 ' + Math.floor(Math.random() * 50)
}))
})
]
}
}
}

0 comments on commit d98a513

Please sign in to comment.