Unverified Commit 5778fd4b authored by Jiwon Choi's avatar Jiwon Choi Committed by GitHub

[DevOverlay] Improve Storybook Structure (#74764)

This PR removed the `title` of stories; that way, it's 1:1 with the codebase. The better the structure of the codebase, the better the structure of the storybook. Also, added `background` colors to test out UI correctly.

Closes NDX-655
parent be99a2f4
...@@ -8,6 +8,16 @@ const preview: Preview = { ...@@ -8,6 +8,16 @@ const preview: Preview = {
date: /Date$/i, date: /Date$/i,
}, },
}, },
backgrounds: {
values: [
{ name: 'backdrop', value: 'rgb(44, 44, 46);' },
{ name: 'background-100-light', value: '#ffffff' },
{ name: 'background-200-light', value: '#fafafa' },
{ name: 'background-100-dark', value: '#0a0a0a' },
{ name: 'background-200-dark', value: '#000000' },
],
default: 'backdrop',
},
}, },
} }
......
...@@ -3,7 +3,6 @@ import { CodeFrame } from './CodeFrame' ...@@ -3,7 +3,6 @@ import { CodeFrame } from './CodeFrame'
import { withShadowPortal } from '../../storybook/with-shadow-portal' import { withShadowPortal } from '../../storybook/with-shadow-portal'
const meta: Meta<typeof CodeFrame> = { const meta: Meta<typeof CodeFrame> = {
title: 'CodeFrame',
component: CodeFrame, component: CodeFrame,
parameters: { parameters: {
layout: 'fullscreen', layout: 'fullscreen',
......
...@@ -3,10 +3,12 @@ import { CallStack } from './call-stack' ...@@ -3,10 +3,12 @@ import { CallStack } from './call-stack'
import { withShadowPortal } from '../../../storybook/with-shadow-portal' import { withShadowPortal } from '../../../storybook/with-shadow-portal'
const meta: Meta<typeof CallStack> = { const meta: Meta<typeof CallStack> = {
title: 'CallStack',
component: CallStack, component: CallStack,
parameters: { parameters: {
layout: 'fullscreen', layout: 'fullscreen',
backgrounds: {
default: 'background-100-dark',
},
}, },
decorators: [withShadowPortal], decorators: [withShadowPortal],
} }
......
...@@ -4,7 +4,6 @@ import { withShadowPortal } from '../../../storybook/with-shadow-portal' ...@@ -4,7 +4,6 @@ import { withShadowPortal } from '../../../storybook/with-shadow-portal'
import type { VersionInfo } from '../../../../../../../../server/dev/parse-version-info' import type { VersionInfo } from '../../../../../../../../server/dev/parse-version-info'
const meta: Meta<typeof DevToolsIndicator> = { const meta: Meta<typeof DevToolsIndicator> = {
title: 'DevToolsIndicator',
component: DevToolsIndicator, component: DevToolsIndicator,
parameters: { parameters: {
layout: 'centered', layout: 'centered',
......
...@@ -2,7 +2,6 @@ import type { Meta, StoryObj } from '@storybook/react' ...@@ -2,7 +2,6 @@ import type { Meta, StoryObj } from '@storybook/react'
import { NextLogo } from './next-logo' import { NextLogo } from './next-logo'
const meta: Meta<typeof NextLogo> = { const meta: Meta<typeof NextLogo> = {
title: 'NextLogo',
component: NextLogo, component: NextLogo,
parameters: { parameters: {
layout: 'centered', layout: 'centered',
......
...@@ -3,7 +3,6 @@ import { ErrorMessage } from './error-message' ...@@ -3,7 +3,6 @@ import { ErrorMessage } from './error-message'
import { withShadowPortal } from '../../../storybook/with-shadow-portal' import { withShadowPortal } from '../../../storybook/with-shadow-portal'
const meta: Meta<typeof ErrorMessage> = { const meta: Meta<typeof ErrorMessage> = {
title: 'ErrorMessage',
component: ErrorMessage, component: ErrorMessage,
parameters: { parameters: {
layout: 'fullscreen', layout: 'fullscreen',
......
...@@ -3,7 +3,6 @@ import { ErrorOverlayBottomStacks } from './error-overlay-bottom-stacks' ...@@ -3,7 +3,6 @@ import { ErrorOverlayBottomStacks } from './error-overlay-bottom-stacks'
import { withShadowPortal } from '../../../storybook/with-shadow-portal' import { withShadowPortal } from '../../../storybook/with-shadow-portal'
const meta: Meta<typeof ErrorOverlayBottomStacks> = { const meta: Meta<typeof ErrorOverlayBottomStacks> = {
title: 'ErrorOverlayBottomStacks',
component: ErrorOverlayBottomStacks, component: ErrorOverlayBottomStacks,
parameters: { parameters: {
layout: 'fullscreen', layout: 'fullscreen',
......
...@@ -3,7 +3,6 @@ import { ErrorOverlayFloatingHeader } from './error-overlay-floating-header' ...@@ -3,7 +3,6 @@ import { ErrorOverlayFloatingHeader } from './error-overlay-floating-header'
import { withShadowPortal } from '../../../storybook/with-shadow-portal' import { withShadowPortal } from '../../../storybook/with-shadow-portal'
const meta: Meta<typeof ErrorOverlayFloatingHeader> = { const meta: Meta<typeof ErrorOverlayFloatingHeader> = {
title: 'ErrorOverlayFloatingHeader',
component: ErrorOverlayFloatingHeader, component: ErrorOverlayFloatingHeader,
parameters: { parameters: {
layout: 'fullscreen', layout: 'fullscreen',
......
...@@ -3,7 +3,6 @@ import { ErrorOverlayLayout } from './error-overlay-layout' ...@@ -3,7 +3,6 @@ import { ErrorOverlayLayout } from './error-overlay-layout'
import { withShadowPortal } from '../../../storybook/with-shadow-portal' import { withShadowPortal } from '../../../storybook/with-shadow-portal'
const meta: Meta<typeof ErrorOverlayLayout> = { const meta: Meta<typeof ErrorOverlayLayout> = {
title: 'ErrorOverlayLayout',
component: ErrorOverlayLayout, component: ErrorOverlayLayout,
parameters: { parameters: {
layout: 'fullscreen', layout: 'fullscreen',
......
...@@ -4,7 +4,6 @@ import { withShadowPortal } from '../../../storybook/with-shadow-portal' ...@@ -4,7 +4,6 @@ import { withShadowPortal } from '../../../storybook/with-shadow-portal'
import { useState } from 'react' import { useState } from 'react'
const meta: Meta<typeof ErrorOverlayPagination> = { const meta: Meta<typeof ErrorOverlayPagination> = {
title: 'ErrorOverlayPagination',
component: ErrorOverlayPagination, component: ErrorOverlayPagination,
parameters: { parameters: {
layout: 'centered', layout: 'centered',
......
...@@ -3,7 +3,6 @@ import { CopyStackTraceButton } from './copy-stack-trace-button' ...@@ -3,7 +3,6 @@ import { CopyStackTraceButton } from './copy-stack-trace-button'
import { withShadowPortal } from '../../../storybook/with-shadow-portal' import { withShadowPortal } from '../../../storybook/with-shadow-portal'
const meta: Meta<typeof CopyStackTraceButton> = { const meta: Meta<typeof CopyStackTraceButton> = {
title: 'ErrorOverlayToolbar/CopyStackTraceButton',
component: CopyStackTraceButton, component: CopyStackTraceButton,
parameters: { parameters: {
layout: 'centered', layout: 'centered',
......
...@@ -3,7 +3,6 @@ import { DocsLinkButton } from './docs-link-button' ...@@ -3,7 +3,6 @@ import { DocsLinkButton } from './docs-link-button'
import { withShadowPortal } from '../../../storybook/with-shadow-portal' import { withShadowPortal } from '../../../storybook/with-shadow-portal'
const meta: Meta<typeof DocsLinkButton> = { const meta: Meta<typeof DocsLinkButton> = {
title: 'ErrorOverlayToolbar/DocsLinkButton',
component: DocsLinkButton, component: DocsLinkButton,
parameters: { parameters: {
layout: 'centered', layout: 'centered',
......
...@@ -3,7 +3,6 @@ import { ErrorOverlayToolbar } from './error-overlay-toolbar' ...@@ -3,7 +3,6 @@ import { ErrorOverlayToolbar } from './error-overlay-toolbar'
import { withShadowPortal } from '../../../storybook/with-shadow-portal' import { withShadowPortal } from '../../../storybook/with-shadow-portal'
const meta: Meta<typeof ErrorOverlayToolbar> = { const meta: Meta<typeof ErrorOverlayToolbar> = {
title: 'ErrorOverlayToolbar',
component: ErrorOverlayToolbar, component: ErrorOverlayToolbar,
parameters: { parameters: {
layout: 'centered', layout: 'centered',
......
...@@ -3,7 +3,6 @@ import { NodejsInspectorButton } from './nodejs-inspector-button' ...@@ -3,7 +3,6 @@ import { NodejsInspectorButton } from './nodejs-inspector-button'
import { withShadowPortal } from '../../../storybook/with-shadow-portal' import { withShadowPortal } from '../../../storybook/with-shadow-portal'
const meta: Meta<typeof NodejsInspectorButton> = { const meta: Meta<typeof NodejsInspectorButton> = {
title: 'ErrorOverlayToolbar/NodejsInspectorButton',
component: NodejsInspectorButton, component: NodejsInspectorButton,
parameters: { parameters: {
layout: 'centered', layout: 'centered',
......
...@@ -3,7 +3,6 @@ import { ErrorTypeLabel } from './error-type-label' ...@@ -3,7 +3,6 @@ import { ErrorTypeLabel } from './error-type-label'
import { withShadowPortal } from '../../../storybook/with-shadow-portal' import { withShadowPortal } from '../../../storybook/with-shadow-portal'
const meta: Meta<typeof ErrorTypeLabel> = { const meta: Meta<typeof ErrorTypeLabel> = {
title: 'ErrorTypeLabel',
component: ErrorTypeLabel, component: ErrorTypeLabel,
parameters: { parameters: {
layout: 'centered', layout: 'centered',
......
...@@ -3,7 +3,6 @@ import { VersionStalenessInfo } from './VersionStalenessInfo' ...@@ -3,7 +3,6 @@ import { VersionStalenessInfo } from './VersionStalenessInfo'
import { withShadowPortal } from '../../storybook/with-shadow-portal' import { withShadowPortal } from '../../storybook/with-shadow-portal'
const meta: Meta<typeof VersionStalenessInfo> = { const meta: Meta<typeof VersionStalenessInfo> = {
title: 'VersionStalenessInfo',
component: VersionStalenessInfo, component: VersionStalenessInfo,
parameters: { parameters: {
layout: 'centered', layout: 'centered',
......
...@@ -3,10 +3,12 @@ import { CallStackFrame } from './call-stack-frame' ...@@ -3,10 +3,12 @@ import { CallStackFrame } from './call-stack-frame'
import { withShadowPortal } from '../../storybook/with-shadow-portal' import { withShadowPortal } from '../../storybook/with-shadow-portal'
const meta: Meta<typeof CallStackFrame> = { const meta: Meta<typeof CallStackFrame> = {
title: 'CallStackFrame',
component: CallStackFrame, component: CallStackFrame,
parameters: { parameters: {
layout: 'fullscreen', layout: 'fullscreen',
backgrounds: {
default: 'background-100-dark',
},
}, },
decorators: [withShadowPortal], decorators: [withShadowPortal],
} }
......
...@@ -3,7 +3,6 @@ import { BuildError } from './BuildError' ...@@ -3,7 +3,6 @@ import { BuildError } from './BuildError'
import { withShadowPortal } from '../storybook/with-shadow-portal' import { withShadowPortal } from '../storybook/with-shadow-portal'
const meta: Meta<typeof BuildError> = { const meta: Meta<typeof BuildError> = {
title: 'BuildError',
component: BuildError, component: BuildError,
parameters: { parameters: {
layout: 'fullscreen', layout: 'fullscreen',
......
...@@ -4,7 +4,6 @@ import { withShadowPortal } from '../storybook/with-shadow-portal' ...@@ -4,7 +4,6 @@ import { withShadowPortal } from '../storybook/with-shadow-portal'
import { ACTION_UNHANDLED_ERROR } from '../../../shared' import { ACTION_UNHANDLED_ERROR } from '../../../shared'
const meta: Meta<typeof Errors> = { const meta: Meta<typeof Errors> = {
title: 'Errors',
component: Errors, component: Errors,
parameters: { parameters: {
layout: 'fullscreen', layout: 'fullscreen',
......
...@@ -3,7 +3,6 @@ import { RootLayoutMissingTagsError } from './RootLayoutMissingTagsError' ...@@ -3,7 +3,6 @@ import { RootLayoutMissingTagsError } from './RootLayoutMissingTagsError'
import { withShadowPortal } from '../storybook/with-shadow-portal' import { withShadowPortal } from '../storybook/with-shadow-portal'
const meta: Meta<typeof RootLayoutMissingTagsError> = { const meta: Meta<typeof RootLayoutMissingTagsError> = {
title: 'RootLayoutMissingTagsError',
component: RootLayoutMissingTagsError, component: RootLayoutMissingTagsError,
parameters: { parameters: {
layout: 'fullscreen', layout: 'fullscreen',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment