Skip to content

Commit

Permalink
feat: gene pathogenicity card (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Jan 26, 2024
1 parent 26aa8c5 commit 9a2e286
Show file tree
Hide file tree
Showing 38 changed files with 11,059 additions and 13,143 deletions.
15 changes: 15 additions & 0 deletions .storybook/StoryWrapper.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<v-app :theme="themeName" :full-height="false">
<v-main>
<slot name="story"></slot>
</v-main>
</v-app>
</template>

<script>
export default {
props: {
themeName: String
}
}
</script>
2 changes: 1 addition & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { StorybookConfig } from '@storybook/vue3-vite'

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
stories: ['../src/**/*.mdx', '../src/components/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
Expand Down
30 changes: 28 additions & 2 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import type { Preview } from '@storybook/vue3'
import { type Preview, setup } from '@storybook/vue3'

import { registerPlugins } from '../src/plugins'
import { withVuetifyTheme } from './withVuetifyTheme.decorator'

// import type { StoryIdentifier } from "@storybook/types"

Expand All @@ -14,7 +17,6 @@ const preview: Preview = {
options: {
// The `a` and `b` arguments in this function have a type of `import('@storybook/types').IndexEntry`. Remember that the function is executed in a JavaScript environment, so use JSDoc for IntelliSense to introspect it.
storySort: (a /*: StoryIdentifier*/, b /*: StoryIdentifier*/) => {
console.log('a', a, 'b', b)
if (a.id === b.id) {
return 0
} else {
Expand All @@ -25,4 +27,28 @@ const preview: Preview = {
}
}

setup((app) => {
// Registers your app's plugins into Storybook
registerPlugins(app)
})

export default preview

export const decorators = [withVuetifyTheme]

export const globalTypes = {
theme: {
name: 'Theme',
description: 'Global theme for components',
toolbar: {
icon: 'paintbrush',
// Array of plain string values or MenuItem shape
items: [
{ value: 'customLightTheme', title: 'Light', left: '🌞' },
{ value: 'dark', title: 'Dark', left: '🌛' }
],
// Change title based on selected value
dynamicTitle: true
}
}
}
21 changes: 21 additions & 0 deletions .storybook/withVuetifyTheme.decorator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { h } from 'vue'

import StoryWrapper from './StoryWrapper.vue'

export const DEFAULT_THEME = 'customLightTheme'

export const withVuetifyTheme = (storyFn, context) => {
// Pull our global theme variable, fallback to DEFAULT_THEME
const themeName = context.globals.theme || DEFAULT_THEME
const story = storyFn()

return () => {
return h(
StoryWrapper,
{ themeName },
{
story: () => h(story, { ...context.args })
}
)
}
}
Loading

0 comments on commit 9a2e286

Please sign in to comment.