Skip to content

Commit 778a17c

Browse files
committed
docs: update content
1 parent 1421c7d commit 778a17c

File tree

5 files changed

+92
-30
lines changed

5 files changed

+92
-30
lines changed

docs/migration/v4.mdx

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
name: Migration to v4
3+
description: Track and review changes to the CoreUI for React.js components to help you migrate from v3 to v4.
4+
menu: "Migration"
5+
route: "/migration/v4"
6+
---
7+
8+
CoreUI for React is the React.js version of CoreUI components library, so before read this migration guide, please check also [CoreUI 3 to 4 migration guide](https://coreui.io/docs/4.0/migration/).
9+
10+
## v4.0.0-alpha.2
11+
12+
### Components
13+
14+
- Deprecated component `CEmbed`
15+
- Deprecated component `CJumbotron`
16+
17+
#### Badges
18+
19+
- variant="pill" => shape="rounded-pill"
20+
- variant="square" => shape="rounded-0"
21+
22+
#### Forms
23+
24+
- `CInput` => `CFormControl`
25+
- `CInputCheckbox` => `CFormCheck`
26+
- `CLabel` => `CFormLabel`
27+
- `CSelect` => `CFormSelect`
28+
- `CValidFeedback` => `CFormFeedback valid`
29+
- `CInvalidFeedback` => `CFormFeedback invalid`
30+
31+
- Deprecated component `CFormGroup`
32+
- Deprecated component `CInputGroupAppend`
33+
- Deprecated component `CInputGroupPrepend`
34+
- Depreacted component `CSwitch`, use `CFormCheck switch` instead of.
35+
- Deprecated `.help-block`
36+
37+
#### Header
38+
39+
- Deprecated property `withSubheader`
40+
- Deprecated component `CHeaderNavItem`, use `CNavItem` instead of.
41+
- Deprecated component `CHeaderNavLink`, use `CNavLink` instead of.
42+
43+
#### List Group
44+
45+
- Depracated prop `action` Use property `component="a"` or `component="button"` instead of `action`.
46+
47+
#### Modal
48+
49+
- Depracated prop `show` Use `visible` instead of.
50+
51+
#### Popover
52+
53+
- Depracated prop `header` Use `title` instead of.
54+
55+
#### Progress Bar
56+
57+
- Depracated prop `precision`
58+
- Depracated prop `showLabel`
59+
- Depracated prop `showPercentage`
60+
- Depracated prop `showValue`
61+
62+
#### Tabs
63+
64+
- Deprecated component `<CTabs>` use `<CNav variant="tabs">` without wrapper component `<CTabs>`

doczrc.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,8 @@ export default {
1818
{
1919
name: 'Components', // manually ordered menu "Components"
2020
},
21-
],
22-
htmlContext: {
23-
footer: {
24-
scripts: [
25-
{
26-
src: 'https://media.ethicalads.io/media/client/ethicalads.min.js',
27-
},
28-
],
21+
{
22+
name: 'Migration', // manually ordered menu "Migration"
2923
},
30-
},
24+
],
3125
}

src/gatsby-theme-docz/components/NavGroup/index.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,18 @@ const icons = {
2121
</svg>`,
2222
Forms: `<svg xmlns="http://www.w3.org/2000/svg" class="nav-icon text-primary" viewBox="0 0 512 512">
2323
<path fill="var(--ci-primary-color, currentColor)" d="M23.686,456.521a24.841,24.841,0,0,0,6,25.708l.087.087a24.841,24.841,0,0,0,17.612,7.342,25.179,25.179,0,0,0,8.1-1.344h0a646.28,646.28,0,0,0,248.04-154.207L469.981,167.646A88.832,88.832,0,1,0,344.354,42.019l-9.534,9.534L314.029,30.762a50.4,50.4,0,0,0-71.274,0L108.687,164.83l22.626,22.627L265.382,53.389a18.4,18.4,0,0,1,26.019,0L312.193,74.18l-134.3,134.3A646.28,646.28,0,0,0,23.686,456.521Zm343.3-391.875a56.832,56.832,0,1,1,80.373,80.373l-89.493,89.493-80.372-80.373ZM254.862,176.766l80.372,80.372L280.892,311.48A614.383,614.383,0,0,1,58.779,453.221,614.383,614.383,0,0,1,200.52,231.108Z" class="ci-primary"></path>
24-
</svg>`
24+
</svg>`,
25+
Migration: `<svg xmlns="http://www.w3.org/2000/svg" class="nav-icon text-primary" viewBox="0 0 512 512">
26+
<path fill="var(--ci-primary-color, currentColor)" d="M464,256.25C464,370.8,370.8,464,256.25,464S48.5,370.8,48.5,256.25,141.7,48.5,256.25,48.5a208,208,0,0,1,149.963,64H328.5v32h128V16.5h-32V85.478A239.717,239.717,0,1,0,496,256.25Z" class="ci-primary"></path>
27+
<polygon fill="var(--ci-primary-color, currentColor)" points="272.5 112.451 240.5 112.549 241.017 282.756 353.301 334.53 366.699 305.47 272.954 262.244 272.5 112.451" class="ci-primary"></polygon>
28+
</svg>`,
2529
}
2630

2731
export const NavGroup = ({ item, sidebarRef }) => {
2832
const currentDoc = useCurrentDoc()
2933
const currentDocRef = useRef()
3034
const { name, menu } = item
31-
const [subheadingsVisible, setShowsubheadings] = useState(
32-
currentDoc.menu === name
33-
)
35+
const [subheadingsVisible, setShowsubheadings] = useState(currentDoc.menu === name)
3436
const toggleSubheadings = () => setShowsubheadings(!subheadingsVisible)
3537
useEffect(() => {
3638
if (sidebarRef.current && currentDocRef.current) {
@@ -39,15 +41,19 @@ export const NavGroup = ({ item, sidebarRef }) => {
3941
}, [])
4042
return (
4143
<div className="nav-item nav-group show" data-testid="nav-group">
42-
<div className="nav-link nav-group-toggle" dangerouslySetInnerHTML={{__html: `${icons[item.name]} ${item.name}`}}onClick={toggleSubheadings}>
44+
<div
45+
className="nav-link nav-group-toggle"
46+
dangerouslySetInnerHTML={{ __html: `${icons[item.name]} ${item.name}` }}
47+
onClick={toggleSubheadings}
48+
>
4349
{/* {dangerouslySetInnerHTML={{ __html: icons[item.name] }}}
4450
{item.name} */}
4551
{/* <ChevronDown sx={styles.chevron({ active: subheadingsVisible })} /> */}
4652
</div>
4753
<div className="nav-group-items compact" data-testid="nav-group-links">
4854
{menu &&
4955
subheadingsVisible &&
50-
menu.map(menu => {
56+
menu.map((menu) => {
5157
if (currentDoc.route === menu.route) {
5258
return (
5359
<NavLink className="nav-link" key={menu.id} item={menu} ref={currentDocRef}>

src/gatsby-theme-docz/components/NavLink/index.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import { get } from 'lodash/fp'
88
// import * as styles from './styles'
99

1010
const getHeadings = (route, docs) => {
11-
const doc = docs.find(doc => doc.route === route)
11+
const doc = docs.find((doc) => doc.route === route)
1212
const headings = get('headings', doc)
13-
return headings ? headings.filter(heading => heading.depth === 2) : []
13+
return headings ? headings.filter((heading) => heading.depth === 2) : []
1414
}
1515

1616
const getCurrentHash = () => {
@@ -35,12 +35,7 @@ export const NavLink = forwardRef(function NavLink({ item, ...props }, ref) {
3535
const currentHash = getCurrentHash()
3636
return (
3737
<Fragment>
38-
<Link
39-
{...props}
40-
to={to}
41-
activeClassName="active"
42-
ref={ref}
43-
/>
38+
<Link {...props} to={to} activeClassName="active" ref={ref} />
4439
{/* {showHeadings &&
4540
headings.map(heading => (
4641
<Link

src/gatsby-theme-docz/components/Sidebar/index.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { NavSearch } from '../NavSearch'
1010
import { NavLink } from '../NavLink'
1111
import { NavGroup } from '../NavGroup'
1212

13-
1413
export const Sidebar = forwardRef(function Sidebar(props, ref) {
1514
const { show } = props
1615
const [query, setQuery] = useState('')
@@ -38,15 +37,19 @@ export const Sidebar = forwardRef(function Sidebar(props, ref) {
3837
}
3938

4039
return (
41-
<div className={`sidebar sidebar-lg sidebar-fixed sidebar-self-hiding-md border-end ps-xl-4", ${show && 'show'}`} style={{...cssVars}}>
40+
<div
41+
className={`sidebar sidebar-lg sidebar-fixed sidebar-self-hiding-md border-end ps-xl-4", ${
42+
show && 'show'
43+
}`}
44+
style={{ ...cssVars }}
45+
>
4246
<div className="sidebar-brand justify-content-start ps-3">
43-
<Logo/>
47+
<Logo />
4448
</div>
4549
<div className="sidebar-nav">
46-
{menus &&
47-
menus.map(menu => {
48-
if (!menu.route)
49-
return <NavGroup key={menu.id} item={menu} sidebarRef={ref} />
50+
{menus &&
51+
menus.map((menu) => {
52+
if (!menu.route) return <NavGroup key={menu.id} item={menu} sidebarRef={ref} />
5053
if (menu.route === currentDoc.route) {
5154
return (
5255
<NavLink key={menu.id} item={menu} ref={currentDocRef}>

0 commit comments

Comments
 (0)