Commit Graph

10 Commits

Author SHA1 Message Date
Emmanuel Pelletier
e47ac65e80 gaufre: follow disclosure aria pattern
- add aria attributes on load with the gaufre api script so that people
already using la gaufre don't necessarely *have* to update their code
- add the aria patterns in given code examples/react components. In some
cases, our small page load JS code isn't enough: for example on SPAs
where gaufre buttons might be loaded after page load.

thanks @inseo
2025-04-17 17:27:58 +02:00
Emmanuel Pelletier
a4d98f4f17 gaufre: fix modal mode sizing issue on mobile
the 100vh takes too much place sometime, making the close button being
rendered behind the browser UI. now we use the "svh" unit when
available, which is the same as vh but making sure we dont overlap with
browser UI.
2024-06-21 15:12:45 +02:00
Emmanuel Pelletier
862d475f15 gaufre: fix crash on safari
the popup object was always null in this case, we have to use the given
element from the parameter
2024-06-21 15:12:45 +02:00
Emmanuel Pelletier
62b74a5445 gaufre: fix popup placement issues, simplify styling
this is done following up Tchap integration.

- the popup placement script was really dumb and assumed the gaufre
button was always placed at the top right of the page. Tchap can't do
that and uses it at the bottom left. Now the popup places itself
correctly wherever the button is on the page.
On mobile now we have a "modal" mode for the popup where it takes all
the viewport.
- Tchap uses the gaufre inside their own popup component. This was not
something we handled before. Now you can set up a
'lasuite--gaufre-borderless' class on your html or body tag so that the
gaufre doesn't render its box shadow or blue border, making it easier to
integrate in a already made popup.
2024-06-21 15:12:45 +02:00
Emmanuel Pelletier
1618bb1d1b gaufre: hide it if the server is unavailable
use visiblity: hidden instead of display: none to prevent layout shifts.
2024-05-15 09:52:42 +02:00
Emmanuel Pelletier
1a436de8dc api/gaufre: fix crash on safari
the popup didn't open correctly on webkit based browsers,
now it does!
2024-05-13 16:00:39 +02:00
Emmanuel Pelletier
63d34d2315 api/gaufre: make sure the popup is shown in the viewport
small test that anchors the popup to the left of the viewport, this
quickly fixes the popup going out of viewport if the Gaufre button is
used on the left of a header bar
2024-05-07 22:11:54 +02:00
Emmanuel Pelletier
087bc5a889 api/gaufre: stop using an iframe
iframe was great because we controlled our page context to style things
easily, handle assets easily.

But since it's not on the same domain as the services consuming it, it
implied configuration here and there. Also some behaviors were annoying
to implement (for example, keyboard navigation). I'm sure everything we
do is possible via iframe but I feel like I'll go from barrier to
barrier at every new thing we want to do…

I feel like, at the cost of handling style-conflicts, just rendering
everything in the real page context is more future-proof.
2024-05-07 21:59:58 +02:00
Emmanuel Pelletier
c041c77360 adding 'la suite territoriale' specific gaufre button/endpoint 2024-05-02 12:58:24 +02:00
Emmanuel Pelletier
d9859f1564 first commit:
- we have a static astro website under /website. It has the
implementation docs of the homepage/gaufre templates, and it handles the
few API endpoints (the gaufre js, backgrounds, logos)
- we have a vite app under /packages/integration. It has the react
components generating the homepage and the gaufre button, and their css.
Its used to generate an npm package
2024-05-02 00:35:38 +02:00