Skip to content

Commit 06c504c

Browse files
authored
docs: convert js docs to mdx (react-bootstrap#6147)
1 parent 75487ce commit 06c504c

29 files changed

+1198
-1612
lines changed

www/src/css/examples.module.scss

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
background-color: #f8f9fa;
1313
border: 1px solid #dee2e6;
1414
margin-right: 5px;
15-
15+
1616
& > div {
1717
display: flex;
1818
align-items: center;
@@ -60,3 +60,16 @@
6060
margin-top: 1rem;
6161
}
6262
}
63+
64+
// has to be fully global because of modal portals
65+
:global(.modal-90w) {
66+
width: 90%;
67+
max-width: none !important;
68+
}
69+
70+
.overlay-contained {
71+
height: 200px;
72+
& > div {
73+
position: relative;
74+
}
75+
}

www/src/pages/components/figures.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

www/src/pages/components/figures.mdx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { graphql } from 'gatsby';
2+
3+
import ComponentApi from '../../components/ComponentApi';
4+
import ReactPlayground from '../../components/ReactPlayground';
5+
import Figure from '../../examples/Figure';
6+
7+
# Figures
8+
9+
Anytime you need to display a piece of content, like an image with an
10+
optional caption, consider using a `Figure`.
11+
12+
## Figure
13+
14+
Displaying related images and text with the Figure component.
15+
16+
<ReactPlayground codeText={Figure} />
17+
18+
## API
19+
20+
<ComponentApi metadata={props.data.figure} />
21+
<ComponentApi metadata={props.data.image} />
22+
<ComponentApi metadata={props.data.caption} />
23+
24+
export const query = graphql`
25+
query FigureQuery {
26+
figure: componentMetadata(displayName: { eq: "Figure" }) {
27+
displayName
28+
...ComponentApi_metadata
29+
}
30+
image: componentMetadata(displayName: { eq: "FigureImage" }) {
31+
displayName
32+
...ComponentApi_metadata
33+
}
34+
caption: componentMetadata(displayName: { eq: "FigureCaption" }) {
35+
displayName
36+
...ComponentApi_metadata
37+
}
38+
}
39+
`;

www/src/pages/components/images.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

www/src/pages/components/images.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { graphql } from 'gatsby';
2+
3+
import ComponentApi from '../../components/ComponentApi';
4+
import ReactPlayground from '../../components/ReactPlayground';
5+
import Fluid from '../../examples/Image/Fluid';
6+
import Shape from '../../examples/Image/Shape';
7+
8+
# Images
9+
10+
## Shape
11+
12+
Use the `rounded`, `roundedCircle` and `thumbnail` props to customise
13+
the image.
14+
15+
## Fluid
16+
17+
Use the `fluid` to scale image nicely to the parent element.
18+
19+
## API
20+
21+
<ComponentApi metadata={props.data.Image} />
22+
23+
export const query = graphql`
24+
query ImageQuery {
25+
Image: componentMetadata(displayName: { eq: "Image" }) {
26+
...ComponentApi_metadata
27+
}
28+
}
29+
`;

www/src/pages/components/input-group.js

Lines changed: 0 additions & 91 deletions
This file was deleted.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import { graphql } from 'gatsby';
2+
3+
import ComponentApi from '../../components/ComponentApi';
4+
import ReactPlayground from '../../components/ReactPlayground';
5+
import Basic from '../../examples/InputGroup/Basic';
6+
import ButtonDropdowns from '../../examples/InputGroup/ButtonDropdowns';
7+
import Buttons from '../../examples/InputGroup/Buttons';
8+
import Checkboxes from '../../examples/InputGroup/Checkboxes';
9+
import MultipleAddons from '../../examples/InputGroup/MultipleAddons';
10+
import MultipleInputs from '../../examples/InputGroup/MultipleInputs';
11+
import SegmentedButtonDropdowns from '../../examples/InputGroup/SegmentedButtonDropdowns';
12+
import Sizes from '../../examples/InputGroup/Sizes';
13+
14+
# InputGroup
15+
16+
Place one add-on or button on either side of an input. You may also
17+
place one on both sides of an input. Remember to place
18+
`<label>`s outside the input group.
19+
20+
<ReactPlayground codeText={Basic} />
21+
22+
## Sizing
23+
24+
Add the relative form sizing classes to the `InputGroup` and
25+
contents within will automatically resize—no need for repeating the form
26+
control size classes on each element.
27+
28+
<ReactPlayground codeText={Sizes} />
29+
30+
## Checkboxes and radios
31+
32+
Use the `InputGroup.Radio` or
33+
`InputGroup.Checkbox` to add options to an input group.
34+
35+
<ReactPlayground codeText={Checkboxes} />
36+
37+
## Multiple inputs
38+
39+
While multiple inputs are supported visually, validation styles are only
40+
available for input groups with a single input.
41+
42+
<ReactPlayground codeText={MultipleInputs} />
43+
44+
## Multiple addons
45+
46+
Multiple add-ons are supported and can be mixed with checkbox and radio
47+
input versions.
48+
49+
<ReactPlayground codeText={MultipleAddons} />
50+
51+
## Button addons
52+
53+
<ReactPlayground codeText={Buttons} />
54+
55+
## Buttons with Dropdowns
56+
57+
<ReactPlayground codeText={ButtonDropdowns} />
58+
59+
## Segmented buttons
60+
61+
<ReactPlayground codeText={SegmentedButtonDropdowns} />
62+
63+
## API
64+
65+
<ComponentApi metadata={props.data.InputGroup} />
66+
67+
export const query = graphql`
68+
query InputGroupQuery {
69+
InputGroup: componentMetadata(displayName: { eq: "InputGroup" }) {
70+
...ComponentApi_metadata
71+
}
72+
}
73+
`;

0 commit comments

Comments
 (0)