Skip to content

Commit 571d08b

Browse files
author
matdsoupe
committed
adds ListGroup and Modal components
1 parent 4565567 commit 571d08b

File tree

3 files changed

+127
-0
lines changed

3 files changed

+127
-0
lines changed

src/ListGroup.res

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
open Types
2+
3+
type horizontal = [#sm | #md | #lg | #xl | #xxl]
4+
5+
@module("react-bootstrap") @react.component
6+
external make: (
7+
~_as: string=?,
8+
~horizontal: horizontal=?,
9+
~variant: [#flush]=?,
10+
~className: string=?,
11+
~children: React.element,
12+
~bsPrefix: string=?,
13+
) => React.element = "ListGroup"
14+
15+
module Item = {
16+
@module("react-bootstrap") @scope("ListGroup") @react.component
17+
external make: (
18+
~action: bool=?,
19+
~active: bool=?,
20+
~_as: string=?,
21+
~disabled: bool=?,
22+
~eventKey: string=?,
23+
~href: string=?,
24+
~onClick: ReactEvent.Mouse.t => unit=?,
25+
~variant: variant=?,
26+
~className: string=?,
27+
~children: React.element,
28+
~bsPrefix: string=?,
29+
) => React.element = "Item"
30+
}

src/Modal.res

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
type backdrop = Bool(bool) | Static([#static])
2+
type fullscreen = [#"sm-down" | #"md-down" | #"lg-down" | #"xl-down" | #"xxl-down"]
3+
type size = [#sm | #lg | #xl]
4+
5+
@module("react-bootstrap") @react.component
6+
external make: (
7+
~\"aria-labelledby": string=?,
8+
~animation: bool=?,
9+
~autoFocus: bool=?,
10+
~backdrop: backdrop=?,
11+
~backdropClassName: string=?,
12+
~centered: bool=?,
13+
~container: Types.reactNode=?,
14+
~contentClassName: string=?,
15+
~dialogAs: React.element=?,
16+
~dialogClassName: string=?,
17+
~enforceFocus: bool=?,
18+
~fullscreen: fullscreen=?,
19+
~keyboard: bool=?,
20+
~manager: {.}=?,
21+
~onEnter: unit => unit=?,
22+
~onEntered: unit => unit=?,
23+
~onEntering: unit => unit=?,
24+
~onEscapeKeyDown: unit => unit=?,
25+
~onExit: unit => unit=?,
26+
~onExited: unit => unit=?,
27+
~onExiting: unit => unit=?,
28+
~onHide: unit => unit=?,
29+
~onShow: unit => unit=?,
30+
~restoreFocus: bool=?,
31+
~restoreFocusOptions: {.}=?,
32+
~scrollable: bool=?,
33+
~show: bool=?,
34+
~size: size=?,
35+
~classname: string=?,
36+
~children: React.element,
37+
~bsPrefix: string=?,
38+
) => React.element = "Modal"
39+
40+
module Dialog = {
41+
@module("react-bootstrap") @scope("Modal") @react.component
42+
external make: (
43+
~centered: bool=?,
44+
~contentClassName: string=?,
45+
~fullscreen: fullscreen=?,
46+
~size: size=?,
47+
~scrollable: bool=?,
48+
~className: string=?,
49+
~children: React.element,
50+
~bsPrefix: string=?,
51+
) => React.element = "Dialog"
52+
}
53+
54+
module Header = {
55+
@module("react-bootstrap") @scope("Modal") @react.component
56+
external make: (
57+
~closeButton: bool=?,
58+
~closeLabel: string=?,
59+
~closeVariant: [#white]=?,
60+
~onHide: unit => unit=?,
61+
~className: string=?,
62+
~children: React.element,
63+
~bsPrefix: string=?,
64+
) => React.element = "Header"
65+
}
66+
67+
module Title = {
68+
@module("react-bootstrap") @scope("Modal") @react.component
69+
external make: (
70+
~_as: string=?,
71+
~className: string=?,
72+
~children: React.element,
73+
~bsPrefix: string=?,
74+
) => React.element = "Title"
75+
}
76+
77+
module Body = {
78+
@module("react-bootstrap") @scope("Modal") @react.component
79+
external make: (
80+
~_as: string=?,
81+
~className: string=?,
82+
~children: React.element,
83+
~bsPrefix: string=?,
84+
) => React.element = "Body"
85+
}
86+
87+
module Footer = {
88+
@module("react-bootstrap") @scope("Modal") @react.component
89+
external make: (
90+
~_as: string=?,
91+
~className: string=?,
92+
~children: React.element,
93+
~bsPrefix: string=?,
94+
) => React.element = "Footer"
95+
}

src/ReactBootstrap.res

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ module FigureCaption = FigureCaption
2121
module Form = Form
2222
module InputGroup = InputGroup
2323
module Image = Image
24+
module ListGroup = ListGroup
25+
module Modal = Modal
2426

2527
module Navbar = {
2628
@module("react-bootstrap") @react.component

0 commit comments

Comments
 (0)