@red-hat-developer-hub/backstage-plugin-theme 0.4.8 → 0.5.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 (67) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/config.d.ts +2 -1
  3. package/dist/backstage.esm.js.map +1 -1
  4. package/dist/components/ThemeProvider.esm.js.map +1 -1
  5. package/dist/darkTheme.esm.js.map +1 -1
  6. package/dist/fonts.esm.js +92 -0
  7. package/dist/fonts.esm.js.map +1 -0
  8. package/dist/hooks/useBranding.esm.js +1 -1
  9. package/dist/hooks/useBranding.esm.js.map +1 -1
  10. package/dist/hooks/useTheme.esm.js.map +1 -1
  11. package/dist/hooks/useThemeConfig.esm.js +2 -2
  12. package/dist/hooks/useThemeConfig.esm.js.map +1 -1
  13. package/dist/hooks/useThemeOptions.esm.js.map +1 -1
  14. package/dist/lightTheme.esm.js.map +1 -1
  15. package/dist/rhdh.esm.js +3 -3
  16. package/dist/rhdh.esm.js.map +1 -1
  17. package/dist/themes.esm.js.map +1 -1
  18. package/dist/typography.esm.js +10 -40
  19. package/dist/typography.esm.js.map +1 -1
  20. package/dist/utils/createComponents.esm.js +23 -0
  21. package/dist/utils/createComponents.esm.js.map +1 -1
  22. package/dist/utils/createPageTheme.esm.js.map +1 -1
  23. package/dist/utils/createPageThemes.esm.js +1 -1
  24. package/dist/utils/createPageThemes.esm.js.map +1 -1
  25. package/dist/utils/mergeTheme.esm.js +2 -2
  26. package/dist/utils/mergeTheme.esm.js.map +1 -1
  27. package/dist/utils/migrateTheme.esm.js.map +1 -1
  28. package/package.json +23 -18
  29. package/dist/plugins/theme/fonts/font.css.esm.js +0 -7
  30. package/dist/plugins/theme/fonts/font.css.esm.js.map +0 -1
  31. package/fonts/OPEN-FONT-LICENSE +0 -94
  32. package/fonts/README.md +0 -9
  33. package/fonts/RedHatDisplay/RedHatDisplay-Black.woff2 +0 -0
  34. package/fonts/RedHatDisplay/RedHatDisplay-BlackItalic.woff2 +0 -0
  35. package/fonts/RedHatDisplay/RedHatDisplay-Bold.woff2 +0 -0
  36. package/fonts/RedHatDisplay/RedHatDisplay-BoldItalic.woff2 +0 -0
  37. package/fonts/RedHatDisplay/RedHatDisplay-Italic.woff2 +0 -0
  38. package/fonts/RedHatDisplay/RedHatDisplay-Light.woff2 +0 -0
  39. package/fonts/RedHatDisplay/RedHatDisplay-LightItalic.woff2 +0 -0
  40. package/fonts/RedHatDisplay/RedHatDisplay-Medium.woff2 +0 -0
  41. package/fonts/RedHatDisplay/RedHatDisplay-MediumItalic.woff2 +0 -0
  42. package/fonts/RedHatDisplay/RedHatDisplay-Regular.woff2 +0 -0
  43. package/fonts/RedHatMono/RedHatMono-Bold.woff2 +0 -0
  44. package/fonts/RedHatMono/RedHatMono-BoldItalic.woff2 +0 -0
  45. package/fonts/RedHatMono/RedHatMono-Italic.woff2 +0 -0
  46. package/fonts/RedHatMono/RedHatMono-Light.woff2 +0 -0
  47. package/fonts/RedHatMono/RedHatMono-LightItalic.woff2 +0 -0
  48. package/fonts/RedHatMono/RedHatMono-Medium.woff2 +0 -0
  49. package/fonts/RedHatMono/RedHatMono-MediumItalic.woff2 +0 -0
  50. package/fonts/RedHatMono/RedHatMono-Regular.woff2 +0 -0
  51. package/fonts/RedHatText/RedHatText-Bold.woff2 +0 -0
  52. package/fonts/RedHatText/RedHatText-BoldItalic.woff2 +0 -0
  53. package/fonts/RedHatText/RedHatText-Italic.woff2 +0 -0
  54. package/fonts/RedHatText/RedHatText-Light.woff2 +0 -0
  55. package/fonts/RedHatText/RedHatText-LightItalic.woff2 +0 -0
  56. package/fonts/RedHatText/RedHatText-Medium.woff2 +0 -0
  57. package/fonts/RedHatText/RedHatText-MediumItalic.woff2 +0 -0
  58. package/fonts/RedHatText/RedHatText-Regular.woff2 +0 -0
  59. package/fonts/font.css +0 -54
  60. package/fonts/font.min.css +0 -43
  61. package/fonts/index.html +0 -374
  62. /package/{fonts → dist/assets/fonts}/RedHatDisplay/RedHatDisplayVF-Italic.woff2 +0 -0
  63. /package/{fonts → dist/assets/fonts}/RedHatDisplay/RedHatDisplayVF.woff2 +0 -0
  64. /package/{fonts → dist/assets/fonts}/RedHatMono/RedHatMonoVF-Italic.woff2 +0 -0
  65. /package/{fonts → dist/assets/fonts}/RedHatMono/RedHatMonoVF.woff2 +0 -0
  66. /package/{fonts → dist/assets/fonts}/RedHatText/RedHatTextVF-Italic.woff2 +0 -0
  67. /package/{fonts → dist/assets/fonts}/RedHatText/RedHatTextVF.woff2 +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"createComponents.esm.js","sources":["../../src/utils/createComponents.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\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 UnifiedThemeOptions } from '@backstage/theme';\nimport { ThemeConfig, ThemeConfigOptions, RHDHThemePalette } from '../types';\n\nexport type Component = {\n defaultProps?: unknown;\n styleOverrides?: unknown;\n variants?: unknown;\n};\n\nexport type Components = UnifiedThemeOptions['components'] & {\n BackstageHeaderTabs?: Component;\n BackstageSidebar?: Component;\n BackstageSidebarItem?: Component;\n BackstagePage?: Component;\n BackstageContent?: Component;\n BackstageContentHeader?: Component;\n BackstageHeader?: Component;\n BackstageItemCardHeader?: Component;\n BackstageTableToolbar?: Component;\n CatalogReactUserListPicker?: Component;\n PrivateTabIndicator?: Component;\n};\n\nexport const createComponents = (themeConfig: ThemeConfig): Components => {\n // Short hands to ensure that the code doesn't break if one of the properties is not defined.\n\n const options = themeConfig.options ?? ({} as ThemeConfigOptions);\n const disableRipple = options?.rippleEffect !== 'on'; // by default ripple effect is disabled\n\n const palette = themeConfig.palette ?? {};\n\n const general = palette.rhdh?.general || ({} as RHDHThemePalette['general']);\n const rhdhPrimary =\n palette.rhdh?.primary || ({} as RHDHThemePalette['primary']);\n const rhdhSecondary =\n palette.rhdh?.secondary || ({} as RHDHThemePalette['secondary']);\n\n const components: Components = {};\n if (options.components === 'backstage' || options.components === 'mui') {\n return components;\n }\n\n //\n // MUI components\n //\n\n // MUI base\n if (options.buttons !== 'mui') {\n components.MuiTypography = {\n styleOverrides: {\n button: {\n textTransform: 'none',\n fontWeight: 'bold',\n },\n },\n };\n }\n\n // MUI container\n if (options.paper !== 'mui') {\n const elevationStyle = {\n boxShadow: 'none',\n outline: `1px solid ${general.paperBorderColor}`,\n '& > hr[class|=\"MuiDivider-root\"]': {\n backgroundColor: general.paperBorderColor,\n },\n };\n const noElevationStyle = {\n boxShadow: 'none',\n outline: 'none',\n };\n\n components.MuiPaper = {\n styleOverrides: {\n root: {\n // This works for all MUI v5 components, but in MUI v4\n boxShadow: 'none',\n outline: `1px solid ${general.paperBorderColor}`,\n // Required only for MUI v5 components because a gradient `backgroundImage`\n // overrides the default background.paper color otherwise.\n backgroundImage: general.paperBackgroundImage,\n // hide the first child element which is a divider with MuiDivider-root classname in MuiPaper\n '& > hr:first-child[class|=\"MuiDivider-root\"]': {\n height: 0,\n },\n },\n elevation0: noElevationStyle,\n },\n };\n components.MuiPopover = {\n styleOverrides: {\n paper: {\n // Box shadow from PatternFly 5 (--pf-v5-global--BoxShadow--sm)\n boxShadow: general.popoverBoxShadow,\n // `Popover` has no outline by default, but since we're adding it to the `Paper`\n // components, this ensures that the `Popover` doesn't has a shadow and an outline.\n outline: 0,\n },\n },\n };\n\n // Required for MUI v4, not MUI v5\n const elevations = Array.from(\n { length: 24 },\n (_, i) => `elevation${i + 1}`,\n ) as 'elevation1'[];\n elevations.forEach(elevation => {\n components.MuiPaper!.styleOverrides![elevation] = elevationStyle;\n });\n }\n\n // MUI buttons\n // Don't disableRipple for MuiButtonBase as it will affect all the buttons\n // and we need to ensure that the buttons have a right touch and focus styling.\n if (options.buttons !== 'mui') {\n components.MuiButton = {\n defaultProps: {\n disableRipple,\n },\n styleOverrides: {\n root: {\n textTransform: 'none',\n border: '0',\n borderRadius: '3px',\n },\n contained: {\n boxShadow: 'none',\n '&:hover': {\n border: '0',\n boxShadow: 'none',\n },\n '&:-webkit-any-link:focus-visible': {\n outlineOffset: '0',\n },\n },\n containedPrimary: {\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 1px ${rhdhPrimary.focusVisibleBorder}`,\n outline: `${rhdhPrimary.focusVisibleBorder} solid 1px`,\n },\n '&:disabled': {\n color: general.disabled,\n backgroundColor: general.disabledBackground,\n },\n },\n containedSecondary: {\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 1px ${rhdhSecondary.focusVisibleBorder}`,\n outline: `${rhdhSecondary.focusVisibleBorder} solid 1px`,\n },\n '&:disabled': {\n color: general.disabled,\n backgroundColor: general.disabledBackground,\n },\n },\n outlined: {\n border: `1px solid color-mix(in srgb, currentColor 50%, transparent)`,\n '&:hover': {\n backgroundColor: 'transparent',\n border: `1px solid`,\n },\n },\n outlinedPrimary: {\n '&:hover': {\n backgroundColor: 'transparent',\n },\n },\n outlinedSecondary: {\n '&:hover': {\n backgroundColor: 'transparent',\n },\n },\n text: {\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${rhdhPrimary.main}`,\n outline: `${rhdhPrimary.focusVisibleBorder} solid 1px`,\n },\n },\n },\n };\n components.MuiToggleButton = {\n styleOverrides: {\n root: {\n textTransform: 'none',\n },\n },\n };\n components.MuiIconButton = {\n styleOverrides: {\n root: {\n '&:disabled': {\n color: general.disabled,\n },\n },\n },\n };\n components.MuiLink = {\n styleOverrides: {\n underlineHover: {\n '&:hover': {\n textDecoration: 'none',\n },\n },\n },\n };\n }\n\n // MUI input fields\n if (options.inputs !== 'mui') {\n components.MuiInputBase = {\n styleOverrides: {\n input: {\n '&::placeholder': {\n color: general.disabled,\n opacity: 1,\n },\n },\n },\n };\n components.MuiOutlinedInput = {\n styleOverrides: {\n input: {\n '&:autofill': {\n boxShadow: `0 0 0 100px ${general.formControlBackgroundColor} inset`,\n borderRadius: 'unset',\n },\n },\n },\n };\n }\n\n if (options.inputs !== 'mui') {\n components.MuiCheckbox = {\n defaultProps: {\n color: 'primary',\n },\n };\n }\n\n // MUI accordion\n if (options.accordions !== 'mui') {\n components.MuiAccordion = {\n styleOverrides: {\n root: {\n boxShadow: 'none',\n },\n rounded: {\n '&:first-child': {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n },\n '&:last-child': {\n borderBottomLeftRadius: '0',\n borderBottomRightRadius: '0',\n },\n },\n },\n };\n }\n\n // MUI cards\n if (options.cards !== 'mui') {\n components.MuiCard = {\n styleOverrides: {\n root: {\n display: 'flex',\n flexDirection: 'column',\n backgroundColor: general.cardBackgroundColor,\n },\n },\n };\n components.MuiCardHeader = {\n styleOverrides: {\n content: {\n '& > span > nav span': {\n textTransform: 'unset',\n letterSpacing: 'normal',\n fountweight: 'normal',\n },\n },\n title: {\n fontSize: '1.125rem',\n },\n action: {\n '& > a > span > svg': {\n fontSize: '1.125rem',\n },\n '& > a[class*=\"MuiIconButton-root\"]:hover': {\n backgroundColor: 'transparent',\n },\n },\n },\n };\n components.MuiCardContent = {\n styleOverrides: {\n root: {\n flexGrow: '1',\n backgroundColor: general.cardBackgroundColor,\n '& > div > div > h2[class*=\"MuiTypography-h2-\"]': {\n textTransform: 'unset',\n opacity: '40%',\n },\n '& > div > div > div[class*=\"MuiChip-sizeSmall\"]': {\n backgroundColor: 'transparent',\n borderRadius: '8px',\n outline: `1px solid ${general.disabled}`,\n },\n '& > div[class*=\"Mui-expanded\"]': {\n margin: 'auto',\n },\n '& > div[class*=\"MuiAccordion-root\"]:before': {\n height: 0,\n },\n // Override the default line-clamp from 10 to 2 for the Software template catalog\n '& > div[class*=\"MuiGrid-root-\"][class*=\"MuiGrid-container-\"][class*=\"MuiGrid-spacing-xs-2-\"] > div[class*=\"MuiGrid-root-\"][class*=\"MuiGrid-item-\"][class*=\"MuiGrid-grid-xs-12-\"] > div[class*=\"MuiBox-root-\"]':\n {\n '-webkit-line-clamp': '2',\n },\n },\n },\n };\n }\n\n // MUI table\n if (options.tables !== 'mui') {\n components.MuiTable = {\n styleOverrides: {\n root: {\n backgroundColor: general.tableBackgroundColor,\n },\n },\n };\n components.MuiTableRow = {\n styleOverrides: {\n root: {\n backgroundColor: general.tableBackgroundColor,\n '&:not([class*=\"MuiTableRow-footer\"]):hover': {\n backgroundColor: `${general.tableRowHover} !important`,\n },\n '& > th[class*=\"MuiTableCell-head\"]': {\n backgroundColor: general.tableBackgroundColor,\n },\n },\n },\n };\n components.MuiTableCell = {\n styleOverrides: {\n root: {\n textTransform: 'none',\n '&[class*=\"BackstageTableHeader-header\"]': {\n borderTop: 'unset',\n borderBottom: `1px solid ${general.tableBorderColor}`,\n },\n },\n // @ts-expect-error: MUI types are not up to date\n head: {\n textTransform: 'unset !important',\n color: `${general.tableColumnTitleColor} !important`,\n '& > span[class*=\"MuiTableSortLabel-active\"]': {\n color: `${rhdhPrimary.main} !important`,\n },\n '& > span > svg[class*=\"MuiTableSortLabel-icon\"]': {\n color: 'inherit !important',\n },\n },\n body: {\n color: general.tableTitleColor,\n '& > div[class*=\"MuiChip-sizeSmall\"]': {\n margin: '2px',\n },\n },\n },\n };\n components.MuiTableFooter = {\n styleOverrides: {\n root: {\n '& > tr > td': {\n borderBottom: 'none',\n },\n },\n },\n };\n }\n\n // MUI toolbar\n if (options.toolbars !== 'mui') {\n components.MuiToolbar = {\n styleOverrides: {\n regular: {\n '& > div > h2[class*=\"MuiTypography-h5\"]': {\n fontSize: '1.25rem',\n color: general.tableTitleColor,\n },\n },\n },\n };\n }\n\n // MUI dialogs\n if (options.dialogs !== 'mui') {\n components.MuiDialogContent = {\n styleOverrides: {\n root: {\n '& > div': {\n backgroundColor: general.cardBackgroundColor,\n },\n },\n },\n };\n }\n\n // MUI tabs\n if (options.tabs !== 'mui') {\n components.MuiTabs = {\n defaultProps: {\n indicatorColor: 'primary',\n },\n styleOverrides: {\n root: {\n borderBottom: `1px solid ${general.tabsBottomBorderColor}`,\n padding: '0 1.5rem',\n },\n vertical: {\n '& > div > div > button[class*=\"v5\"]': {\n alignItems: 'baseline',\n textAlign: 'left',\n },\n '& > div > div > button > span': {\n alignItems: 'baseline',\n textAlign: 'left',\n },\n borderBottom: `none`,\n borderLeft: `1px solid ${general.tabsBottomBorderColor}`,\n padding: 0,\n },\n flexContainerVertical: {\n '& > button:hover': {\n boxShadow: `2px 0 ${general.tabsBottomBorderColor} inset`,\n },\n },\n indicator: {\n left: 0,\n },\n },\n };\n components.MuiTab = {\n defaultProps: {\n disableRipple,\n },\n styleOverrides: {\n root: {\n textTransform: 'none',\n minWidth: 'initial !important',\n '&:disabled': {\n backgroundColor: general.tabsDisabledBackgroundColor,\n },\n '&:hover': {\n boxShadow: `0 -2px ${general.tabsBottomBorderColor} inset`,\n },\n },\n },\n };\n }\n\n //\n // Backstage\n //\n if (options.tabs !== 'mui') {\n components.BackstageHeaderTabs = {\n styleOverrides: {\n tabsWrapper: {\n paddingLeft: '0',\n backgroundColor: general.mainSectionBackgroundColor,\n },\n defaultTab: {\n textTransform: 'none',\n fontSize: '1rem',\n fontWeight: '500',\n color: general.disabled,\n padding: '0.5rem 1rem',\n '&:hover': {\n boxShadow: `0 -3px ${general.tabsBottomBorderColor} inset`,\n },\n },\n tabRoot: {\n '&:hover': {\n backgroundColor: 'unset',\n },\n '&:not(.Mui-selected):hover': {\n color: general.disabled,\n },\n },\n },\n };\n }\n\n if (options.sidebars !== 'mui') {\n components.BackstageSidebar = {\n styleOverrides: {\n drawer: {\n backgroundColor:\n general.sidebarBackgroundColor ?? general.sideBarBackgroundColor,\n '& a[class*=\"BackstageSidebarItem-selected-\"]': {\n backgroundColor: general.sidebarItemSelectedBackgroundColor,\n },\n },\n },\n };\n components.BackstageSidebarItem = {\n styleOverrides: {\n label: {\n '&[class*=\"MuiTypography-subtitle2\"]': {\n fontWeight: '500',\n },\n },\n },\n };\n }\n\n if (options.pages !== 'mui') {\n components.BackstagePage = {\n styleOverrides: {\n root: {\n backgroundColor: general.mainSectionBackgroundColor,\n },\n },\n };\n components.BackstageContent = {\n styleOverrides: {\n root: {\n backgroundColor: general.mainSectionBackgroundColor,\n },\n },\n };\n components.BackstageContentHeader = {\n styleOverrides: {\n leftItemsBox: {\n '& > h2[class*=\"BackstageContentHeader-title-\"][class*=\"MuiTypography-h4-\"]':\n {\n fontWeight: 'bold',\n fontSize: '1.75rem',\n },\n },\n },\n };\n }\n\n if (options.headers !== 'mui') {\n components.BackstageHeader = {\n styleOverrides: {\n header: {\n boxShadow: 'none',\n borderBottom: `1px solid ${general.headerBottomBorderColor}`,\n },\n title: {\n fontWeight: 'bold',\n '&[class*=\"MuiTypography-h1-\"]': {\n fontWeight: 'bold',\n fontSize: '2rem',\n },\n },\n },\n };\n components.BackstageItemCardHeader = {\n styleOverrides: {\n root: {\n // This is required to increase the css specificity, to OVERRIDE the styles from\n // BackstageItemCardHeader (https://github.com/backstage/backstage/blob/master/packages/core-components/src/layout/ItemCard/ItemCardHeader.tsx)\n // These are applied with a CSS class as well.\n\n // This variant is used when running the Storybook locally (dev mode) and in Backstage/RHDH!\n '&[class*=\"MuiBox-root-\"]': {\n color: palette.rhdh?.cards?.headerTextColor,\n backgroundColor: palette.rhdh?.cards?.headerBackgroundColor,\n backgroundImage: palette.rhdh?.cards?.headerBackgroundImage,\n borderBottom: `1px solid ${general.cardBorderColor}`,\n },\n // This variant is used when building a static Storybook (`storybook:build`)\n '&[class~=\"MuiBox-root\"]': {\n color: palette.rhdh?.cards?.headerTextColor,\n backgroundColor: palette.rhdh?.cards?.headerBackgroundColor,\n backgroundImage: palette.rhdh?.cards?.headerBackgroundImage,\n borderBottom: `1px solid ${general.cardBorderColor}`,\n },\n '& > h3[class*=\"MuiTypography-subtitle2-\"] > div > div:first-child': {\n textTransform: 'capitalize',\n },\n },\n },\n };\n }\n\n if (options.toolbars !== 'mui') {\n components.BackstageTableToolbar = {\n styleOverrides: {\n root: {\n '& h2': {\n fontWeight: 'bold',\n },\n },\n title: {\n '& > h2': {\n fontWeight: 'bold',\n },\n },\n },\n };\n }\n\n //\n // Others\n //\n components.CatalogReactUserListPicker = {\n styleOverrides: {\n root: {\n borderRadius: '4px',\n },\n title: {\n textTransform: 'none',\n },\n },\n };\n\n if (options.tabs !== 'mui') {\n components.PrivateTabIndicator = {\n styleOverrides: {\n root: {\n height: '3px',\n },\n vertical: {\n width: '3px',\n },\n },\n };\n }\n\n return components;\n};\n"],"names":[],"mappings":"AAsCa,MAAA,gBAAA,GAAmB,CAAC,WAAyC,KAAA;AAGxE,EAAM,MAAA,OAAA,GAAU,WAAY,CAAA,OAAA,IAAY,EAAC;AACzC,EAAM,MAAA,aAAA,GAAgB,SAAS,YAAiB,KAAA,IAAA;AAEhD,EAAM,MAAA,OAAA,GAAU,WAAY,CAAA,OAAA,IAAW,EAAC;AAExC,EAAA,MAAM,OAAU,GAAA,OAAA,CAAQ,IAAM,EAAA,OAAA,IAAY,EAAC;AAC3C,EAAA,MAAM,WACJ,GAAA,OAAA,CAAQ,IAAM,EAAA,OAAA,IAAY,EAAC;AAC7B,EAAA,MAAM,aACJ,GAAA,OAAA,CAAQ,IAAM,EAAA,SAAA,IAAc,EAAC;AAE/B,EAAA,MAAM,aAAyB,EAAC;AAChC,EAAA,IAAI,OAAQ,CAAA,UAAA,KAAe,WAAe,IAAA,OAAA,CAAQ,eAAe,KAAO,EAAA;AACtE,IAAO,OAAA,UAAA;AAAA;AAQT,EAAI,IAAA,OAAA,CAAQ,YAAY,KAAO,EAAA;AAC7B,IAAA,UAAA,CAAW,aAAgB,GAAA;AAAA,MACzB,cAAgB,EAAA;AAAA,QACd,MAAQ,EAAA;AAAA,UACN,aAAe,EAAA,MAAA;AAAA,UACf,UAAY,EAAA;AAAA;AACd;AACF,KAC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AA,UAAA,CAAW,mBAAsB,GAAA;AAAA,MAC/B,cAAgB,EAAA;AAAA,QACd,IAAM,EAAA;AAAA,UACJ,MAAQ,EAAA;AAAA,SACV;AAAA,QACA,QAAU,EAAA;AAAA,UACR,KAAO,EAAA;AAAA;AACT;AACF,KACF;AAAA;AAGF,EAAO,OAAA,UAAA;AACT;;;;"}
