550 Commits

Author SHA1 Message Date
Lebaud Antoine
539f03eee1 🩹(react) handle possible null date range
Exercise caution when dealing with date range values that may be null.
2023-10-03 11:52:23 +02:00
renovate[bot]
6c3259a4ac ⬆️(dependencies) update js dependencies 2023-10-03 11:52:23 +02:00
Nathan Vasse
a46d28f00a 💄(react) make multi select height homogeneous
Some discussion appeared about the fact the multi select was changing
height when pill were selected, making this input having a bigger
height than others making it looks weird in a form comparing to the
others. Modifying the padding and font size make the input keep the
same height.

See #114
2023-10-03 11:18:56 +02:00
Nathan Vasse
a1e8f46368 🐛(react) fix checkbox double onChange
When clicking on the checkmark it was trigerring two onChange on parent
elements, thus causing double toggling ( which means revert to the initial
value ) in some controlled way approaches ( see the added test ).

Fixes #175
2023-10-02 11:53:04 +02:00
Nathan Vasse
e15586da9b 🐛(react) fix missing mono-simple useEffect dep
A recent rebased cause one the dep to be removed.
2023-09-28 15:43:24 +02:00
Nathan Vasse
3e2d5994f3 ⬇️(deps) downgrade @types/react to 18.2.21
It was causing compilation issue when using React.StrictMode, see this
https://github.com/DefinitelyTyped/DefinitelyTyped/issues/66841
2023-09-28 11:05:51 +02:00
Nathan Vasse
9c8331be5b ⬇️(react) downgrade remark-gfm to 3.0.1
It was causing crashes because the other MDX deps are not already
up-to-date to support remark-gfm 4.0.0 for now. See
https://github.com/remarkjs/remark-gfm/issues/57
2023-09-28 11:05:51 +02:00
renovate[bot]
f82aeee9ac ⬆️(dependencies) update js dependencies 2023-09-28 11:05:51 +02:00
Romain Le Cellier
859a75cebe 🩹(frontend) fix react userEffect
in Select/mono-simple

The whole downshiftProps object change every time a update is made on it.
By observing only initialSelectedItem prop, we reduce the amount of call
of this useEffect.
2023-09-27 15:38:48 +02:00
Romain Le Cellier
3a6028f0ba 🐛(rect) fix rhf select example
clearing the select trigger a infinit loop
2023-09-27 15:38:48 +02:00
Romain Le Cellier
034e299407 ♻️(react) fix rhf reset with Input
when using reset(), Input field value wasn't updated
2023-09-27 15:38:48 +02:00
Nathan Vasse
e2738495dc 🔖(release) version packages
Bump @openfun/cunningham-react to 1.3.0
2023-09-25 16:24:56 +02:00
Anthony Le Courric
3fc464bb8c 🐛(react) fix some edge cases with searchable Select
- rerender mutated options when the menu is opened
- keep the filter value when the menu is opened and rerender
by a mutated options
2023-09-25 16:10:39 +02:00
Nathan Vasse
4e1d0f0bc7 (react) rework the behavior of the Select component
We decided to change a bit the behavior of the Select:
- Do not trigger onChange on first render if value is defined
- Show all options on searchable select menu  opening even if there is an
  existing value.
