Commit Graph

560 Commits

Author SHA1 Message Date
Nathan Vasse
3d4236c7bd 🏷️(react) add WithOptional type
This type allows to make only specific attributes optionnal where
the existing Partial<T> makes all the attributes optionnal. Its
first use will be for Modals.
2024-02-05 15:23:03 +01:00
Nathan Vasse
7dcf08d308 🤡(react) add HTMLDialog mock
As JestDOM does not mock this element, we need to do it in order to
make Modal work in test environement.
2024-02-05 15:23:03 +01:00
Nathan Vasse
141d712a47 🔧(git) add .turbo folder to .gitgnore
Ignore this cache folder that must only be stored locally.
2024-02-05 15:00:34 +01:00
renovate[bot]
a92ef3244b ⬆️(dependencies) update js dependencies 2024-01-29 16:34:31 +01:00
Nathan Vasse
3616c72673 (demo) new demo
This new demo aims to take advantage of all the new Cunningham's
components. The old demo was kind of a draft, this new one gives
a better overview of what Cunningham is capable of.
2024-01-25 15:58:33 +01:00
renovate[bot]
b870fbb760 ⬆️(dependencies) update js dependencies 2024-01-22 17:29:30 +01:00
renovate[bot]
894bf5c155 ⬆️(dependencies) update js dependencies 2024-01-18 17:47:47 +01:00
Nathan Vasse
baba9ab00a 💄(react) change DatePicker clear icon
The close icon was not homogeneous with the other form inputs.

Fixes #229
2024-01-17 10:14:24 +01:00
Nathan Vasse
97a54ee6ae 🐛(react) fix TextArea value color
The dedicated token was not used, so here it is.

Fixes #230
2024-01-16 17:44:00 +01:00
Nathan Vasse
1b049f5b03 🧪(react) fix Toast flacky test
This tests was sometimes failing due to this really low duration of
the Toast.
2024-01-08 16:34:43 +01:00
renovate[bot]
08b5f75b38 ⬆️(dependencies) update js dependencies 2024-01-08 16:34:43 +01:00
Nathan Vasse
cef284b6ab 💄(react) update Alert and Toast icons
For aesthetic reasons we decided to use the circled versions of
icons.
2024-01-08 15:49:34 +01:00
Nathan Vasse
77921e018c (react) switch icons to material-icons-outlined
We decided to switch to this new icons family for aesthetic reasons.
2024-01-08 15:49:34 +01:00
Nathan Vasse
540cdc6896 💄(react) update Alert and Toast icon size
We realized that even if the Figma sketches indicates that the icons
are 16px in reality the rendered DOM was not visualy matching the
sketches. We needs 19px to match the sketches.
2024-01-08 15:49:34 +01:00
Nathan Vasse
5c5964cf9d 🐛(react) change most tertiary buttons to tertiary-text
Since the addition of tertiary-text variant, the original tertiary
variant has seen its background color changing from transparent to
greyscale-100, the change has impacted lots of components making
them look odd. So that's why I updated most of old tertiary to
tertiary-text.

