Fix reports

Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
This commit is contained in:
Charles de Dreuille
2026-02-05 14:41:03 +00:00
committed by Patrik Oldsberg
parent 20b5470692
commit 54dd710eb1
7 changed files with 87 additions and 58 deletions
@@ -19,6 +19,7 @@ import { JSX as JSX_2 } from 'react/jsx-runtime';
import { JSX as JSX_3 } from 'react';
import { Observable } from '@backstage/types';
import { PropsWithChildren } from 'react';
import { ReactElement } from 'react';
import { ReactNode } from 'react';
import { SwappableComponentRef as SwappableComponentRef_2 } from '@backstage/frontend-plugin-api';
import type { z } from 'zod';
@@ -1935,6 +1936,37 @@ export interface SwappableComponentsApi {
// @public
export const swappableComponentsApiRef: ApiRef_2<SwappableComponentsApi>;
// @public
export type ToastApi = {
post(toast: ToastMessage): string;
close(key: string): void;
toast$(): Observable<ToastMessageWithKey>;
};
// @public
export const toastApiRef: ApiRef<ToastApi>;
// @public
export type ToastLink = {
label: string;
href: string;
};
// @public
export type ToastMessage = {
title: ReactNode;
description?: ReactNode;
status?: 'info' | 'success' | 'warning' | 'danger';
icon?: boolean | ReactElement;
links?: ToastLink[];
timeout?: number;
};
// @public
export type ToastMessageWithKey = ToastMessage & {
key: string;
};
// @public (undocumented)
export type TranslationApi = {
getTranslation<
@@ -51,9 +51,9 @@ export type ToastMessage = {
};
/**
* Internal toast message with key for tracking.
* Toast message with key, as returned by the toast$() observable.
*
* @internal
* @public
*/
export type ToastMessageWithKey = ToastMessage & {
/** Unique key for the toast, used for programmatic dismiss */
-47
View File
@@ -54,7 +54,6 @@ import type { TagGroupProps as TagGroupProps_2 } from 'react-aria-components';
import type { TagListProps } from 'react-aria-components';
import type { TagProps as TagProps_2 } from 'react-aria-components';
import type { TextFieldProps as TextFieldProps_2 } from 'react-aria-components';
import { ToastQueue } from 'react-stately';
import type { ToggleButtonGroupProps as ToggleButtonGroupProps_2 } from 'react-aria-components';
import type { ToggleButtonProps as ToggleButtonProps_2 } from 'react-aria-components';
import { TooltipProps as TooltipProps_2 } from 'react-aria-components';
@@ -2180,52 +2179,6 @@ export type TextVariants =
// @public (undocumented)
export type TextWeights = 'regular' | 'bold';
// @public
export const ToastContainer: ForwardRefExoticComponent<
ToastContainerProps & RefAttributes<HTMLDivElement>
>;
// @public
export const ToastContainerDefinition: {
readonly styles: {
readonly [key: string]: string;
};
readonly classNames: {
readonly container: 'bui-ToastContainer';
};
readonly propDefs: {
readonly queue: {};
readonly className: {};
};
};
// @public
export type ToastContainerOwnProps = {
queue: ToastQueue<ToastContent>;
className?: string;
};
// @public
export interface ToastContainerProps extends ToastContainerOwnProps {}
// @public
export interface ToastContent {
description?: ReactNode;
icon?: boolean | ReactElement;
links?: ToastLink[];
status?: 'info' | 'success' | 'warning' | 'danger';
title: ReactNode;
}
// @public
export interface ToastLink {
href: string;
label: string;
}
// @public
export const toastQueue: ToastQueue<ToastContent>;
// @public (undocumented)
export const ToggleButton: ForwardRefExoticComponent<
ToggleButtonProps & RefAttributes<HTMLButtonElement>
+45
View File
@@ -15,9 +15,11 @@ import { ExtensionDataRef } from '@backstage/frontend-plugin-api';
import { ExtensionInput } from '@backstage/frontend-plugin-api';
import { IconComponent } from '@backstage/frontend-plugin-api';
import { JSX as JSX_2 } from 'react';
import { JSX as JSX_3 } from 'react/jsx-runtime';
import { NavContentComponent } from '@backstage/plugin-app-react';
import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api';
import { OverridableFrontendPlugin } from '@backstage/frontend-plugin-api';
import type { ReactElement } from 'react';
import { ReactNode } from 'react';
import { RouteRef } from '@backstage/frontend-plugin-api';
import { SignInPageProps } from '@backstage/plugin-app-react';
@@ -698,6 +700,21 @@ const appPlugin: OverridableFrontendPlugin<
params: ApiFactory<TApi, TImpl, TDeps>,
) => ExtensionBlueprintParams<AnyApiFactory>;
}>;
'api:app/toast': OverridableExtensionDefinition<{
kind: 'api';
name: 'toast';
config: {};
configInput: {};
output: ExtensionDataRef<AnyApiFactory, 'core.api.factory', {}>;
inputs: {};
params: <
TApi,
TImpl extends TApi,
TDeps extends { [name in string]: unknown },
>(
params: ApiFactory<TApi, TImpl, TDeps>,
) => ExtensionBlueprintParams<AnyApiFactory>;
}>;
'api:app/translations': OverridableExtensionDefinition<{
config: {};
configInput: {};
@@ -1004,5 +1021,33 @@ const appPlugin: OverridableFrontendPlugin<
>;
export default appPlugin;
// @public
export interface ToastContent {
description?: ReactNode;
icon?: boolean | ReactElement;
links?: ToastLink[];
status?: 'info' | 'success' | 'warning' | 'danger';
title: ReactNode;
}
// @public
export function ToastDisplay(props: ToastDisplayProps): JSX_3.Element;
// @public
export interface ToastDisplayProps {
// @deprecated
anchorOrigin?: {
vertical: 'top' | 'bottom';
horizontal: 'left' | 'center' | 'right';
};
transientTimeoutMs?: number;
}
// @public
export interface ToastLink {
href: string;
label: string;
}
// (No @packageDocumentation comment for this package)
```
+5 -6
View File
@@ -14,12 +14,11 @@
* limitations under the License.
*/
// Public exports
export { ToastDisplay } from './ToastDisplay';
export type { ToastContent, ToastLink, ToastDisplayProps } from './types';
// Internal exports (used within the plugin only)
export { ToastContainer } from './ToastContainer';
export { toastQueue } from './ToastQueue';
export type {
ToastContent,
ToastLink,
ToastDisplayProps,
ToastContainerProps,
} from './types';
export type { ToastContainerProps } from './types';
+2 -1
View File
@@ -92,10 +92,11 @@ export interface ToastContainerProps {
export interface ToastDisplayProps {
/**
* Number of milliseconds a transient alert will stay open for.
* @default 5000
* Defaults to 5000ms.
*/
transientTimeoutMs?: number;
/**
* Position of the toast on screen.
* @deprecated Toast uses fixed bottom-center positioning. This prop is ignored.
*/
anchorOrigin?: {
+1 -2
View File
@@ -17,10 +17,9 @@
export { appPlugin as default } from './plugin';
// Toast components for alert display
export { ToastDisplay, ToastContainer, toastQueue } from './components/Toast';
export { ToastDisplay } from './components/Toast';
export type {
ToastContent,
ToastLink,
ToastDisplayProps,
ToastContainerProps,
} from './components/Toast';