diff --git a/CHANGELOG.md b/CHANGELOG.md index de44022b7..1f9555a6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ ### Dependency updates +## [18.5.0] - 2023-01-03 + +### Added + +- `AdvancedCollapsible`: Added `defaultIsCollapsed` prop to be able to set it's state ([@BeirlaenAaron](https://github.com/BeirlaenAaron) in [#2511](https://github.com/teamleadercrm/ui/pull/2511)) + ## [18.4.0] - 2023-01-02 ### Added diff --git a/package.json b/package.json index 5993aeb57..19267fe15 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@teamleader/ui", "description": "Teamleader UI library", - "version": "18.4.0", + "version": "18.5.0", "author": "Teamleader ", "bugs": { "url": "https://github.com/teamleadercrm/ui/issues" diff --git a/src/components/advancedCollapsible/AdvancedCollapsible.tsx b/src/components/advancedCollapsible/AdvancedCollapsible.tsx index 3e73b757a..fcc1175ec 100644 --- a/src/components/advancedCollapsible/AdvancedCollapsible.tsx +++ b/src/components/advancedCollapsible/AdvancedCollapsible.tsx @@ -18,6 +18,7 @@ export interface AdvancedCollapsibleProps extends Omit { children: ReactNode; title: string; size?: AllowedAdvancedCollapsibleSize; + defaultIsCollapsed?: boolean; } const AdvancedCollapsible: GenericComponent = ({ @@ -25,9 +26,10 @@ const AdvancedCollapsible: GenericComponent = ({ color = 'teal', size = 'medium', title, + defaultIsCollapsed = true, ...others }) => { - const [collapsed, setCollapsed] = useState(true); + const [collapsed, setCollapsed] = useState(defaultIsCollapsed); const boxProps = pickBoxProps(others); const TitleElement = size === 'large' ? Heading3 : TextBody;