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

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 (52) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/app-config.dynamic.yaml +71 -0
  3. package/dist/components/GlobalHeader.esm.js +75 -61
  4. package/dist/components/GlobalHeader.esm.js.map +1 -1
  5. package/dist/components/HeaderButtonComponent/HeaderButton.esm.js +17 -0
  6. package/dist/components/HeaderButtonComponent/HeaderButton.esm.js.map +1 -0
  7. package/dist/components/HeaderButtonComponent/LogoutButton.esm.js +15 -0
  8. package/dist/components/HeaderButtonComponent/LogoutButton.esm.js.map +1 -0
  9. package/dist/components/HeaderDropdownComponent/CreateDropdown.esm.js +61 -56
  10. package/dist/components/HeaderDropdownComponent/CreateDropdown.esm.js.map +1 -1
  11. package/dist/components/HeaderDropdownComponent/HeaderDropdownComponent.esm.js +2 -49
  12. package/dist/components/HeaderDropdownComponent/HeaderDropdownComponent.esm.js.map +1 -1
  13. package/dist/components/HeaderDropdownComponent/MenuSection.esm.js +11 -22
  14. package/dist/components/HeaderDropdownComponent/MenuSection.esm.js.map +1 -1
  15. package/dist/components/HeaderDropdownComponent/ProfileDropdown.esm.js +36 -42
  16. package/dist/components/HeaderDropdownComponent/ProfileDropdown.esm.js.map +1 -1
  17. package/dist/components/HeaderDropdownComponent/RegisterAComponentSection.esm.js +29 -0
  18. package/dist/components/HeaderDropdownComponent/RegisterAComponentSection.esm.js.map +1 -0
  19. package/dist/components/HeaderDropdownComponent/SoftwareTemplatesSection.esm.js +23 -0
  20. package/dist/components/HeaderDropdownComponent/SoftwareTemplatesSection.esm.js.map +1 -0
  21. package/dist/components/HeaderIconButtonComponent/HeaderIcon.esm.js +33 -0
  22. package/dist/components/HeaderIconButtonComponent/HeaderIcon.esm.js.map +1 -0
  23. package/dist/components/HeaderIconButtonComponent/HeaderIconButton.esm.js +25 -0
  24. package/dist/components/HeaderIconButtonComponent/HeaderIconButton.esm.js.map +1 -0
  25. package/dist/components/HeaderLinkComponent/HeaderItemContent.esm.js +19 -0
  26. package/dist/components/HeaderLinkComponent/HeaderItemContent.esm.js.map +1 -0
  27. package/dist/components/HeaderLinkComponent/HeaderLink.esm.js +29 -0
  28. package/dist/components/HeaderLinkComponent/HeaderLink.esm.js.map +1 -0
  29. package/dist/components/NotificationBanner.esm.js +66 -0
  30. package/dist/components/NotificationBanner.esm.js.map +1 -0
  31. package/dist/components/SearchComponent/SearchBar.esm.js +1 -1
  32. package/dist/components/SearchComponent/SearchBar.esm.js.map +1 -1
  33. package/dist/hooks/useCreateDropdownMountPoints.esm.js +10 -0
  34. package/dist/hooks/useCreateDropdownMountPoints.esm.js.map +1 -0
  35. package/dist/hooks/useGlobalHeaderMountPoints.esm.js +10 -0
  36. package/dist/hooks/useGlobalHeaderMountPoints.esm.js.map +1 -0
  37. package/dist/hooks/useProfileDropdownMountPoints.esm.js +10 -0
  38. package/dist/hooks/useProfileDropdownMountPoints.esm.js.map +1 -0
  39. package/dist/index.d.ts +155 -5
  40. package/dist/index.esm.js +1 -1
  41. package/dist/index.esm.js.map +1 -1
  42. package/dist/plugin.esm.js +85 -1
  43. package/dist/plugin.esm.js.map +1 -1
  44. package/dist/types.esm.js +17 -0
  45. package/dist/types.esm.js.map +1 -0
  46. package/package.json +27 -16
  47. package/dist/components/HeaderDropdownComponent/MenuItemContent.esm.js +0 -15
  48. package/dist/components/HeaderDropdownComponent/MenuItemContent.esm.js.map +0 -1
  49. package/dist/components/HeaderIconButton/HeaderIconButton.esm.js +0 -22
  50. package/dist/components/HeaderIconButton/HeaderIconButton.esm.js.map +0 -1
  51. package/dist/components/HeaderIconButton/SmallIconWrapper.esm.js +0 -11
  52. package/dist/components/HeaderIconButton/SmallIconWrapper.esm.js.map +0 -1
