Merge remote-tracking branch 'origin/master' into bat/ellie-example-links

This commit is contained in:
Tessa Kelly 2022-03-24 10:02:40 -07:00
commit 8d357c7432

View File

@ -7,12 +7,11 @@ module Examples.Balloon exposing (example, State, Msg)
-} -}
import Category exposing (Category(..)) import Category exposing (Category(..))
import Css
import Debug.Control as Control exposing (Control) import Debug.Control as Control exposing (Control)
import Debug.Control.Extra as ControlExtra import Debug.Control.Extra as ControlExtra
import Debug.Control.View as ControlView
import Example exposing (Example) import Example exposing (Example)
import Html.Styled exposing (Html, fromUnstyled, text) import Html.Styled exposing (Html, fromUnstyled, text)
import Html.Styled.Attributes exposing (css)
import Nri.Ui.Balloon.V1 as Balloon import Nri.Ui.Balloon.V1 as Balloon
@ -130,20 +129,25 @@ view state =
let let
copy = copy =
Control.currentValue state.copy Control.currentValue state.copy
attributes =
Control.currentValue state.attributes
in in
[ Control.view SetCopy state.copy |> fromUnstyled [ Control.view SetCopy state.copy |> fromUnstyled
, Control.view SetAttributes state.attributes |> fromUnstyled , ControlView.view
, Html.Styled.code [ css [ Css.display Css.block, Css.margin2 (Css.px 20) Css.zero ] ] { update = SetAttributes
[ text <| , settings = state.attributes
"Balloon.balloon [ " , toExampleCode =
++ String.join ", " (List.map Tuple.first attributes) \attrs ->
++ " ] " [ { sectionName = "Balloon"
++ "\"" , code =
++ copy "Balloon.balloon\n [ "
++ "\"" ++ String.join "\n , " (List.map Tuple.first attrs)
] ++ "\n ] "
, Balloon.balloon (List.map Tuple.second attributes) (text copy) ++ "\n (text \""
++ copy
++ "\")"
}
]
}
, Balloon.balloon
(List.map Tuple.second (Control.currentValue state.attributes))
(text copy)
] ]