noredink-ui/styleguide-app/Examples.elm

829 lines
22 KiB
Elm
Raw Normal View History

module Examples exposing (Msg, State, all)
2018-02-13 00:32:38 +03:00
2020-03-31 23:20:03 +03:00
import Example exposing (Example)
import Examples.Accordion as Accordion
2020-03-31 22:43:32 +03:00
import Examples.AssignmentIcon as AssignmentIcon
2020-03-31 22:05:56 +03:00
import Examples.Button as Button
import Examples.Callout as Callout
2020-03-31 22:43:32 +03:00
import Examples.Checkbox as Checkbox
import Examples.ClickableSvg as ClickableSvg
import Examples.ClickableText as ClickableText
import Examples.Colors as Colors
2020-05-15 20:15:35 +03:00
import Examples.Confetti as Confetti
2020-03-31 22:43:32 +03:00
import Examples.DisclosureIndicator as DisclosureIndicator
2020-04-09 01:13:06 +03:00
import Examples.Divider as Divider
2020-03-31 22:43:32 +03:00
import Examples.Fonts as Fonts
import Examples.Heading as Heading
import Examples.Icon as Icon
2020-04-03 04:13:29 +03:00
import Examples.Loading as Loading
2020-03-31 22:43:32 +03:00
import Examples.Logo as Logo
import Examples.MasteryIcon as MasteryIcon
2020-05-07 22:46:21 +03:00
import Examples.Menu as Menu
import Examples.Message as Message
2020-03-31 22:43:32 +03:00
import Examples.Modal as Modal
import Examples.Page as Page
import Examples.Pennant as Pennant
2020-07-30 21:12:30 +03:00
import Examples.RadioButton as RadioButton
2020-03-31 22:43:32 +03:00
import Examples.SegmentedControl as SegmentedControl
import Examples.Select as Select
import Examples.Slide as Slide
import Examples.SlideModal as SlideModal
import Examples.SortableTable as SortableTable
import Examples.Svg as Svg
import Examples.Table as Table
import Examples.Tabs as Tabs
import Examples.Text as Text
import Examples.Text.Writing as Writing
import Examples.TextArea as TextArea
import Examples.TextInput as TextInput
import Examples.Tooltip as Tooltip
import Examples.UiIcon as UiIcon
2018-02-13 00:32:38 +03:00
all : List (Example State Msg)
all =
[ Accordion.example
|> Example.wrapMsg AccordionMsg
(\msg ->
case msg of
AccordionMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState AccordionState
(\msg ->
case msg of
AccordionState childState ->
Just childState
_ ->
Nothing
)
, AssignmentIcon.example
|> Example.wrapMsg AssignmentIconMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
AssignmentIconMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState AssignmentIconState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
AssignmentIconState childState ->
Just childState
_ ->
Nothing
)
, Button.example
|> Example.wrapMsg ButtonMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
ButtonMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState ButtonState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
ButtonState childState ->
Just childState
_ ->
Nothing
)
, Callout.example
|> Example.wrapMsg CalloutMsg
(\msg ->
case msg of
CalloutMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState CalloutState
(\msg ->
case msg of
CalloutState childState ->
Just childState
2020-04-01 02:00:29 +03:00
_ ->
Nothing
)
, Checkbox.example
|> Example.wrapMsg CheckboxMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
CheckboxMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState CheckboxState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
CheckboxState childState ->
Just childState
_ ->
Nothing
)
, ClickableSvg.example
|> Example.wrapMsg ClickableSvgMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
ClickableSvgMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState ClickableSvgState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
ClickableSvgState childState ->
Just childState
_ ->
Nothing
)
, ClickableText.example
|> Example.wrapMsg ClickableTextMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
ClickableTextMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState ClickableTextState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
ClickableTextState childState ->
Just childState
_ ->
Nothing
)
, Colors.example
|> Example.wrapMsg ColorsMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
ColorsMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState ColorsState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
ColorsState childState ->
Just childState
2020-05-15 20:15:35 +03:00
_ ->
Nothing
)
, Confetti.example
|> Example.wrapMsg ConfettiMsg
(\msg ->
case msg of
ConfettiMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState ConfettiState
(\msg ->
case msg of
ConfettiState childState ->
Just childState
2020-04-01 02:00:29 +03:00
_ ->
Nothing
)
, DisclosureIndicator.example
|> Example.wrapMsg DisclosureIndicatorMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
DisclosureIndicatorMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState DisclosureIndicatorState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
DisclosureIndicatorState childState ->
Just childState
2020-04-09 01:13:06 +03:00
_ ->
Nothing
)
, Divider.example
|> Example.wrapMsg DividerMsg
(\msg ->
case msg of
DividerMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState DividerState
(\msg ->
case msg of
DividerState childState ->
Just childState
2020-04-01 02:00:29 +03:00
_ ->
Nothing
)
, Fonts.example
|> Example.wrapMsg FontsMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
FontsMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState FontsState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
FontsState childState ->
Just childState
_ ->
Nothing
)
, Heading.example
|> Example.wrapMsg HeadingMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
HeadingMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState HeadingState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
HeadingState childState ->
Just childState
_ ->
Nothing
)
, Icon.example
|> Example.wrapMsg IconMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
IconMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState IconState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
IconState childState ->
Just childState
2020-04-03 04:13:29 +03:00
_ ->
Nothing
)
, Loading.example
|> Example.wrapMsg LoadingMsg
(\msg ->
case msg of
LoadingMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState LoadingState
(\msg ->
case msg of
LoadingState childState ->
Just childState
2020-04-01 02:00:29 +03:00
_ ->
Nothing
)
, Logo.example
|> Example.wrapMsg LogoMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
LogoMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState LogoState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
LogoState childState ->
Just childState
_ ->
Nothing
)
, MasteryIcon.example
|> Example.wrapMsg MasteryIconMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
MasteryIconMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState MasteryIconState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
MasteryIconState childState ->
Just childState
2020-05-07 22:46:21 +03:00
_ ->
Nothing
)
, Menu.example
|> Example.wrapMsg MenuMsg
(\msg ->
case msg of
MenuMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState MenuState
(\msg ->
case msg of
MenuState childState ->
Just childState
_ ->
Nothing
)
, Message.example
|> Example.wrapMsg MessageMsg
(\msg ->
case msg of
MessageMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState MessageState
(\msg ->
case msg of
MessageState childState ->
Just childState
2020-04-01 02:00:29 +03:00
_ ->
Nothing
)
, Modal.example
|> Example.wrapMsg ModalMsg
(\msg ->
case msg of
ModalMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState ModalState
(\msg ->
case msg of
ModalState childState ->
Just childState
_ ->
Nothing
)
, Page.example
|> Example.wrapMsg PageMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
PageMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState PageState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
PageState childState ->
Just childState
_ ->
Nothing
)
, Pennant.example
|> Example.wrapMsg PennantMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
PennantMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState PennantState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
PennantState childState ->
Just childState
2020-07-30 21:12:30 +03:00
_ ->
Nothing
)
, RadioButton.example
|> Example.wrapMsg RadioButtonMsg
(\msg ->
case msg of
RadioButtonMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState RadioButtonState
(\msg ->
case msg of
RadioButtonState childState ->
Just childState
2020-04-01 02:00:29 +03:00
_ ->
Nothing
)
, SegmentedControl.example
|> Example.wrapMsg SegmentedControlMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
SegmentedControlMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState SegmentedControlState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
SegmentedControlState childState ->
Just childState
_ ->
Nothing
)
, Select.example
|> Example.wrapMsg SelectMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
SelectMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState SelectState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
SelectState childState ->
Just childState
_ ->
Nothing
)
, Slide.example
|> Example.wrapMsg SlideMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
SlideMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState SlideState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
SlideState childState ->
Just childState
_ ->
Nothing
)
, SlideModal.example
|> Example.wrapMsg SlideModalMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
SlideModalMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState SlideModalState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
SlideModalState childState ->
Just childState
_ ->
Nothing
)
, SortableTable.example
|> Example.wrapMsg SortableTableMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
SortableTableMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState SortableTableState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
SortableTableState childState ->
Just childState
_ ->
Nothing
)
, Svg.example
|> Example.wrapMsg SvgMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
SvgMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState SvgState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
SvgState childState ->
Just childState
_ ->
Nothing
)
, Table.example
|> Example.wrapMsg TableMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
TableMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState TableState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
TableState childState ->
Just childState
_ ->
Nothing
)
, Tabs.example
|> Example.wrapMsg TabsMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
TabsMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState TabsState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
TabsState childState ->
Just childState
_ ->
Nothing
)
, Text.example
|> Example.wrapMsg TextMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
TextMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState TextState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
TextState childState ->
Just childState
_ ->
Nothing
)
, Writing.example
|> Example.wrapMsg WritingMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
WritingMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState WritingState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
WritingState childState ->
Just childState
_ ->
Nothing
)
, TextArea.example
|> Example.wrapMsg TextAreaMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
TextAreaMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState TextAreaState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
TextAreaState childState ->
Just childState
_ ->
Nothing
)
, TextInput.example
|> Example.wrapMsg TextInputMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
TextInputMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState TextInputState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
TextInputState childState ->
Just childState
_ ->
Nothing
)
, Tooltip.example
|> Example.wrapMsg TooltipMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
TooltipMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState TooltipState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
TooltipState childState ->
Just childState
_ ->
Nothing
)
, UiIcon.example
|> Example.wrapMsg UiIconMsg
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
UiIconMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState UiIconState
(\msg ->
2020-04-01 02:00:29 +03:00
case msg of
UiIconState childState ->
Just childState
_ ->
Nothing
)
2020-04-01 01:26:05 +03:00
]
2018-02-13 00:32:38 +03:00
type State
= AccordionState Accordion.State
2020-04-01 02:00:29 +03:00
| AssignmentIconState AssignmentIcon.State
| ButtonState Button.State
| CalloutState Callout.State
2020-04-01 02:00:29 +03:00
| CheckboxState Checkbox.State
| ClickableSvgState ClickableSvg.State
| ClickableTextState ClickableText.State
| ColorsState Colors.State
2020-05-15 20:15:35 +03:00
| ConfettiState Confetti.State
2020-04-01 02:00:29 +03:00
| DisclosureIndicatorState DisclosureIndicator.State
2020-04-09 01:13:06 +03:00
| DividerState Divider.State
2020-04-01 02:00:29 +03:00
| FontsState Fonts.State
| HeadingState Heading.State
| IconState Icon.State
2020-04-03 04:13:29 +03:00
| LoadingState Loading.State
2020-04-01 02:00:29 +03:00
| LogoState Logo.State
| MasteryIconState MasteryIcon.State
2020-05-07 22:46:21 +03:00
| MenuState Menu.State
| MessageState Message.State
| ModalState Modal.State
2020-04-01 02:00:29 +03:00
| PageState Page.State
| PennantState Pennant.State
2020-07-30 21:12:30 +03:00
| RadioButtonState RadioButton.State
2020-04-01 02:00:29 +03:00
| SegmentedControlState SegmentedControl.State
| SelectState Select.State
| SlideState Slide.State
| SlideModalState SlideModal.State
| SortableTableState SortableTable.State
| SvgState Svg.State
| TableState Table.State
| TabsState Tabs.State
| TextState Text.State
| TextAreaState TextArea.State
| TextInputState TextInput.State
| TooltipState Tooltip.State
| UiIconState UiIcon.State
| WritingState Writing.State
type Msg
2020-03-31 22:05:56 +03:00
= AccordionMsg Accordion.Msg
2020-04-01 02:00:29 +03:00
| AssignmentIconMsg AssignmentIcon.Msg
| ButtonMsg Button.Msg
| CalloutMsg Callout.Msg
2020-04-01 02:00:29 +03:00
| CheckboxMsg Checkbox.Msg
| ClickableSvgMsg ClickableSvg.Msg
| ClickableTextMsg ClickableText.Msg
| ColorsMsg Colors.Msg
2020-05-15 20:15:35 +03:00
| ConfettiMsg Confetti.Msg
2020-04-01 02:00:29 +03:00
| DisclosureIndicatorMsg DisclosureIndicator.Msg
2020-04-09 01:13:06 +03:00
| DividerMsg Divider.Msg
2020-04-01 02:00:29 +03:00
| FontsMsg Fonts.Msg
| HeadingMsg Heading.Msg
| IconMsg Icon.Msg
2020-04-03 04:13:29 +03:00
| LoadingMsg Loading.Msg
2020-04-01 02:00:29 +03:00
| LogoMsg Logo.Msg
| MasteryIconMsg MasteryIcon.Msg
2020-05-07 22:46:21 +03:00
| MenuMsg Menu.Msg
| MessageMsg Message.Msg
2020-03-31 22:48:26 +03:00
| ModalMsg Modal.Msg
2020-04-01 02:00:29 +03:00
| PageMsg Page.Msg
| PennantMsg Pennant.Msg
2020-07-30 21:12:30 +03:00
| RadioButtonMsg RadioButton.Msg
2020-04-01 02:00:29 +03:00
| SegmentedControlMsg SegmentedControl.Msg
| SelectMsg Select.Msg
| SlideMsg Slide.Msg
| SlideModalMsg SlideModal.Msg
| SortableTableMsg SortableTable.Msg
| SvgMsg Svg.Msg
| TableMsg Table.Msg
| TabsMsg Tabs.Msg
| TextMsg Text.Msg
| TextAreaMsg TextArea.Msg
| TextInputMsg TextInput.Msg
| TooltipMsg Tooltip.Msg
| UiIconMsg UiIcon.Msg
| WritingMsg Writing.Msg