@red-hat-developer-hub/backstage-plugin-global-header 1.7.3 → 1.9.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 (74) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/app-config.dynamic.yaml +8 -1
  3. package/config.d.ts +31 -0
  4. package/dist/components/CompanyLogo/CompanyLogo.esm.js +64 -0
  5. package/dist/components/CompanyLogo/CompanyLogo.esm.js.map +1 -0
  6. package/dist/components/CompanyLogo/DefaultLogo.esm.js +237 -0
  7. package/dist/components/CompanyLogo/DefaultLogo.esm.js.map +1 -0
  8. package/dist/components/Divider/Divider.esm.js +2 -2
  9. package/dist/components/Divider/Divider.esm.js.map +1 -1
  10. package/dist/components/GlobalHeader.esm.js +2 -2
  11. package/dist/components/GlobalHeader.esm.js.map +1 -1
  12. package/dist/components/GlobalHeaderComponent.esm.js +13 -12
  13. package/dist/components/GlobalHeaderComponent.esm.js.map +1 -1
  14. package/dist/components/HeaderButton/HeaderButton.esm.js +9 -9
  15. package/dist/components/HeaderButton/HeaderButton.esm.js.map +1 -1
  16. package/dist/components/HeaderDropdownComponent/ApplicationLauncherDropdown.esm.js +29 -28
  17. package/dist/components/HeaderDropdownComponent/ApplicationLauncherDropdown.esm.js.map +1 -1
  18. package/dist/components/HeaderDropdownComponent/CreateDropdown.esm.js +17 -13
  19. package/dist/components/HeaderDropdownComponent/CreateDropdown.esm.js.map +1 -1
  20. package/dist/components/HeaderDropdownComponent/DropdownEmptyState.esm.js +16 -14
  21. package/dist/components/HeaderDropdownComponent/DropdownEmptyState.esm.js.map +1 -1
  22. package/dist/components/HeaderDropdownComponent/HeaderDropdownComponent.esm.js +32 -28
  23. package/dist/components/HeaderDropdownComponent/HeaderDropdownComponent.esm.js.map +1 -1
  24. package/dist/components/HeaderDropdownComponent/MenuSection.esm.js +55 -48
  25. package/dist/components/HeaderDropdownComponent/MenuSection.esm.js.map +1 -1
  26. package/dist/components/HeaderDropdownComponent/ProfileDropdown.esm.js +38 -31
  27. package/dist/components/HeaderDropdownComponent/ProfileDropdown.esm.js.map +1 -1
  28. package/dist/components/HeaderDropdownComponent/RegisterAComponentSection.esm.js +2 -2
  29. package/dist/components/HeaderDropdownComponent/RegisterAComponentSection.esm.js.map +1 -1
  30. package/dist/components/HeaderDropdownComponent/SoftwareTemplatesSection.esm.js +15 -11
  31. package/dist/components/HeaderDropdownComponent/SoftwareTemplatesSection.esm.js.map +1 -1
  32. package/dist/components/HeaderDropdownComponent/StarredDropdown.esm.js +55 -50
  33. package/dist/components/HeaderDropdownComponent/StarredDropdown.esm.js.map +1 -1
  34. package/dist/components/HeaderIcon/HeaderIcon.esm.js +11 -11
  35. package/dist/components/HeaderIcon/HeaderIcon.esm.js.map +1 -1
  36. package/dist/components/HeaderIconButton/HeaderIconButton.esm.js +7 -7
  37. package/dist/components/HeaderIconButton/HeaderIconButton.esm.js.map +1 -1
  38. package/dist/components/LogoutButton/LogoutButton.esm.js +5 -5
  39. package/dist/components/LogoutButton/LogoutButton.esm.js.map +1 -1
  40. package/dist/components/MenuItemLink/MenuItemLink.esm.js +6 -3
  41. package/dist/components/MenuItemLink/MenuItemLink.esm.js.map +1 -1
  42. package/dist/components/MenuItemLink/MenuItemLinkContent.esm.js +46 -39
  43. package/dist/components/MenuItemLink/MenuItemLinkContent.esm.js.map +1 -1
  44. package/dist/components/NotificationBanner.esm.js +9 -8
  45. package/dist/components/NotificationBanner.esm.js.map +1 -1
  46. package/dist/components/NotificationButton/NotificationButton.esm.js +7 -7
  47. package/dist/components/NotificationButton/NotificationButton.esm.js.map +1 -1
  48. package/dist/components/SearchComponent/SearchBar.esm.js +7 -6
  49. package/dist/components/SearchComponent/SearchBar.esm.js.map +1 -1
  50. package/dist/components/SearchComponent/SearchComponent.esm.js +7 -6
  51. package/dist/components/SearchComponent/SearchComponent.esm.js.map +1 -1
  52. package/dist/components/SearchComponent/SearchInput.esm.js +3 -3
  53. package/dist/components/SearchComponent/SearchInput.esm.js.map +1 -1
  54. package/dist/components/SearchComponent/SearchOption.esm.js +19 -13
  55. package/dist/components/SearchComponent/SearchOption.esm.js.map +1 -1
  56. package/dist/components/SearchComponent/SearchResultItem.esm.js +18 -18
  57. package/dist/components/SearchComponent/SearchResultItem.esm.js.map +1 -1
  58. package/dist/components/Spacer/Spacer.esm.js +2 -2
  59. package/dist/components/Spacer/Spacer.esm.js.map +1 -1
  60. package/dist/components/SupportButton/SupportButton.esm.js +17 -17
  61. package/dist/components/SupportButton/SupportButton.esm.js.map +1 -1
  62. package/dist/defaultMountPoints/defaultMountPoints.esm.js +11 -0
  63. package/dist/defaultMountPoints/defaultMountPoints.esm.js.map +1 -1
  64. package/dist/hooks/useDebouncedCallback.esm.js +4 -4
  65. package/dist/hooks/useDebouncedCallback.esm.js.map +1 -1
  66. package/dist/hooks/useDropdownManager.esm.js +2 -2
  67. package/dist/hooks/useDropdownManager.esm.js.map +1 -1
  68. package/dist/index.d.ts +51 -36
  69. package/dist/index.esm.js +1 -1
  70. package/dist/plugin.esm.js +11 -2
  71. package/dist/plugin.esm.js.map +1 -1
  72. package/dist/utils/stringUtils.esm.js +12 -12
  73. package/dist/utils/stringUtils.esm.js.map +1 -1
  74. package/package.json +28 -25
