{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/AwAtbcM92MxKyxCaWYs2/3DogXEAp4ACwLLkA6R0j/Heading.js"],
  "sourcesContent": ["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useLayoutEffect, useRef, useState } from \"react\";\nimport { addPropertyControls, ControlType, RenderTarget } from \"framer\"; /**\n                                                                         * HEADING\n                                                                         * By @benjaminnathan\n                                                                         *\n                                                                         * @framerIntrinsicWidth 260\n                                                                         * @framerIntrinsicHeight 200\n                                                                         * @framerDisableUnlink\n                                                                         *\n                                                                         * @framerSupportedLayoutWidth fixed\n                                                                         * @framerSupportedLayoutHeight any\n                                                                         */\nexport default function Heading(props) {\n  const {\n    textContent,\n    minFontSize,\n    maxFontSize,\n    scaler,\n    offset,\n    font,\n    fontControlType,\n    color\n  } = props;\n  const {\n    // fontFamily,\n    // fontWeight,\n    fontStyle,\n    textAlign,\n    letterSpacing,\n    lineHeight,\n    textTransform\n  } = font;\n  const isCanvas = RenderTarget.current() === RenderTarget.canvas;\n  const clampedSize = `clamp(${minFontSize}px, ${scaler}vw, ${maxFontSize}px)`; /* Get width for canvas previewing */\n  const [width, setWidth] = useState(0);\n  const ref = useRef(null);\n  const clampedSizeOnCanvas = clamp(width * (scaler / 100), minFontSize, maxFontSize); /* Grab the width on prop changes */\n  if (isCanvas) {\n    useLayoutEffect(() => {\n      setWidth(ref.current.offsetWidth);\n    });\n  }\n  return /*#__PURE__*/_jsx(\"h1\", {\n    ref: ref,\n    style: {\n      color,\n      fontFamily: \"Inter, sans-serif\",\n      fontWeight: \"normal\",\n      ...fontControlType,\n      fontSize: isCanvas ? clampedSizeOnCanvas : clampedSize,\n      fontStyle,\n      textAlign,\n      letterSpacing: `${letterSpacing / 100}em`,\n      lineHeight: isCanvas ? `${clampedSizeOnCanvas * lineHeight}px` : lineHeight,\n      textTransform,\n      whiteSpace: \"nowrap\",\n      margin: 0,\n      padding: 0,\n      position: \"relative\",\n      left: `${offset}%`\n    },\n    children: textContent\n  });\n}\n; /* Default Properties */\nHeading.defaultProps = {\n  textContent: \"Hello\",\n  color: \"#888\"\n};\nHeading.displayName = \"Heading\"; /* Property Controls */\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  color: {\n    type: ControlType.Color,\n    defaultValue: \"#888\"\n  },\n  fontControlType: {\n    type: ControlType.Font,\n    title: \"Font\",\n    controls: \"basic\"\n  },\n  font: {\n    type: ControlType.Object,\n    title: \"Type\",\n    controls: {\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        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      textTransform: {\n        type: ControlType.Enum,\n        title: \"Transform\",\n        options: [\"none\", \"capitalize\", \"uppercase\", \"lowercase\"],\n        optionTitles: [\"None\", \"Capitalize\", \"Uppercase\", \"Lowercase\"]\n      }\n    }\n  }\n}); /* Manual clamping for canvas */\nconst clamp = (num, min, max) => Math.min(Math.max(num, min), max);\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"default\": {\n      \"type\": \"reactComponent\",\n      \"name\": \"Heading\",\n      \"slots\": [],\n      \"annotations\": {\n        \"framerContractVersion\": \"1\",\n        \"framerSupportedLayoutHeight\": \"any\",\n        \"framerDisableUnlink\": \"*\",\n        \"framerIntrinsicHeight\": \"200\",\n        \"framerSupportedLayoutWidth\": \"fixed\",\n        \"framerIntrinsicWidth\": \"260\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n};\n//# sourceMappingURL=./Heading.map"],
  "mappings": "qHAae,SAARA,EAAyBC,EAAO,CACrC,GAAM,CACJ,YAAAC,EACA,YAAAC,EACA,YAAAC,EACA,OAAAC,EACA,OAAAC,EACA,KAAAC,EACA,gBAAAC,EACA,MAAAC,CACF,EAAIR,EACE,CAGJ,UAAAS,EACA,UAAAC,EACA,cAAAC,EACA,WAAAC,EACA,cAAAC,CACF,EAAIP,EACEQ,EAAWC,EAAa,QAAQ,IAAMA,EAAa,OACnDC,EAAc,SAASd,QAAkBE,QAAaD,OACtD,CAACc,EAAOC,CAAQ,EAAIC,EAAS,CAAC,EAC9BC,EAAMC,EAAO,IAAI,EACjBC,EAAsBC,EAAMN,GAASb,EAAS,KAAMF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,SAAU,SAAU,SAAS,EACvC,aAAc,CAAC,SAAU,SAAU,SAAS,EAC5C,aAAc,QAChB,EACA,UAAW,CACT,KAAMA,EAAY,KAClB,wBAAyB,GACzB,MAAO,QACP,QAAS,CAAC,OAAQ,SAAU,OAAO,EACnC,aAAc,CAAC,OAAQ,SAAU,OAAO,EACxC,aAAc,QAChB,EACA,cAAe,CACb,KAAMA,EAAY,OAClB,MAAO,SACP,IAAK,KACL,IAAK,IACL,eAAgB,GAChB,KAAM,GACN,aAAc,GACd,KAAM,GACR,EACA,WAAY,CACV,KAAMA,EAAY,OAClB,MAAO,OACP,IAAK,KACL,IAAK,IACL,eAAgB,GAChB,KAAM,GACN,aAAc,CAChB,EACA,cAAe,CACb,KAAMA,EAAY,KAClB,MAAO,YACP,QAAS,CAAC,OAAQ,aAAc,YAAa,WAAW,EACxD,aAAc,CAAC,OAAQ,aAAc,YAAa,WAAW,CAC/D,CACF,CACF,CACF,CAAC,EACD,IAAMJ,EAAQ,CAACK,EAAKC,EAAKC,IAAQ,KAAK,IAAI,KAAK,IAAIF,EAAKC,CAAG,EAAGC,CAAG",
  "names": ["Heading", "props", "textContent", "minFontSize", "maxFontSize", "scaler", "offset", "font", "fontControlType", "color", "fontStyle", "textAlign", "letterSpacing", "lineHeight", "textTransform", "isCanvas", "RenderTarget", "clampedSize", "width", "setWidth", "ye", "ref", "pe", "clampedSizeOnCanvas", "clamp", "fe", "p", "addPropertyControls", "ControlType", "num", "min", "max"]
}
