git.iko.soy/rowtype-yoga/purescript-radix-ui
on main help sign in
10 files changed+352−60
since splitsnapshots
unifiedsplit
.idea/misc.xml−1 README.md+3−2 src/RadixUI/Avatar.purs+23−13 src/RadixUI/Collapsible.purs+6−7 src/RadixUI/Dialog.js+8−7 src/RadixUI/Dialog.purs+190−8 src/RadixUI/DropdownMenu.purs+11−8 src/RadixUI/HoverCard.js+5−5 src/RadixUI/HoverCard.purs+102−6 src/RadixUI/Tooltip.purs+4−3
.idea/misc.xml−1
@@ -1,4 +1,3 @@
1−<?xml version="1.0" encoding="UTF-8"?>
21<project version="4">
32 <component name="ProjectRootManager">
43 <output url="file://$PROJECT_DIR$/out" />
README.md+3−2
@@ -45,7 +45,8 @@ with radix-ui =
4545 , "web-dom"
4646 , "web-html"
4747 ]
48− , repo =
48+ , repo =
4949 "https://github.com/rowtype-yoga/purescript-radix-ui.git"
50− , version = "main"
50+ , version = "main"
51+ }
5152```
src/RadixUI/Avatar.purs+23−13
@@ -1,18 +1,20 @@
11module RadixUI.Avatar where
22
33import Prelude
4−import React.Basic (JSX, ReactComponent)
4+
5+import Beta.DOM (class IsJSX)
6+import Beta.DOM (unsafeWithChildren)
7+import Beta.DOM.Internal (CSS)
8+import Beta.DOM.Internal (class IsJSX)
9+import Data.Time.Duration (Milliseconds)
510import Data.Undefined.NoProblem (Opt, pseudoMap)
611import Data.Undefined.NoProblem.Closed (class Coerce, coerce)
7−import React.Basic (element) as React
8−import Data.Time.Duration (Milliseconds)
912import Effect (Effect)
10−import Beta.DOM.Internal (CSS)
11−import Beta.DOM (class IsJSX)
12−import Effect.Uncurried (mkEffectFn1)
13+import Effect.Uncurried (EffectFn1, mkEffectFn1)
1314import Partial.Unsafe (unsafeCrashWith)
14−import Beta.DOM (unsafeWithChildren)
15−import Beta.DOM.Internal (class IsJSX)
15+import React.Basic (JSX, ReactComponent)
16+import React.Basic (element) as React
17+import Unsafe.Coerce (unsafeCoerce)
1618
1719foreign import rootImpl :: forall r. ReactComponent { | r }
1820foreign import imageImpl :: forall r. ReactComponent { | r }
@@ -20,6 +22,8 @@ foreign import fallbackImpl :: forall r. ReactComponent { | r }
2022
2123type RootProps =
2224 { asChild :: Opt Boolean
25+ , className :: Opt String
26+ , style :: Opt CSS
2327 }
2428
2529root :: forall p kids. Coerce p RootProps => IsJSX kids => p -> kids -> JSX
@@ -42,20 +46,26 @@ toImageLoadingStatus = case _ of
4246
4347type ImageProps =
4448 { asChild :: Opt Boolean
49+ , className :: Opt String
50+ , src :: Opt String
51+ , alt :: Opt String
52+ , style :: Opt CSS
4553 , onLoadingStatusChange :: Opt (ImageLoadingStatus -> Effect Unit)
4654 }
4755
48−image :: forall p kids. Coerce p ImageProps => IsJSX kids => p -> kids -> JSX
49−image props' kids = do
56+image :: forall p. Coerce p ImageProps => p -> JSX
57+image props' = do
5058 let props = coerce props' :: ImageProps
51− React.element imageImpl $ props
52− { onLoadingStatusChange = pseudoMap (mkEffectFn1 <<< (toImageLoadingStatus >>> _)) props.onLoadingStatusChange }
53− # unsafeWithChildren kids
59+ React.element imageImpl $ unsafeCoerce $ props
60+ { onLoadingStatusChange = pseudoMap (mkEffectFn1 <<< (toImageLoadingStatus >>> _)) props.onLoadingStatusChange :: Opt (EffectFn1 String Unit)
61+ }
5462
5563
5664type FallbackProps =
5765 { asChild :: Opt Boolean
5866 , delayMs :: Opt Milliseconds
67+ , className :: Opt String
68+ , style :: Opt CSS
5969 }
6070
6171fallback :: forall p kids. Coerce p FallbackProps => IsJSX kids => p -> kids -> JSX
src/RadixUI/Collapsible.purs+6−7
@@ -10,8 +10,7 @@ import Type.Proxy (Proxy(Proxy))
1010import Data.Undefined.NoProblem (Opt, opt, pseudoMap)
1111import Data.Undefined.NoProblem.Closed (class Coerce, coerce)
1212import Record.Builder (build, insert, modify) as RB
13−import Beta.DOM.Internal (CSS)
14−
13+import Beta.DOM.Internal (class IsJSX, CSS)
1514
1615foreign import collapsibleRootImpl :: forall a. ReactComponent { | a }
1716foreign import collapsibleTriggerImpl :: forall a. ReactComponent { | a }
@@ -27,7 +26,7 @@ type RootProps =
2726 , disabled :: Opt Boolean
2827 }
2928
30−root :: forall p. Coerce p RootProps => p -> Array JSX -> JSX
29+root :: forall p kids. IsJSX kids => Coerce p RootProps => p -> kids -> JSX
3130root props kids = React.element collapsibleRootImpl
3231 $ (coerce props :: RootProps) # RB.build
3332 ( RB.modify (Proxy :: _ "onOpenChange") (pseudoMap mkEffectFn1)
@@ -38,10 +37,10 @@ type TriggerProps =
3837 { asChild :: Opt Boolean
3938 }
4039
41−trigger :: forall p. Coerce p TriggerProps => p -> JSX -> JSX
42−trigger props kid = React.element collapsibleTriggerImpl
40+trigger :: forall p kids. IsJSX kids => Coerce p TriggerProps => p -> kids -> JSX
41+trigger props kids = React.element collapsibleTriggerImpl
4342 $ (coerce props :: TriggerProps) # RB.build
44− ( RB.insert (Proxy :: _ "children") kid
43+ ( RB.insert (Proxy :: _ "children") kids
4544 )
4645
4746type ContentProps =
@@ -49,7 +48,7 @@ type ContentProps =
4948 , forceMount :: Opt Boolean
5049 }
5150
52−content :: forall p. Coerce p ContentProps => p -> Array JSX -> JSX
51+content :: forall p kids. IsJSX kids => Coerce p ContentProps => p -> kids -> JSX
5352content props kids = React.element collapsibleContentImpl
5453 $ (coerce props :: ContentProps) # RB.build
5554 ( RB.insert (Proxy :: _ "children") kids
src/RadixUI/Dialog.js+8−7
@@ -1,9 +1,10 @@
11import * as Dialog from '@radix-ui/react-dialog';
22
3−export const dialogOverlay = Dialog.Overlay;
4−export const dialogContent = Dialog.Content;
5−export const dialogTitle = Dialog.Title;
6−export const dialogDescription = Dialog.Description;
7−export const dialogTrigger = Dialog.Trigger;
8−export const dialogClose = Dialog.Close;
9−export const dialogRoot = Dialog.Root;
3+export const overlayImpl = Dialog.Overlay;
4+export const contentImpl = Dialog.Content;
5+export const titleImpl = Dialog.Title;
6+export const descriptionImpl = Dialog.Description;
7+export const triggerImpl = Dialog.Trigger;
8+export const closeImpl = Dialog.Close;
9+export const rootImpl = Dialog.Root;
10+export const portalImpl = Dialog.Portal;
src/RadixUI/Dialog.purs+190−8
@@ -1,13 +1,195 @@
11module RadixUI.Dialog where
22
33import Prelude
4−import React.Basic (ReactComponent)
4+import React.Basic (JSX, ReactComponent)
5+import Effect.Uncurried (EffectFn1, mkEffectFn1)
6+import Prim.Row (class Union)
7+import React.Basic (element) as React
8+import Effect (Effect)
9+import Type.Proxy (Proxy(Proxy))
10+import Data.Undefined.NoProblem (Opt, pseudoMap)
11+import Data.Undefined.NoProblem.Closed (class Coerce, coerce)
12+import Record.Builder (build, insert, modify) as RB
13+import React.Basic.Events (SyntheticEvent)
14+import Web.HTML.HTMLElement (HTMLElement)
15+import Beta.DOM.Internal (CSS)
16+import Beta.DOM (class IsJSX)
517
6−foreign import dialogOverlay :: forall r. ReactComponent {|r}
7−foreign import dialogContent :: forall r. ReactComponent {|r}
8−foreign import dialogTitle :: forall r. ReactComponent {|r}
9−foreign import dialogDescription :: forall r. ReactComponent {|r}
10−foreign import dialogTrigger :: forall r. ReactComponent {|r}
11−foreign import dialogClose :: forall r. ReactComponent {|r}
12−foreign import dialogRoot :: forall r. ReactComponent {|r}
18+-- | The type of the Dialog component props
19+type RootProps =
20+ { open ∷ Opt Boolean -- ^ Whether the alert dialog is open or not
21+ , onOpenChange ∷
22+ Opt (Boolean → Effect Unit) -- ^ A callback function that is called when the alert dialog open state changes
23+ , className ∷ Opt String -- ^ The CSS class name of the alert dialog
24+ , style ∷ Opt CSS -- ^ The CSS style of the alert dialog
25+ }
1326
27+x = React.element
28+
29+-- | The foreign component for the Dialog
30+foreign import rootImpl ∷ ∀ a. ReactComponent { | a }
31+
32+-- | A PureScript wrapper for the Dialog component
33+root
34+ ∷ ∀ p
35+ . Coerce p RootProps
36+ ⇒ p
37+ → Array JSX
38+ → JSX
39+root props kids = React.element rootImpl $
40+ (coerce props ∷ RootProps) # RB.build
41+ ( RB.modify (Proxy ∷ _ "onOpenChange") (pseudoMap mkEffectFn1)
42+ <<< RB.insert (Proxy ∷ _ "children") kids
43+ )
44+
45+-- | The type of the DialogTrigger component props
46+type DialogTriggerProps =
47+ { asChild ∷
48+ Opt Boolean -- ^ Whether to render the alert dialog trigger as a child of the dialog content
49+ }
50+
51+-- | The foreign component for the DialogTrigger
52+foreign import triggerImpl ∷ ∀ a. ReactComponent { | a }
53+
54+-- | A PureScript wrapper for the DialogTrigger component
55+trigger
56+ ∷ ∀ p kids. Coerce p DialogTriggerProps ⇒ IsJSX kids ⇒ p → kids → JSX
57+trigger props kids = React.element triggerImpl $
58+ (coerce props ∷ DialogTriggerProps) # RB.build
59+ ( RB.insert (Proxy ∷ _ "children") kids
60+ )
61+
62+-- | The type of the DialogPortal component props
63+type DialogPortalProps =
64+ { forceMount ∷ Opt Boolean -- ^ Whether to force mount the alert dialog portal in the DOM even when it is not open
65+ , container ∷ Opt HTMLElement -- ^ The container element to mount the alert dialog portal into
66+ }
67+
68+-- | The foreign component for the DialogPortal
69+foreign import portalImpl ∷ ∀ a. ReactComponent { | a }
70+
71+-- | A PureScript wrapper for the DialogPortal component
72+portal
73+ ∷ ∀ p kids. Coerce p DialogPortalProps ⇒ IsJSX kids ⇒ p → kids → JSX
74+portal props kids = React.element portalImpl $
75+ (coerce props ∷ DialogPortalProps) # RB.build
76+ ( RB.insert (Proxy ∷ _ "children") kids
77+ )
78+
79+-- | The type of the DialogOverlay component props
80+type DialogOverlayProps =
81+ { asChild ∷
82+ Opt Boolean -- ^ Whether to render the alert dialog overlay as a child of the dialog content
83+ , forceMount ∷
84+ Opt Boolean -- ^ Whether to force mount the alert dialog overlay in the DOM even when it is not open
85+ , className ∷ Opt String -- ^ The CSS class name of the alert dialog overlay
86+ , style ∷ Opt CSS -- ^ The CSS style of the alert dialog overlay
87+ }
88+
89+-- | The foreign component for the DialogOverlay
90+foreign import overlayImpl ∷ ∀ a. ReactComponent { | a }
91+
92+-- | A PureScript wrapper for the DialogOverlay component
93+overlay
94+ ∷ ∀ p kids. Coerce p DialogOverlayProps ⇒ IsJSX kids ⇒ p → kids → JSX
95+overlay props kids = React.element overlayImpl $
96+ (coerce props ∷ DialogOverlayProps) # RB.build
97+ ( RB.insert (Proxy ∷ _ "children") kids
98+ )
99+
100+-- | The type of the DialogContent component props
101+type DialogContentProps =
102+ { asChild ∷
103+ Opt Boolean -- ^ Whether to render the alert dialog content as a child of the dialog root
104+ , forceMount ∷
105+ Opt Boolean -- ^ Whether to force mount the alert dialog content in the DOM even when it is not open
106+ , onOpenAutoFocus ∷
107+ Opt (Effect Unit) -- ^ A callback function that is called when the alert dialog content is opened and should receive focus
108+ , onCloseAutoFocus ∷
109+ Opt (Effect Unit) -- ^ A callback function that is called when the alert dialog content is closed and should receive focus
110+ , onEscapeKeyDown ∷
111+ Opt (Effect Unit) -- ^ A callback function that is called when the escape key is pressed while the alert dialog content is focused
112+ , className ∷ Opt String -- ^ The CSS class name of the alert dialog content
113+ , style ∷ Opt CSS -- ^ The CSS style of the alert dialog content
114+ }
115+
116+-- | The foreign component for the DialogContent
117+foreign import contentImpl ∷ ∀ a. ReactComponent { | a }
118+
119+-- | A PureScript wrapper for the DialogContent component
120+content
121+ ∷ ∀ p kids. Coerce p DialogContentProps ⇒ IsJSX kids ⇒ p → kids → JSX
122+content props kids = React.element contentImpl $
123+ (coerce props ∷ DialogContentProps) # RB.build
124+ (
125+ -- RB.modify (Proxy :: _ "onOpenAutoFocus") (pseudoMap mkEffectFn1)
126+ -- <<< RB.modify (Proxy :: _ "onCloseAutoFocus") (pseudoMap mkEffectFn1)
127+ -- <<< RB.modify (Proxy :: _ "onEscapeKeyDown") (pseudoMap mkEffectFn1)
128+ -- <<<
129+ RB.insert (Proxy ∷ _ "children") kids
130+ )
131+
132+-- | The type of the DialogCancel component props
133+type DialogCancelProps =
134+ { asChild ∷
135+ Opt Boolean -- ^ Whether to render the alert dialog cancel button as a child of the dialog content
136+ }
137+
138+-- | The type of the DialogTitle component props
139+type DialogTitleProps =
140+ { asChild ∷
141+ Opt Boolean -- ^ Whether to render the alert dialog title as a child of the dialog content
142+ , className ∷ Opt String -- ^ The CSS class name of the alert dialog title
143+ , style ∷ Opt CSS -- ^ The CSS style of the alert dialog title
144+ }
145+
146+-- | The foreign component for the DialogTitle
147+foreign import titleImpl ∷ ∀ a. ReactComponent { | a }
148+
149+-- | A PureScript wrapper for the DialogTitle component
150+title
151+ ∷ ∀ p kids. Coerce p DialogTitleProps ⇒ IsJSX kids ⇒ p → kids → JSX
152+title props kids = React.element titleImpl $
153+ (coerce props ∷ DialogTitleProps) # RB.build
154+ ( RB.insert (Proxy ∷ _ "children") kids
155+ )
156+
157+-- | The type of the DialogDescription component props
158+type DialogDescriptionProps =
159+ { asChild ∷
160+ Opt Boolean -- ^ Whether to render the alert dialog description as a child of the dialog content
161+ , className ∷
162+ Opt String -- ^ The CSS class name of the alert dialog description
163+ , style ∷ Opt CSS -- ^ The CSS style of the alert dialog description
164+ }
165+
166+-- | The foreign component for the DialogDescription
167+foreign import descriptionImpl ∷ ∀ a. ReactComponent { | a }
168+
169+-- | A PureScript wrapper for the DialogDescription component
170+description
171+ ∷ ∀ p kids. Coerce p DialogDescriptionProps ⇒ IsJSX kids ⇒ p → kids → JSX
172+description props kids = React.element descriptionImpl $
173+ (coerce props ∷ DialogDescriptionProps) # RB.build
174+ ( RB.insert (Proxy ∷ _ "children") kids
175+ )
176+
177+-- | The type of the DialogClose component props
178+type DialogCloseProps =
179+ { asChild ∷
180+ Opt Boolean -- ^ Whether to render the alert dialog description as a child of the dialog content
181+ , className ∷
182+ Opt String -- ^ The CSS class name of the alert dialog description
183+ , style ∷ Opt CSS -- ^ The CSS style of the alert dialog description
184+ }
185+
186+-- | The foreign component for the DialogClose
187+foreign import closeImpl ∷ ∀ a. ReactComponent { | a }
188+
189+-- | A PureScript wrapper for the DialogClose component
190+close
191+ ∷ ∀ p kids. Coerce p DialogCloseProps ⇒ IsJSX kids ⇒ p → kids → JSX
192+close props kids = React.element closeImpl $
193+ (coerce props ∷ DialogCloseProps) # RB.build
194+ ( RB.insert (Proxy ∷ _ "children") kids
195+ )
src/RadixUI/DropdownMenu.purs+11−8
@@ -9,7 +9,7 @@ import Effect.Uncurried (EffectFn1, mkEffectFn1)
99import Prim.Row (class Union)
1010import React.Basic (JSX, ReactComponent)
1111import React.Basic (element) as React
12−import React.Basic.Events (SyntheticEvent)
12+import React.Basic.Events (EventHandler, SyntheticEvent)
1313import Record.Builder (build, insert, modify) as RB
1414import Record.Unsafe (unsafeSet)
1515import Record.Unsafe.Union (unsafeUnion)
@@ -86,9 +86,10 @@ content props kids = React.element contentImpl
8686type DropdownMenuItemProps =
8787 { disabled :: Opt Boolean -- ^ Whether the menu item is disabled or not
8888 , onSelect ::
89− Opt (SyntheticEvent -> Effect Unit) -- ^ A callback function that is called when the menu item is selected by a pointer or keyboard event
89+ Opt EventHandler -- ^ A callback function that is called when the menu item is selected by a pointer or keyboard event
9090 , className :: Opt String -- ^ The CSS class name of the menu item
9191 , style :: Opt CSS -- ^ The CSS style of the menu item
92+ , asChild :: Opt Boolean
9293 }
9394
9495-- | The foreign component for the DropdownMenuItem
@@ -98,9 +99,9 @@ foreign import itemImpl :: forall a. ReactComponent { | a }
9899item :: forall p kids. Coerce p DropdownMenuItemProps => IsJSX kids => p -> kids -> JSX
99100item props kids = React.element itemImpl
100101 $ (coerce props :: DropdownMenuItemProps) # RB.build
101− ( RB.modify (Proxy :: _ "onSelect") (pseudoMap mkEffectFn1)
102− <<< RB.insert (Proxy :: _ "children") kids
103− )
102+-- ( RB.modify (Proxy :: _ "onSelect") (pseudoMap mkEffectFn1) <<<
103+ (RB.insert (Proxy :: _ "children") kids)
104+-- )
104105
105106-- | The type of the DropdownMenuItemIndicator component props
106107type DropdownMenuItemIndicatorProps =
@@ -247,15 +248,17 @@ separator props = React.element separatorImpl
247248type DropdownMenuArrowProps =
248249 { className :: Opt String -- ^ The CSS class name of the menu arrow
249250 , style :: Opt CSS -- ^ The CSS style of the menu arrow
251+ , asChild :: Opt Boolean -- ^ Whether to render the menu arrow as a child of the menu content
250252 }
251253
252254-- | The foreign component for the DropdownMenuArrow
253255foreign import arrowImpl :: forall a. ReactComponent { | a }
254256
255257-- | A PureScript wrapper for the DropdownMenuArrow component
256−arrow :: forall p. Coerce p DropdownMenuArrowProps => p -> JSX
257−arrow props = React.element arrowImpl
258− $ (coerce props :: DropdownMenuArrowProps)
258+arrow ∷ ∀ p kids. IsJSX kids => Coerce p DropdownMenuArrowProps ⇒ p → kids -> JSX
259+arrow props kids = React.element arrowImpl
260+ $ (coerce props ∷ DropdownMenuArrowProps)# RB.build
261+ ( RB.insert (Proxy :: Proxy "children") kids)
259262
260263-- | The type of the DropdownMenuSub component props
261264type DropdownMenuSubProps =
src/RadixUI/HoverCard.js+5−5
@@ -1,7 +1,7 @@
11import * as HoverCard from '@radix-ui/react-hover-card';
22
3−export const hoverCardRoot = HoverCard.Root;
4−export const hoverCardTrigger = HoverCard.Trigger;
5−export const hoverCardContent = HoverCard.Content;
6−export const hoverCardArrow = HoverCard.Arrow;
7−export const hoverCardPortal = HoverCard.Portal;
3+export const contentImpl = HoverCard.Content;
4+export const arrowImpl = HoverCard.Arrow;
5+export const portalImpl = HoverCard.Portal;
6+export const triggerImpl = HoverCard.Trigger;
7+export const rootImpl = HoverCard.Root;
src/RadixUI/HoverCard.purs+102−6
@@ -2,10 +2,106 @@
22module RadixUI.HoverCard where
33
44import Prelude
5−import React.Basic (ReactComponent)
65
7−foreign import hoverCardRoot :: forall r. ReactComponent { | r }
8−foreign import hoverCardTrigger :: forall r. ReactComponent { | r }
9−foreign import hoverCardContent :: forall r. ReactComponent { | r }
10−foreign import hoverCardArrow :: forall r. ReactComponent { | r }
11−foreign import hoverCardPortal :: forall r. ReactComponent { | r }
6+import Data.Undefined.NoProblem (Opt, pseudoMap)
7+import Data.Undefined.NoProblem.Closed (class Coerce, coerce)
8+import Effect (Effect)
9+import Effect.Uncurried (EffectFn1, mkEffectFn1)
10+import Prim.Row (class Union)
11+import React.Basic (JSX, ReactComponent)
12+import React.Basic (element) as React
13+import React.Basic.Events (EventHandler, SyntheticEvent)
14+import Record.Builder (build, insert, modify) as RB
15+import Record.Unsafe (unsafeSet)
16+import Record.Unsafe.Union (unsafeUnion)
17+import Type.Proxy (Proxy(Proxy))
18+import Data.Tuple.Nested ((/\))
19+import Control.Monad.Identity.Trans (runIdentityT)
20+import Beta.DOM.Internal (CSS)
21+import Beta.DOM (class IsJSX)
22+import Data.Time.Duration (Milliseconds)
23+import Web.HTML.HTMLElement (HTMLElement)
24+
25+-- The type of the HoverCard component props
26+type RootProps =
27+ { open :: Opt Boolean -- ^ Whether the HoverCard is open or not
28+ , onOpenChange ::
29+ Opt (Boolean -> Effect Unit) -- ^ A callback function that is called when the HoverCard open state changes
30+ , className :: Opt String -- ^ The CSS class name of the HoverCard
31+ , openDelay :: Opt Milliseconds -- ^ The duration from when the mouse enters the trigger until the hover card opens
32+ , closeDelay :: Opt Milliseconds -- ^ The duration from when the mouse leaves the trigger until the hover card closes
33+ , style :: Opt CSS -- ^ The CSS style of the HoverCard
34+ }
35+
36+-- The foreign component for the HoverCard
37+foreign import rootImpl :: forall a. ReactComponent { | a }
38+
39+-- A PureScript wrapper for the HoverCard component
40+root :: forall p. Coerce p RootProps => p -> Array JSX -> JSX
41+root props kids = React.element rootImpl
42+ $ (coerce props :: RootProps) # RB.build
43+ ( RB.modify (Proxy :: _ "onOpenChange") (pseudoMap mkEffectFn1)
44+ <<< RB.insert (Proxy :: _ "children") kids
45+ )
46+
47+type HoverCardContentProps =
48+ { className :: Opt String -- ^ The CSS class name of the HoverCard content
49+ , style :: Opt CSS -- ^ The CSS style of the HoverCard content
50+ }
51+
52+-- The foreign component for the HoverCardContent
53+foreign import contentImpl :: forall a. ReactComponent { | a }
54+
55+-- A PureScript wrapper for the HoverCardContent component
56+content :: forall p kids. IsJSX kids => Coerce p HoverCardContentProps => p -> kids -> JSX
57+content props kids = React.element contentImpl
58+ $ (coerce props :: HoverCardContentProps) # RB.build
59+ ( RB.insert (Proxy :: _ "children") kids
60+ )
61+
62+-- The type of the HoverCardTrigger component props
63+type HoverCardTriggerProps =
64+ { className :: Opt String -- ^ The CSS class name of the HoverCard trigger
65+ , style :: Opt CSS -- ^ The CSS style of the HoverCard trigger
66+ }
67+
68+-- The foreign component for the HoverCardTrigger
69+foreign import triggerImpl :: forall a. ReactComponent { | a }
70+
71+-- A PureScript wrapper for the HoverCardTrigger component
72+trigger ::
73+ forall p kids. Coerce p HoverCardTriggerProps => IsJSX kids => p -> kids -> JSX
74+trigger props kids = React.element triggerImpl
75+ $ (coerce props :: HoverCardTriggerProps) # RB.build
76+ ( RB.insert (Proxy :: _ "children") kids
77+ )
78+
79+-- The type of the arrow component props
80+type HoverCardArrowProps =
81+ { className :: Opt String -- ^ The CSS class name of the HoverCard arrow
82+ , style :: Opt CSS -- ^ The CSS style of the HoverCard arrow
83+ }
84+
85+-- The foreign component for the HoverCard arrow
86+foreign import arrowImpl :: forall a. ReactComponent { | a }
87+
88+-- A PureScript wrapper for the HoverCard arrow component
89+arrow ∷ ∀ p kids. IsJSX kids => Coerce p HoverCardArrowProps ⇒ p → kids -> JSX
90+arrow props kids = React.element arrowImpl
91+ $ (coerce props ∷ HoverCardArrowProps) # RB.build
92+ ( RB.insert (Proxy :: Proxy "children") kids)
93+
94+-- The type of the portal component props
95+type HoverCardPortalProps =
96+ { container :: Opt HTMLElement -- ^ The DOM element to render the portal into
97+ }
98+
99+-- The foreign component for the HoverCard portal
100+foreign import portalImpl :: forall a. ReactComponent { | a }
101+
102+-- A PureScript wrapper for the HoverCardPortal component
103+portal ::
104+ forall p kids. Coerce p HoverCardPortalProps => IsJSX kids => p -> kids -> JSX
105+portal props kids = React.element portalImpl
106+ $ (coerce props :: HoverCardPortalProps) #
107+ unsafeSet "children" kids
src/RadixUI/Tooltip.purs+4−3
@@ -135,7 +135,8 @@ type ArrowProps =
135135
136136foreign import arrowImpl ∷ ∀ a. ReactComponent { | a }
137137
138−arrow ∷ ∀ p. Coerce p ArrowProps ⇒ p → JSX
139−arrow props = React.element arrowImpl
140− $ (coerce props ∷ ArrowProps)
138+arrow ∷ ∀ p kids. IsJSX kids => Coerce p ArrowProps ⇒ p → kids -> JSX
139+arrow props kids = React.element arrowImpl
140+ $ (coerce props ∷ ArrowProps)# RB.build
141+ ( RB.insert (Proxy :: Proxy "children") kids)
141142