1module ButtonStories where
3import Prelude hiding (add)
5import Button.Component (ButtonType(..), mkButton)
6import Decorator.FullScreen (fullScreenDecorator)
8import Effect.Console (log)
9import React.Basic.DOM as R
10import React.Basic.Events (handler_)
11import React.Basic.Hooks (component, element)
12import SVG.Icon (alternativeIcon, apIcon, appendIcon, applyIcon, applyflippedIcon, bindIcon, composeIcon, forallIcon, kleisliIcon, mapIcon, mapflippedIcon, pslogoIcon)
13import Storybook.React (Storybook, add, addDecorator, storiesOf)
15stories ∷ Effect Storybook
18 addDecorator fullScreenDecorator
19 add "Button" mkExample
21 , buttonType: PlainButton
22 , buttonProps: { onClick: handler_ (log "clicked cancel") }
25 , buttonType: HighlightedButton
27 { onClick: handler_ (log "clicked OK")
31 , buttonType: DisabledButton
33 { onClick: handler_ (log "clicked Disabled")
36 , { text: "Very long button text"
37 , buttonType: PlainButton
38 , buttonProps: { onClick: handler_ (log "clicked very long...") }
41 add "Icon Button" mkIconButton
42 [ { icon: alternativeIcon, buttonType: PlainButton }
43 , { icon: apIcon, buttonType: HighlightedButton }
44 , { icon: appendIcon, buttonType: PlainButton }
45 , { icon: applyflippedIcon, buttonType: PlainButton }
46 , { icon: applyIcon, buttonType: PlainButton }
47 , { icon: bindIcon, buttonType: PlainButton }
48 , { icon: composeIcon, buttonType: PlainButton }
49 , { icon: forallIcon, buttonType: PlainButton }
50 , { icon: kleisliIcon, buttonType: DisabledButton }
51 , { icon: mapflippedIcon, buttonType: PlainButton }
52 , { icon: mapIcon, buttonType: PlainButton }
53 , { icon: pslogoIcon, buttonType: PlainButton }
58 component "ExampleButton" \{ text, buttonType, buttonProps } -> React.do
61 { children: [ R.text text ], buttonProps, buttonType
66 component "ExampleIconButton" \{ icon, buttonType } -> React.do
69 { children: [ element icon { width: 30 } ]
76 """PureScript is a strongly-typed, purely-functional programming language that compiles"""
77 <> """ to JavaScript. It can be used to develop web applications, server side apps, and al"""
78 <> """so desktop applications with use of Electron. Its syntax is mostly comparable to tha"""
79 <> """t of Haskell. In addition, it introduces row polymorphism and extensible records.[2]"""
80 <> """ Also, contrary to Haskell, PureScript adheres to a strict evaluation strategy."""
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list