This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rodrigo Arze Leon
authored and
Rodrigo Arze Leon
committed
Oct 18, 2024
1 parent
3a9fdb0
commit 4d151a7
Showing
7 changed files
with
2,285 additions
and
400 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,3 +54,5 @@ temp/ | |
dist/ | ||
|
||
*.play.* | ||
|
||
*storybook.log |
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,34 @@ | ||
import {dirname, join} from 'path' | ||
|
||
/** | ||
* This function is used to resolve the absolute path of a package. | ||
* It is needed in projects that use Yarn PnP or are set up within a monorepo. | ||
*/ | ||
function getAbsolutePath(value) { | ||
return dirname(require.resolve(join(value, 'package.json'))) | ||
} | ||
|
||
/** @type { import('@storybook/react-vite').StorybookConfig } */ | ||
const config = { | ||
stories: [ | ||
'../stories/**/*.mdx', | ||
'../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)', | ||
], | ||
addons: [ | ||
getAbsolutePath('@storybook/addon-onboarding'), | ||
getAbsolutePath('@storybook/addon-links'), | ||
getAbsolutePath('@storybook/addon-essentials'), | ||
getAbsolutePath('@chromatic-com/storybook'), | ||
getAbsolutePath('@storybook/addon-interactions'), | ||
], | ||
framework: { | ||
name: getAbsolutePath('@storybook/react-vite'), | ||
options: {}, | ||
}, | ||
// viteFinal: async (config) => { | ||
// config.css = config.css || {} | ||
// config.css.postcss = require('../../../apps/web/postcss.config.js') | ||
// return config | ||
// }, | ||
} | ||
export default config |
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,21 @@ | ||
// import '../../../apps/web/app/global.css' | ||
|
||
if (typeof document !== 'undefined') { | ||
const script = document.createElement('script') | ||
script.src = 'https://cdn.tailwindcss.com' | ||
document.head.appendChild(script) | ||
} | ||
|
||
/** @type { import('@storybook/react').Preview } */ | ||
const preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
export default preview |
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,29 @@ | ||
import {fn} from '@storybook/test' | ||
import {Button} from '../shadcn/Button' | ||
|
||
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export | ||
export default { | ||
title: 'Example/Button', | ||
component: Button, | ||
parameters: { | ||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout | ||
layout: 'centered', | ||
}, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
// More on argTypes: https://storybook.js.org/docs/api/argtypes | ||
argTypes: { | ||
backgroundColor: {control: 'color'}, | ||
}, | ||
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args | ||
args: {onClick: fn()}, | ||
} | ||
|
||
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args | ||
export const Primary = { | ||
args: { | ||
'aria-label': 'Copy to clipboard', | ||
variant: 'default', | ||
size: 'default', | ||
}, | ||
} |
Oops, something went wrong.