mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
`102.2.0` ⏩ `102.3.0` [Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams) ## Changes >[!IMPORTANT] This release contains the visual refresh updates for buttons ⏹️ 💅 These have already been available for QA ahead of time on [this PR](https://github.com/elastic/kibana/pull/220093). 1. **EUI changes**: Adds all Visual Refresh related EUI changes on button components: - `EuiButton` - `EuiButtonEmpty` - `EuiButtonIcon` - `EuiButtonGroup` - `EuiFilterGroup`/`EuiFilterButton` 2. **EUI button component API updates:** Updates instances of `EuiFilterButton` usages that were missing `isSelected` prop or that should use the new `isToggle` prop to ensure the expected visual and semantic output as toggle button. <details><summary><b>Examples of new toggle filter buttons</b></summary> | before | after | |---|---| |  |  | |  |  | |  |  | </details> 3. **Custom styling updates:** Updates custom styling overrides on EUI button components in selected **high-visibility places** (discover, dashboard, lens) to ensure expected Visual Refresh output. (This is a first iteration step to ensure expected design. In the future we want to replace custom buttons with proper EUI components) <details><summary><b>Updated custom button styling</b></summary> | Solution/Area | After | |---|---| | Discover(classic) |  | | Discover(ES/QL) |  | | Dashboard(Create Visualization) |  | | Maps: Aligned map toolbar button hover |  | </details> ## Package updates ### `@elastic/eui` ## [`v102.3.0`](https://github.com/elastic/eui/releases/v102.3.0) - Added support for `focusTrapProps.returnFocus` on `EuiFlyout` ([#8716](https://github.com/elastic/eui/pull/8716)) - Updated `EuiDataGridToolbarControl` hover styles by removing text-decoration and changing the badge background-color to ensure enough contrast ([#8670](https://github.com/elastic/eui/pull/8670)) - Added prop `isToggle` on `EuiFilterButton` to switch between regular and toggle button ([#8652](https://github.com/elastic/eui/pull/8652)) - Updated `hasActiveFilters` on `EuiFilterButton` to only control highlighting filters, not a visual selected state ([#8652](https://github.com/elastic/eui/pull/8652)) - Updated `EuiFilterButton` to ensure `isSelected` prop applies both semantic and visual states ([#8652](https://github.com/elastic/eui/pull/8652)) - Updated visual styling of `EuiButtonGroup`, `EuiFilterGroup` and `EuiFilterButton` ([#8652](https://github.com/elastic/eui/pull/8652)) - Updated `EuiNotificationBadge` border radius to `2px` ([#8652](https://github.com/elastic/eui/pull/8652)) - Updated `EuiBreadcrumbs` text color for `type="application"` ([#8652](https://github.com/elastic/eui/pull/8652)) - Added new `refresh` design variant for button components: ([#8595](https://github.com/elastic/eui/pull/8595)) - `EuiButton` - `EuiButtonEmpty` - `EuiButtonIcon` - Added `flags.buttonVariant` with value `classic` to `euiThemeAmsterdam` ([#8595](https://github.com/elastic/eui/pull/8595)) - Added new button background component tokens to Amsterdam theme: ([#8595](https://github.com/elastic/eui/pull/8595)) - `background{color}Hover` - `background{color}Active` - `backgroundFilled{color}Hover` - `backgroundFilled{color}Active` - `backgroundEmpty{color}Hover` - `backgroundEmpty{color}Active` **Bug fixes** - Fixed an issue with `EuiDataGrid` where navigating cells with simultaneous key presses would result in a crash in React 18 legacy mode ([#8698](https://github.com/elastic/eui/pull/8698)) **Accessibility** - Improved the accessibility experience of `EuiMarkdownEditorFooter` by fixing the ARIA attributes of the `syntax help` modal. ([#8702](https://github.com/elastic/eui/pull/8702)) ### `@elastic/eui-theme-borealis` ## [`v1.1.0`](https://github.com/elastic/eui/releases/v1.1.0) - Added token `filterButtonBadgeBackgroundHover` ([#8652](https://github.com/elastic/eui/pull/8652)) - Updated values for tokens `buttonGroupFocusColor` and `buttonGroupBackgroundDisabledSelected` ([#8652](https://github.com/elastic/eui/pull/8652)) - Added `flags.buttonVariant` with value `refresh` to `euiThemeBorealis` ([#8595](https://github.com/elastic/eui/pull/8595)) - Added new button background component tokens: ([#8595](https://github.com/elastic/eui/pull/8595)) - `background{color}Hover` - `background{color}Active` - `backgroundFilled{color}Hover` - `backgroundFilled{color}Active` - `backgroundEmpty{color}Hover` - `backgroundEmpty{color}Active` - Updated `backgroundLightText` token value to `shade120` ([#8595](https://github.com/elastic/eui/pull/8595)) --------- Co-authored-by: “jeramysoucy” <jeramy.soucy@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
186 lines
5.2 KiB
TypeScript
186 lines
5.2 KiB
TypeScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the "Elastic License
|
|
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
|
|
* Public License v 1"; you may not use this file except in compliance with, at
|
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
|
* License v3.0 only", or the "Server Side Public License, v 1".
|
|
*/
|
|
|
|
import React, { FunctionComponent, useState } from 'react';
|
|
import { EuiButtonEmpty, EuiFilterGroup, EuiFilterButton, EuiSpacer, EuiTitle } from '@elastic/eui';
|
|
import { UserProfilesPopover, UserProfileWithAvatar } from '@kbn/user-profile-components';
|
|
import { PanelWithCodeBlock } from './panel_with_code_block';
|
|
|
|
export const PopoverDemo: FunctionComponent = () => {
|
|
const [isOpen, setIsOpen] = useState(false);
|
|
const [selectedOptions, setSelectedOptions] = useState<UserProfileWithAvatar[]>([
|
|
{
|
|
uid: 'u_BOulL4QMPSyV9jg5lQI2JmCkUnokHTazBnet3xVHNv0_0',
|
|
enabled: true,
|
|
data: {},
|
|
user: {
|
|
username: 'delighted_nightingale',
|
|
email: 'delighted_nightingale@elastic.co',
|
|
full_name: 'Delighted Nightingale',
|
|
},
|
|
},
|
|
]);
|
|
const defaultOptions: UserProfileWithAvatar[] = [
|
|
{
|
|
uid: 'u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0',
|
|
enabled: true,
|
|
data: {},
|
|
user: {
|
|
username: 'damaged_raccoon',
|
|
email: 'damaged_raccoon@elastic.co',
|
|
full_name: 'Damaged Raccoon',
|
|
},
|
|
},
|
|
{
|
|
uid: 'u_A_tM4n0wPkdiQ9smmd8o0Hr_h61XQfu8aRPh9GMoRoc_0',
|
|
enabled: true,
|
|
data: {},
|
|
user: {
|
|
username: 'physical_dinosaur',
|
|
email: 'physical_dinosaur@elastic.co',
|
|
full_name: 'Physical Dinosaur',
|
|
},
|
|
},
|
|
{
|
|
uid: 'u_9xDEQqUqoYCnFnPPLq5mIRHKL8gBTo_NiKgOnd5gGk0_0',
|
|
enabled: true,
|
|
data: {},
|
|
user: {
|
|
username: 'wet_dingo',
|
|
email: 'wet_dingo@elastic.co',
|
|
full_name: 'Wet Dingo',
|
|
},
|
|
},
|
|
];
|
|
|
|
const [isOpen2, setIsOpen2] = useState(false);
|
|
const [selectedOptions2, setSelectedOptions2] = useState<Array<UserProfileWithAvatar | null>>([
|
|
null,
|
|
]);
|
|
const options2: Array<UserProfileWithAvatar | null> = [
|
|
null,
|
|
{
|
|
uid: 'u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0',
|
|
enabled: true,
|
|
data: {},
|
|
user: {
|
|
username: 'damaged_raccoon',
|
|
email: 'damaged_raccoon@elastic.co',
|
|
full_name: 'Damaged Raccoon',
|
|
},
|
|
},
|
|
{
|
|
uid: 'u_A_tM4n0wPkdiQ9smmd8o0Hr_h61XQfu8aRPh9GMoRoc_0',
|
|
enabled: true,
|
|
data: {},
|
|
user: {
|
|
username: 'physical_dinosaur',
|
|
email: 'physical_dinosaur@elastic.co',
|
|
full_name: 'Physical Dinosaur',
|
|
},
|
|
},
|
|
{
|
|
uid: 'u_9xDEQqUqoYCnFnPPLq5mIRHKL8gBTo_NiKgOnd5gGk0_0',
|
|
enabled: true,
|
|
data: {},
|
|
user: {
|
|
username: 'wet_dingo',
|
|
email: 'wet_dingo@elastic.co',
|
|
full_name: 'Wet Dingo',
|
|
},
|
|
},
|
|
];
|
|
|
|
return (
|
|
<PanelWithCodeBlock title="Popover" code={code}>
|
|
<UserProfilesPopover
|
|
title="Edit assignees"
|
|
button={
|
|
<EuiButtonEmpty iconType="pencil" onClick={() => setIsOpen((value) => !value)}>
|
|
Edit assignees
|
|
</EuiButtonEmpty>
|
|
}
|
|
isOpen={isOpen}
|
|
closePopover={() => setIsOpen(false)}
|
|
selectableProps={{
|
|
selectedOptions,
|
|
defaultOptions,
|
|
onChange: setSelectedOptions,
|
|
limit: 2,
|
|
height: 32 * 8,
|
|
}}
|
|
panelStyle={{
|
|
width: 32 * 16,
|
|
}}
|
|
/>
|
|
<EuiSpacer size="l" />
|
|
<EuiTitle size="xs">
|
|
<h3>Unassigned option</h3>
|
|
</EuiTitle>
|
|
<EuiSpacer size="s" />
|
|
<EuiFilterGroup>
|
|
<UserProfilesPopover
|
|
button={
|
|
<EuiFilterButton
|
|
iconType="arrowDown"
|
|
numFilters={options2.length}
|
|
isSelected={isOpen2}
|
|
hasActiveFilters={selectedOptions2.length > 0}
|
|
numActiveFilters={selectedOptions2.length}
|
|
onClick={() => setIsOpen2((value) => !value)}
|
|
>
|
|
Assignees
|
|
</EuiFilterButton>
|
|
}
|
|
isOpen={isOpen2}
|
|
closePopover={() => setIsOpen2(false)}
|
|
selectableProps={{
|
|
selectedOptions: selectedOptions2,
|
|
options: options2,
|
|
onChange: setSelectedOptions2,
|
|
limit: 2,
|
|
height: 32 * 8,
|
|
nullOptionLabel: 'Unassigned',
|
|
}}
|
|
panelStyle={{
|
|
width: 32 * 16,
|
|
}}
|
|
/>
|
|
</EuiFilterGroup>
|
|
</PanelWithCodeBlock>
|
|
);
|
|
};
|
|
|
|
const code = `import { UserProfilesPopover } from '@kbn/user-profile-components';
|
|
|
|
const [selectedOptions, setSelectedOptions] = useState([
|
|
{
|
|
uid: 'u_BOulL4QMPSyV9jg5lQI2JmCkUnokHTazBnet3xVHNv0_0',
|
|
enabled: true,
|
|
data: {},
|
|
user: {
|
|
username: 'delighted_nightingale',
|
|
email: 'delighted_nightingale@elastic.co',
|
|
full_name: 'Delighted Nightingale',
|
|
},
|
|
},
|
|
]);
|
|
|
|
<UserProfilesPopover
|
|
title="Edit assignees"
|
|
button={
|
|
<EuiButton>
|
|
Edit assignees
|
|
</EuiButton>
|
|
}
|
|
selectableProps={{
|
|
selectedOptions,
|
|
onChange: setSelectedOptions
|
|
}}
|
|
/>`;
|