diff --git a/code/ui/blocks/src/components/Source.tsx b/code/ui/blocks/src/components/Source.tsx index 94d3df6b9ef9..4d72f2f45aed 100644 --- a/code/ui/blocks/src/components/Source.tsx +++ b/code/ui/blocks/src/components/Source.tsx @@ -1,6 +1,6 @@ import type { ComponentProps, FunctionComponent } from 'react'; import React from 'react'; -import { styled, ThemeProvider, convert, themes } from '@storybook/theming'; +import { styled, ThemeProvider, convert, themes, ignoreSsrWarning } from '@storybook/theming'; import { SyntaxHighlighter } from '@storybook/components'; import { EmptyBlock } from './EmptyBlock'; @@ -69,7 +69,7 @@ const SourceSkeletonPlaceholder = styled.div(({ theme }) => ({ marginTop: 1, width: '60%', - [`&:first-child`]: { + [`&:first-child${ignoreSsrWarning}`]: { margin: 0, }, })); diff --git a/code/ui/components/src/spaced/Spaced.tsx b/code/ui/components/src/spaced/Spaced.tsx index 2fdb767fed08..52f0ecf9d7c1 100644 --- a/code/ui/components/src/spaced/Spaced.tsx +++ b/code/ui/components/src/spaced/Spaced.tsx @@ -1,6 +1,6 @@ import type { FC } from 'react'; import React from 'react'; -import { styled } from '@storybook/theming'; +import { styled, ignoreSsrWarning } from '@storybook/theming'; const toNumber = (input: any) => (typeof input === 'number' ? input : Number(input)); @@ -20,7 +20,7 @@ const Container = styled.div( marginLeft: col * theme.layoutMargin, verticalAlign: 'inherit', }, - [`& > *:first-child`]: { + [`& > *:first-child${ignoreSsrWarning}`]: { marginLeft: 0, }, } @@ -28,7 +28,7 @@ const Container = styled.div( '& > *': { marginTop: row * theme.layoutMargin, }, - [`& > *:first-child`]: { + [`& > *:first-child${ignoreSsrWarning}`]: { marginTop: 0, }, }, diff --git a/code/ui/components/src/tabs/tabs.tsx b/code/ui/components/src/tabs/tabs.tsx index 89d95a11baec..454a92376d83 100644 --- a/code/ui/components/src/tabs/tabs.tsx +++ b/code/ui/components/src/tabs/tabs.tsx @@ -10,6 +10,9 @@ import type { ChildrenList } from './tabs.helpers'; import { childrenToList, VisuallyHidden } from './tabs.helpers'; import { useList } from './tabs.hooks'; +const ignoreSsrWarning = + '/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */'; + export interface WrapperProps { bordered?: boolean; absolute?: boolean; @@ -84,7 +87,7 @@ const Content = styled.div( bottom: 0 + (bordered ? 1 : 0), top: 40 + (bordered ? 1 : 0), overflow: 'auto', - [`& > *:first-child`]: { + [`& > *:first-child${ignoreSsrWarning}`]: { position: 'absolute', left: 0 + (bordered ? 1 : 0), right: 0 + (bordered ? 1 : 0), diff --git a/code/ui/manager/src/index.tsx b/code/ui/manager/src/index.tsx index 0660ababc796..9f843d0069e5 100644 --- a/code/ui/manager/src/index.tsx +++ b/code/ui/manager/src/index.tsx @@ -6,21 +6,14 @@ import ReactDOM from 'react-dom'; import { Location, LocationProvider, useNavigate } from '@storybook/router'; import { Provider as ManagerProvider } from '@storybook/manager-api'; import type { Combo } from '@storybook/manager-api'; -import { - ThemeProvider, - ensure as ensureTheme, - CacheProvider, - createCache, -} from '@storybook/theming'; +import { ThemeProvider, ensure as ensureTheme } from '@storybook/theming'; + import { HelmetProvider } from 'react-helmet-async'; import App from './app'; import Provider from './provider'; -const emotionCache = createCache({ key: 'sto' }); -emotionCache.compat = true; - // @ts-expect-error (Converted from ts-ignore) ThemeProvider.displayName = 'ThemeProvider'; // @ts-expect-error (Converted from ts-ignore) @@ -59,16 +52,14 @@ const Main: FC<{ provider: Provider }> = ({ provider }) => { : !state.previewInitialized; return ( - - - - - + + + ); }}