Theme: Border radius nit fixes (#111625)

* increase border radius on login box

* increase command palette border radius

* decrease TagBadge border radius

* increase border radius for alerting homepage containers

* increase border radius of EnterpriseAuthFeaturesCard

* increase border radius on cloud migration containers

* fix border-radius on edit alert rule page

* fix overflow on notification templates page

* add border radius to EmptyArea

* add border radius to image preview in Carousel component

* add border radius to PluginDetailsPanel

* add border radius to licensechrome

* add border radius to empty alerts state

* apply container styles on top of default styles
This commit is contained in:
Ashley Harrison
2025-09-25 17:06:47 +01:00
committed by GitHub
parent bdefea9acf
commit 59b8dff7e4
18 changed files with 36 additions and 15 deletions
@@ -183,6 +183,7 @@ const getStyles = (theme: GrafanaTheme2) => ({
flex: 1, flex: 1,
}), }),
imagePreview: css({ imagePreview: css({
borderRadius: theme.shape.radius.lg,
maxWidth: '100%', maxWidth: '100%',
maxHeight: '80vh', maxHeight: '80vh',
objectFit: 'contain', objectFit: 'contain',
@@ -1,4 +1,4 @@
import { css } from '@emotion/css'; import { css, cx } from '@emotion/css';
import type * as monacoType from 'monaco-editor/esm/vs/editor/editor.api'; import type * as monacoType from 'monaco-editor/esm/vs/editor/editor.api';
import { PureComponent } from 'react'; import { PureComponent } from 'react';
@@ -136,7 +136,7 @@ class UnthemedCodeEditor extends PureComponent<Props> {
const value = this.props.value ?? ''; const value = this.props.value ?? '';
const longText = value.length > 100; const longText = value.length > 100;
const containerStyles = this.props.containerStyles ?? getStyles(theme).container; const containerStyles = cx(getStyles(theme).container, this.props.containerStyles);
const options: MonacoOptions = { const options: MonacoOptions = {
wordWrap: wordWrap ? 'on' : 'off', wordWrap: wordWrap ? 'on' : 'off',
@@ -203,6 +203,7 @@ const getStyles = (theme: GrafanaTheme2) => {
container: css({ container: css({
borderRadius: theme.shape.radius.default, borderRadius: theme.shape.radius.default,
border: `1px solid ${theme.components.input.borderColor}`, border: `1px solid ${theme.components.input.borderColor}`,
overflow: 'hidden',
}), }),
}; };
}; };
@@ -150,7 +150,7 @@ export const getLoginStyles = (theme: GrafanaTheme2) => {
justifyContent: 'flex-start', justifyContent: 'flex-start',
zIndex: 1, zIndex: 1,
minHeight: 320, minHeight: 320,
borderRadius: theme.shape.radius.default, borderRadius: theme.shape.radius.lg,
padding: theme.spacing(2, 0), padding: theme.spacing(2, 0),
opacity: 0, opacity: 0,
[theme.transitions.handleMotion('no-preference', 'reduce')]: { [theme.transitions.handleMotion('no-preference', 'reduce')]: {
@@ -34,7 +34,7 @@ export const getStyles = (theme: GrafanaTheme2) => ({
badge: css({ badge: css({
...theme.typography.bodySmall, ...theme.typography.bodySmall,
backgroundColor: theme.v1.palette.gray1, backgroundColor: theme.v1.palette.gray1,
borderRadius: theme.shape.radius.default, borderRadius: theme.shape.radius.sm,
color: theme.v1.palette.white, color: theme.v1.palette.white,
display: 'inline-block', display: 'inline-block',
height: '20px', height: '20px',
@@ -91,7 +91,7 @@ function getStyles(theme: GrafanaTheme2) {
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
gap: theme.spacing(1.5), gap: theme.spacing(1.5),
borderRadius: theme.shape.radius.default, borderRadius: theme.shape.radius.lg,
marginTop: theme.spacing(3), marginTop: theme.spacing(3),
strong: { strong: {
color: theme.colors.text.primary, color: theme.colors.text.primary,
@@ -22,12 +22,14 @@ const getStyles = (theme: GrafanaTheme2) => {
textAlign: 'center', textAlign: 'center',
padding: theme.spacing(2), padding: theme.spacing(2),
background: footerBg, background: footerBg,
borderRadius: theme.shape.radius.lg,
}), }),
header: css({ header: css({
height: '137px', height: '137px',
padding: theme.spacing(4, 0, 0, 4), padding: theme.spacing(4, 0, 0, 4),
position: 'relative', position: 'relative',
background: `url('${backgroundUrl}') right`, background: `url('${backgroundUrl}') right`,
borderRadius: theme.shape.radius.lg,
}), }),
}; };
}; };
@@ -213,6 +213,7 @@ export const getStyles = (theme: GrafanaTheme2) => ({
noResults: css({ noResults: css({
padding: theme.spacing(2), padding: theme.spacing(2),
backgroundColor: theme.colors.background.secondary, backgroundColor: theme.colors.background.secondary,
borderRadius: theme.shape.radius.lg,
fontStyle: 'italic', fontStyle: 'italic',
}), }),
}); });
@@ -13,6 +13,7 @@ export const EmptyArea = ({ children }: React.PropsWithChildren<{}>) => {
const getStyles = (theme: GrafanaTheme2) => { const getStyles = (theme: GrafanaTheme2) => {
return { return {
container: css({ container: css({
borderRadius: theme.shape.radius.lg,
backgroundColor: theme.colors.background.secondary, backgroundColor: theme.colors.background.secondary,
color: theme.colors.text.secondary, color: theme.colors.text.secondary,
padding: theme.spacing(4), padding: theme.spacing(4),
@@ -541,6 +541,7 @@ const getStyles = (theme: GrafanaTheme2) => ({
flex: 1, flex: 1,
flexBasis: '400px', flexBasis: '400px',
borderRadius: theme.shape.radius.default, borderRadius: theme.shape.radius.default,
overflow: 'hidden',
}), }),
stack: css({ stack: css({
display: 'flex', display: 'flex',
@@ -70,7 +70,7 @@ const getStyles = (theme: GrafanaTheme2) => ({
display: 'flex', display: 'flex',
flexDirection: 'row', flexDirection: 'row',
border: `solid 1px ${theme.colors.border.weak}`, border: `solid 1px ${theme.colors.border.weak}`,
borderRadius: theme.shape.radius.default, borderRadius: theme.shape.radius.lg,
padding: `${theme.spacing(2)} ${theme.spacing(3)}`, padding: `${theme.spacing(2)} ${theme.spacing(3)}`,
}), }),
description: css({ description: css({
@@ -133,7 +133,7 @@ const getAddCardStyles = (theme: GrafanaTheme2) => ({
cardBody: css({ cardBody: css({
padding: `${theme.spacing(3)} ${theme.spacing(4)} ${theme.spacing(2.25)} ${theme.spacing(4)}`, padding: `${theme.spacing(3)} ${theme.spacing(4)} ${theme.spacing(2.25)} ${theme.spacing(4)}`,
backgroundColor: theme.colors.background.secondary, backgroundColor: theme.colors.background.secondary,
borderRadius: theme.shape.radius.default, borderRadius: theme.shape.radius.lg,
border: `1px solid ${theme.colors.border.weak}`, border: `1px solid ${theme.colors.border.weak}`,
flex: 1, flex: 1,
}), }),
@@ -241,6 +241,6 @@ const getContentBoxStyles = (theme: GrafanaTheme2) => ({
box: css({ box: css({
padding: theme.spacing(2), padding: theme.spacing(2),
backgroundColor: theme.colors.background.secondary, backgroundColor: theme.colors.background.secondary,
borderRadius: theme.shape.radius.default, borderRadius: theme.shape.radius.lg,
}), }),
}); });
@@ -8,6 +8,7 @@ export const getAlertTableStyles = (theme: GrafanaTheme2) => ({
borderRadius: theme.shape.radius.default, borderRadius: theme.shape.radius.default,
border: `solid 1px ${theme.colors.border.weak}`, border: `solid 1px ${theme.colors.border.weak}`,
backgroundColor: theme.colors.background.secondary, backgroundColor: theme.colors.background.secondary,
overflow: 'hidden',
th: { th: {
padding: theme.spacing(1), padding: theme.spacing(1),
@@ -230,7 +230,7 @@ const getSearchStyles = (theme: GrafanaTheme2, lateralSpace: number) => {
maxWidth: theme.breakpoints.values.md, maxWidth: theme.breakpoints.values.md,
background: theme.colors.background.primary, background: theme.colors.background.primary,
color: theme.colors.text.primary, color: theme.colors.text.primary,
borderRadius: theme.shape.radius.default, borderRadius: theme.shape.radius.lg,
border: `1px solid ${theme.colors.border.weak}`, border: `1px solid ${theme.colors.border.weak}`,
overflow: 'hidden', overflow: 'hidden',
boxShadow: theme.shadows.z3, boxShadow: theme.shadows.z3,
@@ -6,7 +6,7 @@ import { MigrationTokenPane } from './MigrationTokenPane/MigrationTokenPane';
export const Page = () => { export const Page = () => {
return ( return (
<Box backgroundColor="secondary" display="flex" alignItems="center" direction="column"> <Box borderRadius="lg" backgroundColor="secondary" display="flex" alignItems="center" direction="column">
<Box maxWidth={90} paddingY={6} paddingX={2} gap={6} direction="column" display="flex"> <Box maxWidth={90} paddingY={6} paddingX={2} gap={6} direction="column" display="flex">
<Stack gap={2} direction="column"> <Stack gap={2} direction="column">
<InfoPane /> <InfoPane />
@@ -6,7 +6,7 @@ import { InfoPaneRight } from './InfoPaneRight';
export const EmptyState = () => { export const EmptyState = () => {
return ( return (
<Box backgroundColor="secondary" display="flex" alignItems="center" direction="column"> <Box borderRadius="lg" backgroundColor="secondary" display="flex" alignItems="center" direction="column">
<Box maxWidth={180} paddingY={6} paddingX={2}> <Box maxWidth={180} paddingY={6} paddingX={2}>
<Stack gap={5} direction="column"> <Stack gap={5} direction="column">
<CallToAction /> <CallToAction />
@@ -60,6 +60,7 @@ export function MigrationSummary(props: MigrationSummaryProps) {
return ( return (
<Box <Box
borderRadius="lg"
borderColor="weak" borderColor="weak"
borderStyle="solid" borderStyle="solid"
padding={2} padding={2}
@@ -69,7 +69,7 @@ export function PluginDetailsPanel(props: Props): React.ReactElement | null {
return ( return (
<> <>
<Stack direction="column" gap={3} shrink={0} grow={0} width={width} data-testid="plugin-details-panel"> <Stack direction="column" gap={3} shrink={0} grow={0} width={width} data-testid="plugin-details-panel">
<Box padding={2} borderColor="medium" borderStyle="solid"> <Box borderRadius="lg" padding={2} borderColor="medium" borderStyle="solid">
<Stack direction="column" gap={2}> <Stack direction="column" gap={2}>
{pluginExtentionsInfo.map((infoItem, index) => { {pluginExtentionsInfo.map((infoItem, index) => {
return ( return (
@@ -97,7 +97,13 @@ export function PluginDetailsPanel(props: Props): React.ReactElement | null {
</Box> </Box>
{shouldRenderLinks && ( {shouldRenderLinks && (
<> <>
<Box padding={2} borderColor="medium" borderStyle="solid" data-testid="plugin-details-regular-links"> <Box
borderRadius="lg"
padding={2}
borderColor="medium"
borderStyle="solid"
data-testid="plugin-details-regular-links"
>
<Stack direction="column" gap={2}> <Stack direction="column" gap={2}>
{plugin.details?.repositoryUrl && ( {plugin.details?.repositoryUrl && (
<LinkButton <LinkButton
@@ -164,7 +170,13 @@ export function PluginDetailsPanel(props: Props): React.ReactElement | null {
</> </>
)} )}
{customLinks && customLinks?.length > 0 && ( {customLinks && customLinks?.length > 0 && (
<Box padding={2} borderColor="medium" borderStyle="solid" data-testid="plugin-details-custom-links"> <Box
borderRadius="lg"
padding={2}
borderColor="medium"
borderStyle="solid"
data-testid="plugin-details-custom-links"
>
<CollapsableSection <CollapsableSection
isOpen={true} isOpen={true}
label={ label={
@@ -197,7 +209,7 @@ export function PluginDetailsPanel(props: Props): React.ReactElement | null {
</Box> </Box>
)} )}
{!plugin?.isCore && ( {!plugin?.isCore && (
<Box padding={2} borderColor="medium" borderStyle="solid"> <Box borderRadius="lg" padding={2} borderColor="medium" borderStyle="solid">
<CollapsableSection <CollapsableSection
headerDataTestId="reportConcern" headerDataTestId="reportConcern"
isOpen={false} isOpen={false}