@@ -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, useRef, useState } from 'react';\nimport { useUserProfile } from '@backstage/plugin-user-settings';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport { UserEntity } from '@backstage/catalog-model';\nimport AccountCircleOutlinedIcon from '@mui/icons-material/AccountCircleOutlined';\nimport KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined';\nimport Avatar from '@mui/material/Avatar';\nimport Typography from '@mui/material/Typography';\nimport { lighten } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\n\nimport { MenuSection } from './MenuSection';\nimport { HeaderDropdownComponent } from './HeaderDropdownComponent';\nimport { useProfileDropdownMountPoints } from '../../hooks/useProfileDropdownMountPoints';\nimport { useDropdownManager } from '../../hooks';\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 const [user, setUser] = useState<string | null>();\n const {\n displayName,\n backstageIdentity,\n profile,\n loading: profileLoading,\n } = useUserProfile();\n const catalogApi = useApi(catalogApiRef);\n\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 fetchUserEntity = async () => {\n let userProfile;\n try {\n if (backstageIdentity?.userEntityRef) {\n userProfile = (await catalogApi.getEntityByRef(\n backstageIdentity.userEntityRef,\n )) as unknown as UserEntity;\n }\n setUser(\n userProfile?.spec?.profile?.displayName ??\n userProfile?.metadata?.title,\n );\n } catch (_err) {\n setUser(null);\n }\n };\n\n fetchUserEntity();\n }, [backstageIdentity, catalogApi]);\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 const profileDisplayName = () => {\n const name = user ?? displayName;\n const regex = /^[^:/]+:[^/]+\\/[^/]+$/;\n if (regex.test(name)) {\n return name\n .charAt(name.indexOf('/') + 1)\n .toLocaleUpperCase('en-US')\n .concat(name.substring(name.indexOf('/') + 2));\n }\n return name;\n };\n\n return (\n <HeaderDropdownComponent\n buttonContent={\n <Box sx={{ display: 'flex', alignItems: 'center', ...layout }}>\n {!profileLoading && (\n <>\n {profile.picture ? (\n <Avatar\n src={profile.picture}\n sx={{ mr: 2, height: '32px', width: '32px' }}\n alt=\"Profile picture\"\n />\n ) : (\n <AccountCircleOutlinedIcon fontSize=\"small\" sx={{ mr: 1 }} />\n )}\n <Typography\n variant=\"body2\"\n sx={{\n display: { xs: 'none', md: 'block' },\n fontWeight: 500,\n mr: '1rem',\n }}\n >\n {profileDisplayName()}\n </Typography>\n </>\n )}\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":";;;;;;;;;;;;;;;AAyCO,MAAM,eAAkB,GAAA,CAAC,EAAE,MAAA,EAAmC,KAAA;AACnE,EAAA,M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,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
+ {"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 { useEffect, useMemo, useRef, useState } from 'react';\nimport type { CSSProperties } from 'react';\nimport { useUserProfile } from '@backstage/plugin-user-settings';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport { UserEntity } from '@backstage/catalog-model';\nimport AccountCircleOutlinedIcon from '@mui/icons-material/AccountCircleOutlined';\nimport KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined';\nimport Avatar from '@mui/material/Avatar';\nimport Typography from '@mui/material/Typography';\nimport { lighten } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\n\nimport { MenuSection } from './MenuSection';\nimport { HeaderDropdownComponent } from './HeaderDropdownComponent';\nimport { useProfileDropdownMountPoints } from '../../hooks/useProfileDropdownMountPoints';\nimport { useDropdownManager } from '../../hooks';\n\n/**\n * @public\n * Props for Profile Dropdown\n */\nexport interface ProfileDropdownProps {\n layout?: CSSProperties;\n}\n\nexport const ProfileDropdown = ({ layout }: ProfileDropdownProps) => {\n const { anchorEl, handleOpen, handleClose } = useDropdownManager();\n const [user, setUser] = useState<string | null>();\n const {\n displayName,\n backstageIdentity,\n profile,\n loading: profileLoading,\n } = useUserProfile();\n const catalogApi = useApi(catalogApiRef);\n\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 fetchUserEntity = async () => {\n let userProfile;\n try {\n if (backstageIdentity?.userEntityRef) {\n userProfile = (await catalogApi.getEntityByRef(\n backstageIdentity.userEntityRef,\n )) as unknown as UserEntity;\n }\n setUser(\n userProfile?.spec?.profile?.displayName ??\n userProfile?.metadata?.title,\n );\n } catch (_err) {\n setUser(null);\n }\n };\n\n fetchUserEntity();\n }, [backstageIdentity, catalogApi]);\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 const profileDisplayName = () => {\n const name = user ?? displayName;\n const regex = /^[^:/]+:[^/]+\\/[^/]+$/;\n if (regex.test(name)) {\n return name\n .charAt(name.indexOf('/') + 1)\n .toLocaleUpperCase('en-US')\n .concat(name.substring(name.indexOf('/') + 2));\n }\n return name;\n };\n\n return (\n <HeaderDropdownComponent\n buttonContent={\n <Box sx={{ display: 'flex', alignItems: 'center', ...layout }}>\n {!profileLoading && (\n <>\n {profile.picture ? (\n <Avatar\n src={profile.picture}\n sx={{ mr: 2, height: '32px', width: '32px' }}\n alt=\"Profile picture\"\n />\n ) : (\n <AccountCircleOutlinedIcon fontSize=\"small\" sx={{ mr: 1 }} />\n )}\n <Typography\n variant=\"body2\"\n sx={{\n display: { xs: 'none', md: 'block' },\n fontWeight: 500,\n mr: '1rem',\n }}\n >\n {profileDisplayName()}\n </Typography>\n </>\n )}\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":";;;;;;;;;;;;;;;;AA0CO,MAAM,eAAkB,GAAA,CAAC,EAAE,MAAA,EAAmC,KAAA;AACnE,EAAA,MAAM,EAAE,QAAA,EAAU,UAAY,EAAA,WAAA,KAAgB,kBAAmB,EAAA;AACjE,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,QAAwB,EAAA;AAChD,EAAM,MAAA;AAAA,IACJ,WAAA;AAAA,IACA,iBAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAS,EAAA;AAAA,MACP,cAAe,EAAA;AACnB,EAAM,MAAA,U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AA,UACT,UAAY,EAAA;AAAA;AACd,OACF;AAAA,MACA,MAAQ,EAAA,UAAA;AAAA,MACR,OAAS,EAAA,WAAA;AAAA,MACT,QAAA;AAAA,MAEA,8BAAC,WAAY,EAAA,EAAA,WAAA,EAAW,IAAC,EAAA,KAAA,EAAO,WAAW,WAA0B,EAAA;AAAA;AAAA,GACvE;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx } from 'react/jsx-runtime';
2
2
  import { MenuSection } from './MenuSection.esm.js';
3
3
  import { MenuItemLink } from '../MenuItemLink/MenuItemLink.esm.js';
4
4
 
@@ -6,7 +6,7 @@ const RegisterAComponentSection = ({
6
6
  hideDivider,
7
7
  handleClose
8
8
  }) => {
9
- return /* @__PURE__ */ React.createElement(
9
+ return /* @__PURE__ */ jsx(
10
10
  MenuSection,
11
11
  {
12
12
  hideDivider,
@@ -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 { 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
+ {"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 */\nimport type { ComponentType } 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 ComponentType,\n },\n ]}\n handleClose={handleClose}\n />\n );\n};\n"],"names":[],"mappings":";;;;AA6BO,MAAM,4BAA4B,CAAC;AAAA,EACxC,WAAA;AAAA,EACA;AACF,CAAsC,KAAA;AACpC,EACE,uBAAA,GAAA;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,4 +1,5 @@
1
- import React, { useState, useEffect, useMemo } from 'react';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { useState, useEffect, useMemo } from 'react';
2
3
  import { useApi } from '@backstage/core-plugin-api';
3
4
  import { catalogApiRef } from '@backstage/plugin-catalog-react';
4
5
  import Box from '@mui/material/Box';
@@ -39,19 +40,22 @@ const SoftwareTemplatesSection = ({
39
40
  }));
40
41
  }, [entities]);
41
42
  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
+ return /* @__PURE__ */ jsx(Box, { display: "flex", justifyContent: "center", alignItems: "center", p: 2, children: /* @__PURE__ */ jsx(Typography, { variant: "body1", color: "error", children: "Error fetching templates" }) });
43
44
  }
44
45
  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 } }));
