Skip to content

Commit 30f3d12

Browse files
author
tobias-mintlify
committed
Fix Frame & Accordion styling and set up their stories
1 parent 1bf4229 commit 30f3d12

16 files changed

+38520
-5770
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ yarn.lock
3535
npm-debug.log*
3636
yarn-debug.log*
3737
yarn-error.log*
38+
.build-storybook.log
3839

3940
# local env files
4041
.env

.npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Storybook Tests
2-
/stories
2+
/.storybook
33

44
# Source code (we publish webpack's results not the source code itself)
55
/src

.storybook/main.js

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
const path = require("path");
2+
3+
module.exports = {
4+
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
5+
framework: "@storybook/react",
6+
core: {
7+
builder: "@storybook/builder-webpack5",
8+
},
9+
addons: [
10+
"storybook-addon-themes",
11+
"@storybook/addon-links",
12+
"@storybook/addon-interactions",
13+
"@storybook/addon-essentials",
14+
{
15+
/**
16+
* Fix Storybook issue with PostCSS@8
17+
* @see https://github.com/storybookjs/storybook/issues/12668#issuecomment-773958085
18+
*/
19+
name: "@storybook/addon-postcss",
20+
options: {
21+
postcssLoaderOptions: {
22+
implementation: require("postcss"),
23+
},
24+
},
25+
},
26+
],
27+
core: {
28+
builder: "webpack5",
29+
},
30+
webpackFinal: (config) => {
31+
/**
32+
* Add support for alias-imports
33+
* @see https://github.com/storybookjs/storybook/issues/11989#issuecomment-715524391
34+
*/
35+
config.resolve.alias = {
36+
...config.resolve?.alias,
37+
"@": [path.resolve(__dirname, "../src/"), path.resolve(__dirname, "../")],
38+
};
39+
40+
/**
41+
* Fixes font import with /
42+
* @see https://github.com/storybookjs/storybook/issues/12844#issuecomment-867544160
43+
*/
44+
config.resolve.roots = [
45+
path.resolve(__dirname, "../public"),
46+
"node_modules",
47+
];
48+
49+
return config;
50+
},
51+
};

.storybook/preview.js

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import "../src/css/globals.css";
2+
3+
export const parameters = {
4+
actions: { argTypesRegex: "^on[A-Z].*" },
5+
controls: {
6+
matchers: {
7+
color: /(background|color)$/i,
8+
date: /Date$/,
9+
},
10+
},
11+
themes: {
12+
clearable: false,
13+
icon: "lightning",
14+
list: [
15+
{
16+
name: "Light Mode",
17+
class: [],
18+
color: "#ffffff",
19+
default: true,
20+
},
21+
{
22+
name: "Dark Mode",
23+
// The class dark will be added to the body tag for Tailwind to work
24+
class: ["dark"],
25+
color: "#000000",
26+
},
27+
],
28+
},
29+
backgrounds: {
30+
values: [
31+
{
32+
name: "Light Background",
33+
value: "#00000",
34+
},
35+
{
36+
name: "Dark Background",
37+
value: "#0F172A",
38+
},
39+
],
40+
},
41+
};

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Mintlify uses Mintlify Components in customers' docs. We encourage you to use th
66

77
# Designed for Next.js
88

9-
The project is designed for use in static side rendering where we don't have access to `document` or `window`. Thus, our webpack config has to use `mini-css-extract-plugin` instead of `style-loader`.
9+
The project is designed for use with static side rendering where we don't have access to `document` or `window`. Thus, our webpack config has to use `mini-css-extract-plugin` instead of `style-loader`.
1010

1111
# Documentation
1212

0 commit comments

Comments
 (0)