Skip to content

Commit bb7b200

Browse files
committed
feat: ✨ configurado storybook do react
adicioado o mdx da base do design system para react
1 parent 57666e0 commit bb7b200

File tree

25 files changed

+377
-113
lines changed

25 files changed

+377
-113
lines changed

applications/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"module": "./dist/index.mjs",
66
"types": "./dist/index.d.ts",
77
"scripts": {
8-
"build": "tsup src/index.tsx --format esm,cjs --dts --external react",
9-
"dev": "tsup src/index.tsx --format esm,cjs --dts --external react --watch",
8+
"build": "tsup src/index.ts --format esm,cjs --dts --external react",
9+
"dev": "tsup src/index.ts --format esm,cjs --dts --external react --watch",
1010
"lint": "eslint src/**/*.ts --fix"
1111
},
1212
"keywords": [],

applications/react/src/index.tsx renamed to applications/react/src/components/Button.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { styled } from "./styles";
1+
import { styled } from "../styles";
2+
import { ComponentProps } from "react";
23

34
export const Button = styled("button", {
45
backgroundColor: "$gray900",

applications/react/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { Button } from "./components/Button";
2+
3+
export { Button };
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { ComponentProps } from "react";
2+
import { Button } from "../components/Button";
3+
4+
export type ButtonProps = ComponentProps<typeof Button>;

documentations/angular/.storybook/preview.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
import type { Preview } from "@storybook/angular";
2-
import { setCompodocJson } from "@storybook/addon-docs/angular";
3-
import docJson from "../documentation.json";
4-
setCompodocJson(docJson);
1+
import type { Preview } from '@storybook/react';
2+
import { themes } from '@storybook/theming';
53

64
const preview: Preview = {
75
parameters: {
8-
actions: { argTypesRegex: "^on[A-Z].*" },
96
controls: {
107
matchers: {
118
color: /(background|color)$/i,
12-
date: /Date$/,
9+
date: /Date$/i,
1310
},
1411
},
12+
backgrounds: {
13+
default: 'dark',
14+
},
15+
docs: {
16+
theme: themes.dark,
17+
},
1518
},
1619
};
1720

documentations/react/.storybook/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function getAbsolutePath(value: string): any {
1111
}
1212
const config: StorybookConfig = {
1313
stories: [
14-
"../src/stories/**/*.mdx",
14+
"../src/pages/**/*.mdx",
1515
"../src/stories**/*.stories.@(js|jsx|mjs|ts|tsx)",
1616
],
1717
addons: [
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<link rel="preconnect" href="https://fonts.googleapis.com" />
2+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
3+
<link
4+
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
5+
rel="stylesheet"
6+
/>
7+
8+
<script>
9+
window.global = window;
10+
</script>

documentations/react/.storybook/preview.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Preview } from "@storybook/react";
2+
import { themes } from "@storybook/theming";
23

34
const preview: Preview = {
45
parameters: {
@@ -8,6 +9,12 @@ const preview: Preview = {
89
date: /Date$/i,
910
},
1011
},
12+
backgrounds: {
13+
default: "dark",
14+
},
15+
docs: {
16+
theme: themes.dark,
17+
},
1118
},
1219
};
1320

documentations/react/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@
1111
"build": "storybook build"
1212
},
1313
"dependencies": {
14+
"@storybook/addons": "^7.6.17",
15+
"polished": "^4.3.1",
1416
"react": "^18.2.0",
1517
"react-dom": "^18.2.0"
1618
},
1719
"devDependencies": {
20+
"@chromatic-com/storybook": "^1.4.0",
21+
"@saturn/app-react": "*",
1822
"@saturn/pack-eslint": "*",
1923
"@saturn/pack-tokens": "*",
2024
"@saturn/pack-tsconfig": "*",
21-
"@saturn/app-react": "*",
22-
"@chromatic-com/storybook": "^1.4.0",
2325
"@storybook/addon-essentials": "^8.1.1",
2426
"@storybook/addon-interactions": "^8.1.1",
2527
"@storybook/addon-links": "^8.1.1",

documentations/react/src/assets/react.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)