46
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
47
+ /* @__PURE__ */ jsx(
48
+ Typography,
49
+ {
50
+ variant: "body2",
51
+ sx: { mx: 2, my: 1, color: "text.disabled" },
52
+ children: "No templates available"
53
+ }
54
+ ),
55
+ !hideDivider && /* @__PURE__ */ jsx(Divider, { sx: { my: 0.5 } })
56
+ ] });
53
57
  }
54
- return /* @__PURE__ */ React.createElement(
58
+ return /* @__PURE__ */ jsx(
55
59
  MenuSection,
56
60
  {
57
61
  hideDivider,
@@ -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, { 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,UAA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C,OAAQ,EAAA,OAAA;AAAA,QACR,IAAI,EAAE,EAAA,EAAI,GAAG,EAAI,EAAA,CAAA,EAAG,OAAO,eAAgB;AAAA,OAAA;AAAA,MAC5C;AAAA,KAED,EACC,CAAC,WAAA,oBAAgB,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,IAAI,EAAE,EAAA,EAAI,GAAI,EAAA,EAAG,CAC7C,CAAA;AAAA;AAGJ,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 { useEffect, useMemo, useState } from 'react';\nimport type { ComponentType } 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 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":";;;;;;;;;;AAwCO,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;AAC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AA;AAIJ,EAAI,IAAA,KAAA,CAAM,WAAW,CAAG,EAAA;AACtB,IAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,OAAQ,EAAA,OAAA;AAAA,UACR,IAAI,EAAE,EAAA,EAAI,GAAG,EAAI,EAAA,CAAA,EAAG,OAAO,eAAgB,EAAA;AAAA,UAC5C,QAAA,EAAA;AAAA;AAAA,OAED;AAAA,MACC,CAAC,+BAAgB,GAAA,CAAA,OAAA,EAAA,EAAQ,IAAI,EAAE,EAAA,EAAI,KAAO,EAAA;AAAA,KAC7C,EAAA,CAAA;AAAA;AAGJ,EACE,uBAAA,GAAA;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,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { useStarredEntities, useEntityPresentation } from '@backstage/plugin-catalog-react';
3
3
  import { Link } from '@backstage/core-components';
4
4
  import { parseEntityRef } from '@backstage/catalog-model';
@@ -24,73 +24,78 @@ const StarredItem = ({
24
24
  const { Icon, primaryTitle, secondaryTitle } = useEntityPresentation(entityRef);
25
25
  const { name, kind, namespace } = parseEntityRef(entityRef);
26
26
  const theme = useTheme();
27
- return /* @__PURE__ */ React.createElement(
27
+ return /* @__PURE__ */ jsxs(
28
28
  MenuItem,
29
29
  {
30
30
  component: Link,
31
31
  to: `/catalog/${namespace || "default"}/${kind}/${name}`,
32
32
  onClick: handleClose,
33
33
  disableRipple: true,
34
- disableTouchRipple: true
35
- },
36
- Icon && /* @__PURE__ */ React.createElement(ListItemIcon, { sx: { minWidth: 36 } }, /* @__PURE__ */ React.createElement(Icon, null)),
37
- /* @__PURE__ */ React.createElement(
38
- ListItemText,
39
- {
40
- primary: /* @__PURE__ */ React.createElement(Typography, { sx: { color: theme.palette.text.primary } }, primaryTitle || secondaryTitle),
41
- secondary: kind.toLocaleUpperCase(),
42
- sx: { ml: 1, mr: 1 }
43
- }
44
- ),
45
- /* @__PURE__ */ React.createElement(Tooltip, { title: "Remove from list" }, /* @__PURE__ */ React.createElement(
46
- IconButton,
47
- {
48
- onClick: (e) => {
49
- e.preventDefault();
50
- e.stopPropagation();
51
- toggleStarredEntity(entityRef);
52
- }
53
- },
54
- /* @__PURE__ */ React.createElement(Star, { color: "warning" })
55
- ))
34
+ disableTouchRipple: true,
35
+ children: [
36
+ Icon && /* @__PURE__ */ jsx(ListItemIcon, { sx: { minWidth: 36 }, children: /* @__PURE__ */ jsx(Icon, {}) }),
37
+ /* @__PURE__ */ jsx(
38
+ ListItemText,
39
+ {
40
+ primary: /* @__PURE__ */ jsx(Typography, { sx: { color: theme.palette.text.primary }, children: primaryTitle || secondaryTitle }),
41
+ secondary: kind.toLocaleUpperCase(),
42
+ sx: { ml: 1, mr: 1 }
43
+ }
44
+ ),
45
+ /* @__PURE__ */ jsx(Tooltip, { title: "Remove from list", children: /* @__PURE__ */ jsx(
46
+ IconButton,
47
+ {
48
+ onClick: (e) => {
49
+ e.preventDefault();
50
+ e.stopPropagation();
51
+ toggleStarredEntity(entityRef);
52
+ },
53
+ children: /* @__PURE__ */ jsx(Star, { color: "warning" })
54
+ }
55
+ ) })
56
+ ]
57
+ }
56
58
  );
57
59
  };
58
60
  const StarredDropdown = () => {
59
61
  const { anchorEl, handleOpen, handleClose } = useDropdownManager();
60
62
  const { starredEntities, toggleStarredEntity } = useStarredEntities();
61
63
  const entitiesArray = Array.from(starredEntities);
62
- return /* @__PURE__ */ React.createElement(
64
+ return /* @__PURE__ */ jsx(
63
65
  HeaderDropdownComponent,
64
66
  {
65
- buttonContent: /* @__PURE__ */ React.createElement(StarBorderIcon, null),
67
+ buttonContent: /* @__PURE__ */ jsx(StarBorderIcon, {}),
66
68
  onOpen: handleOpen,
67
69
  onClose: handleClose,
68
70
  anchorEl,
69
71
  tooltip: "Your starred items",
70
- isIconButton: true
71
- },
72
- entitiesArray.length > 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
73
- ListItemText,
74
- {
75
- primary: "Your starred items",
76
- sx: { pl: 2, mt: 1, fontWeight: "bold", color: "text.secondary" }
77
- }
78
- ), entitiesArray.map((enitityRef) => /* @__PURE__ */ React.createElement(
79
- StarredItem,
80
- {
81
- key: enitityRef,
82
- entityRef: enitityRef,
83
- toggleStarredEntity,
84
- handleClose
85
- }
86
- ))) : /* @__PURE__ */ React.createElement(
87
- DropdownEmptyState,
88
- {
89
- title: "No starred items yet",
90
- subTitle: "Click the star icon next to an entity's name to save it here for quick access.",
91
- icon: /* @__PURE__ */ React.createElement(AutoAwesomeIcon, { sx: { fontSize: 64 }, color: "disabled" })
92
- }
93
- )
72
+ isIconButton: true,
73
+ children: entitiesArray.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
74
+ /* @__PURE__ */ jsx(
75
+ ListItemText,
76
+ {
77
+ primary: "Your starred items",
78
+ sx: { pl: 2, mt: 1, fontWeight: "bold", color: "text.secondary" }
79
+ }
80
+ ),
81
+ entitiesArray.map((enitityRef) => /* @__PURE__ */ jsx(
82
+ StarredItem,
83
+ {
84
+ entityRef: enitityRef,
85
+ toggleStarredEntity,
86
+ handleClose
87
+ },
88
+ enitityRef
89
+ ))
90
+ ] }) : /* @__PURE__ */ jsx(
91
+ DropdownEmptyState,
92
+ {
93
+ title: "No starred items yet",
94
+ subTitle: "Click the star icon next to an entity's name to save it here for quick access.",
95
+ icon: /* @__PURE__ */ jsx(AutoAwesomeIcon, { sx: { fontSize: 64 }, color: "disabled" })
96
+ }
97
+ )
98
+ }
94
99
  );
95
100
  };
