diy-template-components 5.1.2 → 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 +275 -201
- package/build/index.es.js.map +1 -1
- package/build/index.js +275 -201
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -9,6 +9,7 @@ var moment = require('moment');
|
|
|
9
9
|
var Countdown = require('react-countdown');
|
|
10
10
|
var koreanLocale = require('moment/locale/ko');
|
|
11
11
|
var ReactDOMServer = require('react-dom/server');
|
|
12
|
+
require('@storybook/theming');
|
|
12
13
|
var reactJss = require('react-jss');
|
|
13
14
|
|
|
14
15
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -2508,9 +2509,9 @@ const getBorderRadius = roundness => {
|
|
|
2508
2509
|
large: 24
|
|
2509
2510
|
},
|
|
2510
2511
|
pill: {
|
|
2511
|
-
small:
|
|
2512
|
-
regular:
|
|
2513
|
-
large:
|
|
2512
|
+
small: 32,
|
|
2513
|
+
regular: 32,
|
|
2514
|
+
large: 32
|
|
2514
2515
|
}
|
|
2515
2516
|
};
|
|
2516
2517
|
return mapping[roundness] || {
|
|
@@ -3224,7 +3225,8 @@ const useSectionStyles$9 = createUseStyles(theme => ({
|
|
|
3224
3225
|
width: '100%',
|
|
3225
3226
|
height: 'calc(100% - 100px)',
|
|
3226
3227
|
// objectFit: 'cover',
|
|
3227
|
-
objectPosition: '50% 50%'
|
|
3228
|
+
objectPosition: '50% 50%',
|
|
3229
|
+
borderRadius: theme?.shape?.borderRadius?.regular
|
|
3228
3230
|
},
|
|
3229
3231
|
absoluteButtonsBannerRight: {
|
|
3230
3232
|
display: 'flex',
|
|
@@ -4199,7 +4201,7 @@ const useSectionStyles$6 = createUseStyles(theme => {
|
|
|
4199
4201
|
flexDirection: 'column'
|
|
4200
4202
|
},
|
|
4201
4203
|
subTitleHeading: {
|
|
4202
|
-
color: theme?.
|
|
4204
|
+
color: theme?.colors?.font2,
|
|
4203
4205
|
marginBottom: '8px',
|
|
4204
4206
|
fontSize: theme.typography.fontSize.subHead,
|
|
4205
4207
|
wordBreak: 'break-word',
|
|
@@ -4208,14 +4210,14 @@ const useSectionStyles$6 = createUseStyles(theme => {
|
|
|
4208
4210
|
heading: {
|
|
4209
4211
|
margin: '0',
|
|
4210
4212
|
fontSize: theme.typography.fontSize.h1,
|
|
4211
|
-
color: theme?.
|
|
4213
|
+
color: theme?.colors?.font2,
|
|
4212
4214
|
wordBreak: ({
|
|
4213
4215
|
wordBreakValue
|
|
4214
4216
|
}) => wordBreakValue || 'break-word',
|
|
4215
4217
|
lineHeight: '80px'
|
|
4216
4218
|
},
|
|
4217
4219
|
description: {
|
|
4218
|
-
color: theme?.
|
|
4220
|
+
color: theme?.colors?.font2,
|
|
4219
4221
|
lineHeight: '32px',
|
|
4220
4222
|
fontWeight: '400',
|
|
4221
4223
|
wordBreak: 'break-word',
|
|
@@ -4490,7 +4492,8 @@ const useSectionStyles$5 = createUseStyles(theme => {
|
|
|
4490
4492
|
width: '100%',
|
|
4491
4493
|
position: 'relative',
|
|
4492
4494
|
zIndex: '2',
|
|
4493
|
-
objectFit: 'cover'
|
|
4495
|
+
objectFit: 'cover',
|
|
4496
|
+
borderRadius: theme?.shape?.borderRadius?.regular
|
|
4494
4497
|
},
|
|
4495
4498
|
textContainer: {
|
|
4496
4499
|
marginLeft: '72px',
|
|
@@ -5593,7 +5596,7 @@ const useVideoTestimonialStyles = createUseStyles(theme => {
|
|
|
5593
5596
|
display: 'flex',
|
|
5594
5597
|
alignItems: 'center',
|
|
5595
5598
|
// marginTop: '16px',
|
|
5596
|
-
borderRadius:
|
|
5599
|
+
borderRadius: theme?.shape?.borderRadius?.regular
|
|
5597
5600
|
},
|
|
5598
5601
|
iframeContainer: {
|
|
5599
5602
|
width: '100%',
|
|
@@ -6394,7 +6397,7 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
|
|
|
6394
6397
|
cursor: 'pointer'
|
|
6395
6398
|
},
|
|
6396
6399
|
singleCard: {
|
|
6397
|
-
borderRadius:
|
|
6400
|
+
borderRadius: theme?.shape?.borderRadius?.large,
|
|
6398
6401
|
margin: '0 1px',
|
|
6399
6402
|
width: 'calc(100% - 24px)',
|
|
6400
6403
|
position: 'relative',
|
|
@@ -6417,7 +6420,7 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
|
|
|
6417
6420
|
height: ({
|
|
6418
6421
|
cardsCount
|
|
6419
6422
|
}) => cardsCount === 1 ? '480px' : '100%',
|
|
6420
|
-
borderRadius:
|
|
6423
|
+
borderRadius: theme?.shape?.borderRadius?.large,
|
|
6421
6424
|
objectFit: 'cover',
|
|
6422
6425
|
objectPosition: 'center',
|
|
6423
6426
|
position: 'absolute',
|
|
@@ -6460,7 +6463,7 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
|
|
|
6460
6463
|
height: ({
|
|
6461
6464
|
cardsCount
|
|
6462
6465
|
}) => cardsCount === 1 ? '360px' : '',
|
|
6463
|
-
borderRadius:
|
|
6466
|
+
borderRadius: theme?.shape?.borderRadius?.regular
|
|
6464
6467
|
},
|
|
6465
6468
|
singleCard: {
|
|
6466
6469
|
width: ({
|
|
@@ -6609,7 +6612,7 @@ const useFaqListStyles = createUseStyles(theme => ({
|
|
|
6609
6612
|
},
|
|
6610
6613
|
container: {
|
|
6611
6614
|
boxShadow: theme?.shadows?.secondary,
|
|
6612
|
-
borderRadius:
|
|
6615
|
+
borderRadius: theme?.shape?.borderRadius?.regular,
|
|
6613
6616
|
backgroundColor: theme?.colors?.white
|
|
6614
6617
|
},
|
|
6615
6618
|
basicCardContainer: {
|
|
@@ -8282,7 +8285,7 @@ const useTeamStyles = createUseStyles(theme => {
|
|
|
8282
8285
|
height: '208px',
|
|
8283
8286
|
top: '0',
|
|
8284
8287
|
left: '0',
|
|
8285
|
-
borderRadius:
|
|
8288
|
+
borderRadius: `${theme?.shape?.borderRadius?.regular}px ${theme?.shape?.borderRadius?.regular}px 0 0`,
|
|
8286
8289
|
objectFit: 'cover'
|
|
8287
8290
|
},
|
|
8288
8291
|
teamDetailsContainer: {
|
|
@@ -11468,7 +11471,7 @@ const useAboutInstituteStyles = createUseStyles(theme => ({
|
|
|
11468
11471
|
image: {
|
|
11469
11472
|
width: '100%',
|
|
11470
11473
|
height: '100%',
|
|
11471
|
-
borderRadius:
|
|
11474
|
+
borderRadius: theme?.shape?.borderRadius?.large,
|
|
11472
11475
|
border: '1px solid var(--stroke, #D8E0F0)'
|
|
11473
11476
|
},
|
|
11474
11477
|
infoContainer: {
|
|
@@ -11476,7 +11479,7 @@ const useAboutInstituteStyles = createUseStyles(theme => ({
|
|
|
11476
11479
|
gap: '16px',
|
|
11477
11480
|
display: 'flex',
|
|
11478
11481
|
flexDirection: 'column',
|
|
11479
|
-
borderRadius:
|
|
11482
|
+
borderRadius: theme?.shape?.borderRadius?.large,
|
|
11480
11483
|
background: 'var(--Blue-Tertiary, #F4F9FF)',
|
|
11481
11484
|
flex: 1
|
|
11482
11485
|
},
|
|
@@ -11510,7 +11513,7 @@ const useAboutInstituteStyles = createUseStyles(theme => ({
|
|
|
11510
11513
|
display: 'flex',
|
|
11511
11514
|
justifyContent: 'space-between',
|
|
11512
11515
|
alignItems: 'center',
|
|
11513
|
-
borderRadius:
|
|
11516
|
+
borderRadius: theme?.shape?.borderRadius?.large,
|
|
11514
11517
|
background: 'var(--Blue-Tertiary, #F4F9FF)',
|
|
11515
11518
|
flexGrow: 1
|
|
11516
11519
|
},
|
|
@@ -11570,7 +11573,7 @@ const useAboutInstituteStyles = createUseStyles(theme => ({
|
|
|
11570
11573
|
width: '150px'
|
|
11571
11574
|
},
|
|
11572
11575
|
image: {
|
|
11573
|
-
borderRadius:
|
|
11576
|
+
borderRadius: theme?.shape?.borderRadius?.regular,
|
|
11574
11577
|
border: '1px solid var(--stroke, #D8E0F0)'
|
|
11575
11578
|
},
|
|
11576
11579
|
infoContainer: {
|
|
@@ -11792,14 +11795,13 @@ const useCounterSectionStyles = createUseStyles(theme => {
|
|
|
11792
11795
|
return {
|
|
11793
11796
|
section: {
|
|
11794
11797
|
width: '100%',
|
|
11795
|
-
borderRadius: theme.shape?.borderRadius?.regular || '12px',
|
|
11796
11798
|
overflow: 'hidden',
|
|
11797
11799
|
backgroundImage: ({
|
|
11798
11800
|
backgroundImage
|
|
11799
11801
|
} = {}) => backgroundImage ? `url("${backgroundImage}")` : 'none',
|
|
11800
11802
|
backgroundColor: ({
|
|
11801
11803
|
backgroundColor
|
|
11802
|
-
} = {}) => backgroundColor ||
|
|
11804
|
+
} = {}) => backgroundColor || theme?.colors?.background2,
|
|
11803
11805
|
backgroundSize: 'cover',
|
|
11804
11806
|
backgroundPosition: 'center',
|
|
11805
11807
|
backgroundRepeat: 'no-repeat',
|
|
@@ -11820,7 +11822,8 @@ const useCounterSectionStyles = createUseStyles(theme => {
|
|
|
11820
11822
|
},
|
|
11821
11823
|
grid: {
|
|
11822
11824
|
display: 'grid',
|
|
11823
|
-
gridTemplateColumns: 'repeat(
|
|
11825
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))',
|
|
11826
|
+
// fits 4 columns in desktop
|
|
11824
11827
|
gap: ({
|
|
11825
11828
|
isMobile
|
|
11826
11829
|
} = {}) => isMobile ? '24px' : '32px',
|
|
@@ -11839,7 +11842,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
|
|
|
11839
11842
|
fontSize: '64px',
|
|
11840
11843
|
fontWeight: theme.typography?.fontWeight?.bold,
|
|
11841
11844
|
lineHeight: 1.1,
|
|
11842
|
-
color:
|
|
11845
|
+
color: theme?.colors?.AccentColor,
|
|
11843
11846
|
wordBreak: 'break-word'
|
|
11844
11847
|
},
|
|
11845
11848
|
description: {
|
|
@@ -11847,7 +11850,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
|
|
|
11847
11850
|
fontSize: '20px',
|
|
11848
11851
|
lineHeight: 1.4,
|
|
11849
11852
|
fontWeight: '700',
|
|
11850
|
-
color:
|
|
11853
|
+
color: theme?.colors?.font3,
|
|
11851
11854
|
wordBreak: 'break-word'
|
|
11852
11855
|
},
|
|
11853
11856
|
'@media (max-width: 1024px)': {
|
|
@@ -11857,9 +11860,6 @@ const useCounterSectionStyles = createUseStyles(theme => {
|
|
|
11857
11860
|
}
|
|
11858
11861
|
},
|
|
11859
11862
|
'@media (max-width: 767px)': {
|
|
11860
|
-
section: {
|
|
11861
|
-
borderRadius: theme.shape?.borderRadius?.small || '8px'
|
|
11862
|
-
},
|
|
11863
11863
|
container: {
|
|
11864
11864
|
padding: `${theme.spacing.padding.regular}px ${theme.spacing.padding.tiny}px`
|
|
11865
11865
|
},
|
|
@@ -11880,6 +11880,83 @@ const useCounterSectionStyles = createUseStyles(theme => {
|
|
|
11880
11880
|
};
|
|
11881
11881
|
});
|
|
11882
11882
|
|
|
11883
|
+
const DURATION_MS = 2000;
|
|
11884
|
+
const EASING = t => 1 - Math.pow(1 - t, 3); // easeOutCubic
|
|
11885
|
+
|
|
11886
|
+
function parseCounterValue(value) {
|
|
11887
|
+
if (value == null || value === '') return null;
|
|
11888
|
+
const match = String(value).trim().match(/^([\d.]+)(.*)$/);
|
|
11889
|
+
if (!match) return null;
|
|
11890
|
+
const num = parseFloat(match[1]);
|
|
11891
|
+
if (Number.isNaN(num)) return null;
|
|
11892
|
+
return {
|
|
11893
|
+
end: num,
|
|
11894
|
+
suffix: match[2] || ''
|
|
11895
|
+
};
|
|
11896
|
+
}
|
|
11897
|
+
function AnimatedCounter({
|
|
11898
|
+
value,
|
|
11899
|
+
className,
|
|
11900
|
+
refSetter
|
|
11901
|
+
}) {
|
|
11902
|
+
const elRef = React.useRef(null);
|
|
11903
|
+
const rafIdRef = React.useRef(null);
|
|
11904
|
+
const hasAnimatedRef = React.useRef(false);
|
|
11905
|
+
React.useLayoutEffect(() => {
|
|
11906
|
+
hasAnimatedRef.current = false; // Reset so we can re-animate when value changes (e.g. live edit)
|
|
11907
|
+
const parsed = parseCounterValue(value);
|
|
11908
|
+
if (!parsed || !elRef.current) return;
|
|
11909
|
+
const observer = new IntersectionObserver(entries => {
|
|
11910
|
+
const [entry] = entries;
|
|
11911
|
+
if (!entry.isIntersecting || hasAnimatedRef.current) return;
|
|
11912
|
+
hasAnimatedRef.current = true;
|
|
11913
|
+
const startTime = performance.now();
|
|
11914
|
+
const {
|
|
11915
|
+
end,
|
|
11916
|
+
suffix
|
|
11917
|
+
} = parsed;
|
|
11918
|
+
const tick = now => {
|
|
11919
|
+
const elapsed = now - startTime;
|
|
11920
|
+
const progress = Math.min(elapsed / DURATION_MS, 1);
|
|
11921
|
+
const eased = EASING(progress);
|
|
11922
|
+
const current = eased * end;
|
|
11923
|
+
if (elRef.current) {
|
|
11924
|
+
const displayValue = Number.isInteger(end) ? Math.round(current) : parseFloat(current.toFixed(2));
|
|
11925
|
+
elRef.current.textContent = displayValue + suffix;
|
|
11926
|
+
}
|
|
11927
|
+
if (progress < 1) {
|
|
11928
|
+
rafIdRef.current = requestAnimationFrame(tick);
|
|
11929
|
+
}
|
|
11930
|
+
};
|
|
11931
|
+
rafIdRef.current = requestAnimationFrame(tick);
|
|
11932
|
+
}, {
|
|
11933
|
+
threshold: 0.2
|
|
11934
|
+
});
|
|
11935
|
+
observer.observe(elRef.current);
|
|
11936
|
+
return () => {
|
|
11937
|
+
observer.disconnect();
|
|
11938
|
+
if (rafIdRef.current) cancelAnimationFrame(rafIdRef.current);
|
|
11939
|
+
};
|
|
11940
|
+
}, [value]);
|
|
11941
|
+
const parsed = parseCounterValue(value);
|
|
11942
|
+
const setRef = el => {
|
|
11943
|
+
elRef.current = el;
|
|
11944
|
+
refSetter?.(el);
|
|
11945
|
+
};
|
|
11946
|
+
if (parsed) {
|
|
11947
|
+
return /*#__PURE__*/React__default["default"].createElement("h2", {
|
|
11948
|
+
ref: setRef,
|
|
11949
|
+
className: className
|
|
11950
|
+
}, "0", parsed.suffix);
|
|
11951
|
+
}
|
|
11952
|
+
return /*#__PURE__*/React__default["default"].createElement("h2", {
|
|
11953
|
+
ref: refSetter,
|
|
11954
|
+
className: className,
|
|
11955
|
+
dangerouslySetInnerHTML: {
|
|
11956
|
+
__html: value
|
|
11957
|
+
}
|
|
11958
|
+
});
|
|
11959
|
+
}
|
|
11883
11960
|
function CounterSection({
|
|
11884
11961
|
sectionData,
|
|
11885
11962
|
sectionIndex
|
|
@@ -11890,44 +11967,49 @@ function CounterSection({
|
|
|
11890
11967
|
},
|
|
11891
11968
|
isMobile
|
|
11892
11969
|
} = React.useContext(PageContext);
|
|
11893
|
-
console.log('llll', sectionData);
|
|
11894
|
-
sectionData.components = sectionData.components;
|
|
11895
11970
|
const metadata = sectionData.metadata || {};
|
|
11896
11971
|
const backgroundImage = metadata.backgroundImage || '';
|
|
11897
|
-
const backgroundColor = metadata.backgroundColor
|
|
11972
|
+
const backgroundColor = metadata.backgroundColor;
|
|
11898
11973
|
const classes = useCounterSectionStyles({
|
|
11899
11974
|
containerWidth,
|
|
11900
11975
|
isMobile,
|
|
11901
11976
|
backgroundImage: backgroundImage || null,
|
|
11902
11977
|
backgroundColor
|
|
11903
11978
|
});
|
|
11904
|
-
const cardData = sectionData?.components[0];
|
|
11905
|
-
const [sectionComponent] = sectionData
|
|
11979
|
+
const cardData = sectionData?.components?.[0];
|
|
11980
|
+
const [sectionComponent] = sectionData?.components || [];
|
|
11906
11981
|
const counterSection = sectionComponent?.counterSection;
|
|
11907
|
-
counterSection?.components || [];
|
|
11982
|
+
const counters = counterSection?.components || [];
|
|
11983
|
+
const items = cardData?.contentList?.components || counters;
|
|
11908
11984
|
if (!cardData) return null;
|
|
11985
|
+
const getValue = item => item?.contentHeading?.metadata?.value ?? item?.value?.metadata?.value;
|
|
11986
|
+
const getDescription = item => item?.contentPara?.metadata?.value ?? item?.description?.metadata?.value;
|
|
11987
|
+
const getValueRefSetter = item => item?.contentHeading?.refSetter ?? item?.value?.refSetter;
|
|
11988
|
+
const getDescRefSetter = item => item?.contentPara?.refSetter ?? item?.description?.refSetter;
|
|
11909
11989
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
11910
11990
|
className: classes.section
|
|
11911
11991
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
11912
11992
|
className: classes.container
|
|
11913
11993
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
11914
11994
|
className: classes.grid
|
|
11915
|
-
},
|
|
11916
|
-
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
|
|
11920
|
-
|
|
11921
|
-
|
|
11922
|
-
|
|
11923
|
-
|
|
11924
|
-
|
|
11925
|
-
|
|
11926
|
-
|
|
11927
|
-
|
|
11928
|
-
|
|
11929
|
-
|
|
11930
|
-
|
|
11995
|
+
}, items?.map((item, index) => {
|
|
11996
|
+
const value = getValue(item);
|
|
11997
|
+
const description = getDescription(item);
|
|
11998
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
11999
|
+
key: item._id || index,
|
|
12000
|
+
className: classes.counterItem
|
|
12001
|
+
}, value != null && value !== '' && /*#__PURE__*/React__default["default"].createElement(AnimatedCounter, {
|
|
12002
|
+
value: value,
|
|
12003
|
+
className: classes.value,
|
|
12004
|
+
refSetter: getValueRefSetter(item)
|
|
12005
|
+
}), description != null && description !== '' && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
12006
|
+
ref: getDescRefSetter(item),
|
|
12007
|
+
className: classes.description,
|
|
12008
|
+
dangerouslySetInnerHTML: {
|
|
12009
|
+
__html: description
|
|
12010
|
+
}
|
|
12011
|
+
}));
|
|
12012
|
+
}))));
|
|
11931
12013
|
}
|
|
11932
12014
|
|
|
11933
12015
|
var index$5 = /*#__PURE__*/Object.freeze({
|
|
@@ -11944,12 +12026,13 @@ const BREAKPOINTS = {
|
|
|
11944
12026
|
/**
|
|
11945
12027
|
* Get current breakpoint from window width
|
|
11946
12028
|
*/
|
|
11947
|
-
const getBreakpoint = width => {
|
|
12029
|
+
const getBreakpoint = (width, isMobile) => {
|
|
12030
|
+
if (isMobile) return 'mobile';
|
|
11948
12031
|
if (width >= BREAKPOINTS.desktop) return 'desktop';
|
|
11949
12032
|
if (width >= BREAKPOINTS.tablet) return 'tablet';
|
|
11950
12033
|
return 'mobile';
|
|
11951
12034
|
};
|
|
11952
|
-
const
|
|
12035
|
+
const getStickyBarBase = theme => ({
|
|
11953
12036
|
position: 'fixed',
|
|
11954
12037
|
left: 0,
|
|
11955
12038
|
right: 0,
|
|
@@ -11958,100 +12041,86 @@ const stickyBarBase = {
|
|
|
11958
12041
|
display: 'flex',
|
|
11959
12042
|
alignItems: 'center',
|
|
11960
12043
|
justifyContent: 'center',
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
}
|
|
11965
|
-
|
|
11966
|
-
|
|
11967
|
-
|
|
11968
|
-
|
|
11969
|
-
|
|
11970
|
-
|
|
11971
|
-
|
|
11972
|
-
|
|
11973
|
-
|
|
11974
|
-
|
|
11975
|
-
|
|
11976
|
-
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
|
|
11980
|
-
|
|
11981
|
-
|
|
11982
|
-
|
|
11983
|
-
|
|
11984
|
-
|
|
11985
|
-
|
|
11986
|
-
|
|
12044
|
+
fontFamily: theme?.typography?.fontFamily,
|
|
12045
|
+
backgroundColor: theme?.colors?.ctaColor || '#FFFFFF',
|
|
12046
|
+
boxShadow: theme?.shadows?.secondary ?? '0 -2px 8px rgba(0, 0, 0, 0.06)',
|
|
12047
|
+
borderTop: `1px solid ${theme?.colors?.border2}`
|
|
12048
|
+
});
|
|
12049
|
+
const getStickyBarResponsive = (theme, bgColor) => {
|
|
12050
|
+
const base = getStickyBarBase(theme);
|
|
12051
|
+
return {
|
|
12052
|
+
mobile: {
|
|
12053
|
+
...base,
|
|
12054
|
+
padding: '12px 16px',
|
|
12055
|
+
gap: '12px',
|
|
12056
|
+
flexDirection: 'column',
|
|
12057
|
+
alignItems: 'stretch',
|
|
12058
|
+
background: '#FFFFFF',
|
|
12059
|
+
color: theme?.colors?.CtaTextColor || 'white'
|
|
12060
|
+
},
|
|
12061
|
+
tablet: {
|
|
12062
|
+
...base,
|
|
12063
|
+
padding: '14px 24px',
|
|
12064
|
+
gap: '16px',
|
|
12065
|
+
flexDirection: 'row',
|
|
12066
|
+
alignItems: 'center',
|
|
12067
|
+
background: '#FFFFFF',
|
|
12068
|
+
color: theme?.colors?.CtaTextColor || 'white'
|
|
12069
|
+
},
|
|
12070
|
+
desktop: {
|
|
12071
|
+
...base,
|
|
12072
|
+
padding: '16px 32px',
|
|
12073
|
+
gap: '24px',
|
|
12074
|
+
flexDirection: 'row',
|
|
12075
|
+
alignItems: 'center',
|
|
12076
|
+
background: '#FFFFFF',
|
|
12077
|
+
color: theme?.colors?.CtaTextColor || 'white'
|
|
12078
|
+
}
|
|
12079
|
+
};
|
|
11987
12080
|
};
|
|
11988
|
-
const getStickyBarStyle = breakpoint =>
|
|
11989
|
-
const
|
|
11990
|
-
color:
|
|
11991
|
-
fontFamily:
|
|
12081
|
+
const getStickyBarStyle = (breakpoint, theme = {}, bgColor) => getStickyBarResponsive(theme)[breakpoint] || getStickyBarResponsive(theme).mobile;
|
|
12082
|
+
const getStickyTextBase = theme => ({
|
|
12083
|
+
color: theme?.colors?.font2,
|
|
12084
|
+
fontFamily: theme?.typography?.fontFamily ?? 'inherit',
|
|
11992
12085
|
margin: 0
|
|
12086
|
+
});
|
|
12087
|
+
const getStickyTextResponsive = (theme, bgColor) => {
|
|
12088
|
+
const base = getStickyTextBase(theme);
|
|
12089
|
+
return {
|
|
12090
|
+
mobile: {
|
|
12091
|
+
...base,
|
|
12092
|
+
fontSize: '13px',
|
|
12093
|
+
lineHeight: 1.4,
|
|
12094
|
+
textAlign: 'center',
|
|
12095
|
+
color: '#000000' ,
|
|
12096
|
+
background: '#FFFFFF'
|
|
12097
|
+
},
|
|
12098
|
+
tablet: {
|
|
12099
|
+
...base,
|
|
12100
|
+
fontSize: '14px',
|
|
12101
|
+
lineHeight: 1.45,
|
|
12102
|
+
textAlign: 'left',
|
|
12103
|
+
color: '#000000' ,
|
|
12104
|
+
background: '#FFFFFF'
|
|
12105
|
+
},
|
|
12106
|
+
desktop: {
|
|
12107
|
+
...base,
|
|
12108
|
+
fontSize: '15px',
|
|
12109
|
+
lineHeight: 1.5,
|
|
12110
|
+
textAlign: 'left',
|
|
12111
|
+
color: '#000000' ,
|
|
12112
|
+
background: '#FFFFFF'
|
|
12113
|
+
}
|
|
12114
|
+
};
|
|
11993
12115
|
};
|
|
11994
|
-
const
|
|
11995
|
-
mobile: {
|
|
11996
|
-
...stickyTextBase,
|
|
11997
|
-
fontSize: '13px',
|
|
11998
|
-
lineHeight: 1.4,
|
|
11999
|
-
textAlign: 'center'
|
|
12000
|
-
},
|
|
12001
|
-
tablet: {
|
|
12002
|
-
...stickyTextBase,
|
|
12003
|
-
fontSize: '14px',
|
|
12004
|
-
lineHeight: 1.45,
|
|
12005
|
-
textAlign: 'left'
|
|
12006
|
-
},
|
|
12007
|
-
desktop: {
|
|
12008
|
-
...stickyTextBase,
|
|
12009
|
-
fontSize: '15px',
|
|
12010
|
-
lineHeight: 1.5,
|
|
12011
|
-
textAlign: 'left'
|
|
12012
|
-
}
|
|
12013
|
-
};
|
|
12014
|
-
const getStickyTextStyle = breakpoint => stickyTextResponsive[breakpoint] || stickyTextResponsive.mobile;
|
|
12015
|
-
const stickyButtonBase = {
|
|
12016
|
-
backgroundColor: '#3366FF',
|
|
12017
|
-
color: '#FFFFFF',
|
|
12018
|
-
border: 'none',
|
|
12019
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
12020
|
-
fontWeight: 600,
|
|
12021
|
-
textTransform: 'uppercase',
|
|
12022
|
-
letterSpacing: '0.02em',
|
|
12023
|
-
cursor: 'pointer',
|
|
12024
|
-
whiteSpace: 'nowrap',
|
|
12025
|
-
flexShrink: 0
|
|
12026
|
-
};
|
|
12027
|
-
const stickyButtonResponsive = {
|
|
12028
|
-
mobile: {
|
|
12029
|
-
...stickyButtonBase,
|
|
12030
|
-
padding: '10px 20px',
|
|
12031
|
-
fontSize: '12px',
|
|
12032
|
-
borderRadius: '6px'
|
|
12033
|
-
},
|
|
12034
|
-
tablet: {
|
|
12035
|
-
...stickyButtonBase,
|
|
12036
|
-
padding: '12px 24px',
|
|
12037
|
-
fontSize: '13px',
|
|
12038
|
-
borderRadius: '8px'
|
|
12039
|
-
},
|
|
12040
|
-
desktop: {
|
|
12041
|
-
...stickyButtonBase,
|
|
12042
|
-
padding: '14px 28px',
|
|
12043
|
-
fontSize: '14px',
|
|
12044
|
-
borderRadius: '8px'
|
|
12045
|
-
}
|
|
12046
|
-
};
|
|
12047
|
-
const getStickyButtonStyle = breakpoint => stickyButtonResponsive[breakpoint] || stickyButtonResponsive.mobile;
|
|
12116
|
+
const getStickyTextStyle = (breakpoint, theme = {}) => getStickyTextResponsive(theme)[breakpoint] || getStickyTextResponsive(theme).mobile;
|
|
12048
12117
|
|
|
12049
12118
|
// --- Floating (WhatsApp) type ---
|
|
12050
12119
|
|
|
12051
|
-
const
|
|
12120
|
+
const getFloatingButtonBase = theme => ({
|
|
12052
12121
|
position: 'fixed',
|
|
12053
12122
|
bottom: 24,
|
|
12054
|
-
right:
|
|
12123
|
+
right: 9,
|
|
12055
12124
|
width: 'fit-content',
|
|
12056
12125
|
marginLeft: 'auto',
|
|
12057
12126
|
zIndex: 9999,
|
|
@@ -12059,47 +12128,50 @@ const floatingButtonBase = {
|
|
|
12059
12128
|
alignItems: 'center',
|
|
12060
12129
|
gap: '10px',
|
|
12061
12130
|
padding: '12px 20px',
|
|
12062
|
-
backgroundColor: '#FFFFFF',
|
|
12063
|
-
border:
|
|
12131
|
+
backgroundColor: theme?.colors?.ctaColor || '#FFFFFF',
|
|
12132
|
+
border: `1px solid ${theme?.palette?.border?.secondary ?? '#E5E7EB'}`,
|
|
12064
12133
|
borderRadius: '9999px',
|
|
12065
|
-
boxShadow: '0 4px 12px rgba(0, 0, 0, 0.1)',
|
|
12134
|
+
boxShadow: theme?.shadows?.primary ?? '0 4px 12px rgba(0, 0, 0, 0.1)',
|
|
12066
12135
|
cursor: 'pointer',
|
|
12067
12136
|
textDecoration: 'none',
|
|
12068
|
-
fontFamily:
|
|
12069
|
-
fontWeight: 700,
|
|
12137
|
+
fontFamily: theme?.typography?.fontFamily ?? 'inherit',
|
|
12138
|
+
fontWeight: theme?.typography?.fontWeight?.bold ?? 700,
|
|
12070
12139
|
fontSize: '14px',
|
|
12071
12140
|
textTransform: 'uppercase',
|
|
12072
12141
|
letterSpacing: '0.02em',
|
|
12073
|
-
color: '
|
|
12142
|
+
color: theme?.colors?.CtaTextColor || 'white',
|
|
12074
12143
|
transition: 'box-shadow 0.2s ease, transform 0.2s ease'
|
|
12144
|
+
});
|
|
12145
|
+
const getFloatingButtonResponsive = theme => {
|
|
12146
|
+
const base = getFloatingButtonBase(theme);
|
|
12147
|
+
return {
|
|
12148
|
+
mobile: {
|
|
12149
|
+
...base,
|
|
12150
|
+
bottom: 142,
|
|
12151
|
+
left: 16,
|
|
12152
|
+
padding: '10px 16px',
|
|
12153
|
+
gap: '8px',
|
|
12154
|
+
fontSize: '12px'
|
|
12155
|
+
},
|
|
12156
|
+
tablet: {
|
|
12157
|
+
...base,
|
|
12158
|
+
bottom: 20,
|
|
12159
|
+
left: 20,
|
|
12160
|
+
padding: '12px 18px',
|
|
12161
|
+
gap: '10px',
|
|
12162
|
+
fontSize: '13px'
|
|
12163
|
+
},
|
|
12164
|
+
desktop: {
|
|
12165
|
+
...base,
|
|
12166
|
+
bottom: 24,
|
|
12167
|
+
left: 24,
|
|
12168
|
+
padding: '12px 20px',
|
|
12169
|
+
gap: '10px',
|
|
12170
|
+
fontSize: '14px'
|
|
12171
|
+
}
|
|
12172
|
+
};
|
|
12075
12173
|
};
|
|
12076
|
-
const
|
|
12077
|
-
mobile: {
|
|
12078
|
-
...floatingButtonBase,
|
|
12079
|
-
bottom: 16,
|
|
12080
|
-
left: 16,
|
|
12081
|
-
padding: '10px 16px',
|
|
12082
|
-
gap: '8px',
|
|
12083
|
-
fontSize: '12px'
|
|
12084
|
-
},
|
|
12085
|
-
tablet: {
|
|
12086
|
-
...floatingButtonBase,
|
|
12087
|
-
bottom: 20,
|
|
12088
|
-
left: 20,
|
|
12089
|
-
padding: '12px 18px',
|
|
12090
|
-
gap: '10px',
|
|
12091
|
-
fontSize: '13px'
|
|
12092
|
-
},
|
|
12093
|
-
desktop: {
|
|
12094
|
-
...floatingButtonBase,
|
|
12095
|
-
bottom: 24,
|
|
12096
|
-
left: 24,
|
|
12097
|
-
padding: '12px 20px',
|
|
12098
|
-
gap: '10px',
|
|
12099
|
-
fontSize: '14px'
|
|
12100
|
-
}
|
|
12101
|
-
};
|
|
12102
|
-
const getFloatingButtonStyle = breakpoint => floatingButtonResponsive[breakpoint] || floatingButtonResponsive.mobile;
|
|
12174
|
+
const getFloatingButtonStyle = (breakpoint, theme = {}) => getFloatingButtonResponsive(theme)[breakpoint] || getFloatingButtonResponsive(theme).mobile;
|
|
12103
12175
|
const whatsAppIconSvgSize = {
|
|
12104
12176
|
mobile: 24,
|
|
12105
12177
|
tablet: 26,
|
|
@@ -12187,12 +12259,17 @@ function StickyCta({
|
|
|
12187
12259
|
whatsAppLabel = 'SUPPORT',
|
|
12188
12260
|
whatsAppIconColor,
|
|
12189
12261
|
whatsAppButtonBackgroundColor,
|
|
12190
|
-
iconImageUrl
|
|
12262
|
+
iconImageUrl,
|
|
12263
|
+
nodeData,
|
|
12264
|
+
extraProps
|
|
12191
12265
|
}) {
|
|
12192
|
-
|
|
12266
|
+
const {
|
|
12267
|
+
isMobile
|
|
12268
|
+
} = React.useContext(PageContext);
|
|
12193
12269
|
const node = sectionData?.components?.[0];
|
|
12194
12270
|
const contentList = node?.contentList?.components || [];
|
|
12195
12271
|
const showEditHint = sectionData?.isDefaultEditor ?? false;
|
|
12272
|
+
sectionData?.bgSection?.components?.[0]?.sectionBgData?.metadata?.value;
|
|
12196
12273
|
const propsFromSection = node ? {
|
|
12197
12274
|
type: node?.title?.metadata?.value ?? type,
|
|
12198
12275
|
stickyMessage: contentList[1]?.contentPara?.metadata?.value ?? stickyMessage,
|
|
@@ -12215,8 +12292,9 @@ function StickyCta({
|
|
|
12215
12292
|
whatsAppButtonBackgroundColor,
|
|
12216
12293
|
iconImageUrl
|
|
12217
12294
|
};
|
|
12218
|
-
const whatsAppUrl = p?.whatsAppPhoneNumber
|
|
12219
|
-
const
|
|
12295
|
+
const whatsAppUrl = buildWhatsAppUrl(p?.whatsAppPhoneNumber) ?? p?.whatsAppHref ?? '#';
|
|
12296
|
+
const theme = useTheme() || {};
|
|
12297
|
+
const [breakpoint, setBreakpoint] = React.useState(() => typeof window !== 'undefined' ? getBreakpoint(window.innerWidth, isMobile) : 'mobile');
|
|
12220
12298
|
React.useEffect(() => {
|
|
12221
12299
|
if (typeof window === 'undefined') return;
|
|
12222
12300
|
const onResize = () => setBreakpoint(getBreakpoint(window.innerWidth));
|
|
@@ -12245,14 +12323,14 @@ function StickyCta({
|
|
|
12245
12323
|
}, "Click on edit button to edit this section")) : null;
|
|
12246
12324
|
if (p.type === 'floating') {
|
|
12247
12325
|
const buttonStyle = {
|
|
12248
|
-
...getFloatingButtonStyle(breakpoint),
|
|
12326
|
+
...getFloatingButtonStyle(breakpoint, theme),
|
|
12249
12327
|
...(p.whatsAppButtonBackgroundColor != null && {
|
|
12250
12328
|
backgroundColor: p.whatsAppButtonBackgroundColor
|
|
12251
12329
|
})
|
|
12252
12330
|
};
|
|
12253
12331
|
const iconSize = getWhatsAppIconSize(breakpoint);
|
|
12254
12332
|
const iconColor = p.whatsAppIconColor ?? DEFAULT_WHATSAPP_ICON_COLOR;
|
|
12255
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, editHintBlock, /*#__PURE__*/React__default["default"].createElement("a", {
|
|
12333
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isMobile ? null : editHintBlock, /*#__PURE__*/React__default["default"].createElement("a", {
|
|
12256
12334
|
href: whatsAppUrl,
|
|
12257
12335
|
target: "_blank",
|
|
12258
12336
|
rel: "noopener noreferrer",
|
|
@@ -12274,28 +12352,29 @@ function StickyCta({
|
|
|
12274
12352
|
}), /*#__PURE__*/React__default["default"].createElement("span", null, p.whatsAppLabel)));
|
|
12275
12353
|
}
|
|
12276
12354
|
|
|
12277
|
-
// type === 'sticky' –
|
|
12278
|
-
const barStyle = getStickyBarStyle(breakpoint);
|
|
12279
|
-
const textStyle = getStickyTextStyle(breakpoint);
|
|
12280
|
-
|
|
12281
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, editHintBlock, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
12355
|
+
// type === 'sticky' – use primary Button (same as other sections) linking to WhatsApp
|
|
12356
|
+
const barStyle = getStickyBarStyle(breakpoint, theme);
|
|
12357
|
+
const textStyle = getStickyTextStyle(breakpoint, theme);
|
|
12358
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isMobile ? null : editHintBlock, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
12282
12359
|
style: barStyle,
|
|
12283
|
-
role: "banner"
|
|
12360
|
+
role: "banner",
|
|
12361
|
+
"access-cta-sticky": "DIY"
|
|
12284
12362
|
}, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
12285
12363
|
style: textStyle
|
|
12286
|
-
}, p.stickyMessage), /*#__PURE__*/React__default["default"].createElement(
|
|
12287
|
-
|
|
12288
|
-
|
|
12289
|
-
|
|
12290
|
-
|
|
12291
|
-
|
|
12292
|
-
|
|
12293
|
-
|
|
12294
|
-
|
|
12295
|
-
|
|
12296
|
-
|
|
12297
|
-
|
|
12298
|
-
|
|
12364
|
+
}, p.stickyMessage), /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
12365
|
+
data: {
|
|
12366
|
+
isLink: 1,
|
|
12367
|
+
isExternal: 1,
|
|
12368
|
+
link: whatsAppUrl,
|
|
12369
|
+
value: p.stickyButtonText
|
|
12370
|
+
},
|
|
12371
|
+
type: "primary",
|
|
12372
|
+
styling: {
|
|
12373
|
+
background: theme?.colors?.ctaColor
|
|
12374
|
+
},
|
|
12375
|
+
size: breakpoint === 'mobile' ? 'small' : 'medium',
|
|
12376
|
+
"access-cta-container": "DIY"
|
|
12377
|
+
})));
|
|
12299
12378
|
}
|
|
12300
12379
|
|
|
12301
12380
|
var index$4 = /*#__PURE__*/Object.freeze({
|
|
@@ -12640,7 +12719,8 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
|
|
|
12640
12719
|
return {
|
|
12641
12720
|
section: {
|
|
12642
12721
|
width: '100%',
|
|
12643
|
-
background:
|
|
12722
|
+
background: theme?.colors?.background2,
|
|
12723
|
+
color: theme?.colors?.font3,
|
|
12644
12724
|
minHeight: '100%',
|
|
12645
12725
|
'&, & *, & *:before, & *:after': {
|
|
12646
12726
|
fontFamily: theme?.typography?.fontFamily,
|
|
@@ -12680,7 +12760,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
|
|
|
12680
12760
|
lineHeight: 1.25,
|
|
12681
12761
|
letterSpacing: '3px',
|
|
12682
12762
|
textTransform: 'uppercase',
|
|
12683
|
-
color: theme.palette?.font?.invertedDefault || 'rgba(255,255,255,0.9)',
|
|
12684
12763
|
wordBreak: 'break-word',
|
|
12685
12764
|
fontWeight: theme.typography?.fontWeight?.regular
|
|
12686
12765
|
},
|
|
@@ -12689,15 +12768,12 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
|
|
|
12689
12768
|
fontSize: theme.typography.fontSize.h2,
|
|
12690
12769
|
lineHeight: 1.1,
|
|
12691
12770
|
letterSpacing: '-1px',
|
|
12692
|
-
fontWeight: theme.typography?.fontWeight?.bold,
|
|
12693
|
-
color: theme.palette?.font?.invertedDefault || '#ffffff',
|
|
12694
12771
|
wordBreak: 'break-word'
|
|
12695
12772
|
},
|
|
12696
12773
|
subHeading: {
|
|
12697
12774
|
margin: 0,
|
|
12698
12775
|
fontSize: theme.typography.fontSize.body,
|
|
12699
12776
|
lineHeight: 1.5,
|
|
12700
|
-
color: theme.palette?.font?.invertedDefault || 'rgba(255,255,255,0.95)',
|
|
12701
12777
|
wordBreak: 'break-word',
|
|
12702
12778
|
maxWidth: '600px'
|
|
12703
12779
|
},
|
|
@@ -12743,7 +12819,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
|
|
|
12743
12819
|
margin: 0,
|
|
12744
12820
|
fontSize: theme.typography.fontSize.body,
|
|
12745
12821
|
fontWeight: theme.typography?.fontWeight?.semiBold,
|
|
12746
|
-
color: '#ffffff',
|
|
12747
12822
|
lineHeight: 1.3
|
|
12748
12823
|
}
|
|
12749
12824
|
},
|
|
@@ -12758,7 +12833,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
|
|
|
12758
12833
|
'& p': {
|
|
12759
12834
|
margin: 0,
|
|
12760
12835
|
fontSize: theme.typography.fontSize.body,
|
|
12761
|
-
color: '#ffffff',
|
|
12762
12836
|
lineHeight: 1.4
|
|
12763
12837
|
}
|
|
12764
12838
|
},
|