diff --git a/elm.json b/elm.json index 6826f954..7e5ff361 100644 --- a/elm.json +++ b/elm.json @@ -83,7 +83,7 @@ "pablohirafuji/elm-markdown": "2.0.5 <= v < 3.0.0", "rtfeldman/elm-css": "16.0.0 <= v < 17.0.0", "tesk9/accessible-html": "4.0.0 <= v < 5.0.0", - "tesk9/modal": "2.0.0 <= v < 3.0.0", + "tesk9/modal": "4.1.0 <= v < 5.0.0", "wernerdegroot/listzipper": "3.1.1 <= v < 4.0.0" }, "test-dependencies": { diff --git a/src/Nri/Ui/Modal/V5.elm b/src/Nri/Ui/Modal/V5.elm index c64bf752..c08aab41 100644 --- a/src/Nri/Ui/Modal/V5.elm +++ b/src/Nri/Ui/Modal/V5.elm @@ -43,7 +43,7 @@ type alias Model = {-| -} -init : Model +init : { dismissOnEscAndOverlayClick : Bool } -> Model init = Modal.init @@ -68,7 +68,6 @@ update msg model = {-| -} info : { title : Css.Color -> ( String, List (Root.Attribute Never) ) - , dismissOnEscAndOverlayClick : Bool , content : Html msg , wrapMsg : Msg -> msg } @@ -77,9 +76,8 @@ info : info config model = Modal.view { overlayColor = toOverlayColor Colors.navy - , dismissOnEscAndOverlayClick = config.dismissOnEscAndOverlayClick , wrapMsg = config.wrapMsg - , modalContainer = viewModalContainer + , modalAttributes = modalStyles , title = config.title Colors.navy , content = toUnstyled config.content } @@ -90,7 +88,6 @@ info config model = {-| -} warning : { title : Css.Color -> ( String, List (Root.Attribute Never) ) - , dismissOnEscAndOverlayClick : Bool , content : Html msg , wrapMsg : Msg -> msg } @@ -99,9 +96,8 @@ warning : warning config model = Modal.view { overlayColor = toOverlayColor Colors.gray20 - , dismissOnEscAndOverlayClick = config.dismissOnEscAndOverlayClick , wrapMsg = config.wrapMsg - , modalContainer = viewModalContainer + , modalAttributes = modalStyles , title = config.title Colors.red , content = toUnstyled config.content } @@ -124,35 +120,20 @@ toOverlayColor : Css.Color -> String toOverlayColor color = color |> Nri.Ui.Colors.Extra.withAlpha 0.9 - |> Nri.Ui.Colors.Extra.toCoreColor - |> Color.toCssString + |> toCssString -viewModalContainer : List (Root.Html msg) -> Root.Html msg -viewModalContainer modalContents = - div - [ css - [ Css.width (Css.px 600) - , Css.maxHeight <| Css.calc (Css.vh 100) Css.minus (Css.px 100) - , Css.padding4 (Css.px 40) Css.zero (Css.px 40) Css.zero - , Css.margin2 (Css.px 75) Css.auto - , Css.backgroundColor Colors.white - , Css.borderRadius (Css.px 20) - , Css.property "box-shadow" "0 1px 10px 0 rgba(0, 0, 0, 0.35)" - , Css.position Css.relative -- required for closeButtonContainer - , Fonts.baseFont - ] - ] - [ -- This global