mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2025-01-04 12:47:53 +03:00
Adds docs
This commit is contained in:
parent
efde15f98c
commit
d66fa40ce6
@ -14,6 +14,33 @@ module Nri.Ui.Modal.V9 exposing
|
|||||||
@docs Msg, open, close, update, subscriptions
|
@docs Msg, open, close, update, subscriptions
|
||||||
@docs FocusManager, info, warning
|
@docs FocusManager, info, warning
|
||||||
|
|
||||||
|
import Html.Styled exposing (text)
|
||||||
|
import Nri.Ui.Modal.V9 as Modal
|
||||||
|
|
||||||
|
type Msg
|
||||||
|
= ModalMsg Modal.Msg
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
viewModal : Modal.Model -> Html Msg
|
||||||
|
viewModal modalState =
|
||||||
|
Modal.info
|
||||||
|
{ title = "Modal Title"
|
||||||
|
, visibleTitle = False
|
||||||
|
, wrapMsg = ModalMsg
|
||||||
|
, focusManager =
|
||||||
|
Modal.OneFocusableElement
|
||||||
|
(\{ onlyFocusableElement, closeButton } ->
|
||||||
|
{ content =
|
||||||
|
[ closeButton onlyFocusableElement
|
||||||
|
, text "Modal Content"
|
||||||
|
]
|
||||||
|
, footer = []
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
modalState
|
||||||
|
|
||||||
-}
|
-}
|
||||||
|
|
||||||
import Accessibility.Styled as Html exposing (..)
|
import Accessibility.Styled as Html exposing (..)
|
||||||
@ -151,7 +178,13 @@ close =
|
|||||||
-- ATTRIBUTES
|
-- ATTRIBUTES
|
||||||
|
|
||||||
|
|
||||||
{-| -}
|
{-| Modals should allow the user to tab forwards & backwards through the modal content.
|
||||||
|
The user should never find their Focus lost behind the modal backdrop!
|
||||||
|
|
||||||
|
Use the `FocusManager` to tag the focusable elements in your modal, so that we
|
||||||
|
know to which element to return focus when the user reaches the last focusable element.
|
||||||
|
|
||||||
|
-}
|
||||||
type FocusManager msg
|
type FocusManager msg
|
||||||
= MultipleFocusableElements
|
= MultipleFocusableElements
|
||||||
({ firstFocusableElement : List (Attribute msg)
|
({ firstFocusableElement : List (Attribute msg)
|
||||||
|
Loading…
Reference in New Issue
Block a user