@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.
package/dist/web.esm.js CHANGED
@@ -16597,6 +16597,99 @@ var LineHeights$1 = {
16597
16597
  lg: 72,
16598
16598
  xl: 80
16599
16599
  };
16600
+ /**
16601
+ * Responsive typography system that maps title sizes to responsive breakpoints
16602
+ * Based on the Typography system with dynamic breakpoint sizing
16603
+ */
16604
+ var ResponsiveTypography = {
16605
+ // xl maps to H1 - Largest heading
16606
+ xl: {
16607
+ lineHeight: '120%',
16608
+ fontWeight: 500,
16609
+ marginBottom: 20,
16610
+ letterSpacing: 1.25,
16611
+ media: {
16612
+ mobile: {
16613
+ fontSize: 42,
16614
+ width: '100%'
16615
+ },
16616
+ tablet: {
16617
+ fontSize: 50,
16618
+ width: '100%'
16619
+ },
16620
+ desktop: {
16621
+ fontSize: 58,
16622
+ minWidth: '60%'
16623
+ }
16624
+ }
16625
+ },
16626
+ // lg maps to H2 - Large heading
16627
+ lg: {
16628
+ lineHeight: '100%',
16629
+ fontWeight: 500,
16630
+ media: {
16631
+ mobile: {
16632
+ fontSize: 32
16633
+ },
16634
+ tablet: {
16635
+ fontSize: 40
16636
+ },
16637
+ desktop: {
16638
+ fontSize: 48
16639
+ }
16640
+ }
16641
+ },
16642
+ // md maps to H3 - Medium heading
16643
+ md: {
16644
+ lineHeight: '100%',
16645
+ fontWeight: 500,
16646
+ media: {
16647
+ mobile: {
16648
+ fontSize: 20
16649
+ },
16650
+ tablet: {
16651
+ fontSize: 30
16652
+ },
16653
+ desktop: {
16654
+ fontSize: 40
16655
+ }
16656
+ }
16657
+ },
16658
+ // sm maps to T1 - Title text
16659
+ sm: {
16660
+ lineHeight: '100%',
16661
+ fontWeight: 400,
16662
+ letterSpacing: -0.2,
16663
+ media: {
16664
+ mobile: {
16665
+ fontSize: 16
16666
+ },
16667
+ tablet: {
16668
+ fontSize: 28
16669
+ },
16670
+ desktop: {
16671
+ fontSize: 32
16672
+ }
16673
+ }
16674
+ },
16675
+ // xs maps to S1 - Subtitle text
16676
+ xs: {
16677
+ lineHeight: '120%',
16678
+ fontWeight: 400,
16679
+ letterSpacing: -0.2,
16680
+ media: {
16681
+ mobile: {
16682
+ fontSize: 12
16683
+ },
16684
+ tablet: {
16685
+ fontSize: 18
16686
+ },
16687
+ desktop: {
16688
+ fontSize: 24
16689
+ }
16690
+ }
16691
+ }
16692
+ };
16600
16693
  /**
16601
16694
  * Default styles for different highlight types
16602
16695
  */
@@ -16715,7 +16808,7 @@ var TypewriterEffect = _ref => {
16715
16808
  }))))));
16716
16809
  };
16717
16810
 
16718
- var _excluded$S = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "centered", "views", "highlightAnimate", "animate", "highlightTypewriter", "highlightTypewriterDuration"];
16811
+ var _excluded$S = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "responsive", "centered", "views", "highlightAnimate", "animate", "animationLoop", "highlightAnimationLoop", "highlightTypewriter", "highlightTypewriterDuration"];
16719
16812
  function escapeRegExp(string) {
16720
16813
  return string.replace(/[.*+?^${}()|[\\]\\/g, '\\$&');
16721
16814
  }
@@ -16726,11 +16819,14 @@ var TitleView = _ref => {
16726
16819
  highlightStyle = 'background',
16727
16820
  highlightColor = 'theme.primary',
16728
16821
  highlightSecondaryColor,
16729
- size = 'xl',
16822
+ size = 'lg',
16823
+ responsive = true,
16730
16824
  centered = false,
16731
16825
  views,
16732
16826
  highlightAnimate,
16733
16827
  animate,
16828
+ animationLoop = 1,
16829
+ highlightAnimationLoop = 1,
16734
16830
  highlightTypewriter: propHighlightTypewriter = false,
16735
16831
  highlightTypewriterDuration = 3000
16736
16832
  } = _ref,
@@ -16768,8 +16864,27 @@ var TitleView = _ref => {
16768
16864
  highlightTypewriter: propHighlightTypewriter,
16769
16865
  highlightTypewriterDuration
16770
16866
  }, props));
16867
+ // Determine if we should use responsive sizing or static sizing
16868
+ var useResponsive = responsive && !props.media; // Don't override if media prop is already provided
16771
16869
  var fontSize = TitleSizes[size];
16772
16870
  var lineHeight = LineHeights$1[size];
