@red-hat-developer-hub/backstage-plugin-global-header 0.0.4 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/app-config.dynamic.yaml +4 -13
  3. package/dist/components/Divider/Divider.esm.js +16 -0
  4. package/dist/components/Divider/Divider.esm.js.map +1 -0
  5. package/dist/components/GlobalHeader.esm.js +5 -90
  6. package/dist/components/GlobalHeader.esm.js.map +1 -1
  7. package/dist/components/GlobalHeaderComponent.esm.js +25 -0
  8. package/dist/components/GlobalHeaderComponent.esm.js.map +1 -0
  9. package/dist/components/HeaderButton/HeaderButton.esm.js +41 -0
  10. package/dist/components/HeaderButton/HeaderButton.esm.js.map +1 -0
  11. package/dist/components/HeaderDropdownComponent/CreateDropdown.esm.js +20 -53
  12. package/dist/components/HeaderDropdownComponent/CreateDropdown.esm.js.map +1 -1
  13. package/dist/components/HeaderDropdownComponent/HeaderDropdownComponent.esm.js +13 -10
  14. package/dist/components/HeaderDropdownComponent/HeaderDropdownComponent.esm.js.map +1 -1
  15. package/dist/components/HeaderDropdownComponent/MenuSection.esm.js +3 -3
  16. package/dist/components/HeaderDropdownComponent/MenuSection.esm.js.map +1 -1
  17. package/dist/components/HeaderDropdownComponent/ProfileDropdown.esm.js +34 -22
  18. package/dist/components/HeaderDropdownComponent/ProfileDropdown.esm.js.map +1 -1
  19. package/dist/components/HeaderDropdownComponent/RegisterAComponentSection.esm.js +4 -3
  20. package/dist/components/HeaderDropdownComponent/RegisterAComponentSection.esm.js.map +1 -1
  21. package/dist/components/HeaderDropdownComponent/SoftwareTemplatesSection.esm.js +50 -3
  22. package/dist/components/HeaderDropdownComponent/SoftwareTemplatesSection.esm.js.map +1 -1
  23. package/dist/components/{HeaderIconButtonComponent → HeaderIcon}/HeaderIcon.esm.js +10 -5
  24. package/dist/components/HeaderIcon/HeaderIcon.esm.js.map +1 -0
  25. package/dist/components/HeaderIconButton/HeaderIconButton.esm.js +37 -0
  26. package/dist/components/HeaderIconButton/HeaderIconButton.esm.js.map +1 -0
  27. package/dist/components/{HeaderButtonComponent → LogoutButton}/LogoutButton.esm.js +10 -2
  28. package/dist/components/LogoutButton/LogoutButton.esm.js.map +1 -0
  29. package/dist/components/{HeaderLinkComponent/HeaderLink.esm.js → MenuItemLink/MenuItemLink.esm.js} +6 -6
  30. package/dist/components/MenuItemLink/MenuItemLink.esm.js.map +1 -0
  31. package/dist/components/MenuItemLink/MenuItemLinkContent.esm.js +40 -0
  32. package/dist/components/MenuItemLink/MenuItemLinkContent.esm.js.map +1 -0
  33. package/dist/components/NotificationButton/NotificationButton.esm.js +36 -0
  34. package/dist/components/NotificationButton/NotificationButton.esm.js.map +1 -0
  35. package/dist/components/SearchComponent/SearchBar.esm.js +37 -7
  36. package/dist/components/SearchComponent/SearchBar.esm.js.map +1 -1
  37. package/dist/components/SearchComponent/SearchOption.esm.js +1 -1
  38. package/dist/components/SearchComponent/SearchOption.esm.js.map +1 -1
  39. package/dist/components/SearchComponent/SearchResultItem.esm.js +13 -1
  40. package/dist/components/SearchComponent/SearchResultItem.esm.js.map +1 -1
  41. package/dist/components/Spacer/Spacer.esm.js +16 -0
  42. package/dist/components/Spacer/Spacer.esm.js.map +1 -0
  43. package/dist/components/SupportButton/SupportButton.esm.js +36 -0
  44. package/dist/components/SupportButton/SupportButton.esm.js.map +1 -0
  45. package/dist/defaultMountPoints/defaultMountPoints.esm.js +93 -0
  46. package/dist/defaultMountPoints/defaultMountPoints.esm.js.map +1 -0
  47. package/dist/hooks/useCreateDropdownMountPoints.esm.js +4 -0
  48. package/dist/hooks/useCreateDropdownMountPoints.esm.js.map +1 -1
  49. package/dist/hooks/useDropdownManager.esm.js +7 -6
  50. package/dist/hooks/useDropdownManager.esm.js.map +1 -1
  51. package/dist/hooks/useNotificationCount.esm.js +54 -0
  52. package/dist/hooks/useNotificationCount.esm.js.map +1 -0
  53. package/dist/hooks/useProfileDropdownMountPoints.esm.js +4 -0
  54. package/dist/hooks/useProfileDropdownMountPoints.esm.js.map +1 -1
  55. package/dist/index.d.ts +190 -41
  56. package/dist/index.esm.js +2 -1
  57. package/dist/index.esm.js.map +1 -1
  58. package/dist/plugin.esm.js +81 -14
  59. package/dist/plugin.esm.js.map +1 -1
  60. package/dist/types.esm.js +3 -6
  61. package/dist/types.esm.js.map +1 -1
  62. package/package.json +6 -1
  63. package/dist/components/HeaderButtonComponent/HeaderButton.esm.js +0 -17
  64. package/dist/components/HeaderButtonComponent/HeaderButton.esm.js.map +0 -1
  65. package/dist/components/HeaderButtonComponent/LogoutButton.esm.js.map +0 -1
  66. package/dist/components/HeaderIconButtonComponent/HeaderIcon.esm.js.map +0 -1
  67. package/dist/components/HeaderIconButtonComponent/HeaderIconButton.esm.js +0 -25
  68. package/dist/components/HeaderIconButtonComponent/HeaderIconButton.esm.js.map +0 -1
  69. package/dist/components/HeaderLinkComponent/HeaderItemContent.esm.js +0 -19
  70. package/dist/components/HeaderLinkComponent/HeaderItemContent.esm.js.map +0 -1
  71. package/dist/components/HeaderLinkComponent/HeaderLink.esm.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
2
+ import React$1 from 'react';
1
3
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
2
- import React from 'react';
3
4
 
4
5
  /**
5
6
  * @public
@@ -21,58 +22,154 @@ interface NotificationBannerProps {
21
22
 
22
23
  /**
23
24
  * @public
24
- * Create button properties
25
25
  */
