@centreon/ui 26.12.14 → 26.12.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centreon/ui",
3
- "version": "26.12.14",
3
+ "version": "26.12.15",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "update:deps": "pnpx npm-check-updates -i --format group",
@@ -48,7 +48,6 @@
48
48
  "exports": {
49
49
  ".": "./src/index.ts",
50
50
  "./components": "./src/components/index.ts",
51
- "./fonts/*": "./src/fonts/*",
52
51
  "./test/testRenderer": "./test/testRenderer.tsx",
53
52
  "./tailwindcss": "./src/ThemeProvider/tailwindcss.css"
54
53
  },
@@ -129,6 +128,7 @@
129
128
  "@centreon/ui-context": "workspace:*"
130
129
  },
131
130
  "dependencies": {
131
+ "@fontsource/roboto": "^5.3.0",
132
132
  "@lexical/html": "^0.27.0",
133
133
  "@lexical/link": "^0.27.0",
134
134
  "@lexical/list": "^0.27.0",
package/public/README.md CHANGED
@@ -1,39 +1 @@
1
1
  > The assets in `public` are served as-is.
2
-
3
-
4
- ---
5
-
6
- ### `public/fonts` → `@centreon/ui/fonts` alias
7
-
8
- The `ThemeProvider` specifies the `@font-face` for MUI.
9
- It imports the fonts using the `@centreon/ui/fonts` alias, but does not bundle them.
10
-
11
-
12
-
13
- #### ⚠️ **note**
14
- When the `@centreon/ui` package is used as non-build dependency, then the `@centreon/ui/fonts` alias need to be added in the webpack config, and configured to handle the asset types.
15
- ```js
16
- // webpack.config.js
17
-
18
- // alias
19
- resolve: {
20
- alias: {
21
- '@centreon/ui/fonts': path.resolve(
22
- './node_modules/@centreon/ui/public/fonts'
23
- )
24
- }
25
- }
26
-
27
- // asset types
28
- module: {
29
- rules: [
30
- {
31
- generator: {
32
- filename: '[name][ext]'
33
- },
34
- test: /\.(woff|woff2|eot|ttf|otf)$/i,
35
- type: 'asset/resource'
36
- }
37
- ]
38
- }
39
- ```
@@ -14,15 +14,15 @@ import { GlobalStyles } from '@mui/system';
14
14
 
15
15
  import { ThemeMode, userAtom } from '@centreon/ui-context';
16
16
 
17
+ import '@fontsource/roboto/300.css';
18
+ import '@fontsource/roboto/400.css';
19
+ import '@fontsource/roboto/500.css';
20
+ import '@fontsource/roboto/700.css';
17
21
  import { useAtomValue } from 'jotai';
18
22
  import { equals, mergeDeepRight } from 'ramda';
19
23
  import { type ReactNode, useMemo } from 'react';
20
24
  import type { CSSInterpolation } from 'tss-react';
21
25
 
22
- import RobotoBoldWoff2 from '../fonts/roboto-bold-webfont.woff2';
23
- import RobotoLightWoff2 from '../fonts/roboto-light-webfont.woff2';
24
- import RobotoMediumWoff2 from '../fonts/roboto-medium-webfont.woff2';
25
- import RobotoRegularWoff2 from '../fonts/roboto-regular-webfont.woff2';
26
26
  import { getPalette } from './palettes';
27
27
 
28
28
  declare module '@mui/styles/defaultTheme' {
@@ -149,30 +149,6 @@ export const getTheme = (mode: ThemeMode): ThemeOptions => ({
149
149
  },
150
150
  MuiCssBaseline: {
151
151
  styleOverrides: (theme) => `
152
- @font-face {
153
- font-family: 'Roboto';
154
- font-style: normal;
155
- font-weight: 300;
156
- src: local('Roboto'), local('Roboto-Light'), url(${RobotoLightWoff2}) format('woff2');
157
- }
158
- @font-face {
159
- font-family: 'Roboto';
160
- font-style: normal;
161
- font-weight: 400;
162
- src: local('Roboto'), local('Roboto-Regular'), url(${RobotoRegularWoff2}) format('woff2');
163
- }
164
- @font-face {
165
- font-family: 'Roboto';
166
- font-style: normal;
167
- font-weight: 500;
168
- src: local('Roboto'), local('Roboto-Medium'), url(${RobotoMediumWoff2}) format('woff2');
169
- }
170
- @font-face {
171
- font-family: 'Roboto';
172
- font-style: normal;
173
- font-weight: 700;
174
- src: local('Roboto'), local('Roboto-Bold'), url(${RobotoBoldWoff2}) format('woff2');
175
- }
176
152
  body {
177
153
  background-color: ${theme.palette.background.paper};
178
154
  }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file