96
101
 
@@ -1 +1 @@
1
- {"version":3,"file":"StarredDropdown.esm.js","sources":["../../../src/components/HeaderDropdownComponent/StarredDropdown.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 useEntityPresentation,\n useStarredEntities,\n} from '@backstage/plugin-catalog-react';\nimport { Link } from '@backstage/core-components';\nimport {\n CompoundEntityRef,\n Entity,\n parseEntityRef,\n} from '@backstage/catalog-model';\nimport StarBorderIcon from '@mui/icons-material/StarBorder';\nimport Star from '@mui/icons-material/Star';\nimport AutoAwesomeIcon from '@mui/icons-material/AutoAwesome';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\n\nimport { useTheme } from '@mui/material/styles';\nimport MenuItem from '@mui/material/MenuItem';\nimport Typography from '@mui/material/Typography';\nimport IconButton from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\n\nimport { useDropdownManager } from '../../hooks';\nimport { HeaderDropdownComponent } from './HeaderDropdownComponent';\nimport { DropdownEmptyState } from './DropdownEmptyState';\n\n/**\n * @public\n * Props for each starred entitify item\n */\ninterface SectionComponentProps {\n entityRef: string | CompoundEntityRef | Entity;\n toggleStarredEntity: (\n entityOrRef: Entity | CompoundEntityRef | string,\n ) => void;\n handleClose: () => void;\n}\n\nconst StarredItem: React.FC<SectionComponentProps> = ({\n entityRef,\n toggleStarredEntity,\n handleClose,\n}) => {\n const { Icon, primaryTitle, secondaryTitle } =\n useEntityPresentation(entityRef);\n const { name, kind, namespace } = parseEntityRef(entityRef as string);\n const theme = useTheme();\n\n return (\n <MenuItem\n component={Link}\n to={`/catalog/${namespace || 'default'}/${kind}/${name}`}\n onClick={handleClose}\n disableRipple\n disableTouchRipple\n >\n {Icon && (\n <ListItemIcon sx={{ minWidth: 36 }}>\n <Icon />\n </ListItemIcon>\n )}\n <ListItemText\n primary={\n <Typography sx={{ color: theme.palette.text.primary }}>\n {primaryTitle || secondaryTitle}\n </Typography>\n }\n secondary={kind.toLocaleUpperCase()}\n // inset={!Icon}\n sx={{ ml: 1, mr: 1 }}\n />\n <Tooltip title=\"Remove from list\">\n <IconButton\n onClick={e => {\n e.preventDefault();\n e.stopPropagation();\n toggleStarredEntity(entityRef);\n }}\n >\n <Star color=\"warning\" />\n </IconButton>\n </Tooltip>\n </MenuItem>\n );\n};\n\nexport const StarredDropdown = () => {\n const { anchorEl, handleOpen, handleClose } = useDropdownManager();\n const { starredEntities, toggleStarredEntity } = useStarredEntities();\n\n const entitiesArray = Array.from(starredEntities);\n\n return (\n <HeaderDropdownComponent\n buttonContent={<StarBorderIcon />}\n onOpen={handleOpen}\n onClose={handleClose}\n anchorEl={anchorEl}\n tooltip=\"Your starred items\"\n isIconButton\n >\n {entitiesArray.length > 0 ? (\n <>\n <ListItemText\n primary=\"Your starred items\"\n sx={{ pl: 2, mt: 1, fontWeight: 'bold', color: 'text.secondary' }}\n />\n {entitiesArray.map(enitityRef => (\n <StarredItem\n key={enitityRef}\n entityRef={enitityRef}\n toggleStarredEntity={toggleStarredEntity}\n handleClose={handleClose}\n />\n ))}\n </>\n ) : (\n <DropdownEmptyState\n title=\"No starred items yet\"\n subTitle=\"Click the star icon next to an entity's name to save it here for quick access.\"\n icon={<AutoAwesomeIcon sx={{ fontSize: 64 }} color=\"disabled\" />}\n />\n )}\n </HeaderDropdownComponent>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAwDA,MAAM,cAA+C,CAAC;AAAA,EACpD,SAAA;AAAA,EACA,mBAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EAAA,MAAM,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;AAAA,KAEH,CACH,CAEA,mBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,kBAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,sBAAA;AAAA,QACN,QAAS,EAAA,gFAAA;AAAA,QACT,IAAA,sCAAO,eAAgB,EAAA,EAAA,EAAA,EAAI,EAAE,QAAU,EAAA,EAAA,EAAM,EAAA,KAAA,EAAM,UAAW,EAAA;AAAA;AAAA;AAChE,GAEJ;AAEJ;;;;"}
1
+ {"version":3,"file":"StarredDropdown.esm.js","sources":["../../../src/components/HeaderDropdownComponent/StarredDropdown.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 type { FC } from 'react';\nimport {\n useEntityPresentation,\n useStarredEntities,\n} from '@backstage/plugin-catalog-react';\nimport { Link } from '@backstage/core-components';\nimport {\n CompoundEntityRef,\n Entity,\n parseEntityRef,\n} from '@backstage/catalog-model';\nimport StarBorderIcon from '@mui/icons-material/StarBorder';\nimport Star from '@mui/icons-material/Star';\nimport AutoAwesomeIcon from '@mui/icons-material/AutoAwesome';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\n\nimport { useTheme } from '@mui/material/styles';\nimport MenuItem from '@mui/material/MenuItem';\nimport Typography from '@mui/material/Typography';\nimport IconButton from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\n\nimport { useDropdownManager } from '../../hooks';\nimport { HeaderDropdownComponent } from './HeaderDropdownComponent';\nimport { DropdownEmptyState } from './DropdownEmptyState';\n\n/**\n * @public\n * Props for each starred entitify item\n */\ninterface SectionComponentProps {\n entityRef: string | CompoundEntityRef | Entity;\n toggleStarredEntity: (\n entityOrRef: Entity | CompoundEntityRef | string,\n ) => void;\n handleClose: () => void;\n}\n\nconst StarredItem: FC<SectionComponentProps> = ({\n entityRef,\n toggleStarredEntity,\n handleClose,\n}) => {\n const { Icon, primaryTitle, secondaryTitle } =\n useEntityPresentation(entityRef);\n const { name, kind, namespace } = parseEntityRef(entityRef as string);\n const theme = useTheme();\n\n return (\n <MenuItem\n component={Link}\n to={`/catalog/${namespace || 'default'}/${kind}/${name}`}\n onClick={handleClose}\n disableRipple\n disableTouchRipple\n >\n {Icon && (\n <ListItemIcon sx={{ minWidth: 36 }}>\n <Icon />\n </ListItemIcon>\n )}\n <ListItemText\n primary={\n <Typography sx={{ color: theme.palette.text.primary }}>\n {primaryTitle || secondaryTitle}\n </Typography>\n }\n secondary={kind.toLocaleUpperCase()}\n // inset={!Icon}\n sx={{ ml: 1, mr: 1 }}\n />\n <Tooltip title=\"Remove from list\">\n <IconButton\n onClick={e => {\n e.preventDefault();\n e.stopPropagation();\n toggleStarredEntity(entityRef);\n }}\n >\n <Star color=\"warning\" />\n </IconButton>\n </Tooltip>\n </MenuItem>\n );\n};\n\nexport const StarredDropdown = () => {\n const { anchorEl, handleOpen, handleClose } = useDropdownManager();\n const { starredEntities, toggleStarredEntity } = useStarredEntities();\n\n const entitiesArray = Array.from(starredEntities);\n\n return (\n <HeaderDropdownComponent\n buttonContent={<StarBorderIcon />}\n onOpen={handleOpen}\n onClose={handleClose}\n anchorEl={anchorEl}\n tooltip=\"Your starred items\"\n isIconButton\n >\n {entitiesArray.length > 0 ? (\n <>\n <ListItemText\n primary=\"Your starred items\"\n sx={{ pl: 2, mt: 1, fontWeight: 'bold', color: 'text.secondary' }}\n />\n {entitiesArray.map(enitityRef => (\n <StarredItem\n key={enitityRef}\n entityRef={enitityRef}\n toggleStarredEntity={toggleStarredEntity}\n handleClose={handleClose}\n />\n ))}\n </>\n ) : (\n <DropdownEmptyState\n title=\"No starred items yet\"\n subTitle=\"Click the star icon next to an entity's name to save it here for quick access.\"\n icon={<AutoAwesomeIcon sx={{ fontSize: 64 }} color=\"disabled\" />}\n />\n )}\n </HeaderDropdownComponent>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAuDA,MAAM,cAAyC,CAAC;AAAA,EAC9C,SAAA;AAAA,EACA,mBAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EAAA,MAAM,EAAE,IAAM,EAAA,YAAA,EAAc,cAAe,EAAA,GACzC,sBAAsB,SAAS,CAAA;AACjC,EAAA,MAAM,EAAE,IAAM,EAAA,IAAA,EAAM,SAAU,EAAA,GAAI,eAAe,SAAmB,CAAA;AACpE,EAAA,MAAM,QAAQ,QAAS,EAAA;AAEvB,EACE,uBAAA,IAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,IAAA;AAAA,MACX,IAAI,CAAY,SAAA,EAAA,SAAA,IAAa,SAAS,CAAI,CAAA,EAAA,IAAI,IAAI,IAAI,CAAA,CAAA;AAAA,MACtD,OAAS,EAAA,WAAA;AAAA,MACT,aAAa,EAAA,IAAA;AAAA,MACb,kBAAkB,EAAA,IAAA;AAAA,MAEjB,QAAA,EAAA;AAAA,QACC,IAAA,oBAAA,GAAA,CAAC,gBAAa,EAAI,EAAA,EAAE,UAAU,EAAG,EAAA,EAC/B,QAAC,kBAAA,GAAA,CAAA,IAAA,EAAA,EAAK,CACR,EAAA,CAAA;AAAA,wBAEF,GAAA;AAAA,UAAC,YAAA;AAAA,UAAA;AAAA,YACC,OACE,kBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,EAAA,EAAI,EAAE,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,OAAA,EACzC,EAAA,QAAA,EAAA,YAAA,IAAgB,cACnB,EAAA,CAAA;AAAA,YAEF,SAAA,EAAW,KAAK,iBAAkB,EAAA;AAAA,YAElC,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,UAAA,EAAY,MAAQ,EAAA,KAAA,EAAO,gBAAiB;AAAA;AAAA,SAClE;AAAA,QACC,aAAA,CAAc,IAAI,CACjB,UAAA,qBAAA,GAAA;AAAA,UAAC,WAAA;AAAA,UAAA;AAAA,YAEC,SAAW,EAAA,UAAA;AAAA,YACX,mBAAA;AAAA,YACA;AAAA,WAAA;AAAA,UAHK;AAAA,SAKR;AAAA,OAAA,EACH,CAEA,mBAAA,GAAA;AAAA,QAAC,kBAAA;AAAA,QAAA;AAAA,UACC,KAAM,EAAA,sBAAA;AAAA,UACN,QAAS,EAAA,gFAAA;AAAA,UACT,IAAA,sBAAO,eAAgB,EAAA,EAAA,EAAA,EAAI,EAAE,QAAU,EAAA,EAAA,EAAM,EAAA,KAAA,EAAM,UAAW,EAAA;AAAA;AAAA;AAChE;AAAA,GAEJ;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx } from 'react/jsx-runtime';
2
2
  import { useApp } from '@backstage/core-plugin-api';
3
3
  import MuiIcon from '@mui/material/Icon';
4
4
  import Box from '@mui/material/Box';
@@ -14,31 +14,31 @@ const HeaderIcon = ({
14
14
  }
15
15
  const SystemIcon = app.getSystemIcon(icon);
16
16
  if (SystemIcon) {
17
- return /* @__PURE__ */ React.createElement(Box, { sx: { display: "flex", alignItems: "center", ...layout } }, /* @__PURE__ */ React.createElement(SystemIcon, { fontSize: size }));
17
+ return /* @__PURE__ */ jsx(Box, { sx: { display: "flex", alignItems: "center", ...layout }, children: /* @__PURE__ */ jsx(SystemIcon, { fontSize: size }) });
18
18
  }
19
19
  if (icon.startsWith("<svg")) {
20
20
  const svgDataUri = `data:image/svg+xml;base64,${btoa(icon)}`;
21
- return /* @__PURE__ */ React.createElement(MuiIcon, { fontSize: size, sx: layout }, /* @__PURE__ */ React.createElement("img", { src: svgDataUri, alt: "" }));
21
+ return /* @__PURE__ */ jsx(MuiIcon, { fontSize: size, sx: layout, children: /* @__PURE__ */ jsx("img", { src: svgDataUri, alt: "" }) });
22
22
  }
23
23
  if (icon.startsWith("https://") || icon.startsWith("http://") || icon.startsWith("/")) {
24
- return /* @__PURE__ */ React.createElement(
24
+ return /* @__PURE__ */ jsx(
25
25
  MuiIcon,
26
26
  {
27
27
  fontSize: size,
28
28
  baseClassName: "material-icons-outlined",
29
- sx: layout
30
- },
31
- /* @__PURE__ */ React.createElement("img", { src: icon, alt: "", height: "100%", width: "100%" })
29
+ sx: layout,
30
+ children: /* @__PURE__ */ jsx("img", { src: icon, alt: "", height: "100%", width: "100%" })
31
+ }
32
32
  );
33
33
  }
34
- return /* @__PURE__ */ React.createElement(
34
+ return /* @__PURE__ */ jsx(
35
35
  MuiIcon,
36
36
  {
37
37
  fontSize: size,
38
38
  baseClassName: "material-icons-outlined",
39
- sx: layout
40
- },
41
- icon
39
+ sx: layout,
40
+ children: icon
41
+ }
42
42
  );
43
43
  };
44
44
 
@@ -1 +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=\"\" height=\"100%\" width=\"100%\" />\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,sBAEJ,KAAA,CAAA,aAAA,CAAC,SAAI,GAAK,EAAA,IAAA,EAAM,KAAI,EAAG,EAAA,MAAA,EAAO,MAAO,EAAA,KAAA,EAAM,MAAO,EAAA;AAAA,KACpD;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;;;;"}
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 type { CSSProperties } 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?: 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=\"\" height=\"100%\" width=\"100%\" />\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,GAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,E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Link as Link$1 } from '@backstage/core-components';
3
3
  import Box from '@mui/material/Box';
4
4
  import IconButton from '@mui/material/IconButton';
5
5
  import Tooltip from '@mui/material/Tooltip';
6
6
  import { HeaderIcon } from '../HeaderIcon/HeaderIcon.esm.js';
7
7
 
8
- const Link = (props) => /* @__PURE__ */ React.createElement(Link$1, { ...props, color: "inherit", externalLinkIcon: false });
8
+ const Link = (props) => /* @__PURE__ */ jsx(Link$1, { ...props, color: "inherit", externalLinkIcon: false });
9
9
  const HeaderIconButton = ({
10
10
  title,
11
11
  icon,
@@ -20,17 +20,17 @@ const HeaderIconButton = ({
20
20
  console.warn("HeaderIconButton has no title:", { icon, to });
21
21
  }
22
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(
23
+ return /* @__PURE__ */ jsx(Box, { sx: layout, children: /* @__PURE__ */ jsx(Tooltip, { title: tooltip ?? title, children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
24
24
  IconButton,
25
25
  {
26
26
  LinkComponent: Link,
27
27
  color,
28
28
  size,
29
29
  "aria-label": ariaLabel ?? title,
30
- ...linkProps
31
- },
32
- /* @__PURE__ */ React.createElement(HeaderIcon, { icon, size })
33
- ))));
30
+ ...linkProps,
31
+ children: /* @__PURE__ */ jsx(HeaderIcon, { icon, size })
32
+ }
33
+ ) }) }) });
34
34
  };
