diff --git a/packages/console/src/components/Alert/index.module.scss b/packages/console/src/components/Alert/index.module.scss new file mode 100644 index 000000000..fae19b8b6 --- /dev/null +++ b/packages/console/src/components/Alert/index.module.scss @@ -0,0 +1,35 @@ +@use '@/scss/underscore' as _; + +.alert { + padding: _.unit(3) _.unit(4); + margin: _.unit(2) 0; + font: var(--font-body-medium); + display: flex; + border-radius: 8px; + align-items: center; + + .icon { + width: 20px; + height: 20px; + } + + .content { + flex: 1; + margin: 0 _.unit(3); + } + + .action { + a { + color: var(--color-text); + text-decoration: underline; + } + } + + &.info { + background: var(--color-surface-variant); + + .icon { + color: var(--color-neutral-variant-60); + } + } +} diff --git a/packages/console/src/components/Alert/index.tsx b/packages/console/src/components/Alert/index.tsx new file mode 100644 index 000000000..250a0a0b9 --- /dev/null +++ b/packages/console/src/components/Alert/index.tsx @@ -0,0 +1,33 @@ +import { I18nKey } from '@logto/phrases'; +import classNames from 'classnames'; +import React, { ReactNode } from 'react'; + +import LinkButton from '@/components/LinkButton'; +import Info from '@/icons/Info'; + +import * as styles from './index.module.scss'; + +type Props = { + severity?: 'info'; + children?: ReactNode; + action?: I18nKey; + href?: string; +}; + +const Alert = ({ children, action, href, severity = 'info' }: Props) => { + return ( +