noredink-ui/styleguide-app/Examples.elm

895 lines
24 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
import Examples.Balloon as Balloon
2022-05-20 21:57:47 +03:00
import Examples.BreadCrumbs as BreadCrumbs
2020-03-31 22:05:56 +03:00
import Examples.Button as Button
import Examples.Carousel as Carousel
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
2021-10-13 20:44:03 +03:00
import Examples.Container as Container
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
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
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
2022-03-10 19:50:39 +03:00
import Examples.Shadows as Shadows
2022-03-11 02:39:37 +03:00
import Examples.SideNav as SideNav
2020-03-31 22:43:32 +03:00
import Examples.SortableTable as SortableTable
import Examples.Sprite as Sprite
2020-03-31 22:43:32 +03:00
import Examples.Svg as Svg
2020-12-10 20:56:52 +03:00
import Examples.Switch as Switch
2020-03-31 22:43:32 +03:00
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
)
, Balloon.example
|> Example.wrapMsg BalloonMsg
(\msg ->
case msg of
BalloonMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState BalloonState
(\msg ->
case msg of
BalloonState childState ->
Just childState
2022-05-20 21:57:47 +03:00
_ ->
Nothing
)
, BreadCrumbs.example
|> Example.wrapMsg BreadCrumbsMsg
(\msg ->
case msg of
BreadCrumbsMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState BreadCrumbsState
(\msg ->
case msg of
BreadCrumbsState 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
)
, Carousel.example
|> Example.wrapMsg CarouselMsg
(\msg ->
case msg of
CarouselMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState CarouselState
(\msg ->
case msg of
CarouselState 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
2021-10-13 20:44:03 +03:00
_ ->
Nothing
)
, Container.example
|> Example.wrapMsg ContainerMsg
(\msg ->
case msg of
ContainerMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState ContainerState
(\msg ->
case msg of
ContainerState 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
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
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
2022-03-10 19:50:39 +03:00
_ ->
Nothing
)
, Shadows.example
|> Example.wrapMsg ShadowsMsg
(\msg ->
case msg of
ShadowsMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState ShadowsState
(\msg ->
case msg of
ShadowsState childState ->
Just childState
2022-03-11 02:39:37 +03:00
_ ->
Nothing
)
, SideNav.example
|> Example.wrapMsg SideNavMsg
(\msg ->
case msg of
SideNavMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState SideNavState
(\msg ->
case msg of
SideNavState childState ->
Just childState
2020-04-01 02:00:29 +03:00
_ ->
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
)
, Sprite.example
|> Example.wrapMsg SpriteMsg
(\msg ->
case msg of
SpriteMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState SpriteState
(\msg ->
case msg of
SpriteState childState ->
Just childState
2020-04-01 02:00:29 +03:00
_ ->
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
2020-12-10 20:56:52 +03:00
_ ->
Nothing
)
, Switch.example
|> Example.wrapMsg SwitchMsg
(\msg ->
case msg of
SwitchMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState SwitchState
(\msg ->
case msg of
SwitchState childState ->
Just childState
2020-04-01 02:00:29 +03:00
_ ->
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
| BalloonState Balloon.State
2022-05-20 21:57:47 +03:00
| BreadCrumbsState BreadCrumbs.State
2020-04-01 02:00:29 +03:00
| ButtonState Button.State
| CarouselState Carousel.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
2021-10-13 20:44:03 +03:00
| ContainerState Container.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
2020-04-03 04:13:29 +03:00
| LoadingState Loading.State
2020-04-01 02:00:29 +03:00
| LogoState Logo.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
2022-03-10 19:50:39 +03:00
| ShadowsState Shadows.State
2022-03-11 02:39:37 +03:00
| SideNavState SideNav.State
2020-04-01 02:00:29 +03:00
| SortableTableState SortableTable.State
| SpriteState Sprite.State
2020-04-01 02:00:29 +03:00
| SvgState Svg.State
2020-12-10 20:56:52 +03:00
| SwitchState Switch.State
2020-04-01 02:00:29 +03:00
| 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
| BalloonMsg Balloon.Msg
2022-05-20 21:57:47 +03:00
| BreadCrumbsMsg BreadCrumbs.Msg
2020-04-01 02:00:29 +03:00
| ButtonMsg Button.Msg
| CarouselMsg Carousel.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
2021-10-13 20:44:03 +03:00
| ContainerMsg Container.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
2020-04-03 04:13:29 +03:00
| LoadingMsg Loading.Msg
2020-04-01 02:00:29 +03:00
| LogoMsg Logo.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
2022-03-10 19:50:39 +03:00
| ShadowsMsg Shadows.Msg
2022-03-11 02:39:37 +03:00
| SideNavMsg SideNav.Msg
2020-04-01 02:00:29 +03:00
| SortableTableMsg SortableTable.Msg
| SpriteMsg Sprite.Msg
2020-04-01 02:00:29 +03:00
| SvgMsg Svg.Msg
2020-12-10 20:56:52 +03:00
| SwitchMsg Switch.Msg
2020-04-01 02:00:29 +03:00
| TableMsg Table.Msg
| TabsMsg Tabs.Msg
| TextMsg Text.Msg
| TextAreaMsg TextArea.Msg
| TextInputMsg TextInput.Msg
| TooltipMsg Tooltip.Msg
| UiIconMsg UiIcon.Msg
| WritingMsg Writing.Msg