-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ixahmedxi/storybook
Storybook
- Loading branch information
Showing
31 changed files
with
11,487 additions
and
3,660 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 |
---|---|---|
|
@@ -131,3 +131,6 @@ dist | |
|
||
# Turborepo | ||
.turbo | ||
|
||
# Storybook | ||
storybook-static |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pnpm-lock.yaml | ||
drizzle/ | ||
.prettierignore | ||
.prettierignore | ||
.gitignore |
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 |
---|---|---|
@@ -1,3 +1,16 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
@layer base { | ||
* { | ||
@apply border-border; | ||
} | ||
|
||
body { | ||
@apply bg-background text-foreground font-sans; | ||
font-feature-settings: | ||
'rlig' 1, | ||
'calt' 1; | ||
} | ||
} |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,11 @@ | ||
{ | ||
"name": "@orbitkit/assets", | ||
"version": "0.1.0", | ||
"private": true, | ||
"description": "OrbitKit's assets package", | ||
"license": "MIT", | ||
"author": "OrbitKit", | ||
"files": [ | ||
"**/*" | ||
] | ||
} |
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
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,18 @@ | ||
/** @type {import('eslint').Linter.Config} */ | ||
const config = { | ||
extends: [ | ||
'plugin:storybook/recommended', | ||
'plugin:storybook/csf', | ||
'plugin:storybook/csf-strict', | ||
], | ||
overrides: [ | ||
{ | ||
files: ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)'], | ||
rules: { | ||
'storybook/no-title-property-in-meta': 'off', | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
module.exports = config; |
Binary file not shown.
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/** @type {import('eslint').Linter.Config} */ | ||
const config = { | ||
root: true, | ||
extends: ['orbitkit/base', 'orbitkit/react'], | ||
extends: ['orbitkit/base', 'orbitkit/react', 'orbitkit/storybook'], | ||
}; | ||
|
||
module.exports = 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,37 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
/* add geist sans variable font ttf file */ | ||
|
||
@font-face { | ||
font-family: 'Geist Sans'; | ||
src: url('/fonts/GeistVariable.ttf') format('truetype'); | ||
font-weight: 100 900; | ||
font-style: normal; | ||
} | ||
|
||
@font-face { | ||
font-family: 'Geist Mono'; | ||
src: url('/fonts/GeistMonoVariable.ttf') format('truetype'); | ||
font-weight: 100 900; | ||
font-style: normal; | ||
} | ||
|
||
:root { | ||
--font-geist-sans: 'Geist Sans'; | ||
--font-geist-mono: 'Geist Mono'; | ||
} | ||
|
||
@layer base { | ||
* { | ||
@apply border-border; | ||
} | ||
|
||
body { | ||
@apply bg-background text-foreground; | ||
font-feature-settings: | ||
'rlig' 1, | ||
'calt' 1; | ||
} | ||
} |
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,45 @@ | ||
import { dirname, join } from 'path'; | ||
|
||
import { type StorybookConfig } from '@storybook/react-vite'; | ||
import { mergeConfig } from 'vite'; | ||
import tsconfigPaths from 'vite-tsconfig-paths'; | ||
|
||
/** | ||
* 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: string) { | ||
return dirname(require.resolve(join(value, 'package.json'))); | ||
} | ||
|
||
const config = { | ||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||
addons: [ | ||
getAbsolutePath('@storybook/addon-links'), | ||
{ | ||
name: getAbsolutePath('@storybook/addon-essentials'), | ||
options: { | ||
backgrounds: false, | ||
}, | ||
}, | ||
getAbsolutePath('@storybook/addon-onboarding'), | ||
getAbsolutePath('@storybook/addon-interactions'), | ||
getAbsolutePath('@storybook/addon-themes'), | ||
getAbsolutePath('@storybook/addon-a11y'), | ||
], | ||
framework: { | ||
name: getAbsolutePath('@storybook/react-vite') as '@storybook/react-vite', | ||
options: {}, | ||
}, | ||
staticDirs: [getAbsolutePath('@orbitkit/assets')], | ||
viteFinal(config) { | ||
return mergeConfig(config, { | ||
plugins: [tsconfigPaths()], | ||
}); | ||
}, | ||
docs: { | ||
autodocs: 'tag', | ||
}, | ||
} satisfies StorybookConfig; | ||
|
||
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,74 @@ | ||
import './globals.css'; | ||
|
||
import type { Preview } from '@storybook/react'; | ||
|
||
import { withThemeByClassName } from '@storybook/addon-themes'; | ||
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport'; | ||
import { type ReactRenderer } from '@storybook/react'; | ||
|
||
const customViewports = { | ||
'720p': { | ||
name: '720p', | ||
styles: { | ||
width: '1280px', | ||
height: '720px', | ||
}, | ||
}, | ||
'1080p': { | ||
name: '1080p', | ||
styles: { | ||
width: '1920px', | ||
height: '1080px', | ||
}, | ||
}, | ||
'2k': { | ||
name: '2K', | ||
styles: { | ||
width: '2560px', | ||
height: '1440px', | ||
}, | ||
}, | ||
'4k': { | ||
name: '4K', | ||
styles: { | ||
width: '3840px', | ||
height: '2160px', | ||
}, | ||
}, | ||
'21/9': { | ||
name: '21/9', | ||
styles: { | ||
width: '2560px', | ||
height: '1080px', | ||
}, | ||
}, | ||
}; | ||
|
||
const preview = { | ||
parameters: { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
viewport: { | ||
viewports: { | ||
...customViewports, | ||
...INITIAL_VIEWPORTS, | ||
}, | ||
}, | ||
}, | ||
decorators: [ | ||
withThemeByClassName<ReactRenderer>({ | ||
themes: { | ||
light: 'light', | ||
dark: 'dark', | ||
}, | ||
defaultTheme: 'light', | ||
}), | ||
], | ||
} satisfies Preview; | ||
|
||
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,6 @@ | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './avatar'; | ||
export * from './primitives/avatar'; | ||
export * from './utils/cn'; |
Oops, something went wrong.