Fixes #223
2024-01-08 15:26:37 +01:00
Nathan Vasse
1787df0853 (react) add ToastProvider to CunninghamProvider
This allows the consumer to use useToastProvider very easily, it avoids
thinking of explicity adding ToastProvider to apps that needs toasts.
2024-01-05 16:38:09 +01:00
Nathan Vasse
692b4a817d 📝(react) add Toast doc
With various examples and how-to guides.
2024-01-05 16:38:09 +01:00
Nathan Vasse
132b676ff7 (react) add Toast component
This component allows to create dynamic Toast appearing at the bottom
of the screen for few seconds.
2024-01-05 16:38:09 +01:00
Nathan Vasse
dd1a677a76 🧵(react) add Queue util
This util processes function given to it sequentially, using a FIFO
strategy.
2024-01-05 16:38:09 +01:00
Nathan Vasse
68608b5390 📱(react) add media mixin
We want to be able to use responsive media queries for the Toast
component.
2024-01-05 16:38:09 +01:00
Nathan Vasse
9e0f7c5ef4 🤡(react) add Animate API
The jest-dom by default does not mock the Animate API, as the Toast
use it we need to mock it.
2024-01-05 16:38:09 +01:00
Nathan Vasse
83a533d245 ♻️(react) extract typeToColor from AlertIcon
We will need to use the logic of this function in the Toast component.
2024-01-05 16:38:09 +01:00
Nathan Vasse
6e4dd55f49 🔧(react) regenerate tokens files
These new tokens file adds button and alert tokens.
2024-01-02 15:26:13 +01:00
Nathan Vasse
491f66f86e 📝(react) add Alert doc
Add the Alert doc with various examples and use cases.
2024-01-02 15:26:13 +01:00
Nathan Vasse
33d0c9fdca (react) add Alert
Here is the Alert component based on recent delivered sketches.
There is a main component that based on props renders sub alert components.
2024-01-02 15:26:13 +01:00
Nathan Vasse
3800cd8142 📝(react) create a stories for all buttons
Previously we were using a deprecated Storybook feature by using
canvas for multiple Stories and it was also rendering buttons not
aligned, so this new story is a better choice.
2024-01-02 15:26:13 +01:00
Nathan Vasse
e90a5dd6e6 (react) add text variants to Button
These variant are smaller buttons without background that can be used
in cases where we want the Button to have a minimal design.
2024-01-02 15:26:13 +01:00
Nathan Vasse
6d91c1d19f (react) add useControllableState hook
This hook is used to create a state that can be controlled by the parent.
If not the state is handled internally. We start to have this redundant
use case across Cunningham, so creating a dedicated hook reduces the
components verbosity and complexity.
2024-01-02 15:26:13 +01:00
Nathan Vasse
3dd7b3ef8e 🔖(release) version packages
Bump @openfun/cunningham-react to 2.4.0
Bump @openfun/cunningham-tokens to 2.1.0
2023-12-12 11:39:32 +01:00
Nathan Vasse
311c20e3e7 🏷️(react) fix stories warning
Having private props was causing the following error: Default export
of the module has or is using private name 'Props'. So exporting those
fixes the issue. It also has a double benefit as we provide exported
Props to library consummers.
2023-12-12 11:13:30 +01:00
renovate[bot]
bdf17929ba ⬆️(dependencies) update js dependencies 2023-12-12 11:13:30 +01:00
Nathan Vasse
72f7048514 💄(react) make Pagination responsive
We want to adapt the layout of Pagination to take less space when
its container is too small.
2023-12-12 11:04:25 +01:00
Nathan Vasse
da3761b699 💄(react) make DataGrid responsive
Previously the DataGrid was buggy in small width containers. Now it enables
an horizontal scroll, in the future we will use cards instead.
2023-12-12 11:04:25 +01:00
Nathan Vasse
6dcafa91f4 (react) add responsive helper
This helper provides handy functions to make components responsive.
2023-12-12 11:04:25 +01:00
Nathan Vasse
7b0686dede (react) add sass generator to react
We need to use sass variable in order to use breakpoints in media
queries. Using native CSS vars in media queries is not possible.
2023-12-12 11:04:25 +01:00
Nathan Vasse
5e3deb2399 (tokens) add breakpoints tokens
We need those to be able to make components responsive.
2023-12-12 11:04:25 +01:00
Nathan Vasse
7ddcfeb4bc 🐛(react) fix closing of menu via toggle button
Previously it was not possible to close the menu when clicking on
the toggle button on search select. It was caused by a conflicting
state update.
1. Downshift triggers closing the menu from getToggleButtonProps
2. wrapperProps was calling downshiftReturn.openMenu()
2023-11-30 10:40:13 +01:00
Nathan Vasse
b25aa8f078 🔖(release) version packages
Bump @openfun/cunningham-react to 2.3.0
2023-11-27 14:14:24 +01:00
Nathan Vasse
66e55e9647 ⬇️(deps) downgrade Typescript to 5.2.2
This new Typescript version introduced a crash when executing ts-node
in order to run cunningham.ts file. We need to wait for ts-node
to update their package too. Please see the related issue:
https://github.com/microsoft/TypeScript/issues/56492
2023-11-27 12:34:30 +01:00
renovate[bot]
516cb4e8cb ⬆️(dependencies) update js dependencies 2023-11-27 12:34:30 +01:00
Nathan Vasse
e3882eb308 🏷️(react) support ReactNode as input label
There are use cases that required to put links inside Checkboxes or
Radio inputs.
2023-11-27 10:02:28 +01:00
Nathan Vasse
6b6c0ea942 🔖(release) version packages
Bump @openfun/cunningham-react to 2.2.0
2023-11-24 11:15:55 +01:00
Nathan Vasse
94b32be5d3 (react) add monoline props to multi select
We want to enable a mode that prevent the pills the wrap on multiple
lines in order to control any height overflowing. In monoline mode the
selected items are displayed as text to allow text ellipsis, and the
menu renders the list items with checkboxes.
2023-11-24 11:01:41 +01:00
Nathan Vasse
7c13badeb2 ♻️(react) delete duplicated SelectMultiProps
During dev I realized that we had a duplicated SelectMultiProps which
was really misleanding.
2023-11-24 11:01:41 +01:00
Nathan Vasse
7201409d00 🚨(build) fix Vite CJS config warning
Since the migration to Vite 5 we had the "The CJS build of Vite's
Node API is deprecated" error ocurring during compilation.

We needed to rename to .mts the vite config file in order for it
to acknowledge that we are using the Node ESM API, this is needed
because we do not set "type": "module" in package.json because
we need to support CJS too.
2023-11-23 10:20:08 +01:00
Nathan Vasse
b2866c1d2b 📌(deps) pin node to version 18
We force node to version 18 otherwise renovate will keep updating it
to version 20.
2023-11-21 17:00:07 +01:00
Nathan Vasse
98c7075637 🔧(Docker) upgrade to node 18.18
The node LTS version is 18 and node 16 has reached its end of support the 11th
september 2023. Furthermore, some JS packages starts to remove support of node
version less than 18. That's why it seems to be the right moment for us to level
up to node 18.18.
2023-11-21 17:00:07 +01:00
renovate[bot]
35d0821287 ⬆️(dependencies) update js dependencies 2023-11-21 17:00:07 +01:00
Nathan Vasse
b340272207 🔖(release) version packages
Bump @openfun/cunningham-react to 2.1.0
Bump cunningham-demo to 1.0.1
2023-11-03 11:19:31 +01:00
Lebaud Antoine
d5fcf500b7 ♻️(react) merge duplicated scss classes related to accessibility
'offscreen' and 'c__offscreen' were duplicated, merge these two classes
in a dedicated utils file.
2023-10-24 20:32:42 +02:00