From c6542fd4c88a72fed535d3093f0dd0097fd947d3 Mon Sep 17 00:00:00 2001 From: mrholek Date: Thu, 21 Sep 2023 12:31:02 +0200 Subject: [PATCH] release: v5.0.0-alpha.3 --- README.md | 2 +- lerna.json | 2 +- packages/coreui-react/README.md | 2 +- packages/coreui-react/package.json | 2 +- .../components/dropdown/CDropdownToggle.tsx | 18 +++++++++++++++++- packages/docs/package.json | 2 +- 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b6d1fc44..d2b93770 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Several quick start options are available: -- [Download the latest release](https://github.com/coreui/coreui-react/archive/v5.0.0-alpha.2.zip) +- [Download the latest release](https://github.com/coreui/coreui-react/archive/v5.0.0-alpha.3.zip) - Clone the repo: `git clone https://github.com/coreui/coreui-react.git` - Install with [npm](https://www.npmjs.com/): `npm install @coreui/react` - Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react` diff --git a/lerna.json b/lerna.json index 41a4992f..e43afba8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "npmClient": "yarn", "packages": ["packages/*"], - "version": "5.0.0-alpha.2", + "version": "5.0.0-alpha.3", "$schema": "node_modules/lerna/schemas/lerna-schema.json" } diff --git a/packages/coreui-react/README.md b/packages/coreui-react/README.md index 43b832b2..c0835dd6 100644 --- a/packages/coreui-react/README.md +++ b/packages/coreui-react/README.md @@ -46,7 +46,7 @@ Several quick start options are available: -- [Download the latest release](https://github.com/coreui/coreui-react/archive/v5.0.0-alpha.2.zip) +- [Download the latest release](https://github.com/coreui/coreui-react/archive/v5.0.0-alpha.3.zip) - Clone the repo: `git clone https://github.com/coreui/coreui-react.git` - Install with [npm](https://www.npmjs.com/): `npm install @coreui/react` - Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react` diff --git a/packages/coreui-react/package.json b/packages/coreui-react/package.json index 3672c32f..2d29cbd3 100644 --- a/packages/coreui-react/package.json +++ b/packages/coreui-react/package.json @@ -1,6 +1,6 @@ { "name": "@coreui/react", - "version": "5.0.0-alpha.2", + "version": "5.0.0-alpha.3", "description": "UI Components Library for React.js", "keywords": [ "react", diff --git a/packages/coreui-react/src/components/dropdown/CDropdownToggle.tsx b/packages/coreui-react/src/components/dropdown/CDropdownToggle.tsx index 7e9a96db..1bf68954 100644 --- a/packages/coreui-react/src/components/dropdown/CDropdownToggle.tsx +++ b/packages/coreui-react/src/components/dropdown/CDropdownToggle.tsx @@ -18,6 +18,12 @@ export interface CDropdownToggleProps extends Omit { * Create a custom toggler which accepts any content. */ custom?: boolean + /** + * If a dropdown `variant` is set to `nav-item` then render the toggler as a link instead of a button. + * + * @since v5.0.0-alpha.3 + */ + navLink?: boolean /** * 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. */ @@ -35,11 +41,12 @@ export const CDropdownToggle: FC = ({ caret = true, custom, className, + navLink = true, split, trigger = 'click', ...rest }) => { - const { dropdownToggleRef, visible, setVisible } = useContext(CDropdownContext) + const { dropdownToggleRef, variant, visible, setVisible } = useContext(CDropdownContext) const triggers = { ...((trigger === 'click' || trigger.includes('click')) && { @@ -57,6 +64,7 @@ export const CDropdownToggle: FC = ({ const togglerProps = { className: classNames( { + 'nav-link': variant === 'nav-item' && navLink, 'dropdown-toggle': caret, 'dropdown-toggle-split': split, show: visible, @@ -80,6 +88,14 @@ export const CDropdownToggle: FC = ({ ) } + if (variant === 'nav-item' && navLink) { + return ( + + {children} + + ) + } + return ( {children} diff --git a/packages/docs/package.json b/packages/docs/package.json index f38d7524..b583dc9f 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -1,6 +1,6 @@ { "name": "@coreui/react-docs", - "version": "5.0.0-alpha.2", + "version": "5.0.0-alpha.3", "private": true, "description": "", "homepage": "https://coreui.io/react/",