2026-03-07 15:22:18 +09:00
|
|
|
import type { StorybookConfig } from "@storybook/react-vite";
|
|
|
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
|
import path from "path";
|
|
|
|
|
|
|
|
|
|
const config: StorybookConfig = {
|
|
|
|
|
stories: ["../src/**/*.stories.@(ts|tsx)"],
|
|
|
|
|
addons: ["@storybook/addon-essentials"],
|
|
|
|
|
framework: {
|
|
|
|
|
name: "@storybook/react-vite",
|
|
|
|
|
options: {},
|
|
|
|
|
},
|
|
|
|
|
staticDirs: ["../public"],
|
|
|
|
|
viteFinal: async config => {
|
|
|
|
|
config.plugins = config.plugins || [];
|
|
|
|
|
config.plugins.push(tailwindcss());
|
|
|
|
|
|
|
|
|
|
// Ensure JSX runtime is available (auto-imports React)
|
|
|
|
|
config.esbuild = {
|
|
|
|
|
...config.esbuild,
|
|
|
|
|
jsx: "automatic",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
config.resolve = config.resolve || {};
|
|
|
|
|
config.resolve.alias = {
|
|
|
|
|
...config.resolve.alias,
|
|
|
|
|
"@": path.resolve(__dirname, "../src"),
|
|
|
|
|
"next/link": path.resolve(__dirname, "mocks/next-link.tsx"),
|
|
|
|
|
"next/image": path.resolve(__dirname, "mocks/next-image.tsx"),
|
|
|
|
|
"next/navigation": path.resolve(__dirname, "mocks/next-navigation.tsx"),
|
|
|
|
|
};
|
|
|
|
|
|
refactor: complete shadcn/ui migration and unify raw HTML with component library
- Migrate all molecule components (DataTable, PaginationBar, FilterDropdown,
AlertBanner, FormField, SectionCard, SubCard, MetricCard, AnimatedCard,
OtpInput) to shadcn/ui primitives with legacy backups and comparison stories
- Install 24 shadcn/ui primitives (accordion, alert, badge, button, card,
checkbox, collapsible, dialog, dropdown-menu, input-otp, input, label,
pagination, popover, radio-group, select, separator, sheet, skeleton,
table, tabs, toggle-group, toggle, tooltip) with barrel exports
- Replace 69 raw HTML elements across all features with shadcn components:
35+ <button> → Button, 5 <select> → Select, 15+ <label> → Label,
6 <input type=checkbox> → Checkbox, 7 <input type=radio> → RadioGroup
- Add TextRotate animation component and integrate into hero section
with rotating service names (Internet, Phone Plans, VPN, IT Support, Business)
- Add destructive color token aliases for error state consistency
- Add CLAUDE.md rules for shadcn migration process
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:21:36 +09:00
|
|
|
// Pre-bundle ESM dependencies so Vite can resolve their exports
|
|
|
|
|
config.optimizeDeps = config.optimizeDeps || {};
|
|
|
|
|
config.optimizeDeps.include = [
|
|
|
|
|
...(config.optimizeDeps.include || []),
|
|
|
|
|
"framer-motion",
|
|
|
|
|
"@heroicons/react/24/outline",
|
|
|
|
|
"@heroicons/react/24/solid",
|
|
|
|
|
"radix-ui",
|
|
|
|
|
"lucide-react",
|
|
|
|
|
"class-variance-authority",
|
|
|
|
|
"input-otp",
|
|
|
|
|
];
|
|
|
|
|
|
2026-03-07 15:22:18 +09:00
|
|
|
// Disable PostCSS — @tailwindcss/vite handles CSS directly
|
|
|
|
|
config.css = config.css || {};
|
|
|
|
|
config.css.postcss = { plugins: [] };
|
|
|
|
|
|
|
|
|
|
// Polyfill process.env for Next.js code that uses it
|
|
|
|
|
config.define = {
|
|
|
|
|
...config.define,
|
|
|
|
|
"process.env": JSON.stringify({
|
|
|
|
|
NODE_ENV: "development",
|
|
|
|
|
}),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return config;
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default config;
|