diff --git a/packages/grafana-data/src/themes/createColors.ts b/packages/grafana-data/src/themes/createColors.ts index 348019f4581..b7007b5148b 100644 --- a/packages/grafana-data/src/themes/createColors.ts +++ b/packages/grafana-data/src/themes/createColors.ts @@ -86,6 +86,12 @@ class DarkColors implements ThemeColorsBase> { whiteBase = '201, 209, 217'; + border = { + weak: `rgba(${this.whiteBase}, 0.10)`, + medium: `rgba(${this.whiteBase}, 0.15)`, + strong: `rgba(${this.whiteBase}, 0.25)`, + }; + text = { primary: `rgb(${this.whiteBase})`, secondary: `rgba(${this.whiteBase}, 0.65)`, @@ -103,8 +109,9 @@ class DarkColors implements ThemeColorsBase> { secondary = { main: `rgba(${this.whiteBase}, 0.1)`, shade: `rgba(${this.whiteBase}, 0.15)`, - text: `rgba(${this.whiteBase}, 0.13)`, + text: this.text.primary, contrastText: `rgb(${this.whiteBase})`, + border: this.border.strong, }; info = this.primary; @@ -130,12 +137,6 @@ class DarkColors implements ThemeColorsBase> { secondary: palette.gray15, }; - border = { - weak: `rgba(${this.whiteBase}, 0.10)`, - medium: `rgba(${this.whiteBase}, 0.15)`, - strong: `rgba(${this.whiteBase}, 0.20)`, - }; - action = { hover: `rgba(${this.whiteBase}, 0.08)`, selected: `rgba(${this.whiteBase}, 0.12)`, @@ -167,10 +168,26 @@ class LightColors implements ThemeColorsBase> { text: palette.blueLightText, }; + text = { + primary: `rgba(${this.blackBase}, 1)`, + secondary: `rgba(${this.blackBase}, 0.75)`, + disabled: `rgba(${this.blackBase}, 0.50)`, + link: this.primary.text, + maxContrast: palette.black, + }; + + border = { + weak: `rgba(${this.blackBase}, 0.12)`, + medium: `rgba(${this.blackBase}, 0.30)`, + strong: `rgba(${this.blackBase}, 0.40)`, + }; + secondary = { main: `rgba(${this.blackBase}, 0.11)`, shade: `rgba(${this.blackBase}, 0.16)`, contrastText: `rgba(${this.blackBase}, 1)`, + text: this.text.primary, + border: this.border.strong, }; info = { @@ -194,28 +211,12 @@ class LightColors implements ThemeColorsBase> { text: palette.orangeLightText, }; - text = { - primary: `rgba(${this.blackBase}, 1)`, - secondary: `rgba(${this.blackBase}, 0.75)`, - disabled: `rgba(${this.blackBase}, 0.50)`, - link: this.primary.text, - maxContrast: palette.black, - }; - background = { canvas: palette.gray90, primary: palette.white, secondary: palette.gray100, }; - border = { - weak: `rgba(${this.blackBase}, 0.12)`, - medium: `rgba(${this.blackBase}, 0.30)`, - strong: `rgba(${this.blackBase}, 0.40)`, - }; - - divider = this.border.weak; - action = { hover: `rgba(${this.blackBase}, 0.04)`, selected: `rgba(${this.blackBase}, 0.08)`, diff --git a/packages/grafana-ui/src/components/Button/Button.mdx b/packages/grafana-ui/src/components/Button/Button.mdx index cd5f85f89fa..a355676e553 100644 --- a/packages/grafana-ui/src/components/Button/Button.mdx +++ b/packages/grafana-ui/src/components/Button/Button.mdx @@ -1,5 +1,5 @@ import { Meta, Story, Preview, Props } from '@storybook/addon-docs/blocks'; -import { Button } from './Button'; +import { Button, LinkButton } from './Button'; @@ -64,22 +64,38 @@ Used for triggering a removing or deleting action. Because of its dominant color -## Link - -Used for hyperlinks. +## Text
- - -
+ +## Links + +To add an anchor that looks like a button use the `` component and pass a href prop. + + +
+ + Small + + + Medium + + + Large + +
+
diff --git a/packages/grafana-ui/src/components/Button/Button.story.tsx b/packages/grafana-ui/src/components/Button/Button.story.tsx index f68a33174f1..b61f3aded5b 100644 --- a/packages/grafana-ui/src/components/Button/Button.story.tsx +++ b/packages/grafana-ui/src/components/Button/Button.story.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Story } from '@storybook/react'; -import { allButtonVariants, Button, ButtonProps } from './Button'; +import { Story, Meta } from '@storybook/react'; +import { allButtonVariants, allButtonFills, Button, ButtonProps } from './Button'; import { iconOptions } from '../../utils/storybook/knobs'; import mdx from './Button.mdx'; import { HorizontalGroup, VerticalGroup } from '../Layout/Layout'; @@ -12,11 +12,9 @@ export default { title: 'Buttons/Button', component: Button, argTypes: { - variant: { control: { type: 'select', options: ['primary', 'secondary', 'destructive', 'link'] } }, - size: { control: { type: 'select', options: ['sm', 'md', 'lg'] } }, + variant: { control: 'select' }, + size: { control: 'select' }, icon: { control: { type: 'select', options: iconOptions } }, - css: { control: { disable: true } }, - className: { control: { disable: true } }, }, parameters: { docs: { @@ -25,29 +23,35 @@ export default { knobs: { disable: true, }, + controls: { + exclude: ['css', 'className'], + }, }, -}; +} as Meta; export const Variants: Story = ({ children, ...args }) => { const sizes: ComponentSize[] = ['lg', 'md', 'sm']; - return ( - - {allButtonVariants.map((variant) => ( - - {sizes.map((size) => ( - + {allButtonFills.map((buttonFill) => ( + + + {allButtonVariants.map((variant) => ( + + {sizes.map((size) => ( + + ))} + + ))} - - - ))} - -
+ +
+ + ))}
With icon and text
@@ -153,7 +153,7 @@ class UnThemedConfirmButton extends PureComponent { )} -
diff --git a/packages/grafana-ui/src/components/TagsInput/TagsInput.tsx b/packages/grafana-ui/src/components/TagsInput/TagsInput.tsx index e4b78d7d663..8f12c666233 100644 --- a/packages/grafana-ui/src/components/TagsInput/TagsInput.tsx +++ b/packages/grafana-ui/src/components/TagsInput/TagsInput.tsx @@ -53,7 +53,7 @@ export const TagsInput: FC = ({ placeholder = 'New tag (enter key to add) onKeyUp={onKeyboardAdd} suffix={ newTagName.length > 0 && ( - ) diff --git a/public/app/core/components/FilterInput/FilterInput.tsx b/public/app/core/components/FilterInput/FilterInput.tsx index ebaf7640daf..9efe9939396 100644 --- a/public/app/core/components/FilterInput/FilterInput.tsx +++ b/public/app/core/components/FilterInput/FilterInput.tsx @@ -13,7 +13,7 @@ export interface Props { export const FilterInput: FC = ({ value, placeholder, width, onChange, autoFocus }) => { const suffix = value !== '' ? ( - ) : null; diff --git a/public/app/core/components/ForgottenPassword/ChangePassword.tsx b/public/app/core/components/ForgottenPassword/ChangePassword.tsx index a1668b91683..e745ecd19c1 100644 --- a/public/app/core/components/ForgottenPassword/ChangePassword.tsx +++ b/public/app/core/components/ForgottenPassword/ChangePassword.tsx @@ -50,7 +50,7 @@ export const ChangePassword: FC = ({ onSubmit, onSkip }) => { content="If you skip you will be prompted to change password next time you log in." placement="bottom" > - diff --git a/public/app/core/components/ForgottenPassword/ForgottenPassword.tsx b/public/app/core/components/ForgottenPassword/ForgottenPassword.tsx index 20f0059e99c..c2b188992b1 100644 --- a/public/app/core/components/ForgottenPassword/ForgottenPassword.tsx +++ b/public/app/core/components/ForgottenPassword/ForgottenPassword.tsx @@ -55,7 +55,7 @@ export const ForgottenPassword: FC = () => { - + Back to login diff --git a/public/app/core/components/Login/LoginPage.tsx b/public/app/core/components/Login/LoginPage.tsx index ea1e936d86b..581e248980e 100644 --- a/public/app/core/components/Login/LoginPage.tsx +++ b/public/app/core/components/Login/LoginPage.tsx @@ -50,7 +50,7 @@ export const LoginPage: FC = () => { Forgot your password? diff --git a/public/app/core/components/Signup/SignupPage.tsx b/public/app/core/components/Signup/SignupPage.tsx index d6a37308c40..bc3f2368db7 100644 --- a/public/app/core/components/Signup/SignupPage.tsx +++ b/public/app/core/components/Signup/SignupPage.tsx @@ -112,7 +112,7 @@ export const SignupPage: FC = (props) => { - + Back to login diff --git a/public/app/core/components/Signup/VerifyEmail.tsx b/public/app/core/components/Signup/VerifyEmail.tsx index 008a202dff4..463d2e294c4 100644 --- a/public/app/core/components/Signup/VerifyEmail.tsx +++ b/public/app/core/components/Signup/VerifyEmail.tsx @@ -51,7 +51,7 @@ export const VerifyEmail: FC = () => { - + Back to login diff --git a/public/app/features/alerting/components/NotificationChannelOptions.tsx b/public/app/features/alerting/components/NotificationChannelOptions.tsx index 9b3bba4618d..9f548d004e4 100644 --- a/public/app/features/alerting/components/NotificationChannelOptions.tsx +++ b/public/app/features/alerting/components/NotificationChannelOptions.tsx @@ -60,12 +60,7 @@ export const NotificationChannelOptions: FC = ({ readOnly={true} value="Configured" suffix={ - } diff --git a/public/app/features/dashboard/components/PanelEditor/VisualizationSelectPane.tsx b/public/app/features/dashboard/components/PanelEditor/VisualizationSelectPane.tsx index c6d4c6f5196..543fc5b4aa3 100644 --- a/public/app/features/dashboard/components/PanelEditor/VisualizationSelectPane.tsx +++ b/public/app/features/dashboard/components/PanelEditor/VisualizationSelectPane.tsx @@ -63,7 +63,7 @@ export const VisualizationSelectPane: FC = ({ panel }) => { const suffix = searchQuery !== '' ? ( - ) : null; diff --git a/public/app/features/dashboard/components/ShareModal/ShareSnapshot.tsx b/public/app/features/dashboard/components/ShareModal/ShareSnapshot.tsx index c6fd0f5e369..62125bd4db1 100644 --- a/public/app/features/dashboard/components/ShareModal/ShareSnapshot.tsx +++ b/public/app/features/dashboard/components/ShareModal/ShareSnapshot.tsx @@ -269,7 +269,7 @@ export class ShareSnapshot extends PureComponent {
Did you make a mistake?{' '} - + Delete snapshot.
diff --git a/public/app/features/datasources/settings/ButtonRow.tsx b/public/app/features/datasources/settings/ButtonRow.tsx index f8275e4dc67..28e1e9e6067 100644 --- a/public/app/features/datasources/settings/ButtonRow.tsx +++ b/public/app/features/datasources/settings/ButtonRow.tsx @@ -39,7 +39,7 @@ const ButtonRow: FC = ({ isReadOnly, onDelete, onSubmit, onTest }) => { > Delete - + Back
diff --git a/public/app/features/datasources/settings/__snapshots__/ButtonRow.test.tsx.snap b/public/app/features/datasources/settings/__snapshots__/ButtonRow.test.tsx.snap index ccee8cc3727..d553d347570 100644 --- a/public/app/features/datasources/settings/__snapshots__/ButtonRow.test.tsx.snap +++ b/public/app/features/datasources/settings/__snapshots__/ButtonRow.test.tsx.snap @@ -21,8 +21,8 @@ exports[`Render should render component 1`] = ` Delete Back @@ -52,8 +52,8 @@ exports[`Render should render with buttons enabled 1`] = ` Delete Back diff --git a/public/app/features/explore/Logs.tsx b/public/app/features/explore/Logs.tsx index 9f16e3f6e95..f9878439928 100644 --- a/public/app/features/explore/Logs.tsx +++ b/public/app/features/explore/Logs.tsx @@ -415,7 +415,7 @@ export class UnthemedLogs extends PureComponent { {!loading && !hasData && !scanning && (
No logs found. -
@@ -424,7 +424,7 @@ export class UnthemedLogs extends PureComponent { {scanning && (
{scanText} -