Skip to content

Commit

Permalink
refactor: revert storybook parameter centralization
Browse files Browse the repository at this point in the history
  • Loading branch information
haideralsh committed Dec 6, 2024
1 parent 7c87ca8 commit aecb78d
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 26 deletions.
6 changes: 4 additions & 2 deletions src/BottomSheet/stories/BottomSheet.actions.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import React from "react";
import { Button, PrimaryButton, QuietButton } from "../../Button";
import { Placeholder } from "../../utils/story/placeholder";
import BottomSheet from "../BottomSheet";
import { storyParams } from "./BottomSheet.story";

export default {
...storyParams,
title: "Components/BottomSheet/Actions",
parameters: {
chromatic: { delay: 1000 },
},
decorators: [(storyFn) => <div style={{ width: "800px", height: "800px" }}>{storyFn()}</div>],
};

export const WithAHiddenCloseButton = () => {
Expand Down
6 changes: 4 additions & 2 deletions src/BottomSheet/stories/BottomSheet.content.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import { Link } from "../../Link";
import { Text } from "../../Type";
import { Placeholder } from "../../utils/story/placeholder";
import BottomSheet from "../BottomSheet";
import { storyParams } from "./BottomSheet.story";

export default {
...storyParams,
title: "Components/BottomSheet/Content",
parameters: {
chromatic: { delay: 1000 },
},
decorators: [(storyFn) => <div style={{ width: "800px", height: "800px" }}>{storyFn()}</div>],
};

export const WithHelpText = () => {
Expand Down
6 changes: 4 additions & 2 deletions src/BottomSheet/stories/BottomSheet.features.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ import { toast, ToastContainer } from "../../ToastContainer";
import { Text } from "../../Type";
import { Placeholder } from "../../utils/story/placeholder";
import BottomSheet from "../BottomSheet";
import { storyParams } from "./BottomSheet.story";

export default {
...storyParams,
title: "Components/BottomSheet/Features",
parameters: {
chromatic: { delay: 1000 },
},
decorators: [(storyFn) => <div style={{ width: "800px", height: "800px" }}>{storyFn()}</div>],
};

export const WithCustomWidths = () => {
Expand Down
6 changes: 4 additions & 2 deletions src/BottomSheet/stories/BottomSheet.parts.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import { Flex } from "../../Flex";
import { Link } from "../../Link";
import { Placeholder } from "../../utils/story/placeholder";
import { BottomSheetParts as BottomSheet } from "../BottomSheet.parts";
import { storyParams } from "./BottomSheet.story";

export default {
...storyParams,
title: "Components/BottomSheet/Parts",
parameters: {
chromatic: { delay: 1000 },
},
decorators: [(storyFn) => <div style={{ width: "800px", height: "800px" }}>{storyFn()}</div>],
};

export const RenderedUsingCompositionalAPI = () => {
Expand Down
10 changes: 3 additions & 7 deletions src/BottomSheet/stories/BottomSheet.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ import { Button } from "../../Button";
import { Placeholder } from "../../utils/story/placeholder";
import BottomSheet from "../BottomSheet";

export const storyParams = {
decorators: [(storyFn) => <div style={{ width: "800px", height: "800px" }}>{storyFn()}</div>],
export default {
title: "Components/BottomSheet",
parameters: {
chromatic: { delay: 1000 },
},
} as const;

export default {
...storyParams,
title: "Components/BottomSheet",
decorators: [(storyFn) => <div style={{ width: "800px", height: "800px" }}>{storyFn()}</div>],
};

export const BasicUsage = () => {
Expand Down
3 changes: 2 additions & 1 deletion src/TopBar/TopBar.styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ const TileLink = styled.a(({ theme }) => ({
color: theme.colors.white,
gap: theme.space.x1_5,
whiteSpace: "nowrap",
textOverflow: "hidden",
outlineOffset: theme.space.x0_25,
outlineColor: theme.colors.blue,
}));

const StyledMenuItem = styled(motion.li)(({ theme }) => ({
Expand Down
11 changes: 9 additions & 2 deletions src/TopBar/stories/TopBar.backButton.story.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import React from "react";
import { Link, BrowserRouter } from "react-router-dom";
import { legacy as theme } from "../../theme/theme";
import numberFromDimension from "../../utils/numberFromDimension";
import { TopBar } from "../TopBar";
import { menuItems } from "./fixtures";
import { storyParams } from "./TopBar.story";

export default {
...storyParams,
parameters: {
layout: "fullscreen",
chromatic: {
viewports: [theme.breakpoints.small, theme.breakpoints.medium, theme.breakpoints.large].map(numberFromDimension),
delay: 1000,
},
},
title: "Components/TopBar/BackLink",
};

Expand Down
11 changes: 9 additions & 2 deletions src/TopBar/stories/TopBar.menu.story.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import React from "react";
import { Link, BrowserRouter } from "react-router-dom";
import { legacy as theme } from "../../theme/theme";
import numberFromDimension from "../../utils/numberFromDimension";
import { TopBar } from "../TopBar";
import { menuItems } from "./fixtures";
import { storyParams } from "./TopBar.story";

export default {
...storyParams,
parameters: {
layout: "fullscreen",
chromatic: {
viewports: [theme.breakpoints.small, theme.breakpoints.medium, theme.breakpoints.large].map(numberFromDimension),
delay: 1000,
},
},
title: "Components/TopBar/Menu",
};

Expand Down
8 changes: 2 additions & 6 deletions src/TopBar/stories/TopBar.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@ import React from "react";
import { FormSection } from "../../Form";
import { Input } from "../../Input";
import { ApplicationFrame, Page } from "../../Layout";
import { TopBar } from "../TopBar";
import { legacy as theme } from "../../theme/theme";
import numberFromDimension from "../../utils/numberFromDimension";
import { TopBar } from "../TopBar";
import { menuItems } from "./fixtures";

export const storyParams = {
export default {
parameters: {
layout: "fullscreen",
chromatic: {
viewports: [theme.breakpoints.small, theme.breakpoints.medium, theme.breakpoints.large].map(numberFromDimension),
delay: 1000,
},
},
} as const;

export default {
...storyParams,
title: "Components/TopBar",
};

Expand Down

0 comments on commit aecb78d

Please sign in to comment.