Skip to content

Commit 05cb203

Browse files
exported CoreUITheme and updated readme
1 parent 67c0b29 commit 05cb203

File tree

3 files changed

+29
-80
lines changed

3 files changed

+29
-80
lines changed

README.md

Lines changed: 27 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,21 @@ Core-UI is a component library containing all components, layouts, icons and the
1111
- Add `@scality/core-ui` in the `package.json`'s dependencies of your project.
1212

1313
```json
14-
"@scality/core-ui": "0.115.0",
14+
"@scality/core-ui": "^0.165.0",
1515
```
1616

1717
- `@scality/core-ui` requires the peerDependencies below. Make sure that you have them in the `package.json`'s dependencies.
1818

1919
```json
20-
"@fortawesome/fontawesome-free": "^5.10.2",
21-
"@fortawesome/fontawesome-svg-core": "^1.2.35",
22-
"@fortawesome/free-regular-svg-icons": "^5.15.3",
23-
"@fortawesome/free-solid-svg-icons": "^5.15.3",
24-
"@fortawesome/react-fontawesome": "^0.1.14",
25-
"@js-temporal/polyfill": "^0.4.4",
26-
"polished": "3.4.1",
27-
"pretty-bytes": "^5.6.0",
28-
"react": "^17.0.2",
29-
"react-debounce-input": "3.2.2",
30-
"react-dom": "^17.0.2",
31-
"react-dropzone": "^14.2.3",
20+
"react": "^18.0.0",
21+
"react-dom": "^18.0.0",
22+
// to provides a Provider to the components using react-query
3223
"react-query": "^3.34.0",
33-
"react-router": "^5.2.0",
34-
"react-router-dom": "^5.2.0",
35-
"react-select": "4.3.1",
36-
"react-table": "^7.7.0",
37-
"react-virtualized": "9.22.3",
38-
"react-virtualized-auto-sizer": "^1.0.5",
39-
"react-window": "^1.8.6",
40-
"styled-components": "^4.1.2",
41-
"styled-system": "^5.1.5",
42-
"vega": "^5.17.3",
43-
"vega-embed": "^6.0.0",
44-
"vega-lite": "^5.0.0",
45-
"vega-tooltip": "^0.27.0"
24+
// for the components using react router
25+
"react-router": "^7.0.1",
26+
"react-router-dom": "^7.0.1",
27+
// for legacy chart components
28+
"canvas": "^2.10.1",
4629
```
4730

4831
- Install the dependencies :
@@ -90,59 +73,31 @@ import { coreUIAvailableThemes as themes } from '@scality/core-ui/dist/style/the
9073

