@gem-sdk/components 2.5.3-staging.8 → 2.5.3-staging.9

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.
@@ -71,7 +71,7 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
71
71
  onClick: onClickItem,
72
72
  "aria-hidden": true,
73
73
  children: /*#__PURE__*/ jsxRuntime.jsx("div", {
74
- className: "gp-w-full",
74
+ className: "gp-w-full gp-h-full",
75
75
  style: {
76
76
  ...itemShadowStyle
77
77
  },
@@ -82,7 +82,7 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
82
82
  data-index="${index}"
83
83
  >
84
84
  <div
85
- class="gp-w-full",
85
+ class="gp-w-full gp-h-full",
86
86
  style="${{
87
87
  ...itemShadowStyle
88
88
  }}"
@@ -50,7 +50,7 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
50
50
  childHasChildren,
51
51
  children
52
52
  ]);
53
- const { fullWidth, width, verticalGutter, background, columnGap } = styles ?? {};
53
+ const { fullWidth, width, verticalGutter, background, columnGap, height } = styles ?? {};
54
54
  const styleObject = helpers.createStyleObject(width, pageType === 'POST_PURCHASE' && isSection ? {
55
55
  desktop: false,
56
56
  tablet: false,
@@ -69,7 +69,8 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
69
69
  ...isSection ? restStyle : style,
70
70
  ...core.makeStyleResponsive('cg', verticalGutter),
71
71
  ...layout ? core.composeGridLayout(layout) : core.makeStyleResponsive('gtc', responsive),
72
- ...core.makeStyleResponsive('w', styleObject.content)
72
+ ...core.makeStyleResponsive('w', styleObject.content),
73
+ ...core.makeStyleResponsive('h', height)
73
74
  };
74
75
  if (pageType === 'POST_PURCHASE') {
75
76
  result = {
@@ -123,7 +124,7 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
123
124
  "data-id": builderProps?.uidInteraction ?? builderProps?.uid,
124
125
  ref: ref,
125
126
  style: getStyles(),
126
- className: core.cls(className, builderProps?.uid, 'gp-mb-0 gp-grid gp-mx-auto gp-max-w-full gp-gap-y-0 gp-transition-colors gp-duration-200 gp-ease-in-out ', {
127
+ className: core.cls(className, builderProps?.uid, 'gp-mb-0 gp-grid gp-mx-auto gp-max-w-full gp-gap-y-0 gp-transition-colors gp-duration-200 gp-ease-in-out gp-grid-rows-[1fr]', {
127
128
  'gp-content-visibility-hidden': mode !== 'edit' && isSection && lazy && !inView
128
129
  }),
129
130
  children: isDisplaySection ? /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
@@ -8,7 +8,7 @@ var helpers = require('../../helpers.js');
8
8
 
9
9
  const Row = ({ className, children, setting, builderAttrs, builderProps, styles, style, rawChildren, advanced, ...props })=>{
10
10
  const { isSection, horizontalAlign, verticalAlign, order, layout, responsive } = setting ?? {};
11
- const { fullWidth, width, verticalGutter, background } = styles ?? {};
11
+ const { fullWidth, width, verticalGutter, background, height } = styles ?? {};
12
12
  const styleObject = helpers$1.createStyleObject(width, fullWidth);
13
13
  const [wrapStyle, restStyle] = core.splitStyle([
14
14
  'pos',
@@ -31,6 +31,7 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
31
31
  ...core.makeStyleResponsive('pc', horizontalAlign),
32
32
  ...layout ? core.composeGridLayout(layout) : core.makeStyleResponsive('gtc', responsive),
33
33
  ...core.makeStyleResponsive('w', styleObject.content),
34
+ ...core.makeStyleResponsive('h', height),
34
35
  ...core.getStyleBackgroundByDevice(background, {
35
36
  liquid: true
36
37
  }),
@@ -254,6 +254,27 @@ const config = {
254
254
  }
255
255
  }
256
256
  },
257
+ {
258
+ id: 'height',
259
+ type: 'segment',
260
+ devices: {
261
+ desktop: {
262
+ default: 'auto'
263
+ }
264
+ },
265
+ options: [
266
+ {
267
+ label: 'Full',
268
+ value: '100%',
269
+ tooltip: 'Stretch to fill <br> vertical space around'
270
+ },
271
+ {
272
+ label: 'Fit',
273
+ value: 'auto',
274
+ tooltip: 'Auto-resize <br> based on content'
275
+ }
276
+ ]
277
+ },
257
278
  {
258
279
  id: 'verticalGutter',
259
280
  type: 'input:unit-spacing',
@@ -408,6 +429,16 @@ const config = {
408
429
  },
409
430
  layout: 'horizontal'
410
431
  },
432
+ {
433
+ type: 'control',
434
+ setting: {
435
+ id: 'height'
436
+ },
437
+ label: {
438
+ en: 'Height'
439
+ },
440
+ layout: 'horizontal'
441
+ },
411
442
  {
412
443
  type: 'control',
413
444
  label: {
@@ -21,6 +21,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
21
21
  };
22
22
  const imageWidth = shape ? core.makeStyleResponsive('w', core.getWidthByShapeGlobalSize(shape)) : core.makeStyleResponsive('w', core.makeWidth(styles?.width, styles?.fullWidth));
23
23
  const imageHeight = core.makeStyleResponsive('h', core.getHeightByShapeGlobalSize(shape));
24
+ const imageFlexGrowClass = core.getFlexGrowClassByShapeGlobalSize(shape);
24
25
  const overwriteDefaultRadius = (cornerRadius)=>{
25
26
  const radius = {
26
27
  ...cornerRadius
@@ -61,7 +62,9 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
61
62
  "data-id": builderProps?.uid,
62
63
  onClick: onClick,
63
64
  role: "presentation",
64
- className: core.cls('gp-group/image gp-relative', builderProps?.uid),
65
+ className: core.cls('gp-group/image gp-relative', builderProps?.uid, {
66
+ ...imageFlexGrowClass
67
+ }),
65
68
  style: {
66
69
  ...style,
67
70
  ...core.makeStyleResponsive('ta', styles?.align)
@@ -148,6 +148,15 @@ const config = {
148
148
  displayOptions: [
149
149
  'full'
150
150
  ]
151
+ },
152
+ height: {
153
+ displayOptions: [
154
+ 'full'
155
+ ],
156
+ units: [
157
+ 'px',
158
+ '%'
159
+ ]
151
160
  }
152
161
  },
153
162
  hiddenSettings: [
@@ -67,7 +67,7 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
67
67
  onClick: onClickItem,
68
68
  "aria-hidden": true,
69
69
  children: /*#__PURE__*/ jsx("div", {
70
- className: "gp-w-full",
70
+ className: "gp-w-full gp-h-full",
71
71
  style: {
72
72
  ...itemShadowStyle
73
73
  },
@@ -78,7 +78,7 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
78
78
  data-index="${index}"
79
79
  >
80
80
  <div
81
- class="gp-w-full",
81
+ class="gp-w-full gp-h-full",
82
82
  style="${{
83
83
  ...itemShadowStyle
84
84
  }}"
@@ -46,7 +46,7 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
46
46
  childHasChildren,
47
47
  children
48
48
  ]);
49
- const { fullWidth, width, verticalGutter, background, columnGap } = styles ?? {};
49
+ const { fullWidth, width, verticalGutter, background, columnGap, height } = styles ?? {};
50
50
  const styleObject = createStyleObject(width, pageType === 'POST_PURCHASE' && isSection ? {
51
51
  desktop: false,
52
52
  tablet: false,
@@ -65,7 +65,8 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
65
65
  ...isSection ? restStyle : style,
66
66
  ...makeStyleResponsive('cg', verticalGutter),
67
67
  ...layout ? composeGridLayout(layout) : makeStyleResponsive('gtc', responsive),
68
- ...makeStyleResponsive('w', styleObject.content)
68
+ ...makeStyleResponsive('w', styleObject.content),
69
+ ...makeStyleResponsive('h', height)
69
70
  };
70
71
  if (pageType === 'POST_PURCHASE') {
71
72
  result = {
@@ -119,7 +120,7 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
119
120
  "data-id": builderProps?.uidInteraction ?? builderProps?.uid,
120
121
  ref: ref,
121
122
  style: getStyles(),
122
- className: cls(className, builderProps?.uid, 'gp-mb-0 gp-grid gp-mx-auto gp-max-w-full gp-gap-y-0 gp-transition-colors gp-duration-200 gp-ease-in-out ', {
123
+ className: cls(className, builderProps?.uid, 'gp-mb-0 gp-grid gp-mx-auto gp-max-w-full gp-gap-y-0 gp-transition-colors gp-duration-200 gp-ease-in-out gp-grid-rows-[1fr]', {
123
124
  'gp-content-visibility-hidden': mode !== 'edit' && isSection && lazy && !inView
124
125
  }),
125
126
  children: isDisplaySection ? /*#__PURE__*/ jsx(Fragment, {
@@ -4,7 +4,7 @@ import { getSettingPreloadData } from '../../helpers.js';
4
4
 
5
5
  const Row = ({ className, children, setting, builderAttrs, builderProps, styles, style, rawChildren, advanced, ...props })=>{
6
6
  const { isSection, horizontalAlign, verticalAlign, order, layout, responsive } = setting ?? {};
7
- const { fullWidth, width, verticalGutter, background } = styles ?? {};
7
+ const { fullWidth, width, verticalGutter, background, height } = styles ?? {};
8
8
  const styleObject = createStyleObject(width, fullWidth);
9
9
  const [wrapStyle, restStyle] = splitStyle([
10
10
  'pos',
@@ -27,6 +27,7 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
27
27
  ...makeStyleResponsive('pc', horizontalAlign),
28
28
  ...layout ? composeGridLayout(layout) : makeStyleResponsive('gtc', responsive),
29
29
  ...makeStyleResponsive('w', styleObject.content),
30
+ ...makeStyleResponsive('h', height),
30
31
  ...getStyleBackgroundByDevice(background, {
31
32
  liquid: true
32
33
  }),
@@ -250,6 +250,27 @@ const config = {
250
250
  }
251
251
  }
252
252
  },
253
+ {
254
+ id: 'height',
255
+ type: 'segment',
256
+ devices: {
257
+ desktop: {
258
+ default: 'auto'
259
+ }
260
+ },
261
+ options: [
262
+ {
263
+ label: 'Full',
264
+ value: '100%',
265
+ tooltip: 'Stretch to fill <br> vertical space around'
266
+ },
267
+ {
268
+ label: 'Fit',
269
+ value: 'auto',
270
+ tooltip: 'Auto-resize <br> based on content'
271
+ }
272
+ ]
273
+ },
253
274
  {
254
275
  id: 'verticalGutter',
255
276
  type: 'input:unit-spacing',
@@ -404,6 +425,16 @@ const config = {
404
425
  },
405
426
  layout: 'horizontal'
406
427
  },
428
+ {
429
+ type: 'control',
430
+ setting: {
431
+ id: 'height'
432
+ },
433
+ label: {
434
+ en: 'Height'
435
+ },
436
+ layout: 'horizontal'
437
+ },
407
438
  {
408
439
  type: 'control',
409
440
  label: {
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { makeStyleResponsive, getWidthByShapeGlobalSize, makeWidth, getHeightByShapeGlobalSize, cls, getStyleShadowState, handleConvertClassColor, getBorderStyle, getBorderRadiusStyle, getStyleShadow, getAspectRatioGlobalSize, getGlobalColorStateClass, getGlobalColorStateStyle, makeStyleState, getCornerCSSFromGlobal } from '@gem-sdk/core';
2
+ import { makeStyleResponsive, getWidthByShapeGlobalSize, makeWidth, getHeightByShapeGlobalSize, getFlexGrowClassByShapeGlobalSize, cls, getStyleShadowState, handleConvertClassColor, getBorderStyle, getBorderRadiusStyle, getStyleShadow, getAspectRatioGlobalSize, getGlobalColorStateClass, getGlobalColorStateStyle, makeStyleState, getCornerCSSFromGlobal } from '@gem-sdk/core';
3
3
  import Link from '../../link/components/Link.js';
4
4
  import AdaptiveImage from './AdaptiveImage.js';
5
5
  import NextImage from './NextImage.js';
@@ -17,6 +17,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
17
17
  };
18
18
  const imageWidth = shape ? makeStyleResponsive('w', getWidthByShapeGlobalSize(shape)) : makeStyleResponsive('w', makeWidth(styles?.width, styles?.fullWidth));
19
19
  const imageHeight = makeStyleResponsive('h', getHeightByShapeGlobalSize(shape));
20
+ const imageFlexGrowClass = getFlexGrowClassByShapeGlobalSize(shape);
20
21
  const overwriteDefaultRadius = (cornerRadius)=>{
21
22
  const radius = {
22
23
  ...cornerRadius
@@ -57,7 +58,9 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
57
58
  "data-id": builderProps?.uid,
58
59
  onClick: onClick,
59
60
  role: "presentation",
60
- className: cls('gp-group/image gp-relative', builderProps?.uid),
61
+ className: cls('gp-group/image gp-relative', builderProps?.uid, {
62
+ ...imageFlexGrowClass
63
+ }),
61
64
  style: {
62
65
  ...style,
63
66
  ...makeStyleResponsive('ta', styles?.align)
@@ -144,6 +144,15 @@ const config = {
144
144
  displayOptions: [
145
145
  'full'
146
146
  ]
147
+ },
148
+ height: {
149
+ displayOptions: [
150
+ 'full'
151
+ ],
152
+ units: [
153
+ 'px',
154
+ '%'
155
+ ]
147
156
  }
148
157
  },
149
158
  hiddenSettings: [
@@ -548,6 +548,7 @@ type RowProps$1 = BaseProps<{
548
548
  }, {
549
549
  fullWidth?: ObjectDevices<boolean>;
550
550
  width?: ObjectDevices<string>;
551
+ height?: ObjectDevices<'auto' | '100%'>;
551
552
  verticalGutter?: ObjectDevices<string>;
552
553
  background?: ObjectDevices<Background>;
553
554
  preloadBgImage?: boolean;
@@ -5536,6 +5537,7 @@ type RowProps = BaseProps<{
5536
5537
  }, {
5537
5538
  fullWidth?: ObjectDevices<boolean>;
5538
5539
  width?: ObjectDevices<string>;
5540
+ height?: ObjectDevices<'auto' | '100%'>;
5539
5541
  verticalGutter?: ObjectDevices<string>;
5540
5542
  background?: ObjectDevices<Background>;
5541
5543
  preloadBgImage?: boolean;
@@ -5681,6 +5683,7 @@ declare const Product: ({ children, setting, styles, style, builderProps, rawChi
5681
5683
  }, {
5682
5684
  fullWidth?: Partial<Record<_gem_sdk_core.NameDevices, boolean>> | undefined;
5683
5685
  width?: Partial<Record<_gem_sdk_core.NameDevices, string>> | undefined;
5686
+ height?: Partial<Record<_gem_sdk_core.NameDevices, "auto" | "100%">> | undefined;
5684
5687
  verticalGutter?: Partial<Record<_gem_sdk_core.NameDevices, string>> | undefined;
5685
5688
  background?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.Background>> | undefined;
5686
5689
  preloadBgImage?: boolean | undefined;
@@ -6480,6 +6483,7 @@ declare const HeroBanner: ({ builderAttrs, builderProps, setting, styles, style,
6480
6483
  } & Pick<{
6481
6484
  fullWidth?: Partial<Record<NameDevices, boolean>> | undefined;
6482
6485
  width?: Partial<Record<NameDevices, string>> | undefined;
6486
+ height?: Partial<Record<NameDevices, "auto" | "100%">> | undefined;
6483
6487
  verticalGutter?: Partial<Record<NameDevices, string>> | undefined;
6484
6488
  background?: Partial<Record<NameDevices, Background>> | undefined;
6485
6489
  preloadBgImage?: boolean | undefined;
@@ -6723,6 +6727,7 @@ declare const CollectionBanner: ({ builderAttrs, builderProps, setting, style, c
6723
6727
  }, "layout" | "verticalAlign" | "horizontalAlign"> & Pick<{
6724
6728
  fullWidth?: Partial<Record<_gem_sdk_core.NameDevices, boolean>> | undefined;
6725
6729
  width?: Partial<Record<_gem_sdk_core.NameDevices, string>> | undefined;
6730
+ height?: Partial<Record<_gem_sdk_core.NameDevices, "auto" | "100%">> | undefined;
6726
6731
  verticalGutter?: Partial<Record<_gem_sdk_core.NameDevices, string>> | undefined;
6727
6732
  background?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.Background>> | undefined;
6728
6733
  preloadBgImage?: boolean | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.5.3-staging.8",
3
+ "version": "2.5.3-staging.9",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -21,7 +21,7 @@
21
21
  "format": "prettier --write \"./src/**/*.{ts,tsx}\""
22
22
  },
23
23
  "devDependencies": {
24
- "@gem-sdk/core": "2.5.3-staging.7",
24
+ "@gem-sdk/core": "2.5.3-staging.9",
25
25
  "@gem-sdk/styles": "2.4.8",
26
26
  "@types/react-transition-group": "^4.4.5"
27
27
  },