{"version":3,"file":"FoldableList.DMjYooIs.mjs","names":["createContext","withStyle","forwardRef","classNames","useState","useContext","withStyle","forwardRef","classNames","withStyle","forwardRef","classNames","forwardRef","FoldableList","__esmMin","init_npm_react_18_3_1","oe","p","B","J","init_jsx_runtime","ce","_e","motion","useAnimationControls","AnimatePresence","init_framer_motion_DhsWWWsN","init_framer_DKtAEkcX","ControlType","addPropertyControls","cx","init_theme","Theme","init_ComponentName","init_content_store","init_css","createWithStyle","typography","Skeleton","typographyCSS","init_Skeleton","css","init_isCanvas","init_createWithStyle","init_source","init_Icon","init_typography","Icon","isCanvas","ComponentName","classNames$3","withStyle$3","FoldableListContext","Root","skeletonStyle","skeletonStyleByTheme","init_Root","init_Root_hooks","rest","useFold","pending","theme","className","useFoldableListContext","isFolded","setIsFolded","prev","context","useFoldControls","init_Content_hooks","controls","classNames$2","withStyle$2","Content","init_Content","textStyleByTheme","init_Root_constants","classNames$1","withStyle$1","Item","init_Item","\"container\"","color","style","classNames","withStyle","Trigger","baseTextStyle","init_Trigger","textColor","icons","onClick","toggleFold","textStyle","initial","active","FoldableList","init_FoldableList","FramerFoldableList","init_FoldableList$1","title","list","item","index","FoldableList_default","init_FoldableList$2"],"sources":["https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/Root.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/Root.hooks.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/Content.hooks.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/Content.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/Root.constants.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/Item.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/Trigger.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/index.js","https:/asset.29cm.co.kr/contents/framer/components/systems/FoldableList/FoldableList.js","https:/framerusercontent.com/modules/tUBiKZg56pi21zdt8uQV/cl4efca9dm68GLvEXnUm/FoldableList.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { createContext, forwardRef } from \"react\";\nimport { ComponentName } from \"../../../styles/ComponentName.js\";\nimport { createWithStyle } from \"../../../styles/createWithStyle.js\";\nimport { css } from \"../../../styles/css.js\";\nimport { useFold } from \"./Root.hooks.js\";\nimport { cx } from \"framer\";\nimport { Skeleton } from \"../Skeleton/Skeleton.js\";\nconst {\n  classNames,\n  withStyle\n} = createWithStyle(ComponentName.FoldableListRoot, {\n  container: css`\n    display: flex;\n    flex-direction: column;\n    align-items: flex-start;\n  `\n});\nconst FoldableListContext = createContext(null);\nconst Root = withStyle(forwardRef(({\n  children,\n  className,\n  theme = \"light\",\n  pending = false,\n  color,\n  ...rest\n}, ref) => {\n  const {\n    isFolded,\n    toggleFold\n  } = useFold();\n  if (pending) {\n    return /* @__PURE__ */ jsx(Skeleton, { style: {\n      ...skeletonStyle,\n      ...skeletonStyleByTheme[theme]\n    } });\n  }\n  return /* @__PURE__ */ jsx(FoldableListContext.Provider, { value: {\n    theme,\n    color,\n    isFolded,\n    toggleFold\n  }, children: /* @__PURE__ */ jsx(\"div\", { className: cx(className, classNames.container), ref, ...rest, children }) });\n}));\nconst skeletonStyle = {\n  width: 100,\n  height: 20,\n  borderRadius: 4\n};\nconst skeletonStyleByTheme = {\n  light: {\n    backgroundColor: \"#dee2e6\"\n  },\n  dark: {\n    backgroundColor: \"#27272a\"\n  }\n};\nexport {\n  FoldableListContext,\n  Root\n};\n","import { useState, useContext } from \"react\";\nimport { FoldableListContext } from \"./Root.js\";\nconst useFold = () => {\n  const [isFolded, setIsFolded] = useState(true);\n  const toggleFold = () => {\n    setIsFolded((prev) => !prev);\n  };\n  return {\n    isFolded,\n    toggleFold\n  };\n};\nconst useFoldableListContext = () => {\n  const context = useContext(FoldableListContext);\n  if (!context) {\n    throw new Error(\"useFoldableListContext should be used within Root\");\n  }\n  return context;\n};\nexport {\n  useFold,\n  useFoldableListContext\n};\n","import { useAnimationControls } from \"framer-motion\";\nimport { useFoldableListContext } from \"./Root.hooks.js\";\nimport { useEffect } from \"react\";\nconst useFoldControls = () => {\n  const {\n    isFolded\n  } = useFoldableListContext();\n  const controls = useAnimationControls();\n  useEffect(() => {\n    if (isFolded) {\n      controls.start({\n        height: 0\n      });\n    } else {\n      controls.start({\n        height: \"auto\"\n      });\n    }\n  }, [isFolded]);\n  return controls;\n};\nexport {\n  useFoldControls\n};\n","import { jsx } from \"react/jsx-runtime\";\nimport { forwardRef } from \"react\";\nimport { ComponentName } from \"../../../styles/ComponentName.js\";\nimport { createWithStyle } from \"../../../styles/createWithStyle.js\";\nimport { css } from \"../../../styles/css.js\";\nimport { motion } from \"framer-motion\";\nimport { cx } from \"framer\";\nimport { useFoldControls } from \"./Content.hooks.js\";\nconst {\n  classNames,\n  withStyle\n} = createWithStyle(ComponentName.FoldableListContent, {\n  container: css`\n    display: flex;\n    flex-direction: column;\n    gap: 2px;\n    padding-top: 7px;\n  `\n});\nconst Content = withStyle(forwardRef(({\n  children,\n  className,\n  ...rest\n}, ref) => {\n  const controls = useFoldControls();\n  return /* @__PURE__ */ jsx(motion.div, { ref, initial: {\n    height: 0\n  }, animate: controls, style: {\n    overflow: \"hidden\"\n  }, transition: {\n    type: \"spring\",\n    stiffness: 500,\n    damping: 60,\n    mass: 1\n  }, children: /* @__PURE__ */ jsx(\"div\", { className: cx(className, classNames.container), ...rest, children }) });\n}));\nexport {\n  Content\n};\n","const textStyleByTheme = {\n  light: {\n    color: \"#474747\"\n  },\n  dark: {\n    color: \"#a0a0a0\"\n  }\n};\nexport {\n  textStyleByTheme\n};\n","import { jsx } from \"react/jsx-runtime\";\nimport { cx } from \"framer\";\nimport { forwardRef } from \"react\";\nimport { ComponentName } from \"../../../styles/ComponentName.js\";\nimport { createWithStyle } from \"../../../styles/createWithStyle.js\";\nimport { css } from \"../../../styles/css.js\";\nimport { typographyCSS } from \"../../../styles/typography.js\";\nimport { useFoldableListContext } from \"./Root.hooks.js\";\nimport { textStyleByTheme } from \"./Root.constants.js\";\nconst {\n  classNames,\n  withStyle\n} = createWithStyle(ComponentName.FoldableListItem, {\n  \"container\": css`\n    display: flex;\n\n    ${typographyCSS(12, 400)};\n\n    line-height: 1.6em;\n    white-space: pre-wrap;\n    word-break: keep-all;\n  `,\n  \"container::before\": css`\n    content: '•';\n    font-size: 16px;\n    margin-right: 6px;\n  `\n});\nconst Item = withStyle(forwardRef(({\n  children,\n  className,\n  style,\n  ...rest\n}, ref) => {\n  const {\n    theme,\n    color\n  } = useFoldableListContext();\n  return /* @__PURE__ */ jsx(\"div\", { ref, className: cx(className, classNames.container), style: {\n    color: color ?? textStyleByTheme[theme].color,\n    ...style\n  }, ...rest, children });\n}));\nexport {\n  Item\n};\n","import { jsxs, jsx } from \"react/jsx-runtime\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { forwardRef } from \"react\";\nimport { ComponentName } from \"../../../styles/ComponentName.js\";\nimport { createWithStyle } from \"../../../styles/createWithStyle.js\";\nimport { css } from \"../../../styles/css.js\";\nimport { typographyCSS } from \"../../../styles/typography.js\";\nimport { Icon } from \"../Icon/Icon.js\";\nimport { cx } from \"framer\";\nimport { useFoldableListContext } from \"./Root.hooks.js\";\nimport \"../../../hooks/stores/content/content.store.js\";\nimport \"../../../utils/event-properties/source.js\";\nimport { isCanvas } from \"../../../utils/framer/isCanvas.js\";\nimport { textStyleByTheme } from \"./Root.constants.js\";\nconst {\n  classNames,\n  withStyle\n} = createWithStyle(ComponentName.FoldableListTrigger, {\n  container: css`\n    display: flex;\n    align-items: center;\n    gap: 4px;\n    cursor: pointer;\n  `,\n  text: typographyCSS(14, 500, 1.6)\n});\nconst Trigger = withStyle(forwardRef(({\n  children,\n  className,\n  textStyle,\n  icons,\n  onClick,\n  ...rest\n}, ref) => {\n  const {\n    theme,\n    color,\n    isFolded,\n    toggleFold\n  } = useFoldableListContext();\n  const textColor = color ?? textStyleByTheme[theme].color;\n  const {\n    initial = \"chevronDown\",\n    active = \"chevronUp\",\n    size = 14\n  } = icons ?? {};\n  const handleClick = (e) => {\n    onClick == null ? void 0 : onClick(e);\n    toggleFold();\n  };\n  return /* @__PURE__ */ jsxs(\"div\", { ref, className: cx(className, classNames.container), onClick: handleClick, ...rest, children: [\n    /* @__PURE__ */ jsx(\"div\", { className: classNames.text, style: {\n      color: textColor,\n      ...baseTextStyle,\n      ...textStyle\n    }, children }),\n    /* @__PURE__ */ jsx(AnimatePresence, { mode: \"wait\", children: /* @__PURE__ */ jsx(motion.div, { style: {\n      display: \"flex\",\n      alignItems: \"center\",\n      justifyContent: \"center\"\n    }, animate: {\n      opacity: 1\n    }, initial: {\n      opacity: isCanvas() ? 1 : 0\n    }, exit: {\n      opacity: 0\n    }, transition: {\n      duration: 0.2\n    }, children: /* @__PURE__ */ jsx(Icon, { type: isFolded ? initial : active, color: textColor, size, weight: \"bold\" }) }, isFolded ? \"plus\" : \"minus\") })\n  ] });\n}));\nconst baseTextStyle = {\n  minHeight: 20,\n  display: \"flex\",\n  alignItems: \"center\"\n};\nexport {\n  Trigger\n};\n","import { Content } from \"./Content.js\";\nimport { Item } from \"./Item.js\";\nimport { Root } from \"./Root.js\";\nimport { Trigger } from \"./Trigger.js\";\nconst FoldableList = {\n  Root,\n  Trigger,\n  Content,\n  Item\n};\nexport {\n  FoldableList\n};\n","import { jsxs, jsx } from \"react/jsx-runtime\";\nimport { addPropertyControls, ControlType } from \"framer\";\nimport { FoldableList } from \"../../@shared/FoldableList/index.js\";\nimport \"react\";\nimport { typography } from \"../../../styles/typography.js\";\nimport { Theme } from \"../../../styles/theme.js\";\nconst FramerFoldableList = ({\n  theme,\n  title,\n  list\n}) => {\n  return /* @__PURE__ */ jsxs(FoldableList.Root, { theme, children: [\n    /* @__PURE__ */ jsx(FoldableList.Trigger, { textStyle: typography(12, 700), icons: {\n      initial: \"chevronDown\",\n      active: \"chevronUp\",\n      size: 12\n    }, children: title }),\n    /* @__PURE__ */ jsx(FoldableList.Content, { children: list.map((item, index) => (\n      // eslint-disable-next-line react/no-array-index-key\n      /* @__PURE__ */ jsx(FoldableList.Item, { children: item }, index)\n    )) })\n  ] });\n};\naddPropertyControls(FramerFoldableList, {\n  theme: {\n    type: ControlType.Enum,\n    title: \"테마\",\n    options: [Theme.LIGHT, Theme.DARK],\n    optionTitles: [\"light\", \"dark\"]\n  },\n  title: {\n    type: ControlType.String,\n    title: \"제목\",\n    placeholder: \"제목 입력\",\n    defaultValue: \"텍스트\"\n  },\n  list: {\n    type: ControlType.Array,\n    title: \"목록\",\n    control: {\n      type: ControlType.String,\n      title: \"내용\",\n      placeholder: \"내용 입력\"\n    }\n  }\n});\nexport {\n  FramerFoldableList\n};\n","import{FramerFoldableList as FoldableList}from\"https://asset.29cm.co.kr/contents/framer/components/systems/FoldableList/FoldableList.js\";FoldableList.displayName=\"[레거시]FoldableList\";/**\n * @framerDisableUnlink\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 400\n */export default FoldableList;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FoldableList\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutHeight\":\"auto\",\"framerDisableUnlink\":\"* @framerSupportedLayoutWidth fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FoldableList.map"],"mappings":"A,+kBASE,CAAA,WAAAkD,EACA,UAAAC,GACEf,EAAgBa,EAAc,iBAAkB,CAClD,UAAW,CAAG;;;;GAKhB,CAAC,EACK,EAAsBjD,EAAc,IAAI,EACxC,EAAOC,EAAUC,GAAY,CACjC,WACA,YACA,QAAQ,QACR,UAAU,GACV,QACA,GAAGwD,GACF,IAAQ,CACT,GAAM,CACJ,WACA,cACEC,EAAQ,EAOZ,OANIC,EACqB,kBAAItB,GAAU,CAAE,MAAO,CAC5C,GAAGgB,EACH,GAAGC,EAAq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