@app-studio/web 0.9.12 → 0.9.13

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.
@@ -16573,6 +16573,99 @@
16573
16573
  lg: 72,
16574
16574
  xl: 80
16575
16575
  };
16576
+ /**
16577
+ * Responsive typography system that maps title sizes to responsive breakpoints
16578
+ * Based on the Typography system with dynamic breakpoint sizing
16579
+ */
16580
+ var ResponsiveTypography = {
16581
+ // xl maps to H1 - Largest heading
16582
+ xl: {
16583
+ lineHeight: '120%',
16584
+ fontWeight: 500,
16585
+ marginBottom: 20,
16586
+ letterSpacing: 1.25,
16587
+ media: {
16588
+ mobile: {
16589
+ fontSize: 42,
16590
+ width: '100%'
16591
+ },
16592
+ tablet: {
16593
+ fontSize: 50,
16594
+ width: '100%'
16595
+ },
16596
+ desktop: {
16597
+ fontSize: 58,
16598
+ minWidth: '60%'
16599
+ }
16600
+ }
16601
+ },
16602
+ // lg maps to H2 - Large heading
16603
+ lg: {
16604
+ lineHeight: '100%',
16605
+ fontWeight: 500,
16606
+ media: {
16607
+ mobile: {
16608
+ fontSize: 32
16609
+ },
16610
+ tablet: {
16611
+ fontSize: 40
16612
+ },
16613
+ desktop: {
16614
+ fontSize: 48
16615
+ }
16616
+ }
16617
+ },
16618
+ // md maps to H3 - Medium heading
16619
+ md: {
16620
+ lineHeight: '100%',
16621
+ fontWeight: 500,
16622
+ media: {
16623
+ mobile: {
16624
+ fontSize: 20
16625
+ },
16626
+ tablet: {
16627
+ fontSize: 30
16628
+ },
16629
+ desktop: {
16630
+ fontSize: 40
16631
+ }
16632
+ }
16633
+ },
16634
+ // sm maps to T1 - Title text
16635
+ sm: {
16636
+ lineHeight: '100%',
16637
+ fontWeight: 400,
16638
+ letterSpacing: -0.2,
16639
+ media: {
16640
+ mobile: {
16641
+ fontSize: 16
16642
+ },
16643
+ tablet: {
16644
+ fontSize: 28
16645
+ },
16646
+ desktop: {
16647
+ fontSize: 32
16648
+ }
16649
+ }
16650
+ },
16651
+ // xs maps to S1 - Subtitle text
16652
+ xs: {
16653
+ lineHeight: '120%',
16654
+ fontWeight: 400,
16655
+ letterSpacing: -0.2,
16656
+ media: {
16657
+ mobile: {
16658
+ fontSize: 12
16659
+ },
16660
+ tablet: {
16661
+ fontSize: 18
16662
+ },
16663
+ desktop: {
16664
+ fontSize: 24
16665
+ }
16666
+ }
16667
+ }
16668
+ };
16576
16669
  /**
16577
16670
  * Default styles for different highlight types
16578
16671
  */
@@ -16691,7 +16784,7 @@
16691
16784
  }))))));
16692
16785
  };
16693
16786
 
16694
- var _excluded$S = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "centered", "views", "highlightAnimate", "animate", "highlightTypewriter", "highlightTypewriterDuration"];
16787
+ var _excluded$S = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "responsive", "centered", "views", "highlightAnimate", "animate", "animationLoop", "highlightAnimationLoop", "highlightTypewriter", "highlightTypewriterDuration"];
16695
16788
  function escapeRegExp(string) {
16696
16789
  return string.replace(/[.*+?^${}()|[\\]\\/g, '\\$&');
16697
16790
  }
@@ -16702,11 +16795,14 @@
16702
16795
  highlightStyle = 'background',
16703
16796
  highlightColor = 'theme.primary',
16704
16797
  highlightSecondaryColor,
16705
- size = 'xl',
16798
+ size = 'lg',
16799
+ responsive = true,
16706
16800
  centered = false,
16707
16801
  views,
16708
16802
  highlightAnimate,
16709
16803
  animate,
16804
+ animationLoop = 1,
16805
+ highlightAnimationLoop = 1,
16710
16806
  highlightTypewriter: propHighlightTypewriter = false,
16711
16807
  highlightTypewriterDuration = 3000
16712
16808
  } = _ref,
@@ -16744,8 +16840,27 @@
16744
16840
  highlightTypewriter: propHighlightTypewriter,
16745
16841
  highlightTypewriterDuration
16746
16842
  }, props));
16843
+ // Determine if we should use responsive sizing or static sizing
16844
+ var useResponsive = responsive && !props.media; // Don't override if media prop is already provided
16747
16845
  var fontSize = TitleSizes[size];
