@gem-sdk/components 2.0.0-dev.475 → 2.0.0-dev.478

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.
@@ -171,8 +171,9 @@ const CarouselSettingsV2Setting = [
171
171
  {
172
172
  id: 'dotGapToCarousel',
173
173
  label: 'Gap to carousel',
174
- type: 'input:number',
174
+ type: 'input:slider',
175
175
  min: 0,
176
+ max: 120,
176
177
  devices: {
177
178
  desktop: {
178
179
  default: 16
@@ -740,7 +741,9 @@ const CarouselSettingsV2Style = [
740
741
  {
741
742
  id: 'spacing',
742
743
  label: 'Items spacing',
743
- type: 'input:number',
744
+ type: 'input:slider',
745
+ min: 1,
746
+ max: 120,
744
747
  devices: {
745
748
  desktop: {
746
749
  default: 16
@@ -6,22 +6,22 @@ const CouponSettings = [
6
6
  controls: [
7
7
  {
8
8
  id: 'couponLayout',
9
- label: 'Price Layout',
10
- type: 'layout-segment',
11
- iconViewBox: '0 0 120 72',
12
- enableItemBackground: true,
13
- enableTooltip: false,
9
+ label: 'Layout',
10
+ type: 'layout-selector',
11
+ iconViewBox: '0 0 80 48',
12
+ itemPerRow: 2,
13
+ itemSpacing: 'large',
14
14
  default: 'icon',
15
15
  options: [
16
16
  {
17
- label: 'secondary',
17
+ label: 'Secondary',
18
18
  value: 'none',
19
- type: 'copy-layout'
19
+ iconName: 'gp-coupon-code-layout'
20
20
  },
21
21
  {
22
- label: 'link',
22
+ label: 'Icon',
23
23
  value: 'icon',
24
- type: 'copy-layout'
24
+ iconName: 'gp-coupon-code-no-icon-layout'
25
25
  }
26
26
  ]
27
27
  },
@@ -16,10 +16,9 @@ var classes = require('./common/classes.js');
16
16
 
17
17
  const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced })=>{
18
18
  const { background, preloadBgImage, width, isScrollToTop } = setting ?? {};
19
- const { w, positionStyle, displayStyle } = useSticky.default(setting);
19
+ const { positionStyle, displayStyle } = useSticky.default(setting);
20
20
  const computedContainerStyles = system.createStyle({
21
21
  margin: '0 auto',
22
- ...w,
23
22
  ...displayStyle,
24
23
  ...styles.getStylePadding(style),
25
24
  ...positionStyle,
@@ -12,7 +12,6 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
12
12
  const { width, position, display, preloadBgImage, background, isScrollToTop } = setting ?? {};
13
13
  const advancedDisplay = advanced?.d;
14
14
  const computedContainerStyles = system.createStyle(styles.getContainerStyles({
15
- width,
16
15
  position,
17
16
  style,
18
17
  display
@@ -15,7 +15,7 @@ const getDisplayStyle = (device, display, position)=>{
15
15
  return style;
16
16
  };
17
17
  const getCSSPosition = (position, device)=>{
18
- if (device === '-mobile') {
18
+ if (device === '-mobile' || device === '-tablet') {
19
19
  return 'fixed';
20
20
  }
21
21
  return position == 'top' ? 'sticky' : 'fixed';
@@ -44,8 +44,8 @@ const getContentStyles = (args)=>{
44
44
  }),
45
45
  ...core.makeStyleResponsive('w', width),
46
46
  ...filterStyles(style),
47
- ...core.getGradientBgrStyleByDevice(background),
48
- ...core.getStyleBackgroundByDevice(background)
47
+ ...core.getStyleBackgroundByDevice(background),
48
+ ...core.getGradientBgrStyleByDevice(background)
49
49
  };
50
50
  };
51
51
  const getStylePadding = (style)=>{
@@ -10,8 +10,8 @@ const useSticky = (setting)=>{
10
10
  const w = core.makeStyleResponsive('w', width);
11
11
  const sidebarMode = core.usePageStore((s)=>s.sidebarMode === 'interaction');
12
12
  const currentDevice = core.useCurrentDevice();
13
- const getCSSPosition = (position, isMobile)=>{
14
- if (isMobile) {
13
+ const getCSSPosition = (position, forceFixed)=>{
14
+ if (forceFixed) {
15
15
  return 'fixed';
16
16
  }
17
17
  return position == 'top' ? 'sticky' : 'fixed';
@@ -61,7 +61,7 @@ const useSticky = (setting)=>{
61
61
  const positionStyle = React.useMemo(()=>{
62
62
  return {
63
63
  [`--pos`]: getCSSPosition(position?.desktop),
64
- [`--pos-tablet`]: getCSSPosition(position?.tablet ?? position?.desktop),
64
+ [`--pos-tablet`]: getCSSPosition(position?.tablet ?? position?.desktop, true),
65
65
  [`--pos-mobile`]: getCSSPosition(position?.mobile ?? position?.desktop, true)
66
66
  };
67
67
  }, [
@@ -169,8 +169,9 @@ const CarouselSettingsV2Setting = [
169
169
  {
170
170
  id: 'dotGapToCarousel',
171
171
  label: 'Gap to carousel',
172
- type: 'input:number',
172
+ type: 'input:slider',
173
173
  min: 0,
174
+ max: 120,
174
175
  devices: {
175
176
  desktop: {
176
177
  default: 16
@@ -738,7 +739,9 @@ const CarouselSettingsV2Style = [
738
739
  {
739
740
  id: 'spacing',
740
741
  label: 'Items spacing',
741
- type: 'input:number',
742
+ type: 'input:slider',
743
+ min: 1,
744
+ max: 120,
742
745
  devices: {
743
746
  desktop: {
744
747
  default: 16
@@ -4,22 +4,22 @@ const CouponSettings = [
4
4
  controls: [
5
5
  {
6
6
  id: 'couponLayout',
7
- label: 'Price Layout',
8
- type: 'layout-segment',
9
- iconViewBox: '0 0 120 72',
10
- enableItemBackground: true,
11
- enableTooltip: false,
7
+ label: 'Layout',
8
+ type: 'layout-selector',
9
+ iconViewBox: '0 0 80 48',
10
+ itemPerRow: 2,
11
+ itemSpacing: 'large',
12
12
  default: 'icon',
13
13
  options: [
14
14
  {
15
- label: 'secondary',
15
+ label: 'Secondary',
16
16
  value: 'none',
17
- type: 'copy-layout'
17
+ iconName: 'gp-coupon-code-layout'
18
18
  },
19
19
  {
20
- label: 'link',
20
+ label: 'Icon',
21
21
  value: 'icon',
22
- type: 'copy-layout'
22
+ iconName: 'gp-coupon-code-no-icon-layout'
23
23
  }
24
24
  ]
25
25
  },
@@ -12,10 +12,9 @@ import { getContainerClasses } from './common/classes.js';
12
12
 
13
13
  const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced })=>{
14
14
  const { background, preloadBgImage, width, isScrollToTop } = setting ?? {};
15
- const { w, positionStyle, displayStyle } = useSticky(setting);
15
+ const { positionStyle, displayStyle } = useSticky(setting);
16
16
  const computedContainerStyles = createStyle({
17
17
  margin: '0 auto',
18
- ...w,
19
18
  ...displayStyle,
20
19
  ...getStylePadding(style),
21
20
  ...positionStyle,
@@ -8,7 +8,6 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
8
8
  const { width, position, display, preloadBgImage, background, isScrollToTop } = setting ?? {};
9
9
  const advancedDisplay = advanced?.d;
10
10
  const computedContainerStyles = createStyle(getContainerStyles({
11
- width,
12
11
  position,
13
12
  style,
14
13
  display
@@ -1,4 +1,4 @@
1
- import { makeStyle, makeStyleResponsive, getGradientBgrStyleByDevice, getStyleBackgroundByDevice } from '@gem-sdk/core';
1
+ import { makeStyle, makeStyleResponsive, getStyleBackgroundByDevice, getGradientBgrStyleByDevice } from '@gem-sdk/core';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import { ELEMENT_Z_INDEX } from '../../../common/const.js';
@@ -13,7 +13,7 @@ const getDisplayStyle = (device, display, position)=>{
13
13
  return style;
14
14
  };
15
15
  const getCSSPosition = (position, device)=>{
16
- if (device === '-mobile') {
16
+ if (device === '-mobile' || device === '-tablet') {
17
17
  return 'fixed';
18
18
  }
19
19
  return position == 'top' ? 'sticky' : 'fixed';
@@ -42,8 +42,8 @@ const getContentStyles = (args)=>{
42
42
  }),
43
43
  ...makeStyleResponsive('w', width),
44
44
  ...filterStyles(style),
45
- ...getGradientBgrStyleByDevice(background),
46
- ...getStyleBackgroundByDevice(background)
45
+ ...getStyleBackgroundByDevice(background),
46
+ ...getGradientBgrStyleByDevice(background)
47
47
  };
48
48
  };
49
49
  const getStylePadding = (style)=>{
@@ -6,8 +6,8 @@ const useSticky = (setting)=>{
6
6
  const w = makeStyleResponsive('w', width);
7
7
  const sidebarMode = usePageStore((s)=>s.sidebarMode === 'interaction');
8
8
  const currentDevice = useCurrentDevice();
9
- const getCSSPosition = (position, isMobile)=>{
10
- if (isMobile) {
9
+ const getCSSPosition = (position, forceFixed)=>{
10
+ if (forceFixed) {
11
11
  return 'fixed';
12
12
  }
13
13
  return position == 'top' ? 'sticky' : 'fixed';
@@ -57,7 +57,7 @@ const useSticky = (setting)=>{
57
57
  const positionStyle = useMemo(()=>{
58
58
  return {
59
59
  [`--pos`]: getCSSPosition(position?.desktop),
60
- [`--pos-tablet`]: getCSSPosition(position?.tablet ?? position?.desktop),
60
+ [`--pos-tablet`]: getCSSPosition(position?.tablet ?? position?.desktop, true),
61
61
  [`--pos-mobile`]: getCSSPosition(position?.mobile ?? position?.desktop, true)
62
62
  };
63
63
  }, [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.475",
3
+ "version": "2.0.0-dev.478",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",