git.iko.soy/rowtype-yoga/purescript-yoga-heroui3
on main help sign in
scaffold + infra + wave 1 primitives
27c75f6Mark
src/HeroUI/Accordion.pursnew file+107
@@ -0,0 +1,107 @@
1+module HeroUI.Accordion where
2+
3+import Prelude
4+
5+import Effect.Uncurried (EffectFn1)
6+import Foreign (Foreign)
7+import React.Basic (JSX)
8+import Yoga.React.DOM.Internal (class IsJSX)
9+import Data.Function.Uncurried (runFn4)
10+import HeroUI.Internal (class CoerceHeroProps, createElementTransformImpl)
11+import HeroUI.Raw as Raw
12+
13+data Variant = Default | Surface
14+
15+derive instance Eq Variant
16+derive instance Ord Variant
17+
18+variantToString :: Variant -> String
19+variantToString = case _ of
20+ Default -> "default"
21+ Surface -> "surface"
22+
23+type AccordionProps r =
24+ ( variant :: Variant
25+ , hideSeparator :: Boolean
26+ , allowsMultipleExpanded :: Boolean
27+ , isDisabled :: Boolean
28+ , expandedKeys :: Array String
29+ , defaultExpandedKeys :: Array String
30+ , onExpandedChange :: EffectFn1 Foreign Unit
31+ , className :: String
32+ | r
33+ )
34+
35+accordion
36+ :: forall givenProps nonDataProps kids
37+ . IsJSX kids
38+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | AccordionProps () }
39+ => { | givenProps }
40+ -> kids
41+ -> JSX
42+accordion props kids = runFn4 createElementTransformImpl { variant: variantToString } Raw.accordion props kids
43+
44+type AccordionItemProps r =
45+ ( id :: String
46+ , isDisabled :: Boolean
47+ , isExpanded :: Boolean
48+ , defaultExpanded :: Boolean
49+ , className :: String
50+ | r
51+ )
52+
53+accordionItem
54+ :: forall givenProps nonDataProps kids
55+ . IsJSX kids
56+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | AccordionItemProps () }
57+ => { | givenProps }
58+ -> kids
59+ -> JSX
60+accordionItem props kids = runFn4 createElementTransformImpl {} Raw.accordionItem props kids
61+
62+type SectionProps r = (className :: String | r)
63+
64+accordionHeading
65+ :: forall givenProps nonDataProps kids
66+ . IsJSX kids
67+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | SectionProps () }
68+ => { | givenProps }
69+ -> kids
70+ -> JSX
71+accordionHeading props kids = runFn4 createElementTransformImpl {} Raw.accordionHeading props kids
72+
73+accordionTrigger
74+ :: forall givenProps nonDataProps kids
75+ . IsJSX kids
76+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | SectionProps () }
77+ => { | givenProps }
78+ -> kids
79+ -> JSX
80+accordionTrigger props kids = runFn4 createElementTransformImpl {} Raw.accordionTrigger props kids
81+
82+accordionPanel
83+ :: forall givenProps nonDataProps kids
84+ . IsJSX kids
85+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | SectionProps () }
86+ => { | givenProps }
87+ -> kids
88+ -> JSX
89+accordionPanel props kids = runFn4 createElementTransformImpl {} Raw.accordionPanel props kids
90+
91+accordionIndicator
92+ :: forall givenProps nonDataProps kids
93+ . IsJSX kids
94+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | SectionProps () }
95+ => { | givenProps }
96+ -> kids
97+ -> JSX
98+accordionIndicator props kids = runFn4 createElementTransformImpl {} Raw.accordionIndicator props kids
99+
100+accordionBody
101+ :: forall givenProps nonDataProps kids
102+ . IsJSX kids
103+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | SectionProps () }
104+ => { | givenProps }
105+ -> kids
106+ -> JSX
107+accordionBody props kids = runFn4 createElementTransformImpl {} Raw.accordionBody props kids
src/HeroUI/Card.pursnew file+79
@@ -0,0 +1,79 @@
1+module HeroUI.Card where
2+
3+import Prelude
4+
5+import React.Basic (JSX)
6+import Yoga.React.DOM.Internal (class IsJSX)
7+import Data.Function.Uncurried (runFn4)
8+import HeroUI.Internal (class CoerceHeroProps, createElementTransformImpl)
9+import HeroUI.Raw as Raw
10+
11+data Variant = Default | Secondary | Tertiary | Transparent
12+
13+derive instance Eq Variant
14+derive instance Ord Variant
15+
16+variantToString :: Variant -> String
17+variantToString = case _ of
18+ Default -> "default"
19+ Secondary -> "secondary"
20+ Tertiary -> "tertiary"
21+ Transparent -> "transparent"
22+
23+type CardProps r = (variant :: Variant, className :: String | r)
24+
25+card
26+ :: forall givenProps nonDataProps kids
27+ . IsJSX kids
28+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | CardProps () }
29+ => { | givenProps }
30+ -> kids
31+ -> JSX
32+card props kids = runFn4 createElementTransformImpl { variant: variantToString } Raw.card props kids
33+
34+type SectionProps r = (className :: String | r)
35+
36+cardHeader
37+ :: forall givenProps nonDataProps kids
38+ . IsJSX kids
39+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | SectionProps () }
40+ => { | givenProps }
41+ -> kids
42+ -> JSX
43+cardHeader props kids = runFn4 createElementTransformImpl {} Raw.cardHeader props kids
44+
45+cardTitle
46+ :: forall givenProps nonDataProps kids
47+ . IsJSX kids
48+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | SectionProps () }
49+ => { | givenProps }
50+ -> kids
51+ -> JSX
52+cardTitle props kids = runFn4 createElementTransformImpl {} Raw.cardTitle props kids
53+
54+cardDescription
55+ :: forall givenProps nonDataProps kids
56+ . IsJSX kids
57+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | SectionProps () }
58+ => { | givenProps }
59+ -> kids
60+ -> JSX
61+cardDescription props kids = runFn4 createElementTransformImpl {} Raw.cardDescription props kids
62+
63+cardContent
64+ :: forall givenProps nonDataProps kids
65+ . IsJSX kids
66+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | SectionProps () }
67+ => { | givenProps }
68+ -> kids
69+ -> JSX
70+cardContent props kids = runFn4 createElementTransformImpl {} Raw.cardContent props kids
71+
72+cardFooter
73+ :: forall givenProps nonDataProps kids
74+ . IsJSX kids
75+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | SectionProps () }
76+ => { | givenProps }
77+ -> kids
78+ -> JSX
79+cardFooter props kids = runFn4 createElementTransformImpl {} Raw.cardFooter props kids
src/HeroUI/Raw.js+50
@@ -18,6 +18,27 @@ import {
18 BadgeAnchor,
18 BadgeAnchor,
19 SkeletonRoot,
19 SkeletonRoot,
20 SeparatorRoot,
20 SeparatorRoot,
21+ CardRoot,
22+ CardHeader,
23+ CardTitle,
24+ CardDescription,
25+ CardContent,
26+ CardFooter,
27+ ScrollShadowRoot,
28+ AccordionRoot,
29+ AccordionItem,
30+ AccordionHeading,
31+ AccordionTrigger,
32+ AccordionPanel,
33+ AccordionIndicator,
34+ AccordionBody,
35+ TabsRoot,
36+ TabListContainer,
37+ TabList,
38+ Tab,
39+ TabIndicator,
40+ TabSeparator,
41+ TabPanel,
21} from "@heroui/react";
42} from "@heroui/react";
22
43
23// Button
44// Button
@@ -56,3 +77,32 @@ export const skeleton = SkeletonRoot;
56
77
57// Separator
78// Separator
58export const separator = SeparatorRoot;
79export const separator = SeparatorRoot;
80+
81+// Card
82+export const card = CardRoot;
83+export const cardHeader = CardHeader;
84+export const cardTitle = CardTitle;
85+export const cardDescription = CardDescription;
86+export const cardContent = CardContent;
87+export const cardFooter = CardFooter;
88+
89+// ScrollShadow
90+export const scrollShadow = ScrollShadowRoot;
91+
92+// Accordion
93+export const accordion = AccordionRoot;
94+export const accordionItem = AccordionItem;
95+export const accordionHeading = AccordionHeading;
96+export const accordionTrigger = AccordionTrigger;
97+export const accordionPanel = AccordionPanel;
98+export const accordionIndicator = AccordionIndicator;
99+export const accordionBody = AccordionBody;
100+
101+// Tabs
102+export const tabs = TabsRoot;
103+export const tabListContainer = TabListContainer;
104+export const tabList = TabList;
105+export const tab = Tab;
106+export const tabIndicator = TabIndicator;
107+export const tabSeparator = TabSeparator;
108+export const tabPanel = TabPanel;
src/HeroUI/Raw.purs+29
@@ -38,3 +38,32 @@ foreign import skeleton :: forall r. ReactComponent { | r }
38
38
39-- Separator
39-- Separator
40foreign import separator :: forall r. ReactComponent { | r }
40foreign import separator :: forall r. ReactComponent { | r }
41+
42+-- Card
43+foreign import card :: forall r. ReactComponent { | r }
44+foreign import cardHeader :: forall r. ReactComponent { | r }
45+foreign import cardTitle :: forall r. ReactComponent { | r }
46+foreign import cardDescription :: forall r. ReactComponent { | r }
47+foreign import cardContent :: forall r. ReactComponent { | r }
48+foreign import cardFooter :: forall r. ReactComponent { | r }
49+
50+-- ScrollShadow
51+foreign import scrollShadow :: forall r. ReactComponent { | r }
52+
53+-- Accordion
54+foreign import accordion :: forall r. ReactComponent { | r }
55+foreign import accordionItem :: forall r. ReactComponent { | r }
56+foreign import accordionHeading :: forall r. ReactComponent { | r }
57+foreign import accordionTrigger :: forall r. ReactComponent { | r }
58+foreign import accordionPanel :: forall r. ReactComponent { | r }
59+foreign import accordionIndicator :: forall r. ReactComponent { | r }
60+foreign import accordionBody :: forall r. ReactComponent { | r }
61+
62+-- Tabs
63+foreign import tabs :: forall r. ReactComponent { | r }
64+foreign import tabListContainer :: forall r. ReactComponent { | r }
65+foreign import tabList :: forall r. ReactComponent { | r }
66+foreign import tab :: forall r. ReactComponent { | r }
67+foreign import tabIndicator :: forall r. ReactComponent { | r }
68+foreign import tabSeparator :: forall r. ReactComponent { | r }
69+foreign import tabPanel :: forall r. ReactComponent { | r }
src/HeroUI/ScrollShadow.pursnew file+51
@@ -0,0 +1,51 @@
1+module HeroUI.ScrollShadow where
2+
3+import Prelude
4+
5+import Effect.Uncurried (EffectFn1)
6+import React.Basic (JSX)
7+import Yoga.React.DOM.Internal (class IsJSX)
8+import Data.Function.Uncurried (runFn4)
9+import HeroUI.Types (Orientation, orientationToString)
10+import HeroUI.Internal (class CoerceHeroProps, createElementTransformImpl)
11+import HeroUI.Raw as Raw
12+
13+data Visibility = Auto | Both | Top | Bottom | Left | Right | None
14+
15+derive instance Eq Visibility
16+derive instance Ord Visibility
17+
18+visibilityToString :: Visibility -> String
19+visibilityToString = case _ of
20+ Auto -> "auto"
21+ Both -> "both"
22+ Top -> "top"
23+ Bottom -> "bottom"
24+ Left -> "left"
25+ Right -> "right"
26+ None -> "none"
27+
28+type ScrollShadowProps r =
29+ ( size :: Number
30+ , offset :: Number
31+ , visibility :: Visibility
32+ , isEnabled :: Boolean
33+ , hideScrollBar :: Boolean
34+ , orientation :: Orientation
35+ , onVisibilityChange :: EffectFn1 String Unit
36+ , className :: String
37+ | r
38+ )
39+
40+scrollShadowTransforms
41+ :: { visibility :: Visibility -> String, orientation :: Orientation -> String }
42+scrollShadowTransforms = { visibility: visibilityToString, orientation: orientationToString }
43+
44+scrollShadow
45+ :: forall givenProps nonDataProps kids
46+ . IsJSX kids
47+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | ScrollShadowProps () }
48+ => { | givenProps }
49+ -> kids
50+ -> JSX
51+scrollShadow props kids = runFn4 createElementTransformImpl scrollShadowTransforms Raw.scrollShadow props kids
src/HeroUI/Tabs.pursnew file+129
@@ -0,0 +1,129 @@
1+module HeroUI.Tabs where
2+
3+import Prelude
4+
5+import Effect.Uncurried (EffectFn1)
6+import React.Basic (JSX)
7+import Yoga.React.DOM.Internal (class IsJSX)
8+import Data.Function.Uncurried (runFn4)
9+import HeroUI.Types (Orientation, orientationToString)
10+import HeroUI.Internal (class CoerceHeroProps, createElementTransformImpl)
11+import HeroUI.Raw as Raw
12+
13+data Variant = Primary | Secondary
14+
15+derive instance Eq Variant
16+derive instance Ord Variant
17+
18+variantToString :: Variant -> String
19+variantToString = case _ of
20+ Primary -> "primary"
21+ Secondary -> "secondary"
22+
23+data KeyboardActivation = Automatic | Manual
24+
25+derive instance Eq KeyboardActivation
26+derive instance Ord KeyboardActivation
27+
28+keyboardActivationToString :: KeyboardActivation -> String
29+keyboardActivationToString = case _ of
30+ Automatic -> "automatic"
31+ Manual -> "manual"
32+
33+type TabsProps r =
34+ ( variant :: Variant
35+ , orientation :: Orientation
36+ , selectedKey :: String
37+ , defaultSelectedKey :: String
38+ , onSelectionChange :: EffectFn1 String Unit
39+ , keyboardActivation :: KeyboardActivation
40+ , isDisabled :: Boolean
41+ , className :: String
42+ | r
43+ )
44+
45+tabsTransforms
46+ :: { variant :: Variant -> String
47+ , orientation :: Orientation -> String
48+ , keyboardActivation :: KeyboardActivation -> String
49+ }
50+tabsTransforms =
51+ { variant: variantToString
52+ , orientation: orientationToString
53+ , keyboardActivation: keyboardActivationToString
54+ }
55+
56+tabs
57+ :: forall givenProps nonDataProps kids
58+ . IsJSX kids
59+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | TabsProps () }
60+ => { | givenProps }
61+ -> kids
62+ -> JSX
63+tabs props kids = runFn4 createElementTransformImpl tabsTransforms Raw.tabs props kids
64+
65+type TabProps r =
66+ ( id :: String
67+ , isDisabled :: Boolean
68+ , href :: String
69+ , className :: String
70+ | r
71+ )
72+
73+tab
74+ :: forall givenProps nonDataProps kids
75+ . IsJSX kids
76+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | TabProps () }
77+ => { | givenProps }
78+ -> kids
79+ -> JSX
80+tab props kids = runFn4 createElementTransformImpl {} Raw.tab props kids
81+
82+type PanelProps r = (id :: String, className :: String | r)
83+
84+tabPanel
85+ :: forall givenProps nonDataProps kids
86+ . IsJSX kids
87+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | PanelProps () }
88+ => { | givenProps }
89+ -> kids
90+ -> JSX
91+tabPanel props kids = runFn4 createElementTransformImpl {} Raw.tabPanel props kids
92+
93+type SectionProps r = (className :: String | r)
94+
95+tabListContainer
96+ :: forall givenProps nonDataProps kids
97+ . IsJSX kids
98+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | SectionProps () }
99+ => { | givenProps }
100+ -> kids
101+ -> JSX
102+tabListContainer props kids = runFn4 createElementTransformImpl {} Raw.tabListContainer props kids
103+
104+tabList
105+ :: forall givenProps nonDataProps kids
106+ . IsJSX kids
107+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | SectionProps () }
108+ => { | givenProps }
109+ -> kids
110+ -> JSX
111+tabList props kids = runFn4 createElementTransformImpl {} Raw.tabList props kids
112+
113+tabIndicator
114+ :: forall givenProps nonDataProps kids
115+ . IsJSX kids
116+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | SectionProps () }
117+ => { | givenProps }
118+ -> kids
119+ -> JSX
120+tabIndicator props kids = runFn4 createElementTransformImpl {} Raw.tabIndicator props kids
121+
122+tabSeparator
123+ :: forall givenProps nonDataProps kids
124+ . IsJSX kids
125+ => CoerceHeroProps { | givenProps } { | nonDataProps } { | SectionProps () }
126+ => { | givenProps }
127+ -> kids
128+ -> JSX
129+tabSeparator props kids = runFn4 createElementTransformImpl {} Raw.tabSeparator props kids