16748
16846
  var lineHeight = LineHeights$1[size];
16847
+ // Get responsive styles if responsive prop is true
16848
+ var responsiveStyles = useResponsive ? ResponsiveTypography[size] : null;
16849
+ // Helper function to apply loop control to animations
16850
+ var applyAnimationLoop = (animation, loopControl) => {
16851
+ if (!animation) return animation;
16852
+ if (Array.isArray(animation)) {
16853
+ return animation.map(anim => Object.assign({}, anim, {
16854
+ iterationCount: loopControl.toString()
16855
+ }));
16856
+ }
16857
+ return Object.assign({}, animation, {
16858
+ iterationCount: loopControl.toString()
16859
+ });
16860
+ };
16861
+ // Apply loop control to animations
16862
+ var controlledAnimate = applyAnimationLoop(animate, animationLoop);
16863
+ var controlledHighlightAnimate = applyAnimationLoop(highlightAnimate, highlightAnimationLoop);
16749
16864
  // Get the text to display
16750
16865
  var text = typeof finalDisplayedText === 'string' ? finalDisplayedText : typeof children === 'string' ? children : '';
16751
16866
  if (typeof text === 'string' && activeHighlightTarget) {
@@ -16769,16 +16884,19 @@
16769
16884
  return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
16770
16885
  ref: ref,
16771
16886
  as: "h1",
16772
- fontSize: fontSize,
16773
- lineHeight: lineHeight + "px",
16774
- fontWeight: "bold",
16887
+ fontSize: useResponsive ? undefined : fontSize,
16888
+ lineHeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.lineHeight : lineHeight + "px",
16889
+ fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
16890
+ letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
16891
+ marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
16775
16892
  textAlign: centered ? 'center' : 'left',
16776
- animate: inView ? animate : undefined
16893
+ animate: inView ? controlledAnimate : undefined,
16894
+ media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
16777
16895
  }, views == null ? void 0 : views.container, props), parts.map((part, idx) => typeof part === 'string' ? part : (/*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
16778
16896
  key: part.text + "-" + idx,
16779
16897
  as: "span",
16780
16898
  display: "inline",
16781
- animate: inView ? highlightAnimate : undefined
16899
+ animate: inView ? controlledHighlightAnimate : undefined
16782
16900
  }, HighlightStyles[highlightStyle](resolvedColor, resolvedSecondary), views == null ? void 0 : views.highlight), highlightTypewriter ? (/*#__PURE__*/React__default.createElement(TypewriterEffect, {
16783
16901
  text: part.text,
16784
16902
  typingSpeed: Math.max(30, highlightTypewriterDuration / (part.text.length * 10)),
@@ -16791,15 +16909,18 @@
16791
16909
  return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
16792
16910
  ref: ref,
16793
16911
  as: "h1",
16794
- fontSize: fontSize,
16795
- lineHeight: lineHeight + "px",
16796
- fontWeight: "bold",
16912
+ fontSize: useResponsive ? undefined : fontSize,
16913
+ lineHeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.lineHeight : lineHeight + "px",
16914
+ fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
16915
+ letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
16916
+ marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
16797
16917
  textAlign: centered ? 'center' : 'left',
16798
- animate: inView ? animate : undefined
16918
+ animate: inView ? controlledAnimate : undefined,
16919
+ media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
16799
16920
  }, views == null ? void 0 : views.container, props), /*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
16800
16921
  as: "span",
16801
16922
  display: "inline",
16802
- animate: inView ? highlightAnimate : undefined
16923
+ animate: inView ? controlledHighlightAnimate : undefined
16803
16924
  }, HighlightStyles[highlightStyle](resolvedColor, resolvedSecondary), views == null ? void 0 : views.highlight), highlightTypewriter ? (/*#__PURE__*/React__default.createElement(TypewriterEffect, {
16804
16925
  text: text,
16805
16926
  typingSpeed: Math.max(30, highlightTypewriterDuration / (text.length * 10)),
@@ -16811,11 +16932,14 @@
16811
16932
  return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
16812
16933
  ref: ref,
16813
16934
  as: "h1",
16814
- fontSize: fontSize,
16815
- lineHeight: lineHeight + "px",
16816
- fontWeight: "bold",
16935
+ fontSize: useResponsive ? undefined : fontSize,
16936
+ lineHeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.lineHeight : lineHeight + "px",
16937
+ fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
16938
+ letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
16939
+ marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
16817
16940
  textAlign: centered ? 'center' : 'left',
16818
- animate: inView ? animate : undefined
16941
+ animate: inView ? controlledAnimate : undefined,
16942
+ media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
16819
16943
  }, views == null ? void 0 : views.container, props), text);
16820
16944
  };
16821
16945