Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 23 additions & 20 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { ReactNode } from 'react';
import type { DecoratorFunction, GlobalTypes, Parameters } from 'storybook/internal/types';

import { Box } from '@launchpad-ui/box';
import { FocusTrapContext } from '@launchpad-ui/focus-trap';
import sprite from '@launchpad-ui/icons/img/sprite.svg';
import { withThemeByDataAttribute } from '@storybook/addon-themes';
import { BrowserRouter, useNavigate } from 'react-router';
Expand Down Expand Up @@ -156,29 +157,31 @@ const decorators: DecoratorFunction<ReactRenderer>[] = [
return (
<BrowserRouter>
<RouterProvider>
{mirror ? (
<Box display="flex" flexDirection={sideBySide ? 'row' : 'column'} minHeight="100vh">
<Box
padding="$400"
width={sideBySide ? '50vw' : undefined}
height={stacked ? '50vh' : undefined}
>
<StoryFn />
<FocusTrapContext.Provider value={{ contain: false }}>
{mirror ? (
<Box display="flex" flexDirection={sideBySide ? 'row' : 'column'} minHeight="100vh">
<Box
padding="$400"
width={sideBySide ? '50vw' : undefined}
height={stacked ? '50vh' : undefined}
>
<StoryFn />
</Box>
<Box
data-theme="dark"
padding="$400"
width={sideBySide ? '50vw' : undefined}
height={stacked ? '50vh' : undefined}
>
<StoryFn />
</Box>
</Box>
<Box
data-theme="dark"
padding="$400"
width={sideBySide ? '50vw' : undefined}
height={stacked ? '50vh' : undefined}
>
) : (
<Box padding="$400">
<StoryFn />
</Box>
</Box>
) : (
<Box padding="$400">
<StoryFn />
</Box>
)}
)}
</FocusTrapContext.Provider>
</RouterProvider>
</BrowserRouter>
);
Expand Down
Loading