@red-hat-developer-hub/backstage-plugin-theme 0.14.10 → 0.15.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.
- package/CHANGELOG.md +12 -0
- package/dist/alpha.esm.js.map +1 -1
- package/dist/assets/fonts/font.min.css.esm.js +0 -2
- package/dist/assets/fonts/font.min.css.esm.js.map +1 -1
- package/dist/backstage.esm.js.map +1 -1
- package/dist/components/LogoFull.esm.js.map +1 -1
- package/dist/components/LogoIcon.esm.js.map +1 -1
- package/dist/components/ThemeProvider.esm.js.map +1 -1
- package/dist/darkTheme.esm.js.map +1 -1
- package/dist/fonts.esm.js.map +1 -1
- package/dist/hooks/useBranding.esm.js +1 -1
- package/dist/hooks/useBranding.esm.js.map +1 -1
- package/dist/hooks/useTheme.esm.js.map +1 -1
- package/dist/hooks/useThemeConfig.esm.js +1 -1
- package/dist/hooks/useThemeConfig.esm.js.map +1 -1
- package/dist/hooks/useThemeOptions.esm.js.map +1 -1
- package/dist/lightTheme.esm.js.map +1 -1
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js +1 -1
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -1
- package/dist/rhdh.esm.js.map +1 -1
- package/dist/themes.esm.js.map +1 -1
- package/dist/typography.esm.js.map +1 -1
- package/dist/utils/createComponents.esm.js +10 -1
- package/dist/utils/createComponents.esm.js.map +1 -1
- package/dist/utils/createPageTheme.esm.js.map +1 -1
- package/dist/utils/createPageThemes.esm.js +1 -1
- package/dist/utils/createPageThemes.esm.js.map +1 -1
- package/dist/utils/mergeTheme.esm.js +2 -2
- package/dist/utils/mergeTheme.esm.js.map +1 -1
- package/dist/utils/migrateTheme.esm.js.map +1 -1
- package/dist/utils/navigationSidebarColors.esm.js +3 -3
- package/dist/utils/navigationSidebarColors.esm.js.map +1 -1
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @red-hat-developer-hub/backstage-plugin-theme
|
|
2
2
|
|
|
3
|
+
## 0.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 22d09cd: Backstage version bump to v1.52.1
|
|
8
|
+
|
|
9
|
+
## 0.14.11
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- a3302ac: prevent overlapping scrollbars on TechDocs pages
|
|
14
|
+
|
|
3
15
|
## 0.14.10
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha/index.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * RHDH themes as NFS extensions (ThemeBlueprint).\n * Only the app can register ThemeBlueprint; we use the same theme definitions\n * from the theme plugin (getAllThemes()) so behavior matches the legacy app.\n *\n * @packageDocumentation\n */\n\nimport { createFrontendModule } from '@backstage/frontend-plugin-api';\nimport { ThemeBlueprint } from '@backstage/plugin-app-react';\n\nimport '../assets/fonts/font.min.css';\n\nimport { getAllThemes } from '../themes';\n\nconst rhdhThemeExtensions = getAllThemes().map(appTheme =>\n ThemeBlueprint.make({\n name: appTheme.id,\n params: {\n theme: {\n id: appTheme.id,\n title: appTheme.title,\n variant: appTheme.variant,\n icon: appTheme.icon,\n Provider: appTheme.Provider,\n },\n },\n }),\n);\n\n/*\n * @alpha\n */\nexport const rhdhThemeModule = createFrontendModule({\n pluginId: 'app',\n extensions: rhdhThemeExtensions,\n});\n"],"names":[],"mappings":";;;;;AA+BA,MAAM,mBAAA,GAAsB,
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha/index.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * RHDH themes as NFS extensions (ThemeBlueprint).\n * Only the app can register ThemeBlueprint; we use the same theme definitions\n * from the theme plugin (getAllThemes()) so behavior matches the legacy app.\n *\n * @packageDocumentation\n */\n\nimport { createFrontendModule } from '@backstage/frontend-plugin-api';\nimport { ThemeBlueprint } from '@backstage/plugin-app-react';\n\nimport '../assets/fonts/font.min.css';\n\nimport { getAllThemes } from '../themes';\n\nconst rhdhThemeExtensions = getAllThemes().map(appTheme =>\n ThemeBlueprint.make({\n name: appTheme.id,\n params: {\n theme: {\n id: appTheme.id,\n title: appTheme.title,\n variant: appTheme.variant,\n icon: appTheme.icon,\n Provider: appTheme.Provider,\n },\n },\n }),\n);\n\n/*\n * @alpha\n */\nexport const rhdhThemeModule = createFrontendModule({\n pluginId: 'app',\n extensions: rhdhThemeExtensions,\n});\n"],"names":[],"mappings":";;;;;AA+BA,MAAM,mBAAA,GAAsB,cAAa,CAAE,GAAA;AAAA,EAAI,CAAA,QAAA,KAC7C,eAAe,IAAA,CAAK;AAAA,IAClB,MAAM,QAAA,CAAS,EAAA;AAAA,IACf,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO;AAAA,QACL,IAAI,QAAA,CAAS,EAAA;AAAA,QACb,OAAO,QAAA,CAAS,KAAA;AAAA,QAChB,SAAS,QAAA,CAAS,OAAA;AAAA,QAClB,MAAM,QAAA,CAAS,IAAA;AAAA,QACf,UAAU,QAAA,CAAS;AAAA;AACrB;AACF,GACD;AACH,CAAA;AAKO,MAAM,kBAAkB,oBAAA,CAAqB;AAAA,EAClD,QAAA,EAAU,KAAA;AAAA,EACV,UAAA,EAAY;AACd,CAAC;;;;"}
|
|
@@ -2,6 +2,4 @@ import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.
|
|
|
2
2
|
|
|
3
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@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@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@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@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@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";
|
|
4
4
|
styleInject(css_248z);
|
|
5
|
-
|
|
6
|
-
export { css_248z as default };
|
|
7
5
|
//# sourceMappingURL=font.min.css.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font.min.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"font.min.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1 +1 @@
|
|
|
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":";;
|
|
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":";;AAoBO,MAAM,qBAAA,GAAwB,CAAC,IAAA,KAAwC;AAC5E,EAAA,MAAM,OAAA,GAAU,IAAA,KAAS,MAAA,GAAS,QAAA,CAAS,OAAO,QAAA,CAAS,KAAA;AAE3D,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,WAAA;AAAA,IACT,IAAA,EAAM,IAAA,KAAS,MAAA,GAAS,MAAA,GAAS,OAAA;AAAA,IACjC;AAAA,GACF;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogoFull.esm.js","sources":["../../src/components/LogoFull.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useTheme } from '@mui/material/styles';\n\nexport const LogoFull = (props: React.ComponentProps<'svg'>) => {\n const theme = useTheme();\n const isDarkMode = theme.palette.mode === 'dark';\n\n return (\n <svg\n viewBox=\"0 0 931.8 244\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"default-full-logo\"\n width=\"170\"\n {...props}\n >\n <path\n fill=\"#e00\"\n d=\"M129,85c12.5,0,30.6-2.6,30.6-17.5c0-1.2,0-2.3-0.3-3.4l-7.4-32.4c-1.7-7.1-3.2-10.3-15.7-16.6\n\t\t\t\tC126.4,10.2,105.3,2,99,2c-5.8,0-7.5,7.5-14.4,7.5c-6.7,0-11.6-5.6-17.9-5.6c-6,0-9.9,4.1-12.9,12.5c0,0-8.4,23.7-9.5,27.2\n\t\t\t\tC44,44.3,44,45,44,45.5C44,54.8,80.3,85,129,85 M161.5,73.6c1.7,8.2,1.7,9.1,1.7,10.1c0,14-15.7,21.8-36.4,21.8\n\t\t\t\tC80,105.5,39.1,78.1,39.1,60c0-2.8,0.6-5.4,1.5-7.3C23.8,53.5,2,56.5,2,75.7C2,107.2,76.6,146,135.7,146\n\t\t\t\tc45.3,0,56.7-20.5,56.7-36.6C192.3,96.6,181.4,82.2,161.5,73.6\"\n />\n <path\n fill=\"#000\"\n d=\"M161.5,73.6c1.7,8.2,1.7,9.1,1.7,10.1c0,14-15.7,21.8-36.4,21.8C80,105.5,39.1,78.1,39.1,60c0-2.8,0.6-5.4,1.5-7.3\n\t\t\t\tl3.7-9.1C44,44.3,44,45,44,45.5C44,54.8,80.3,85,129,85c12.5,0,30.6-2.6,30.6-17.5c0-1.2,0-2.3-0.3-3.4L161.5,73.6z\"\n />\n <g fill={isDarkMode ? '#fff' : '#000'}>\n <path\n d=\"M581.2,94.3c0,11.9,7.2,17.7,20.2,17.7c3.2,0,8.6-0.7,11.9-1.7V96.5c-2.8,0.8-4.9,1.2-7.7,1.2c-5.4,0-7.4-1.7-7.4-6.7\n\t\t\tV69.8h15.6V55.6h-15.6v-18l-17,3.7v14.3H570v14.2h11.3V94.3z M528.3,94.6c0-3.7,3.7-5.5,9.3-5.5c3.7,0,7,0.5,10.1,1.3v7.2\n\t\t\tc-3.2,1.8-6.8,2.6-10.6,2.6C531.6,100.2,528.3,98.1,528.3,94.6 M533.5,112.2c6,0,10.8-1.3,15.4-4.3v3.4h16.8V75.6\n\t\t\tc0-13.6-9.1-21-24.4-21c-8.5,0-16.9,2-26,6.1l6.1,12.5c6.5-2.7,12-4.4,16.8-4.4c7,0,10.6,2.7,10.6,8.3v2.7\n\t\t\tc-4-1.1-8.2-1.6-12.6-1.6c-14.3,0-22.9,6-22.9,16.7C513.3,104.7,521.1,112.2,533.5,112.2 M441.1,111.2h18.1V82.4h30.3v28.8h18.1\n\t\t\tV37.6h-18.1v28.3h-30.3V37.6h-18.1V111.2z M372.1,83.4c0-8,6.3-14.1,14.6-14.1c4.6,0,8.8,1.6,11.8,4.3V93c-3,2.9-7,4.4-11.8,4.4\n\t\t\tC378.5,97.5,372.1,91.4,372.1,83.4 M398.7,111.2h16.8V33.9l-17,3.7v20.9c-4.2-2.4-9-3.7-14.2-3.7c-16.2,0-28.9,12.5-28.9,28.5\n\t\t\tc0,16,12.5,28.6,28.4,28.6c5.5,0,10.6-1.7,14.9-4.8V111.2z M321.5,68.5c5.4,0,9.9,3.5,11.7,8.8H310\n\t\t\tC311.7,71.8,315.9,68.5,321.5,68.5 M292.8,83.5c0,16.2,13.3,28.8,30.3,28.8c9.4,0,16.2-2.5,23.2-8.4l-11.3-10\n\t\t\tc-2.6,2.7-6.5,4.2-11.1,4.2c-6.3,0-11.5-3.5-13.7-8.8h39.6V85c0-17.7-11.9-30.4-28.1-30.4C305.6,54.7,292.8,67.3,292.8,83.5\n\t\t\t M263.5,53.1c6,0,9.4,3.8,9.4,8.3s-3.4,8.3-9.4,8.3h-17.9V53.1H263.5z M227.5,111.2h18.1V84.4h13.8l13.9,26.8h20.2l-16.2-29.4\n\t\t\tc8.7-3.8,13.9-11.7,13.9-20.7c0-13.3-10.4-23.5-26-23.5h-37.7V111.2z\"\n />\n <path\n d=\"M228.7,219.5v-72.8h25.7c5.5,0,10.7,0.9,15.4,2.8c4.7,1.9,8.8,4.4,12.2,7.7c3.4,3.3,6,7.1,8,11.6\n\t\t\tc1.9,4.5,2.9,9.3,2.9,14.4c0,5.1-1,9.9-2.9,14.4c-1.9,4.4-4.6,8.3-8,11.5c-3.4,3.2-7.5,5.8-12.2,7.6c-4.7,1.9-9.8,2.8-15.4,2.8\n\t\t\tH228.7z M254.5,156.5h-15v53.2h15c3.8,0,7.4-0.7,10.7-2c3.3-1.4,6.1-3.2,8.5-5.6c2.4-2.4,4.3-5.2,5.7-8.4\n\t\t\tc1.4-3.2,2.1-6.7,2.1-10.5s-0.7-7.2-2.1-10.5c-1.4-3.3-3.3-6.1-5.7-8.5c-2.4-2.4-5.2-4.3-8.5-5.7\n\t\t\tC261.9,157.2,258.4,156.5,254.5,156.5z M300.7,193c0-3.7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7C413.1,200.5,412.4,196.9,412.4,193z M438.7,174.5\n\t\t\tc-4,0-7.5,1.3-10.4,4c-2.9,2.6-4.8,6-5.5,10.2h31.4c-0.7-4-2.5-7.4-5.4-10.1C445.9,175.9,442.5,174.5,438.7,174.5z M484.7,144.5v75.1h-10.4v-72.8L484.7,144.5z M494.5,193c0-3.8,0.7-7.4,2.1-10.8c1.4-3.4,3.4-6.3,5.9-8.7c2.5-2.5,5.4-4.4,8.8-5.8c3.4-1.4,7-2.1,10.8-2.1\n\t\t\tc3.8,0,7.4,0.7,10.8,2.1c3.4,1.4,6.3,3.4,8.7,5.8c2.5,2.5,4.4,5.4,5.8,8.7c1.4,3.4,2.1,7,2.1,10.8c0,3.9-0.7,7.5-2.1,10.9\n\t\t\tc-1.4,3.4-3.4,6.3-5.8,8.7c-2.5,2.5-5.4,4.4-8.7,5.8c-3.4,1.4-7,2.1-10.8,2.1c-3.8,0-7.4-0.7-10.8-2.1c-3.4-1.4-6.3-3.4-8.8-5.8\n\t\t\tc-2.5-2.5-4.5-5.4-5.9-8.7C495.2,200.5,494.5,196.9,494.5,193z M539.4,193c0-5.1-1.7-9.5-5.1-13c-3.4-3.5-7.5-5.3-12.3-5.3\n\t\t\ts-8.9,1.8-12.3,5.3c-3.4,3.5-5.1,7.9-5.1,13c0,5.1,1.7,9.5,5,13.1c3.4,3.6,7.5,5.4,12.3,5.4c4.8,0,8.9-1.8,12.3-5.4\n\t\t\tC537.7,202.5,539.4,198.2,539.4,193z M559.3,241.1v-74.5h10.3v5c2.2-1.9,4.7-3.3,7.5-4.3c2.8-1,5.7-1.5,8.7-1.5c3.7,0,7.2,0.7,10.5,2.1\n\t\t\tc3.3,1.4,6.1,3.4,8.5,5.8c2.4,2.5,4.3,5.4,5.7,8.7c1.4,3.3,2.1,6.9,2.1,10.6c0,3.8-0.7,7.4-2.1,10.7c-1.4,3.3-3.3,6.2-5.7,8.7\n\t\t\tc-2.4,2.5-5.3,4.4-8.6,5.8c-3.3,1.4-6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5.4,0.7-7.8,2.2\n\t\t\tc-2.4,1.5-4.4,3.9-5.8,7.3v35.5H681.9z M743.7,219.5v-72.8h10.9v31.2h38.7v-31.2h10.9v72.8h-10.9v-31.7h-38.7v31.7H743.7z M828,166.6v31.5c0,4.1,1.2,7.3,3.5,9.8c2.4,2.4,5.6,3.6,9.7,3.6c2.8,0,5.3-0.6,7.5-1.8c2.2-1.2,4.1-2.9,5.5-5.1v-38.1\n\t\t\th10.4v52.9h-10.4v-5.3c-2.1,2.1-4.5,3.7-7.1,4.7c-2.7,1.1-5.6,1.6-8.8,1.6c-6,0-11-1.9-14.8-5.8c-3.8-3.9-5.8-8.8-5.8-14.9v-33.3\n\t\t\tH828z M929.9,193c0,3.8-0.7,7.4-2.1,10.7c-1.4,3.3-3.3,6.2-5.7,8.7c-2.4,2.5-5.3,4.4-8.6,5.8c-3.3,1.4-6.9,2.1-10.7,2.1\n\t\t\tc-3,0-5.8-0.5-8.5-1.4s-5.2-2.2-7.4-4v4.5h-10.3v-72.8l10.4-2.3v27c2.2-1.9,4.7-3.3,7.4-4.3c2.7-1,5.6-1.5,8.7-1.5\n\t\t\tc3.7,0,7.2,0.7,10.5,2.1c3.3,1.4,6.1,3.4,8.5,5.8c2.4,2.5,4.3,5.4,5.7,8.7C929.2,185.7,929.9,189.3,929.9,193z M901.7,174.8\n\t\t\tc-3.1,0-5.8,0.6-8.3,1.7c-2.5,1.1-4.6,2.6-6.3,4.6v24.1c1.7,1.9,3.8,3.4,6.3,4.5c2.6,1.1,5.3,1.7,8.3,1.7c5.1,0,9.4-1.8,12.8-5.3\n\t\t\tc3.4-3.5,5.1-7.8,5.1-12.9c0-5.2-1.8-9.6-5.3-13.1C911,176.6,906.7,174.8,901.7,174.8z\"\n />\n </g>\n </svg>\n );\n};\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"LogoFull.esm.js","sources":["../../src/components/LogoFull.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useTheme } from '@mui/material/styles';\n\nexport const LogoFull = (props: React.ComponentProps<'svg'>) => {\n const theme = useTheme();\n const isDarkMode = theme.palette.mode === 'dark';\n\n return (\n <svg\n viewBox=\"0 0 931.8 244\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"default-full-logo\"\n width=\"170\"\n {...props}\n >\n <path\n fill=\"#e00\"\n d=\"M129,85c12.5,0,30.6-2.6,30.6-17.5c0-1.2,0-2.3-0.3-3.4l-7.4-32.4c-1.7-7.1-3.2-10.3-15.7-16.6\n\t\t\t\tC126.4,10.2,105.3,2,99,2c-5.8,0-7.5,7.5-14.4,7.5c-6.7,0-11.6-5.6-17.9-5.6c-6,0-9.9,4.1-12.9,12.5c0,0-8.4,23.7-9.5,27.2\n\t\t\t\tC44,44.3,44,45,44,45.5C44,54.8,80.3,85,129,85 M161.5,73.6c1.7,8.2,1.7,9.1,1.7,10.1c0,14-15.7,21.8-36.4,21.8\n\t\t\t\tC80,105.5,39.1,78.1,39.1,60c0-2.8,0.6-5.4,1.5-7.3C23.8,53.5,2,56.5,2,75.7C2,107.2,76.6,146,135.7,146\n\t\t\t\tc45.3,0,56.7-20.5,56.7-36.6C192.3,96.6,181.4,82.2,161.5,73.6\"\n />\n <path\n fill=\"#000\"\n d=\"M161.5,73.6c1.7,8.2,1.7,9.1,1.7,10.1c0,14-15.7,21.8-36.4,21.8C80,105.5,39.1,78.1,39.1,60c0-2.8,0.6-5.4,1.5-7.3\n\t\t\t\tl3.7-9.1C44,44.3,44,45,44,45.5C44,54.8,80.3,85,129,85c12.5,0,30.6-2.6,30.6-17.5c0-1.2,0-2.3-0.3-3.4L161.5,73.6z\"\n />\n <g fill={isDarkMode ? '#fff' : '#000'}>\n <path\n d=\"M581.2,94.3c0,11.9,7.2,17.7,20.2,17.7c3.2,0,8.6-0.7,11.9-1.7V96.5c-2.8,0.8-4.9,1.2-7.7,1.2c-5.4,0-7.4-1.7-7.4-6.7\n\t\t\tV69.8h15.6V55.6h-15.6v-18l-17,3.7v14.3H570v14.2h11.3V94.3z M528.3,94.6c0-3.7,3.7-5.5,9.3-5.5c3.7,0,7,0.5,10.1,1.3v7.2\n\t\t\tc-3.2,1.8-6.8,2.6-10.6,2.6C531.6,100.2,528.3,98.1,528.3,94.6 M533.5,112.2c6,0,10.8-1.3,15.4-4.3v3.4h16.8V75.6\n\t\t\tc0-13.6-9.1-21-24.4-21c-8.5,0-16.9,2-26,6.1l6.1,12.5c6.5-2.7,12-4.4,16.8-4.4c7,0,10.6,2.7,10.6,8.3v2.7\n\t\t\tc-4-1.1-8.2-1.6-12.6-1.6c-14.3,0-22.9,6-22.9,16.7C513.3,104.7,521.1,112.2,533.5,112.2 M441.1,111.2h18.1V82.4h30.3v28.8h18.1\n\t\t\tV37.6h-18.1v28.3h-30.3V37.6h-18.1V111.2z M372.1,83.4c0-8,6.3-14.1,14.6-14.1c4.6,0,8.8,1.6,11.8,4.3V93c-3,2.9-7,4.4-11.8,4.4\n\t\t\tC378.5,97.5,372.1,91.4,372.1,83.4 M398.7,111.2h16.8V33.9l-17,3.7v20.9c-4.2-2.4-9-3.7-14.2-3.7c-16.2,0-28.9,12.5-28.9,28.5\n\t\t\tc0,16,12.5,28.6,28.4,28.6c5.5,0,10.6-1.7,14.9-4.8V111.2z M321.5,68.5c5.4,0,9.9,3.5,11.7,8.8H310\n\t\t\tC311.7,71.8,315.9,68.5,321.5,68.5 M292.8,83.5c0,16.2,13.3,28.8,30.3,28.8c9.4,0,16.2-2.5,23.2-8.4l-11.3-10\n\t\t\tc-2.6,2.7-6.5,4.2-11.1,4.2c-6.3,0-11.5-3.5-13.7-8.8h39.6V85c0-17.7-11.9-30.4-28.1-30.4C305.6,54.7,292.8,67.3,292.8,83.5\n\t\t\t M263.5,53.1c6,0,9.4,3.8,9.4,8.3s-3.4,8.3-9.4,8.3h-17.9V53.1H263.5z M227.5,111.2h18.1V84.4h13.8l13.9,26.8h20.2l-16.2-29.4\n\t\t\tc8.7-3.8,13.9-11.7,13.9-20.7c0-13.3-10.4-23.5-26-23.5h-37.7V111.2z\"\n />\n <path\n d=\"M228.7,219.5v-72.8h25.7c5.5,0,10.7,0.9,15.4,2.8c4.7,1.9,8.8,4.4,12.2,7.7c3.4,3.3,6,7.1,8,11.6\n\t\t\tc1.9,4.5,2.9,9.3,2.9,14.4c0,5.1-1,9.9-2.9,14.4c-1.9,4.4-4.6,8.3-8,11.5c-3.4,3.2-7.5,5.8-12.2,7.6c-4.7,1.9-9.8,2.8-15.4,2.8\n\t\t\tH228.7z M254.5,156.5h-15v53.2h15c3.8,0,7.4-0.7,10.7-2c3.3-1.4,6.1-3.2,8.5-5.6c2.4-2.4,4.3-5.2,5.7-8.4\n\t\t\tc1.4-3.2,2.1-6.7,2.1-10.5s-0.7-7.2-2.1-10.5c-1.4-3.3-3.3-6.1-5.7-8.5c-2.4-2.4-5.2-4.3-8.5-5.7\n\t\t\tC261.9,157.2,258.4,156.5,254.5,156.5z M300.7,193c0-3.7,0.7-7.3,2-10.6c1.4-3.3,3.2-6.2,5.6-8.7c2.4-2.5,5.2-4.4,8.4-5.8c3.2-1.4,6.7-2.1,10.5-2.1\n\t\t\tc3.6,0,7,0.7,10.1,2.1c3.2,1.4,5.9,3.4,8.1,5.8c2.3,2.5,4,5.4,5.4,8.8c1.3,3.4,2,7,2,10.9v3H311c0.7,4.4,2.7,8,6,10.9\n\t\t\tc3.3,2.9,7.3,4.3,11.9,4.3c2.6,0,5-0.4,7.4-1.2c2.4-0.8,4.4-2,6-3.4l6.7,6.6c-3.1,2.4-6.3,4.2-9.6,5.3c-3.3,1.1-6.9,1.7-10.9,1.7\n\t\t\tc-3.9,0-7.5-0.7-10.9-2.1c-3.4-1.4-6.3-3.3-8.8-5.8c-2.5-2.4-4.5-5.3-5.9-8.7C301.4,200.5,300.7,196.9,300.7,193z M327,174.5\n\t\t\tc-4,0-7.5,1.3-10.4,4c-2.9,2.6-4.8,6-5.5,10.2h31.4c-0.7-4-2.5-7.4-5.4-10.1C334.2,175.9,330.8,174.5,327,174.5z M377.7,219.5l-22.9-52.9h11.4l16.5,39.6l16.5-39.6h11.1l-22.9,52.9H377.7z M412.4,193c0-3.7,0.7-7.3,2-10.6c1.4-3.3,3.2-6.2,5.6-8.7c2.4-2.5,5.2-4.4,8.4-5.8c3.2-1.4,6.7-2.1,10.5-2.1\n\t\t\tc3.6,0,7,0.7,10.1,2.1c3.2,1.4,5.9,3.4,8.1,5.8c2.3,2.5,4,5.4,5.4,8.8c1.3,3.4,2,7,2,10.9v3h-41.8c0.7,4.4,2.7,8,6,10.9\n\t\t\tc3.3,2.9,7.3,4.3,11.9,4.3c2.6,0,5-0.4,7.4-1.2c2.4-0.8,4.4-2,6-3.4l6.7,6.6c-3.1,2.4-6.3,4.2-9.6,5.3c-3.3,1.1-6.9,1.7-10.9,1.7\n\t\t\tc-3.9,0-7.5-0.7-10.9-2.1c-3.4-1.4-6.3-3.3-8.8-5.8c-2.5-2.4-4.5-5.3-5.9-8.7C413.1,200.5,412.4,196.9,412.4,193z M438.7,174.5\n\t\t\tc-4,0-7.5,1.3-10.4,4c-2.9,2.6-4.8,6-5.5,10.2h31.4c-0.7-4-2.5-7.4-5.4-10.1C445.9,175.9,442.5,174.5,438.7,174.5z M484.7,144.5v75.1h-10.4v-72.8L484.7,144.5z M494.5,193c0-3.8,0.7-7.4,2.1-10.8c1.4-3.4,3.4-6.3,5.9-8.7c2.5-2.5,5.4-4.4,8.8-5.8c3.4-1.4,7-2.1,10.8-2.1\n\t\t\tc3.8,0,7.4,0.7,10.8,2.1c3.4,1.4,6.3,3.4,8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AA;AAAA,SAKJ;AAAA,wBACA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,IAAA,EAAK,MAAA;AAAA,YACL,CAAA,EAAE;AAAA;AAAA,SAEJ;AAAA,wBACA,IAAA,CAAC,GAAA,EAAA,EAAE,IAAA,EAAM,UAAA,GAAa,SAAS,MAAA,EAC7B,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,MAAA;AAAA,YAAA;AAAA,cACC,CAAA,EAAE;AAAA;AAAA,WAYJ;AAAA,0BACA,GAAA;AAAA,YAAC,MAAA;AAAA,YAAA;AAAA,cACC,CAAA,EAAE;AAAA;AAAA;AAkCJ,SAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogoIcon.esm.js","sources":["../../src/components/LogoIcon.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 */\nexport const LogoIcon = (props: React.ComponentProps<'svg'>) => {\n return (\n <svg\n viewBox=\"0 0 192 145\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"default-icon-logo\"\n width=\"28\"\n {...props}\n >\n <path\n fill=\"#000\"\n d=\"M157.77,62.61a14,14,0,0,1,.31,3.42c0,14.88-18.1,17.46-30.61,17.46C78.83,83.49,42.53,53.26,42.53,44a6.43,6.43,0,0,1,.22-1.94l-3.66,9.06a18.45,18.45,0,0,0-1.51,7.33c0,18.11,41,45.48,87.74,45.48,20.69,0,36.43-7.76,36.43-21.77,0-1.08,0-1.94-1.73-10.13Z\"\n />\n <path\n fill=\"#e00\"\n d=\"M127.47,83.49c12.51,0,30.61-2.58,30.61-17.46a14,14,0,0,0-.31-3.42l-7.45-32.36c-1.72-7.12-3.23-10.35-15.73-16.6C124.89,8.69,103.76.5,97.51.5,91.69.5,90,8,83.06,8c-6.68,0-11.64-5.6-17.89-5.6-6,0-9.91,4.09-12.93,12.5,0,0-8.41,23.72-9.49,27.16A6.43,6.43,0,0,0,42.53,44c0,9.22,36.3,39.45,84.94,39.45M160,72.07c1.73,8.19,1.73,9.05,1.73,10.13,0,14-15.74,21.77-36.43,21.77C78.54,104,37.58,76.6,37.58,58.49a18.45,18.45,0,0,1,1.51-7.33C22.27,52,.5,55,.5,74.22c0,31.48,74.59,70.28,133.65,70.28,45.28,0,56.7-20.48,56.7-36.65,0-12.72-11-27.16-30.83-35.78\"\n />\n </svg>\n );\n};\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"LogoIcon.esm.js","sources":["../../src/components/LogoIcon.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 */\nexport const LogoIcon = (props: React.ComponentProps<'svg'>) => {\n return (\n <svg\n viewBox=\"0 0 192 145\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"default-icon-logo\"\n width=\"28\"\n {...props}\n >\n <path\n fill=\"#000\"\n d=\"M157.77,62.61a14,14,0,0,1,.31,3.42c0,14.88-18.1,17.46-30.61,17.46C78.83,83.49,42.53,53.26,42.53,44a6.43,6.43,0,0,1,.22-1.94l-3.66,9.06a18.45,18.45,0,0,0-1.51,7.33c0,18.11,41,45.48,87.74,45.48,20.69,0,36.43-7.76,36.43-21.77,0-1.08,0-1.94-1.73-10.13Z\"\n />\n <path\n fill=\"#e00\"\n d=\"M127.47,83.49c12.51,0,30.61-2.58,30.61-17.46a14,14,0,0,0-.31-3.42l-7.45-32.36c-1.72-7.12-3.23-10.35-15.73-16.6C124.89,8.69,103.76.5,97.51.5,91.69.5,90,8,83.06,8c-6.68,0-11.64-5.6-17.89-5.6-6,0-9.91,4.09-12.93,12.5,0,0-8.41,23.72-9.49,27.16A6.43,6.43,0,0,0,42.53,44c0,9.22,36.3,39.45,84.94,39.45M160,72.07c1.73,8.19,1.73,9.05,1.73,10.13,0,14-15.74,21.77-36.43,21.77C78.54,104,37.58,76.6,37.58,58.49a18.45,18.45,0,0,1,1.51-7.33C22.27,52,.5,55,.5,74.22c0,31.48,74.59,70.28,133.65,70.28,45.28,0,56.7-20.48,56.7-36.65,0-12.72-11-27.16-30.83-35.78\"\n />\n </svg>\n );\n};\n"],"names":[],"mappings":";;AAeO,MAAM,QAAA,GAAW,CAAC,KAAA,KAAuC;AAC9D,EAAA,uBACE,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAQ,aAAA;AAAA,MACR,KAAA,EAAM,4BAAA;AAAA,MACN,aAAA,EAAY,mBAAA;AAAA,MACZ,KAAA,EAAM,IAAA;AAAA,MACL,GAAG,KAAA;AAAA,MAEJ,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,IAAA,EAAK,MAAA;AAAA,YACL,CAAA,EAAE;AAAA;AAAA,SACJ;AAAA,wBACA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,IAAA,EAAK,MAAA;AAAA,YACL,CAAA,EAAE;AAAA;AAAA;AACJ;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
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 type { ReactNode } 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: 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,yBAIG,
|
|
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 type { ReactNode } 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: 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,yBAIG,oBAAA,EAAA,EAAqB,KAAA,EACpB,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,aAAW,IAAA,EAC/B,QAAA,kBAAA,GAAA,CAACA,eAAA,EAAA,EAAa,KAAA,EAAO,MAAM,QAAA,CAAS,IAAI,CAAA,EACrC,QAAA,EACH,GACF,CAAA,EACF,CAAA;AAGK,MAAM,sBAAsB,CACjC,KAAA,KAEA,SAAS,iBAAA,CAAkB,EAAE,UAAS,EAAG;AACvC,EAAA,uBAAO,GAAA,CAAC,aAAA,EAAA,EAAc,KAAA,EAAe,QAAA,EAAS,CAAA;AAChD;AAEK,MAAM,oCAAoC,CAC/C,WAAA,KAEA,SAAS,+BAAA,CAAgC,EAAE,UAAS,EAAG;AACrD,EAAA,MAAM,KAAA,GAAQ,SAAS,WAAW,CAAA;AAClC,EAAA,uBAAO,GAAA,CAAC,aAAA,EAAA,EAAc,KAAA,EAAe,QAAA,EAAS,CAAA;AAChD;AAEK,MAAM,kCAAkC,CAC7C,SAAA,KAEA,SAAS,6BAAA,CAA8B,EAAE,UAAS,EAAG;AACnD,EAAA,MAAM,WAAA,GAAc,eAAe,SAAS,CAAA;AAC5C,EAAA,MAAM,KAAA,GAAQ,SAAS,WAAW,CAAA;AAClC,EAAA,uBAAO,GAAA,CAAC,aAAA,EAAA,EAAc,KAAA,EAAe,QAAA,EAAS,CAAA;AAChD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
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 darkThemeOverrides: Partial<ThemeConfigPalette> = {\n primary: {\n main: '#92c5f9',\n },\n secondary: {\n main: '#92c5f9',\n },\n navigation: {\n background: '#292929',\n indicator: 'transparent',\n color: '#ffffff',\n selectedColor: '#ffffff',\n navItem: {\n hoverBackground: '#292929',\n },\n submenu: {\n background: '#292929',\n },\n },\n text: {\n primary: '#ffffff',\n secondary: '#c7c7c7',\n },\n background: {\n default: '#292929',\n paper: '#292929',\n },\n rhdh: {\n general: {\n pageInset: '1.5rem',\n pageInsetBackgroundColor: '#151515',\n\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: '#292929',\n cardBorderColor: '#A3A3A3',\n\n mainSectionBackgroundColor: '#292929',\n formControlBackgroundColor: '#36373A',\n\n sidebarBackgroundColor: '#151515',\n sidebarDividerColor: '#383838',\n sidebarItemSelectedBackgroundColor: '#292929',\n\n tableTitleColor: '#E0E0E0',\n tableSubtitleColor: '#E0E0E0',\n tableColumnTitleColor: '#E0E0E0',\n tableRowHover: '#292929',\n tableBorderColor: '#515151',\n tableBackgroundColor: '#292929',\n tabsLinkHoverBackgroundColor: 'rgba(199, 199, 199, 0.1500)',\n\n contrastText: '#FFF',\n\n appBarBackgroundScheme: 'dark',\n\n appBarBackgroundColor: '#151515',\n appBarForegroundColor: '#ffffff',\n appBarBackgroundImage: 'none',\n\n starredItemsColor: '#F3BA37',\n },\n primary: {\n main: '#92c5f9',\n focusVisibleBorder: '#ADD6FF',\n },\n secondary: {\n main: '#92c5f9',\n focusVisibleBorder: '#ADD6FF',\n },\n cards: {\n headerTextColor: '#FFF',\n headerBackgroundColor: '#292929',\n headerBackgroundImage: 'none',\n },\n },\n};\n\nexport const customDarkTheme = (): ThemeConfigPalette => {\n const palette: (typeof palettes)['dark'] & PaletteOptions = palettes.dark;\n return {\n ...palette,\n ...darkThemeOverrides,\n };\n};\n"],"names":[],"mappings":";;AAqBO,MAAM,
|
|
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 darkThemeOverrides: Partial<ThemeConfigPalette> = {\n primary: {\n main: '#92c5f9',\n },\n secondary: {\n main: '#92c5f9',\n },\n navigation: {\n background: '#292929',\n indicator: 'transparent',\n color: '#ffffff',\n selectedColor: '#ffffff',\n navItem: {\n hoverBackground: '#292929',\n },\n submenu: {\n background: '#292929',\n },\n },\n text: {\n primary: '#ffffff',\n secondary: '#c7c7c7',\n },\n background: {\n default: '#292929',\n paper: '#292929',\n },\n rhdh: {\n general: {\n pageInset: '1.5rem',\n pageInsetBackgroundColor: '#151515',\n\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: '#292929',\n cardBorderColor: '#A3A3A3',\n\n mainSectionBackgroundColor: '#292929',\n formControlBackgroundColor: '#36373A',\n\n sidebarBackgroundColor: '#151515',\n sidebarDividerColor: '#383838',\n sidebarItemSelectedBackgroundColor: '#292929',\n\n tableTitleColor: '#E0E0E0',\n tableSubtitleColor: '#E0E0E0',\n tableColumnTitleColor: '#E0E0E0',\n tableRowHover: '#292929',\n tableBorderColor: '#515151',\n tableBackgroundColor: '#292929',\n tabsLinkHoverBackgroundColor: 'rgba(199, 199, 199, 0.1500)',\n\n contrastText: '#FFF',\n\n appBarBackgroundScheme: 'dark',\n\n appBarBackgroundColor: '#151515',\n appBarForegroundColor: '#ffffff',\n appBarBackgroundImage: 'none',\n\n starredItemsColor: '#F3BA37',\n },\n primary: {\n main: '#92c5f9',\n focusVisibleBorder: '#ADD6FF',\n },\n secondary: {\n main: '#92c5f9',\n focusVisibleBorder: '#ADD6FF',\n },\n cards: {\n headerTextColor: '#FFF',\n headerBackgroundColor: '#292929',\n headerBackgroundImage: 'none',\n },\n },\n};\n\nexport const customDarkTheme = (): ThemeConfigPalette => {\n const palette: (typeof palettes)['dark'] & PaletteOptions = palettes.dark;\n return {\n ...palette,\n ...darkThemeOverrides,\n };\n};\n"],"names":[],"mappings":";;AAqBO,MAAM,kBAAA,GAAkD;AAAA,EAC7D,OAAA,EAAS;AAAA,IACP,IAAA,EAAM;AAAA,GACR;AAAA,EACA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM;AAAA,GACR;AAAA,EACA,UAAA,EAAY;AAAA,IACV,UAAA,EAAY,SAAA;AAAA,IACZ,SAAA,EAAW,aAAA;AAAA,IACX,KAAA,EAAO,SAAA;AAAA,IACP,aAAA,EAAe,SAAA;AAAA,IACf,OAAA,EAAS;AAAA,MACP,eAAA,EAAiB;AAAA,KACnB;AAAA,IACA,OAAA,EAAS;AAAA,MACP,UAAA,EAAY;AAAA;AACd,GACF;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS,SAAA;AAAA,IACT,SAAA,EAAW;AAAA,GACb;AAAA,EACA,UAAA,EAAY;AAAA,IACV,OAAA,EAAS,SAAA;AAAA,IACT,KAAA,EAAO;AAAA,GACT;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS;AAAA,MACP,SAAA,EAAW,QAAA;AAAA,MACX,wBAAA,EAA0B,SAAA;AAAA,MAE1B,QAAA,EAAU,SAAA;AAAA,MACV,kBAAA,EAAoB,SAAA;AAAA,MAEpB,oBAAA,EAAsB,MAAA;AAAA,MACtB,gBAAA,EAAkB,SAAA;AAAA;AAAA,MAGlB,gBAAA,EACE,8EAAA;AAAA,MAEF,mBAAA,EAAqB,SAAA;AAAA,MACrB,eAAA,EAAiB,SAAA;AAAA,MAEjB,0BAAA,EAA4B,SAAA;AAAA,MAC5B,0BAAA,EAA4B,SAAA;AAAA,MAE5B,sBAAA,EAAwB,SAAA;AAAA,MACxB,mBAAA,EAAqB,SAAA;AAAA,MACrB,kCAAA,EAAoC,SAAA;AAAA,MAEpC,eAAA,EAAiB,SAAA;AAAA,MACjB,kBAAA,EAAoB,SAAA;AAAA,MACpB,qBAAA,EAAuB,SAAA;AAAA,MACvB,aAAA,EAAe,SAAA;AAAA,MACf,gBAAA,EAAkB,SAAA;AAAA,MAClB,oBAAA,EAAsB,SAAA;AAAA,MACtB,4BAAA,EAA8B,6BAAA;AAAA,MAE9B,YAAA,EAAc,MAAA;AAAA,MAEd,sBAAA,EAAwB,MAAA;AAAA,MAExB,qBAAA,EAAuB,SAAA;AAAA,MACvB,qBAAA,EAAuB,SAAA;AAAA,MACvB,qBAAA,EAAuB,MAAA;AAAA,MAEvB,iBAAA,EAAmB;AAAA,KACrB;AAAA,IACA,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,SAAA;AAAA,MACN,kBAAA,EAAoB;AAAA,KACtB;AAAA,IACA,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,SAAA;AAAA,MACN,kBAAA,EAAoB;AAAA,KACtB;AAAA,IACA,KAAA,EAAO;AAAA,MACL,eAAA,EAAiB,MAAA;AAAA,MACjB,qBAAA,EAAuB,SAAA;AAAA,MACvB,qBAAA,EAAuB;AAAA;AACzB;AAEJ;AAEO,MAAM,kBAAkB,MAA0B;AACvD,EAAA,MAAM,UAAsD,QAAA,CAAS,IAAA;AACrE,EAAA,OAAO;AAAA,IACL,GAAG,OAAA;AAAA,IACH,GAAG;AAAA,GACL;AACF;;;;"}
|
package/dist/fonts.esm.js.map
CHANGED
|
@@ -1 +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,
|
|
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,qBAAA,GAAwB;AAAA,EAC5B,UAAA,EAAY,eAAA;AAAA,EACZ,GAAA,EAAK,OAAO,aAAa,CAAA,4BAAA,CAAA;AAAA,EACzB,UAAA,EAAY,SAAA;AAAA,EACZ,SAAA,EAAW,QAAA;AAAA,EACX,WAAA,EAAa;AACf,CAAA;AAEA,MAAM,2BAAA,GAA8B;AAAA,EAClC,UAAA,EAAY,eAAA;AAAA,EACZ,GAAA,EAAK,OAAO,mBAAmB,CAAA,4BAAA,CAAA;AAAA,EAC/B,UAAA,EAAY,SAAA;AAAA,EACZ,SAAA,EAAW,QAAA;AAAA,EACX,WAAA,EAAa;AACf,CAAA;AAEO,MAAM,kBAAA,GAAqB;AAAA,EAChC,UAAA,EAAY,YAAA;AAAA,EACZ,GAAA,EAAK,OAAO,UAAU,CAAA,4BAAA,CAAA;AAAA,EACtB,UAAA,EAAY,SAAA;AAAA,EACZ,SAAA,EAAW,QAAA;AAAA,EACX,WAAA,EAAa;AACf;AAEA,MAAM,wBAAA,GAA2B;AAAA,EAC/B,UAAA,EAAY,YAAA;AAAA,EACZ,GAAA,EAAK,OAAO,gBAAgB,CAAA,4BAAA,CAAA;AAAA,EAC5B,UAAA,EAAY,SAAA;AAAA,EACZ,SAAA,EAAW,QAAA;AAAA,EACX,WAAA,EAAa;AACf,CAAA;AAEA,MAAM,kBAAA,GAAqB;AAAA,EACzB,UAAA,EAAY,YAAA;AAAA,EACZ,GAAA,EAAK,OAAO,UAAU,CAAA,4BAAA,CAAA;AAAA,EACtB,UAAA,EAAY,SAAA;AAAA,EACZ,SAAA,EAAW,QAAA;AAAA,EACX,WAAA,EAAa;AACf,CAAA;AAEA,MAAM,wBAAA,GAA2B;AAAA,EAC/B,UAAA,EAAY,YAAA;AAAA,EACZ,GAAA,EAAK,OAAO,gBAAgB,CAAA,4BAAA,CAAA;AAAA,EAC5B,UAAA,EAAY,SAAA;AAAA,EACZ,SAAA,EAAW,QAAA;AAAA,EACX,WAAA,EAAa;AACf,CAAA;AAEO,MAAM,eAAA,GAAkB;AAAA,EAC7B,qBAAA;AAAA,EACA,2BAAA;AAAA,EACA,kBAAA;AAAA,EACA,wBAAA;AAAA,EACA,kBAAA;AAAA,EACA;AACF;AAEO,MAAM,WAAA,GAAc;AAAA,EACzB,IAAA,EAAM;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,OAAA,EAAS;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,SAAA,EAAW;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;;;;"}
|
|
@@ -1 +1 @@
|
|
|
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 { useMemo } 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 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,
|
|
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 { useMemo } 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 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,SAAA,GAAmC,MAAA;AACvC,EAAA,IAAI;AAEF,IAAA,SAAA,GAAY,OAAO,YAAY,CAAA;AAAA,EACjC,SAAS,GAAA,EAAK;AAAA,EAEd;AACA,EAAA,OAAO,QAAQ,MAAM;AACnB,IAAA,MAAM,QAAA,GAAW,SAAA,EAAW,WAAA,CAAsB,cAAc,CAAA;AAChE,IAAA,OAAO,QAAA;AAAA,EACT,CAAA,EAAG,CAAC,SAAS,CAAC,CAAA;AAChB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
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 { useMemo } 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 = useMemo<UnifiedTheme>(\n () => createUnifiedTheme(unifiedThemeOptions),\n [unifiedThemeOptions],\n );\n return theme;\n};\n"],"names":[],"mappings":";;;;
|
|
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 { useMemo } 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 = useMemo<UnifiedTheme>(\n () => createUnifiedTheme(unifiedThemeOptions),\n [unifiedThemeOptions],\n );\n return theme;\n};\n"],"names":[],"mappings":";;;;AAsBO,MAAM,QAAA,GAAW,CAAC,WAAA,KAA2C;AAClE,EAAA,MAAM,mBAAA,GAAsB,gBAAgB,WAAW,CAAA;AACvD,EAAA,MAAM,KAAA,GAAQ,OAAA;AAAA,IACZ,MAAM,mBAAmB,mBAAmB,CAAA;AAAA,IAC5C,CAAC,mBAAmB;AAAA,GACtB;AACA,EAAA,OAAO,KAAA;AACT;;;;"}
|
|
@@ -1 +1 @@
|
|
|
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 { useMemo } 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 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":";;;
|
|
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 { useMemo } 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 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":";;;AAoBO,MAAM,cAAA,GAAiB,CAAC,SAAA,KAAmC;AAChE,EAAA,IAAI,SAAA,GAAmC,MAAA;AACvC,EAAA,IAAI;AAEF,IAAA,SAAA,GAAY,OAAkB,YAAY,CAAA;AAAA,EAC5C,SAAS,GAAA,EAAK;AAAA,EAEd;AACA,EAAA,OAAO,QAAQ,MAAM;AACnB,IAAA,IAAI,CAAC,SAAA,EAAW;AACd,MAAA,OAAO;AAAA,QACL,IAAA,EAAM,SAAA,CAAU,QAAA,CAAS,MAAM,IAAI,MAAA,GAAS;AAAA,OAC9C;AAAA,IACF;AACA,IAAA,MAAM,cACJ,SAAA,CAAU,WAAA,CAAyB,sBAAsB,SAAS,CAAA,CAAE,KACpE,EAAC;AACH,IAAA,IAAI,CAAC,YAAY,IAAA,EAAM;AACrB,MAAA,WAAA,CAAY,IAAA,GAAO,SAAA,CAAU,QAAA,CAAS,MAAM,IAAI,MAAA,GAAS,OAAA;AAAA,IAC3D;AAEA,IAAA,IAAI,MAAM,OAAA,CAAQ,WAAA,EAAa,SAAA,EAAW,OAAA,EAAS,SAAS,CAAA,EAAG;AAC7D,MAAA,WAAA,CAAY,UAAU,OAAA,CAAQ,SAAA,GAC5B,YAAY,SAAA,CAAU,OAAA,CAAQ,UAAU,CAAC,CAAA;AAAA,IAC7C;AAEA,IAAA,OAAO,WAAA;AAAA,EACT,CAAA,EAAG,CAAC,SAAA,EAAW,SAAS,CAAC,CAAA;AAC3B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
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 { useMemo } 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 = 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":";;;;;;;;
|
|
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 { useMemo } 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 = 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":";;;;;;;;AA2BO,MAAM,eAAA,GAAkB,CAC7B,WAAA,KACwB;AACxB,EAAA,MAAM,KAAA,GAAQ,QAA6B,MAAM;AAC/C,IAAA,MAAM,IAAA,GAAO,YAAY,IAAA,IAAQ,OAAA;AACjC,IAAA,MAAM,OAAA,GAAU,YAAY,OAAA,IAAW,MAAA;AAEvC,IAAA,IAAI,kBAAA;AACJ,IAAA,IAAI,YAAY,WAAA,EAAa;AAC3B,MAAA,kBAAA,GAAqBA,sBAAgC,IAAI,CAAA;AAAA,IAC3D,CAAA,MAAO;AACL,MAAA,kBAAA,GAAqBC,wBAA2B,IAAI,CAAA;AAAA,IACtD;AAEA,IAAA,MAAM,mBAAA,GAAsB,mBAAmB,WAAW,CAAA;AAC1D,IAAA,MAAM,iBAAA,GAAoB,wBAAA;AAAA,MACxB,kBAAA;AAAA,MACA;AAAA,KACF;AAEA,IAAA,MAAM,kBAAA,GAA0C;AAAA,MAC9C,SAAS,iBAAA,CAAkB,OAAA;AAAA,MAC3B,kBAAkB,iBAAA,CAAkB,gBAAA;AAAA,MACpC,YAAY,iBAAA,CAAkB,UAAA;AAAA,MAC9B,cAAc,iBAAA,CAAkB,YAAA;AAAA,MAChC,YAAY,iBAAA,CAAkB;AAAA,KAChC;AAEA,IAAA,kBAAA,CAAmB,SAAA,GAAY,iBAAiB,iBAAiB,CAAA;AAEjE,IAAA,IAAI,YAAY,WAAA,EAAa;AAC3B,MAAA,kBAAA,CAAmB,UAAA,GAAa,iBAAiB,iBAAiB,CAAA;AAAA,IACpE;AAEA,IAAA,OAAO,kBAAA;AAAA,EACT,CAAA,EAAG,CAAC,WAAW,CAAC,CAAA;AAChB,EAAA,OAAO,KAAA;AACT;;;;"}
|
|
@@ -1 +1 @@
|
|
|
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 lightThemeOverrides: Partial<ThemeConfigPalette> = {\n primary: {\n main: '#0066CC',\n },\n secondary: {\n main: '#0066CC',\n },\n navigation: {\n background: '#f2f2f2',\n indicator: 'transparent',\n color: '#151515',\n selectedColor: '#151515',\n navItem: {\n hoverBackground: '#ffffff',\n },\n submenu: {\n background: '#FFF',\n },\n },\n text: {\n primary: '#151515',\n secondary: '#757575',\n },\n background: {\n default: '#FFFFFF',\n paper: '#FFFFFF',\n },\n rhdh: {\n general: {\n pageInset: '1.5rem',\n pageInsetBackgroundColor: '#f2f2f2',\n\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 mainSectionBackgroundColor: '#FFF',\n formControlBackgroundColor: '#FFF',\n\n sidebarBackgroundColor: '#f2f2f2',\n sidebarDividerColor: '#c7c7c7',\n sidebarItemSelectedBackgroundColor: '#FFF',\n\n tableTitleColor: '#181818',\n tableSubtitleColor: '#616161',\n tableColumnTitleColor: '#151515',\n tableRowHover: '#F5F5F5',\n tableBorderColor: '#E0E0E0',\n tableBackgroundColor: '#FFF',\n tabsLinkHoverBackgroundColor: 'rgba(199, 199, 199, 0.2500)',\n\n contrastText: '#FFF',\n\n appBarBackgroundScheme: 'light',\n\n appBarBackgroundColor: '#f2f2f2',\n appBarForegroundColor: '#1f1f1f',\n appBarBackgroundImage: 'none',\n\n starredItemsColor: '#F3BA37',\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\nexport const customLightTheme = (): ThemeConfigPalette => {\n const palette: (typeof palettes)['light'] & PaletteOptions = palettes.light;\n return {\n ...palette,\n ...lightThemeOverrides,\n };\n};\n"],"names":[],"mappings":";;AAqBO,MAAM,
|
|
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 lightThemeOverrides: Partial<ThemeConfigPalette> = {\n primary: {\n main: '#0066CC',\n },\n secondary: {\n main: '#0066CC',\n },\n navigation: {\n background: '#f2f2f2',\n indicator: 'transparent',\n color: '#151515',\n selectedColor: '#151515',\n navItem: {\n hoverBackground: '#ffffff',\n },\n submenu: {\n background: '#FFF',\n },\n },\n text: {\n primary: '#151515',\n secondary: '#757575',\n },\n background: {\n default: '#FFFFFF',\n paper: '#FFFFFF',\n },\n rhdh: {\n general: {\n pageInset: '1.5rem',\n pageInsetBackgroundColor: '#f2f2f2',\n\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 mainSectionBackgroundColor: '#FFF',\n formControlBackgroundColor: '#FFF',\n\n sidebarBackgroundColor: '#f2f2f2',\n sidebarDividerColor: '#c7c7c7',\n sidebarItemSelectedBackgroundColor: '#FFF',\n\n tableTitleColor: '#181818',\n tableSubtitleColor: '#616161',\n tableColumnTitleColor: '#151515',\n tableRowHover: '#F5F5F5',\n tableBorderColor: '#E0E0E0',\n tableBackgroundColor: '#FFF',\n tabsLinkHoverBackgroundColor: 'rgba(199, 199, 199, 0.2500)',\n\n contrastText: '#FFF',\n\n appBarBackgroundScheme: 'light',\n\n appBarBackgroundColor: '#f2f2f2',\n appBarForegroundColor: '#1f1f1f',\n appBarBackgroundImage: 'none',\n\n starredItemsColor: '#F3BA37',\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\nexport const customLightTheme = (): ThemeConfigPalette => {\n const palette: (typeof palettes)['light'] & PaletteOptions = palettes.light;\n return {\n ...palette,\n ...lightThemeOverrides,\n };\n};\n"],"names":[],"mappings":";;AAqBO,MAAM,mBAAA,GAAmD;AAAA,EAC9D,OAAA,EAAS;AAAA,IACP,IAAA,EAAM;AAAA,GACR;AAAA,EACA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM;AAAA,GACR;AAAA,EACA,UAAA,EAAY;AAAA,IACV,UAAA,EAAY,SAAA;AAAA,IACZ,SAAA,EAAW,aAAA;AAAA,IACX,KAAA,EAAO,SAAA;AAAA,IACP,aAAA,EAAe,SAAA;AAAA,IACf,OAAA,EAAS;AAAA,MACP,eAAA,EAAiB;AAAA,KACnB;AAAA,IACA,OAAA,EAAS;AAAA,MACP,UAAA,EAAY;AAAA;AACd,GACF;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS,SAAA;AAAA,IACT,SAAA,EAAW;AAAA,GACb;AAAA,EACA,UAAA,EAAY;AAAA,IACV,OAAA,EAAS,SAAA;AAAA,IACT,KAAA,EAAO;AAAA,GACT;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS;AAAA,MACP,SAAA,EAAW,QAAA;AAAA,MACX,wBAAA,EAA0B,SAAA;AAAA,MAE1B,QAAA,EAAU,SAAA;AAAA,MACV,kBAAA,EAAoB,SAAA;AAAA,MAEpB,oBAAA,EAAsB,MAAA;AAAA,MACtB,gBAAA,EAAkB,SAAA;AAAA;AAAA,MAGlB,gBAAA,EACE,8EAAA;AAAA,MAEF,mBAAA,EAAqB,MAAA;AAAA,MACrB,eAAA,EAAiB,SAAA;AAAA,MAEjB,0BAAA,EAA4B,MAAA;AAAA,MAC5B,0BAAA,EAA4B,MAAA;AAAA,MAE5B,sBAAA,EAAwB,SAAA;AAAA,MACxB,mBAAA,EAAqB,SAAA;AAAA,MACrB,kCAAA,EAAoC,MAAA;AAAA,MAEpC,eAAA,EAAiB,SAAA;AAAA,MACjB,kBAAA,EAAoB,SAAA;AAAA,MACpB,qBAAA,EAAuB,SAAA;AAAA,MACvB,aAAA,EAAe,SAAA;AAAA,MACf,gBAAA,EAAkB,SAAA;AAAA,MAClB,oBAAA,EAAsB,MAAA;AAAA,MACtB,4BAAA,EAA8B,6BAAA;AAAA,MAE9B,YAAA,EAAc,MAAA;AAAA,MAEd,sBAAA,EAAwB,OAAA;AAAA,MAExB,qBAAA,EAAuB,SAAA;AAAA,MACvB,qBAAA,EAAuB,SAAA;AAAA,MACvB,qBAAA,EAAuB,MAAA;AAAA,MAEvB,iBAAA,EAAmB;AAAA,KACrB;AAAA,IACA,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,SAAA;AAAA,MACN,kBAAA,EAAoB;AAAA,KACtB;AAAA,IACA,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,SAAA;AAAA,MACN,kBAAA,EAAoB;AAAA,KACtB;AAAA,IACA,KAAA,EAAO;AAAA,MACL,eAAA,EAAiB,SAAA;AAAA,MACjB,qBAAA,EAAuB,MAAA;AAAA,MACvB,qBAAA,EAAuB;AAAA;AACzB;AAEJ;AAEO,MAAM,mBAAmB,MAA0B;AACxD,EAAA,MAAM,UAAuD,QAAA,CAAS,KAAA;AACtE,EAAA,OAAO;AAAA,IACL,GAAG,OAAA;AAAA,IACH,GAAG;AAAA,GACL;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-inject.es.esm.js","sources":["../../../../../../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":"AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"style-inject.es.esm.js","sources":["../../../../../../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":"AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,MAAM,GAAG,GAAG,GAAG,EAAE;AAChC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ;;AAE7B,EAAE,IAAY,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,CAAC;;AAEzD,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AAC7C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU;;AAEzB,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC;AAC/C,IAAI,CAAC,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC7B,IAAI;AACJ,EAAE,CAAC,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC3B,EAAE;;AAEF,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG;AAClC,EAAE,CAAC,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AACnD,EAAE;AACF;;;;","x_google_ignoreList":[0]}
|
package/dist/rhdh.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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' ? '#292929' : '#ffffff',\n fontColor: mode === 'dark' ? '#ffffff' : '#000000',\n },\n },\n options: {},\n };\n};\n"],"names":[],"mappings":";;;;;
|
|
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' ? '#292929' : '#ffffff',\n fontColor: mode === 'dark' ? '#ffffff' : '#000000',\n },\n },\n options: {},\n };\n};\n"],"names":[],"mappings":";;;;;AAsBO,MAAM,qBAAA,GAAwB,CAAC,IAAA,KAAwC;AAC5E,EAAA,MAAM,OAAA,GAAU,IAAA,KAAS,MAAA,GAAS,eAAA,KAAoB,gBAAA,EAAiB;AAEvE,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,MAAA;AAAA,IACT,IAAA,EAAM,IAAA,KAAS,MAAA,GAAS,MAAA,GAAS,OAAA;AAAA,IACjC,OAAA;AAAA,IACA,YAAY,WAAA,CAAY,IAAA;AAAA,IACxB,UAAA;AAAA,IACA,gBAAA,EAAkB,SAAA;AAAA,IAClB,SAAA,EAAW;AAAA,MACT,OAAA,EAAS;AAAA,QACP,eAAA,EAAiB,IAAA,KAAS,MAAA,GAAS,SAAA,GAAY,SAAA;AAAA,QAC/C,SAAA,EAAW,IAAA,KAAS,MAAA,GAAS,SAAA,GAAY;AAAA;AAC3C,KACF;AAAA,IACA,SAAS;AAAC,GACZ;AACF;;;;"}
|
package/dist/themes.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 { useMemo } from 'react';\nimport { AppTheme } from '@backstage/core-plugin-api';\nimport { themes } from '@backstage/theme';\n\nimport LightIcon from '@mui/icons-material/WbSunnyRounded';\nimport DarkIcon from '@mui/icons-material/Brightness2Rounded';\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 lightThemeProvider = createThemeProviderForThemeName('light');\n\nexport const darkThemeProvider = createThemeProviderForThemeName('dark');\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 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 useMemo(() => getThemes(), []);\n};\n\nexport const useLoaderTheme = () => {\n return 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":";;;;;;;;;;
|
|
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 { useMemo } from 'react';\nimport { AppTheme } from '@backstage/core-plugin-api';\nimport { themes } from '@backstage/theme';\n\nimport LightIcon from '@mui/icons-material/WbSunnyRounded';\nimport DarkIcon from '@mui/icons-material/Brightness2Rounded';\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 lightThemeProvider = createThemeProviderForThemeName('light');\n\nexport const darkThemeProvider = createThemeProviderForThemeName('dark');\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 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 useMemo(() => getThemes(), []);\n};\n\nexport const useLoaderTheme = () => {\n return 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,kBAAA,GAAqB,gCAAgC,OAAO;AAElE,MAAM,iBAAA,GAAoB,gCAAgC,MAAM;AAEhE,MAAM,eAAe,MAAkB;AAC5C,EAAA,OAAO;AAAA,IACL;AAAA,MACE,EAAA,EAAI,OAAA;AAAA,MACJ,KAAA,EAAO,qBAAA;AAAA,MACP,OAAA,EAAS,OAAA;AAAA,MACT,IAAA,sBAAO,SAAA,EAAA,EAAU,CAAA;AAAA,MACjB,QAAA,EAAU,gCAAgC,OAAO;AAAA,KACnD;AAAA,IACA;AAAA,MACE,EAAA,EAAI,MAAA;AAAA,MACJ,KAAA,EAAO,oBAAA;AAAA,MACP,OAAA,EAAS,MAAA;AAAA,MACT,IAAA,sBAAO,QAAA,EAAA,EAAS,CAAA;AAAA,MAChB,QAAA,EAAU,g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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,
|
|
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,UAAA,GAAkC;AAAA,EAC7C,YAAA,EAAc,EAAA;AAAA,EACd,YAAY,WAAA,CAAY,IAAA;AAAA,EACxB,EAAA,EAAI;AAAA,IACF,YAAY,WAAA,CAAY,OAAA;AAAA,IACxB,QAAA,EAAU,EAAA;AAAA,IACV,UAAA,EAAY,GAAA;AAAA,IACZ,YAAA,EAAc;AAAA,GAChB;AAAA,EACA,EAAA,EAAI;AAAA,IACF,YAAY,WAAA,CAAY,OAAA;AAAA,IACxB,QAAA,EAAU,EAAA;AAAA,IACV,UAAA,EAAY,GAAA;AAAA,IACZ,YAAA,EAAc;AAAA,GAChB;AAAA,EACA,EAAA,EAAI;AAAA,IACF,YAAY,WAAA,CAAY,OAAA;AAAA,IACxB,QAAA,EAAU,EAAA;AAAA,IACV,UAAA,EAAY,GAAA;AAAA,IACZ,YAAA,EAAc;AAAA,GAChB;AAAA,EACA,EAAA,EAAI;AAAA,IACF,YAAY,WAAA,CAAY,OAAA;AAAA,IACxB,QAAA,EAAU,EAAA;AAAA,IACV,UAAA,EAAY,GAAA;AAAA,IACZ,YAAA,EAAc;AAAA,GAChB;AAAA,EACA,EAAA,EAAI;AAAA,IACF,YAAY,WAAA,CAAY,OAAA;AAAA,IACxB,QAAA,EAAU,EAAA;AAAA,IACV,UAAA,EAAY,GAAA;AAAA,IACZ,YAAA,EAAc;AAAA,GAChB;AAAA,EACA,EAAA,EAAI;AAAA,IACF,YAAY,WAAA,CAAY,OAAA;AAAA,IACxB,QAAA,EAAU,EAAA;AAAA,IACV,UAAA,EAAY,GAAA;AAAA,IACZ,YAAA,EAAc;AAAA;AAElB;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defaultComponentThemes } from '@backstage/theme';
|
|
2
|
-
import {
|
|
2
|
+
import { redHatFonts, redHatFontFaces } from '../fonts.esm.js';
|
|
3
3
|
import { resolveNavigationSidebarColors } from './navigationSidebarColors.esm.js';
|
|
4
4
|
|
|
5
5
|
const createComponents = (themeConfig) => {
|
|
@@ -678,6 +678,15 @@ const createComponents = (themeConfig) => {
|
|
|
678
678
|
// Prevent overflow in the main container due to the margin
|
|
679
679
|
maxHeight: `calc(100vh - 2 * ${general.pageInset})`
|
|
680
680
|
},
|
|
681
|
+
// Prevent TechDocs double scrollbar: the page-inset max-height puts
|
|
682
|
+
// <main>'s scrollbar at the same position as the ToC sidebar scrollbar.
|
|
683
|
+
// Letting <main> expand moves the scroll to the parent root instead.
|
|
684
|
+
"& > main:has([data-testid='techdocs-native-shadowroot'])": {
|
|
685
|
+
height: "auto !important",
|
|
686
|
+
maxHeight: "none !important",
|
|
687
|
+
borderRadius: "1rem",
|
|
688
|
+
marginRight: "0.5rem"
|
|
689
|
+
},
|
|
681
690
|
// The Backstage suspense is an MUI LinearProgress that is not wrapped by
|
|
682
691
|
// a `main`. We need to give it 100vh height to fill the page for the page
|
|
683
692
|
// inset to look right.
|
|
@@ -1 +1 @@
|
|
|
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';\nimport { resolveNavigationSidebarColors } from './navigationSidebarColors';\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 RHDHPageWithoutFixHeight?: 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 \"[class*='BackstagePage-root-'] > [class*='MuiToolbar-root']\": {\n backgroundColor: theme.palette.background.paper,\n },\n };\n },\n };\n\n // MUI base\n if (options.buttons !== 'mui') {\n components.MuiTypography = {\n styleOverrides: {\n root: {\n fontFamily: redHatFonts.text,\n fontWeight: 'normal',\n letterSpacing: '0.01em',\n // This is required to override the default MUI styles\n // that set the `font-weight` to `500` for the `h1` element.\n '&.MuiTypography-h1': {\n fontWeight: 'normal',\n },\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 rounded: {\n '& > :last-child': {\n borderBottomLeftRadius: 16,\n borderBottomRightRadius: 16,\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 AppBar\n components.MuiAppBar = {\n styleOverrides: {\n root: {\n boxShadow: 'none',\n ...(options.appBar !== 'mui' && {\n backgroundColor: general.appBarBackgroundColor,\n backgroundImage: general.appBarBackgroundImage,\n outline: 'none',\n }),\n },\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 borderRadius: '3px',\n fontWeight: 'normal',\n },\n contained: {\n border: '0',\n borderRadius: '99em',\n boxShadow: 'none',\n '&:hover, &:focus-visible': {\n border: '0',\n boxShadow: 'none',\n },\n '&:-webkit-any-link:focus-visible': {\n outlineOffset: '0',\n },\n },\n containedPrimary: {\n borderRadius: '99em',\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 borderRadius: '99em',\n border: `1px solid color-mix(in srgb, currentColor 50%, transparent)`,\n '&:hover, &:focus-visible': {\n backgroundColor: 'transparent',\n border: `1px solid`,\n },\n '&:disabled': {\n color: general.disabled,\n backgroudColor: general.disabledBackground,\n border: `1px solid ${general.disabledBackground}`,\n },\n },\n outlinedPrimary: {\n '&:hover, &:focus-visible': {\n backgroundColor: 'transparent',\n },\n },\n outlinedSecondary: {\n '&:hover, &:focus-visible': {\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, &:focus-visible': {\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.checkbox !== '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 borderRadius: '16px',\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 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.paperBorderColor}`,\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.paperBorderColor}`,\n padding: 0,\n \"& span[class*='MuiTabs-indicator']\": {\n width: '3px',\n },\n },\n indicator: {\n left: 0,\n height: '3px',\n },\n },\n };\n components.MuiTab = {\n defaultProps: {\n disableRipple,\n },\n styleOverrides: {\n root: {\n fontWeight: '400',\n minWidth: 'initial !important',\n padding: '0.25em 1em',\n position: 'relative',\n textTransform: 'none',\n zIndex: 1,\n '&:before': {\n content: '\"\"',\n display: 'block',\n position: 'absolute',\n top: '0.75em',\n left: '0.5em',\n right: '0.5em',\n bottom: '0.75em',\n borderRadius: '4px',\n zIndex: -1,\n },\n '&.Mui-selected': {\n color: `${palette.text?.primary} !important`,\n },\n '&[class*=\"v5\"]': {\n lineHeight: 1.75,\n },\n '&:hover, &:focus-visible': {\n backgroundColor: 'transparent !important',\n '&:before': {\n backgroundColor: general.tabsLinkHoverBackgroundColor,\n },\n },\n '&:disabled': {\n color: general.disabled,\n '&:before': {\n backgroundColor: general.disabledBackground,\n },\n },\n },\n },\n };\n\n // MUI Breadcrumbs\n if (options.breadcrumbs !== 'mui') {\n components.MuiBreadcrumbs = {\n defaultProps: {\n separator: '>',\n },\n styleOverrides: {\n separator: {\n fontWeight: 'bold',\n },\n root: {\n fontWeight: '400',\n },\n li: {\n fontSize: '0.875rem !important',\n fontStyle: 'normal !important',\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: '0.875rem',\n fontWeight: '400',\n color: 'unset',\n padding: '0.25em 1em',\n },\n },\n };\n }\n\n if (options.sidebars !== 'mui') {\n const {\n sidebarBackgroundColor,\n sidebarItemInteractionBackgroundColor,\n navigationItemColor,\n navigationSelectedColor,\n } = resolveNavigationSidebarColors(themeConfig);\n\n components.BackstageSidebar = {\n styleOverrides: {\n drawer: {\n gap: '0.25rem',\n borderRight: `0.5rem solid ${sidebarBackgroundColor}`,\n paddingBottom: '1.5rem',\n backgroundColor: sidebarBackgroundColor,\n '& hr': {\n backgroundColor: general.sidebarDividerColor,\n },\n '#rhdh-sidebar-layout & a[aria-current=\"page\"], & a[aria-current=\"page\"]':\n {\n background: `${sidebarItemInteractionBackgroundColor} !important`,\n backgroundColor: `${sidebarItemInteractionBackgroundColor} !important`,\n color: `${navigationSelectedColor} !important`,\n '& .MuiTypography-root': {\n color: 'inherit !important',\n },\n },\n '& [class*=\"BackstageSidebarItem-selected-\"][class*=\"BackstageSidebarItem-root-\"]':\n {\n backgroundColor: `${sidebarItemInteractionBackgroundColor} !important`,\n color: `${navigationSelectedColor} !important`,\n },\n\n '& [class*=\"BackstageSidebarSubmenuItem-selected-\"]': {\n background: `${sidebarItemInteractionBackgroundColor} !important`,\n color: `${navigationSelectedColor} !important`,\n },\n },\n },\n };\n components.BackstageSidebarItem = {\n styleOverrides: {\n root: {\n borderRadius: '6px',\n width: 'calc(100% - 0.5rem) !important',\n marginLeft: '0.5rem !important',\n textDecorationLine: 'none',\n '&:hover, &:focus-visible': {\n backgroundColor: sidebarItemInteractionBackgroundColor,\n },\n },\n label: {\n '&[class*=\"MuiTypography-subtitle2\"]': {\n fontWeight: 'normal',\n },\n },\n selected: {\n backgroundColor: sidebarItemInteractionBackgroundColor,\n color: navigationSelectedColor,\n },\n },\n };\n components.MuiBottomNavigation = {\n styleOverrides: {\n root: {\n backgroundColor: `${sidebarBackgroundColor} !important`,\n borderColor: `${sidebarBackgroundColor} !important`,\n },\n },\n };\n components.MuiBottomNavigationAction = {\n defaultProps: {\n disableRipple,\n },\n styleOverrides: {\n root: {\n color: `${navigationItemColor} !important`,\n backgroundColor: `${sidebarBackgroundColor} !important`,\n borderRadius: '6px',\n borderTop: '3px solid transparent !important', // default mui selected styling\n paddingTop: '6px !important', // default mui selected styling\n marginTop: '-1px !important', // default mui selected styling\n '&:hover, &:focus-visible': {\n backgroundColor: `${sidebarItemInteractionBackgroundColor} !important`,\n },\n '&.Mui-selected': {\n backgroundColor: `${sidebarItemInteractionBackgroundColor} !important`,\n color: `${navigationSelectedColor} !important`,\n },\n },\n },\n };\n components.MuiDrawer = {\n styleOverrides: {\n root: {\n // undocumented Backstage makeStyles\n \"& [class*='makeStyles-overlay-']\": {\n backgroundColor: `${sidebarBackgroundColor} !important`,\n },\n '& hr': {\n backgroundColor: general.sidebarDividerColor,\n },\n },\n },\n };\n }\n\n if (options.pages !== 'mui') {\n components.RHDHPageWithoutFixHeight = {\n styleOverrides: {\n root: {\n // Cancel out the spacing produced by the page inset border when\n // the global header is present in the above-sidebar position.\n '@media (min-width: 600px)': {\n '#rhdh-above-sidebar-header-container:has(*) ~ #rhdh-sidebar-layout':\n {\n \"& main, & [class*='MuiLinearProgress-root']\": {\n marginTop: '0 !important',\n },\n },\n },\n },\n sidebarLayout: {\n // Cancel out the spacing produced by the page inset border when\n // the global header is present in the above-main-content position.\n '@media (min-width: 600px)': {\n '#rhdh-above-main-content-header-container:has(*)': {\n \"& ~ main, & ~ [class*='MuiLinearProgress-root']\": {\n marginTop: '0 !important',\n },\n },\n },\n },\n },\n };\n components.BackstageSidebarPage = {\n styleOverrides: {\n root: {\n // Controls the page inset as in PF6 -- only in desktop view\n '@media (min-width: 600px)': {\n backgroundColor:\n general.pageInsetBackgroundColor ?? general.appBarBackgroundColor,\n // Prevents the main content from scrolling weird\n overflowY: 'auto',\n // Cancel out the spacing produced by the page inset border when\n // the sidebar is present\n '& nav': {\n \"& ~ main, & ~ [class*='MuiLinearProgress-root']\": {\n marginLeft: '0 !important',\n },\n },\n \"& > [class*='MuiLinearProgress-root'], & > main\": {\n // clip-path clips the scrollbar properly in Chrome compared to\n // border-radius. 1rem is the hardcoded border-radius of the page content.\n clipPath: 'rect(0 100% 100% 0 round 1rem)',\n // Emulate the PatternFly 6 page inset using a margin\n margin: general.pageInset,\n // Prevent overflow in the main container due to the margin\n maxHeight: `calc(100vh - 2 * ${general.pageInset})`,\n },\n // The Backstage suspense is an MUI LinearProgress that is not wrapped by\n // a `main`. We need to give it 100vh height to fill the page for the page\n // inset to look right.\n \"& > [class*='MuiLinearProgress-root']\": {\n backgroundColor: general.mainSectionBackgroundColor,\n height: '100vh',\n \"& > [class*='MuiLinearProgress-']\": {\n height: '0.5rem !important',\n },\n },\n },\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 },\n title: {\n '&[class*=\"MuiTypography-h1-\"]': {\n fontWeight: '500',\n fontSize: '1.5rem',\n },\n },\n subtitle: {\n '&[class*=\"BackstageHeader-subtitle-\"]': {\n fontWeight: 'normal',\n fontSize: '0.875rem',\n opacity: 1,\n },\n },\n breadcrumb: {\n marginBottom: '0.5rem',\n },\n },\n };\n components.BreadcrumbsCurrentPage = {\n styleOverrides: {\n root: {\n '& p': {\n fontStyle: 'normal',\n fontSize: 'inherit',\n },\n },\n },\n };\n components.BackstageBreadcrumbsStyledBox = {\n styleOverrides: {\n root: {\n textDecoration: 'underline !important',\n color: palette.rhdh?.primary.main,\n '&:hover': {\n color: `color-mix(in srgb, ${palette.rhdh?.primary.main} 50%, ${palette.text?.primary})`,\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 zIndex: 1,\n },\n vertical: {\n width: '3px',\n },\n },\n };\n }\n\n return components;\n};\n"],"names":["backstageComponents"],"mappings":";;;;AA+Ca,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;AAA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,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,KAAA;AAAA,UACR,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';\nimport { resolveNavigationSidebarColors } from './navigationSidebarColors';\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 RHDHPageWithoutFixHeight?: 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 \"[class*='BackstagePage-root-'] > [class*='MuiToolbar-root']\": {\n backgroundColor: theme.palette.background.paper,\n },\n };\n },\n };\n\n // MUI base\n if (options.buttons !== 'mui') {\n components.MuiTypography = {\n styleOverrides: {\n root: {\n fontFamily: redHatFonts.text,\n fontWeight: 'normal',\n letterSpacing: '0.01em',\n // This is required to override the default MUI styles\n // that set the `font-weight` to `500` for the `h1` element.\n '&.MuiTypography-h1': {\n fontWeight: 'normal',\n },\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 rounded: {\n '& > :last-child': {\n borderBottomLeftRadius: 16,\n borderBottomRightRadius: 16,\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 AppBar\n components.MuiAppBar = {\n styleOverrides: {\n root: {\n boxShadow: 'none',\n ...(options.appBar !== 'mui' && {\n backgroundColor: general.appBarBackgroundColor,\n backgroundImage: general.appBarBackgroundImage,\n outline: 'none',\n }),\n },\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 borderRadius: '3px',\n fontWeight: 'normal',\n },\n contained: {\n border: '0',\n borderRadius: '99em',\n boxShadow: 'none',\n '&:hover, &:focus-visible': {\n border: '0',\n boxShadow: 'none',\n },\n '&:-webkit-any-link:focus-visible': {\n outlineOffset: '0',\n },\n },\n containedPrimary: {\n borderRadius: '99em',\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 borderRadius: '99em',\n border: `1px solid color-mix(in srgb, currentColor 50%, transparent)`,\n '&:hover, &:focus-visible': {\n backgroundColor: 'transparent',\n border: `1px solid`,\n },\n '&:disabled': {\n color: general.disabled,\n backgroudColor: general.disabledBackground,\n border: `1px solid ${general.disabledBackground}`,\n },\n },\n outlinedPrimary: {\n '&:hover, &:focus-visible': {\n backgroundColor: 'transparent',\n },\n },\n outlinedSecondary: {\n '&:hover, &:focus-visible': {\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, &:focus-visible': {\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.checkbox !== '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 borderRadius: '16px',\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 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.paperBorderColor}`,\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.paperBorderColor}`,\n padding: 0,\n \"& span[class*='MuiTabs-indicator']\": {\n width: '3px',\n },\n },\n indicator: {\n left: 0,\n height: '3px',\n },\n },\n };\n components.MuiTab = {\n defaultProps: {\n disableRipple,\n },\n styleOverrides: {\n root: {\n fontWeight: '400',\n minWidth: 'initial !important',\n padding: '0.25em 1em',\n position: 'relative',\n textTransform: 'none',\n zIndex: 1,\n '&:before': {\n content: '\"\"',\n display: 'block',\n position: 'absolute',\n top: '0.75em',\n left: '0.5em',\n right: '0.5em',\n bottom: '0.75em',\n borderRadius: '4px',\n zIndex: -1,\n },\n '&.Mui-selected': {\n color: `${palette.text?.primary} !important`,\n },\n '&[class*=\"v5\"]': {\n lineHeight: 1.75,\n },\n '&:hover, &:focus-visible': {\n backgroundColor: 'transparent !important',\n '&:before': {\n backgroundColor: general.tabsLinkHoverBackgroundColor,\n },\n },\n '&:disabled': {\n color: general.disabled,\n '&:before': {\n backgroundColor: general.disabledBackground,\n },\n },\n },\n },\n };\n\n // MUI Breadcrumbs\n if (options.breadcrumbs !== 'mui') {\n components.MuiBreadcrumbs = {\n defaultProps: {\n separator: '>',\n },\n styleOverrides: {\n separator: {\n fontWeight: 'bold',\n },\n root: {\n fontWeight: '400',\n },\n li: {\n fontSize: '0.875rem !important',\n fontStyle: 'normal !important',\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: '0.875rem',\n fontWeight: '400',\n color: 'unset',\n padding: '0.25em 1em',\n },\n },\n };\n }\n\n if (options.sidebars !== 'mui') {\n const {\n sidebarBackgroundColor,\n sidebarItemInteractionBackgroundColor,\n navigationItemColor,\n navigationSelectedColor,\n } = resolveNavigationSidebarColors(themeConfig);\n\n components.BackstageSidebar = {\n styleOverrides: {\n drawer: {\n gap: '0.25rem',\n borderRight: `0.5rem solid ${sidebarBackgroundColor}`,\n paddingBottom: '1.5rem',\n backgroundColor: sidebarBackgroundColor,\n '& hr': {\n backgroundColor: general.sidebarDividerColor,\n },\n '#rhdh-sidebar-layout & a[aria-current=\"page\"], & a[aria-current=\"page\"]':\n {\n background: `${sidebarItemInteractionBackgroundColor} !important`,\n backgroundColor: `${sidebarItemInteractionBackgroundColor} !important`,\n color: `${navigationSelectedColor} !important`,\n '& .MuiTypography-root': {\n color: 'inherit !important',\n },\n },\n '& [class*=\"BackstageSidebarItem-selected-\"][class*=\"BackstageSidebarItem-root-\"]':\n {\n backgroundColor: `${sidebarItemInteractionBackgroundColor} !important`,\n color: `${navigationSelectedColor} !important`,\n },\n\n '& [class*=\"BackstageSidebarSubmenuItem-selected-\"]': {\n background: `${sidebarItemInteractionBackgroundColor} !important`,\n color: `${navigationSelectedColor} !important`,\n },\n },\n },\n };\n components.BackstageSidebarItem = {\n styleOverrides: {\n root: {\n borderRadius: '6px',\n width: 'calc(100% - 0.5rem) !important',\n marginLeft: '0.5rem !important',\n textDecorationLine: 'none',\n '&:hover, &:focus-visible': {\n backgroundColor: sidebarItemInteractionBackgroundColor,\n },\n },\n label: {\n '&[class*=\"MuiTypography-subtitle2\"]': {\n fontWeight: 'normal',\n },\n },\n selected: {\n backgroundColor: sidebarItemInteractionBackgroundColor,\n color: navigationSelectedColor,\n },\n },\n };\n components.MuiBottomNavigation = {\n styleOverrides: {\n root: {\n backgroundColor: `${sidebarBackgroundColor} !important`,\n borderColor: `${sidebarBackgroundColor} !important`,\n },\n },\n };\n components.MuiBottomNavigationAction = {\n defaultProps: {\n disableRipple,\n },\n styleOverrides: {\n root: {\n color: `${navigationItemColor} !important`,\n backgroundColor: `${sidebarBackgroundColor} !important`,\n borderRadius: '6px',\n borderTop: '3px solid transparent !important', // default mui selected styling\n paddingTop: '6px !important', // default mui selected styling\n marginTop: '-1px !important', // default mui selected styling\n '&:hover, &:focus-visible': {\n backgroundColor: `${sidebarItemInteractionBackgroundColor} !important`,\n },\n '&.Mui-selected': {\n backgroundColor: `${sidebarItemInteractionBackgroundColor} !important`,\n color: `${navigationSelectedColor} !important`,\n },\n },\n },\n };\n components.MuiDrawer = {\n styleOverrides: {\n root: {\n // undocumented Backstage makeStyles\n \"& [class*='makeStyles-overlay-']\": {\n backgroundColor: `${sidebarBackgroundColor} !important`,\n },\n '& hr': {\n backgroundColor: general.sidebarDividerColor,\n },\n },\n },\n };\n }\n\n if (options.pages !== 'mui') {\n components.RHDHPageWithoutFixHeight = {\n styleOverrides: {\n root: {\n // Cancel out the spacing produced by the page inset border when\n // the global header is present in the above-sidebar position.\n '@media (min-width: 600px)': {\n '#rhdh-above-sidebar-header-container:has(*) ~ #rhdh-sidebar-layout':\n {\n \"& main, & [class*='MuiLinearProgress-root']\": {\n marginTop: '0 !important',\n },\n },\n },\n },\n sidebarLayout: {\n // Cancel out the spacing produced by the page inset border when\n // the global header is present in the above-main-content position.\n '@media (min-width: 600px)': {\n '#rhdh-above-main-content-header-container:has(*)': {\n \"& ~ main, & ~ [class*='MuiLinearProgress-root']\": {\n marginTop: '0 !important',\n },\n },\n },\n },\n },\n };\n components.BackstageSidebarPage = {\n styleOverrides: {\n root: {\n // Controls the page inset as in PF6 -- only in desktop view\n '@media (min-width: 600px)': {\n backgroundColor:\n general.pageInsetBackgroundColor ?? general.appBarBackgroundColor,\n // Prevents the main content from scrolling weird\n overflowY: 'auto',\n // Cancel out the spacing produced by the page inset border when\n // the sidebar is present\n '& nav': {\n \"& ~ main, & ~ [class*='MuiLinearProgress-root']\": {\n marginLeft: '0 !important',\n },\n },\n \"& > [class*='MuiLinearProgress-root'], & > main\": {\n // clip-path clips the scrollbar properly in Chrome compared to\n // border-radius. 1rem is the hardcoded border-radius of the page content.\n clipPath: 'rect(0 100% 100% 0 round 1rem)',\n // Emulate the PatternFly 6 page inset using a margin\n margin: general.pageInset,\n // Prevent overflow in the main container due to the margin\n maxHeight: `calc(100vh - 2 * ${general.pageInset})`,\n },\n // Prevent TechDocs double scrollbar: the page-inset max-height puts\n // <main>'s scrollbar at the same position as the ToC sidebar scrollbar.\n // Letting <main> expand moves the scroll to the parent root instead.\n \"& > main:has([data-testid='techdocs-native-shadowroot'])\": {\n height: 'auto !important',\n maxHeight: 'none !important',\n borderRadius: '1rem',\n marginRight: '0.5rem',\n },\n // The Backstage suspense is an MUI LinearProgress that is not wrapped by\n // a `main`. We need to give it 100vh height to fill the page for the page\n // inset to look right.\n \"& > [class*='MuiLinearProgress-root']\": {\n backgroundColor: general.mainSectionBackgroundColor,\n height: '100vh',\n \"& > [class*='MuiLinearProgress-']\": {\n height: '0.5rem !important',\n },\n },\n },\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 },\n title: {\n '&[class*=\"MuiTypography-h1-\"]': {\n fontWeight: '500',\n fontSize: '1.5rem',\n },\n },\n subtitle: {\n '&[class*=\"BackstageHeader-subtitle-\"]': {\n fontWeight: 'normal',\n fontSize: '0.875rem',\n opacity: 1,\n },\n },\n breadcrumb: {\n marginBottom: '0.5rem',\n },\n },\n };\n components.BreadcrumbsCurrentPage = {\n styleOverrides: {\n root: {\n '& p': {\n fontStyle: 'normal',\n fontSize: 'inherit',\n },\n },\n },\n };\n components.BackstageBreadcrumbsStyledBox = {\n styleOverrides: {\n root: {\n textDecoration: 'underline !important',\n color: palette.rhdh?.primary.main,\n '&:hover': {\n color: `color-mix(in srgb, ${palette.rhdh?.primary.main} 50%, ${palette.text?.primary})`,\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 zIndex: 1,\n },\n vertical: {\n width: '3px',\n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A,EAAU;AAAA,UACR,KAAA,EAAO;AAAA;AACT;AACF,KACF;AAAA,EACF;AAEA,EAAA,OAAO,UAAA;AACT;;;;"}
|
|
@@ -1 +1 @@
|
|
|
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":";;
|
|
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":";;AAsCO,MAAM,eAAA,GAAkB,CAC7B,eAAA,KACc;AACd,EAAA,IAAI,MAAA,GAAS,eAAA,CAAgB,eAAA,IAAmB,eAAA,CAAgB,MAAA;AAChE,EAAA,IAAI,OAAO,WAAW,QAAA,EAAU;AAC9B,IAAA,MAAA,GAAS,CAAC,MAAM,CAAA;AAAA,EAClB,CAAA,MAAA,IAAW,CAAC,MAAA,EAAQ,MAAA,EAAQ;AAC1B,IAAA,MAAA,GAAS,CAAC,aAAa,CAAA;AAAA,EACzB;AAEA,EAAA,IAAI,KAAA,GACF,gBAAgB,eAAA,IAChB,MAAA,CAAO,gBAAgB,KAAe,CAAA,IACtC,gBAAgB,KAAA,IAChB,MAAA;AACF,EAAA,IACE,KAAA,CAAM,UAAA,CAAW,OAAO,CAAA,IACxB,MAAM,UAAA,CAAW,SAAS,CAAA,IAC1B,KAAA,CAAM,WAAW,UAAU,CAAA,IAC3B,KAAA,CAAM,UAAA,CAAW,GAAG,CAAA,EACpB;AACA,IAAA,KAAA,GAAQ,QAAQ,KAAK,CAAA,EAAA,CAAA;AAAA,EACvB,CAAA,MAAA,IAAW,MAAM,UAAA,CAAW,MAAM,KAAK,KAAA,CAAM,QAAA,CAAS,GAAG,CAAA,EAAG;AAC1D,IAAA,KAAA,GAAQ,CAAA,wBAAA,EAA2B,kBAAA,CAAmB,KAAK,CAAC,CAAA,EAAA,CAAA;AAAA,EAC9D;AAGA,EAAA,OAAO,YAAA,CAAa;AAAA,IAClB,MAAA;AAAA,IACA,KAAA;AAAA,IACA,OAAA,EAAS;AAAA,MACP,WAAW,eAAA,CAAgB;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
|
|
5
|
+
return void 0;
|
|
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 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":";;
|
|
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":";;AAoBO,MAAM,gBAAA,GAAmB,CAC9B,WAAA,KAC0C;AAC1C,EAAA,IAAI,CAAC,aAAa,SAAA,IAAa,CAAC,OAAO,IAAA,CAAK,WAAA,CAAY,SAAS,CAAA,CAAE,MAAA,EAAQ;AACzE,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,MAAM,aAAwC,EAAC;AAE/C,EAAA,KAAA,MAAW,IAAA,IAAQ,YAAY,SAAA,EAAW;AACxC,IAAA,IAAI,MAAA,CAAO,MAAA,CAAO,WAAA,CAAY,SAAA,EAAW,IAAI,CAAA,EAAG;AAC9C,MAAA,UAAA,CAAW,IAAI,CAAA,GAAI,eAAA,CAAgB,WAAA,CAAY,SAAA,CAAU,IAAI,CAAC,CAAA;AAAA,IAChE;AAAA,EACF;AAEA,EAAA,OAAO,UAAA;AACT;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function isObject(objectOrValue) {
|
|
2
|
-
return objectOrValue !==
|
|
2
|
+
return objectOrValue !== void 0 && 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 !==
|
|
37
|
+
return customValue !== void 0 ? 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 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,
|
|
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,aAAA,EAC0C;AAC1C,EAAA,OACE,aAAA,KAAkB,MAAA,IAClB,aAAA,KAAkB,IAAA,IAClB,OAAO,kBAAkB,QAAA,IACzB,CAAC,KAAA,CAAM,OAAA,CAAQ,aAAa,CAAA;AAEhC;AAEA,MAAM,cAAA,GAAiB,CAAC,aAAA,KAAoC;AAC1D,EAAA,IAAI,QAAA,CAAS,aAAa,CAAA,EAAG;AAC3B,IAAA,MAAM,SAAkC,EAAC;AACzC,IAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,IAAA,CAAK,aAAa,CAAA,EAAG;AAC5C,MAAA,MAAA,CAAO,GAAG,CAAA,GAAI,cAAA,CAAe,aAAA,CAAc,GAAG,CAAC,CAAA;AAAA,IACjD;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAO,aAAA;AACT,CAAA;AAEO,MAAM,gBAAA,GAAmB,CAC9B,YAAA,EACA,WAAA,KACY;AACZ,EAAA,IAAI,QAAA,CAAS,YAAY,CAAA,IAAK,QAAA,CAAS,WAAW,CAAA,EAAG;AACnD,IAAA,MAAM,SAAkC,EAAC;AACzC,IAAA,IAAI,QAAA,CAAS,YAAY,CAAA,IAAK,QAAA,CAAS,WAAW,CAAA,EAAG;AACnD,MAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,IAAA,CAAK,YAAY,CAAA,EAAG;AAC3C,QAAA,MAAA,CAAO,GAAG,IAAI,gBAAA,CAAiB,YAAA,CAAa,GAAG,CAAA,EAAG,WAAA,CAAY,GAAG,CAAC,CAAA;AAAA,MACpE;AACA,MAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,IAAA,CAAK,WAAW,CAAA,EAAG;AAC1C,QAAA,MAAA,CAAO,GAAG,IAAI,gBAAA,CAAiB,YAAA,CAAa,GAAG,CAAA,EAAG,WAAA,CAAY,GAAG,CAAC,CAAA;AAAA,MACpE;AAAA,IACF,CAAA,MAAA,IAAW,gBAAgB,IAAA,EAAM;AAC/B,MAAA,OAAO,IAAA;AAAA,IACT,CAAA,MAAA,IAAW,QAAA,CAAS,WAAW,CAAA,EAAG;AAChC,MAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,IAAA,CAAK,WAAW,CAAA,EAAG;AAC1C,QAAA,MAAA,CAAO,GAAG,CAAA,GAAI,cAAA,CAAe,WAAA,CAAY,GAAG,CAAC,CAAA;AAAA,MAC/C;AAAA,IACF,CAAA,MAAA,IAAW,QAAA,CAAS,YAAY,CAAA,EAAG;AACjC,MAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,IAAA,CAAK,YAAY,CAAA,EAAG;AAC3C,QAAA,MAAA,CAAO,GAAG,CAAA,GAAI,cAAA,CAAe,YAAA,CAAa,GAAG,CAAC,CAAA;AAAA,MAChD;AAAA,IACF;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAO,WAAA,KAAgB,SAAY,WAAA,GAAc,YAAA;AACnD;AAiBO,MAAM,wBAAA,GAA2B,CACtC,kBAAA,EACA,qBAAA,KACgB;AAChB,EAAA,OAAO,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 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,
|
|
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,aAAA,EAC0C;AAC1C,EAAA,OAAO,OAAO,aAAA,KAAkB,QAAA,IAAY,CAAC,KAAA,CAAM,QAAQ,aAAa,CAAA;AAC1E;AAEO,MAAM,kBAAA,GAAqB,CAChC,WAAA,KACgB;AAChB,EAAA,IAAI,CAAC,WAAA,EAAa;AAChB,IAAA,OAAO,EAAE,OAAA,EAAS,EAAC,EAAE;AAAA,EACvB;AAGA,EAAA,MAAM,QAAA,GAAwB;AAAA,IAC5B,OAAA,EAAS,WAAA,CAAY,OAAA,IAAW,EAAC;AAAA,IACjC,kBAAkB,WAAA,CAAY,gBAAA;AAAA,IAC9B,WAAW,WAAA,CAAY,SAAA;AAAA,IACvB,YAAY,WAAA,CAAY,UAAA;AAAA,IACxB,cAAc,WAAA,CAAY,YAAA;AAAA,IAC1B,YAAY,WAAA,CAAY,UAAA;AAAA,I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AS,gBAAA,GAAmB,MAAA;AAC5B,MAAA,QAAA,CAAS,SAAA,GAAY;AAAA,QACnB,IAAA,EAAM;AAAA,UACJ,eAAA,EAAiB,CAAC,WAAA,CAAY,YAAA,GAC1B,WAAA,CAAY,eACZ,CAAC,WAAA,CAAY,YAAA,EAAc,WAAA,CAAY,YAAY;AAAA;AACzD,OACF;AAAA,IACF;AAAA,EACF;AAEA,EAAA,OAAO,QAAA;AACT;;;;"}
|
|
@@ -26,11 +26,11 @@ function pickNavigationOrRhdhGeneralColor(themeConfig, palette, pick) {
|
|
|
26
26
|
}
|
|
27
27
|
const defaultNav = defaultNavigationColor(baseline);
|
|
28
28
|
const defaultRhdh = defaultRhdhGeneralColor(baseline);
|
|
29
|
-
if (defaultNav ===
|
|
29
|
+
if (defaultNav === void 0 && defaultRhdh === void 0) {
|
|
30
30
|
return fromRhdh || fromNavigation || "";
|
|
31
31
|
}
|
|
32
|
-
const navigationCustomized = fromNavigation !==
|
|
33
|
-
const rhdhCustomized = fromRhdh !==
|
|
32
|
+
const navigationCustomized = fromNavigation !== void 0 && fromNavigation !== defaultNav;
|
|
33
|
+
const rhdhCustomized = fromRhdh !== void 0 && fromRhdh !== defaultRhdh;
|
|
34
34
|
if (navigationCustomized && !rhdhCustomized) {
|
|
35
35
|
return fromNavigation;
|
|
36
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigationSidebarColors.esm.js","sources":["../../src/utils/navigationSidebarColors.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 * as backstage from '../backstage';\nimport * as rhdh from '../rhdh';\nimport {\n type RHDHThemePalette,\n type ThemeConfig,\n type ThemeConfigPalette,\n} from '../types';\n\nfunction baselinePalette(\n themeConfig: ThemeConfig,\n): ThemeConfigPalette | undefined {\n const mode = themeConfig.mode ?? 'light';\n const variant = themeConfig.variant ?? 'rhdh';\n const baseline =\n variant === 'backstage'\n ? backstage.getDefaultThemeConfig(mode)\n : rhdh.getDefaultThemeConfig(mode);\n return baseline.palette as ThemeConfigPalette | undefined;\n}\n\nfunction hasRhdhGeneral(\n baseline: ThemeConfigPalette | undefined,\n palette: ThemeConfigPalette,\n): boolean {\n return !!baseline?.rhdh?.general || !!palette.rhdh?.general;\n}\n\n/**\n * One conceptual color can be set in two places in the merged theme:\n * - Backstage: `palette.navigation…`\n * - RHDH: `palette.rhdh.general…`\n *\n * We load the **default** palette for this mode/variant and compare:\n * - If only the Backstage value differs from its default → use Backstage (user\n * likely customized `navigation` in app config).\n * - If only the RHDH value differs from its default → use RHDH.\n * - If both differ and disagree → prefer **RHDH**.\n */\ntype NavigationVsRhdhGeneralPick = {\n /** Current merged `palette.navigation…` color. */\n navigationColor: string | undefined;\n /** Current merged `palette.rhdh.general…` color. */\n rhdhGeneralColor: string | undefined;\n /** That same navigation field on the **default** theme (for this mode). */\n defaultNavigationColor: (baseline: ThemeConfigPalette) => string | undefined;\n /** That same RHDH general field on the **default** theme. */\n defaultRhdhGeneralColor: (baseline: ThemeConfigPalette) => string | undefined;\n};\n\nfunction pickNavigationOrRhdhGeneralColor(\n themeConfig: ThemeConfig,\n palette: ThemeConfigPalette,\n pick: NavigationVsRhdhGeneralPick,\n): string {\n const {\n navigationColor: fromNavigation,\n rhdhGeneralColor: fromRhdh,\n defaultNavigationColor,\n defaultRhdhGeneralColor,\n } = pick;\n\n const baseline = baselinePalette(themeConfig);\n if (!baseline) {\n return fromRhdh || fromNavigation || '';\n }\n if (!hasRhdhGeneral(baseline, palette)) {\n return fromNavigation || fromRhdh || '';\n }\n\n const defaultNav = defaultNavigationColor(baseline);\n const defaultRhdh = defaultRhdhGeneralColor(baseline);\n\n if (defaultNav === undefined && defaultRhdh === undefined) {\n return fromRhdh || fromNavigation || '';\n }\n\n const navigationCustomized =\n fromNavigation !== undefined && fromNavigation !== defaultNav;\n const rhdhCustomized = fromRhdh !== undefined && fromRhdh !== defaultRhdh;\n\n if (navigationCustomized && !rhdhCustomized) {\n return fromNavigation!;\n }\n if (rhdhCustomized && !navigationCustomized) {\n return fromRhdh!;\n }\n if (navigationCustomized && rhdhCustomized && fromNavigation !== fromRhdh) {\n return fromRhdh ?? fromNavigation ?? '';\n }\n return fromRhdh || fromNavigation || '';\n}\n\nexport type NavigationSidebarChrome = {\n /** `navigation.background` and `rhdh.general.sidebarBackgroundColor` */\n sidebarBackgroundColor: string;\n /** `navigation.navItem.hoverBackground` and `sidebarItemSelectedBackgroundColor` */\n sidebarItemInteractionBackgroundColor: string;\n /** `navigation.color` (fallback: `text.primary`) */\n navigationItemColor: string;\n /** `navigation.selectedColor` (fallback: `navigation.color`, then `text.primary`) */\n navigationSelectedColor: string;\n};\n\n/**\n * Resolves all navigation/sidebar chrome colors for RHDH component overrides.\n */\nexport function resolveNavigationSidebarColors(\n themeConfig: ThemeConfig,\n): NavigationSidebarChrome {\n const palette = (themeConfig.palette ?? {}) as ThemeConfigPalette;\n const general = palette.rhdh?.general ?? ({} as RHDHThemePalette['general']);\n const textPrimary = palette.text?.primary ?? '';\n\n const navigationItemColor = palette.navigation?.color ?? textPrimary;\n const navigationSelectedColor =\n palette.navigation?.selectedColor ??\n palette.navigation?.color ??\n textPrimary;\n\n /** `themeConfig` + `palette` fixed; only pass which navigation vs RHDH fields to compare. */\n const pickNavigationColor = (fields: NavigationVsRhdhGeneralPick) =>\n pickNavigationOrRhdhGeneralColor(themeConfig, palette, fields);\n\n return {\n sidebarBackgroundColor: pickNavigationColor({\n navigationColor: palette.navigation?.background,\n rhdhGeneralColor: general.sidebarBackgroundColor,\n defaultNavigationColor: b => b.navigation?.background,\n defaultRhdhGeneralColor: b => b.rhdh?.general?.sidebarBackgroundColor,\n }),\n sidebarItemInteractionBackgroundColor: pickNavigationColor({\n navigationColor: palette.navigation?.navItem?.hoverBackground,\n rhdhGeneralColor: general.sidebarItemSelectedBackgroundColor,\n defaultNavigationColor: b => b.navigation?.navItem?.hoverBackground,\n defaultRhdhGeneralColor: b =>\n b.rhdh?.general?.sidebarItemSelectedBackgroundColor,\n }),\n navigationItemColor,\n navigationSelectedColor,\n };\n}\n"],"names":["backstage.getDefaultThemeConfig","rhdh.getDefaultThemeConfig"],"mappings":";;;AAwBA,SAAS,gBACP,
|
|
1
|
+
{"version":3,"file":"navigationSidebarColors.esm.js","sources":["../../src/utils/navigationSidebarColors.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 * as backstage from '../backstage';\nimport * as rhdh from '../rhdh';\nimport {\n type RHDHThemePalette,\n type ThemeConfig,\n type ThemeConfigPalette,\n} from '../types';\n\nfunction baselinePalette(\n themeConfig: ThemeConfig,\n): ThemeConfigPalette | undefined {\n const mode = themeConfig.mode ?? 'light';\n const variant = themeConfig.variant ?? 'rhdh';\n const baseline =\n variant === 'backstage'\n ? backstage.getDefaultThemeConfig(mode)\n : rhdh.getDefaultThemeConfig(mode);\n return baseline.palette as ThemeConfigPalette | undefined;\n}\n\nfunction hasRhdhGeneral(\n baseline: ThemeConfigPalette | undefined,\n palette: ThemeConfigPalette,\n): boolean {\n return !!baseline?.rhdh?.general || !!palette.rhdh?.general;\n}\n\n/**\n * One conceptual color can be set in two places in the merged theme:\n * - Backstage: `palette.navigation…`\n * - RHDH: `palette.rhdh.general…`\n *\n * We load the **default** palette for this mode/variant and compare:\n * - If only the Backstage value differs from its default → use Backstage (user\n * likely customized `navigation` in app config).\n * - If only the RHDH value differs from its default → use RHDH.\n * - If both differ and disagree → prefer **RHDH**.\n */\ntype NavigationVsRhdhGeneralPick = {\n /** Current merged `palette.navigation…` color. */\n navigationColor: string | undefined;\n /** Current merged `palette.rhdh.general…` color. */\n rhdhGeneralColor: string | undefined;\n /** That same navigation field on the **default** theme (for this mode). */\n defaultNavigationColor: (baseline: ThemeConfigPalette) => string | undefined;\n /** That same RHDH general field on the **default** theme. */\n defaultRhdhGeneralColor: (baseline: ThemeConfigPalette) => string | undefined;\n};\n\nfunction pickNavigationOrRhdhGeneralColor(\n themeConfig: ThemeConfig,\n palette: ThemeConfigPalette,\n pick: NavigationVsRhdhGeneralPick,\n): string {\n const {\n navigationColor: fromNavigation,\n rhdhGeneralColor: fromRhdh,\n defaultNavigationColor,\n defaultRhdhGeneralColor,\n } = pick;\n\n const baseline = baselinePalette(themeConfig);\n if (!baseline) {\n return fromRhdh || fromNavigation || '';\n }\n if (!hasRhdhGeneral(baseline, palette)) {\n return fromNavigation || fromRhdh || '';\n }\n\n const defaultNav = defaultNavigationColor(baseline);\n const defaultRhdh = defaultRhdhGeneralColor(baseline);\n\n if (defaultNav === undefined && defaultRhdh === undefined) {\n return fromRhdh || fromNavigation || '';\n }\n\n const navigationCustomized =\n fromNavigation !== undefined && fromNavigation !== defaultNav;\n const rhdhCustomized = fromRhdh !== undefined && fromRhdh !== defaultRhdh;\n\n if (navigationCustomized && !rhdhCustomized) {\n return fromNavigation!;\n }\n if (rhdhCustomized && !navigationCustomized) {\n return fromRhdh!;\n }\n if (navigationCustomized && rhdhCustomized && fromNavigation !== fromRhdh) {\n return fromRhdh ?? fromNavigation ?? '';\n }\n return fromRhdh || fromNavigation || '';\n}\n\nexport type NavigationSidebarChrome = {\n /** `navigation.background` and `rhdh.general.sidebarBackgroundColor` */\n sidebarBackgroundColor: string;\n /** `navigation.navItem.hoverBackground` and `sidebarItemSelectedBackgroundColor` */\n sidebarItemInteractionBackgroundColor: string;\n /** `navigation.color` (fallback: `text.primary`) */\n navigationItemColor: string;\n /** `navigation.selectedColor` (fallback: `navigation.color`, then `text.primary`) */\n navigationSelectedColor: string;\n};\n\n/**\n * Resolves all navigation/sidebar chrome colors for RHDH component overrides.\n */\nexport function resolveNavigationSidebarColors(\n themeConfig: ThemeConfig,\n): NavigationSidebarChrome {\n const palette = (themeConfig.palette ?? {}) as ThemeConfigPalette;\n const general = palette.rhdh?.general ?? ({} as RHDHThemePalette['general']);\n const textPrimary = palette.text?.primary ?? '';\n\n const navigationItemColor = palette.navigation?.color ?? textPrimary;\n const navigationSelectedColor =\n palette.navigation?.selectedColor ??\n palette.navigation?.color ??\n textPrimary;\n\n /** `themeConfig` + `palette` fixed; only pass which navigation vs RHDH fields to compare. */\n const pickNavigationColor = (fields: NavigationVsRhdhGeneralPick) =>\n pickNavigationOrRhdhGeneralColor(themeConfig, palette, fields);\n\n return {\n sidebarBackgroundColor: pickNavigationColor({\n navigationColor: palette.navigation?.background,\n rhdhGeneralColor: general.sidebarBackgroundColor,\n defaultNavigationColor: b => b.navigation?.background,\n defaultRhdhGeneralColor: b => b.rhdh?.general?.sidebarBackgroundColor,\n }),\n sidebarItemInteractionBackgroundColor: pickNavigationColor({\n navigationColor: palette.navigation?.navItem?.hoverBackground,\n rhdhGeneralColor: general.sidebarItemSelectedBackgroundColor,\n defaultNavigationColor: b => b.navigation?.navItem?.hoverBackground,\n defaultRhdhGeneralColor: b =>\n b.rhdh?.general?.sidebarItemSelectedBackgroundColor,\n }),\n navigationItemColor,\n navigationSelectedColor,\n };\n}\n"],"names":["backstage.getDefaultThemeConfig","rhdh.getDefaultThemeConfig"],"mappings":";;;AAwBA,SAAS,gBACP,WAAA,EACgC;AAChC,EAAA,MAAM,IAAA,GAAO,YAAY,IAAA,IAAQ,OAAA;AACjC,E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B,OAAA,CAAQ,kCAAA;AAAA,MAC1B,sBAAA,EAAwB,CAAA,CAAA,KAAK,CAAA,CAAE,UAAA,EAAY,OAAA,EAAS,eAAA;AAAA,MACpD,uBAAA,EAAyB,CAAA,CAAA,KACvB,CAAA,CAAE,IAAA,EAAM,OAAA,EAAS;AAAA,KACpB,CAAA;AAAA,IACD,mBAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@red-hat-developer-hub/backstage-plugin-theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Red Hat Developer Hub Theme",
|
|
5
5
|
"main": "./dist/index.esm.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -57,25 +57,25 @@
|
|
|
57
57
|
"postpack": "backstage-cli package postpack"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@backstage/core-plugin-api": "^1.12.
|
|
61
|
-
"@backstage/theme": "^0.7.
|
|
60
|
+
"@backstage/core-plugin-api": "^1.12.7",
|
|
61
|
+
"@backstage/theme": "^0.7.3",
|
|
62
62
|
"@mui/icons-material": "^5.17.1",
|
|
63
63
|
"@mui/material": "^5.0.0",
|
|
64
64
|
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
65
65
|
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@backstage/cli": "^0.36.
|
|
69
|
-
"@backstage/core-app-api": "^1.
|
|
70
|
-
"@backstage/core-components": "^0.18.
|
|
71
|
-
"@backstage/core-plugin-api": "^1.12.
|
|
72
|
-
"@backstage/dev-utils": "^1.1.
|
|
73
|
-
"@backstage/frontend-defaults": "^0.5.
|
|
74
|
-
"@backstage/plugin-user-settings": "^0.9.
|
|
75
|
-
"@backstage/test-utils": "^1.7.
|
|
76
|
-
"@backstage/theme": "^0.7.
|
|
68
|
+
"@backstage/cli": "^0.36.3",
|
|
69
|
+
"@backstage/core-app-api": "^1.20.2",
|
|
70
|
+
"@backstage/core-components": "^0.18.11",
|
|
71
|
+
"@backstage/core-plugin-api": "^1.12.7",
|
|
72
|
+
"@backstage/dev-utils": "^1.1.24",
|
|
73
|
+
"@backstage/frontend-defaults": "^0.5.3",
|
|
74
|
+
"@backstage/plugin-user-settings": "^0.9.4",
|
|
75
|
+
"@backstage/test-utils": "^1.7.19",
|
|
76
|
+
"@backstage/theme": "^0.7.3",
|
|
77
77
|
"@backstage/types": "^1.2.2",
|
|
78
|
-
"@backstage/ui": "^0.
|
|
78
|
+
"@backstage/ui": "^0.16.0",
|
|
79
79
|
"@testing-library/jest-dom": "^6.0.0",
|
|
80
80
|
"@testing-library/react": "^14.0.0",
|
|
81
81
|
"@testing-library/user-event": "^14.0.0",
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
"@divyanshiGupta"
|
|
105
105
|
],
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@backstage/frontend-plugin-api": "^0.
|
|
108
|
-
"@backstage/plugin-app-react": "^0.2.
|
|
107
|
+
"@backstage/frontend-plugin-api": "^0.17.2",
|
|
108
|
+
"@backstage/plugin-app-react": "^0.2.4",
|
|
109
109
|
"@mui/icons-material": "^5.17.1"
|
|
110
110
|
},
|
|
111
111
|
"module": "./dist/index.esm.js"
|