@@ -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