@gem-sdk/components 2.0.0-dev.275 → 2.0.0-dev.278
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.
- package/dist/cjs/article/components/ArticleReadMore.js +2 -4
- package/dist/cjs/banner/components/HeroBannerItem.liquid.js +4 -4
- package/dist/cjs/builder.js +4 -8
- package/dist/cjs/button/components/Button.js +111 -184
- package/dist/cjs/button/components/Button.liquid.js +108 -171
- package/dist/cjs/button/components/ButtonIcon.js +17 -0
- package/dist/cjs/button/components/ButtonIcon.liquid.js +16 -0
- package/dist/cjs/button/components/ButtonLabel.js +18 -0
- package/dist/cjs/button/components/ButtonLabel.liquid.js +15 -0
- package/dist/cjs/button/components/ButtonLoadingIndicator.liquid.js +12 -0
- package/dist/cjs/button/components/common/attributes.js +15 -0
- package/dist/cjs/button/components/common/classes.js +55 -0
- package/dist/cjs/button/components/common/constants.js +26 -0
- package/dist/cjs/button/components/common/data.js +76 -0
- package/dist/cjs/button/components/common/helpers.js +131 -0
- package/dist/cjs/button/components/common/styles.js +157 -0
- package/dist/cjs/button/next.js +2 -6
- package/dist/cjs/button/setting/configs/settings.js +5 -1
- package/dist/cjs/cart/components/CheckoutNow.js +0 -2
- package/dist/cjs/coupon/components/Coupon.js +1 -3
- package/dist/cjs/dialog/setting/Dialog.js +7 -580
- package/dist/cjs/dialog/setting/configs/settings.js +325 -0
- package/dist/cjs/dialog/setting/configs/uiV1.js +288 -0
- package/dist/cjs/dialog/setting/configs/uiV2.js +258 -0
- package/dist/cjs/estimate-delivery/components/EstimateDate.liquid.js +3 -3
- package/dist/cjs/form/components/submit-button/SubmitButton.js +0 -4
- package/dist/cjs/index.js +2 -4
- package/dist/cjs/index.liquid.js +1 -3
- package/dist/cjs/post-purchase/callout-banner/components/CalloutText.js +1 -2
- package/dist/cjs/post-purchase/callout-banner/components/common/getClasses.js +2 -5
- package/dist/cjs/post-purchase/callout-banner/components/common/getStyles.js +4 -2
- package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/setting.js +11 -1
- package/dist/cjs/post-purchase/product/hooks/product-image/useListCarousel.js +1 -1
- package/dist/cjs/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +4 -1
- package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +15 -2
- package/dist/cjs/post-purchase/product/settings/product-image/uiV2.js +3 -1
- package/dist/cjs/post-purchase/utils/constants.js +1 -1
- package/dist/cjs/product/components/DynamicCheckout/DynamicCheckout.js +2 -5
- package/dist/cjs/product/components/DynamicCheckout.js +2 -5
- package/dist/cjs/product/components/FileUpload/components/common/index.js +1 -1
- package/dist/cjs/product/components/ProductButton.js +2 -3
- package/dist/cjs/product/components/ProductButton.liquid.js +3 -3
- package/dist/cjs/product/components/ProductDescription/index.liquid.js +1 -2
- package/dist/cjs/product/components/ProductViewMore.js +2 -5
- package/dist/cjs/product/components/ProductViewMore.liquid.js +2 -2
- package/dist/cjs/setting.js +2 -2
- package/dist/cjs/text/components/common/getClasses.js +1 -1
- package/dist/cjs/third-party/components/PushOwl.js +0 -5
- package/dist/esm/article/components/ArticleReadMore.js +1 -3
- package/dist/esm/banner/components/HeroBannerItem.liquid.js +4 -4
- package/dist/esm/builder.js +1 -5
- package/dist/esm/button/components/Button.js +113 -186
- package/dist/esm/button/components/Button.liquid.js +109 -172
- package/dist/esm/button/components/ButtonIcon.js +13 -0
- package/dist/esm/button/components/ButtonIcon.liquid.js +12 -0
- package/dist/esm/button/components/ButtonLabel.js +14 -0
- package/dist/esm/button/components/ButtonLabel.liquid.js +11 -0
- package/dist/esm/button/components/ButtonLoadingIndicator.liquid.js +8 -0
- package/dist/esm/button/components/common/attributes.js +13 -0
- package/dist/esm/button/components/common/classes.js +49 -0
- package/dist/esm/button/components/common/constants.js +24 -0
- package/dist/esm/button/components/common/data.js +74 -0
- package/dist/esm/button/components/common/helpers.js +118 -0
- package/dist/esm/button/components/common/styles.js +148 -0
- package/dist/esm/button/next.js +2 -6
- package/dist/esm/button/setting/configs/settings.js +5 -1
- package/dist/esm/cart/components/CheckoutNow.js +0 -2
- package/dist/esm/coupon/components/Coupon.js +1 -3
- package/dist/esm/dialog/setting/Dialog.js +7 -580
- package/dist/esm/dialog/setting/configs/settings.js +323 -0
- package/dist/esm/dialog/setting/configs/uiV1.js +286 -0
- package/dist/esm/dialog/setting/configs/uiV2.js +256 -0
- package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +3 -3
- package/dist/esm/form/components/submit-button/SubmitButton.js +0 -4
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.liquid.js +1 -2
- package/dist/esm/post-purchase/callout-banner/components/CalloutText.js +1 -2
- package/dist/esm/post-purchase/callout-banner/components/common/getClasses.js +2 -5
- package/dist/esm/post-purchase/callout-banner/components/common/getStyles.js +4 -2
- package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +11 -1
- package/dist/esm/post-purchase/product/hooks/product-image/useListCarousel.js +1 -1
- package/dist/esm/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +4 -1
- package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +15 -2
- package/dist/esm/post-purchase/product/settings/product-image/uiV2.js +3 -1
- package/dist/esm/post-purchase/utils/constants.js +1 -1
- package/dist/esm/product/components/DynamicCheckout/DynamicCheckout.js +1 -4
- package/dist/esm/product/components/DynamicCheckout.js +1 -4
- package/dist/esm/product/components/FileUpload/components/common/index.js +1 -1
- package/dist/esm/product/components/ProductButton.js +1 -2
- package/dist/esm/product/components/ProductButton.liquid.js +1 -1
- package/dist/esm/product/components/ProductDescription/index.liquid.js +3 -4
- package/dist/esm/product/components/ProductViewMore.js +1 -4
- package/dist/esm/product/components/ProductViewMore.liquid.js +1 -1
- package/dist/esm/setting.js +2 -2
- package/dist/esm/text/components/common/getClasses.js +1 -1
- package/dist/esm/third-party/components/PushOwl.js +0 -5
- package/dist/types/index.d.ts +175 -267
- package/package.json +2 -2
- package/dist/cjs/button/components/v2/ButtonIcon.js +0 -18
- package/dist/cjs/button/components/v2/ButtonLabel.js +0 -25
- package/dist/cjs/button/components/v2/ButtonV2.js +0 -140
- package/dist/cjs/button/components/v2/ButtonV2.liquid.js +0 -181
- package/dist/cjs/button/hooks/useButtonCustomCss.js +0 -88
- package/dist/cjs/button/hooks/useButtonStyles.js +0 -93
- package/dist/esm/button/components/v2/ButtonIcon.js +0 -14
- package/dist/esm/button/components/v2/ButtonLabel.js +0 -21
- package/dist/esm/button/components/v2/ButtonV2.js +0 -136
- package/dist/esm/button/components/v2/ButtonV2.liquid.js +0 -177
- package/dist/esm/button/hooks/useButtonCustomCss.js +0 -84
- package/dist/esm/button/hooks/useButtonStyles.js +0 -91
- /package/dist/cjs/button/components/{v2/ButtonLoadingIndicator.js → ButtonLoadingIndicator.js} +0 -0
- /package/dist/esm/button/components/{v2/ButtonLoadingIndicator.js → ButtonLoadingIndicator.js} +0 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@gem-sdk/core');
|
|
4
|
+
var helpers = require('../../../helpers.js');
|
|
5
|
+
var Link = require('../../../link/components/Link.js');
|
|
6
|
+
|
|
7
|
+
const getCleanedStyles = (styles, disabled)=>{
|
|
8
|
+
if (!disabled) return styles;
|
|
9
|
+
const cleanedStyles = {
|
|
10
|
+
...styles
|
|
11
|
+
};
|
|
12
|
+
const states = [
|
|
13
|
+
'hover',
|
|
14
|
+
'focus'
|
|
15
|
+
];
|
|
16
|
+
const devices = [
|
|
17
|
+
'tablet',
|
|
18
|
+
'mobile',
|
|
19
|
+
'desktop'
|
|
20
|
+
];
|
|
21
|
+
devices.forEach((device)=>{
|
|
22
|
+
states.forEach((state)=>{
|
|
23
|
+
delete cleanedStyles?.backgroundColorV2?.[device]?.[state];
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
return cleanedStyles;
|
|
27
|
+
};
|
|
28
|
+
const handleGetLabelToDisplay = ({ label, styles, translate, pageContext, isForceValue, builderProps, isLiquid = false })=>{
|
|
29
|
+
const liquidLabel = isForceValue ? label : helpers.getDynamicSourceLocales({
|
|
30
|
+
translate,
|
|
31
|
+
val: label,
|
|
32
|
+
pageContext,
|
|
33
|
+
settingId: translate ?? 'label',
|
|
34
|
+
uid: builderProps?.uidTranslate ?? builderProps?.uid,
|
|
35
|
+
isCapitalize: styles?.typo?.attrs?.transform === 'capitalize'
|
|
36
|
+
});
|
|
37
|
+
return isLiquid ? liquidLabel?.toString() ?? '' : core.convertHTML(label);
|
|
38
|
+
};
|
|
39
|
+
const checkIsShowIcon = (iconSvg, iconVisible)=>{
|
|
40
|
+
return !!iconSvg && iconVisible;
|
|
41
|
+
};
|
|
42
|
+
const handleCheckIsShowLabel = (labelToDisplay, shouldClearSpace)=>{
|
|
43
|
+
return !!labelToDisplay || !shouldClearSpace;
|
|
44
|
+
};
|
|
45
|
+
const handleCheckIsEditableLabel = ({ mode, options, isLiquid = false })=>{
|
|
46
|
+
return isLiquid ? !options?.isCannotEditing : mode === 'edit' && !options?.isCannotEditing;
|
|
47
|
+
};
|
|
48
|
+
const checkIsScrollToElement = (btnLink)=>{
|
|
49
|
+
return btnLink?.link?.startsWith('#') && btnLink?.target === '_self';
|
|
50
|
+
};
|
|
51
|
+
const getButtonWrapper = (Wrap, isScrollToElement)=>{
|
|
52
|
+
return isScrollToElement ? 'button' : Wrap;
|
|
53
|
+
};
|
|
54
|
+
const getSplitStyles = (style)=>{
|
|
55
|
+
return core.splitStyle([
|
|
56
|
+
'pos',
|
|
57
|
+
'top',
|
|
58
|
+
'left',
|
|
59
|
+
'bottom',
|
|
60
|
+
'right',
|
|
61
|
+
'z'
|
|
62
|
+
], style);
|
|
63
|
+
};
|
|
64
|
+
const getDataState = (isLoading)=>{
|
|
65
|
+
return isLoading ? 'loading' : 'idle';
|
|
66
|
+
};
|
|
67
|
+
const getDataId = (uidInteraction, dataId, uid)=>{
|
|
68
|
+
return uidInteraction ?? (dataId || uid) ?? '';
|
|
69
|
+
};
|
|
70
|
+
const handleGetArialLabel = ({ label, isLiquid = false })=>{
|
|
71
|
+
return isLiquid ? label?.toString().replaceAll("'", ''').replaceAll('"', "'") ?? '' : label?.toString() ?? '';
|
|
72
|
+
};
|
|
73
|
+
const getInsertLinkData = ({ setting, htmlType, defaultTag, isLiquid = false })=>{
|
|
74
|
+
const URL_INCLUDES = [
|
|
75
|
+
'product.url'
|
|
76
|
+
];
|
|
77
|
+
const URL_START_WITH = [
|
|
78
|
+
'#',
|
|
79
|
+
'mailto:',
|
|
80
|
+
'tel:'
|
|
81
|
+
];
|
|
82
|
+
const urlHref = setting?.link ?? '';
|
|
83
|
+
const isHomePageHref = urlHref === '/';
|
|
84
|
+
const isHyperlink = setting?.link !== undefined && setting.link !== '';
|
|
85
|
+
const regexHttp = new RegExp(/^https?:\/\//i);
|
|
86
|
+
const isDomain = isHyperlink && regexHttp.test(urlHref);
|
|
87
|
+
const regexPageType = new RegExp(/^\/?(?:collections|pages|products|blogs|checkout|cart)\/?/i);
|
|
88
|
+
const isShopifyDomain = isHyperlink && !regexHttp.test(urlHref) && regexPageType.test(urlHref);
|
|
89
|
+
const isLink = ()=>{
|
|
90
|
+
if (URL_INCLUDES.find((el)=>urlHref.includes(el))) return true;
|
|
91
|
+
if (URL_START_WITH.find((el)=>urlHref.startsWith(el))) return true;
|
|
92
|
+
return false;
|
|
93
|
+
};
|
|
94
|
+
const shouldRenderLink = isDomain || isShopifyDomain || isLink() || isHomePageHref;
|
|
95
|
+
let transformedUrl = urlHref;
|
|
96
|
+
if (isLiquid && (isShopifyDomain || isHomePageHref)) {
|
|
97
|
+
transformedUrl = setting?.isTranslate ? '$locationOrigin' + urlHref : "{{ request.origin }}{{ routes.root_url | split: '/' | join: '/' }}" + urlHref;
|
|
98
|
+
}
|
|
99
|
+
const HTMLTag = shouldRenderLink ? isLiquid ? 'a' : Link.default : defaultTag;
|
|
100
|
+
const baseUrlData = {
|
|
101
|
+
href: transformedUrl,
|
|
102
|
+
target: setting?.target,
|
|
103
|
+
...setting?.noFollow && {
|
|
104
|
+
rel: 'nofollow'
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const urlData = shouldRenderLink ? baseUrlData : isHyperlink ? {
|
|
108
|
+
...baseUrlData,
|
|
109
|
+
type: htmlType
|
|
110
|
+
} : {
|
|
111
|
+
type: htmlType
|
|
112
|
+
};
|
|
113
|
+
return {
|
|
114
|
+
HTMLTag,
|
|
115
|
+
urlData,
|
|
116
|
+
shouldRenderLink
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
exports.checkIsScrollToElement = checkIsScrollToElement;
|
|
121
|
+
exports.checkIsShowIcon = checkIsShowIcon;
|
|
122
|
+
exports.getButtonWrapper = getButtonWrapper;
|
|
123
|
+
exports.getCleanedStyles = getCleanedStyles;
|
|
124
|
+
exports.getDataId = getDataId;
|
|
125
|
+
exports.getDataState = getDataState;
|
|
126
|
+
exports.getInsertLinkData = getInsertLinkData;
|
|
127
|
+
exports.getSplitStyles = getSplitStyles;
|
|
128
|
+
exports.handleCheckIsEditableLabel = handleCheckIsEditableLabel;
|
|
129
|
+
exports.handleCheckIsShowLabel = handleCheckIsShowLabel;
|
|
130
|
+
exports.handleGetArialLabel = handleGetArialLabel;
|
|
131
|
+
exports.handleGetLabelToDisplay = handleGetLabelToDisplay;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@gem-sdk/core');
|
|
4
|
+
|
|
5
|
+
const MEDIA_QUERIES = {
|
|
6
|
+
TABLET: '@media only screen and (max-width: 1024px) and (min-width: 768px)',
|
|
7
|
+
MOBILE: '@media only screen and (max-width: 767px)'
|
|
8
|
+
};
|
|
9
|
+
const getButtonWrapperStyles = (style, styles)=>({
|
|
10
|
+
...style,
|
|
11
|
+
...core.makeStyleResponsive('ta', styles?.align)
|
|
12
|
+
});
|
|
13
|
+
const getButtonStyles = (styles, nodePrice)=>({
|
|
14
|
+
...getSizeStyles(styles),
|
|
15
|
+
...getRadiusStyles(styles),
|
|
16
|
+
...getShadowStyles(styles),
|
|
17
|
+
...getBackgroundStyles(styles),
|
|
18
|
+
...getTypoStyles(styles, nodePrice)
|
|
19
|
+
});
|
|
20
|
+
const getButtonIconStyles = (styles, settings)=>({
|
|
21
|
+
...getIconSpacingStyle(styles, settings),
|
|
22
|
+
'--height-desktop': `${styles?.size?.desktop}`,
|
|
23
|
+
'--height-tablet': `${styles?.size?.desktop || styles?.size?.tablet}`,
|
|
24
|
+
'--height-mobile': `${styles?.size?.mobile || styles?.size?.tablet || styles?.size?.desktop}`
|
|
25
|
+
});
|
|
26
|
+
const isEnableShadowStateForDevice = (deviceStyles)=>({
|
|
27
|
+
normal: deviceStyles?.normal?.type !== 'none',
|
|
28
|
+
hover: deviceStyles?.hover?.type !== 'none'
|
|
29
|
+
});
|
|
30
|
+
const getShadowStyles = (styles)=>{
|
|
31
|
+
const { boxShadowBtnV2 } = styles || {};
|
|
32
|
+
return {
|
|
33
|
+
...core.getStyleShadowState(boxShadowBtnV2?.desktop, 'box-shadow', isEnableShadowStateForDevice(boxShadowBtnV2?.desktop)),
|
|
34
|
+
...core.getStyleShadowState(boxShadowBtnV2?.tablet, 'box-shadow', isEnableShadowStateForDevice(boxShadowBtnV2?.tablet), 'tablet'),
|
|
35
|
+
...core.getStyleShadowState(boxShadowBtnV2?.mobile, 'box-shadow', isEnableShadowStateForDevice(boxShadowBtnV2?.mobile), 'mobile')
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
const getRadiusStyles = (styles)=>core.composeRadius(styles?.roundedBtnV2);
|
|
39
|
+
const getIconSpacingStyle = (styles, settings)=>{
|
|
40
|
+
const spacing = styles?.iconSpacing || {
|
|
41
|
+
desktop: '8px'
|
|
42
|
+
};
|
|
43
|
+
return settings?.iconAlign === 'left' ? core.makeStyleResponsive('mr', spacing) : core.makeStyleResponsive('ml', spacing);
|
|
44
|
+
};
|
|
45
|
+
const getSizeStyles = (styles)=>{
|
|
46
|
+
const composeGlobalSize = core.makeGlobalSize(styles?.globalSize);
|
|
47
|
+
return {
|
|
48
|
+
...composeGlobalSize.width,
|
|
49
|
+
...composeGlobalSize.height,
|
|
50
|
+
...composeGlobalSize.padding
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
const getTypoStyles = (styles, nodePrice)=>{
|
|
54
|
+
const appendTypoStyle = {
|
|
55
|
+
...core.makeStyleResponsiveState('c', styles?.textColorHover),
|
|
56
|
+
...core.composeTypographyStyle(styles?.typo, styles?.typography)
|
|
57
|
+
};
|
|
58
|
+
return {
|
|
59
|
+
...!nodePrice && appendTypoStyle,
|
|
60
|
+
...core.getGlobalColorStateStyle('c', styles?.textColor),
|
|
61
|
+
...core.getStyleShadow({
|
|
62
|
+
styleAppliedFor: 'text-shadow',
|
|
63
|
+
value: styles?.typo?.custom?.textShadow,
|
|
64
|
+
isEnableShadow: styles?.typo?.custom?.textShadow?.type !== 'none'
|
|
65
|
+
})
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
const getBackgroundStyles = (styles)=>{
|
|
69
|
+
return {
|
|
70
|
+
...core.getStyleBackgroundImageByDevice(styles?.backgroundImage),
|
|
71
|
+
...core.getGlobalColorStateResponsiveStyle('bg', styles?.backgroundColorV2)
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
const getCustomCssStyles = ({ styles, uid })=>{
|
|
75
|
+
if (!uid) return '';
|
|
76
|
+
const { borderBtnV2, roundedBtnV2, textColor } = styles ?? {};
|
|
77
|
+
const borderCornerStyles = {
|
|
78
|
+
desktop: generateBorderCornerStyles({
|
|
79
|
+
uid,
|
|
80
|
+
device: 'desktop',
|
|
81
|
+
borderBtn: borderBtnV2,
|
|
82
|
+
roundedBtn: roundedBtnV2
|
|
83
|
+
}),
|
|
84
|
+
tablet: generateBorderCornerStyles({
|
|
85
|
+
uid,
|
|
86
|
+
device: 'tablet',
|
|
87
|
+
borderBtn: borderBtnV2,
|
|
88
|
+
roundedBtn: roundedBtnV2
|
|
89
|
+
}),
|
|
90
|
+
mobile: generateBorderCornerStyles({
|
|
91
|
+
uid,
|
|
92
|
+
device: 'mobile',
|
|
93
|
+
borderBtn: borderBtnV2,
|
|
94
|
+
roundedBtn: roundedBtnV2
|
|
95
|
+
})
|
|
96
|
+
};
|
|
97
|
+
const colorStyles = generateColorStyles(uid, textColor);
|
|
98
|
+
return `
|
|
99
|
+
${borderCornerStyles.desktop.normalStyles}
|
|
100
|
+
${borderCornerStyles.desktop.hoverStyles}
|
|
101
|
+
|
|
102
|
+
${MEDIA_QUERIES.TABLET} {
|
|
103
|
+
${borderCornerStyles.tablet.normalStyles}
|
|
104
|
+
${borderCornerStyles.tablet.hoverStyles}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
${MEDIA_QUERIES.MOBILE} {
|
|
108
|
+
${borderCornerStyles.mobile.normalStyles}
|
|
109
|
+
${borderCornerStyles.mobile.hoverStyles}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
${colorStyles}
|
|
113
|
+
`.trim();
|
|
114
|
+
};
|
|
115
|
+
const generateBorderCornerStyles = ({ uid, device, borderBtn, roundedBtn })=>{
|
|
116
|
+
const normalStyles = `
|
|
117
|
+
.${uid}.gp-button-base::before {
|
|
118
|
+
content: "";
|
|
119
|
+
height: 100%;
|
|
120
|
+
width: 100%;
|
|
121
|
+
position: absolute;
|
|
122
|
+
pointer-events: none;
|
|
123
|
+
${core.composeBorderCss(borderBtn?.[device]?.normal)}
|
|
124
|
+
${core.composeCornerCss(roundedBtn?.[device]?.normal)}
|
|
125
|
+
}
|
|
126
|
+
`;
|
|
127
|
+
const hoverStyles = `
|
|
128
|
+
.${uid}:hover::before {
|
|
129
|
+
${core.composeBorderCss(borderBtn?.[device]?.hover)}
|
|
130
|
+
${core.composeCornerCss(roundedBtn?.[device]?.hover)}
|
|
131
|
+
}
|
|
132
|
+
`;
|
|
133
|
+
return {
|
|
134
|
+
normalStyles,
|
|
135
|
+
hoverStyles
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
const generateColorStyles = (uid, textColor)=>`
|
|
139
|
+
.${uid}:hover .gp-button-price,
|
|
140
|
+
.${uid}:hover .gp-product-dot-price {
|
|
141
|
+
color: ${core.getSingleColorVariable(textColor?.hover)};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.${uid} .gp-button-price,
|
|
145
|
+
.${uid} .gp-product-dot-price {
|
|
146
|
+
color: ${core.getSingleColorVariable(textColor?.normal)};
|
|
147
|
+
}
|
|
148
|
+
`;
|
|
149
|
+
|
|
150
|
+
exports.generateBorderCornerStyles = generateBorderCornerStyles;
|
|
151
|
+
exports.generateColorStyles = generateColorStyles;
|
|
152
|
+
exports.getButtonIconStyles = getButtonIconStyles;
|
|
153
|
+
exports.getButtonStyles = getButtonStyles;
|
|
154
|
+
exports.getButtonWrapperStyles = getButtonWrapperStyles;
|
|
155
|
+
exports.getCustomCssStyles = getCustomCssStyles;
|
|
156
|
+
exports.getRadiusStyles = getRadiusStyles;
|
|
157
|
+
exports.getShadowStyles = getShadowStyles;
|
package/dist/cjs/button/next.js
CHANGED
|
@@ -8,15 +8,11 @@ require('react/jsx-runtime');
|
|
|
8
8
|
require('react');
|
|
9
9
|
require('@gem-sdk/core');
|
|
10
10
|
|
|
11
|
-
const Button = dynamic(()=>Promise.resolve().then(function () { return require('./components/
|
|
12
|
-
loading: Loading.default
|
|
13
|
-
});
|
|
14
|
-
const ButtonV1 = dynamic(()=>Promise.resolve().then(function () { return require('./components/Button.js'); }), {
|
|
11
|
+
const Button = dynamic(()=>Promise.resolve().then(function () { return require('./components/Button.js'); }), {
|
|
15
12
|
loading: Loading.default
|
|
16
13
|
});
|
|
17
14
|
var button = {
|
|
18
|
-
Button
|
|
19
|
-
ButtonV1
|
|
15
|
+
Button
|
|
20
16
|
};
|
|
21
17
|
|
|
22
18
|
exports.default = button;
|
|
@@ -44,7 +44,11 @@ const ButtonSettings = [
|
|
|
44
44
|
id: 'iconSvg',
|
|
45
45
|
label: 'SVG Icon',
|
|
46
46
|
type: 'icon',
|
|
47
|
-
default:
|
|
47
|
+
default: `
|
|
48
|
+
<svg width="100%" height="100%" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
49
|
+
<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"/>
|
|
50
|
+
</svg>
|
|
51
|
+
`
|
|
48
52
|
},
|
|
49
53
|
{
|
|
50
54
|
id: 'iconAlign',
|
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@gem-sdk/core');
|
|
8
8
|
var React = require('react');
|
|
9
|
-
require('next/head');
|
|
10
|
-
require('next/link');
|
|
11
9
|
var Button = require('../../button/components/Button.js');
|
|
12
10
|
|
|
13
11
|
const CheckoutNow = ({ setting, builderAttrs, builderProps, style, styles, className })=>{
|
|
@@ -5,10 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@gem-sdk/core');
|
|
8
|
-
require('next/head');
|
|
9
|
-
var React = require('react');
|
|
10
|
-
require('next/link');
|
|
11
8
|
var Button = require('../../button/components/Button.js');
|
|
9
|
+
var React = require('react');
|
|
12
10
|
|
|
13
11
|
const Coupon = ({ setting, builderProps, builderAttrs, style, styles, advanced, children })=>{
|
|
14
12
|
const mode = core.useEditorMode();
|