From 4d45e1d6baa4fc20360387b296492639688e49ab Mon Sep 17 00:00:00 2001 From: devjiwonchoi Date: Thu, 2 Jan 2025 21:58:23 +0900 Subject: [PATCH] [DevOverlay] Add color palette script --- .../_experimental/app/ReactDevOverlay.tsx | 2 + .../internal/storybook/with-shadow-portal.tsx | 2 + .../_experimental/internal/styles/colors.tsx | 166 ++++++++++++++++++ .../_experimental/pages/ReactDevOverlay.tsx | 2 + 4 files changed, 172 insertions(+) create mode 100644 packages/next/src/client/components/react-dev-overlay/_experimental/internal/styles/colors.tsx diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/app/ReactDevOverlay.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/app/ReactDevOverlay.tsx index aa28e797676db..d16308471d97d 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/app/ReactDevOverlay.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/app/ReactDevOverlay.tsx @@ -12,6 +12,7 @@ import { ComponentStyles } from '../internal/styles/ComponentStyles' import { CssReset } from '../internal/styles/CssReset' import { RootLayoutMissingTagsError } from '../internal/container/RootLayoutMissingTagsError' import { RuntimeErrorHandler } from '../internal/helpers/runtime-error-handler' +import { Colors } from '../internal/styles/colors' interface ReactDevOverlayState { isReactError: boolean @@ -57,6 +58,7 @@ export default class ReactDevOverlay extends React.PureComponent< + {state.rootLayoutMissingTags?.length ? ( ( + diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/styles/colors.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/styles/colors.tsx new file mode 100644 index 0000000000000..3d32b3c99917c --- /dev/null +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/styles/colors.tsx @@ -0,0 +1,166 @@ +import { noop as css } from '../helpers/noop-template' + +// TODO: Replace the existing colors in Base.tsx. +export function Colors() { + return ( + + ) +} diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/pages/ReactDevOverlay.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/pages/ReactDevOverlay.tsx index f5546fac1d364..d454557ac9152 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/pages/ReactDevOverlay.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/pages/ReactDevOverlay.tsx @@ -9,6 +9,7 @@ import { CssReset } from '../internal/styles/CssReset' import { ErrorBoundary } from '../../pages/ErrorBoundary' import { usePagesReactDevOverlay } from '../../pages/hooks' +import { Colors } from '../internal/styles/colors' export type ErrorType = 'runtime' | 'build' @@ -45,6 +46,7 @@ export default function ReactDevOverlay({ + {displayPrevented ? null : hasBuildError ? (