@growth-angels/ds-core 1.21.1 → 1.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  export const Container = (props) => {
3
3
  const { size, children, style, padding, margin, stretch, id, paddingPosition, marginPosition } = props;
4
- console.log("Container props", props);
5
4
  const classes = [
6
5
  "ga-ds-container",
7
6
  `ga-ds-container--${size}`,
@@ -13,6 +13,8 @@ import "swiper/css/autoplay";
13
13
  const { createElement, createRoot } = useReactAdapter();
14
14
  export function HydrateCarousel(islands) {
15
15
  islands?.forEach((carousel) => {
16
+ // first hide all carousels to prevent FOUC
17
+ carousel.setAttribute("style", "opacity: 0");
16
18
  const Component = CarouselSwiper;
17
19
  if (!Component)
18
20
  return;
@@ -25,5 +27,7 @@ export function HydrateCarousel(islands) {
25
27
  const root = createRoot(carousel);
26
28
  root.render(createElement(Component, { ...parsedProps, children }));
27
29
  carousel.setAttribute("data-hydrated", "true");
30
+ // finally show the carousel
31
+ carousel.setAttribute("style", "opacity: 1");
28
32
  });
29
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@growth-angels/ds-core",
3
- "version": "1.21.1",
3
+ "version": "1.21.2",
4
4
  "description": "Design system by Growth Angels",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -2,7 +2,6 @@ import type { ContainerProps } from "./Container.types"
2
2
 
3
3
  export const Container = (props: ContainerProps) => {
4
4
  const { size, children, style, padding, margin, stretch, id, paddingPosition, marginPosition } = props
5
- console.log("Container props", props)
6
5
  const classes = [
7
6
  "ga-ds-container",
8
7
  `ga-ds-container--${size}`,
@@ -13,6 +13,8 @@ const { createElement, createRoot } = useReactAdapter()
13
13
 
14
14
  export function HydrateCarousel(islands: NodeListOf<Element> | null) {
15
15
  islands?.forEach((carousel) => {
16
+ // first hide all carousels to prevent FOUC
17
+ carousel.setAttribute("style", "opacity: 0")
16
18
  const Component = CarouselSwiper
17
19
  if (!Component) return
18
20
  const props = carousel.getAttribute("data-props")
@@ -28,5 +30,7 @@ export function HydrateCarousel(islands: NodeListOf<Element> | null) {
28
30
 
29
31
  root.render(createElement(Component, { ...parsedProps, children }))
30
32
  carousel.setAttribute("data-hydrated", "true")
33
+ // finally show the carousel
34
+ carousel.setAttribute("style", "opacity: 1")
31
35
  })
32
36
  }