Skip to content

Commit

Permalink
feat: add storybook with governance custom components (#1253)
Browse files Browse the repository at this point in the history
* feat: add storybook with pill component example

* feat: add css imports and some typography stories

* feat: add sidebar link button story

* refactor: remove unused component and reorder files

* fix: login component imports
  • Loading branch information
andyesp authored Sep 11, 2023
1 parent cef989a commit fef5c40
Show file tree
Hide file tree
Showing 58 changed files with 45,918 additions and 31,904 deletions.
18 changes: 18 additions & 0 deletions .babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": 100,
"safari": 15,
"firefox": 91
}
}
],
"@babel/preset-typescript",
"@babel/preset-react"
],
"plugins": []
}
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
"plugin:prettier/recommended",
"plugin:storybook/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
Expand Down
27 changes: 27 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react'

module.exports = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-onboarding',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/react-webpack5',
options: {},
},
docs: {
autodocs: 'tag',
},
webpackFinal: async (config) => {
config.module.rules[0].exclude = [/node_modules\/(?!(gatsby|gatsby-script)\/)/]
if (parseInt(React.version) <= 18) {
config.externals = ['react-dom/client']
}
config.module.rules[0].exclude = [/core-js/]
config.resolve.mainFields = ['browser', 'module', 'main']
return config
},
}
1 change: 1 addition & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link async rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2/dist/semantic.min.css" />
20 changes: 20 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { Preview } from '@storybook/react'
import 'decentraland-ui/dist/themes/alternative/light-theme.css'
import 'decentraland-ui/dist/themes/base-theme.css'

import '../src/theme.css'
import '../src/ui-overrides.css'

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

export default preview
Loading

0 comments on commit fef5c40

Please sign in to comment.