28 lines
858 B
Text
28 lines
858 B
Text
module Web.Box where
|
|
|
|
import Prelude
|
|
|
|
import Halogen.HTML as HH
|
|
import Halogen.HTML.Properties as HP
|
|
|
|
import CSSClasses as C
|
|
|
|
box :: forall w i. Array (HH.HTML w i) -> HH.HTML w i
|
|
box = HH.div [HP.classes [C.box]]
|
|
|
|
box_ :: forall w i. Array HH.ClassName -> Array (HH.HTML w i) -> HH.HTML w i
|
|
box_ classes = HH.div [HP.classes $ [C.box] <> classes]
|
|
|
|
-- | Box with tags.
|
|
-- |```
|
|
-- |box_with_tag [C.has_background_danger_light] some_tag [Bulma.p "Hello"]
|
|
-- |```
|
|
box_with_tag :: forall w action.
|
|
Array HH.ClassName -- css classes (like the color)
|
|
-> HH.HTML w action -- tag (title for the box)
|
|
-> Array (HH.HTML w action) -- box content
|
|
-> HH.HTML w action
|
|
box_with_tag colors tag xs
|
|
= box_
|
|
([C.no_padding_left, C.no_padding_top] <> colors)
|
|
[tag, HH.div [HP.classes [C.restore_padding_left, C.restore_padding_top]] xs]
|