@@ -0,0 +1,10 @@
1
+ import { useScalprum } from '@scalprum/react-core';
2
+
3
+ const useCreateDropdownMountPoints = () => {
4
+ const scalprum = useScalprum();
5
+ const createDropdownMountPoints = scalprum?.api?.dynamicRootConfig?.mountPoints?.["global.header/create"];
6
+ return createDropdownMountPoints ?? [];
7
+ };
8
+
9
+ export { useCreateDropdownMountPoints };
10
+ //# sourceMappingURL=useCreateDropdownMountPoints.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCreateDropdownMountPoints.esm.js","sources":["../../src/hooks/useCreateDropdownMountPoints.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 { CreateDropdownMountPoint, ScalprumState } from '../types';\nimport { useScalprum } from '@scalprum/react-core';\n\nexport const useCreateDropdownMountPoints = ():\n | CreateDropdownMountPoint[]\n | undefined => {\n const scalprum = useScalprum<ScalprumState>();\n\n const createDropdownMountPoints =\n scalprum?.api?.dynamicRootConfig?.mountPoints?.['global.header/create'];\n\n return createDropdownMountPoints ?? [];\n};\n"],"names":[],"mappings":";;AAmBO,MAAM,+BAA+B,MAE3B;AACf,EAAA,MAAM,WAAW,WAA2B,EAAA;AAE5C,EAAA,MAAM,yBACJ,GAAA,QAAA,EAAU,GAAK,EAAA,iBAAA,EAAmB,cAAc,sBAAsB,CAAA;AAExE,EAAA,OAAO,6BAA6B,EAAC;AACvC;;;;"}
@@ -0,0 +1,10 @@
1
+ import { useScalprum } from '@scalprum/react-core';
2
+
3
+ const useGlobalHeaderMountPoints = () => {
4
+ const scalprum = useScalprum();
5
+ const globalHeaderComponentsMountPoints = scalprum?.api?.dynamicRootConfig?.mountPoints?.["global.header/component"];
6
+ return globalHeaderComponentsMountPoints;
7
+ };
8
+
9
+ export { useGlobalHeaderMountPoints };
10
+ //# sourceMappingURL=useGlobalHeaderMountPoints.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGlobalHeaderMountPoints.esm.js","sources":["../../src/hooks/useGlobalHeaderMountPoints.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 { useScalprum } from '@scalprum/react-core';\nimport { GlobalHeaderComponentMountPoint, ScalprumState } from '../types';\n\nexport const useGlobalHeaderMountPoints = ():\n | GlobalHeaderComponentMountPoint[]\n | undefined => {\n const scalprum = useScalprum<ScalprumState>();\n\n const globalHeaderComponentsMountPoints =\n scalprum?.api?.dynamicRootConfig?.mountPoints?.['global.header/component'];\n\n return globalHeaderComponentsMountPoints;\n};\n"],"names":[],"mappings":";;AAmBO,MAAM,6BAA6B,MAEzB;AACf,EAAA,MAAM,WAAW,WAA2B,EAAA;AAE5C,EAAA,MAAM,iCACJ,GAAA,QAAA,EAAU,GAAK,EAAA,iBAAA,EAAmB,cAAc,yBAAyB,CAAA;AAE3E,EAAO,OAAA,iCAAA;AACT;;;;"}
@@ -0,0 +1,10 @@
1
+ import { useScalprum } from '@scalprum/react-core';
2
+
3
+ const useProfileDropdownMountPoints = () => {
4
+ const scalprum = useScalprum();
5
+ const profileDropdownMountPoints = scalprum?.api?.dynamicRootConfig?.mountPoints?.["global.header/profile"];
6
+ return profileDropdownMountPoints ?? [];
7
+ };
8
+
9
+ export { useProfileDropdownMountPoints };
10
+ //# 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 { 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 return profileDropdownMountPoints ?? [];\n};\n"],"names":[],"mappings":";;AAmBO,MAAM,gCAAgC,MAE5B;AACf,EAAA,MAAM,WAAW,WAA2B,EAAA;AAE5C,EAAA,MAAM,0BACJ,GAAA,QAAA,EAAU,GAAK,EAAA,iBAAA,EAAmB,cAAc,uBAAuB,CAAA;AAEzE,EAAA,OAAO,8BAA8B,EAAC;AACxC;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,16 +1,166 @@
1
- /// <reference types="react" />
2
- import * as react from 'react';
3
1
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
2
+ import React from 'react';
4
3
 
