550 Commits

Author SHA1 Message Date
Nathan Vasse
37de4b3d70 🔖(release) version packages
Bump @openfun/cunningham-react to 1.0.2
2023-09-07 09:59:52 +02:00
Nathan Vasse
051c79fd6f ♻️(react) improve props propagation
Before we had to edit input components using Field when adding new props
to the latter.
2023-09-05 11:48:04 +02:00
Nathan Vasse
b530e966ae (react) add textItems to Field
This allow to add bullet points lists below inputs, the best example
is when we want to list multiple errors from form validation.

Fixes #147
2023-09-05 11:48:04 +02:00
Nathan Vasse
468c8161eb 📝(react) add RHF examples
Rework a bit the recent work made on RHF example to make some component
more generic, such as RhfSelect and RhfDatepicker, which is based on a
design using RHF context hooks to provide a seamless integration.

Fixes #144
2023-09-05 11:15:51 +02:00
Nathan Vasse
90a8f559b4 🚨(react) fix stories file warnings
Revert the changes made in the d05e385 commit, it was causing IDE
warnings in stories files about source files that cannot be resolved,
but in reality Storybook really base its config on the local tsconfig.json,
so excluding stories.tsx files was just a ugly temporary fix.
2023-09-05 11:15:51 +02:00
Nathan Vasse
a88aa1a23d 🐛(react) fix isActive console warning
Previously when interacting with a select, the list items
were triggering a warning.
2023-09-05 11:15:51 +02:00
Nathan Vasse
0683047763 🔖(release) version packages
Bump @openfun/cunningham-react to 1.0.1
2023-08-29 16:49:06 +02:00
Nathan Vasse
66c25bcdbd 🏷️(react) export more types
Based on recent developers feedbacks that needed to use props types
in order to wrap the lib's component they were stuck because we were
not exporting all of them.

Fixes #143
2023-08-29 16:26:40 +02:00
jbpenrath
b6e5a876d3 🔖(tokens) major bump to v1.0.0
Major Changes

- The first bunch of components and features are ready,
  the first milestone has been reached
2023-08-21 17:58:14 +02:00
jbpenrath
90faa82245 🔖(react) major bump to v1.0.0
Major Changes

- The first bunch of components and features are ready,
  the first milestone has been reached

Minor Changes

- 9edb976: Position Datepicker popover on top or bottom depending space
available

Patch Changes

- fd7ad8a: Do not apply font-family to all elements with `*` selector
2023-08-21 17:58:14 +02:00
jbpenrath
c89d9dc6df 🚨(react) fix linter warning & errors
With upgrade new linter warning and erros are popped up. So we fix it.
2023-08-21 15:33:50 +02:00
jbpenrath
151382dec2 ⬆️(frontend) migrate to testing-library/jest-dom 6.0.0
The new version of `testing-library/jest-dom` now offers several modules
 to extend vitest interface. We have to update the import path to extend
 vitest dom interface.
2023-08-21 15:33:50 +02:00
renovate[bot]
25b8f696ed ⬆️(dependencies) update js dependencies 2023-08-21 15:33:50 +02:00
Anthony Le Courric
9edb9765db (react) position top datepicker
Position the datepicker on top of the input when the input is
at the bottom of the screen and whenthere is enough space to display
the datepicker on the top.
2023-08-21 12:32:14 +02:00
Anthony Le Courric
6ea8544fed 🔨(project) add json, cjs and js extensions to prettier config
Prettier had some missing extensions in the config, this commit
added them, we then prettified the whole project. We
ignore the `cunningham-tokens` files.
2023-08-21 12:32:14 +02:00
Anthony Le Courric
b46aaa66ed 🚨(packages) fix eslint tsconfig root dir
Eslint extension highlighted some issues with the way we were
importing the tsconfig.json file in the .eslintrc.json file.
By changing the extension to .cjs, we are now able to set
tsconfigRootDir to the root of the package thanks to `dirname`.
It helps eslint to find the correct tsconfig.json file.
2023-08-21 12:32:14 +02:00
Anthony Le Courric
c880222c12 🔧(react) adapt script and config to use the watch mode of vite
If we work from an app perspective, it is nice to have a watch mode
on our packages to see the changes in real time. Better to use the
watch mode of vite (rollup) compare to nodemon because it is faster,
we re-transpile only the files that have changed.
Possility to use the wath mode by polling as well, on a remote machine
the HMR does not work well, the polling mode helps to solve this issue.
2023-08-21 12:32:14 +02:00
Anthony Le Courric
4f4f1682a6 🔧(packages) make scripts cross platform friendly
Some scripts had errors when running on windows.
We now use some cross platform cli tools to be
able to run the scripts on every platform.
2023-08-21 12:32:14 +02:00
jbpenrath
956e6f2367 💚(tokens) fix flaky test
Currently tokens test are flaky. It appears `cleanup` function can raise
 an Error. Locally, we use `runInBand` option to run our tests and all
 is working fine. The mess up could appear when test are running in
 parallel as cleanup can remove file used in other test at any moment.
