Skip to content

Commit d881fd9

Browse files
committed
docs: update documentation
1 parent 05f031e commit d881fd9

File tree

5 files changed

+46
-22
lines changed

5 files changed

+46
-22
lines changed

docs/4.0/components/CButton.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ Disabled buttons using the `<a>` component act a little different:
144144
<CButton component="a" href="#" color="secondary" size="lg" disabled>Link</CButton>
145145
</Playground>
146146

147-
TODO: callout callout-warning
148-
149147
The `.disabled` class uses `pointer-events: none` to try to disable the link functionality of `<a>`s, but that CSS property is not yet standardized. Besides, even in browsers that do support `pointer-events: none`, keyboard navigation remains unaffected, meaning that sighted keyboard users and users of assistive technologies will still be able to activate these links. So to be safe, we automatically add a `tabindex="-1"` attribute on disabled links (to prevent them from receiving keyboard focus) and use custom JavaScript to disable their functionality.
150148

151149
## Block buttons

docs/4.0/components/CButtonGroup.mdx

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ Wrap a series of `<CButton>` components in `<CButtonGroup>`.
3636
</CButtonGroup>
3737
</Playground>
3838

39-
<!-- TODO: callout warning -->
4039
##### Ensure the correct `role` and provide a label
4140

4241
For assistive technologies (ex. screen readers) to communicate that a series of buttons are grouped, a proper `role` attribute has to be provided. For button groups, this should be `role="group"`, while toolbars should have a `role="toolbar"`.

docs/4.0/components/CCard.mdx

+17-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
CCardGroup,
1717
CCardHeader,
1818
CCardImage,
19+
CCardImageOverlay,
1920
CCardLink,
2021
CCardSubtitle,
2122
CCardTitle,
@@ -411,7 +412,18 @@ Similar to headers and footers, cards can include top and bottom "image caps"—
411412

412413
Adapt an image into a background and overlay your text. Depending on the image, you may need additional styles or utilities.
413414

414-
<!-- TODO: add example -->
415+
<Playground>
416+
<CCard className="mb-3 bg-dark text-white">
417+
<CCardImage component="svg" className="docs-placeholder-img rounded-0" width="100%" height="250" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Image" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#868e96"></rect><text x="50%" y="50%" fill="#dee2e6" dy=".3em">Image</text></CCardImage>
418+
<CCardImageOverlay>
419+
<CCardTitle>Card title</CCardTitle>
420+
<CCardText>This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</CCardText>
421+
<CCardText>Last updated 3 mins ago</CCardText>
422+
</CCardImageOverlay>
423+
</CCard>
424+
</Playground>
425+
426+
## Horizontal
415427

416428
Using a combination of grid and utility classes, cards can be made horizontal in a mobile-friendly and responsive way. In the example below, we remove the grid gutters with `.g-0` and use `.col-md-*` classes to make the card horizontal at the `md` breakpoint. Further adjustments may be needed depending on your card content.
417429

@@ -788,6 +800,10 @@ Just like with card groups, card footers will automatically line up.
788800

789801
<Props of={CCardImage} />
790802

803+
### CCardImageOverlay
804+
805+
<Props of={CCardImageOverlay} />
806+
791807
### CCardLink
792808

793809
<Props of={CCardLink} />

docs/4.0/components/CDropdown.mdx

+17-14
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {
1212
CButton,
1313
CButtonGroup,
1414
CCallout,
15+
CCollapse,
16+
CContainer,
1517
CDropdown,
1618
CDropdownDivider,
1719
CDropdownHeader,
@@ -22,7 +24,11 @@ import {
2224
CForm,
2325
CFormCheck,
2426
CFormControl,
25-
CFormLabel
27+
CFormLabel,
28+
CNavbar,
29+
CNavbarBrand,
30+
CNavbarNav,
31+
CNavbarToggler
2632
} from '../../../src/index.ts'
2733

2834

@@ -180,16 +186,13 @@ Opt into darker dropdowns to match a dark navbar or custom style by set `dark` p
180186

181187
And putting it to use in a navbar:
182188

183-
<!-- TODO: update navbar components -->
184189
<Playground>
185-
<nav className="navbar navbar-expand-lg navbar-dark bg-dark">
186-
<div className="container-fluid">
187-
<a className="navbar-brand" href="#">Navbar</a>
188-
<button className="navbar-toggler" type="button" data-coreui-toggle="collapse" data-coreui-target="#navbarNavDarkDropdown" aria-controls="navbarNavDarkDropdown" aria-expanded="false" aria-label="Toggle navigation">
189-
<span className="navbar-toggler-icon"></span>
190-
</button>
191-
<div className="collapse navbar-collapse" id="navbarNavDarkDropdown">
192-
<ul className="navbar-nav">
190+
<CNavbar expand="lg" colorScheme="dark" className="bg-dark">
191+
<CContainer fluid>
192+
<CNavbarBrand href="#">Navbar</CNavbarBrand>
193+
<CNavbarToggler aria-label="Toggle navigation" aria-expanded={visible} onClick={() => setVisible(!visible)} />
194+
<CCollapse className="navbar-collapse" visible={visible}>
195+
<CNavbarNav>
193196
<CDropdown dark component="li" variant="nav-item">
194197
<CDropdownToggle>Dropdown</CDropdownToggle>
195198
<CDropdownMenu>
@@ -200,10 +203,10 @@ And putting it to use in a navbar:
200203
<CDropdownItem href="#">Separated link</CDropdownItem>
201204
</CDropdownMenu>
202205
</CDropdown>
203-
</ul>
204-
</div>
205-
</div>
206-
</nav>
206+
</CNavbarNav>
207+
</CCollapse>
208+
</CContainer>
209+
</CNavbar>
207210
</Playground>
208211

209212
## Directions

docs/4.0/forms/CFormCheck.mdx

+12-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Create consistent cross-browser and cross-device checkboxes and rad
55
menu: Forms
66
route: /forms/checks-radios
77
---
8-
8+
import { useEffect, useRef } from 'react'
99
import { Playground, Props } from 'docz'
1010
import {
1111
CButton,
@@ -27,13 +27,21 @@ Browser default checkboxes and radios are replaced with the help of `<CFormCheck
2727
<CFormCheck id="flexCheckChecked" label="Checked checkbox" defaultChecked />
2828
</Playground>
2929

30-
<!-- TODO: ## Indeterminate
30+
## Indeterminate
3131

3232
Checkboxes can utilize the `:indeterminate` pseudo class when manually set via JavaScript (there is no available HTML attribute for specifying it).
3333

3434
<Playground>
35-
<CFormCheck id="flexCheckIndeterminate" label="Indeterminate checkbox" indeterminate/>
36-
</Playground> -->
35+
{() => {
36+
const checkboxRef = useRef(null)
37+
useEffect(() => {
38+
checkboxRef.current.indeterminate = true
39+
})
40+
return (
41+
<CFormCheck id="flexCheckIndeterminate" label="Indeterminate checkbox" ref={checkboxRef} />
42+
)
43+
}}
44+
</Playground>
3745

3846
### Disabled
3947

0 commit comments

Comments
 (0)