Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2515 from teamleadercrm/AdvancedCollapsible/indent
Browse files Browse the repository at this point in the history
AdvancedCollapsible: children indent
  • Loading branch information
driesd authored Jan 4, 2023
2 parents 64af5fe + 292a9ca commit 20aee40
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@

### Dependency updates

## [18.5.0] - 2023-01-03
## [18.5.0] - 2023-01-04

### 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))

- `AdvancedCollapsible`: Added `indent` boolean prop ([@BeirlaenAaron](https://github.com/driesd) in [#2515](https://github.com/teamleadercrm/ui/pull/2515))

## [18.4.0] - 2023-01-02

### Added
Expand Down
4 changes: 3 additions & 1 deletion src/components/advancedCollapsible/AdvancedCollapsible.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type AllowedAdvancedCollapsibleColor = Exclude<
export interface AdvancedCollapsibleProps extends Omit<BoxProps, 'size'> {
color?: AllowedAdvancedCollapsibleColor;
children: ReactNode;
indent?: boolean;
title: string;
size?: AllowedAdvancedCollapsibleSize;
defaultIsCollapsed?: boolean;
Expand All @@ -24,6 +25,7 @@ export interface AdvancedCollapsibleProps extends Omit<BoxProps, 'size'> {
const AdvancedCollapsible: GenericComponent<AdvancedCollapsibleProps> = ({
children,
color = 'teal',
indent = true,
size = 'medium',
title,
defaultIsCollapsed = true,
Expand All @@ -49,7 +51,7 @@ const AdvancedCollapsible: GenericComponent<AdvancedCollapsibleProps> = ({
</TitleElement>
</Box>
{!collapsed && (
<Box className={theme['children']} marginTop={2}>
<Box {...(indent && { className: theme['children-indent'] })} marginTop={2}>
{children}
</Box>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/advancedCollapsible/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
cursor: pointer;
}

.children {
.children-indent {
padding-left: 20px;
}

0 comments on commit 20aee40

Please sign in to comment.