@gem-sdk/components 2.0.0-dev.275 → 2.0.0-dev.277

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.
Files changed (94) hide show
  1. package/dist/cjs/article/components/ArticleReadMore.js +2 -4
  2. package/dist/cjs/banner/components/HeroBannerItem.liquid.js +4 -4
  3. package/dist/cjs/builder.js +4 -8
  4. package/dist/cjs/button/components/Button.js +111 -184
  5. package/dist/cjs/button/components/Button.liquid.js +108 -171
  6. package/dist/cjs/button/components/ButtonIcon.js +17 -0
  7. package/dist/cjs/button/components/ButtonIcon.liquid.js +16 -0
  8. package/dist/cjs/button/components/ButtonLabel.js +18 -0
  9. package/dist/cjs/button/components/ButtonLabel.liquid.js +15 -0
  10. package/dist/cjs/button/components/ButtonLoadingIndicator.liquid.js +12 -0
  11. package/dist/cjs/button/components/common/attributes.js +15 -0
  12. package/dist/cjs/button/components/common/classes.js +55 -0
  13. package/dist/cjs/button/components/common/constants.js +26 -0
  14. package/dist/cjs/button/components/common/data.js +76 -0
  15. package/dist/cjs/button/components/common/helpers.js +131 -0
  16. package/dist/cjs/button/components/common/styles.js +157 -0
  17. package/dist/cjs/button/next.js +2 -6
  18. package/dist/cjs/button/setting/configs/settings.js +5 -1
  19. package/dist/cjs/cart/components/CheckoutNow.js +0 -2
  20. package/dist/cjs/coupon/components/Coupon.js +1 -3
  21. package/dist/cjs/dialog/setting/Dialog.js +7 -580
  22. package/dist/cjs/dialog/setting/configs/settings.js +325 -0
  23. package/dist/cjs/dialog/setting/configs/uiV1.js +288 -0
  24. package/dist/cjs/dialog/setting/configs/uiV2.js +258 -0
  25. package/dist/cjs/estimate-delivery/components/EstimateDate.liquid.js +3 -3
  26. package/dist/cjs/form/components/submit-button/SubmitButton.js +0 -4
  27. package/dist/cjs/index.js +2 -4
  28. package/dist/cjs/index.liquid.js +1 -3
  29. package/dist/cjs/product/components/DynamicCheckout/DynamicCheckout.js +2 -5
  30. package/dist/cjs/product/components/DynamicCheckout.js +2 -5
  31. package/dist/cjs/product/components/FileUpload/components/common/index.js +1 -1
  32. package/dist/cjs/product/components/ProductButton.js +2 -3
  33. package/dist/cjs/product/components/ProductButton.liquid.js +3 -3
  34. package/dist/cjs/product/components/ProductDescription/index.liquid.js +1 -2
  35. package/dist/cjs/product/components/ProductViewMore.js +2 -5
  36. package/dist/cjs/product/components/ProductViewMore.liquid.js +2 -2
  37. package/dist/cjs/setting.js +2 -2
  38. package/dist/cjs/text/components/common/getClasses.js +1 -1
  39. package/dist/cjs/third-party/components/PushOwl.js +0 -5
  40. package/dist/esm/article/components/ArticleReadMore.js +1 -3
  41. package/dist/esm/banner/components/HeroBannerItem.liquid.js +4 -4
  42. package/dist/esm/builder.js +1 -5
  43. package/dist/esm/button/components/Button.js +113 -186
  44. package/dist/esm/button/components/Button.liquid.js +109 -172
  45. package/dist/esm/button/components/ButtonIcon.js +13 -0
  46. package/dist/esm/button/components/ButtonIcon.liquid.js +12 -0
  47. package/dist/esm/button/components/ButtonLabel.js +14 -0
  48. package/dist/esm/button/components/ButtonLabel.liquid.js +11 -0
  49. package/dist/esm/button/components/ButtonLoadingIndicator.liquid.js +8 -0
  50. package/dist/esm/button/components/common/attributes.js +13 -0
  51. package/dist/esm/button/components/common/classes.js +49 -0
  52. package/dist/esm/button/components/common/constants.js +24 -0
  53. package/dist/esm/button/components/common/data.js +74 -0
  54. package/dist/esm/button/components/common/helpers.js +118 -0
  55. package/dist/esm/button/components/common/styles.js +148 -0
  56. package/dist/esm/button/next.js +2 -6
  57. package/dist/esm/button/setting/configs/settings.js +5 -1
  58. package/dist/esm/cart/components/CheckoutNow.js +0 -2
  59. package/dist/esm/coupon/components/Coupon.js +1 -3
  60. package/dist/esm/dialog/setting/Dialog.js +7 -580
  61. package/dist/esm/dialog/setting/configs/settings.js +323 -0
  62. package/dist/esm/dialog/setting/configs/uiV1.js +286 -0
  63. package/dist/esm/dialog/setting/configs/uiV2.js +256 -0
  64. package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +3 -3
  65. package/dist/esm/form/components/submit-button/SubmitButton.js +0 -4
  66. package/dist/esm/index.js +1 -2
  67. package/dist/esm/index.liquid.js +1 -2
  68. package/dist/esm/product/components/DynamicCheckout/DynamicCheckout.js +1 -4
  69. package/dist/esm/product/components/DynamicCheckout.js +1 -4
  70. package/dist/esm/product/components/FileUpload/components/common/index.js +1 -1
  71. package/dist/esm/product/components/ProductButton.js +1 -2
  72. package/dist/esm/product/components/ProductButton.liquid.js +1 -1
  73. package/dist/esm/product/components/ProductDescription/index.liquid.js +3 -4
  74. package/dist/esm/product/components/ProductViewMore.js +1 -4
  75. package/dist/esm/product/components/ProductViewMore.liquid.js +1 -1
  76. package/dist/esm/setting.js +2 -2
  77. package/dist/esm/text/components/common/getClasses.js +1 -1
  78. package/dist/esm/third-party/components/PushOwl.js +0 -5
  79. package/dist/types/index.d.ts +174 -266
  80. package/package.json +2 -2
  81. package/dist/cjs/button/components/v2/ButtonIcon.js +0 -18
  82. package/dist/cjs/button/components/v2/ButtonLabel.js +0 -25
  83. package/dist/cjs/button/components/v2/ButtonV2.js +0 -140
  84. package/dist/cjs/button/components/v2/ButtonV2.liquid.js +0 -181
  85. package/dist/cjs/button/hooks/useButtonCustomCss.js +0 -88
  86. package/dist/cjs/button/hooks/useButtonStyles.js +0 -93
  87. package/dist/esm/button/components/v2/ButtonIcon.js +0 -14
  88. package/dist/esm/button/components/v2/ButtonLabel.js +0 -21
  89. package/dist/esm/button/components/v2/ButtonV2.js +0 -136
  90. package/dist/esm/button/components/v2/ButtonV2.liquid.js +0 -177
  91. package/dist/esm/button/hooks/useButtonCustomCss.js +0 -84
  92. package/dist/esm/button/hooks/useButtonStyles.js +0 -91
  93. /package/dist/cjs/button/components/{v2/ButtonLoadingIndicator.js → ButtonLoadingIndicator.js} +0 -0
  94. /package/dist/esm/button/components/{v2/ButtonLoadingIndicator.js → ButtonLoadingIndicator.js} +0 -0
