Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ - chore: update Storybook #151

Merged
merged 8 commits into from
Oct 18, 2024
112 changes: 112 additions & 0 deletions .storybook/fixtures/products.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
export const FIXTURE_PRODUCTS = [
{
id: 1,
name: "Wireless Headphones",
description: "High-quality wireless headphones with noise cancellation.",
url: "https://www.example.com/products/1",
price: 99.99,
stock: 50,
category: "Electronics",
isAvailable: true,
releaseDate: "2023-01-15", // YYYY-MM-DD format
},
{
id: 2,
name: "Smartwatch",
description: "A smartwatch with fitness tracking and notifications.",
url: "https://www.example.com/products/2",
price: 199.99,
stock: 30,
category: "Wearables",
isAvailable: false,
releaseDate: "2023-02-20",
},
{
id: 3,
name: "Laptop Stand",
description: "An ergonomic laptop stand to improve posture while working.",
url: "https://www.example.com/products/3",
price: 39.99,
stock: 100,
category: "Accessories",
isAvailable: true,
releaseDate: "2023-03-10",
},
{
id: 4,
name: "Bluetooth Speaker",
description: "Portable Bluetooth speaker with rich sound quality.",
url: "https://www.example.com/products/4",
price: 49.99,
stock: 75,
category: "Audio",
isAvailable: true,
releaseDate: "2023-04-25",
},
{
id: 5,
name: "4K Monitor",
description: "High-resolution 4K monitor for stunning visuals.",
url: "https://www.example.com/products/5",
price: 299.99,
stock: 20,
category: "Monitors",
isAvailable: false,
releaseDate: "2023-05-15",
},
{
id: 6,
name: "Wireless Mouse",
description: "Ergonomic wireless mouse with customizable buttons.",
url: "https://www.example.com/products/6",
price: 29.99,
stock: 150,
category: "Accessories",
isAvailable: true,
releaseDate: "2023-06-30",
},
{
id: 7,
name: "Gaming Keyboard",
description: "Mechanical gaming keyboard with RGB lighting.",
url: "https://www.example.com/products/7",
price: 89.99,
stock: 60,
category: "Gaming",
isAvailable: false,
releaseDate: "2023-07-18",
},
{
id: 8,
name: "External Hard Drive",
description: "1TB external hard drive for data storage.",
url: "https://www.example.com/products/8",
price: 69.99,
stock: 40,
category: "Storage",
isAvailable: true,
releaseDate: "2023-08-05",
},
{
id: 9,
name: "Phone Case",
description: "Durable phone case with shock absorption.",
url: "https://www.example.com/products/9",
price: 19.99,
stock: 200,
category: "Accessories",
isAvailable: true,
releaseDate: "2023-09-12",
},
{
id: 10,
name: "Smart TV",
description: "65-inch smart TV with 4K resolution and streaming capabilities.",
url: "https://www.example.com/products/10",
price: 599.99,
stock: 10,
category: "Electronics",
isAvailable: false,
releaseDate: "2023-10-01",
},
];
129 changes: 129 additions & 0 deletions .storybook/fixtures/todos.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
export const FIXTURE_TODOS = [
{
id: 1,
title: "Complete documentation for new feature",
url: "https://www.example.com/todos/1",
thumbnailURl: "/static/maykin_logo.png",
completed: false,
dueDate: "2024-11-01",
priority: "High",
description: "Complete the documentation for the new feature implementation.",
status: "in_progress",
},
{
id: 2,
title: "Review and merge pull requests",
url: "https://www.example.com/todos/2",
thumbnailURl: "/static/maykin_logo.png",
completed: true,
dueDate: "2024-10-10",
priority: "Medium",
description: "Review the pull requests and merge if everything looks good.",
status: "done",
},
{
id: 3,
title: "Fix minor bugs from user feedback",
url: "https://www.example.com/todos/3",
thumbnailURl: "/static/maykin_logo.png",
completed: false,
dueDate: "2024-10-20",
priority: "Low",
description: "Fix the minor bugs reported in the user feedback.",
status: "todo",
},
{
id: 4,
title: "Prepare quarterly financial report",
url: "https://www.example.com/todos/4",
thumbnailURl: "/static/maykin_logo.png",
completed: true,
dueDate: "2024-09-30",
priority: "High",
description: "Prepare the quarterly financial report for the team meeting.",
status: "done",
},
{
id: 5,
title: "Organize and archive older project files",
url: "https://www.example.com/todos/5",
thumbnailURl: "/static/maykin_logo.png",
completed: false,
dueDate: "2024-11-15",
priority: "Low",
description: "Organize and archive older project files to save storage space.",
status: "in_review",
},
{
id: 6,
title: "Conduct developer interviews",
url: "https://www.example.com/todos/6",
thumbnailURl: "/static/maykin_logo.png",
completed: true,
dueDate: "2024-10-12",
priority: "Medium",
description: "Conduct interviews for the new developer positions.",
status: "done",
},
{
id: 7,
title: "Draft client project proposal",
url: "https://www.example.com/todos/7",
thumbnailURl: "/static/maykin_logo.png",
completed: false,
dueDate: "2024-11-05",
priority: "High",
description: "Draft the proposal for the new client project.",
status: "in_progress",
},
{
id: 8,
title: "Update website with new content",
url: "https://www.example.com/todos/8",
thumbnailURl: "/static/maykin_logo.png",
completed: false,
dueDate: "2024-12-01",
priority: "Medium",
description: "Update the company website with the latest blog posts and testimonials.",
status: "todo",
},
{
id: 9,
title: "Approve marketing materials",
url: "https://www.example.com/todos/9",
thumbnailURl: "/static/maykin_logo.png",
completed: true,
dueDate: "2024-10-08",
priority: "Low",
description: "Review and approve the marketing materials for the product launch.",
status: "done",
},
{
id: 10,
title: "Plan team-building event",
url: "https://www.example.com/todos/10",
thumbnailURl: "/static/maykin_logo.png",
completed: false,
dueDate: "2024-10-25",
priority: "High",
description: "Plan the upcoming team-building event and book the venue.",
status: "todo",
},
];


