github.com/simpleiot/simpleiot@v0.18.3/frontend/src/UI/Button.elm (about)

     1  module UI.Button exposing
     2      ( arrowDown
     3      , arrowRight
     4      , clipboard
     5      , copy
     6      , dot
     7      , list
     8      , message
     9      , plusCircle
    10      , x
    11      )
    12  
    13  import Element exposing (..)
    14  import Element.Background as Background
    15  import Element.Border as Border
    16  import Element.Input as Input
    17  import FeatherIcons
    18  import Svg
    19  import Svg.Attributes as S
    20  import UI.Style as Style
    21  
    22  
    23  button : FeatherIcons.Icon -> msg -> Element msg
    24  button iconIn msg =
    25      Input.button
    26          [ padding 5
    27          , Border.rounded 50
    28          , mouseOver
    29              [ Background.color Style.colors.ltgray
    30              ]
    31  
    32          --, Element.focused
    33          --    [ Background.color Style.palette.ltgray
    34          --    ]
    35          ]
    36          { onPress = Just msg
    37          , label =
    38              html
    39                  (FeatherIcons.toHtml [] iconIn)
    40          }
    41  
    42  
    43  
    44  -- Button Icons
    45  
    46  
    47  x : msg -> Element msg
    48  x msg =
    49      button FeatherIcons.x msg
    50  
    51  
    52  plusCircle : msg -> Element msg
    53  plusCircle msg =
    54      button FeatherIcons.plusCircle msg
    55  
    56  
    57  arrowRight : msg -> Element msg
    58  arrowRight msg =
    59      button FeatherIcons.chevronRight msg
    60  
    61  
    62  arrowDown : msg -> Element msg
    63  arrowDown msg =
    64      button FeatherIcons.chevronDown msg
    65  
    66  
    67  message : msg -> Element msg
    68  message msg =
    69      button FeatherIcons.messageSquare msg
    70  
    71  
    72  copy : msg -> Element msg
    73  copy msg =
    74      button FeatherIcons.copy msg
    75  
    76  
    77  clipboard : msg -> Element msg
    78  clipboard msg =
    79      button FeatherIcons.clipboard msg
    80  
    81  
    82  list : msg -> Element msg
    83  list msg =
    84      button FeatherIcons.list msg
    85  
    86  
    87  dot : msg -> Element msg
    88  dot =
    89      [ Svg.circle
    90          [ S.style "fill:#000000;fill-opacity:1;"
    91          , S.cx "11.903377"
    92          , S.cy "11.823219"
    93          , S.r "4.1"
    94          ]
    95          []
    96      ]
    97          |> FeatherIcons.customIcon
    98          |> button