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
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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
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
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.
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.
Prettier had some missing extensions in the config, this commit
added them, we then prettified the whole project. We
ignore the `cunningham-tokens` files.