{"version":3,"file":"SelectionBox.BbsCykwZ.mjs","names":["useState","useRef","__esmMin","_e","p","c","init_jsx_runtime","ce","init_npm_react_18_3_1","de","addPropertyControls","init_framer_Bf4_tcb2","ControlType","SelectionBox","props","hover","setHover","size","setSize","ref","on","selected","liveSize","el","ro","label","tag","handle","accent","EASE","pos","style","stretch","idle","radius","init_SelectionBox"],"sources":["https:/framerusercontent.com/modules/Q9VES3mjKnioMSkWLZJr/b620TldpmX6Ib19zgXCs/SelectionBox.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const EASE=\"cubic-bezier(.3,0,.2,1)\";/**\n * Selection box from the NP system (What I do). Place it inside a card, filling it.\n * On hover (or when Selected) the frame stretches out and squares off, handles pop in,\n * and the tag (or the live size) shows on the bottom edge.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 240\n * @framerIntrinsicHeight 140\n */export default function SelectionBox(props){const{selected=false,tag=\"Result\",liveSize=false,radius=10,stretch=6,idle=\"#E3E3E3\",accent=\"#FF6500\",style}=props;const[hover,setHover]=useState(false);const[size,setSize]=useState(\"\");const ref=useRef(null);const on=selected||hover;useEffect(()=>{if(!liveSize||!ref.current||typeof ResizeObserver===\"undefined\")return;const el=ref.current;const ro=new ResizeObserver(()=>setSize(Math.round(el.offsetWidth)+\" \\xd7 \"+Math.round(el.offsetHeight)));ro.observe(el);return()=>ro.disconnect();},[liveSize]);const label=liveSize?size:tag;const handle=pos=>({position:\"absolute\",width:7,height:7,boxSizing:\"border-box\",background:\"var(--token-6255ab05-d1a4-45a4-aaac-b957d792b287, #FFFFFF)\",border:\"1px solid \"+accent,opacity:on?1:0,transform:on?\"scale(1)\":\"scale(0)\",transition:on?\"opacity .1s .09s, transform .1s .09s \"+EASE:\"opacity .12s, transform .12s \"+EASE,...pos});return /*#__PURE__*/_jsx(\"div\",{ref:ref,\"aria-hidden\":\"true\",onPointerEnter:()=>setHover(true),onPointerLeave:()=>setHover(false),style:{...style,position:\"relative\",width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",inset:on?-stretch:0,boxSizing:\"border-box\",pointerEvents:\"none\",border:\"1px solid \"+(on?accent:idle),borderRadius:on?0:radius,transition:\"inset .25s \"+EASE+\", border-radius .25s \"+EASE+\", border-color .2s \"+EASE},children:[/*#__PURE__*/_jsx(\"span\",{style:handle({left:-4,top:-4})}),/*#__PURE__*/_jsx(\"span\",{style:handle({right:-4,top:-4})}),/*#__PURE__*/_jsx(\"span\",{style:handle({left:-4,bottom:-4})}),/*#__PURE__*/_jsx(\"span\",{style:handle({right:-4,bottom:-4})}),label?/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",left:\"50%\",bottom:0,padding:\"4px 7px\",borderRadius:4,background:accent,color:\"var(--token-6255ab05-d1a4-45a4-aaac-b957d792b287, #FFFFFF)\",font:\"520 11px/1 'Allo Text Variable Regular','Allo Text', sans-serif\",fontVariationSettings:\"'wght' 520\",whiteSpace:\"nowrap\",fontVariantNumeric:\"tabular-nums\",opacity:on?1:0,transform:on?\"translate(-50%, 50%)\":\"translate(-50%, 90%)\",transition:on?\"opacity .12s .12s, transform .12s .12s \"+EASE:\"opacity .12s, transform .12s \"+EASE},children:label}):null]})});}addPropertyControls(SelectionBox,{selected:{type:ControlType.Boolean,title:\"Selected\",defaultValue:false},tag:{type:ControlType.String,title:\"Tag\",defaultValue:\"Result\",hidden:p=>p.liveSize},liveSize:{type:ControlType.Boolean,title:\"Live size\",defaultValue:false},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:10,min:0,max:40,step:1},stretch:{type:ControlType.Number,title:\"Stretch\",defaultValue:6,min:0,max:24,step:1},idle:{type:ControlType.Color,title:\"Idle\",defaultValue:\"#E3E3E3\"},accent:{type:ControlType.Color,title:\"Accent\",defaultValue:\"#FF6500\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SelectionBox\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"240\",\"framerIntrinsicHeight\":\"140\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SelectionBox.map"],"mappings":"A,+LASG,SAAwBa,EAAa,EAAM,CAAC,GAAK,CAAC,WAAS,GAAM,MAAI,SAAS,WAAS,GAAM,SAAO,GAAG,UAAQ,EAAE,OAAK,UAAU,SAAO,UAAU,SAAOC,EAAW,CAACC,EAAMC,GAAUhB,EAAS,EAAK,EAAO,CAACiB,EAAKC,GAASlB,EAAS,EAAE,EAAQmB,EAAIlB,EAAO,IAAI,EAAQmB,EAAGC,GAAUN,EAAMR,MAAc,CAAC,GAAG,CAACe,GAAU,CAACH,EAAI,SAAS,OAAO,eAAiB,IAAY,OAAO,IAAMI,EAAGJ,EAAI,QAAcK,EAAG,IAAI,mBAAmBN,EAAQ,KAAK,MAAMK,EAAG,WAAW,EAAE,MAAS,KAAK,MAAMA,EAAG,YAAY,CAAC,CAAC,EAAiB,OAAfC,EAAG,QAAQD,CAAE,MAAYC,EAAG,WAAW,CAAE,EAAE,CAACF,CAAQ,CAAC,EAAE,IAAMG,EAAMH,EAASL,EAAKS,EAAUC,EAAO,IAAM,CAAC,SAAS,WAAW,MAAM,EAAE,OAAO,EAAE,UAAU,aAAa,WAAW,6DAA6D,OAAO,aAAaC,EAAO,QAAQ,KAAO,UAAUR,EAAG,WAAW,WAAW,WAAWA,EAAG,wCAAwCS,EAAK,gCAAgCA,EAAK,GAAGC,CAAG,GAAG,MAAoB,gBAAK,MAAM,CAAK,MAAI,cAAc,OAAO,mBAAmBd,EAAS,EAAI,EAAE,mBAAmBA,EAAS,EAAK,EAAE,MAAM,CAAC,GAAGe,EAAM,SAAS,WAAW,M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