Skip to content

Commit fa9ab94

Browse files
author
matdsoupe
committed
adds Overlays components
1 parent 29fb8b1 commit fa9ab94

File tree

6 files changed

+173
-0
lines changed

6 files changed

+173
-0
lines changed

src/Offcanvas.res

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
type placement = [#start | #end | #top | #bottom]
2+
3+
@module("react-bootstrap") @react.component
4+
external make: (
5+
~\"aria-labelledby": string=?,
6+
~autoFocus: bool=?,
7+
~backdrop: bool=?,
8+
~backdropClassName: string=?,
9+
~container: React.element=?,
10+
~enforceFocus: bool=?,
11+
~keyboard: bool=?,
12+
~onEnter: unit => unit=?,
13+
~onEntering: unit => unit=?,
14+
~onEscapeKeyDown: unit => unit=?,
15+
~onExit: unit => unit=?,
16+
~onExited: unit => unit=?,
17+
~onExiting: unit => unit=?,
18+
~onHide: unit => unit=?,
19+
~onShow: unit => unit=?,
20+
~placement: placement=?,
21+
~restoreFocus: bool=?,
22+
~restoreFocusOptions: {.}=?,
23+
~scrool: bool=?,
24+
~show: bool=?,
25+
~className: string=?,
26+
~children: React.element,
27+
~bsPrefix: string=?,
28+
) => React.element = "Offcanvas"
29+
30+
module Header = {
31+
@module("react-bootstrap") @scope("Offcanvas") @react.component
32+
external make: (
33+
~closeButton: bool=?,
34+
~closeLabel: string=?,
35+
~closeVariant: [#white]=?,
36+
~onHide: unit => unit=?,
37+
~className: string=?,
38+
~children: React.element,
39+
~bsPrefix: string=?,
40+
) => React.element = "Header"
41+
}
42+
43+
module Title = {
44+
@module("react-bootstrap") @scope("Offcanvas") @react.component
45+
external make: (
46+
~_as: string=?,
47+
~className: string=?,
48+
~children: React.element,
49+
~bsPrefix: string,
50+
) => React.element = "Title"
51+
}
52+
53+
module Body = {
54+
@module("react-bootstrap") @scope("Offcanvas") @react.component
55+
external make: (
56+
~_as: string=?,
57+
~className: string=?,
58+
~children: React.element,
59+
~bsPrefix: string,
60+
) => React.element = "Body"
61+
}

src/Overlay.res

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
open Types
2+
3+
@module("react-bootstrap") @react.component
4+
external make: (
5+
~container: reactNode=?,
6+
~onEnter: unit => unit=?,
7+
~onEntered: unit => unit=?,
8+
~onEntering: unit => unit=?,
9+
~onExit: unit => unit=?,
10+
~onExited: unit => unit=?,
11+
~onExiting: unit => unit=?,
12+
~onHide: unit => unit=?,
13+
~placement: placement=?,
14+
~popperConfig: {.}=?,
15+
~rootClose: bool=?,
16+
~rootCloseEvent: [#click | #mousedown]=?,
17+
~show: bool=?,
18+
~target: reactNode=?,
19+
~transition: React.element=?,
20+
~className: string=?,
21+
~children: React.element,
22+
) => React.element = "Overlay"

src/OverlayTrigger.res

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
open Types
2+
3+
type triggers = [#hover | #click | #focus]
4+
type trigger = One(triggers) | Many(array<triggers>)
5+
6+
@module("react-bootstrap") @react.component
7+
external make: (
8+
~children: React.element,
9+
~defaultShow: bool=?,
10+
~delay: int=?,
11+
~flip: bool=?,
12+
~onHide: unit => unit=?,
13+
~onToggle: unit => unit=?,
14+
~overlay: React.element=?,
15+
~placement: placement=?,
16+
~popperConfig: {.}=?,
17+
~show: bool=?,
18+
~target: reactNode=?,
19+
~trigger: trigger=?,
20+
~className: string=?,
21+
) => React.element = "OverlayTrigger"

src/Popover.res

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
open Types
2+
3+
type arrowProps<'a> = {ref: React.ref<'a>, style: {.}}
4+
5+
@module("react-bootstrap") @react.component
6+
external make: (
7+
~arrowProps: arrowProps<'a>=?,
8+
~body: bool=?,
9+
~id: string,
10+
~placement: placement=?,
11+
~popper: {.}=?,
12+
~show: bool=?,
13+
~className: string=?,
14+
~children: React.element,
15+
~bsPrefix: string=?,
16+
) => React.element = "Popover"
17+
18+
module Body = {
19+
@module("react-bootstrap") @scope("Popover") @react.component
20+
external make: (
21+
~_as: string=?,
22+
~className: string=?,
23+
~children: React.element,
24+
~bsPrefix: string,
25+
) => React.element = "Body"
26+
}
27+
28+
module Header = {
29+
@module("react-bootstrap") @scope("Popover") @react.component
30+
external make: (
31+
~_as: string=?,
32+
~className: string=?,
33+
~children: React.element,
34+
~bsPrefix: string,
35+
) => React.element = "Header"
36+
}

src/Tooltip.res

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
open Types
2+
3+
type arrowProps<'a> = {ref: React.ref<'a>, style: {.}}
4+
5+
@module("react-bootstrap") @react.component
6+
external make: (
7+
~arrowProps: arrowProps<'a>=?,
8+
~id: string,
9+
~placement: placement=?,
10+
~popper: {.}=?,
11+
~show: bool=?,
12+
~className: string=?,
13+
~children: React.element,
14+
~bsPrefix: string=?,
15+
) => React.element = "Tooltip"

src/Types.res

+18
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,21 @@ type variant = [
1818
| #dark
1919
| #light
2020
]
21+
22+
type placement = [
23+
| #"auto-start"
24+
| #auto
25+
| #"auto-end"
26+
| #"top-start"
27+
| #top
28+
| #"top-end"
29+
| #"right-start"
30+
| #right
31+
| #"right-end"
32+
| #"bottom-start"
33+
| #bottom
34+
| #"bottom-end"
35+
| #"left-start"
36+
| #left
37+
| #"left-end"
38+
]

0 commit comments

Comments
 (0)