@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.
Files changed (112) 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/post-purchase/callout-banner/components/CalloutText.js +1 -2
  30. package/dist/cjs/post-purchase/callout-banner/components/common/getClasses.js +2 -5
  31. package/dist/cjs/post-purchase/callout-banner/components/common/getStyles.js +4 -2
  32. package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/setting.js +11 -1
  33. package/dist/cjs/post-purchase/product/hooks/product-image/useListCarousel.js +1 -1
  34. package/dist/cjs/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +4 -1
  35. package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +15 -2
  36. package/dist/cjs/post-purchase/product/settings/product-image/uiV2.js +3 -1
  37. package/dist/cjs/post-purchase/utils/constants.js +1 -1
  38. package/dist/cjs/product/components/DynamicCheckout/DynamicCheckout.js +2 -5
  39. package/dist/cjs/product/components/DynamicCheckout.js +2 -5
  40. package/dist/cjs/product/components/FileUpload/components/common/index.js +1 -1
  41. package/dist/cjs/product/components/ProductButton.js +2 -3
  42. package/dist/cjs/product/components/ProductButton.liquid.js +3 -3
  43. package/dist/cjs/product/components/ProductDescription/index.liquid.js +1 -2
  44. package/dist/cjs/product/components/ProductViewMore.js +2 -5
  45. package/dist/cjs/product/components/ProductViewMore.liquid.js +2 -2
  46. package/dist/cjs/setting.js +2 -2
  47. package/dist/cjs/text/components/common/getClasses.js +1 -1
  48. package/dist/cjs/third-party/components/PushOwl.js +0 -5
  49. package/dist/esm/article/components/ArticleReadMore.js +1 -3
  50. package/dist/esm/banner/components/HeroBannerItem.liquid.js +4 -4
  51. package/dist/esm/builder.js +1 -5
  52. package/dist/esm/button/components/Button.js +113 -186
  53. package/dist/esm/button/components/Button.liquid.js +109 -172
  54. package/dist/esm/button/components/ButtonIcon.js +13 -0
  55. package/dist/esm/button/components/ButtonIcon.liquid.js +12 -0
  56. package/dist/esm/button/components/ButtonLabel.js +14 -0
  57. package/dist/esm/button/components/ButtonLabel.liquid.js +11 -0
  58. package/dist/esm/button/components/ButtonLoadingIndicator.liquid.js +8 -0
  59. package/dist/esm/button/components/common/attributes.js +13 -0
  60. package/dist/esm/button/components/common/classes.js +49 -0
  61. package/dist/esm/button/components/common/constants.js +24 -0
  62. package/dist/esm/button/components/common/data.js +74 -0
  63. package/dist/esm/button/components/common/helpers.js +118 -0
  64. package/dist/esm/button/components/common/styles.js +148 -0
  65. package/dist/esm/button/next.js +2 -6
  66. package/dist/esm/button/setting/configs/settings.js +5 -1
  67. package/dist/esm/cart/components/CheckoutNow.js +0 -2
  68. package/dist/esm/coupon/components/Coupon.js +1 -3
  69. package/dist/esm/dialog/setting/Dialog.js +7 -580
  70. package/dist/esm/dialog/setting/configs/settings.js +323 -0
  71. package/dist/esm/dialog/setting/configs/uiV1.js +286 -0
  72. package/dist/esm/dialog/setting/configs/uiV2.js +256 -0
  73. package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +3 -3
  74. package/dist/esm/form/components/submit-button/SubmitButton.js +0 -4
  75. package/dist/esm/index.js +1 -2
  76. package/dist/esm/index.liquid.js +1 -2
  77. package/dist/esm/post-purchase/callout-banner/components/CalloutText.js +1 -2
  78. package/dist/esm/post-purchase/callout-banner/components/common/getClasses.js +2 -5
  79. package/dist/esm/post-purchase/callout-banner/components/common/getStyles.js +4 -2
  80. package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +11 -1
  81. package/dist/esm/post-purchase/product/hooks/product-image/useListCarousel.js +1 -1
  82. package/dist/esm/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +4 -1
  83. package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +15 -2
  84. package/dist/esm/post-purchase/product/settings/product-image/uiV2.js +3 -1
  85. package/dist/esm/post-purchase/utils/constants.js +1 -1
  86. package/dist/esm/product/components/DynamicCheckout/DynamicCheckout.js +1 -4
  87. package/dist/esm/product/components/DynamicCheckout.js +1 -4
  88. package/dist/esm/product/components/FileUpload/components/common/index.js +1 -1
  89. package/dist/esm/product/components/ProductButton.js +1 -2
  90. package/dist/esm/product/components/ProductButton.liquid.js +1 -1
  91. package/dist/esm/product/components/ProductDescription/index.liquid.js +3 -4
  92. package/dist/esm/product/components/ProductViewMore.js +1 -4
  93. package/dist/esm/product/components/ProductViewMore.liquid.js +1 -1
  94. package/dist/esm/setting.js +2 -2
  95. package/dist/esm/text/components/common/getClasses.js +1 -1
  96. package/dist/esm/third-party/components/PushOwl.js +0 -5
  97. package/dist/types/index.d.ts +175 -267
  98. package/package.json +2 -2
  99. package/dist/cjs/button/components/v2/ButtonIcon.js +0 -18
  100. package/dist/cjs/button/components/v2/ButtonLabel.js +0 -25
  101. package/dist/cjs/button/components/v2/ButtonV2.js +0 -140
  102. package/dist/cjs/button/components/v2/ButtonV2.liquid.js +0 -181
  103. package/dist/cjs/button/hooks/useButtonCustomCss.js +0 -88
  104. package/dist/cjs/button/hooks/useButtonStyles.js +0 -93
  105. package/dist/esm/button/components/v2/ButtonIcon.js +0 -14
  106. package/dist/esm/button/components/v2/ButtonLabel.js +0 -21
  107. package/dist/esm/button/components/v2/ButtonV2.js +0 -136
  108. package/dist/esm/button/components/v2/ButtonV2.liquid.js +0 -177
  109. package/dist/esm/button/hooks/useButtonCustomCss.js +0 -84
  110. package/dist/esm/button/hooks/useButtonStyles.js +0 -91
  111. /package/dist/cjs/button/components/{v2/ButtonLoadingIndicator.js → ButtonLoadingIndicator.js} +0 -0
  112. /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 };
@@ -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();