git.iko.soy/rowtype-yoga/psfp
on 9e23a92 help sign in
rowtype-yoga/psfp/stories/TypographyStories.purs
52 lines 2.0 kB history raw
1module TypographyStories where
3import Prelude hiding (add)
5import Container.Component (mkContainer)
6import Data.Maybe (Maybe(..))
7import Effect (Effect)
8import React.Basic (element)
9import Storybook.React (Storybook, add, addDecorator, storiesOf)
10import Theme.Default (darkTheme)
11import Typography.Header (HeadingLevel(..), mkH)
12import Typography.Paragraph (mkP)
14stories ∷ Effect Storybook
15stories =
16 storiesOf "Typography" do
17 add "All" mkH
18 [ { text: "A first level heading", level: H1, className: Nothing }
19 , { text: "Second level", level: H2, className: Nothing }
20 , { text: "A long third level heading", level: H3, className: Nothing }
21 , { text: "Finally, a pretty long h4 heading", level: H4, className: Nothing }
22 , { text: "A subheading", level: Subheading, className: Nothing }
23 ]
24 addDecorator \jsx -> do
25 container <- mkContainer
26 p <- mkP
27 pure
28 $ element container
29 { theme: darkTheme
30 , children: [
31 jsx,
32 element p { text: loremIpsum }
33 ]
34 }
35 add "H1" mkH
36 [ { text: "Purescript (H1)", level: H1, className: Nothing } ]
37 add "H2" mkH
38 [ { text: "Purescript (H2)", level: H2, className: Nothing } ]
39 add "H3" mkH
40 [ { text: "Purescript (H3)", level: H3, className: Nothing } ]
41 add "H4" mkH
42 [ { text: "Purescript (H4)", level: H4, className: Nothing } ]
43 add "H5" mkH
44 [ { text: "Purescript (H5)", level: Subheading, className: Nothing } ]
46loremIpsum ∷ String
47loremIpsum =
48 """PureScript is a strongly-typed, purely-functional programming language that compiles""" <>
49 """to JavaScript. It can be used to develop web applications, server side apps, and als""" <>
50 """o desktop applications with use of Electron. Its syntax is mostly comparable to that""" <>
51 """of Haskell. In addition, it introduces row polymorphism and extensible records.[2] A""" <>
52 """lso, contrary to Haskell, PureScript adheres to a strict evaluation strategy."""