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.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 }; }
@@ -11800,7 +11801,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
11800
11801
  } = {}) => backgroundImage ? `url("${backgroundImage}")` : 'none',
11801
11802
  backgroundColor: ({
11802
11803
  backgroundColor
11803
- } = {}) => backgroundColor || '#f8f8fa',
11804
+ } = {}) => backgroundColor || theme?.colors?.background2,
11804
11805
  backgroundSize: 'cover',
11805
11806
  backgroundPosition: 'center',
11806
11807
  backgroundRepeat: 'no-repeat',
@@ -11821,7 +11822,8 @@ const useCounterSectionStyles = createUseStyles(theme => {
11821
11822
  },
11822
11823
  grid: {
11823
11824
  display: 'grid',
11824
- gridTemplateColumns: 'repeat(4, 1fr)',
11825
+ gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))',
11826
+ // fits 4 columns in desktop
11825
11827
  gap: ({
11826
11828
  isMobile
11827
11829
  } = {}) => isMobile ? '24px' : '32px',
@@ -11840,7 +11842,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
11840
11842
  fontSize: '64px',
11841
11843
  fontWeight: theme.typography?.fontWeight?.bold,
11842
11844
  lineHeight: 1.1,
11843
- color: 'rgba(247, 37, 133, 1)' ,
11845
+ color: theme?.colors?.AccentColor,
11844
11846
  wordBreak: 'break-word'
11845
11847
  },
11846
11848
  description: {
@@ -11848,7 +11850,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
11848
11850
  fontSize: '20px',
11849
11851
  lineHeight: 1.4,
11850
11852
  fontWeight: '700',
11851
- color: 'rgba(51, 51, 51, 1)' ,
11853
+ color: theme?.colors?.font3,
11852
11854
  wordBreak: 'break-word'
11853
11855
  },
11854
11856
  '@media (max-width: 1024px)': {
@@ -11878,6 +11880,83 @@ const useCounterSectionStyles = createUseStyles(theme => {
11878
11880
  };
11879
11881
  });
11880
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
+ }
11881
11960
  function CounterSection({
11882
11961
  sectionData,
11883
11962
  sectionIndex
@@ -11888,44 +11967,49 @@ function CounterSection({
11888
11967
  },
11889
11968
  isMobile
11890
11969
  } = React.useContext(PageContext);
11891
- console.log('llll', sectionData);
11892
- sectionData.components = sectionData.components;
11893
11970
  const metadata = sectionData.metadata || {};
11894
11971
  const backgroundImage = metadata.backgroundImage || '';
11895
- const backgroundColor = metadata.backgroundColor || '#f8f8fa';
11972
+ const backgroundColor = metadata.backgroundColor;
11896
11973
  const classes = useCounterSectionStyles({
11897
11974
  containerWidth,
11898
11975
  isMobile,
11899
11976
  backgroundImage: backgroundImage || null,
11900
11977
  backgroundColor
11901
11978
  });
11902
- const cardData = sectionData?.components[0];
11903
- const [sectionComponent] = sectionData.components || [];
11979
+ const cardData = sectionData?.components?.[0];
11980
+ const [sectionComponent] = sectionData?.components || [];
11904
11981
  const counterSection = sectionComponent?.counterSection;
11905
- counterSection?.components || [];
11982
+ const counters = counterSection?.components || [];
11983
+ const items = cardData?.contentList?.components || counters;
11906
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;
11907
11989
  return /*#__PURE__*/React__default["default"].createElement("section", {
11908
11990
  className: classes.section
11909
11991
  }, /*#__PURE__*/React__default["default"].createElement("div", {
11910
11992
  className: classes.container
11911
11993
  }, /*#__PURE__*/React__default["default"].createElement("div", {
11912
11994
  className: classes.grid
11913
- }, cardData?.contentList?.components?.map((item, index) => /*#__PURE__*/React__default["default"].createElement("div", {
11914
- key: item._id || index,
11915
- className: classes.counterItem
11916
- }, item.contentHeading?.metadata?.value != null && item.contentHeading?.metadata?.value !== '' && /*#__PURE__*/React__default["default"].createElement("h2", {
11917
- ref: item.contentHeading?.refSetter,
11918
- className: classes.value,
11919
- dangerouslySetInnerHTML: {
11920
- __html: item.contentHeading.metadata.value
11921
- }
11922
- }), item.contentPara?.metadata?.value != null && item.contentPara?.metadata?.value !== '' && /*#__PURE__*/React__default["default"].createElement("p", {
11923
- ref: item.contentPara?.refSetter,
11924
- className: classes.description,
11925
- dangerouslySetInnerHTML: {
11926
- __html: item.contentPara.metadata.value
11927
- }
11928
- }))))));
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
+ }))));
11929
12013
  }