35
35
 
36
36
  export { HeaderIconButton };
@@ -1 +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
+ {"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 type { CSSProperties } from 'react';\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?: 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":";;;;;;;AAwCA,MAAM,IAAA,GAAO,CAAC,KAAA,qBACX,GAAA,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,GAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,MACP,EAAA,QAAA,kBAAA,GAAA,CAAC,WAAQ,KAAO,EAAA,OAAA,IAAW,KACzB,EAAA,QAAA,kBAAA,GAAA,CAAC,KACC,EAAA,EAAA,QAAA,kBAAA,GAAA;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,SAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,IAAA,EAAY,IAAY,EAAA;AAAA;AAAA,GACtC,EACF,GACF,CACF,EAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx } from 'react/jsx-runtime';
2
2
  import { useApi, errorApiRef, identityApiRef } from '@backstage/core-plugin-api';
3
3
  import MenuItem from '@mui/material/MenuItem';
4
4
  import { MenuItemLinkContent } from '../MenuItemLink/MenuItemLinkContent.esm.js';
@@ -9,13 +9,13 @@ const LogoutButton = () => {
9
9
  const handleLogout = () => {
10
10
  identityApi.signOut().catch((error) => errorApi.post(error));
11
11
  };
12
- return /* @__PURE__ */ React.createElement(
12
+ return /* @__PURE__ */ jsx(
13
13
  MenuItem,
14
14
  {
15
15
  onClick: handleLogout,
16
- sx: { cursor: "pointer", width: "100%", color: "inherit" }
17
- },
18
- /* @__PURE__ */ React.createElement(MenuItemLinkContent, { icon: "logout", label: "Sign out" })
16
+ sx: { cursor: "pointer", width: "100%", color: "inherit" },
17
+ children: /* @__PURE__ */ jsx(MenuItemLinkContent, { icon: "logout", label: "Sign out" })
18
+ }
19
19
  );
20
20
  };
21
21
 
@@ -1 +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 MenuItem from '@mui/material/MenuItem';\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 return (\n <MenuItem\n onClick={handleLogout}\n sx={{ cursor: 'pointer', width: '100%', color: 'inherit' }}\n >\n <MenuItemLinkContent icon=\"logout\" label=\"Sign out\" />\n </MenuItem>\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;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,QAAA;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,UAAW,EAAA;AAAA,GACtD;AAEJ;;;;"}
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 {\n errorApiRef,\n identityApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\n\nimport MenuItem from '@mui/material/MenuItem';\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 return (\n <MenuItem\n onClick={handleLogout}\n sx={{ cursor: 'pointer', width: '100%', color: 'inherit' }}\n >\n <MenuItemLinkContent icon=\"logout\" label=\"Sign out\" />\n </MenuItem>\n );\n};\n"],"names":[],"mappings":";;;;;AA0BO,MAAM,eAAe,MAAM;AAChC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA;AAEzC,EAAA,MAAM,eAAe,MAAM;AACzB,IAAA,WAAA,CAAY,SAAU,CAAA,KAAA,CAAM,WAAS,QAAS,CAAA,IAAA,CAAK,KAAK,CAAC,CAAA;AAAA,GAC3D;AAEA,EACE,uBAAA,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA,YAAA;AAAA,MACT,IAAI,EAAE,MAAA,EAAQ,WAAW,KAAO,EAAA,MAAA,EAAQ,OAAO,SAAU,EAAA;AAAA,MAEzD,QAAC,kBAAA,GAAA,CAAA,mBAAA,EAAA,EAAoB,IAAK,EAAA,QAAA,EAAS,OAAM,UAAW,EAAA;AAAA;AAAA,GACtD;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import Tooltip from '@mui/material/Tooltip';
3
3
  import { MenuItemLinkContent } from './MenuItemLinkContent.esm.js';
4
4
 
@@ -10,7 +10,7 @@ const MenuItemLink = ({
10
10
  tooltip
11
11
  }) => {
12
12
  const isExternalLink = to.startsWith("http://") || to.startsWith("https://");
13
- const headerLinkContent = () => /* @__PURE__ */ React.createElement(
13
+ const headerLinkContent = () => /* @__PURE__ */ jsx(
14
14
  MenuItemLinkContent,
15
15
  {
16
16
  icon,
@@ -19,7 +19,10 @@ const MenuItemLink = ({
19
19
  isExternalLink
20
20
  }
21
21
  );
22
- return /* @__PURE__ */ React.createElement(React.Fragment, null, tooltip && /* @__PURE__ */ React.createElement(Tooltip, { title: tooltip }, /* @__PURE__ */ React.createElement("div", null, headerLinkContent())), !tooltip && headerLinkContent());
22
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
23
+ tooltip && /* @__PURE__ */ jsx(Tooltip, { title: tooltip, children: /* @__PURE__ */ jsx("div", { children: headerLinkContent() }) }),
24
+ !tooltip && headerLinkContent()
25
+ ] });
23
26
  };
24
27
 
25
28
  export { MenuItemLink };
@@ -1 +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 { 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 isExternalLink = to.startsWith('http://') || to.startsWith('https://');\n\n const headerLinkContent = () => (\n <MenuItemLinkContent\n icon={icon}\n label={title}\n subLabel={subTitle}\n isExternalLink={isExternalLink}\n />\n );\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":";;;;AAgCO,MAAM,eAAe,CAAC;AAAA,EAC3B,EAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAyB,KAAA;AACvB,EAAA,MAAM,iBAAiB,EAAG,CAAA,UAAA,CAAW,SAAS,CAAK,IAAA,EAAA,CAAG,WAAW,UAAU,CAAA;AAE3E,EAAA,MAAM,oBAAoB,sBACxB,KAAA,CAAA,aAAA;AAAA,IAAC,mBAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,KAAO,EAAA,KAAA;AAAA,MACP,QAAU,EAAA,QAAA;AAAA,MACV;AAAA;AAAA,GACF;AAGF,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;;;;"}
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 Tooltip from '@mui/material/Tooltip';\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 isExternalLink = to.startsWith('http://') || to.startsWith('https://');\n\n const headerLinkContent = () => (\n <MenuItemLinkContent\n icon={icon}\n label={title}\n subLabel={subTitle}\n isExternalLink={isExternalLink}\n />\n );\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":";;;;AA+BO,MAAM,eAAe,CAAC;AAAA,EAC3B,EAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAyB,KAAA;AACvB,EAAA,MAAM,iBAAiB,EAAG,CAAA,UAAA,CAAW,SAAS,CAAK,IAAA,EAAA,CAAG,WAAW,UAAU,CAAA;AAE3E,EAAA,MAAM,oBAAoB,sBACxB,GAAA;AAAA,IAAC,mBAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,KAAO,EAAA,KAAA;AAAA,MACP,QAAU,EAAA,QAAA;AAAA,MACV;AAAA;AAAA,GACF;AAGF,EAAA,uBAEK,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,IACC,OAAA,oBAAA,GAAA,CAAC,WAAQ,KAAO,EAAA,OAAA,EACd,8BAAC,KAAK,EAAA,EAAA,QAAA,EAAA,iBAAA,IAAoB,CAC5B,EAAA,CAAA;AAAA,IAED,CAAC,WAAW,iBAAkB;AAAA,GACjC,EAAA,CAAA;AAEJ;;;;"}