-
Notifications
You must be signed in to change notification settings - Fork 843
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[New Nav Feature] Created
EuiCollapsibleGroup
(#3031)
* Added `EuiCollapsibleNavGroup` component * Initial render of nav group * Adding background color options * Fixing more colors * Added `collapsible` prop * cleanup * remove slugify * Added `titleSize` and `titleElement` to groups and better docs * better docs * snaps * doc cleanoup * Fixing contrast of focus state of dark bg * specific classname target * Using EuiTitle and sizing to wrap title * `collapsible` -> `isCollapsible` * Fixing `id` as state and exporting proper Prop types
- Loading branch information
Showing
14 changed files
with
716 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src-docs/src/views/collapsible_nav/collapsible_nav_group.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React from 'react'; | ||
|
||
import { EuiCollapsibleNavGroup } from '../../../../src/components/collapsible_nav'; | ||
import { EuiText } from '../../../../src/components/text'; | ||
import { EuiCode } from '../../../../src/components/code'; | ||
|
||
export default () => ( | ||
<> | ||
<EuiCollapsibleNavGroup> | ||
<EuiText size="s" color="subdued"> | ||
<p>This is a basic group without any modifications</p> | ||
</EuiText> | ||
</EuiCollapsibleNavGroup> | ||
<EuiCollapsibleNavGroup title="Nav group" iconType="logoElastic"> | ||
<EuiText size="s" color="subdued"> | ||
<p> | ||
This is a nice group with a heading supplied via{' '} | ||
<EuiCode>title</EuiCode> and <EuiCode>iconType</EuiCode>. | ||
</p> | ||
</EuiText> | ||
</EuiCollapsibleNavGroup> | ||
<EuiCollapsibleNavGroup | ||
background="light" | ||
title="Nav group" | ||
isCollapsible={true} | ||
iconType="logoElastic" | ||
initialIsOpen={true}> | ||
<EuiText size="s" color="subdued"> | ||
<p> | ||
This group is <EuiCode>collapsible</EuiCode> and set with{' '} | ||
<EuiCode>initialIsOpen</EuiCode>. It has a heading that is the | ||
collapsing button via <EuiCode>title</EuiCode> and{' '} | ||
<EuiCode>iconType</EuiCode>. | ||
</p> | ||
</EuiText> | ||
</EuiCollapsibleNavGroup> | ||
<EuiCollapsibleNavGroup | ||
title="Nav group" | ||
iconType="logoGCPMono" | ||
iconSize="xxl" | ||
titleSize="s" | ||
isCollapsible={true} | ||
initialIsOpen={false} | ||
background="dark"> | ||
<EuiText size="s"> | ||
<p> | ||
This is a <EuiCode>dark</EuiCode> <EuiCode>collapsible</EuiCode> group | ||
that is initally set to closed,{' '} | ||
<EuiCode>iconSize="xxl"</EuiCode> and{' '} | ||
<EuiCode>titleSize="s"</EuiCode>. | ||
</p> | ||
</EuiText> | ||
</EuiCollapsibleNavGroup> | ||
</> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
@import 'variables'; | ||
|
||
@import 'collapsible_nav_group/index'; | ||
@import 'collapsible_nav'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
// Sizing | ||
$euiCollapsibleNavWidth: $euiSize * 20; // ~ 320px | ||
|
||
$euiCollapsibleNavGroupLightBackgroundColor: $euiPageBackgroundColor; | ||
|
||
$euiCollapsibleNavGroupDarkBackgroundColor: lightOrDarkTheme( | ||
shade($euiColorDarkestShade, 20%), | ||
shade($euiColorLightestShade, 50%), | ||
); | ||
|
||
$euiCollapsibleNavGroupDarkHighContrastColor: makeGraphicContrastColor( | ||
$euiColorPrimary, | ||
$euiCollapsibleNavGroupDarkBackgroundColor | ||
); |
Oops, something went wrong.