@growth-angels/ds-core 1.21.2 → 1.22.0

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.
@@ -13,8 +13,6 @@ 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");
18
16
  const Component = CarouselSwiper;
19
17
  if (!Component)
20
18
  return;
@@ -28,6 +26,8 @@ export function HydrateCarousel(islands) {
28
26
  root.render(createElement(Component, { ...parsedProps, children }));
29
27
  carousel.setAttribute("data-hydrated", "true");
30
28
  // finally show the carousel
31
- carousel.setAttribute("style", "opacity: 1");
29
+ setTimeout(() => {
30
+ carousel.setAttribute("style", "opacity: 1");
31
+ }, 1000);
32
32
  });
33
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@growth-angels/ds-core",
3
- "version": "1.21.2",
3
+ "version": "1.22.0",
4
4
  "description": "Design system by Growth Angels",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -37,7 +37,7 @@
37
37
  "build-storybook": "storybook build"
38
38
  },
39
39
  "dependencies": {
40
- "@growth-angels/foundation": "^1.4.1",
40
+ "@growth-angels/foundation": "^1.4.2",
41
41
  "swiper": "^12.0.3"
42
42
  },
43
43
  "peerDependencies": {
@@ -6,6 +6,7 @@
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  align-items: stretch;
9
+ --ga-container-safe-zone: 2.4rem;
9
10
 
10
11
  &:not(.ga-ds-container--full) {
11
12
  padding-left: var(--ga-container-safe-zone, 2.4rem);
@@ -29,43 +30,35 @@
29
30
  }
30
31
  }
31
32
 
32
- .ga-ds-container--small {
33
- @include bp-up("lg", $ga-breakpoints) {
34
- &:not(.ga-ds-container-stretch--right) {
35
- padding-right: calc((100% - (#{map.get($ga-containers, "sm")} / 0.8)) / 2);
36
- }
37
- &:not(.ga-ds-container-stretch--left) {
38
- padding-left: calc((100% - (#{map.get($ga-containers, "sm")} / 0.8)) / 2);
39
- }
40
- }
41
- @include bp-up("xxl", $ga-breakpoints) {
42
- &:not(.ga-ds-container-stretch--right) {
43
- padding-right: calc((100% - #{map.get($ga-containers, "sm")}) / 2);
44
- }
45
- &:not(.ga-ds-container-stretch--left) {
46
- padding-left: calc((100% - #{map.get($ga-containers, "sm")}) / 2);
47
- }
48
- }
49
- }
33
+ @each $key, $config in $ga-containers {
34
+ $breakpoint: map.get($config, "breakpoint");
35
+ $size: map.get($config, "size");
36
+ $class: map.get($config, "key");
50
37
 
51
- @include bp-up("xxl", $ga-breakpoints) {
52
- .ga-ds-container--medium {
53
- &:not(.ga-ds-container-stretch--right) {
54
- padding-right: calc((100% - #{map.get($ga-containers, "md")}) / 2);
55
- }
56
- &:not(.ga-ds-container-stretch--left) {
57
- padding-left: calc((100% - #{map.get($ga-containers, "md")}) / 2);
38
+ @if $key == null {
39
+ @warn "Unknown container key: #{$key}";
40
+ } @else if $key != "max" {
41
+ @include bp-up($breakpoint, $ga-breakpoints) {
42
+ .ga-ds-container--#{$class} {
43
+ &:not(.ga-ds-container-stretch--right) {
44
+ padding-right: calc((100% - (#{$size})) / 2);
45
+ }
46
+ &:not(.ga-ds-container-stretch--left) {
47
+ padding-left: calc((100% - (#{$size})) / 2);
48
+ }
49
+ }
58
50
  }
59
51
  }
60
- }
61
-
62
- @include bp-up("xxl", $ga-breakpoints) {
63
- .ga-ds-container--large {
64
- &:not(.ga-ds-container-stretch--right) {
65
- padding-right: calc((100% - #{map.get($ga-containers, "lg")}) / 2);
66
- }
67
- &:not(.ga-ds-container-stretch--left) {
68
- padding-left: calc((100% - #{map.get($ga-containers, "lg")}) / 2);
52
+ @if $key == "max" {
53
+ @include bp-up($breakpoint, $ga-breakpoints) {
54
+ .ga-ds-container--large {
55
+ &:not(.ga-ds-container-stretch--right) {
56
+ padding-right: calc((100% - (#{$size})) / 2);
57
+ }
58
+ &:not(.ga-ds-container-stretch--left) {
59
+ padding-left: calc((100% - (#{$size})) / 2);
60
+ }
61
+ }
69
62
  }
70
63
  }
71
64
  }
@@ -13,8 +13,6 @@ 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")
18
16
  const Component = CarouselSwiper
19
17
  if (!Component) return
20
18
  const props = carousel.getAttribute("data-props")
@@ -31,6 +29,8 @@ export function HydrateCarousel(islands: NodeListOf<Element> | null) {
31
29
  root.render(createElement(Component, { ...parsedProps, children }))
32
30
  carousel.setAttribute("data-hydrated", "true")
33
31
  // finally show the carousel
34
- carousel.setAttribute("style", "opacity: 1")
32
+ setTimeout(() => {
33
+ carousel.setAttribute("style", "opacity: 1")
34
+ }, 1000)
35
35
  })
36
36
  }