-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[New Nav Feature] Created EuiCollapsibleGroup
#3031
[New Nav Feature] Created EuiCollapsibleGroup
#3031
Conversation
+1 |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3031/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3031/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.tsx
Show resolved
Hide resolved
src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.tsx
Show resolved
Hide resolved
src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only bit I noticed was collapsable spitting out some weirdness in the autodocs. Note reads well enough though.
Yeah this happens when a prop is technically a boolean, but depending on it's value requires another prop or extends another type. Hopefully that'll all get fixed via GSOC 😏
eui/src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.tsx
Lines 50 to 74 in e8d7b39
type GroupAsAccordion = EuiCollapsibleNavGroupProps & | |
Omit<EuiAccordionProps, 'id'> & { | |
/** | |
* If `true`, wraps children in the body of an accordion, | |
* using the `title` (required for use with `collapsible`) as the button | |
*/ | |
collapsible: true; | |
/** | |
* The title gets wrapped in the appropriate heading level | |
* with the option to add an iconType | |
*/ | |
title: ReactNode; | |
}; | |
type GroupAsDiv = EuiCollapsibleNavGroupProps & { | |
/** | |
* When `false`, simply renders a div without any accordion functionality | |
*/ | |
collapsible?: false; | |
/** | |
* The title gets wrapped in the appropriate heading level | |
* with the option to add an iconType | |
*/ | |
title?: ReactNode; | |
}; |
src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.tsx
Outdated
Show resolved
Hide resolved
Preview documentation changes for this PR: https://eui.elastic.co/pr_3031/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good; just a couple requests.
src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.test.tsx
Outdated
Show resolved
Hide resolved
src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.tsx
Outdated
Show resolved
Hide resolved
src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.tsx
Outdated
Show resolved
Hide resolved
src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.tsx
Outdated
Show resolved
Hide resolved
Preview documentation changes for this PR: https://eui.elastic.co/pr_3031/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* 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
* 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
* 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
* [Feature] Added `EuiCollapsibleNav` component (#2977) * [New Nav Feature] Added `ghost` colored EuiListGroupItem (#3018) * [New Nav Feature] Created `EuiCollapsibleGroup` (#3031) * [New Nav Feature] EuiPinnableListGroup (#3061) * [K8 Nav Feature] Added `home` and `menu` glyphs to EuiIcon (#3109) * [New Nav Feature] Final docs examples and patterns (#3117) * [New Nav Feature] Move collapsible nav toggle button to be part of EuiCollapsibleNav (#3168)
* [Feature] Added `EuiCollapsibleNav` component (elastic#2977) * [New Nav Feature] Added `ghost` colored EuiListGroupItem (elastic#3018) * [New Nav Feature] Created `EuiCollapsibleGroup` (elastic#3031) * [New Nav Feature] EuiPinnableListGroup (elastic#3061) * [K8 Nav Feature] Added `home` and `menu` glyphs to EuiIcon (elastic#3109) * [New Nav Feature] Final docs examples and patterns (elastic#3117) * [New Nav Feature] Move collapsible nav toggle button to be part of EuiCollapsibleNav (elastic#3168)
EuiCollapsibleGroup
This is the accordion style grouping that will make up these three portions:
The contents of the group doesn't matter, hence the scribbles
Instead of trying to create 3 components, I made one that is child-agnostic and can be an accordion via
collapsible=true
or not. Consumers can also add a header withtitle
andiconType
. They can also choose the background color.Accessibility
Since it does wrap the EuiAccordion when
collapsible=true
, if there's any a11y needs for that specifically, we should do it in EuiAccordion and make an issue for that.The one thing I had to deal with is the focus states of the
dark
background accordion toggle arrow were hard to see. So I forced a different focus ring color with overrides.Dark mode
In dark mode, they all just get different shades of dark that aren't that noticeable from each other. 🤷♀
Checklist
[ ] Checked for breaking changes and labeled appropriately[ ] A changelog entry exists and is marked appropriatelyWill be added to feature PR