Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test/integration/**/* linguist-documentation
.eslintrc.js linguist-documentation
src/bin/copy-dsapitech-to-public.ts -linguist-detectable
src/bin/copy-dsfr-to-public.ts -linguist-detectable
src/bin/only-include-used-icons.ts -linguist-detectable
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ jspm_packages

.DS_Store

/dist
/.yarn_home
/dsapitech
/dsfr
/src/fr/generatedFromCss
/storybook-static

Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ node_modules/
/CHANGELOG.md
/.yarn_home/
/test/integration/
/dsapitech/
/dsfr/
/src/fr/generatedFromCss/
/storybook-static/
14 changes: 7 additions & 7 deletions .storybook/DocsContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import React, { useEffect } from "react";
import { DocsContainer as BaseContainer } from "@storybook/addon-docs";
import { useDarkMode } from "storybook-dark-mode";
import { darkTheme, lightTheme } from "./customTheme";
import "../dist/dsapitech/utility/icons/icons.min.css";
import "../dist/dsapitech/dsapitech.css";
import "../dist/dsfr/utility/icons/icons.min.css";
import "../dist/dsfr/dsfr.css";
import { useIsDark } from "../dist/useIsDark";
import { startReactDsapitech } from "../dist/spa";
import { startReactDsfr } from "../dist/spa";
import { fr } from "../dist/fr";
import { MuiDsapitechThemeProvider } from "../dist/mui";
import { MuiDsfrThemeProvider } from "../dist/mui";

startReactDsapitech({
startReactDsfr({
"defaultColorScheme": "system",
"useLang": () => "fr"
});
Expand Down Expand Up @@ -70,9 +70,9 @@ export const DocsContainer = ({ children, context }) => {
}
}}
>
<MuiDsapitechThemeProvider>
<MuiDsfrThemeProvider>
{children}
</MuiDsapitechThemeProvider>
</MuiDsfrThemeProvider>
</BaseContainer>
</>
);
Expand Down
4 changes: 2 additions & 2 deletions .storybook/customTheme.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { create } from "@storybook/theming";

const brandImage= "logo.png";
const brandTitle= "@apitech/react-dsapitech";
const brandUrl= "https://github.com/ApitechFR/react-dsapitech";
const brandTitle= "@codegouvfr/react-dsfr";
const brandUrl= "https://github.com/codegouvfr/react-dsfr";
const fontBase= '"Marianne", arial, sans-serif';
const fontCode= "monospace";

Expand Down
24 changes: 12 additions & 12 deletions .storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<link rel="apple-touch-icon" href="/dsapitech/favicon/apple-touch-icon.png" />
<link rel="icon" href="/dsapitech/favicon/favicon.svg" type="image/svg+xml" />
<link rel="shortcut icon" href="/dsapitech/favicon/favicon.ico" type="image/x-icon" />
<link rel="manifest" href="/dsapitech/favicon/manifest.webmanifest" crossorigin="use-credentials" />
<link rel="stylesheet" href="/dsapitech/fonts/index.css" />
<link rel="apple-touch-icon" href="/dsfr/favicon/apple-touch-icon.png" />
<link rel="icon" href="/dsfr/favicon/favicon.svg" type="image/svg+xml" />
<link rel="shortcut icon" href="/dsfr/favicon/favicon.ico" type="image/x-icon" />
<link rel="manifest" href="/dsfr/favicon/manifest.webmanifest" crossorigin="use-credentials" />
<link rel="stylesheet" href="/dsfr/fonts/index.css" />

<!-- Meta tags generated by metatags.io -->
<!-- Primary Meta Tags -->
<title>react-dsapitech components</title>
<meta name="title" content="react-dsapitech components">
<meta name="description" content="@apitech/react-dsapitech components playground and showcase">
<title>react-dsfr components</title>
<meta name="title" content="react-dsfr components">
<meta name="description" content="@codegouvfr/react-dsfr components playground and showcase">


<!-- Facebook Meta Tags -->
<meta property="og:url" content="/">
<meta property="og:type" content="website">
<meta property="og:title" content="react-dsapitech components">
<meta property="og:description" content="@apitech/react-dsapitech components playground and showcase">
<meta property="og:title" content="react-dsfr components">
<meta property="og:description" content="@codegouvfr/react-dsfr components playground and showcase">
<meta property="og:image" content="/repo-card.png">

<!-- Twitter Meta Tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="react-dsapitech components">
<meta name="twitter:description" content="@apitech/react-dsapitech components playground and showcase">
<meta name="twitter:title" content="react-dsfr components">
<meta name="twitter:description" content="@codegouvfr/react-dsfr components playground and showcase">
<meta name="twitter:image" content="/repo-card.png">

