Skip to content

Commit eb23314

Browse files
committed
feat: add accordion stories
1 parent 227a8b0 commit eb23314

File tree

14 files changed

+105
-465
lines changed

14 files changed

+105
-465
lines changed

.storybook/preview.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

.storybook/preview.tsx

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import React, { useEffect } from "react";
2+
import clsx from "clsx";
3+
4+
import type { Preview } from "@storybook/react";
5+
6+
import "../src/styles/global.css";
7+
8+
export type IPreviewArgs = {
9+
themeUI: "light" | "dark";
10+
backgroundUI: "white" | "light";
11+
};
12+
13+
const preview: Preview = {
14+
decorators: [
15+
(Story, { args }) => {
16+
const { themeUI, backgroundUI } = args;
17+
useEffect(() => {
18+
if (themeUI === "dark") document.documentElement.classList.add("dark");
19+
else document.documentElement.classList.remove("dark");
20+
}, [themeUI]);
21+
return (
22+
<div
23+
className={clsx(
24+
"p-4",
25+
backgroundUI === "white"
26+
? "bg-klerosUIComponentsWhiteBackground"
27+
: "bg-klerosUIComponentsLightBackground",
28+
)}
29+
>
30+
<Story />
31+
</div>
32+
);
33+
},
34+
],
35+
args: {
36+
themeUI: "light",
37+
backgroundUI: "white",
38+
},
39+
argTypes: {
40+
themeUI: {
41+
options: ["light", "dark"],
42+
control: { type: "radio" },
43+
},
44+
backgroundUI: {
45+
options: ["white", "light"],
46+
control: { type: "radio" },
47+
},
48+
},
49+
parameters: {
50+
layout: "centered",
51+
},
52+
};
53+
54+
export default preview;

eslint.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ export default [
6767
react: {
6868
version: "^16.12.0",
6969
},
70+
"import/resolver": {
71+
node: {
72+
extensions: [".js", ".jsx", ".ts", ".tsx"],
73+
},
74+
},
7075
},
7176

7277
rules: {

src/stories/Button.stories.ts

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/stories/Button.tsx

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/stories/Header.stories.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/stories/Header.tsx

Lines changed: 0 additions & 71 deletions
This file was deleted.

src/stories/Page.stories.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)