Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/guidelines ds #692

Merged
merged 93 commits into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
ae55099
feat(delete): delete some files and unused components
samuel-gomez Oct 5, 2020
b16b810
fix(glyphicon): size alert, badge, modal
samuel-gomez Oct 5, 2020
228ff3e
doc(contributing): update file, delete demo info
samuel-gomez Oct 5, 2020
9019fa5
build(copyicon): update path copyicon
samuel-gomez Oct 5, 2020
97f6f80
build(contributors): add gulp task
samuel-gomez Oct 5, 2020
0510381
build(githubinfo): add gulp task
samuel-gomez Oct 5, 2020
13418cf
build(pug): update gulp task
samuel-gomez Oct 5, 2020
d27e425
feat(index): add general styles and headerlinks instance
samuel-gomez Oct 5, 2020
53ef2b5
feat(home): update pug
samuel-gomez Oct 5, 2020
f1d6ca4
feat(images): add all images
samuel-gomez Oct 5, 2020
62dcb36
feat(layout): update common layout pug
samuel-gomez Oct 5, 2020
6a46e65
feat(style): update common style
samuel-gomez Oct 5, 2020
3368745
feat(buttonlink): update buttonlink
samuel-gomez Oct 5, 2020
dbc51cb
feat(cards): update cards
samuel-gomez Oct 5, 2020
99994eb
feat(contributors): update contributors
samuel-gomez Oct 5, 2020
e3d8d96
feat(footer): update footer
samuel-gomez Oct 5, 2020
0aed736
feat(demo): update demo
samuel-gomez Oct 5, 2020
e30691c
feat(header): update header
samuel-gomez Oct 5, 2020
a3fa249
feat(menu): update menu
samuel-gomez Oct 5, 2020
42e5460
feat(headerlinks): add headerlinks
samuel-gomez Oct 5, 2020
c57bd2a
feat(encart): update encart
samuel-gomez Oct 5, 2020
85bbd75
feat(component): update content, img, introheader, logo, page, pageli…
samuel-gomez Oct 5, 2020
345a10a
feat(data): update data menu
samuel-gomez Oct 5, 2020
2419b19
build(gitignore): update pug icone ignore
samuel-gomez Oct 5, 2020
a1d666f
build(style): delete old
samuel-gomez Oct 5, 2020
f4b6ae6
feat(badge): update badge page
samuel-gomez Oct 5, 2020
d1a9451
feat(button): update button page
samuel-gomez Oct 5, 2020
66ebe44
feat(drawer): update drawer page
samuel-gomez Oct 5, 2020
2c7b253
feat(list): update list page
samuel-gomez Oct 5, 2020
4842b59
feat(loader): update loader page
samuel-gomez Oct 5, 2020
2eab70a
feat(popover): update popover page
samuel-gomez Oct 5, 2020
bbaffe7
feat(slider): update slider page
samuel-gomez Oct 5, 2020
e25a15a
feat(title): update title page
samuel-gomez Oct 5, 2020
a873398
feat(components): add components page
samuel-gomez Oct 5, 2020
21780af
feat(conduct): add code of conduct page
samuel-gomez Oct 5, 2020
f6c7bdb
feat(status): add component status page
samuel-gomez Oct 5, 2020
1a139cd
feat(contributors): add contributors page
samuel-gomez Oct 5, 2020
c2ff711
feat(changelog): add changelog page
samuel-gomez Oct 5, 2020
ad7de68
feat(issue): add issue page
samuel-gomez Oct 5, 2020
2db0f58
feat(howto): add howto page
samuel-gomez Oct 5, 2020
40c419a
feat(github): add github page
samuel-gomez Oct 5, 2020
afc67cb
feat(getstarted): add getstarted page
samuel-gomez Oct 5, 2020
591bd64
feat(access): add accessibility page
samuel-gomez Oct 5, 2020
218283f
feat(anim): add anim page
samuel-gomez Oct 5, 2020
e931226
feat(color): add color page
samuel-gomez Oct 5, 2020
b89a817
feat(content): add content page
samuel-gomez Oct 5, 2020
e2c3d8e
feat(content): add grid page
samuel-gomez Oct 5, 2020
6e2c29f
feat(icones): add icones page
samuel-gomez Oct 5, 2020
6ee717d
feat(spaces): add spaces page
samuel-gomez Oct 5, 2020
de435c7
feat(typo): add typo page
samuel-gomez Oct 5, 2020
3546cb7
feat(guidelines): add guidelines page
samuel-gomez Oct 5, 2020
d2ec5e0
feat(home): update home page
samuel-gomez Oct 5, 2020
78f2d83
feat(alert): update alert page
samuel-gomez Oct 5, 2020
b8c644a
feat(footer): update footer page
samuel-gomez Oct 5, 2020
2836b14
feat(checkbox): update checkbox page
samuel-gomez Oct 5, 2020
531c53e
feat(datepicker): update datepicker page
samuel-gomez Oct 5, 2020
83b83c1
feat(file): update formfile page
samuel-gomez Oct 5, 2020
f5f54c1
feat(pass): update pass page
samuel-gomez Oct 5, 2020
e281cdd
feat(radio): update radio page
samuel-gomez Oct 5, 2020
d44453e
feat(radioswitch): update radio switch page
samuel-gomez Oct 5, 2020
63d3705
feat(select): update select page
samuel-gomez Oct 5, 2020
cd7a4c8
feat(textinpu): update textinput page
samuel-gomez Oct 5, 2020
83abb29
feat(textarea): update textarea page
samuel-gomez Oct 5, 2020
c33b15f
feat(nav): update nav page
samuel-gomez Oct 5, 2020
4855fa7
feat(pager): update pager page
samuel-gomez Oct 5, 2020
3da4a7d
feat(step): update step page
samuel-gomez Oct 5, 2020
1c15484
feat(stepnew): update step new page
samuel-gomez Oct 5, 2020
304d330
feat(table): update table page
samuel-gomez Oct 5, 2020
5fd0993
feat(tabs): update tabs page
samuel-gomez Oct 5, 2020
ab638c0
feat(titlebar): update titlebar page
samuel-gomez Oct 5, 2020
1a52fd6
feat(accordion): update accordion page
samuel-gomez Oct 5, 2020
f7f8a35
feat(footerclient): update footer-client page
samuel-gomez Oct 5, 2020
8b5df02
feat(form): update form page
samuel-gomez Oct 5, 2020
5489bd0
feat(formcard): update formcard page
samuel-gomez Oct 5, 2020
56f90e7
feat(formfilter): update formfilter page
samuel-gomez Oct 5, 2020
55676ba
feat(formfilterinline): update formfilterinline page
samuel-gomez Oct 5, 2020
76f04a5
feat(header): update header page
samuel-gomez Oct 5, 2020
e15af3d
feat(modal): update modal page
samuel-gomez Oct 5, 2020
685f1c5
feat(paging): update paging page
samuel-gomez Oct 5, 2020
18f41a5
feat(panel): update panel page
samuel-gomez Oct 5, 2020
97f16c9
feat(restit): update restit page
samuel-gomez Oct 5, 2020
12119a6
feat(fullform): update full form page
samuel-gomez Oct 5, 2020
7ec53dd
feat(fulltable): update full table page
samuel-gomez Oct 5, 2020
924d45e
feat(disabled): update disabled page
samuel-gomez Oct 5, 2020
a39dd34
feat(loading): add loading page
samuel-gomez Oct 6, 2020
62d9321
feat(overtaking): add overtaking page
samuel-gomez Oct 6, 2020
04837f6
feat(progress): add progress page
samuel-gomez Oct 6, 2020
d2fb509
feat(regress): add regress page
samuel-gomez Oct 6, 2020
8c4018f
feat(pattern): add pattern page
samuel-gomez Oct 6, 2020
5a1d221
build(ingore): contributors generate pug
samuel-gomez Oct 6, 2020
22c4559
feat(home): update content
samuel-gomez Oct 6, 2020
9568639
doc(contributing): update docs
samuel-gomez Oct 6, 2020
d10b257
ci(contributing): delete old css task npm
samuel-gomez Oct 6, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ tmp/
.vs

