 # and merges them into the className of each element.
 AuiMixin =
   componentWillMount: ->
+    @$ = (ref) -> jQuery? React.findDOMNode @refs[ref] or ref
     render = @render
     @render = ->
       element = render?.apply? @, arguments
       if React.isValidElement element
-        Aui.classify element, @props
+        Aui.classify element
       else
-        Aui.classify (Aui.warning 'Aui.Mixin: Child is not a React.isValidElement', element), @props
+        Aui.classify Aui.warning 'Aui.Mixin: Child is not a React.isValidElement', element
 
-## class <Aui/>
+## (depricated) class <Aui/>
 # A tag that applies the Aui.Mixin
+# Using the Aui.Mixin in your Component is prefered over <Aui/> tag.
 Aui = React.createClass
   mixins: [AuiMixin]
-  render: -> @props.children
+  render: ->
+    Aui.warning '<Aui/> tag is depricated, use Aui.Mixin instead', @props.children
+  componentDidMount: ->
+    console.warn React.findDOMNode @
+Aui.Mixin = Aui.AuiMixin = AuiMixin
 Aui.Aui = Aui
-Aui.Mixin = Aui.AuiMixin = AuiMixin
+Aui.$ = jQuery
 
 ## function Aui.warning (string, element)
 # console.warn a warning message

    for own key, value of element.props
      classNames[key] = yes if value is yes
      if (not options.disableModules) and (Array.isArray value) and (key in Aui.modules)
        unless modules then modules = []
        classNames[key] = true
        modules.push key
      props[key] = value
    props.className = Object.keys(classNames).join ' '
    unless props.className.length
      delete props.className
    console.log modules, (if typeof element.type is 'string' then element.type else 'Component'), props.className or ''
    element = React.cloneElement element, props, if options.ignoreChildren then element.props.children else React.Children.map element.props.children, classify
    if modules
      React.createElement Aui.Module, { modules }, element
    else element
  classify element


unless React? then throw new Error "Aui: window.React not found."
unless jQuery? then console.warn "Aui: window.jQuery not found, Modules and Semantic-UI will be disabled."
unless jQuery?.site?.settings?.modules? then console.warn 'Aui: No Semantic-UI window.jQuery.site.settings.modules found, Semantic will be disabled.'


## mixin Aui.Mixin
# Aui class is the main wrapper class
