@gem-sdk/components 2.0.0-dev.676 → 2.0.0-dev.678

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.
@@ -10,14 +10,12 @@ var DesktopMenuItem = require('./DesktopMenuItem.js');
10
10
  const DesktopMenu = ({ menu, height, arrow, textColor, menuTextColor, typography, typo, headerBg, menuBg, className })=>{
11
11
  const rootMenu = menu?.ROOT;
12
12
  const appendTypoClass = core.composeTypographyClassName(typo, typography);
13
- const appendTypoStyle = core.composeTypographyStyle(typo, typography);
14
13
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
15
14
  className: core.cls('gp-flex gp-flex-1 gp-items-center gp-justify-center', className),
16
15
  children: /*#__PURE__*/ jsxRuntime.jsx("ul", {
17
16
  className: core.cls('gp-flex', appendTypoClass),
18
17
  style: {
19
- ...core.makeStyleResponsive('h', height),
20
- ...appendTypoStyle
18
+ ...core.makeStyleResponsive('h', height)
21
19
  },
22
20
  children: rootMenu?.childrens?.map((id)=>/*#__PURE__*/ jsxRuntime.jsx(DesktopMenuItem.default, {
23
21
  id: id,
@@ -28,7 +26,9 @@ const DesktopMenu = ({ menu, height, arrow, textColor, menuTextColor, typography
28
26
  menuTextColor: menuTextColor,
29
27
  textColor: textColor,
30
28
  headerBg: headerBg,
31
- menuBg: menuBg
29
+ menuBg: menuBg,
30
+ typography: typography,
31
+ typo: typo
32
32
  }, id))
33
33
  })
34
34
  });
@@ -7,10 +7,11 @@ var jsxRuntime = require('react/jsx-runtime');
7
7
  var core = require('@gem-sdk/core');
8
8
  var Link = require('next/link');
9
9
 
10
- const DesktopMenuItem = ({ id, menu, arrow, textColor, menuTextColor, depth = 0, maxDepth = 2, menuBg })=>{
10
+ const DesktopMenuItem = ({ id, menu, arrow, textColor, menuTextColor, depth = 0, maxDepth = 2, menuBg, typo, typography })=>{
11
11
  const item = menu?.[id];
12
12
  if (!item || depth > maxDepth) return null;
13
13
  const lastDepth = depth === maxDepth;
14
+ const appendTypoStyle = core.composeTypographyStyle(typo, typography);
14
15
  const renderChild = !!item?.childrens?.length && !lastDepth;
15
16
  const hasCaret = renderChild && !!arrow;
16
17
  return /*#__PURE__*/ jsxRuntime.jsxs("li", {
@@ -19,7 +20,8 @@ const DesktopMenuItem = ({ id, menu, arrow, textColor, menuTextColor, depth = 0,
19
20
  'gp-min-w-[200px] gp-border-b last:gp-border-b-transparent': depth > 0
20
21
  }),
21
22
  style: {
22
- ...core.getGlobalColorStateStyle('c', depth === 0 ? textColor : menuTextColor)
23
+ ...core.getGlobalColorStateStyle('c', depth === 0 ? textColor : menuTextColor),
24
+ ...appendTypoStyle
23
25
  },
24
26
  children: [
25
27
  item?.link && !item.childrens?.length ? /*#__PURE__*/ jsxRuntime.jsx(Link, {
@@ -56,7 +58,9 @@ const DesktopMenuItem = ({ id, menu, arrow, textColor, menuTextColor, depth = 0,
56
58
  maxDepth: maxDepth,
57
59
  arrow: arrow,
58
60
  menuTextColor: menuTextColor,
59
- menuBg: menuBg
61
+ menuBg: menuBg,
62
+ typo: typo,
63
+ typography: typography
60
64
  }, childId))
61
65
  })
62
66
  })
@@ -37,9 +37,10 @@ const transitionStyles = {
37
37
  opacity: 0
38
38
  }
39
39
  };
40
- const MenuMobileItem = ({ id, menu, arrow, menuBg, menuTextColor, closeMenu, depth = 0, maxDepth = 2 })=>{
40
+ const MenuMobileItem = ({ id, menu, arrow, menuBg, menuTextColor, closeMenu, depth = 0, maxDepth = 2, typo, typography })=>{
41
41
  const [isOpen, setIsOpen] = React.useState(false);
42
42
  const nodeRef = React.useRef(null);
43
+ const appendTypoStyle = core.composeTypographyStyle(typo, typography);
43
44
  const item = menu?.[id];
44
45
  if (!item || depth > maxDepth) return null;
45
46
  const lastDepth = depth === maxDepth;
@@ -69,6 +70,9 @@ const MenuMobileItem = ({ id, menu, arrow, menuBg, menuTextColor, closeMenu, dep
69
70
  title: item.title,
70
71
  children: item.title
71
72
  }) : /*#__PURE__*/ jsxRuntime.jsx("span", {
73
+ style: {
74
+ ...appendTypoStyle
75
+ },
72
76
  children: item?.title
73
77
  }),
74
78
  hasCaret && /*#__PURE__*/ jsxRuntime.jsx("span", {
@@ -79,7 +83,10 @@ const MenuMobileItem = ({ id, menu, arrow, menuBg, menuTextColor, closeMenu, dep
79
83
  'gp-rotate-0': depth > 0 && !isOpen,
80
84
  'gp-rotate-180': depth > 0 && isOpen,
81
85
  '-gp-rotate-90': depth === 0
82
- })
86
+ }),
87
+ style: {
88
+ ...appendTypoStyle
89
+ }
83
90
  })
84
91
  ]
85
92
  }),