26
- interface CreateButtonProps {
27
- handleMenu: (event: React.MouseEvent<HTMLElement>) => void;
28
- anchorEl: HTMLElement | null;
29
- setAnchorEl: React.Dispatch<React.SetStateAction<HTMLElement | null>>;
26
+ interface NotificationButtonProps {
27
+ title?: string;
28
+ tooltip?: string;
29
+ color?: 'inherit' | 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
30
+ size?: 'small' | 'medium' | 'large';
31
+ badgeColor?: 'primary' | 'secondary' | 'default' | 'error' | 'info' | 'success' | 'warning';
32
+ to?: string;
33
+ }
34
+
35
+ /**
36
+ * @public
37
+ */
38
+ interface SupportButtonProps {
39
+ title?: string;
40
+ tooltip?: string;
41
+ color?: 'inherit' | 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
42
+ size?: 'small' | 'medium' | 'large';
43
+ to?: string;
44
+ }
45
+
46
+ /**
47
+ * @public
48
+ */
49
+ interface SpacerProps {
50
+ growFactor?: number;
51
+ minWidth?: number | string;
30
52
  }
31
53
 
32
54
  /**
33
- * Header Icon Button properties
34
55
  * @public
35
56
  */
36
57
  interface HeaderIconButtonProps {
58
+ title: string;
37
59
  icon: string;
38
- to?: string;
39
60
  tooltip?: string;
61
+ color?: 'inherit' | 'primary' | 'secondary' | 'default';
62
+ size?: 'small' | 'medium' | 'large';
63
+ ariaLabel?: string;
64
+ to: string;
65
+ style?: React$1.CSSProperties;
40
66
  }
41
67
 
42
68
  /**
43
69
  * @public
44
- * ProfileDropdown component properties
45
70
  */
46
- interface ProfileDropdownProps {
47
- handleMenu: (event: React.MouseEvent<HTMLElement>) => void;
48
- anchorEl: HTMLElement | null;
49
- setAnchorEl: React.Dispatch<React.SetStateAction<HTMLElement | null>>;
71
+ interface HeaderIconProps {
72
+ icon: string;
73
+ size?: 'small' | 'medium' | 'large';
74
+ styles?: React$1.CSSProperties;
50
75
  }
51
76
 
52
77
  /**
53
- * Header Icon Button properties
54
78
  * @public
55
79
  */
56
- interface HeaderLinkProps {
57
- to: string;
58
- title?: string;
59
- subTitle?: string;
60
- icon?: string;
80
+ interface HeaderButtonProps {
81
+ title: string;
61
82
  tooltip?: string;
83
+ color?: 'inherit' | 'primary' | 'secondary' | 'default';
84
+ size?: 'small' | 'medium' | 'large';
85
+ variant?: 'text' | 'outlined' | 'contained';
86
+ ariaLabel?: string;
87
+ startIcon?: string;
88
+ endIcon?: string;
89
+ externalLinkIcon?: boolean;
90
+ to: string;
91
+ style?: React$1.CSSProperties;
62
92
  }
63
93
 
64
94
  /**
65
- * Menu item configuration
95
+ * Component
66
96
  *
67
97
  * @public
68
98
  */
69
- interface MenuItemConfig {
70
- Component: React.ComponentType<HeaderLinkProps | {}>;
71
- type: string;
72
- label: string;
99
+ declare enum ComponentType {
100
+ /**
101
+ * Global Header spacer
102
+ */
103
+ SPACER = "spacer",
104
+ /**
105
+ * Global Header support button
106
+ */
107
+ SUPPORT_BUTTON = "support_button",
108
+ /**
109
+ * Global Header Component dropdown button
110
+ */
111
+ DROPDOWN_BUTTON = "dropdown_button",
112
+ /**
113
+ * Global Header Component icon button
114
+ */
115
+ ICON_BUTTON = "icon_button",
116
+ /**
117
+ * Global Header Component link
118
+ */
119
+ LINK = "link",
120
+ /**
121
+ * Global Header Component list
122
+ */
123
+ LIST = "list",
124
+ /**
125
+ * Global Header Component search
126
+ */
127
+ SEARCH = "search",
128
+ /**
129
+ * Global Header Component logout
130
+ */
131
+ LOGOUT = "logout"
132
+ }
133
+ /**
134
+ * Global Header Config
135
+ *
136
+ * @public
137
+ */
138
+ interface GlobalHeaderComponentMountPointConfig {
139
+ type?: ComponentType;
140
+ priority?: number;
141
+ }
142
+ /**
143
+ * Global Header Component Mount Point
144
+ *
145
+ * @public
146
+ */
147
+ interface GlobalHeaderComponentMountPoint {
148
+ Component: React.ComponentType<{}>;
149
+ config?: GlobalHeaderComponentMountPointConfig & {
150
+ layout?: Record<string, any>;
151
+ props?: Record<string, any>;
152
+ };
153
+ }
154
+
155
+ /**
156
+ * @public
157
+ * Global Header Component properties
158
+ */
159
+ interface GlobalHeaderComponentProps {
160
+ globalHeaderMountPoints: GlobalHeaderComponentMountPoint[];
161
+ }
162
+
163
+ /**
164
+ * Header Icon Button properties
165
+ * @public
166
+ */
167
+ interface MenuItemLinkProps {
168
+ to: string;
169
+ title?: string;
170
+ subTitle?: string;
73
171
  icon?: string;
74
- subLabel?: string;
75
- link?: string;
172
+ tooltip?: string;
76
173
  }
77
174
 
78
175
  /**
@@ -81,7 +178,6 @@ interface MenuItemConfig {
81
178
  * @public
82
179
  */
83
180
  type SoftwareTemplatesSectionProps = {
84
- items: MenuItemConfig[];
85
181
  handleClose: () => void;
86
182
  hideDivider?: boolean;
87
183
  };
@@ -96,6 +192,27 @@ type RegisterAComponentSectionProps = {
96
192
  handleClose: () => void;
97
193
  };
98
194
 
195
+ /**
196
+ * Menu item configuration
197
+ *
198
+ * @public
199
+ */
200
+ interface MenuItemConfig {
201
+ Component: React$1.ComponentType<MenuItemLinkProps | {}>;
202
+ type: string;
203
+ label: string;
204
+ icon?: string;
205
+ subLabel?: string;
206
+ link?: string;
207
+ }
208
+
209
+ /**
210
+ * default Global Header Components mount points
211
+ *
212
+ * @public
213
+ */
214
+ declare const defaultGlobalHeaderComponentsMountPoints: GlobalHeaderComponentMountPoint[];
215
+
99
216
  /**
100
217
  * Global Header Plugin
101
218
  *
@@ -107,60 +224,92 @@ declare const globalHeaderPlugin: _backstage_core_plugin_api.BackstagePlugin<{},
107
224
  *
108
225
  * @public
109
226
  */
110
- declare const GlobalHeader: () => React.JSX.Element;
227
+ declare const GlobalHeader: () => React$1.JSX.Element;
111
228
  /**
112
- * Search Component
229
+ * Global Header Component
113
230
  *
114
231
  * @public
115
232
  */
116
- declare const SearchComponent: React.ComponentType;
233
+ declare const GlobalHeaderComponent: React$1.ComponentType<GlobalHeaderComponentProps>;
117
234
  /**
118
- * Create Dropdown
235
+ * @public
236
+ */
237
+ declare const HeaderButton: ({ title, tooltip, color, size, variant, ariaLabel, startIcon, endIcon, externalLinkIcon, to, style, }: HeaderButtonProps) => React$1.JSX.Element;
238
+ /**
239
+ * @public
240
+ */
241
+ declare const HeaderIcon: ({ icon, size, styles, }: HeaderIconProps) => React$1.JSX.Element | null;
242
+ /**
243
+ * @public
244
+ */
245
+ declare const HeaderIconButton: ({ title, icon, tooltip, color, size, ariaLabel, to, style, }: HeaderIconButtonProps) => React$1.JSX.Element;
246
+ /**
247
+ * Search Component
119
248
  *
120
249
  * @public
121
250
  */
122
- declare const CreateDropdown: React.ComponentType<CreateButtonProps>;
251
+ declare const SearchComponent: React$1.ComponentType;
123
252
  /**
124
- * Header Icon Button
253
+ * Create Dropdown
125
254
  *
126
255
  * @public
127
256
  */
128
- declare const HeaderIconButton: React.ComponentType<HeaderIconButtonProps>;
257
+ declare const CreateDropdown: () => React$1.JSX.Element | null;
129
258
  /**
130
259
  * Profile Dropdown
131
260
  *
132
261
  * @public
133
262
  */
134
- declare const ProfileDropdown: React.ComponentType<ProfileDropdownProps>;
263
+ declare const ProfileDropdown: () => React$1.JSX.Element | null;
135
264
  /**
136
265
  * Software Templates List
137
266
  *
138
267
  * @public
139
268
  */
140
- declare const SoftwareTemplatesSection: React.ComponentType<SoftwareTemplatesSectionProps>;
269
+ declare const SoftwareTemplatesSection: React$1.ComponentType<SoftwareTemplatesSectionProps>;
141
270
  /**
142
271
  * Register A Component Link
143
272
  *
144
273
  * @public
145
274
  */
146
- declare const RegisterAComponentSection: React.ComponentType<RegisterAComponentSectionProps>;
275
+ declare const RegisterAComponentSection: React$1.ComponentType<RegisterAComponentSectionProps>;
147
276
  /**
148
277
  * Header Link
149
278
  *
150
279
  * @public
151
280
  */
152
- declare const HeaderLink: React.ComponentType<HeaderLinkProps>;
281
+ declare const MenuItemLink: React$1.ComponentType<MenuItemLinkProps>;
153
282
  /**
154
283
  * Header Logout Button
155
284
  *
156
285
  * @public
157
286
  */
158
- declare const LogoutButton: React.ComponentType;
287
+ declare const LogoutButton: React$1.ComponentType;
288
+ /**
289
+ * Spacer component that allow users to add a flexibel spacing between components.
290
+ *
291
+ * Supports two props: `growFactor` with default 1 and `minWidth` width default 8 pixels.
292
+ *
293
+ * @public
294
+ */
295
+ declare const Spacer: ({ growFactor, minWidth }: SpacerProps) => React$1.JSX.Element;
296
+ /**
297
+ * @public
298
+ */
299
+ declare const Divider: () => React$1.JSX.Element;
300
+ /**
301
+ * @public
302
+ */
303
+ declare const SupportButton: ({ title, tooltip, color, size, to, }: SupportButtonProps) => React$1.JSX.Element | null;
304
+ /**
305
+ * @public
306
+ */
307
+ declare const NotificationButton: ({ title, tooltip, color, size, badgeColor, to, }: NotificationButtonProps) => React$1.JSX.Element | null;
159
308
  /**
160
309
  * NotificationBanner
161
310
  *
162
311
  * @public
163
312
  */
164
- declare const NotificationBanner: (props: NotificationBannerProps) => React.JSX.Element | null;
313
+ declare const NotificationBanner: (props: NotificationBannerProps) => React$1.JSX.Element | null;
165
314
 
166
- export { type CreateButtonProps, CreateDropdown, GlobalHeader, HeaderIconButton, type HeaderIconButtonProps, HeaderLink, type HeaderLinkProps, LogoutButton, type MenuItemConfig, NotificationBanner, type NotificationBannerDismiss, type NotificationBannerProps, ProfileDropdown, type ProfileDropdownProps, RegisterAComponentSection, type RegisterAComponentSectionProps, SearchComponent, SoftwareTemplatesSection, type SoftwareTemplatesSectionProps, globalHeaderPlugin };
315
+ export { ComponentType, CreateDropdown, Divider, GlobalHeader, GlobalHeaderComponent, type GlobalHeaderComponentMountPoint, type GlobalHeaderComponentMountPointConfig, type GlobalHeaderComponentProps, HeaderButton, type HeaderButtonProps, HeaderIcon, HeaderIconButton, type HeaderIconButtonProps, type HeaderIconProps, LogoutButton, type MenuItemConfig, MenuItemLink, type MenuItemLinkProps, NotificationBanner, type NotificationBannerDismiss, type NotificationBannerProps, NotificationButton, type NotificationButtonProps, ProfileDropdown, RegisterAComponentSection, type RegisterAComponentSectionProps, SearchComponent, SoftwareTemplatesSection, type SoftwareTemplatesSectionProps, Spacer, type SpacerProps, SupportButton, type SupportButtonProps, defaultGlobalHeaderComponentsMountPoints, globalHeaderPlugin };
package/dist/index.esm.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { unstable_ClassNameGenerator } from '@mui/material/className';
2
- export { CreateDropdown, GlobalHeader, HeaderIconButton, HeaderLink, LogoutButton, NotificationBanner, ProfileDropdown, RegisterAComponentSection, SearchComponent, SoftwareTemplatesSection, globalHeaderPlugin } from './plugin.esm.js';
2
+ export { CreateDropdown, Divider, GlobalHeader, GlobalHeaderComponent, HeaderButton, HeaderIcon, HeaderIconButton, LogoutButton, MenuItemLink, NotificationBanner, NotificationButton, ProfileDropdown, RegisterAComponentSection, SearchComponent, SoftwareTemplatesSection, Spacer, SupportButton, globalHeaderPlugin } from './plugin.esm.js';
3
+ export { defaultGlobalHeaderComponentsMountPoints } from './defaultMountPoints/defaultMountPoints.esm.js';
3
4
 
4
5
  unstable_ClassNameGenerator.configure((componentName) => {
5
6
  return componentName.startsWith("v5-") ? componentName : `v5-${componentName}`;
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/material/className';\n\nClassNameGenerator.configure(componentName => {\n return componentName.startsWith('v5-')\n ? componentName\n : `v5-${componentName}`;\n});\n\nexport * from './plugin';\n"],"names":["ClassNameGenerator"],"mappings":";;;AAiBAA,2BAAA,CAAmB,UAAU,CAAiB,aAAA,KAAA;AAC5C,EAAA,OAAO,cAAc,UAAW,CAAA,KAAK,CACjC,GAAA,aAAA,GACA,MAAM,aAAa,CAAA,CAAA;AACzB,CAAC,CAAA"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/material/className';\n\nClassNameGenerator.configure(componentName => {\n return componentName.startsWith('v5-')\n ? componentName\n : `v5-${componentName}`;\n});\n\nexport * from './plugin';\n"],"names":["ClassNameGenerator"],"mappings":";;;;AAiBAA,2BAAA,CAAmB,UAAU,CAAiB,aAAA,KAAA;AAC5C,EAAA,OAAO,cAAc,UAAW,CAAA,KAAK,CACjC,GAAA,aAAA,GACA,MAAM,aAAa,CAAA,CAAA;AACzB,CAAC,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { createPlugin, createComponentExtension } from '@backstage/core-plugin-api';
2
+ export { defaultGlobalHeaderComponentsMountPoints } from './defaultMountPoints/defaultMountPoints.esm.js';
2
3
 
3
4
  const globalHeaderPlugin = createPlugin({
4
5
  id: "global-header"
@@ -11,6 +12,44 @@ const GlobalHeader = globalHeaderPlugin.provide(
11
12
  }
12
13
  })
13
14
  );
15
+ const GlobalHeaderComponent = globalHeaderPlugin.provide(
16
+ createComponentExtension({
17
+ name: "GlobalHeaderComponent",
18
+ component: {
19
+ lazy: () => import('./components/GlobalHeaderComponent.esm.js').then(
20
+ (m) => m.GlobalHeaderComponent
21
+ )
22
+ }
23
+ })
24
+ );
25
+ const HeaderButton = globalHeaderPlugin.provide(
26
+ createComponentExtension({
27
+ name: "HeaderButton",
28
+ component: {
29
+ lazy: () => import('./components/HeaderButton/HeaderButton.esm.js').then(
30
+ (m) => m.HeaderButton
31
+ )
32
+ }
33
+ })
34
+ );
35
+ const HeaderIcon = globalHeaderPlugin.provide(
36
+ createComponentExtension({
37
+ name: "HeaderIcon",
38
+ component: {
39
+ lazy: () => import('./components/HeaderIcon/HeaderIcon.esm.js').then((m) => m.HeaderIcon)
40
+ }
41
+ })
42
+ );
43
+ const HeaderIconButton = globalHeaderPlugin.provide(
44
+ createComponentExtension({
45
+ name: "HeaderIconButton",
46
+ component: {
47
+ lazy: () => import('./components/HeaderIconButton/HeaderIconButton.esm.js').then(
48
+ (m) => m.HeaderIconButton
49
+ )
50
+ }
51
+ })
52
+ );
14
53
  const SearchComponent = globalHeaderPlugin.provide(
15
54
  createComponentExtension({
16
55
  name: "SearchComponent",
@@ -31,14 +70,6 @@ const CreateDropdown = globalHeaderPlugin.provide(
31
70
  }
32
71
  })
33
72
  );
34
- const HeaderIconButton = globalHeaderPlugin.provide(
35
- createComponentExtension({
36
- name: "HeaderIconButton",
37
- component: {
38
- lazy: () => import('./components/HeaderIconButtonComponent/HeaderIconButton.esm.js').then((m) => m.HeaderIconButton)
39
- }
40
- })
41
- );
42
73
  const ProfileDropdown = globalHeaderPlugin.provide(
43
74
  createComponentExtension({
44
75
  name: "ProfileDropdown",
@@ -65,12 +96,12 @@ const RegisterAComponentSection = globalHeaderPlugin.provide(
65
96
  }
66
97
  })
67
98
  );
68
- const HeaderLink = globalHeaderPlugin.provide(
99
+ const MenuItemLink = globalHeaderPlugin.provide(
69
100
  createComponentExtension({
70
- name: "HeaderLink",
101
+ name: "MenuItemLink",
71
102
  component: {
72
- lazy: () => import('./components/HeaderLinkComponent/HeaderLink.esm.js').then(
73
- (m) => m.HeaderLink
103
+ lazy: () => import('./components/MenuItemLink/MenuItemLink.esm.js').then(
104
+ (m) => m.MenuItemLink
74
105
  )
75
106
  }
76
107
  })
@@ -79,12 +110,48 @@ const LogoutButton = globalHeaderPlugin.provide(
79
110
  createComponentExtension({
80
111
  name: "LogoutButton",
81
112
  component: {
82
- lazy: () => import('./components/HeaderButtonComponent/LogoutButton.esm.js').then(
113
+ lazy: () => import('./components/LogoutButton/LogoutButton.esm.js').then(
83
114
  (m) => m.LogoutButton
84
115
  )
85
116
  }
86
117
  })
87
118
  );
119
+ const Spacer = globalHeaderPlugin.provide(
120
+ createComponentExtension({
121
+ name: "Spacer",
122
+ component: {
123
+ lazy: () => import('./components/Spacer/Spacer.esm.js').then((m) => m.Spacer)
124
+ }
125
+ })
126
+ );
127
+ const Divider = globalHeaderPlugin.provide(
128
+ createComponentExtension({
129
+ name: "Divider",
130
+ component: {
131
+ lazy: () => import('./components/Divider/Divider.esm.js').then((m) => m.Divider)
132
+ }
133
+ })
134
+ );
135
+ const SupportButton = globalHeaderPlugin.provide(
136
+ createComponentExtension({
137
+ name: "SupportButton",
138
+ component: {
139
+ lazy: () => import('./components/SupportButton/SupportButton.esm.js').then(
140
+ (m) => m.SupportButton
141
+ )
142
+ }
143
+ })
144
+ );
145
+ const NotificationButton = globalHeaderPlugin.provide(
146
+ createComponentExtension({
147
+ name: "NotificationButton",
148
+ component: {
149
+ lazy: () => import('./components/NotificationButton/NotificationButton.esm.js').then(
150
+ (m) => m.NotificationButton
151
+ )
152
+ }
153
+ })
154
+ );
88
155
  const NotificationBanner = globalHeaderPlugin.provide(
89
156
  createComponentExtension({
90
157
  name: "NotificationBanner",
@@ -96,5 +163,5 @@ const NotificationBanner = globalHeaderPlugin.provide(
96
163
  })
97
164
  );
98
165
 
99
- export { CreateDropdown, GlobalHeader, HeaderIconButton, HeaderLink, LogoutButton, NotificationBanner, ProfileDropdown, RegisterAComponentSection, SearchComponent, SoftwareTemplatesSection, globalHeaderPlugin };
166
+ export { CreateDropdown, Divider, GlobalHeader, GlobalHeaderComponent, HeaderButton, HeaderIcon, HeaderIconButton, LogoutButton, MenuItemLink, NotificationBanner, NotificationButton, ProfileDropdown, RegisterAComponentSection, SearchComponent, SoftwareTemplatesSection, Spacer, SupportButton, globalHeaderPlugin };
100
167
  //# sourceMappingURL=plugin.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport {\n createPlugin,\n createComponentExtension,\n} from '@backstage/core-plugin-api';\nimport { CreateButtonProps } from './components/HeaderDropdownComponent/CreateDropdown';\nimport { HeaderIconButtonProps } from './components/HeaderIconButtonComponent/HeaderIconButton';\nimport { ProfileDropdownProps } from './components/HeaderDropdownComponent/ProfileDropdown';\nimport { HeaderLinkProps } from './components/HeaderLinkComponent/HeaderLink';\nimport { SoftwareTemplatesSectionProps } from './components/HeaderDropdownComponent/SoftwareTemplatesSection';\nimport { RegisterAComponentSectionProps } from './components/HeaderDropdownComponent/RegisterAComponentSection';\n\nexport type { CreateButtonProps } from './components/HeaderDropdownComponent/CreateDropdown';\nexport type { HeaderLinkProps } from './components/HeaderLinkComponent/HeaderLink';\nexport type { MenuItemConfig } from './components/HeaderDropdownComponent/MenuSection';\nexport type { SoftwareTemplatesSectionProps } from './components/HeaderDropdownComponent/SoftwareTemplatesSection';\nexport type { RegisterAComponentSectionProps } from './components/HeaderDropdownComponent/RegisterAComponentSection';\nexport type { HeaderIconButtonProps } from './components/HeaderIconButtonComponent/HeaderIconButton';\nexport type { ProfileDropdownProps } from './components/HeaderDropdownComponent/ProfileDropdown';\n\nexport type {\n NotificationBannerProps,\n NotificationBannerDismiss,\n} from './components/NotificationBanner';\n\n/**\n * Global Header Plugin\n *\n * @public\n */\nexport const globalHeaderPlugin = createPlugin({\n id: 'global-header',\n});\n\n/**\n * Global Header\n *\n * @public\n */\nexport const GlobalHeader = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'GlobalHeader',\n component: {\n lazy: () => import('./components/GlobalHeader').then(m => m.GlobalHeader),\n },\n }),\n);\n\n/**\n * Search Component\n *\n * @public\n */\nexport const SearchComponent: React.ComponentType = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'SearchComponent',\n component: {\n lazy: () =>\n import('./components/SearchComponent/SearchComponent').then(\n m => m.SearchComponent,\n ),\n },\n }),\n);\n\n/**\n * Create Dropdown\n *\n * @public\n */\nexport const CreateDropdown: React.ComponentType<CreateButtonProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'CreateDropdown',\n component: {\n lazy: () =>\n import('./components/HeaderDropdownComponent/CreateDropdown').then(\n m => m.CreateDropdown,\n ),\n },\n }),\n );\n\n/**\n * Header Icon Button\n *\n * @public\n */\nexport const HeaderIconButton: React.ComponentType<HeaderIconButtonProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'HeaderIconButton',\n component: {\n lazy: () =>\n import(\n './components/HeaderIconButtonComponent/HeaderIconButton'\n ).then(m => m.HeaderIconButton),\n },\n }),\n );\n\n/**\n * Profile Dropdown\n *\n * @public\n */\nexport const ProfileDropdown: React.ComponentType<ProfileDropdownProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'ProfileDropdown',\n component: {\n lazy: () =>\n import('./components/HeaderDropdownComponent/ProfileDropdown').then(\n m => m.ProfileDropdown,\n ),\n },\n }),\n );\n\n/**\n * Software Templates List\n *\n * @public\n */\nexport const SoftwareTemplatesSection: React.ComponentType<SoftwareTemplatesSectionProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'SoftwareTemplatesSection',\n component: {\n lazy: () =>\n import(\n './components/HeaderDropdownComponent/SoftwareTemplatesSection'\n ).then(m => m.SoftwareTemplatesSection),\n },\n }),\n );\n\n/**\n * Register A Component Link\n *\n * @public\n */\nexport const RegisterAComponentSection: React.ComponentType<RegisterAComponentSectionProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'RegisterAComponentSection',\n component: {\n lazy: () =>\n import(\n './components/HeaderDropdownComponent/RegisterAComponentSection'\n ).then(m => m.RegisterAComponentSection),\n },\n }),\n );\n\n/**\n * Header Link\n *\n * @public\n */\nexport const HeaderLink: React.ComponentType<HeaderLinkProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'HeaderLink',\n component: {\n lazy: () =>\n import('./components/HeaderLinkComponent/HeaderLink').then(\n m => m.HeaderLink,\n ),\n },\n }),\n );\n\n/**\n * Header Logout Button\n *\n * @public\n */\nexport const LogoutButton: React.ComponentType = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'LogoutButton',\n component: {\n lazy: () =>\n import('./components/HeaderButtonComponent/LogoutButton').then(\n m => m.LogoutButton,\n ),\n },\n }),\n);\n\n/**\n * NotificationBanner\n *\n * @public\n */\nexport const NotificationBanner = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'NotificationBanner',\n component: {\n lazy: () =>\n import('./components/NotificationBanner').then(\n m => m.NotificationBanner,\n ),\n },\n }),\n);\n"],"names":[],"mappings":";;AA8CO,MAAM,qBAAqB,YAAa,CAAA;AAAA,EAC7C,EAAI,EAAA;AACN,CAAC;AAOM,MAAM,eAAe,kBAAmB,CAAA,OAAA;AAAA,EAC7C,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,cAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MAAM,OAAO,kCAA2B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,YAAY;AAAA;AAC1E,GACD;AACH;AAOO,MAAM,kBAAuC,kBAAmB,CAAA,OAAA;AAAA,EACrE,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,iBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,qDAA8C,CAAE,CAAA,IAAA;AAAA,QACrD,OAAK,CAAE,CAAA;AAAA;AACT;AACJ,GACD;AACH;AAOO,MAAM,iBACX,kBAAmB,CAAA,OAAA;AAAA,EACjB,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,gBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,4DAAqD,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,GACD;AACH;AAOK,MAAM,eAAoC,kBAAmB,CAAA,OAAA;AAAA,EAClE,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,cAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,wDAAiD,CAAE,CAAA,IAAA;AAAA,QACxD,OAAK,CAAE,CAAA;AAAA;AACT;AACJ,GACD;AACH;AAOO,MAAM,qBAAqB,kBAAmB,CAAA,OAAA;AAAA,EACnD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,oBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,wCAAiC,CAAE,CAAA,IAAA;AAAA,QACxC,OAAK,CAAE,CAAA;AAAA;AACT;AACJ,GACD;AACH;;;;"}
1
+ {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\n\nimport {\n createPlugin,\n createComponentExtension,\n} from '@backstage/core-plugin-api';\n\nimport { GlobalHeaderComponentProps } from './components/GlobalHeaderComponent';\nimport { MenuItemLinkProps } from './components/MenuItemLink/MenuItemLink';\nimport { SoftwareTemplatesSectionProps } from './components/HeaderDropdownComponent/SoftwareTemplatesSection';\nimport { RegisterAComponentSectionProps } from './components/HeaderDropdownComponent/RegisterAComponentSection';\n\nexport type { GlobalHeaderComponentProps } from './components/GlobalHeaderComponent';\n\nexport type { HeaderButtonProps } from './components/HeaderButton/HeaderButton';\nexport type { HeaderIconProps } from './components/HeaderIcon/HeaderIcon';\nexport type { HeaderIconButtonProps } from './components/HeaderIconButton/HeaderIconButton';\n\nexport type { MenuItemLinkProps } from './components/MenuItemLink/MenuItemLink';\nexport type { MenuItemConfig } from './components/HeaderDropdownComponent/MenuSection';\nexport type { SoftwareTemplatesSectionProps } from './components/HeaderDropdownComponent/SoftwareTemplatesSection';\nexport type { RegisterAComponentSectionProps } from './components/HeaderDropdownComponent/RegisterAComponentSection';\nexport type { SpacerProps } from './components/Spacer/Spacer';\nexport type { SupportButtonProps } from './components/SupportButton/SupportButton';\nexport type { NotificationButtonProps } from './components/NotificationButton/NotificationButton';\n\nexport type {\n NotificationBannerProps,\n NotificationBannerDismiss,\n} from './components/NotificationBanner';\n\nexport type {\n ComponentType,\n GlobalHeaderComponentMountPoint,\n GlobalHeaderComponentMountPointConfig,\n} from './types';\n\nexport { defaultGlobalHeaderComponentsMountPoints } from './defaultMountPoints/defaultMountPoints';\n\n/**\n * Global Header Plugin\n *\n * @public\n */\nexport const globalHeaderPlugin = createPlugin({\n id: 'global-header',\n});\n\n/**\n * Global Header\n *\n * @public\n */\nexport const GlobalHeader = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'GlobalHeader',\n component: {\n lazy: () => import('./components/GlobalHeader').then(m => m.GlobalHeader),\n },\n }),\n);\n\n/**\n * Global Header Component\n *\n * @public\n */\nexport const GlobalHeaderComponent: React.ComponentType<GlobalHeaderComponentProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'GlobalHeaderComponent',\n component: {\n lazy: () =>\n import('./components/GlobalHeaderComponent').then(\n m => m.GlobalHeaderComponent,\n ),\n },\n }),\n );\n\n/**\n * @public\n */\nexport const HeaderButton = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'HeaderButton',\n component: {\n lazy: () =>\n import('./components/HeaderButton/HeaderButton').then(\n m => m.HeaderButton,\n ),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const HeaderIcon = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'HeaderIcon',\n component: {\n lazy: () =>\n import('./components/HeaderIcon/HeaderIcon').then(m => m.HeaderIcon),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const HeaderIconButton = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'HeaderIconButton',\n component: {\n lazy: () =>\n import('./components/HeaderIconButton/HeaderIconButton').then(\n m => m.HeaderIconButton,\n ),\n },\n }),\n);\n\n/**\n * Search Component\n *\n * @public\n */\nexport const SearchComponent: React.ComponentType = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'SearchComponent',\n component: {\n lazy: () =>\n import('./components/SearchComponent/SearchComponent').then(\n m => m.SearchComponent,\n ),\n },\n }),\n);\n\n/**\n * Create Dropdown\n *\n * @public\n */\nexport const CreateDropdown = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'CreateDropdown',\n component: {\n lazy: () =>\n import('./components/HeaderDropdownComponent/CreateDropdown').then(\n m => m.CreateDropdown,\n ),\n },\n }),\n);\n\n/**\n * Profile Dropdown\n *\n * @public\n */\nexport const ProfileDropdown = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'ProfileDropdown',\n component: {\n lazy: () =>\n import('./components/HeaderDropdownComponent/ProfileDropdown').then(\n m => m.ProfileDropdown,\n ),\n },\n }),\n);\n\n/**\n * Software Templates List\n *\n * @public\n */\nexport const SoftwareTemplatesSection: React.ComponentType<SoftwareTemplatesSectionProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'SoftwareTemplatesSection',\n component: {\n lazy: () =>\n import(\n './components/HeaderDropdownComponent/SoftwareTemplatesSection'\n ).then(m => m.SoftwareTemplatesSection),\n },\n }),\n );\n\n/**\n * Register A Component Link\n *\n * @public\n */\nexport const RegisterAComponentSection: React.ComponentType<RegisterAComponentSectionProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'RegisterAComponentSection',\n component: {\n lazy: () =>\n import(\n './components/HeaderDropdownComponent/RegisterAComponentSection'\n ).then(m => m.RegisterAComponentSection),\n },\n }),\n );\n\n/**\n * Header Link\n *\n * @public\n */\nexport const MenuItemLink: React.ComponentType<MenuItemLinkProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'MenuItemLink',\n component: {\n lazy: () =>\n import('./components/MenuItemLink/MenuItemLink').then(\n m => m.MenuItemLink,\n ),\n },\n }),\n );\n\n/**\n * Header Logout Button\n *\n * @public\n */\nexport const LogoutButton: React.ComponentType = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'LogoutButton',\n component: {\n lazy: () =>\n import('./components/LogoutButton/LogoutButton').then(\n m => m.LogoutButton,\n ),\n },\n }),\n);\n\n/**\n * Spacer component that allow users to add a flexibel spacing between components.\n *\n * Supports two props: `growFactor` with default 1 and `minWidth` width default 8 pixels.\n *\n * @public\n */\nexport const Spacer = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'Spacer',\n component: {\n lazy: () => import('./components/Spacer/Spacer').then(m => m.Spacer),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const Divider = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'Divider',\n component: {\n lazy: () => import('./components/Divider/Divider').then(m => m.Divider),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const SupportButton = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'SupportButton',\n component: {\n lazy: () =>\n import('./components/SupportButton/SupportButton').then(\n m => m.SupportButton,\n ),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const NotificationButton = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'NotificationButton',\n component: {\n lazy: () =>\n import('./components/NotificationButton/NotificationButton').then(\n m => m.NotificationButton,\n ),\n },\n }),\n);\n\n/**\n * NotificationBanner\n *\n * @public\n */\nexport const NotificationBanner = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'NotificationBanner',\n component: {\n lazy: () =>\n import('./components/NotificationBanner').then(\n m => m.NotificationBanner,\n ),\n },\n }),\n);\n"],"names":[],"mappings":";;;AA4DO,MAAM,qBAAqB,YAAa,CAAA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AAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,2DAAoD,CAAE,CAAA,IAAA;AAAA,QAC3D,OAAK,CAAE,CAAA;AAAA;AACT;AACJ,GACD;AACH;AAOO,MAAM,qBAAqB,kBAAmB,CAAA,OAAA;AAAA,EACnD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,oBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,wCAAiC,CAAE,CAAA,IAAA;AAAA,QACxC,OAAK,CAAE,CAAA;AAAA;AACT;AACJ,GACD;AACH;;;;"}
package/dist/types.esm.js CHANGED
@@ -1,9 +1,6 @@
1
- var Slot = /* @__PURE__ */ ((Slot2) => {
2
- Slot2["HEADER_START"] = "header-start";
3
- Slot2["HEADER_END"] = "header-end";
4
- return Slot2;
5
- })(Slot || {});
6
1
  var ComponentType = /* @__PURE__ */ ((ComponentType2) => {
2
+ ComponentType2["SPACER"] = "spacer";
3
+ ComponentType2["SUPPORT_BUTTON"] = "support_button";
7
4
  ComponentType2["DROPDOWN_BUTTON"] = "dropdown_button";
8
5
  ComponentType2["ICON_BUTTON"] = "icon_button";
9
6
  ComponentType2["LINK"] = "link";
@@ -13,5 +10,5 @@ var ComponentType = /* @__PURE__ */ ((ComponentType2) => {
13
10
  return ComponentType2;
14
11
  })(ComponentType || {});
15
12
 
16
- export { ComponentType, Slot };
13
+ export { ComponentType };
17
14
  //# sourceMappingURL=types.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.esm.js","sources":["../src/types.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Slot\n *\n * @public\n */\nexport enum Slot {\n /**\n * Positions the global header component at the start of the global header\n */\n HEADER_START = 'header-start',\n /**\n * Positions the global header component at the end of the global header\n */\n HEADER_END = 'header-end',\n}\n\n/**\n * Component\n *\n * @public\n */\nexport enum ComponentType {\n /**\n * Global Header Component dropdown button\n */\n DROPDOWN_BUTTON = 'dropdown_button',\n /**\n * Global Header Component icon button\n */\n ICON_BUTTON = 'icon_button',\n /**\n * Global Header Component link\n */\n LINK = 'link',\n /**\n * Global Header Component list\n */\n LIST = 'list',\n /**\n * Global Header Component search\n */\n SEARCH = 'search',\n /**\n * Global Header Component logout\n */\n LOGOUT = 'logout',\n}\n\n/**\n * Global Header Config\n *\n * @public\n */\nexport interface GlobalHeaderComponentMountPointConfig {\n type: ComponentType;\n key?: string;\n slot?: Slot;\n priority?: number;\n size?: 'small' | 'medium' | 'large';\n}\n\n/**\n * Create Dropdown Config\n *\n * @public\n */\nexport interface CreateDropdownMountPointConfig {\n type: ComponentType;\n priority?: number;\n props?: Record<string, any>;\n}\n/**\n * Profile Dropdown Config\n *\n * @public\n */\nexport interface ProfileDropdownMountPointConfig {\n type: ComponentType;\n priority?: number;\n icon?: string;\n title?: string;\n link?: string;\n props?: Record<string, any>;\n}\n\n/**\n * Global Header Component Mount Point\n *\n * @public\n */\nexport interface GlobalHeaderComponentMountPoint {\n Component: React.ComponentType;\n config?: GlobalHeaderComponentMountPointConfig & {\n props?: Record<string, any>;\n };\n}\n\n/**\n * Create Dropdown Mount Point\n *\n * @public\n */\nexport interface CreateDropdownMountPoint {\n Component: React.ComponentType;\n config?: CreateDropdownMountPointConfig & {\n props?: Record<string, any>;\n };\n}\n\n/**\n * Profile Dropdown Mount Point\n *\n * @public\n */\nexport interface ProfileDropdownMountPoint {\n Component: React.ComponentType;\n config?: ProfileDropdownMountPointConfig & {\n props?: Record<string, any>;\n };\n}\n\n/**\n * ScalprumState\n *\n * @public\n */\nexport interface ScalprumState {\n api?: {\n dynamicRootConfig?: {\n mountPoints?: {\n 'global.header/component': GlobalHeaderComponentMountPoint[];\n 'global.header/create': CreateDropdownMountPoint[];\n 'global.header/profile': ProfileDropdownMountPoint[];\n };\n };\n };\n}\n"],"names":["Slot","ComponentType"],"mappings":"AAqBY,IAAA,IAAA,qBAAAA,KAAL,KAAA;AAIL,EAAAA,MAAA,cAAe,CAAA,GAAA,cAAA;AAIf,EAAAA,MAAA,YAAa,CAAA,GAAA,YAAA;AARH,EAAAA,OAAAA,KAAAA;AAAA,CAAA,EAAA,IAAA,IAAA,EAAA;AAgBA,IAAA,aAAA,qBAAAC,cAAL,KAAA;AAIL,EAAAA,eAAA,iBAAkB,CAAA,GAAA,iBAAA;AAIlB,EAAAA,eAAA,aAAc,CAAA,GAAA,aAAA;AAId,EAAAA,eAAA,MAAO,CAAA,GAAA,MAAA;AAIP,EAAAA,eAAA,MAAO,CAAA,GAAA,MAAA;AAIP,EAAAA,eAAA,QAAS,CAAA,GAAA,QAAA;AAIT,EAAAA,eAAA,QAAS,CAAA,GAAA,QAAA;AAxBC,EAAAA,OAAAA,cAAAA;AAAA,CAAA,EAAA,aAAA,IAAA,EAAA;;;;"}
1
+ {"version":3,"file":"types.esm.js","sources":["../src/types.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Component\n *\n * @public\n */\nexport enum ComponentType {\n /**\n * Global Header spacer\n */\n SPACER = 'spacer',\n /**\n * Global Header support button\n */\n SUPPORT_BUTTON = 'support_button',\n /**\n * Global Header Component dropdown button\n */\n DROPDOWN_BUTTON = 'dropdown_button',\n /**\n * Global Header Component icon button\n */\n ICON_BUTTON = 'icon_button',\n /**\n * Global Header Component link\n */\n LINK = 'link',\n /**\n * Global Header Component list\n */\n LIST = 'list',\n /**\n * Global Header Component search\n */\n SEARCH = 'search',\n /**\n * Global Header Component logout\n */\n LOGOUT = 'logout',\n}\n\n/**\n * Global Header Config\n *\n * @public\n */\nexport interface GlobalHeaderComponentMountPointConfig {\n type?: ComponentType;\n priority?: number;\n}\n\n/**\n * Create Dropdown Config\n *\n * @public\n */\nexport interface CreateDropdownMountPointConfig {\n type: ComponentType;\n priority?: number;\n props?: Record<string, any>;\n}\n/**\n * Profile Dropdown Config\n *\n * @public\n */\nexport interface ProfileDropdownMountPointConfig {\n type: ComponentType;\n priority?: number;\n icon?: string;\n title?: string;\n link?: string;\n props?: Record<string, any>;\n}\n\n/**\n * Global Header Component Mount Point\n *\n * @public\n */\nexport interface GlobalHeaderComponentMountPoint {\n Component: React.ComponentType<{}>;\n config?: GlobalHeaderComponentMountPointConfig & {\n layout?: Record<string, any>;\n props?: Record<string, any>;\n };\n}\n\n/**\n * Create Dropdown Mount Point\n *\n * @public\n */\nexport interface CreateDropdownMountPoint {\n Component: React.ComponentType;\n config?: CreateDropdownMountPointConfig & {\n props?: Record<string, any>;\n };\n}\n\n/**\n * Profile Dropdown Mount Point\n *\n * @public\n */\nexport interface ProfileDropdownMountPoint {\n Component: React.ComponentType;\n config?: ProfileDropdownMountPointConfig & {\n props?: Record<string, any>;\n };\n}\n\n/**\n * ScalprumState\n *\n * @public\n */\nexport interface ScalprumState {\n api?: {\n dynamicRootConfig?: {\n mountPoints?: {\n 'global.header/component': GlobalHeaderComponentMountPoint[];\n 'global.header/create': CreateDropdownMountPoint[];\n 'global.header/profile': ProfileDropdownMountPoint[];\n };\n };\n };\n}\n"],"names":["ComponentType"],"mappings":"AAqBY,IAAA,aAAA,qBAAAA,cAAL,KAAA;AAIL,EAAAA,eAAA,QAAS,CAAA,GAAA,QAAA;AAIT,EAAAA,eAAA,gBAAiB,CAAA,GAAA,gBAAA;AAIjB,EAAAA,eAAA,iBAAkB,CAAA,GAAA,iBAAA;AAIlB,EAAAA,eAAA,aAAc,CAAA,GAAA,aAAA;AAId,EAAAA,eAAA,MAAO,CAAA,GAAA,MAAA;AAIP,EAAAA,eAAA,MAAO,CAAA,GAAA,MAAA;AAIP,EAAAA,eAAA,QAAS,CAAA,GAAA,QAAA;AAIT,EAAAA,eAAA,QAAS,CAAA,GAAA,QAAA;AAhCC,EAAAA,OAAAA,cAAAA;AAAA,CAAA,EAAA,aAAA,IAAA,EAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@red-hat-developer-hub/backstage-plugin-global-header",
3
- "version": "0.0.4",
3
+ "version": "0.1.0",
4
4
  "main": "dist/index.esm.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -37,6 +37,8 @@
37
37
  "@backstage/core-components": "^0.16.3",
38
38
  "@backstage/core-plugin-api": "^1.10.3",
39
39
  "@backstage/plugin-catalog-react": "^1.15.1",
40
+ "@backstage/plugin-notifications": "^0.5.1",
41
+ "@backstage/plugin-notifications-common": "^0.0.8",
40
42
  "@backstage/plugin-search": "^1.4.22",
41
43
  "@backstage/plugin-search-backend": "^1.8.1",
42
44
  "@backstage/plugin-search-backend-module-catalog": "^0.3.0",
@@ -44,6 +46,7 @@
44
46
  "@backstage/plugin-search-backend-module-techdocs": "^0.3.5",
45
47
  "@backstage/plugin-search-common": "^1.2.17",
46
48
  "@backstage/plugin-search-react": "^1.8.5",
49
+ "@backstage/plugin-signals-react": "^0.0.9",
47
50
  "@backstage/theme": "^0.6.3",
48
51
  "@mui/icons-material": "5.16.13",
49
52
  "@mui/material": "5.16.13",
@@ -61,9 +64,11 @@
61
64
  "@backstage/cli": "^0.29.5",
62
65
  "@backstage/core-app-api": "^1.15.4",
63
66
  "@backstage/dev-utils": "^1.1.6",
67
+ "@backstage/frontend-test-utils": "^0.2.5",
64
68
  "@backstage/plugin-search-common": "^1.2.17",
65
69
  "@backstage/test-utils": "^1.7.4",
66
70
  "@openshift/dynamic-plugin-sdk": "^5.0.1",
71
+ "@redhat-developer/red-hat-developer-hub-theme": "^0.5.0",
67
72
  "@testing-library/jest-dom": "^6.0.0",
68
73
  "@testing-library/react": "^14.0.0",
69
74
  "@testing-library/user-event": "^14.0.0",
@@ -1,17 +0,0 @@
1
- import Box from '@mui/material/Box';
2
- import React from 'react';
3
- import HeaderItemContent from '../HeaderLinkComponent/HeaderItemContent.esm.js';
4
-
5
- const HeaderButton = ({ title, icon, onClick }) => {
6
- return /* @__PURE__ */ React.createElement(
7
- Box,
8
- {
9
- onClick,
10
- sx: { cursor: "pointer", width: "100%", color: "inherit" }
11
- },
12
- /* @__PURE__ */ React.createElement(HeaderItemContent, { icon, label: title })
13
- );
14
- };
15
-
16
- export { HeaderButton };
17
- //# sourceMappingURL=HeaderButton.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HeaderButton.esm.js","sources":["../../../src/components/HeaderButtonComponent/HeaderButton.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@mui/material/Box';\nimport React from 'react';\nimport HeaderItemContent from '../HeaderLinkComponent/HeaderItemContent';\n\nexport type HeaderButtonProps = {\n title: string;\n icon: string;\n onClick?: () => void;\n};\n\nexport const HeaderButton = ({ title, icon, onClick }: HeaderButtonProps) => {\n return (\n <Box\n onClick={onClick}\n sx={{ cursor: 'pointer', width: '100%', color: 'inherit' }}\n >\n <HeaderItemContent icon={icon} label={title} />\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;AA0BO,MAAM,eAAe,CAAC,EAAE,KAAO,EAAA,IAAA,EAAM,SAAiC,KAAA;AAC3E,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,OAAA;AAAA,MACA,IAAI,EAAE,MAAA,EAAQ,WAAW,KAAO,EAAA,MAAA,EAAQ,OAAO,SAAU;AAAA,KAAA;AAAA,oBAExD,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAkB,IAAY,EAAA,KAAA,EAAO,KAAO,EAAA;AAAA,GAC/C;AAEJ;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"LogoutButton.esm.js","sources":["../../../src/components/HeaderButtonComponent/LogoutButton.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport {\n errorApiRef,\n identityApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\nimport { HeaderButton } from './HeaderButton';\n\nexport const LogoutButton = () => {\n const errorApi = useApi(errorApiRef);\n const identityApi = useApi(identityApiRef);\n\n const handleLogout = () => {\n identityApi.signOut().catch(error => errorApi.post(error));\n };\n\n return <HeaderButton title=\"Logout\" icon=\"logout\" onClick={handleLogout} />;\n};\n"],"names":[],"mappings":";;;;AAwBO,MAAM,eAAe,MAAM;AAChC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA;AAEzC,EAAA,MAAM,eAAe,MAAM;AACzB,IAAA,WAAA,CAAY,SAAU,CAAA,KAAA,CAAM,WAAS,QAAS,CAAA,IAAA,CAAK,KAAK,CAAC,CAAA;AAAA,GAC3D;AAEA,EAAA,2CAAQ,YAAa,EAAA,EAAA,KAAA,EAAM,UAAS,IAAK,EAAA,QAAA,EAAS,SAAS,YAAc,EAAA,CAAA;AAC3E;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"HeaderIcon.esm.js","sources":["../../../src/components/HeaderIconButtonComponent/HeaderIcon.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { useApp } from '@backstage/core-plugin-api';\nimport MuiIcon from '@mui/material/Icon';\nimport Box from '@mui/material/Box';\n\ninterface HeaderIconProps {\n icon: string;\n styles?: React.CSSProperties;\n}\n\nexport const HeaderIcon = ({ icon, styles }: HeaderIconProps) => {\n const app = useApp();\n if (!icon) {\n return null;\n }\n\n const SystemIcon = app.getSystemIcon(icon);\n\n if (SystemIcon) {\n return (\n <Box sx={{ display: 'flex', alignItems: 'center', ...styles }}>\n <SystemIcon fontSize=\"small\" />\n </Box>\n );\n }\n\n if (icon.startsWith('<svg')) {\n const svgDataUri = `data:image/svg+xml;base64,${btoa(icon)}`;\n return (\n <MuiIcon style={{ fontSize: 20, ...styles }}>\n <img src={svgDataUri} alt=\"\" />\n </MuiIcon>\n );\n }\n\n if (\n icon.startsWith('https://') ||\n icon.startsWith('http://') ||\n icon.startsWith('/')\n ) {\n return (\n <MuiIcon\n style={{ fontSize: 20, ...styles }}\n baseClassName=\"material-icons-outlined\"\n >\n <img src={icon} alt=\"\" />\n </MuiIcon>\n );\n }\n\n return (\n <MuiIcon style={{ fontSize: 20 }} baseClassName=\"material-icons-outlined\">\n {icon}\n </MuiIcon>\n );\n};\n"],"names":[],"mappings":";;;;;AAyBO,MAAM,UAAa,GAAA,CAAC,EAAE,IAAA,EAAM,QAA8B,KAAA;AAC/D,EAAA,MAAM,MAAM,MAAO,EAAA;AACnB,EAAA,IAAI,CAAC,IAAM,EAAA;AACT,IAAO,OAAA,IAAA;AAAA;AAGT,EAAM,MAAA,UAAA,GAAa,GAAI,CAAA,aAAA,CAAc,IAAI,CAAA;AAEzC,EAAA,IAAI,UAAY,EAAA;AACd,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,EAAE,SAAS,MAAQ,EAAA,UAAA,EAAY,QAAU,EAAA,GAAG,QACnD,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,QAAA,EAAS,SAAQ,CAC/B,CAAA;AAAA;AAIJ,EAAI,IAAA,IAAA,CAAK,UAAW,CAAA,MAAM,CAAG,EAAA;AAC3B,IAAA,MAAM,UAAa,GAAA,CAAA,0BAAA,EAA6B,IAAK,CAAA,IAAI,CAAC,CAAA,CAAA;AAC1D,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,KAAO,EAAA,EAAE,UAAU,EAAI,EAAA,GAAG,MAAO,EAAA,EAAA,sCACvC,KAAI,EAAA,EAAA,GAAA,EAAK,UAAY,EAAA,GAAA,EAAI,IAAG,CAC/B,CAAA;AAAA;AAIJ,EACE,IAAA,IAAA,CAAK,UAAW,CAAA,UAAU,CAC1B,IAAA,IAAA,CAAK,UAAW,CAAA,SAAS,CACzB,IAAA,IAAA,CAAK,UAAW,CAAA,GAAG,CACnB,EAAA;AACA,IACE,uBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC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