@centreon/ui 26.12.14 → 26.12.16

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/README.md CHANGED
@@ -57,9 +57,8 @@ To start Storybook server, run:
57
57
 
58
58
  # Tests architecture
59
59
 
60
- There are two kinds of tests in Centreon UI.
60
+ Centreon UI tests are component tests:
61
61
  - Jest + RTL and Cypress: Component testing. We want to migrate from Jest to Cypress
62
- - Chromatic: Chromatic is a tool that snapshots our stories and better handle snapshots changes using a review process
63
62
 
64
63
 
65
64
  ### Run Jest tests
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centreon/ui",
3
- "version": "26.12.14",
3
+ "version": "26.12.16",
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",
@@ -153,7 +153,6 @@
153
153
  "@visx/visx": "3.12.0",
154
154
  "@visx/zoom": "^3.12.0",
155
155
  "anylogger": "^1.0.11",
156
- "chromatic": "^13.3.3",
157
156
  "d3-array": "3.2.4",
158
157
  "dayjs": "^1.11.13",
159
158
  "highlight.js": "^11.11.1",
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
- ```
@@ -27,9 +27,6 @@ const meta = {
27
27
 
28
28
  component: ButtonSave,
29
29
 
30
- parameters: {
31
- chromatic: { delay: 300 }
32
- },
33
30
  title: 'Button/Save'
34
31
  };
35
32
 
@@ -26,12 +26,7 @@ const dataWithSmallNumber = [
26
26
  ];
27
27
 
28
28
  const meta: Meta<typeof BarStack> = {
29
- component: BarStack,
30
- parameters: {
31
- chromatic: {
32
- delay: 1000
33
- }
34
- }
29
+ component: BarStack
35
30
  };
36
31
 
37
32
  export default meta;
@@ -358,9 +358,6 @@ export const LineChartWithTimePeriod: Story = {
358
358
  end: defaultEnd,
359
359
  height: 500,
360
360
  start: defaultStart
361
- },
362
- parameters: {
363
- chromatic: { disableSnapshot: true }
364
361
  }
365
362
  };
366
363
 
@@ -18,12 +18,7 @@ const dataWithBigNumbers = [
18
18
  ];
19
19
 
20
20
  const meta: Meta<typeof ResponsivePie> = {
21
- component: ResponsivePie,
22
- parameters: {
23
- chromatic: {
24
- delay: 1000
25
- }
26
- }
21
+ component: ResponsivePie
27
22
  };
28
23
 
29
24
  export default meta;
@@ -35,11 +35,6 @@ const Template = (args): JSX.Element => {
35
35
 
36
36
  const meta: Meta<typeof Timeline> = {
37
37
  component: Timeline,
38
- parameters: {
39
- chromatic: {
40
- delay: 1000
41
- }
42
- },
43
38
  render: Template
44
39
  };
45
40
 
@@ -153,8 +153,5 @@ export const treeWithZoom: Story = {
153
153
  getStrokeWidth: ({ target }) => (target.status === 'ok' ? 1 : 2)
154
154
  }
155
155
  },
156
- parameters: {
157
- chromatic: { disableSnapshot: true }
158
- },
159
156
  render: TreeWithZoom
160
157
  };
@@ -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
  }
@@ -9,9 +9,6 @@ import { dateFormat } from './models';
9
9
 
10
10
  const meta: Meta<typeof TimePeriod> = {
11
11
  component: TimePeriod,
12
- parameters: {
13
- chromatic: { disableSnapshot: true }
14
- },
15
12
  tags: ['autodocs']
16
13
  };
17
14
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file