export const FIXTURE_TODOS_STATUS_TODO = FIXTURE_TODOS.filter(
(t) => t.status === "todo",
);

export const FIXTURE_TODOS_STATUS_IN_PROGRESS = FIXTURE_TODOS.filter(
(t) => t.status === "in_progress",
);

export const FIXTURE_TODOS_STATUS_IN_REVIEW = FIXTURE_TODOS.filter(
(t) => t.status === "in_review",
);

export const FIXTURE_TODOS_STATUS_DONE = FIXTURE_TODOS.filter(
(t) => t.status === "done",
);
14 changes: 8 additions & 6 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,37 @@ import type { StorybookConfig } from "@storybook/react-webpack5";
import * as path from "path";

const config: StorybookConfig = {

stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
staticDirs: [{ from: "./static", to: "/static"}],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-themes",
"@storybook/addon-webpack5-compiler-swc",
"@chromatic-com/storybook",
"@chromatic-com/storybook"
],
core: {
disableTelemetry: true,
disableTelemetry: true
},
framework: {
name: "@storybook/react-webpack5",
options: {
builder: {},
},
builder: {}
}
},
docs: {},
webpackFinal: async (config) => {
config?.module?.rules?.push({
test: /\.scss$/,
use: ["style-loader", "css-loader", "sass-loader"],
include: path.resolve(__dirname, "../"),
include: path.resolve(__dirname, "../")
});

// Add any other webpack config modifications here

return config;
},
}
};
export default config;
2 changes: 1 addition & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const preview: Preview = {
}) as any,
],

tags: ["autodocs", "autodocs"]
tags: ["autodocs"]
};

export default preview;
Binary file added .storybook/static/maykin_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading