From 89546d52d8f0c9f7c57c7461b846aaa994526b3d Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Mon, 26 Jan 2026 18:58:15 +0000 Subject: [PATCH] Cleaning up props and types on Alert Signed-off-by: Charles de Dreuille --- .changeset/plenty-monkeys-share.md | 9 ++++++++- packages/ui/src/components/Alert/Alert.module.css | 1 - packages/ui/src/components/Alert/Alert.stories.tsx | 4 ++-- packages/ui/src/components/Alert/Alert.tsx | 12 +++++------- packages/ui/src/components/Alert/types.ts | 4 ++-- packages/ui/src/types.ts | 9 ++++++++- 6 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.changeset/plenty-monkeys-share.md b/.changeset/plenty-monkeys-share.md index 11c8d0a0fa..214b0e8546 100644 --- a/.changeset/plenty-monkeys-share.md +++ b/.changeset/plenty-monkeys-share.md @@ -2,6 +2,13 @@ '@backstage/ui': patch --- -Added new `Alert` component with support for status variants, icons, loading states, and custom actions. +Added new `Alert` component with support for status variants (info, success, warning, danger), icons, loading states, and custom actions. + +Updated status color tokens for improved contrast and consistency across light and dark themes: + +- Added new `--bui-bg-info` and `--bui-fg-info` tokens for info status +- Updated `--bui-bg-danger`, `--bui-fg-danger` tokens +- Updated `--bui-bg-warning`, `--bui-fg-warning` tokens +- Updated `--bui-bg-success`, `--bui-fg-success` tokens **Affected components**: Alert diff --git a/packages/ui/src/components/Alert/Alert.module.css b/packages/ui/src/components/Alert/Alert.module.css index 182aeec105..643a7d09b0 100644 --- a/packages/ui/src/components/Alert/Alert.module.css +++ b/packages/ui/src/components/Alert/Alert.module.css @@ -25,7 +25,6 @@ gap: var(--bui-space-6); padding: var(--bui-space-3) var(--bui-space-3); border-radius: var(--bui-radius-3); - border: 1px solid var(--alert-border); font-family: var(--bui-font-regular); font-size: var(--bui-font-size-3); line-height: 1.5; diff --git a/packages/ui/src/components/Alert/Alert.stories.tsx b/packages/ui/src/components/Alert/Alert.stories.tsx index d223d01a30..a81337fe71 100644 --- a/packages/ui/src/components/Alert/Alert.stories.tsx +++ b/packages/ui/src/components/Alert/Alert.stories.tsx @@ -145,12 +145,12 @@ export const CustomIcon = meta.story({ } + icon={ diff --git a/packages/ui/src/components/Alert/Alert.tsx b/packages/ui/src/components/Alert/Alert.tsx index 5dfac37409..54eb9cffae 100644 --- a/packages/ui/src/components/Alert/Alert.tsx +++ b/packages/ui/src/components/Alert/Alert.tsx @@ -14,8 +14,6 @@ * limitations under the License. */ -'use client'; - import { forwardRef, Ref, isValidElement, ReactElement } from 'react'; import { ProgressBar } from 'react-aria-components'; import { @@ -107,14 +105,14 @@ export const Alert = forwardRef( if (icon === true) { switch (status) { case 'success': - return ; + return