diy-template-components 5.1.4 → 5.10.0
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/build/index.es.js +255 -179
- package/build/index.es.js.map +1 -1
- package/build/index.js +255 -179
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.es.js
CHANGED
|
@@ -5,6 +5,7 @@ import moment from 'moment';
|
|
|
5
5
|
import Countdown from 'react-countdown';
|
|
6
6
|
import koreanLocale from 'moment/locale/ko';
|
|
7
7
|
import ReactDOMServer from 'react-dom/server';
|
|
8
|
+
import '@storybook/theming';
|
|
8
9
|
import { createTheming, createUseStyles as createUseStyles$1, useTheme as useTheme$1 } from 'react-jss';
|
|
9
10
|
|
|
10
11
|
function insertStyle(css) {
|
|
@@ -11786,7 +11787,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
|
|
|
11786
11787
|
} = {}) => backgroundImage ? `url("${backgroundImage}")` : 'none',
|
|
11787
11788
|
backgroundColor: ({
|
|
11788
11789
|
backgroundColor
|
|
11789
|
-
} = {}) => backgroundColor ||
|
|
11790
|
+
} = {}) => backgroundColor || theme?.colors?.background2,
|
|
11790
11791
|
backgroundSize: 'cover',
|
|
11791
11792
|
backgroundPosition: 'center',
|
|
11792
11793
|
backgroundRepeat: 'no-repeat',
|
|
@@ -11807,7 +11808,8 @@ const useCounterSectionStyles = createUseStyles(theme => {
|
|
|
11807
11808
|
},
|
|
11808
11809
|
grid: {
|
|
11809
11810
|
display: 'grid',
|
|
11810
|
-
gridTemplateColumns: 'repeat(
|
|
11811
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))',
|
|
11812
|
+
// fits 4 columns in desktop
|
|
11811
11813
|
gap: ({
|
|
11812
11814
|
isMobile
|
|
11813
11815
|
} = {}) => isMobile ? '24px' : '32px',
|
|
@@ -11826,7 +11828,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
|
|
|
11826
11828
|
fontSize: '64px',
|
|
11827
11829
|
fontWeight: theme.typography?.fontWeight?.bold,
|
|
11828
11830
|
lineHeight: 1.1,
|
|
11829
|
-
color:
|
|
11831
|
+
color: theme?.colors?.AccentColor,
|
|
11830
11832
|
wordBreak: 'break-word'
|
|
11831
11833
|
},
|
|
11832
11834
|
description: {
|
|
@@ -11834,7 +11836,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
|
|
|
11834
11836
|
fontSize: '20px',
|
|
11835
11837
|
lineHeight: 1.4,
|
|
11836
11838
|
fontWeight: '700',
|
|
11837
|
-
color:
|
|
11839
|
+
color: theme?.colors?.font3,
|
|
11838
11840
|
wordBreak: 'break-word'
|
|
11839
11841
|
},
|
|
11840
11842
|
'@media (max-width: 1024px)': {
|
|
@@ -11864,6 +11866,83 @@ const useCounterSectionStyles = createUseStyles(theme => {
|
|
|
11864
11866
|
};
|
|
11865
11867
|
});
|
|
11866
11868
|
|
|
11869
|
+
const DURATION_MS = 2000;
|
|
11870
|
+
const EASING = t => 1 - Math.pow(1 - t, 3); // easeOutCubic
|
|
11871
|
+
|
|
11872
|
+
function parseCounterValue(value) {
|
|
11873
|
+
if (value == null || value === '') return null;
|
|
11874
|
+
const match = String(value).trim().match(/^([\d.]+)(.*)$/);
|
|
11875
|
+
if (!match) return null;
|
|
11876
|
+
const num = parseFloat(match[1]);
|
|
11877
|
+
if (Number.isNaN(num)) return null;
|
|
11878
|
+
return {
|
|
11879
|
+
end: num,
|
|
11880
|
+
suffix: match[2] || ''
|
|
11881
|
+
};
|
|
11882
|
+
}
|
|
11883
|
+
function AnimatedCounter({
|
|
11884
|
+
value,
|
|
11885
|
+
className,
|
|
11886
|
+
refSetter
|
|
11887
|
+
}) {
|
|
11888
|
+
const elRef = useRef(null);
|
|
11889
|
+
const rafIdRef = useRef(null);
|
|
11890
|
+
const hasAnimatedRef = useRef(false);
|
|
11891
|
+
useLayoutEffect(() => {
|
|
11892
|
+
hasAnimatedRef.current = false; // Reset so we can re-animate when value changes (e.g. live edit)
|
|
11893
|
+
const parsed = parseCounterValue(value);
|
|
11894
|
+
if (!parsed || !elRef.current) return;
|
|
11895
|
+
const observer = new IntersectionObserver(entries => {
|
|
11896
|
+
const [entry] = entries;
|
|
11897
|
+
if (!entry.isIntersecting || hasAnimatedRef.current) return;
|
|
11898
|
+
hasAnimatedRef.current = true;
|
|
11899
|
+
const startTime = performance.now();
|
|
11900
|
+
const {
|
|
11901
|
+
end,
|
|
11902
|
+
suffix
|
|
11903
|
+
} = parsed;
|
|
11904
|
+
const tick = now => {
|
|
11905
|
+
const elapsed = now - startTime;
|
|
11906
|
+
const progress = Math.min(elapsed / DURATION_MS, 1);
|
|
11907
|
+
const eased = EASING(progress);
|
|
11908
|
+
const current = eased * end;
|
|
11909
|
+
if (elRef.current) {
|
|
11910
|
+
const displayValue = Number.isInteger(end) ? Math.round(current) : parseFloat(current.toFixed(2));
|
|
11911
|
+
elRef.current.textContent = displayValue + suffix;
|
|
11912
|
+
}
|
|
11913
|
+
if (progress < 1) {
|
|
11914
|
+
rafIdRef.current = requestAnimationFrame(tick);
|
|
11915
|
+
}
|
|
11916
|
+
};
|
|
11917
|
+
rafIdRef.current = requestAnimationFrame(tick);
|
|
11918
|
+
}, {
|
|
11919
|
+
threshold: 0.2
|
|
11920
|
+
});
|
|
11921
|
+
observer.observe(elRef.current);
|
|
11922
|
+
return () => {
|
|
11923
|
+
observer.disconnect();
|
|
11924
|
+
if (rafIdRef.current) cancelAnimationFrame(rafIdRef.current);
|
|
11925
|
+
};
|
|
11926
|
+
}, [value]);
|
|
11927
|
+
const parsed = parseCounterValue(value);
|
|
11928
|
+
const setRef = el => {
|
|
11929
|
+
elRef.current = el;
|
|
11930
|
+
refSetter?.(el);
|
|
11931
|
+
};
|
|
11932
|
+
if (parsed) {
|
|
11933
|
+
return /*#__PURE__*/React.createElement("h2", {
|
|
11934
|
+
ref: setRef,
|
|
11935
|
+
className: className
|
|
11936
|
+
}, "0", parsed.suffix);
|
|
11937
|
+
}
|
|
11938
|
+
return /*#__PURE__*/React.createElement("h2", {
|
|
11939
|
+
ref: refSetter,
|
|
11940
|
+
className: className,
|
|
11941
|
+
dangerouslySetInnerHTML: {
|
|
11942
|
+
__html: value
|
|
11943
|
+
}
|
|
11944
|
+
});
|
|
11945
|
+
}
|
|
11867
11946
|
function CounterSection({
|
|
11868
11947
|
sectionData,
|
|
11869
11948
|
sectionIndex
|
|
@@ -11874,44 +11953,49 @@ function CounterSection({
|
|
|
11874
11953
|
},
|
|
11875
11954
|
isMobile
|
|
11876
11955
|
} = useContext(PageContext);
|
|
11877
|
-
console.log('llll', sectionData);
|
|
11878
|
-
sectionData.components = sectionData.components;
|
|
11879
11956
|
const metadata = sectionData.metadata || {};
|
|
11880
11957
|
const backgroundImage = metadata.backgroundImage || '';
|
|
11881
|
-
const backgroundColor = metadata.backgroundColor
|
|
11958
|
+
const backgroundColor = metadata.backgroundColor;
|
|
11882
11959
|
const classes = useCounterSectionStyles({
|
|
11883
11960
|
containerWidth,
|
|
11884
11961
|
isMobile,
|
|
11885
11962
|
backgroundImage: backgroundImage || null,
|
|
11886
11963
|
backgroundColor
|
|
11887
11964
|
});
|
|
11888
|
-
const cardData = sectionData?.components[0];
|
|
11889
|
-
const [sectionComponent] = sectionData
|
|
11965
|
+
const cardData = sectionData?.components?.[0];
|
|
11966
|
+
const [sectionComponent] = sectionData?.components || [];
|
|
11890
11967
|
const counterSection = sectionComponent?.counterSection;
|
|
11891
|
-
counterSection?.components || [];
|
|
11968
|
+
const counters = counterSection?.components || [];
|
|
11969
|
+
const items = cardData?.contentList?.components || counters;
|
|
11892
11970
|
if (!cardData) return null;
|
|
11971
|
+
const getValue = item => item?.contentHeading?.metadata?.value ?? item?.value?.metadata?.value;
|
|
11972
|
+
const getDescription = item => item?.contentPara?.metadata?.value ?? item?.description?.metadata?.value;
|
|
11973
|
+
const getValueRefSetter = item => item?.contentHeading?.refSetter ?? item?.value?.refSetter;
|
|
11974
|
+
const getDescRefSetter = item => item?.contentPara?.refSetter ?? item?.description?.refSetter;
|
|
11893
11975
|
return /*#__PURE__*/React.createElement("section", {
|
|
11894
11976
|
className: classes.section
|
|
11895
11977
|
}, /*#__PURE__*/React.createElement("div", {
|
|
11896
11978
|
className: classes.container
|
|
11897
11979
|
}, /*#__PURE__*/React.createElement("div", {
|
|
11898
11980
|
className: classes.grid
|
|
11899
|
-
},
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
|
|
11912
|
-
|
|
11913
|
-
|
|
11914
|
-
|
|
11981
|
+
}, items?.map((item, index) => {
|
|
11982
|
+
const value = getValue(item);
|
|
11983
|
+
const description = getDescription(item);
|
|
11984
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
11985
|
+
key: item._id || index,
|
|
11986
|
+
className: classes.counterItem
|
|
11987
|
+
}, value != null && value !== '' && /*#__PURE__*/React.createElement(AnimatedCounter, {
|
|
11988
|
+
value: value,
|
|
11989
|
+
className: classes.value,
|
|
11990
|
+
refSetter: getValueRefSetter(item)
|
|
11991
|
+
}), description != null && description !== '' && /*#__PURE__*/React.createElement("p", {
|
|
11992
|
+
ref: getDescRefSetter(item),
|
|
11993
|
+
className: classes.description,
|
|
11994
|
+
dangerouslySetInnerHTML: {
|
|
11995
|
+
__html: description
|
|
11996
|
+
}
|
|
11997
|
+
}));
|
|
11998
|
+
}))));
|
|
11915
11999
|
}
|
|
11916
12000
|
|
|
11917
12001
|
var index$5 = /*#__PURE__*/Object.freeze({
|
|
@@ -11928,12 +12012,13 @@ const BREAKPOINTS = {
|
|
|
11928
12012
|
/**
|
|
11929
12013
|
* Get current breakpoint from window width
|
|
11930
12014
|
*/
|
|
11931
|
-
const getBreakpoint = width => {
|
|
12015
|
+
const getBreakpoint = (width, isMobile) => {
|
|
12016
|
+
if (isMobile) return 'mobile';
|
|
11932
12017
|
if (width >= BREAKPOINTS.desktop) return 'desktop';
|
|
11933
12018
|
if (width >= BREAKPOINTS.tablet) return 'tablet';
|
|
11934
12019
|
return 'mobile';
|
|
11935
12020
|
};
|
|
11936
|
-
const
|
|
12021
|
+
const getStickyBarBase = theme => ({
|
|
11937
12022
|
position: 'fixed',
|
|
11938
12023
|
left: 0,
|
|
11939
12024
|
right: 0,
|
|
@@ -11942,100 +12027,86 @@ const stickyBarBase = {
|
|
|
11942
12027
|
display: 'flex',
|
|
11943
12028
|
alignItems: 'center',
|
|
11944
12029
|
justifyContent: 'center',
|
|
11945
|
-
|
|
11946
|
-
|
|
11947
|
-
|
|
11948
|
-
}
|
|
11949
|
-
|
|
11950
|
-
|
|
11951
|
-
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11959
|
-
|
|
11960
|
-
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
|
|
11966
|
-
|
|
11967
|
-
|
|
11968
|
-
|
|
11969
|
-
|
|
11970
|
-
|
|
12030
|
+
fontFamily: theme?.typography?.fontFamily,
|
|
12031
|
+
backgroundColor: theme?.colors?.ctaColor || '#FFFFFF',
|
|
12032
|
+
boxShadow: theme?.shadows?.secondary ?? '0 -2px 8px rgba(0, 0, 0, 0.06)',
|
|
12033
|
+
borderTop: `1px solid ${theme?.colors?.border2}`
|
|
12034
|
+
});
|
|
12035
|
+
const getStickyBarResponsive = (theme, bgColor) => {
|
|
12036
|
+
const base = getStickyBarBase(theme);
|
|
12037
|
+
return {
|
|
12038
|
+
mobile: {
|
|
12039
|
+
...base,
|
|
12040
|
+
padding: '12px 16px',
|
|
12041
|
+
gap: '12px',
|
|
12042
|
+
flexDirection: 'column',
|
|
12043
|
+
alignItems: 'stretch',
|
|
12044
|
+
background: '#FFFFFF',
|
|
12045
|
+
color: theme?.colors?.CtaTextColor || 'white'
|
|
12046
|
+
},
|
|
12047
|
+
tablet: {
|
|
12048
|
+
...base,
|
|
12049
|
+
padding: '14px 24px',
|
|
12050
|
+
gap: '16px',
|
|
12051
|
+
flexDirection: 'row',
|
|
12052
|
+
alignItems: 'center',
|
|
12053
|
+
background: '#FFFFFF',
|
|
12054
|
+
color: theme?.colors?.CtaTextColor || 'white'
|
|
12055
|
+
},
|
|
12056
|
+
desktop: {
|
|
12057
|
+
...base,
|
|
12058
|
+
padding: '16px 32px',
|
|
12059
|
+
gap: '24px',
|
|
12060
|
+
flexDirection: 'row',
|
|
12061
|
+
alignItems: 'center',
|
|
12062
|
+
background: '#FFFFFF',
|
|
12063
|
+
color: theme?.colors?.CtaTextColor || 'white'
|
|
12064
|
+
}
|
|
12065
|
+
};
|
|
11971
12066
|
};
|
|
11972
|
-
const getStickyBarStyle = breakpoint =>
|
|
11973
|
-
const
|
|
11974
|
-
color:
|
|
11975
|
-
fontFamily:
|
|
12067
|
+
const getStickyBarStyle = (breakpoint, theme = {}, bgColor) => getStickyBarResponsive(theme)[breakpoint] || getStickyBarResponsive(theme).mobile;
|
|
12068
|
+
const getStickyTextBase = theme => ({
|
|
12069
|
+
color: theme?.colors?.font2,
|
|
12070
|
+
fontFamily: theme?.typography?.fontFamily ?? 'inherit',
|
|
11976
12071
|
margin: 0
|
|
12072
|
+
});
|
|
12073
|
+
const getStickyTextResponsive = (theme, bgColor) => {
|
|
12074
|
+
const base = getStickyTextBase(theme);
|
|
12075
|
+
return {
|
|
12076
|
+
mobile: {
|
|
12077
|
+
...base,
|
|
12078
|
+
fontSize: '13px',
|
|
12079
|
+
lineHeight: 1.4,
|
|
12080
|
+
textAlign: 'center',
|
|
12081
|
+
color: '#000000' ,
|
|
12082
|
+
background: '#FFFFFF'
|
|
12083
|
+
},
|
|
12084
|
+
tablet: {
|
|
12085
|
+
...base,
|
|
12086
|
+
fontSize: '14px',
|
|
12087
|
+
lineHeight: 1.45,
|
|
12088
|
+
textAlign: 'left',
|
|
12089
|
+
color: '#000000' ,
|
|
12090
|
+
background: '#FFFFFF'
|
|
12091
|
+
},
|
|
12092
|
+
desktop: {
|
|
12093
|
+
...base,
|
|
12094
|
+
fontSize: '15px',
|
|
12095
|
+
lineHeight: 1.5,
|
|
12096
|
+
textAlign: 'left',
|
|
12097
|
+
color: '#000000' ,
|
|
12098
|
+
background: '#FFFFFF'
|
|
12099
|
+
}
|
|
12100
|
+
};
|
|
11977
12101
|
};
|
|
11978
|
-
const
|
|
11979
|
-
mobile: {
|
|
11980
|
-
...stickyTextBase,
|
|
11981
|
-
fontSize: '13px',
|
|
11982
|
-
lineHeight: 1.4,
|
|
11983
|
-
textAlign: 'center'
|
|
11984
|
-
},
|
|
11985
|
-
tablet: {
|
|
11986
|
-
...stickyTextBase,
|
|
11987
|
-
fontSize: '14px',
|
|
11988
|
-
lineHeight: 1.45,
|
|
11989
|
-
textAlign: 'left'
|
|
11990
|
-
},
|
|
11991
|
-
desktop: {
|
|
11992
|
-
...stickyTextBase,
|
|
11993
|
-
fontSize: '15px',
|
|
11994
|
-
lineHeight: 1.5,
|
|
11995
|
-
textAlign: 'left'
|
|
11996
|
-
}
|
|
11997
|
-
};
|
|
11998
|
-
const getStickyTextStyle = breakpoint => stickyTextResponsive[breakpoint] || stickyTextResponsive.mobile;
|
|
11999
|
-
const stickyButtonBase = {
|
|
12000
|
-
backgroundColor: '#3366FF',
|
|
12001
|
-
color: '#FFFFFF',
|
|
12002
|
-
border: 'none',
|
|
12003
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
12004
|
-
fontWeight: 600,
|
|
12005
|
-
textTransform: 'uppercase',
|
|
12006
|
-
letterSpacing: '0.02em',
|
|
12007
|
-
cursor: 'pointer',
|
|
12008
|
-
whiteSpace: 'nowrap',
|
|
12009
|
-
flexShrink: 0
|
|
12010
|
-
};
|
|
12011
|
-
const stickyButtonResponsive = {
|
|
12012
|
-
mobile: {
|
|
12013
|
-
...stickyButtonBase,
|
|
12014
|
-
padding: '10px 20px',
|
|
12015
|
-
fontSize: '12px',
|
|
12016
|
-
borderRadius: '6px'
|
|
12017
|
-
},
|
|
12018
|
-
tablet: {
|
|
12019
|
-
...stickyButtonBase,
|
|
12020
|
-
padding: '12px 24px',
|
|
12021
|
-
fontSize: '13px',
|
|
12022
|
-
borderRadius: '8px'
|
|
12023
|
-
},
|
|
12024
|
-
desktop: {
|
|
12025
|
-
...stickyButtonBase,
|
|
12026
|
-
padding: '14px 28px',
|
|
12027
|
-
fontSize: '14px',
|
|
12028
|
-
borderRadius: '8px'
|
|
12029
|
-
}
|
|
12030
|
-
};
|
|
12031
|
-
const getStickyButtonStyle = breakpoint => stickyButtonResponsive[breakpoint] || stickyButtonResponsive.mobile;
|
|
12102
|
+
const getStickyTextStyle = (breakpoint, theme = {}) => getStickyTextResponsive(theme)[breakpoint] || getStickyTextResponsive(theme).mobile;
|
|
12032
12103
|
|
|
12033
12104
|
// --- Floating (WhatsApp) type ---
|
|
12034
12105
|
|
|
12035
|
-
const
|
|
12106
|
+
const getFloatingButtonBase = theme => ({
|
|
12036
12107
|
position: 'fixed',
|
|
12037
12108
|
bottom: 24,
|
|
12038
|
-
right:
|
|
12109
|
+
right: 9,
|
|
12039
12110
|
width: 'fit-content',
|
|
12040
12111
|
marginLeft: 'auto',
|
|
12041
12112
|
zIndex: 9999,
|
|
@@ -12043,47 +12114,50 @@ const floatingButtonBase = {
|
|
|
12043
12114
|
alignItems: 'center',
|
|
12044
12115
|
gap: '10px',
|
|
12045
12116
|
padding: '12px 20px',
|
|
12046
|
-
backgroundColor: '#FFFFFF',
|
|
12047
|
-
border:
|
|
12117
|
+
backgroundColor: theme?.colors?.ctaColor || '#FFFFFF',
|
|
12118
|
+
border: `1px solid ${theme?.palette?.border?.secondary ?? '#E5E7EB'}`,
|
|
12048
12119
|
borderRadius: '9999px',
|
|
12049
|
-
boxShadow: '0 4px 12px rgba(0, 0, 0, 0.1)',
|
|
12120
|
+
boxShadow: theme?.shadows?.primary ?? '0 4px 12px rgba(0, 0, 0, 0.1)',
|
|
12050
12121
|
cursor: 'pointer',
|
|
12051
12122
|
textDecoration: 'none',
|
|
12052
|
-
fontFamily:
|
|
12053
|
-
fontWeight: 700,
|
|
12123
|
+
fontFamily: theme?.typography?.fontFamily ?? 'inherit',
|
|
12124
|
+
fontWeight: theme?.typography?.fontWeight?.bold ?? 700,
|
|
12054
12125
|
fontSize: '14px',
|
|
12055
12126
|
textTransform: 'uppercase',
|
|
12056
12127
|
letterSpacing: '0.02em',
|
|
12057
|
-
color: '
|
|
12128
|
+
color: theme?.colors?.CtaTextColor || 'white',
|
|
12058
12129
|
transition: 'box-shadow 0.2s ease, transform 0.2s ease'
|
|
12130
|
+
});
|
|
12131
|
+
const getFloatingButtonResponsive = theme => {
|
|
12132
|
+
const base = getFloatingButtonBase(theme);
|
|
12133
|
+
return {
|
|
12134
|
+
mobile: {
|
|
12135
|
+
...base,
|
|
12136
|
+
bottom: 142,
|
|
12137
|
+
left: 16,
|
|
12138
|
+
padding: '10px 16px',
|
|
12139
|
+
gap: '8px',
|
|
12140
|
+
fontSize: '12px'
|
|
12141
|
+
},
|
|
12142
|
+
tablet: {
|
|
12143
|
+
...base,
|
|
12144
|
+
bottom: 20,
|
|
12145
|
+
left: 20,
|
|
12146
|
+
padding: '12px 18px',
|
|
12147
|
+
gap: '10px',
|
|
12148
|
+
fontSize: '13px'
|
|
12149
|
+
},
|
|
12150
|
+
desktop: {
|
|
12151
|
+
...base,
|
|
12152
|
+
bottom: 24,
|
|
12153
|
+
left: 24,
|
|
12154
|
+
padding: '12px 20px',
|
|
12155
|
+
gap: '10px',
|
|
12156
|
+
fontSize: '14px'
|
|
12157
|
+
}
|
|
12158
|
+
};
|
|
12059
12159
|
};
|
|
12060
|
-
const
|
|
12061
|
-
mobile: {
|
|
12062
|
-
...floatingButtonBase,
|
|
12063
|
-
bottom: 16,
|
|
12064
|
-
left: 16,
|
|
12065
|
-
padding: '10px 16px',
|
|
12066
|
-
gap: '8px',
|
|
12067
|
-
fontSize: '12px'
|
|
12068
|
-
},
|
|
12069
|
-
tablet: {
|
|
12070
|
-
...floatingButtonBase,
|
|
12071
|
-
bottom: 20,
|
|
12072
|
-
left: 20,
|
|
12073
|
-
padding: '12px 18px',
|
|
12074
|
-
gap: '10px',
|
|
12075
|
-
fontSize: '13px'
|
|
12076
|
-
},
|
|
12077
|
-
desktop: {
|
|
12078
|
-
...floatingButtonBase,
|
|
12079
|
-
bottom: 24,
|
|
12080
|
-
left: 24,
|
|
12081
|
-
padding: '12px 20px',
|
|
12082
|
-
gap: '10px',
|
|
12083
|
-
fontSize: '14px'
|
|
12084
|
-
}
|
|
12085
|
-
};
|
|
12086
|
-
const getFloatingButtonStyle = breakpoint => floatingButtonResponsive[breakpoint] || floatingButtonResponsive.mobile;
|
|
12160
|
+
const getFloatingButtonStyle = (breakpoint, theme = {}) => getFloatingButtonResponsive(theme)[breakpoint] || getFloatingButtonResponsive(theme).mobile;
|
|
12087
12161
|
const whatsAppIconSvgSize = {
|
|
12088
12162
|
mobile: 24,
|
|
12089
12163
|
tablet: 26,
|
|
@@ -12171,12 +12245,17 @@ function StickyCta({
|
|
|
12171
12245
|
whatsAppLabel = 'SUPPORT',
|
|
12172
12246
|
whatsAppIconColor,
|
|
12173
12247
|
whatsAppButtonBackgroundColor,
|
|
12174
|
-
iconImageUrl
|
|
12248
|
+
iconImageUrl,
|
|
12249
|
+
nodeData,
|
|
12250
|
+
extraProps
|
|
12175
12251
|
}) {
|
|
12176
|
-
|
|
12252
|
+
const {
|
|
12253
|
+
isMobile
|
|
12254
|
+
} = useContext(PageContext);
|
|
12177
12255
|
const node = sectionData?.components?.[0];
|
|
12178
12256
|
const contentList = node?.contentList?.components || [];
|
|
12179
12257
|
const showEditHint = sectionData?.isDefaultEditor ?? false;
|
|
12258
|
+
sectionData?.bgSection?.components?.[0]?.sectionBgData?.metadata?.value;
|
|
12180
12259
|
const propsFromSection = node ? {
|
|
12181
12260
|
type: node?.title?.metadata?.value ?? type,
|
|
12182
12261
|
stickyMessage: contentList[1]?.contentPara?.metadata?.value ?? stickyMessage,
|
|
@@ -12199,8 +12278,9 @@ function StickyCta({
|
|
|
12199
12278
|
whatsAppButtonBackgroundColor,
|
|
12200
12279
|
iconImageUrl
|
|
12201
12280
|
};
|
|
12202
|
-
const whatsAppUrl = p?.whatsAppPhoneNumber
|
|
12203
|
-
const
|
|
12281
|
+
const whatsAppUrl = buildWhatsAppUrl(p?.whatsAppPhoneNumber) ?? p?.whatsAppHref ?? '#';
|
|
12282
|
+
const theme = useTheme() || {};
|
|
12283
|
+
const [breakpoint, setBreakpoint] = useState(() => typeof window !== 'undefined' ? getBreakpoint(window.innerWidth, isMobile) : 'mobile');
|
|
12204
12284
|
useEffect(() => {
|
|
12205
12285
|
if (typeof window === 'undefined') return;
|
|
12206
12286
|
const onResize = () => setBreakpoint(getBreakpoint(window.innerWidth));
|
|
@@ -12229,14 +12309,14 @@ function StickyCta({
|
|
|
12229
12309
|
}, "Click on edit button to edit this section")) : null;
|
|
12230
12310
|
if (p.type === 'floating') {
|
|
12231
12311
|
const buttonStyle = {
|
|
12232
|
-
...getFloatingButtonStyle(breakpoint),
|
|
12312
|
+
...getFloatingButtonStyle(breakpoint, theme),
|
|
12233
12313
|
...(p.whatsAppButtonBackgroundColor != null && {
|
|
12234
12314
|
backgroundColor: p.whatsAppButtonBackgroundColor
|
|
12235
12315
|
})
|
|
12236
12316
|
};
|
|
12237
12317
|
const iconSize = getWhatsAppIconSize(breakpoint);
|
|
12238
12318
|
const iconColor = p.whatsAppIconColor ?? DEFAULT_WHATSAPP_ICON_COLOR;
|
|
12239
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, editHintBlock, /*#__PURE__*/React.createElement("a", {
|
|
12319
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isMobile ? null : editHintBlock, /*#__PURE__*/React.createElement("a", {
|
|
12240
12320
|
href: whatsAppUrl,
|
|
12241
12321
|
target: "_blank",
|
|
12242
12322
|
rel: "noopener noreferrer",
|
|
@@ -12258,28 +12338,29 @@ function StickyCta({
|
|
|
12258
12338
|
}), /*#__PURE__*/React.createElement("span", null, p.whatsAppLabel)));
|
|
12259
12339
|
}
|
|
12260
12340
|
|
|
12261
|
-
// type === 'sticky' –
|
|
12262
|
-
const barStyle = getStickyBarStyle(breakpoint);
|
|
12263
|
-
const textStyle = getStickyTextStyle(breakpoint);
|
|
12264
|
-
|
|
12265
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, editHintBlock, /*#__PURE__*/React.createElement("div", {
|
|
12341
|
+
// type === 'sticky' – use primary Button (same as other sections) linking to WhatsApp
|
|
12342
|
+
const barStyle = getStickyBarStyle(breakpoint, theme);
|
|
12343
|
+
const textStyle = getStickyTextStyle(breakpoint, theme);
|
|
12344
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isMobile ? null : editHintBlock, /*#__PURE__*/React.createElement("div", {
|
|
12266
12345
|
style: barStyle,
|
|
12267
|
-
role: "banner"
|
|
12346
|
+
role: "banner",
|
|
12347
|
+
"access-cta-sticky": "DIY"
|
|
12268
12348
|
}, /*#__PURE__*/React.createElement("p", {
|
|
12269
12349
|
style: textStyle
|
|
12270
|
-
}, p.stickyMessage), /*#__PURE__*/React.createElement(
|
|
12271
|
-
|
|
12272
|
-
|
|
12273
|
-
|
|
12274
|
-
|
|
12275
|
-
|
|
12276
|
-
|
|
12277
|
-
|
|
12278
|
-
|
|
12279
|
-
|
|
12280
|
-
|
|
12281
|
-
|
|
12282
|
-
|
|
12350
|
+
}, p.stickyMessage), /*#__PURE__*/React.createElement(Button, {
|
|
12351
|
+
data: {
|
|
12352
|
+
isLink: 1,
|
|
12353
|
+
isExternal: 1,
|
|
12354
|
+
link: whatsAppUrl,
|
|
12355
|
+
value: p.stickyButtonText
|
|
12356
|
+
},
|
|
12357
|
+
type: "primary",
|
|
12358
|
+
styling: {
|
|
12359
|
+
background: theme?.colors?.ctaColor
|
|
12360
|
+
},
|
|
12361
|
+
size: breakpoint === 'mobile' ? 'small' : 'medium',
|
|
12362
|
+
"access-cta-container": "DIY"
|
|
12363
|
+
})));
|
|
12283
12364
|
}
|
|
12284
12365
|
|
|
12285
12366
|
var index$4 = /*#__PURE__*/Object.freeze({
|
|
@@ -12624,7 +12705,8 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
|
|
|
12624
12705
|
return {
|
|
12625
12706
|
section: {
|
|
12626
12707
|
width: '100%',
|
|
12627
|
-
background:
|
|
12708
|
+
background: theme?.colors?.background2,
|
|
12709
|
+
color: theme?.colors?.font3,
|
|
12628
12710
|
minHeight: '100%',
|
|
12629
12711
|
'&, & *, & *:before, & *:after': {
|
|
12630
12712
|
fontFamily: theme?.typography?.fontFamily,
|
|
@@ -12664,7 +12746,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
|
|
|
12664
12746
|
lineHeight: 1.25,
|
|
12665
12747
|
letterSpacing: '3px',
|
|
12666
12748
|
textTransform: 'uppercase',
|
|
12667
|
-
color: theme.palette?.font?.invertedDefault || 'rgba(255,255,255,0.9)',
|
|
12668
12749
|
wordBreak: 'break-word',
|
|
12669
12750
|
fontWeight: theme.typography?.fontWeight?.regular
|
|
12670
12751
|
},
|
|
@@ -12673,15 +12754,12 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
|
|
|
12673
12754
|
fontSize: theme.typography.fontSize.h2,
|
|
12674
12755
|
lineHeight: 1.1,
|
|
12675
12756
|
letterSpacing: '-1px',
|
|
12676
|
-
fontWeight: theme.typography?.fontWeight?.bold,
|
|
12677
|
-
color: theme.palette?.font?.invertedDefault || '#ffffff',
|
|
12678
12757
|
wordBreak: 'break-word'
|
|
12679
12758
|
},
|
|
12680
12759
|
subHeading: {
|
|
12681
12760
|
margin: 0,
|
|
12682
12761
|
fontSize: theme.typography.fontSize.body,
|
|
12683
12762
|
lineHeight: 1.5,
|
|
12684
|
-
color: theme.palette?.font?.invertedDefault || 'rgba(255,255,255,0.95)',
|
|
12685
12763
|
wordBreak: 'break-word',
|
|
12686
12764
|
maxWidth: '600px'
|
|
12687
12765
|
},
|
|
@@ -12727,7 +12805,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
|
|
|
12727
12805
|
margin: 0,
|
|
12728
12806
|
fontSize: theme.typography.fontSize.body,
|
|
12729
12807
|
fontWeight: theme.typography?.fontWeight?.semiBold,
|
|
12730
|
-
color: '#ffffff',
|
|
12731
12808
|
lineHeight: 1.3
|
|
12732
12809
|
}
|
|
12733
12810
|
},
|
|
@@ -12742,7 +12819,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
|
|
|
12742
12819
|
'& p': {
|
|
12743
12820
|
margin: 0,
|
|
12744
12821
|
fontSize: theme.typography.fontSize.body,
|
|
12745
|
-
color: '#ffffff',
|
|
12746
12822
|
lineHeight: 1.4
|
|
12747
12823
|
}
|
|
12748
12824
|
},
|