<style>
Expand Down
2 changes: 1 addition & 1 deletion .storybook/static/CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
components.react-dsapitech.codegouv.studio
components.react-dsfr.codegouv.studio
56 changes: 28 additions & 28 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
`Hello friends 👋,

Would you help us implement [the components](https://www.apitech.fr/elements-d-interface/composants/accordeon)?
Would you help us implement [the components](https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/accordeon)?
Thank you so much to anyone that would!

To get you started you can check out [the `<Alert />` component](https://components.react-dsapitech.codegouv.studio/?path=/docs/components-alert--default).
To get you started you can check out [the `<Alert />` component](https://components.react-dsfr.codegouv.studio/?path=/docs/components-alert--default).

- Here is it's definition from the SIG: [apitech.fr/elements-d-interface/composants/alerte](https://www.apitech.fr/elements-d-interface/composants/alerte) (Pro tip: the real source of truth for DSApitech component is [here](https://main--ds-gouv.netlify.app/example/component/))
- Here is its implementation [src/Alert.tsx](https://github.com/ApitechFR/react-dsapitech/blob/main/src/Alert.tsx)
- Here is the file that generates its documentation: [stories/Alert.stories.tsx](https://github.com/ApitechFR/react-dsapitech/blob/main/stories/Alert.stories.tsx)
- Here is it's definition from the SIG: [systeme-de-design.gouv.fr/elements-d-interface/composants/alerte](https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/alerte) (Pro tip: the real source of truth for DSFR component is [here](https://main--ds-gouv.netlify.app/example/component/))
- Here is its implementation [src/Alert.tsx](https://github.com/codegouvfr/react-dsfr/blob/main/src/Alert.tsx)
- Here is the file that generates its documentation: [stories/Alert.stories.tsx](https://github.com/codegouvfr/react-dsfr/blob/main/stories/Alert.stories.tsx)

[Here are the few commands](https://github.com/ApitechFR/react-dsapitech#development) you need to run to set up your dev environment.
[Here are the few commands](https://github.com/codegouvfr/react-dsfr#development) you need to run to set up your dev environment.

_If you want to link your development version into your own project it's possible, just [ask me how](https://github.com/ApitechFR/react-dsapitech/discussions)._
_If you want to link your development version into your own project it's possible, just [ask me how](https://github.com/codegouvfr/react-dsfr/discussions)._

A few things:

- 🙏🏻 Don't be afraid to push even if you aren't 100% happy with your code or [if it's still WIP](https://github.com/ApitechFR/react-dsapitech/blob/1fdcf15cb085c67d37c31badf6ffa4725795ba0f/stories/Accordion.stories.tsx#L6).
- 📣 Let everyone know what component you are working on by [oppening an issue](https://github.com/ApitechFR/react-dsapitech/issues).
- 📚 You can draw inspiration from [`dataesr/react-dsapitech`](https://github.com/dataesr/react-dsapitech/tree/master/src/components/interface) and the implementation of [france connect](https://github.com/france-connect/sources/tree/main/front/libs/dsapitech).
- 🔗 Use the component returned by `getLink()` instead of `<a />`. [Example in the `<Header />` component](https://github.com/ApitechFR/react-dsapitech/blob/bbaf4a81d78de08d6fdcb059a9f4cb8a78ce4d5a/src/Header.tsx#L84-L87). We want to [play nice with all routing libraries](https://react-dsapitech.codegouv.studio/integration-with-routing-libraries).
- 🕹️ When it's relevant, try to enable components to be used either in controlled or uncontrolled mode. [Example with <Tabs />](https://components.react-dsapitech.codegouv.studio/?path=/docs/components-tabs--default).
- 🌎 Avoid hard coding text in JSX, use [the i18n mechanism](https://react-dsapitech.codegouv.studio/i18n) instead. [Here is an example](https://github.com/ApitechFR/react-dsapitech/blob/bbaf4a81d78de08d6fdcb059a9f4cb8a78ce4d5a/src/DarkModeSwitch.tsx#L162-L199). (Don't worry about providing translations other than French.)
- 🍳 If you have to arbitrate between ease of use and customisability I'd encourage you to favor ease of use. People that would need a greater level of customizability can always fall back to making their own wrapper from the reference documentation using [`fr.cx()`](https://react-dsapitech.codegouv.studio/cx).
- 🙏🏻 Don't be afraid to push even if you aren't 100% happy with your code or [if it's still WIP](https://github.com/codegouvfr/react-dsfr/blob/1fdcf15cb085c67d37c31badf6ffa4725795ba0f/stories/Accordion.stories.tsx#L6).
- 📣 Let everyone know what component you are working on by [oppening an issue](https://github.com/codegouvfr/react-dsfr/issues).
- 📚 You can draw inspiration from [`dataesr/react-dsfr`](https://github.com/dataesr/react-dsfr/tree/master/src/components/interface) and the implementation of [france connect](https://github.com/france-connect/sources/tree/main/front/libs/dsfr).
- 🔗 Use the component returned by `getLink()` instead of `<a />`. [Example in the `<Header />` component](https://github.com/codegouvfr/react-dsfr/blob/bbaf4a81d78de08d6fdcb059a9f4cb8a78ce4d5a/src/Header.tsx#L84-L87). We want to [play nice with all routing libraries](https://react-dsfr.codegouv.studio/integration-with-routing-libraries).
- 🕹️ When it's relevant, try to enable components to be used either in controlled or uncontrolled mode. [Example with <Tabs />](https://components.react-dsfr.codegouv.studio/?path=/docs/components-tabs--default).
- 🌎 Avoid hard coding text in JSX, use [the i18n mechanism](https://react-dsfr.codegouv.studio/i18n) instead. [Here is an example](https://github.com/codegouvfr/react-dsfr/blob/bbaf4a81d78de08d6fdcb059a9f4cb8a78ce4d5a/src/DarkModeSwitch.tsx#L162-L199). (Don't worry about providing translations other than French.)
- 🍳 If you have to arbitrate between ease of use and customisability I'd encourage you to favor ease of use. People that would need a greater level of customizability can always fall back to making their own wrapper from the reference documentation using [`fr.cx()`](https://react-dsfr.codegouv.studio/cx).

## PR Reviews

Expand All @@ -41,41 +41,41 @@ https://user-images.githubusercontent.com/6702424/206940923-8d2d1113-8b81-4f61-8

Thank You Very Much ❤️

PS: If you want to contribute to the Doc website. You can edit [the source Markdown](https://github.com/ApitechFR/react-dsapitech/tree/v1_docs) or ask me for access to our GitBook. (We'll migrate to Docusaurus once we have the DSApitech theme for it ready.)
PS: If you want to contribute to the Doc website. You can edit [the source Markdown](https://github.com/codegouvfr/react-dsfr/tree/v1_docs) or ask me for access to our GitBook. (We'll migrate to Docusaurus once we have the DSFR theme for it ready.)

## Linking your local copy of `@apitech/react-dsapitech` in your project
## Linking your local copy of `@codegouvfr/react-dsfr` in your project

This will enable you to see your react-dsapitech changes in your main project.
This will enable you to see your react-dsfr changes in your main project.

```bash
cd ~/github
git clone https://github.com/ORG/YOUR-PROJECT-USING-REACT-DSApitech
cd YOUR-PROJECT-USING-REACT-DSApitech
git clone https://github.com/ORG/YOUR-PROJECT-USING-REACT-DSFR
cd YOUR-PROJECT-USING-REACT-DSFR
yarn # or npm install or pnpm install depending of what you are using...

cd ~/github
git clone https://github.com/ApitechFR/react-dsapitech
cd react-dsapitech
git clone https://github.com/codegouvfr/react-dsfr
cd react-dsfr
yarn
yarn build
yarn link-external YOUR-PROJECT-USING-REACT-DSApitech
yarn link-external YOUR-PROJECT-USING-REACT-DSFR
npx tsc -w -p src # Leave this running if you want hot reload.
```

## Linking a working version of `@apitech/dsapitech` (For the SIG)
## Linking a working version of `@gouvfr/dsfr` (For the SIG)

```bash
cd ~/github
git clone http://github.com/gouvernementfr/dsapitech
cd dsapitech
git clone http://github.com/gouvernementfr/dsfr
cd dsfr
# git checkout my-working-branch
yarn
yarn build --clean
yarn link
cd ~/github/react-dsapitech
cd ~/github/react-dsfr
yarn
yarn link @apitech/dsapitech
yarn link @gouvfr/dsfr
yarn build
```

Now `~/github/react-dsapitech/node_modules/@apitech/dsapitech` links to `~/github/@apitech/dsapitech`.
Now `~/github/react-dsfr/node_modules/@gouvfr/dsfr` links to `~/github/@gouvfr/dsfr`.
Loading
Loading