@red-hat-developer-hub/backstage-plugin-global-header 0.0.3 → 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 (68) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/app-config.dynamic.yaml +54 -2
  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 +6 -77
  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 +39 -67
  12. package/dist/components/HeaderDropdownComponent/CreateDropdown.esm.js.map +1 -1
  13. package/dist/components/HeaderDropdownComponent/HeaderDropdownComponent.esm.js +15 -59
  14. package/dist/components/HeaderDropdownComponent/HeaderDropdownComponent.esm.js.map +1 -1
  15. package/dist/components/HeaderDropdownComponent/MenuSection.esm.js +14 -25
  16. package/dist/components/HeaderDropdownComponent/MenuSection.esm.js.map +1 -1
  17. package/dist/components/HeaderDropdownComponent/ProfileDropdown.esm.js +57 -51
  18. package/dist/components/HeaderDropdownComponent/ProfileDropdown.esm.js.map +1 -1
  19. package/dist/components/HeaderDropdownComponent/RegisterAComponentSection.esm.js +30 -0
  20. package/dist/components/HeaderDropdownComponent/RegisterAComponentSection.esm.js.map +1 -0
  21. package/dist/components/HeaderDropdownComponent/SoftwareTemplatesSection.esm.js +70 -0
  22. package/dist/components/HeaderDropdownComponent/SoftwareTemplatesSection.esm.js.map +1 -0
  23. package/dist/components/HeaderIcon/HeaderIcon.esm.js +38 -0
  24. package/dist/components/HeaderIcon/HeaderIcon.esm.js.map +1 -0
  25. package/dist/components/HeaderIconButton/HeaderIconButton.esm.js +25 -10
  26. package/dist/components/HeaderIconButton/HeaderIconButton.esm.js.map +1 -1
  27. package/dist/components/LogoutButton/LogoutButton.esm.js +23 -0
  28. package/dist/components/LogoutButton/LogoutButton.esm.js.map +1 -0
  29. package/dist/components/MenuItemLink/MenuItemLink.esm.js +29 -0
  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 +38 -8
  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 +14 -0
  48. package/dist/hooks/useCreateDropdownMountPoints.esm.js.map +1 -0
  49. package/dist/hooks/useDropdownManager.esm.js +7 -6
  50. package/dist/hooks/useDropdownManager.esm.js.map +1 -1
  51. package/dist/hooks/useGlobalHeaderMountPoints.esm.js +10 -0
  52. package/dist/hooks/useGlobalHeaderMountPoints.esm.js.map +1 -0
  53. package/dist/hooks/useNotificationCount.esm.js +54 -0
  54. package/dist/hooks/useNotificationCount.esm.js.map +1 -0
  55. package/dist/hooks/useProfileDropdownMountPoints.esm.js +14 -0
  56. package/dist/hooks/useProfileDropdownMountPoints.esm.js.map +1 -0
  57. package/dist/index.d.ts +277 -4
  58. package/dist/index.esm.js +2 -1
  59. package/dist/index.esm.js.map +1 -1
  60. package/dist/plugin.esm.js +142 -1
  61. package/dist/plugin.esm.js.map +1 -1
  62. package/dist/types.esm.js +14 -0
  63. package/dist/types.esm.js.map +1 -0
  64. package/package.json +31 -16
  65. package/dist/components/HeaderDropdownComponent/MenuItemContent.esm.js +0 -15
  66. package/dist/components/HeaderDropdownComponent/MenuItemContent.esm.js.map +0 -1
  67. package/dist/components/HeaderIconButton/SmallIconWrapper.esm.js +0 -11
  68. package/dist/components/HeaderIconButton/SmallIconWrapper.esm.js.map +0 -1