- Clear the input field if no choice are selected
- Clear the added text to the input field when a value is already selected
2023-09-22 14:18:01 +02:00
Nathan Vasse
732183420d 🐛(react) fix select pills submiting form
We found out that clicking on the delete button of the pill in example
forms were triggering form submit.
2023-09-22 12:07:00 +02:00
Nathan Vasse
a07b461621 🔖(release) version packages
Bump @openfun/cunningham-react to 1.2.0
2023-09-19 09:57:36 +02:00
Nathan Vasse
8470126b1f 🐛(react) fix failing selection of last removed item
Previsouly when selecting item A and then removing it, it was impossible
to select it again. This was caused by the internal memory of useSelect
that only provides undefined selectedItem inside the onStateChange callback
when the item has not changed. So by forcing it everytime to null it is
now providing it everytime.
2023-09-18 17:01:21 +02:00
Nathan Vasse
111bb677c4 ♻️(react) improve select element keys
It was considered as a bad practice to include array indexes in list
elements keys even though it was made this way in the documentation. We
removed them and also decided to drop the use of options value in the
keys too to the profit of optionToValue which can never be undefined or null.
This changes caused test crashing due to the fact that it made the useSelect
onStateChange trigger a onBlur event that was causing the first option of the
list to be selected automatically, which was a really weird behavior. Before
it was not happening because newSelectedItem was not defined, using the
new keys made it defined, we don't 100% understand why yet.
2023-09-18 17:01:21 +02:00
Nathan Vasse
fd988c03e1 🐛(react) fix controlled searchable select
Changing the controlled value was setting triggering immediately an
onChange event with undefined value. This was due to the fact that when
the controlled value was changed SelectMonoAux was searching only in
options displayed, where it should in reality be searching accross all
options.

