{-# LANGUAGE OverloadedStrings #-}
module Web.Alert.Renderer.Foundation5
( renderAlertsFoundation5
, AlertType(..)
) where
import Data.Text.Lazy
import Text.Blaze.Html
import qualified Text.Blaze.Html5 as H
import qualified Text.Blaze.Html5.Attributes as A
import Web.Alert
import Web.Alert.Renderer.Common
renderAlertsFoundation5 :: AlertType -> [Alert] -> Text
renderAlertsFoundation5 atype = renderAlerts
"alert-box"
[alertTypeClass atype]
(Just $ dataAttribute "alert" "")
(Just close)
foundation5Clases
data AlertType
= Radius
| Round
deriving (Eq, Show, Read)
close :: Html
close =
H.button
! A.class_ "close"
! customAttribute "aria-label" "x"
$ preEscapedToHtml ("×" :: Text)
alertTypeClass :: AlertType -> AttributeValue
alertTypeClass Radius = "radius"
alertTypeClass Round = "round"
foundation5Clases :: AlertStatus -> AttributeValue
foundation5Clases Default = "secondary"
foundation5Clases Info = "info"
foundation5Clases Success = "success"
foundation5Clases Warning = "warning"
foundation5Clases Error = "alert"