-
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] EuiPinnableListGroup (#3061)
* Added EuiCollapsibleNavGroupList component * Added content to EuiCollapsibleNavList * Update to use latest props from EuiListGroup * Passing `color` to EuiListGroup * Added active link to examples * Better docs for nav list and added snippets * cleanup * Renamed `EuiCollapsibleList` to `EuiPinnableListGroup` and moved to `list_group` Also made `onPinClick` required * i18n * Fix focus and focus-within states With IE fallback * Allowing pin icon title/aria-labels to be custom Co-authored-by: Greg Thompson <thompson.glowe@gmail.com>
- Loading branch information
1 parent
760d8c0
commit 942cc34
Showing
17 changed files
with
701 additions
and
12 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
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
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,53 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
EuiPinnableListGroup, | ||
EuiPinnableListGroupItemProps, | ||
} from '../../../../src/components/list_group'; | ||
|
||
const someListItems: EuiPinnableListGroupItemProps[] = [ | ||
{ | ||
label: 'Label with iconType', | ||
iconType: 'stop', | ||
}, | ||
{ | ||
label: 'Pinned button with onClick', | ||
pinned: true, | ||
onClick: e => { | ||
console.log('Pinned button clicked', e); | ||
}, | ||
}, | ||
{ | ||
label: 'Link with href and custom pin titles', | ||
href: '/#', | ||
}, | ||
{ | ||
label: 'Active link', | ||
isActive: true, | ||
href: '/#', | ||
}, | ||
{ | ||
label: 'Custom extra actions will override pinning ability', | ||
extraAction: { | ||
iconType: 'bell', | ||
alwaysShow: true, | ||
'aria-label': 'bell', | ||
}, | ||
}, | ||
]; | ||
|
||
export default () => ( | ||
<> | ||
<EuiPinnableListGroup | ||
listItems={someListItems} | ||
onPinClick={item => { | ||
console.warn('Clicked: ', item); | ||
}} | ||
maxWidth="none" | ||
pinTitle={(item: EuiPinnableListGroupItemProps) => `Pin ${item.label}`} | ||
unpinTitle={(item: EuiPinnableListGroupItemProps) => | ||
`Unpin ${item.label}` | ||
} | ||
/> | ||
</> | ||
); |
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,7 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
|
||
import { EuiPinnableListGroupItemProps } from '../../../../src/components/list_group'; | ||
|
||
export const EuiPinnableListGroupItem: FunctionComponent< | ||
EuiPinnableListGroupItemProps | ||
> = () => <div />; |
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,4 +1,4 @@ | ||
@import 'variables'; | ||
|
||
@import 'collapsible_nav_group/index'; | ||
@import 'collapsible_nav'; | ||
@import 'collapsible_nav_group/index'; |
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
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
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
|
||
@import 'list_group'; | ||
@import 'list_group_item'; | ||
@import 'pinnable_list_group/index'; |
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
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,7 @@ | ||
export { EuiListGroup, EuiListGroupProps } from './list_group'; | ||
export { EuiListGroupItem, EuiListGroupItemProps } from './list_group_item'; | ||
export { | ||
EuiPinnableListGroup, | ||
EuiPinnableListGroupProps, | ||
EuiPinnableListGroupItemProps, | ||
} from './pinnable_list_group'; |
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
Oops, something went wrong.