@@ -0,0 +1,14 @@
1
+ import { defaultProfileDropdownMountPoints } from '../defaultMountPoints/defaultMountPoints.esm.js';
2
+ import { useScalprum } from '@scalprum/react-core';
3
+
4
+ const useProfileDropdownMountPoints = () => {
5
+ const scalprum = useScalprum();
6
+ const profileDropdownMountPoints = scalprum?.api?.dynamicRootConfig?.mountPoints?.["global.header/profile"];
7
+ if (Object.keys(scalprum?.api || {}).length === 0) {
8
+ return defaultProfileDropdownMountPoints;
9
+ }
10
+ return profileDropdownMountPoints ?? [];
11
+ };
12
+
13
+ export { useProfileDropdownMountPoints };
14
+ //# sourceMappingURL=useProfileDropdownMountPoints.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useProfileDropdownMountPoints.esm.js","sources":["../../src/hooks/useProfileDropdownMountPoints.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 { defaultProfileDropdownMountPoints } from '../defaultMountPoints/defaultMountPoints';\nimport { ProfileDropdownMountPoint, ScalprumState } from '../types';\nimport { useScalprum } from '@scalprum/react-core';\n\nexport const useProfileDropdownMountPoints = ():\n | ProfileDropdownMountPoint[]\n | undefined => {\n const scalprum = useScalprum<ScalprumState>();\n\n const profileDropdownMountPoints =\n scalprum?.api?.dynamicRootConfig?.mountPoints?.['global.header/profile'];\n\n // default profile dropdown components for dev env\n if (Object.keys(scalprum?.api || {}).length === 0) {\n return defaultProfileDropdownMountPoints;\n }\n\n return profileDropdownMountPoints ?? [];\n};\n"],"names":[],"mappings":";;;AAoBO,MAAM,gCAAgC,MAE5B;AACf,EAAA,MAAM,WAAW,WAA2B,EAAA;AAE5C,EAAA,MAAM,0BACJ,GAAA,QAAA,EAAU,GAAK,EAAA,iBAAA,EAAmB,cAAc,uBAAuB,CAAA;AAGzE,EAAI,IAAA,MAAA,CAAO,KAAK,QAAU,EAAA,GAAA,IAAO,EAAE,CAAA,CAAE,WAAW,CAAG,EAAA;AACjD,IAAO,OAAA,iCAAA;AAAA;AAGT,EAAA,OAAO,8BAA8B,EAAC;AACxC;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import * as react from 'react';
2
+ import React$1 from 'react';
3
3
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
4
4
 
5
5
  /**
@@ -20,6 +20,199 @@ interface NotificationBannerProps {
20
20
  dismiss?: NotificationBannerDismiss;
21
21
  }
22
22
 
23
+ /**
24
+ * @public
25
+ */
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;
52
+ }
53
+
54
+ /**
55
+ * @public
56
+ */
57
+ interface HeaderIconButtonProps {
58
+ title: string;
59
+ icon: string;
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;
66
+ }
67
+
68
+ /**
69
+ * @public
70
+ */
71
+ interface HeaderIconProps {
72
+ icon: string;
73
+ size?: 'small' | 'medium' | 'large';
74
+ styles?: React$1.CSSProperties;
75
+ }
76
+
77
+ /**
78
+ * @public
79
+ */
80
+ interface HeaderButtonProps {
81
+ title: string;
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;
92
+ }
93
+
94
+ /**
95
+ * Component
96
+ *
97
+ * @public
98
+ */
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;
171
+ icon?: string;
172
+ tooltip?: string;
173
+ }
174
+
175
+ /**
176
+ * Software Templates Section properties
177
+ *
178
+ * @public
179
+ */
180
+ type SoftwareTemplatesSectionProps = {
181
+ handleClose: () => void;
182
+ hideDivider?: boolean;
183
+ };
184
+
185
+ /**
186
+ * Register A Component Section properties
187
+ *
188
+ * @public
189
+ */
190
+ type RegisterAComponentSectionProps = {
191
+ hideDivider: boolean;
192
+ handleClose: () => void;
193
+ };
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
+
23
216
  /**
24
217
  * Global Header Plugin
25
218
  *
@@ -31,12 +224,92 @@ declare const globalHeaderPlugin: _backstage_core_plugin_api.BackstagePlugin<{},
31
224
  *
32
225
  * @public
33
226
  */
