----------------------------------------------------------------------
------------------------------------------------------------------------------

-- | Label-element has the following attributes:
-- globals; form; for
--
data Label = Label
  { _labelGlobals ∷ Maybe A.Globals
  -- , _labelForm ∷ Maybe Form -- Not in HTML 5.2.
  , _labelForId   ∷ Maybe A.ForId
  , _labelCustom  ∷ Maybe A.Attr
  }


-- | An instance. 
instance A.AttrMap Label where
  attrMap bm = fold $ catMaybes
    [ A.attrMap <$> _labelGlobals bm
    -- , A.attrMap <$> _labelForm bm
    , A.attrMap <$> _labelForId bm
    ] <> maybeToList (_labelCustom bm)

-- | A default value for Label.
defLabel ∷ Label

inputCD ∷ (DomBuilder t m, PostBuild t m) ⇒ Dynamic t Input → m () → m (Event t ())
inputCD bDyn children = do
  (e,_) ← elDynAttr' "input" (A.attrMap <$> bDyn) children
  return $ domEvent Click e



------------------------------------------------------------------------------
------------------------------------------------------------------------------

-- Keygen is likely to be removed from HTML 5.2.
-- Thus, we don't have it here.

------------------------------------------------------------------------------
------------------------------------------------------------------------------

-- | Label-element has the following attributes:
-- globals; form; for
--
inputCD bDyn children = do
  (e,_) ← elDynAttr' "input" (A.attrMap <$> bDyn) children
  return $ domEvent Click e



------------------------------------------------------------------------------
------------------------------------------------------------------------------

-- Keygen is likely to be removed from HTML 5.2.
-- Thus, we don't have it here.

------------------------------------------------------------------------------
------------------------------------------------------------------------------

-- | Label-element has the following attributes:
-- globals; form; for
--