5
4
  /**
6
5
  * @public
6
+ */
7
+ type NotificationBannerDismiss = 'none' | 'session' | 'localstorage';
8
+ /**
9
+ * @public
10
+ */
11
+ interface NotificationBannerProps {
12
+ id?: string;
13
+ title: string;
14
+ markdown?: boolean;
15
+ textColor?: string;
16
+ backgroundColor?: string;
17
+ border?: string;
18
+ borderRadius?: string;
19
+ dismiss?: NotificationBannerDismiss;
20
+ }
21
+
22
+ /**
23
+ * @public
24
+ * Create button properties
25
+ */
26
+ interface CreateButtonProps {
27
+ handleMenu: (event: React.MouseEvent<HTMLElement>) => void;
28
+ anchorEl: HTMLElement | null;
29
+ setAnchorEl: React.Dispatch<React.SetStateAction<HTMLElement | null>>;
30
+ }
31
+
32
+ /**
33
+ * Header Icon Button properties
34
+ * @public
35
+ */
36
+ interface HeaderIconButtonProps {
37
+ icon: string;
38
+ to?: string;
39
+ tooltip?: string;
40
+ }
41
+
42
+ /**
43
+ * @public
44
+ * ProfileDropdown component properties
45
+ */
46
+ interface ProfileDropdownProps {
47
+ handleMenu: (event: React.MouseEvent<HTMLElement>) => void;
48
+ anchorEl: HTMLElement | null;
49
+ setAnchorEl: React.Dispatch<React.SetStateAction<HTMLElement | null>>;
50
+ }
51
+
52
+ /**
53
+ * Header Icon Button properties
54
+ * @public
55
+ */
56
+ interface HeaderLinkProps {
57
+ to: string;
58
+ title?: string;
59
+ subTitle?: string;
60
+ icon?: string;
61
+ tooltip?: string;
62
+ }
63
+
64
+ /**
65
+ * Menu item configuration
66
+ *
67
+ * @public
68
+ */
69
+ interface MenuItemConfig {
70
+ Component: React.ComponentType<HeaderLinkProps | {}>;
71
+ type: string;
72
+ label: string;
73
+ icon?: string;
74
+ subLabel?: string;
75
+ link?: string;
76
+ }
77
+
78
+ /**
79
+ * Software Templates Section properties
80
+ *
81
+ * @public
82
+ */
83
+ type SoftwareTemplatesSectionProps = {
84
+ items: MenuItemConfig[];
85
+ handleClose: () => void;
86
+ hideDivider?: boolean;
87
+ };
88
+
89
+ /**
90
+ * Register A Component Section properties
91
+ *
92
+ * @public
93
+ */
94
+ type RegisterAComponentSectionProps = {
95
+ hideDivider: boolean;
96
+ handleClose: () => void;
97
+ };
98
+
99
+ /**
7
100
  * Global Header Plugin
101
+ *
102
+ * @public
8
103
  */
9
104
  declare const globalHeaderPlugin: _backstage_core_plugin_api.BackstagePlugin<{}, {}, {}>;
