diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 3317e750e0c5..a57524a04ebb 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,4 +1,5 @@ 34e364a0ca1d93555d36a7367d78e8e229493de8 c0896915fb7fb9a8dd416b9aebca17abd909d1c1 a41c227037e7e7249b8b376f838f4f8bcc3e3e59 -13c46e6c0b7f3dd8cf4ba42d1cfd6714f4777d54 \ No newline at end of file +13c46e6c0b7f3dd8cf4ba42d1cfd6714f4777d54 +0a4522a3f84773f39daec4820c49b8a92e9f9d11 \ No newline at end of file diff --git a/code/.storybook/main.ts b/code/.storybook/main.ts index 7c4f74c8c2ef..6a1f51f62f7c 100644 --- a/code/.storybook/main.ts +++ b/code/.storybook/main.ts @@ -68,6 +68,10 @@ const config: StorybookConfig = { directory: '../addons/toolbars/template/stories', titlePrefix: 'addons/toolbars', }, + { + directory: '../addons/themes/template/stories', + titlePrefix: 'addons/themes', + }, { directory: '../addons/onboarding/src', titlePrefix: 'addons/onboarding', @@ -83,6 +87,7 @@ const config: StorybookConfig = { ], addons: [ '@storybook/addon-links', + '@storybook/addon-themes', '@storybook/addon-essentials', '@storybook/addon-interactions', '@storybook/addon-storysource', @@ -119,7 +124,6 @@ const config: StorybookConfig = { }, features: { viewportStoryGlobals: true, - themesStoryGlobals: true, backgroundsStoryGlobals: true, }, viteFinal: (viteConfig, { configType }) => diff --git a/code/.storybook/preview.tsx b/code/.storybook/preview.tsx index c80bdcea2937..548f29473efc 100644 --- a/code/.storybook/preview.tsx +++ b/code/.storybook/preview.tsx @@ -12,16 +12,17 @@ import { } from 'storybook/internal/theming'; import { useArgs, DocsContext as DocsContextProps } from 'storybook/internal/preview-api'; import type { PreviewWeb } from 'storybook/internal/preview-api'; -import type { ReactRenderer } from '@storybook/react'; +import type { ReactRenderer, Decorator } from '@storybook/react'; import type { Channel } from 'storybook/internal/channels'; import { DocsContext } from '@storybook/blocks'; +import { MINIMAL_VIEWPORTS } from '@storybook/addon-viewport'; import { DocsPageWrapper } from '../lib/blocks/src/components'; const { document } = global; -const ThemeBlock = styled.div<{ side: 'left' | 'right' }>( +const ThemeBlock = styled.div<{ side: 'left' | 'right'; layout: string }>( { position: 'absolute', top: 0, @@ -31,8 +32,10 @@ const ThemeBlock = styled.div<{ side: 'left' | 'right' }>( height: '100vh', bottom: 0, overflow: 'auto', - padding: 10, }, + ({ layout }) => ({ + padding: layout === 'fullscreen' ? 0 : '1rem', + }), ({ theme }) => ({ background: theme.background.content, color: theme.color.defaultText, @@ -49,14 +52,17 @@ const ThemeBlock = styled.div<{ side: 'left' | 'right' }>( } ); -const ThemeStack = styled.div( +const ThemeStack = styled.div<{ layout: string }>( { position: 'relative', - minHeight: 'calc(50vh - 15px)', + flex: 1, }, ({ theme }) => ({ background: theme.background.content, color: theme.color.defaultText, + }), + ({ layout }) => ({ + padding: layout === 'fullscreen' ? 0 : '1rem', }) ); @@ -80,6 +86,25 @@ const PlayFnNotice = styled.div( }) ); +const StackContainer = ({ children, layout }) => ( +
+