16871
+ // Get responsive styles if responsive prop is true
16872
+ var responsiveStyles = useResponsive ? ResponsiveTypography[size] : null;
16873
+ // Helper function to apply loop control to animations
16874
+ var applyAnimationLoop = (animation, loopControl) => {
16875
+ if (!animation) return animation;
16876
+ if (Array.isArray(animation)) {
16877
+ return animation.map(anim => Object.assign({}, anim, {
16878
+ iterationCount: loopControl.toString()
16879
+ }));
16880
+ }
16881
+ return Object.assign({}, animation, {
16882
+ iterationCount: loopControl.toString()
16883
+ });
16884
+ };
16885
+ // Apply loop control to animations
16886
+ var controlledAnimate = applyAnimationLoop(animate, animationLoop);
16887
+ var controlledHighlightAnimate = applyAnimationLoop(highlightAnimate, highlightAnimationLoop);
16773
16888
  // Get the text to display
16774
16889
  var text = typeof finalDisplayedText === 'string' ? finalDisplayedText : typeof children === 'string' ? children : '';
16775
16890
  if (typeof text === 'string' && activeHighlightTarget) {
@@ -16793,16 +16908,19 @@ var TitleView = _ref => {
16793
16908
  return /*#__PURE__*/React.createElement(Element, Object.assign({
16794
16909
  ref: ref,
16795
16910
  as: "h1",
16796
- fontSize: fontSize,
16797
- lineHeight: lineHeight + "px",
16798
- fontWeight: "bold",
16911
+ fontSize: useResponsive ? undefined : fontSize,
16912
+ lineHeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.lineHeight : lineHeight + "px",
16913
+ fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
16914
+ letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
16915
+ marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
16799
16916
  textAlign: centered ? 'center' : 'left',
16800
- animate: inView ? animate : undefined
16917
+ animate: inView ? controlledAnimate : undefined,
16918
+ media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
16801
16919
  }, views == null ? void 0 : views.container, props), parts.map((part, idx) => typeof part === 'string' ? part : (/*#__PURE__*/React.createElement(Text$1, Object.assign({
16802
16920
  key: part.text + "-" + idx,
16803
16921
  as: "span",
16804
16922
  display: "inline",
16805
- animate: inView ? highlightAnimate : undefined
16923
+ animate: inView ? controlledHighlightAnimate : undefined
16806
16924
  }, HighlightStyles[highlightStyle](resolvedColor, resolvedSecondary), views == null ? void 0 : views.highlight), highlightTypewriter ? (/*#__PURE__*/React.createElement(TypewriterEffect, {
16807
16925
  text: part.text,
16808
16926
  typingSpeed: Math.max(30, highlightTypewriterDuration / (part.text.length * 10)),
@@ -16815,15 +16933,18 @@ var TitleView = _ref => {
16815
16933
  return /*#__PURE__*/React.createElement(Element, Object.assign({
16816
16934
  ref: ref,
16817
16935
  as: "h1",
16818
- fontSize: fontSize,
16819
- lineHeight: lineHeight + "px",
16820
- fontWeight: "bold",
16936
+ fontSize: useResponsive ? undefined : fontSize,
16937
+ lineHeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.lineHeight : lineHeight + "px",
16938
+ fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
16939
+ letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
16940
+ marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
16821
16941
  textAlign: centered ? 'center' : 'left',
16822
- animate: inView ? animate : undefined
16942
+ animate: inView ? controlledAnimate : undefined,
16943
+ media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
16823
16944
  }, views == null ? void 0 : views.container, props), /*#__PURE__*/React.createElement(Text$1, Object.assign({
16824
16945
  as: "span",
16825
16946
  display: "inline",
16826
- animate: inView ? highlightAnimate : undefined
16947
+ animate: inView ? controlledHighlightAnimate : undefined
16827
16948
  }, HighlightStyles[highlightStyle](resolvedColor, resolvedSecondary), views == null ? void 0 : views.highlight), highlightTypewriter ? (/*#__PURE__*/React.createElement(TypewriterEffect, {
16828
16949
  text: text,
16829
16950
  typingSpeed: Math.max(30, highlightTypewriterDuration / (text.length * 10)),
@@ -16835,11 +16956,14 @@ var TitleView = _ref => {
16835
16956
  return /*#__PURE__*/React.createElement(Element, Object.assign({
16836
16957
  ref: ref,
16837
16958
  as: "h1",
16838
- fontSize: fontSize,
16839
- lineHeight: lineHeight + "px",
16840
- fontWeight: "bold",
16959
+ fontSize: useResponsive ? undefined : fontSize,
16960
+ lineHeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.lineHeight : lineHeight + "px",
16961
+ fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
16962
+ letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
16963
+ marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
16841
16964
  textAlign: centered ? 'center' : 'left',
16842
- animate: inView ? animate : undefined
16965
+ animate: inView ? controlledAnimate : undefined,
16966
+ media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
16843
16967
  }, views == null ? void 0 : views.container, props), text);
16844
16968
  };
16845
16969