add Button component and Storybook configuration
Some checks failed
CI TEST (Vault secrets) / build (push) Failing after 9s
Some checks failed
CI TEST (Vault secrets) / build (push) Failing after 9s
This commit is contained in:
30
.storybook/constants.ts
Normal file
30
.storybook/constants.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
export const CUSTOM_VIEW_PORTS = {
|
||||
sm: {
|
||||
name: "Small",
|
||||
styles: {
|
||||
width: "375px",
|
||||
height: "800px",
|
||||
},
|
||||
},
|
||||
md: {
|
||||
name: "Medium",
|
||||
styles: {
|
||||
width: "768px",
|
||||
height: "1024px",
|
||||
},
|
||||
},
|
||||
lg: {
|
||||
name: "Large",
|
||||
styles: {
|
||||
width: "1024px",
|
||||
height: "1366px",
|
||||
},
|
||||
},
|
||||
xl: {
|
||||
name: "Extra Large",
|
||||
styles: {
|
||||
width: "1440px",
|
||||
height: "900px",
|
||||
},
|
||||
},
|
||||
};
|
||||
18
.storybook/main.js
Normal file
18
.storybook/main.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
|
||||
export default {
|
||||
stories: ["../src/**/*.stories.@(js|jsx|ts|tsx)"],
|
||||
staticDirs: ["../public"],
|
||||
framework: {
|
||||
name: "@storybook-astro/framework",
|
||||
},
|
||||
core: {
|
||||
disableTelemetry: true,
|
||||
enableCrashReports: false,
|
||||
},
|
||||
async viteFinal(config) {
|
||||
config.plugins = config.plugins || [];
|
||||
config.plugins.push(tailwindcss());
|
||||
return config;
|
||||
},
|
||||
};
|
||||
1
.storybook/preview.css
Normal file
1
.storybook/preview.css
Normal file
@@ -0,0 +1 @@
|
||||
@import "../src/app/styles/global.css";
|
||||
22
.storybook/preview.js
Normal file
22
.storybook/preview.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import "./preview.css";
|
||||
import { INITIAL_VIEWPORTS } from "storybook/viewport";
|
||||
import { CUSTOM_VIEW_PORTS } from "./constants.ts";
|
||||
|
||||
const preview = {
|
||||
parameters: {
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/i,
|
||||
},
|
||||
},
|
||||
backgrounds: {
|
||||
default: "darky",
|
||||
values: [{ name: "darky", value: "#0b121a" }],
|
||||
},
|
||||
viewport: {
|
||||
options: { ...CUSTOM_VIEW_PORTS, ...INITIAL_VIEWPORTS },
|
||||
},
|
||||
},
|
||||
};
|
||||
export default preview;
|
||||
Reference in New Issue
Block a user