{"version":3,"file":"Button.lmtNl-R_.mjs","names":[],"sources":["https:/asset.29cm.co.kr/contents/framer/components/systems/Button/Button.utils.js","https:/asset.29cm.co.kr/contents/framer/components/systems/Button/Button.js","https:/framerusercontent.com/modules/StvG2c1V7uA5IIqUxIaE/vbcf7LFrQUhWMAfEAWy2/Button.js"],"sourcesContent":["import { getAnchorTarget } from \"../../../utils/getAnchorTarget.js\";\nconst reshapeProps = (props) => {\n  const {\n    url,\n    onTap,\n    prefixIcon,\n    postfixIcon,\n    fillIcon,\n    ...rest\n  } = props;\n  const disabled = rest.variant === \"disabled\";\n  return {\n    as: url ? \"a\" : \"button\",\n    href: url,\n    target: url ? getAnchorTarget(url) : \"_self\",\n    disabled,\n    onClick: onTap,\n    ...toPropsWithIcon(fillIcon, prefixIcon, postfixIcon),\n    ...rest\n  };\n};\nconst toPropsWithIcon = (fill, prefixIcon, postfixIcon) => {\n  if (!postfixIcon) {\n    return {\n      prefixIcon: toIconOptions(fill, prefixIcon)\n    };\n  }\n  return {\n    postfixIcon: toIconOptions(fill, postfixIcon)\n  };\n};\nconst toIconOptions = (fill, icon) => {\n  if (icon && typeof icon === \"string\") {\n    return {\n      type: icon,\n      fill\n    };\n  }\n  return void 0;\n};\nconst isValidUrl = (url) => {\n  if (!url) {\n    return true;\n  }\n  return url.startsWith(\"https://\");\n};\nexport {\n  isValidUrl,\n  reshapeProps\n};\n","import { jsxs, jsx } from \"react/jsx-runtime\";\nimport { addPropertyControls, ControlType } from \"framer\";\nimport { ButtonVariant, ButtonTheme, ButtonSize, UrlType } from \"../../@shared/Button/Button.types.js\";\nimport { useCreateIsomorphicAppSchemeLink } from \"../../../hooks/useCreateIsomorphicAppSchemeLink.js\";\nimport { isCanvas } from \"../../../utils/framer/isCanvas.js\";\nimport { Button as Default } from \"../../@shared/Button/Button.js\";\nimport { PREFIX_ICON_OPTIONS, POSTFIX_ICON_OPTIONS } from \"./Button.constants.js\";\nimport { reshapeProps, isValidUrl } from \"./Button.utils.js\";\nconst urlWarningStyle = {\n  marginTop: 4,\n  color: \"#dc2626\",\n  fontSize: 11,\n  fontWeight: 500\n};\nconst FramerButton = (props) => {\n  const url = useCreateIsomorphicAppSchemeLink(props.url);\n  const {\n    text,\n    ...rest\n  } = reshapeProps({\n    ...props,\n    url: props.urlType === UrlType.ONELINK ? props.url : url\n  });\n  const showUrlWarning = isCanvas() && !isValidUrl(props.url);\n  if (showUrlWarning) {\n    return /* @__PURE__ */ jsxs(\"div\", { style: {\n      display: \"inline-block\",\n      width: rest.fill ? \"100%\" : \"auto\"\n    }, children: [\n      /* @__PURE__ */ jsx(Default, { ...rest, children: text }),\n      /* @__PURE__ */ jsx(\"div\", { style: urlWarningStyle, children: \"⚠️ URL은 https://로 시작해야 합니다\" })\n    ] });\n  }\n  return /* @__PURE__ */ jsx(Default, { ...rest, children: text });\n};\naddPropertyControls(FramerButton, {\n  variant: {\n    type: ControlType.Enum,\n    title: \"변형\",\n    options: [ButtonVariant.PRIMARY, ButtonVariant.SECONDARY, ButtonVariant.TERTIARY, ButtonVariant.CUSTOM, ButtonVariant.DISABLED],\n    optionTitles: [\"primary\", \"secondary\", \"tertiary\", \"custom\", \"disabled\"]\n  },\n  theme: {\n    type: ControlType.Enum,\n    title: \"테마\",\n    options: [ButtonTheme.LIGHT, ButtonTheme.DARK],\n    optionTitles: [\"light\", \"dark\"],\n    defaultValue: ButtonTheme.LIGHT,\n    displaySegmentedControl: true\n  },\n  backgroundColor: {\n    hidden: ({\n      variant\n    }) => variant !== ButtonVariant.CUSTOM,\n    type: ControlType.Color,\n    title: \"배경 색상\",\n    optional: true\n  },\n  color: {\n    hidden: ({\n      variant\n    }) => variant !== ButtonVariant.CUSTOM,\n    type: ControlType.Color,\n    title: \"텍스트 색상\",\n    optional: true\n  },\n  size: {\n    type: ControlType.Enum,\n    title: \"크기\",\n    options: [ButtonSize.LARGE, ButtonSize.MEDIUM, ButtonSize.SMALL, ButtonSize.X_SMALL],\n    optionTitles: [\"large\", \"medium\", \"small\", \"xSmall\"],\n    defaultValue: ButtonSize.MEDIUM\n  },\n  fill: {\n    type: ControlType.Boolean,\n    title: \"반응형 너비\",\n    defaultValue: false\n  },\n  text: {\n    type: ControlType.String,\n    title: \"텍스트\",\n    defaultValue: \"텍스트\"\n  },\n  prefixIcon: {\n    hidden: ({\n      postfixIcon\n    }) => Boolean(postfixIcon),\n    type: ControlType.Enum,\n    title: \"좌측 아이콘\",\n    options: [void 0, ...PREFIX_ICON_OPTIONS],\n    optionTitles: [\"선택 안 함\", ...PREFIX_ICON_OPTIONS]\n  },\n  postfixIcon: {\n    hidden: ({\n      prefixIcon\n    }) => Boolean(prefixIcon),\n    type: ControlType.Enum,\n    title: \"우측 아이콘\",\n    options: [void 0, ...POSTFIX_ICON_OPTIONS],\n    optionTitles: [\"선택 안 함\", ...POSTFIX_ICON_OPTIONS]\n  },\n  fillIcon: {\n    type: ControlType.Boolean,\n    title: \"아이콘 채우기\",\n    defaultValue: false\n  },\n  url: {\n    hidden: ({\n      variant\n    }) => variant === ButtonVariant.DISABLED,\n    type: ControlType.Link,\n    title: \"URL\",\n    description: \"https://로 시작하는 전체 URL을 입력해주세요.\"\n  },\n  urlType: {\n    type: ControlType.Enum,\n    title: \"URL 타입\",\n    options: [UrlType.DEFAULT, UrlType.ONELINK],\n    optionTitles: [\"기본\", \"OneLink\"],\n    defaultValue: UrlType.DEFAULT,\n    description: \"onelink 타입을 선택하면 deeplink 변환없이 해당 url을 그대로 사용합니다.\"\n  },\n  onTap: {\n    hidden: ({\n      variant\n    }) => variant === ButtonVariant.DISABLED,\n    type: ControlType.EventHandler\n  }\n});\nexport {\n  FramerButton\n};\n","import{FramerButton}from\"https://asset.29cm.co.kr/contents/framer/components/systems/Button/Button.js\";FramerButton.displayName=\"Button\";/**\n * @framerDisableUnlink\n */export default FramerButton;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FramerButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":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