NoRedInk/noredink-ui/12.18.0

NOTE: the latest version is 35.9.3

Nri.Ui.Accordion.V2

Changes from V1:

  • Combine view and viewKeyed so that nodes are always keyed
  • Removes viewCaret from the API -- it's possible to use the DisclosureIndicator directly
  • Changed implementation to follow recommendations from https://www.w3.org/TR/wai-aria-practices-1.1/examples/accordion/accordion.html
    • Adds Up and Down keyboard handling for navigating between the accordions
    • Adds aria-expanded and aria-controls
    • Changes accordion container to a section
    • removes tablist/tab/tabpanel roles
    • Adds heading levels for the accordion header (including style resets)
{ entries :
List
{ headerId : String
, entry : entry
, isExpanded : Bool
}
, headerLevel : HeaderLevel
, viewHeader : entry -> Html msg
, viewContent : entry -> Html msg
, customStyles : Maybe (entry -> StyleOptions)
, caret : Caret
, toggle : entry -> Bool -> msg
, focus : String -> msg
}
-> Html msg
type Caret
= DefaultCaret
| WhiteCaret
| NoneCaret

DefaultCaret is the blue caret

type alias StyleOptions =
{ entryStyles : List Style
, entryExpandedStyles : List Style
, entryClosedStyles : List Style
, headerStyles : List Style
, headerExpandedStyles : List Style
, headerClosedStyles : List Style
, contentStyles : List Style
}
= H1
| H2
| H3
| H4
| H5
| H6

Corresponds to h1, h2, h3 etc. Choose the correct header level given your page context.