@@ -0,0 +1,11 @@
1
+ const ButtonLabel = ({ label, classes })=>{
2
+ return `
3
+ <span
4
+ data-gp-text
5
+ class="${classes}"
6
+ >
7
+ ${label}
8
+ </span>`;
9
+ };
10
+
11
+ export { ButtonLabel as default };
@@ -0,0 +1,8 @@
1
+ import { template } from '@gem-sdk/core';
2
+ import { LOADING_INDICATOR } from './common/constants.js';
3
+
4
+ const ButtonLoadingIndicator = ()=>{
5
+ return template`${LOADING_INDICATOR}`;
6
+ };
7
+
8
+ export { ButtonLoadingIndicator as default };
@@ -0,0 +1,13 @@
1
+ const getButtonAttributes = ({ dataId, disabled, urlData, dataState, arialLabel })=>{
2
+ return {
3
+ ...urlData,
4
+ ...disabled !== undefined && {
5
+ disabled: disabled
6
+ },
7
+ 'data-id': dataId,
8
+ 'data-state': dataState,
9
+ 'aria-label': arialLabel
10
+ };
11
+ };
12
+
13
+ export { getButtonAttributes };
@@ -0,0 +1,49 @@
1
+ import { getGlobalColorStateClass } from '@gem-sdk/core';
2
+
3
+ const getButtonClasses = ({ uid, styles, className, shouldRenderLink })=>{
4
+ return {
5
+ ...className && {
6
+ [className]: true
7
+ },
8
+ ...uid && {
9
+ [uid]: true
10
+ },
11
+ 'gp-text-center': shouldRenderLink,
12
+ 'gp-max-w-full': styles?.textOverFlow || false,
13
+ 'gp-scale-[1.1]': styles?.animation?.normal === 'grow',
14
+ 'gp-animate-bounce': styles?.animation?.normal === 'bounce',
15
+ 'hover:gp-scale-[1.1]': styles?.animation?.hover === 'grow',
16
+ 'hover:gp-animate-bounce': styles?.animation?.hover === 'bounce',
17
+ 'gp-button-base gp-group gp-relative gp-inline-flex gp-max-w-full gp-items-center gp-justify-center gp-no-underline gp-transition-colors gp-duration-300 disabled:gp-btn-disabled disabled:gp-opacity-30': true,
18
+ [getGlobalColorStateClass('text', styles?.textColor)]: true
19
+ };
20
+ };
21
+ const getButtonWrapperClasses = (wrapClassName, className, advancedCssClass)=>{
22
+ return {
23
+ [wrapClassName]: true,
24
+ ...className?.includes('gp-button-atc') && advancedCssClass && {
25
+ [advancedCssClass]: true
26
+ }
27
+ };
28
+ };
29
+ const getButtonContentWrapperClasses = (setting)=>{
30
+ return {
31
+ 'gp-inline-flex': true,
32
+ 'gp-flex-row-reverse': setting?.iconAlign === 'right'
33
+ };
34
+ };
35
+ const getButtonLabelClasses = (styles, isEditable)=>{
36
+ return {
37
+ 'gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line': true,
38
+ '[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]': styles?.typo?.attrs?.italic,
39
+ 'gp-text button-text': isEditable
40
+ };
41
+ };
42
+ const getButtonIconClasses = (label, shouldClearSpace)=>{
43
+ return {
44
+ '!gp-m-0': shouldClearSpace && !label,
45
+ 'gp-button-icon gp-transition-colors gp-duration-300 gp-z-1 gp-inline-flex gp-shrink-0 gp-items-center gp-justify-center group-data-[state=loading]:gp-invisible [&>svg]:!gp-h-[var(--height-desktop)] [&>svg]:!gp-w-auto tablet:[&>svg]:!gp-h-[var(--height-tablet)] mobile:[&>svg]:!gp-h-[var(--height-mobile)]': true
46
+ };
47
+ };
48
+
49
+ export { getButtonClasses, getButtonContentWrapperClasses, getButtonIconClasses, getButtonLabelClasses, getButtonWrapperClasses };
@@ -0,0 +1,24 @@
1
+ const LOADING_INDICATOR = `
2
+ <svg
3
+ class="gp-invisible gp-absolute gp-h-5 gp-w-5 group-data-[state=loading]:gp-animate-spin group-data-[state=loading]:gp-visible"
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ fill="none"
6
+ viewBox="0 0 24 24"
7
+ >
8
+ <circle
9
+ class="gp-opacity-25"
10
+ cx="12"
11
+ cy="12"
12
+ r="10"
13
+ stroke="currentColor"
14
+ stroke-width="4"
15
+ ></circle>
16
+ <path
17
+ class="gp-opacity-75"
18
+ fill="currentColor"
19
+ d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
20
+ ></path>
21
+ </svg>
22
+ `;
23
+
24
+ export { LOADING_INDICATOR };
@@ -0,0 +1,74 @@
1
+ import { getSplitStyles, getCleanedStyles, checkIsScrollToElement, getDataState, getDataId, handleGetArialLabel, handleGetLabelToDisplay, handleCheckIsShowLabel, handleCheckIsEditableLabel, checkIsShowIcon } from './helpers.js';
2
+ import { getCustomCssStyles } from './styles.js';
3
+
4
+ const getData = (props)=>{
5
+ const { style, dataId, pageContext, styles = {}, setting = {}, builderProps, isForceValue = false } = props;
6
+ const { label, iconSvg, btnLink, loading, options, disabled, translate, iconVisible, shouldClearSpace } = setting;
7
+ const [wrapStyle, restStyle] = getSplitStyles(style);
8
+ const cleanedStyles = getCleanedStyles(styles, disabled);
9
+ const customCss = getCustomCssStyles({
10
+ styles,
11
+ uid: builderProps?.uid
12
+ });
13
+ const dataState = getDataState(loading);
14
+ const dataIdAttr = getDataId(builderProps?.uidInteraction, dataId, builderProps?.uid);
15
+ const getArialLabel = (props)=>{
16
+ const { isLiquid } = props ?? {};
17
+ return handleGetArialLabel({
18
+ label,
19
+ isLiquid
20
+ });
21
+ };
22
+ const getLabelToDisplay = (props)=>{
23
+ const { isLiquid } = props ?? {};
24
+ return handleGetLabelToDisplay({
25
+ label,
26
+ builderProps,
27
+ styles: cleanedStyles,
28
+ isLiquid,
29
+ ...isLiquid && {
30
+ translate
31
+ },
32
+ ...isLiquid && {
33
+ pageContext
34
+ },
35
+ ...isLiquid && {
36
+ isForceValue
37
+ }
38
+ });
39
+ };
40
+ const checkIsShowLabel = (props)=>{
41
+ const { isLiquid } = props ?? {};
42
+ const labelToDisplay = getLabelToDisplay({
43
+ isLiquid
44
+ });
45
+ return handleCheckIsShowLabel(labelToDisplay, shouldClearSpace);
46
+ };
47
+ const checkIsEditableLabel = (props)=>{
48
+ const { isLiquid, mode } = props ?? {};
49
+ return handleCheckIsEditableLabel({
50
+ options,
51
+ isLiquid,
52
+ ...!isLiquid && mode && {
53
+ mode
54
+ }
55
+ });
56
+ };
57
+ const isShowIcon = checkIsShowIcon(iconSvg, iconVisible);
58
+ const isScrollToElement = checkIsScrollToElement(btnLink);
59
+ return {
60
+ customCss,
61
+ wrapStyle,
62
+ restStyle,
63
+ dataState,
64
+ dataIdAttr,
65
+ isShowIcon,
66
+ isScrollToElement,
67
+ getArialLabel,
68
+ getLabelToDisplay,
69
+ checkIsShowLabel,
70
+ checkIsEditableLabel
71
+ };
72
+ };
73
+
74
+ export { getData };
@@ -0,0 +1,118 @@
1
+ import { splitStyle, convertHTML } from '@gem-sdk/core';
2
+ import { getDynamicSourceLocales } from '../../../helpers.js';
3
+ import Link from '../../../link/components/Link.js';
4
+
5
+ const getCleanedStyles = (styles, disabled)=>{
6
+ if (!disabled) return styles;
7
+ const cleanedStyles = {
8
+ ...styles
9
+ };
10
+ const states = [
11
+ 'hover',
12
+ 'focus'
13
+ ];
14
+ const devices = [
15
+ 'tablet',
16
+ 'mobile',
17
+ 'desktop'
18
+ ];
19
+ devices.forEach((device)=>{
20
+ states.forEach((state)=>{
21
+ delete cleanedStyles?.backgroundColorV2?.[device]?.[state];
22
+ });
23
+ });
24
+ return cleanedStyles;
25
+ };
26
+ const handleGetLabelToDisplay = ({ label, styles, translate, pageContext, isForceValue, builderProps, isLiquid = false })=>{
27
+ const liquidLabel = isForceValue ? label : getDynamicSourceLocales({
28
+ translate,
29
+ val: label,
30
+ pageContext,
31
+ settingId: translate ?? 'label',
32
+ uid: builderProps?.uidTranslate ?? builderProps?.uid,
33
+ isCapitalize: styles?.typo?.attrs?.transform === 'capitalize'
34
+ });
35
+ return isLiquid ? liquidLabel?.toString() ?? '' : convertHTML(label);
36
+ };
37
+ const checkIsShowIcon = (iconSvg, iconVisible)=>{
38
+ return !!iconSvg && iconVisible;
39
+ };
40
+ const handleCheckIsShowLabel = (labelToDisplay, shouldClearSpace)=>{
41
+ return !!labelToDisplay || !shouldClearSpace;
42
+ };
43
+ const handleCheckIsEditableLabel = ({ mode, options, isLiquid = false })=>{
44
+ return isLiquid ? !options?.isCannotEditing : mode === 'edit' && !options?.isCannotEditing;
45
+ };
46
+ const checkIsScrollToElement = (btnLink)=>{
47
+ return btnLink?.link?.startsWith('#') && btnLink?.target === '_self';
48
+ };
49
+ const getButtonWrapper = (Wrap, isScrollToElement)=>{
50
+ return isScrollToElement ? 'button' : Wrap;
51
+ };
52
+ const getSplitStyles = (style)=>{
53
+ return splitStyle([
54
+ 'pos',
55
+ 'top',
56
+ 'left',
57
+ 'bottom',
58
+ 'right',
59
+ 'z'
60
+ ], style);
61
+ };
62
+ const getDataState = (isLoading)=>{
63
+ return isLoading ? 'loading' : 'idle';
64
+ };
65
+ const getDataId = (uidInteraction, dataId, uid)=>{
66
+ return uidInteraction ?? (dataId || uid) ?? '';
67
+ };
68
+ const handleGetArialLabel = ({ label, isLiquid = false })=>{
69
+ return isLiquid ? label?.toString().replaceAll("'", '&#039;').replaceAll('"', "'") ?? '' : label?.toString() ?? '';
70
+ };
71
+ const getInsertLinkData = ({ setting, htmlType, defaultTag, isLiquid = false })=>{
72
+ const URL_INCLUDES = [
73
+ 'product.url'
74
+ ];
75
+ const URL_START_WITH = [
76
+ '#',
77
+ 'mailto:',
78
+ 'tel:'
79
+ ];
80
+ const urlHref = setting?.link ?? '';
81
+ const isHomePageHref = urlHref === '/';
82
+ const isHyperlink = setting?.link !== undefined && setting.link !== '';
83
+ const regexHttp = new RegExp(/^https?:\/\//i);
84
+ const isDomain = isHyperlink && regexHttp.test(urlHref);
85
+ const regexPageType = new RegExp(/^\/?(?:collections|pages|products|blogs|checkout|cart)\/?/i);
86
+ const isShopifyDomain = isHyperlink && !regexHttp.test(urlHref) && regexPageType.test(urlHref);
87
+ const isLink = ()=>{
88
+ if (URL_INCLUDES.find((el)=>urlHref.includes(el))) return true;
89
+ if (URL_START_WITH.find((el)=>urlHref.startsWith(el))) return true;
90
+ return false;
91
+ };
92
+ const shouldRenderLink = isDomain || isShopifyDomain || isLink() || isHomePageHref;
93
+ let transformedUrl = urlHref;
94
+ if (isLiquid && (isShopifyDomain || isHomePageHref)) {
95
+ transformedUrl = setting?.isTranslate ? '$locationOrigin' + urlHref : "{{ request.origin }}{{ routes.root_url | split: '/' | join: '/' }}" + urlHref;
96
+ }
97
+ const HTMLTag = shouldRenderLink ? isLiquid ? 'a' : Link : defaultTag;
98
+ const baseUrlData = {
99
+ href: transformedUrl,
100
+ target: setting?.target,
101
+ ...setting?.noFollow && {
102
+ rel: 'nofollow'
103
+ }
104
+ };
105
+ const urlData = shouldRenderLink ? baseUrlData : isHyperlink ? {
106
+ ...baseUrlData,
107
+ type: htmlType
108
+ } : {
109
+ type: htmlType
110
+ };
111
+ return {
112
+ HTMLTag,
113
+ urlData,
114
+ shouldRenderLink
115
+ };
116
+ };
117
+
118
+ export { checkIsScrollToElement, checkIsShowIcon, getButtonWrapper, getCleanedStyles, getDataId, getDataState, getInsertLinkData, getSplitStyles, handleCheckIsEditableLabel, handleCheckIsShowLabel, handleGetArialLabel, handleGetLabelToDisplay };
@@ -0,0 +1,148 @@
1
+ import { makeStyleResponsive, getStyleShadowState, composeRadius, makeGlobalSize, makeStyleResponsiveState, composeTypographyStyle, getGlobalColorStateStyle, getStyleShadow, getStyleBackgroundImageByDevice, getGlobalColorStateResponsiveStyle, composeBorderCss, composeCornerCss, getSingleColorVariable } from '@gem-sdk/core';
2
+
3
+ const MEDIA_QUERIES = {
4
+ TABLET: '@media only screen and (max-width: 1024px) and (min-width: 768px)',
5
+ MOBILE: '@media only screen and (max-width: 767px)'
6
+ };
7
+ const getButtonWrapperStyles = (style, styles)=>({
8
+ ...style,
9
+ ...makeStyleResponsive('ta', styles?.align)
10
+ });
11
+ const getButtonStyles = (styles, nodePrice)=>({
12
+ ...getSizeStyles(styles),
13
+ ...getRadiusStyles(styles),
14
+ ...getShadowStyles(styles),
15
+ ...getBackgroundStyles(styles),
16
+ ...getTypoStyles(styles, nodePrice)
17
+ });
18
+ const getButtonIconStyles = (styles, settings)=>({
19
+ ...getIconSpacingStyle(styles, settings),
20
+ '--height-desktop': `${styles?.size?.desktop}`,
21
+ '--height-tablet': `${styles?.size?.desktop || styles?.size?.tablet}`,
22
+ '--height-mobile': `${styles?.size?.mobile || styles?.size?.tablet || styles?.size?.desktop}`
23
+ });
24
+ const isEnableShadowStateForDevice = (deviceStyles)=>({
25
+ normal: deviceStyles?.normal?.type !== 'none',
26
+ hover: deviceStyles?.hover?.type !== 'none'
27
+ });
28
+ const getShadowStyles = (styles)=>{
29
+ const { boxShadowBtnV2 } = styles || {};
30
+ return {
31
+ ...getStyleShadowState(boxShadowBtnV2?.desktop, 'box-shadow', isEnableShadowStateForDevice(boxShadowBtnV2?.desktop)),
32
+ ...getStyleShadowState(boxShadowBtnV2?.tablet, 'box-shadow', isEnableShadowStateForDevice(boxShadowBtnV2?.tablet), 'tablet'),
33
+ ...getStyleShadowState(boxShadowBtnV2?.mobile, 'box-shadow', isEnableShadowStateForDevice(boxShadowBtnV2?.mobile), 'mobile')
34
+ };
35
+ };
36
+ const getRadiusStyles = (styles)=>composeRadius(styles?.roundedBtnV2);
37
+ const getIconSpacingStyle = (styles, settings)=>{
38
+ const spacing = styles?.iconSpacing || {
39
+ desktop: '8px'
40
+ };
41
+ return settings?.iconAlign === 'left' ? makeStyleResponsive('mr', spacing) : makeStyleResponsive('ml', spacing);
42
+ };
43
+ const getSizeStyles = (styles)=>{
44
+ const composeGlobalSize = makeGlobalSize(styles?.globalSize);
45
+ return {
46
+ ...composeGlobalSize.width,
47
+ ...composeGlobalSize.height,
48
+ ...composeGlobalSize.padding
49
+ };
50
+ };
51
+ const getTypoStyles = (styles, nodePrice)=>{
52
+ const appendTypoStyle = {
53
+ ...makeStyleResponsiveState('c', styles?.textColorHover),
54
+ ...composeTypographyStyle(styles?.typo, styles?.typography)
55
+ };
56
+ return {
57
+ ...!nodePrice && appendTypoStyle,
58
+ ...getGlobalColorStateStyle('c', styles?.textColor),
59
+ ...getStyleShadow({
60
+ styleAppliedFor: 'text-shadow',
61
+ value: styles?.typo?.custom?.textShadow,
62
+ isEnableShadow: styles?.typo?.custom?.textShadow?.type !== 'none'
63
+ })
64
+ };
65
+ };
66
+ const getBackgroundStyles = (styles)=>{
67
+ return {
68
+ ...getStyleBackgroundImageByDevice(styles?.backgroundImage),
69
+ ...getGlobalColorStateResponsiveStyle('bg', styles?.backgroundColorV2)
70
+ };
71
+ };
72
+ const getCustomCssStyles = ({ styles, uid })=>{
73
+ if (!uid) return '';
74
+ const { borderBtnV2, roundedBtnV2, textColor } = styles ?? {};
75
+ const borderCornerStyles = {
76
+ desktop: generateBorderCornerStyles({
77
+ uid,
78
+ device: 'desktop',
79
+ borderBtn: borderBtnV2,
80
+ roundedBtn: roundedBtnV2
81
+ }),
82
+ tablet: generateBorderCornerStyles({
83
+ uid,
84
+ device: 'tablet',
85
+ borderBtn: borderBtnV2,
86
+ roundedBtn: roundedBtnV2
87
+ }),
88
+ mobile: generateBorderCornerStyles({
89
+ uid,
90
+ device: 'mobile',
91
+ borderBtn: borderBtnV2,
92
+ roundedBtn: roundedBtnV2
93
+ })
94
+ };
95
+ const colorStyles = generateColorStyles(uid, textColor);
96
+ return `
97
+ ${borderCornerStyles.desktop.normalStyles}
98
+ ${borderCornerStyles.desktop.hoverStyles}
99
+
100
+ ${MEDIA_QUERIES.TABLET} {
101
+ ${borderCornerStyles.tablet.normalStyles}
102
+ ${borderCornerStyles.tablet.hoverStyles}
103
+ }
104
+
105
+ ${MEDIA_QUERIES.MOBILE} {
106
+ ${borderCornerStyles.mobile.normalStyles}
107
+ ${borderCornerStyles.mobile.hoverStyles}
108
+ }
109
+
110
+ ${colorStyles}
111
+ `.trim();
112
+ };
113
+ const generateBorderCornerStyles = ({ uid, device, borderBtn, roundedBtn })=>{
114
+ const normalStyles = `
115
+ .${uid}.gp-button-base::before {
116
+ content: "";
117
+ height: 100%;
118
+ width: 100%;
119
+ position: absolute;
120
+ pointer-events: none;
121
+ ${composeBorderCss(borderBtn?.[device]?.normal)}
122
+ ${composeCornerCss(roundedBtn?.[device]?.normal)}
123
+ }
124
+ `;
125
+ const hoverStyles = `
126
+ .${uid}:hover::before {
127
+ ${composeBorderCss(borderBtn?.[device]?.hover)}
128
+ ${composeCornerCss(roundedBtn?.[device]?.hover)}
129
+ }
130
+ `;
131
+ return {
132
+ normalStyles,
133
+ hoverStyles
134
+ };
135
+ };
136
+ const generateColorStyles = (uid, textColor)=>`
137
+ .${uid}:hover .gp-button-price,
138
+ .${uid}:hover .gp-product-dot-price {
139
+ color: ${getSingleColorVariable(textColor?.hover)};
140
+ }
141
+
142
+ .${uid} .gp-button-price,
143
+ .${uid} .gp-product-dot-price {
144
+ color: ${getSingleColorVariable(textColor?.normal)};
145
+ }
146
+ `;
147
+
148
+ export { generateBorderCornerStyles, generateColorStyles, getButtonIconStyles, getButtonStyles, getButtonWrapperStyles, getCustomCssStyles, getRadiusStyles, getShadowStyles };
@@ -4,15 +4,11 @@ import 'react/jsx-runtime';
4
4
  import 'react';
5
5
  import '@gem-sdk/core';
6
6
 
7
- const Button = dynamic(()=>import('./components/v2/ButtonV2.js'), {
8
- loading: Loading
9
- });
10
- const ButtonV1 = dynamic(()=>import('./components/Button.js'), {
7
+ const Button = dynamic(()=>import('./components/Button.js'), {
11
8
  loading: Loading
12
9
  });
13
10
  var button = {
14
- Button,
15
- ButtonV1
11
+ Button
16
12
  };
17
13
 
18
14
  export { button as default };
@@ -42,7 +42,11 @@ const ButtonSettings = [
42
42
  id: 'iconSvg',
43
43
  label: 'SVG Icon',
44
44
  type: 'icon',
45
- default: '<svg style="width: 100%; height: 100%" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M10.1149 4.21421C9.91455 4.02414 9.58977 4.02414 9.38946 4.21421C9.18915 4.40429 9.18915 4.71246 9.38946 4.90254L12.1268 7.5L2.35236 7.5C2.07622 7.5 1.85236 7.72385 1.85236 8C1.85236 8.27614 2.07622 8.5 2.35236 8.5L12.1269 8.5L9.38946 11.0975C9.18915 11.2876 9.18915 11.5957 9.38946 11.7858C9.58977 11.9759 9.91454 11.9759 10.1149 11.7858L13.7419 8.34418C13.9422 8.15411 13.9422 7.84593 13.7419 7.65585L10.1149 4.21421Z" fill="currentColor"/></svg>'
45
+ default: `
46
+ <svg width="100%" height="100%" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
47
+ <path d="M8.90239 3.29786C8.54015 2.53874 7.45959 2.53873 7.09736 3.29786L5.98572 5.62747L3.42662 5.96481C2.59271 6.07473 2.2588 7.1024 2.86883 7.68149L4.74091 9.45861L4.27093 11.9967C4.11778 12.8238 4.99198 13.4589 5.73123 13.0577L7.99987 11.8264L10.2685 13.0577C11.0078 13.4589 11.882 12.8238 11.7288 11.9967L11.2588 9.45861L13.1309 7.68149C13.7409 7.1024 13.407 6.07473 12.5731 5.96481L10.014 5.62747L8.90239 3.29786Z" fill="currentColor"/>
48
+ </svg>
49
+ `
46
50
  },
47
51
  {
48
52
  id: 'iconAlign',
@@ -2,8 +2,6 @@
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { useCartData } from '@gem-sdk/core';
4
4
  import { useRef } from 'react';
5
- import 'next/head';
6
- import 'next/link';
7
5
  import Button from '../../button/components/Button.js';
8
6
 
9
7
  const CheckoutNow = ({ setting, builderAttrs, builderProps, style, styles, className })=>{
@@ -1,10 +1,8 @@
1
1
  'use client';
2
2
  import { jsx, Fragment } from 'react/jsx-runtime';
3
3
  import { useEditorMode } from '@gem-sdk/core';
4
- import 'next/head';
5
- import { useState } from 'react';
6
- import 'next/link';
7
4
  import Button from '../../button/components/Button.js';
5
+ import { useState } from 'react';
8
6
 
9
7
  const Coupon = ({ setting, builderProps, builderAttrs, style, styles, advanced, children })=>{
10
8
  const mode = useEditorMode();