Skip to content

Commit ffcd24f

Browse files
Jonathangarridoalv-alvarez
authored andcommitted
feat(framework): chakra ui
1 parent fc1047e commit ffcd24f

19 files changed

+1532
-147
lines changed

.cssrem

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"rootFontSize": 16,
3+
"fixedDigits": 3
4+
}

.eslintrc.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,14 @@
2424
"plugin:jest-dom/recommended",
2525
"plugin:testing-library/react",
2626
"plugin:prettier/recommended"
27-
]
27+
],
28+
"overrides": [
29+
{
30+
"files": ["*.mdx"],
31+
"extends": "plugin:mdx/recommended"
32+
}
33+
],
34+
"settings": {
35+
"mdx/code-blocks": true
36+
}
2837
}

.storybook/eClassTheme.js renamed to .storybook/eClassTheme.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// .storybook/YourTheme.js
2-
31
import { create } from '@storybook/theming';
42

53
export default create({

.storybook/main.js

-14
This file was deleted.

.storybook/main.ts

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const path = require('path')
2+
3+
const toPath = (_path) => path.join(process.cwd(), _path)
4+
5+
module.exports = {
6+
stories: ['../src/**/*.stories.@(ts|tsx|mdx)'],
7+
addons: [
8+
'@storybook/addon-links',
9+
'@storybook/addon-essentials'
10+
],
11+
core: {
12+
builder: 'storybook-builder-vite',
13+
},
14+
typescript: {
15+
check: true
16+
},
17+
viteFinal: async config => {
18+
return {
19+
...config,
20+
resolve: {
21+
...config.resolve,
22+
alias: {
23+
...config.resolve.alias,
24+
'@emotion/css': toPath('node_modules/@emotion/css'),
25+
'@emotion/core': toPath('node_modules/@emotion/react'),
26+
'emotion-theming': toPath('node_modules/@emotion/react'),
27+
},
28+
},
29+
}
30+
}
31+
}

.storybook/manager.js renamed to .storybook/manager.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
// .storybook/manager.js
2-
31
import { addons } from '@storybook/addons';
2+
43
import eClassTheme from './eClassTheme';
54

65
addons.setConfig({

.storybook/preview.js

-9
This file was deleted.

.storybook/preview.tsx

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ChakraProvider } from "@chakra-ui/react"
2+
3+
import { theme } from '../src/theme'
4+
5+
const withChakra = (StoryFn: Function) => {
6+
return (
7+
<ChakraProvider theme={theme}>
8+
<StoryFn />
9+
</ChakraProvider>
10+
)
11+
}
12+
13+
export const parameters = {
14+
actions: { argTypesRegex: '^on[A-Z].*' },
15+
controls: {
16+
matchers: {
17+
color: /(background|color)$/i,
18+
date: /Date$/,
19+
},
20+
},
21+
}
22+
23+
export const decorators = [ withChakra ]

0 commit comments

Comments
 (0)