# Ignore icons pug file generate by Gulp task
storybook/design-system/src/pages/style/icons/templates/*.pug
storybook/design-system/src/pages/guidelines/icones/templates/*.pug
storybook/design-system/src/pages/get-started/contributors/templates/contributors-page.pug

# Ignore package-lock.json / yarn.lock in dependencies
packages/**/package-lock.json
Expand Down
57 changes: 16 additions & 41 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to @axa-fr/react-toolkit

First, ensure you have Node.js < 12 and the [latest `npm`](https://docs.npmjs.com/).
## Installation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removed the 1st level block? I think it should be kept (MDLint fails on this). Plus, it gives the title of the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just wanted to delete the node version requirement. i didn't want to delete the title. i'll fixed it, thank you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in last commit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


To get started with the repository:

Expand All @@ -10,42 +10,30 @@ cd react-toolkit
npm install
```

A post-install action is thrown. This action first install dependencies with ```lerna bootstrap``` & then build all packages with a custom command gulp.
A post-install action is thrown. This action first install dependencies with `lerna bootstrap` & then build all packages with a custom command gulp.

At this point you are ready to contribute.

## Additional installations

This repository contains some projects used to display, explain components built previously.

* *examples/demo* : a project using some components & react-oidc library
* *storybook* :
* *design-system*: a design system web app rendering & exposing code to use components
* *storybook*: a storybook app to develop in isolated mode
* *styles*: part of design sytem & use as an explaination page of toolkit style


```bash
├───storybook
│ ├───design-system : a design system web app rendering & exposing code to use components
│ ├───storybook : a storybook app to develop in isolated mode
```

If you want to use these projects, you must:

```sh
cd examples/demo
npm i
```

```sh
cd storybook/design-system
npm i
npm ci
```

```sh
cd storybook/storybook
npm i
```

```sh
cd storybook/styles
npm i
npm ci
```

## How to work on a component
Expand All @@ -56,39 +44,28 @@ Into a terminal, to start to develop a component you can run
npm run dev
```

Or,if you want to run your component in watch mode, execting one of command below
Or, if you want to run your component in watch mode, execting one of command below

```sh
# If your component is in js
npm run dev:js -- --scope=@axa-fr/react-toolkit-status

# If your component is in TypeScript
npm run dev:ts -- --scope=@axa-fr/react-toolkit-action
```

*scope* refer to package name of your component you are working on.
_scope_ refer to package name of your component you are working on.

And then if you want to work on it, in isolation mode, you can run storybook

```sh
npm run storybook
```

After all this, if your development affect css, you can run

```sh
npx gulp all
```

to regenerate css
After all this, if your development affect css, you can run `npm run style` to regenerate css

## Other usefull commands

### Launch demo app

```sh
npm start
```

### Run unit tests

```sh
Expand All @@ -99,9 +76,9 @@ By default, `npm test` also runs the linter.
You can skip this by calling `jest` directly:

```sh
$ npx jest
$ npx jest --watch
$ npx jest --config jest.config.json
$ npm jest
$ npm jest --watch
$ npm jest --config jest.config.json
# etc
```

Expand All @@ -111,8 +88,6 @@ $ npx jest --config jest.config.json
npm test -- --coverage
```



## Pull Request

Please respect the following [PULL_REQUEST_TEMPLATE.md](./PULL_REQUEST_TEMPLATE.md)
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
"storybook:build": "npm -C ./storybook/storybook run storybook:build",
"design": "npm -C ./storybook/design-system run start",
"design:build": "npm -C ./storybook/design-system run build",
"css": "npm -C ./storybook/styles run css",
"css:build": "npm -C ./storybook/styles run css:build",
"test": "jest --config jest.config.json",
"cover": "jest --no-cache --config ./jest.config.json --coverage",
"lint": "npm run lint:js && npm run lint:ts **/*.ts",
Expand Down
1 change: 1 addition & 0 deletions packages/Form/filter/src/filter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
margin-right: 0.3125rem;
color: $color-filter-selected-glyphicon-close;
cursor: pointer;
width: 22px;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/Modal/default/src/modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
bottom: 0;
left: 0;
z-index: 1040;
background-color: $color;
background-color: $color-axa;

&.show {
opacity: 0.5;
Expand Down
1 change: 1 addition & 0 deletions packages/alert/src/alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ $typesLite: (
top: 50%;
margin-top: -50%;
display: block;
width: 22px;
}
}

Expand Down
3 changes: 3 additions & 0 deletions packages/badge/src/badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ $types: (
display: inline-block;
min-width: 38px;
padding-top: 0.4rem;
.glyphicon {
width: 22px;
}
}
}
4 changes: 2 additions & 2 deletions storybook/design-system/gulpfile.babel.js/copyIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import config from './config';

