Commit Graph

22 Commits

Author SHA1 Message Date
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
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
Lebaud Antoine
3b13bcae65 🐛(react) adjust the calendar width with a full width input
Establish a maximum width for the calendar that slightly
exceeds the Figma design, allowing for optimal display
of most timezone locales without expanding to fit the full
width input.
2023-07-10 22:05:33 +02:00
Lebaud Antoine
f8326c5de6 (react) make DatePicker elements accessible
Declare and export reusable element from the DatePicker
sub-packages, to make them easily usable accros
the design system or any application.
2023-07-10 22:05:33 +02:00
Lebaud Antoine
52bd807b27 📝(react) add DateRangePicker documentation
Provide a concise example using the range selection
in a controlled way. Most of DateRangePicker props
are similar to the DatePicker.
2023-07-10 22:05:33 +02:00
Lebaud Antoine
114d0b5f2e ♻️(react) refactor DatePicker component
Refactor the original DatePicker component to utilize the newly created shared
common DatePickerAux component. This modification enhances code consistency,
and promotes the reuse of the DatePickerAux across date inputs variants.
2023-07-10 22:05:33 +02:00
Lebaud Antoine
0d6b98ee1f (react) introduce DateRangePicker component
Introduce a flexible and reusable DateRangePicker component to facilitate the
selection of date ranges in the design system.
2023-07-10 22:05:33 +02:00
Lebaud Antoine
0775490a60 (react) introduce a reusable common DatePicker component
For both mono date and range date selection, create a versatile
DatePickerAux component that shares common logics, between both
selection mode.
2023-07-10 22:05:33 +02:00
Lebaud Antoine
0dae71aa92 ♻️(react) extract duplicated utility functions and types
DateRangePicker and DatePicker would share quite a lot of
common logics. Make sure the code elements are factorised
easily reusable in each components.
2023-07-10 22:05:33 +02:00
Lebaud Antoine
d16ada2825 ♻️(react) make datefield inputs reusable
Refactor the date field input to ensure the inclusion of two identical
and reusable date field inputs in the future DateRangePicker component.
By factoring out the common logic and structure, we can create a more efficient
and easily reusable component for selecting date ranges.
2023-07-10 22:05:33 +02:00
Lebaud Antoine
3631367e14 (react) extend Calendar functionalities with range selection
Extend the functionality of the DatePicker component to include support
for a range calendar. This enhancement allows users to select a date
range spanning multiple calendar cells, enabling more flexible date
selection.
2023-07-10 22:05:33 +02:00
Lebaud Antoine
219d08c82e 🐛(react) prevent ENTER event being triggered twice on calendar grid-cell
iThe Button component is not utilizing the headless UI Button from react-aria.
When pressing ENTER on calendar grid cells, the onClick event handler is
being called twice. This issue remained unnoticed when the date picker only
selected a single date and closed. However, when selecting a range of dates,
this double triggering becomes problematic.
2023-07-10 22:05:33 +02:00
Lebaud Antoine
2886f0c992 💄(react) add styling for range selection on a cell
Integrate new styling classes for grid-cells to facilitate range selection
in the DatePicker component. This implementation improves the visual
representation and user experience of selecting a range. In addition,
outside-month cells are now hidden, to avoid having a range selection
that contains outside-month cells.
2023-07-10 22:05:33 +02:00
Lebaud Antoine
87ec3a5061 ♻️(react) revamp clear date picker button
Revamp DatePicker component to enhance range functionalities by elevating
the clear button, resulting in the utilization of a single button across
multiple DateField inputs.
2023-07-10 22:05:33 +02:00
Nathan Vasse
4c5129e660 💄(react) reduce border of DatePicker
To make the DatePicker looks the same as other form inputs.
2023-06-19 17:21:29 +02:00
Nathan Vasse
501ba1a031 🐛(react) fix DatePicker alignments
Due to the previous changes of LabelledBox that allows it to fit dynamic
height containers, we forgot to update the DatePicker resulting in a broken
CSS alignment.
2023-06-19 17:21:29 +02:00
Lebaud Antoine
be87c97f31 ♻️(react) refactor dupplicated formatter
Make sure every date formatter has the same time zone by encapsulating
it in a factored custom hook. Reorganize component to gain
in readability and improve maintainability.
2023-06-16 17:13:35 +02:00
Lebaud Antoine
76ad5621c6 🐛(react) fix calendar selects initialization and syncing
Select under the calendar component were not properly initialized,
leading to issues. Additionally, syncing the dropdowns with the calendar
state was causing unnecessary renders. Selects now update on user events
triggered by the toggle button, ensuring the selected item remains
up-to-date. The code has been refactored to eliminate duplication
and improve the component's readability and maintainability.
2023-06-16 17:13:35 +02:00
Lebaud Antoine
10fa71e2a7 (react) add DatePicker component
Based on the Figma DS design by Alex, a mono date-picker
component has been added. It uses react-aria headless ui
component capabilities, with downshift headless ui component.
React-aria was not supporting by default dropdown menus to
select months and years. We could not reuse Popover component
from react-aria because we are not using their headless ui
component for the button one. Clicking on the toggle calendar
button triggers both the button and the popover click outside
events. React-aria button uses a custom onPress props that is
disabled by their popover. Instead, I have implemented a simple
custom hook. This is the first acceptable version of the component.
Some minor user interaction are missing. This first component
doesn't support time selection.
2023-06-12 18:57:20 +02:00