-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DevOverlay] Decouple Dialog component from Error Overlay
- Loading branch information
1 parent
daa0478
commit 1055ba5
Showing
8 changed files
with
126 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...ponents/react-dev-overlay/_experimental/internal/components/Errors/dialog/dialog-body.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { noop as css } from '../../../helpers/noop-template' | ||
import { DialogBody } from '../../Dialog' | ||
|
||
type ErrorOverlayDialogBodyProps = { | ||
children?: React.ReactNode | ||
onClose?: () => void | ||
} | ||
|
||
export function ErrorOverlayDialogBody({ | ||
children, | ||
}: ErrorOverlayDialogBodyProps) { | ||
return ( | ||
<DialogBody className="nextjs-container-errors-body">{children}</DialogBody> | ||
) | ||
} | ||
|
||
export const styles = css` | ||
.error-overlay-dialog { | ||
background: var(--color-background-100); | ||
border: 1px solid var(--color-gray-400); | ||
border-radius: var(--rounded-xl); | ||
box-shadow: var(--shadow-md); | ||
} | ||
` |
51 changes: 51 additions & 0 deletions
51
...nents/react-dev-overlay/_experimental/internal/components/Errors/dialog/dialog-header.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { DialogHeader } from '../../Dialog/DialogHeader' | ||
import { noop as css } from '../../../helpers/noop-template' | ||
|
||
type ErrorOverlayDialogHeaderProps = { | ||
children?: React.ReactNode | ||
} | ||
|
||
export function ErrorOverlayDialogHeader({ | ||
children, | ||
}: ErrorOverlayDialogHeaderProps) { | ||
return ( | ||
<DialogHeader className="nextjs-container-errors-header"> | ||
{children} | ||
</DialogHeader> | ||
) | ||
} | ||
|
||
export const styles = css` | ||
.nextjs-container-errors-header { | ||
position: relative; | ||
} | ||
.nextjs-container-errors-header > h1 { | ||
font-size: var(--size-font-big); | ||
line-height: var(--size-font-bigger); | ||
font-weight: bold; | ||
margin: calc(var(--size-gap-double) * 1.5) 0; | ||
color: var(--color-title-h1); | ||
} | ||
.nextjs-container-errors-header small { | ||
font-size: var(--size-font-small); | ||
color: var(--color-accents-1); | ||
margin-left: var(--size-gap-double); | ||
} | ||
.nextjs-container-errors-header small > span { | ||
font-family: var(--font-stack-monospace); | ||
} | ||
.nextjs-container-errors-header > div > small { | ||
margin: 0; | ||
margin-top: var(--size-gap-half); | ||
} | ||
.nextjs-container-errors-header > p > a { | ||
color: inherit; | ||
font-weight: bold; | ||
} | ||
.nextjs-container-errors-header | ||
> .nextjs-container-build-error-version-status { | ||
position: absolute; | ||
top: var(--size-4); | ||
right: var(--size-4); | ||
} | ||
` |
33 changes: 33 additions & 0 deletions
33
...t/components/react-dev-overlay/_experimental/internal/components/Errors/dialog/dialog.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Dialog } from '../../Dialog/Dialog' | ||
import { noop as css } from '../../../helpers/noop-template' | ||
|
||
type ErrorOverlayDialogProps = { | ||
children?: React.ReactNode | ||
onClose?: () => void | ||
} | ||
|
||
export function ErrorOverlayDialog({ | ||
children, | ||
onClose, | ||
}: ErrorOverlayDialogProps) { | ||
return ( | ||
<Dialog | ||
type="error" | ||
aria-labelledby="nextjs__container_errors_label" | ||
aria-describedby="nextjs__container_errors_desc" | ||
onClose={onClose} | ||
className="error-overlay-dialog" | ||
> | ||
{children} | ||
</Dialog> | ||
) | ||
} | ||
|
||
export const styles = css` | ||
.error-overlay-dialog { | ||
background: var(--color-background-100); | ||
border: 1px solid var(--color-gray-400); | ||
border-radius: var(--rounded-xl); | ||
box-shadow: var(--shadow-md); | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters