noredink-ui/styleguide-app/AtomicDesignType.elm

78 lines
1.1 KiB
Elm
Raw Normal View History

2020-06-19 23:41:28 +03:00
module AtomicDesignType exposing
( AtomicDesignType(..)
2020-06-19 23:52:02 +03:00
, all, sorter, toString
2020-06-19 23:41:28 +03:00
)
{-|
@docs AtomicDesignType
2020-06-19 23:52:02 +03:00
@docs all, sorter, toString
2020-06-19 23:41:28 +03:00
-}
import Sort exposing (Sorter)
{-| -}
type AtomicDesignType
= Atom
| Molecule
| Organism
| Template
| Page
2020-06-19 23:52:02 +03:00
{-| -}
all : List AtomicDesignType
all =
[ Atom
, Molecule
, Organism
, Template
, Page
]
2020-06-19 23:41:28 +03:00
{-| -}
sorter : Sorter AtomicDesignType
sorter =
Sort.by
(\v ->
case v of
Atom ->
0
Molecule ->
1
Organism ->
2
Template ->
3
Page ->
4
)
Sort.increasing
2020-06-19 23:41:28 +03:00
{-| -}
toString : AtomicDesignType -> String
toString atomicDesignType =
case atomicDesignType of
Atom ->
"Atom"
Molecule ->
"Molecule"
Organism ->
"Organism"
Template ->
"Template"
Page ->
"Page"