Skip to content

Commit 7fb318b

Browse files
Merge branch 'main' into feat/range-and-segmented
2 parents 6e13602 + 10be541 commit 7fb318b

12 files changed

+230
-98
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ A few things:
1818
- 🙏🏻 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).
1919
- 📣 Let everyone know what component you are working on by [oppening an issue](https://github.com/codegouvfr/react-dsfr/issues).
2020
- 📚 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).
21-
- 🔗 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://guides.react-dsfr.fr/integration-with-routing-libraries).
21+
- 🔗 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).
2222
- 🕹️ 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).
23-
- 🌎 Avoid hard coding text in JSX, use [the i18n mechanism](https://guides.react-dsfr.fr/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.)
24-
- 🍳 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://guides.react-dsfr.fr/cx).
23+
- 🌎 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.)
24+
- 🍳 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).
2525

2626
## PR Reviews
2727

README.fr.md

Lines changed: 75 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -26,80 +26,106 @@
2626
<a href="https://stackblitz.com/edit/nextjs-j2wba3?file=pages/index.tsx">essai immédiat</a>
2727
</p>
2828

29-
> ATTENTION: Ce design système a uniquement vocation à être utilisé pour des sites officiels de l'état.
30-
> Son but est de rendre la parole de l'état clairement identifiable. [Consulter le CGU](https://www.systeme-de-design.gouv.fr/utilisation-et-organisation/perimetre-d-application)
29+
> AVERTISSEMENT : Ce système de conception est uniquement destiné à être utilisé pour les sites web officiels des services publics français.
30+
> Son objectif principal est de faciliter l'identification des sites gouvernementaux par les citoyens. [Voir les conditions](https://www.systeme-de-design.gouv.fr/utilisation-et-organisation/perimetre-d-application).
3131
32-
> 🗣️ L'enregistrement de l'atelier de présentation de la librairie est disponible [ici](https://bbb-dinum-scalelite.visio.education.fr/playback/presentation/2.3/22298bc9d93b53540248207bc3f9e31260f3b4f1-1670578779094).
33-
34-
Ce module NPM est une surcouche de compatibilité React pour [@gouvfr/dsfr](https://www.npmjs.com/package/@gouvfr/dsfr), l'implémentation officielle de référence du
35-
DSFR en pur JavaScript/CSS.
32+
Ce module est une boîte à outils avancée qui tire parti de [@gouvfr/dsfr](https://github.com/GouvernementFR/dsfr), l'implémentation en JS/CSS vanilla du DSFR.
3633

3734
<a href="https://youtu.be/5q88JgXUAY4">
3835
<img width="1712" alt="image" src="https://user-images.githubusercontent.com/6702424/224423044-c1823249-eab6-4844-af43-d059c01416af.png">
3936
</a>
4037

41-
> Bien que cette bibliothèque soit écrite en TypeScript, l'utilisation de TypeScript dans votre application est facultative (mais recommandée car elle présente des avantages exceptionnels pour vous et votre base de code).
42-
43-
- [x] une interface de programmation strictement typée et bien documentée.
44-
- [x] Garantie d'être toujours à jour avec les [dernières évolutions du DSFR](https://www.systeme-de-design.gouv.fr/).
45-
Une grande partie du code et du typage est généré procéduralement à partir de la feuille de style de référence: [`@gouvfr/dsfr`](https://www.npmjs.com/package/@gouvfr/dsfr)`/dist/dsfr.css`.
46-
- [x] exactement le même aspect et ressenti qu'avec [@gouvfr/dsfr](https://www.npmjs.com/package/@gouvfr/dsfr), il s'agit d'une couche de compatibilité et non pas d'une implémentation alternative.
47-
- [x] pas de [flash d'écran blanc lors du basculement automatique du thème clair vers le thème sombre](https://github.com/codegouvfr/@codegouvfr/react-dsfr/issues/2#issuecomment-1257263480).
48-
- [x] la plupart des composants peuvent être rendus directement sur le serveur (voir [RSC](https://reactjs.org/blog/2020/12/21/data-fetching-with-react-server-components.html)). Les autres sont étiquetés `"use client";`.
49-
- [x] [Intégration clef en main pour les différents frameworks de développement: vite, Next.js, y compris la version beta de Next 13 (configuration AppDir) et Create React App](https://guides.react-dsfr.fr/) si votre
50-
framework n'est pas supporté, il suffit de demander notre **il manque un mot là** , nous avons pour but de couvrir tous les cas d'usage effectifs.
51-
- [x] (Presque) tout [les composants de référence](https://www.systeme-de-design.gouv.fr/elements-d-interface) sont [implémenté](https://components.react-dsfr.codegouv.studio/).
52-
- [x] seulement le code des composants que vous utilisez effectivement sera inclus dans votre projet final.
53-
- [x] Intégration facultative avec [MUI](https://mui.com/). Si vous utilisez des composants MUI ils seront automatiquement adaptés pour ressembler à des composants DSFR.
54-
Voir la [documentation](https://guides.react-dsfr.fr/mui-integration).
55-
- [x] permet de développer à l'aide d'outil de CSS-in-JS comme [Styled component](https://styled-components.com/), [Emotion](https://emotion.sh/docs/introduction) ou [TSS](https://www.tss-react.dev/).
56-
- [x] prévoit un système de traduction pour les textes présents dans les composants (i18n).
57-
- [x] [s'intègre avec les librairies de routing](https://guides.react-dsfr.fr/routing) comme [React Router](https://reactrouter.com/en/main), [TanStack Router](https://tanstack.com/router/v1) ou encore [Type route](https://type-route.zilch.dev/).
58-
59-
> 💡 Besoin de pages de connexion au DSFR? Allez voir [keycloak-theme-dsfr](https://github.com/codegouvfr/keycloak-theme-dsfr).
38+
> Bien que ce module soit écrit en TypeScript, l'utilisation de TypeScript dans votre application est optionnelle (mais recommandée car elle apporte des avantages exceptionnels à la fois pour vous et votre base de code).
39+
40+
- [x] API entièrement TypeSafe, bien documentée.
41+
- [x] Toujours à jour avec les dernières évolutions du DSFR.
42+
Code et Types générés à partir de [`@gouvfr/dsfr`](https://www.npmjs.com/package/@gouvfr/dsfr)`/dist/dsfr.css`.
43+
- [x] Exactement le même aspect et ressenti qu'avec [@gouvfr/dsfr](https://www.npmjs.com/package/@gouvfr/dsfr).
44+
- [x] Pas de [flash blanc lors du rechargement dans la configuration SSR](https://github.com/codegouvfr/@codegouvfr/react-dsfr/issues/2#issuecomment-1257263480).
45+
- [x] La plupart des composants sont prêts pour les composants serveur. Les autres sont étiquetés avec `"use client";`
46+
- [x] [Intégration parfaite avec tous les principaux frameworks React : Next.js (PagesDir et AppDir), Create React App, Vue](https://react-dsfr.codegouv.studio/).
47+
- [x] (Presque) Tous [les composants](https://www.systeme-de-design.gouv.fr/elements-d-interface) sont [implémentés](https://components.react-dsfr.codegouv.studio/)
48+
- [x] Trois distributions modulables, choisissez les composants que vous importez. (Ce n'est pas tout dans un gros bundle .js)
49+
- [x] Intégration optionnelle avec [MUI](https://mui.com/). Si vous utilisez des composants MUI, ils seront
50+
automatiquement adaptés pour ressembler aux [composants DSFR](https://www.systeme-de-design.gouv.fr/elements-d-interface). Voir [documentation](https://react-dsfr.codegouv.studio/mui-integration).
51+
- [x] Activez CSS in JS en fournissant un hook `useColors()` qui expose les bonnes options de couleurs et décisions
52+
pour le schéma de couleurs actuellement activé.
53+
- [x] i18n en option, les textes intégrés peuvent être affichés en plusieurs langues et l'utilisateur peut fournir des traductions supplémentaires.
54+
- [x] [Support des bibliothèques de routage](https://react-dsfr.codegouv.studio/routing) comme react-router.
55+
56+
> 💡 Besoin de pages de connexion et d'inscription prêtes à l'emploi et conformes au DSFR ? Consultez [keycloak-theme-dsfr](https://github.com/codegouvfr/keycloak-theme-dsfr).
6057
6158
<p align="center">
62-
<a href="https://guides.react-dsfr.fr/">🚀 Commencer maintenant 🚀 </a>
59+
<a href="https://react-dsfr.codegouv.studio/">🚀 Commencez ici 🚀 </a>
6360
</p>
6461

65-
# Gouvernance du projet
62+
# Gouvernance
63+
64+
Ce module est un produit du pôle Logiciel libre et open source d'[Etalab](https://code.gouv.fr/en/mission/).
6665

67-
Ce travail est un produit de [CodeGouvFr](https://code.gouv.fr/fr/mission/), la mission logiciel libre de [la direction interministérielle du numérique](https://www.numerique.gouv.fr/dinum/) (DINUM).
66+
Ce projet est co-maintenu par des fonctionnaires de diverses administrations françaises :
6867

69-
Ce projet est co-maintenu par des agents de différentes administrations françaises.
68+
- [Julien Bouquillon](https://github.com/revolunet) - DNUM des ministères sociaux
69+
- [Dylan DECRULLE](https://github.com/ddecrulle) - Insee
70+
- [Enguerran Weiss](https://github.com/enguerranws) - Plateforme de l'Inclusion
7071

71-
- [Joseph Garrone](@garronej)
72-
- [Julien Bouquillon](@revolunet) - DNUM des ministeres sociaux
73-
- [Dylan DECRULLE](@ddecrulle) - Insee
74-
- [Enguerran Weiss](@enguerranws) - Plateforme de l'Inclusion
72+
Il est également co-maintenu par [Joseph Garrone](https://github.com/garronej), l'auteur original.
7573

76-
## Development
74+
## Développement
7775

7876
```bash
7977
git clone https://github.com/codegouvfr/react-dsfr
8078
cd react-dsfr
8179
yarn
8280

83-
# Démarrer Storybook
81+
# Démarrer storybook
8482
yarn storybook
8583

8684
# Démarrer les applications de test
87-
yarn start-cra
88-
yarn start-vite
89-
yarn start-next-pagesdir
90-
yarn start-next-appdir
85+
yarn start-cra # Pour tester dans une configuration Create React App
86+
yarn start-vite # Pour tester dans une configuration Vite
87+
yarn start-next-pagesdir # Pour tester dans une configuration Next.js 13 PagesDir (la configuration par défaut)
88+
yarn start-next-appdir # Pour tester dans une configuration Next.js 13 AppDir
9189

92-
# Executer tout les tests unitaires (test/runtime):
90+
# Exécuter tous les tests unitaires (test/runtime):
9391
yarn test
94-
# Executer, par exemple, uniquement le test test/runtime/cssVariable.test.ts
92+
# Exécuter uniquement test/runtime/cssVariable.test.ts (par exemple)
9593
npx vitest -t "Resolution of CSS variables"
9694
```
9795

98-
### Vous cherchez comment contribuer?
99-
100-
Tout d'abord, merci ! Voici [le guide de contribution](https://github.com/codegouvfr/react-dsfr/blob/main/CONTRIBUTING.md).
101-
102-
### Comment publier une nouvelle version sur NPM
103-
104-
Ce dépôt a été mis en place avec [garronej/ts-ci](https://github.com/garronej/ts-ci).
105-
Vous pouvez vous référer à la documentation de TS-CI pour comprendre le cycle de vie de ce projet.
96+
### Vous voulez contribuer ?
97+
98+
Merci ! Voir [le guide de contribution](https://github.com/codegouvfr/react-dsfr/blob/main/CONTRIBUTING.md).
99+
100+
### Comment publier une nouvelle version sur NPM, comment sortir une version bêta
101+
102+
Ce dépôt a été initialisé à partir de [garronej/ts-ci](https://github.com/garronej/ts-ci), consultez la
103+
documentation de ce starter pour comprendre le cycle de vie de ce dépôt.
104+
105+
## Cas d'utilisation
106+
107+
Quelques projets qui utilisent `@codegouvfr/react-dsfr`.
108+
109+
- [https://code.gouv.fr/sill](https://sill-preprod.lab.sspcloud.fr/)
110+
- https://cartes.gouv.fr
111+
- https://immersion-facile.beta.gouv.fr/
112+
- https://egapro.travail.gouv.fr/
113+
- https://maisondelautisme.gouv.fr/
114+
- https://refugies.info/fr
115+
- https://www.mediateur-public.fr/
116+
- https://signal.conso.gouv.fr/
117+
- https://observatoire.numerique.gouv.fr/
118+
- https://github.com/BaseAdresseNationale/adresse.data.gouv.fr
119+
- https://github.com/DISIC/observatoire.numerique.gouv.fr
120+
- https://github.com/DISIC/monfranceconnect
121+
- https://github.com/InseeFr/Lunatic-DSFR
122+
- https://github.com/EIG6-Geocommuns/lidarviz-front
123+
- https://github.com/EIG6-Geocommuns/geocommuns-core
124+
- https://github.com/SocialGouv/bpco-site
125+
- https://github.com/EIG6-ArtificIA/predictia_front
126+
- https://github.com/BaseAdresseNationale/bal-admin
127+
- https://github.com/etalab/sill-web
128+
- https://github.com/inclusion-numerique/mediature
129+
- https://territoiresentransitions.fr (peut-être)
130+
- https://potentiel.beta.gouv.fr
131+
- https://diagoriente.beta.gouv.fr

README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,33 @@ This module is an advanced toolkit that leverages [@gouvfr/dsfr](https://github.
4545
- [x] Exactly the same look and feel than with [@gouvfr/dsfr](https://www.npmjs.com/package/@gouvfr/dsfr).
4646
- [x] No [white flash when reloading in SSR setup](https://github.com/codegouvfr/@codegouvfr/react-dsfr/issues/2#issuecomment-1257263480).
4747
- [x] Most components are server component ready. The others are labeled with `"use client";`
48-
- [x] [Perfect integration with all major React framework: Next.js (PagesDir and AppDir), Create React App, Vue](https://guides.react-dsfr.fr/).
48+
- [x] [Perfect integration with all major React framework: Next.js (PagesDir and AppDir), Create React App, Vue](https://react-dsfr.codegouv.studio/).
4949
- [x] (Almost) All [the components](https://www.systeme-de-design.gouv.fr/elements-d-interface) are [implemented](https://components.react-dsfr.codegouv.studio/)
5050
- [x] Three shakable distribution, cherry pick the components you import. (It's not all in a big .js bundle)
5151
- [x] Optional integration with [MUI](https://mui.com/). If you use MUI components they will
52-
be automatically adapted to look like [DSFR components](https://www.systeme-de-design.gouv.fr/elements-d-interface). See [documentation](https://guides.react-dsfr.fr/mui-integration).
52+
be automatically adapted to look like [DSFR components](https://www.systeme-de-design.gouv.fr/elements-d-interface). See [documentation](https://react-dsfr.codegouv.studio/mui-integration).
5353
- [x] Enable CSS in JS by providing a `useColors()` hooks that exposes the correct colors options and decision
5454
for the currently enabled color scheme.
5555
- [x] Opt-in i18n, built in text can be displayed in multiple languages and user can provide extra translations.
56-
- [x] [Support routing libraries](https://guides.react-dsfr.fr/routing) like react-router.
56+
- [x] [Support routing libraries](https://react-dsfr.codegouv.studio/routing) like react-router.
5757

5858
> 💡 Need ready to use, DSFR compliant login and register pages? Checkout [keycloak-theme-dsfr](https://github.com/codegouvfr/keycloak-theme-dsfr).
5959
6060
<p align="center">
61-
<a href="https://guides.react-dsfr.fr/">🚀 Get started 🚀 </a>
61+
<a href="https://react-dsfr.codegouv.studio/">🚀 Get started 🚀 </a>
6262
</p>
6363

6464
# Governance
6565

6666
This module is a product of [Etalab's Free and open source software pole](https://code.gouv.fr/en/mission/).
6767

68-
This project is co-maintained by public servants from various French administrations.
68+
This project is co-maintained by public servants from various French administrations:
6969

70-
- [Joseph Garrone](@garronej)
71-
- [Julien Bouquillon](@revolunet) - DNUM des ministères sociaux
72-
- [Dylan DECRULLE](@ddecrulle) - Insee
73-
- [Enguerran Weiss](@enguerranws) - Plateforme de l'Inclusion
70+
- [Julien Bouquillon](https://github.com/revolunet) - DNUM des ministères sociaux
71+
- [Dylan DECRULLE](https://github.com/ddecrulle) - Insee
72+
- [Enguerran Weiss](https://github.com/enguerranws) - Plateforme de l'Inclusion
73+
74+
It is also co-maintained [Joseph Garrone](https://github.com/garronej), the original author.
7475

7576
## Development
7677

@@ -92,8 +93,6 @@ yarn start-next-appdir # For testing in a Next.js 13 AppDir setup
9293
yarn test
9394
# Run only test/runtime/cssVariable.test.ts (for example)
9495
npx vitest -t "Resolution of CSS variables"
95-
96-
# Debugging while unit testing
9796
```
9897

9998
### Want to contribute?
@@ -109,7 +108,7 @@ documentation of this starter for understanding the lifecycle of this repo.
109108

110109
A few projects that use `@codegouvfr/react-dsfr`.
111110

112-
- https://code.gouv.fr/sill
111+
- [https://code.gouv.fr/sill](https://sill-preprod.lab.sspcloud.fr/)
113112
- https://cartes.gouv.fr
114113
- https://immersion-facile.beta.gouv.fr/
115114
- https://egapro.travail.gouv.fr/
@@ -131,6 +130,4 @@ A few projects that use `@codegouvfr/react-dsfr`.
131130
- https://github.com/inclusion-numerique/mediature
132131
- https://territoiresentransitions.fr (maybe)
133132
- https://potentiel.beta.gouv.fr
134-
135-
Keep in mind that the project has been released recently so it's only natural
136-
that there is only a few projects in production using it.
133+
- https://diagoriente.beta.gouv.fr

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codegouvfr/react-dsfr",
3-
"version": "1.1.1",
3+
"version": "1.2.2",
44
"description": "French State Design System React integration library",
55
"repository": {
66
"type": "git",

publiccode.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ it:
3131
gdpr: true
3232
description:
3333
en:
34-
documentation: 'https://guides.react-dsfr.fr/'
34+
documentation: 'https://react-dsfr.codegouv.studio/'
3535
shortDescription: French State Design System React integration
3636
longDescription: |
3737
This module is a wrapper/compatibility layer for
@@ -56,7 +56,7 @@ description:
5656
`"use client";`
5757
5858
- [Perfect integration with all major React framework: Next.js (PagesDir
59-
and AppDir), Create React App, Vue](https://guides.react-dsfr.fr/).
59+
and AppDir), Create React App, Vue](https://react-dsfr.codegouv.studio/).
6060
6161
- All [the
6262
components](https://www.systeme-de-design.gouv.fr/elements-d-interface)
@@ -69,7 +69,7 @@ description:
6969
- Optional integration with [MUI](https://mui.com/). If you use MUI
7070
components they will be automatically adapted to look like [DSFR
7171
components](https://www.systeme-de-design.gouv.fr/elements-d-interface).
72-
See [documentation](https://guides.react-dsfr.fr/mui-integration).
72+
See [documentation](https://react-dsfr.codegouv.studio/mui-integration).
7373
7474
- Enable CSS in JS by providing a `useTheme()` hooks that exposes the
7575
correct colors options and decision for the currently enabled color
@@ -78,7 +78,7 @@ description:
7878
- Opt-in i18n, built in text can be displayed in multiple languages and
7979
user can provide extra translations.
8080
81-
- [Support routing libraries](https://guides.react-dsfr.fr/routing)
81+
- [Support routing libraries](https://react-dsfr.codegouv.studio/routing)
8282
like react-router.
8383
8484

0 commit comments

Comments
 (0)