Skip to content

Commit

Permalink
storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
epompeii committed Jun 26, 2022
1 parent c756cc3 commit a6b0b2b
Show file tree
Hide file tree
Showing 7 changed files with 38,215 additions and 5,524 deletions.
28 changes: 28 additions & 0 deletions services/ui/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const Solid = require("vite-plugin-solid")

module.exports = {

core: {
builder: "storybook-builder-vite"
},

framework: "@storybook/html",

stories: [
"../src/**/*.stories.tsx",
],

addons: [
"@storybook/addon-links",
"@storybook/addon-essentials"
],

async viteFinal(config, {configType}){
config.plugins.unshift(
Solid({hot:false}),
)

return config
},

}
1 change: 1 addition & 0 deletions services/ui/.storybook/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"commonjs"}
24 changes: 24 additions & 0 deletions services/ui/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {createRoot} from "solid-js"
import {insert, template, createComponent} from "solid-js/web"


export const decorators = [
((Story) => (
createRoot(() => {
const element = template("<div/>").cloneNode(true)
insert(element, createComponent(Story, {}))
return element
})
)),
]


export const parameters = {
actions: {argTypesRegex:"^on[A-Z].*"},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
}
Loading

0 comments on commit a6b0b2b

Please sign in to comment.