@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,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 };
|
package/dist/esm/button/next.js
CHANGED
|
@@ -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/
|
|
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:
|
|
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();
|