Skip to content

Commit 09fe72f

Browse files
author
matdsoupe
committed
adds Toast, Transitions and Ratio components
1 parent 86d0b58 commit 09fe72f

File tree

7 files changed

+111
-1
lines changed

7 files changed

+111
-1
lines changed

src/Collapse.res

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
type dimension = [#height | #width]
2+
3+
@module("react-bootstrap") @react.component
4+
external make: (
5+
~appear: bool=?,
6+
~children: React.element,
7+
~dimension: dimension=?,
8+
~getDimensionValue: (~dimension: dimension, ~element: Dom.htmlElement) => int=?,
9+
~_in: bool=?,
10+
~mountOnEnter: bool=?,
11+
~onEnter: unit => unit=?,
12+
~onEntered: unit => unit=?,
13+
~onEntering: unit => unit=?,
14+
~onExit: unit => unit=?,
15+
~onExited: unit => unit=?,
16+
~onExiting: unit => unit=?,
17+
~role: string=?,
18+
~timeout: int=?,
19+
~unmountOnExit: bool=?,
20+
~className: string=?
21+
) => React.element = "Collapse"

src/Fade.res

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@module("react-bootstrap") @react.component
2+
external make: (
3+
~appear: bool=?,
4+
~children: React.element,
5+
~_in: bool=?,
6+
~mountOnEnter: bool=?,
7+
~onEnter: unit => unit=?,
8+
~onEntered: unit => unit=?,
9+
~onEntering: unit => unit=?,
10+
~onExit: unit => unit=?,
11+
~onExited: unit => unit=?,
12+
~onExiting: unit => unit=?,
13+
~timeout: int=?,
14+
~unmountOnExit: bool=?,
15+
~className: string=?
16+
) => React.element = "Fade"

src/Placeholder.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module Button = {
1818
~size: size=?,
1919
~variant: Types.variant=?,
2020
~className: string=?,
21-
~children: Rect.element,
21+
~children: React.element,
2222
~bsPrefix: string=?,
2323
) => React.element = "Button"
2424
}

src/Ratio.res

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@module("react-bootstrap") @react.component
2+
external make: (
3+
~aspectRatio: float=?,
4+
~classNmae: string=?,
5+
~children: React.element,
6+
~bsPrefix: string=?
7+
) => React.element = "Ratio"

src/ReactBootstrap.res

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Layout
12
module Layout = Layout
23

34
module Accordion = Accordion
@@ -36,3 +37,12 @@ module Placeholder = Placeholder
3637
module ProgressBar = ProgressBar
3738
module Spinner = Spinner
3839
module Table = Table
40+
module Toast = Toast
41+
module ToastContainer = ToastContainer
42+
43+
// Utils
44+
module Ratio = Ratio
45+
46+
// Transisions
47+
module Collapse = Collapse
48+
module Fade = Fade

src/Toast.res

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
open Types
2+
3+
@module("react-bootstrap") @react.component
4+
external make: (
5+
~animation: bool=?,
6+
~autohide: bool=?,
7+
~bg: variant=?,
8+
~delay: int=?,
9+
~onClose: unit => unit=?,
10+
~show: bool=?,
11+
~transition: reactNode=?,
12+
~className: string=?,
13+
~children: React.element,
14+
~bsPrefix: string=?
15+
) => React.element = "Toast"
16+
17+
module Header = {
18+
@module("react-bootstrap") @scope("Toast") @react.component
19+
external make: (
20+
~closeButton: bool=?,
21+
~closeLabel: string=?,
22+
~closeVariant: [#white]=?,
23+
~className: string=?,
24+
~children: React.element,
25+
~bsPrefix: string=?
26+
) => React.element = "Header"
27+
}
28+
29+
module Body = {
30+
@module("react-bootstrap") @scope("Toast") @react.component
31+
external make: (
32+
~_as: string=?,
33+
~className: string=?,
34+
~children: React.element,
35+
~bsPrefix: string
36+
) => React.element = "Body"
37+
}

src/ToastContainer.res

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
type position = [
2+
#"top-start"
3+
| #"top-center"
4+
| #"top-end"
5+
| #"middle-start"
6+
| #"middle-center"
7+
| #"middle-end"
8+
| #"bottom-start"
9+
| #"bottom-center"
10+
| #"bottom-end"
11+
]
12+
13+
@module("react-bootstrap") @react.component
14+
external make: (
15+
~position: position=?,
16+
~className: string=?,
17+
~children: React.element,
18+
~bsPrefix: string=?
19+
) => React.element = "ToastContainer"

0 commit comments

Comments
 (0)