34
- declare const GlobalHeader: () => react.JSX.Element;
227
+ declare const GlobalHeader: () => React$1.JSX.Element;
228
+ /**
229
+ * Global Header Component
230
+ *
231
+ * @public
232
+ */
233
+ declare const GlobalHeaderComponent: React$1.ComponentType<GlobalHeaderComponentProps>;
234
+ /**
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
248
+ *
249
+ * @public
250
+ */
251
+ declare const SearchComponent: React$1.ComponentType;
252
+ /**
253
+ * Create Dropdown
254
+ *
255
+ * @public
256
+ */
257
+ declare const CreateDropdown: () => React$1.JSX.Element | null;
258
+ /**
259
+ * Profile Dropdown
260
+ *
261
+ * @public
262
+ */
263
+ declare const ProfileDropdown: () => React$1.JSX.Element | null;
264
+ /**
265
+ * Software Templates List
266
+ *
267
+ * @public
268
+ */
269
+ declare const SoftwareTemplatesSection: React$1.ComponentType<SoftwareTemplatesSectionProps>;
270
+ /**
271
+ * Register A Component Link
272
+ *
273
+ * @public
274
+ */
275
+ declare const RegisterAComponentSection: React$1.ComponentType<RegisterAComponentSectionProps>;
276
+ /**
277
+ * Header Link
278
+ *
279
+ * @public
280
+ */
281
+ declare const MenuItemLink: React$1.ComponentType<MenuItemLinkProps>;
282
+ /**
283
+ * Header Logout Button
284
+ *
285
+ * @public
286
+ */
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;
35
308
  /**
36
309
  * NotificationBanner
37
310
  *
38
311
  * @public
39
312
  */
40
- declare const NotificationBanner: (props: NotificationBannerProps) => react.JSX.Element | null;
313
+ declare const NotificationBanner: (props: NotificationBannerProps) => React$1.JSX.Element | null;
41
314
 
