Skip to content

Commit

Permalink
EuiSelectableTemplateSitewide for Elastic's global search (#3800)
Browse files Browse the repository at this point in the history
* [EuiSelectableListItem] Added `onFocusBadgeContent` prop for visible instructions
  * Fixing alignment of new li elements that used to be buttons
* First step towards custom option renders
* Added `searchableLabel` to EuiSelectableOption`
  * EuiHighlight as the span
  * Changing EuiSelectableItem’s `onFocusBadgeContent` to `onFocusBadge` To allow for altering the badge’s props as well as content
* Added ability to change empty messages directly on EuiSelectable to maintain id
* [EuiSelectableMessage] Added `bordered` prop
  * Updating some EuiSelectable docs and removing `<br>` from sitewide template
* [EuiBadge] Fix layout when only an icon is provided
  * Also fixes the implementation of the on focus badge for EuiComboBox and EuiSelectable
* Background color for EuiMark only in Amsterdam
* introduce EuiSelectableOption generic; use generic extension in EuiSelectableTemplateSitewideOption
* [EuiPopover] and [EuiSelectable] Fix some axe issues
  • Loading branch information
cchaos authored Aug 18, 2020
1 parent faeaabf commit df6dd76
Show file tree
Hide file tree
Showing 52 changed files with 2,268 additions and 184 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ No public interface changes since `28.1.0`.

- Added `isLoading` and `isLoadingMessage` props to `EuiAccordion` ([#3879](https://github.com/elastic/eui/pull/3879))
- Added `testenv` mock for `EuiFocusTrap` ([#3930](https://github.com/elastic/eui/pull/3930))
- Added `EuiSelectableTemplateSitewide` as wrapper of `EuiSelectable` for Elastic's global search component ([#3800](https://github.com/elastic/eui/pull/3800))
- Updated styles of `EuiMark` to override browser default ([#3800](https://github.com/elastic/eui/pull/3800))
- Updated `EuiHighlight` to use `EuiMark` as matching element wrapper ([#3800](https://github.com/elastic/eui/pull/3800))
- Enhanced `EuiSelectable`'s `option` type to allow for a separate `searchableLabel` and any generic keys ([#3800](https://github.com/elastic/eui/pull/3800))
- Added `listProps.onFocusBadge`, `loadingMessage`, `noMatchesMessage`, and `emptyMessage` props to `EuiSelectable` ([#3800](https://github.com/elastic/eui/pull/3800))
- Added `bordered` prop to `EuiSelectableMessage` ([#3800](https://github.com/elastic/eui/pull/3800))

**Bug fixes**

- Fixed bug in `EuiCodeBlock` content overlapping with control buttons when `whiteSpace` was set to `"pre"` ([#3853](https://github.com/elastic/eui/pull/3853))
- Fixed `EuiFocusTrap` not applying provided `style` prop ([#3916](https://github.com/elastic/eui/pull/3916))
- Fixed bug in `EuiDataGrid` when a new pagination object would cause every cell to render ([#3919](https://github.com/elastic/eui/pull/3919))
- Fixed display of `EuiBadge` if only the `iconType` is passed ([#3800](https://github.com/elastic/eui/pull/3800))
- Fixed accesssibility error in `EuiSelectable` when the `list` isn't on the page ([#3800](https://github.com/elastic/eui/pull/3800))
- Fixed accesssibility error in `EuiPopover` when `ownFocus = false` ([#3800](https://github.com/elastic/eui/pull/3800))

## [`28.0.0`](https://github.com/elastic/eui/tree/v28.0.0)

Expand Down
5 changes: 5 additions & 0 deletions src-docs/src/components/guide_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ $guideZLevelHighest: $euiZLevel9 + 1000;
font-weight: $euiFontWeightBold;
}

.euiSelectableTemplateSitewide__optionMeta--PINK {
font-weight: $euiFontWeightMedium;
color: $euiColorAccentText;
}

@import '../views/guidelines/index';
@import 'guide_section/index';
@import 'guide_rule/index';
Expand Down
2 changes: 2 additions & 0 deletions src-docs/src/views/badge/badge_with_icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ export default () => (
</EuiBadge>

<EuiBadge iconType="check">Default</EuiBadge>

<EuiBadge iconType="returnKey" />
</div>
);
25 changes: 25 additions & 0 deletions src-docs/src/views/header/header_elastic_pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import {
EuiShowFor,
EuiText,
EuiTitle,
EuiSelectableTemplateSitewide,
EuiSelectableMessage,
} from '../../../../src/components';

export default ({ theme }) => {
Expand Down Expand Up @@ -256,6 +258,29 @@ export default ({ theme }) => {
],
borders: 'none',
},
{
items: [
<EuiSelectableTemplateSitewide
options={[]}
searchProps={{
append: '⌘K',
compressed: true,
}}
emptyMessage={
<EuiSelectableMessage style={{ minHeight: 300 }}>
<p>
Please see the component page for{' '}
<Link to="/forms/selectable">
<strong>EuiSelectableTemplateSitewide</strong>
</Link>{' '}
on how to configure your sitewide search.
</p>
</EuiSelectableMessage>
}
/>,
],
borders: 'none',
},
{
items: [
deploymentMenu,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const HighlightAndMarkExample = {
],
text: (
<p>
Use <strong>EuiMark</strong> to wrap a string in an
Use <strong>EuiMark</strong> to wrap a string in a{' '}
<EuiCode>mark</EuiCode> element.
</p>
),
Expand Down
4 changes: 1 addition & 3 deletions src-docs/src/views/highlight_and_mark/mark.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { EuiMark } from '../../../../src/components';
export function Mark() {
return (
<Fragment>
The quick brown fox
<EuiMark>jumped over</EuiMark>
the lazy dog
The quick brown fox <EuiMark>jumped over</EuiMark> the lazy dog
</Fragment>
);
}
13 changes: 13 additions & 0 deletions src-docs/src/views/selectable/props.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,23 @@ import {
EuiSelectableOptionsListProps,
} from '../../../../src/components/selectable';

import {
EuiSelectableTemplateSitewideOption,
EuiSelectableTemplateSitewideMetaData,
} from '../../../../src/components/selectable/selectable_templates/selectable_template_sitewide_option';

export const EuiSelectableOptionProps: FunctionComponent<EuiSelectableOption> = () => (
<div />
);

export const EuiSelectableOptionsList: FunctionComponent<EuiSelectableOptionsListProps> = () => (
<div />
);

export const Options: FunctionComponent<EuiSelectableTemplateSitewideOption> = () => (
<div />
);

export const MetaData: FunctionComponent<EuiSelectableTemplateSitewideMetaData> = () => (
<div />
);
Loading

0 comments on commit df6dd76

Please sign in to comment.