@red-hat-developer-hub/backstage-plugin-global-header 0.0.4 → 0.2.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 (75) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/app-config.dynamic.yaml +31 -38
  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 +26 -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 +22 -56
  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 +5 -14
  16. package/dist/components/HeaderDropdownComponent/MenuSection.esm.js.map +1 -1
  17. package/dist/components/HeaderDropdownComponent/ProfileDropdown.esm.js +47 -26
  18. package/dist/components/HeaderDropdownComponent/ProfileDropdown.esm.js.map +1 -1
  19. package/dist/components/HeaderDropdownComponent/RegisterAComponentSection.esm.js +4 -5
  20. package/dist/components/HeaderDropdownComponent/RegisterAComponentSection.esm.js.map +1 -1
  21. package/dist/components/HeaderDropdownComponent/SoftwareTemplatesSection.esm.js +48 -3
  22. package/dist/components/HeaderDropdownComponent/SoftwareTemplatesSection.esm.js.map +1 -1
  23. package/dist/components/{HeaderIconButtonComponent → HeaderIcon}/HeaderIcon.esm.js +19 -6
  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 +38 -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/SearchComponent.esm.js +1 -2
  38. package/dist/components/SearchComponent/SearchComponent.esm.js.map +1 -1
  39. package/dist/components/SearchComponent/SearchInput.esm.js +0 -1
  40. package/dist/components/SearchComponent/SearchInput.esm.js.map +1 -1
  41. package/dist/components/SearchComponent/SearchOption.esm.js +1 -1
  42. package/dist/components/SearchComponent/SearchOption.esm.js.map +1 -1
  43. package/dist/components/SearchComponent/SearchResultItem.esm.js +13 -1
  44. package/dist/components/SearchComponent/SearchResultItem.esm.js.map +1 -1
  45. package/dist/components/Spacer/Spacer.esm.js +21 -0
  46. package/dist/components/Spacer/Spacer.esm.js.map +1 -0
  47. package/dist/components/SupportButton/SupportButton.esm.js +45 -0
  48. package/dist/components/SupportButton/SupportButton.esm.js.map +1 -0
  49. package/dist/defaultMountPoints/defaultMountPoints.esm.js +107 -0
  50. package/dist/defaultMountPoints/defaultMountPoints.esm.js.map +1 -0
  51. package/dist/hooks/useCreateDropdownMountPoints.esm.js +4 -0
  52. package/dist/hooks/useCreateDropdownMountPoints.esm.js.map +1 -1
  53. package/dist/hooks/useDropdownManager.esm.js +7 -6
  54. package/dist/hooks/useDropdownManager.esm.js.map +1 -1
  55. package/dist/hooks/useNotificationCount.esm.js +51 -0
  56. package/dist/hooks/useNotificationCount.esm.js.map +1 -0
  57. package/dist/hooks/useProfileDropdownMountPoints.esm.js +4 -0
  58. package/dist/hooks/useProfileDropdownMountPoints.esm.js.map +1 -1
  59. package/dist/index.d.ts +177 -41
  60. package/dist/index.esm.js +2 -1
  61. package/dist/index.esm.js.map +1 -1
  62. package/dist/plugin.esm.js +109 -14
  63. package/dist/plugin.esm.js.map +1 -1
  64. package/package.json +6 -1
  65. package/dist/components/HeaderButtonComponent/HeaderButton.esm.js +0 -17
  66. package/dist/components/HeaderButtonComponent/HeaderButton.esm.js.map +0 -1
  67. package/dist/components/HeaderButtonComponent/LogoutButton.esm.js.map +0 -1
  68. package/dist/components/HeaderIconButtonComponent/HeaderIcon.esm.js.map +0 -1
  69. package/dist/components/HeaderIconButtonComponent/HeaderIconButton.esm.js +0 -25
  70. package/dist/components/HeaderIconButtonComponent/HeaderIconButton.esm.js.map +0 -1
  71. package/dist/components/HeaderLinkComponent/HeaderItemContent.esm.js +0 -19
  72. package/dist/components/HeaderLinkComponent/HeaderItemContent.esm.js.map +0 -1
  73. package/dist/components/HeaderLinkComponent/HeaderLink.esm.js.map +0 -1
  74. package/dist/types.esm.js +0 -17
  75. package/dist/types.esm.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MenuSection.esm.js","sources":["../../../src/components/HeaderDropdownComponent/MenuSection.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 Divider from '@mui/material/Divider';\nimport Box from '@mui/material/Box';\nimport Typography from '@mui/material/Typography';\nimport MenuItem from '@mui/material/MenuItem';\nimport { Link } from '@backstage/core-components';\nimport { HeaderLinkProps } from '../HeaderLinkComponent/HeaderLink';\n\n/**\n * Menu item configuration\n *\n * @public\n */\nexport interface MenuItemConfig {\n Component: React.ComponentType<HeaderLinkProps | {}>;\n type: string;\n label: string;\n icon?: string;\n subLabel?: string;\n link?: string;\n}\n\nexport interface MenuSectionConfig {\n sectionLabel?: string;\n optionalLink?: string;\n optionalLinkLabel?: string;\n items: MenuItemConfig[];\n hideDivider?: boolean;\n handleClose: () => void;\n}\n\nconst MenuSection: React.FC<MenuSectionConfig> = ({\n sectionLabel,\n optionalLink,\n optionalLinkLabel,\n items,\n hideDivider = false,\n handleClose,\n}) => (\n <Box>\n {sectionLabel && (\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n mx: 0,\n mt: '0.5rem',\n '&:hover': { background: 'transparent' },\n }}\n >\n <Typography variant=\"body2\" sx={{ pl: 2, color: 'text.disabled' }}>\n {sectionLabel}\n </Typography>\n <MenuItem\n sx={{\n '&:hover': { background: 'transparent' },\n }}\n disableRipple\n disableTouchRipple\n onClick={handleClose}\n >\n {optionalLink && optionalLinkLabel && (\n <Link\n to={optionalLink}\n underline=\"none\"\n style={{ fontSize: '0.875em' }}\n >\n {optionalLinkLabel}\n </Link>\n )}\n </MenuItem>\n </Box>\n )}\n <ul style={{ padding: 0, listStyle: 'none' }}>\n {items.map(({ type, icon, label, subLabel, link, Component }, index) => (\n <MenuItem\n key={`menu-item-${index.toString()}`}\n disableRipple\n disableTouchRipple\n onClick={handleClose}\n sx={{ py: 0.5, '&:hover': { background: 'transparent' } }}\n >\n {link && (\n <Component\n icon={icon}\n to={link}\n title={label}\n subTitle={subLabel}\n />\n )}\n {type === 'logout' && <Component />}\n </MenuItem>\n ))}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AAA,CAAA,aAAA,CAAC,QAAG,KAAO,EAAA,EAAE,SAAS,CAAG,EAAA,SAAA,EAAW,QACjC,EAAA,EAAA,KAAA,CAAM,IAAI,CAAC,EAAE,MAAM,IAAM,EAAA,KAAA,EAAO,UAAU,IAAM,EAAA,SAAA,IAAa,KAC5D,qBAAA,KAAA,CAAA,aAAA;AAAA,EAAC,QAAA;AAAA,EAAA;AAAA,IACC,GAAK,EAAA,CAAA,UAAA,EAAa,KAAM,CAAA,QAAA,EAAU,CAAA,CAAA;AAAA,IAClC,aAAa,EAAA,IAAA;AAAA,IACb,kBAAkB,EAAA,IAAA;AAAA,IAClB,OAAS,EAAA,WAAA;AAAA,IACT,EAAA,EAAI,EAAE,EAAI,EAAA,GAAA,EAAK,WAAW,EAAE,UAAA,EAAY,eAAgB;AAAA,GAAA;AAAA,EAEvD,IACC,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,EAAI,EAAA,IAAA;AAAA,MACJ,KAAO,EAAA,KAAA;AAAA,MACP,QAAU,EAAA;AAAA;AAAA,GACZ;AAAA,EAED,IAAA,KAAS,QAAY,oBAAA,KAAA,CAAA,aAAA,CAAC,SAAU,EAAA,IAAA;AACnC,CACD,CACH,CACC,EAAA,CAAC,WAAe,oBAAA,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,EAAA,EAAA,EAAI,EAAE,MAAA,EAAQ,OAAQ,EAAA,EAAG,CACrD;;;;"}
