-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 80e9bd9.
- Loading branch information
Showing
9 changed files
with
39,111 additions
and
9,355 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 |
---|---|---|
@@ -0,0 +1,100 @@ | ||
const path = require('path') | ||
// const postcss = require('../postcss.config.js') | ||
// const { mergeConfig } = require('vite') | ||
const { VitePWA } = require('vite-plugin-pwa') | ||
const { viteStaticCopy } = require('vite-plugin-static-copy') | ||
|
||
const INVALID_CHAR_REGEX = /[\u0000-\u001F"#$&*+,:;<=>?[\]^`{|}\u007F_]/g | ||
const DRIVE_LETTER_REGEX = /^[a-z]:/i | ||
function sanitizeFileName(name) { | ||
const match = DRIVE_LETTER_REGEX.exec(name) | ||
const driveLetter = match ? match[0] : '' | ||
return ( | ||
driveLetter + | ||
name.slice(driveLetter.length).replace(INVALID_CHAR_REGEX, '+') | ||
) | ||
} | ||
|
||
module.exports = { | ||
stories: [ | ||
'../src/components/**/*.story.@(js|jsx|ts|tsx|mdx)', | ||
'../src/plugins/**/*.story.@(js|jsx|ts|tsx|mdx)', | ||
'../src/views/**/*.story.@(js|jsx|ts|tsx|mdx)' | ||
], | ||
|
||
addons: [{ | ||
name: '@storybook/addon-postcss', | ||
options: { | ||
postcssLoaderOptions: { | ||
implementation: require('postcss') | ||
} | ||
} | ||
}, '@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions', 'storybook-dark-mode', '@storybook/addon-mdx-gfm'], | ||
|
||
framework: { | ||
name: '@storybook/vue3-vite', | ||
options: {} | ||
}, | ||
|
||
features: { | ||
storyStoreV7: true | ||
}, | ||
|
||
typescript: { | ||
check: false, | ||
checkOptions: {}, | ||
reactDocgen: 'react-docgen-typescript', | ||
reactDocgenTypescriptOptions: { | ||
shouldExtractLiteralValuesFromEnum: true, | ||
propFilter: (prop) => | ||
prop.parent ? !/node_modules/.test(prop.parent.fileName) : true | ||
} | ||
}, | ||
|
||
async viteFinal(config, { configType }) { | ||
config.resolve.alias = { | ||
...config.resolve.alias, | ||
'@': path.resolve(__dirname, '../src'), | ||
'tailwind.config': path.resolve(__dirname, '../tailwind.config.js') | ||
} | ||
|
||
config.build = { | ||
...config.build, | ||
...{ | ||
rollupOptions: { | ||
output: { sanitizeFileName: sanitizeFileName } | ||
} | ||
} | ||
} | ||
|
||
config.optimizeDeps = { | ||
...config.optimizeDeps, | ||
include: ['tailwind.config'] | ||
} | ||
|
||
config.plugins.push(VitePWA({})) | ||
|
||
config.plugins.push( | ||
viteStaticCopy({ | ||
targets: [ | ||
{ | ||
src: './plugin.js', | ||
dest: './' | ||
} | ||
] | ||
}) | ||
) | ||
|
||
// config.build.commonjsOptions = { | ||
// ...config.build.commonjsOptions, | ||
// include: ['../tailwind-config.js', '../node_modules/**'], | ||
// esmExternals: true | ||
// } | ||
|
||
return config | ||
}, | ||
|
||
docs: { | ||
autodocs: true | ||
} | ||
} |
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,5 @@ | ||
import { addons } from '@storybook/addons' | ||
|
||
addons.setConfig({ | ||
panelPosition: 'right' | ||
}) |
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,145 @@ | ||
import React from 'react' | ||
import { app } from '@storybook/vue3' | ||
import { themes } from '@storybook/theming' | ||
import { DocsContainer } from '@storybook/addon-docs' | ||
import { useDarkMode } from 'storybook-dark-mode' | ||
|
||
// PINIA | ||
import { createPinia } from 'pinia' | ||
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' | ||
|
||
// KODAMA | ||
import { createApp } from '../src/main' | ||
import '../src/config/_style' | ||
|
||
// CUSTOM CONFIG | ||
import router from './app/config/router' | ||
import menu from './app/config/menu' | ||
import settings from './app/config/settings' | ||
import { useAuth } from './app/modules/auth' | ||
|
||
const components = import.meta.globEager('./app/components/**/*.vue') | ||
const layouts = import.meta.globEager('./app/layout/**/*.vue') | ||
|
||
const pinia = createPinia() | ||
pinia.use(piniaPluginPersistedstate) | ||
|
||
const vm = createApp( | ||
{ | ||
router: router, | ||
components: { ...components, ...layouts }, | ||
menu: menu, | ||
settings: settings, | ||
auth: { | ||
getName: () => { | ||
const auth = useAuth() | ||
return auth.name | ||
}, | ||
getLastName: () => { | ||
const auth = useAuth() | ||
return auth.lastname | ||
}, | ||
isLoggedIn: () => { | ||
const auth = useAuth() | ||
return auth.isLoggedIn | ||
}, | ||
login: (username, password) => { | ||
const auth = useAuth() | ||
return auth.login(username, password) | ||
}, | ||
forgot: (email) => { | ||
const auth = useAuth() | ||
return auth.forgot(email) | ||
}, | ||
logout: () => { | ||
const auth = useAuth() | ||
return auth.logout() | ||
} | ||
} | ||
}, | ||
app | ||
) | ||
|
||
vm.use(pinia) | ||
|
||
const brand = { | ||
// Brand | ||
brandTitle: 'Kodama', | ||
brandUrl: 'https://calltek.es', | ||
brandImage: 'https://place-hold.it/350x150', | ||
brandTarget: '_self' | ||
} | ||
|
||
const dark = { | ||
...themes.dark, | ||
...brand, | ||
|
||
// UI | ||
appContentBg: '#111827', // gray-900 | ||
appBorderColor: '#1F2937', // gray-800 | ||
appBg: '#0b0f19', | ||
|
||
// Text colors | ||
textColor: '#9CA3AF', // gray-400 | ||
|
||
// Toolbar default and active colors | ||
barTextColor: '#9CA3AF', // gray-400 | ||
barSelectedColor: '#1A56DB', //primary | ||
barBg: '#111827', //gray-900 | ||
|
||
// Form colors | ||
inputBg: '#374151', //gray-700 | ||
inputBorder: '#4B5563', //gray-600 | ||
inputTextColor: '#9CA3AF', //gray-400 | ||
inputBorderRadius: 4 | ||
} | ||
|
||
const light = { | ||
...themes.normal, | ||
...brand, | ||
|
||
// UI | ||
appContentBg: '#F3F4F6', // gray-100 | ||
appBorderColor: '#D1D5DB', //gray-300 | ||
appBg: '#0b0f19', | ||
|
||
// Text colors | ||
textColor: '#9CA3AF', | ||
|
||
// Toolbar default and active colors | ||
barTextColor: '#4B5563', //gray-600 | ||
barSelectedColor: '#1A56DB', //primary | ||
barBg: '#fff', | ||
|
||
// Form colors | ||
inputBg: '#F9FAFB', | ||
inputBorder: '#D1D5DB', | ||
inputTextColor: '#111827', | ||
inputBorderRadius: 4 | ||
} | ||
|
||
export const parameters = { | ||
layout: 'centered', | ||
darkMode: { | ||
classTarget: 'html', | ||
stylePreview: true, | ||
|
||
// Override the default dark theme | ||
dark: dark, | ||
// Override the default light theme | ||
light: light | ||
}, | ||
docs: { | ||
container: (props) => { | ||
const isDark = useDarkMode() | ||
|
||
const { id: storyId, storyById } = props.context | ||
const { | ||
parameters: { docs = {} } | ||
} = storyById(storyId) | ||
docs.theme = isDark ? dark : light | ||
|
||
return React.createElement(DocsContainer, props) | ||
} | ||
} | ||
} |
Oops, something went wrong.