{"version":3,"file":"TextButton.Dfgac1il.mjs","names":["forwardRef"],"sources":["https:/asset.29cm.co.kr/contents/framer/components/@shared/TextButton/TextButton.js"],"sourcesContent":["import { jsxs, jsx } from \"react/jsx-runtime\";\nimport { forwardRef } from \"react\";\nimport { Icon } from \"../Icon/Icon.js\";\nimport { typography } from \"../../../styles/typography.js\";\nconst TextButton = ({\n  children,\n  style,\n  as,\n  theme = \"light\",\n  size = \"medium\",\n  prefixIcon,\n  postfixIcon,\n  variant,\n  backgroundColor,\n  color,\n  isUnderlined = false,\n  ...rest\n}, ref) => {\n  const Component = as ?? \"button\";\n  const variantStyle = textButtonStyleByVariant[rest.disabled ? \"disabled\" : variant];\n  const textButtonStyle = {\n    ...style,\n    ...baseTextButtonStyle,\n    ...textButtonStyleBySize[size],\n    ...variantStyle[theme],\n    ...isUnderlined && {\n      textDecoration: \"underline\"\n    }\n  };\n  const reshapedProps = {\n    ...rest,\n    href: rest.disabled ? void 0 : rest.href,\n    onClick: rest.disabled ? void 0 : rest.onClick\n  };\n  return /* @__PURE__ */ jsxs(Component, { ref, ...reshapedProps, style: textButtonStyle, children: [\n    prefixIcon ? /* @__PURE__ */ jsx(Icon, { type: getIconType(prefixIcon), fill: getIconFill(prefixIcon), size: iconSizeByButtonSize[size], color: textButtonStyle.color, weight: \"bold\" }) : null,\n    /* @__PURE__ */ jsx(\"div\", { style: contentStyle, children }),\n    postfixIcon ? /* @__PURE__ */ jsx(Icon, { type: getIconType(postfixIcon), fill: getIconFill(postfixIcon), size: iconSizeByButtonSize[size], color: textButtonStyle.color, weight: \"bold\" }) : null\n  ] });\n};\nconst getIconType = (icon) => typeof icon === \"string\" ? icon : icon.type;\nconst getIconFill = (icon) => typeof icon === \"string\" ? void 0 : icon.fill;\nconst baseTextButtonStyle = {\n  minWidth: \"fit-content\",\n  height: \"auto\",\n  display: \"flex\",\n  alignItems: \"center\",\n  justifyContent: \"center\",\n  cursor: \"pointer\",\n  // reset button element css\n  backgroundColor: \"transparent\",\n  textDecoration: \"none\",\n  padding: 0,\n  outline: \"none\",\n  border: \"none\",\n  boxSizing: \"border-box\"\n};\nconst textButtonStyleBySize = {\n  large: {\n    gap: \"4px\",\n    ...typography(18, 600, 1.2)\n  },\n  medium: {\n    gap: \"4px\",\n    ...typography(16, 600, 1.2)\n  },\n  small: {\n    gap: \"2px\",\n    ...typography(14, 600, 1.2)\n  },\n  xSmall: {\n    gap: \"2px\",\n    ...typography(12, 700, 1.36)\n  }\n};\nconst textButtonStyleByVariant = {\n  primary: {\n    light: {\n      color: \"#000\"\n    },\n    dark: {\n      color: \"#fff\"\n    }\n  },\n  secondary: {\n    light: {\n      color: \"#474747\"\n    },\n    dark: {\n      color: \"#a0a0a0\"\n    }\n  },\n  tertiary: {\n    light: {\n      color: \"#a0a0a0\"\n    },\n    dark: {\n      color: \"#474747\"\n    }\n  },\n  disabled: {\n    light: {\n      color: \"#c4c4c4\",\n      cursor: \"not-allowed\"\n    },\n    dark: {\n      color: \"#303033\",\n      cursor: \"not-allowed\"\n    }\n  }\n};\nconst iconSizeByButtonSize = {\n  large: 20,\n  medium: 18,\n  small: 16,\n  xSmall: 12\n};\nconst contentStyle = {\n  display: \"flex\",\n  alignItems: \"center\"\n};\nconst Default = forwardRef(TextButton);\nexport {\n  Default as TextButton\n};\n"],"mappings":"mOAA8C,IACX,IACI,IACoB,CACrD,GAAc,CAClB,WACA,QACA,KACA,QAAQ,QACR,OAAO,SACP,aACA,cACA,UACA,kBACA,QACA,eAAe,GACf,GAAG,GACF,IAAQ,CACT,IAAM,EAAY,GAAM,SAClB,EAAe,EAAyB,EAAK,SAAW,WAAa,GACrE,EAAkB,CACtB,GAAG,EACH,GAAG,EACH,GAAG,EAAsB,GACzB,GAAG,EAAa,GAChB,GAAG,GAAgB,CACjB,eAAgB,YACjB,CACF,CAMD,OAAuB,EAAK,EAAW,CAAE,MAJvC,GAAG,EACH,KAAM,EAAK,SAAW,IAAK,GAAI,EAAK,KACpC,QAAS,EAAK,SAAW,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