@growth-angels/ds-core 1.21.1 → 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.
@@ -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}`,
@@ -25,5 +25,9 @@ export function HydrateCarousel(islands) {
25
25
  const root = createRoot(carousel);
26
26
  root.render(createElement(Component, { ...parsedProps, children }));
27
27
  carousel.setAttribute("data-hydrated", "true");
28
+ // finally show the carousel
29
+ setTimeout(() => {
30
+ carousel.setAttribute("style", "opacity: 1");
31
+ }, 1000);
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.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
  }
@@ -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}`,
@@ -28,5 +28,9 @@ export function HydrateCarousel(islands: NodeListOf<Element> | null) {
28
28
 
29
29
  root.render(createElement(Component, { ...parsedProps, children }))
30
30
  carousel.setAttribute("data-hydrated", "true")
31
+ // finally show the carousel
32
+ setTimeout(() => {
33
+ carousel.setAttribute("style", "opacity: 1")
34
+ }, 1000)
31
35
  })
32
36
  }