Skip to content

Commit 005fa36

Browse files
feat(global-header): release global-header 1.0.0 (#428)
1 parent 2fb0bd8 commit 005fa36

File tree

6 files changed

+29
-27
lines changed

6 files changed

+29
-27
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-global-header': major
3+
---
4+
5+
Release 1.0.0

workspaces/global-header/plugins/global-header/dev/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ createDevApp()
279279
title="A colorized notification: ⚠️ Maintainance planned for this week! ⚠️"
280280
textColor="blue"
281281
backgroundColor="yellow"
282-
border="2px solid blue"
282+
borderColor="blue"
283283
/>
284284
<NotificationBanner
285285
title="And a dismissable notification! Will appear after reload!"

workspaces/global-header/plugins/global-header/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
"@mui/material": "5.16.13",
5353
"@mui/styled-engine": "5.16.13",
5454
"@scalprum/react-core": "0.9.3",
55-
"react-dom": "18.3.1",
56-
"react-router-dom": "^6.26.2",
5755
"react-use": "^17.5.0"
5856
},
5957
"peerDependencies": {
@@ -77,7 +75,7 @@
7775
"react-router-dom": "^6.0.0"
7876
},
7977
"keywords": [
80-
"support:tech-preview",
78+
"support:production",
8179
"lifecycle:active",
8280
"backstage",
8381
"plugin"

workspaces/global-header/plugins/global-header/report.api.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,16 @@ export interface NotificationBannerProps {
200200
// (undocumented)
201201
backgroundColor?: string;
202202
// (undocumented)
203-
border?: string;
204-
// (undocumented)
205-
borderRadius?: string;
203+
borderColor?: string;
206204
// (undocumented)
207205
dismiss?: NotificationBannerDismiss;
208206
// (undocumented)
207+
icon?: string;
208+
// (undocumented)
209209
id?: string;
210210
// (undocumented)
211+
layout?: React_2.CSSProperties;
212+
// (undocumented)
211213
markdown?: boolean;
212214
// (undocumented)
213215
textColor?: string;

workspaces/global-header/plugins/global-header/src/components/NotificationBanner.tsx

+16-18
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
*/
1616

1717
import React from 'react';
18-
import Alert from '@mui/material/Alert';
18+
1919
import { MarkdownContent } from '@backstage/core-components';
2020

21-
// export type NotificationBannerColor = 'success' | 'info' | 'warning' | 'error';
22-
// export type NotificationBannerIcon = 'success' | 'info' | 'warning' | 'error';
23-
// export type NotificationBannerVariant = 'standard' | 'filled' | 'outlined';
21+
import Alert from '@mui/material/Alert';
22+
23+
import { HeaderIcon } from './HeaderIcon/HeaderIcon';
2424

2525
/**
2626
* @public
@@ -34,15 +34,12 @@ export interface NotificationBannerProps {
3434
id?: string;
3535
title: string;
3636
markdown?: boolean;
37+
icon?: string;
3738

3839
textColor?: string;
3940
backgroundColor?: string;
40-
border?: string;
41-
borderRadius?: string;
42-
43-
// color?: NotificationBannerColor;
44-
// icon?: NotificationBannerIcon;
45-
// variant?: NotificationBannerVariant;
41+
borderColor?: string;
42+
layout?: React.CSSProperties;
4643

4744
dismiss?: NotificationBannerDismiss;
4845
}
@@ -99,18 +96,19 @@ export const NotificationBanner = (props: NotificationBannerProps) => {
9996

10097
return (
10198
<Alert
102-
// color={props.color}
103-
// severity={props.icon}
104-
icon={false}
105-
// variant={props.variant}
99+
color="warning"
100+
icon={props.icon ? <HeaderIcon icon={props.icon} /> : false}
106101
onClose={onClose}
107102
sx={{
108-
color: props.textColor ?? 'text.primary',
109-
backgroundColor: props.backgroundColor ?? 'background.paper',
110-
border: props.border,
111-
borderRadius: props.borderRadius,
103+
color: props.textColor,
104+
backgroundColor: props.backgroundColor,
105+
borderColor: props.borderColor,
106+
borderStyle: 'solid',
107+
borderWidth: 2,
108+
borderRadius: 0,
112109
justifyContent: 'center',
113110
textAlign: 'center',
111+
...props.layout,
114112
}}
115113
>
116114
{props.markdown ? (

workspaces/global-header/yarn.lock

+1-2
Original file line numberDiff line numberDiff line change
@@ -11042,7 +11042,6 @@ __metadata:
1104211042
"@testing-library/user-event": ^14.0.0
1104311043
msw: ^1.0.0
1104411044
react: ^16.13.1 || ^17.0.0 || ^18.0.0
11045-
react-dom: 18.3.1
1104611045
react-router-dom: ^6.0.0
1104711046
react-use: ^17.5.0
1104811047
peerDependencies:
@@ -30644,7 +30643,7 @@ __metadata:
3064430643
languageName: node
3064530644
linkType: hard
3064630645

30647-
"react-dom@npm:18.3.1, react-dom@npm:^18.0.2":
30646+
"react-dom@npm:^18.0.2":
3064830647
version: 18.3.1
3064930648
resolution: "react-dom@npm:18.3.1"
3065030649
dependencies:

0 commit comments

Comments
 (0)