Skip to content

Commit 4cf455e

Browse files
committed
Add shadcn/ui + Storybook
1 parent 886070d commit 4cf455e

File tree

17 files changed

+2134
-230
lines changed

17 files changed

+2134
-230
lines changed

.vscode/extensions.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"recommendations": [
55
"dbaeumer.vscode-eslint",
66
"connor4312.esbuild-problem-matchers",
7-
"ms-vscode.extension-test-runner"
7+
"ms-vscode.extension-test-runner",
8+
"csstools.postcss",
9+
"bradlc.vscode-tailwindcss"
810
]
911
}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
"dist": true // set this to false to include "dist" folder in search results
1010
},
1111
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
12-
"typescript.tsc.autoDetect": "off"
12+
"typescript.tsc.autoDetect": "off",
13+
"editor.formatOnSave": true
1314
}

webview-ui/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@
2121
npm-debug.log*
2222
yarn-debug.log*
2323
yarn-error.log*
24+
25+
*storybook.log

webview-ui/.storybook/main.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { StorybookConfig } from "@storybook/react-vite"
2+
3+
const config: StorybookConfig = {
4+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
5+
addons: [
6+
"@storybook/addon-onboarding",
7+
"@storybook/addon-essentials",
8+
"@chromatic-com/storybook",
9+
"@storybook/addon-interactions",
10+
],
11+
framework: {
12+
name: "@storybook/react-vite",
13+
options: {},
14+
},
15+
}
16+
export default config

webview-ui/.storybook/preview.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { Preview } from "@storybook/react"
2+
3+
import "../src/index.css"
4+
import "./vscode.css"
5+
6+
const preview: Preview = {
7+
parameters: {
8+
controls: {
9+
matchers: {
10+
color: /(background|color)$/i,
11+
date: /Date$/i,
12+
},
13+
},
14+
},
15+
}
16+
17+
export default preview

webview-ui/.storybook/vscode.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* Use `Developer: Generate Color Theme From Current Settings` to generate themes
3+
* using your current VSCode settings.
4+
*
5+
* See: https://code.visualstudio.com/docs/getstarted/themes
6+
*/
7+
8+
:root {
9+
--vscode-editor-background: #1f1f1f; /* "editor.background" */
10+
--vscode-editor-foreground: #cccccc; /* "editor.foreground" */
11+
--vscode-menu-background: #1f1f1f; /* "menu.background" */
12+
--vscode-menu-foreground: #cccccc; /* "menu.foreground" */
13+
--vscode-button-background: #0078d4; /* "button.background" */
14+
--vscode-button-foreground: #ffffff; /* "button.foreground" */
15+
--vscode-button-secondaryBackground: #313131; /* "button.secondaryBackground" */
16+
--vscode-button-secondaryForeground: #cccccc; /* "button.secondaryForeground" */
17+
--vscode-disabledForeground: red; /* "disabledForeground" */
18+
--vscode-descriptionForeground: #9d9d9d; /* "descriptionForeground" */
19+
--vscode-focusBorder: #0078d4; /* "focusBorder" */
20+
--vscode-errorForeground: #f85149; /* "errorForeground" */
21+
--vscode-widget-border: #313131; /* "widget.border" */
22+
--vscode-input-background: #313131; /* "input.background" */
23+
--vscode-input-foreground: #cccccc; /* "input.foreground" */
24+
--vscode-input-border: #3c3c3c; /* "input.border" */
25+
26+
/* I can't find these in the output of `Developer: Generate Color Theme From Current Settings` */
27+
--vscode-charts-red: red;
28+
--vscode-charts-blue: blue;
29+
--vscode-charts-yellow: yellow;
30+
--vscode-charts-orange: orange;
31+
--vscode-charts-green: green;
32+
}

webview-ui/components.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "tailwind.config.js",
8+
"css": "src/index.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
21+
}

0 commit comments

Comments
 (0)