var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Hoverable=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _primitives=require("../../primitives");var _Text=_interopRequireDefault(require("../../primitives/Button/styled-components/Text"));var _LayoutContext=require("../Layout/LayoutContext");var _jsxRuntime=require("react/jsx-runtime");function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var Hoverable=function Hoverable(_ref){var href=_ref.href,heading=_ref.heading,subHeading=_ref.subHeading;var _React$useState=_react.default.useState(false),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),isHovered=_React$useState2[0],setIsHovered=_React$useState2[1];var _useContext=(0,_react.useContext)(_LayoutContext.LayoutContext),NextLink=_useContext.Link;var LinkComponent=NextLink!=null?NextLink:_primitives.Link;return(0,_jsxRuntime.jsx)(LinkComponent,{href:href,style:{marginBottom:16,flex:1,textDecoration:'none'},onMouseEnter:function onMouseEnter(){return setIsHovered(true);},onMouseOut:function onMouseOut(){return setIsHovered(false);},children:(0,_jsxRuntime.jsxs)(_primitives.Box,{states:{hover:isHovered},position:"relative",overflow:"hidden",borderRadius:8,borderWidth:1,p:'$5',sx:{':hover':{_dark:{bg:'$backgroundDark900',borderColor:'transparent'},bg:'$borderLight100',borderColor:'transparent'},'bg':'transparent','borderColor':'$borderLight200','_dark':{borderColor:'$borderDark800'}},children:[(0,_jsxRuntime.jsx)(_Text.default,{fontWeight:"800",mb:"$2",fontSize:"$md",onMouseEnter:function onMouseEnter(){return setIsHovered(true);},onMouseOut:function onMouseOut(){return setIsHovered(false);},sx:{color:'$textLight900',_dark:{color:'$textDark50'}},children:heading}),(0,_jsxRuntime.jsx)(_Text.default,{fontSize:"$sm",lineHeight:"$sm",onMouseEnter:function onMouseEnter(){return setIsHovered(true);},onMouseOut:function onMouseOut(){return setIsHovered(false);},sx:{color:'$textLight900',_dark:{color:'$textDark50'}},children:subHeading})]})});};exports.Hoverable=Hoverable;
//# sourceMappingURL=index.js.map