Skip to content

Commit 885e1aa

Browse files
authored
Upgrade clo-ui to 0.5.1 (#1812)
* Upgrade clo-ui to 0.5.0 Signed-off-by: Cintia Sánchez García <[email protected]> * Fix some tests Signed-off-by: Cintia Sánchez García <[email protected]> * Update clo-ui version Signed-off-by: Cintia Sánchez García <[email protected]> --------- Signed-off-by: Cintia Sánchez García <[email protected]>
1 parent 2efa957 commit 885e1aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+180
-249
lines changed

web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dependencies": {
77
"apexcharts": "3.49.0",
88
"classnames": "^2.5.1",
9-
"clo-ui": "https://github.com/cncf/clo-ui.git#v0.4.5",
9+
"clo-ui": "https://github.com/cncf/clo-ui.git#v0.5.1",
1010
"lodash": "^4.17.21",
1111
"moment": "^2.30.1",
1212
"nth-check": "^2.0.1",
@@ -61,7 +61,7 @@
6161
"jest": {
6262
"moduleNameMapper": {
6363
"\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
64-
"\\.(css|less)$": "<rootDir>/__mocks__/fileMock.js"
64+
"\\.(css|less|scss|sass)$": "<rootDir>/__mocks__/fileMock.js"
6565
}
6666
},
6767
"scripts": {

web/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import 'clo-ui/dist/styles/xxxl_grid.scss';
1+
import 'clo-ui/styles/xxxl_grid.scss';
22

3-
import { AlertController } from 'clo-ui';
3+
import { AlertController } from 'clo-ui/components/AlertController';
44
import { useState } from 'react';
55
import { BrowserRouter as Router, Navigate, Route, Routes, useParams } from 'react-router-dom';
66

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { FunctionComponent, ReactNode } from 'react';
2+
3+
type CodeBlockProps = {
4+
content: ReactNode;
5+
label?: string;
6+
withCopyBtn?: boolean;
7+
};
8+
9+
const CodeBlock: FunctionComponent<CodeBlockProps> = ({ content, label, withCopyBtn }) => {
10+
return (
11+
<div data-testid="code" data-label={label}>
12+
{content}
13+
{withCopyBtn && label ? (
14+
<button aria-label={label} type="button">
15+
{label}
16+
</button>
17+
) : null}
18+
</div>
19+
);
20+
};
21+
22+
export { CodeBlock };

web/src/context/AppContextProvider.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { detectActiveThemeMode, getMetaTag, useSystemThemeMode } from 'clo-ui';
1+
import { useSystemThemeMode } from 'clo-ui/hooks/useSystemThemeMode';
2+
import { detectActiveThemeMode } from 'clo-ui/utils/detectActiveThemeMode';
3+
import { getMetaTag } from 'clo-ui/utils/getMetaTag';
24
import { isNull } from 'lodash';
35
import { createContext, Dispatch, useContext, useEffect, useReducer, useState } from 'react';
46

web/src/data.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { ExternalLink, Foundation, Maturity, SampleQuery } from 'clo-ui';
1+
import { ExternalLink } from 'clo-ui/components/ExternalLink';
2+
import { Foundation } from 'clo-ui/components/Foundation';
3+
import { Maturity } from 'clo-ui/components/Maturity';
4+
import { SampleQuery } from 'clo-ui/components/SampleQueries';
25
import { BiLock, BiMedal, BiShieldQuarter, BiTable, BiTrophy, BiWorld } from 'react-icons/bi';
36
import { BsCalendar3, BsUiChecks } from 'react-icons/bs';
47
import { CgFileDocument, CgReadme } from 'react-icons/cg';

web/src/layout/common/BadgeModal.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { render, screen } from '@testing-library/react';
22
import userEvent from '@testing-library/user-event';
3-
import { Foundation } from 'clo-ui';
3+
import { Foundation } from 'clo-ui/components/Foundation';
44

55
import BadgeModal from './BadgeModal';
66

web/src/layout/common/BadgeModal.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { CodeBlock, Foundation, Modal, Tabs } from 'clo-ui';
1+
import { CodeBlock } from 'clo-ui/components/CodeBlock';
2+
import { Foundation } from 'clo-ui/components/Foundation';
3+
import { Modal } from 'clo-ui/components/Modal';
4+
import { Tabs } from 'clo-ui/components/Tabs';
25
import { useContext } from 'react';
36

47
import { AppContext } from '../../context/AppContextProvider';

web/src/layout/common/CategoriesSummary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import classNames from 'classnames';
2-
import { RoundScore } from 'clo-ui';
2+
import { RoundScore } from 'clo-ui/components/RoundScore';
33
import { isUndefined } from 'lodash';
44

55
import { CATEGORY_ICONS } from '../../data';

web/src/layout/common/CategoryProgressbar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { getCategoryColor, roundScoreValue } from 'clo-ui';
1+
import { getCategoryColor } from 'clo-ui/utils/getCategoryColor';
2+
import { roundScoreValue } from 'clo-ui/utils/roundScoreValue';
23
import { isUndefined } from 'lodash';
34
import { useLocation, useNavigate } from 'react-router-dom';
45

web/src/layout/common/ProjectDropdown.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { fireEvent, render, screen } from '@testing-library/react';
2-
import { Foundation } from 'clo-ui';
2+
import { Foundation } from 'clo-ui/components/Foundation';
33

44
import ProjectDropdown from './ProjectDropdown';
55

0 commit comments

Comments
 (0)