From bc78197a2b6bedea95b92808a8968c81f9c1bd64 Mon Sep 17 00:00:00 2001 From: Lukas Hirt Date: Fri, 20 Feb 2026 10:20:05 +0100 Subject: [PATCH] chore(idp): use kpop without dependency Instead of trying to download kpop every time, bring in the specific code that we are using. There is very little code that we are actually using from kpop so pulling it as a dependency is not really necessary and it should fix the current CI issues. --- services/idp/package.json | 4 - services/idp/pnpm-lock.yaml | 113 ----------------------- services/idp/src/App.jsx | 79 ++++++++-------- services/idp/src/app.css | 147 +++++++++++++++++++++++++++++- services/idp/src/theme/default.js | 55 +++++++++++ 5 files changed, 236 insertions(+), 162 deletions(-) create mode 100644 services/idp/src/theme/default.js diff --git a/services/idp/package.json b/services/idp/package.json index 9fd45bead06..4d3f8e44a34 100644 --- a/services/idp/package.json +++ b/services/idp/package.json @@ -90,7 +90,6 @@ "i18next-browser-languagedetector": "^7.2.2", "i18next-http-backend": "^2.7.3", "i18next-resources-to-backend": "^1.2.1", - "kpop": "https://download.kopano.io/community/kapp:/kpop-2.7.2.tgz", "notistack": "^1.0.10", "query-string": "^9.3.1", "react": "^17.0.2", @@ -172,9 +171,6 @@ "glob": "10.5.0", "js-yaml": ">=4.1.1", "lodash": ">=4.17.23", - "kpop>cldr": "", - "kpop>notistack": "^1.0.5", - "kpop>react-intl": "^5.25.0", "undici": ">=7.18.2", "vue-template-compiler": "^3.0.0", "brace-expansion@>=1.0.0 <=1.1.11": ">=1.1.12", diff --git a/services/idp/pnpm-lock.yaml b/services/idp/pnpm-lock.yaml index 9c624912a00..9b0baa3f2db 100644 --- a/services/idp/pnpm-lock.yaml +++ b/services/idp/pnpm-lock.yaml @@ -8,9 +8,6 @@ overrides: glob: 10.5.0 js-yaml: '>=4.1.1' lodash: '>=4.17.23' - kpop>cldr: '' - kpop>notistack: ^1.0.5 - kpop>react-intl: ^5.25.0 undici: '>=7.18.2' vue-template-compiler: ^3.0.0 brace-expansion@>=1.0.0 <=1.1.11: '>=1.1.12' @@ -77,9 +74,6 @@ importers: i18next-resources-to-backend: specifier: ^1.2.1 version: 1.2.1 - kpop: - specifier: https://download.kopano.io/community/kapp:/kpop-2.7.2.tgz - version: https://download.kopano.io/community/kapp:/kpop-2.7.2.tgz(@gluejs/glue@0.3.0)(@material-ui/core@4.12.4(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2))(@material-ui/icons@4.11.3(@material-ui/core@4.12.4(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2))(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2))(notistack@1.0.10(@material-ui/core@4.12.4(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2))(react-dom@17.0.2(react@17.0.2))(react@17.0.2))(oidc-client@1.11.5)(react-dom@17.0.2(react@17.0.2))(react-intl@5.25.1(react@17.0.2)(typescript@5.9.3))(react@17.0.2) notistack: specifier: ^1.0.10 version: 1.0.10(@material-ui/core@4.12.4(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2))(react-dom@17.0.2(react@17.0.2))(react@17.0.2) @@ -1652,9 +1646,6 @@ packages: typescript: optional: true - '@gluejs/glue@0.3.0': - resolution: {integrity: sha512-byvFoZCbZW+A3Pg8JUU+8FjoPuF5l1v7mDeLJQP/YSeEcEDiD/YdUKLBUapPrcuyxclrtS8+peX4cxkh6awwTw==} - '@gulpjs/to-absolute-glob@4.0.0': resolution: {integrity: sha512-kjotm7XJrJ6v+7knhPaRgaT6q8F8K2jiafwYdNHLzmV0uGLuZY43FK6smNSHUPrhq5kX2slCUy+RGG/xGqmIKA==} engines: {node: '>=10.13.0'} @@ -1805,18 +1796,6 @@ packages: '@types/react': optional: true - '@material-ui/icons@4.11.3': - resolution: {integrity: sha512-IKHlyx6LDh8n19vzwH5RtHIOHl9Tu90aAAxcbWME6kp4dmvODM3UvOHJeMIDzUbd4muuJKHmlNoBN+mDY4XkBA==} - engines: {node: '>=8.0.0'} - peerDependencies: - '@material-ui/core': ^4.0.0 - '@types/react': ^16.8.6 || ^17.0.0 - react: ^16.8.0 || ^17.0.0 - react-dom: ^16.8.0 || ^17.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@material-ui/styles@4.11.5': resolution: {integrity: sha512-o/41ot5JJiUsIETME9wVLAJrmIWL3j0R0Bj2kCOLbSfqEkKf0fmaPt+5vtblUh5eXr2S+J/8J3DaCb10+CzPGA==} engines: {node: '>=8.0.0'} @@ -2544,11 +2523,6 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn@7.4.1: - resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} - engines: {node: '>=0.4.0'} - hasBin: true - acorn@8.15.0: resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} engines: {node: '>=0.4.0'} @@ -3070,9 +3044,6 @@ packages: core-js@3.37.1: resolution: {integrity: sha512-Xn6qmxrQZyB0FFY8E3bgRXei3lWDJHhvI+u0q9TKIYM49G8pAr0FgnnrFRAmsbptZL1yxRADVXn+x5AGsbBfyw==} - core-js@3.48.0: - resolution: {integrity: sha512-zpEHTy1fjTMZCKLHUZoVeylt9XrzaIN2rbPXEt0k+q7JE5CkCZdo6bNq55bn24a69CH7ErAVLKijxJja4fw+UQ==} - core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} @@ -3093,11 +3064,6 @@ packages: typescript: optional: true - crc32@0.2.2: - resolution: {integrity: sha512-PFZEGbDUeoNbL2GHIEpJRQGheXReDody/9axKTxhXtQqIL443wnNigtVZO9iuCIMPApKZRv7k2xr8euXHqNxQQ==} - engines: {node: '>= 0.4.0'} - hasBin: true - cross-fetch@4.0.0: resolution: {integrity: sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==} @@ -3109,9 +3075,6 @@ packages: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} - crypto-js@4.2.0: - resolution: {integrity: sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==} - crypto-random-string@2.0.0: resolution: {integrity: sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==} engines: {node: '>=8'} @@ -4071,9 +4034,6 @@ packages: resolution: {integrity: sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hsv-rgb@1.0.0: - resolution: {integrity: sha512-Azd6IP11LZm0cEczEnJw5B6zIgWdGlE4TSoM2eh+RPRbXSQCy/0JS2POEq0wOtbAZtxTJhEMGm3GUYGbnTIJGw==} - html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} @@ -4367,10 +4327,6 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - iso-639-1@2.1.15: - resolution: {integrity: sha512-7c7mBznZu2ktfvyT582E2msM+Udc1EjOyhVRE/0ZsjD9LBtWSm23h3PtiRh2a35XoUsTQQjJXaJzuLjXsOdFDg==} - engines: {node: '>=6.0'} - istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} engines: {node: '>=8'} @@ -4644,20 +4600,6 @@ packages: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} - kpop@https://download.kopano.io/community/kapp:/kpop-2.7.2.tgz: - resolution: {tarball: https://download.kopano.io/community/kapp:/kpop-2.7.2.tgz} - version: 2.7.1 - engines: {node: '>=6.11.0'} - peerDependencies: - '@gluejs/glue': ^0.3.0 - '@material-ui/core': ^4.11.0 - '@material-ui/icons': ^4.9.1 - notistack: ^1.0.5 - oidc-client: ^1.11.0 - react: ^16.8.0 || ^17.0.0 - react-dom: ^16.8.0 || ^17.0.0 - react-intl: ^5.25.0 - language-subtag-registry@0.3.23: resolution: {integrity: sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==} @@ -4987,9 +4929,6 @@ packages: resolution: {integrity: sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==} engines: {node: '>= 0.4'} - oidc-client@1.11.5: - resolution: {integrity: sha512-LcKrKC8Av0m/KD/4EFmo9Sg8fSQ+WFJWBrmtWd+tZkNn3WT/sQG3REmPANE9tzzhbjW6VkTNy4xhAXCfPApAOg==} - once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} @@ -6006,9 +5945,6 @@ packages: seq@0.3.5: resolution: {integrity: sha512-sisY2Ln1fj43KBkRtXkesnRHYNdswIkIibvNe/0UKm2GZxjMbqmccpiatoKr/k2qX5VKiLU8xm+tz/74LAho4g==} - serialize-javascript@4.0.0: - resolution: {integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==} - serialize-javascript@6.0.2: resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} @@ -8331,8 +8267,6 @@ snapshots: optionalDependencies: typescript: 5.9.3 - '@gluejs/glue@0.3.0': {} - '@gulpjs/to-absolute-glob@4.0.0': dependencies: is-negated-glob: 1.0.0 @@ -8603,15 +8537,6 @@ snapshots: optionalDependencies: '@types/react': 17.0.87 - '@material-ui/icons@4.11.3(@material-ui/core@4.12.4(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2))(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': - dependencies: - '@babel/runtime': 7.28.6 - '@material-ui/core': 4.12.4(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) - react: 17.0.2 - react-dom: 17.0.2(react@17.0.2) - optionalDependencies: - '@types/react': 17.0.87 - '@material-ui/styles@4.11.5(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: '@babel/runtime': 7.28.6 @@ -9431,8 +9356,6 @@ snapshots: dependencies: acorn: 8.15.0 - acorn@7.4.1: {} - acorn@8.15.0: {} address@1.2.2: {} @@ -10050,8 +9973,6 @@ snapshots: core-js@3.37.1: {} - core-js@3.48.0: {} - core-util-is@1.0.3: {} cosmiconfig@6.0.0: @@ -10079,8 +10000,6 @@ snapshots: optionalDependencies: typescript: 5.9.3 - crc32@0.2.2: {} - cross-fetch@4.0.0(encoding@0.1.13): dependencies: node-fetch: 2.7.0(encoding@0.1.13) @@ -10099,8 +10018,6 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 - crypto-js@4.2.0: {} - crypto-random-string@2.0.0: {} css-blank-pseudo@7.0.1(postcss@8.5.6): @@ -11402,8 +11319,6 @@ snapshots: dependencies: lru-cache: 7.18.3 - hsv-rgb@1.0.0: {} - html-escaper@2.0.2: {} html-minifier-terser@6.1.0: @@ -11702,8 +11617,6 @@ snapshots: isexe@2.0.0: {} - iso-639-1@2.1.15: {} - istanbul-lib-coverage@3.2.2: {} istanbul-lib-instrument@6.0.3: @@ -12195,20 +12108,6 @@ snapshots: kleur@3.0.3: {} - kpop@https://download.kopano.io/community/kapp:/kpop-2.7.2.tgz(@gluejs/glue@0.3.0)(@material-ui/core@4.12.4(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2))(@material-ui/icons@4.11.3(@material-ui/core@4.12.4(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2))(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2))(notistack@1.0.10(@material-ui/core@4.12.4(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2))(react-dom@17.0.2(react@17.0.2))(react@17.0.2))(oidc-client@1.11.5)(react-dom@17.0.2(react@17.0.2))(react-intl@5.25.1(react@17.0.2)(typescript@5.9.3))(react@17.0.2): - dependencies: - '@gluejs/glue': 0.3.0 - '@material-ui/core': 4.12.4(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) - '@material-ui/icons': 4.11.3(@material-ui/core@4.12.4(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2))(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) - crc32: 0.2.2 - hsv-rgb: 1.0.0 - iso-639-1: 2.1.15 - notistack: 1.0.10(@material-ui/core@4.12.4(@types/react@17.0.87)(react-dom@17.0.2(react@17.0.2))(react@17.0.2))(react-dom@17.0.2(react@17.0.2))(react@17.0.2) - oidc-client: 1.11.5 - react: 17.0.2 - react-dom: 17.0.2(react@17.0.2) - react-intl: 5.25.1(react@17.0.2)(typescript@5.9.3) - language-subtag-registry@0.3.23: {} language-tags@1.0.9: @@ -12507,14 +12406,6 @@ snapshots: define-properties: 1.2.1 es-object-atoms: 1.1.1 - oidc-client@1.11.5: - dependencies: - acorn: 7.4.1 - base64-js: 1.5.1 - core-js: 3.48.0 - crypto-js: 4.2.0 - serialize-javascript: 4.0.0 - once@1.4.0: dependencies: wrappy: 1.0.2 @@ -13630,10 +13521,6 @@ snapshots: chainsaw: 0.0.9 hashish: 0.0.4 - serialize-javascript@4.0.0: - dependencies: - randombytes: 2.1.0 - serialize-javascript@6.0.2: dependencies: randombytes: 2.1.0 diff --git a/services/idp/src/App.jsx b/services/idp/src/App.jsx index 50cc7b55e53..f6247f73b9b 100644 --- a/services/idp/src/App.jsx +++ b/services/idp/src/App.jsx @@ -1,69 +1,62 @@ -import React, { ReactElement, Suspense, lazy, useState, useEffect } from 'react'; -import PropTypes from 'prop-types'; +import React, { ReactElement, Suspense, lazy, useState, useEffect } from 'react' +import PropTypes from 'prop-types' -import { MuiThemeProvider } from '@material-ui/core/styles'; -import { defaultTheme } from 'kpop/es/theme'; +import { MuiThemeProvider } from '@material-ui/core/styles' -import 'kpop/static/css/base.css'; -import 'kpop/static/css/scrollbar.css'; +import Spinner from './components/Spinner' +import * as version from './version' +import { InfiniteScaleContext } from './infiniteScaleContext' -import Spinner from './components/Spinner'; -import * as version from './version'; -import { InfiniteScaleContext } from './infiniteScaleContext'; +import defaultTheme from './theme/default' -const LazyMain = lazy(() => import(/* webpackChunkName: "identifier-main" */ './Main')); +const LazyMain = lazy(() => import(/* webpackChunkName: "identifier-main" */ './Main')) -console.info(`Kopano Identifier build version: ${version.build}`); // eslint-disable-line no-console +console.info(`Kopano Identifier build version: ${version.build}`) // eslint-disable-line no-console const App = ({ bgImg }): ReactElement => { - const [theme, setTheme] = useState(null); - const [config, setConfig] = useState(null); - const [loading, setLoading] = useState(true); + const [theme, setTheme] = useState(null) + const [config, setConfig] = useState(null) + const [loading, setLoading] = useState(true) useEffect(() => { const fetchData = async () => { try { - const configResponse = await fetch('/config.json'); - const configData = await configResponse.json(); - setConfig(configData); + const configResponse = await fetch('/config.json') + const configData = await configResponse.json() + setConfig(configData) - const themeResponse = await fetch(configData.theme); - const themeData = await themeResponse.json(); - setTheme(themeData); + const themeResponse = await fetch(configData.theme) + const themeData = await themeResponse.json() + setTheme(themeData) } catch (error) { - console.error('Error fetching config/theme data:', error); + console.error('Error fetching config/theme data:', error) } finally { - setLoading(false); + setLoading(false) } - }; - - fetchData(); - }, []); + } + fetchData() + }, []) if (loading) { - return ; + return } - return ( - -
- - }> - - - -
-
- ); + +
+ + }> + + + +
+
+ ) } App.propTypes = { bgImg: PropTypes.string -}; +} -export default App; +export default App diff --git a/services/idp/src/app.css b/services/idp/src/app.css index dee99c285db..57255bfe82d 100644 --- a/services/idp/src/app.css +++ b/services/idp/src/app.css @@ -1,3 +1,147 @@ +/* Kopano styles */ +html, +body { + height: 100%; +} + +body { + margin: 0; + padding: 0; +} + +#bg { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + background: white; +} + +#loader { + position: absolute; + bottom: 6%; + left: 50%; + font-weight: 400; + font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif; + color: #666; + transform: translate(-50%, -50%); +} + +#loader > a { + color: #1e98d7; /* KopanoBlue700 */ +} + +#font-preloader { + position: absolute; + top: -500px; + font-weight: 400; + color: white; + font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif; +} + +#font-preloader > span { + font-weight: 500; +} + +#root { + height: 100%; + display: flex; +} + +/* CSS Scrollbars, currently only Firefox: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Scrollbars */ + +* { + scrollbar-width: thin; + scrollbar-color: #ddd #f5f5f5; +} + +body:hover * { + scrollbar-color: #bdbdbd #f5f5f5; +} + +/* Webkit specific scrollbars, works in Chrome and Safari */ + +::-webkit-scrollbar { + height: 8px; + width: 8px; + background: transparent; + overflow: visible; +} + +::-webkit-scrollbar-corner { + display: none; + background: #f5f5f5; +} + +::-webkit-scrollbar-button { + display: none; + height: 0; + width: 0; +} + +::-webkit-scrollbar-button:start:decrement, +::-webkit-scrollbar-button:end:increment { + display: block; +} + +::-webkit-scrollbar-button:vertical:start:increment, +::-webkit-scrollbar-button:vertical:end:decrement { + display: none; +} + +::-webkit-scrollbar-track { + -moz-background-clip: border; + -webkit-background-clip: border; + background-clip: padding-box; + background-color: #f5f5f5; +} + +::-webkit-scrollbar-thumb { + background-clip: padding-box; + background-color: #ddd; + min-height: 40px; + padding-top: 100px; + border-radius: 4px; +} + +::-webkit-scrollbar-track:vertical, +::-webkit-scrollbar-track:horizontal { + border-left-width: 0; + border-right-width: 0; +} + +::-webkit-scrollbar-track:vertical, +::-webkit-scrollbar-track:horizontal, +::-webkit-scrollbar-thumb:vertical, +::-webkit-scrollbar-thumb:horizontal, +::-webkit-scrollbar-track:vertical, +::-webkit-scrollbar-track:horizontal, +::-webkit-scrollbar-thumb:vertical, +::-webkit-scrollbar-thumb:horizontal { + border-style: solid; + border-color: transparent; +} + +::-webkit-scrollbar-thumb:hover { + background-color: #bdbdbd; +} + +::-webkit-scrollbar-thumb:active { + background-color: #989898; +} + +::-webkit-scrollbar-thumb:vertical, +::-webkit-scrollbar-thumb:horizontal { + border-width: 0; + border-left-width: 0; + border-right-width: 0; +} + +body:hover ::-webkit-scrollbar-thumb { + background-color: #bdbdbd; +} + /* additional css on top of kpop */ @font-face { font-family: Inter; @@ -7,7 +151,7 @@ } html { - font-feature-settings: "cv11"; + font-feature-settings: 'cv11'; } body { @@ -141,7 +285,6 @@ strong { margin-bottom: 15px; } - /* * Special SR classes * Used to hide an element visually, but keeping it accessible for accessibility tools. diff --git a/services/idp/src/theme/default.js b/services/idp/src/theme/default.js new file mode 100644 index 00000000000..ae31a920785 --- /dev/null +++ b/services/idp/src/theme/default.js @@ -0,0 +1,55 @@ +import { createMuiTheme } from '@material-ui/core/styles' + +import blueGrey from '@material-ui/core/colors/blueGrey' +import red from '@material-ui/core/colors/red' + +const kopanoBlue = { + 50: '#e5f7fd', + 100: '#ccf0fc', + 200: '#99e1f9', + 300: '#66d1f6', + 400: '#33c2f3', + 500: '#00b3f0', + 600: '#14a9e7', + 700: '#1e98d7', + 800: '#188cc8', + 900: '#0d74b6', + A100: '#96e8ff', + A200: '#6ddaff', + A400: '#56cbff', + A700: '#48acf0' +} + +const primaryColor = kopanoBlue +const secondaryColor = blueGrey +const errorColor = red + +// All the following keys are optional. +// We try our best to provide a great default value. +const theme = createMuiTheme({ + palette: { + primary: primaryColor, + secondary: secondaryColor, + error: errorColor, + // Used by `getContrastText()` to maximize the contrast between the background and + // the text. + // NOTE(longsleep): KopanoBlue is too light and thus needs 2.4 contrastThreshold + // to make sure the default 500 color is still using white text. It will + // show warnings in development mode that the contrast is too low as W3C + // recommends the threshold to be 3 or more. This cannot be helped. + contrastThreshold: 2.4, + // Used to shift a color's luminance by approximately + // two indexes within its tonal palette. + // E.g., shift from Red 500 to Red 300 or Red 700. + tonalOffset: 0.2 + }, + typography: { + useNextVariants: true, + button: { + textTransform: 'none', + fontSize: '1rem' + } + } +}) + +export default theme