fixes #162
2023-09-15 15:11:43 +02:00
Nathan Vasse
4616ad9ffb (react) add select menu empty placeholder
Previously if the menu was opened and no there were no options to be
displayed it was just showing a tiny empty menu, this commit adds an
empty placeholder in order to make it clearer that the list is empty.
2023-09-13 17:28:58 +02:00
renovate[bot]
be5559d9fe ⬆️(dependencies) update js dependencies 2023-09-12 15:28:58 +02:00
Nathan Vasse
5bf2bc7e6f 🔖(release) version packages
Bump @openfun/cunningham-react to 1.1.0
Bump @openfun/cunningham-tokens to 1.0.1
2023-09-11 16:43:27 +02:00
Anthony Le Courric
e251bbb438 🚨(eslint-config-custom) prob order with windows
With Windows the order of the imports was not the same as with Linux,
this was causing the linter to fail with CI.
We force the import starting with ":" to the internal group to fix this
issue.
2023-09-11 16:15:13 +02:00
Anthony Le Courric
c7000f37d2 🐛(react) fix props not recognized on the input element
The props propagation was adding unknown props to the input element,
which was causing an error warning to be displayed in the console.
2023-09-11 16:15:13 +02:00
Nathan Vasse
8086a48672 📝(react) improve form examples
We decided to improve the examples to fit better the guidelines of the
design-system.
2023-09-11 12:07:49 +02:00
Nathan Vasse
8fd34add8a 🐛(react) fix Radio, Checkbox fullWidth
The fullWidth was buggy for those components, the label was floating
in the middle of the empty space where it feels correct to keep it
aligned on the left.
2023-09-11 12:07:49 +02:00
Nathan Vasse
9de9a9735d 💄(react) improve Select actions ui
The button were too big compared to the sketches. So we re-adjust their
sizes and positions.
2023-09-11 12:07:49 +02:00
Nathan Vasse
cdace69482 💄(react) adjust checkbox and radio borders and colors
Based on a QA feedback.
2023-09-11 12:07:49 +02:00
Nathan Vasse
dce90eafb4 💄(react) add margin to right supporting text
If the left text is long it was able in some cases to be too close
to the right text.
2023-09-11 12:07:49 +02:00
Nathan Vasse
d36e31448e 💄(react) improve FileUploader style
Based on recent QA feedbacks we needed to do small changes to the style
of the FileUploader.
2023-09-11 12:07:49 +02:00
Nathan Vasse
6257dd9cbc 💄(react) fix DatePicker label focused
The label of the DatePicker was not using the specific focus color.
2023-09-11 12:07:49 +02:00
Nathan Vasse
cf542e4fa9 💄(react) fix DatePicker, Select, Input success colors
This is based on recent QA report.
2023-09-11 12:07:49 +02:00
Nathan Vasse
9a349c1556 💄(react) fix Select and Input error colors
This was a feedback from the QA.
2023-09-11 12:07:49 +02:00
Nathan Vasse
1c45b93a85 💄(react) homogenize form fields colors
Based on the QA feedbacks we figured out that form fields were not all
using the exact same greyscale colors.
2023-09-11 12:07:49 +02:00
Nathan Vasse
4c64cb3993 📝(react) add disabled form example
Before it wasn't really handy to see form inputs next to each other
in order to make sure that their style is homogeneous when being
disabled.
2023-09-11 12:07:49 +02:00
Nathan Vasse
94f392e037 💄(react) update DatePicker error color
The QA reported that the colors were not correct.
2023-09-11 12:07:49 +02:00
Nathan Vasse
37772a4b85 💄(react) update DatePicker segments colors
Based on QA feedbacks we just want a background color for the focused
segments.
2023-09-11 12:07:49 +02:00
Nathan Vasse
09e474c8c1 ♻️(react) update Pagination behavior
We want to make the Pagination more intuitive and fluent. Now it displays
the current page all the time, auto select, auto submits on blur.
2023-09-11 12:07:49 +02:00
Nathan Vasse
c90f66f0cd 💄(react) hide input number arrows
During our last meeting regarding the QA the designer told us to remove
the arrows on the number input. We can still change the value with the
keyboard arrows, so it does not cause a11y issues.
2023-09-11 12:07:49 +02:00
Nathan Vasse
21b6d77913 💄(react) fix the css order in storybook
Previously, having the icon file coming after the design system styles
was causing issues: we were not able to set fs-* classes to material-icons
because the priority of the selector was too low.
2023-09-11 12:07:49 +02:00
Nathan Vasse
71dc458ab4 ♻️(react) use nano Button inside DatePicker
Based on the last QA it appears that we were using wrong button size
and icon size ratio. By using the newly created nano size we can make
the code much simpler.
2023-09-11 12:07:49 +02:00
Nathan Vasse
32b8dc0915 💄(react) make DatePicker placeholders uppercase
This was a feedback from the QA.
2023-09-11 12:07:49 +02:00
Nathan Vasse
c0028966f1 (react) add a nano button, proper icon sizes
Previously we had to hack the button in order to display small clickable
icons, like the clear button in the DatePicker. By introducing a new
nano button we can natively achieve that. Also make more homegenous
font size and icon sizes in existing button sizes.
2023-09-11 12:07:49 +02:00
Nathan Vasse
495f7d3731 💄(react) fix DatePicker focus
Based on QA feedback the keyboard focus of the DatePicker was using
the browser default outline ( when navigating with tab key ), this
ensure a consistent style accross different focus modes.
2023-09-11 12:07:49 +02:00
Nathan Vasse
9be1ec52b3 💄(react) make the checkboxes column the smallest
QA feedbacks told us that the checkbox column was too wide, this update
makes it the smallest possible.
2023-09-11 12:07:49 +02:00
Nathan Vasse
cf299d9e2b 💄(react) align actions column items on the right
The design-system guidelines tell that actions button must be aligned
on the right. To make this behavior effortless this feature adds a
special class to actions column to apply the correct css style in order
to achieve that.
2023-09-11 12:07:49 +02:00
Nathan Vasse
4d2a5d1873 💄(react) update DataGrid empty placeholder's ui
The border was not matching the sketches.
2023-09-11 12:07:49 +02:00
Nathan Vasse
7128e7fef7 💄(react) using correct DataGrid header class
Previously the headers of the DataGrid were not aligned with the
correct title class.
2023-09-11 12:07:49 +02:00
Nathan Vasse
6236729ae8 💄(tokens) titles QA feedbacks
QA-based updates to the title classes, the letter-spacing was not
taken into account previously.
2023-09-11 12:07:49 +02:00
Nathan Vasse
4e6e5a2e52 💄(react) fix Button style
QA-based updates to the Button components. It includes global UI updates
to make the Button to match the sketches.
2023-09-11 12:07:49 +02:00