Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@dataesr/react-dsfr

dataesr6.5kMIT3.10.0TypeScript support: included

A React implementation of the french government design system.

react, components, design-system, gouvfr

readme

@dataesr/react-dsfr

Non-official React components of the official french Système de Design de l'État.

NPM JavaScript Style Guide GitHub contributors

Tests GitHub last commit semantic-release: react

Current version is using a degraded version of @gouvfr/dsfr@1.7.0 (new components are not yet available)

Requirements

  • node >= 14.18.x
  • npm >= 8.15.x
  • React >= 18.2.x

Installation

npm i @dataesr/react-dsfr

Generate and watch

Generate and watch dist folder containing bundles:

npm install --legacy-peer-deps
npm start

Library usage

Example page

A playground to test components

An example page is available containing all components. To launch it on your local machine, first launch watcher of the project and then:

cd example
npm install 
npm start

Use Icons

We are using remixicon.

import { Icon } from '@dataesr/react-dsfr';

<Icon
    name="ri-bubble-chart-line"
    size="lg"
    color="#f88"
    iconPosition="right"
>
    <p>I have an icon</p>
</Icon>

:warning: CDN link of css must be added to the <head> of your website.

<link href="https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css" rel="stylesheet">

Use Colors

Color variables are available in style/color.css. To make a new component dark theme compatible it's recommended to use variables from scheme.css in @gouvfr/dsfr project

Some components can be colored with variables (see colorFamily props) listed below:

['green-tilleul-verveine', 'green-bourgeon', 'green-emeraude', 'green-menthe', 'green-archipel', 'blue-ecume', 'blue-cumulus', 'purple-glycine', 'pink-macaron', 'pink-tuile', 'yellow-tournesol', 'yellow-moutarde', 'orange-terre-battue', 'brown-cafe-creme', 'brown-caramel', 'brown-opera', 'beige-gris-galet']

Documentation - Storybook

Storybook of the project is under construction.

Unit tests

Run all tests using react-scripts WHITH watcher option

npm run test:dev

Run all tests using react-scripts WITHOUT watcher option

npm run test:nowatch

Update snapshots

npm test -- --updateSnapshot

In Chrome

npm run test:debug

Access about:inspect

See doc debugging-tests

Release policy and package publishing

The @dataesr/react-dsfr package is published with semantic-release.

Merging code on the master branch will automatically bump the version, create a tag, produce a changelog and trigger the tests.

If new semantic commits are found (see below how to format commit) a new version of npm package is published and github pages is updated.

new patch version

git commit -m "fix: This is my fix"

new minor version

git commit -m "feat: This is my feature"

new major version

git commit -m "[subject]" -m "BREAKING CHANGE: [body]"

See Commit message formats for more details.

Accessibility

Components can be tested in Example's page App.js with @axe-core/react

npm instal --save-dev @axe-core/react

Another solution to test accessibility is CLI module https://pa11y.org/

Check configuration file .pa11y-ci

npm install -g pa11y-ci
pa11y-ci

They use react-dsfr and we like it!

Help from outside

Thanks to the internet world.

TODO

  • Limit usage of colors to colorFamilies
  • Upgrade to latest version of the DSFR (v1.9)
  • Full review ot the Typescript integration
  • Tree Shaking (instead of the whole bundle)

changelog

3.10.0 (2023-11-27)

Features

  • ci: Change Mattermost notification channel (8a424e2)

3.9.2 (2023-11-20)

Bug Fixes

  • container: add prop type div to the component (f5f2f51)

3.9.1 (2023-05-16)

Bug Fixes

  • tag: avoid stacked icons on tag component (797c3df)

3.9.0 (2023-05-11)

Features

3.8.1 (2023-05-11)

Bug Fixes

  • CI and update unit tests snapshots (0e6d8d5)
  • Resolve ci errors and warnings (43db8d5)

3.8.0 (2023-05-10)

Features

  • link: add storybook for links (aff8faf)

3.7.0 (2023-05-10)

Features

  • tag/taggroup: add storybook for tag and taggroup (c6ce84c)

3.6.0 (2023-05-03)

Bug Fixes

