@centreon/ui 26.12.13 → 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 +2 -2
- package/public/README.md +0 -38
- package/src/ActionsList/index.tsx +5 -3
- package/src/ThemeProvider/index.tsx +4 -28
- package/src/fonts/roboto-bold-webfont.ttf +0 -0
- package/src/fonts/roboto-bold-webfont.woff +0 -0
- package/src/fonts/roboto-bold-webfont.woff2 +0 -0
- package/src/fonts/roboto-light-webfont.ttf +0 -0
- package/src/fonts/roboto-light-webfont.woff +0 -0
- package/src/fonts/roboto-light-webfont.woff2 +0 -0
- package/src/fonts/roboto-medium-webfont.ttf +0 -0
- package/src/fonts/roboto-medium-webfont.woff +0 -0
- package/src/fonts/roboto-medium-webfont.woff2 +0 -0
- package/src/fonts/roboto-regular-webfont.ttf +0 -0
- package/src/fonts/roboto-regular-webfont.woff +0 -0
- package/src/fonts/roboto-regular-webfont.woff2 +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@centreon/ui",
|
|
3
|
-
"version": "26.12.
|
|
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
|
-
```
|
|
@@ -16,6 +16,8 @@ import { useStyles } from './ActionsList.styles';
|
|
|
16
16
|
import type { ActionVariants } from './models';
|
|
17
17
|
|
|
18
18
|
interface ActionsType {
|
|
19
|
+
// A stable id for analytics and tests; the label stays the fallback.
|
|
20
|
+
dataTestId?: string;
|
|
19
21
|
Icon?: OverridableComponent<SvgIconTypeMap<object, 'svg'>> & {
|
|
20
22
|
muiName: string;
|
|
21
23
|
};
|
|
@@ -52,16 +54,16 @@ const ActionsList = ({
|
|
|
52
54
|
return <Divider key={`divider_${idx}`} />;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
const { label, Icon, onClick, variant, secondaryLabel } =
|
|
57
|
+
const { dataTestId, label, Icon, onClick, variant, secondaryLabel } =
|
|
56
58
|
action as ActionsType;
|
|
57
59
|
|
|
58
60
|
return (
|
|
59
61
|
<MenuItem
|
|
60
62
|
aria-label={label}
|
|
61
63
|
className={classes.item}
|
|
62
|
-
data-testid={label}
|
|
64
|
+
data-testid={dataTestId ?? label}
|
|
63
65
|
data-variant={variant}
|
|
64
|
-
id={label}
|
|
66
|
+
id={dataTestId ?? label}
|
|
65
67
|
key={label}
|
|
66
68
|
onClick={onClick}
|
|
67
69
|
>
|
|
@@ -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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|