rakutentech / r10 / R10.FormTypes

Types for Forms


type TypeText
    = TextPlain
    | TextEmail
    | TextEmailWithSuggestions (List String)
    | TextMobileEmail
    | TextUsername
    | TextUsernameWithUseEmailCheckbox String
    | TextPasswordNew String
    | TextPasswordCurrent String
    | TextMultiline
    | TextWithPattern String
    | TextWithPatternLarge String
    | TextWithPatternLargeWithoutLabel String
    | TextOnlyDigitsOrDash

Possible types of Text input fields


type TypeBinary
    = BinaryCheckbox
    | BinarySwitch

Possible types of Binary input fields


type TypeMulti
    = MultiCombobox

Possible types of Multi input fields


type TypeSingle
    = SingleRadio
    | SingleRadioRow
    | SingleCombobox
    | SingleComboboxForCountry
    | SingleSelect

Possible types of Single input fields


type TypeSpecial
    = SpecialPhone ({ disableInternationalPrefixPhoneChange : Basics.Bool, isJapanService : Basics.Bool })

Possible types of Special input fields


type FieldType
    = TypeText TypeText
    | TypeSingle TypeSingle (List FieldOption)
    | TypeMulti TypeMulti (List FieldOption)
    | TypeBinary TypeBinary
    | TypeSpecial TypeSpecial


type alias FieldOption =
{ value : String
, label : String 
}

inputField : { binaryCheckbox : FieldType, binarySwitch : FieldType, multiCombobox : List FieldOption -> FieldType, singleCombobox : List FieldOption -> FieldType, singleSelect : List FieldOption -> FieldType, singleRadio : List FieldOption -> FieldType, singleRadioRow : List FieldOption -> FieldType, textEmail : FieldType, textEmailWithSuggestions : List String -> FieldType, textMobileEmail : FieldType, textMultiline : FieldType, textPasswordCurrent : String -> FieldType, textPasswordNew : String -> FieldType, textPlain : FieldType, textUsername : FieldType, textUsernameWithUseEmailCheckbox : String -> FieldType, textWithPattern : String -> FieldType }


type ValidationIcon
    = NoIcon
    | ClearOrCheck
    | ErrorOrCheck


type alias Palette =
{ primary : Color
, primaryVariant : Color
, success : Color
, error : Color
, border : Color
, onSurface : Color
, onPrimary : Color
, surface : Color
, background : Color 
}



type alias Palette =
    { primary : Color
    , primaryVariant : Color
    , success : Color
    , error : Color

    -- Text Colors
    --
    , onSurface : Color
    , onPrimary : Color

    -- Background Colors
    --
    , surface : Color
    , background : Color
    }

Note that these are Color from elm-ui.

See https://material.io/design/color/dark-theme.html#properties for more details.

If you want to use the default palette, just pass Nothing