10
105
  /**
11
- * @public
12
106
  * Global Header
107
+ *
108
+ * @public
109
+ */
110
+ declare const GlobalHeader: () => React.JSX.Element;
111
+ /**
112
+ * Search Component
113
+ *
114
+ * @public
115
+ */
116
+ declare const SearchComponent: React.ComponentType;
117
+ /**
118
+ * Create Dropdown
119
+ *
120
+ * @public
121
+ */
122
+ declare const CreateDropdown: React.ComponentType<CreateButtonProps>;
123
+ /**
124
+ * Header Icon Button
125
+ *
126
+ * @public
127
+ */
128
+ declare const HeaderIconButton: React.ComponentType<HeaderIconButtonProps>;
129
+ /**
130
+ * Profile Dropdown
131
+ *
132
+ * @public
133
+ */
134
+ declare const ProfileDropdown: React.ComponentType<ProfileDropdownProps>;
135
+ /**
136
+ * Software Templates List
137
+ *
138
+ * @public
139
+ */
140
+ declare const SoftwareTemplatesSection: React.ComponentType<SoftwareTemplatesSectionProps>;
141
+ /**
142
+ * Register A Component Link
143
+ *
144
+ * @public
145
+ */
146
+ declare const RegisterAComponentSection: React.ComponentType<RegisterAComponentSectionProps>;
147
+ /**
148
+ * Header Link
149
+ *
150
+ * @public
151
+ */
152
+ declare const HeaderLink: React.ComponentType<HeaderLinkProps>;
153
+ /**
154
+ * Header Logout Button
155
+ *
156
+ * @public
157
+ */
158
+ declare const LogoutButton: React.ComponentType;
159
+ /**
160
+ * NotificationBanner
161
+ *
162
+ * @public
13
163
  */
14
- declare const GlobalHeader: () => react.JSX.Element;
164
+ declare const NotificationBanner: (props: NotificationBannerProps) => React.JSX.Element | null;
15
165
 
16
- export { GlobalHeader, globalHeaderPlugin };
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 };
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { unstable_ClassNameGenerator } from '@mui/material/className';
2
- export { GlobalHeader, globalHeaderPlugin } from './plugin.esm.js';
2
+ export { CreateDropdown, GlobalHeader, HeaderIconButton, HeaderLink, LogoutButton, NotificationBanner, ProfileDropdown, RegisterAComponentSection, SearchComponent, SoftwareTemplatesSection, globalHeaderPlugin } from './plugin.esm.js';
3
3
 
4
4
  unstable_ClassNameGenerator.configure((componentName) => {
5
5
  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 { globalHeaderPlugin, GlobalHeader } 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"}
@@ -11,6 +11,90 @@ const GlobalHeader = globalHeaderPlugin.provide(
11
11
  }
12
12
  })
13
13
  );
14
+ const SearchComponent = globalHeaderPlugin.provide(
15
+ createComponentExtension({
16
+ name: "SearchComponent",
17
+ component: {
18
+ lazy: () => import('./components/SearchComponent/SearchComponent.esm.js').then(
19
+ (m) => m.SearchComponent
20
+ )
21
+ }
22
+ })
23
+ );
24
+ const CreateDropdown = globalHeaderPlugin.provide(
25
+ createComponentExtension({
26
+ name: "CreateDropdown",
27
+ component: {
28
+ lazy: () => import('./components/HeaderDropdownComponent/CreateDropdown.esm.js').then(
29
+ (m) => m.CreateDropdown
30
+ )
31
+ }
32
+ })
33
+ );
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
+ const ProfileDropdown = globalHeaderPlugin.provide(
43
+ createComponentExtension({
44
+ name: "ProfileDropdown",
45
+ component: {
46
+ lazy: () => import('./components/HeaderDropdownComponent/ProfileDropdown.esm.js').then(
47
+ (m) => m.ProfileDropdown
48
+ )
49
+ }
50
+ })
51
+ );
52
+ const SoftwareTemplatesSection = globalHeaderPlugin.provide(
53
+ createComponentExtension({
54
+ name: "SoftwareTemplatesSection",
55
+ component: {
56
+ lazy: () => import('./components/HeaderDropdownComponent/SoftwareTemplatesSection.esm.js').then((m) => m.SoftwareTemplatesSection)
57
+ }
58
+ })
59
+ );
60
+ const RegisterAComponentSection = globalHeaderPlugin.provide(
61
+ createComponentExtension({
62
+ name: "RegisterAComponentSection",
63
+ component: {
64
+ lazy: () => import('./components/HeaderDropdownComponent/RegisterAComponentSection.esm.js').then((m) => m.RegisterAComponentSection)
65
+ }
66
+ })
67
+ );
68
+ const HeaderLink = globalHeaderPlugin.provide(
69
+ createComponentExtension({
70
+ name: "HeaderLink",
71
+ component: {
72
+ lazy: () => import('./components/HeaderLinkComponent/HeaderLink.esm.js').then(
73
+ (m) => m.HeaderLink
74
+ )
75
+ }
76
+ })
77
+ );
78
+ const LogoutButton = globalHeaderPlugin.provide(
79
+ createComponentExtension({
80
+ name: "LogoutButton",
81
+ component: {
82
+ lazy: () => import('./components/HeaderButtonComponent/LogoutButton.esm.js').then(
83
+ (m) => m.LogoutButton
84
+ )
85
+ }
86
+ })
87
+ );
88
+ const NotificationBanner = globalHeaderPlugin.provide(
89
+ createComponentExtension({
90
+ name: "NotificationBanner",
91
+ component: {
92
+ lazy: () => import('./components/NotificationBanner.esm.js').then(
93
+ (m) => m.NotificationBanner
94
+ )
95
+ }
96
+ })
97
+ );
14
98
 