42
- export { GlobalHeader, NotificationBanner, type NotificationBannerDismiss, type NotificationBannerProps, 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 { GlobalHeader, NotificationBanner, 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,146 @@ 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
+ );
53
+ const SearchComponent = globalHeaderPlugin.provide(
54
+ createComponentExtension({
55
+ name: "SearchComponent",
56
+ component: {
57
+ lazy: () => import('./components/SearchComponent/SearchComponent.esm.js').then(
58
+ (m) => m.SearchComponent
59
+ )
60
+ }
61
+ })
62
+ );
63
+ const CreateDropdown = globalHeaderPlugin.provide(
64
+ createComponentExtension({
65
+ name: "CreateDropdown",
66
+ component: {
67
+ lazy: () => import('./components/HeaderDropdownComponent/CreateDropdown.esm.js').then(
68
+ (m) => m.CreateDropdown
69
+ )
70
+ }
71
+ })
72
+ );
73
+ const ProfileDropdown = globalHeaderPlugin.provide(
74
+ createComponentExtension({
75
+ name: "ProfileDropdown",
76
+ component: {
77
+ lazy: () => import('./components/HeaderDropdownComponent/ProfileDropdown.esm.js').then(
78
+ (m) => m.ProfileDropdown
79
+ )
80
+ }
81
+ })
82
+ );
83
+ const SoftwareTemplatesSection = globalHeaderPlugin.provide(
84
+ createComponentExtension({
85
+ name: "SoftwareTemplatesSection",
86
+ component: {
87
+ lazy: () => import('./components/HeaderDropdownComponent/SoftwareTemplatesSection.esm.js').then((m) => m.SoftwareTemplatesSection)
88
+ }
89
+ })
90
+ );
91
+ const RegisterAComponentSection = globalHeaderPlugin.provide(
92
+ createComponentExtension({
93
+ name: "RegisterAComponentSection",
94
+ component: {
95
+ lazy: () => import('./components/HeaderDropdownComponent/RegisterAComponentSection.esm.js').then((m) => m.RegisterAComponentSection)
96
+ }
97
+ })
98
+ );
99
+ const MenuItemLink = globalHeaderPlugin.provide(
100
+ createComponentExtension({
101
+ name: "MenuItemLink",
102
+ component: {
103
+ lazy: () => import('./components/MenuItemLink/MenuItemLink.esm.js').then(
104
+ (m) => m.MenuItemLink
105
+ )
106
+ }
107
+ })
108
+ );
109
+ const LogoutButton = globalHeaderPlugin.provide(
110
+ createComponentExtension({
111
+ name: "LogoutButton",
112
+ component: {
113
+ lazy: () => import('./components/LogoutButton/LogoutButton.esm.js').then(
114
+ (m) => m.LogoutButton
115
+ )
116
+ }
117
+ })
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
+ );
14
155
  const NotificationBanner = globalHeaderPlugin.provide(
15
156
  createComponentExtension({
16
157
  name: "NotificationBanner",
@@ -22,5 +163,5 @@ const NotificationBanner = globalHeaderPlugin.provide(
22
163
  })
23
164
  );
24
165
 
25
- export { GlobalHeader, NotificationBanner, globalHeaderPlugin };
166
+ export { CreateDropdown, Divider, GlobalHeader, GlobalHeaderComponent, HeaderButton, HeaderIcon, HeaderIconButton, LogoutButton, MenuItemLink, NotificationBanner, NotificationButton, ProfileDropdown, RegisterAComponentSection, SearchComponent, SoftwareTemplatesSection, Spacer, SupportButton, globalHeaderPlugin };
26
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 {\n createPlugin,\n createComponentExtension,\n} from '@backstage/core-plugin-api';\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 * 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":";;AA+BO,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,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;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,C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AA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,wCAAiC,CAAE,CAAA,IAAA;AAAA,QACxC,OAAK,CAAE,CAAA;AAAA;AACT;AACJ,GACD;AACH;;;;"}
@@ -0,0 +1,14 @@
1
+ var ComponentType = /* @__PURE__ */ ((ComponentType2) => {
2
+ ComponentType2["SPACER"] = "spacer";
3
+ ComponentType2["SUPPORT_BUTTON"] = "support_button";
4
+ ComponentType2["DROPDOWN_BUTTON"] = "dropdown_button";
5
+ ComponentType2["ICON_BUTTON"] = "icon_button";
6
+ ComponentType2["LINK"] = "link";
7
+ ComponentType2["LIST"] = "list";
8
+ ComponentType2["SEARCH"] = "search";
9
+ ComponentType2["LOGOUT"] = "logout";
10
+ return ComponentType2;
11
+ })(ComponentType || {});
12
+
13
+ export { ComponentType };
14
+ //# sourceMappingURL=types.esm.js.map
@@ -0,0 +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 * 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.3",
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",
@@ -33,19 +33,25 @@
33
33
  "postpack": "backstage-cli package postpack"
34
34
  },
35
35
  "dependencies": {
36
- "@backstage/core-components": "^0.15.1",
37
- "@backstage/core-plugin-api": "^1.10.0",
38
- "@backstage/plugin-search": "1.4.18",
39
- "@backstage/plugin-search-backend": "1.6.1",
40
- "@backstage/plugin-search-backend-module-catalog": "^0.2.4",
41
- "@backstage/plugin-search-backend-module-pg": "0.5.37",
42
- "@backstage/plugin-search-backend-module-techdocs": "^0.3.1",
43
- "@backstage/plugin-search-common": "^1.2.15",
44
- "@backstage/plugin-search-react": "^1.8.1",
45
- "@backstage/theme": "^0.6.0",
36
+ "@backstage/catalog-model": "^1.7.3",
37
+ "@backstage/core-components": "^0.16.3",
38
+ "@backstage/core-plugin-api": "^1.10.3",
39
+ "@backstage/plugin-catalog-react": "^1.15.1",
40
+ "@backstage/plugin-notifications": "^0.5.1",
41
+ "@backstage/plugin-notifications-common": "^0.0.8",
42
+ "@backstage/plugin-search": "^1.4.22",
43
+ "@backstage/plugin-search-backend": "^1.8.1",
44
+ "@backstage/plugin-search-backend-module-catalog": "^0.3.0",
45
+ "@backstage/plugin-search-backend-module-pg": "^0.5.40",
46
+ "@backstage/plugin-search-backend-module-techdocs": "^0.3.5",
47
+ "@backstage/plugin-search-common": "^1.2.17",
48
+ "@backstage/plugin-search-react": "^1.8.5",
49
+ "@backstage/plugin-signals-react": "^0.0.9",
50
+ "@backstage/theme": "^0.6.3",
46
51
  "@mui/icons-material": "5.16.13",
47
52
  "@mui/material": "5.16.13",
48
53
  "@mui/styled-engine": "5.16.13",
54
+ "@scalprum/react-core": "0.9.3",
49
55
  "react-dom": "18.3.1",
50
56
  "react-router-dom": "^6.26.2",
51
57
  "react-use": "^17.5.0"
@@ -55,11 +61,14 @@
55
61
  "react-router-dom": "^6.0.0"
56
62
  },
57
63
  "devDependencies": {
58
- "@backstage/cli": "^0.29.0",
59
- "@backstage/core-app-api": "^1.15.2",
60
- "@backstage/dev-utils": "^1.1.4",
61
- "@backstage/plugin-search-common": "^1.2.16",
62
- "@backstage/test-utils": "^1.7.2",
64
+ "@backstage/cli": "^0.29.5",
65
+ "@backstage/core-app-api": "^1.15.4",
66
+ "@backstage/dev-utils": "^1.1.6",
67
+ "@backstage/frontend-test-utils": "^0.2.5",
68
+ "@backstage/plugin-search-common": "^1.2.17",
69
+ "@backstage/test-utils": "^1.7.4",
70
+ "@openshift/dynamic-plugin-sdk": "^5.0.1",
71
+ "@redhat-developer/red-hat-developer-hub-theme": "^0.5.0",
63
72
  "@testing-library/jest-dom": "^6.0.0",
64
73
  "@testing-library/react": "^14.0.0",
65
74
  "@testing-library/user-event": "^14.0.0",
@@ -67,6 +76,12 @@
67
76
  "react": "^16.13.1 || ^17.0.0 || ^18.0.0",
68
77
  "react-router-dom": "^6.0.0"
69
78
  },
79
+ "keywords": [
80
+ "support:tech-preview",
81
+ "lifecycle:active",
82
+ "backstage",
83
+ "plugin"
84
+ ],
70
85
  "files": [
71
86
  "app-config.dynamic.yaml",
72
87
  "dist"
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import Typography from '@mui/material/Typography';
3
- import Box from '@mui/material/Box';
4
- import SmallIconWrapper from '../HeaderIconButton/SmallIconWrapper.esm.js';
5
-
6
- const MenuItemContent = ({ Icon, label, subLabel }) => /* @__PURE__ */ React.createElement(Box, { sx: { display: "flex", alignItems: "center", margin: "8px 0" } }, Icon && /* @__PURE__ */ React.createElement(
7
- SmallIconWrapper,
8
- {
9
- IconComponent: Icon,
10
- sx: { marginRight: "0.5rem", flexShrink: 0 }
11
- }
12
- ), /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, label), subLabel && /* @__PURE__ */ React.createElement(Typography, { variant: "caption", color: "text.secondary" }, subLabel)));
13
-
14
- export { MenuItemContent as default };
15
- //# sourceMappingURL=MenuItemContent.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MenuItemContent.esm.js","sources":["../../../src/components/HeaderDropdownComponent/MenuItemContent.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 Typography from '@mui/material/Typography';\nimport { SvgIconProps } from '@mui/material/SvgIcon';\nimport Box from '@mui/material/Box';\nimport SmallIconWrapper from '../HeaderIconButton/SmallIconWrapper';\n\nconst MenuItemContent: React.FC<{\n Icon?: React.ElementType<SvgIconProps>;\n label: string;\n subLabel?: string;\n}> = ({ Icon, label, subLabel }) => (\n <Box sx={{ display: 'flex', alignItems: 'center', margin: '8px 0' }}>\n {Icon && (\n <SmallIconWrapper\n IconComponent={Icon}\n sx={{ marginRight: '0.5rem', flexShrink: 0 }}\n />\n )}\n <Box>\n <Typography variant=\"body2\">{label}</Typography>\n {subLabel && (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {subLabel}\n </Typography>\n )}\n </Box>\n </Box>\n);\n\nexport default MenuItemContent;\n"],"names":[],"mappings":";;;;;AAsBA,MAAM,kBAID,CAAC,EAAE,MAAM,KAAO,EAAA,QAAA,uBAClB,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,EAAE,SAAS,MAAQ,EAAA,UAAA,EAAY,UAAU,MAAQ,EAAA,OAAA,MACvD,IACC,oBAAA,KAAA,CAAA,aAAA;AAAA,EAAC,gBAAA;AAAA,EAAA;AAAA,IACC,aAAe,EAAA,IAAA;AAAA,IACf,EAAI,EAAA,EAAE,WAAa,EAAA,QAAA,EAAU,YAAY,CAAE;AAAA;AAC7C,CAAA,sCAED,GACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,WAAS,KAAM,CAAA,EAClC,QACC,oBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,OAAQ,EAAA,SAAA,EAAU,OAAM,gBACjC,EAAA,EAAA,QACH,CAEJ,CACF;;;;"}