@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @red-hat-developer-hub/backstage-plugin-theme
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a571f32: Upgrade Backstage from 0.32.0 to 1.35.0
8
+
9
+ ### Patch Changes
10
+
11
+ - 106b3d0: Fixing fontColor error while customizing rhdh appearance
12
+
13
+ ## 0.4.9
14
+
15
+ ### Patch Changes
16
+
17
+ - b6efba4: fix font loading after migrating theme
18
+
3
19
  ## 0.4.8
4
20
 
5
21
  ### Patch Changes
package/config.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2024 The Backstage Authors
2
+ * Copyright Red Hat, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import { ThemeConfig } from './src';
17
18
 
18
19
  export interface Config {
@@ -1 +1 @@
1
- {"version":3,"file":"backstage.esm.js","sources":["../src/backstage.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 { palettes } from '@backstage/theme';\n\nimport { ThemeConfig } from './types';\n\nexport const getDefaultThemeConfig = (mode: 'light' | 'dark'): ThemeConfig => {\n const palette = mode === 'dark' ? palettes.dark : palettes.light;\n\n return {\n variant: 'backstage',\n mode: mode === 'dark' ? 'dark' : 'light',\n palette,\n };\n};\n"],"names":[],"mappings":";;AAmBa,MAAA,qBAAA,GAAwB,CAAC,IAAwC,KAAA;AAC5E,EAAA,MAAM,OAAU,GAAA,IAAA,KAAS,MAAS,GAAA,QAAA,CAAS,OAAO,QAAS,CAAA,KAAA;AAE3D,EAAO,OAAA;AAAA,IACL,OAAS,EAAA,WAAA;AAAA,IACT,IAAA,EAAM,IAAS,KAAA,MAAA,GAAS,MAAS,GAAA,OAAA;AAAA,IACjC;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"backstage.esm.js","sources":["../src/backstage.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 { palettes } from '@backstage/theme';\n\nimport { ThemeConfig } from './types';\n\nexport const getDefaultThemeConfig = (mode: 'light' | 'dark'): ThemeConfig => {\n const palette = mode === 'dark' ? palettes.dark : palettes.light;\n\n return {\n variant: 'backstage',\n mode: mode === 'dark' ? 'dark' : 'light',\n palette,\n };\n};\n"],"names":[],"mappings":";;AAoBa,MAAA,qBAAA,GAAwB,CAAC,IAAwC,KAAA;AAC5E,EAAA,MAAM,OAAU,GAAA,IAAA,KAAS,MAAS,GAAA,QAAA,CAAS,OAAO,QAAS,CAAA,KAAA;AAE3D,EAAO,OAAA;AAAA,IACL,OAAS,EAAA,WAAA;AAAA,IACT,IAAA,EAAM,IAAS,KAAA,MAAA,GAAS,MAAS,GAAA,OAAA;AAAA,IACjC;AAAA,GACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.esm.js","sources":["../../src/components/ThemeProvider.tsx"],"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 React from 'react';\nimport { AppTheme } from '@backstage/core-plugin-api';\nimport { UnifiedTheme, UnifiedThemeProvider } from '@backstage/theme';\n\nimport {\n StyledEngineProvider,\n ThemeProvider as Mui5Provider,\n Theme as Mui5Theme,\n} from '@mui/material/styles';\n\nimport { useTheme } from '../hooks/useTheme';\nimport { useThemeConfig } from '../hooks/useThemeConfig';\nimport { ThemeConfig } from '../types';\n\n/**\n * Uses the UnifiedThemeProvider to style MUI v4 and v5 components.\n *\n * This component duplicated the StyledEngineProvider and MUI v5 ThemeProvider\n * to solve an issue that the defaultProps from the component configurations\n * (see `utils/createComponents.ts`) wasn't picked up.\n *\n * https://github.com/backstage/backstage/blob/master/packages/theme/src/unified/UnifiedThemeProvider.tsx#L94-L100\n */\nconst ThemeProvider = ({\n theme,\n children,\n}: {\n theme: UnifiedTheme;\n children: React.ReactNode;\n}) => (\n <UnifiedThemeProvider theme={theme}>\n <StyledEngineProvider injectFirst>\n <Mui5Provider theme={theme.getTheme('v5') as Mui5Theme}>\n {children}\n </Mui5Provider>\n </StyledEngineProvider>\n </UnifiedThemeProvider>\n);\n\nexport const createThemeProvider = (\n theme: UnifiedTheme,\n): AppTheme['Provider'] =>\n function RHDHThemeProvider({ children }) {\n return <ThemeProvider theme={theme}>{children}</ThemeProvider>;\n };\n\nexport const createThemeProviderForThemeConfig = (\n themeConfig: ThemeConfig,\n): AppTheme['Provider'] =>\n function RHDHThemeProviderForThemeConfig({ children }) {\n const theme = useTheme(themeConfig);\n return <ThemeProvider theme={theme}>{children}</ThemeProvider>;\n };\n\nexport const createThemeProviderForThemeName = (\n themeName: string,\n): AppTheme['Provider'] =>\n function RHDHThemeProviderForThemeName({ children }) {\n const themeConfig = useThemeConfig(themeName);\n const theme = useTheme(themeConfig);\n return <ThemeProvider theme={theme}>{children}</ThemeProvider>;\n };\n"],"names":["Mui5Provider"],"mappings":";;;;;;AAsCA,MAAM,gBAAgB,CAAC;AAAA,EACrB,KAAA;AAAA,EACA;AACF,CAAA,yCAIG,oBAAqB,EAAA,EAAA,KAAA,EAAA,kBACnB,KAAA,CAAA,aAAA,CAAA,oBAAA,EAAA,EAAqB,aAAW,IAC/B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAACA,eAAa,EAAA,EAAA,KAAA,EAAO,MAAM,QAAS,CAAA,IAAI,CACrC,EAAA,EAAA,QACH,CACF,CACF,CAAA;AAGK,MAAM,sBAAsB,CACjC,KAAA,KAEA,SAAS,iBAAkB,CAAA,EAAE,UAAY,EAAA;AACvC,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,aAAc,EAAA,EAAA,KAAA,EAAA,EAAe,QAAS,CAAA;AAChD;AAEK,MAAM,oCAAoC,CAC/C,WAAA,KAEA,SAAS,+BAAgC,CAAA,EAAE,UAAY,EAAA;AACrD,EAAM,MAAA,KAAA,GAAQ,SAAS,WAAW,CAAA;AAClC,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,aAAc,EAAA,EAAA,KAAA,EAAA,EAAe,QAAS,CAAA;AAChD;AAEK,MAAM,kCAAkC,CAC7C,SAAA,KAEA,SAAS,6BAA8B,CAAA,EAAE,UAAY,EAAA;AACnD,EAAM,MAAA,WAAA,GAAc,eAAe,SAAS,CAAA;AAC5C,EAAM,MAAA,KAAA,GAAQ,SAAS,WAAW,CAAA;AAClC,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,aAAc,EAAA,EAAA,KAAA,EAAA,EAAe,QAAS,CAAA;AAChD;;;;"}
1
+ {"version":3,"file":"ThemeProvider.esm.js","sources":["../../src/components/ThemeProvider.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 { AppTheme } from '@backstage/core-plugin-api';\nimport { UnifiedTheme, UnifiedThemeProvider } from '@backstage/theme';\n\nimport {\n StyledEngineProvider,\n ThemeProvider as Mui5Provider,\n Theme as Mui5Theme,\n} from '@mui/material/styles';\n\nimport { useTheme } from '../hooks/useTheme';\nimport { useThemeConfig } from '../hooks/useThemeConfig';\nimport { ThemeConfig } from '../types';\n\n/**\n * Uses the UnifiedThemeProvider to style MUI v4 and v5 components.\n *\n * This component duplicated the StyledEngineProvider and MUI v5 ThemeProvider\n * to solve an issue that the defaultProps from the component configurations\n * (see `utils/createComponents.ts`) wasn't picked up.\n *\n * https://github.com/backstage/backstage/blob/master/packages/theme/src/unified/UnifiedThemeProvider.tsx#L94-L100\n */\nconst ThemeProvider = ({\n theme,\n children,\n}: {\n theme: UnifiedTheme;\n children: React.ReactNode;\n}) => (\n <UnifiedThemeProvider theme={theme}>\n <StyledEngineProvider injectFirst>\n <Mui5Provider theme={theme.getTheme('v5') as Mui5Theme}>\n {children}\n </Mui5Provider>\n </StyledEngineProvider>\n </UnifiedThemeProvider>\n);\n\nexport const createThemeProvider = (\n theme: UnifiedTheme,\n): AppTheme['Provider'] =>\n function RHDHThemeProvider({ children }) {\n return <ThemeProvider theme={theme}>{children}</ThemeProvider>;\n };\n\nexport const createThemeProviderForThemeConfig = (\n themeConfig: ThemeConfig,\n): AppTheme['Provider'] =>\n function RHDHThemeProviderForThemeConfig({ children }) {\n const theme = useTheme(themeConfig);\n return <ThemeProvider theme={theme}>{children}</ThemeProvider>;\n };\n\nexport const createThemeProviderForThemeName = (\n themeName: string,\n): AppTheme['Provider'] =>\n function RHDHThemeProviderForThemeName({ children }) {\n const themeConfig = useThemeConfig(themeName);\n const theme = useTheme(themeConfig);\n return <ThemeProvider theme={theme}>{children}</ThemeProvider>;\n };\n"],"names":["Mui5Provider"],"mappings":";;;;;;AAuCA,MAAM,gBAAgB,CAAC;AAAA,EACrB,KAAA;AAAA,EACA;AACF,CAAA,yCAIG,oBAAqB,EAAA,EAAA,KAAA,EAAA,kBACnB,KAAA,CAAA,aAAA,CAAA,oBAAA,EAAA,EAAqB,aAAW,IAC/B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAACA,eAAa,EAAA,EAAA,KAAA,EAAO,MAAM,QAAS,CAAA,IAAI,CACrC,EAAA,EAAA,QACH,CACF,CACF,CAAA;AAGK,MAAM,sBAAsB,CACjC,KAAA,KAEA,SAAS,iBAAkB,CAAA,EAAE,UAAY,EAAA;AACvC,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,aAAc,EAAA,EAAA,KAAA,EAAA,EAAe,QAAS,CAAA;AAChD;AAEK,MAAM,oCAAoC,CAC/C,WAAA,KAEA,SAAS,+BAAgC,CAAA,EAAE,UAAY,EAAA;AACrD,EAAM,MAAA,KAAA,GAAQ,SAAS,WAAW,CAAA;AAClC,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,aAAc,EAAA,EAAA,KAAA,EAAA,EAAe,QAAS,CAAA;AAChD;AAEK,MAAM,kCAAkC,CAC7C,SAAA,KAEA,SAAS,6BAA8B,CAAA,EAAE,UAAY,EAAA;AACnD,EAAM,MAAA,WAAA,GAAc,eAAe,SAAS,CAAA;AAC5C,EAAM,MAAA,KAAA,GAAQ,SAAS,WAAW,CAAA;AAClC,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,aAAc,EAAA,EAAA,KAAA,EAAA,EAAe,QAAS,CAAA;AAChD;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"darkTheme.esm.js","sources":["../src/darkTheme.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 { palettes } from '@backstage/theme';\nimport { type PaletteOptions } from '@mui/material/styles';\n\nimport { type ThemeConfigPalette } from './types';\n\nexport const customDarkTheme = (): ThemeConfigPalette => {\n const palette: (typeof palettes)['dark'] & PaletteOptions = palettes.dark;\n return {\n ...palette,\n primary: {\n main: '#1FA7F8',\n },\n secondary: {\n main: '#1FA7F8',\n },\n navigation: {\n background: '#0f1214',\n indicator: '#0066CC',\n color: '#ffffff',\n selectedColor: '#ffffff',\n navItem: {\n hoverBackground: '#3c3f42',\n },\n submenu: {\n background: '#0f1214',\n },\n },\n background: {\n default: '#333333',\n paper: '#1b1d21',\n },\n rhdh: {\n general: {\n disabled: '#AAABAC',\n disabledBackground: '#444548',\n\n paperBackgroundImage: 'none',\n paperBorderColor: '#A3A3A3',\n\n // Box shadow from PatternFly 5 (--pf-v5-global--BoxShadow--sm)\n popoverBoxShadow:\n '0 0.25rem 0.5rem 0rem rgba(3, 3, 3, 0.48), 0 0 0.25rem 0 rgba(3, 3, 3, 0.24)',\n\n cardBackgroundColor: '#1b1d21',\n cardBorderColor: '#A3A3A3',\n\n headerBottomBorderColor: '#A3A3A3',\n mainSectionBackgroundColor: '#0f1214',\n formControlBackgroundColor: '#36373A',\n\n sidebarBackgroundColor: '#1b1d21',\n sidebarItemSelectedBackgroundColor: '#4F5255',\n\n tableTitleColor: '#E0E0E0',\n tableSubtitleColor: '#E0E0E0',\n tableColumnTitleColor: '#E0E0E0',\n tableRowHover: '#0f1214',\n tableBorderColor: '#515151',\n tableBackgroundColor: '#1b1d21',\n tabsDisabledBackgroundColor: '#444548',\n tabsBottomBorderColor: '#444548',\n\n contrastText: '#FFF',\n },\n primary: {\n main: '#1FA7F8',\n focusVisibleBorder: '#ADD6FF',\n },\n secondary: {\n main: '#1FA7F8',\n focusVisibleBorder: '#ADD6FF',\n },\n cards: {\n headerTextColor: '#FFF',\n headerBackgroundColor: '#0f1214',\n headerBackgroundImage: 'none',\n },\n },\n };\n};\n"],"names":[],"mappings":";;AAoBO,MAAM,kBAAkB,MAA0B;AACvD,EAAA,MAAM,UAAsD,QAAS,CAAA,IAAA;AACrE,EAAO,OAAA;AAAA,IACL,GAAG,OAAA;AAAA,IACH,OAAS,EAAA;AAAA,MACP,IAAM,EAAA;AAAA,KACR;AAAA,IACA,SAAW,EAAA;AAAA,MACT,IAAM,EAAA;AAAA,KACR;AAAA,IACA,UAAY,EAAA;AAAA,MACV,UAAY,EAAA,SAAA;AAAA,MACZ,SAAW,EAAA,SAAA;AAAA,MACX,KAAO,EAAA,SAAA;AAAA,MACP,aAAe,EAAA,SAAA;AAAA,MACf,OAAS,EAAA;AAAA,QACP,eAAiB,EAAA;AAAA,OACnB;AAAA,MACA,OAAS,EAAA;AAAA,QACP,UAAY,EAAA;AAAA;AACd,KACF;AAAA,IACA,UAAY,EAAA;AAAA,MACV,OAAS,EAAA,SAAA;AAAA,MACT,KAAO,EAAA;AAAA,KACT;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,OAAS,EAAA;AAAA,QACP,QAAU,EAAA,SAAA;AAAA,QACV,kBAAoB,EAAA,SAAA;AAAA,QAEpB,oBAAsB,EAAA,MAAA;AAAA,QACtB,gBAAkB,EAAA,SAAA;AAAA;AAAA,QAGlB,gBACE,EAAA,8EAAA;AAAA,QAEF,mBAAqB,EAAA,SAAA;AAAA,QACrB,eAAiB,EAAA,SAAA;AAAA,QAEjB,uBAAyB,EAAA,SAAA;AAAA,QACzB,0BAA4B,EAAA,SAAA;AAAA,QAC5B,0BAA4B,EAAA,SAAA;AAAA,QAE5B,sBAAwB,EAAA,SAAA;AAAA,QACxB,kCAAoC,EAAA,SAAA;AAAA,QAEpC,eAAiB,EAAA,SAAA;AAAA,QACjB,kBAAoB,EAAA,SAAA;AAAA,QACpB,qBAAuB,EAAA,SAAA;AAAA,QACvB,aAAe,EAAA,SAAA;AAAA,QACf,gBAAkB,EAAA,SAAA;AAAA,QAClB,oBAAsB,EAAA,SAAA;AAAA,QACtB,2BAA6B,EAAA,SAAA;AAAA,QAC7B,qBAAuB,EAAA,SAAA;AAAA,QAEvB,YAAc,EAAA;AAAA,OAChB;AAAA,MACA,OAAS,EAAA;AAAA,QACP,IAAM,EAAA,SAAA;AAAA,QACN,kBAAoB,EAAA;AAAA,OACtB;AAAA,MACA,SAAW,EAAA;AAAA,QACT,IAAM,EAAA,SAAA;AAAA,QACN,kBAAoB,EAAA;AAAA,OACtB;AAAA,MACA,KAAO,EAAA;AAAA,QACL,eAAiB,EAAA,MAAA;AAAA,QACjB,qBAAuB,EAAA,SAAA;AAAA,QACvB,qBAAuB,EAAA;AAAA;AACzB;AACF,GACF;AACF;;;;"}
1
+ {"version":3,"file":"darkTheme.esm.js","sources":["../src/darkTheme.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 { palettes } from '@backstage/theme';\nimport { type PaletteOptions } from '@mui/material/styles';\n\nimport { type ThemeConfigPalette } from './types';\n\nexport const customDarkTheme = (): ThemeConfigPalette => {\n const palette: (typeof palettes)['dark'] & PaletteOptions = palettes.dark;\n return {\n ...palette,\n primary: {\n main: '#1FA7F8',\n },\n secondary: {\n main: '#1FA7F8',\n },\n navigation: {\n background: '#0f1214',\n indicator: '#0066CC',\n color: '#ffffff',\n selectedColor: '#ffffff',\n navItem: {\n hoverBackground: '#3c3f42',\n },\n submenu: {\n background: '#0f1214',\n },\n },\n background: {\n default: '#333333',\n paper: '#1b1d21',\n },\n rhdh: {\n general: {\n disabled: '#AAABAC',\n disabledBackground: '#444548',\n\n paperBackgroundImage: 'none',\n paperBorderColor: '#A3A3A3',\n\n // Box shadow from PatternFly 5 (--pf-v5-global--BoxShadow--sm)\n popoverBoxShadow:\n '0 0.25rem 0.5rem 0rem rgba(3, 3, 3, 0.48), 0 0 0.25rem 0 rgba(3, 3, 3, 0.24)',\n\n cardBackgroundColor: '#1b1d21',\n cardBorderColor: '#A3A3A3',\n\n headerBottomBorderColor: '#A3A3A3',\n mainSectionBackgroundColor: '#0f1214',\n formControlBackgroundColor: '#36373A',\n\n sidebarBackgroundColor: '#1b1d21',\n sidebarItemSelectedBackgroundColor: '#4F5255',\n\n tableTitleColor: '#E0E0E0',\n tableSubtitleColor: '#E0E0E0',\n tableColumnTitleColor: '#E0E0E0',\n tableRowHover: '#0f1214',\n tableBorderColor: '#515151',\n tableBackgroundColor: '#1b1d21',\n tabsDisabledBackgroundColor: '#444548',\n tabsBottomBorderColor: '#444548',\n\n contrastText: '#FFF',\n },\n primary: {\n main: '#1FA7F8',\n focusVisibleBorder: '#ADD6FF',\n },\n secondary: {\n main: '#1FA7F8',\n focusVisibleBorder: '#ADD6FF',\n },\n cards: {\n headerTextColor: '#FFF',\n headerBackgroundColor: '#0f1214',\n headerBackgroundImage: 'none',\n },\n },\n };\n};\n"],"names":[],"mappings":";;AAqBO,MAAM,kBAAkB,MAA0B;AACvD,EAAA,MAAM,UAAsD,QAAS,CAAA,IAAA;AACrE,EAAO,OAAA;AAAA,IACL,GAAG,OAAA;AAAA,IACH,OAAS,EAAA;AAAA,MACP,IAAM,EAAA;AAAA,KACR;AAAA,IACA,SAAW,EAAA;AAAA,MACT,IAAM,EAAA;AAAA,KACR;AAAA,IACA,UAAY,EAAA;AAAA,MACV,UAAY,EAAA,SAAA;AAAA,MACZ,SAAW,EAAA,SAAA;AAAA,MACX,KAAO,EAAA,SAAA;AAAA,MACP,aAAe,EAAA,SAAA;AAAA,MACf,OAAS,EAAA;AAAA,QACP,eAAiB,EAAA;AAAA,OACnB;AAAA,MACA,OAAS,EAAA;AAAA,QACP,UAAY,EAAA;AAAA;AACd,KACF;AAAA,IACA,UAAY,EAAA;AAAA,MACV,OAAS,EAAA,SAAA;AAAA,MACT,KAAO,EAAA;AAAA,KACT;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,OAAS,EAAA;AAAA,QACP,QAAU,EAAA,SAAA;AAAA,QACV,kBAAoB,EAAA,SAAA;AAAA,QAEpB,oBAAsB,EAAA,MAAA;AAAA,QACtB,gBAAkB,EAAA,SAAA;AAAA;AAAA,QAGlB,gBACE,EAAA,8EAAA;AAAA,QAEF,mBAAqB,EAAA,SAAA;AAAA,QACrB,eAAiB,EAAA,SAAA;AAAA,QAEjB,uBAAyB,EAAA,SAAA;AAAA,QACzB,0BAA4B,EAAA,SAAA;AAAA,QAC5B,0BAA4B,EAAA,SAAA;AAAA,QAE5B,sBAAwB,EAAA,SAAA;AAAA,QACxB,kCAAoC,EAAA,SAAA;AAAA,QAEpC,eAAiB,EAAA,SAAA;AAAA,QACjB,kBAAoB,EAAA,SAAA;AAAA,QACpB,qBAAuB,EAAA,SAAA;AAAA,QACvB,aAAe,EAAA,SAAA;AAAA,QACf,gBAAkB,EAAA,SAAA;AAAA,QAClB,oBAAsB,EAAA,SAAA;AAAA,QACtB,2BAA6B,EAAA,SAAA;AAAA,QAC7B,qBAAuB,EAAA,SAAA;AAAA,QAEvB,YAAc,EAAA;AAAA,OAChB;AAAA,MACA,OAAS,EAAA;AAAA,QACP,IAAM,EAAA,SAAA;AAAA,QACN,kBAAoB,EAAA;AAAA,OACtB;AAAA,MACA,SAAW,EAAA;AAAA,QACT,IAAM,EAAA,SAAA;AAAA,QACN,kBAAoB,EAAA;AAAA,OACtB;AAAA,MACA,KAAO,EAAA;AAAA,QACL,eAAiB,EAAA,MAAA;AAAA,QACjB,qBAAuB,EAAA,SAAA;AAAA,QACvB,qBAAuB,EAAA;AAAA;AACzB;AACF,GACF;AACF;;;;"}
@@ -0,0 +1,92 @@
1
+ import RedHatDisplay from './assets/fonts/RedHatDisplay/RedHatDisplayVF.woff2';
2
+ import RedHatDisplayItalic from './assets/fonts/RedHatDisplay/RedHatDisplayVF-Italic.woff2';
3
+ import RedHatText from './assets/fonts/RedHatText/RedHatTextVF.woff2';
4
+ import RedHatTextItalic from './assets/fonts/RedHatText/RedHatTextVF-Italic.woff2';
5
+ import RedHatMono from './assets/fonts/RedHatMono/RedHatMonoVF.woff2';
6
+ import RedHatMonoItalic from './assets/fonts/RedHatMono/RedHatMonoVF-Italic.woff2';
7
+
8
+ const RedHatDisplayFontFace = {
9
+ fontFamily: "RedHatDisplay",
10
+ src: `url(${RedHatDisplay}) format('woff2-variations')`,
11
+ fontWeight: "300 900",
12
+ fontStyle: "normal",
13
+ fontDisplay: "fallback"
14
+ };
15
+ const RedHatDisplayItalicFontFace = {
16
+ fontFamily: "RedHatDisplay",
17
+ src: `url(${RedHatDisplayItalic}) format('woff2-variations')`,
18
+ fontWeight: "300 900",
19
+ fontStyle: "italic",
20
+ fontDisplay: "fallback"
21
+ };
22
+ const RedHatTextFontFace = {
23
+ fontFamily: "RedHatText",
24
+ src: `url(${RedHatText}) format('woff2-variations')`,
25
+ fontWeight: "300 700",
26
+ fontStyle: "normal",
27
+ fontDisplay: "fallback"
28
+ };
29
+ const RedHatTextItalicFontFace = {
30
+ fontFamily: "RedHatText",
31
+ src: `url(${RedHatTextItalic}) format('woff2-variations')`,
32
+ fontWeight: "300 700",
33
+ fontStyle: "italic",
34
+ fontDisplay: "fallback"
35
+ };
36
+ const RedHatMonoFontFace = {
37
+ fontFamily: "RedHatMono",
38
+ src: `url(${RedHatMono}) format('woff2-variations')`,
39
+ fontWeight: "300 700",
40
+ fontStyle: "normal",
41
+ fontDisplay: "fallback"
42
+ };
43
+ const RedHatMonoItalicFontFace = {
44
+ fontFamily: "RedHatMono",
45
+ src: `url(${RedHatMonoItalic}) format('woff2-variations')`,
46
+ fontWeight: "300 700",
47
+ fontStyle: "italic",
48
+ fontDisplay: "fallback"
49
+ };
50
+ const redHatFontFaces = [
51
+ RedHatDisplayFontFace,
52
+ RedHatDisplayItalicFontFace,
53
+ RedHatTextFontFace,
54
+ RedHatTextItalicFontFace,
55
+ RedHatMonoFontFace,
56
+ RedHatMonoItalicFontFace
57
+ ];
58
+ const redHatFonts = {
59
+ text: [
60
+ "RedHatText",
61
+ '"Helvetica Neue"',
62
+ "-apple-system",
63
+ '"Segoe UI"',
64
+ "Roboto",
65
+ "Helvetica",
66
+ "Arial",
67
+ "sans-serif"
68
+ ].join(", "),
69
+ heading: [
70
+ "RedHatDisplay",
71
+ '"Helvetica Neue"',
72
+ "-apple-system",
73
+ '"Segoe UI"',
74
+ "Roboto",
75
+ "Helvetica",
76
+ "Arial",
77
+ "sans-serif"
78
+ ].join(", "),
79
+ monospace: [
80
+ "RedHatMono",
81
+ '"Liberation Mono"',
82
+ "consolas",
83
+ '"SFMono-Regular"',
84
+ "menlo",
85
+ "monaco",
86
+ '"Courier New"',
87
+ "monospace"
88
+ ].join(", ")
89
+ };
90
+
91
+ export { RedHatTextFontFace, redHatFontFaces, redHatFonts };
92
+ //# sourceMappingURL=fonts.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fonts.esm.js","sources":["../src/fonts.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 RedHatDisplay from './assets/fonts/RedHatDisplay/RedHatDisplayVF.woff2';\nimport RedHatDisplayItalic from './assets/fonts/RedHatDisplay/RedHatDisplayVF-Italic.woff2';\nimport RedHatText from './assets/fonts/RedHatText/RedHatTextVF.woff2';\nimport RedHatTextItalic from './assets/fonts/RedHatText/RedHatTextVF-Italic.woff2';\nimport RedHatMono from './assets/fonts/RedHatMono/RedHatMonoVF.woff2';\nimport RedHatMonoItalic from './assets/fonts/RedHatMono/RedHatMonoVF-Italic.woff2';\n\nconst RedHatDisplayFontFace = {\n fontFamily: 'RedHatDisplay',\n src: `url(${RedHatDisplay}) format('woff2-variations')`,\n fontWeight: '300 900',\n fontStyle: 'normal',\n fontDisplay: 'fallback',\n};\n\nconst RedHatDisplayItalicFontFace = {\n fontFamily: 'RedHatDisplay',\n src: `url(${RedHatDisplayItalic}) format('woff2-variations')`,\n fontWeight: '300 900',\n fontStyle: 'italic',\n fontDisplay: 'fallback',\n};\n\nexport const RedHatTextFontFace = {\n fontFamily: 'RedHatText',\n src: `url(${RedHatText}) format('woff2-variations')`,\n fontWeight: '300 700',\n fontStyle: 'normal',\n fontDisplay: 'fallback',\n};\n\nconst RedHatTextItalicFontFace = {\n fontFamily: 'RedHatText',\n src: `url(${RedHatTextItalic}) format('woff2-variations')`,\n fontWeight: '300 700',\n fontStyle: 'italic',\n fontDisplay: 'fallback',\n};\n\nconst RedHatMonoFontFace = {\n fontFamily: 'RedHatMono',\n src: `url(${RedHatMono}) format('woff2-variations')`,\n fontWeight: '300 700',\n fontStyle: 'normal',\n fontDisplay: 'fallback',\n};\n\nconst RedHatMonoItalicFontFace = {\n fontFamily: 'RedHatMono',\n src: `url(${RedHatMonoItalic}) format('woff2-variations')`,\n fontWeight: '300 700',\n fontStyle: 'italic',\n fontDisplay: 'fallback',\n};\n\nexport const redHatFontFaces = [\n RedHatDisplayFontFace,\n RedHatDisplayItalicFontFace,\n RedHatTextFontFace,\n RedHatTextItalicFontFace,\n RedHatMonoFontFace,\n RedHatMonoItalicFontFace,\n];\n\nexport const redHatFonts = {\n text: [\n 'RedHatText',\n '\"Helvetica Neue\"',\n '-apple-system',\n '\"Segoe UI\"',\n 'Roboto',\n 'Helvetica',\n 'Arial',\n 'sans-serif',\n ].join(', '),\n heading: [\n 'RedHatDisplay',\n '\"Helvetica Neue\"',\n '-apple-system',\n '\"Segoe UI\"',\n 'Roboto',\n 'Helvetica',\n 'Arial',\n 'sans-serif',\n ].join(', '),\n monospace: [\n 'RedHatMono',\n '\"Liberation Mono\"',\n 'consolas',\n '\"SFMono-Regular\"',\n 'menlo',\n 'monaco',\n '\"Courier New\"',\n 'monospace',\n ].join(', '),\n};\n"],"names":[],"mappings":";;;;;;;AAuBA,MAAM,qBAAwB,GAAA;AAAA,EAC5B,UAAY,EAAA,eAAA;AAAA,EACZ,GAAA,EAAK,OAAO,aAAa,CAAA,4BAAA,CAAA;AAAA,EACzB,UAAY,EAAA,SAAA;AAAA,EACZ,SAAW,EAAA,QAAA;AAAA,EACX,WAAa,EAAA;AACf,CAAA;AAEA,MAAM,2BAA8B,GAAA;AAAA,EAClC,UAAY,EAAA,eAAA;AAAA,EACZ,GAAA,EAAK,OAAO,mBAAmB,CAAA,4BAAA,CAAA;AAAA,EAC/B,UAAY,EAAA,SAAA;AAAA,EACZ,SAAW,EAAA,QAAA;AAAA,EACX,WAAa,EAAA;AACf,CAAA;AAEO,MAAM,kBAAqB,GAAA;AAAA,EAChC,UAAY,EAAA,YAAA;AAAA,EACZ,GAAA,EAAK,OAAO,UAAU,CAAA,4BAAA,CAAA;AAAA,EACtB,UAAY,EAAA,SAAA;AAAA,EACZ,SAAW,EAAA,QAAA;AAAA,EACX,WAAa,EAAA;AACf;AAEA,MAAM,wBAA2B,GAAA;AAAA,EAC/B,UAAY,EAAA,YAAA;AAAA,EACZ,GAAA,EAAK,OAAO,gBAAgB,CAAA,4BAAA,CAAA;AAAA,EAC5B,UAAY,EAAA,SAAA;AAAA,EACZ,SAAW,EAAA,QAAA;AAAA,EACX,WAAa,EAAA;AACf,CAAA;AAEA,MAAM,kBAAqB,GAAA;AAAA,EACzB,UAAY,EAAA,YAAA;AAAA,EACZ,GAAA,EAAK,OAAO,UAAU,CAAA,4BAAA,CAAA;AAAA,EACtB,UAAY,EAAA,SAAA;AAAA,EACZ,SAAW,EAAA,QAAA;AAAA,EACX,WAAa,EAAA;AACf,CAAA;AAEA,MAAM,wBAA2B,GAAA;AAAA,EAC/B,UAAY,EAAA,YAAA;AAAA,EACZ,GAAA,EAAK,OAAO,gBAAgB,CAAA,4BAAA,CAAA;AAAA,EAC5B,UAAY,EAAA,SAAA;AAAA,EACZ,SAAW,EAAA,QAAA;AAAA,EACX,WAAa,EAAA;AACf,CAAA;AAEO,MAAM,eAAkB,GAAA;AAAA,EAC7B,qBAAA;AAAA,EACA,2BAAA;AAAA,EACA,kBAAA;AAAA,EACA,wBAAA;AAAA,EACA,kBAAA;AAAA,EACA;AACF;AAEO,MAAM,WAAc,GAAA;AAAA,EACzB,IAAM,EAAA;AAAA,IACJ,YAAA;AAAA,IACA,kBAAA;AAAA,IACA,eAAA;AAAA,IACA,YAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GACF,CAAE,KAAK,IAAI,CAAA;AAAA,EACX,OAAS,EAAA;AAAA,IACP,eAAA;AAAA,IACA,kBAAA;AAAA,IACA,eAAA;AAAA,IACA,YAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GACF,CAAE,KAAK,IAAI,CAAA;AAAA,EACX,SAAW,EAAA;AAAA,IACT,YAAA;AAAA,IACA,mBAAA;AAAA,IACA,UAAA;AAAA,IACA,kBAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,GACF,CAAE,KAAK,IAAI;AACb;;;;"}
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { useApi, configApiRef } from '@backstage/core-plugin-api';
3
3
 
4
4
  const useBranding = () => {
5
- let configApi = void 0;
5
+ let configApi = undefined;
6
6
  try {
7
7
  configApi = useApi(configApiRef);
8
8
  } catch (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"useBranding.esm.js","sources":["../../src/hooks/useBranding.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 React from 'react';\nimport { ConfigApi, configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { Branding } from '../types';\n\nexport const useBranding = (): Branding | undefined => {\n let configApi: ConfigApi | undefined = undefined;\n try {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n configApi = useApi(configApiRef);\n } catch (err) {\n // useApi won't be initialized initially in createApp theme provider, and will get updated later\n }\n return React.useMemo(() => {\n const branding = configApi?.getOptional<Branding>('app.branding');\n return branding;\n }, [configApi]);\n};\n"],"names":[],"mappings":";;;AAmBO,MAAM,cAAc,MAA4B;AACrD,EAAA,IAAI,SAAmC,GAAA,KAAA,CAAA;AACvC,EAAI,IAAA;AAEF,IAAA,SAAA,GAAY,OAAO,YAAY,CAAA;AAAA,WACxB,GAAK,EAAA;AAAA;AAGd,EAAO,OAAA,KAAA,CAAM,QAAQ,MAAM;AACzB,IAAM,MAAA,QAAA,GAAW,SAAW,EAAA,WAAA,CAAsB,cAAc,CAAA;AAChE,IAAO,OAAA,QAAA;AAAA,GACT,EAAG,CAAC,SAAS,CAAC,CAAA;AAChB;;;;"}
1
+ {"version":3,"file":"useBranding.esm.js","sources":["../../src/hooks/useBranding.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { ConfigApi, configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { Branding } from '../types';\n\nexport const useBranding = (): Branding | undefined => {\n let configApi: ConfigApi | undefined = undefined;\n try {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n configApi = useApi(configApiRef);\n } catch (err) {\n // useApi won't be initialized initially in createApp theme provider, and will get updated later\n }\n return React.useMemo(() => {\n const branding = configApi?.getOptional<Branding>('app.branding');\n return branding;\n }, [configApi]);\n};\n"],"names":[],"mappings":";;;AAoBO,MAAM,cAAc,MAA4B;AACrD,EAAA,IAAI,SAAmC,GAAA,SAAA;AACvC,EAAI,IAAA;AAEF,IAAA,SAAA,GAAY,OAAO,YAAY,CAAA;AAAA,WACxB,GAAK,EAAA;AAAA;AAGd,EAAO,OAAA,KAAA,CAAM,QAAQ,MAAM;AACzB,IAAM,MAAA,QAAA,GAAW,SAAW,EAAA,WAAA,CAAsB,cAAc,CAAA;AAChE,IAAO,OAAA,QAAA;AAAA,GACT,EAAG,CAAC,SAAS,CAAC,CAAA;AAChB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTheme.esm.js","sources":["../../src/hooks/useTheme.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 React from 'react';\nimport { createUnifiedTheme, type UnifiedTheme } from '@backstage/theme';\nimport type { ThemeConfig } from '../types';\nimport { useThemeOptions } from './useThemeOptions';\n\n/** Creates a memorized Backstage UnifiedTheme based on the given ThemeConfig. */\nexport const useTheme = (themeConfig: ThemeConfig): UnifiedTheme => {\n const unifiedThemeOptions = useThemeOptions(themeConfig);\n const theme = React.useMemo<UnifiedTheme>(\n () => createUnifiedTheme(unifiedThemeOptions),\n [unifiedThemeOptions],\n );\n return theme;\n};\n"],"names":[],"mappings":";;;;AAqBa,MAAA,QAAA,GAAW,CAAC,WAA2C,KAAA;AAClE,EAAM,MAAA,mBAAA,GAAsB,gBAAgB,WAAW,CAAA;AACvD,EAAA,MAAM,QAAQ,KAAM,CAAA,OAAA;AAAA,IAClB,MAAM,mBAAmB,mBAAmB,CAAA;AAAA,IAC5C,CAAC,mBAAmB;AAAA,GACtB;AACA,EAAO,OAAA,KAAA;AACT;;;;"}
1
+ {"version":3,"file":"useTheme.esm.js","sources":["../../src/hooks/useTheme.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { createUnifiedTheme, type UnifiedTheme } from '@backstage/theme';\nimport type { ThemeConfig } from '../types';\nimport { useThemeOptions } from './useThemeOptions';\n\n/** Creates a memorized Backstage UnifiedTheme based on the given ThemeConfig. */\nexport const useTheme = (themeConfig: ThemeConfig): UnifiedTheme => {\n const unifiedThemeOptions = useThemeOptions(themeConfig);\n const theme = React.useMemo<UnifiedTheme>(\n () => createUnifiedTheme(unifiedThemeOptions),\n [unifiedThemeOptions],\n );\n return theme;\n};\n"],"names":[],"mappings":";;;;AAsBa,MAAA,QAAA,GAAW,CAAC,WAA2C,KAAA;AAClE,EAAM,MAAA,mBAAA,GAAsB,gBAAgB,WAAW,CAAA;AACvD,EAAA,MAAM,QAAQ,KAAM,CAAA,OAAA;AAAA,IAClB,MAAM,mBAAmB,mBAAmB,CAAA;AAAA,IAC5C,CAAC,mBAAmB;AAAA,GACtB;AACA,EAAO,OAAA,KAAA;AACT;;;;"}
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { useApi, configApiRef } from '@backstage/core-plugin-api';
3
3
 
4
4
  const useThemeConfig = (themeName) => {
5
- let configApi = void 0;
5
+ let configApi = undefined;
6
6
  try {
7
7
  configApi = useApi(configApiRef);
8
8
  } catch (err) {
@@ -17,7 +17,7 @@ const useThemeConfig = (themeName) => {
17
17
  if (!themeConfig.mode) {
18
18
  themeConfig.mode = themeName.includes("dark") ? "dark" : "light";
19
19
  }
20
- if (Array.isArray(themeConfig?.pageTheme?.default.fontColor)) {
20
+ if (Array.isArray(themeConfig?.pageTheme?.default?.fontColor)) {
21
21
  themeConfig.pageTheme.default.fontColor = themeConfig.pageTheme.default.fontColor[0];
22
22
  }
23
23
  return themeConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"useThemeConfig.esm.js","sources":["../../src/hooks/useThemeConfig.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 React from 'react';\nimport { ConfigApi, configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { ThemeConfig } from '../types';\n\nexport const useThemeConfig = (themeName: string): ThemeConfig => {\n let configApi: ConfigApi | undefined = undefined;\n try {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n configApi = useApi<ConfigApi>(configApiRef); // NOSONAR\n } catch (err) {\n // useApi won't be initialized initially in createApp theme provider, and will get updated later\n }\n return React.useMemo(() => {\n if (!configApi) {\n return {\n mode: themeName.includes('dark') ? 'dark' : 'light',\n };\n }\n const themeConfig =\n configApi.getOptional<ThemeConfig>(`app.branding.theme.${themeName}`) ??\n {};\n if (!themeConfig.mode) {\n themeConfig.mode = themeName.includes('dark') ? 'dark' : 'light';\n }\n\n if (Array.isArray(themeConfig?.pageTheme?.default.fontColor)) {\n themeConfig.pageTheme.default.fontColor =\n themeConfig.pageTheme.default.fontColor[0];\n }\n\n return themeConfig;\n }, [themeName, configApi]);\n};\n"],"names":[],"mappings":";;;AAmBa,MAAA,cAAA,GAAiB,CAAC,SAAmC,KAAA;AAChE,EAAA,IAAI,SAAmC,GAAA,KAAA,CAAA;AACvC,EAAI,IAAA;AAEF,IAAA,SAAA,GAAY,OAAkB,YAAY,CAAA;AAAA,WACnC,GAAK,EAAA;AAAA;AAGd,EAAO,OAAA,KAAA,CAAM,QAAQ,MAAM;AACzB,IAAA,IAAI,CAAC,SAAW,EAAA;AACd,MAAO,OAAA;AAAA,QACL,IAAM,EAAA,SAAA,CAAU,QAAS,CAAA,MAAM,IAAI,MAAS,GAAA;AAAA,OAC9C;AAAA;AAEF,IAAA,MAAM,cACJ,SAAU,CAAA,WAAA,CAAyB,sBAAsB,SAAS,CAAA,CAAE,KACpE,EAAC;AACH,IAAI,IAAA,CAAC,YAAY,IAAM,EAAA;AACrB,MAAA,WAAA,CAAY,IAAO,GAAA,SAAA,CAAU,QAAS,CAAA,MAAM,IAAI,MAAS,GAAA,OAAA;AAAA;AAG3D,IAAA,IAAI,MAAM,OAAQ,CAAA,WAAA,EAAa,SAAW,EAAA,OAAA,CAAQ,SAAS,CAAG,EAAA;AAC5D,MAAA,WAAA,CAAY,UAAU,OAAQ,CAAA,SAAA,GAC5B,YAAY,SAAU,CAAA,OAAA,CAAQ,UAAU,CAAC,CAAA;AAAA;AAG7C,IAAO,OAAA,WAAA;AAAA,GACN,EAAA,CAAC,SAAW,EAAA,SAAS,CAAC,CAAA;AAC3B;;;;"}
1
+ {"version":3,"file":"useThemeConfig.esm.js","sources":["../../src/hooks/useThemeConfig.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { ConfigApi, configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { ThemeConfig } from '../types';\n\nexport const useThemeConfig = (themeName: string): ThemeConfig => {\n let configApi: ConfigApi | undefined = undefined;\n try {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n configApi = useApi<ConfigApi>(configApiRef); // NOSONAR\n } catch (err) {\n // useApi won't be initialized initially in createApp theme provider, and will get updated later\n }\n return React.useMemo(() => {\n if (!configApi) {\n return {\n mode: themeName.includes('dark') ? 'dark' : 'light',\n };\n }\n const themeConfig =\n configApi.getOptional<ThemeConfig>(`app.branding.theme.${themeName}`) ??\n {};\n if (!themeConfig.mode) {\n themeConfig.mode = themeName.includes('dark') ? 'dark' : 'light';\n }\n\n if (Array.isArray(themeConfig?.pageTheme?.default?.fontColor)) {\n themeConfig.pageTheme.default.fontColor =\n themeConfig.pageTheme.default.fontColor[0];\n }\n\n return themeConfig;\n }, [themeName, configApi]);\n};\n"],"names":[],"mappings":";;;AAoBa,MAAA,cAAA,GAAiB,CAAC,SAAmC,KAAA;AAChE,EAAA,IAAI,SAAmC,GAAA,SAAA;AACvC,EAAI,IAAA;AAEF,IAAA,SAAA,GAAY,OAAkB,YAAY,CAAA;AAAA,WACnC,GAAK,EAAA;AAAA;AAGd,EAAO,OAAA,KAAA,CAAM,QAAQ,MAAM;AACzB,IAAA,IAAI,CAAC,SAAW,EAAA;AACd,MAAO,OAAA;AAAA,QACL,IAAM,EAAA,SAAA,CAAU,QAAS,CAAA,MAAM,IAAI,MAAS,GAAA;AAAA,OAC9C;AAAA;AAEF,IAAA,MAAM,cACJ,SAAU,CAAA,WAAA,CAAyB,sBAAsB,SAAS,CAAA,CAAE,KACpE,EAAC;AACH,IAAI,IAAA,CAAC,YAAY,IAAM,EAAA;AACrB,MAAA,WAAA,CAAY,IAAO,GAAA,SAAA,CAAU,QAAS,CAAA,MAAM,IAAI,MAAS,GAAA,OAAA;AAAA;AAG3D,IAAA,IAAI,MAAM,OAAQ,CAAA,WAAA,EAAa,SAAW,EAAA,OAAA,EAAS,SAAS,CAAG,EAAA;AAC7D,MAAA,WAAA,CAAY,UAAU,OAAQ,CAAA,SAAA,GAC5B,YAAY,SAAU,CAAA,OAAA,CAAQ,UAAU,CAAC,CAAA;AAAA;AAG7C,IAAO,OAAA,WAAA;AAAA,GACN,EAAA,CAAC,SAAW,EAAA,SAAS,CAAC,CAAA;AAC3B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useThemeOptions.esm.js","sources":["../../src/hooks/useThemeOptions.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 React from 'react';\nimport { type UnifiedThemeOptions } from '@backstage/theme';\nimport type { ThemeConfig } from '../types';\nimport * as backstage from '../backstage';\nimport * as rhdh from '../rhdh';\nimport { migrateThemeConfig } from '../utils/migrateTheme';\nimport { mergeUnifiedThemeOptions } from '../utils/mergeTheme';\nimport { createPageThemes } from '../utils/createPageThemes';\nimport { createComponents } from '../utils/createComponents';\n\n/** Creates a memorized Backstage UnifiedThemeOptions based on the given ThemeConfig. */\nexport const useThemeOptions = (\n themeConfig: ThemeConfig,\n): UnifiedThemeOptions => {\n const theme = React.useMemo<UnifiedThemeOptions>(() => {\n const mode = themeConfig.mode ?? 'light';\n const variant = themeConfig.variant ?? 'rhdh';\n\n let defaultThemeConfig: ThemeConfig;\n if (variant === 'backstage') {\n defaultThemeConfig = backstage.getDefaultThemeConfig(mode);\n } else {\n defaultThemeConfig = rhdh.getDefaultThemeConfig(mode);\n }\n\n const migratedThemeConfig = migrateThemeConfig(themeConfig);\n const mergedThemeConfig = mergeUnifiedThemeOptions(\n defaultThemeConfig,\n migratedThemeConfig,\n );\n\n const unifiedThemeOption: UnifiedThemeOptions = {\n palette: mergedThemeConfig.palette as UnifiedThemeOptions['palette'],\n defaultPageTheme: mergedThemeConfig.defaultPageTheme,\n fontFamily: mergedThemeConfig.fontFamily,\n htmlFontSize: mergedThemeConfig.htmlFontSize,\n typography: mergedThemeConfig.typography,\n };\n\n unifiedThemeOption.pageTheme = createPageThemes(mergedThemeConfig);\n\n if (variant !== 'backstage') {\n unifiedThemeOption.components = createComponents(mergedThemeConfig);\n }\n\n return unifiedThemeOption;\n }, [themeConfig]);\n return theme;\n};\n"],"names":["backstage.getDefaultThemeConfig","rhdh.getDefaultThemeConfig"],"mappings":";;;;;;;;AA0Ba,MAAA,eAAA,GAAkB,CAC7B,WACwB,KAAA;AACxB,EAAM,MAAA,KAAA,GAAQ,KAAM,CAAA,OAAA,CAA6B,MAAM;AACrD,IAAM,MAAA,IAAA,GAAO,YAAY,IAAQ,IAAA,OAAA;AACjC,IAAM,MAAA,OAAA,GAAU,YAAY,OAAW,IAAA,MAAA;AAEvC,IAAI,IAAA,kBAAA;AACJ,IAAA,IAAI,YAAY,WAAa,EAAA;AAC3B,MAAqB,kBAAA,GAAAA,sBAAgC,IAAI,CAAA;AAAA,KACpD,MAAA;AACL,MAAqB,kBAAA,GAAAC,wBAA2B,IAAI,CAAA;AAAA;AAGtD,IAAM,MAAA,mBAAA,GAAsB,mBAAmB,WAAW,CAAA;AAC1D,IAAA,MAAM,iBAAoB,GAAA,wBAAA;AAAA,MACxB,kBAAA;AAAA,MACA;AAAA,KACF;AAEA,IAAA,MAAM,kBAA0C,GAAA;AAAA,MAC9C,SAAS,iBAAkB,CAAA,OAAA;AAAA,MAC3B,kBAAkB,iBAAkB,CAAA,gBAAA;AAAA,MACpC,YAAY,iBAAkB,CAAA,UAAA;AAAA,MAC9B,cAAc,iBAAkB,CAAA,YAAA;AAAA,MAChC,YAAY,iBAAkB,CAAA;AAAA,KAChC;AAEA,IAAmB,kBAAA,CAAA,SAAA,GAAY,iBAAiB,iBAAiB,CAAA;AAEjE,IAAA,IAAI,YAAY,WAAa,EAAA;AAC3B,MAAmB,kBAAA,CAAA,UAAA,GAAa,iBAAiB,iBAAiB,CAAA;AAAA;AAGpE,IAAO,OAAA,kBAAA;AAAA,GACT,EAAG,CAAC,WAAW,CAAC,CAAA;AAChB,EAAO,OAAA,KAAA;AACT;;;;"}
1
+ {"version":3,"file":"useThemeOptions.esm.js","sources":["../../src/hooks/useThemeOptions.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { type UnifiedThemeOptions } from '@backstage/theme';\nimport type { ThemeConfig } from '../types';\nimport * as backstage from '../backstage';\nimport * as rhdh from '../rhdh';\nimport { migrateThemeConfig } from '../utils/migrateTheme';\nimport { mergeUnifiedThemeOptions } from '../utils/mergeTheme';\nimport { createPageThemes } from '../utils/createPageThemes';\nimport { createComponents } from '../utils/createComponents';\n\n/** Creates a memorized Backstage UnifiedThemeOptions based on the given ThemeConfig. */\nexport const useThemeOptions = (\n themeConfig: ThemeConfig,\n): UnifiedThemeOptions => {\n const theme = React.useMemo<UnifiedThemeOptions>(() => {\n const mode = themeConfig.mode ?? 'light';\n const variant = themeConfig.variant ?? 'rhdh';\n\n let defaultThemeConfig: ThemeConfig;\n if (variant === 'backstage') {\n defaultThemeConfig = backstage.getDefaultThemeConfig(mode);\n } else {\n defaultThemeConfig = rhdh.getDefaultThemeConfig(mode);\n }\n\n const migratedThemeConfig = migrateThemeConfig(themeConfig);\n const mergedThemeConfig = mergeUnifiedThemeOptions(\n defaultThemeConfig,\n migratedThemeConfig,\n );\n\n const unifiedThemeOption: UnifiedThemeOptions = {\n palette: mergedThemeConfig.palette as UnifiedThemeOptions['palette'],\n defaultPageTheme: mergedThemeConfig.defaultPageTheme,\n fontFamily: mergedThemeConfig.fontFamily,\n htmlFontSize: mergedThemeConfig.htmlFontSize,\n typography: mergedThemeConfig.typography,\n };\n\n unifiedThemeOption.pageTheme = createPageThemes(mergedThemeConfig);\n\n if (variant !== 'backstage') {\n unifiedThemeOption.components = createComponents(mergedThemeConfig);\n }\n\n return unifiedThemeOption;\n }, [themeConfig]);\n return theme;\n};\n"],"names":["backstage.getDefaultThemeConfig","rhdh.getDefaultThemeConfig"],"mappings":";;;;;;;;AA2Ba,MAAA,eAAA,GAAkB,CAC7B,WACwB,KAAA;AACxB,EAAM,MAAA,KAAA,GAAQ,KAAM,CAAA,OAAA,CAA6B,MAAM;AACrD,IAAM,MAAA,IAAA,GAAO,YAAY,IAAQ,IAAA,OAAA;AACjC,IAAM,MAAA,OAAA,GAAU,YAAY,OAAW,IAAA,MAAA;AAEvC,IAAI,IAAA,kBAAA;AACJ,IAAA,IAAI,YAAY,WAAa,EAAA;AAC3B,MAAqB,kBAAA,GAAAA,sBAAgC,IAAI,CAAA;AAAA,KACpD,MAAA;AACL,MAAqB,kBAAA,GAAAC,wBAA2B,IAAI,CAAA;AAAA;AAGtD,IAAM,MAAA,mBAAA,GAAsB,mBAAmB,WAAW,CAAA;AAC1D,IAAA,MAAM,iBAAoB,GAAA,wBAAA;AAAA,MACxB,kBAAA;AAAA,MACA;AAAA,KACF;AAEA,IAAA,MAAM,kBAA0C,GAAA;AAAA,MAC9C,SAAS,iBAAkB,CAAA,OAAA;AAAA,MAC3B,kBAAkB,iBAAkB,CAAA,gBAAA;AAAA,MACpC,YAAY,iBAAkB,CAAA,UAAA;AAAA,MAC9B,cAAc,iBAAkB,CAAA,YAAA;AAAA,MAChC,YAAY,iBAAkB,CAAA;AAAA,KAChC;AAEA,IAAmB,kBAAA,CAAA,SAAA,GAAY,iBAAiB,iBAAiB,CAAA;AAEjE,IAAA,IAAI,YAAY,WAAa,EAAA;AAC3B,MAAmB,kBAAA,CAAA,UAAA,GAAa,iBAAiB,iBAAiB,CAAA;AAAA;AAGpE,IAAO,OAAA,kBAAA;AAAA,GACT,EAAG,CAAC,WAAW,CAAC,CAAA;AAChB,EAAO,OAAA,KAAA;AACT;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"lightTheme.esm.js","sources":["../src/lightTheme.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 { palettes } from '@backstage/theme';\nimport { type PaletteOptions } from '@mui/material/styles';\n\nimport { type ThemeConfigPalette } from './types';\n\nexport const customLightTheme = (): ThemeConfigPalette => {\n const palette: (typeof palettes)['light'] & PaletteOptions = palettes.light;\n return {\n ...palette,\n primary: {\n main: '#0066CC',\n },\n secondary: {\n main: '#0066CC',\n },\n navigation: {\n background: '#222427',\n indicator: '#0066CC',\n color: '#ffffff',\n selectedColor: '#ffffff',\n navItem: {\n hoverBackground: '#3c3f42',\n },\n submenu: {\n background: '#222427',\n },\n },\n text: {\n primary: '#151515',\n secondary: '#757575',\n },\n background: {\n default: '#F8F8F8',\n paper: '#FFFFFF',\n },\n rhdh: {\n general: {\n disabled: '#6A6E73',\n disabledBackground: '#D2D2D2',\n\n paperBackgroundImage: 'none',\n paperBorderColor: '#C7C7C7',\n\n // Box shadow from PatternFly 5 (--pf-v5-global--BoxShadow--sm)\n popoverBoxShadow:\n '0 0.25rem 0.5rem 0rem rgba(3, 3, 3, 0.12), 0 0 0.25rem 0 rgba(3, 3, 3, 0.06)',\n\n cardBackgroundColor: '#FFF',\n cardBorderColor: '#C7C7C7',\n\n headerBottomBorderColor: '#C7C7C7',\n mainSectionBackgroundColor: '#FFF',\n formControlBackgroundColor: '#FFF',\n\n sidebarBackgroundColor: '#212427',\n sidebarItemSelectedBackgroundColor: '#4F5255',\n\n tableTitleColor: '#181818',\n tableSubtitleColor: '#616161',\n tableColumnTitleColor: '#151515',\n tableRowHover: '#F5F5F5',\n tableBorderColor: '#E0E0E0',\n tableBackgroundColor: '#FFF',\n tabsDisabledBackgroundColor: '#f5f5f5',\n tabsBottomBorderColor: '#D2D2D2',\n\n contrastText: '#FFF',\n },\n primary: {\n main: '#0066CC',\n focusVisibleBorder: '#0066CC',\n },\n secondary: {\n main: '#0066CC',\n focusVisibleBorder: '#0066CC',\n },\n cards: {\n headerTextColor: '#151515',\n headerBackgroundColor: '#FFF',\n headerBackgroundImage: 'none',\n },\n },\n };\n};\n"],"names":[],"mappings":";;AAoBO,MAAM,mBAAmB,MAA0B;AACxD,EAAA,MAAM,UAAuD,QAAS,CAAA,KAAA;AACtE,EAAO,OAAA;AAAA,IACL,GAAG,OAAA;AAAA,IACH,OAAS,EAAA;AAAA,MACP,IAAM,EAAA;AAAA,KACR;AAAA,IACA,SAAW,EAAA;AAAA,MACT,IAAM,EAAA;AAAA,KACR;AAAA,IACA,UAAY,EAAA;AAAA,MACV,UAAY,EAAA,SAAA;AAAA,MACZ,SAAW,EAAA,SAAA;AAAA,MACX,KAAO,EAAA,SAAA;AAAA,MACP,aAAe,EAAA,SAAA;AAAA,MACf,OAAS,EAAA;AAAA,QACP,eAAiB,EAAA;AAAA,OACnB;AAAA,MACA,OAAS,EAAA;AAAA,QACP,UAAY,EAAA;AAAA;AACd,KACF;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,OAAS,EAAA,SAAA;AAAA,MACT,SAAW,EAAA;AAAA,KACb;AAAA,IACA,UAAY,EAAA;AAAA,MACV,OAAS,EAAA,SAAA;AAAA,MACT,KAAO,EAAA;AAAA,KACT;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,OAAS,EAAA;AAAA,QACP,QAAU,EAAA,SAAA;AAAA,QACV,kBAAoB,EAAA,SAAA;AAAA,QAEpB,oBAAsB,EAAA,MAAA;AAAA,QACtB,gBAAkB,EAAA,SAAA;AAAA;AAAA,QAGlB,gBACE,EAAA,8EAAA;AAAA,QAEF,mBAAqB,EAAA,MAAA;AAAA,QACrB,eAAiB,EAAA,SAAA;AAAA,QAEjB,uBAAyB,EAAA,SAAA;AAAA,QACzB,0BAA4B,EAAA,MAAA;AAAA,QAC5B,0BAA4B,EAAA,MAAA;AAAA,QAE5B,sBAAwB,EAAA,SAAA;AAAA,QACxB,kCAAoC,EAAA,SAAA;AAAA,QAEpC,eAAiB,EAAA,SAAA;AAAA,QACjB,kBAAoB,EAAA,SAAA;AAAA,QACpB,qBAAuB,EAAA,SAAA;AAAA,QACvB,aAAe,EAAA,SAAA;AAAA,QACf,gBAAkB,EAAA,SAAA;AAAA,QAClB,oBAAsB,EAAA,MAAA;AAAA,QACtB,2BAA6B,EAAA,SAAA;AAAA,QAC7B,qBAAuB,EAAA,SAAA;AAAA,QAEvB,YAAc,EAAA;AAAA,OAChB;AAAA,MACA,OAAS,EAAA;AAAA,QACP,IAAM,EAAA,SAAA;AAAA,QACN,kBAAoB,EAAA;AAAA,OACtB;AAAA,MACA,SAAW,EAAA;AAAA,QACT,IAAM,EAAA,SAAA;AAAA,QACN,kBAAoB,EAAA;AAAA,OACtB;AAAA,MACA,KAAO,EAAA;AAAA,QACL,eAAiB,EAAA,SAAA;AAAA,QACjB,qBAAuB,EAAA,MAAA;AAAA,QACvB,qBAAuB,EAAA;AAAA;AACzB;AACF,GACF;AACF;;;;"}
1
+ {"version":3,"file":"lightTheme.esm.js","sources":["../src/lightTheme.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 { palettes } from '@backstage/theme';\nimport { type PaletteOptions } from '@mui/material/styles';\n\nimport { type ThemeConfigPalette } from './types';\n\nexport const customLightTheme = (): ThemeConfigPalette => {\n const palette: (typeof palettes)['light'] & PaletteOptions = palettes.light;\n return {\n ...palette,\n primary: {\n main: '#0066CC',\n },\n secondary: {\n main: '#0066CC',\n },\n navigation: {\n background: '#222427',\n indicator: '#0066CC',\n color: '#ffffff',\n selectedColor: '#ffffff',\n navItem: {\n hoverBackground: '#3c3f42',\n },\n submenu: {\n background: '#222427',\n },\n },\n text: {\n primary: '#151515',\n secondary: '#757575',\n },\n background: {\n default: '#F8F8F8',\n paper: '#FFFFFF',\n },\n rhdh: {\n general: {\n disabled: '#6A6E73',\n disabledBackground: '#D2D2D2',\n\n paperBackgroundImage: 'none',\n paperBorderColor: '#C7C7C7',\n\n // Box shadow from PatternFly 5 (--pf-v5-global--BoxShadow--sm)\n popoverBoxShadow:\n '0 0.25rem 0.5rem 0rem rgba(3, 3, 3, 0.12), 0 0 0.25rem 0 rgba(3, 3, 3, 0.06)',\n\n cardBackgroundColor: '#FFF',\n cardBorderColor: '#C7C7C7',\n\n headerBottomBorderColor: '#C7C7C7',\n mainSectionBackgroundColor: '#FFF',\n formControlBackgroundColor: '#FFF',\n\n sidebarBackgroundColor: '#212427',\n sidebarItemSelectedBackgroundColor: '#4F5255',\n\n tableTitleColor: '#181818',\n tableSubtitleColor: '#616161',\n tableColumnTitleColor: '#151515',\n tableRowHover: '#F5F5F5',\n tableBorderColor: '#E0E0E0',\n tableBackgroundColor: '#FFF',\n tabsDisabledBackgroundColor: '#f5f5f5',\n tabsBottomBorderColor: '#D2D2D2',\n\n contrastText: '#FFF',\n },\n primary: {\n main: '#0066CC',\n focusVisibleBorder: '#0066CC',\n },\n secondary: {\n main: '#0066CC',\n focusVisibleBorder: '#0066CC',\n },\n cards: {\n headerTextColor: '#151515',\n headerBackgroundColor: '#FFF',\n headerBackgroundImage: 'none',\n },\n },\n };\n};\n"],"names":[],"mappings":";;AAqBO,MAAM,mBAAmB,MAA0B;AACxD,EAAA,MAAM,UAAuD,QAAS,CAAA,KAAA;AACtE,EAAO,OAAA;AAAA,IACL,GAAG,OAAA;AAAA,IACH,OAAS,EAAA;AAAA,MACP,IAAM,EAAA;AAAA,KACR;AAAA,IACA,SAAW,EAAA;AAAA,MACT,IAAM,EAAA;AAAA,KACR;AAAA,IACA,UAAY,EAAA;AAAA,MACV,UAAY,EAAA,SAAA;AAAA,MACZ,SAAW,EAAA,SAAA;AAAA,MACX,KAAO,EAAA,SAAA;AAAA,MACP,aAAe,EAAA,SAAA;AAAA,MACf,OAAS,EAAA;AAAA,QACP,eAAiB,EAAA;AAAA,OACnB;AAAA,MACA,OAAS,EAAA;AAAA,QACP,UAAY,EAAA;AAAA;AACd,KACF;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,OAAS,EAAA,SAAA;AAAA,MACT,SAAW,EAAA;AAAA,KACb;AAAA,IACA,UAAY,EAAA;AAAA,MACV,OAAS,EAAA,SAAA;AAAA,MACT,KAAO,EAAA;AAAA,KACT;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,OAAS,EAAA;AAAA,QACP,QAAU,EAAA,SAAA;AAAA,QACV,kBAAoB,EAAA,SAAA;AAAA,QAEpB,oBAAsB,EAAA,MAAA;AAAA,QACtB,gBAAkB,EAAA,SAAA;AAAA;AAAA,QAGlB,gBACE,EAAA,8EAAA;AAAA,QAEF,mBAAqB,EAAA,MAAA;AAAA,QACrB,eAAiB,EAAA,SAAA;AAAA,QAEjB,uBAAyB,EAAA,SAAA;AAAA,QACzB,0BAA4B,EAAA,MAAA;AAAA,QAC5B,0BAA4B,EAAA,MAAA;AAAA,QAE5B,sBAAwB,EAAA,SAAA;AAAA,QACxB,kCAAoC,EAAA,SAAA;AAAA,QAEpC,eAAiB,EAAA,SAAA;AAAA,QACjB,kBAAoB,EAAA,SAAA;AAAA,QACpB,qBAAuB,EAAA,SAAA;AAAA,QACvB,aAAe,EAAA,SAAA;AAAA,QACf,gBAAkB,EAAA,SAAA;AAAA,QAClB,oBAAsB,EAAA,MAAA;AAAA,QACtB,2BAA6B,EAAA,SAAA;AAAA,QAC7B,qBAAuB,EAAA,SAAA;AAAA,QAEvB,YAAc,EAAA;AAAA,OAChB;AAAA,MACA,OAAS,EAAA;AAAA,QACP,IAAM,EAAA,SAAA;AAAA,QACN,kBAAoB,EAAA;AAAA,OACtB;AAAA,MACA,SAAW,EAAA;AAAA,QACT,IAAM,EAAA,SAAA;AAAA,QACN,kBAAoB,EAAA;AAAA,OACtB;AAAA,MACA,KAAO,EAAA;AAAA,QACL,eAAiB,EAAA,SAAA;AAAA,QACjB,qBAAuB,EAAA,MAAA;AAAA,QACvB,qBAAuB,EAAA;AAAA;AACzB;AACF,GACF;AACF;;;;"}
package/dist/rhdh.esm.js CHANGED
@@ -1,7 +1,7 @@
1
- import './plugins/theme/fonts/font.css.esm.js';
2
1
  import { customDarkTheme } from './darkTheme.esm.js';
3
2
  import { customLightTheme } from './lightTheme.esm.js';
4
- import { fonts, typography } from './typography.esm.js';
3
+ import { redHatFonts } from './fonts.esm.js';
4
+ import { typography } from './typography.esm.js';
5
5
 
6
6
  const getDefaultThemeConfig = (mode) => {
7
7
  const palette = mode === "dark" ? customDarkTheme() : customLightTheme();
@@ -9,7 +9,7 @@ const getDefaultThemeConfig = (mode) => {
9
9
  variant: "rhdh",
10
10
  mode: mode === "dark" ? "dark" : "light",
11
11
  palette,
12
- fontFamily: fonts.text,
12
+ fontFamily: redHatFonts.text,
13
13
  typography,
14
14
  defaultPageTheme: "default",
15
15
  pageTheme: {
@@ -1 +1 @@
1
- {"version":3,"file":"rhdh.esm.js","sources":["../src/rhdh.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 */\n\nimport '../fonts/font.css';\n\nimport { ThemeConfig } from './types';\nimport { customDarkTheme } from './darkTheme';\nimport { customLightTheme } from './lightTheme';\nimport { fonts, typography } from './typography';\n\nexport const getDefaultThemeConfig = (mode: 'light' | 'dark'): ThemeConfig => {\n const palette = mode === 'dark' ? customDarkTheme() : customLightTheme();\n\n return {\n variant: 'rhdh',\n mode: mode === 'dark' ? 'dark' : 'light',\n palette,\n fontFamily: fonts.text,\n typography,\n defaultPageTheme: 'default',\n pageTheme: {\n default: {\n backgroundColor: mode === 'dark' ? '#0f1214' : '#ffffff',\n fontColor: mode === 'dark' ? '#ffffff' : '#000000',\n },\n },\n options: {},\n };\n};\n"],"names":[],"mappings":";;;;;AAuBa,MAAA,qBAAA,GAAwB,CAAC,IAAwC,KAAA;AAC5E,EAAA,MAAM,OAAU,GAAA,IAAA,KAAS,MAAS,GAAA,eAAA,KAAoB,gBAAiB,EAAA;AAEvE,EAAO,OAAA;AAAA,IACL,OAAS,EAAA,MAAA;AAAA,IACT,IAAA,EAAM,IAAS,KAAA,MAAA,GAAS,MAAS,GAAA,OAAA;AAAA,IACjC,OAAA;AAAA,IACA,YAAY,KAAM,CAAA,IAAA;AAAA,IAClB,UAAA;AAAA,IACA,gBAAkB,EAAA,SAAA;AAAA,IAClB,SAAW,EAAA;AAAA,MACT,OAAS,EAAA;AAAA,QACP,eAAA,EAAiB,IAAS,KAAA,MAAA,GAAS,SAAY,GAAA,SAAA;AAAA,QAC/C,SAAA,EAAW,IAAS,KAAA,MAAA,GAAS,SAAY,GAAA;AAAA;AAC3C,KACF;AAAA,IACA,SAAS;AAAC,GACZ;AACF;;;;"}
1
+ {"version":3,"file":"rhdh.esm.js","sources":["../src/rhdh.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';\nimport { customDarkTheme } from './darkTheme';\nimport { customLightTheme } from './lightTheme';\nimport { redHatFonts } from './fonts';\nimport { typography } from './typography';\n\nexport const getDefaultThemeConfig = (mode: 'light' | 'dark'): ThemeConfig => {\n const palette = mode === 'dark' ? customDarkTheme() : customLightTheme();\n\n return {\n variant: 'rhdh',\n mode: mode === 'dark' ? 'dark' : 'light',\n palette,\n fontFamily: redHatFonts.text,\n typography,\n defaultPageTheme: 'default',\n pageTheme: {\n default: {\n backgroundColor: mode === 'dark' ? '#0f1214' : '#ffffff',\n fontColor: mode === 'dark' ? '#ffffff' : '#000000',\n },\n },\n options: {},\n };\n};\n"],"names":[],"mappings":";;;;;AAsBa,MAAA,qBAAA,GAAwB,CAAC,IAAwC,KAAA;AAC5E,EAAA,MAAM,OAAU,GAAA,IAAA,KAAS,MAAS,GAAA,eAAA,KAAoB,gBAAiB,EAAA;AAEvE,EAAO,OAAA;AAAA,IACL,OAAS,EAAA,MAAA;AAAA,IACT,IAAA,EAAM,IAAS,KAAA,MAAA,GAAS,MAAS,GAAA,OAAA;AAAA,IACjC,OAAA;AAAA,IACA,YAAY,WAAY,CAAA,IAAA;AAAA,IACxB,UAAA;AAAA,IACA,gBAAkB,EAAA,SAAA;AAAA,IAClB,SAAW,EAAA;AAAA,MACT,OAAS,EAAA;AAAA,QACP,eAAA,EAAiB,IAAS,KAAA,MAAA,GAAS,SAAY,GAAA,SAAA;AAAA,QAC/C,SAAA,EAAW,IAAS,KAAA,MAAA,GAAS,SAAY,GAAA;AAAA;AAC3C,KACF;AAAA,IACA,SAAS;AAAC,GACZ;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"themes.esm.js","sources":["../src/themes.tsx"],"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 React from 'react';\nimport { AppTheme } from '@backstage/core-plugin-api';\nimport { themes } from '@backstage/theme';\n\nimport LightIcon from '@material-ui/icons/WbSunny';\nimport DarkIcon from '@material-ui/icons/Brightness2';\nimport { createTheme } from '@mui/material/styles';\n\nimport {\n createThemeProvider,\n createThemeProviderForThemeName,\n createThemeProviderForThemeConfig,\n} from './components/ThemeProvider';\nimport * as backstage from './backstage';\nimport * as rhdh from './rhdh';\n\nexport const getAllThemes = (): AppTheme[] => {\n return [\n {\n id: 'light',\n title: 'RHDH Light (latest)',\n variant: 'light',\n icon: <LightIcon />,\n Provider: createThemeProviderForThemeName('light'),\n },\n {\n id: 'dark',\n title: 'RHDH Dark (latest)',\n variant: 'dark',\n icon: <DarkIcon />,\n Provider: createThemeProviderForThemeName('dark'),\n },\n {\n id: 'light-customized',\n title: 'RHDH Light (customized)',\n variant: 'light',\n icon: <LightIcon />,\n Provider: createThemeProviderForThemeConfig({\n mode: 'light',\n variant: 'rhdh',\n palette: {\n primary: { main: '#ff0000' },\n secondary: { main: '#00ff00' },\n },\n }),\n },\n {\n id: 'dark-customized',\n title: 'RHDH Dark (customized)',\n variant: 'dark',\n icon: <DarkIcon />,\n Provider: createThemeProviderForThemeConfig({\n mode: 'dark',\n variant: 'rhdh',\n palette: {\n primary: { main: '#ff0000' },\n secondary: { main: '#00ff00' },\n },\n }),\n },\n {\n id: 'backstage-light',\n title: 'Backstage Light',\n variant: 'light',\n icon: <LightIcon />,\n Provider: createThemeProvider(themes.light),\n },\n {\n id: 'backstage-dark',\n title: 'Backstage Dark',\n variant: 'dark',\n icon: <DarkIcon />,\n Provider: createThemeProvider(themes.dark),\n },\n ];\n};\n\nexport const useAllThemes = (): AppTheme[] => {\n return React.useMemo(() => getAllThemes(), []);\n};\n\nexport const getThemes = (): AppTheme[] => {\n return [\n {\n id: 'light',\n title: 'Light',\n variant: 'light',\n icon: <LightIcon />,\n Provider: createThemeProviderForThemeName('light'),\n },\n {\n id: 'dark',\n title: 'Dark',\n variant: 'dark',\n icon: <DarkIcon />,\n Provider: createThemeProviderForThemeName('dark'),\n },\n ];\n};\n\nexport const useThemes = (): AppTheme[] => {\n return React.useMemo(() => getThemes(), []);\n};\n\nexport const useLoaderTheme = () => {\n return React.useMemo(() => {\n const latestTheme = localStorage.getItem('theme');\n const mode = latestTheme?.includes('dark') ? 'dark' : 'light';\n const variant = latestTheme?.includes('backstage') ? 'backstage' : 'rhdh';\n const themeOptions =\n variant === 'backstage'\n ? backstage.getDefaultThemeConfig(mode)\n : rhdh.getDefaultThemeConfig(mode);\n return createTheme(themeOptions);\n }, []);\n};\n"],"names":["backstage.getDefaultThemeConfig","rhdh.getDefaultThemeConfig"],"mappings":"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"}
1
+ {"version":3,"file":"themes.esm.js","sources":["../src/themes.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 { AppTheme } from '@backstage/core-plugin-api';\nimport { themes } from '@backstage/theme';\n\nimport LightIcon from '@material-ui/icons/WbSunny';\nimport DarkIcon from '@material-ui/icons/Brightness2';\nimport { createTheme } from '@mui/material/styles';\n\nimport {\n createThemeProvider,\n createThemeProviderForThemeName,\n createThemeProviderForThemeConfig,\n} from './components/ThemeProvider';\nimport * as backstage from './backstage';\nimport * as rhdh from './rhdh';\n\nexport const getAllThemes = (): AppTheme[] => {\n return [\n {\n id: 'light',\n title: 'RHDH Light (latest)',\n variant: 'light',\n icon: <LightIcon />,\n Provider: createThemeProviderForThemeName('light'),\n },\n {\n id: 'dark',\n title: 'RHDH Dark (latest)',\n variant: 'dark',\n icon: <DarkIcon />,\n Provider: createThemeProviderForThemeName('dark'),\n },\n {\n id: 'light-customized',\n title: 'RHDH Light (customized)',\n variant: 'light',\n icon: <LightIcon />,\n Provider: createThemeProviderForThemeConfig({\n mode: 'light',\n variant: 'rhdh',\n palette: {\n primary: { main: '#ff0000' },\n secondary: { main: '#00ff00' },\n },\n }),\n },\n {\n id: 'dark-customized',\n title: 'RHDH Dark (customized)',\n variant: 'dark',\n icon: <DarkIcon />,\n Provider: createThemeProviderForThemeConfig({\n mode: 'dark',\n variant: 'rhdh',\n palette: {\n primary: { main: '#ff0000' },\n secondary: { main: '#00ff00' },\n },\n }),\n },\n {\n id: 'backstage-light',\n title: 'Backstage Light',\n variant: 'light',\n icon: <LightIcon />,\n Provider: createThemeProvider(themes.light),\n },\n {\n id: 'backstage-dark',\n title: 'Backstage Dark',\n variant: 'dark',\n icon: <DarkIcon />,\n Provider: createThemeProvider(themes.dark),\n },\n ];\n};\n\nexport const useAllThemes = (): AppTheme[] => {\n return React.useMemo(() => getAllThemes(), []);\n};\n\nexport const getThemes = (): AppTheme[] => {\n return [\n {\n id: 'light',\n title: 'Light',\n variant: 'light',\n icon: <LightIcon />,\n Provider: createThemeProviderForThemeName('light'),\n },\n {\n id: 'dark',\n title: 'Dark',\n variant: 'dark',\n icon: <DarkIcon />,\n Provider: createThemeProviderForThemeName('dark'),\n },\n ];\n};\n\nexport const useThemes = (): AppTheme[] => {\n return React.useMemo(() => getThemes(), []);\n};\n\nexport const useLoaderTheme = () => {\n return React.useMemo(() => {\n const latestTheme = localStorage.getItem('theme');\n const mode = latestTheme?.includes('dark') ? 'dark' : 'light';\n const variant = latestTheme?.includes('backstage') ? 'backstage' : 'rhdh';\n const themeOptions =\n variant === 'backstage'\n ? backstage.getDefaultThemeConfig(mode)\n : rhdh.getDefaultThemeConfig(mode);\n return createTheme(themeOptions);\n }, []);\n};\n"],"names":["backstage.getDefaultThemeConfig","rhdh.getDefaultThemeConfig"],"mappings":";;;;;;;;;AAgCO,MAAM,eAAe,MAAkB;AAC5C,EAAO,OAAA;AAAA,IACL;AAAA,MACE,EAAI,EAAA,OAAA;AAAA,MACJ,KAAO,EAAA,qBAAA;AAAA,MACP,OAAS,EAAA,OAAA;AAAA,MACT,IAAA,sCAAO,SAAU,EAAA,IAAA,CAAA;AAAA,MACjB,QAAA,EAAU,gCAAgC,OAAO;AAAA,KACnD;AAAA,IACA;AAAA,MACE,EAAI,EAAA,MAAA;AAAA,MACJ,KAAO,EAAA,oBAAA;AAAA,MACP,OAAS,EAAA,MAAA;AAAA,MACT,IAAA,sCAAO,QAAS,EAAA,IAAA,CAAA;AAAA,MAChB,QAAA,EAAU,gCAAgC,MAAM;AAAA,KAClD;AAAA,IACA;AAAA,MACE,EAAI,EAAA,kBAAA;AAAA,MACJ,KAAO,EAAA,yBAAA;AAAA,MACP,OAAS,EAAA,OAAA;AAAA,MACT,IAAA,sCAAO,SAAU,EAAA,IAAA,CAAA;AAAA,MACjB,UAAU,iCAAkC,CAAA;AAAA,QAC1C,IAAM,EAAA,OAAA;AAAA,QACN,OAAS,EAAA,MAAA;AAAA,QACT,OAAS,EAAA;AAAA,UACP,OAAA,EAAS,EAAE,IAAA,EAAM,SAAU,EAAA;AAAA,UAC3B,SAAA,EAAW,EAAE,IAAA,EAAM,SAAU;AAAA;AAC/B,OACD;AAAA,KACH;AAAA,IACA;AAAA,MACE,EAAI,EAAA,iBAAA;AAAA,MACJ,KAAO,EAAA,wBAAA;AAAA,MACP,OAAS,EAAA,MAAA;AAAA,MACT,IAAA,sCAAO,QAAS,EAAA,IAAA,CAAA;AAAA,MAChB,UAAU,iCAAkC,CAAA;AAAA,QAC1C,IAAM,EAAA,MAAA;AAAA,QACN,OAAS,EAAA,MAAA;AAAA,QACT,OAAS,EAAA;AAAA,UACP,OAAA,EAAS,EAAE,IAAA,EAAM,SAAU,EAAA;AAAA,UAC3B,SAAA,EAAW,EAAE,IAAA,EAAM,SAAU;AAAA;AAC/B,OACD;AAAA,KACH;AAAA,IACA;AAAA,MACE,EAAI,EAAA,iBAAA;AAAA,MACJ,KAAO,EAAA,iBAAA;AAAA,MACP,OAAS,EAAA,OAAA;AAAA,MACT,IAAA,sCAAO,SAAU,EAAA,IAAA,CAAA;AAAA,MACjB,QAAA,EAAU,mBAAoB,CAAA,MAAA,CAAO,KAAK;AAAA,KAC5C;AAAA,IACA;AAAA,MACE,EAAI,EAAA,gBAAA;AAAA,MACJ,KAAO,EAAA,gBAAA;AAAA,MACP,OAAS,EAAA,MAAA;AAAA,MACT,IAAA,sCAAO,QAAS,EAAA,IAAA,CAAA;AAAA,MAChB,QAAA,EAAU,mBAAoB,CAAA,MAAA,CAAO,IAAI;AAAA;AAC3C,GACF;AACF;AAEO,MAAM,eAAe,MAAkB;AAC5C,EAAA,OAAO,MAAM,OAAQ,CAAA,MAAM,YAAa,EAAA,EAAG,EAAE,CAAA;AAC/C;AAEO,MAAM,YAAY,MAAkB;AACzC,EAAO,OAAA;AAAA,IACL;AAAA,MACE,EAAI,EAAA,OAAA;AAAA,MACJ,KAAO,EAAA,OAAA;AAAA,MACP,OAAS,EAAA,OAAA;AAAA,MACT,IAAA,sCAAO,SAAU,EAAA,IAAA,CAAA;AAAA,MACjB,QAAA,EAAU,gCAAgC,OAAO;AAAA,KACnD;AAAA,IACA;AAAA,MACE,EAAI,EAAA,MAAA;AAAA,MACJ,KAAO,EAAA,MAAA;AAAA,MACP,OAAS,EAAA,MAAA;AAAA,MACT,IAAA,sCAAO,QAAS,EAAA,IAAA,CAAA;AAAA,MAChB,QAAA,EAAU,gCAAgC,MAAM;AAAA;AAClD,GACF;AACF;AAEO,MAAM,YAAY,MAAkB;AACzC,EAAA,OAAO,MAAM,OAAQ,CAAA,MAAM,SAAU,EAAA,EAAG,EAAE,CAAA;AAC5C;AAEO,MAAM,iBAAiB,MAAM;AAClC,EAAO,OAAA,KAAA,CAAM,QAAQ,MAAM;AACzB,IAAM,MAAA,WAAA,GAAc,YAAa,CAAA,OAAA,CAAQ,OAAO,CAAA;AAChD,IAAA,MAAM,IAAO,GAAA,WAAA,EAAa,QAAS,CAAA,MAAM,IAAI,MAAS,GAAA,OAAA;AACtD,IAAA,MAAM,OAAU,GAAA,WAAA,EAAa,QAAS,CAAA,WAAW,IAAI,WAAc,GAAA,MAAA;AACnE,IAAM,MAAA,YAAA,GACJ,YAAY,WACR,GAAAA,sBAAgC,IAAI,CAAA,GACpCC,uBAAK,CAAsB,IAAI,CAAA;AACrC,IAAA,OAAO,YAAY,YAAY,CAAA;AAAA,GACjC,EAAG,EAAE,CAAA;AACP;;;;"}
@@ -1,75 +1,45 @@
1
- const fonts = {
2
- text: [
3
- "RedHatText",
4
- '"Helvetica Neue"',
5
- "-apple-system",
6
- '"Segoe UI"',
7
- "Roboto",
8
- "Helvetica",
9
- "Arial",
10
- "sans-serif"
11
- ].join(", "),
12
- heading: [
13
- "RedHatDisplay",
14
- '"Helvetica Neue"',
15
- "-apple-system",
16
- '"Segoe UI"',
17
- "Roboto",
18
- "Helvetica",
19
- "Arial",
20
- "sans-serif"
21
- ].join(", "),
22
- monospace: [
23
- "RedHatMono",
24
- '"Liberation Mono"',
25
- "consolas",
26
- '"SFMono-Regular"',
27
- "menlo",
28
- "monaco",
29
- '"Courier New"',
30
- "monospace"
31
- ].join(", ")
32
- };
1
+ import { redHatFonts } from './fonts.esm.js';
2
+
33
3
  const typography = {
34
4
  htmlFontSize: 16,
35
- fontFamily: fonts.text,
5
+ fontFamily: redHatFonts.text,
36
6
  h1: {
37
- fontFamily: fonts.heading,
7
+ fontFamily: redHatFonts.heading,
38
8
  fontSize: 36,
39
9
  fontWeight: 400,
40
10
  marginBottom: 10
41
11
  },
42
12
  h2: {
43
- fontFamily: fonts.heading,
13
+ fontFamily: redHatFonts.heading,
44
14
  fontSize: 28,
45
15
  fontWeight: 400,
46
16
  marginBottom: 8
47
17
  },
48
18
  h3: {
49
- fontFamily: fonts.heading,
19
+ fontFamily: redHatFonts.heading,
50
20
  fontSize: 24,
51
21
  fontWeight: 400,
52
22
  marginBottom: 6
53
23
  },
54
24
  h4: {
55
- fontFamily: fonts.heading,
25
+ fontFamily: redHatFonts.heading,
56
26
  fontSize: 20,
57
27
  fontWeight: 400,
58
28
  marginBottom: 6
59
29
  },
60
30
  h5: {
61
- fontFamily: fonts.heading,
31
+ fontFamily: redHatFonts.heading,
62
32
  fontSize: 18,
63
33
  fontWeight: 500,
64
34
  marginBottom: 4
65
35
  },
66
36
  h6: {
67
- fontFamily: fonts.heading,
37
+ fontFamily: redHatFonts.heading,
68
38
  fontSize: 16,
69
39
  fontWeight: 500,
70
40
  marginBottom: 2
71
41
  }
72
42
  };
73
43
 
74
- export { fonts, typography };
44
+ export { typography };
75
45
  //# sourceMappingURL=typography.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"typography.esm.js","sources":["../src/typography.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 { BackstageTypography } from '@backstage/theme';\n\nexport const fonts = {\n text: [\n 'RedHatText',\n '\"Helvetica Neue\"',\n '-apple-system',\n '\"Segoe UI\"',\n 'Roboto',\n 'Helvetica',\n 'Arial',\n 'sans-serif',\n ].join(', '),\n heading: [\n 'RedHatDisplay',\n '\"Helvetica Neue\"',\n '-apple-system',\n '\"Segoe UI\"',\n 'Roboto',\n 'Helvetica',\n 'Arial',\n 'sans-serif',\n ].join(', '),\n monospace: [\n 'RedHatMono',\n '\"Liberation Mono\"',\n 'consolas',\n '\"SFMono-Regular\"',\n 'menlo',\n 'monaco',\n '\"Courier New\"',\n 'monospace',\n ].join(', '),\n};\n\n// Font sized based on https://www.patternfly.org/design-foundations/typography\nexport const typography: BackstageTypography = {\n htmlFontSize: 16,\n fontFamily: fonts.text,\n h1: {\n fontFamily: fonts.heading,\n fontSize: 36,\n fontWeight: 400,\n marginBottom: 10,\n },\n h2: {\n fontFamily: fonts.heading,\n fontSize: 28,\n fontWeight: 400,\n marginBottom: 8,\n },\n h3: {\n fontFamily: fonts.heading,\n fontSize: 24,\n fontWeight: 400,\n marginBottom: 6,\n },\n h4: {\n fontFamily: fonts.heading,\n fontSize: 20,\n fontWeight: 400,\n marginBottom: 6,\n },\n h5: {\n fontFamily: fonts.heading,\n fontSize: 18,\n fontWeight: 500,\n marginBottom: 4,\n },\n h6: {\n fontFamily: fonts.heading,\n fontSize: 16,\n fontWeight: 500,\n marginBottom: 2,\n },\n};\n"],"names":[],"mappings":"AAiBO,MAAM,KAAQ,GAAA;AAAA,EACnB,IAAM,EAAA;AAAA,IACJ,YAAA;AAAA,IACA,kBAAA;AAAA,IACA,eAAA;AAAA,IACA,YAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GACF,CAAE,KAAK,IAAI,CAAA;AAAA,EACX,OAAS,EAAA;AAAA,IACP,eAAA;AAAA,IACA,kBAAA;AAAA,IACA,eAAA;AAAA,IACA,YAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GACF,CAAE,KAAK,IAAI,CAAA;AAAA,EACX,SAAW,EAAA;AAAA,IACT,YAAA;AAAA,IACA,mBAAA;AAAA,IACA,UAAA;AAAA,IACA,kBAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,GACF,CAAE,KAAK,IAAI;AACb;AAGO,MAAM,UAAkC,GAAA;AAAA,EAC7C,YAAc,EAAA,EAAA;AAAA,EACd,YAAY,KAAM,CAAA,IAAA;AAAA,EAClB,EAAI,EAAA;AAAA,IACF,YAAY,KAAM,CAAA,OAAA;AAAA,IAClB,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,GAAA;AAAA,IACZ,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,EAAI,EAAA;AAAA,IACF,YAAY,KAAM,CAAA,OAAA;AAAA,IAClB,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,GAAA;AAAA,IACZ,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,EAAI,EAAA;AAAA,IACF,YAAY,KAAM,CAAA,OAAA;AAAA,IAClB,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,GAAA;AAAA,IACZ,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,EAAI,EAAA;AAAA,IACF,YAAY,KAAM,CAAA,OAAA;AAAA,IAClB,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,GAAA;AAAA,IACZ,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,EAAI,EAAA;AAAA,IACF,YAAY,KAAM,CAAA,OAAA;AAAA,IAClB,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,GAAA;AAAA,IACZ,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,EAAI,EAAA;AAAA,IACF,YAAY,KAAM,CAAA,OAAA;AAAA,IAClB,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,GAAA;AAAA,IACZ,YAAc,EAAA;AAAA;AAElB;;;;"}
1
+ {"version":3,"file":"typography.esm.js","sources":["../src/typography.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 { BackstageTypography } from '@backstage/theme';\n\nimport { redHatFonts } from './fonts';\n\n// Font sized based on https://www.patternfly.org/design-foundations/typography\nexport const typography: BackstageTypography = {\n htmlFontSize: 16,\n fontFamily: redHatFonts.text,\n h1: {\n fontFamily: redHatFonts.heading,\n fontSize: 36,\n fontWeight: 400,\n marginBottom: 10,\n },\n h2: {\n fontFamily: redHatFonts.heading,\n fontSize: 28,\n fontWeight: 400,\n marginBottom: 8,\n },\n h3: {\n fontFamily: redHatFonts.heading,\n fontSize: 24,\n fontWeight: 400,\n marginBottom: 6,\n },\n h4: {\n fontFamily: redHatFonts.heading,\n fontSize: 20,\n fontWeight: 400,\n marginBottom: 6,\n },\n h5: {\n fontFamily: redHatFonts.heading,\n fontSize: 18,\n fontWeight: 500,\n marginBottom: 4,\n },\n h6: {\n fontFamily: redHatFonts.heading,\n fontSize: 16,\n fontWeight: 500,\n marginBottom: 2,\n },\n};\n"],"names":[],"mappings":";;AAqBO,MAAM,UAAkC,GAAA;AAAA,EAC7C,YAAc,EAAA,EAAA;AAAA,EACd,YAAY,WAAY,CAAA,IAAA;AAAA,EACxB,EAAI,EAAA;AAAA,IACF,YAAY,WAAY,CAAA,OAAA;AAAA,IACxB,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,GAAA;AAAA,IACZ,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,EAAI,EAAA;AAAA,IACF,YAAY,WAAY,CAAA,OAAA;AAAA,IACxB,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,GAAA;AAAA,IACZ,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,EAAI,EAAA;AAAA,IACF,YAAY,WAAY,CAAA,OAAA;AAAA,IACxB,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,GAAA;AAAA,IACZ,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,EAAI,EAAA;AAAA,IACF,YAAY,WAAY,CAAA,OAAA;AAAA,IACxB,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,GAAA;AAAA,IACZ,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,EAAI,EAAA;AAAA,IACF,YAAY,WAAY,CAAA,OAAA;AAAA,IACxB,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,GAAA;AAAA,IACZ,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,EAAI,EAAA;AAAA,IACF,YAAY,WAAY,CAAA,OAAA;AAAA,IACxB,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,GAAA;AAAA,IACZ,YAAc,EAAA;AAAA;AAElB;;;;"}
@@ -1,3 +1,6 @@
1
+ import { defaultComponentThemes } from '@backstage/theme';
2
+ import { redHatFontFaces, redHatFonts } from '../fonts.esm.js';
3
+
1
4
  const createComponents = (themeConfig) => {
2
5
  const options = themeConfig.options ?? {};
3
6
  const disableRipple = options?.rippleEffect !== "on";
@@ -9,6 +12,26 @@ const createComponents = (themeConfig) => {
9
12
  if (options.components === "backstage" || options.components === "mui") {
10
13
  return components;
11
14
  }
15
+ components.MuiCssBaseline = {
16
+ styleOverrides: (theme) => {
17
+ const backstageOverrides = defaultComponentThemes.MuiCssBaseline.styleOverrides;
18
+ const backstageStyles = typeof backstageOverrides === "function" ? backstageOverrides(theme) : backstageOverrides;
19
+ return {
20
+ ...backstageStyles,
21
+ "@font-face": redHatFontFaces,
22
+ body: {
23
+ ...backstageStyles.body,
24
+ fontFamily: redHatFonts.text
25
+ },
26
+ "h1, h2, h3, h4, h5, h6": {
27
+ fontFamily: redHatFonts.heading
28
+ },
29
+ "pre, code": {
30
+ fontFamily: redHatFonts.monospace
31
+ }
32
+ };
33
+ }
34
+ };
12
35
  if (options.buttons !== "mui") {
13
36
  components.MuiTypography = {
14
37
  styleOverrides: {