[{"name":"Toasty","comment":" This package lets you easily show customizable toast notifications in your\nElm apps following The Elm Architecture. You will be able to trigger toasts as\na side-effect of model updates by piping your update function return value\nthrough this library `addToast` function.\n\nWhile this package lets you configure each part of the rendering and behaviour\nof the notification stack, you can use a nice default theme configuration provided\nin `Toasty.Defaults`. See a [demo using default styling](http://pablen-toasty-demo.surge.sh/).\n\n\n## Example\n\n\n### Setting things up\n\nTo use the package, let's look at an example that shows a simple text notification.\n\nFirst you add the toast stack to your model, wrapping the toast model you want in `Stack`.\nYou must do it in a field called `toasties`:\n\n    type alias Model =\n        { toasties : Toasty.Stack String }\n\nNote that in this example we are modelling our toasts as a simple `String`,\nbut we can model our toasts however we need.\n\nAdd the stack initial state in your `init` function:\n\n    init : ( Model, Cmd Msg )\n    init =\n        ( { toasties = Toasty.initialState }, Cmd.none )\n\nThen add a message that will handle toasts messages:\n\n    type alias Msg =\n        ToastyMsg (Toasty.Msg String)\n\nYou can use the default configuration as-is or tweak it to your needs by piping configuration helpers:\n\n    myConfig : Toasty.Config msg\n    myConfig =\n        Toasty.config\n            |> Toasty.transitionOutDuration 100\n            |> Toasty.delay 8000\n\nHandle the toasts message in your app update function using the library `update`\nfunction:\n\n    update msg model =\n        case msg of\n            ToastyMsg subMsg ->\n                Toasty.update myConfig ToastyMsg subMsg model\n\nAs a last step, render the toast stack in you `view` function. You will need to\nprovide a special view function that knows how to render your toast model:\n\n    view : Model -> Html Msg\n    view model =\n        div []\n            [ h1 [] [ text \"Toasty example\" ]\n            , Toasty.view myConfig renderToast ToastyMsg model.toasties\n            ]\n\n    renderToast : String -> Html Msg\n    renderToast toast =\n        div [] [ text toast ]\n\n\n### Triggering toasts\n\nA pretty common scenario is to trigger toasts as side-effect of some other app event,\ne.g. show a message when an asynchronous response was received. In order to do that, just\npipe your update function return value through the `addToast` function passing your\nconfiguration, tag and toast.\n\n        update msg model =\n            case msg of\n                SomeAppMsg ->\n                    ( newModel, Cmd.none )\n                        |> Toasty.addToast myConfig ToastyMsg \"Entity successfully created!\"\n\nThat's all!\n\n\n# Definition\n\n@docs Stack, Msg\n\n\n# Configuration\n\nThe notifications appearance and behaviour can be fully customized. To do this,\nyou need to import the default configuration and tweak it by piping the provided\nhelper functions.\n\nNote that as you can set container and items HTML attributes the library remains\nagnostic about how to style your toasts, enabling you to use inline styles or\nclasses.\n\n    myConfig : Toasty.Config msg\n    myConfig =\n        Toasty.config\n            |> Toasty.transitionOutDuration 700\n            |> Toasty.delay 8000\n            |> Toasty.containerAttrs containerAttrs\n\n    containerAttrs =\n        [ style \"max-width\" \"300px\"\n        , style \"position\" \"fixed\"\n        , style \"right\" \"0\"\n        , style \"top\" \"0\"\n        ]\n\n@docs config, delay, transitionOutDuration, containerAttrs, itemAttrs, transitionInAttrs, transitionOutAttrs, Config\n\n\n# Other functions\n\n@docs view, update, addToast, addPersistentToast, addToastIf, addToastIfUnique, hasToast, initialState\n\n","unions":[{"name":"Config","comment":" The base configuration type.\n","args":["msg"],"cases":[]},{"name":"Msg","comment":" The internal message type used by the library. You need to tag and add it to your app messages.\n\n    type Msg\n        = ToastyMsg (Toasty.Msg MyToast)\n\n","args":["a"],"cases":[]},{"name":"Stack","comment":" Represents the stack of current toasts notifications. You can model a toast\nto be as complex or simple as you want.\n\n    type alias Model =\n        { toasties : Toasty.Stack MyToast\n        }\n\n\n    -- Defines a toast model that has three different variants\n    type MyToast\n        = Success String\n        | Warning String\n        | Error String String\n\n","args":["a"],"cases":[]}],"aliases":[],"values":[{"name":"addPersistentToast","comment":" Similar to `addToast` but doesn't schedule the toast removal, so it will remain visible until clicked.\n","type":"Toasty.Config msg -> (Toasty.Msg a -> msg) -> a -> ( { m | toasties : Toasty.Stack a }, Platform.Cmd.Cmd msg ) -> ( { m | toasties : Toasty.Stack a }, Platform.Cmd.Cmd msg )"},{"name":"addToast","comment":" Adds a toast to the stack and schedules its removal. It receives and returns\na tuple of type '(model, Cmd msg)' so that you can easily pipe it to your app\nupdate function branches.\n\n    update msg model =\n        case msg of\n            SomeAppMsg ->\n                ( newModel, Cmd.none )\n                    |> Toasty.addToast myConfig ToastyMsg (MyToast \"Entity successfully created!\")\n\n            ToastyMsg subMsg ->\n                Toasty.update myConfig ToastyMsg subMsg model\n\n","type":"Toasty.Config msg -> (Toasty.Msg a -> msg) -> a -> ( { m | toasties : Toasty.Stack a }, Platform.Cmd.Cmd msg ) -> ( { m | toasties : Toasty.Stack a }, Platform.Cmd.Cmd msg )"},{"name":"addToastIf","comment":" Similar to `addToast` but also receives a condition parameter `List toast -> Bool`\nso that the toast will only be added if the condition returns `True`.\n","type":"Toasty.Config msg -> (Toasty.Msg a -> msg) -> (List.List a -> Basics.Bool) -> a -> ( { m | toasties : Toasty.Stack a }, Platform.Cmd.Cmd msg ) -> ( { m | toasties : Toasty.Stack a }, Platform.Cmd.Cmd msg )"},{"name":"addToastIfUnique","comment":" Similar to `addToast` but only effectively adds the toast if it's not already\npresent in the stack. This is a convenience `addToastIf` function using\n`not << List.member toast` as a `condition` parameter.\n","type":"Toasty.Config msg -> (Toasty.Msg a -> msg) -> a -> ( { m | toasties : Toasty.Stack a }, Platform.Cmd.Cmd msg ) -> ( { m | toasties : Toasty.Stack a }, Platform.Cmd.Cmd msg )"},{"name":"config","comment":" Some basic configuration defaults: Toasts are visible for 5 seconds with\nno animations or special styling.\n","type":"Toasty.Config msg"},{"name":"containerAttrs","comment":" Lets you set the HTML attributes to add to the toasts stack container. This will help\nyou style and position the toast stack however you like by adding classes or inline styles.\n","type":"List.List (Html.Attribute msg) -> Toasty.Config msg -> Toasty.Config msg"},{"name":"delay","comment":" Changes the amount of time (in milliseconds) the toast will be visible.\nAfter this time, the transition out begins.\n","type":"Basics.Float -> Toasty.Config msg -> Toasty.Config msg"},{"name":"hasToast","comment":" Figure out whether a stack contains a specific toast. Similar to `List.member`.\n","type":"a -> Toasty.Stack a -> Basics.Bool"},{"name":"initialState","comment":" An empty stack of toasts to initialize your model with.\n","type":"Toasty.Stack a"},{"name":"itemAttrs","comment":" Lets you set the HTML attributes to add to each toast container. This will help\nyou style and arrange the toasts however you like by adding classes or inline styles.\n","type":"List.List (Html.Attribute msg) -> Toasty.Config msg -> Toasty.Config msg"},{"name":"transitionInAttrs","comment":" Lets you set the HTML attributes to add to the toast container when transitioning in.\n","type":"List.List (Html.Attribute msg) -> Toasty.Config msg -> Toasty.Config msg"},{"name":"transitionOutAttrs","comment":" Lets you set the HTML attributes to add to the toast container when transitioning out.\n","type":"List.List (Html.Attribute msg) -> Toasty.Config msg -> Toasty.Config msg"},{"name":"transitionOutDuration","comment":" Changes the amount of time (in milliseconds) to wait after transition out\nbegins and before actually removing the toast node from the DOM. This lets you\nauthor fancy animations when a toast is removed.\n","type":"Basics.Float -> Toasty.Config msg -> Toasty.Config msg"},{"name":"update","comment":" Handles the internal messages. You need to wire it to your app update function\n\n    update msg model =\n        case msg of\n            ToastyMsg subMsg ->\n                Toasty.update Toasty.config ToastyMsg subMsg model\n\n","type":"Toasty.Config msg -> (Toasty.Msg a -> msg) -> Toasty.Msg a -> { m | toasties : Toasty.Stack a } -> ( { m | toasties : Toasty.Stack a }, Platform.Cmd.Cmd msg )"},{"name":"view","comment":" Renders the stack of toasts. You need to add it to your app view function and\ngive it a function that knows how to render your toasts model.\n\n    view model =\n        div []\n            [ h1 [] [ text \"Toasty example\" ]\n            , Toasty.view myConfig (\\txt -> div [] [ text txt ]) ToastyMsg model.toasties\n            ]\n\n","type":"Toasty.Config msg -> (a -> Html.Html msg) -> (Toasty.Msg a -> msg) -> Toasty.Stack a -> Html.Html msg"}],"binops":[]},{"name":"Toasty.Defaults","comment":" This module provides a generic toast type with three variants (success, error and warning)\neach one supports a title and optional secondary text.\n\n**You need to load the provided `Defaults.css` file in your project**. `bounceInRight`\nand `fadeOutRightBig` animations borrowed from [Animate.css](https://daneden.github.io/animate.css/)\nproject by Daniel Eden.\n\nSee a [demo](http://pablen-toasty-demo.surge.sh/).\n\n\n# Definition\n\n@docs Toast, config, view\n\n","unions":[{"name":"Toast","comment":" This theme defines toasts of three variants: \"Success\", \"Warning\" and \"Error\".\nEach of them accepts a title and an optional secondary text.\n","args":[],"cases":[["Success",["String.String","String.String"]],["Warning",["String.String","String.String"]],["Error",["String.String","String.String"]]]}],"aliases":[],"values":[{"name":"config","comment":" Default theme configuration.\n","type":"Toasty.Config msg"},{"name":"view","comment":" Default theme view handling the three toast variants.\n","type":"Toasty.Defaults.Toast -> Html.Html msg"}],"binops":[]}]