1
+ {"version":3,"file":"createComponents.esm.js","sources":["../../src/utils/createComponents.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type UnifiedThemeOptions,\n defaultComponentThemes as backstageComponents,\n} from '@backstage/theme';\nimport { type CSSObject } from '@mui/material/styles';\n\nimport { ThemeConfig, ThemeConfigOptions, RHDHThemePalette } from '../types';\nimport { redHatFontFaces, redHatFonts } from '../fonts';\n\nexport type Component = {\n defaultProps?: unknown;\n styleOverrides?: unknown;\n variants?: unknown;\n};\n\nexport type Components = UnifiedThemeOptions['components'] & {\n BackstageHeaderTabs?: Component;\n BackstageSidebar?: Component;\n BackstageSidebarItem?: Component;\n BackstagePage?: Component;\n BackstageContent?: Component;\n BackstageContentHeader?: Component;\n BackstageHeader?: Component;\n BackstageItemCardHeader?: Component;\n BackstageTableToolbar?: Component;\n CatalogReactUserListPicker?: Component;\n PrivateTabIndicator?: Component;\n};\n\nexport const createComponents = (themeConfig: ThemeConfig): Components => {\n // Short hands to ensure that the code doesn't break if one of the properties is not defined.\n\n const options = themeConfig.options ?? ({} as ThemeConfigOptions);\n const disableRipple = options?.rippleEffect !== 'on'; // by default ripple effect is disabled\n\n const palette = themeConfig.palette ?? {};\n\n const general = palette.rhdh?.general || ({} as RHDHThemePalette['general']);\n const rhdhPrimary =\n palette.rhdh?.primary || ({} as RHDHThemePalette['primary']);\n const rhdhSecondary =\n palette.rhdh?.secondary || ({} as RHDHThemePalette['secondary']);\n\n const components: Components = {};\n if (options.components === 'backstage' || options.components === 'mui') {\n return components;\n }\n\n //\n // MUI components\n //\n components.MuiCssBaseline = {\n styleOverrides: theme => {\n const backstageOverrides =\n backstageComponents!.MuiCssBaseline!.styleOverrides!;\n const backstageStyles =\n typeof backstageOverrides === 'function'\n ? (backstageOverrides(theme) as CSSObject)\n : (backstageOverrides as CSSObject);\n\n return {\n ...backstageStyles,\n '@font-face': redHatFontFaces,\n body: {\n ...(backstageStyles.body as CSSObject),\n fontFamily: redHatFonts.text,\n },\n 'h1, h2, h3, h4, h5, h6': {\n fontFamily: redHatFonts.heading,\n },\n 'pre, code': {\n fontFamily: redHatFonts.monospace,\n },\n };\n },\n };\n\n // MUI base\n if (options.buttons !== 'mui') {\n components.MuiTypography = {\n styleOverrides: {\n button: {\n textTransform: 'none',\n fontWeight: 'bold',\n },\n },\n };\n }\n\n // MUI container\n if (options.paper !== 'mui') {\n const elevationStyle = {\n boxShadow: 'none',\n outline: `1px solid ${general.paperBorderColor}`,\n '& > hr[class|=\"MuiDivider-root\"]': {\n backgroundColor: general.paperBorderColor,\n },\n };\n const noElevationStyle = {\n boxShadow: 'none',\n outline: 'none',\n };\n\n components.MuiPaper = {\n styleOverrides: {\n root: {\n // This works for all MUI v5 components, but in MUI v4\n boxShadow: 'none',\n outline: `1px solid ${general.paperBorderColor}`,\n // Required only for MUI v5 components because a gradient `backgroundImage`\n // overrides the default background.paper color otherwise.\n backgroundImage: general.paperBackgroundImage,\n // hide the first child element which is a divider with MuiDivider-root classname in MuiPaper\n '& > hr:first-child[class|=\"MuiDivider-root\"]': {\n height: 0,\n },\n },\n elevation0: noElevationStyle,\n },\n };\n components.MuiPopover = {\n styleOverrides: {\n paper: {\n // Box shadow from PatternFly 5 (--pf-v5-global--BoxShadow--sm)\n boxShadow: general.popoverBoxShadow,\n // `Popover` has no outline by default, but since we're adding it to the `Paper`\n // components, this ensures that the `Popover` doesn't has a shadow and an outline.\n outline: 0,\n },\n },\n };\n\n // Required for MUI v4, not MUI v5\n const elevations = Array.from(\n { length: 24 },\n (_, i) => `elevation${i + 1}`,\n ) as 'elevation1'[];\n elevations.forEach(elevation => {\n components.MuiPaper!.styleOverrides![elevation] = elevationStyle;\n });\n }\n\n // MUI buttons\n // Don't disableRipple for MuiButtonBase as it will affect all the buttons\n // and we need to ensure that the buttons have a right touch and focus styling.\n if (options.buttons !== 'mui') {\n components.MuiButton = {\n defaultProps: {\n disableRipple,\n },\n styleOverrides: {\n root: {\n textTransform: 'none',\n border: '0',\n borderRadius: '3px',\n },\n contained: {\n boxShadow: 'none',\n '&:hover': {\n border: '0',\n boxShadow: 'none',\n },\n '&:-webkit-any-link:focus-visible': {\n outlineOffset: '0',\n },\n },\n containedPrimary: {\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 1px ${rhdhPrimary.focusVisibleBorder}`,\n outline: `${rhdhPrimary.focusVisibleBorder} solid 1px`,\n },\n '&:disabled': {\n color: general.disabled,\n backgroundColor: general.disabledBackground,\n },\n },\n containedSecondary: {\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 1px ${rhdhSecondary.focusVisibleBorder}`,\n outline: `${rhdhSecondary.focusVisibleBorder} solid 1px`,\n },\n '&:disabled': {\n color: general.disabled,\n backgroundColor: general.disabledBackground,\n },\n },\n outlined: {\n border: `1px solid color-mix(in srgb, currentColor 50%, transparent)`,\n '&:hover': {\n backgroundColor: 'transparent',\n border: `1px solid`,\n },\n },\n outlinedPrimary: {\n '&:hover': {\n backgroundColor: 'transparent',\n },\n },\n outlinedSecondary: {\n '&:hover': {\n backgroundColor: 'transparent',\n },\n },\n text: {\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${rhdhPrimary.main}`,\n outline: `${rhdhPrimary.focusVisibleBorder} solid 1px`,\n },\n },\n },\n };\n components.MuiToggleButton = {\n styleOverrides: {\n root: {\n textTransform: 'none',\n },\n },\n };\n components.MuiIconButton = {\n styleOverrides: {\n root: {\n '&:disabled': {\n color: general.disabled,\n },\n },\n },\n };\n components.MuiLink = {\n styleOverrides: {\n underlineHover: {\n '&:hover': {\n textDecoration: 'none',\n },\n },\n },\n };\n }\n\n // MUI input fields\n if (options.inputs !== 'mui') {\n components.MuiInputBase = {\n styleOverrides: {\n input: {\n '&::placeholder': {\n color: general.disabled,\n opacity: 1,\n },\n },\n },\n };\n components.MuiOutlinedInput = {\n styleOverrides: {\n input: {\n '&:autofill': {\n boxShadow: `0 0 0 100px ${general.formControlBackgroundColor} inset`,\n borderRadius: 'unset',\n },\n },\n },\n };\n }\n\n if (options.inputs !== 'mui') {\n components.MuiCheckbox = {\n defaultProps: {\n color: 'primary',\n },\n };\n }\n\n // MUI accordion\n if (options.accordions !== 'mui') {\n components.MuiAccordion = {\n styleOverrides: {\n root: {\n boxShadow: 'none',\n },\n rounded: {\n '&:first-child': {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n },\n '&:last-child': {\n borderBottomLeftRadius: '0',\n borderBottomRightRadius: '0',\n },\n },\n },\n };\n }\n\n // MUI cards\n if (options.cards !== 'mui') {\n components.MuiCard = {\n styleOverrides: {\n root: {\n display: 'flex',\n flexDirection: 'column',\n backgroundColor: general.cardBackgroundColor,\n },\n },\n };\n components.MuiCardHeader = {\n styleOverrides: {\n content: {\n '& > span > nav span': {\n textTransform: 'unset',\n letterSpacing: 'normal',\n fountweight: 'normal',\n },\n },\n title: {\n fontSize: '1.125rem',\n },\n action: {\n '& > a > span > svg': {\n fontSize: '1.125rem',\n },\n '& > a[class*=\"MuiIconButton-root\"]:hover': {\n backgroundColor: 'transparent',\n },\n },\n },\n };\n components.MuiCardContent = {\n styleOverrides: {\n root: {\n flexGrow: '1',\n backgroundColor: general.cardBackgroundColor,\n '& > div > div > h2[class*=\"MuiTypography-h2-\"]': {\n textTransform: 'unset',\n opacity: '40%',\n },\n '& > div > div > div[class*=\"MuiChip-sizeSmall\"]': {\n backgroundColor: 'transparent',\n borderRadius: '8px',\n outline: `1px solid ${general.disabled}`,\n },\n '& > div[class*=\"Mui-expanded\"]': {\n margin: 'auto',\n },\n '& > div[class*=\"MuiAccordion-root\"]:before': {\n height: 0,\n },\n // Override the default line-clamp from 10 to 2 for the Software template catalog\n '& > div[class*=\"MuiGrid-root-\"][class*=\"MuiGrid-container-\"][class*=\"MuiGrid-spacing-xs-2-\"] > div[class*=\"MuiGrid-root-\"][class*=\"MuiGrid-item-\"][class*=\"MuiGrid-grid-xs-12-\"] > div[class*=\"MuiBox-root-\"]':\n {\n '-webkit-line-clamp': '2',\n },\n },\n },\n };\n }\n\n // MUI table\n if (options.tables !== 'mui') {\n components.MuiTable = {\n styleOverrides: {\n root: {\n backgroundColor: general.tableBackgroundColor,\n },\n },\n };\n components.MuiTableRow = {\n styleOverrides: {\n root: {\n backgroundColor: general.tableBackgroundColor,\n '&:not([class*=\"MuiTableRow-footer\"]):hover': {\n backgroundColor: `${general.tableRowHover} !important`,\n },\n '& > th[class*=\"MuiTableCell-head\"]': {\n backgroundColor: general.tableBackgroundColor,\n },\n },\n },\n };\n components.MuiTableCell = {\n styleOverrides: {\n root: {\n textTransform: 'none',\n '&[class*=\"BackstageTableHeader-header\"]': {\n borderTop: 'unset',\n borderBottom: `1px solid ${general.tableBorderColor}`,\n },\n },\n // @ts-expect-error: MUI types are not up to date\n head: {\n textTransform: 'unset !important',\n color: `${general.tableColumnTitleColor} !important`,\n '& > span[class*=\"MuiTableSortLabel-active\"]': {\n color: `${rhdhPrimary.main} !important`,\n },\n '& > span > svg[class*=\"MuiTableSortLabel-icon\"]': {\n color: 'inherit !important',\n },\n },\n body: {\n color: general.tableTitleColor,\n '& > div[class*=\"MuiChip-sizeSmall\"]': {\n margin: '2px',\n },\n },\n },\n };\n components.MuiTableFooter = {\n styleOverrides: {\n root: {\n '& > tr > td': {\n borderBottom: 'none',\n },\n },\n },\n };\n }\n\n // MUI toolbar\n if (options.toolbars !== 'mui') {\n components.MuiToolbar = {\n styleOverrides: {\n regular: {\n '& > div > h2[class*=\"MuiTypography-h5\"]': {\n fontSize: '1.25rem',\n color: general.tableTitleColor,\n },\n },\n },\n };\n }\n\n // MUI dialogs\n if (options.dialogs !== 'mui') {\n components.MuiDialogContent = {\n styleOverrides: {\n root: {\n '& > div': {\n backgroundColor: general.cardBackgroundColor,\n },\n },\n },\n };\n }\n\n // MUI tabs\n if (options.tabs !== 'mui') {\n components.MuiTabs = {\n defaultProps: {\n indicatorColor: 'primary',\n },\n styleOverrides: {\n root: {\n borderBottom: `1px solid ${general.tabsBottomBorderColor}`,\n padding: '0 1.5rem',\n },\n vertical: {\n '& > div > div > button[class*=\"v5\"]': {\n alignItems: 'baseline',\n textAlign: 'left',\n },\n '& > div > div > button > span': {\n alignItems: 'baseline',\n textAlign: 'left',\n },\n borderBottom: `none`,\n borderLeft: `1px solid ${general.tabsBottomBorderColor}`,\n padding: 0,\n },\n flexContainerVertical: {\n '& > button:hover': {\n boxShadow: `2px 0 ${general.tabsBottomBorderColor} inset`,\n },\n },\n indicator: {\n left: 0,\n },\n },\n };\n components.MuiTab = {\n defaultProps: {\n disableRipple,\n },\n styleOverrides: {\n root: {\n textTransform: 'none',\n minWidth: 'initial !important',\n '&:disabled': {\n backgroundColor: general.tabsDisabledBackgroundColor,\n },\n '&:hover': {\n boxShadow: `0 -2px ${general.tabsBottomBorderColor} inset`,\n },\n },\n },\n };\n }\n\n //\n // Backstage\n //\n if (options.tabs !== 'mui') {\n components.BackstageHeaderTabs = {\n styleOverrides: {\n tabsWrapper: {\n paddingLeft: '0',\n backgroundColor: general.mainSectionBackgroundColor,\n },\n defaultTab: {\n textTransform: 'none',\n fontSize: '1rem',\n fontWeight: '500',\n color: general.disabled,\n padding: '0.5rem 1rem',\n '&:hover': {\n boxShadow: `0 -3px ${general.tabsBottomBorderColor} inset`,\n },\n },\n tabRoot: {\n '&:hover': {\n backgroundColor: 'unset',\n },\n '&:not(.Mui-selected):hover': {\n color: general.disabled,\n },\n },\n },\n };\n }\n\n if (options.sidebars !== 'mui') {\n components.BackstageSidebar = {\n styleOverrides: {\n drawer: {\n backgroundColor:\n general.sidebarBackgroundColor ?? general.sideBarBackgroundColor,\n '& a[class*=\"BackstageSidebarItem-selected-\"]': {\n backgroundColor: general.sidebarItemSelectedBackgroundColor,\n },\n },\n },\n };\n components.BackstageSidebarItem = {\n styleOverrides: {\n label: {\n '&[class*=\"MuiTypography-subtitle2\"]': {\n fontWeight: '500',\n },\n },\n },\n };\n }\n\n if (options.pages !== 'mui') {\n components.BackstagePage = {\n styleOverrides: {\n root: {\n backgroundColor: general.mainSectionBackgroundColor,\n },\n },\n };\n components.BackstageContent = {\n styleOverrides: {\n root: {\n backgroundColor: general.mainSectionBackgroundColor,\n },\n },\n };\n components.BackstageContentHeader = {\n styleOverrides: {\n leftItemsBox: {\n '& > h2[class*=\"BackstageContentHeader-title-\"][class*=\"MuiTypography-h4-\"]':\n {\n fontWeight: 'bold',\n fontSize: '1.75rem',\n },\n },\n },\n };\n }\n\n if (options.headers !== 'mui') {\n components.BackstageHeader = {\n styleOverrides: {\n header: {\n boxShadow: 'none',\n borderBottom: `1px solid ${general.headerBottomBorderColor}`,\n },\n title: {\n fontWeight: 'bold',\n '&[class*=\"MuiTypography-h1-\"]': {\n fontWeight: 'bold',\n fontSize: '2rem',\n },\n },\n },\n };\n components.BackstageItemCardHeader = {\n styleOverrides: {\n root: {\n // This is required to increase the css specificity, to OVERRIDE the styles from\n // BackstageItemCardHeader (https://github.com/backstage/backstage/blob/master/packages/core-components/src/layout/ItemCard/ItemCardHeader.tsx)\n // These are applied with a CSS class as well.\n\n // This variant is used when running the Storybook locally (dev mode) and in Backstage/RHDH!\n '&[class*=\"MuiBox-root-\"]': {\n color: palette.rhdh?.cards?.headerTextColor,\n backgroundColor: palette.rhdh?.cards?.headerBackgroundColor,\n backgroundImage: palette.rhdh?.cards?.headerBackgroundImage,\n borderBottom: `1px solid ${general.cardBorderColor}`,\n },\n // This variant is used when building a static Storybook (`storybook:build`)\n '&[class~=\"MuiBox-root\"]': {\n color: palette.rhdh?.cards?.headerTextColor,\n backgroundColor: palette.rhdh?.cards?.headerBackgroundColor,\n backgroundImage: palette.rhdh?.cards?.headerBackgroundImage,\n borderBottom: `1px solid ${general.cardBorderColor}`,\n },\n '& > h3[class*=\"MuiTypography-subtitle2-\"] > div > div:first-child': {\n textTransform: 'capitalize',\n },\n },\n },\n };\n }\n\n if (options.toolbars !== 'mui') {\n components.BackstageTableToolbar = {\n styleOverrides: {\n root: {\n '& h2': {\n fontWeight: 'bold',\n },\n },\n title: {\n '& > h2': {\n fontWeight: 'bold',\n },\n },\n },\n };\n }\n\n //\n // Others\n //\n components.CatalogReactUserListPicker = {\n styleOverrides: {\n root: {\n borderRadius: '4px',\n },\n title: {\n textTransform: 'none',\n },\n },\n };\n\n if (options.tabs !== 'mui') {\n components.PrivateTabIndicator = {\n styleOverrides: {\n root: {\n height: '3px',\n },\n vertical: {\n width: '3px',\n },\n },\n };\n }\n\n return components;\n};\n"],"names":["backstageComponents"],"mappings":";;;AA6Ca,MAAA,gBAAA,GAAmB,CAAC,WAAyC,KAAA;AAGxE,EAAM,MAAA,OAAA,GAAU,WAAY,CAAA,OAAA,IAAY,EAAC;AACzC,EAAM,MAAA,aAAA,GAAgB,SAAS,YAAiB,KAAA,IAAA;AAEhD,EAAM,MAAA,OAAA,GAAU,WAAY,CAAA,OAAA,IAAW,EAAC;AAExC,EAAA,MAAM,OAAU,GAAA,OAAA,CAAQ,IAAM,EAAA,OAAA,IAAY,EAAC;AAC3C,EAAA,MAAM,WACJ,GAAA,OAAA,CAAQ,IAAM,EAAA,OAAA,IAAY,EAAC;AAC7B,EAAA,MAAM,aACJ,GAAA,OAAA,CAAQ,IAAM,EAAA,SAAA,IAAc,EAAC;AAE/B,EAAA,MAAM,aA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OAAQ,CAAA,IAAA,EAAM,KAAO,EAAA,eAAA;AAAA,YAC5B,eAAA,EAAiB,OAAQ,CAAA,IAAA,EAAM,KAAO,EAAA,qBAAA;AAAA,YACtC,eAAA,EAAiB,OAAQ,CAAA,IAAA,EAAM,KAAO,EAAA,qBAAA;AAAA,YACtC,YAAA,EAAc,CAAa,UAAA,EAAA,OAAA,CAAQ,eAAe,CAAA;AAAA,WACpD;AAAA,UACA,mEAAqE,EAAA;AAAA,YACnE,aAAe,EAAA;AAAA;AACjB;AACF;AACF,KACF;AAAA;AAGF,EAAI,IAAA,OAAA,CAAQ,aAAa,KAAO,EAAA;AAC9B,IAAA,UAAA,CAAW,qBAAwB,GAAA;AAAA,MACjC,cAAgB,EAAA;AAAA,QACd,IAAM,EAAA;AAAA,UACJ,MAAQ,EAAA;AAAA,YACN,UAAY,EAAA;AAAA;AACd,SACF;AAAA,QACA,KAAO,EAAA;AAAA,UACL,QAAU,EAAA;AAAA,YACR,UAAY,EAAA;AAAA;AACd;AACF;AACF,KACF;AAAA;AAMF,EAAA,UAAA,CAAW,0BAA6B,GAAA;AAAA,IACtC,cAAgB,EAAA;AAAA,MACd,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA;AAAA,OAChB;AAAA,MACA,KAAO,EAAA;AAAA,QACL,aAAe,EAAA;AAAA;AACjB;AACF,GACF;AAEA,EAAI,IAAA,OAAA,CAAQ,SAAS,KAAO,EAAA;AAC1B,IAAA,UAAA,CAAW,mBAAsB,GAAA;AAAA,MAC/B,cAAgB,EAAA;AAAA,QACd,IAAM,EAAA;AAAA,UACJ,MAAQ,EAAA;AAAA,SACV;AAAA,QACA,QAAU,EAAA;AAAA,UACR,KAAO,EAAA;AAAA;AACT;AACF,KACF;AAAA;AAGF,EAAO,OAAA,UAAA;AACT;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createPageTheme.esm.js","sources":["../../src/utils/createPageTheme.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\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 { PageTheme, genPageTheme, shapes } from '@backstage/theme';\nimport { ThemeConfigPageTheme } from '../types';\n\n/**\n * Creates a page theme from a page theme configuration (app-config.yaml).\n *\n * This allows the user to specificy a custom header with:\n *\n * * `backgroundColor` or `colors` like `'#ff0000'`, `['#ff0000']` or `['#ff0000', '#00ff00', '#0000ff']`.\n *\n * More then one color will create a gradient from left to right.\n *\n * * a `shape` like `round`, `wave`, `wave2`, or `none`.\n *\n * * or an `backgroundImage` that supports different types of images references:\n *\n * 1. CSS urls like `data:image/svg+xml,...` or `url(data:image/svg+xml,...)`\n * 2. Absolute or relative URLs starting with `http://`, `https://` or `/`\n * 3. Inline <svg>...</svg> images will be transformed to `url(data:image/svg+xml,<svg>...</svg>)`\n *\n * * `fontColor` like `'#ffffff'` or `'#000000'`\n */\nexport const createPageTheme = (\n pageThemeConfig: ThemeConfigPageTheme,\n): PageTheme => {\n let colors = pageThemeConfig.backgroundColor ?? pageThemeConfig.colors;\n if (typeof colors === 'string') {\n colors = [colors];\n } else if (!colors?.length) {\n colors = ['transparent'];\n }\n\n let shape =\n pageThemeConfig.backgroundImage ??\n shapes[pageThemeConfig.shape as string] ??\n pageThemeConfig.shape ??\n 'none';\n if (\n shape.startsWith('data:') ||\n shape.startsWith('http://') ||\n shape.startsWith('https://') ||\n shape.startsWith('/')\n ) {\n shape = `url(\"${shape}\")`;\n } else if (shape.startsWith('<svg') && shape.endsWith('>')) {\n shape = `url(\"data:image/svg+xml,${encodeURIComponent(shape)}\")`;\n }\n\n // https://github.com/backstage/backstage/blob/master/packages/theme/src/base/pageTheme.ts#L59-L87\n return genPageTheme({\n colors,\n shape,\n options: {\n fontColor: pageThemeConfig.fontColor, // default is white in genPageTheme!\n },\n });\n};\n"],"names":[],"mappings":";;AAqCa,MAAA,eAAA,GAAkB,CAC7B,eACc,KAAA;AACd,EAAI,IAAA,MAAA,GAAS,eAAgB,CAAA,eAAA,IAAmB,eAAgB,CAAA,MAAA;AAChE,EAAI,IAAA,OAAO,WAAW,QAAU,EAAA;AAC9B,IAAA,MAAA,GAAS,CAAC,MAAM,CAAA;AAAA,GAClB,MAAA,IAAW,CAAC,MAAA,EAAQ,MAAQ,EAAA;AAC1B,IAAA,MAAA,GAAS,CAAC,aAAa,CAAA;AAAA;AAGzB,EAAI,IAAA,KAAA,GACF,gBAAgB,eAChB,IAAA,MAAA,CAAO,gBAAgB,KAAe,CAAA,IACtC,gBAAgB,KAChB,IAAA,MAAA;AACF,EAAA,IACE,KAAM,CAAA,UAAA,CAAW,OAAO,CAAA,IACxB,MAAM,UAAW,CAAA,SAAS,CAC1B,IAAA,KAAA,CAAM,WAAW,UAAU,CAAA,IAC3B,KAAM,CAAA,UAAA,CAAW,GAAG,CACpB,EAAA;AACA,IAAA,KAAA,GAAQ,QAAQ,KAAK,CAAA,EAAA,CAAA;AAAA,GACvB,MAAA,IAAW,MAAM,UAAW,CAAA,MAAM,KAAK,KAAM,CAAA,QAAA,CAAS,GAAG,CAAG,EAAA;AAC1D,IAAQ,KAAA,GAAA,CAAA,wBAAA,EAA2B,kBAAmB,CAAA,KAAK,CAAC,CAAA,EAAA,CAAA;AAAA;AAI9D,EAAA,OAAO,YAAa,CAAA;AAAA,IAClB,MAAA;AAAA,IACA,KAAA;AAAA,IACA,OAAS,EAAA;AAAA,MACP,WAAW,eAAgB,CAAA;AAAA;AAAA;AAC7B,GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"createPageTheme.esm.js","sources":["../../src/utils/createPageTheme.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { PageTheme, genPageTheme, shapes } from '@backstage/theme';\nimport { ThemeConfigPageTheme } from '../types';\n\n/**\n * Creates a page theme from a page theme configuration (app-config.yaml).\n *\n * This allows the user to specificy a custom header with:\n *\n * * `backgroundColor` or `colors` like `'#ff0000'`, `['#ff0000']` or `['#ff0000', '#00ff00', '#0000ff']`.\n *\n * More then one color will create a gradient from left to right.\n *\n * * a `shape` like `round`, `wave`, `wave2`, or `none`.\n *\n * * or an `backgroundImage` that supports different types of images references:\n *\n * 1. CSS urls like `data:image/svg+xml,...` or `url(data:image/svg+xml,...)`\n * 2. Absolute or relative URLs starting with `http://`, `https://` or `/`\n * 3. Inline <svg>...</svg> images will be transformed to `url(data:image/svg+xml,<svg>...</svg>)`\n *\n * * `fontColor` like `'#ffffff'` or `'#000000'`\n */\nexport const createPageTheme = (\n pageThemeConfig: ThemeConfigPageTheme,\n): PageTheme => {\n let colors = pageThemeConfig.backgroundColor ?? pageThemeConfig.colors;\n if (typeof colors === 'string') {\n colors = [colors];\n } else if (!colors?.length) {\n colors = ['transparent'];\n }\n\n let shape =\n pageThemeConfig.backgroundImage ??\n shapes[pageThemeConfig.shape as string] ??\n pageThemeConfig.shape ??\n 'none';\n if (\n shape.startsWith('data:') ||\n shape.startsWith('http://') ||\n shape.startsWith('https://') ||\n shape.startsWith('/')\n ) {\n shape = `url(\"${shape}\")`;\n } else if (shape.startsWith('<svg') && shape.endsWith('>')) {\n shape = `url(\"data:image/svg+xml,${encodeURIComponent(shape)}\")`;\n }\n\n // https://github.com/backstage/backstage/blob/master/packages/theme/src/base/pageTheme.ts#L59-L87\n return genPageTheme({\n colors,\n shape,\n options: {\n fontColor: pageThemeConfig.fontColor, // default is white in genPageTheme!\n },\n });\n};\n"],"names":[],"mappings":";;AAsCa,MAAA,eAAA,GAAkB,CAC7B,eACc,KAAA;AACd,EAAI,IAAA,MAAA,GAAS,eAAgB,CAAA,eAAA,IAAmB,eAAgB,CAAA,MAAA;AAChE,EAAI,IAAA,OAAO,WAAW,QAAU,EAAA;AAC9B,IAAA,MAAA,GAAS,CAAC,MAAM,CAAA;AAAA,GAClB,MAAA,IAAW,CAAC,MAAA,EAAQ,MAAQ,EAAA;AAC1B,IAAA,MAAA,GAAS,CAAC,aAAa,CAAA;AAAA;AAGzB,EAAI,IAAA,KAAA,GACF,gBAAgB,eAChB,IAAA,MAAA,CAAO,gBAAgB,KAAe,CAAA,IACtC,gBAAgB,KAChB,IAAA,MAAA;AACF,EAAA,IACE,KAAM,CAAA,UAAA,CAAW,OAAO,CAAA,IACxB,MAAM,UAAW,CAAA,SAAS,CAC1B,IAAA,KAAA,CAAM,WAAW,UAAU,CAAA,IAC3B,KAAM,CAAA,UAAA,CAAW,GAAG,CACpB,EAAA;AACA,IAAA,KAAA,GAAQ,QAAQ,KAAK,CAAA,EAAA,CAAA;AAAA,GACvB,MAAA,IAAW,MAAM,UAAW,CAAA,MAAM,KAAK,KAAM,CAAA,QAAA,CAAS,GAAG,CAAG,EAAA;AAC1D,IAAQ,KAAA,GAAA,CAAA,wBAAA,EAA2B,kBAAmB,CAAA,KAAK,CAAC,CAAA,EAAA,CAAA;AAAA;AAI9D,EAAA,OAAO,YAAa,CAAA;AAAA,IAClB,MAAA;AAAA,IACA,KAAA;AAAA,IACA,OAAS,EAAA;AAAA,MACP,WAAW,eAAgB,CAAA;AAAA;AAAA;AAC7B,GACD,CAAA;AACH;;;;"}
@@ -2,7 +2,7 @@ import { createPageTheme } from './createPageTheme.esm.js';
2
2
 
3
3
  const createPageThemes = (themeConfig) => {
4
4
  if (!themeConfig?.pageTheme || !Object.keys(themeConfig.pageTheme).length) {
5
- return void 0;
5
+ return undefined;
6
6
  }
7
7
  const pageThemes = {};
8
8
  for (const page in themeConfig.pageTheme) {
@@ -1 +1 @@
1
- {"version":3,"file":"createPageThemes.esm.js","sources":["../../src/utils/createPageThemes.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\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 { PageTheme } from '@backstage/theme';\nimport { ThemeConfig } from '../types';\nimport { createPageTheme } from './createPageTheme';\n\nexport const createPageThemes = (\n themeConfig: ThemeConfig | undefined,\n): Record<string, PageTheme> | undefined => {\n if (!themeConfig?.pageTheme || !Object.keys(themeConfig.pageTheme).length) {\n return undefined;\n }\n\n const pageThemes: Record<string, PageTheme> = {};\n\n for (const page in themeConfig.pageTheme) {\n if (Object.hasOwn(themeConfig.pageTheme, page)) {\n pageThemes[page] = createPageTheme(themeConfig.pageTheme[page]);\n }\n }\n\n return pageThemes;\n};\n"],"names":[],"mappings":";;AAmBa,MAAA,gBAAA,GAAmB,CAC9B,WAC0C,KAAA;AAC1C,EAAI,IAAA,CAAC,aAAa,SAAa,IAAA,CAAC,OAAO,IAAK,CAAA,WAAA,CAAY,SAAS,CAAA,CAAE,MAAQ,EAAA;AACzE,IAAO,OAAA,KAAA,CAAA;AAAA;AAGT,EAAA,MAAM,aAAwC,EAAC;AAE/C,EAAW,KAAA,MAAA,IAAA,IAAQ,YAAY,SAAW,EAAA;AACxC,IAAA,IAAI,MAAO,CAAA,MAAA,CAAO,WAAY,CAAA,SAAA,EAAW,IAAI,CAAG,EAAA;AAC9C,MAAA,UAAA,CAAW,IAAI,CAAI,GAAA,eAAA,CAAgB,WAAY,CAAA,SAAA,CAAU,IAAI,CAAC,CAAA;AAAA;AAChE;AAGF,EAAO,OAAA,UAAA;AACT;;;;"}
1
+ {"version":3,"file":"createPageThemes.esm.js","sources":["../../src/utils/createPageThemes.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { PageTheme } from '@backstage/theme';\nimport { ThemeConfig } from '../types';\nimport { createPageTheme } from './createPageTheme';\n\nexport const createPageThemes = (\n themeConfig: ThemeConfig | undefined,\n): Record<string, PageTheme> | undefined => {\n if (!themeConfig?.pageTheme || !Object.keys(themeConfig.pageTheme).length) {\n return undefined;\n }\n\n const pageThemes: Record<string, PageTheme> = {};\n\n for (const page in themeConfig.pageTheme) {\n if (Object.hasOwn(themeConfig.pageTheme, page)) {\n pageThemes[page] = createPageTheme(themeConfig.pageTheme[page]);\n }\n }\n\n return pageThemes;\n};\n"],"names":[],"mappings":";;AAoBa,MAAA,gBAAA,GAAmB,CAC9B,WAC0C,KAAA;AAC1C,EAAI,IAAA,CAAC,aAAa,SAAa,IAAA,CAAC,OAAO,IAAK,CAAA,WAAA,CAAY,SAAS,CAAA,CAAE,MAAQ,EAAA;AACzE,IAAO,OAAA,SAAA;AAAA;AAGT,EAAA,MAAM,aAAwC,EAAC;AAE/C,EAAW,KAAA,MAAA,IAAA,IAAQ,YAAY,SAAW,EAAA;AACxC,IAAA,IAAI,MAAO,CAAA,MAAA,CAAO,WAAY,CAAA,SAAA,EAAW,IAAI,CAAG,EAAA;AAC9C,MAAA,UAAA,CAAW,IAAI,CAAI,GAAA,eAAA,CAAgB,WAAY,CAAA,SAAA,CAAU,IAAI,CAAC,CAAA;AAAA;AAChE;AAGF,EAAO,OAAA,UAAA;AACT;;;;"}
@@ -1,5 +1,5 @@
1
1
  function isObject(objectOrValue) {
2
- return objectOrValue !== void 0 && objectOrValue !== null && typeof objectOrValue === "object" && !Array.isArray(objectOrValue);
2
+ return objectOrValue !== undefined && objectOrValue !== null && typeof objectOrValue === "object" && !Array.isArray(objectOrValue);
3
3
  }
4
4
  const deepCopyObject = (objectOrValue) => {
5
5
  if (isObject(objectOrValue)) {
@@ -34,7 +34,7 @@ const deepMergeObjects = (defaultValue, customValue) => {
34
34
  }
35
35
  return result;
36
36
  }
37
- return customValue !== void 0 ? customValue : defaultValue;
37
+ return customValue !== undefined ? customValue : defaultValue;
38
38
  };
39
39
  const mergeUnifiedThemeOptions = (defaultThemeConfig, customizedThemeConfig) => {
40
40
  return deepMergeObjects(
@@ -1 +1 @@
1
- {"version":3,"file":"mergeTheme.esm.js","sources":["../../src/utils/mergeTheme.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\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 { ThemeConfig } from '../types';\n\nfunction isObject(\n objectOrValue: unknown,\n): objectOrValue is Record<string, unknown> {\n return (\n objectOrValue !== undefined &&\n objectOrValue !== null &&\n typeof objectOrValue === 'object' &&\n !Array.isArray(objectOrValue)\n );\n}\n\nconst deepCopyObject = (objectOrValue: unknown): unknown => {\n if (isObject(objectOrValue)) {\n const result: Record<string, unknown> = {};\n for (const key of Object.keys(objectOrValue)) {\n result[key] = deepCopyObject(objectOrValue[key]);\n }\n return result;\n }\n return objectOrValue;\n};\n\nexport const deepMergeObjects = (\n defaultValue: unknown,\n customValue: unknown,\n): unknown => {\n if (isObject(defaultValue) || isObject(customValue)) {\n const result: Record<string, unknown> = {};\n if (isObject(defaultValue) && isObject(customValue)) {\n for (const key of Object.keys(defaultValue)) {\n result[key] = deepMergeObjects(defaultValue[key], customValue[key]);\n }\n for (const key of Object.keys(customValue)) {\n result[key] = deepMergeObjects(defaultValue[key], customValue[key]);\n }\n } else if (customValue === null) {\n return null;\n } else if (isObject(customValue)) {\n for (const key of Object.keys(customValue)) {\n result[key] = deepCopyObject(customValue[key]);\n }\n } else if (isObject(defaultValue)) {\n for (const key of Object.keys(defaultValue)) {\n result[key] = deepCopyObject(defaultValue[key]);\n }\n }\n return result;\n }\n return customValue !== undefined ? customValue : defaultValue;\n};\n\n/**\n * Merges two theme configurations with this priority:\n *\n * 1. Values will be picked up first from the `defaultThemeConfig` and\n * then from the `customizedThemeConfig`.\n * This means that if a value is set in the customized theme, it will 'override' the default.\n * 2. Null values in `customizedThemeConfig` the will override the default with `null`,\n * while undefined values will be ignored.\n * 3. Objects will be merged recursively.\n * All other values, esp. Arrays, will not be merged.\n *\n * @param defaultThemeConfig\n * @param customizedThemeConfig\n * @returns\n */\nexport const mergeUnifiedThemeOptions = (\n defaultThemeConfig: ThemeConfig,\n customizedThemeConfig: ThemeConfig,\n): ThemeConfig => {\n return deepMergeObjects(\n defaultThemeConfig,\n customizedThemeConfig,\n ) as ThemeConfig;\n};\n"],"names":[],"mappings":"AAiBA,SAAS,SACP,aAC0C,EAAA;AAC1C,EACE,OAAA,aAAA,KAAkB,KAClB,CAAA,IAAA,aAAA,KAAkB,IAClB,IAAA,OAAO,kBAAkB,QACzB,IAAA,CAAC,KAAM,CAAA,OAAA,CAAQ,aAAa,CAAA;AAEhC;AAEA,MAAM,cAAA,GAAiB,CAAC,aAAoC,KAAA;AAC1D,EAAI,IAAA,QAAA,CAAS,aAAa,CAAG,E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AA,YAAY,CAAG,EAAA;AACjC,MAAA,KAAA,MAAW,GAAO,IAAA,MAAA,CAAO,IAAK,CAAA,YAAY,CAAG,EAAA;AAC3C,QAAA,MAAA,CAAO,GAAG,CAAA,GAAI,cAAe,CAAA,YAAA,CAAa,GAAG,CAAC,CAAA;AAAA;AAChD;AAEF,IAAO,OAAA,MAAA;AAAA;AAET,EAAO,OAAA,WAAA,KAAgB,SAAY,WAAc,GAAA,YAAA;AACnD;AAiBa,MAAA,wBAAA,GAA2B,CACtC,kBAAA,EACA,qBACgB,KAAA;AAChB,EAAO,OAAA,gBAAA;AAAA,IACL,kBAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"mergeTheme.esm.js","sources":["../../src/utils/mergeTheme.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ThemeConfig } from '../types';\n\nfunction isObject(\n objectOrValue: unknown,\n): objectOrValue is Record<string, unknown> {\n return (\n objectOrValue !== undefined &&\n objectOrValue !== null &&\n typeof objectOrValue === 'object' &&\n !Array.isArray(objectOrValue)\n );\n}\n\nconst deepCopyObject = (objectOrValue: unknown): unknown => {\n if (isObject(objectOrValue)) {\n const result: Record<string, unknown> = {};\n for (const key of Object.keys(objectOrValue)) {\n result[key] = deepCopyObject(objectOrValue[key]);\n }\n return result;\n }\n return objectOrValue;\n};\n\nexport const deepMergeObjects = (\n defaultValue: unknown,\n customValue: unknown,\n): unknown => {\n if (isObject(defaultValue) || isObject(customValue)) {\n const result: Record<string, unknown> = {};\n if (isObject(defaultValue) && isObject(customValue)) {\n for (const key of Object.keys(defaultValue)) {\n result[key] = deepMergeObjects(defaultValue[key], customValue[key]);\n }\n for (const key of Object.keys(customValue)) {\n result[key] = deepMergeObjects(defaultValue[key], customValue[key]);\n }\n } else if (customValue === null) {\n return null;\n } else if (isObject(customValue)) {\n for (const key of Object.keys(customValue)) {\n result[key] = deepCopyObject(customValue[key]);\n }\n } else if (isObject(defaultValue)) {\n for (const key of Object.keys(defaultValue)) {\n result[key] = deepCopyObject(defaultValue[key]);\n }\n }\n return result;\n }\n return customValue !== undefined ? customValue : defaultValue;\n};\n\n/**\n * Merges two theme configurations with this priority:\n *\n * 1. Values will be picked up first from the `defaultThemeConfig` and\n * then from the `customizedThemeConfig`.\n * This means that if a value is set in the customized theme, it will 'override' the default.\n * 2. Null values in `customizedThemeConfig` the will override the default with `null`,\n * while undefined values will be ignored.\n * 3. Objects will be merged recursively.\n * All other values, esp. Arrays, will not be merged.\n *\n * @param defaultThemeConfig\n * @param customizedThemeConfig\n * @returns\n */\nexport const mergeUnifiedThemeOptions = (\n defaultThemeConfig: ThemeConfig,\n customizedThemeConfig: ThemeConfig,\n): ThemeConfig => {\n return deepMergeObjects(\n defaultThemeConfig,\n customizedThemeConfig,\n ) as ThemeConfig;\n};\n"],"names":[],"mappings":"AAkBA,SAAS,SACP,aAC0C,EAAA;AAC1C,EACE,OAAA,aAAA,KAAkB,SAClB,IAAA,aAAA,KAAkB,IAClB,IAAA,OAAO,kBAAkB,QACzB,IAAA,CAAC,KAAM,CAAA,OAAA,CAAQ,aAAa,CAAA;AAEhC;AAEA,MAAM,cAAA,GAAiB,CAAC,aAAoC,KAAA;AAC1D,EAAI,IAAA,QAAA,CAAS,aAAa,CAAG,EAAA;AAC3B,IAAA,MAAM,SAAkC,EAAC;AACzC,IAAA,KAAA,MAAW,GAAO,IAAA,MAAA,CAAO,IAAK,CAAA,aAAa,CAAG,EAAA;AAC5C,MAAA,MAAA,CAAO,GAAG,CAAA,GAAI,cAAe,CAAA,aAAA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AC,CAAA;AAAA;AAChD;AAEF,IAAO,OAAA,MAAA;AAAA;AAET,EAAO,OAAA,WAAA,KAAgB,YAAY,WAAc,GAAA,YAAA;AACnD;AAiBa,MAAA,wBAAA,GAA2B,CACtC,kBAAA,EACA,qBACgB,KAAA;AAChB,EAAO,OAAA,gBAAA;AAAA,IACL,kBAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"migrateTheme.esm.js","sources":["../../src/utils/migrateTheme.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\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 { BackstagePaletteAdditions } from '@backstage/theme';\nimport type { SimplePaletteColorOptions } from '@mui/material/styles';\nimport type { ThemeConfig } from '../types';\n\nexport interface DeprecatedRHDH10to12ThemeColors {\n /**\n * primaryColor Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n primaryColor?: string;\n /**\n * Header Theme color Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n headerColor1?: string;\n /**\n * Header Theme color Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n headerColor2?: string;\n /**\n * Navigation Side Bar Indicator color Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n navigationIndicatorColor?: string;\n}\n\nfunction isObject(\n objectOrValue: unknown,\n): objectOrValue is Record<string, unknown> {\n return typeof objectOrValue === 'object' && !Array.isArray(objectOrValue);\n}\n\nexport const migrateThemeConfig = (\n themeConfig: ThemeConfig & DeprecatedRHDH10to12ThemeColors,\n): ThemeConfig => {\n if (!themeConfig) {\n return { palette: {} };\n }\n\n // Drop deprecated values from the root level!\n const migrated: ThemeConfig = {\n palette: themeConfig.palette ?? {},\n defaultPageTheme: themeConfig.defaultPageTheme,\n pageTheme: themeConfig.pageTheme,\n fontFamily: themeConfig.fontFamily,\n htmlFontSize: themeConfig.htmlFontSize,\n typography: themeConfig.typography,\n options: themeConfig.options,\n };\n\n if (themeConfig.primaryColor) {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Automatically migrate theme configuration from `primaryColor` to `palette.primary.main`',\n );\n if (isObject(migrated.palette?.primary)) {\n if (!(migrated.palette.primary as SimplePaletteColorOptions).main) {\n (migrated.palette.primary as SimplePaletteColorOptions).main =\n themeConfig.primaryColor;\n }\n } else if (migrated.palette) {\n migrated.palette.primary = { main: themeConfig.primaryColor };\n }\n }\n\n if (themeConfig.navigationIndicatorColor) {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Automatically migrate theme configuration from `navigationIndicatorColor` to `palette.navigation.indicator`',\n );\n if (isObject(migrated.palette?.navigation)) {\n if (!migrated.palette.navigation.indicator) {\n migrated.palette.navigation.indicator =\n themeConfig.navigationIndicatorColor;\n }\n } else if (migrated.palette) {\n migrated.palette.navigation = {\n indicator: themeConfig.navigationIndicatorColor,\n } as BackstagePaletteAdditions['navigation'];\n }\n }\n\n if (themeConfig.headerColor1) {\n if (themeConfig.pageTheme) {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Ignore theme configuration `headerColor1` and `headerColor2` because `pageTheme` is defined!',\n );\n } else {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Automatically migrate theme configuration from `headerColor1` and `headerColor2` to `pageTheme.home.backgroundColor`',\n );\n migrated.defaultPageTheme = 'home';\n migrated.pageTheme = {\n home: {\n backgroundColor: !themeConfig.headerColor2\n ? themeConfig.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AI,QAAS,CAAA,QAAA,CAAS,OAAS,EAAA,UAAU,CAAG,EAAA;AAC1C,MAAA,IAAI,CAAC,QAAA,CAAS,OAAQ,CAAA,UAAA,CAAW,SAAW,EAAA;AAC1C,QAAS,QAAA,CAAA,OAAA,CAAQ,UAAW,CAAA,SAAA,GAC1B,WAAY,CAAA,wBAAA;AAAA;AAChB,KACF,MAAA,IAAW,SAAS,OAAS,EAAA;AAC3B,MAAA,QAAA,CAAS,QAAQ,UAAa,GAAA;AAAA,QAC5B,WAAW,WAAY,CAAA;AAAA,OACzB;AAAA;AACF;AAGF,EAAA,IAAI,YAAY,YAAc,EAAA;AAC5B,IAAA,IAAI,YAAY,SAAW,EAAA;AAEzB,MAAQ,OAAA,CAAA,IAAA;AAAA,QACN;AAAA,OACF;AAAA,KACK,MAAA;AAEL,MAAQ,OAAA,CAAA,IAAA;AAAA,QACN;AAAA,OACF;AACA,MAAA,QAAA,CAAS,gBAAmB,GAAA,MAAA;AAC5B,MAAA,QAAA,CAAS,SAAY,GAAA;AAAA,QACnB,IAAM,EAAA;AAAA,UACJ,eAAA,EAAiB,CAAC,WAAA,CAAY,YAC1B,GAAA,WAAA,CAAY,eACZ,CAAC,WAAA,CAAY,YAAc,EAAA,WAAA,CAAY,YAAY;AAAA;AACzD,OACF;AAAA;AACF;AAGF,EAAO,OAAA,QAAA;AACT;;;;"}
1
+ {"version":3,"file":"migrateTheme.esm.js","sources":["../../src/utils/migrateTheme.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { BackstagePaletteAdditions } from '@backstage/theme';\nimport type { SimplePaletteColorOptions } from '@mui/material/styles';\nimport type { ThemeConfig } from '../types';\n\nexport interface DeprecatedRHDH10to12ThemeColors {\n /**\n * primaryColor Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n primaryColor?: string;\n /**\n * Header Theme color Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n headerColor1?: string;\n /**\n * Header Theme color Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n headerColor2?: string;\n /**\n * Navigation Side Bar Indicator color Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n navigationIndicatorColor?: string;\n}\n\nfunction isObject(\n objectOrValue: unknown,\n): objectOrValue is Record<string, unknown> {\n return typeof objectOrValue === 'object' && !Array.isArray(objectOrValue);\n}\n\nexport const migrateThemeConfig = (\n themeConfig: ThemeConfig & DeprecatedRHDH10to12ThemeColors,\n): ThemeConfig => {\n if (!themeConfig) {\n return { palette: {} };\n }\n\n // Drop deprecated values from the root level!\n const migrated: ThemeConfig = {\n palette: themeConfig.palette ?? {},\n defaultPageTheme: themeConfig.defaultPageTheme,\n pageTheme: themeConfig.pageTheme,\n fontFamily: themeConfig.fontFamily,\n htmlFontSize: themeConfig.htmlFontSize,\n typography: themeConfig.typography,\n options: themeConfig.options,\n };\n\n if (themeConfig.primaryColor) {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Automatically migrate theme configuration from `primaryColor` to `palette.primary.main`',\n );\n if (isObject(migrated.palette?.primary)) {\n if (!(migrated.palette.primary as SimplePaletteColorOptions).main) {\n (migrated.palette.primary as SimplePaletteColorOptions).main =\n themeConfig.primaryColor;\n }\n } else if (migrated.palette) {\n migrated.palette.primary = { main: themeConfig.primaryColor };\n }\n }\n\n if (themeConfig.navigationIndicatorColor) {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Automatically migrate theme configuration from `navigationIndicatorColor` to `palette.navigation.indicator`',\n );\n if (isObject(migrated.palette?.navigation)) {\n if (!migrated.palette.navigation.indicator) {\n migrated.palette.navigation.indicator =\n themeConfig.navigationIndicatorColor;\n }\n } else if (migrated.palette) {\n migrated.palette.navigation = {\n indicator: themeConfig.navigationIndicatorColor,\n } as BackstagePaletteAdditions['navigation'];\n }\n }\n\n if (themeConfig.headerColor1) {\n if (themeConfig.pageTheme) {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Ignore theme configuration `headerColor1` and `headerColor2` because `pageTheme` is defined!',\n );\n } else {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Automatically migrate theme configuration from `headerColor1` and `headerColor2` to `pageTheme.home.backgroundColor`',\n );\n migrated.defaultPageTheme = 'home';\n migrated.pageTheme = {\n home: {\n backgroundColor: !themeConfig.headerColor2\n ? themeConfig.headerColor1\n : [themeConfig.headerColor1, themeConfig.headerColor2],\n },\n };\n }\n }\n\n return migrated;\n};\n"],"names":[],"mappings":"AA2CA,SAAS,SACP,aAC0C,EAAA;AAC1C,EAAA,OAAO,OAAO,aAAkB,KAAA,QAAA,IAAY,CAAC,KAAA,CAAM,QAAQ,aAAa,CAAA;AAC1E;AAEa,MAAA,kBAAA,GAAqB,CAChC,WACgB,KAAA;AAChB,EAAA,IAAI,CAAC,WAAa,EAAA;AAChB,IAAO,OAAA,EAAE,OAAS,EAAA,EAAG,EAAA;AAAA;AAIvB,EAAA,MAAM,QAAwB,GAAA;AAAA,IAC5B,OAAA,EAAS,WAAY,CAAA,OAAA,IAAW,EAAC;AAAA,IACjC,kBAAkB,WAAY,CAAA,gBAAA;AAAA,IAC9B,WAAW,WAAY,CAAA,SAAA;AAAA,IACvB,YAAY,WAAY,CAAA,UAAA;AAAA,IACxB,cAAc,WAAY,CAAA,YAAA;AAAA,IAC1B,YAAY,WAAY,CAAA,UAAA;AAAA,IACxB,SAAS,WAA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,QACnB,IAAM,EAAA;AAAA,UACJ,eAAA,EAAiB,CAAC,WAAA,CAAY,YAC1B,GAAA,WAAA,CAAY,eACZ,CAAC,WAAA,CAAY,YAAc,EAAA,WAAA,CAAY,YAAY;AAAA;AACzD,OACF;AAAA;AACF;AAGF,EAAO,OAAA,QAAA;AACT;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@red-hat-developer-hub/backstage-plugin-theme",
3
- "version": "0.4.8",
3
+ "version": "0.5.0",
4
4
  "description": "Red Hat Developer Hub Theme",
5
5
  "main": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,34 +18,33 @@
18
18
  "backstage": {
19
19
  "role": "web-library"
20
20
  },
21
- "sideEffects": [
22
- "./fonts/*.css"
23
- ],
21
+ "sideEffects": false,
24
22
  "scripts": {
25
23
  "start": "backstage-cli package start",
26
- "build": "backstage-cli package build && ./fix-style-inject-imports.sh",
24
+ "build": "backstage-cli package build",
27
25
  "lint": "backstage-cli package lint",
28
26
  "test": "backstage-cli package test",
29
27
  "clean": "backstage-cli package clean",
30
28
  "prepack": "backstage-cli package prepack",
31
- "postpack": "backstage-cli package postpack",
32
- "prepublish": "./fix-style-inject-imports.sh"
29
+ "postpack": "backstage-cli package postpack"
33
30
  },
34
31
  "peerDependencies": {
35
- "@backstage/core-plugin-api": "^1.10.0",
36
- "@backstage/theme": "^0.6.0",
32
+ "@backstage/core-plugin-api": "^1.10.3",
33
+ "@backstage/theme": "^0.6.3",
37
34
  "@material-ui/icons": "^4.11.3",
38
35
  "@mui/material": "^5.0.0",
39
36
  "react": "^16.13.1 || ^17.0.0 || ^18.0.0"
40
37
  },
41
38
  "devDependencies": {
42
- "@backstage/cli": "^0.28.0",
43
- "@backstage/core-app-api": "^1.15.1",
44
- "@backstage/core-plugin-api": "^1.10.0",
45
- "@backstage/dev-utils": "^1.1.2",
46
- "@backstage/test-utils": "^1.7.0",
47
- "@backstage/theme": "^0.6.0",
48
- "@backstage/types": "^1.2.0",
39
+ "@backstage/cli": "^0.29.5",
40
+ "@backstage/core-app-api": "^1.15.4",
41
+ "@backstage/core-components": "^0.16.3",
42
+ "@backstage/core-plugin-api": "^1.10.3",
43
+ "@backstage/dev-utils": "^1.1.6",
44
+ "@backstage/plugin-user-settings": "^0.8.18",
45
+ "@backstage/test-utils": "^1.7.4",
46
+ "@backstage/theme": "^0.6.3",
47
+ "@backstage/types": "^1.2.1",
49
48
  "@material-ui/icons": "^4.11.3",
50
49
  "@testing-library/jest-dom": "^6.0.0",
51
50
  "@testing-library/react": "^14.0.0",
@@ -57,8 +56,7 @@
57
56
  "configSchema": "config.d.ts",
58
57
  "files": [
59
58
  "config.d.ts",
60
- "dist",
61
- "fonts"
59
+ "dist"
62
60
  ],
63
61
  "author": "Red Hat",
64
62
  "homepage": "https://red.ht/rhdh",
@@ -74,5 +72,12 @@
74
72
  "@debsmita1",
75
73
  "@divyanshiGupta"
76
74
  ],
75
+ "typesVersions": {
76
+ "*": {
77
+ "index": [
78
+ "dist/index.d.ts"
79
+ ]
80
+ }
81
+ },
77
82
  "module": "./dist/index.esm.js"
78
83
  }
@@ -1,7 +0,0 @@
1
- import styleInject from 'style-inject';
2
-
3
- var css_248z = "@font-face {\n font-family: 'RedHatDisplay';\n src: url('./RedHatDisplay/RedHatDisplayVF.woff2') format('woff2-variations');\n font-weight: 300 900;\n font-style: normal;\n font-display: fallback;\n}\n\n@font-face {\n font-family: 'RedHatDisplay';\n src: url('./RedHatDisplay/RedHatDisplayVF-Italic.woff2')\n format('woff2-variations');\n font-weight: 300 900;\n font-style: italic;\n font-display: fallback;\n}\n\n@font-face {\n font-family: 'RedHatText';\n src: url('./RedHatText/RedHatTextVF.woff2') format('woff2-variations');\n font-weight: 300 700;\n font-style: normal;\n font-display: fallback;\n}\n\n@font-face {\n font-family: 'RedHatText';\n src: url('./RedHatText/RedHatTextVF-Italic.woff2') format('woff2-variations');\n font-weight: 300 700;\n font-style: italic;\n font-display: fallback;\n}\n\n@font-face {\n font-family: 'RedHatMono';\n src: url('./RedHatMono/RedHatMonoVF.woff2') format('woff2-variations');\n font-weight: 300 700;\n font-style: normal;\n font-display: fallback;\n}\n\n@font-face {\n font-family: 'RedHatMono';\n src: url('./RedHatMono/RedHatMonoVF-Italic.woff2') format('woff2-variations');\n font-weight: 300 700;\n font-style: italic;\n font-display: fallback;\n}\n\npre,\ncode {\n font-family: 'RedHatMono', 'Liberation Mono', consolas, 'SFMono-Regular',\n menlo, monaco, 'Courier New', monospace;\n}\n";
4
- styleInject(css_248z);
5
-
6
- export { css_248z as default };
7
- //# sourceMappingURL=font.css.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"font.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,94 +0,0 @@
1
- Copyright 2021 Red Hat, Inc.,
2
- with Reserved Font Name Red Hat.
3
-
4
- This Font Software is licensed under the SIL Open Font License, Version 1.1.
5
- This license is copied below, and is also available with a FAQ at:
6
- http://scripts.sil.org/OFL
7
-
8
-
9
- -----------------------------------------------------------
10
- SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
11
- -----------------------------------------------------------
12
-
13
- PREAMBLE
14
- The goals of the Open Font License (OFL) are to stimulate worldwide
15
- development of collaborative font projects, to support the font creation
16
- efforts of academic and linguistic communities, and to provide a free and
17
- open framework in which fonts may be shared and improved in partnership
18
- with others.
19
-
20
- The OFL allows the licensed fonts to be used, studied, modified and
21
- redistributed freely as long as they are not sold by themselves. The
22
- fonts, including any derivative works, can be bundled, embedded,
23
- redistributed and/or sold with any software provided that any reserved
24
- names are not used by derivative works. The fonts and derivatives,
25
- however, cannot be released under any other type of license. The
26
- requirement for fonts to remain under this license does not apply
27
- to any document created using the fonts or their derivatives.
28
-
29
- DEFINITIONS
30
- "Font Software" refers to the set of files released by the Copyright
31
- Holder(s) under this license and clearly marked as such. This may
32
- include source files, build scripts and documentation.
33
-
34
- "Reserved Font Name" refers to any names specified as such after the
35
- copyright statement(s).
36
-
37
- "Original Version" refers to the collection of Font Software components as
38
- distributed by the Copyright Holder(s).
39
-
40
- "Modified Version" refers to any derivative made by adding to, deleting,
41
- or substituting -- in part or in whole -- any of the components of the
42
- Original Version, by changing formats or by porting the Font Software to a
43
- new environment.
44
-
45
- "Author" refers to any designer, engineer, programmer, technical
46
- writer or other person who contributed to the Font Software.
47
-
48
- PERMISSION & CONDITIONS
49
- Permission is hereby granted, free of charge, to any person obtaining
50
- a copy of the Font Software, to use, study, copy, merge, embed, modify,
51
- redistribute, and sell modified and unmodified copies of the Font
52
- Software, subject to the following conditions:
53
-
54
- 1) Neither the Font Software nor any of its individual components,
55
- in Original or Modified Versions, may be sold by itself.
56
-
57
- 2) Original or Modified Versions of the Font Software may be bundled,
58
- redistributed and/or sold with any software, provided that each copy
59
- contains the above copyright notice and this license. These can be
60
- included either as stand-alone text files, human-readable headers or
61
- in the appropriate machine-readable metadata fields within text or
62
- binary files as long as those fields can be easily viewed by the user.
63
-
64
- 3) No Modified Version of the Font Software may use the Reserved Font
65
- Name(s) unless explicit written permission is granted by the corresponding
66
- Copyright Holder. This restriction only applies to the primary font name as
67
- presented to the users.
68
-
69
- 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
70
- Software shall not be used to promote, endorse or advertise any
71
- Modified Version, except to acknowledge the contribution(s) of the
72
- Copyright Holder(s) and the Author(s) or with their explicit written
73
- permission.
74
-
75
- 5) The Font Software, modified or unmodified, in part or in whole,
76
- must be distributed entirely under this license, and must not be
77
- distributed under any other license. The requirement for fonts to
78
- remain under this license does not apply to any document created
79
- using the Font Software.
80
-
81
- TERMINATION
82
- This license becomes null and void if any of the above conditions are
83
- not met.
84
-
85
- DISCLAIMER
86
- THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
87
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
88
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
89
- OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
90
- COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
91
- INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
92
- DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93
- FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
94
- OTHER DEALINGS IN THE FONT SOFTWARE.
package/fonts/README.md DELETED
@@ -1,9 +0,0 @@
1
- # Red Hat font family
2
-
3
- See also:
4
-
5
- 1. https://www.patternfly.org/design-foundations/typography
6
- 2. https://www.redhat.com/en/about/brand/standards/typography
7
- 3. https://ux.redhat.com/foundations/typography/
8
- 4. https://github.com/RedHatOfficial/RedHatFont
9
- 5. https://github.com/RedHatOfficial/RedHatFont/tree/master/webfonts
package/fonts/font.css DELETED
@@ -1,54 +0,0 @@
1
- @font-face {
2
- font-family: 'RedHatDisplay';
3
- src: url('./RedHatDisplay/RedHatDisplayVF.woff2') format('woff2-variations');
4
- font-weight: 300 900;
5
- font-style: normal;
6
- font-display: fallback;
7
- }
8
-
9
- @font-face {
10
- font-family: 'RedHatDisplay';
11
- src: url('./RedHatDisplay/RedHatDisplayVF-Italic.woff2')
12
- format('woff2-variations');
13
- font-weight: 300 900;
14
- font-style: italic;
15
- font-display: fallback;
16
- }
17
-
18
- @font-face {
19
- font-family: 'RedHatText';
20
- src: url('./RedHatText/RedHatTextVF.woff2') format('woff2-variations');
21
- font-weight: 300 700;
22
- font-style: normal;
23
- font-display: fallback;
24
- }
25
-
26
- @font-face {
27
- font-family: 'RedHatText';
28
- src: url('./RedHatText/RedHatTextVF-Italic.woff2') format('woff2-variations');
29
- font-weight: 300 700;
30
- font-style: italic;
31
- font-display: fallback;
32
- }
33
-
34
- @font-face {
35
- font-family: 'RedHatMono';
36
- src: url('./RedHatMono/RedHatMonoVF.woff2') format('woff2-variations');
37
- font-weight: 300 700;
38
- font-style: normal;
39
- font-display: fallback;
40
- }
41
-
42
- @font-face {
43
- font-family: 'RedHatMono';
44
- src: url('./RedHatMono/RedHatMonoVF-Italic.woff2') format('woff2-variations');
45
- font-weight: 300 700;
46
- font-style: italic;
47
- font-display: fallback;
48
- }
49
-
50
- pre,
51
- code {
52
- font-family: 'RedHatMono', 'Liberation Mono', consolas, 'SFMono-Regular',
53
- menlo, monaco, 'Courier New', monospace;
54
- }