Commit Graph

263 Commits

Author SHA1 Message Date
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
Nathan Vasse
cfd0f7e9d8 ♻️(tokens) handle custom tokens in SassGenerator
Previously the generator was only handling hard-defined design tokens
preventing to make custom tokens to appear in the scss generated file.
This new way of generating the file handles custom tokens in a more
generic way.
2023-07-18 14:36:09 +02:00
Nathan Vasse
d4e98d17e9 🔖(release) version packages
Bump @openfun/cunningham-react to 0.10.0
2023-07-17 11:29:01 +02:00
Nathan Vasse
9661e280e0 🐛(react) fix DataGrid stories
Due to a recent update we need to set id for custom columns. This
wasn't reflected in stories.
2023-07-17 11:29:01 +02:00
Nathan Vasse
b9f5227332 ⬇️(deps) downgrade vite-plugins-ts to 2.3.0
Since the upgrade we had an error during the types rollups, please see
https://github.com/qmhc/vite-plugin-dts/issues/242.
2023-07-13 15:38:23 +02:00
Lebaud Antoine
2cd8c6e843 🐛(react) make DatePicker's tests no longer depend on the user's locale
Refactor tests to enhance simplicity and clarity by introducing
expected string values. This improvement is particularly relevant
for focused months and focused year scenarios. Consequently, the
tests no longer depend on the user's locale.
2023-07-13 14:22:43 +02:00
Lebaud Antoine
c35cc603a7 🐛(react) resolve development warning in CalendarAux component
Resolve development warning in `CalendarAux` component caused
by recent updates to react-aria dependencies. Update props for next
and previous calendar buttons, removing `onFocusChange` before
passing to the Button component.
2023-07-13 14:11:18 +02:00
Anthony LC
e4c1df5b0b 🐛(react) fix datagrid column unique key
If we had more than 1 columns with custom cells, we would get a warning
about duplicate keys, because every columns got the key `actions`.
We add the column index to the key to make it unique.
2023-07-12 16:06:09 +02:00
Nathan Vasse
2344cdbe6f (react) update DatePicker test
The recent updates of @react-aria renamed the segment name from
month to "month,", causing tests fails.
2023-07-12 15:47:35 +02:00
Nathan Vasse
16dd24148b (react) update DateRangerPicker test
Due to the recent update of @react-aria/calendar the role of the calendar
has changed from group to application, the test were using this role.
2023-07-12 15:47:35 +02:00
Nathan Vasse
72ebd56568 📌(deps) downgrade prettier versions
For now there is a conflict with the new Prettier version, so for now
we just keep the previous version to check it later during the next
renovate pull request.
2023-07-12 15:47:35 +02:00
renovate[bot]
6ffb537cd0 ⬆️(dependencies) update js dependencies 2023-07-12 15:47:35 +02:00
Lebaud Antoine
5338e2142f 📝(react) update incoming DatePicker features
Documentation was outdated, as the range date picker is now available.
2023-07-12 00:47:52 +02:00
Lebaud Antoine
5c61413949 📝(react) illustrate international calendars of DatePicker component
Show international capabilities of the `DatePicker` component using the
`locale` props and the Cunningham provider. Dates would
be automatically displayed in the appropriate calendar system.
2023-07-12 00:47:52 +02:00
Lebaud Antoine
e1489b7fe0 (react) internationalize calendar system in DatePicker
Component was lacking some customization capabilities.
Using the browser calendar system wasn't enough modular.
This introduces a `locale` props, that allows a higher
customization of the component. By default, the calendar
system of the DatePicker is synchronized with the Cunningham
Provider.
2023-07-12 00:47:52 +02:00