15
- export { GlobalHeader, globalHeaderPlugin };
99
+ export { CreateDropdown, GlobalHeader, HeaderIconButton, HeaderLink, LogoutButton, NotificationBanner, ProfileDropdown, RegisterAComponentSection, SearchComponent, SoftwareTemplatesSection, globalHeaderPlugin };
16
100
  //# 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\n/**\n * @public\n * Global Header Plugin\n */\nexport const globalHeaderPlugin = createPlugin({\n id: 'global-header',\n});\n\n/**\n * @public\n * Global Header\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"],"names":[],"mappings":";;AAyBO,MAAM,qBAAqB,YAAa,CAAA;AAAA,EAC7C,EAAI,EAAA;AACN,CAAC;AAMM,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;;;;"}
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":"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"}
@@ -0,0 +1,17 @@
1
+ var Slot = /* @__PURE__ */ ((Slot2) => {
2
+ Slot2["HEADER_START"] = "header-start";
3
+ Slot2["HEADER_END"] = "header-end";
4
+ return Slot2;
5
+ })(Slot || {});
6
+ var ComponentType = /* @__PURE__ */ ((ComponentType2) => {
7
+ ComponentType2["DROPDOWN_BUTTON"] = "dropdown_button";
8
+ ComponentType2["ICON_BUTTON"] = "icon_button";
9
+ ComponentType2["LINK"] = "link";
10
+ ComponentType2["LIST"] = "list";
11
+ ComponentType2["SEARCH"] = "search";
12
+ ComponentType2["LOGOUT"] = "logout";
13
+ return ComponentType2;
14
+ })(ComponentType || {});
15
+
16
+ export { ComponentType, Slot };
17
+ //# 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 * 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;;;;"}
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.2",
3
+ "version": "0.0.4",
4
4
  "main": "dist/index.esm.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -33,19 +33,22 @@
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-search": "^1.4.22",
41
+ "@backstage/plugin-search-backend": "^1.8.1",
42
+ "@backstage/plugin-search-backend-module-catalog": "^0.3.0",
43
+ "@backstage/plugin-search-backend-module-pg": "^0.5.40",
44
+ "@backstage/plugin-search-backend-module-techdocs": "^0.3.5",
45
+ "@backstage/plugin-search-common": "^1.2.17",
46
+ "@backstage/plugin-search-react": "^1.8.5",
47
+ "@backstage/theme": "^0.6.3",
46
48
  "@mui/icons-material": "5.16.13",
47
49
  "@mui/material": "5.16.13",
48
50
  "@mui/styled-engine": "5.16.13",
51
+ "@scalprum/react-core": "0.9.3",
49
52
  "react-dom": "18.3.1",
50
53
  "react-router-dom": "^6.26.2",
51
54
  "react-use": "^17.5.0"
@@ -55,11 +58,12 @@
55
58
  "react-router-dom": "^6.0.0"
56
59
  },
57
60
  "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",
61
+ "@backstage/cli": "^0.29.5",
62
+ "@backstage/core-app-api": "^1.15.4",
63
+ "@backstage/dev-utils": "^1.1.6",
64
+ "@backstage/plugin-search-common": "^1.2.17",
65
+ "@backstage/test-utils": "^1.7.4",
66
+ "@openshift/dynamic-plugin-sdk": "^5.0.1",
63
67
  "@testing-library/jest-dom": "^6.0.0",
