{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/AwAtbcM92MxKyxCaWYs2/8rwzUY5hA41IZh4w8gKu/Heading.js"],
  "sourcesContent": ["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useLayoutEffect, useRef, useState } from \"react\";\nimport { addPropertyControls, ControlType, RenderTarget } from \"framer\";\n/**\n* HEADING\n*\n* @framerIntrinsicWidth 260\n* @framerIntrinsicHeight 200\n* @framerDisableUnlink\n*\n* @framerSupportedLayoutWidth any-prefer-fixed\n* @framerSupportedLayoutHeight any\n*/\n\nexport default function Heading(props) {\n  const {\n    textContent,\n    minFontSize,\n    maxFontSize,\n    scaler,\n    offset,\n    font\n  } = props;\n  const {\n    color,\n    fontFamily,\n    fontWeight,\n    fontStyle,\n    textAlign,\n    letterSpacing,\n    lineHeight\n  } = font;\n  const isCanvas = RenderTarget.current() === RenderTarget.canvas;\n  const clampedSize = `clamp(${minFontSize}px, ${scaler}vw, ${maxFontSize}px)`;\n  /* Get width for canvas previewing */\n\n  const [width, setWidth] = useState(0);\n  const ref = useRef(null);\n  const clampedSizeOnCanvas = clamp(width * (scaler / 100), minFontSize, maxFontSize);\n  /* Grab the width on prop changes */\n\n  if (isCanvas) {\n    useLayoutEffect(() => {\n      setWidth(ref.current.offsetWidth);\n    });\n  }\n\n  return /*#__PURE__*/_jsx(\"h1\", {\n    ref: ref,\n    style: {\n      color,\n      fontSize: isCanvas ? clampedSizeOnCanvas : clampedSize,\n      fontFamily: `\"${fontFamily}\", sans-serif`,\n      fontStyle,\n      fontWeight,\n      textAlign,\n      letterSpacing: `${letterSpacing / 100}em`,\n      lineHeight: isCanvas ? `${clampedSizeOnCanvas * lineHeight}px` : lineHeight,\n      whiteSpace: \"nowrap\",\n      margin: 0,\n      padding: 0,\n      position: \"relative\",\n      left: `${offset}%`\n    },\n    children: textContent\n  });\n}\n;\n/* Default Properties */\n\nHeading.defaultProps = {\n  textContent: \"Hello\"\n};\nHeading.displayName = \"Heading\";\n/* Property Controls */\n\naddPropertyControls(Heading, {\n  textContent: {\n    type: ControlType.String,\n    title: \"Text\",\n    defaultValue: \"Hello\"\n  },\n  scaler: {\n    type: ControlType.Number,\n    title: \"Scaler\",\n    min: 0,\n    max: 100,\n    displayStepper: true,\n    step: 1,\n    unit: \"vw\",\n    defaultValue: 20\n  },\n  minFontSize: {\n    type: ControlType.Number,\n    title: \"Min Size\",\n    min: 0,\n    displayStepper: true,\n    step: 1,\n    unit: \"px\",\n    defaultValue: 100\n  },\n  maxFontSize: {\n    type: ControlType.Number,\n    title: \"Max Size\",\n    min: 0,\n    displayStepper: true,\n    step: 1,\n    unit: \"px\",\n    defaultValue: 600\n  },\n  offset: {\n    type: ControlType.Number,\n    title: \"Offset\",\n    min: -100,\n    max: 100,\n    displayStepper: true,\n    step: .25,\n    defaultValue: 0,\n    unit: \"%\"\n  },\n  font: {\n    type: ControlType.Object,\n    controls: {\n      color: {\n        type: ControlType.Color,\n        defaultValue: \"#888\"\n      },\n      fontFamily: {\n        type: ControlType.String,\n        title: \"Font\",\n        defaultValue: \"Inter\"\n      },\n      fontWeight: {\n        type: ControlType.Enum,\n        title: \"Weight\",\n        options: [100, 200, 300, 400, 500, 600, 700, 800, 900],\n        defaultValue: 400\n      },\n      fontStyle: {\n        type: ControlType.Enum,\n        title: \"Style\",\n        options: [\"normal\", \"italic\", \"oblique\"],\n        optionTitles: [\"Normal\", \"Italic\", \"Oblique\"],\n        defaultValue: \"normal\"\n      },\n      textAlign: {\n        type: ControlType.Enum,\n        displaySegmentedControl: true,\n        title: \"Align\",\n        // segmentedControlDirection: \"vertical\",\n        options: [\"left\", \"center\", \"right\"],\n        optionTitles: [\"Left\", \"Center\", \"Right\"],\n        defaultValue: \"center\"\n      },\n      letterSpacing: {\n        type: ControlType.Number,\n        title: \"Letter\",\n        min: -100,\n        max: 100,\n        displayStepper: true,\n        step: 1,\n        defaultValue: -5,\n        unit: \"%\"\n      },\n      lineHeight: {\n        type: ControlType.Number,\n        title: \"Line\",\n        min: -100,\n        max: 100,\n        displayStepper: true,\n        step: .1,\n        defaultValue: 1\n      }\n    }\n  }\n});\n/* Manual clamping for canvas */\n\nconst clamp = (num, min, max) => Math.min(Math.max(num, min), max);\n\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"default\": {\n      \"type\": \"reactComponent\",\n      \"name\": \"Heading\",\n      \"slots\": [],\n      \"annotations\": {\n        \"framerIntrinsicHeight\": \"200\",\n        \"framerSupportedLayoutHeight\": \"any\",\n        \"framerIntrinsicWidth\": \"260\",\n        \"framerContractVersion\": \"1\",\n        \"framerSupportedLayoutWidth\": \"any-prefer-fixed\",\n        \"framerDisableUnlink\": \"*\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n}; //# sourceMappingURL=./Heading.map"],
  "mappings": "gHAce,SAARA,EAAyBC,EAAO,CACrC,GAAM,CACJ,YAAAC,EACA,YAAAC,EACA,YAAAC,EACA,OAAAC,EACA,OAAAC,EACA,KAAAC,CACF,EAAIN,EACE,CACJ,MAAAO,EACA,WAAAC,EACA,WAAAC,EACA,UAAAC,EACA,UAAAC,EACA,cAAAC,EACA,WAAAC,CACF,EAAIP,EACEQ,EAAWC,EAAa,QAAQ,IAAMA,EAAa,OACnDC,EAAc,SAASd,QAAkBE,QAAaD,OAGtD,CAACc,EAAOC,CAAQ,EAAIC,EAAS,CAAC,EAC9BC,EAAMC,EAAO,IAAI,EACjBC,EAAsBC,EAAMN,GAASb,EAAS,KAAMF,EAAaC,CAAW,EAGlF,OAAIW,GACFU,EAAgB,IAAM,CACpBN,EAASE,EAAI,QAAQ,WAAW,CAClC,CAAC,EAGiBK,EAAK,KAAM,CAC7B,IAAKL,EACL,MAAO,CACL,MAAAb,EACA,SAAUO,EAAWQ,EAAsBN,EAC3C,WAAY,IAAIR,iBAChB,UAAAE,EACA,WAAAD,EACA,UAAAE,EACA,cAAe,GAAGC,EAAgB,QAClC,WAAYE,EAAW,GAAGQ,EAAsBT,M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AAc,QAChB,EACA,cAAe,CACb,KAAMA,EAAY,OAClB,MAAO,SACP,IAAK,KACL,IAAK,IACL,eAAgB,GAChB,KAAM,EACN,aAAc,GACd,KAAM,GACR,EACA,WAAY,CACV,KAAMA,EAAY,OAClB,MAAO,OACP,IAAK,KACL,IAAK,IACL,eAAgB,GAChB,KAAM,GACN,aAAc,CAChB,CACF,CACF,CACF,CAAC,EAGD,IAAMJ,EAAQ,CAACK,EAAKC,EAAKC,IAAQ,KAAK,IAAI,KAAK,IAAIF,EAAKC,CAAG,EAAGC,CAAG",
  "names": ["Heading", "props", "textContent", "minFontSize", "maxFontSize", "scaler", "offset", "font", "color", "fontFamily", "fontWeight", "fontStyle", "textAlign", "letterSpacing", "lineHeight", "isCanvas", "RenderTarget", "clampedSize", "width", "setWidth", "ye", "ref", "pe", "clampedSizeOnCanvas", "clamp", "fe", "p", "addPropertyControls", "ControlType", "num", "min", "max"]
}
