-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[field] Improve appearance of value/diff component errors
- Loading branch information
Showing
10 changed files
with
113 additions
and
21 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
22 changes: 22 additions & 0 deletions
22
packages/@sanity/field/src/diff/changes/DiffErrorBoundary.css
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,22 @@ | ||
@import 'part:@sanity/base/theme/variables-style'; | ||
|
||
.root { | ||
display: flex; | ||
} | ||
|
||
.icon { | ||
color: var(--state-danger-color); | ||
|
||
@nest & svg { | ||
font-size: calc(17 / 16 * 1em); | ||
|
||
@nest &[data-sanity-icon='true'] { | ||
font-size: calc(25 / 16 * 1em); | ||
margin: -4px; | ||
} | ||
} | ||
} | ||
|
||
.message { | ||
padding-left: var(--small-padding); | ||
} |
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
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,23 @@ | ||
@import 'part:@sanity/base/theme/variables-style'; | ||
|
||
.root { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.icon { | ||
color: var(--state-danger-color); | ||
|
||
@nest & svg { | ||
font-size: calc(17 / 16 * 1em); | ||
|
||
@nest &[data-sanity-icon='true'] { | ||
font-size: calc(25 / 16 * 1em); | ||
margin: -4px; | ||
} | ||
} | ||
} | ||
|
||
.message { | ||
padding-left: var(--small-padding); | ||
} |
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 |
---|---|---|
@@ -1,5 +1,15 @@ | ||
import * as React from 'react' | ||
import ErrorOutlineIcon from 'part:@sanity/base/error-outline-icon' | ||
import {FieldValueError} from '../../validation' | ||
import styles from './ValueError.css' | ||
|
||
export function ValueError(props: any) { | ||
return <div>Value error</div> | ||
export function ValueError({error}: {error: FieldValueError}) { | ||
return ( | ||
<div className={styles.root}> | ||
<span className={styles.icon}> | ||
<ErrorOutlineIcon /> | ||
</span> | ||
<span className={styles.message}>Value error: {error.message}</span> | ||
</div> | ||
) | ||
} |
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