git.iko.soy/rowtype-yoga/purescript-radix-ui
on main help sign in
First commit
commit377bb22a891a946101415b3a7416c7b626e3da2b authorMark Eibes <mark.eibes@gmail.com> dateFri 21 Jul 2023, 15:09 (3 years ago)
65 files changed+1999
.gitignore+10 .idea/.gitignore+8 .idea/misc.xml+6 .idea/modules.xml+8 .idea/purescript-radix-ui.iml+9 .idea/vcs.xml+6 README.md+51 packages.dhall+128 spago.dhall+32 src/RadixUI/Accordion.js+7 src/RadixUI/Accordion.purs+104 src/RadixUI/AlertDialog.js+11 src/RadixUI/AlertDialog.purs+205 src/RadixUI/AspectRatio.js+3 src/RadixUI/AspectRatio.purs+22 src/RadixUI/Avatar.js+6 src/RadixUI/Avatar.purs+65 src/RadixUI/Checkbox.js+4 src/RadixUI/Checkbox.purs+46 src/RadixUI/Collapsible.js+5 src/RadixUI/Collapsible.purs+56 src/RadixUI/ContextMenu.js+17 src/RadixUI/ContextMenu.purs+18 src/RadixUI/Dialog.js+9 src/RadixUI/Dialog.purs+13 src/RadixUI/DropdownMenu.js+18 src/RadixUI/DropdownMenu.purs+326 src/RadixUI/Form.js+9 src/RadixUI/Form.purs+12 src/RadixUI/HoverCard.js+7 src/RadixUI/HoverCard.purs+11 src/RadixUI/Label.js+3 src/RadixUI/Label.purs+6 src/RadixUI/Menubar.js+18 src/RadixUI/Menubar.purs+21 src/RadixUI/NavigationMenu.js+43 src/RadixUI/NavigationMenu.purs+151 src/RadixUI/Popover.js+9 src/RadixUI/Popover.purs+154 src/RadixUI/Progress.js+4 src/RadixUI/Progress.purs+8 src/RadixUI/RadioGroup.js+6 src/RadixUI/RadioGroup.purs+9 src/RadixUI/ScrollArea.js+7 src/RadixUI/ScrollArea.purs+17 src/RadixUI/Select.js+18 src/RadixUI/Select.purs+21 src/RadixUI/Separator.js+3 src/RadixUI/Separator.purs+6 src/RadixUI/Slider.js+6 src/RadixUI/Slider.purs+9 src/RadixUI/Switch.js+4 src/RadixUI/Switch.purs+7 src/RadixUI/Tabs.js+6 src/RadixUI/Tabs.purs+14 src/RadixUI/Toast.js+8 src/RadixUI/Toast.purs+19 src/RadixUI/Toggle.js+3 src/RadixUI/Toggle.purs+6 src/RadixUI/ToggleGroup.js+4 src/RadixUI/ToggleGroup.purs+7 src/RadixUI/Toolbar.js+8 src/RadixUI/Toolbar.purs+12 src/RadixUI/Tooltip.js+9 src/RadixUI/Tooltip.purs+141
.gitignorenew file+10
@@ -0,0 +1,10 @@
1+/bower_components/
2+/node_modules/
3+/.pulp-cache/
4+/output/
5+/generated-docs/
6+/.psc-package/
7+/.psc*
8+/.purs*
9+/.psa*
10+/.spago
.idea/.gitignorenew file+8
@@ -0,0 +1,8 @@
1+# Default ignored files
2+/shelf/
3+/workspace.xml
4+# Editor-based HTTP Client requests
5+/httpRequests/
6+# Datasource local storage ignored files
7+/dataSources/
8+/dataSources.local.xml
.idea/misc.xmlnew file+6
@@ -0,0 +1,6 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<project version="4">
3+ <component name="ProjectRootManager">
4+ <output url="file://$PROJECT_DIR$/out" />
5+ </component>
6+</project>
.idea/modules.xmlnew file+8
@@ -0,0 +1,8 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<project version="4">
3+ <component name="ProjectModuleManager">
4+ <modules>
5+ <module fileurl="file://$PROJECT_DIR$/.idea/purescript-radix-ui.iml" filepath="$PROJECT_DIR$/.idea/purescript-radix-ui.iml" />
6+ </modules>
7+ </component>
8+</project>
.idea/purescript-radix-ui.imlnew file+9
@@ -0,0 +1,9 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<module type="JAVA_MODULE" version="4">
3+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4+ <exclude-output />
5+ <content url="file://$MODULE_DIR$" />
6+ <orderEntry type="inheritedJdk" />
7+ <orderEntry type="sourceFolder" forTests="false" />
8+ </component>
9+</module>
.idea/vcs.xmlnew file+6
@@ -0,0 +1,6 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<project version="4">
3+ <component name="VcsDirectoryMappings">
4+ <mapping directory="" vcs="Git" />
5+ </component>
6+</project>
README.mdnew file+51
@@ -0,0 +1,51 @@
1+# PureScript Radix UI
2+
3+Use this library
4+
5+add this to your `packages.dhall`
6+```dhall
7+with react-basic-dom-beta =
8+ { dependencies =
9+ [ "datetime"
10+ , "effect"
11+ , "forgetmenot"
12+ , "functions"
13+ , "nullable"
14+ , "prelude"
15+ , "react-basic"
16+ , "react-basic-hooks"
17+ , "record"
18+ , "type-equality"
19+ , "typelevel-prelude"
20+ , "unsafe-coerce"
21+ , "web-dom"
22+ , "web-events"
23+ , "web-html"
24+ , "web-touchevents"
25+ ]
26+ , repo =
27+ "https://github.com/rowtype-yoga/purescript-react-basic-dom-beta.git"
28+ , version = "main"
29+ }
30+
31+with radix-ui =
32+ { dependencies =
33+ [ "datetime"
34+ , "effect"
35+ , "newtype"
36+ , "nullable"
37+ , "partial"
38+ , "prelude"
39+ , "react-basic"
40+ , "react-basic-dom-beta"
41+ , "record"
42+ , "transformers"
43+ , "tuples"
44+ , "undefined-is-not-a-problem"
45+ , "web-dom"
46+ , "web-html"
47+ ]
48+ , repo =
49+ "https://github.com/rowtype-yoga/purescript-radix-ui.git"
50+ , version = "main"
51+```
packages.dhallnew file+128
@@ -0,0 +1,128 @@
1+{-
2+Welcome to your new Dhall package-set!
3+
4+Below are instructions for how to edit this file for most use
5+cases, so that you don't need to know Dhall to use it.
6+
7+## Use Cases
8+
9+Most will want to do one or both of these options:
10+1. Override/Patch a package's dependency
11+2. Add a package not already in the default package set
12+
13+This file will continue to work whether you use one or both options.
14+Instructions for each option are explained below.
15+
16+### Overriding/Patching a package
17+
18+Purpose:
19+- Change a package's dependency to a newer/older release than the
20+ default package set's release
21+- Use your own modified version of some dependency that may
22+ include new API, changed API, removed API by
23+ using your custom git repo of the library rather than
24+ the package set's repo
25+
26+Syntax:
27+where `entityName` is one of the following:
28+- dependencies
29+- repo
30+- version
31+-------------------------------
32+let upstream = --
33+in upstream
34+ with packageName.entityName = "new value"
35+-------------------------------
36+
37+Example:
38+-------------------------------
39+let upstream = --
40+in upstream
41+ with halogen.version = "master"
42+ with halogen.repo = "https://example.com/path/to/git/repo.git"
43+
44+ with halogen-vdom.version = "v4.0.0"
45+ with halogen-vdom.dependencies = [ "extra-dependency" ] # halogen-vdom.dependencies
46+-------------------------------
47+
48+### Additions
49+
50+Purpose:
51+- Add packages that aren't already included in the default package set
52+
53+Syntax:
54+where `<version>` is:
55+- a tag (i.e. "v4.0.0")
56+- a branch (i.e. "master")
57+- commit hash (i.e. "701f3e44aafb1a6459281714858fadf2c4c2a977")
58+-------------------------------
59+let upstream = --
60+in upstream
61+ with new-package-name =
62+ { dependencies =
63+ [ "dependency1"
64+ , "dependency2"
65+ ]
66+ , repo =
67+ "https://example.com/path/to/git/repo.git"
68+ , version =
69+ "<version>"
70+ }
71+-------------------------------
72+
73+Example:
74+-------------------------------
75+let upstream = --
76+in upstream
77+ with benchotron =
78+ { dependencies =
79+ [ "arrays"
80+ , "exists"
81+ , "profunctor"
82+ , "strings"
83+ , "quickcheck"
84+ , "lcg"
85+ , "transformers"
86+ , "foldable-traversable"
87+ , "exceptions"
88+ , "node-fs"
89+ , "node-buffer"
90+ , "node-readline"
91+ , "datetime"
92+ , "now"
93+ ]
94+ , repo =
95+ "https://github.com/hdgarrood/purescript-benchotron.git"
96+ , version =
97+ "v7.0.0"
98+ }
99+-------------------------------
100+-}
101+let upstream =
102+ https://github.com/purescript/package-sets/releases/download/psc-0.15.9-20230718/packages.dhall
103+ sha256:661c257c997f37bba1b169020a87ae6ea08eb998e931875cb92e86ac9ea26846
104+
105+in upstream
106+ with react-basic-dom-beta =
107+ { dependencies =
108+ [ "datetime"
109+ , "effect"
110+ , "forgetmenot"
111+ , "functions"
112+ , "nullable"
113+ , "prelude"
114+ , "react-basic"
115+ , "react-basic-hooks"
116+ , "record"
117+ , "type-equality"
118+ , "typelevel-prelude"
119+ , "unsafe-coerce"
120+ , "web-dom"
121+ , "web-events"
122+ , "web-html"
123+ , "web-touchevents"
124+ ]
125+ , repo =
126+ "https://github.com/rowtype-yoga/purescript-react-basic-dom-beta.git"
127+ , version = "a34fd57c40c295c6ed07c96d7478a5947875019b"
128+ }
spago.dhallnew file+32
@@ -0,0 +1,32 @@
1+{-
2+Welcome to a Spago project!
3+You can edit this file as you like.
4+
5+Need help? See the following resources:
6+- Spago documentation: https://github.com/purescript/spago
7+- Dhall language tour: https://docs.dhall-lang.org/tutorials/Language-Tour.html
8+
9+When creating a new Spago project, you can use
10+`spago init --no-comments` or `spago init -C`
11+to generate this file without the comments in this block.
12+-}
13+{ name = "radix-ui"
14+, dependencies =
15+ [ "datetime"
16+ , "effect"
17+ , "newtype"
18+ , "nullable"
19+ , "partial"
20+ , "prelude"
21+ , "react-basic"
22+ , "react-basic-dom-beta"
23+ , "record"
24+ , "transformers"
25+ , "tuples"
26+ , "undefined-is-not-a-problem"
27+ , "web-dom"
28+ , "web-html"
29+ ]
30+, packages = ./packages.dhall
31+, sources = [ "src/**/*.purs", "test/**/*.purs" ]
32+}
src/RadixUI/Accordion.jsnew file+7
@@ -0,0 +1,7 @@
1+import * as Accordion from '@radix-ui/react-accordion';
2+
3+export const accordionRootImpl = Accordion.Root;
4+export const accordionItemImpl = Accordion.Item;
5+export const accordionHeaderImpl = Accordion.Header;
6+export const accordionTriggerImpl = Accordion.Trigger;
7+export const accordionContentImpl = Accordion.Content;
src/RadixUI/Accordion.pursnew file+104
@@ -0,0 +1,104 @@
1+module RadixUI.Accordion where
2+
3+import Prelude
4+import React.Basic (JSX, ReactComponent, Ref)
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 Data.Nullable (Nullable)
14+import Web.DOM.Internal.Types (Node)
15+import Beta.DOM.Internal (CSS)
16+
17+foreign import accordionRootImpl ∷ ∀ a. ReactComponent { | a }
18+foreign import accordionItemImpl ∷ ∀ a. ReactComponent { | a }
19+foreign import accordionHeaderImpl ∷ ∀ a. ReactComponent { | a }
20+foreign import accordionTriggerImpl ∷ ∀ a. ReactComponent { | a }
21+foreign import accordionContentImpl ∷ ∀ a. ReactComponent { | a }
22+
23+data AccordionType = Single | Multiple
24+
25+type RootProps =
26+ { asChild ∷ Opt Boolean
27+ , className ∷ Opt String
28+ , style ∷ Opt CSS
29+ , type ∷ Opt AccordionType
30+ , value ∷ Opt String
31+ , defaultValue ∷ Opt String
32+ , onValueChange ∷ Opt (String → Effect Unit)
33+ , values ∷ Opt (Array String)
34+ , defaultValues ∷ Opt (Array String)
35+ , collapsible ∷ Opt Boolean
36+ , disabled ∷ Opt Boolean
37+ , dir ∷ Opt String
38+ , orientation ∷ Opt String
39+ }
40+
41+root ∷ ∀ p. Coerce p RootProps ⇒ p → Array JSX → JSX
42+root props kids = React.element accordionRootImpl
43+ $ (coerce props ∷ RootProps) # RB.build
44+ ( RB.modify (Proxy ∷ _ "onValueChange") (pseudoMap mkEffectFn1)
45+ <<< RB.modify (Proxy ∷ _ "type")
46+ ( pseudoMap case _ of
47+ Single → "single"
48+ Multiple → "multiple"
49+ )
50+ <<< RB.insert (Proxy ∷ _ "children") kids
51+ )
52+
53+type ItemProps =
54+ { asChild ∷ Opt Boolean
55+ , className ∷ Opt String
56+ , style ∷ Opt CSS
57+ , disabled ∷ Opt Boolean
58+ , value ∷ Opt String
59+ , ref ∷ Opt (Ref (Nullable Node))
60+ }
61+
62+item ∷ ∀ p. Coerce p ItemProps ⇒ p → Array JSX → JSX
63+item props kid = React.element accordionItemImpl
64+ $ (coerce props ∷ ItemProps) # RB.build
65+ ( RB.insert (Proxy ∷ _ "children") kid
66+ )
67+
68+type HeaderProps =
69+ { asChild ∷ Opt Boolean
70+ , className ∷ Opt String
71+ }
72+
73+header ∷ ∀ p. Coerce p HeaderProps ⇒ p → JSX → JSX
74+header props kid = React.element accordionHeaderImpl
75+ $ (coerce props ∷ HeaderProps) # RB.build
76+ ( RB.insert (Proxy ∷ _ "children") kid
77+ )
78+
79+type TriggerProps =
80+ { asChild ∷ Opt Boolean
81+ , className ∷ Opt String
82+ , style ∷ Opt CSS
83+ , ref ∷ Opt (Ref (Nullable Node))
84+ }
85+
86+trigger ∷ ∀ p. Coerce p TriggerProps ⇒ p → Array JSX → JSX
87+trigger props kids = React.element accordionTriggerImpl
88+ $ (coerce props ∷ TriggerProps) # RB.build
89+ ( RB.insert (Proxy ∷ _ "children") kids
90+ )
91+
92+type ContentProps =
93+ { asChild ∷ Opt Boolean
94+ , className ∷ Opt String
95+ , style ∷ Opt CSS
96+ , forceMount ∷ Opt Boolean
97+ , ref ∷ Opt (Ref (Nullable Node))
98+ }
99+
100+content ∷ ∀ p. Coerce p ContentProps ⇒ p → JSX → JSX
101+content props kid = React.element accordionContentImpl
102+ $ (coerce props ∷ ContentProps) # RB.build
103+ ( RB.insert (Proxy ∷ _ "children") kid
104+ )
src/RadixUI/AlertDialog.jsnew file+11
@@ -0,0 +1,11 @@
1+import * as AlertDialog from '@radix-ui/react-alert-dialog';
2+
3+export const rootImpl = AlertDialog.Root
4+export const triggerImpl = AlertDialog.Trigger
5+export const contentImpl = AlertDialog.Content
6+export const titleImpl = AlertDialog.Title
7+export const overlayImpl = AlertDialog.Overlay
8+export const descriptionImpl = AlertDialog.Description
9+export const portalImpl = AlertDialog.Portal
10+export const cancelImpl = AlertDialog.Cancel
11+export const actionImpl = AlertDialog.Action
src/RadixUI/AlertDialog.pursnew file+205
@@ -0,0 +1,205 @@
1+module RadixUI.AlertDialog where
2+
3+import Prelude
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)
17+
18+-- | The type of the AlertDialog 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+ }
26+
27+x = React.element
28+-- | The foreign component for the AlertDialog
29+foreign import rootImpl ∷ ∀ a. ReactComponent { | a }
30+
31+-- | A PureScript wrapper for the AlertDialog component
32+root ∷
33+ ∀ p.
34+ Coerce p RootProps ⇒
35+ p →
36+ Array JSX →
37+ JSX
38+root props kids = React.element rootImpl $
39+ (coerce props ∷ RootProps) # RB.build
40+ ( RB.modify (Proxy ∷ _ "onOpenChange") (pseudoMap mkEffectFn1)
41+ <<< RB.insert (Proxy ∷ _ "children") kids
42+ )
43+
44+-- | The type of the AlertDialogTrigger component props
45+type AlertDialogTriggerProps =
46+ { asChild ∷
47+ Opt Boolean -- ^ Whether to render the alert dialog trigger as a child of the dialog content
48+ }
49+
50+-- | The foreign component for the AlertDialogTrigger
51+foreign import triggerImpl ∷ ∀ a. ReactComponent { | a }
52+
53+-- | A PureScript wrapper for the AlertDialogTrigger component
54+trigger ∷
55+ ∀ p kids. Coerce p AlertDialogTriggerProps ⇒ IsJSX kids ⇒ p → kids → JSX
56+trigger props kids = React.element triggerImpl $
57+ (coerce props ∷ AlertDialogTriggerProps) # RB.build
58+ ( RB.insert (Proxy ∷ _ "children") kids
59+ )
60+
61+-- | The type of the AlertDialogPortal component props
62+type AlertDialogPortalProps =
63+ { forceMount ∷
64+ Opt Boolean -- ^ Whether to force mount the alert dialog portal in the DOM even when it is not open
65+ , container ∷
66+ Opt HTMLElement -- ^ The container element to mount the alert dialog portal into
67+ }
68+
69+-- | The foreign component for the AlertDialogPortal
70+foreign import portalImpl ∷ ∀ a. ReactComponent { | a }
71+
72+-- | A PureScript wrapper for the AlertDialogPortal component
73+portal ∷
74+ ∀ p kids. Coerce p AlertDialogPortalProps ⇒ IsJSX kids ⇒ p → kids → JSX
75+portal props kids = React.element portalImpl $
76+ (coerce props ∷ AlertDialogPortalProps) # RB.build
77+ ( RB.insert (Proxy ∷ _ "children") kids
78+ )
79+
80+-- | The type of the AlertDialogOverlay component props
81+type AlertDialogOverlayProps =
82+ { asChild ∷
83+ Opt Boolean -- ^ Whether to render the alert dialog overlay as a child of the dialog content
84+ , forceMount ∷
85+ Opt Boolean -- ^ Whether to force mount the alert dialog overlay in the DOM even when it is not open
86+ , className ∷ Opt String -- ^ The CSS class name of the alert dialog overlay
87+ , style ∷ Opt CSS -- ^ The CSS style of the alert dialog overlay
88+ }
89+
90+-- | The foreign component for the AlertDialogOverlay
91+foreign import overlayImpl ∷ ∀ a. ReactComponent { | a }
92+
93+-- | A PureScript wrapper for the AlertDialogOverlay component
94+overlay ∷
95+ ∀ p kids. Coerce p AlertDialogOverlayProps ⇒ IsJSX kids ⇒ p → kids → JSX
96+overlay props kids = React.element overlayImpl $
97+ (coerce props ∷ AlertDialogOverlayProps) # RB.build
98+ ( RB.insert (Proxy ∷ _ "children") kids
99+ )
100+
101+-- | The type of the AlertDialogContent component props
102+type AlertDialogContentProps =
103+ { asChild ∷
104+ Opt Boolean -- ^ Whether to render the alert dialog content as a child of the dialog root
105+ , forceMount ∷
106+ Opt Boolean -- ^ Whether to force mount the alert dialog content in the DOM even when it is not open
107+ , onOpenAutoFocus ∷
108+ Opt (Effect Unit) -- ^ A callback function that is called when the alert dialog content is opened and should receive focus
109+ , onCloseAutoFocus ∷
110+ Opt (Effect Unit) -- ^ A callback function that is called when the alert dialog content is closed and should receive focus
111+ , onEscapeKeyDown ∷
112+ Opt (Effect Unit) -- ^ A callback function that is called when the escape key is pressed while the alert dialog content is focused
113+ , className ∷ Opt String -- ^ The CSS class name of the alert dialog content
114+ , style ∷ Opt CSS -- ^ The CSS style of the alert dialog content
115+ }
116+
117+-- | The foreign component for the AlertDialogContent
118+foreign import contentImpl ∷ ∀ a. ReactComponent { | a }
119+
120+-- | A PureScript wrapper for the AlertDialogContent component
121+content ∷
122+ ∀ p kids. Coerce p AlertDialogContentProps ⇒ IsJSX kids ⇒ p → kids → JSX
123+content props kids = React.element contentImpl $
124+ (coerce props ∷ AlertDialogContentProps) # RB.build
125+ (
126+ -- RB.modify (Proxy :: _ "onOpenAutoFocus") (pseudoMap mkEffectFn1)
127+ -- <<< RB.modify (Proxy :: _ "onCloseAutoFocus") (pseudoMap mkEffectFn1)
128+ -- <<< RB.modify (Proxy :: _ "onEscapeKeyDown") (pseudoMap mkEffectFn1)
129+ -- <<<
130+ RB.insert (Proxy ∷ _ "children") kids
131+ )
132+
133+-- | The type of the AlertDialogCancel component props
134+type AlertDialogCancelProps =
135+ { asChild ∷
136+ Opt Boolean -- ^ Whether to render the alert dialog cancel button as a child of the dialog content
137+ }
138+
139+-- | The foreign component for the AlertDialogCancel
140+foreign import cancelImpl ∷ ∀ a. ReactComponent { | a }
141+
142+-- | A PureScript wrapper for the AlertDialogCancel component
143+cancel ∷
144+ ∀ p kids. Coerce p AlertDialogCancelProps ⇒ IsJSX kids ⇒ p → kids → JSX
145+cancel props kids = React.element cancelImpl $
146+ (coerce props ∷ AlertDialogCancelProps) # RB.build
147+ ( RB.insert (Proxy ∷ _ "children") kids
148+ )
149+
150+-- | The type of the AlertDialogAction component props
151+type AlertDialogActionProps =
152+ { asChild ∷
153+ Opt Boolean -- ^ Whether to render the alert dialog action button as a child of the dialog content
154+ }
155+
156+-- | The foreign component for the AlertDialogAction
157+foreign import actionImpl ∷ ∀ a. ReactComponent { | a }
158+
159+-- | A PureScript wrapper for the AlertDialogAction component
160+action ∷
161+ ∀ p kids. Coerce p AlertDialogActionProps ⇒ IsJSX kids ⇒ p → kids → JSX
162+action props kids = React.element actionImpl $
163+ (coerce props ∷ AlertDialogActionProps) # RB.build
164+ ( RB.insert (Proxy ∷ _ "children") kids
165+ )
166+
167+-- | The type of the AlertDialogTitle component props
168+type AlertDialogTitleProps =
169+ { asChild ∷
170+ Opt Boolean -- ^ Whether to render the alert dialog title as a child of the dialog content
171+ , className ∷ Opt String -- ^ The CSS class name of the alert dialog title
172+ , style ∷ Opt CSS -- ^ The CSS style of the alert dialog title
173+ }
174+
175+-- | The foreign component for the AlertDialogTitle
176+foreign import titleImpl ∷ ∀ a. ReactComponent { | a }
177+
178+-- | A PureScript wrapper for the AlertDialogTitle component
179+title ∷
180+ ∀ p kids. Coerce p AlertDialogTitleProps ⇒ IsJSX kids ⇒ p → kids → JSX
181+title props kids = React.element titleImpl $
182+ (coerce props ∷ AlertDialogTitleProps) # RB.build
183+ ( RB.insert (Proxy ∷ _ "children") kids
184+ )
185+
186+-- | The type of the AlertDialogDescription component props
187+type AlertDialogDescriptionProps =
188+ { asChild ∷
189+ Opt Boolean -- ^ Whether to render the alert dialog description as a child of the dialog content
190+ , className ∷
191+ Opt String -- ^ The CSS class name of the alert dialog description
192+ , style ∷ Opt CSS -- ^ The CSS style of the alert dialog description
193+ }
194+
195+-- | The foreign component for the AlertDialogDescription
196+foreign import descriptionImpl ∷ ∀ a. ReactComponent { | a }
197+
198+-- | A PureScript wrapper for the AlertDialogDescription component
199+description ∷
200+ ∀ p kids. Coerce p AlertDialogDescriptionProps ⇒ IsJSX kids ⇒ p → kids → JSX
201+description props kids = React.element descriptionImpl $
202+ (coerce props ∷ AlertDialogDescriptionProps) # RB.build
203+ ( RB.insert (Proxy ∷ _ "children") kids
204+ )
205+
src/RadixUI/AspectRatio.jsnew file+3
@@ -0,0 +1,3 @@
1+import {Root} from '@radix-ui/react-aspect-ratio';
2+
3+export const rootImpl = Root;
src/RadixUI/AspectRatio.pursnew file+22
@@ -0,0 +1,22 @@
1+module RadixUI.AspectRatio where
2+
3+import Prelude
4+import React.Basic (JSX, ReactComponent)
5+import Beta.DOM (class IsJSX)
6+import Beta.DOM.Internal (unsafeWithChildren)
7+import Data.Undefined.NoProblem (Opt)
8+import Record.Builder (build) as RB
9+import React.Basic (element) as React
10+import Data.Undefined.NoProblem.Closed (class Coerce, coerce)
11+
12+foreign import rootImpl :: forall a. ReactComponent a
13+
14+type AspectRatioProps =
15+ { asChild :: Opt Boolean
16+ , ratio :: Opt Number
17+
18+ }
19+root ∷
20+ ∀ p kids. Coerce p AspectRatioProps ⇒ IsJSX kids ⇒ p → kids → JSX
21+root props kids = React.element rootImpl $
22+ (coerce props ∷ AspectRatioProps) # unsafeWithChildren kids
src/RadixUI/Avatar.jsnew file+6
@@ -0,0 +1,6 @@
1+import * as Avatar from '@radix-ui/react-avatar';
2+
3+export const rootImpl = Avatar.Root;
4+export const imageImpl = Avatar.Image;
5+export const fallbackImpl = Avatar.Fallback;
6+
src/RadixUI/Avatar.pursnew file+65
@@ -0,0 +1,65 @@
1+module RadixUI.Avatar where
2+
3+import Prelude
4+import React.Basic (JSX, ReactComponent)
5+import Data.Undefined.NoProblem (Opt, pseudoMap)
6+import Data.Undefined.NoProblem.Closed (class Coerce, coerce)
7+import React.Basic (element) as React
8+import Data.Time.Duration (Milliseconds)
9+import Effect (Effect)
10+import Beta.DOM.Internal (CSS)
11+import Beta.DOM (class IsJSX)
12+import Effect.Uncurried (mkEffectFn1)
13+import Partial.Unsafe (unsafeCrashWith)
14+import Beta.DOM (unsafeWithChildren)
15+import Beta.DOM.Internal (class IsJSX)
16+
17+foreign import rootImpl :: forall r. ReactComponent { | r }
18+foreign import imageImpl :: forall r. ReactComponent { | r }
19+foreign import fallbackImpl :: forall r. ReactComponent { | r }
20+
21+type RootProps =
22+ { asChild :: Opt Boolean
23+ }
24+
25+root :: forall p kids. Coerce p RootProps => IsJSX kids => p -> kids -> JSX
26+root props kids = React.element rootImpl
27+ $ (coerce props :: RootProps) # unsafeWithChildren kids
28+
29+data ImageLoadingStatus =
30+ ImageLoadingStatusIdle |
31+ ImageLoadingStatusLoading |
32+ ImageLoadingStatusLoaded |
33+ ImageLoadingStatusError
34+
35+toImageLoadingStatus :: String -> ImageLoadingStatus
36+toImageLoadingStatus = case _ of
37+ "idle" -> ImageLoadingStatusIdle
38+ "loading" -> ImageLoadingStatusLoading
39+ "loaded" -> ImageLoadingStatusLoaded
40+ "error" -> ImageLoadingStatusError
41+ other -> unsafeCrashWith $ "Invalid value " <> other <> " for ImageLoadingStatus"
42+
43+type ImageProps =
44+ { asChild :: Opt Boolean
45+ , onLoadingStatusChange :: Opt (ImageLoadingStatus -> Effect Unit)
46+ }
47+
48+image :: forall p kids. Coerce p ImageProps => IsJSX kids => p -> kids -> JSX
49+image props' kids = do
50+ let props = coerce props' :: ImageProps
51+ React.element imageImpl $ props
52+ { onLoadingStatusChange = pseudoMap (mkEffectFn1 <<< (toImageLoadingStatus >>> _)) props.onLoadingStatusChange }
53+ # unsafeWithChildren kids
54+
55+
56+type FallbackProps =
57+ { asChild :: Opt Boolean
58+ , delayMs :: Opt Milliseconds
59+ }
60+
61+fallback :: forall p kids. Coerce p FallbackProps => IsJSX kids => p -> kids -> JSX
62+fallback props kids = React.element fallbackImpl
63+ $ (coerce props :: FallbackProps) # unsafeWithChildren kids
64+
65+
src/RadixUI/Checkbox.jsnew file+4
@@ -0,0 +1,4 @@
1+import * as Checkbox from '@radix-ui/react-checkbox';
2+
3+export const checkboxRootImpl = Checkbox.Root;
4+export const checkboxIndicatorImpl = Checkbox.Indicator;
src/RadixUI/Checkbox.pursnew file+46
@@ -0,0 +1,46 @@
1+module RadixUI.Checkbox
2+ ( root
3+ , indicator
4+ ) where
5+
6+import Prelude
7+import React.Basic (JSX, ReactComponent)
8+import Data.Undefined.NoProblem (Opt, pseudoMap)
9+import Effect (Effect)
10+import Type.Proxy (Proxy(Proxy))
11+import Effect.Uncurried (mkEffectFn1)
12+import Data.Undefined.NoProblem.Closed (class Coerce, coerce)
13+import React.Basic (element) as React
14+import Record.Builder (build, insert, modify) as RB
15+
16+foreign import checkboxRootImpl :: forall a. ReactComponent { | a }
17+foreign import checkboxIndicatorImpl :: forall a. ReactComponent { | a }
18+
19+type RootProps =
20+ { asChild :: Opt Boolean
21+ , defaultChecked :: Opt Boolean
22+ , checked :: Opt Boolean
23+ , onCheckedChange :: Opt (Boolean -> Effect Unit)
24+ , disabled :: Opt Boolean
25+ , required :: Opt Boolean
26+ , name :: Opt String
27+ , value :: Opt String
28+ }
29+
30+root :: forall p. Coerce p RootProps => p -> Array JSX -> JSX
31+root props kids = React.element checkboxRootImpl
32+ $ (coerce props :: RootProps) # RB.build
33+ ( RB.modify (Proxy :: _ "onCheckedChange") (pseudoMap mkEffectFn1)
34+ <<< RB.insert (Proxy :: _ "children") kids
35+ )
36+
37+type IndicatorProps =
38+ { asChild :: Opt Boolean
39+ , forceMount :: Opt Boolean
40+ }
41+
42+indicator :: forall p. Coerce p IndicatorProps => p -> JSX -> JSX
43+indicator props kid = React.element checkboxIndicatorImpl
44+ $ (coerce props :: IndicatorProps) # RB.build
45+ ( RB.insert (Proxy :: _ "children") kid
46+ )
src/RadixUI/Collapsible.jsnew file+5
@@ -0,0 +1,5 @@
1+import * as Collapsible from '@radix-ui/react-collapsible';
2+
3+export const collapsibleRootImpl = Collapsible.Root;
4+export const collapsibleTriggerImpl = Collapsible.Trigger;
5+export const collapsibleContentImpl = Collapsible.Content;
src/RadixUI/Collapsible.pursnew file+56
@@ -0,0 +1,56 @@
1+module RadixUI.Collapsible where
2+
3+import Prelude
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, opt, pseudoMap)
11+import Data.Undefined.NoProblem.Closed (class Coerce, coerce)
12+import Record.Builder (build, insert, modify) as RB
13+import Beta.DOM.Internal (CSS)
14+
15+
16+foreign import collapsibleRootImpl :: forall a. ReactComponent { | a }
17+foreign import collapsibleTriggerImpl :: forall a. ReactComponent { | a }
18+foreign import collapsibleContentImpl :: forall a. ReactComponent { | a }
19+
20+type RootProps =
21+ { asChild :: Opt Boolean
22+ , className :: Opt String
23+ , style :: Opt CSS
24+ , defaultOpen :: Opt Boolean
25+ , open :: Opt Boolean
26+ , onOpenChange :: Opt (Boolean -> Effect Unit)
27+ , disabled :: Opt Boolean
28+ }
29+
30+root :: forall p. Coerce p RootProps => p -> Array JSX -> JSX
31+root props kids = React.element collapsibleRootImpl
32+ $ (coerce props :: RootProps) # RB.build
33+ ( RB.modify (Proxy :: _ "onOpenChange") (pseudoMap mkEffectFn1)
34+ <<< RB.insert (Proxy :: _ "children") kids
35+ )
36+
37+type TriggerProps =
38+ { asChild :: Opt Boolean
39+ }
40+
41+trigger :: forall p. Coerce p TriggerProps => p -> JSX -> JSX
42+trigger props kid = React.element collapsibleTriggerImpl
43+ $ (coerce props :: TriggerProps) # RB.build
44+ ( RB.insert (Proxy :: _ "children") kid
45+ )
46+
47+type ContentProps =
48+ { asChild :: Opt Boolean
49+ , forceMount :: Opt Boolean
50+ }
51+
52+content :: forall p. Coerce p ContentProps => p -> Array JSX -> JSX
53+content props kids = React.element collapsibleContentImpl
54+ $ (coerce props :: ContentProps) # RB.build
55+ ( RB.insert (Proxy :: _ "children") kids
56+ )
src/RadixUI/ContextMenu.jsnew file+17
@@ -0,0 +1,17 @@
1+import * as ContextMenu from '@radix-ui/react-context-menu';
2+
3+export const contextMenuRoot = ContextMenu.Root;
4+export const contextMenuTrigger = ContextMenu.Trigger;
5+export const contextMenuContent = ContextMenu.Content;
6+export const contextMenuGroup = ContextMenu.Group;
7+export const contextMenuItem = ContextMenu.Item;
8+export const contextMenuCheckboxItem = ContextMenu.CheckboxItem;
9+export const contextMenuRadioGroup = ContextMenu.RadioGroup;
10+export const contextMenuRadioItem = ContextMenu.RadioItem;
11+export const contextMenuSeparator = ContextMenu.Separator;
12+export const contextMenuArrow = ContextMenu.Arrow;
13+export const contextMenuSub = ContextMenu.Sub;
14+export const contextMenuLabel = ContextMenu.Label;
15+export const contextMenuSubTrigger = ContextMenu.SubTrigger;
16+
17+
src/RadixUI/ContextMenu.pursnew file+18
@@ -0,0 +1,18 @@
1+module RadixUI.ContextMenu where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+
6+foreign import contextMenuRoot :: forall r. ReactComponent {|r}
7+foreign import contextMenuTrigger :: forall r. ReactComponent {|r}
8+foreign import contextMenuContent :: forall r. ReactComponent {|r}
9+foreign import contextMenuGroup :: forall r. ReactComponent {|r}
10+foreign import contextMenuItem :: forall r. ReactComponent {|r}
11+foreign import contextMenuCheckboxItem :: forall r. ReactComponent {|r}
12+foreign import contextMenuRadioGroup :: forall r. ReactComponent {|r}
13+foreign import contextMenuRadioItem :: forall r. ReactComponent {|r}
14+foreign import contextMenuSeparator :: forall r. ReactComponent {|r}
15+foreign import contextMenuArrow :: forall r. ReactComponent {|r}
16+foreign import contextMenuSub :: forall r. ReactComponent {|r}
17+foreign import contextMenuLabel :: forall r. ReactComponent {|r}
18+foreign import contextMenuSubTrigger :: forall r. ReactComponent {|r}
src/RadixUI/Dialog.jsnew file+9
@@ -0,0 +1,9 @@
1+import * as Dialog from '@radix-ui/react-dialog';
2+
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;
src/RadixUI/Dialog.pursnew file+13
@@ -0,0 +1,13 @@
1+module RadixUI.Dialog where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+
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}
13+
src/RadixUI/DropdownMenu.jsnew file+18
@@ -0,0 +1,18 @@
1+import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
2+
3+export const rootImpl = DropdownMenu.Root
4+export const arrowImpl = DropdownMenu.Arrow
5+export const portalImpl = DropdownMenu.Portal
6+export const triggerImpl = DropdownMenu.Trigger
7+export const contentImpl = DropdownMenu.Content
8+export const labelImpl = DropdownMenu.Label
9+export const itemImpl = DropdownMenu.Item
10+export const itemIndicatorImpl = DropdownMenu.ItemIndicator
11+export const groupImpl = DropdownMenu.Group
12+export const checkboxItemImpl = DropdownMenu.CheckboxItem
13+export const radioGroupImpl = DropdownMenu.RadioGroup
14+export const radioItemImpl = DropdownMenu.RadioItem
15+export const separatorImpl = DropdownMenu.Separator
16+export const subImpl = DropdownMenu.Sub
17+export const subTriggerImpl = DropdownMenu.SubTrigger
18+export const subContentImpl = DropdownMenu.SubContent
src/RadixUI/DropdownMenu.pursnew file+326
@@ -0,0 +1,326 @@
1+module RadixUI.DropdownMenu where
2+
3+import Prelude
4+
5+import Data.Undefined.NoProblem (Opt, pseudoMap)
6+import Data.Undefined.NoProblem.Closed (class Coerce, coerce)
7+import Effect (Effect)
8+import Effect.Uncurried (EffectFn1, mkEffectFn1)
9+import Prim.Row (class Union)
10+import React.Basic (JSX, ReactComponent)
11+import React.Basic (element) as React
12+import React.Basic.Events (SyntheticEvent)
13+import Record.Builder (build, insert, modify) as RB
14+import Record.Unsafe (unsafeSet)
15+import Record.Unsafe.Union (unsafeUnion)
16+import Type.Proxy (Proxy(Proxy))
17+import Data.Tuple.Nested ((/\))
18+import Control.Monad.Identity.Trans (runIdentityT)
19+import Beta.DOM.Internal (CSS)
20+import Beta.DOM (class IsJSX)
21+
22+
23+-- | The type of the DropdownMenu component props
24+type RootProps =
25+ { open :: Opt Boolean -- ^ Whether the menu is open or not
26+ , onOpenChange ::
27+ Opt (Boolean -> Effect Unit) -- ^ A callback function that is called when the menu open state changes
28+ , className :: Opt String -- ^ The CSS class name of the menu
29+ , style :: Opt CSS -- ^ The CSS style of the menu
30+ }
31+
32+-- | The foreign component for the DropdownMenu
33+foreign import rootImpl :: forall a. ReactComponent { | a }
34+
35+-- | A PureScript wrapper for the DropdownMenu component
36+root :: forall p. Coerce p RootProps => p -> Array JSX -> JSX
37+root props kids = React.element rootImpl
38+ $ (coerce props :: RootProps) # RB.build
39+ ( RB.modify (Proxy :: _ "onOpenChange") (pseudoMap mkEffectFn1)
40+ <<< RB.insert (Proxy :: _ "children") kids
41+ )
42+
43+-- | The type of the DropdownMenuContent component props
44+type DropdownMenuContentProps =
45+ { side ::
46+ Opt String -- ^ The preferred side of the menu content relative to the trigger
47+ , sideOffset ::
48+ Opt Number -- ^ The offset in pixels from the trigger to the menu content on the side axis
49+ , align ::
50+ Opt String -- ^ The preferred alignment of the menu content relative to the trigger on the side axis
51+ , alignOffset ::
52+ Opt Number -- ^ The offset in pixels from the trigger to the menu content on the align axis
53+ , disableOutsidePointerEvents ::
54+ Opt Boolean -- ^ Whether to disable pointer events outside of the menu content
55+ , onEscapeKeyDown ::
56+ Opt (Effect Unit) -- ^ A callback function that is called when the escape key is pressed while the menu content is focused
57+ , onPointerDownOutside ::
58+ Opt (Effect Unit) -- ^ A callback function that is called when a pointer event occurs outside of the menu content
59+ , onFocusOutside ::
60+ Opt (Effect Unit) -- ^ A callback function that is called when a focus event occurs outside of the menu content
61+ , onInteractOutside ::
62+ Opt (Effect Unit) -- ^ A callback function that is called when an interaction event occurs outside of the menu content
63+ , forceMount ::
64+ Opt Boolean -- ^ Whether to force mount the menu content in the DOM even when it is not open
65+ , className :: Opt String -- ^ The CSS class name of the menu content
66+ , style :: Opt CSS -- ^ The CSS style of the menu content
67+ }
68+
69+-- | The foreign component for the DropdownMenuContent
70+foreign import contentImpl :: forall a. ReactComponent { | a }
71+
72+-- | A PureScript wrapper for the DropdownMenuContent component
73+content :: forall p. Coerce p DropdownMenuContentProps => p -> Array JSX -> JSX
74+content props kids = React.element contentImpl
75+ $ (coerce props :: DropdownMenuContentProps) # RB.build
76+ (
77+ -- RB.modify (Proxy ∷ _ "onEscapeKeyDown") (pseudoMap mkEffectFn1)
78+ -- <<< RB.modify (Proxy ∷ _ "onPointerDownOutside") (pseudoMap mkEffectFn1)
79+ -- <<< RB.modify (Proxy ∷ _ "onFocusOutside") (pseudoMap mkEffectFn1)
80+ -- <<< RB.modify (Proxy ∷ _ "onInteractOutside") (pseudoMap mkEffectFn1)
81+ -- <<<
82+ RB.insert (Proxy :: _ "children") kids
83+ )
84+
85+-- | The type of the DropdownMenuItem component props
86+type DropdownMenuItemProps =
87+ { disabled :: Opt Boolean -- ^ Whether the menu item is disabled or not
88+ , onSelect ::
89+ Opt (SyntheticEvent -> Effect Unit) -- ^ A callback function that is called when the menu item is selected by a pointer or keyboard event
90+ , className :: Opt String -- ^ The CSS class name of the menu item
91+ , style :: Opt CSS -- ^ The CSS style of the menu item
92+ }
93+
94+-- | The foreign component for the DropdownMenuItem
95+foreign import itemImpl :: forall a. ReactComponent { | a }
96+
97+-- | A PureScript wrapper for the DropdownMenuItem component
98+item :: forall p kids. Coerce p DropdownMenuItemProps => IsJSX kids => p -> kids -> JSX
99+item props kids = React.element itemImpl
100+ $ (coerce props :: DropdownMenuItemProps) # RB.build
101+ ( RB.modify (Proxy :: _ "onSelect") (pseudoMap mkEffectFn1)
102+ <<< RB.insert (Proxy :: _ "children") kids
103+ )
104+
105+-- | The type of the DropdownMenuItemIndicator component props
106+type DropdownMenuItemIndicatorProps =
107+ { className :: Opt String -- ^ The CSS class name of the menu item indicator
108+ , style :: Opt CSS -- ^ The CSS style of the menu item indicator
109+ }
110+
111+-- | The foreign component for the DropdownMenuItemIndicator
112+foreign import itemIndicatorImpl :: forall a. ReactComponent { | a }
113+
114+-- | A PureScript wrapper for the DropdownMenuItemIndicator component
115+itemIndicator ::
116+ forall p kids.
117+ Coerce p DropdownMenuItemIndicatorProps =>
118+ IsJSX kids =>
119+ p ->
120+ kids ->
121+ JSX
122+itemIndicator props kids = React.element itemIndicatorImpl
123+ $ (coerce props :: DropdownMenuItemIndicatorProps) # RB.build
124+ ( RB.insert (Proxy :: _ "children") kids
125+ )
126+
127+-- | The type of the DropdownMenuTrigger component props
128+type DropdownMenuTriggerProps =
129+ { className :: Opt String -- ^ The CSS class name of the menu trigger
130+ , style :: Opt CSS -- ^ The CSS style of the menu trigger
131+ , asChild ::
132+ Opt Boolean -- ^ Whether to render the menu trigger as a child of the menu content
133+ }
134+
135+-- | The foreign component for the DropdownMenuTrigger
136+foreign import triggerImpl :: forall a. ReactComponent { | a }
137+
138+-- | A PureScript wrapper for the DropdownMenuTrigger component
139+trigger ::
140+ forall p kids. Coerce p DropdownMenuTriggerProps => IsJSX kids => p -> kids -> JSX
141+trigger props kids = React.element triggerImpl
142+ $ (coerce props :: DropdownMenuTriggerProps) # RB.build
143+ ( RB.insert (Proxy :: _ "children") kids
144+ )
145+
146+-- | The type of the DropdownMenuGroup component props
147+type DropdownMenuGroupProps = {}
148+
149+-- | The foreign component for the DropdownMenuGroup
150+foreign import groupImpl :: forall a. ReactComponent { | a }
151+
152+-- | A PureScript wrapper for the DropdownMenuGroup component
153+group :: forall p. Coerce p DropdownMenuGroupProps => p -> Array JSX -> JSX
154+group props kids = React.element groupImpl
155+ $ (coerce props :: DropdownMenuGroupProps) # RB.build
156+ ( RB.insert (Proxy :: _ "children") kids
157+ )
158+
159+-- | The type of the DropdownMenuLabel component props
160+type DropdownMenuLabelProps =
161+ { className :: Opt String -- ^ The CSS class name of the menu label
162+ , style :: Opt CSS -- ^ The CSS style of the menu label
163+ }
164+
165+-- | The foreign component for the DropdownMenuLabel
166+foreign import labelImpl :: forall a. ReactComponent { | a }
167+
168+-- | A PureScript wrapper for the DropdownMenuLabel component
169+label :: forall p kids. Coerce p DropdownMenuLabelProps => IsJSX kids => p -> kids -> JSX
170+label props kids = React.element labelImpl
171+ $ (coerce props :: DropdownMenuLabelProps) # RB.build
172+ ( RB.insert (Proxy :: _ "children") kids
173+ )
174+
175+-- | The type of the DropdownMenuCheckboxItem component props
176+type DropdownMenuCheckboxItemProps =
177+ { checked :: Opt Boolean -- ^ Whether the menu checkbox item is checked or not
178+ , onCheckedChange ::
179+ Opt (Boolean -> Effect Unit) -- ^ A callback function that is called when the menu checkbox item checked state changes
180+ , className :: Opt String -- ^ The CSS class name of the menu checkbox item
181+ , style :: Opt CSS -- ^ The CSS style of the menu checkbox item
182+ }
183+
184+-- | The foreign component for the DropdownMenuCheckboxItem
185+foreign import checkboxItemImpl :: forall a. ReactComponent { | a }
186+
187+-- | A PureScript wrapper for the DropdownMenuCheckboxItem component
188+checkboxItem :: forall p. Coerce p DropdownMenuCheckboxItemProps => p -> Array JSX -> JSX
189+checkboxItem props kids = React.element checkboxItemImpl
190+ $ (coerce props :: DropdownMenuCheckboxItemProps) # RB.build
191+ ( RB.modify (Proxy :: _ "onCheckedChange") (pseudoMap mkEffectFn1)
192+ <<< RB.insert (Proxy :: _ "children") kids
193+ )
194+
195+-- | The type of the DropdownMenuRadioGroup component props
196+type DropdownMenuRadioGroupProps =
197+ { value ::
198+ Opt String -- ^ The value of the selected menu radio item in the group
199+ , onValueChange ::
200+ Opt (String -> Effect Unit) -- ^ A callback function that is called when the value of the selected menu radio item in the group changes
201+ }
202+
203+-- | The foreign component for the DropdownMenuRadioGroup
204+foreign import radioGroupImpl :: forall a. ReactComponent { | a }
205+
206+-- | A PureScript wrapper for the DropdownMenuRadioGroup component
207+radioGroup :: forall p. Coerce p DropdownMenuRadioGroupProps => p -> Array JSX -> JSX
208+radioGroup props' kids = do
209+ let props = coerce props' :: DropdownMenuRadioGroupProps
210+ React.element radioGroupImpl
211+ $ props # unsafeUnion
212+ { onValueChange: pseudoMap mkEffectFn1 props.onValueChange
213+ , children: kids
214+ }
215+
216+-- | The type of the DropdownMenuRadioItem component props
217+type DropdownMenuRadioItemProps =
218+ { value :: String -- ^ The value of the menu radio item
219+ , className :: Opt String -- ^ The CSS class name of the menu radio item
220+ , style :: Opt CSS -- ^ The CSS style of the menu radio item
221+ }
222+
223+-- | The foreign component for the DropdownMenuRadioItem
224+foreign import radioItemImpl :: forall a. ReactComponent { | a }
225+
226+-- | A PureScript wrapper for the DropdownMenuRadioItem component
227+radioItem :: forall p. Coerce p DropdownMenuRadioItemProps => p -> Array JSX -> JSX
228+radioItem props kids = React.element radioItemImpl
229+ $ (coerce props :: DropdownMenuRadioItemProps) #
230+ unsafeSet "children" kids
231+
232+-- | The type of the DropdownMenuSeparator component props
233+type DropdownMenuSeparatorProps =
234+ { className :: Opt String -- ^ The CSS class name of the menu separator
235+ , style :: Opt CSS -- ^ The CSS style of the menu separator
236+ }
237+
238+-- | The foreign component for the DropdownMenuSeparator
239+foreign import separatorImpl :: forall a. ReactComponent { | a }
240+
241+-- | A PureScript wrapper for the DropdownMenuSeparator component
242+separator :: forall p. Coerce p DropdownMenuSeparatorProps => p -> JSX
243+separator props = React.element separatorImpl
244+ $ (coerce props :: DropdownMenuSeparatorProps)
245+
246+-- | The type of the DropdownMenuArrow component props
247+type DropdownMenuArrowProps =
248+ { className :: Opt String -- ^ The CSS class name of the menu arrow
249+ , style :: Opt CSS -- ^ The CSS style of the menu arrow
250+ }
251+
252+-- | The foreign component for the DropdownMenuArrow
253+foreign import arrowImpl :: forall a. ReactComponent { | a }
254+
255+-- | 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)
259+
260+-- | The type of the DropdownMenuSub component props
261+type DropdownMenuSubProps =
262+ { className :: Opt String }
263+
264+-- | The foreign component for the DropdownMenuSub
265+foreign import subImpl :: forall a. ReactComponent { | a }
266+
267+-- | A PureScript wrapper for the DropdownMenuSub component
268+sub :: forall p. Coerce p DropdownMenuSubProps => p -> Array JSX -> JSX
269+sub props kids = React.element subImpl
270+ $ (coerce props :: DropdownMenuSubProps) #
271+ unsafeSet "children" kids
272+
273+-- | The type of the DropdownMenuSubTrigger component props
274+type DropdownMenuSubTriggerProps =
275+ { className :: Opt String -- ^ The CSS class name of the menu sub trigger
276+ , style :: Opt CSS -- ^ The CSS style of the menu sub trigger
277+ }
278+
279+-- | The foreign component for the DropdownMenuSubTrigger
280+foreign import subTriggerImpl :: forall a. ReactComponent { | a }
281+
282+-- | A PureScript wrapper for the DropdownMenuSubTrigger component
283+subTrigger ::
284+ forall p kids. Coerce p DropdownMenuSubTriggerProps => IsJSX kids => p -> kids -> JSX
285+subTrigger props kids = React.element subTriggerImpl
286+ $ (coerce props :: DropdownMenuSubTriggerProps) #
287+ unsafeSet "children" kids
288+
289+-- | The type of the DropdownMenuSubContent component props
290+type DropdownMenuSubContentProps =
291+ { side ::
292+ Opt String -- ^ The preferred side of the menu sub content relative to the trigger
293+ , sideOffset ::
294+ Opt Number -- ^ The offset in pixels from the trigger to the menu sub content on the side axis
295+ , align ::
296+ Opt String -- ^ The preferred alignment of the menu sub content relative to the trigger on the side axis
297+ , alignOffset ::
298+ Opt Number -- ^ The offset in pixels from the trigger to the menu sub content on the align axis
299+ , className :: Opt String -- ^ The CSS class name of the menu sub content
300+ , style :: Opt CSS -- ^ The CSS style of the menu sub content
301+ }
302+
303+-- | The foreign component for the DropdownMenuSubContent
304+foreign import subContentImpl :: forall a. ReactComponent { | a }
305+
306+-- | A PureScript wrapper for the DropdownMenuSubContent component
307+subContent ::
308+ forall p kids. Coerce p DropdownMenuSubContentProps => IsJSX kids => p -> kids -> JSX
309+subContent props children = React.element subContentImpl
310+ $ (coerce props :: DropdownMenuSubContentProps) #
311+ unsafeUnion { children }
312+
313+-- | The type of the DropdownMenuPortal component props
314+type DropdownMenuPortalProps =
315+ {
316+ }
317+
318+-- | The foreign component for the DropdownMenuPortal
319+foreign import portalImpl :: forall a. ReactComponent { | a }
320+
321+-- | A PureScript wrapper for the DropdownMenuPortal component
322+portal ::
323+ forall p kids. Coerce p DropdownMenuPortalProps => IsJSX kids => p -> kids -> JSX
324+portal props kids = React.element portalImpl
325+ $ (coerce props :: DropdownMenuPortalProps) #
326+ unsafeSet "children" kids
src/RadixUI/Form.jsnew file+9
@@ -0,0 +1,9 @@
1+import * as Form from '@radix-ui/react-form';
2+
3+export const formRoot = Form.Root;
4+export const formField = Form.Field;
5+export const formLabel = Form.Label;
6+export const formControl = Form.Control;
7+export const formMessage = Form.Message;
8+export const formValidityState = Form.ValidityState;
9+export const formSubmit = Form.Submit;
src/RadixUI/Form.pursnew file+12
@@ -0,0 +1,12 @@
1+module RadixUI.Form where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+
6+foreign import formRoot :: forall r. ReactComponent {|r}
7+foreign import formField :: forall r. ReactComponent {|r}
8+foreign import formLabel :: forall r. ReactComponent {|r}
9+foreign import formControl :: forall r. ReactComponent {|r}
10+foreign import formMessage :: forall r. ReactComponent {|r}
11+foreign import formValidityState :: forall r. ReactComponent {|r}
12+foreign import formSubmit :: forall r. ReactComponent {|r}
src/RadixUI/HoverCard.jsnew file+7
@@ -0,0 +1,7 @@
1+import * as HoverCard from '@radix-ui/react-hover-card';
2+
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;
src/RadixUI/HoverCard.pursnew file+11
@@ -0,0 +1,11 @@
1+-- PureScript React Basic Hooks
2+module RadixUI.HoverCard where
3+
4+import Prelude
5+import React.Basic (ReactComponent)
6+
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 }
src/RadixUI/Label.jsnew file+3
@@ -0,0 +1,3 @@
1+import * as Label from '@radix-ui/react-label';
2+
3+export const labelRoot = Label.Root;
src/RadixUI/Label.pursnew file+6
@@ -0,0 +1,6 @@
1+module RadixUI.Label where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+
6+foreign import labelRoot :: forall r. ReactComponent { | r }
src/RadixUI/Menubar.jsnew file+18
@@ -0,0 +1,18 @@
1+import * as Menubar from '@radix-ui/react-menubar';
2+
3+export const menubarRoot = Menubar.Root;
4+export const menubarMenu = Menubar.Menu;
5+export const menubarTrigger = Menubar.Trigger;
6+export const menubarPortal = Menubar.Portal;
7+export const menubarContent = Menubar.Content;
8+export const menubarLabel = Menubar.Label;
9+export const menubarItem = Menubar.Item;
10+export const menubarGroup = Menubar.Group;
11+export const menubarCheckboxItem = Menubar.CheckboxItem;
12+export const menubarRadioGroup = Menubar.RadioGroup;
13+export const menubarRadioItem = Menubar.RadioItem;
14+export const menubarSub = Menubar.Sub;
15+export const menubarSubTrigger = Menubar.SubTrigger;
16+export const menubarSeparator = Menubar.Separator;
17+export const menubarArrow = Menubar.Arrow;
18+export const menubarItemIndicator = Menubar.ItemIndicator;
src/RadixUI/Menubar.pursnew file+21
@@ -0,0 +1,21 @@
1+module RadixUI.Menubar where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+
6+foreign import menubarRoot :: forall a. ReactComponent { | a }
7+foreign import menubarMenu :: forall a. ReactComponent { | a }
8+foreign import menubarTrigger :: forall a. ReactComponent { | a }
9+foreign import menubarPortal :: forall a. ReactComponent { | a }
10+foreign import menubarContent :: forall a. ReactComponent { | a }
11+foreign import menubarLabel :: forall a. ReactComponent { | a }
12+foreign import menubarItem :: forall a. ReactComponent { | a }
13+foreign import menubarGroup :: forall a. ReactComponent { | a }
14+foreign import menubarCheckboxItem :: forall a. ReactComponent { | a }
15+foreign import menubarRadioGroup :: forall a. ReactComponent { | a }
16+foreign import menubarRadioItem :: forall a. ReactComponent { | a }
17+foreign import menubarSub :: forall a. ReactComponent { | a }
18+foreign import menubarSubTrigger :: forall a. ReactComponent { | a }
19+foreign import menubarSeparator :: forall a. ReactComponent { | a }
20+foreign import menubarArrow :: forall a. ReactComponent { | a }
21+foreign import menubarItemIndicator :: forall a. ReactComponent { | a }
src/RadixUI/NavigationMenu.jsnew file+43
@@ -0,0 +1,43 @@
1+import * as NavigationMenu from '@radix-ui/react-navigation-menu';
2+
3+export const navigationMenuRootImpl = NavigationMenu.Root;
4+export const navigationMenuSubImpl = NavigationMenu.Sub;
5+export const navigationMenuListImpl = NavigationMenu.List;
6+export const navigationMenuItemImpl = NavigationMenu.Item;
7+export const navigationMenuTriggerImpl = NavigationMenu.Trigger;
8+export const navigationMenuContentImpl = NavigationMenu.Content;
9+export const navigationMenuLinkImpl = NavigationMenu.Link;
10+export const navigationMenuIndicatorImpl = NavigationMenu.Indicator;
11+export const navigationMenuViewportImpl = NavigationMenu.Viewport;
12+
13+
14+// export default () => (
15+// <NavigationMenu.Root>
16+// <NavigationMenu.List>
17+// <NavigationMenu.Item>
18+// <NavigationMenu.Trigger />
19+// <NavigationMenu.Content>
20+// <NavigationMenu.Link />
21+// </NavigationMenu.Content>
22+// </NavigationMenu.Item>
23+//
24+// <NavigationMenu.Item>
25+// <NavigationMenu.Link />
26+// </NavigationMenu.Item>
27+//
28+// <NavigationMenu.Item>
29+// <NavigationMenu.Trigger />
30+// <NavigationMenu.Content>
31+// <NavigationMenu.Sub>
32+// <NavigationMenu.List />
33+// <NavigationMenu.Viewport />
34+// </NavigationMenu.Sub>
35+// </NavigationMenu.Content>
36+// </NavigationMenu.Item>
37+//
38+// <NavigationMenu.Indicator />
39+// </NavigationMenu.List>
40+//
41+// <NavigationMenu.Viewport />
42+// </NavigationMenu.Root>
43+// );
src/RadixUI/NavigationMenu.pursnew file+151
@@ -0,0 +1,151 @@
1+module RadixUI.NavigationMenu where
2+
3+import Prelude
4+import React.Basic (JSX, ReactComponent)
5+import Effect.Uncurried (EffectFn1)
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)
11+import Data.Undefined.NoProblem.Closed (class Coerce, coerce)
12+import Record.Builder (build, insert) as RB
13+import Beta.DOM.Internal (CSS)
14+import React.Basic.Events (SyntheticEvent)
15+import Beta.DOM (class IsJSX)
16+
17+foreign import navigationMenuRootImpl ∷ ∀ a. ReactComponent { | a }
18+foreign import navigationMenuSubImpl ∷ ∀ a. ReactComponent { | a }
19+foreign import navigationMenuListImpl ∷ ∀ a. ReactComponent { | a }
20+foreign import navigationMenuItemImpl ∷ ∀ a. ReactComponent { | a }
21+foreign import navigationMenuTriggerImpl ∷ ∀ a. ReactComponent { | a }
22+foreign import navigationMenuContentImpl ∷ ∀ a. ReactComponent { | a }
23+foreign import navigationMenuLinkImpl ∷ ∀ a. ReactComponent { | a }
24+foreign import navigationMenuIndicatorImpl ∷ ∀ a. ReactComponent { | a }
25+foreign import navigationMenuViewportImpl ∷ ∀ a. ReactComponent { | a }
26+
27+type RootProps =
28+ { defaultValue ∷ Opt String
29+ , value ∷ Opt String
30+ , onValueChange ∷ Opt (String → Effect Unit)
31+ , delayDuration ∷ Opt Number
32+ , skipDelayDuration ∷ Opt Number
33+ , dir ∷ Opt String
34+ , orientation ∷ Opt String
35+ , className ∷ Opt String
36+ , style ∷ Opt CSS
37+ }
38+
39+root ∷ ∀ p. Coerce p RootProps ⇒ p → Array JSX → JSX
40+root props children = React.element navigationMenuRootImpl
41+ $ (coerce props ∷ RootProps) # RB.build
42+ ( RB.insert (Proxy ∷ _ "children") children
43+ )
44+
45+type SubProps =
46+ { defaultValue ∷ Opt String
47+ , value ∷ Opt String
48+ , onValueChange ∷ Opt (String → Effect Unit)
49+ , orientation ∷ Opt String
50+ , className ∷ Opt String
51+ , style ∷ Opt CSS
52+ }
53+
54+sub ∷ ∀ p. Coerce p SubProps ⇒ p → Array JSX → JSX
55+sub props children = React.element navigationMenuSubImpl
56+ $ (coerce props ∷ SubProps) # RB.build
57+ ( RB.insert (Proxy ∷ _ "children") children
58+ )
59+
60+type ListProps =
61+ { asChild ∷ Opt Boolean
62+ , className ∷ Opt String
63+ , style ∷ Opt CSS
64+ }
65+
66+list ∷ ∀ p kids. Coerce p ListProps ⇒ IsJSX kids => p → kids → JSX
67+list props children = React.element navigationMenuListImpl
68+ $ (coerce props ∷ ListProps) # RB.build
69+ ( RB.insert (Proxy ∷ _ "children") children
70+ )
71+
72+type ItemProps =
73+ { asChild ∷ Opt Boolean
74+ , value ∷ Opt String
75+ , className ∷ Opt String
76+ , style ∷ Opt CSS
77+ }
78+
79+item ∷ ∀ p kids. IsJSX kids => Coerce p ItemProps ⇒ p → kids → JSX
80+item props children = React.element navigationMenuItemImpl
81+ $ (coerce props ∷ ItemProps) # RB.build
82+ ( RB.insert (Proxy ∷ _ "children") children
83+ )
84+
85+type TriggerProps =
86+ { asChild ∷ Opt Boolean
87+ , className ∷ Opt String
88+ , style ∷ Opt CSS
89+ }
90+
91+trigger ∷ ∀ p. Coerce p TriggerProps ⇒ p → Array JSX → JSX
92+trigger props children = React.element navigationMenuTriggerImpl
93+ $ (coerce props ∷ TriggerProps) # RB.build
94+ ( RB.insert (Proxy ∷ _ "children") children
95+ )
96+
97+type ContentProps =
98+ { asChild ∷ Opt Boolean
99+ , disableOutsidePointerEvents ∷ Opt Boolean
100+ , onEscapeKeyDown ∷ Opt (EffectFn1 SyntheticEvent Unit)
101+ , onPointerDownOutside ∷ Opt (EffectFn1 SyntheticEvent Unit)
102+ , onFocusOutside ∷ Opt (EffectFn1 SyntheticEvent Unit)
103+ , onInteractOutside ∷ Opt (EffectFn1 SyntheticEvent Unit)
104+ , forceMount ∷ Opt Boolean
105+ , className ∷ Opt String
106+ , style ∷ Opt CSS
107+ }
108+
109+content ∷ ∀ p. Coerce p ContentProps ⇒ p → Array JSX → JSX
110+content props children = React.element navigationMenuContentImpl
111+ $ (coerce props ∷ ContentProps) # RB.build
112+ ( RB.insert (Proxy ∷ _ "children") children
113+ )
114+
115+type LinkProps =
116+ { asChild ∷ Opt Boolean
117+ , active ∷ Opt Boolean
118+ , onSelect ∷ Opt (EffectFn1 SyntheticEvent Unit)
119+ , className ∷ Opt String
120+ , style ∷ Opt CSS
121+ }
122+
123+link ∷ ∀ p kids. Coerce p LinkProps => IsJSX kids ⇒ p → kids → JSX
124+link props children = React.element navigationMenuLinkImpl
125+ $ (coerce props ∷ LinkProps) # RB.build
126+ ( RB.insert (Proxy ∷ _ "children") children
127+ )
128+
129+type IndicatorProps =
130+ { asChild ∷ Opt Boolean
131+ , forceMount ∷ Opt Boolean
132+ , className ∷ Opt String
133+ , style ∷ Opt CSS
134+ }
135+
136+indicator ∷ ∀ p. Coerce p IndicatorProps ⇒ p → Array JSX → JSX
137+indicator props children = React.element navigationMenuIndicatorImpl
138+ $ (coerce props ∷ IndicatorProps) # RB.build
139+ ( RB.insert (Proxy ∷ _ "children") children
140+ )
141+
142+type ViewportProps =
143+ { asChild ∷ Opt Boolean
144+ , forceMount ∷ Opt Boolean
145+ , className ∷ Opt String
146+ , style ∷ Opt CSS
147+ }
148+
149+viewport ∷ ∀ p. Coerce p ViewportProps ⇒ p → JSX
150+viewport props = React.element navigationMenuViewportImpl
151+ $ (coerce props ∷ ViewportProps)
src/RadixUI/Popover.jsnew file+9
@@ -0,0 +1,9 @@
1+import * as Popover from '@radix-ui/react-popover';
2+
3+export const rootImpl = Popover.Root
4+export const triggerImpl = Popover.Trigger
5+export const contentImpl = Popover.Content
6+export const arrowImpl = Popover.Arrow
7+export const closeImpl = Popover.Close
8+export const anchorImpl = Popover.Anchor
9+export const portalImpl = Popover.Portal
src/RadixUI/Popover.pursnew file+154
@@ -0,0 +1,154 @@
1+module RadixUI.Popover where
2+
3+import Prelude
4+
5+import Data.Undefined.NoProblem (Opt, pseudoMap)
6+import Data.Undefined.NoProblem.Closed (class Coerce, coerce)
7+import Effect (Effect)
8+import Effect.Uncurried (EffectFn1, mkEffectFn1)
9+import Prim.Row (class Union)
10+import React.Basic (JSX, ReactComponent)
11+import Beta.DOM.Internal (CSS)
12+import Beta.DOM (class IsJSX)
13+import Record.Unsafe.Union (unsafeUnion)
14+import Type.Proxy (Proxy(Proxy))
15+import Web.DOM.Internal.Types (Element)
16+import Web.HTML.HTMLElement (HTMLElement)
17+import Record.Builder (build, insert, modify) as RB
18+import React.Basic (element) as React
19+
20+-- Root
21+type RootProps =
22+ { defaultOpen ∷ Opt Boolean
23+ , open ∷ Opt Boolean
24+ , onOpenChange ∷ Opt (Boolean → Effect Unit)
25+ , modal ∷ Opt Boolean
26+ }
27+
28+foreign import rootImpl ∷ ∀ a. ReactComponent { | a }
29+
30+root ∷ ∀ p kids. Coerce p RootProps ⇒ IsJSX kids ⇒ p → kids → JSX
31+root props kids = React.element rootImpl
32+ $ (coerce props ∷ RootProps) # RB.build
33+ ( RB.modify (Proxy ∷ _ "onOpenChange") (pseudoMap mkEffectFn1)
34+ <<< RB.insert (Proxy ∷ _ "children") kids
35+ )
36+
37+-- Trigger
38+type TriggerProps =
39+ { asChild ∷ Opt Boolean
40+ }
41+
42+foreign import triggerImpl ∷ ∀ a. ReactComponent { | a }
43+
44+trigger ∷ ∀ p kids. Coerce p TriggerProps ⇒ IsJSX kids ⇒ p → kids → JSX
45+trigger props kids = React.element triggerImpl
46+ $ (coerce props ∷ TriggerProps) # RB.build
47+ ( RB.insert (Proxy ∷ _ "children") kids
48+ )
49+
50+-- Anchor
51+type AnchorProps =
52+ { asChild ∷ Opt Boolean
53+ }
54+
55+foreign import anchorImpl ∷ ∀ a. ReactComponent { | a }
56+
57+anchor ∷ ∀ p kids. Coerce p AnchorProps ⇒ p → kids → JSX
58+anchor props kids = React.element anchorImpl
59+ $ (coerce props ∷ AnchorProps) # RB.build
60+ ( RB.insert (Proxy ∷ _ "children") kids
61+ )
62+
63+-- Portal
64+type PortalProps =
65+ { forceMount ∷ Opt Boolean
66+ , container ∷ Opt HTMLElement
67+ }
68+
69+foreign import portalImpl ∷ ∀ a. ReactComponent { | a }
70+
71+portal ∷ ∀ p kids. Coerce p PortalProps ⇒ IsJSX kids ⇒ p → kids → JSX
72+portal props kids = React.element portalImpl
73+ $ (coerce props ∷ PortalProps) # RB.build
74+ ( RB.insert (Proxy ∷ _ "children") kids
75+ )
76+
77+data PopoverSide = Top | Right | Bottom | Left
78+data Align = AlignStart | AlignCenter | AlignEnd
79+data Sticky = Always | Partial
80+-- Content
81+type ContentProps =
82+ { asChild ∷ Opt Boolean
83+ , className ∷ Opt String
84+ , style ∷ Opt CSS
85+ , onOpenAutoFocus ∷ Opt (Effect Unit)
86+ , onCloseAutoFocus ∷ Opt (Effect Unit)
87+ , onEscapeKeyDown ∷ Opt (Effect Unit)
88+ , onPointerDownOutside ∷ Opt (Effect Unit)
89+ , onFocusOutside ∷ Opt (Effect Unit)
90+ , onInteractOutside ∷ Opt (Effect Unit)
91+ , forceMount ∷ Opt Boolean
92+ , side ∷ Opt PopoverSide
93+ , sideOffset ∷ Opt Number
94+ , align ∷ Opt Align
95+ , alignOffset ∷ Opt Number
96+ , avoidCollisions ∷ Opt Boolean
97+ , collisionBoundary ∷ Opt (Array Element)
98+ , collisionPadding ∷ Opt Number
99+ , arrowPadding ∷ Opt Number
100+ , sticky ∷ Opt Sticky
101+ , hideWhenDetached ∷ Opt Boolean
102+ }
103+
104+foreign import contentImpl ∷ ∀ a. ReactComponent { | a }
105+
106+content ∷ ∀ p kids. Coerce p ContentProps ⇒ IsJSX kids ⇒ p → kids → JSX
107+content props' children = do
108+ let props = coerce props' ∷ ContentProps
109+ React.element contentImpl $ props # unsafeUnion
110+ { children
111+ , side: props.side # pseudoMap case _ of
112+ Top → "top"
113+ Right → "right"
114+ Bottom → "bottom"
115+ Left → "left"
116+ , align: props.align # pseudoMap case _ of
117+ AlignStart → "start"
118+ AlignCenter → "center"
119+ AlignEnd → "end"
120+ , sticky: props.sticky # pseudoMap case _ of
121+ Always → "always"
122+ Partial → "partial"
123+ }
124+
125+-- Arrow
126+type ArrowProps =
127+ { asChild ∷ Opt Boolean
128+ , className ∷ Opt String
129+ , style ∷ Opt CSS
130+ , width ∷ Opt Number
131+ , height ∷ Opt Number
132+ }
133+
134+foreign import arrowImpl ∷ ∀ a. ReactComponent { | a }
135+
136+arrow ∷ ∀ p. Coerce p ArrowProps ⇒ p → JSX
137+arrow props = React.element arrowImpl
138+ $ (coerce props ∷ ArrowProps)
139+
140+-- Close
141+type CloseProps =
142+ { asChild ∷ Opt Boolean
143+ , className ∷ Opt String
144+ , style ∷ Opt CSS
145+ , "aria-label" ∷ Opt String
146+ }
147+
148+foreign import closeImpl ∷ ∀ a. ReactComponent { | a }
149+
150+close ∷ ∀ p kids. Coerce p CloseProps ⇒ p → kids → JSX
151+close props children = React.element closeImpl
152+ $ (coerce props ∷ CloseProps) # RB.build
153+ ( RB.insert (Proxy ∷ _ "children") children
154+ )
src/RadixUI/Progress.jsnew file+4
@@ -0,0 +1,4 @@
1+import * as Progress from '@radix-ui/react-progress';
2+
3+export const progressRoot = Progress.Root;
4+export const progressIndicator = Progress.Indicator;
src/RadixUI/Progress.pursnew file+8
@@ -0,0 +1,8 @@
1+module RadixUI.Progress where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+
6+foreign import progressRoot :: forall a. ReactComponent { | a }
7+foreign import progressIndicator :: forall a. ReactComponent { | a }
8+
src/RadixUI/RadioGroup.jsnew file+6
@@ -0,0 +1,6 @@
1+import * as RadioGroup from '@radix-ui/react-radio-group';
2+
3+export const radioGroupRoot = RadioGroup.Root;
4+export const radioGroupItem = RadioGroup.Item;
5+export const radioGroupIndicator = RadioGroup.Indicator;
6+
src/RadixUI/RadioGroup.pursnew file+9
@@ -0,0 +1,9 @@
1+module RadixUI.RadioGroup where
2+
3+import Prelude
4+
5+import React.Basic (ReactComponent)
6+
7+foreign import radioGroupRoot :: forall a. ReactComponent { | a }
8+foreign import radioGroupItem :: forall a. ReactComponent { | a }
9+foreign import radioGroupIndicator :: forall a. ReactComponent { | a }
src/RadixUI/ScrollArea.jsnew file+7
@@ -0,0 +1,7 @@
1+import * as ScrollArea from '@radix-ui/react-scroll-area';
2+
3+export const scrollAreaRoot = ScrollArea.Root;
4+export const scrollAreaViewport = ScrollArea.Viewport;
5+export const scrollAreaScrollbar = ScrollArea.Scrollbar;
6+export const scrollAreaThumb = ScrollArea.Thumb;
7+export const scrollAreaCorner = ScrollArea.Corner;
src/RadixUI/ScrollArea.pursnew file+17
@@ -0,0 +1,17 @@
1+module RadixUI.ScrollArea where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+
6+foreign import scrollAreaRoot :: forall a. ReactComponent { | a }
7+foreign import scrollAreaViewport :: forall a. ReactComponent { | a }
8+foreign import scrollAreaScrollbar :: forall a. ReactComponent { | a }
9+foreign import scrollAreaThumb :: forall a. ReactComponent { | a }
10+foreign import scrollAreaCorner :: forall a. ReactComponent { | a }
11+
12+
13+--export const scrollAreaRoot = ScrollArea.Root;
14+--export const scrollAreaViewport = ScrollArea.Viewport;
15+--export const scrollAreaScrollbar = ScrollArea.Scrollbar;
16+--export const scrollAreaThumb = ScrollArea.Thumb;
17+--export const scrollAreaCorner = ScrollArea.Corner;
src/RadixUI/Select.jsnew file+18
@@ -0,0 +1,18 @@
1+import * as Select from '@radix-ui/react-select';
2+
3+export const selectRoot = Select.Root;
4+export const selectTrigger = Select.Trigger;
5+export const selectValue = Select.Value;
6+export const selectIcon = Select.Icon;
7+export const selectPortal = Select.Portal;
8+export const selectContent = Select.Content;
9+export const selectScrollUpButton = Select.ScrollUpButton;
10+export const selectViewport = Select.Viewport;
11+export const selectItem = Select.Item;
12+export const selectItemText = Select.ItemText;
13+export const selectItemIndicator = Select.ItemIndicator;
14+export const selectGroup = Select.Group;
15+export const selectLabel = Select.Label;
16+export const selectSeparator = Select.Separator;
17+export const selectScrollDownButton = Select.ScrollDownButton;
18+export const selectArrow = Select.Arrow;
src/RadixUI/Select.pursnew file+21
@@ -0,0 +1,21 @@
1+module RadixUI.Select where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+
6+foreign import selectRoot :: forall a. ReactComponent { | a }
7+foreign import selectTrigger :: forall a. ReactComponent { | a }
8+foreign import selectValue :: forall a. ReactComponent { | a }
9+foreign import selectIcon :: forall a. ReactComponent { | a }
10+foreign import selectPortal :: forall a. ReactComponent { | a }
11+foreign import selectContent :: forall a. ReactComponent { | a }
12+foreign import selectScrollUpButton :: forall a. ReactComponent { | a }
13+foreign import selectViewport :: forall a. ReactComponent { | a }
14+foreign import selectItem :: forall a. ReactComponent { | a }
15+foreign import selectItemText :: forall a. ReactComponent { | a }
16+foreign import selectItemIndicator :: forall a. ReactComponent { | a }
17+foreign import selectGroup :: forall a. ReactComponent { | a }
18+foreign import selectLabel :: forall a. ReactComponent { | a }
19+foreign import selectSeparator :: forall a. ReactComponent { | a }
20+foreign import selectScrollDownButton :: forall a. ReactComponent { | a }
21+foreign import selectArrow :: forall a. ReactComponent { | a }
src/RadixUI/Separator.jsnew file+3
@@ -0,0 +1,3 @@
1+import * as Separator from '@radix-ui/react-separator';
2+
3+export const separatorRoot = Separator.Root;
src/RadixUI/Separator.pursnew file+6
@@ -0,0 +1,6 @@
1+module RadixUI.Separator where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+
6+foreign import separatorRoot :: forall a. ReactComponent { | a }
src/RadixUI/Slider.jsnew file+6
@@ -0,0 +1,6 @@
1+import * as Slider from '@radix-ui/react-slider';
2+
3+export const sliderRoot = Slider.Root;
4+export const sliderTrack = Slider.Track;
5+export const sliderRange = Slider.Range;
6+export const sliderThumb = Slider
src/RadixUI/Slider.pursnew file+9
@@ -0,0 +1,9 @@
1+module RadixUI.Slider where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+
6+foreign import sliderRoot :: forall a. ReactComponent { | a }
7+foreign import sliderTrack :: forall a. ReactComponent { | a }
8+foreign import sliderRange :: forall a. ReactComponent { | a }
9+foreign import sliderThumb :: forall a. ReactComponent { | a }
src/RadixUI/Switch.jsnew file+4
@@ -0,0 +1,4 @@
1+import * as Switch from '@radix-ui/react-switch';
2+
3+export const switchRoot = Switch.Root;
4+export const switchThumb = Switch.Thumb;
src/RadixUI/Switch.pursnew file+7
@@ -0,0 +1,7 @@
1+module RadixUI.Switch where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+
6+foreign import switchRoot :: forall a. ReactComponent { | a }
7+foreign import switchThumb :: forall a. ReactComponent { | a }
src/RadixUI/Tabs.jsnew file+6
@@ -0,0 +1,6 @@
1+import * as Tabs from '@radix-ui/react-tabs';
2+
3+export const tabsRoot = Tabs.Root;
4+export const tabsList = Tabs.List;
5+export const tabsTrigger = Tabs.Trigger;
6+export const tabsContent = Tabs.Content;
src/RadixUI/Tabs.pursnew file+14
@@ -0,0 +1,14 @@
1+module RadixUI.Tabs where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+
6+foreign import tabsRoot :: forall a. ReactComponent { | a }
7+foreign import tabsList :: forall a. ReactComponent { | a }
8+foreign import tabsTrigger :: forall a. ReactComponent { | a }
9+foreign import tabsContent :: forall a. ReactComponent { | a }
10+
11+--export const tabsRoot = Tabs.Root;
12+--export const tabsList = Tabs.List;
13+--export const tabsTrigger = Tabs.Trigger;
14+--export const tabsContent = Tabs.Content;
src/RadixUI/Toast.jsnew file+8
@@ -0,0 +1,8 @@
1+import * as Toast from '@radix-ui/react-toast';
2+
3+export const toastRoot = Toast.Root;
4+export const toastTitle = Toast.Title;
5+export const toastDescription = Toast.Description;
6+export const toastAction = Toast.Action;
7+export const toastClose = Toast.Close;
8+export const toastViewport = Toast.Viewport;
src/RadixUI/Toast.pursnew file+19
@@ -0,0 +1,19 @@
1+module RadixUI.Toast where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+
6+foreign import toastRoot :: forall a. ReactComponent { | a }
7+foreign import toastTitle :: forall a. ReactComponent { | a }
8+foreign import toastDescription :: forall a. ReactComponent { | a }
9+foreign import toastAction :: forall a. ReactComponent { | a }
10+foreign import toastClose :: forall a. ReactComponent { | a }
11+foreign import toastViewport :: forall a. ReactComponent { | a }
12+
13+
14+--export const toastRoot = Toast.Root;
15+--export const toastTitle = Toast.Title;
16+--export const toastDescription = Toast.Description;
17+--export const toastAction = Toast.Action;
18+--export const toastClose = Toast.Close;
19+--export const toastViewport = Toast.Viewport;
src/RadixUI/Toggle.jsnew file+3
@@ -0,0 +1,3 @@
1+import * as Toggle from '@radix-ui/react-toggle';
2+
3+export const toggleRoot = Toggle.Root;
src/RadixUI/Toggle.pursnew file+6
@@ -0,0 +1,6 @@
1+module RadixUI.Toggle where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+
6+foreign import toggleRoot :: forall a. ReactComponent { | a }
src/RadixUI/ToggleGroup.jsnew file+4
@@ -0,0 +1,4 @@
1+import * as ToggleGroup from '@radix-ui/react-toggle-group';
2+
3+export const toggleGroupRoot = ToggleGroup.Root;
4+export const toggleGroupItem = ToggleGroup.Item;
src/RadixUI/ToggleGroup.pursnew file+7
@@ -0,0 +1,7 @@
1+module RadixUI.ToggleGroup where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+
6+foreign import toggleGroupRoot :: forall a. ReactComponent { | a }
7+foreign import toggleGroupItem :: forall a. ReactComponent { | a }
src/RadixUI/Toolbar.jsnew file+8
@@ -0,0 +1,8 @@
1+import * as Toolbar from '@radix-ui/react-toolbar';
2+
3+export const toolbarRoot = Toolbar.Root;
4+export const toolbarButton = Toolbar.Button;
5+export const toolbarSeparator = Toolbar.Separator;
6+export const toolbarLink = Toolbar.Link;
7+export const toolbarToggleGroup = Toolbar.ToggleGroup;
8+export const toolbarToggleItem = Toolbar.ToggleItem;
src/RadixUI/Toolbar.pursnew file+12
@@ -0,0 +1,12 @@
1+module RadixUI.Toolbar where
2+
3+import Prelude
4+import React.Basic (ReactComponent)
5+import Data.Newtype (class Newtype)
6+
7+foreign import toolbarRoot :: forall a. ReactComponent { | a }
8+foreign import toolbarButton :: forall a. ReactComponent { | a }
9+foreign import toolbarSeparator :: forall a. ReactComponent { | a }
10+foreign import toolbarLink :: forall a. ReactComponent { | a }
11+foreign import toolbarToggleGroup :: forall a. ReactComponent { | a }
12+foreign import toolbarToggleItem :: forall a. ReactComponent { | a }
src/RadixUI/Tooltip.jsnew file+9
@@ -0,0 +1,9 @@
1+import * as Tooltip from '@radix-ui/react-tooltip';
2+
3+export const providerImpl = Tooltip.Provider
4+export const rootImpl = Tooltip.Root
5+export const triggerImpl = Tooltip.Trigger
6+export const portalImpl = Tooltip.Portal
7+export const contentImpl = Tooltip.Content
8+export const arrowImpl = Tooltip.Arrow
9+
src/RadixUI/Tooltip.pursnew file+141
@@ -0,0 +1,141 @@
1+module RadixUI.Tooltip where
2+
3+import Prelude
4+
5+import Data.Undefined.NoProblem (Opt, pseudoMap)
6+import Data.Undefined.NoProblem.Closed (class Coerce, coerce)
7+import Effect (Effect)
8+import Effect.Uncurried (EffectFn1, mkEffectFn1)
9+import Prim.Row (class Union)
10+import React.Basic (JSX, ReactComponent)
11+import React.Basic (element) as React
12+import Beta.DOM.Internal (CSS)
13+import Beta.DOM (class IsJSX)
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 Web.DOM.Internal.Types (Element)
19+import Web.HTML.HTMLElement (HTMLElement)
20+
21+-- Provider
22+type ProviderProps =
23+ { delayDuration :: Opt Number
24+ , skipDelayDuration :: Opt Number
25+ , disableHoverableContent :: Opt Boolean
26+ }
27+
28+foreign import providerImpl :: forall a. ReactComponent { | a }
29+
30+provider :: forall p kids. Coerce p ProviderProps => IsJSX kids => p -> kids -> JSX
31+provider props kids = do
32+ React.element providerImpl
33+ $ (coerce props :: ProviderProps) # unsafeSet "children" kids
34+
35+-- Root
36+type RootProps =
37+ { defaultOpen :: Opt Boolean
38+ , open :: Opt Boolean
39+ , onOpenChange :: Opt (Boolean -> Effect Unit)
40+ , delayDuration :: Opt Number
41+ , disableHoverableContent :: Opt Boolean
42+ }
43+
44+foreign import rootImpl :: forall a. ReactComponent { | a }
45+
46+root :: forall p kids. Coerce p RootProps => IsJSX kids => p -> kids -> JSX
47+root props' kids = do
48+ let props = coerce props' :: RootProps
49+ React.element rootImpl $ props # unsafeUnion
50+ { children: kids
51+ , onOpenChange: props.onOpenChange # pseudoMap mkEffectFn1
52+ }
53+
54+-- Trigger
55+type TriggerProps =
56+ { asChild :: Opt Boolean
57+ }
58+
59+foreign import triggerImpl :: forall a. ReactComponent { | a }
60+
61+trigger :: forall p kids. Coerce p TriggerProps => IsJSX kids => p -> kids -> JSX
62+trigger props kids = React.element triggerImpl
63+ ( (coerce props :: TriggerProps)
64+ # unsafeSet "children" kids
65+ )
66+
67+-- Portal
68+type PortalProps =
69+ { forceMount :: Opt Boolean
70+ , container :: Opt HTMLElement
71+ }
72+
73+foreign import portalImpl :: forall a. ReactComponent { | a }
74+
75+portal :: forall p kids. Coerce p PortalProps => IsJSX kids => p -> kids -> JSX
76+portal props kids = React.element portalImpl
77+ $ (coerce props :: PortalProps) # RB.build
78+ ( RB.insert (Proxy :: Proxy "children") kids
79+ )
80+
81+-- Content
82+type ContentProps =
83+ { asChild :: Opt Boolean
84+ , className :: Opt String
85+ , style :: Opt CSS
86+ , ariaLabel :: Opt String
87+ , onEscapeKeyDown :: Opt (Effect Unit)
88+ , onPointerDownOutside :: Opt (Effect Unit)
89+ , forceMount :: Opt Boolean
90+ , side :: Opt TooltipSide
91+ , sideOffset :: Opt Number
92+ , align :: Opt TooltipAlign
93+ , alignOffset :: Opt Number
94+ , avoidCollisions :: Opt Boolean
95+ , collisionBoundary :: Opt (Array Element)
96+ , collisionPadding :: Opt Number
97+ , arrowPadding :: Opt Number
98+ , sticky :: Opt TooltipSticky
99+ , hideWhenDetached :: Opt Boolean
100+ }
101+
102+foreign import contentImpl :: forall a. ReactComponent { | a }
103+
104+data TooltipSide = Top | Right | Bottom | Left
105+data TooltipAlign = AlignStart | AlignCenter | AlignEnd
106+data TooltipSticky = Always | Partial
107+
108+content :: forall p kids. Coerce p ContentProps => IsJSX kids => p -> kids -> JSX
109+content props' children = do
110+ let props = coerce props' :: ContentProps
111+ React.element contentImpl $ props # unsafeUnion
112+ { children
113+ , side: props.side # pseudoMap case _ of
114+ Top -> "top"
115+ Right -> "right"
116+ Bottom -> "bottom"
117+ Left -> "left"
118+ , align: props.align # pseudoMap case _ of
119+ AlignStart -> "start"
120+ AlignCenter -> "center"
121+ AlignEnd -> "end"
122+ , sticky: props.sticky # pseudoMap case _ of
123+ Always -> "always"
124+ Partial -> "partial"
125+ }
126+
127+-- Arrow
128+type ArrowProps =
129+ { asChild ∷ Opt Boolean
130+ , className ∷ Opt String
131+ , style ∷ Opt CSS
132+ , width ∷ Opt Number
133+ , height ∷ Opt Number
134+ }
135+
136+foreign import arrowImpl ∷ ∀ a. ReactComponent { | a }
137+
138+arrow ∷ ∀ p. Coerce p ArrowProps ⇒ p → JSX
139+arrow props = React.element arrowImpl
140+ $ (coerce props ∷ ArrowProps)
141+