From cd4c6d22745a10516f4bc28a6fc2fe73b415cfc9 Mon Sep 17 00:00:00 2001 From: Stephanos Date: Thu, 19 Dec 2024 17:55:10 +0800 Subject: [PATCH] Revert "refactor: Storybook Config to make absolute paths work" This reverts commit 71c325eba33aef742bbba7eb48e9c3b309733e3e. --- .storybook/main.ts | 13 ------------- src/components/Buttons/ZDSButton.stories.tsx | 7 ++++++- .../cta-common-btn/ZDSAidaCtaCommonBtn.stories.tsx | 8 +++++++- src/components/Grids/ZDSGrantCard.stories.tsx | 10 ++++++++++ src/components/Grids/ZDSGrantCard.tsx | 4 ++++ src/components/Menu/MuiMenu/ZDSDropdown.stories.tsx | 5 +++++ .../SearchInput/ZDSSearchInput.stories.tsx | 6 ++++++ src/components/Tables/TabulatorTables/data.ts | 13 ++++++++++++- src/components/buttons/cta-common-btn/index.tsx | 7 ++++++- tsconfig.json | 3 --- 10 files changed, 56 insertions(+), 20 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 5ce9782..29077d7 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -1,5 +1,4 @@ import type { StorybookConfig } from "@storybook/react-webpack5"; -import path from "path"; const config: StorybookConfig = { stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], @@ -22,17 +21,5 @@ const config: StorybookConfig = { autodocs: true, }, staticDirs: ["../public"], - - webpackFinal: async (config) => { - if (config.resolve) { - config.resolve.alias = { - ...config.resolve.alias, - theme: path.resolve(__dirname, "../src/theme"), - assets: path.resolve(__dirname, "../src/assets"), - app: path.resolve(__dirname, "../src/app"), - }; - } - return config; - }, }; export default config; diff --git a/src/components/Buttons/ZDSButton.stories.tsx b/src/components/Buttons/ZDSButton.stories.tsx index 04e4664..2bf5cca 100644 --- a/src/components/Buttons/ZDSButton.stories.tsx +++ b/src/components/Buttons/ZDSButton.stories.tsx @@ -1,7 +1,12 @@ import type { Meta, StoryObj } from "@storybook/react"; import { fn } from "@storybook/test"; +<<<<<<< Updated upstream:src/components/Buttons/ZDSButton.stories.tsx import Button from "./ZDSButton"; -import { ReactComponent as GoogleIcon } from "assets/AIDA/vectors/HeaderSignInViewGoogle.svg"; +import { ReactComponent as GoogleIcon } from "../../assets/AIDA/vectors/HeaderSignInViewGoogle.svg"; +======= +import Button from "./myButton"; +import { ReactComponent as GoogleIcon } from "assets/vectors/jsx/HeaderSignInViewGoogle.svg"; +>>>>>>> Stashed changes:src/components/Buttons/myButton.stories.tsx import ExpandMore from "@mui/icons-material/ExpandMore"; import ExpandLess from "@mui/icons-material/ExpandLess"; import colors from "../../theme/colors"; diff --git a/src/components/Buttons/cta-common-btn/ZDSAidaCtaCommonBtn.stories.tsx b/src/components/Buttons/cta-common-btn/ZDSAidaCtaCommonBtn.stories.tsx index 9c99c94..1ba7c3f 100644 --- a/src/components/Buttons/cta-common-btn/ZDSAidaCtaCommonBtn.stories.tsx +++ b/src/components/Buttons/cta-common-btn/ZDSAidaCtaCommonBtn.stories.tsx @@ -1,7 +1,13 @@ import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; -import { ExplorerLargeCtaIcon } from "assets/AIDA/jsx/ExplorerLargeCtaIcon"; +<<<<<<< Updated upstream:src/components/Buttons/cta-common-btn/ZDSAidaCtaCommonBtn.stories.tsx +import { ExplorerLargeCtaIcon } from "../../../assets/AIDA/jsx/ExplorerLargeCtaIcon"; + import { ZDSAidaCtaCommonBtn } from "."; +======= +import { ExplorerLargeCtaIcon } from "assets/vectors/jsx/ExplorerLargeCtaIcon"; +import { CtaCommonBtn } from "."; +>>>>>>> Stashed changes:src/components/buttons/cta-common-btn/CtaCommonBtn.stories.tsx import { withRouter } from "storybook-addon-remix-react-router"; const meta = { diff --git a/src/components/Grids/ZDSGrantCard.stories.tsx b/src/components/Grids/ZDSGrantCard.stories.tsx index 0273601..525573e 100644 --- a/src/components/Grids/ZDSGrantCard.stories.tsx +++ b/src/components/Grids/ZDSGrantCard.stories.tsx @@ -1,10 +1,20 @@ import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; +<<<<<<< Updated upstream:src/components/Grids/ZDSGrantCard.stories.tsx +// import { withRouter } from "storybook-addon-remix-react-router"; import { ZDSGrantCard } from "./ZDSGrantCard"; const meta = { title: "Example/Grid", component: ZDSGrantCard, + // decorators: [withRouter], +======= +import { GrantCard } from "./GrantCard"; + +const meta = { + title: "Example/Grid", + component: GrantCard, +>>>>>>> Stashed changes:src/components/grids/GrantCard.stories.tsx parameters: { layout: "fullscreen", }, diff --git a/src/components/Grids/ZDSGrantCard.tsx b/src/components/Grids/ZDSGrantCard.tsx index 7d00797..8e7e056 100644 --- a/src/components/Grids/ZDSGrantCard.tsx +++ b/src/components/Grids/ZDSGrantCard.tsx @@ -3,7 +3,11 @@ import Box from "@mui/material/Box"; import Divider from "@mui/material/Divider"; import Typography from "@mui/material/Typography"; import LocationIcon from "@mui/icons-material/LocationOn"; +<<<<<<< Updated upstream:src/components/Grids/ZDSGrantCard.tsx +import { GrantCardProps } from "./data"; // Ensure this path is correct and the file exists +======= import { GrantCardProps } from "./data"; +>>>>>>> Stashed changes:src/components/grids/GrantCard.tsx export const ZDSGrantCard: React.FC = ( props: GrantCardProps diff --git a/src/components/Menu/MuiMenu/ZDSDropdown.stories.tsx b/src/components/Menu/MuiMenu/ZDSDropdown.stories.tsx index 04a866f..b4d66c4 100644 --- a/src/components/Menu/MuiMenu/ZDSDropdown.stories.tsx +++ b/src/components/Menu/MuiMenu/ZDSDropdown.stories.tsx @@ -1,7 +1,12 @@ import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; +<<<<<<< Updated upstream:src/components/Menu/MuiMenu/ZDSDropdown.stories.tsx import MyDropdown from "./ZDSDropdown"; +import { colors } from "../../../theme"; +======= +import MyDropdown from "./myDropdown"; import { colors } from "theme"; +>>>>>>> Stashed changes:src/components/Menu/MuiMenu/mydropdown.stories.tsx import IconButton from "@mui/material/IconButton"; import MenuRounded from "@mui/icons-material/MenuRounded"; import AccountCircleIcon from "@mui/icons-material/AccountCircle"; diff --git a/src/components/SearchInput/ZDSSearchInput.stories.tsx b/src/components/SearchInput/ZDSSearchInput.stories.tsx index b14da32..3d13f80 100644 --- a/src/components/SearchInput/ZDSSearchInput.stories.tsx +++ b/src/components/SearchInput/ZDSSearchInput.stories.tsx @@ -1,8 +1,14 @@ import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; +<<<<<<< Updated upstream:src/components/SearchInput/ZDSSearchInput.stories.tsx import { ZDSSearchInput } from "./ZDSSearchInput"; import { ReactComponent as ExplorerSearchIcon } from "../../assets/OpenAid/vectors/ExplorerSearchIcon.svg"; import colors from "../../theme/colorsSeaerchInput"; +======= +import { mySearchInput } from "./mySearchInput"; +import { ReactComponent as ExplorerSearchIcon } from "assets/vectors/ExplorerSearchIcon.svg"; +import colors from "theme/colorsSeaerchInput"; +>>>>>>> Stashed changes:src/components/SearchInput/mySearchInput.stories.tsx import { Box } from "@mui/material"; import SearchIcon from "@mui/icons-material/Search"; import ClearIcon from "@mui/icons-material/Clear"; diff --git a/src/components/Tables/TabulatorTables/data.ts b/src/components/Tables/TabulatorTables/data.ts index 85347ec..755a782 100644 --- a/src/components/Tables/TabulatorTables/data.ts +++ b/src/components/Tables/TabulatorTables/data.ts @@ -1,9 +1,20 @@ +<<<<<<< Updated upstream +import { appColors } from "./../../../app/theme/index"; +import { formatLocale } from "./../../../app/utils/formatLocale"; +import { + CellComponent, + ColumnDefinition, + TabulatorFull as Tabulator, +} from "tabulator-tables"; +import { TableDataItem } from "./ZDSTabulatorTable"; +======= import { appColors } from "app/theme/index"; import { formatLocale } from "app/utils/formatLocale"; import { CellComponent } from "tabulator-tables"; import { ColumnDefinition } from "tabulator-tables"; import { TabulatorFull as Tabulator } from "tabulator-tables"; -import { TableDataItem } from "./ZDSTabulatorTable"; +import { TableDataItem } from "./myTabulatorTable"; +>>>>>>> Stashed changes export const TABULATOR_BORDER_STYLES = { BLUE: "2px solid blue", diff --git a/src/components/buttons/cta-common-btn/index.tsx b/src/components/buttons/cta-common-btn/index.tsx index 3c9dd7e..2dcf21f 100644 --- a/src/components/buttons/cta-common-btn/index.tsx +++ b/src/components/buttons/cta-common-btn/index.tsx @@ -5,8 +5,13 @@ import { useNavigate } from "react-router-dom"; import ButtonBase from "@mui/material/ButtonBase"; import Typography from "@mui/material/Typography"; import ArrowOutward from "@mui/icons-material/ArrowOutward"; -import { ZDSAidaCtaCommonBtnVariantStyles } from "./data"; +<<<<<<< Updated upstream +import { CtaCommonBtnProps, ZDSAidaCtaCommonBtnVariantStyles } from "./data"; +import { Color } from "@mui/material"; +======= +import { CtaCommonBtnVariantStyles } from "./data"; import { CtaCommonBtnProps } from "./data"; +>>>>>>> Stashed changes export const ZDSAidaCtaCommonBtn: React.FC = ( props: CtaCommonBtnProps diff --git a/tsconfig.json b/tsconfig.json index 2b1b0aa..ab14485 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,9 +5,6 @@ "outDir": "dist", "declarationDir": "dist/types", "baseUrl": "./src", - "paths": { - "theme/*": ["theme/*"] - }, "lib": [ "dom", "dom.iterable",