const { pathSrc, pathDest, pathFontToolkit } = config;

const pathIconPugTemplate = path.join(`${pathSrc}/pages/style/icons/`, 'templates');
const pathIconPugTemplate = path.join(`${pathSrc}/pages/guidelines/icones/`, 'templates');

const copyIcons = () => src(`${pathFontToolkit}/*.svg`).pipe(dest(`${pathDest}/iconsToolkit`));

Expand Down Expand Up @@ -40,7 +40,7 @@ ul.icons-list\n`;
contentFile += ` span.icons-list__item-name ${svgFile} \n`;
});

fs.writeFileSync(`${pathSrc}/pages/style/icons/templates/icons-page.pug`, contentFile);
fs.writeFileSync(`${pathIconPugTemplate}/icons-page.pug`, contentFile);
};

export default copyIcons;
48 changes: 48 additions & 0 deletions storybook/design-system/gulpfile.babel.js/generateContributors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* eslint-disable arrow-parens */
import path from 'path';
import fs from 'fs';
import config from './config';

const { pathSrc } = config;

const pathContributorsPugTemplate = path.join(
`${pathSrc}/pages/get-started/contributors/`,
'templates',
);

const getContributors = async () => {
const response = await fetch(
'https://api.github.com/repos/AxaGuilDEv/react-toolkit/stats/contributors',
);
const responseJson = await response.json();
return responseJson;
};

const generateContributors = async () => {
const contributors = await getContributors();
const reservedContributors = contributors.reverse();
let contentFile = '.tk-contributors\n';

reservedContributors.forEach((contributor, index) => {
const { author, total, weeks } = contributor;
const { avatar_url: avatarUrl, html_url: htmlUrl, login } = author;
const additions = weeks.map(({ a }) => a).reduce((acc, curr) => acc + curr);
const deletions = weeks.map(({ d }) => d).reduce((acc, curr) => acc + curr);

contentFile += ' .tk-contributor\n';
contentFile += ` a.tk-contributor__link(href="${htmlUrl}" title="${login}") ${login}\n`;
contentFile += ` img.tk-contributor__avatar(src="${avatarUrl}" loading="lazy")\n`;
contentFile += ` span.tk-contributor__badge #${index + 1}\n`;
contentFile += ` span.tk-contributor__commits Commits : ${total}\n`;
contentFile += ` span.tk-contributor__additions Additions : ${additions} ++\n`;
contentFile += ` span.tk-contributor__deletions Deletions : ${deletions} --\n`;
});