11930
12014
 
11931
12015
  var index$5 = /*#__PURE__*/Object.freeze({
@@ -11942,12 +12026,13 @@ const BREAKPOINTS = {
11942
12026
  /**
11943
12027
  * Get current breakpoint from window width
11944
12028
  */
11945
- const getBreakpoint = width => {
12029
+ const getBreakpoint = (width, isMobile) => {
12030
+ if (isMobile) return 'mobile';
11946
12031
  if (width >= BREAKPOINTS.desktop) return 'desktop';
11947
12032
  if (width >= BREAKPOINTS.tablet) return 'tablet';
11948
12033
  return 'mobile';
11949
12034
  };
11950
- const stickyBarBase = {
12035
+ const getStickyBarBase = theme => ({
11951
12036
  position: 'fixed',
11952
12037
  left: 0,
11953
12038
  right: 0,
@@ -11956,100 +12041,86 @@ const stickyBarBase = {
11956
12041
  display: 'flex',
11957
12042
  alignItems: 'center',
11958
12043
  justifyContent: 'center',
11959
- backgroundColor: '#F8F9FB',
11960
- boxShadow: '0 -2px 8px rgba(0, 0, 0, 0.06)',
11961
- borderTop: '1px solid #E5E7EB'
11962
- };
11963
- const stickyBarResponsive = {
11964
- mobile: {
11965
- ...stickyBarBase,
11966
- padding: '12px 16px',
11967
- gap: '12px',
11968
- flexDirection: 'column',
11969
- alignItems: 'stretch'
11970
- },
11971
- tablet: {
11972
- ...stickyBarBase,
11973
- padding: '14px 24px',
11974
- gap: '16px',
11975
- flexDirection: 'row',
11976
- alignItems: 'center'
11977
- },
11978
- desktop: {
11979
- ...stickyBarBase,
11980
- padding: '16px 32px',
11981
- gap: '24px',
11982
- flexDirection: 'row',
11983
- alignItems: 'center'
11984
- }
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
+ };
11985
12080
  };
11986
- const getStickyBarStyle = breakpoint => stickyBarResponsive[breakpoint] || stickyBarResponsive.mobile;
11987
- const stickyTextBase = {
11988
- color: '#343A40',
11989
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
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',
11990
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
+ };
11991
12115
  };
11992
- const stickyTextResponsive = {
11993
- mobile: {
11994
- ...stickyTextBase,
11995
- fontSize: '13px',
11996
- lineHeight: 1.4,
11997
- textAlign: 'center'
11998
- },
11999
- tablet: {
12000
- ...stickyTextBase,
12001
- fontSize: '14px',
12002
- lineHeight: 1.45,
12003
- textAlign: 'left'
12004
- },
12005
- desktop: {
12006
- ...stickyTextBase,
12007
- fontSize: '15px',
12008
- lineHeight: 1.5,
12009
- textAlign: 'left'
12010
- }
12011
- };
12012
- const getStickyTextStyle = breakpoint => stickyTextResponsive[breakpoint] || stickyTextResponsive.mobile;
12013
- const stickyButtonBase = {
12014
- backgroundColor: '#3366FF',
12015
- color: '#FFFFFF',
12016
- border: 'none',
12017
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
12018
- fontWeight: 600,
12019
- textTransform: 'uppercase',
12020
- letterSpacing: '0.02em',
12021
- cursor: 'pointer',
12022
- whiteSpace: 'nowrap',
12023
- flexShrink: 0
12024
- };
12025
- const stickyButtonResponsive = {
12026
- mobile: {
12027
- ...stickyButtonBase,
12028
- padding: '10px 20px',
12029
- fontSize: '12px',
12030
- borderRadius: '6px'
12031
- },
12032
- tablet: {
12033
- ...stickyButtonBase,
12034
- padding: '12px 24px',
12035
- fontSize: '13px',
12036
- borderRadius: '8px'
12037
- },
12038
- desktop: {
12039
- ...stickyButtonBase,
12040
- padding: '14px 28px',
12041
- fontSize: '14px',
12042
- borderRadius: '8px'
12043
- }
12044
- };
12045
- const getStickyButtonStyle = breakpoint => stickyButtonResponsive[breakpoint] || stickyButtonResponsive.mobile;
12116
+ const getStickyTextStyle = (breakpoint, theme = {}) => getStickyTextResponsive(theme)[breakpoint] || getStickyTextResponsive(theme).mobile;
12046
12117
 
12047
12118
  // --- Floating (WhatsApp) type ---
12048
12119
 
12049
- const floatingButtonBase = {
12120
+ const getFloatingButtonBase = theme => ({
12050
12121
  position: 'fixed',
12051
12122
  bottom: 24,
12052
- right: 24,
12123
+ right: 9,
12053
12124
  width: 'fit-content',
12054
12125
  marginLeft: 'auto',
12055
12126
  zIndex: 9999,
@@ -12057,47 +12128,50 @@ const floatingButtonBase = {
12057
12128
  alignItems: 'center',
12058
12129
  gap: '10px',
12059
12130
  padding: '12px 20px',
12060
- backgroundColor: '#FFFFFF',
12061
- border: '1px solid #E5E7EB',
12131
+ backgroundColor: theme?.colors?.ctaColor || '#FFFFFF',
12132
+ border: `1px solid ${theme?.palette?.border?.secondary ?? '#E5E7EB'}`,
12062
12133
  borderRadius: '9999px',
12063
- boxShadow: '0 4px 12px rgba(0, 0, 0, 0.1)',
12134
+ boxShadow: theme?.shadows?.primary ?? '0 4px 12px rgba(0, 0, 0, 0.1)',
12064
12135
  cursor: 'pointer',
12065
12136
  textDecoration: 'none',
12066
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
12067
- fontWeight: 700,
12137
+ fontFamily: theme?.typography?.fontFamily ?? 'inherit',
12138
+ fontWeight: theme?.typography?.fontWeight?.bold ?? 700,
12068
12139
  fontSize: '14px',
12069
12140
  textTransform: 'uppercase',
12070
12141
  letterSpacing: '0.02em',
12071
- color: '#000000',
12142
+ color: theme?.colors?.CtaTextColor || 'white',
12072
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
+ };
12073
12173
  };
12074
- const floatingButtonResponsive = {
12075
- mobile: {
12076
- ...floatingButtonBase,
12077
- bottom: 16,
12078
- left: 16,
12079
- padding: '10px 16px',
12080
- gap: '8px',
12081
- fontSize: '12px'
12082
- },
12083
- tablet: {
12084
- ...floatingButtonBase,
12085
- bottom: 20,
12086
- left: 20,
12087
- padding: '12px 18px',
12088
- gap: '10px',
12089
- fontSize: '13px'
12090
- },
12091
- desktop: {
12092
- ...floatingButtonBase,
12093
- bottom: 24,
12094
- left: 24,
12095
- padding: '12px 20px',
12096
- gap: '10px',
12097
- fontSize: '14px'
12098
- }
12099
- };
12100
- const getFloatingButtonStyle = breakpoint => floatingButtonResponsive[breakpoint] || floatingButtonResponsive.mobile;
12174
+ const getFloatingButtonStyle = (breakpoint, theme = {}) => getFloatingButtonResponsive(theme)[breakpoint] || getFloatingButtonResponsive(theme).mobile;
12101
12175
  const whatsAppIconSvgSize = {
12102
12176
  mobile: 24,
12103
12177
  tablet: 26,
@@ -12185,12 +12259,17 @@ function StickyCta({
12185
12259
  whatsAppLabel = 'SUPPORT',
12186
12260
  whatsAppIconColor,
12187
12261
  whatsAppButtonBackgroundColor,
12188
- iconImageUrl
12262
+ iconImageUrl,
12263
+ nodeData,
12264
+ extraProps
12189
12265
  }) {
12190
- console.log('nishu03333', sectionData);
12266
+ const {
12267
+ isMobile
12268
+ } = React.useContext(PageContext);
12191
12269
  const node = sectionData?.components?.[0];
12192
12270
  const contentList = node?.contentList?.components || [];
12193
12271
  const showEditHint = sectionData?.isDefaultEditor ?? false;
12272
+ sectionData?.bgSection?.components?.[0]?.sectionBgData?.metadata?.value;
12194
12273
  const propsFromSection = node ? {
12195
12274
  type: node?.title?.metadata?.value ?? type,
12196
12275
  stickyMessage: contentList[1]?.contentPara?.metadata?.value ?? stickyMessage,
@@ -12213,8 +12292,9 @@ function StickyCta({
12213
12292
  whatsAppButtonBackgroundColor,
12214
12293
  iconImageUrl
12215
12294
  };
12216
- const whatsAppUrl = p?.whatsAppPhoneNumber ? p?.whatsAppPhoneNumber : buildWhatsAppUrl(p?.whatsAppPhoneNumber);
12217
- const [breakpoint, setBreakpoint] = React.useState(() => typeof window !== 'undefined' ? getBreakpoint(window.innerWidth) : 'mobile');
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');
12218
12298
  React.useEffect(() => {
12219
12299
  if (typeof window === 'undefined') return;
12220
12300
  const onResize = () => setBreakpoint(getBreakpoint(window.innerWidth));
@@ -12243,14 +12323,14 @@ function StickyCta({
12243
12323
  }, "Click on edit button to edit this section")) : null;
12244
12324
  if (p.type === 'floating') {
12245
12325
  const buttonStyle = {
12246
- ...getFloatingButtonStyle(breakpoint),
12326
+ ...getFloatingButtonStyle(breakpoint, theme),
12247
12327
  ...(p.whatsAppButtonBackgroundColor != null && {
12248
12328
  backgroundColor: p.whatsAppButtonBackgroundColor
12249
12329
  })
12250
12330
  };
12251
12331
  const iconSize = getWhatsAppIconSize(breakpoint);
12252
12332
  const iconColor = p.whatsAppIconColor ?? DEFAULT_WHATSAPP_ICON_COLOR;
12253
- 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", {
12254
12334
  href: whatsAppUrl,
12255
12335
  target: "_blank",
12256
12336
  rel: "noopener noreferrer",
@@ -12272,28 +12352,29 @@ function StickyCta({
12272
12352
  }), /*#__PURE__*/React__default["default"].createElement("span", null, p.whatsAppLabel)));
12273
12353
  }
12274
12354
 
12275
- // type === 'sticky' – button uses mobile number from props to build URL; click redirects to WhatsApp
12276
- const barStyle = getStickyBarStyle(breakpoint);
12277
- const textStyle = getStickyTextStyle(breakpoint);
12278
- const buttonStyle = getStickyButtonStyle(breakpoint);
12279
- 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", {
12280
12359
  style: barStyle,
12281
- role: "banner"
12360
+ role: "banner",
12361
+ "access-cta-sticky": "DIY"
12282
12362
  }, /*#__PURE__*/React__default["default"].createElement("p", {
12283
12363
  style: textStyle
12284
- }, p.stickyMessage), /*#__PURE__*/React__default["default"].createElement("a", {
12285
- href: whatsAppUrl,
12286
- target: "_blank",
12287
- rel: "noopener noreferrer",
12288
- "access-cta-container": "DIY",
12289
- style: {
12290
- ...buttonStyle,
12291
- textDecoration: 'none',
12292
- display: 'inline-flex',
12293
- alignItems: 'center',
12294
- justifyContent: 'center'
12295
- }
12296
- }, p.stickyButtonText)));
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
+ })));
12297
12378
  }
12298
12379
 
12299
12380
  var index$4 = /*#__PURE__*/Object.freeze({
@@ -12638,7 +12719,8 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12638
12719
  return {
12639
12720
  section: {
12640
12721
  width: '100%',
12641
- background: 'linear-gradient(135deg, #6b2d5c 0%, #4a3f6b 40%, #2d5a6b 70%, #3d6b5a 100%)',
12722
+ background: theme?.colors?.background2,
12723
+ color: theme?.colors?.font3,
12642
12724
  minHeight: '100%',
12643
12725
  '&, & *, & *:before, & *:after': {
12644
12726
  fontFamily: theme?.typography?.fontFamily,
@@ -12678,7 +12760,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12678
12760
  lineHeight: 1.25,
12679
12761
  letterSpacing: '3px',
12680
12762
  textTransform: 'uppercase',
12681
- color: theme.palette?.font?.invertedDefault || 'rgba(255,255,255,0.9)',
12682
12763
  wordBreak: 'break-word',
12683
12764
  fontWeight: theme.typography?.fontWeight?.regular
12684
12765
  },
@@ -12687,15 +12768,12 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12687
12768
  fontSize: theme.typography.fontSize.h2,
12688
12769
  lineHeight: 1.1,
12689
12770
  letterSpacing: '-1px',
12690
- fontWeight: theme.typography?.fontWeight?.bold,
12691
- color: theme.palette?.font?.invertedDefault || '#ffffff',
12692
12771
  wordBreak: 'break-word'
12693
12772
  },
12694
12773
  subHeading: {
12695
12774
  margin: 0,
12696
12775
  fontSize: theme.typography.fontSize.body,
12697
12776
  lineHeight: 1.5,
12698
- color: theme.palette?.font?.invertedDefault || 'rgba(255,255,255,0.95)',
12699
12777
  wordBreak: 'break-word',
12700
12778
  maxWidth: '600px'
12701
12779
  },
@@ -12741,7 +12819,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12741
12819
  margin: 0,
12742
12820
  fontSize: theme.typography.fontSize.body,
12743
12821
  fontWeight: theme.typography?.fontWeight?.semiBold,
12744
- color: '#ffffff',
12745
12822
  lineHeight: 1.3
12746
12823
  }
12747
12824
  },
@@ -12756,7 +12833,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12756
12833
  '& p': {
12757
12834
  margin: 0,
12758
12835
  fontSize: theme.typography.fontSize.body,
12759
- color: '#ffffff',
12760
12836
  lineHeight: 1.4
12761
12837
  }
12762
12838
  },