Features

  • ci: Switch from Slack to mattermost (6858df8)
  • radio: Add stories for storybook (db392a8)
  • radio: Add stories for storybook /2 (2949c66)

3.5.15 (2023-04-22)

Bug Fixes

3.5.14 (2023-04-05)

Bug Fixes

  • ci: Clean and update github workflow (21e1610)

3.5.13 (2023-03-28)

Bug Fixes

3.5.12 (2023-03-28)

Bug Fixes

  • workflow: Update github workflow (ec73808)

3.5.11 (2023-03-20)

Bug Fixes

3.5.10 (2023-03-20)

Bug Fixes

3.5.9 (2023-03-15)

Bug Fixes

3.5.8 (2023-03-15)

Bug Fixes

3.5.7 (2023-03-15)

Bug Fixes

3.5.6 (2023-02-11)

Bug Fixes

3.5.5 (2023-02-10)

Bug Fixes

  • always close mobile sidemenu on click (#331) (13c7b6f)

3.5.4 (2023-01-27)

Bug Fixes

3.5.3 (2023-01-25)

Bug Fixes

3.5.2 (2023-01-04)

Bug Fixes

3.5.1 (2022-12-27)

Bug Fixes

3.5.0 (2022-12-26)

Bug Fixes

  • ConsentManager: :technologist: Improvement of the APIs of ConsentManager & ConsentService to be able to manage consents correctly (#319) (ec00810)

Features

3.4.15 (2022-12-20)

Bug Fixes

3.4.14 (2022-12-15)

Bug Fixes

3.4.13 (2022-12-12)

Bug Fixes

3.4.12 (2022-12-02)

Bug Fixes

  • Header: :technologist: Add onClick prop on NavItem (#312) (34eeb88)

3.4.11 (2022-12-02)

Bug Fixes

3.4.10 (2022-12-02)

Bug Fixes

  • Footer: :bug: Fix "filter" bug when FooterTopCategory has only one child (#311) (e8035a2)
  • ts: fix Tab types (#310) (e65341f)

3.4.9 (2022-12-01)

Bug Fixes

3.4.8 (2022-11-29)

Bug Fixes

  • Fix tab height due to tabs-height not updated (#308) (37e75a5)

3.4.7 (2022-11-29)

Bug Fixes

3.4.6 (2022-11-28)

Bug Fixes

3.4.5 (2022-11-25)

Bug Fixes

3.4.4 (2022-11-22)

Bug Fixes

  • Update github workflow plugin version (3fb5ae1)

3.4.3 (2022-11-18)

Bug Fixes

  • Revert make @storybook/react a dev dependency (#294) (39fb8cf)

3.4.2 (2022-11-17)

Bug Fixes

3.4.1 (2022-11-15)

Bug Fixes

3.4.0 (2022-11-14)

Bug Fixes

Features

  • close language menu when item is clicked on (#289) (6876303)

3.3.5 (2022-10-28)

Bug Fixes

3.3.4 (2022-10-27)

Bug Fixes

3.3.3 (2022-10-27)

Bug Fixes

3.3.2 (2022-10-27)

Bug Fixes

3.3.1 (2022-10-27)

Bug Fixes

3.3.0 (2022-10-26)

Features

  • Ajout de la gestion d'une classe specifique pour les cellule TD des Tableau (#278) (3d914e0)

3.2.0 (2022-10-24)

Features

3.1.12 (2022-10-21)

Bug Fixes

  • Allow tables to have an empty data var (#280) (05ef81d)

3.1.11 (2022-10-11)

Bug Fixes

3.1.10 (2022-10-04)

Bug Fixes

3.1.9 (2022-10-04)

Bug Fixes

3.1.8 (2022-10-04)

Bug Fixes

3.1.7 (2022-09-21)

Bug Fixes

3.1.6 (2022-08-04)

Bug Fixes

  • secrets deploy storybook gh-pages (24d73de)

3.1.5 (2022-08-04)

Bug Fixes

  • secrets deploy storybook gh-pages (d6cc9a8)

3.1.4 (2022-08-04)

Bug Fixes

  • storybook button colored (f1b97ce)

3.1.3 (2022-08-03)

Bug Fixes

3.1.2 (2022-08-03)

Bug Fixes

  • release storybook coming (2e7d654)

3.1.1 (2022-08-01)

Bug Fixes

3.1.0 (2022-08-01)

Features

  • Add html5 structuring tags (7bf5495)

3.0.0 (2022-07-29)

BREAKING CHANGES

  • react v18

2.9.2 (2022-07-28)

Bug Fixes

  • pass className and onClick to component ToolTranslateItem (#261) (63577c9)

2.9.1 (2022-07-28)

Bug Fixes

  • remove styleguidist and gh-pages (f5ace22)
  • remove styleguidist and gh-pages (d9a912c)
  • tests action (e429808)

2.9.0 (2022-07-27)

Features

2.8.6 (2022-07-27)

Bug Fixes

2.8.5 (2022-07-26)

Bug Fixes

  • icon: Remove useless span tag inside button (4044aa9)

2.8.4 (2022-07-05)

Bug Fixes

2.8.3 (2022-07-01)

Bug Fixes

2.8.2 (2022-07-01)

Bug Fixes

  • add htmlinput element properties in TextInput (#243) (8a54051)

2.8.1 (2022-07-01)

Bug Fixes

  • accordion: Realign icon to the right (a4b0165)

2.8.0 (2022-06-30)

Features

2.7.0 (2022-06-30)

Features

  • footer: Add a secondary partners title (#252) (d2c82f2)

2.6.3 (2022-06-27)

Bug Fixes

2.6.2 (2022-06-27)

Bug Fixes

2.6.1 (2022-06-27)

Bug Fixes

2.6.0 (2022-06-27)

Bug Fixes

Features

  • header: Allow complexe title and description (#245) (c497183)

2.5.0 (2022-06-23)

Features

  • :sparkles: add optionnal sticky table header (#238) (a813c39)

2.4.1 (2022-06-23)

Bug Fixes

  • dsfr: Use version 1.5.0 (b7ddcaa)

2.4.0 (2022-06-23)

Features

  • dsfr: Use version 1.6.0 (c72b581)

2.3.1 (2022-06-07)

Bug Fixes

2.3.0 (2022-05-16)

Bug Fixes

Features

  • update components Title Text AltTitle (a3981bb)

2.2.2 (2022-05-16)

Bug Fixes

2.2.1 (2022-05-13)

Bug Fixes

2.2.0 (2022-05-13)

Bug Fixes

Features

2.1.7 (2022-05-13)

Bug Fixes

2.1.6 (2022-05-13)

Bug Fixes

2.1.5 (2022-05-13)

Bug Fixes

2.1.4 (2022-05-13)

Bug Fixes

2.1.3 (2022-05-13)

Bug Fixes

2.1.2 (2022-05-12)

Bug Fixes

2.1.1 (2022-05-12)

Bug Fixes

2.1.0 (2022-05-12)

Features

2.0.0 (2022-05-11)

BREAKING CHANGES

  • upgrade dsfr 1.5.0

1.3.0 (2022-05-11)

Features

  • BREAKING CHANGE: upgrade v1.5.0 (99ca28d)

1.2.0 (2022-05-11)

Features

1.1.11 (2022-03-25)

Bug Fixes

  • radio disabled propType optional (500d644)

1.1.10 (2022-03-25)

Bug Fixes

  • radio disabled propType (13d2bc9)

1.1.9 (2022-03-25)

Bug Fixes

  • checkboxes and radio disabled prop (cf595d7)

1.1.8 (2022-03-24)

Bug Fixes

1.1.7 (2022-03-24)

Bug Fixes

1.1.6 (2022-03-24)

Bug Fixes

1.1.5 (2022-03-24)

Bug Fixes

  • publish in release workflow (eb7c160)

1.1.4 (2022-03-24)

Bug Fixes

1.1.3 (2022-03-24)

Bug Fixes

1.1.2 (2022-03-24)

Bug Fixes

  • publish after release gh action (82ba04e)

1.1.1 (2022-03-23)

Bug Fixes

1.1.0 (2022-03-23)

Bug Fixes

Features

1.0.9 (2022-03-23)

Bug Fixes

1.0.7 (2022-03-23)

Bug Fixes