1
+ {"version":3,"file":"MenuSection.esm.js","sources":["../../../src/components/HeaderDropdownComponent/MenuSection.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 Divider from '@mui/material/Divider';\nimport Box from '@mui/material/Box';\nimport Typography from '@mui/material/Typography';\nimport MenuItem from '@mui/material/MenuItem';\nimport { Link } from '@backstage/core-components';\nimport { MenuItemLinkProps } from '../MenuItemLink/MenuItemLink';\n\n/**\n * Menu item configuration\n *\n * @public\n */\nexport interface MenuItemConfig {\n Component: React.ComponentType<MenuItemLinkProps | {}>;\n label: string;\n icon?: string;\n subLabel?: string;\n link?: string;\n}\n\nexport interface MenuSectionConfig {\n sectionLabel?: string;\n optionalLink?: string;\n optionalLinkLabel?: string;\n items: MenuItemConfig[];\n hideDivider?: boolean;\n handleClose: () => void;\n}\n\nexport const MenuSection: React.FC<MenuSectionConfig> = ({\n sectionLabel,\n optionalLink,\n optionalLinkLabel,\n items,\n hideDivider = false,\n handleClose,\n}) => (\n <Box>\n {sectionLabel && (\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n mx: 0,\n mt: '0.5rem',\n '&:hover': { background: 'transparent' },\n }}\n >\n <Typography variant=\"body2\" sx={{ pl: 2, color: 'text.disabled' }}>\n {sectionLabel}\n </Typography>\n <MenuItem\n sx={{\n '&:hover': { background: 'transparent' },\n }}\n disableRipple\n disableTouchRipple\n onClick={handleClose}\n >\n {optionalLink && optionalLinkLabel && items.length > 0 && (\n <Link\n to={optionalLink}\n underline=\"none\"\n style={{ fontSize: '0.875em' }}\n >\n {optionalLinkLabel}\n </Link>\n )}\n </MenuItem>\n </Box>\n )}\n <ul style={{ padding: 0, listStyle: 'none' }}>\n {items.map(({ icon, label, subLabel, link, Component }, index) => (\n <MenuItem\n key={`menu-item-${index.toString()}`}\n disableRipple\n disableTouchRipple\n onClick={handleClose}\n sx={{ py: 0.5, '&:hover': { background: 'transparent' } }}\n >\n <Component icon={icon} to={link!} title={label} subTitle={subLabel} />\n </MenuItem>\n ))}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AACH;AAGN,CAAA,sCAED,IAAG,EAAA,EAAA,KAAA,EAAO,EAAE,OAAS,EAAA,CAAA,EAAG,WAAW,MAAO,EAAA,EAAA,EACxC,MAAM,GAAI,CAAA,CAAC,EAAE,IAAM,EAAA,KAAA,EAAO,UAAU,IAAM,EAAA,SAAA,IAAa,KACtD,qBAAA,KAAA,CAAA,aAAA;AAAA,EAAC,QAAA;AAAA,EAAA;AAAA,IACC,GAAK,EAAA,CAAA,UAAA,EAAa,KAAM,CAAA,QAAA,EAAU,CAAA,CAAA;AAAA,IAClC,aAAa,EAAA,IAAA;AAAA,IACb,kBAAkB,EAAA,IAAA;AAAA,IAClB,OAAS,EAAA,WAAA;AAAA,IACT,EAAA,EAAI,EAAE,EAAI,EAAA,GAAA,EAAK,WAAW,EAAE,UAAA,EAAY,eAAgB;AAAA,GAAA;AAAA,kBAExD,KAAA,CAAA,aAAA,CAAC,aAAU,IAAY,EAAA,EAAA,EAAI,MAAO,KAAO,EAAA,KAAA,EAAO,UAAU,QAAU,EAAA;AACtE,CACD,CACH,CACC,EAAA,CAAC,WAAe,oBAAA,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,EAAA,EAAA,EAAI,EAAE,EAAA,EAAI,GAAI,EAAA,EAAG,CAC7C;;;;"}
@@ -1,21 +1,37 @@
1
- import React, { useState, useEffect, useMemo } from 'react';
2
- import HeaderDropdownComponent from './HeaderDropdownComponent.esm.js';
1
+ import React, { useState, useRef, useEffect, useMemo } from 'react';
2
+ import { useApi, identityApiRef } from '@backstage/core-plugin-api';
3
3
  import AccountCircleOutlinedIcon from '@mui/icons-material/AccountCircleOutlined';
4
4
  import KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined';
5
5
  import Typography from '@mui/material/Typography';
6
- import { useApi, identityApiRef } from '@backstage/core-plugin-api';
6
+ import { lighten } from '@mui/material/styles';
7
+ import { HeaderDropdownComponent } from './HeaderDropdownComponent.esm.js';
7
8
  import { useProfileDropdownMountPoints } from '../../hooks/useProfileDropdownMountPoints.esm.js';
8
- import { ComponentType } from '../../types.esm.js';
9
- import MenuSection from './MenuSection.esm.js';
9
+ import { MenuSection } from './MenuSection.esm.js';
10
+ import { useDropdownManager } from '../../hooks/useDropdownManager.esm.js';
11
+ import Box from '@mui/material/Box';
10
12
 
11
- const ProfileDropdown = ({
12
- handleMenu,
13
- anchorEl,
14
- setAnchorEl
15
- }) => {
13
+ const ProfileDropdown = ({ layout }) => {
14
+ const { anchorEl, handleOpen, handleClose } = useDropdownManager();
16
15
  const identityApi = useApi(identityApiRef);
17
16
  const [user, setUser] = useState();
18
17
  const profileDropdownMountPoints = useProfileDropdownMountPoints();
18
+ const headerRef = useRef(null);
19
+ const [bgColor, setBgColor] = useState("#3C3F42");
20
+ useEffect(() => {
21
+ if (headerRef.current) {
22
+ const computedStyle = window.getComputedStyle(headerRef.current);
23
+ const baseColor = computedStyle.backgroundColor;
24
+ setBgColor(lighten(baseColor, 0.2));
25
+ }
26
+ }, []);
27
+ useEffect(() => {
28
+ const container = document.getElementById("global-header");
29
+ if (container) {
30
+ const computedStyle = window.getComputedStyle(container);
31
+ const baseColor = computedStyle.backgroundColor;
32
+ setBgColor(lighten(baseColor, 0.2));
33
+ }
34
+ }, []);
19
35
  useEffect(() => {
20
36
  const fetchUser = async () => {
21
37
  const userProfile = await identityApi.getProfileInfo();
@@ -26,22 +42,34 @@ const ProfileDropdown = ({
26
42
  const menuItems = useMemo(() => {
27
43
  return (profileDropdownMountPoints ?? []).map((mp) => ({
28
44
  Component: mp.Component,
29
- type: mp.config?.type ?? ComponentType.LINK,
30
45
  icon: mp.config?.props?.icon ?? "",
31
46
  label: mp.config?.props?.title ?? "",
32
47
  link: mp.config?.props?.link ?? "",
33
48
  priority: mp.config?.priority ?? 0
34
49
  })).sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
35
50
  }, [profileDropdownMountPoints]);
51
+ if (menuItems.length === 0) {
52
+ return null;
53
+ }
36
54
  return /* @__PURE__ */ React.createElement(
37
55
  HeaderDropdownComponent,
38
56
  {
39
- buttonContent: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(AccountCircleOutlinedIcon, { fontSize: "small", sx: { mx: 1 } }), /* @__PURE__ */ React.createElement(Typography, { variant: "body2", sx: { fontWeight: 500, mx: 1 } }, user?.displayName ?? "Guest"), /* @__PURE__ */ React.createElement(
57
+ buttonContent: /* @__PURE__ */ React.createElement(Box, { sx: { display: "flex", alignItems: "center", ...layout } }, /* @__PURE__ */ React.createElement(AccountCircleOutlinedIcon, { fontSize: "small", sx: { mr: 1 } }), /* @__PURE__ */ React.createElement(
58
+ Typography,
59
+ {
60
+ variant: "body2",
61
+ sx: {
62
+ display: { xs: "none", md: "block" },
63
+ fontWeight: 500,
64
+ mr: "1rem"
65
+ }
66
+ },
67
+ user?.displayName ?? "Guest"
68
+ ), /* @__PURE__ */ React.createElement(
40
69
  KeyboardArrowDownOutlinedIcon,
41
70
  {
42
71
  sx: {
43
- marginLeft: "1rem",
44
- bgcolor: "#383838",
72
+ bgcolor: bgColor,
45
73
  borderRadius: "25%"
46
74
  }
47
75
  }
@@ -53,20 +81,13 @@ const ProfileDropdown = ({
53
81
  alignItems: "center"
54
82
  }
55
83
  },
56
- buttonClick: handleMenu,
57
- anchorEl,
58
- setAnchorEl
84
+ onOpen: handleOpen,
85
+ onClose: handleClose,
86
+ anchorEl
59
87
  },
60
- /* @__PURE__ */ React.createElement(
61
- MenuSection,
62
- {
63
- hideDivider: true,
64
- items: menuItems,
65
- handleClose: () => setAnchorEl(null)
66
- }
67
- )
88
+ /* @__PURE__ */ React.createElement(MenuSection, { hideDivider: true, items: menuItems, handleClose })
68
89
  );
69
90
  };
70
91
 
71
- export { ProfileDropdown, ProfileDropdown as default };
92
+ export { ProfileDropdown };
72
93
  //# sourceMappingURL=ProfileDropdown.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProfileDropdown.esm.js","sources":["../../../src/components/HeaderDropdownComponent/ProfileDropdown.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, { useEffect, useMemo, useState } from 'react';\nimport HeaderDropdownComponent from './HeaderDropdownComponent';\nimport AccountCircleOutlinedIcon from '@mui/icons-material/AccountCircleOutlined';\nimport KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined';\nimport Typography from '@mui/material/Typography';\nimport {\n identityApiRef,\n useApi,\n ProfileInfo,\n} from '@backstage/core-plugin-api';\nimport { useProfileDropdownMountPoints } from '../../hooks/useProfileDropdownMountPoints';\nimport { ComponentType } from '../../types';\nimport MenuSection from './MenuSection';\n\n/**\n * @public\n * ProfileDropdown component properties\n */\nexport interface ProfileDropdownProps {\n handleMenu: (event: React.MouseEvent<HTMLElement>) => void;\n anchorEl: HTMLElement | null;\n setAnchorEl: React.Dispatch<React.SetStateAction<HTMLElement | null>>;\n}\n\nexport const ProfileDropdown = ({\n handleMenu,\n anchorEl,\n setAnchorEl,\n}: ProfileDropdownProps) => {\n const identityApi = useApi(identityApiRef);\n const [user, setUser] = useState<ProfileInfo>();\n const profileDropdownMountPoints = useProfileDropdownMountPoints();\n\n useEffect(() => {\n const fetchUser = async () => {\n const userProfile = await identityApi.getProfileInfo();\n setUser(userProfile);\n };\n\n fetchUser();\n }, [identityApi]);\n\n const menuItems = useMemo(() => {\n return (profileDropdownMountPoints ?? [])\n .map(mp => ({\n Component: mp.Component,\n type: mp.config?.type ?? ComponentType.LINK,\n icon: mp.config?.props?.icon ?? '',\n label: mp.config?.props?.title ?? '',\n link: mp.config?.props?.link ?? '',\n priority: mp.config?.priority ?? 0,\n }))\n .sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n }, [profileDropdownMountPoints]);\n\n return (\n <HeaderDropdownComponent\n buttonContent={\n <>\n <AccountCircleOutlinedIcon fontSize=\"small\" sx={{ mx: 1 }} />\n <Typography variant=\"body2\" sx={{ fontWeight: 500, mx: 1 }}>\n {user?.displayName ?? 'Guest'}\n </Typography>\n <KeyboardArrowDownOutlinedIcon\n sx={{\n marginLeft: '1rem',\n bgcolor: '#383838',\n borderRadius: '25%',\n }}\n />\n </>\n }\n buttonProps={{\n color: 'inherit',\n sx: {\n display: 'flex',\n alignItems: 'center',\n },\n }}\n buttonClick={handleMenu}\n anchorEl={anchorEl}\n setAnchorEl={setAnchorEl}\n >\n <MenuSection\n hideDivider\n items={menuItems}\n handleClose={() => setAnchorEl(null)}\n />\n </HeaderDropdownComponent>\n );\n};\n\nexport default ProfileDropdown;\n"],"names":[],"mappings":";;;;;;;;;;AAwCO,MAAM,kBAAkB,CAAC;AAAA,EAC9B,UAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAA4B,KAAA;AAC1B,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA;AACzC,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,QAAsB,EAAA;AAC9C,EAAA,MAAM,6BAA6B,6BAA8B,EAAA;AAEjE,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,YAAY,YAAY;AAC5B,MAAM,MAAA,WAAA,GAAc,MAAM,WAAA,CAAY,cAAe,EAAA;AACrD,MAAA,OAAA,CAAQ,WAAW,CAAA;AAAA,KACrB;AAEA,IAAU,SAAA,EAAA;AAAA,GACZ,EAAG,CAAC,WAAW,CAAC,CAAA;AAEhB,EAAM,MAAA,SAAA,GAAY,QAAQ,MAAM;AAC9B,IAAA,OAAA,CAAQ,0BAA8B,IAAA,EACnC,EAAA,GAAA,CAAI,CAAO,EAAA,MA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AAA;AAAA;AAChB;AAAA,OAEJ,CAAA;AAAA,MAEF,WAAa,EAAA;AAAA,QACX,KAAO,EAAA,SAAA;AAAA,QACP,EAAI,EAAA;AAAA,UACF,OAAS,EAAA,MAAA;AAAA,UACT,UAAY,EAAA;AAAA;AACd,OACF;AAAA,MACA,WAAa,EAAA,UAAA;AAAA,MACb,QAAA;AAAA,MACA;AAAA,KAAA;AAAA,oBAEA,KAAA,CAAA,aAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,WAAW,EAAA,IAAA;AAAA,QACX,KAAO,EAAA,SAAA;AAAA,QACP,WAAA,EAAa,MAAM,WAAA,CAAY,IAAI;AAAA;AAAA;AACrC,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"ProfileDropdown.esm.js","sources":["../../../src/components/HeaderDropdownComponent/ProfileDropdown.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, { useEffect, useMemo, useRef, useState } from 'react';\nimport {\n identityApiRef,\n useApi,\n ProfileInfo,\n} from '@backstage/core-plugin-api';\nimport AccountCircleOutlinedIcon from '@mui/icons-material/AccountCircleOutlined';\nimport KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined';\nimport Typography from '@mui/material/Typography';\nimport { lighten } from '@mui/material/styles';\nimport { HeaderDropdownComponent } from './HeaderDropdownComponent';\nimport { useProfileDropdownMountPoints } from '../../hooks/useProfileDropdownMountPoints';\nimport { MenuSection } from './MenuSection';\nimport { useDropdownManager } from '../../hooks';\nimport Box from '@mui/material/Box';\n\n/**\n * @public\n * Props for Profile Dropdown\n */\nexport interface ProfileDropdownProps {\n layout?: React.CSSProperties;\n}\n\nexport const ProfileDropdown = ({ layout }: ProfileDropdownProps) => {\n const { anchorEl, handleOpen, handleClose } = useDropdownManager();\n\n const identityApi = useApi(identityApiRef);\n const [user, setUser] = useState<ProfileInfo>();\n const profileDropdownMountPoints = useProfileDropdownMountPoints();\n\n const headerRef = useRef<HTMLElement | null>(null);\n const [bgColor, setBgColor] = useState('#3C3F42');\n\n useEffect(() => {\n if (headerRef.current) {\n const computedStyle = window.getComputedStyle(headerRef.current);\n const baseColor = computedStyle.backgroundColor;\n setBgColor(lighten(baseColor, 0.2));\n }\n }, []);\n\n useEffect(() => {\n const container = document.getElementById('global-header');\n if (container) {\n const computedStyle = window.getComputedStyle(container);\n const baseColor = computedStyle.backgroundColor;\n setBgColor(lighten(baseColor, 0.2));\n }\n }, []);\n\n useEffect(() => {\n const fetchUser = async () => {\n const userProfile = await identityApi.getProfileInfo();\n setUser(userProfile);\n };\n\n fetchUser();\n }, [identityApi]);\n\n const menuItems = useMemo(() => {\n return (profileDropdownMountPoints ?? [])\n .map(mp => ({\n Component: mp.Component,\n icon: mp.config?.props?.icon ?? '',\n label: mp.config?.props?.title ?? '',\n link: mp.config?.props?.link ?? '',\n priority: mp.config?.priority ?? 0,\n }))\n .sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n }, [profileDropdownMountPoints]);\n\n if (menuItems.length === 0) {\n return null;\n }\n\n return (\n <HeaderDropdownComponent\n buttonContent={\n <Box sx={{ display: 'flex', alignItems: 'center', ...layout }}>\n <AccountCircleOutlinedIcon fontSize=\"small\" sx={{ mr: 1 }} />\n <Typography\n variant=\"body2\"\n sx={{\n display: { xs: 'none', md: 'block' },\n fontWeight: 500,\n mr: '1rem',\n }}\n >\n {user?.displayName ?? 'Guest'}\n </Typography>\n <KeyboardArrowDownOutlinedIcon\n sx={{\n bgcolor: bgColor,\n borderRadius: '25%',\n }}\n />\n </Box>\n }\n buttonProps={{\n color: 'inherit',\n sx: {\n display: 'flex',\n alignItems: 'center',\n },\n }}\n onOpen={handleOpen}\n onClose={handleClose}\n anchorEl={anchorEl}\n >\n <MenuSection hideDivider items={menuItems} handleClose={handleClose} />\n </HeaderDropdownComponent>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAwCO,MAAM,eAAkB,GAAA,CAAC,EAAE,MAAA,EAAmC,KAAA;AACnE,EAAA,MAAM,EAAE,QAAA,EAAU,UAAY,EAAA,WAAA,KAAgB,kBAAmB,EAAA;AAEjE,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA;AACzC,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,QAAsB,EAAA;AAC9C,EAAA,MAAM,6BAA6B,6BAA8B,EAAA;AAEjE,EAAM,MAAA,SAAA,GAAY,OAA2B,IAAI,CAAA;AACjD,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,SAAS,CAAA;AAEhD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,UAAU,OAAS,EAAA;AACrB,MAAA,MAAM,aAAgB,GAAA,MAAA,CAAO,gBAAiB,CAAA,SAAA,CAAU,OAAO,CAAA;AAC/D,MAAA,MAAM,YAAY,aAAc,CAAA,eAAA;AAChC,MAAW,UAAA,CAAA,OAAA,CAAQ,SAAW,EAAA,GAAG,CAAC,CAAA;AAAA;AACpC,GACF,EAAG,EAAE,CAAA;AAEL,EAAA,SAAA,CAAU,MAAM;AACd,IAAM,MAAA,SAAA,GAAY,QAAS,CAAA,cAAA,CAAe,eAAe,CAAA;AACzD,IAAA,IAAI,SAAW,EAAA;AACb,MAAM,MAAA,aAAA,GAAgB,MAAO,CAAA,gBAAA,CAAiB,SAAS,CAAA;AACvD,MAAA,MAAM,YAAY,aAAc,CAAA,eAAA;AAChC,MAAW,UAAA,CAAA,OAAA,CAAQ,SAAW,EAAA,GAAG,CAAC,CAAA;AAAA;AACpC,GAC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,EAAA,OAAA,EAAQ,IAAI,EAAE,EAAA,EAAI,CAAE,EAAA,EAAG,CAC3D,kBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,OAAQ,EAAA,OAAA;AAAA,UACR,EAAI,EAAA;AAAA,YACF,OAAS,EAAA,EAAE,EAAI,EAAA,MAAA,EAAQ,IAAI,OAAQ,EAAA;AAAA,YACnC,UAAY,EAAA,GAAA;AAAA,YACZ,EAAI,EAAA;AAAA;AACN,SAAA;AAAA,QAEC,MAAM,WAAe,IAAA;AAAA,OAExB,kBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,6BAAA;AAAA,QAAA;AAAA,UACC,EAAI,EAAA;AAAA,YACF,OAAS,EAAA,OAAA;AAAA,YACT,YAAc,EAAA;AAAA;AAChB;AAAA,OAEJ,CAAA;AAAA,MAEF,WAAa,EAAA;AAAA,QACX,KAAO,EAAA,SAAA;AAAA,QACP,EAAI,EAAA;AAAA,UACF,OAAS,EAAA,MAAA;AAAA,UACT,UAAY,EAAA;AAAA;AACd,OACF;AAAA,MACA,MAAQ,EAAA,UAAA;AAAA,MACR,OAAS,EAAA,WAAA;AAAA,MACT;AAAA,KAAA;AAAA,wCAEC,WAAY,EAAA,EAAA,WAAA,EAAW,IAAC,EAAA,KAAA,EAAO,WAAW,WAA0B,EAAA;AAAA,GACvE;AAEJ;;;;"}
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import MenuSection from './MenuSection.esm.js';
3
- import { HeaderLink } from '../HeaderLinkComponent/HeaderLink.esm.js';
4
- import { ComponentType } from '../../types.esm.js';
2
+ import { MenuSection } from './MenuSection.esm.js';
3
+ import { MenuItemLink } from '../MenuItemLink/MenuItemLink.esm.js';
5
4
 
6
5
  const RegisterAComponentSection = ({
7
6
  hideDivider,
@@ -13,11 +12,11 @@ const RegisterAComponentSection = ({
13
12
  hideDivider,
14
13
  items: [
15
14
  {
16
- type: ComponentType.LINK,
17
15
  label: "Register a component",
16
+ subLabel: "Import it to the catalog page",
18
17
  link: "/catalog-import",
19
18
  icon: "category",
20
- Component: HeaderLink
19
+ Component: MenuItemLink
21
20
  }
22
21
  ],
23
22
  handleClose
@@ -1 +1 @@
1
- {"version":3,"file":"RegisterAComponentSection.esm.js","sources":["../../../src/components/HeaderDropdownComponent/RegisterAComponentSection.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 MenuSection from './MenuSection';\nimport { HeaderLink } from '../HeaderLinkComponent/HeaderLink';\nimport { ComponentType } from '../../types';\n\n/**\n * Register A Component Section properties\n *\n * @public\n */\nexport type RegisterAComponentSectionProps = {\n hideDivider: boolean;\n handleClose: () => void;\n};\n\nexport const RegisterAComponentSection = ({\n hideDivider,\n handleClose,\n}: RegisterAComponentSectionProps) => {\n return (\n <MenuSection\n hideDivider={hideDivider}\n items={[\n {\n type: ComponentType.LINK,\n label: 'Register a component',\n link: '/catalog-import',\n icon: 'category',\n Component: HeaderLink as React.ComponentType,\n },\n ]}\n handleClose={handleClose}\n />\n );\n};\n"],"names":[],"mappings":";;;;;AA+BO,MAAM,4BAA4B,CAAC;AAAA,EACxC,WAAA;AAAA,EACA;AACF,CAAsC,KAAA;AACpC,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,WAAA;AAAA,MACA,KAAO,EAAA;AAAA,QACL;AAAA,UACE,MAAM,aAAc,CAAA,IAAA;AAAA,UACpB,KAAO,EAAA,sBAAA;AAAA,UACP,IAAM,EAAA,iBAAA;AAAA,UACN,IAAM,EAAA,UAAA;AAAA,UACN,SAAW,EAAA;AAAA;AACb,OACF;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"RegisterAComponentSection.esm.js","sources":["../../../src/components/HeaderDropdownComponent/RegisterAComponentSection.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 { MenuSection } from './MenuSection';\nimport { MenuItemLink } from '../MenuItemLink/MenuItemLink';\n\n/**\n * Register A Component Section properties\n *\n * @public\n */\nexport type RegisterAComponentSectionProps = {\n hideDivider: boolean;\n handleClose: () => void;\n};\n\nexport const RegisterAComponentSection = ({\n hideDivider,\n handleClose,\n}: RegisterAComponentSectionProps) => {\n return (\n <MenuSection\n hideDivider={hideDivider}\n items={[\n {\n label: 'Register a component',\n subLabel: 'Import it to the catalog page',\n link: '/catalog-import',\n icon: 'category',\n Component: MenuItemLink as React.ComponentType,\n },\n ]}\n handleClose={handleClose}\n />\n );\n};\n"],"names":[],"mappings":";;;;AA8BO,MAAM,4BAA4B,CAAC;AAAA,EACxC,WAAA;AAAA,EACA;AACF,CAAsC,KAAA;AACpC,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,WAAA;AAAA,MACA,KAAO,EAAA;AAAA,QACL;AAAA,UACE,KAAO,EAAA,sBAAA;AAAA,UACP,QAAU,EAAA,+BAAA;AAAA,UACV,IAAM,EAAA,iBAAA;AAAA,UACN,IAAM,EAAA,UAAA;AAAA,UACN,SAAW,EAAA;AAAA;AACb,OACF;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;;;;"}
@@ -1,11 +1,56 @@
1
- import React from 'react';
2
- import MenuSection from './MenuSection.esm.js';
1
+ import React, { useState, useEffect, useMemo } from 'react';
2
+ import { useApi } from '@backstage/core-plugin-api';
3
+ import { catalogApiRef } from '@backstage/plugin-catalog-react';
4
+ import Box from '@mui/material/Box';
5
+ import Divider from '@mui/material/Divider';
6
+ import Typography from '@mui/material/Typography';
7
+ import { MenuSection } from './MenuSection.esm.js';
8
+ import { MenuItemLink } from '../MenuItemLink/MenuItemLink.esm.js';
3
9
 
4
10
  const SoftwareTemplatesSection = ({
5
- items,
6
11
  handleClose,
7
12
  hideDivider
8
13
  }) => {
14
+ const catalogApi = useApi(catalogApiRef);
15
+ const [entities, setEntities] = useState([]);
16
+ const [_loading, setLoading] = useState(true);
17
+ const [error, setError] = useState(null);
18
+ useEffect(() => {
19
+ const fetchEntities = async () => {
20
+ try {
21
+ const response = await catalogApi.getEntities({
22
+ filter: { kind: ["Template"] },
23
+ limit: 7
24
+ });
25
+ setEntities(response.items);
26
+ } catch (err) {
27
+ setError(err);
28
+ } finally {
29
+ setLoading(false);
30
+ }
31
+ };
32
+ fetchEntities();
33
+ }, [catalogApi]);
34
+ const items = useMemo(() => {
35
+ return entities.filter((e) => e.kind === "Template").map((m) => ({
36
+ Component: MenuItemLink,
37
+ label: m.metadata.title ?? m.metadata.name,
38
+ link: `/create/templates/default/${m.metadata.name}`
39
+ }));
40
+ }, [entities]);
41
+ if (error) {
42
+ return /* @__PURE__ */ React.createElement(Box, { display: "flex", justifyContent: "center", alignItems: "center", p: 2 }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1", color: "error" }, "Error fetching templates"));
43
+ }
44
+ if (items.length === 0) {
45
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
46
+ Typography,
47
+ {
48
+ variant: "body2",
49
+ sx: { mx: 2, my: 1, color: "text.disabled" }
50
+ },
51
+ "No templates available"
52
+ ), !hideDivider && /* @__PURE__ */ React.createElement(Divider, { sx: { my: 0.5 } }));
53
+ }
9
54
  return /* @__PURE__ */ React.createElement(
10
55
  MenuSection,
11
56
  {
@@ -1 +1 @@
1
- {"version":3,"file":"SoftwareTemplatesSection.esm.js","sources":["../../../src/components/HeaderDropdownComponent/SoftwareTemplatesSection.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 MenuSection, { MenuItemConfig } from './MenuSection';\n\n/**\n * Software Templates Section properties\n *\n * @public\n */\nexport type SoftwareTemplatesSectionProps = {\n items: MenuItemConfig[];\n handleClose: () => void;\n hideDivider?: boolean;\n};\n\nexport const SoftwareTemplatesSection = ({\n items,\n handleClose,\n hideDivider,\n}: SoftwareTemplatesSectionProps) => {\n return (\n <MenuSection\n hideDivider={hideDivider}\n sectionLabel=\"Use a template\"\n optionalLink=\"/create\"\n optionalLinkLabel=\"All templates\"\n items={items}\n handleClose={handleClose}\n />\n );\n};\n"],"names":[],"mappings":";;;AA8BO,MAAM,2BAA2B,CAAC;AAAA,EACvC,KAAA;AAAA,EACA,WAAA;AAAA,EACA;AACF,CAAqC,KAAA;AACnC,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,WAAA;AAAA,MACA,YAAa,EAAA,gBAAA;AAAA,MACb,YAAa,EAAA,SAAA;AAAA,MACb,iBAAkB,EAAA,eAAA;AAAA,MAClB,KAAA;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"SoftwareTemplatesSection.esm.js","sources":["../../../src/components/HeaderDropdownComponent/SoftwareTemplatesSection.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, { useEffect, useMemo, useState } from 'react';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport { Entity } from '@backstage/catalog-model';\n\nimport Box from '@mui/material/Box';\nimport Divider from '@mui/material/Divider';\nimport Typography from '@mui/material/Typography';\n\nimport { MenuSection } from './MenuSection';\nimport { MenuItemLink } from '../MenuItemLink/MenuItemLink';\n\n/**\n * Software Templates Section properties\n *\n * @public\n */\nexport type SoftwareTemplatesSectionProps = {\n handleClose: () => void;\n hideDivider?: boolean;\n};\n\nexport const SoftwareTemplatesSection = ({\n handleClose,\n hideDivider,\n}: SoftwareTemplatesSectionProps) => {\n const catalogApi = useApi(catalogApiRef);\n\n const [entities, setEntities] = useState<Entity[]>([]);\n // TODO: handle loading\n const [_loading, setLoading] = useState(true);\n const [error, setError] = useState(null);\n\n useEffect(() => {\n const fetchEntities = async () => {\n try {\n const response = await catalogApi.getEntities({\n filter: { kind: ['Template'] },\n limit: 7,\n });\n setEntities(response.items);\n } catch (err) {\n setError(err);\n } finally {\n setLoading(false);\n }\n };\n\n fetchEntities();\n }, [catalogApi]);\n\n const items = useMemo(() => {\n return entities\n .filter(e => e.kind === 'Template')\n .map(m => ({\n Component: MenuItemLink as React.ComponentType,\n label: m.metadata.title ?? m.metadata.name,\n link: `/create/templates/default/${m.metadata.name}`,\n }));\n }, [entities]);\n\n if (error) {\n return (\n <Box display=\"flex\" justifyContent=\"center\" alignItems=\"center\" p={2}>\n <Typography variant=\"body1\" color=\"error\">\n Error fetching templates\n </Typography>\n </Box>\n );\n }\n\n if (items.length === 0) {\n return (\n <>\n <Typography\n variant=\"body2\"\n sx={{ mx: 2, my: 1, color: 'text.disabled' }}\n >\n No templates available\n </Typography>\n {!hideDivider && <Divider sx={{ my: 0.5 }} />}\n </>\n );\n }\n return (\n <MenuSection\n hideDivider={hideDivider}\n sectionLabel=\"Use a template\"\n optionalLink=\"/create\"\n optionalLinkLabel=\"All templates\"\n items={items}\n handleClose={handleClose}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAuCO,MAAM,2BAA2B,CAAC;AAAA,EACvC,WAAA;AAAA,EACA;AACF,CAAqC,KAAA;AACnC,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA;AAEvC,EAAA,MAAM,CAAC,QAAU,EAAA,WAAW,CAAI,GAAA,QAAA,CAAmB,EAAE,CAAA;AAErD,EAAA,MAAM,CAAC,QAAA,EAAU,UAAU,CAAA,GAAI,SAAS,IAAI,CAAA;AAC5C,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAAS,IAAI,CAAA;AAEvC,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,gBAAgB,YAAY;AAChC,MAAI,IAAA;AACF,QAAM,MAAA,QAAA,GAAW,MAAM,UAAA,CAAW,WAAY,CAAA;AAAA,UAC5C,MAAQ,EAAA,EAAE,IAAM,EAAA,CAAC,UAAU,CAAE,EAAA;AAAA,UAC7B,KAAO,EAAA;AAAA,SACR,CAAA;AACD,QAAA,WAAA,CAAY,SAAS,KAAK,CAAA;AAAA,eACnB,GAAK,EAAA;AACZ,QAAA,QAAA,CAAS,GAAG,CAAA;AAAA,OACZ,SAAA;AACA,QAAA,UAAA,CAAW,KAAK,CAAA;AAAA;AAClB,KACF;AAEA,IAAc,aAAA,EAAA;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,IAAA;AAAA,MACC,WAAA;AAAA,MACA,YAAa,EAAA,gBAAA;AAAA,MACb,YAAa,EAAA,SAAA;AAAA,MACb,iBAAkB,EAAA,eAAA;AAAA,MAClB,KAAA;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;;;;"}
@@ -3,30 +3,43 @@ import { useApp } from '@backstage/core-plugin-api';
3
3
  import MuiIcon from '@mui/material/Icon';
4
4
  import Box from '@mui/material/Box';
5
5
 
6
- const HeaderIcon = ({ icon, styles }) => {
6
+ const HeaderIcon = ({
7
+ icon,
8
+ size = "small",
9
+ layout
10
+ }) => {
7
11
  const app = useApp();
8
12
  if (!icon) {
9
13
  return null;
10
14
  }
11
15
  const SystemIcon = app.getSystemIcon(icon);
12
16
  if (SystemIcon) {
13
- return /* @__PURE__ */ React.createElement(Box, { sx: { display: "flex", alignItems: "center", ...styles } }, /* @__PURE__ */ React.createElement(SystemIcon, { fontSize: "small" }));
17
+ return /* @__PURE__ */ React.createElement(Box, { sx: { display: "flex", alignItems: "center", ...layout } }, /* @__PURE__ */ React.createElement(SystemIcon, { fontSize: size }));
14
18
  }
15
19
  if (icon.startsWith("<svg")) {
16
20
  const svgDataUri = `data:image/svg+xml;base64,${btoa(icon)}`;
17
- return /* @__PURE__ */ React.createElement(MuiIcon, { style: { fontSize: 20, ...styles } }, /* @__PURE__ */ React.createElement("img", { src: svgDataUri, alt: "" }));
21
+ return /* @__PURE__ */ React.createElement(MuiIcon, { fontSize: size, sx: layout }, /* @__PURE__ */ React.createElement("img", { src: svgDataUri, alt: "" }));
18
22
  }
19
23
  if (icon.startsWith("https://") || icon.startsWith("http://") || icon.startsWith("/")) {
20
24
  return /* @__PURE__ */ React.createElement(
21
25
  MuiIcon,
22
26
  {
23
- style: { fontSize: 20, ...styles },
24
- baseClassName: "material-icons-outlined"
27
+ fontSize: size,
28
+ baseClassName: "material-icons-outlined",
29
+ sx: layout
25
30
  },
26
31
  /* @__PURE__ */ React.createElement("img", { src: icon, alt: "" })
27
32
  );
28
33
  }
29
- return /* @__PURE__ */ React.createElement(MuiIcon, { style: { fontSize: 20 }, baseClassName: "material-icons-outlined" }, icon);
34
+ return /* @__PURE__ */ React.createElement(
35
+ MuiIcon,
36
+ {
37
+ fontSize: size,
38
+ baseClassName: "material-icons-outlined",
39
+ sx: layout
40
+ },
41
+ icon
42
+ );
30
43
  };
31
44
 
32
45
  export { HeaderIcon };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeaderIcon.esm.js","sources":["../../../src/components/HeaderIcon/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\n/**\n * @public\n */\nexport interface HeaderIconProps {\n icon: string;\n size?: 'small' | 'medium' | 'large';\n layout?: React.CSSProperties;\n}\n\n/**\n * @public\n */\nexport const HeaderIcon = ({\n icon,\n size = 'small',\n layout,\n}: HeaderIconProps) => {\n const app = useApp();\n if (!icon) {\n return null;\n }\n\n const SystemIcon = app.getSystemIcon(icon);\n if (SystemIcon) {\n return (\n <Box sx={{ display: 'flex', alignItems: 'center', ...layout }}>\n <SystemIcon fontSize={size} />\n </Box>\n );\n }\n\n if (icon.startsWith('<svg')) {\n const svgDataUri = `data:image/svg+xml;base64,${btoa(icon)}`;\n return (\n <MuiIcon fontSize={size} sx={layout}>\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 fontSize={size}\n baseClassName=\"material-icons-outlined\"\n sx={layout}\n >\n <img src={icon} alt=\"\" />\n </MuiIcon>\n );\n }\n\n return (\n <MuiIcon\n fontSize={size}\n baseClassName=\"material-icons-outlined\"\n sx={layout}\n >\n {icon}\n </MuiIcon>\n );\n};\n"],"names":[],"mappings":";;;;;AAgCO,MAAM,aAAa,CAAC;AAAA,EACzB,IAAA;AAAA,EACA,IAAO,GAAA,OAAA;AAAA,EACP;AACF,CAAuB,KAAA;AACrB,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;AACzC,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,EAAU,MAAM,CAC9B,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,QAAU,EAAA,IAAA,EAAM,EAAI,EAAA,MAAA,EAAA,kBAC1B,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,GAAK,EAAA,UAAA,EAAY,GAAI,EAAA,EAAA,EAAG,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,QAAU,EAAA,IAAA;AAAA,QACV,aAAc,EAAA,yBAAA;AAAA,QACd,EAAI,EAAA;AAAA,OAAA;AAAA,sBAEH,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,GAAK,EAAA,IAAA,EAAM,KAAI,EAAG,EAAA;AAAA,KACzB;AAAA;AAIJ,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,QAAU,EAAA,IAAA;AAAA,MACV,aAAc,EAAA,yBAAA;AAAA,MACd,EAAI,EAAA;AAAA,KAAA;AAAA,IAEH;AAAA,GACH;AAEJ;;;;"}
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { Link as Link$1 } from '@backstage/core-components';
3
+ import Box from '@mui/material/Box';
4
+ import IconButton from '@mui/material/IconButton';
5
+ import Tooltip from '@mui/material/Tooltip';
6
+ import { HeaderIcon } from '../HeaderIcon/HeaderIcon.esm.js';
7
+
8
+ const Link = (props) => /* @__PURE__ */ React.createElement(Link$1, { ...props, color: "inherit", externalLinkIcon: false });
9
+ const HeaderIconButton = ({
10
+ title,
11
+ icon,
12
+ tooltip,
13
+ color = "inherit",
14
+ size = "small",
15
+ ariaLabel,
16
+ to,
17
+ layout
18
+ }) => {
19
+ if (!title) {
20
+ console.warn("HeaderIconButton has no title:", { icon, to });
21
+ }
22
+ const linkProps = { to };
23
+ return /* @__PURE__ */ React.createElement(Box, { sx: layout }, /* @__PURE__ */ React.createElement(Tooltip, { title: tooltip ?? title }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
24
+ IconButton,
25
+ {
26
+ LinkComponent: Link,
27
+ color,
28
+ size,
29
+ "aria-label": ariaLabel ?? title,
30
+ ...linkProps
31
+ },
32
+ /* @__PURE__ */ React.createElement(HeaderIcon, { icon, size })
33
+ ))));
34
+ };
35
+
36
+ export { HeaderIconButton };
37
+ //# sourceMappingURL=HeaderIconButton.esm.js.map
@@ -0,0 +1 @@
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';\n\nimport { Link as BackstageLink } from '@backstage/core-components';\n\nimport Box from '@mui/material/Box';\nimport IconButton, { IconButtonProps } from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\n\nimport { HeaderIcon } from '../HeaderIcon/HeaderIcon';\n\n/**\n * @public\n */\nexport interface HeaderIconButtonProps {\n title: string;\n icon: string;\n tooltip?: string;\n color?: 'inherit' | 'primary' | 'secondary' | 'default';\n size?: 'small' | 'medium' | 'large';\n ariaLabel?: string;\n to: string;\n layout?: React.CSSProperties;\n}\n\n// Backstage Link automatically detects external links and emits analytic events.\nconst Link = (props: any) => (\n <BackstageLink {...props} color=\"inherit\" externalLinkIcon={false} />\n);\n\nexport const HeaderIconButton = ({\n title,\n icon,\n tooltip,\n color = 'inherit',\n size = 'small',\n ariaLabel,\n to,\n layout,\n}: HeaderIconButtonProps) => {\n if (!title) {\n // eslint-disable-next-line no-console\n console.warn('HeaderIconButton has no title:', { icon, to });\n }\n\n const linkProps = { to } as IconButtonProps;\n\n return (\n <Box sx={layout}>\n <Tooltip title={tooltip ?? title}>\n <div>\n <IconButton\n LinkComponent={Link}\n color={color}\n size={size}\n aria-label={ariaLabel ?? title}\n {...linkProps} // to={to} isn't supported\n >\n <HeaderIcon icon={icon} size={size} />\n </IconButton>\n </div>\n </Tooltip>\n </Box>\n );\n};\n"],"names":["BackstageLink"],"mappings":";;;;;;;AAyCA,MAAM,IAAA,GAAO,CAAC,KAAA,qBACX,KAAA,CAAA,aAAA,CAAAA,MAAA,EAAA,EAAe,GAAG,KAAO,EAAA,KAAA,EAAM,SAAU,EAAA,gBAAA,EAAkB,KAAO,EAAA,CAAA;AAG9D,MAAM,mBAAmB,CAAC;AAAA,EAC/B,KAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAQ,GAAA,SAAA;AAAA,EACR,IAAO,GAAA,OAAA;AAAA,EACP,SAAA;AAAA,EACA,EAAA;AAAA,EACA;AACF,CAA6B,KAAA;AAC3B,EAAA,IAAI,CAAC,KAAO,EAAA;AAEV,IAAA,OAAA,CAAQ,IAAK,CAAA,gCAAA,EAAkC,EAAE,IAAA,EAAM,IAAI,CAAA;AAAA;AAG7D,EAAM,MAAA,SAAA,GAAY,EAAE,EAAG,EAAA;AAEvB,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,MACP,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,WAAQ,KAAO,EAAA,OAAA,IAAW,KACzB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,aAAe,EAAA,IAAA;AAAA,MACf,KAAA;AAAA,MACA,IAAA;AAAA,MACA,cAAY,SAAa,IAAA,KAAA;AAAA,MACxB,GAAG;AAAA,KAAA;AAAA,oBAEJ,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,IAAA,EAAY,IAAY,EAAA;AAAA,GAExC,CACF,CACF,CAAA;AAEJ;;;;"}
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useApi, errorApiRef, identityApiRef } from '@backstage/core-plugin-api';
3
- import { HeaderButton } from './HeaderButton.esm.js';
3
+ import Box from '@mui/material/Box';
4
+ import { MenuItemLinkContent } from '../MenuItemLink/MenuItemLinkContent.esm.js';
4
5
 
5
6
  const LogoutButton = () => {
6
7
  const errorApi = useApi(errorApiRef);
@@ -8,7 +9,14 @@ const LogoutButton = () => {
8
9
  const handleLogout = () => {
9
10
  identityApi.signOut().catch((error) => errorApi.post(error));
10
11
  };
11
- return /* @__PURE__ */ React.createElement(HeaderButton, { title: "Logout", icon: "logout", onClick: handleLogout });
12
+ return /* @__PURE__ */ React.createElement(
13
+ Box,
14
+ {
15
+ onClick: handleLogout,
16
+ sx: { cursor: "pointer", width: "100%", color: "inherit" }
17
+ },
18
+ /* @__PURE__ */ React.createElement(MenuItemLinkContent, { icon: "logout", label: "Logout" })
19
+ );
12
20
  };
13
21
 
14
22
  export { LogoutButton };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogoutButton.esm.js","sources":["../../../src/components/LogoutButton/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';\n\nimport {\n errorApiRef,\n identityApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\n\nimport Box from '@mui/material/Box';\n\nimport { MenuItemLinkContent } from '../MenuItemLink/MenuItemLinkContent';\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 // TODO switch to Button\n return (\n <Box\n onClick={handleLogout}\n sx={{ cursor: 'pointer', width: '100%', color: 'inherit' }}\n >\n <MenuItemLinkContent icon=\"logout\" label=\"Logout\" />\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;AA4BO,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;AAGA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA,YAAA;AAAA,MACT,IAAI,EAAE,MAAA,EAAQ,WAAW,KAAO,EAAA,MAAA,EAAQ,OAAO,SAAU;AAAA,KAAA;AAAA,oBAExD,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAA,EAAoB,IAAK,EAAA,QAAA,EAAS,OAAM,QAAS,EAAA;AAAA,GACpD;AAEJ;;;;"}
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import Tooltip from '@mui/material/Tooltip';
3
3
  import { Link } from 'react-router-dom';
4
- import HeaderItemContent from './HeaderItemContent.esm.js';
4
+ import { MenuItemLinkContent } from './MenuItemLinkContent.esm.js';
5
5
 
6
- const HeaderLink = ({
6
+ const MenuItemLink = ({
7
7
  to,
8
8
  title,
9
9
  subTitle,
@@ -20,10 +20,10 @@ const HeaderLink = ({
20
20
  width: "100%"
21
21
  }
22
22
  },
23
- /* @__PURE__ */ React.createElement(HeaderItemContent, { icon, label: title, subLabel: subTitle })
23
+ /* @__PURE__ */ React.createElement(MenuItemLinkContent, { icon, label: title, subLabel: subTitle })
24
24
  );
25
- return /* @__PURE__ */ React.createElement(React.Fragment, null, tooltip && /* @__PURE__ */ React.createElement(Tooltip, { title: tooltip }, headerLinkContent()), !tooltip && headerLinkContent());
25
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, tooltip && /* @__PURE__ */ React.createElement(Tooltip, { title: tooltip }, /* @__PURE__ */ React.createElement("div", null, headerLinkContent())), !tooltip && headerLinkContent());
26
26
  };
27
27
 
28
- export { HeaderLink };
29
- //# sourceMappingURL=HeaderLink.esm.js.map
28
+ export { MenuItemLink };
29
+ //# sourceMappingURL=MenuItemLink.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuItemLink.esm.js","sources":["../../../src/components/MenuItemLink/MenuItemLink.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 Tooltip from '@mui/material/Tooltip';\nimport { Link } from 'react-router-dom';\nimport { MenuItemLinkContent } from './MenuItemLinkContent';\n\n/**\n * Header Icon Button properties\n * @public\n */\nexport interface MenuItemLinkProps {\n to: string;\n title?: string;\n subTitle?: string;\n icon?: string;\n tooltip?: string;\n}\n\nexport const MenuItemLink = ({\n to,\n title,\n subTitle,\n icon,\n tooltip,\n}: MenuItemLinkProps) => {\n const headerLinkContent = () => (\n <Link\n to={to}\n style={{\n color: 'inherit',\n textDecoration: 'none',\n width: '100%',\n }}\n >\n <MenuItemLinkContent icon={icon} label={title} subLabel={subTitle} />\n </Link>\n );\n return (\n <>\n {tooltip && (\n <Tooltip title={tooltip}>\n <div>{headerLinkContent()}</div>\n </Tooltip>\n )}\n {!tooltip && headerLinkContent()}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;AAiCO,MAAM,eAAe,CAAC;AAAA,EAC3B,EAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAyB,KAAA;AACvB,EAAA,MAAM,oBAAoB,sBACxB,KAAA,CAAA,aAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,EAAA;AAAA,MACA,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,SAAA;AAAA,QACP,cAAgB,EAAA,MAAA;AAAA,QAChB,KAAO,EAAA;AAAA;AACT,KAAA;AAAA,wCAEC,mBAAoB,EAAA,EAAA,IAAA,EAAY,KAAO,EAAA,KAAA,EAAO,UAAU,QAAU,EAAA;AAAA,GACrE;AAEF,EAAA,uBAEK,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAA,OAAA,oBACE,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,OAAO,OACd,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,IAAA,EAAA,iBAAA,EAAoB,CAC5B,CAAA,EAED,CAAC,OAAA,IAAW,mBACf,CAAA;AAEJ;;;;"}
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import Typography from '@mui/material/Typography';
3
+ import Box from '@mui/material/Box';
4
+ import { HeaderIcon } from '../HeaderIcon/HeaderIcon.esm.js';
5
+ import { useTheme } from '@mui/material/styles';
6
+
7
+ const MenuItemLinkContent = ({
8
+ icon,
9
+ label,
10
+ subLabel
11
+ }) => {
12
+ const theme = useTheme();
13
+ return /* @__PURE__ */ React.createElement(
14
+ Box,
15
+ {
16
+ sx: {
17
+ display: "flex",
18
+ alignItems: "center",
19
+ margin: "8px 0",
20
+ color: "inherit"
21
+ }
22
+ },
23
+ icon && /* @__PURE__ */ React.createElement(
24
+ HeaderIcon,
25
+ {
26
+ icon,
27
+ size: "small",
28
+ layout: label ? {
29
+ marginRight: "0.5rem",
30
+ flexShrink: 0,
31
+ color: theme.palette.mode === "dark" ? theme.palette.text.primary : theme.palette.text.disabled
32
+ } : {}
33
+ }
34
+ ),
35
+ /* @__PURE__ */ React.createElement(Box, null, label && /* @__PURE__ */ React.createElement(Typography, { variant: "body2", color: theme.palette.text.primary }, label), subLabel && /* @__PURE__ */ React.createElement(Typography, { variant: "caption", color: "text.secondary" }, subLabel))
36
+ );
37
+ };
38
+
39
+ export { MenuItemLinkContent };
40
+ //# sourceMappingURL=MenuItemLinkContent.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuItemLinkContent.esm.js","sources":["../../../src/components/MenuItemLink/MenuItemLinkContent.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 Box from '@mui/material/Box';\nimport { HeaderIcon } from '../HeaderIcon/HeaderIcon';\nimport { useTheme } from '@mui/material/styles';\n\ninterface MenuItemLinkContentProps {\n icon?: string;\n label?: string;\n subLabel?: string;\n}\n\nexport const MenuItemLinkContent: React.FC<MenuItemLinkContentProps> = ({\n icon,\n label,\n subLabel,\n}) => {\n const theme = useTheme();\n return (\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n margin: '8px 0',\n color: 'inherit',\n }}\n >\n {icon && (\n <HeaderIcon\n icon={icon}\n size=\"small\"\n layout={\n label\n ? {\n marginRight: '0.5rem',\n flexShrink: 0,\n color:\n theme.palette.mode === 'dark'\n ? theme.palette.text.primary\n : theme.palette.text.disabled,\n }\n : {}\n }\n />\n )}\n <Box>\n {label && (\n <Typography variant=\"body2\" color={theme.palette.text.primary}>\n {label}\n </Typography>\n )}\n {subLabel && (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {subLabel}\n </Typography>\n )}\n </Box>\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;AA4BO,MAAM,sBAA0D,CAAC;AAAA,EACtE,IAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EAAA,MAAM,QAAQ,QAAS,EAAA;AACvB,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA;AAAA,QACF,OAAS,EAAA,MAAA;AAAA,QACT,UAAY,EAAA,QAAA;AAAA,QACZ,MAAQ,EAAA,OAAA;AAAA,QACR,KAAO,EAAA;AAAA;AACT,KAAA;AAAA,IAEC,IACC,oBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,IAAA;AAAA,QACA,IAAK,EAAA,OAAA;AAAA,QACL,QACE,KACI,GAAA;AAAA,UACE,WAAa,EAAA,QAAA;AAAA,UACb,UAAY,EAAA,CAAA;AAAA,UACZ,KAAA,EACE,KAAM,CAAA,OAAA,CAAQ,IAAS,KAAA,MAAA,GACnB,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,OAAA,GACnB,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA;AAAA,YAE3B;AAAC;AAAA,KAET;AAAA,oBAEF,KAAA,CAAA,aAAA,CAAC,WACE,KACC,oBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,OAAQ,EAAA,OAAA,EAAQ,KAAO,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,WACnD,KACH,CAAA,EAED,4BACE,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,SAAQ,SAAU,EAAA,KAAA,EAAM,gBACjC,EAAA,EAAA,QACH,CAEJ;AAAA,GACF;AAEJ;;;;"}
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { Link as Link$1 } from '@backstage/core-components';
3
+ import Badge from '@mui/material/Badge';
4
+ import Box from '@mui/material/Box';
5
+ import IconButton from '@mui/material/IconButton';
6
+ import Tooltip from '@mui/material/Tooltip';
7
+ import NotificationIcon from '@mui/icons-material/NotificationsOutlined';
8
+ import { useNotificationCount } from '../../hooks/useNotificationCount.esm.js';
9
+
10
+ const Link = (props) => /* @__PURE__ */ React.createElement(Link$1, { ...props, color: "inherit", externalLinkIcon: false });
11
+ const NotificationButton = ({
12
+ title = "Notifications",
13
+ tooltip,
14
+ color = "inherit",
15
+ size = "small",
16
+ badgeColor = "error",
17
+ to = "/notifications",
18
+ layout
19
+ }) => {
20
+ const { available, unreadCount } = useNotificationCount();
21
+ if (!available) {
22
+ return null;
23
+ }
24
+ return /* @__PURE__ */ React.createElement(Box, { sx: layout }, /* @__PURE__ */ React.createElement(Tooltip, { title: tooltip ?? title }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
25
+ IconButton,
26
+ {
27
+ component: Link,
28
+ color,
29
+ size,
30
+ to,
31
+ "aria-label": title
32
+ },
33
+ unreadCount > 0 ? /* @__PURE__ */ React.createElement(Badge, { badgeContent: unreadCount, color: badgeColor, max: 999 }, /* @__PURE__ */ React.createElement(NotificationIcon, { fontSize: size })) : /* @__PURE__ */ React.createElement(NotificationIcon, { fontSize: size })
34
+ ))));
35
+ };
36
+
37
+ export { NotificationButton };
38
+ //# sourceMappingURL=NotificationButton.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationButton.esm.js","sources":["../../../src/components/NotificationButton/NotificationButton.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';\n\nimport { Link as BackstageLink } from '@backstage/core-components';\n\nimport Badge from '@mui/material/Badge';\nimport Box from '@mui/material/Box';\nimport IconButton from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\nimport NotificationIcon from '@mui/icons-material/NotificationsOutlined';\n\nimport { useNotificationCount } from '../../hooks/useNotificationCount';\n\n/**\n * @public\n */\nexport interface NotificationButtonProps {\n title?: string;\n tooltip?: string;\n color?:\n | 'inherit'\n | 'default'\n | 'primary'\n | 'secondary'\n | 'error'\n | 'info'\n | 'success'\n | 'warning';\n size?: 'small' | 'medium' | 'large';\n badgeColor?:\n | 'primary'\n | 'secondary'\n | 'default'\n | 'error'\n | 'info'\n | 'success'\n | 'warning';\n to?: string;\n layout?: React.CSSProperties;\n}\n\n// Backstage Link automatically detects external links and emits analytic events.\nconst Link = (props: any) => (\n <BackstageLink {...props} color=\"inherit\" externalLinkIcon={false} />\n);\n\n/**\n * @public\n */\nexport const NotificationButton = ({\n title = 'Notifications',\n tooltip,\n color = 'inherit',\n size = 'small',\n badgeColor = 'error',\n to = '/notifications',\n layout,\n}: NotificationButtonProps) => {\n const { available, unreadCount } = useNotificationCount();\n\n if (!available) {\n return null;\n }\n\n return (\n <Box sx={layout}>\n <Tooltip title={tooltip ?? title}>\n <div>\n <IconButton\n component={Link}\n color={color}\n size={size}\n to={to}\n aria-label={title}\n >\n {unreadCount > 0 ? (\n <Badge badgeContent={unreadCount} color={badgeColor} max={999}>\n <NotificationIcon fontSize={size} />\n </Badge>\n ) : (\n <NotificationIcon fontSize={size} />\n )}\n </IconButton>\n </div>\n </Tooltip>\n </Box>\n );\n};\n"],"names":["BackstageLink"],"mappings":";;;;;;;;;AAyDA,MAAM,IAAA,GAAO,CAAC,KAAA,qBACX,KAAA,CAAA,aAAA,CAAAA,MAAA,EAAA,EAAe,GAAG,KAAO,EAAA,KAAA,EAAM,SAAU,EAAA,gBAAA,EAAkB,KAAO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