550 Commits

Author SHA1 Message Date
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
Lebaud Antoine
f03ef6a9e1 (react) expose currentLocale in CunninghamContext
Expose `currentLocale` value to let know its subscribers
what is the locale value currently in use.
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
0378b3fa0c 🔖(release) version packages
Bump cunningham-demo to 0.1.0
Bump @openfun/cunningham-react to 0.9.0
Bump @openfun/cunningham-tokens to 0.6.0
2023-07-07 15:28:01 +02:00
Nathan Vasse
672f4be4d4 (react) make use of tokens references
We want to leverage the use of references inside our tokens definitions.
2023-07-07 15:06:18 +02:00
Nathan Vasse
f36cc07f1b (tokens) add token references
Previously we were not fully using CSS variables as values used in
CSS were hard-coded one. It wasn't keeping the variable references.
This was causing issues when customizing the theme, because editing
colors was not enough, it was needed to customize also the tokens
using these variables. Now by introducing ref() we can delegate how
to deal with these directly to the generators themselves.
2023-07-07 15:06:18 +02:00
jbpenrath
6aca0a3d85 💚(ci) fix performance issue of test job
Currently the test job seems to hit the maximum CPU resource available.
In order to prevent that we try to run tests on several workers.
2023-07-04 17:08:11 +02:00
Nathan Vasse
d05e38520b 🐛(react) avoid storybook errors
Since our upgrade from Typescript 5.0.4 to 5.1.3 some errors started to
occur when running yarn build in .stories.tsx files. Please see the
related issue: https://github.com/storybookjs/storybook/issues/23249.
Adding this ignore clause partitions the storybook compilation and the
package compilation which represents how things really work together,
thus making the irrelevant errors to be removed.

Fixes #109
2023-06-30 17:38:47 +02:00
Nathan Vasse
ef344e0aee 📝(react) add FileUploader to example
The goal is to give a real-life showcase of our components.
2023-06-28 16:20:17 +02:00
Nathan Vasse
80e8dc45eb (react) add file uploader
Add mono and multi file uploader according to sketches.
2023-06-28 16:20:17 +02:00
Nathan Vasse
af3caed43f (react) improve loader
Add small size to the loader for the file uploader.
2023-06-28 16:20:17 +02:00
renovate[bot]
93bfaae502 ⬆️(dependencies) update js dependencies 2023-06-27 17:15:59 +02:00
Nathan Vasse
16463c6c83 🔖(release) version packages
Bump @openfun/cunningham-react to 0.8.2
Bump @openfun/cunningham-tokens to 0.5.0
2023-06-23 14:52:12 +02:00
Lebaud Antoine
c160359045 🐛(react) export DatePicker components
Date picker elements were not exported in the global `index.ts`
2023-06-23 12:50:54 +02:00
Nathan Vasse
d618a1805e 🔖(release) version packages
Bump @openfun/cunningham-react to 0.8.1
2023-06-19 17:59:05 +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
Nathan Vasse
760ffb48e9 🔖(release) version packages
Bump @openfun/cunningham-react to 0.8.0
2023-06-19 15:20:49 +02:00
Nathan Vasse
34d2fe0af3 (react) max width for multi select pills
In order to prevent a pill with a long text to stack below the actions
div we decided to introduce the concept of max-width for pills.
2023-06-19 15:04:05 +02:00
Nathan Vasse
29b58ed1a6 (react) use css float for multi select
Previously the pills were not stacking under the actions div, now we can
do it using the forgotten CSS float feature.
2023-06-19 15:04:05 +02:00
Nathan Vasse
10a28d5e22 📝(react) add multi select to form example
This way we can showcase the multi select in real life conditions.
2023-06-19 15:04:05 +02:00
Nathan Vasse
3ff2ac4a64 📝(react) add multi select doc
Also rename existing doc for the mono select to mono.mdx for homogeneity
purposes.
2023-06-19 15:04:05 +02:00
Nathan Vasse
c8afa105dd (react) add multi select
Adding this new variant makes necessary to reorganize the files to keep
a clear separations of concerns. As of now Select/index.tsx is just an
entrypoint to render either the mono or multi variant of the select.
2023-06-19 15:04:05 +02:00
Nathan Vasse
5a9d77042f ♻️(react) parents of LabelledBox must be flex
Previously we enforced the height of the LabelledBox div with height: 100%, but
if the parent container of LabelledBox had an auto height this wasn't working
anymore. Setting height: 100% to a child works only if its parent has a fixed
height. In our situation we needed the LabelledBox to work for the multi select
which has a auto growing height. To solve this issue we just have to force the
parent containers of LabelledBox to display flex in order for it to stretches
its children to take all of its height, including LabelledBox div.
2023-06-19 15:04:05 +02:00
Nathan Vasse
02aa441b3b (react) add horizontal mode to LabelledBox
This way initially added for the multi select but after some discussions
we decided to keep the label vertical even for the multi select. But this
could be useful in the future.
2023-06-19 15:04:05 +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