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 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) {
@@ -2494,9 +2495,9 @@ const getBorderRadius = roundness => {
2494
2495
  large: 24
2495
2496
  },
2496
2497
  pill: {
2497
- small: 9999,
2498
- regular: 9999,
2499
- large: 9999
2498
+ small: 32,
2499
+ regular: 32,
2500
+ large: 32
2500
2501
  }
2501
2502
  };
2502
2503
  return mapping[roundness] || {
@@ -3210,7 +3211,8 @@ const useSectionStyles$9 = createUseStyles(theme => ({
3210
3211
  width: '100%',
3211
3212
  height: 'calc(100% - 100px)',
3212
3213
  // objectFit: 'cover',
3213
- objectPosition: '50% 50%'
3214
+ objectPosition: '50% 50%',
3215
+ borderRadius: theme?.shape?.borderRadius?.regular
3214
3216
  },
3215
3217
  absoluteButtonsBannerRight: {
3216
3218
  display: 'flex',
@@ -4185,7 +4187,7 @@ const useSectionStyles$6 = createUseStyles(theme => {
4185
4187
  flexDirection: 'column'
4186
4188
  },
4187
4189
  subTitleHeading: {
4188
- color: theme?.palette?.font?.invertedDefault,
4190
+ color: theme?.colors?.font2,
4189
4191
  marginBottom: '8px',
4190
4192
  fontSize: theme.typography.fontSize.subHead,
4191
4193
  wordBreak: 'break-word',
@@ -4194,14 +4196,14 @@ const useSectionStyles$6 = createUseStyles(theme => {
4194
4196
  heading: {
4195
4197
  margin: '0',
4196
4198
  fontSize: theme.typography.fontSize.h1,
4197
- color: theme?.palette?.font?.invertedDefault,
4199
+ color: theme?.colors?.font2,
4198
4200
  wordBreak: ({
4199
4201
  wordBreakValue
4200
4202
  }) => wordBreakValue || 'break-word',
4201
4203
  lineHeight: '80px'
4202
4204
  },
4203
4205
  description: {
4204
- color: theme?.palette?.font?.invertedDefault,
4206
+ color: theme?.colors?.font2,
4205
4207
  lineHeight: '32px',
4206
4208
  fontWeight: '400',
4207
4209
  wordBreak: 'break-word',
@@ -4476,7 +4478,8 @@ const useSectionStyles$5 = createUseStyles(theme => {
4476
4478
  width: '100%',
4477
4479
  position: 'relative',
4478
4480
  zIndex: '2',
4479
- objectFit: 'cover'
4481
+ objectFit: 'cover',
4482
+ borderRadius: theme?.shape?.borderRadius?.regular
4480
4483
  },
4481
4484
  textContainer: {
4482
4485
  marginLeft: '72px',
@@ -5579,7 +5582,7 @@ const useVideoTestimonialStyles = createUseStyles(theme => {
5579
5582
  display: 'flex',
5580
5583
  alignItems: 'center',
5581
5584
  // marginTop: '16px',
5582
- borderRadius: '8px'
5585
+ borderRadius: theme?.shape?.borderRadius?.regular
5583
5586
  },
5584
5587
  iframeContainer: {
5585
5588
  width: '100%',
@@ -6380,7 +6383,7 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
6380
6383
  cursor: 'pointer'
6381
6384
  },
6382
6385
  singleCard: {
6383
- borderRadius: '24px',
6386
+ borderRadius: theme?.shape?.borderRadius?.large,
6384
6387
  margin: '0 1px',
6385
6388
  width: 'calc(100% - 24px)',
6386
6389
  position: 'relative',
@@ -6403,7 +6406,7 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
6403
6406
  height: ({
6404
6407
  cardsCount
6405
6408
  }) => cardsCount === 1 ? '480px' : '100%',
6406
- borderRadius: '24px',
6409
+ borderRadius: theme?.shape?.borderRadius?.large,
6407
6410
  objectFit: 'cover',
6408
6411
  objectPosition: 'center',
6409
6412
  position: 'absolute',
@@ -6446,7 +6449,7 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
6446
6449
  height: ({
6447
6450
  cardsCount
6448
6451
  }) => cardsCount === 1 ? '360px' : '',
6449
- borderRadius: '16px'
6452
+ borderRadius: theme?.shape?.borderRadius?.regular
6450
6453
  },
6451
6454
  singleCard: {
6452
6455
  width: ({
@@ -6595,7 +6598,7 @@ const useFaqListStyles = createUseStyles(theme => ({
6595
6598
  },
6596
6599
  container: {
6597
6600
  boxShadow: theme?.shadows?.secondary,
6598
- borderRadius: '8px',
6601
+ borderRadius: theme?.shape?.borderRadius?.regular,
6599
6602
  backgroundColor: theme?.colors?.white
6600
6603
  },
6601
6604
  basicCardContainer: {
@@ -8268,7 +8271,7 @@ const useTeamStyles = createUseStyles(theme => {
8268
8271
  height: '208px',
8269
8272
  top: '0',
8270
8273
  left: '0',
8271
- borderRadius: '12px 12px 0px 0px',
8274
+ borderRadius: `${theme?.shape?.borderRadius?.regular}px ${theme?.shape?.borderRadius?.regular}px 0 0`,
8272
8275
  objectFit: 'cover'
8273
8276
  },
8274
8277
  teamDetailsContainer: {
@@ -11454,7 +11457,7 @@ const useAboutInstituteStyles = createUseStyles(theme => ({
11454
11457
  image: {
11455
11458
  width: '100%',
11456
11459
  height: '100%',
11457
- borderRadius: '16px',
11460
+ borderRadius: theme?.shape?.borderRadius?.large,
11458
11461
  border: '1px solid var(--stroke, #D8E0F0)'
11459
11462
  },
11460
11463
  infoContainer: {
@@ -11462,7 +11465,7 @@ const useAboutInstituteStyles = createUseStyles(theme => ({
11462
11465
  gap: '16px',
11463
11466
  display: 'flex',
11464
11467
  flexDirection: 'column',
11465
- borderRadius: '16px',
11468
+ borderRadius: theme?.shape?.borderRadius?.large,
11466
11469
  background: 'var(--Blue-Tertiary, #F4F9FF)',
11467
11470
  flex: 1
11468
11471
  },
@@ -11496,7 +11499,7 @@ const useAboutInstituteStyles = createUseStyles(theme => ({
11496
11499
  display: 'flex',
11497
11500
  justifyContent: 'space-between',
11498
11501
  alignItems: 'center',
11499
- borderRadius: '16px',
11502
+ borderRadius: theme?.shape?.borderRadius?.large,
11500
11503
  background: 'var(--Blue-Tertiary, #F4F9FF)',
11501
11504
  flexGrow: 1
11502
11505
  },
@@ -11556,7 +11559,7 @@ const useAboutInstituteStyles = createUseStyles(theme => ({
11556
11559
  width: '150px'
11557
11560
  },
11558
11561
  image: {
11559
- borderRadius: '10px',
11562
+ borderRadius: theme?.shape?.borderRadius?.regular,
11560
11563
  border: '1px solid var(--stroke, #D8E0F0)'
11561
11564
  },
11562
11565
  infoContainer: {
@@ -11778,14 +11781,13 @@ const useCounterSectionStyles = createUseStyles(theme => {
11778
11781
  return {
11779
11782
  section: {
11780
11783
  width: '100%',
11781
- borderRadius: theme.shape?.borderRadius?.regular || '12px',
11782
11784
  overflow: 'hidden',
11783
11785
  backgroundImage: ({
11784
11786
  backgroundImage
11785
11787
  } = {}) => backgroundImage ? `url("${backgroundImage}")` : 'none',
11786
11788
  backgroundColor: ({
11787
11789
  backgroundColor
11788
- } = {}) => backgroundColor || '#f8f8fa',
11790
+ } = {}) => backgroundColor || theme?.colors?.background2,
11789
11791
  backgroundSize: 'cover',
11790
11792
  backgroundPosition: 'center',
11791
11793
  backgroundRepeat: 'no-repeat',
@@ -11806,7 +11808,8 @@ const useCounterSectionStyles = createUseStyles(theme => {
11806
11808
  },
11807
11809
  grid: {
11808
11810
  display: 'grid',
11809
- gridTemplateColumns: 'repeat(4, 1fr)',
11811
+ gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))',
11812
+ // fits 4 columns in desktop
11810
11813
  gap: ({
11811
11814
  isMobile
11812
11815
  } = {}) => isMobile ? '24px' : '32px',
@@ -11825,7 +11828,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
11825
11828
  fontSize: '64px',
11826
11829
  fontWeight: theme.typography?.fontWeight?.bold,
11827
11830
  lineHeight: 1.1,
11828
- color: 'rgba(247, 37, 133, 1)' ,
11831
+ color: theme?.colors?.AccentColor,
11829
11832
  wordBreak: 'break-word'
11830
11833
  },
11831
11834
  description: {
@@ -11833,7 +11836,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
11833
11836
  fontSize: '20px',
11834
11837
  lineHeight: 1.4,
11835
11838
  fontWeight: '700',
11836
- color: 'rgba(51, 51, 51, 1)' ,
11839
+ color: theme?.colors?.font3,
11837
11840
  wordBreak: 'break-word'
11838
11841
  },
11839
11842
  '@media (max-width: 1024px)': {
@@ -11843,9 +11846,6 @@ const useCounterSectionStyles = createUseStyles(theme => {
11843
11846
  }
11844
11847
  },
11845
11848
  '@media (max-width: 767px)': {
11846
- section: {
11847
- borderRadius: theme.shape?.borderRadius?.small || '8px'
11848
- },
11849
11849
  container: {
11850
11850
  padding: `${theme.spacing.padding.regular}px ${theme.spacing.padding.tiny}px`
11851
11851
  },
@@ -11866,6 +11866,83 @@ const useCounterSectionStyles = createUseStyles(theme => {
11866
11866
  };
11867
11867
  });
11868
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
+ }
11869
11946
  function CounterSection({
11870
11947
  sectionData,
11871
11948
  sectionIndex
@@ -11876,44 +11953,49 @@ function CounterSection({
11876
11953
  },
11877
11954
  isMobile
11878
11955
  } = useContext(PageContext);
11879
- console.log('llll', sectionData);
11880
- sectionData.components = sectionData.components;
11881
11956
  const metadata = sectionData.metadata || {};
11882
11957
  const backgroundImage = metadata.backgroundImage || '';
11883
- const backgroundColor = metadata.backgroundColor || '#f8f8fa';
11958
+ const backgroundColor = metadata.backgroundColor;
11884
11959
  const classes = useCounterSectionStyles({
11885
11960
  containerWidth,
11886
11961
  isMobile,
11887
11962
  backgroundImage: backgroundImage || null,
11888
11963
  backgroundColor
11889
11964
  });
11890
- const cardData = sectionData?.components[0];
11891
- const [sectionComponent] = sectionData.components || [];
11965
+ const cardData = sectionData?.components?.[0];
11966
+ const [sectionComponent] = sectionData?.components || [];
11892
11967
  const counterSection = sectionComponent?.counterSection;
11893
- counterSection?.components || [];
11968
+ const counters = counterSection?.components || [];
11969
+ const items = cardData?.contentList?.components || counters;
11894
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;
11895
11975
  return /*#__PURE__*/React.createElement("section", {
11896
11976
  className: classes.section
11897
11977
  }, /*#__PURE__*/React.createElement("div", {
11898
11978
  className: classes.container
11899
11979
  }, /*#__PURE__*/React.createElement("div", {
11900
11980
  className: classes.grid
11901
- }, cardData?.contentList?.components?.map((item, index) => /*#__PURE__*/React.createElement("div", {
11902
- key: item._id || index,
11903
- className: classes.counterItem
11904
- }, item.contentHeading?.metadata?.value != null && item.contentHeading?.metadata?.value !== '' && /*#__PURE__*/React.createElement("h2", {
11905
- ref: item.contentHeading?.refSetter,
11906
- className: classes.value,
11907
- dangerouslySetInnerHTML: {
11908
- __html: item.contentHeading.metadata.value
11909
- }
11910
- }), item.contentPara?.metadata?.value != null && item.contentPara?.metadata?.value !== '' && /*#__PURE__*/React.createElement("p", {
11911
- ref: item.contentPara?.refSetter,
11912
- className: classes.description,
11913
- dangerouslySetInnerHTML: {
11914
- __html: item.contentPara.metadata.value
11915
- }
11916
- }))))));
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
+ }))));
11917
11999
  }
11918
12000
 
11919
12001
  var index$5 = /*#__PURE__*/Object.freeze({
@@ -11930,12 +12012,13 @@ const BREAKPOINTS = {
11930
12012
  /**
11931
12013
  * Get current breakpoint from window width
11932
12014
  */
11933
- const getBreakpoint = width => {
12015
+ const getBreakpoint = (width, isMobile) => {
12016
+ if (isMobile) return 'mobile';
11934
12017
  if (width >= BREAKPOINTS.desktop) return 'desktop';
11935
12018
  if (width >= BREAKPOINTS.tablet) return 'tablet';
11936
12019
  return 'mobile';
11937
12020
  };
11938
- const stickyBarBase = {
12021
+ const getStickyBarBase = theme => ({
11939
12022
  position: 'fixed',
11940
12023
  left: 0,
11941
12024
  right: 0,
@@ -11944,100 +12027,86 @@ const stickyBarBase = {
11944
12027
  display: 'flex',
11945
12028
  alignItems: 'center',
11946
12029
  justifyContent: 'center',
11947
- backgroundColor: '#F8F9FB',
11948
- boxShadow: '0 -2px 8px rgba(0, 0, 0, 0.06)',
11949
- borderTop: '1px solid #E5E7EB'
11950
- };
11951
- const stickyBarResponsive = {
11952
- mobile: {
11953
- ...stickyBarBase,
11954
- padding: '12px 16px',
11955
- gap: '12px',
11956
- flexDirection: 'column',
11957
- alignItems: 'stretch'
11958
- },
11959
- tablet: {
11960
- ...stickyBarBase,
11961
- padding: '14px 24px',
11962
- gap: '16px',
11963
- flexDirection: 'row',
11964
- alignItems: 'center'
11965
- },
11966
- desktop: {
11967
- ...stickyBarBase,
11968
- padding: '16px 32px',
11969
- gap: '24px',
11970
- flexDirection: 'row',
11971
- alignItems: 'center'
11972
- }
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
+ };
11973
12066
  };
11974
- const getStickyBarStyle = breakpoint => stickyBarResponsive[breakpoint] || stickyBarResponsive.mobile;
11975
- const stickyTextBase = {
11976
- color: '#343A40',
11977
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
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',
11978
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
+ };
11979
12101
  };
11980
- const stickyTextResponsive = {
11981
- mobile: {
11982
- ...stickyTextBase,
11983
- fontSize: '13px',
11984
- lineHeight: 1.4,
11985
- textAlign: 'center'
11986
- },
11987
- tablet: {
11988
- ...stickyTextBase,
11989
- fontSize: '14px',
11990
- lineHeight: 1.45,
11991
- textAlign: 'left'
11992
- },
11993
- desktop: {
11994
- ...stickyTextBase,
11995
- fontSize: '15px',
11996
- lineHeight: 1.5,
11997
- textAlign: 'left'
11998
- }
11999
- };
12000
- const getStickyTextStyle = breakpoint => stickyTextResponsive[breakpoint] || stickyTextResponsive.mobile;
12001
- const stickyButtonBase = {
12002
- backgroundColor: '#3366FF',
12003
- color: '#FFFFFF',
12004
- border: 'none',
12005
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
12006
- fontWeight: 600,
12007
- textTransform: 'uppercase',
12008
- letterSpacing: '0.02em',
12009
- cursor: 'pointer',
12010
- whiteSpace: 'nowrap',
12011
- flexShrink: 0
12012
- };
12013
- const stickyButtonResponsive = {
12014
- mobile: {
12015
- ...stickyButtonBase,
12016
- padding: '10px 20px',
12017
- fontSize: '12px',
12018
- borderRadius: '6px'
12019
- },
12020
- tablet: {
12021
- ...stickyButtonBase,
12022
- padding: '12px 24px',
12023
- fontSize: '13px',
12024
- borderRadius: '8px'
12025
- },
12026
- desktop: {
12027
- ...stickyButtonBase,
12028
- padding: '14px 28px',
12029
- fontSize: '14px',
12030
- borderRadius: '8px'
12031
- }
12032
- };
12033
- const getStickyButtonStyle = breakpoint => stickyButtonResponsive[breakpoint] || stickyButtonResponsive.mobile;
12102
+ const getStickyTextStyle = (breakpoint, theme = {}) => getStickyTextResponsive(theme)[breakpoint] || getStickyTextResponsive(theme).mobile;
12034
12103
 
12035
12104
  // --- Floating (WhatsApp) type ---
12036
12105
 
12037
- const floatingButtonBase = {
12106
+ const getFloatingButtonBase = theme => ({
12038
12107
  position: 'fixed',
12039
12108
  bottom: 24,
12040
- right: 24,
12109
+ right: 9,
12041
12110
  width: 'fit-content',
12042
12111
  marginLeft: 'auto',
12043
12112
  zIndex: 9999,
@@ -12045,47 +12114,50 @@ const floatingButtonBase = {
12045
12114
  alignItems: 'center',
12046
12115
  gap: '10px',
12047
12116
  padding: '12px 20px',
12048
- backgroundColor: '#FFFFFF',
12049
- border: '1px solid #E5E7EB',
12117
+ backgroundColor: theme?.colors?.ctaColor || '#FFFFFF',
12118
+ border: `1px solid ${theme?.palette?.border?.secondary ?? '#E5E7EB'}`,
12050
12119
  borderRadius: '9999px',
12051
- boxShadow: '0 4px 12px rgba(0, 0, 0, 0.1)',
12120
+ boxShadow: theme?.shadows?.primary ?? '0 4px 12px rgba(0, 0, 0, 0.1)',
12052
12121
  cursor: 'pointer',
12053
12122
  textDecoration: 'none',
12054
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
12055
- fontWeight: 700,
12123
+ fontFamily: theme?.typography?.fontFamily ?? 'inherit',
12124
+ fontWeight: theme?.typography?.fontWeight?.bold ?? 700,
12056
12125
  fontSize: '14px',
12057
12126
  textTransform: 'uppercase',
12058
12127
  letterSpacing: '0.02em',
12059
- color: '#000000',
12128
+ color: theme?.colors?.CtaTextColor || 'white',
12060
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
+ };
12061
12159
  };
12062
- const floatingButtonResponsive = {
12063
- mobile: {
12064
- ...floatingButtonBase,
12065
- bottom: 16,
12066
- left: 16,
12067
- padding: '10px 16px',
12068
- gap: '8px',
12069
- fontSize: '12px'
12070
- },
12071
- tablet: {
12072
- ...floatingButtonBase,
12073
- bottom: 20,
12074
- left: 20,
12075
- padding: '12px 18px',
12076
- gap: '10px',
12077
- fontSize: '13px'
12078
- },
12079
- desktop: {
12080
- ...floatingButtonBase,
12081
- bottom: 24,
12082
- left: 24,
12083
- padding: '12px 20px',
12084
- gap: '10px',
12085
- fontSize: '14px'
12086
- }
12087
- };
12088
- const getFloatingButtonStyle = breakpoint => floatingButtonResponsive[breakpoint] || floatingButtonResponsive.mobile;
12160
+ const getFloatingButtonStyle = (breakpoint, theme = {}) => getFloatingButtonResponsive(theme)[breakpoint] || getFloatingButtonResponsive(theme).mobile;
12089
12161
  const whatsAppIconSvgSize = {
12090
12162
  mobile: 24,
12091
12163
  tablet: 26,
@@ -12173,12 +12245,17 @@ function StickyCta({
12173
12245
  whatsAppLabel = 'SUPPORT',
12174
12246
  whatsAppIconColor,
12175
12247
  whatsAppButtonBackgroundColor,
12176
- iconImageUrl
12248
+ iconImageUrl,
12249
+ nodeData,
12250
+ extraProps
12177
12251
  }) {
12178
- console.log('nishu03333', sectionData);
12252
+ const {
12253
+ isMobile
12254
+ } = useContext(PageContext);
12179
12255
  const node = sectionData?.components?.[0];
12180
12256
  const contentList = node?.contentList?.components || [];
12181
12257
  const showEditHint = sectionData?.isDefaultEditor ?? false;
12258
+ sectionData?.bgSection?.components?.[0]?.sectionBgData?.metadata?.value;
12182
12259
  const propsFromSection = node ? {
12183
12260
  type: node?.title?.metadata?.value ?? type,
12184
12261
  stickyMessage: contentList[1]?.contentPara?.metadata?.value ?? stickyMessage,
@@ -12201,8 +12278,9 @@ function StickyCta({
12201
12278
  whatsAppButtonBackgroundColor,
12202
12279
  iconImageUrl
12203
12280
  };
12204
- const whatsAppUrl = p?.whatsAppPhoneNumber ? p?.whatsAppPhoneNumber : buildWhatsAppUrl(p?.whatsAppPhoneNumber);
12205
- const [breakpoint, setBreakpoint] = useState(() => typeof window !== 'undefined' ? getBreakpoint(window.innerWidth) : 'mobile');
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');
12206
12284
  useEffect(() => {
12207
12285
  if (typeof window === 'undefined') return;
12208
12286
  const onResize = () => setBreakpoint(getBreakpoint(window.innerWidth));
@@ -12231,14 +12309,14 @@ function StickyCta({
12231
12309
  }, "Click on edit button to edit this section")) : null;
12232
12310
  if (p.type === 'floating') {
12233
12311
  const buttonStyle = {
12234
- ...getFloatingButtonStyle(breakpoint),
12312
+ ...getFloatingButtonStyle(breakpoint, theme),
12235
12313
  ...(p.whatsAppButtonBackgroundColor != null && {
12236
12314
  backgroundColor: p.whatsAppButtonBackgroundColor
12237
12315
  })
12238
12316
  };
12239
12317
  const iconSize = getWhatsAppIconSize(breakpoint);
12240
12318
  const iconColor = p.whatsAppIconColor ?? DEFAULT_WHATSAPP_ICON_COLOR;
12241
- 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", {
12242
12320
  href: whatsAppUrl,
12243
12321
  target: "_blank",
12244
12322
  rel: "noopener noreferrer",
@@ -12260,28 +12338,29 @@ function StickyCta({
12260
12338
  }), /*#__PURE__*/React.createElement("span", null, p.whatsAppLabel)));
12261
12339
  }
12262
12340
 
12263
- // type === 'sticky' – button uses mobile number from props to build URL; click redirects to WhatsApp
12264
- const barStyle = getStickyBarStyle(breakpoint);
12265
- const textStyle = getStickyTextStyle(breakpoint);
12266
- const buttonStyle = getStickyButtonStyle(breakpoint);
12267
- 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", {
12268
12345
  style: barStyle,
12269
- role: "banner"
12346
+ role: "banner",
12347
+ "access-cta-sticky": "DIY"
12270
12348
  }, /*#__PURE__*/React.createElement("p", {
12271
12349
  style: textStyle
12272
- }, p.stickyMessage), /*#__PURE__*/React.createElement("a", {
12273
- href: whatsAppUrl,
12274
- target: "_blank",
12275
- rel: "noopener noreferrer",
12276
- "access-cta-container": "DIY",
12277
- style: {
12278
- ...buttonStyle,
12279
- textDecoration: 'none',
12280
- display: 'inline-flex',
12281
- alignItems: 'center',
12282
- justifyContent: 'center'
12283
- }
12284
- }, p.stickyButtonText)));
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
+ })));
12285
12364
  }
12286
12365
 
12287
12366
  var index$4 = /*#__PURE__*/Object.freeze({
@@ -12626,7 +12705,8 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12626
12705
  return {
12627
12706
  section: {
12628
12707
  width: '100%',
12629
- background: 'linear-gradient(135deg, #6b2d5c 0%, #4a3f6b 40%, #2d5a6b 70%, #3d6b5a 100%)',
12708
+ background: theme?.colors?.background2,
12709
+ color: theme?.colors?.font3,
12630
12710
  minHeight: '100%',
12631
12711
  '&, & *, & *:before, & *:after': {
12632
12712
  fontFamily: theme?.typography?.fontFamily,
@@ -12666,7 +12746,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12666
12746
  lineHeight: 1.25,
12667
12747
  letterSpacing: '3px',
12668
12748
  textTransform: 'uppercase',
12669
- color: theme.palette?.font?.invertedDefault || 'rgba(255,255,255,0.9)',
12670
12749
  wordBreak: 'break-word',
12671
12750
  fontWeight: theme.typography?.fontWeight?.regular
12672
12751
  },
@@ -12675,15 +12754,12 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12675
12754
  fontSize: theme.typography.fontSize.h2,
12676
12755
  lineHeight: 1.1,
12677
12756
  letterSpacing: '-1px',
12678
- fontWeight: theme.typography?.fontWeight?.bold,
12679
- color: theme.palette?.font?.invertedDefault || '#ffffff',
12680
12757
  wordBreak: 'break-word'
12681
12758
  },
12682
12759
  subHeading: {
12683
12760
  margin: 0,
12684
12761
  fontSize: theme.typography.fontSize.body,
12685
12762
  lineHeight: 1.5,
12686
- color: theme.palette?.font?.invertedDefault || 'rgba(255,255,255,0.95)',
12687
12763
  wordBreak: 'break-word',
12688
12764
  maxWidth: '600px'
12689
12765
  },
@@ -12729,7 +12805,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12729
12805
  margin: 0,
12730
12806
  fontSize: theme.typography.fontSize.body,
12731
12807
  fontWeight: theme.typography?.fontWeight?.semiBold,
12732
- color: '#ffffff',
12733
12808
  lineHeight: 1.3
12734
12809
  }
12735
12810
  },
@@ -12744,7 +12819,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12744
12819
  '& p': {
12745
12820
  margin: 0,
12746
12821
  fontSize: theme.typography.fontSize.body,
12747
- color: '#ffffff',
12748
12822
  lineHeight: 1.4
12749
12823
  }
12750
12824
  },