2023-08-11 17:10:57 +02:00
jbpenrath
944370cc02 🔧(react) enforce to use UTC timezone in our test
Currently, the timezone used in test depends to the local environment
that is weird. So we enforce the use of UTC timezone in our tests.
2023-08-11 17:10:57 +02:00
jbpenrath
fd7ad8a2f2 💄(react) do not apply font-family to all elements with * selector
Currently, `react` package use `*` selector to enforce the font family
to all elements. That is weird as all elements are not able anymore to
inherit their font-family from their parent. In order to enforce the use
 of font-family base by default without breaking the parent inheritance,
  we apply font-family to the body element instead.

Fix #137
2023-08-11 17:10:57 +02:00
jbpenrath
fed31ddbb9 🔖(react) fix release 0.11.1
Patch Changes
- 7de28bc: Fix bug on sass token generation
2023-08-11 09:16:26 +02:00
jbpenrath
e3ee7ac065 🔖(tokens) fix release 0.7.1
Patch Changes
- 7de28bc: Fix bug on sass token generation
2023-08-11 09:16:26 +02:00
jbpenrath
41ddaa5251 🔧(react) chain commands within build script
Currently commands within build script are not chained so if one fail,
all other will run that could lead to mistunderstanding, that all is
working fine when no...
2023-08-10 18:37:15 +02:00
Romain Le Cellier
4eae45c4d9 🐛(react) fix RadioGroup optional prop
since 5dde74c10d RadioGroup style was a
mandatory property.
It should be optional.
2023-08-10 18:37:15 +02:00
Romain Le Cellier
3e1cdbe9d6 🚑️(react) fix unexisting import
Since b72d0d5c90 InputRefType doesn't
exist.
We missed some usage of it that are removed in this fix.
2023-08-10 18:37:15 +02:00
Romain Le Cellier
7de28bcf9b 🐛(tokens) fix generators
When customized tokens have multiple entries like theme and components,
each variable definition needs to end with a ;.
2023-08-10 15:30:32 +02:00
Romain Le Cellier
53bccd111b 🔖(release) version packages
Bump @openfun/cunningham-react to 0.11.0
2023-08-07 17:35:47 +02:00
Romain Le Cellier
5dde74c10d 📝(react) react-hook-form forms Sports examples
Our forms needs to be usable with react-hook-form
2023-08-07 16:25:00 +02:00
Romain Le Cellier
d0941ae0a7 📝(react) react-hook-form forms Login examples
Our forms needs to be usable with react-hook-form
2023-08-07 16:25:00 +02:00
Romain Le Cellier
e3563f85d1 (react) react-hook-form Select example
Our form elements needs to be usable with react-hook-form
2023-08-07 16:25:00 +02:00
Romain Le Cellier
4e53857159 (react) react-hook-form Radio example
Our form elements needs to be usable with react-hook-form
2023-08-07 16:25:00 +02:00
Romain Le Cellier
d506cab978 (react) react-hook-form Checkbox example
Our form elements needs to be usable with react-hook-form
2023-08-07 16:25:00 +02:00
Romain Le Cellier
e3bf4cadf2 (react) react-hook-form Switch example
Our form elements needs to be usable with react-hook-form
2023-08-07 16:25:00 +02:00
Romain Le Cellier
b72d0d5c90 (react) react-hook-form Input example
Our form elements needs to be usable with react-hook-form
2023-08-07 16:25:00 +02:00
Romain Le Cellier
bdc08cf043 (dependencies) add yup
Our form elements needs to be usable with react-hook-form
This lib is needed to create examples stories
2023-08-07 16:25:00 +02:00
Romain Le Cellier
1953d52cdb (dependencies) add @hookform/resolvers
Our form elements needs to be usable with react-hook-form
This lib is needed to create examples stories
2023-08-07 16:25:00 +02:00
Romain Le Cellier
314462a3c8 (dependencies) add react-hook-form
Our form elements needs to be usable with react-hook-form
This lib is needed to create examples stories
2023-08-07 16:25:00 +02:00
Romain Le Cellier
3471e2e0b2 (react) add Button token font-family
Components font-family have to be customizable.
2023-08-04 17:42:18 +02:00
Lebaud Antoine
94ae861ae9 🚚(react) make datepicker utils tests a tsx file
In order to use vitest dependency, make the utils test file
use a tsx extension.
2023-08-02 19:02:22 +02:00
Lebaud Antoine
7e5a11ec7d 📝(react) add a timezone management section to date picker docs
Describe the current behavior of date picker components,
especially with the recent changes in component's API.
2023-08-02 19:02:22 +02:00
Lebaud Antoine
9d31c502b8 📝(react) document date picker utils functions
Add some docstring documentation to the newly updated utils
functions, to help understand what are their role and params.
User have a clear view of inputs and outputs timezone.
2023-08-02 19:02:22 +02:00
Lebaud Antoine
cd42afb10e (react) add a timezone props on date picker components
By default, component's timezone is the user locale timezone.
Component now offers a way to set its timezone to any supported
Intl timezone format. Please note that output values from the
component will always be converted to a UTC timezone.
2023-08-02 19:02:22 +02:00
Lebaud Antoine
0dc46d1144 (react) restrict inputs formats in date picker components
Enforces a standardized approach for end consumers using the
component's API. Consumers are now required to provide a date as an
ISO string in either UTC or with a UTC offset. The support for native
Date objects has been removed to ensure consistent and reliable
behavior across all implementations. By adopting this uniform input
format, we can simplify usage and avoid potential inconsistencies in
date handling.
2023-08-02 19:02:22 +02:00
Lebaud Antoine
8cf8e1eba2 🩹(react) harmonize date picker components output
By introducing this utility function, we ensure that any output value
is converted back to an ISO 8601 date and time string in UTC timezone.
Overall, it harmonize and factorize the way we output
values from date picker components.
2023-08-02 19:02:22 +02:00
Lebaud Antoine
bae7392fe1 (react) strip "Today, " from selected date range literal
DateRangePicker aria-labels mention when a selected date range
contains today's date, which breaks the tests  while ran on the
first day of the month. Avoid these tests to be flaky.
2023-08-02 16:22:40 +02:00
Nathan Vasse
26304791ae 🔖(release) version packages
Bump @openfun/cunningham-tokens to 0.7.0
2023-07-18 17:22:37 +02:00
Nathan Vasse
40f2eb2b06 ♻️(react) upgrade code for Downshift 8
This new major version broke our components, including the way the menu
gets opened, how to determine the disabled options and some other semantic
types changes.
2023-07-18 16:59:39 +02:00
Nathan Vasse
d85f9edac8 🚨(lint) update file for prettier 3.0.0
Prettier 3.0.0 comes with new standards so we need to upgrade our files
to comply with it.
2023-07-18 16:59:39 +02:00
renovate[bot]
5f63c2a606 ⬆️(dependencies) update js dependencies 2023-07-18 16:59:39 +02:00