if (!fs.existsSync(pathContributorsPugTemplate)) {
fs.mkdirSync(pathContributorsPugTemplate, { recursive: true });
}

fs.writeFileSync(`${pathContributorsPugTemplate}/contributors-page.pug`, contentFile);
};

export default generateContributors;
20 changes: 20 additions & 0 deletions storybook/design-system/gulpfile.babel.js/generateGithubInfos.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* eslint-disable arrow-parens */
import fs from 'fs';
import config from './config';

const { pathSrc } = config;

const files = ['CHANGELOG', 'CONTRIBUTING', 'CODE_OF_CONDUCT'];
const components = ['changelog', 'how-to-contribute', 'code-of-conduct'];

const generateGithubInfos = async () => {
files.forEach((file, index) => {
const content = fs.readFileSync(`../../${file}.md`, 'utf8');
fs.writeFileSync(
`${pathSrc}/pages/get-started/${components[index]}/markdown/content.md`,
content,
);
});
};

export default generateGithubInfos;
17 changes: 16 additions & 1 deletion storybook/design-system/gulpfile.babel.js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,34 @@ import copyAssets, { copyImages } from './copy';
import sprite from './sprite';
import serve from './serve';
import copyIcons, { generatePugIcons } from './copyIcons';
import generateGithubInfos from './generateGithubInfos';
import generateContributors from './generateContributors';

const reloadImages = series(cleanImages, copyImages);
const build = series(
clean,
copyIcons,
generateGithubInfos,
generatePugIcons,
jsProd,
sassProd,
sprite,
pugProd,
copyAssets,
);
const dev = series(clean, copyIcons, generatePugIcons, jsDev, sassDev, pugDev, copyAssets, serve);

const dev = series(
clean,
generateContributors,
copyIcons,
generateGithubInfos,
generatePugIcons,
jsDev,
sassDev,
pugDev,
copyAssets,
serve,
);

export default build;
export {
Expand Down
2 changes: 1 addition & 1 deletion storybook/design-system/gulpfile.babel.js/pug.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ const pugTsk = (baseurl = '') => {

return src([
`${pathSrc}/index.pug`,
`${pathSrc}/pages/**/index.pug`,
`${pathSrc}/pages/**/iframe-*.pug`,
`${pathSrc}/pages/**/index.pug`,
])
.pipe(plumber())
.pipe(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions storybook/design-system/src/assets/images/accordion.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading