Skip to content

Commit c6542fd

Browse files
committed
release: v5.0.0-alpha.3
1 parent 97e00bf commit c6542fd

File tree

6 files changed

+22
-6
lines changed

6 files changed

+22
-6
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
Several quick start options are available:
4848

49-
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v5.0.0-alpha.2.zip)
49+
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v5.0.0-alpha.3.zip)
5050
- Clone the repo: `git clone https://github.com/coreui/coreui-react.git`
5151
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/react`
5252
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react`

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"npmClient": "yarn",
33
"packages": ["packages/*"],
4-
"version": "5.0.0-alpha.2",
4+
"version": "5.0.0-alpha.3",
55
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
66
}

packages/coreui-react/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
Several quick start options are available:
4848

49-
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v5.0.0-alpha.2.zip)
49+
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v5.0.0-alpha.3.zip)
5050
- Clone the repo: `git clone https://github.com/coreui/coreui-react.git`
5151
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/react`
5252
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react`

packages/coreui-react/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coreui/react",
3-
"version": "5.0.0-alpha.2",
3+
"version": "5.0.0-alpha.3",
44
"description": "UI Components Library for React.js",
55
"keywords": [
66
"react",

packages/coreui-react/src/components/dropdown/CDropdownToggle.tsx

+17-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ export interface CDropdownToggleProps extends Omit<CButtonProps, 'type'> {
1818
* Create a custom toggler which accepts any content.
1919
*/
2020
custom?: boolean
21+
/**
22+
* If a dropdown `variant` is set to `nav-item` then render the toggler as a link instead of a button.
23+
*
24+
* @since v5.0.0-alpha.3
25+
*/
26+
navLink?: boolean
2127
/**
2228
* Similarly, create split button dropdowns with virtually the same markup as single button dropdowns, but with the addition of `.dropdown-toggle-split` className for proper spacing around the dropdown caret.
2329
*/
@@ -35,11 +41,12 @@ export const CDropdownToggle: FC<CDropdownToggleProps> = ({
3541
caret = true,
3642
custom,
3743
className,
44+
navLink = true,
3845
split,
3946
trigger = 'click',
4047
...rest
4148
}) => {
42-
const { dropdownToggleRef, visible, setVisible } = useContext(CDropdownContext)
49+
const { dropdownToggleRef, variant, visible, setVisible } = useContext(CDropdownContext)
4350

4451
const triggers = {
4552
...((trigger === 'click' || trigger.includes('click')) && {
@@ -57,6 +64,7 @@ export const CDropdownToggle: FC<CDropdownToggleProps> = ({
5764
const togglerProps = {
5865
className: classNames(
5966
{
67+
'nav-link': variant === 'nav-item' && navLink,
6068
'dropdown-toggle': caret,
6169
'dropdown-toggle-split': split,
6270
show: visible,
@@ -80,6 +88,14 @@ export const CDropdownToggle: FC<CDropdownToggleProps> = ({
8088
)
8189
}
8290

91+
if (variant === 'nav-item' && navLink) {
92+
return (
93+
<a href="#" {...togglerProps} role="button" ref={dropdownToggleRef}>
94+
{children}
95+
</a>
96+
)
97+
}
98+
8399
return (
84100
<CButton {...togglerProps} tabIndex={0} {...rest} ref={dropdownToggleRef}>
85101
{children}

packages/docs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coreui/react-docs",
3-
"version": "5.0.0-alpha.2",
3+
"version": "5.0.0-alpha.3",
44
"private": true,
55
"description": "",
66
"homepage": "https://coreui.io/react/",

0 commit comments

Comments
 (0)