64
68
  "@testing-library/react": "^14.0.0",
65
69
  "@testing-library/user-event": "^14.0.0",
@@ -67,7 +71,14 @@
67
71
  "react": "^16.13.1 || ^17.0.0 || ^18.0.0",
68
72
  "react-router-dom": "^6.0.0"
69
73
  },
74
+ "keywords": [
75
+ "support:tech-preview",
76
+ "lifecycle:active",
77
+ "backstage",
78
+ "plugin"
79
+ ],
70
80
  "files": [
81
+ "app-config.dynamic.yaml",
71
82
  "dist"
72
83
  ],
73
84
  "typesVersions": {
@@ -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;;;;"}
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import IconButton from '@mui/material/IconButton';
3
- import SmallIconWrapper from './SmallIconWrapper.esm.js';
4
-
5
- const HeaderIconButton = ({
6
- Icon,
7
- onClick
8
- }) => {
9
- return /* @__PURE__ */ React.createElement(
10
- IconButton,
11
- {
12
- color: "inherit",
13
- "aria-label": "help",
14
- sx: { mr: 1.5 },
15
- onClick
16
- },
17
- /* @__PURE__ */ React.createElement(SmallIconWrapper, { IconComponent: Icon })
18
- );
19
- };
20
-
21
- export { HeaderIconButton };
22
- //# sourceMappingURL=HeaderIconButton.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HeaderIconButton.esm.js","sources":["../../../src/components/HeaderIconButton/HeaderIconButton.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 IconButton from '@mui/material/IconButton';\nimport SmallIconWrapper, { IconComponentType } from './SmallIconWrapper';\n\ninterface HeaderIconButtonProps {\n Icon: IconComponentType;\n onClick: () => void;\n}\n\nexport const HeaderIconButton: React.FC<HeaderIconButtonProps> = ({\n Icon,\n onClick,\n}) => {\n return (\n <IconButton\n color=\"inherit\"\n aria-label=\"help\"\n sx={{ mr: 1.5 }}\n onClick={onClick}\n >\n <SmallIconWrapper IconComponent={Icon} />\n </IconButton>\n );\n};\n"],"names":[],"mappings":";;;;AAyBO,MAAM,mBAAoD,CAAC;AAAA,EAChE,IAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,SAAA;AAAA,MACN,YAAW,EAAA,MAAA;AAAA,MACX,EAAA,EAAI,EAAE,EAAA,EAAI,GAAI,EAAA;AAAA,MACd;AAAA,KAAA;AAAA,oBAEA,KAAA,CAAA,aAAA,CAAC,gBAAiB,EAAA,EAAA,aAAA,EAAe,IAAM,EAAA;AAAA,GACzC;AAEJ;;;;"}
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
-
3
- const SmallIconWrapper = ({
4
- IconComponent,
5
- ...props
6
- }) => {
7
- return /* @__PURE__ */ React.createElement(IconComponent, { fontSize: "small", ...props });
8
- };
9
-
10
- export { SmallIconWrapper as default };
11
- //# sourceMappingURL=SmallIconWrapper.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SmallIconWrapper.esm.js","sources":["../../../src/components/HeaderIconButton/SmallIconWrapper.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 { SvgIconProps } from '@mui/material/SvgIcon';\n\nexport type IconComponentType = React.ElementType<SvgIconProps>;\n\ninterface SmallIconWrapperProps extends SvgIconProps {\n IconComponent: IconComponentType;\n}\n\nconst SmallIconWrapper: React.FC<SmallIconWrapperProps> = ({\n IconComponent,\n ...props\n}) => {\n return <IconComponent fontSize=\"small\" {...props} />;\n};\n\nexport default SmallIconWrapper;\n"],"names":[],"mappings":";;AAyBA,MAAM,mBAAoD,CAAC;AAAA,EACzD,aAAA;AAAA,EACA,GAAG;AACL,CAAM,KAAA;AACJ,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,EAAc,QAAS,EAAA,OAAA,EAAS,GAAG,KAAO,EAAA,CAAA;AACpD;;;;"}