Skip to content

Commit

Permalink
Migrated mds to use emotion Library
Browse files Browse the repository at this point in the history
- Migration to emotion library
- Fixed styles for compoents
- Simplified Themes & direct use of colors
- Removal of obsolete components (ActionsList, InformativeMessage, MainContainer, Menu, Pill)
- Renamed components to match specification (CommentBox => TextArea, ReadBox => CodeSnippet, Switch => Toggle)

Signed-off-by: Benjamin Perez <[email protected]>
  • Loading branch information
bayasdev authored and Benjamin Perez committed Oct 22, 2024
1 parent 95859b2 commit 39efcdf
Show file tree
Hide file tree
Showing 5,091 changed files with 144,177 additions and 128,788 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 6 additions & 3 deletions .babelrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
}
}
],
"@babel/preset-typescript",
"@babel/preset-react"
[
"@babel/preset-react",
{ "runtime": "automatic", "importSource": "@emotion/react" }
],
"@babel/preset-typescript"
],
"plugins": []
"plugins": ["@emotion/babel-plugin"]
}
39 changes: 0 additions & 39 deletions .storybook/main.js

This file was deleted.

40 changes: 40 additions & 0 deletions .storybook/main.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import remarkGfm from "remark-gfm";

module.exports = {
stories: ["../src/**/**/*.mdx", "../src/**/**/*.stories.@(js|jsx|ts|tsx)"],

core: {
disableTelemetry: true,
},

addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"storybook-dark-mode",
{
name: "@storybook/addon-docs",
options: {
mdxPluginOptions: {
mdxCompileOptions: {
remarkPlugins: [remarkGfm],
},
},
},
},
"@storybook/addon-webpack5-compiler-babel",
"@chromatic-com/storybook",
"@storybook/addon-themes",
],

framework: {
name: "@storybook/react-webpack5",
options: {},
},

docs: {},

typescript: {
reactDocgen: "react-docgen-typescript",
},
};
69 changes: 69 additions & 0 deletions .storybook/preview.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import React from "react";
import { themes } from "@storybook/theming";
import { darkColors, lightColors } from "../src/global/themes";

import { withThemeFromJSXProvider } from "@storybook/addon-themes";
import { Global, css } from "@emotion/react";

export const parameters = {
actions: {},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
darkMode: {
light: {
...themes.normal,
appBg: "#F6F7F9",
},
},
/*darkMode: {
dark: {
...themes.dark,
appBg: darkColors.dark,
appContentBg: darkColors.dark,
appBorderColor: darkColors.divisorColor,
barTextColor: darkColors.mainGrey,
textColor: darkColors.mainGrey,
barSelectedColor: darkColors.mainWhite,
barBg: darkColors.dark,
inputBg: darkColors.dark,
inputBorder: darkColors.mainGrey,
colorSecondary: darkColors.mainRed,
},
light: {
...themes.normal,
appBg: lightColors.white,
appContentBg: lightColors.white,
appBorderColor: lightColors.divisorColor,
barTextColor: lightColors.mainGrey,
textColor: lightColors.mainGrey,
barSelectedColor: lightColors.mainBlue,
barBg: lightColors.white,
inputBg: lightColors.white,
inputBorder: lightColors.mainGrey,
colorSecondary: lightColors.mainBlue,
},
},*/
};

const GlobalStyles = () => (
<Global
styles={css`
body {
font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial,
sans-serif;
}
`}
/>
);

export const decorators = [
withThemeFromJSXProvider({
GlobalStyles, // Adds your GlobalStyles component to all stories
}),
];

export const tags = ["autodocs"];
51 changes: 29 additions & 22 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Preview } from "@storybook/react";
import { themes } from "@storybook/theming";
import { themes, ensure } from "@storybook/theming";

import { darkColors, lightColors } from "../src/global/themes";
import { darkModeColors, lightModeColors } from "../src";

const preview: Preview = {
parameters: {
Expand All @@ -12,32 +12,39 @@ const preview: Preview = {
date: /Date$/,
},
},
docs: {
theme: ensure(themes.dark),
},
darkMode: {
dark: {
...themes.dark,
appBg: darkColors.dark,
appContentBg: darkColors.dark,
appBorderColor: darkColors.divisorColor,
barTextColor: darkColors.mainGrey,
textColor: darkColors.mainGrey,
barSelectedColor: darkColors.mainWhite,
barBg: darkColors.dark,
inputBg: darkColors.dark,
inputBorder: darkColors.mainGrey,
colorSecondary: darkColors.mainRed,
appBg: darkModeColors["Color/Neutral/Bg/colorBgSections"],
appContentBg: darkModeColors["Color/Neutral/Bg/colorBgSections"],
appBorderColor:
darkModeColors["Color/Neutral/Border/colorBorderSubtle"],
barTextColor: darkModeColors["Color/Neutral/Text/colorTextLabel"],
textColor: darkModeColors["Color/Neutral/Text/colorText"],
barSelectedColor: darkModeColors["Color/Base/Royal/6"],
barBg: darkModeColors["Color/Neutral/Icon/colorIcon"],
inputBg: darkModeColors["Color/Neutral/Bg/colorBgFields"],
inputBorder: darkModeColors["Color/Neutral/Border/colorBorderSubtle"],
colorSecondary:
darkModeColors["Color/Brand/Primary/colorPrimaryBorder"],
},
light: {
...themes.normal,
appBg: lightColors.white,
appContentBg: lightColors.white,
appBorderColor: lightColors.divisorColor,
barTextColor: lightColors.mainGrey,
textColor: lightColors.mainGrey,
barSelectedColor: lightColors.mainBlue,
barBg: lightColors.white,
inputBg: lightColors.white,
inputBorder: lightColors.mainGrey,
colorSecondary: lightColors.mainBlue,
appBg: lightModeColors["Color/Neutral/Bg/colorBgSections"],
appContentBg: lightModeColors["Color/Neutral/Bg/colorBgSections"],
appBorderColor:
lightModeColors["Color/Neutral/Border/colorBorderSubtle"],
barTextColor: lightModeColors["Color/Neutral/Text/colorTextLabel"],
textColor: lightModeColors["Color/Neutral/Text/colorText"],
barSelectedColor: lightModeColors["Color/Base/Royal/6"],
barBg: lightModeColors["Color/Neutral/Icon/colorIcon"],
inputBg: lightModeColors["Color/Neutral/Bg/colorBgFields"],
inputBorder: lightModeColors["Color/Neutral/Border/colorBorderSubtle"],
colorSecondary:
lightModeColors["Color/Brand/Primary/colorPrimaryBorder"],
},
},
},
Expand Down
Loading

0 comments on commit 39efcdf

Please sign in to comment.