Skip to content

Commit e2c2a63

Browse files
authored
Merge pull request #64 from rtCamp/enhance/storybook-display
Enhancement: Storybook setup and theme showcase
2 parents b244ed4 + df78a1f commit e2c2a63

File tree

6 files changed

+915
-884
lines changed

6 files changed

+915
-884
lines changed

.storybook/manager-head.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,16 @@
6969
font-size: 14px;
7070
}
7171

72-
</style>
72+
</style>
73+
74+
<script>
75+
var observer = new MutationObserver(function(mutations) {
76+
if (document.title.match(/Storybook$/)) {
77+
document.title = "Frappe UI React";
78+
}
79+
}).observe(document.querySelector("title"), {
80+
childList: true,
81+
subtree: true,
82+
characterData: true
83+
});
84+
</script>

.storybook/public/favicon.svg

Lines changed: 5 additions & 0 deletions
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"build": "npm run build -w @rtcamp/frappe-ui-react",
1212
"preview": "vite preview",
1313
"storybook": "storybook dev -p 6006",
14-
"build-storybook": "storybook build",
14+
"build-storybook": "storybook build; cp .storybook/public/favicon.svg storybook-static/",
1515
"test:unit": "jest --config=tests/unitTest.jest.config.cjs",
1616
"lint": "npm-run-all --parallel lint:*",
1717
"lint:js": "eslint .",

packages/frappe-ui-react/src/components/themeShowCase/ThemeShowcase.stories.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
import type { Meta, StoryObj } from "@storybook/react-vite";
2+
23
import ThemeShowcase from "./ThemeShowcase";
4+
// @ts-expect-error - Json import
5+
import tailwindExtend from "../../../../../tailwindExtend.json";
36

47
const meta = {
58
title: "Theme/DesignSystem",
69
component: ThemeShowcase,
710
parameters: {
811
layout: "fullscreen",
12+
docs: {
13+
source: {
14+
code: `
15+
Extended Tailwind Config:
16+
17+
${JSON.stringify(tailwindExtend, null, 2)}
18+
`,
19+
},
20+
},
921
},
1022
tags: ["autodocs"],
1123
} satisfies Meta<typeof ThemeShowcase>;

0 commit comments

Comments
 (0)