9174
There is 2 default theme available in Core-UI : you can find them [here](https://github.com/scality/core-ui/pull/684#:~:text=https%3A//github.com/scality/core%2Dui/blob/development/1.0/src/lib/style/theme.ts)
9275

93-
<br/>
94-
95-
You can also modify or create a new theme. In this case make sure to respect this type :
76+
You can also modify or create a new theme but make sure to extend this type:
9677

9778
```tsx
98-
export type CoreUITheme = {
99-
statusHealthy: string;
100-
statusHealthyRGB: string;
101-
statusWarning: string;
102-
statusWarningRGB: string;
103-
statusCritical: string;
104-
statusCriticalRGB: string;
105-
selectedActive: string;
106-
highlight: string;
107-
border: string;
108-
buttonPrimary: string;
109-
buttonSecondary: string;
110-
buttonDelete: string;
111-
infoPrimary: string;
112-
infoSecondary: string;
113-
backgroundLevel1: string;
114-
backgroundLevel2: string;
115-
backgroundLevel3: string;
116-
backgroundLevel4: string;
117-
textPrimary: string;
118-
textSecondary: string;
119-
textTertiary: string;
120-
textReverse: string;
121-
textLink: string;
122-
};
79+
import { CoreUITheme } from "@scality/core-ui/dist/next";
12380
```
12481

125-
<br />
126-
12782
## Development
12883

12984
This project is built with [React](https://react.dev/) and [TypeScript](https://www.typescriptlang.org/), and styled with [styled-components](https://styled-components.com/).
13085

131-
To start contributing to core-ui, clone the repository :
86+
To start contributing to core-ui, clone the repository:
13287

13388
```sh
13489
git clone [email protected]:scality/core-ui.git
13590
```
13691

137-
then install the dependancies :
92+
then install the dependancies:
13893

13994
```sh
14095
npm install
14196
```
14297

14398
### Create a new branch
14499

145-
Give your branch an explicit name with the reference to the Jira ticket or issue if it exists, and prefix it with :
100+
Give your branch an explicit name with the reference to the Jira ticket or issue if it exists, and prefix it with:
146101

147102
- feature/ for new component or major component update : `feature/TICKET-123-some-feature`
148103
- improvement/ for code improvement, component update : `improvement/TICKET-456-some-improvement`
@@ -183,7 +138,7 @@ When creating a new version of an existing component, expose it in `src/lib/next
183138

184139
You can use storybook to help with the development.
185140
Storybook helps to test and vizualize component in isolation.
186-
If it doesn't exist, write a [story](https://storybook.js.org/docs/get-started/whats-a-story) for the component :
141+
If it doesn't exist, write a [story](https://storybook.js.org/docs/get-started/whats-a-story) for the component:
187142

188143
```jsx
189144
// in stories/example/example.stories.tsx
@@ -200,10 +155,9 @@ type Story = StoryObj<typeof Example>;
200155
export const Default: Story = {
201156
render: () => <Example />,
202157
};
203-
204158
```
205159

206-
then launch storybook :
160+
Then launch storybook:
207161

208162
```sh
209163
npm run storybook
@@ -213,7 +167,7 @@ Storybook will be launched on `http://localhost:3000`.
213167

214168
### Lint
215169

216-
To make sure your code is correctly lint, run :
170+
To make sure your code is correctly lint, run:
217171

218172
```sh
219173
npm run lint
@@ -225,13 +179,13 @@ It will run ESLint by using `eslint-config-react-app` which is a shareable ESLin
225179

226180
Build tests with [jest](https://jestjs.io/)
227181

228-
Make sure to write tests that cover all cases, then you can run all tests with :
182+
Make sure to write tests that cover all cases, then you can run all tests with:
229183

230184
```sh
231185
npm run test
232186
```
233187

234-
or run a specific test with :
188+
Or run a specific test with:
235189

236190
```sh
237191
npm run test Example.test.tsx
@@ -241,7 +195,6 @@ npm run test Example.test.tsx
241195

242196
Core-UI uses [storybook](https://storybook.js.org/) for its documentation. \
243197
Illustrate use cases and state variations with [stories](https://storybook.js.org/docs/writing-stories).
244-
All stories should be type.
245198

246199
If possible create or update the component guideline.
247200
This guideline is an MDX file containing details about the component usage and is illustrated with the stories write in stories.tsx file.
@@ -259,29 +212,23 @@ import * as ExampleStories from './Example.stories';
259212
An Example component is used for example.
260213
261214
<Canvas of={ExampleStories.Default} />
262-
263215
```
264216

265-
### Pull request
266-
267-
Push your code on the repository
268-
269-
```sh
270-
git push origin <branch-name>
271-
```
217+
### Contributing
272218

273-
then create a `Pull Request`.
274-
Pull request needs to be approved by at least one reviewer.
275-
After your PR is approved you can comment `/approve`
219+
- Push your code on a branch following the [branch naming convention](#create-a-new-branch)
220+
- Create a pull request.
221+
- Obtain the approval of at least one reviewer.
222+
- Then comment with `/approve` to merge the PR.
276223

277224
### Release
278225

279226
After merging one or more PR in Core-UI, it is possible to plublish a new release.
280-
In the Core-UI repo, follow these steps :
227+
In the Core-UI repo, follow these steps:
281228

282229
1. Go on `Releases` then `Draft a new release`
283-
2. In the select menu `Choose a tag` : Create a new tag (the current tag increment by 1).
284-
3. You can now `Generate release notes` : it will add all the PR infos since the last release. \
230+
2. In the select menu `Choose a tag`: Create a new tag (the current tag increment by 1).
231+
3. You can now `Generate release notes`: it will add all the PR infos since the last release. \
285232
You can add details if necessary.
286233
4. `Publish release`
287234
5. It will create a PR that need to be approved.

src/lib/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,4 @@ export { InfoMessage } from './components/infomessage/InfoMessage.component';
8282
export { InputList } from './components/inputlist/InputList.component';
8383
export { InlineInput } from './components/inlineinput/InlineInput';
8484
export { UnsuccessfulResult } from './components/UnsuccessfulResult.component';
85+
export { CoreUITheme } from './style/theme';

src/lib/next.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ export { ChartTooltip } from './components/barchartv2/ChartTooltip';
2525
export { ChartLegendWrapper } from './components/chartlegend/ChartLegendWrapper';
2626
export { ChartLegend } from './components/chartlegend/ChartLegend';
2727
export { LineTimeSerieChart } from './components/linetimeseriechart/linetimeseriechart.component';
28+
export { CoreUITheme } from './style/theme';

0 commit comments

Comments
 (0)