@@ -67,7 +67,6 @@ const MobileMenu = ({ menu, typography, typo, arrow, menuTextColor, menuBg, text
67
67
  setIsOpen(open);
68
68
  };
69
69
  const appendTypoClass = core.composeTypographyClassName(typo, typography);
70
- const appendTypoStyle = core.composeTypographyStyle(typo, typography);
71
70
  return /*#__PURE__*/ jsxRuntime.jsxs("div", {
72
71
  ref: wrap,
73
72
  className: core.cls('gp-relative gp-z-5 gp-h-full gp-items-center gp-justify-center', className),
@@ -132,7 +131,6 @@ const MobileMenu = ({ menu, typography, typo, arrow, menuTextColor, menuBg, text
132
131
  className: core.cls('gp-w-full scrollbar:!gp-h-1.5 scrollbar:!gp-w-1.5 scrollbar:gp-bg-transparent scrollbar-track:!gp-rounded scrollbar-track:!gp-bg-slate-100 scrollbar-thumb:!gp-rounded scrollbar-thumb:!gp-bg-slate-300', appendTypoClass),
133
132
  ref: nodeRef,
134
133
  style: {
135
- ...appendTypoStyle,
136
134
  ...core.getGlobalColorResponsiveStyle('bgc', menuBg)
137
135
  },
138
136
  children: rootMenu?.childrens?.map((id)=>/*#__PURE__*/ jsxRuntime.jsx(MenuMobileItem.default, {
@@ -143,7 +141,9 @@ const MobileMenu = ({ menu, typography, typo, arrow, menuTextColor, menuBg, text
143
141
  maxDepth: 2,
144
142
  menuBg: menuBg,
145
143
  menuTextColor: menuTextColor,
146
- closeMenu: ()=>toggleModal(false)
144
+ closeMenu: ()=>toggleModal(false),
145
+ typo: typo,
146
+ typography: typography
147
147
  }, id))
148
148
  })
149
149
  ]
@@ -338,6 +338,9 @@ const HeaderSettings = [
338
338
  type: 'paragraph-1'
339
339
  },
340
340
  hiddenSetting: {
341
+ //color: true,
342
+ textAlign: true,
343
+ textShadow: true
341
344
  },
342
345
  ignoreReRender: true
343
346
  },
@@ -158,20 +158,6 @@ const ProductBadgeSettings = [
158
158
  ignoreReRender: true,
159
159
  default: {
160
160
  type: 'paragraph-1',
161
- custom: {
162
- fontSize: {
163
- desktop: '15px'
164
- },
165
- lineHeight: {
166
- desktop: '120%'
167
- },
168
- fontWeight: '400',
169
- fontFamily: 'Assistant',
170
- hasShadowText: false,
171
- textShadow: {
172
- enable: false
173
- }
174
- },
175
161
  attrs: {
176
162
  color: '#121212'
177
163
  }
@@ -68,16 +68,16 @@ const SettingUIV2 = [
68
68
  },
69
69
  {
70
70
  label: {
71
- en: 'Text style'
71
+ en: 'Text'
72
72
  },
73
73
  conditionDisplay: 'contentType === "text"',
74
74
  controls: [
75
75
  {
76
76
  id: 'content-badge',
77
77
  type: 'combo',
78
- iconName: 'polaris-plus',
78
+ iconName: 'polaris-edit',
79
+ getValueFromSettingID: 'displayContent',
79
80
  isHideClear: true,
80
- fixedValue: 'Add...',
81
81
  popoverLabel: {
82
82
  en: 'Content'
83
83
  },
@@ -1,19 +1,17 @@
1
1
  'use client';
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import { composeTypographyClassName, composeTypographyStyle, cls, makeStyleResponsive } from '@gem-sdk/core';
3
+ import { composeTypographyClassName, cls, makeStyleResponsive } from '@gem-sdk/core';
4
4
  import DesktopMenuItem from './DesktopMenuItem.js';
5
5
 
6
6
  const DesktopMenu = ({ menu, height, arrow, textColor, menuTextColor, typography, typo, headerBg, menuBg, className })=>{
7
7
  const rootMenu = menu?.ROOT;
8
8
  const appendTypoClass = composeTypographyClassName(typo, typography);
9
- const appendTypoStyle = composeTypographyStyle(typo, typography);
10
9
  return /*#__PURE__*/ jsx("div", {
11
10
  className: cls('gp-flex gp-flex-1 gp-items-center gp-justify-center', className),
12
11
  children: /*#__PURE__*/ jsx("ul", {
13
12
  className: cls('gp-flex', appendTypoClass),
14
13
  style: {
15
- ...makeStyleResponsive('h', height),
16
- ...appendTypoStyle
14
+ ...makeStyleResponsive('h', height)
17
15
  },
18
16
  children: rootMenu?.childrens?.map((id)=>/*#__PURE__*/ jsx(DesktopMenuItem, {
19
17
  id: id,
@@ -24,7 +22,9 @@ const DesktopMenu = ({ menu, height, arrow, textColor, menuTextColor, typography
24
22
  menuTextColor: menuTextColor,
25
23
  textColor: textColor,
26
24
  headerBg: headerBg,
27
- menuBg: menuBg
25
+ menuBg: menuBg,
26
+ typography: typography,
27
+ typo: typo
28
28
  }, id))
29
29
  })
30
30
  });
@@ -1,12 +1,13 @@
1
1
  'use client';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { cls, getGlobalColorStateStyle, getGlobalColorResponsiveStyle } from '@gem-sdk/core';
3
+ import { composeTypographyStyle, cls, getGlobalColorStateStyle, getGlobalColorResponsiveStyle } from '@gem-sdk/core';
4
4
  import Link from 'next/link';
5
5
 
6
- const DesktopMenuItem = ({ id, menu, arrow, textColor, menuTextColor, depth = 0, maxDepth = 2, menuBg })=>{
6
+ const DesktopMenuItem = ({ id, menu, arrow, textColor, menuTextColor, depth = 0, maxDepth = 2, menuBg, typo, typography })=>{
7
7
  const item = menu?.[id];
8
8
  if (!item || depth > maxDepth) return null;
9
9
  const lastDepth = depth === maxDepth;
10
+ const appendTypoStyle = composeTypographyStyle(typo, typography);
10
11
  const renderChild = !!item?.childrens?.length && !lastDepth;
11
12
  const hasCaret = renderChild && !!arrow;
12
13
  return /*#__PURE__*/ jsxs("li", {
@@ -15,7 +16,8 @@ const DesktopMenuItem = ({ id, menu, arrow, textColor, menuTextColor, depth = 0,
15
16
  'gp-min-w-[200px] gp-border-b last:gp-border-b-transparent': depth > 0
16
17
  }),
17
18
  style: {
18
- ...getGlobalColorStateStyle('c', depth === 0 ? textColor : menuTextColor)
19
+ ...getGlobalColorStateStyle('c', depth === 0 ? textColor : menuTextColor),
20
+ ...appendTypoStyle
19
21
  },
20
22
  children: [
21
23
  item?.link && !item.childrens?.length ? /*#__PURE__*/ jsx(Link, {
@@ -52,7 +54,9 @@ const DesktopMenuItem = ({ id, menu, arrow, textColor, menuTextColor, depth = 0,
52
54
  maxDepth: maxDepth,
53
55
  arrow: arrow,
54
56
  menuTextColor: menuTextColor,
55
- menuBg: menuBg
57
+ menuBg: menuBg,
58
+ typo: typo,
59
+ typography: typography
56
60
  }, childId))
57
61
  })
58
62
  })
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { cls, getGlobalColorStateStyle, getGlobalColorResponsiveStyle } from '@gem-sdk/core';
3
+ import { composeTypographyStyle, cls, getGlobalColorStateStyle, getGlobalColorResponsiveStyle } from '@gem-sdk/core';
4
4
  import Link from 'next/link';
5
5
  import { useState, useRef } from 'react';
6
6
  import { Transition } from 'react-transition-group';
@@ -33,9 +33,10 @@ const transitionStyles = {
33
33
  opacity: 0
34
34
  }
35
35
  };
36
- const MenuMobileItem = ({ id, menu, arrow, menuBg, menuTextColor, closeMenu, depth = 0, maxDepth = 2 })=>{
36
+ const MenuMobileItem = ({ id, menu, arrow, menuBg, menuTextColor, closeMenu, depth = 0, maxDepth = 2, typo, typography })=>{
37
37
  const [isOpen, setIsOpen] = useState(false);
38
38
  const nodeRef = useRef(null);
39
+ const appendTypoStyle = composeTypographyStyle(typo, typography);
39
40
  const item = menu?.[id];
40
41
  if (!item || depth > maxDepth) return null;
41
42
  const lastDepth = depth === maxDepth;
@@ -65,6 +66,9 @@ const MenuMobileItem = ({ id, menu, arrow, menuBg, menuTextColor, closeMenu, dep
65
66
  title: item.title,
66
67
  children: item.title
67
68
  }) : /*#__PURE__*/ jsx("span", {
69
+ style: {
70
+ ...appendTypoStyle
71
+ },
68
72
  children: item?.title
69
73
  }),
70
74
  hasCaret && /*#__PURE__*/ jsx("span", {
@@ -75,7 +79,10 @@ const MenuMobileItem = ({ id, menu, arrow, menuBg, menuTextColor, closeMenu, dep
75
79
  'gp-rotate-0': depth > 0 && !isOpen,
76
80
  'gp-rotate-180': depth > 0 && isOpen,
77
81
  '-gp-rotate-90': depth === 0
78
- })
82
+ }),
83
+ style: {
84
+ ...appendTypoStyle
85
+ }
79
86
  })
80
87
  ]
81
88
  }),
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { useEditorMode, composeTypographyClassName, composeTypographyStyle, cls, getGlobalColorStateStyle, getGlobalColorResponsiveStyle } from '@gem-sdk/core';
3
+ import { useEditorMode, composeTypographyClassName, cls, getGlobalColorStateStyle, getGlobalColorResponsiveStyle } from '@gem-sdk/core';
4
4
  import { useState, useRef } from 'react';
5
5
  import { Transition } from 'react-transition-group';
6
6
  import { useBodyOverlay } from '../../../hooks/use-body-overlay.js';
@@ -63,7 +63,6 @@ const MobileMenu = ({ menu, typography, typo, arrow, menuTextColor, menuBg, text
63
63
  setIsOpen(open);
64
64
  };
65
65
  const appendTypoClass = composeTypographyClassName(typo, typography);
66
- const appendTypoStyle = composeTypographyStyle(typo, typography);
67
66
  return /*#__PURE__*/ jsxs("div", {
68
67
  ref: wrap,
69
68
  className: cls('gp-relative gp-z-5 gp-h-full gp-items-center gp-justify-center', className),
@@ -128,7 +127,6 @@ const MobileMenu = ({ menu, typography, typo, arrow, menuTextColor, menuBg, text
128
127
  className: cls('gp-w-full scrollbar:!gp-h-1.5 scrollbar:!gp-w-1.5 scrollbar:gp-bg-transparent scrollbar-track:!gp-rounded scrollbar-track:!gp-bg-slate-100 scrollbar-thumb:!gp-rounded scrollbar-thumb:!gp-bg-slate-300', appendTypoClass),
129
128
  ref: nodeRef,
130
129
  style: {
131
- ...appendTypoStyle,
132
130
  ...getGlobalColorResponsiveStyle('bgc', menuBg)
133
131
  },
134
132
  children: rootMenu?.childrens?.map((id)=>/*#__PURE__*/ jsx(MenuMobileItem, {
@@ -139,7 +137,9 @@ const MobileMenu = ({ menu, typography, typo, arrow, menuTextColor, menuBg, text
139
137
  maxDepth: 2,
140
138
  menuBg: menuBg,
141
139
  menuTextColor: menuTextColor,
142
- closeMenu: ()=>toggleModal(false)
140
+ closeMenu: ()=>toggleModal(false),
141
+ typo: typo,
142
+ typography: typography
143
143
  }, id))
144
144
  })
145
145
  ]
@@ -336,6 +336,9 @@ const HeaderSettings = [
336
336
  type: 'paragraph-1'
337
337
  },
338
338
  hiddenSetting: {
339
+ //color: true,
340
+ textAlign: true,
341
+ textShadow: true
339
342
  },
340
343
  ignoreReRender: true
341
344
  },
@@ -156,20 +156,6 @@ const ProductBadgeSettings = [
156
156
  ignoreReRender: true,
157
157
  default: {
158
158
  type: 'paragraph-1',
159
- custom: {
160
- fontSize: {
161
- desktop: '15px'
162
- },
163
- lineHeight: {
164
- desktop: '120%'
165
- },
166
- fontWeight: '400',
167
- fontFamily: 'Assistant',
168
- hasShadowText: false,
169
- textShadow: {
170
- enable: false
171
- }
172
- },
173
159
  attrs: {
174
160
  color: '#121212'
175
161
  }
@@ -66,16 +66,16 @@ const SettingUIV2 = [
66
66
  },
67
67
  {
68
68
  label: {
69
- en: 'Text style'
69
+ en: 'Text'
70
70
  },
71
71
  conditionDisplay: 'contentType === "text"',
72
72
  controls: [
73
73
  {
74
74
  id: 'content-badge',
75
75
  type: 'combo',
76
- iconName: 'polaris-plus',
76
+ iconName: 'polaris-edit',
77
+ getValueFromSettingID: 'displayContent',
77
78
  isHideClear: true,
78
- fixedValue: 'Add...',
79
79
  popoverLabel: {
80
80
  en: 'Content'
81
81
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.676",
3
+ "version": "2.0.0-dev.678",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",