diff --git a/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastListItem_Playground.png b/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastListItem_Playground.png index c1175793920b..4f4b917bcfa5 100644 Binary files a/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastListItem_Playground.png and b/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastListItem_Playground.png differ diff --git a/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastList_Playground.png b/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastList_Playground.png index 6b2be8146eaf..638a92973ab8 100644 Binary files a/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastList_Playground.png and b/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastList_Playground.png differ diff --git a/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_Kitchen_Sink.png b/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_Kitchen_Sink.png new file mode 100644 index 000000000000..067785a881c5 Binary files /dev/null and b/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_Kitchen_Sink.png differ diff --git a/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_On_Dismiss.png b/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_On_Dismiss.png new file mode 100644 index 000000000000..93aeb011c98e Binary files /dev/null and b/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_On_Dismiss.png differ diff --git a/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_Playground.png b/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_Playground.png index 5a449f5c2b7a..517f53c52933 100644 Binary files a/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_Playground.png and b/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_Playground.png differ diff --git a/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_With_Actions.png b/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_With_Actions.png new file mode 100644 index 000000000000..a0d5e28d6880 Binary files /dev/null and b/packages/eui/.loki/reference/chrome_desktop_Display_EuiToast_With_Actions.png differ diff --git a/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastListItem_Playground.png b/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastListItem_Playground.png index 562b2e4004d9..d142ac8578e3 100644 Binary files a/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastListItem_Playground.png and b/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastListItem_Playground.png differ diff --git a/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastList_Playground.png b/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastList_Playground.png index 692b8b11cb97..b482dd162000 100644 Binary files a/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastList_Playground.png and b/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_EuiGlobalToastList_EuiGlobalToastList_Playground.png differ diff --git a/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_Kitchen_Sink.png b/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_Kitchen_Sink.png new file mode 100644 index 000000000000..57588a566ed4 Binary files /dev/null and b/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_Kitchen_Sink.png differ diff --git a/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_On_Dismiss.png b/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_On_Dismiss.png new file mode 100644 index 000000000000..90a93bc7a618 Binary files /dev/null and b/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_On_Dismiss.png differ diff --git a/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_Playground.png b/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_Playground.png index 3c62b0390f05..84c38ed21760 100644 Binary files a/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_Playground.png and b/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_Playground.png differ diff --git a/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_With_Actions.png b/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_With_Actions.png new file mode 100644 index 000000000000..fba2454968a7 Binary files /dev/null and b/packages/eui/.loki/reference/chrome_mobile_Display_EuiToast_With_Actions.png differ diff --git a/packages/eui/changelogs/upcoming/9688.md b/packages/eui/changelogs/upcoming/9688.md new file mode 100644 index 000000000000..a938790bc8f3 --- /dev/null +++ b/packages/eui/changelogs/upcoming/9688.md @@ -0,0 +1,5 @@ +- Updated `EuiToast` styles +- Added `text` prop on `EuiToast` which renders the main text. Use this instead of `children` where possible. +- Added `actionProps` prop on `EuiToast` which renders primary and secondary action buttons. +- Added `animationMs` prop on `EuiToast`. If set it'll render a reverse loading bar. +- Added `showNotificationBadge` prop on `EuiGlobalToastList` to optionally show a badge indicating the toast list length. \ No newline at end of file diff --git a/packages/eui/i18ntokens.json b/packages/eui/i18ntokens.json index 719389b27f21..05806e65b07b 100644 --- a/packages/eui/i18ntokens.json +++ b/packages/eui/i18ntokens.json @@ -18,22 +18,76 @@ "filepath": "src/components/tree_view/tree_view.tsx" }, { - "token": "euiIconTip.defaultAriaLabel", - "defString": "Info", + "token": "euiToast.dismissToast", + "defString": "Dismiss toast", "highlighting": "string", "loc": { "start": { - "line": 58, - "column": 27, - "index": 1773 + "line": 145, + "column": 6, + "index": 4506 }, "end": { - "line": 58, - "column": 76, - "index": 1822 + "line": 145, + "column": 69, + "index": 4569 } }, - "filepath": "src/components/tool_tip/icon_tip.tsx" + "filepath": "src/components/toast/toast.tsx" + }, + { + "token": "euiToast.newNotification", + "defString": "A new notification appears", + "highlighting": "string", + "loc": { + "start": { + "line": 270, + "column": 10, + "index": 7552 + }, + "end": { + "line": 273, + "column": 12, + "index": 7667 + } + }, + "filepath": "src/components/toast/toast.tsx" + }, + { + "token": "euiGlobalToastList.clearAllToastsButtonAriaLabel", + "defString": "Clear all toast notifications", + "highlighting": "string", + "loc": { + "start": { + "line": 332, + "column": 8, + "index": 11220 + }, + "end": { + "line": 339, + "column": 9, + "index": 11503 + } + }, + "filepath": "src/components/toast/global_toast_list.tsx" + }, + { + "token": "euiGlobalToastList.clearAllToastsButtonDisplayText", + "defString": "Clear all", + "highlighting": "string", + "loc": { + "start": { + "line": 332, + "column": 8, + "index": 11220 + }, + "end": { + "line": 339, + "column": 9, + "index": 11503 + } + }, + "filepath": "src/components/toast/global_toast_list.tsx" }, { "token": "euiTourStepIndicator.isActive", @@ -162,112 +216,76 @@ "filepath": "src/components/tour/_tour_footer.tsx" }, { - "token": "euiToast.newNotification", - "defString": "A new notification appears", - "highlighting": "string", - "loc": { - "start": { - "line": 59, - "column": 10, - "index": 1830 - }, - "end": { - "line": 62, - "column": 12, - "index": 1945 - } - }, - "filepath": "src/components/toast/toast.tsx" - }, - { - "token": "euiToast.notification", - "defString": "Notification", - "highlighting": "string", - "loc": { - "start": { - "line": 67, - "column": 6, - "index": 2016 - }, - "end": { - "line": 67, - "column": 68, - "index": 2078 - } - }, - "filepath": "src/components/toast/toast.tsx" - }, - { - "token": "euiToast.dismissToast", - "defString": "Dismiss toast", + "token": "euiIconTip.defaultAriaLabel", + "defString": "Info", "highlighting": "string", "loc": { "start": { - "line": 95, - "column": 8, - "index": 2767 + "line": 58, + "column": 27, + "index": 1773 }, "end": { - "line": 95, - "column": 71, - "index": 2830 + "line": 58, + "column": 76, + "index": 1822 } }, - "filepath": "src/components/toast/toast.tsx" + "filepath": "src/components/tool_tip/icon_tip.tsx" }, { - "token": "euiGlobalToastList.clearAllToastsButtonAriaLabel", - "defString": "Clear all toast notifications", + "token": "euiTableHeaderCell.titleTextWithDesc", + "defString": "{innerText}; {description}", "highlighting": "string", "loc": { "start": { - "line": 323, - "column": 8, - "index": 11017 + "line": 139, + "column": 10, + "index": 4414 }, "end": { - "line": 330, - "column": 9, - "index": 11300 + "line": 143, + "column": 11, + "index": 4588 } }, - "filepath": "src/components/toast/global_toast_list.tsx" + "filepath": "src/components/table/table_header_cell.tsx" }, { - "token": "euiGlobalToastList.clearAllToastsButtonDisplayText", - "defString": "Clear all", + "token": "euiSkeletonLoading.loadedAriaText", + "defString": "Loaded {contentAriaLabel}", "highlighting": "string", "loc": { "start": { - "line": 323, - "column": 8, - "index": 11017 + "line": 73, + "column": 25, + "index": 2343 }, "end": { - "line": 330, - "column": 9, - "index": 11300 + "line": 77, + "column": 3, + "index": 2457 } }, - "filepath": "src/components/toast/global_toast_list.tsx" + "filepath": "src/components/skeleton/skeleton_loading.tsx" }, { - "token": "euiTableHeaderCell.titleTextWithDesc", - "defString": "{innerText}; {description}", + "token": "euiSkeletonLoading.loadingAriaText", + "defString": "Loading {contentAriaLabel}", "highlighting": "string", "loc": { "start": { - "line": 139, - "column": 10, - "index": 4414 + "line": 79, + "column": 27, + "index": 2487 }, "end": { - "line": 143, - "column": 11, - "index": 4588 + "line": 83, + "column": 3, + "index": 2603 } }, - "filepath": "src/components/table/table_header_cell.tsx" + "filepath": "src/components/skeleton/skeleton_loading.tsx" }, { "token": "euiStat.loadingText", @@ -576,40 +594,22 @@ "filepath": "src/components/steps/step_strings.tsx" }, { - "token": "euiSkeletonLoading.loadedAriaText", - "defString": "Loaded {contentAriaLabel}", - "highlighting": "string", - "loc": { - "start": { - "line": 73, - "column": 25, - "index": 2343 - }, - "end": { - "line": 77, - "column": 3, - "index": 2457 - } - }, - "filepath": "src/components/skeleton/skeleton_loading.tsx" - }, - { - "token": "euiSkeletonLoading.loadingAriaText", - "defString": "Loading {contentAriaLabel}", + "token": "euiSideNav.mobileToggleAriaLabel", + "defString": "Toggle navigation", "highlighting": "string", "loc": { "start": { - "line": 79, - "column": 27, - "index": 2487 + "line": 208, + "column": 16, + "index": 6318 }, "end": { - "line": 83, - "column": 3, - "index": 2603 + "line": 211, + "column": 17, + "index": 6449 } }, - "filepath": "src/components/skeleton/skeleton_loading.tsx" + "filepath": "src/components/side_nav/side_nav.tsx" }, { "token": "euiSearchBox.placeholder", @@ -792,40 +792,40 @@ "filepath": "src/components/selectable/selectable.tsx" }, { - "token": "euiSideNav.mobileToggleAriaLabel", - "defString": "Toggle navigation", + "token": "euiResizableButton.horizontalResizerAriaLabel", + "defString": "Press the left or right arrow keys to adjust panels size", "highlighting": "string", "loc": { "start": { - "line": 208, - "column": 16, - "index": 6318 + "line": 98, + "column": 6, + "index": 3160 }, "end": { - "line": 211, - "column": 17, - "index": 6449 + "line": 107, + "column": 7, + "index": 3489 } }, - "filepath": "src/components/side_nav/side_nav.tsx" + "filepath": "src/components/resizable_container/resizable_button.tsx" }, { - "token": "euiProgress.valueText", - "defString": "{value}%", + "token": "euiResizableButton.verticalResizerAriaLabel", + "defString": "Press the up or down arrow keys to adjust panels size", "highlighting": "string", "loc": { "start": { - "line": 154, + "line": 98, "column": 6, - "index": 4411 + "index": 3160 }, "end": { - "line": 160, - "column": 8, - "index": 4539 + "line": 107, + "column": 7, + "index": 3489 } }, - "filepath": "src/components/progress/progress.tsx" + "filepath": "src/components/resizable_container/resizable_button.tsx" }, { "token": "euiResizablePanel.toggleButtonAriaLabel", @@ -846,112 +846,40 @@ "filepath": "src/components/resizable_container/resizable_panel.tsx" }, { - "token": "euiResizableButton.horizontalResizerAriaLabel", - "defString": "Press the left or right arrow keys to adjust panels size", + "token": "euiProgress.valueText", + "defString": "{value}%", "highlighting": "string", "loc": { "start": { - "line": 98, + "line": 154, "column": 6, - "index": 3160 + "index": 4411 }, "end": { - "line": 107, - "column": 7, - "index": 3489 + "line": 160, + "column": 8, + "index": 4539 } }, - "filepath": "src/components/resizable_container/resizable_button.tsx" + "filepath": "src/components/progress/progress.tsx" }, { - "token": "euiResizableButton.verticalResizerAriaLabel", - "defString": "Press the up or down arrow keys to adjust panels size", + "token": "euiPaginationButtonArrow.firstPage", + "defString": "First page", "highlighting": "string", "loc": { "start": { - "line": 98, - "column": 6, - "index": 3160 + "line": 48, + "column": 11, + "index": 1414 }, "end": { - "line": 107, - "column": 7, - "index": 3489 + "line": 48, + "column": 73, + "index": 1476 } }, - "filepath": "src/components/resizable_container/resizable_button.tsx" - }, - { - "token": "euiPopover.screenReaderAnnouncement", - "defString": "You are in a dialog. Press Escape, or tap/click outside the dialog to close.", - "highlighting": "string", - "loc": { - "start": { - "line": 762, - "column": 16, - "index": 22865 - }, - "end": { - "line": 765, - "column": 18, - "index": 23059 - } - }, - "filepath": "src/components/popover/popover.tsx" - }, - { - "token": "euiPaginationButton.longPageString", - "defString": "Page {page} of {totalPages}", - "highlighting": "string", - "loc": { - "start": { - "line": 66, - "column": 4, - "index": 1920 - }, - "end": { - "line": 70, - "column": 5, - "index": 2087 - } - }, - "filepath": "src/components/pagination/pagination_button.tsx" - }, - { - "token": "euiPaginationButton.shortPageString", - "defString": "Page {page}", - "highlighting": "string", - "loc": { - "start": { - "line": 72, - "column": 8, - "index": 2133 - }, - "end": { - "line": 76, - "column": 9, - "index": 2277 - } - }, - "filepath": "src/components/pagination/pagination_button.tsx" - }, - { - "token": "euiPaginationButtonArrow.firstPage", - "defString": "First page", - "highlighting": "string", - "loc": { - "start": { - "line": 48, - "column": 11, - "index": 1414 - }, - "end": { - "line": 48, - "column": 73, - "index": 1476 - } - }, - "filepath": "src/components/pagination/pagination_button_arrow.tsx" + "filepath": "src/components/pagination/pagination_button_arrow.tsx" }, { "token": "euiPaginationButtonArrow.previousPage", @@ -1007,6 +935,42 @@ }, "filepath": "src/components/pagination/pagination_button_arrow.tsx" }, + { + "token": "euiPaginationButton.longPageString", + "defString": "Page {page} of {totalPages}", + "highlighting": "string", + "loc": { + "start": { + "line": 66, + "column": 4, + "index": 1920 + }, + "end": { + "line": 70, + "column": 5, + "index": 2087 + } + }, + "filepath": "src/components/pagination/pagination_button.tsx" + }, + { + "token": "euiPaginationButton.shortPageString", + "defString": "Page {page}", + "highlighting": "string", + "loc": { + "start": { + "line": 72, + "column": 8, + "index": 2133 + }, + "end": { + "line": 76, + "column": 9, + "index": 2277 + } + }, + "filepath": "src/components/pagination/pagination_button.tsx" + }, { "token": "euiPagination.pageOfTotalCompressed", "defString": "{page} of {total}", @@ -1151,6 +1115,96 @@ }, "filepath": "src/components/pagination/pagination.tsx" }, + { + "token": "euiPopover.screenReaderAnnouncement", + "defString": "You are in a dialog. Press Escape, or tap/click outside the dialog to close.", + "highlighting": "string", + "loc": { + "start": { + "line": 762, + "column": 16, + "index": 22865 + }, + "end": { + "line": 765, + "column": 18, + "index": 23059 + } + }, + "filepath": "src/components/popover/popover.tsx" + }, + { + "token": "euiModal.screenReaderModalDialog", + "defString": "You are in a modal dialog. Press Escape or tap/click outside the dialog on the shadowed overlay to close.", + "highlighting": "string", + "loc": { + "start": { + "line": 133, + "column": 8, + "index": 4057 + }, + "end": { + "line": 136, + "column": 10, + "index": 4253 + } + }, + "filepath": "src/components/modal/modal.tsx" + }, + { + "token": "euiModal.closeModal", + "defString": "Closes this modal window", + "highlighting": "string", + "loc": { + "start": { + "line": 163, + "column": 10, + "index": 4871 + }, + "end": { + "line": 166, + "column": 11, + "index": 4978 + } + }, + "filepath": "src/components/modal/modal.tsx" + }, + { + "token": "euiMark.highlightStart", + "defString": "highlight start", + "highlighting": "string", + "loc": { + "start": { + "line": 44, + "column": 25, + "index": 1289 + }, + "end": { + "line": 47, + "column": 3, + "index": 1356 + } + }, + "filepath": "src/components/mark/mark.tsx" + }, + { + "token": "euiMark.highlightEnd", + "defString": "highlight end", + "highlighting": "string", + "loc": { + "start": { + "line": 48, + "column": 23, + "index": 1381 + }, + "end": { + "line": 48, + "column": 74, + "index": 1432 + } + }, + "filepath": "src/components/mark/mark.tsx" + }, { "token": "euiMarkdownEditorToolbar.editor", "defString": "Editor", @@ -1421,42 +1475,6 @@ }, "filepath": "src/components/markdown_editor/markdown_editor_footer.tsx" }, - { - "token": "euiModal.screenReaderModalDialog", - "defString": "You are in a modal dialog. Press Escape or tap/click outside the dialog on the shadowed overlay to close.", - "highlighting": "string", - "loc": { - "start": { - "line": 133, - "column": 8, - "index": 4057 - }, - "end": { - "line": 136, - "column": 10, - "index": 4253 - } - }, - "filepath": "src/components/modal/modal.tsx" - }, - { - "token": "euiModal.closeModal", - "defString": "Closes this modal window", - "highlighting": "string", - "loc": { - "start": { - "line": 163, - "column": 10, - "index": 4871 - }, - "end": { - "line": 166, - "column": 11, - "index": 4978 - } - }, - "filepath": "src/components/modal/modal.tsx" - }, { "token": "euiLoadingStrings.ariaLabel", "defString": "Loading", @@ -1476,62 +1494,26 @@ "filepath": "src/components/loading/_loading_strings.tsx" }, { - "token": "euiMark.highlightStart", - "defString": "highlight start", + "token": "euiExternalLinkIcon.newTarget.screenReaderOnlyText", + "defString": "(external, opens in a new tab or window)", "highlighting": "string", "loc": { "start": { - "line": 44, - "column": 25, - "index": 1289 + "line": 58, + "column": 12, + "index": 1806 }, "end": { - "line": 47, - "column": 3, - "index": 1356 + "line": 61, + "column": 14, + "index": 1967 } }, - "filepath": "src/components/mark/mark.tsx" + "filepath": "src/components/link/external_link_icon.tsx" }, { - "token": "euiMark.highlightEnd", - "defString": "highlight end", - "highlighting": "string", - "loc": { - "start": { - "line": 48, - "column": 23, - "index": 1381 - }, - "end": { - "line": 48, - "column": 74, - "index": 1432 - } - }, - "filepath": "src/components/mark/mark.tsx" - }, - { - "token": "euiExternalLinkIcon.newTarget.screenReaderOnlyText", - "defString": "(external, opens in a new tab or window)", - "highlighting": "string", - "loc": { - "start": { - "line": 58, - "column": 12, - "index": 1806 - }, - "end": { - "line": 61, - "column": 14, - "index": 1967 - } - }, - "filepath": "src/components/link/external_link_icon.tsx" - }, - { - "token": "euiExternalLinkIcon.externalTarget.screenReaderOnlyText", - "defString": "(external)", + "token": "euiExternalLinkIcon.externalTarget.screenReaderOnlyText", + "defString": "(external)", "highlighting": "string", "loc": { "start": { @@ -1655,24 +1637,6 @@ }, "filepath": "src/components/image/image_button.tsx" }, - { - "token": "euiForm.addressFormErrors", - "defString": "Please address the highlighted errors.", - "highlighting": "string", - "loc": { - "start": { - "line": 98, - "column": 8, - "index": 2588 - }, - "end": { - "line": 101, - "column": 9, - "index": 2709 - } - }, - "filepath": "src/components/form/form.tsx" - }, { "token": "euiFlyoutMenu.back", "defString": "Back", @@ -1781,6 +1745,24 @@ }, "filepath": "src/components/flyout/_flyout_close_button.tsx" }, + { + "token": "euiForm.addressFormErrors", + "defString": "Please address the highlighted errors.", + "highlighting": "string", + "loc": { + "start": { + "line": 98, + "column": 8, + "index": 2588 + }, + "end": { + "line": 101, + "column": 9, + "index": 2709 + } + }, + "filepath": "src/components/form/form.tsx" + }, { "token": "euiFilterButton.filterBadgeActiveAriaLabel", "defString": "{count} active filters", @@ -2195,24 +2177,6 @@ }, "filepath": "src/components/color_picker/color_picker.tsx" }, - { - "token": "euiComboBox.listboxAriaLabel", - "defString": "Choose from the following options", - "highlighting": "string", - "loc": { - "start": { - "line": 842, - "column": 8, - "index": 24681 - }, - "end": { - "line": 845, - "column": 9, - "index": 24800 - } - }, - "filepath": "src/components/combo_box/combo_box.tsx" - }, { "token": "euiCollapsibleNavBeta.ariaLabel", "defString": "Site menu", @@ -2340,76 +2304,40 @@ "filepath": "src/components/code/code_block.tsx" }, { - "token": "euiCallOut.dismissAriaLabel", - "defString": "Dismiss this callout", + "token": "euiComboBox.listboxAriaLabel", + "defString": "Choose from the following options", "highlighting": "string", "loc": { "start": { - "line": 114, + "line": 842, "column": 8, - "index": 3269 + "index": 24681 }, "end": { - "line": 117, + "line": 845, "column": 9, - "index": 3374 + "index": 24800 } }, - "filepath": "src/components/call_out/call_out.tsx" + "filepath": "src/components/combo_box/combo_box.tsx" }, { - "token": "euiBottomBar.screenReaderHeading", - "defString": "Page level controls", + "token": "euiCallOut.dismissAriaLabel", + "defString": "Dismiss this callout", "highlighting": "string", "loc": { "start": { - "line": 192, + "line": 171, "column": 8, - "index": 5428 + "index": 5546 }, "end": { - "line": 195, + "line": 174, "column": 9, - "index": 5537 - } - }, - "filepath": "src/components/bottom_bar/bottom_bar.tsx" - }, - { - "token": "euiBottomBar.customScreenReaderAnnouncement", - "defString": "There is a new region landmark called {landmarkHeading} with page level controls at the end of the document.", - "highlighting": "string", - "loc": { - "start": { - "line": 222, - "column": 14, - "index": 6478 - }, - "end": { - "line": 226, - "column": 16, - "index": 6751 - } - }, - "filepath": "src/components/bottom_bar/bottom_bar.tsx" - }, - { - "token": "euiBottomBar.screenReaderAnnouncement", - "defString": "There is a new region landmark with page level controls at the end of the document.", - "highlighting": "string", - "loc": { - "start": { - "line": 228, - "column": 14, - "index": 6784 - }, - "end": { - "line": 231, - "column": 16, - "index": 6981 + "index": 5651 } }, - "filepath": "src/components/bottom_bar/bottom_bar.tsx" + "filepath": "src/components/call_out/call_out.tsx" }, { "token": "euiCollapsedItemActions.allActionsTooltip", @@ -2627,6 +2555,60 @@ }, "filepath": "src/components/basic_table/basic_table.tsx" }, + { + "token": "euiBottomBar.screenReaderHeading", + "defString": "Page level controls", + "highlighting": "string", + "loc": { + "start": { + "line": 192, + "column": 8, + "index": 5428 + }, + "end": { + "line": 195, + "column": 9, + "index": 5537 + } + }, + "filepath": "src/components/bottom_bar/bottom_bar.tsx" + }, + { + "token": "euiBottomBar.customScreenReaderAnnouncement", + "defString": "There is a new region landmark called {landmarkHeading} with page level controls at the end of the document.", + "highlighting": "string", + "loc": { + "start": { + "line": 222, + "column": 14, + "index": 6478 + }, + "end": { + "line": 226, + "column": 16, + "index": 6751 + } + }, + "filepath": "src/components/bottom_bar/bottom_bar.tsx" + }, + { + "token": "euiBottomBar.screenReaderAnnouncement", + "defString": "There is a new region landmark with page level controls at the end of the document.", + "highlighting": "string", + "loc": { + "start": { + "line": 228, + "column": 14, + "index": 6784 + }, + "end": { + "line": 231, + "column": 16, + "index": 6981 + } + }, + "filepath": "src/components/bottom_bar/bottom_bar.tsx" + }, { "token": "euiBreadcrumbs.nav.ariaLabel", "defString": "Breadcrumbs", @@ -2681,6 +2663,24 @@ }, "filepath": "src/components/breadcrumbs/_breadcrumb_content.tsx" }, + { + "token": "euiTableSortMobile.sorting", + "defString": "Sorting", + "highlighting": "string", + "loc": { + "start": { + "line": 76, + "column": 8, + "index": 1971 + }, + "end": { + "line": 76, + "column": 72, + "index": 2035 + } + }, + "filepath": "src/components/table/mobile/table_sort_mobile.tsx" + }, { "token": "euiTablePagination.allRows", "defString": "Showing all rows", @@ -2753,24 +2753,6 @@ }, "filepath": "src/components/table/table_pagination/table_pagination.tsx" }, - { - "token": "euiTableSortMobile.sorting", - "defString": "Sorting", - "highlighting": "string", - "loc": { - "start": { - "line": 76, - "column": 8, - "index": 1971 - }, - "end": { - "line": 76, - "column": 72, - "index": 2035 - } - }, - "filepath": "src/components/table/mobile/table_sort_mobile.tsx" - }, { "token": "euiFieldValueSelectionFilter.buttonLabelHint", "defString": "Selection", @@ -3059,6 +3041,24 @@ }, "filepath": "src/components/list_group/pinnable_list_group/pinnable_list_group.tsx" }, + { + "token": "euiFlyoutManaged.defaultTitle", + "defString": "Unknown Flyout", + "highlighting": "string", + "loc": { + "start": { + "line": 169, + "column": 25, + "index": 5638 + }, + "end": { + "line": 172, + "column": 5, + "index": 5717 + } + }, + "filepath": "src/components/flyout/manager/flyout_managed.tsx" + }, { "token": "euiSuperSelect.screenReaderAnnouncement", "defString": "You are in a form selector and must select a single option.\n Use the Up and Down arrow keys to navigate or Escape to close.", @@ -3293,24 +3293,6 @@ }, "filepath": "src/components/form/field_password/field_password.tsx" }, - { - "token": "euiFlyoutManaged.defaultTitle", - "defString": "Unknown Flyout", - "highlighting": "string", - "loc": { - "start": { - "line": 169, - "column": 25, - "index": 5638 - }, - "end": { - "line": 172, - "column": 5, - "index": 5717 - } - }, - "filepath": "src/components/flyout/manager/flyout_managed.tsx" - }, { "token": "euiHeaderLinks.appNavigation", "defString": "App menu", @@ -3528,1066 +3510,1066 @@ "filepath": "src/components/datagrid/utils/data_grid_schema.tsx" }, { - "token": "euiKeyboardShortcuts.title", - "defString": "Keyboard shortcuts", + "token": "euiDataGridPagination.detailedPaginationLabel", + "defString": "Pagination for preceding grid: {label}", "highlighting": "string", "loc": { "start": { - "line": 26, - "column": 16, - "index": 1033 + "line": 51, + "column": 34, + "index": 1785 }, "end": { - "line": 26, - "column": 78, - "index": 1095 + "line": 55, + "column": 3, + "index": 1930 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/pagination/data_grid_pagination.tsx" }, { - "token": "euiKeyboardShortcuts.upArrowTitle", - "defString": "Up arrow", + "token": "euiDataGridPagination.paginationLabel", + "defString": "Pagination for preceding grid", "highlighting": "string", "loc": { "start": { - "line": 70, - "column": 20, - "index": 2407 + "line": 56, + "column": 26, + "index": 1958 }, "end": { - "line": 73, - "column": 22, - "index": 2543 + "line": 59, + "column": 3, + "index": 2054 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/pagination/data_grid_pagination.tsx" }, { - "token": "euiKeyboardShortcuts.upArrowDescription", - "defString": "Move one cell up", + "token": "euiFullscreenSelector.fullscreenButton", + "defString": "Enter fullscreen", "highlighting": "string", "loc": { "start": { - "line": 77, - "column": 18, - "index": 2637 + "line": 46, + "column": 53, + "index": 1444 }, "end": { - "line": 80, - "column": 20, - "index": 2781 + "line": 52, + "column": 3, + "index": 1618 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/fullscreen_selector.tsx" }, { - "token": "euiKeyboardShortcuts.downArrowTitle", - "defString": "Down arrow", + "token": "euiFullscreenSelector.fullscreenButtonActive", + "defString": "Exit fullscreen", "highlighting": "string", "loc": { "start": { - "line": 86, - "column": 20, - "index": 2903 + "line": 46, + "column": 53, + "index": 1444 }, "end": { - "line": 89, - "column": 22, - "index": 3043 + "line": 52, + "column": 3, + "index": 1618 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/fullscreen_selector.tsx" }, { - "token": "euiKeyboardShortcuts.downArrowDescription", - "defString": "Move one cell down", + "token": "euiDisplaySelector.densityLabel", + "defString": "Density", "highlighting": "string", "loc": { "start": { - "line": 93, - "column": 18, - "index": 3137 + "line": 96, + "column": 4, + "index": 2610 }, "end": { - "line": 96, - "column": 20, - "index": 3285 + "line": 104, + "column": 5, + "index": 2883 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/display_selector.tsx" }, { - "token": "euiKeyboardShortcuts.rightArrowTitle", - "defString": "Right arrow", + "token": "euiDisplaySelector.labelCompact", + "defString": "Compact", "highlighting": "string", "loc": { "start": { - "line": 102, - "column": 20, - "index": 3407 + "line": 96, + "column": 4, + "index": 2610 }, "end": { - "line": 105, - "column": 22, - "index": 3549 + "line": 104, + "column": 5, + "index": 2883 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/display_selector.tsx" }, { - "token": "euiKeyboardShortcuts.rightArrowDescription", - "defString": "Move one cell right", + "token": "euiDisplaySelector.labelNormal", + "defString": "Normal", "highlighting": "string", "loc": { "start": { - "line": 109, - "column": 18, - "index": 3643 + "line": 96, + "column": 4, + "index": 2610 }, "end": { - "line": 112, - "column": 20, - "index": 3793 + "line": 104, + "column": 5, + "index": 2883 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/display_selector.tsx" }, { - "token": "euiKeyboardShortcuts.leftArrowTitle", - "defString": "Left arrow", + "token": "euiDisplaySelector.labelExpanded", + "defString": "Expanded", "highlighting": "string", "loc": { "start": { - "line": 118, - "column": 20, - "index": 3915 + "line": 96, + "column": 4, + "index": 2610 }, "end": { - "line": 121, - "column": 22, - "index": 4055 + "line": 104, + "column": 5, + "index": 2883 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/display_selector.tsx" }, { - "token": "euiKeyboardShortcuts.leftArrowDescription", - "defString": "Move one cell left", + "token": "euiDisplaySelector.rowHeightLabel", + "defString": "Lines per row", "highlighting": "string", "loc": { "start": { - "line": 125, - "column": 18, - "index": 4149 + "line": 227, + "column": 4, + "index": 6476 }, "end": { - "line": 128, - "column": 20, - "index": 4297 + "line": 235, + "column": 5, + "index": 6741 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/display_selector.tsx" }, { - "token": "euiKeyboardShortcuts.homeTitle", - "defString": "Home", + "token": "euiDisplaySelector.labelAuto", + "defString": "Auto", "highlighting": "string", "loc": { "start": { - "line": 134, - "column": 20, - "index": 4419 + "line": 227, + "column": 4, + "index": 6476 }, "end": { - "line": 137, - "column": 22, - "index": 4548 + "line": 235, + "column": 5, + "index": 6741 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/display_selector.tsx" }, { - "token": "euiKeyboardShortcuts.homeDescription", - "defString": "Move to the first cell of the current row", + "token": "euiDisplaySelector.labelStatic", + "defString": "Static", "highlighting": "string", "loc": { "start": { - "line": 141, - "column": 18, - "index": 4642 + "line": 227, + "column": 4, + "index": 6476 }, "end": { - "line": 144, - "column": 20, - "index": 4808 + "line": 235, + "column": 5, + "index": 6741 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/display_selector.tsx" }, { - "token": "euiKeyboardShortcuts.endTitle", - "defString": "End", + "token": "euiDisplaySelector.labelMax", + "defString": "Max", "highlighting": "string", "loc": { "start": { - "line": 150, - "column": 20, - "index": 4930 + "line": 227, + "column": 4, + "index": 6476 }, "end": { - "line": 153, - "column": 22, - "index": 5057 + "line": 235, + "column": 5, + "index": 6741 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/display_selector.tsx" }, { - "token": "euiKeyboardShortcuts.endDescription", - "defString": "Move to the last cell of the current row", + "token": "euiDisplaySelector.buttonText", + "defString": "Display options", "highlighting": "string", "loc": { "start": { - "line": 157, - "column": 18, - "index": 5151 + "line": 393, + "column": 22, + "index": 11825 }, "end": { - "line": 160, - "column": 20, - "index": 5315 + "line": 396, + "column": 3, + "index": 11899 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/display_selector.tsx" }, { - "token": "euiKeyboardShortcuts.ctrl", - "defString": "Ctrl", + "token": "euiDisplaySelector.resetButtonText", + "defString": "Reset to default", "highlighting": "string", "loc": { "start": { - "line": 167, - "column": 22, - "index": 5462 + "line": 472, + "column": 27, + "index": 14000 }, "end": { - "line": 170, - "column": 24, - "index": 5592 + "line": 475, + "column": 3, + "index": 14080 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/display_selector.tsx" }, { - "token": "euiKeyboardShortcuts.homeTitle", - "defString": "Home", + "token": "euiColumnSortingDraggable.defaultSortAsc", + "defString": "A-Z", "highlighting": "string", "loc": { "start": { - "line": 173, - "column": 22, - "index": 5673 + "line": 27, + "column": 2, + "index": 1166 }, "end": { - "line": 176, - "column": 24, - "index": 5808 + "line": 27, + "column": 76, + "index": 1240 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/column_sorting_draggable.tsx" }, { - "token": "euiKeyboardShortcuts.ctrlHomeDescription", - "defString": "Move to the first cell of the current page", + "token": "euiColumnSortingDraggable.defaultSortDesc", + "defString": "Z-A", "highlighting": "string", "loc": { "start": { - "line": 181, - "column": 18, - "index": 5926 + "line": 30, + "column": 2, + "index": 1284 }, "end": { - "line": 184, - "column": 20, - "index": 6097 + "line": 30, + "column": 77, + "index": 1359 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/column_sorting_draggable.tsx" }, { - "token": "euiKeyboardShortcuts.ctrl", - "defString": "Ctrl", + "token": "euiColumnSortingDraggable.dragHandleAriaLabel", + "defString": "Drag handle", "highlighting": "string", "loc": { "start": { - "line": 191, - "column": 22, - "index": 6244 + "line": 71, + "column": 30, + "index": 2323 }, "end": { - "line": 194, - "column": 24, - "index": 6374 + "line": 74, + "column": 3, + "index": 2409 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/column_sorting_draggable.tsx" }, { - "token": "euiKeyboardShortcuts.endTitle", - "defString": "End", + "token": "euiColumnSortingDraggable.activeSortLabel", + "defString": "{display} is sorting this data grid", "highlighting": "string", "loc": { "start": { - "line": 197, - "column": 22, - "index": 6455 + "line": 120, + "column": 14, + "index": 3759 }, "end": { - "line": 200, - "column": 24, - "index": 6588 + "line": 124, + "column": 15, + "index": 3948 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/column_sorting_draggable.tsx" }, { - "token": "euiKeyboardShortcuts.ctrlEndDescription", - "defString": "Move to the last cell of the current page", + "token": "euiColumnSortingDraggable.removeSortLabel", + "defString": "Remove {display} from data grid sort", "highlighting": "string", "loc": { "start": { - "line": 205, - "column": 18, - "index": 6706 + "line": 130, + "column": 12, + "index": 4136 }, "end": { - "line": 208, - "column": 20, - "index": 6875 + "line": 134, + "column": 13, + "index": 4318 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/column_sorting_draggable.tsx" }, { - "token": "euiKeyboardShortcuts.pageUpTitle", - "defString": "Page Up", + "token": "euiColumnSortingDraggable.toggleLegend", + "defString": "Select sorting method for {display}", "highlighting": "string", "loc": { "start": { - "line": 214, - "column": 20, - "index": 6997 + "line": 178, + "column": 12, + "index": 5821 }, "end": { - "line": 217, - "column": 22, - "index": 7131 + "line": 182, + "column": 13, + "index": 5999 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/column_sorting_draggable.tsx" }, { - "token": "euiKeyboardShortcuts.pageUpDescription", - "defString": "Go to the last row of the previous page", + "token": "euiColumnSorting.button", + "defString": "Sort fields", "highlighting": "string", "loc": { "start": { - "line": 221, - "column": 18, - "index": 7225 + "line": 66, + "column": 30, + "index": 2120 }, "end": { - "line": 224, - "column": 20, - "index": 7391 + "line": 69, + "column": 5, + "index": 2190 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/column_sorting.tsx" }, { - "token": "euiKeyboardShortcuts.pageDownTitle", - "defString": "Page Down", + "token": "euiColumnSorting.sortFieldAriaLabel", + "defString": "Sort by: ", "highlighting": "string", "loc": { "start": { - "line": 230, - "column": 20, - "index": 7513 + "line": 70, + "column": 31, + "index": 2223 }, "end": { - "line": 233, - "column": 22, - "index": 7651 + "line": 73, + "column": 5, + "index": 2303 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/column_sorting.tsx" }, { - "token": "euiKeyboardShortcuts.pageDownDescription", - "defString": "Go to the first row of the next page", + "token": "euiColumnSorting.emptySorting", + "defString": "Currently no fields are sorted", "highlighting": "string", "loc": { "start": { - "line": 237, - "column": 18, - "index": 7745 + "line": 220, + "column": 14, + "index": 6937 }, "end": { - "line": 240, - "column": 20, - "index": 7910 + "line": 223, + "column": 16, + "index": 7073 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/column_sorting.tsx" }, { - "token": "euiKeyboardShortcuts.enterTitle", - "defString": "Enter", + "token": "euiColumnSorting.pickFields", + "defString": "Pick fields to sort by", "highlighting": "string", "loc": { "start": { - "line": 246, - "column": 20, - "index": 8032 + "line": 253, + "column": 24, + "index": 8304 }, "end": { - "line": 249, - "column": 22, - "index": 8163 + "line": 256, + "column": 26, + "index": 8460 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/column_sorting.tsx" }, { - "token": "euiKeyboardShortcuts.enterDescription", - "defString": "Open cell details and actions", + "token": "euiColumnSorting.clearAll", + "defString": "Clear sorting", "highlighting": "string", "loc": { "start": { - "line": 253, - "column": 18, - "index": 8257 + "line": 328, + "column": 20, + "index": 11814 }, "end": { - "line": 256, - "column": 20, - "index": 8412 + "line": 331, + "column": 22, + "index": 11947 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/column_sorting.tsx" }, { - "token": "euiKeyboardShortcuts.escapeTitle", - "defString": "Escape", + "token": "euiDataGridToolbarControl.badgeAriaLabel", + "defString": "Active: {count}", "highlighting": "string", "loc": { "start": { - "line": 262, - "column": 20, - "index": 8534 + "line": 31, + "column": 25, + "index": 1211 }, "end": { - "line": 265, - "column": 22, - "index": 8667 + "line": 40, + "column": 3, + "index": 1441 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/data_grid_toolbar_control.tsx" }, { - "token": "euiKeyboardShortcuts.escapeDescription", - "defString": "Close cell details and actions", + "token": "euiColumnSelector.dragHandleAriaLabel", + "defString": "drag handle", "highlighting": "string", "loc": { "start": { - "line": 269, - "column": 18, - "index": 8761 + "line": 164, + "column": 30, + "index": 5119 }, "end": { - "line": 272, - "column": 20, - "index": 8918 + "line": 167, + "column": 3, + "index": 5197 } }, - "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" + "filepath": "src/components/datagrid/controls/column_selector.tsx" }, { - "token": "euiFullscreenSelector.fullscreenButton", - "defString": "Enter fullscreen", + "token": "euiColumnSelector.button", + "defString": "Columns", "highlighting": "string", "loc": { "start": { - "line": 46, - "column": 53, - "index": 1444 + "line": 203, + "column": 12, + "index": 6382 }, "end": { - "line": 52, - "column": 3, - "index": 1618 + "line": 203, + "column": 74, + "index": 6444 } }, - "filepath": "src/components/datagrid/controls/fullscreen_selector.tsx" + "filepath": "src/components/datagrid/controls/column_selector.tsx" }, { - "token": "euiFullscreenSelector.fullscreenButtonActive", - "defString": "Exit fullscreen", + "token": "euiColumnSelector.search", + "defString": "Search", "highlighting": "string", "loc": { "start": { - "line": 46, - "column": 53, - "index": 1444 + "line": 209, + "column": 12, + "index": 6590 }, "end": { - "line": 52, - "column": 3, - "index": 1618 + "line": 215, + "column": 13, + "index": 6802 } }, - "filepath": "src/components/datagrid/controls/fullscreen_selector.tsx" + "filepath": "src/components/datagrid/controls/column_selector.tsx" }, { - "token": "euiDisplaySelector.densityLabel", - "defString": "Density", + "token": "euiColumnSelector.searchcolumns", + "defString": "Search columns", "highlighting": "string", "loc": { "start": { - "line": 96, - "column": 4, - "index": 2610 + "line": 209, + "column": 12, + "index": 6590 }, "end": { - "line": 104, - "column": 5, - "index": 2883 + "line": 215, + "column": 13, + "index": 6802 } }, - "filepath": "src/components/datagrid/controls/display_selector.tsx" + "filepath": "src/components/datagrid/controls/column_selector.tsx" }, { - "token": "euiDisplaySelector.labelCompact", - "defString": "Compact", + "token": "euiColumnSelector.selectAll", + "defString": "Show all", "highlighting": "string", "loc": { "start": { - "line": 96, - "column": 4, - "index": 2610 + "line": 340, + "column": 18, + "index": 12118 }, "end": { - "line": 104, - "column": 5, - "index": 2883 + "line": 343, + "column": 20, + "index": 12242 } }, - "filepath": "src/components/datagrid/controls/display_selector.tsx" + "filepath": "src/components/datagrid/controls/column_selector.tsx" }, { - "token": "euiDisplaySelector.labelNormal", - "defString": "Normal", + "token": "euiColumnSelector.hideAll", + "defString": "Hide all", "highlighting": "string", "loc": { "start": { - "line": 96, - "column": 4, - "index": 2610 + "line": 353, + "column": 18, + "index": 12602 }, "end": { - "line": 104, - "column": 5, - "index": 2883 + "line": 356, + "column": 20, + "index": 12724 } }, - "filepath": "src/components/datagrid/controls/display_selector.tsx" + "filepath": "src/components/datagrid/controls/column_selector.tsx" }, { - "token": "euiDisplaySelector.labelExpanded", - "defString": "Expanded", + "token": "euiKeyboardShortcuts.title", + "defString": "Keyboard shortcuts", "highlighting": "string", "loc": { "start": { - "line": 96, - "column": 4, - "index": 2610 + "line": 26, + "column": 16, + "index": 1033 }, "end": { - "line": 104, - "column": 5, - "index": 2883 + "line": 26, + "column": 78, + "index": 1095 } }, - "filepath": "src/components/datagrid/controls/display_selector.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiDisplaySelector.rowHeightLabel", - "defString": "Lines per row", + "token": "euiKeyboardShortcuts.upArrowTitle", + "defString": "Up arrow", "highlighting": "string", "loc": { "start": { - "line": 227, - "column": 4, - "index": 6476 + "line": 70, + "column": 20, + "index": 2407 }, "end": { - "line": 235, - "column": 5, - "index": 6741 + "line": 73, + "column": 22, + "index": 2543 } }, - "filepath": "src/components/datagrid/controls/display_selector.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiDisplaySelector.labelAuto", - "defString": "Auto", + "token": "euiKeyboardShortcuts.upArrowDescription", + "defString": "Move one cell up", "highlighting": "string", "loc": { "start": { - "line": 227, - "column": 4, - "index": 6476 + "line": 77, + "column": 18, + "index": 2637 }, "end": { - "line": 235, - "column": 5, - "index": 6741 + "line": 80, + "column": 20, + "index": 2781 } }, - "filepath": "src/components/datagrid/controls/display_selector.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiDisplaySelector.labelStatic", - "defString": "Static", + "token": "euiKeyboardShortcuts.downArrowTitle", + "defString": "Down arrow", "highlighting": "string", "loc": { "start": { - "line": 227, - "column": 4, - "index": 6476 + "line": 86, + "column": 20, + "index": 2903 }, "end": { - "line": 235, - "column": 5, - "index": 6741 + "line": 89, + "column": 22, + "index": 3043 } }, - "filepath": "src/components/datagrid/controls/display_selector.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiDisplaySelector.labelMax", - "defString": "Max", + "token": "euiKeyboardShortcuts.downArrowDescription", + "defString": "Move one cell down", "highlighting": "string", "loc": { "start": { - "line": 227, - "column": 4, - "index": 6476 + "line": 93, + "column": 18, + "index": 3137 }, "end": { - "line": 235, - "column": 5, - "index": 6741 + "line": 96, + "column": 20, + "index": 3285 } }, - "filepath": "src/components/datagrid/controls/display_selector.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiDisplaySelector.buttonText", - "defString": "Display options", + "token": "euiKeyboardShortcuts.rightArrowTitle", + "defString": "Right arrow", "highlighting": "string", "loc": { "start": { - "line": 393, - "column": 22, - "index": 11825 + "line": 102, + "column": 20, + "index": 3407 }, "end": { - "line": 396, - "column": 3, - "index": 11899 + "line": 105, + "column": 22, + "index": 3549 } }, - "filepath": "src/components/datagrid/controls/display_selector.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiDisplaySelector.resetButtonText", - "defString": "Reset to default", + "token": "euiKeyboardShortcuts.rightArrowDescription", + "defString": "Move one cell right", "highlighting": "string", "loc": { "start": { - "line": 472, - "column": 27, - "index": 14000 + "line": 109, + "column": 18, + "index": 3643 }, "end": { - "line": 475, - "column": 3, - "index": 14080 + "line": 112, + "column": 20, + "index": 3793 } }, - "filepath": "src/components/datagrid/controls/display_selector.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiDataGridToolbarControl.badgeAriaLabel", - "defString": "Active: {count}", + "token": "euiKeyboardShortcuts.leftArrowTitle", + "defString": "Left arrow", "highlighting": "string", "loc": { "start": { - "line": 31, - "column": 25, - "index": 1211 + "line": 118, + "column": 20, + "index": 3915 }, "end": { - "line": 40, - "column": 3, - "index": 1441 + "line": 121, + "column": 22, + "index": 4055 } }, - "filepath": "src/components/datagrid/controls/data_grid_toolbar_control.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSortingDraggable.defaultSortAsc", - "defString": "A-Z", + "token": "euiKeyboardShortcuts.leftArrowDescription", + "defString": "Move one cell left", "highlighting": "string", "loc": { "start": { - "line": 27, - "column": 2, - "index": 1166 + "line": 125, + "column": 18, + "index": 4149 }, "end": { - "line": 27, - "column": 76, - "index": 1240 + "line": 128, + "column": 20, + "index": 4297 } }, - "filepath": "src/components/datagrid/controls/column_sorting_draggable.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSortingDraggable.defaultSortDesc", - "defString": "Z-A", + "token": "euiKeyboardShortcuts.homeTitle", + "defString": "Home", "highlighting": "string", "loc": { "start": { - "line": 30, - "column": 2, - "index": 1284 + "line": 134, + "column": 20, + "index": 4419 }, "end": { - "line": 30, - "column": 77, - "index": 1359 + "line": 137, + "column": 22, + "index": 4548 } }, - "filepath": "src/components/datagrid/controls/column_sorting_draggable.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSortingDraggable.dragHandleAriaLabel", - "defString": "Drag handle", + "token": "euiKeyboardShortcuts.homeDescription", + "defString": "Move to the first cell of the current row", "highlighting": "string", "loc": { "start": { - "line": 71, - "column": 30, - "index": 2323 + "line": 141, + "column": 18, + "index": 4642 }, "end": { - "line": 74, - "column": 3, - "index": 2409 + "line": 144, + "column": 20, + "index": 4808 } }, - "filepath": "src/components/datagrid/controls/column_sorting_draggable.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSortingDraggable.activeSortLabel", - "defString": "{display} is sorting this data grid", + "token": "euiKeyboardShortcuts.endTitle", + "defString": "End", "highlighting": "string", "loc": { "start": { - "line": 120, - "column": 14, - "index": 3759 + "line": 150, + "column": 20, + "index": 4930 }, "end": { - "line": 124, - "column": 15, - "index": 3948 + "line": 153, + "column": 22, + "index": 5057 } }, - "filepath": "src/components/datagrid/controls/column_sorting_draggable.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSortingDraggable.removeSortLabel", - "defString": "Remove {display} from data grid sort", + "token": "euiKeyboardShortcuts.endDescription", + "defString": "Move to the last cell of the current row", "highlighting": "string", "loc": { "start": { - "line": 130, - "column": 12, - "index": 4136 + "line": 157, + "column": 18, + "index": 5151 }, "end": { - "line": 134, - "column": 13, - "index": 4318 + "line": 160, + "column": 20, + "index": 5315 } }, - "filepath": "src/components/datagrid/controls/column_sorting_draggable.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSortingDraggable.toggleLegend", - "defString": "Select sorting method for {display}", + "token": "euiKeyboardShortcuts.ctrl", + "defString": "Ctrl", "highlighting": "string", "loc": { "start": { - "line": 178, - "column": 12, - "index": 5821 + "line": 167, + "column": 22, + "index": 5462 }, "end": { - "line": 182, - "column": 13, - "index": 5999 + "line": 170, + "column": 24, + "index": 5592 } }, - "filepath": "src/components/datagrid/controls/column_sorting_draggable.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSorting.button", - "defString": "Sort fields", + "token": "euiKeyboardShortcuts.homeTitle", + "defString": "Home", "highlighting": "string", "loc": { "start": { - "line": 66, - "column": 30, - "index": 2120 + "line": 173, + "column": 22, + "index": 5673 }, "end": { - "line": 69, - "column": 5, - "index": 2190 + "line": 176, + "column": 24, + "index": 5808 } }, - "filepath": "src/components/datagrid/controls/column_sorting.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSorting.sortFieldAriaLabel", - "defString": "Sort by: ", + "token": "euiKeyboardShortcuts.ctrlHomeDescription", + "defString": "Move to the first cell of the current page", "highlighting": "string", "loc": { "start": { - "line": 70, - "column": 31, - "index": 2223 + "line": 181, + "column": 18, + "index": 5926 }, "end": { - "line": 73, - "column": 5, - "index": 2303 + "line": 184, + "column": 20, + "index": 6097 } }, - "filepath": "src/components/datagrid/controls/column_sorting.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSorting.emptySorting", - "defString": "Currently no fields are sorted", + "token": "euiKeyboardShortcuts.ctrl", + "defString": "Ctrl", "highlighting": "string", "loc": { "start": { - "line": 220, - "column": 14, - "index": 6937 + "line": 191, + "column": 22, + "index": 6244 }, "end": { - "line": 223, - "column": 16, - "index": 7073 + "line": 194, + "column": 24, + "index": 6374 } }, - "filepath": "src/components/datagrid/controls/column_sorting.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSorting.pickFields", - "defString": "Pick fields to sort by", + "token": "euiKeyboardShortcuts.endTitle", + "defString": "End", "highlighting": "string", "loc": { "start": { - "line": 253, - "column": 24, - "index": 8304 + "line": 197, + "column": 22, + "index": 6455 }, "end": { - "line": 256, - "column": 26, - "index": 8460 + "line": 200, + "column": 24, + "index": 6588 } }, - "filepath": "src/components/datagrid/controls/column_sorting.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSorting.clearAll", - "defString": "Clear sorting", + "token": "euiKeyboardShortcuts.ctrlEndDescription", + "defString": "Move to the last cell of the current page", "highlighting": "string", "loc": { "start": { - "line": 328, - "column": 20, - "index": 11814 + "line": 205, + "column": 18, + "index": 6706 }, "end": { - "line": 331, - "column": 22, - "index": 11947 + "line": 208, + "column": 20, + "index": 6875 } }, - "filepath": "src/components/datagrid/controls/column_sorting.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSelector.dragHandleAriaLabel", - "defString": "drag handle", + "token": "euiKeyboardShortcuts.pageUpTitle", + "defString": "Page Up", "highlighting": "string", "loc": { "start": { - "line": 164, - "column": 30, - "index": 5119 + "line": 214, + "column": 20, + "index": 6997 }, "end": { - "line": 167, - "column": 3, - "index": 5197 + "line": 217, + "column": 22, + "index": 7131 } }, - "filepath": "src/components/datagrid/controls/column_selector.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSelector.button", - "defString": "Columns", + "token": "euiKeyboardShortcuts.pageUpDescription", + "defString": "Go to the last row of the previous page", "highlighting": "string", "loc": { "start": { - "line": 203, - "column": 12, - "index": 6382 + "line": 221, + "column": 18, + "index": 7225 }, "end": { - "line": 203, - "column": 74, - "index": 6444 + "line": 224, + "column": 20, + "index": 7391 } }, - "filepath": "src/components/datagrid/controls/column_selector.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSelector.search", - "defString": "Search", + "token": "euiKeyboardShortcuts.pageDownTitle", + "defString": "Page Down", "highlighting": "string", "loc": { "start": { - "line": 209, - "column": 12, - "index": 6590 + "line": 230, + "column": 20, + "index": 7513 }, "end": { - "line": 215, - "column": 13, - "index": 6802 + "line": 233, + "column": 22, + "index": 7651 } }, - "filepath": "src/components/datagrid/controls/column_selector.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSelector.searchcolumns", - "defString": "Search columns", + "token": "euiKeyboardShortcuts.pageDownDescription", + "defString": "Go to the first row of the next page", "highlighting": "string", "loc": { "start": { - "line": 209, - "column": 12, - "index": 6590 + "line": 237, + "column": 18, + "index": 7745 }, "end": { - "line": 215, - "column": 13, - "index": 6802 + "line": 240, + "column": 20, + "index": 7910 } }, - "filepath": "src/components/datagrid/controls/column_selector.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSelector.selectAll", - "defString": "Show all", + "token": "euiKeyboardShortcuts.enterTitle", + "defString": "Enter", "highlighting": "string", "loc": { "start": { - "line": 340, - "column": 18, - "index": 12118 + "line": 246, + "column": 20, + "index": 8032 }, "end": { - "line": 343, - "column": 20, - "index": 12242 + "line": 249, + "column": 22, + "index": 8163 } }, - "filepath": "src/components/datagrid/controls/column_selector.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiColumnSelector.hideAll", - "defString": "Hide all", + "token": "euiKeyboardShortcuts.enterDescription", + "defString": "Open cell details and actions", "highlighting": "string", "loc": { "start": { - "line": 353, + "line": 253, "column": 18, - "index": 12602 + "index": 8257 }, "end": { - "line": 356, + "line": 256, "column": 20, - "index": 12724 + "index": 8412 } }, - "filepath": "src/components/datagrid/controls/column_selector.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiDataGridPagination.detailedPaginationLabel", - "defString": "Pagination for preceding grid: {label}", + "token": "euiKeyboardShortcuts.escapeTitle", + "defString": "Escape", "highlighting": "string", "loc": { "start": { - "line": 51, - "column": 34, - "index": 1785 + "line": 262, + "column": 20, + "index": 8534 }, "end": { - "line": 55, - "column": 3, - "index": 1930 + "line": 265, + "column": 22, + "index": 8667 } }, - "filepath": "src/components/datagrid/pagination/data_grid_pagination.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { - "token": "euiDataGridPagination.paginationLabel", - "defString": "Pagination for preceding grid", + "token": "euiKeyboardShortcuts.escapeDescription", + "defString": "Close cell details and actions", "highlighting": "string", "loc": { "start": { - "line": 56, - "column": 26, - "index": 1958 + "line": 269, + "column": 18, + "index": 8761 }, "end": { - "line": 59, - "column": 3, - "index": 2054 + "line": 272, + "column": 20, + "index": 8918 } }, - "filepath": "src/components/datagrid/pagination/data_grid_pagination.tsx" + "filepath": "src/components/datagrid/controls/keyboard_shortcuts.tsx" }, { "token": "euiRefreshInterval.fullDescriptionOff", @@ -6300,274 +6282,274 @@ "filepath": "src/components/date_picker/super_date_picker/pretty_interval.ts" }, { - "token": "euiComboBoxOptionsList.loadingOptions", - "defString": "Loading options", + "token": "euiCollapsibleNavButton.ariaLabelExpand", + "defString": "Expand navigation", "highlighting": "string", "loc": { "start": { - "line": 444, - "column": 12, - "index": 13054 + "line": 37, + "column": 28, + "index": 1465 }, "end": { - "line": 447, - "column": 14, - "index": 13177 + "line": 40, + "column": 3, + "index": 1551 } }, - "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" + "filepath": "src/components/collapsible_nav_beta/collapsible_nav_button/collapsible_nav_button.tsx" }, { - "token": "euiComboBoxOptionsList.delimiterMessage", - "defString": "Add each item separated by {delimiter}", + "token": "euiCollapsibleNavButton.ariaLabelCollapse", + "defString": "Collapse navigation", "highlighting": "string", "loc": { "start": { - "line": 457, - "column": 16, - "index": 13616 + "line": 41, + "column": 30, + "index": 1583 }, "end": { - "line": 461, - "column": 18, - "index": 13847 + "line": 44, + "column": 3, + "index": 1673 } }, - "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" + "filepath": "src/components/collapsible_nav_beta/collapsible_nav_button/collapsible_nav_button.tsx" }, { - "token": "euiComboBoxOptionsList.alreadyAdded", - "defString": "{label} has already been added", + "token": "euiCollapsibleNavButton.ariaLabelOpen", + "defString": "Open navigation", "highlighting": "string", "loc": { "start": { - "line": 476, - "column": 16, - "index": 14276 + "line": 45, + "column": 26, + "index": 1701 }, "end": { - "line": 482, - "column": 18, - "index": 14549 + "line": 48, + "column": 3, + "index": 1783 } }, - "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" + "filepath": "src/components/collapsible_nav_beta/collapsible_nav_button/collapsible_nav_button.tsx" }, { - "token": "euiComboBoxOptionsList.createCustomOption", - "defString": "Add {searchValue} as a custom option", + "token": "euiCollapsibleNavButton.ariaLabelClose", + "defString": "Close navigation", "highlighting": "string", "loc": { "start": { - "line": 511, - "column": 20, - "index": 15540 + "line": 49, + "column": 27, + "index": 1812 }, "end": { - "line": 517, - "column": 22, - "index": 15838 + "line": 52, + "column": 3, + "index": 1896 } }, - "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" + "filepath": "src/components/collapsible_nav_beta/collapsible_nav_button/collapsible_nav_button.tsx" }, { - "token": "euiComboBoxOptionsList.noMatchingOptions", - "defString": "{searchValue} doesn't match any options", + "token": "euiCollapsibleNavKibanaSolution.switcherTitle", + "defString": "Solution view", "highlighting": "string", "loc": { "start": { - "line": 528, - "column": 12, - "index": 16042 + "line": 73, + "column": 40, + "index": 2535 }, "end": { - "line": 532, - "column": 14, - "index": 16263 + "line": 76, + "column": 3, + "index": 2623 } }, - "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" + "filepath": "src/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.tsx" }, { - "token": "euiComboBoxOptionsList.noAvailableOptions", - "defString": "There aren't any options available", + "token": "euiCollapsibleNavKibanaSolution.switcherAriaLabel", + "defString": " - click to switch to another solution", "highlighting": "string", "loc": { "start": { - "line": 539, - "column": 10, - "index": 16382 + "line": 77, + "column": 44, + "index": 2669 }, "end": { - "line": 542, - "column": 12, - "index": 16522 + "line": 80, + "column": 3, + "index": 2786 } }, - "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" + "filepath": "src/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.tsx" }, { - "token": "euiComboBoxOptionsList.allOptionsSelected", - "defString": "You've selected all available options", + "token": "euiCollapsibleNavKibanaSolution.groupLabel", + "defString": "Navigate to solution", "highlighting": "string", "loc": { "start": { - "line": 548, - "column": 10, - "index": 16635 + "line": 81, + "column": 37, + "index": 2825 }, "end": { - "line": 551, - "column": 12, - "index": 16778 + "line": 84, + "column": 3, + "index": 2917 } }, - "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" + "filepath": "src/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.tsx" }, { - "token": "euiComboBoxPill.removeSelection", - "defString": "Remove {children} from selection in this group", + "token": "euiComboBoxOptionsList.loadingOptions", + "defString": "Loading options", "highlighting": "string", "loc": { "start": { - "line": 67, - "column": 6, - "index": 2037 + "line": 444, + "column": 12, + "index": 13054 }, "end": { - "line": 71, - "column": 7, - "index": 2196 + "line": 447, + "column": 14, + "index": 13177 } }, - "filepath": "src/components/combo_box/combo_box_input/combo_box_pill.tsx" + "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" }, { - "token": "euiCollapsibleNavKibanaSolution.switcherTitle", - "defString": "Solution view", + "token": "euiComboBoxOptionsList.delimiterMessage", + "defString": "Add each item separated by {delimiter}", "highlighting": "string", "loc": { "start": { - "line": 73, - "column": 40, - "index": 2535 + "line": 457, + "column": 16, + "index": 13616 }, "end": { - "line": 76, - "column": 3, - "index": 2623 + "line": 461, + "column": 18, + "index": 13847 } }, - "filepath": "src/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.tsx" + "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" }, { - "token": "euiCollapsibleNavKibanaSolution.switcherAriaLabel", - "defString": " - click to switch to another solution", + "token": "euiComboBoxOptionsList.alreadyAdded", + "defString": "{label} has already been added", "highlighting": "string", "loc": { "start": { - "line": 77, - "column": 44, - "index": 2669 + "line": 476, + "column": 16, + "index": 14276 }, "end": { - "line": 80, - "column": 3, - "index": 2786 + "line": 482, + "column": 18, + "index": 14549 } }, - "filepath": "src/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.tsx" + "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" }, { - "token": "euiCollapsibleNavKibanaSolution.groupLabel", - "defString": "Navigate to solution", + "token": "euiComboBoxOptionsList.createCustomOption", + "defString": "Add {searchValue} as a custom option", "highlighting": "string", "loc": { - "start": { - "line": 81, - "column": 37, - "index": 2825 + "start": { + "line": 511, + "column": 20, + "index": 15540 }, "end": { - "line": 84, - "column": 3, - "index": 2917 + "line": 517, + "column": 22, + "index": 15838 } }, - "filepath": "src/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.tsx" + "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" }, { - "token": "euiCollapsibleNavButton.ariaLabelExpand", - "defString": "Expand navigation", + "token": "euiComboBoxOptionsList.noMatchingOptions", + "defString": "{searchValue} doesn't match any options", "highlighting": "string", "loc": { "start": { - "line": 37, - "column": 28, - "index": 1465 + "line": 528, + "column": 12, + "index": 16042 }, "end": { - "line": 40, - "column": 3, - "index": 1551 + "line": 532, + "column": 14, + "index": 16263 } }, - "filepath": "src/components/collapsible_nav_beta/collapsible_nav_button/collapsible_nav_button.tsx" + "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" }, { - "token": "euiCollapsibleNavButton.ariaLabelCollapse", - "defString": "Collapse navigation", + "token": "euiComboBoxOptionsList.noAvailableOptions", + "defString": "There aren't any options available", "highlighting": "string", "loc": { "start": { - "line": 41, - "column": 30, - "index": 1583 + "line": 539, + "column": 10, + "index": 16382 }, "end": { - "line": 44, - "column": 3, - "index": 1673 + "line": 542, + "column": 12, + "index": 16522 } }, - "filepath": "src/components/collapsible_nav_beta/collapsible_nav_button/collapsible_nav_button.tsx" + "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" }, { - "token": "euiCollapsibleNavButton.ariaLabelOpen", - "defString": "Open navigation", + "token": "euiComboBoxOptionsList.allOptionsSelected", + "defString": "You've selected all available options", "highlighting": "string", "loc": { "start": { - "line": 45, - "column": 26, - "index": 1701 + "line": 548, + "column": 10, + "index": 16635 }, "end": { - "line": 48, - "column": 3, - "index": 1783 + "line": 551, + "column": 12, + "index": 16778 } }, - "filepath": "src/components/collapsible_nav_beta/collapsible_nav_button/collapsible_nav_button.tsx" + "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" }, { - "token": "euiCollapsibleNavButton.ariaLabelClose", - "defString": "Close navigation", + "token": "euiComboBoxPill.removeSelection", + "defString": "Remove {children} from selection in this group", "highlighting": "string", "loc": { "start": { - "line": 49, - "column": 27, - "index": 1812 + "line": 67, + "column": 6, + "index": 2037 }, "end": { - "line": 52, - "column": 3, - "index": 1896 + "line": 71, + "column": 7, + "index": 2196 } }, - "filepath": "src/components/collapsible_nav_beta/collapsible_nav_button/collapsible_nav_button.tsx" + "filepath": "src/components/combo_box/combo_box_input/combo_box_pill.tsx" }, { "token": "euiCardSelect.selected", @@ -6695,42 +6677,6 @@ }, "filepath": "src/components/datagrid/body/cell/focus_utils.tsx" }, - { - "token": "euiDataGridCell.position", - "defString": "{columnName}, column {columnIndex}, row {rowIndex}", - "highlighting": "string", - "loc": { - "start": { - "line": 748, - "column": 23, - "index": 23788 - }, - "end": { - "line": 752, - "column": 3, - "index": 23935 - } - }, - "filepath": "src/components/datagrid/body/cell/data_grid_cell.tsx" - }, - { - "token": "euiDataGridCell.expansionEnterPrompt", - "defString": "Press the Enter key to expand this cell.", - "highlighting": "string", - "loc": { - "start": { - "line": 753, - "column": 25, - "index": 23962 - }, - "end": { - "line": 756, - "column": 3, - "index": 24068 - } - }, - "filepath": "src/components/datagrid/body/cell/data_grid_cell.tsx" - }, { "token": "euiDataGridCellActions.expandButtonTitle", "defString": "Click or hit enter to interact with cell content", @@ -6857,6 +6803,42 @@ }, "filepath": "src/components/datagrid/body/header/column_sorting.tsx" }, + { + "token": "euiDataGridCell.position", + "defString": "{columnName}, column {columnIndex}, row {rowIndex}", + "highlighting": "string", + "loc": { + "start": { + "line": 748, + "column": 23, + "index": 23788 + }, + "end": { + "line": 752, + "column": 3, + "index": 23935 + } + }, + "filepath": "src/components/datagrid/body/cell/data_grid_cell.tsx" + }, + { + "token": "euiDataGridCell.expansionEnterPrompt", + "defString": "Press the Enter key to expand this cell.", + "highlighting": "string", + "loc": { + "start": { + "line": 753, + "column": 25, + "index": 23962 + }, + "end": { + "line": 756, + "column": 3, + "index": 24068 + } + }, + "filepath": "src/components/datagrid/body/cell/data_grid_cell.tsx" + }, { "token": "euiDataGridHeaderCell.actionsButtonAriaLabel", "defString": "{title}. Click to view column header actions.", @@ -7272,76 +7254,76 @@ "filepath": "src/components/date_picker/super_date_picker/date_popover/date_popover_content.tsx" }, { - "token": "euiDatePopoverButton.invalidTitle", - "defString": "Invalid date: {title}", + "token": "euiAbsoluteTab.dateFormatButtonLabel", + "defString": "Parse date", "highlighting": "string", "loc": { "start": { - "line": 107, - "column": 23, - "index": 3054 + "line": 95, + "column": 28, + "index": 2852 }, "end": { - "line": 111, + "line": 98, "column": 3, - "index": 3153 + "index": 2928 } }, - "filepath": "src/components/date_picker/super_date_picker/date_popover/date_popover_button.tsx" + "filepath": "src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx" }, { - "token": "euiDatePopoverButton.outdatedTitle", - "defString": "Update needed: {title}", + "token": "euiAbsoluteTab.dateFormatError", + "defString": "Allowed formats: {dateFormat}, ISO 8601, RFC 2822, or Unix timestamp.", "highlighting": "string", "loc": { "start": { - "line": 112, - "column": 24, - "index": 3179 + "line": 99, + "column": 26, + "index": 2956 }, "end": { - "line": 116, + "line": 103, "column": 3, - "index": 3280 + "index": 3138 } }, - "filepath": "src/components/date_picker/super_date_picker/date_popover/date_popover_button.tsx" + "filepath": "src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx" }, { - "token": "euiAbsoluteTab.dateFormatButtonLabel", - "defString": "Parse date", + "token": "euiDatePopoverButton.invalidTitle", + "defString": "Invalid date: {title}", "highlighting": "string", "loc": { "start": { - "line": 95, - "column": 28, - "index": 2852 + "line": 107, + "column": 23, + "index": 3054 }, "end": { - "line": 98, + "line": 111, "column": 3, - "index": 2928 + "index": 3153 } }, - "filepath": "src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx" + "filepath": "src/components/date_picker/super_date_picker/date_popover/date_popover_button.tsx" }, { - "token": "euiAbsoluteTab.dateFormatError", - "defString": "Allowed formats: {dateFormat}, ISO 8601, RFC 2822, or Unix timestamp.", + "token": "euiDatePopoverButton.outdatedTitle", + "defString": "Update needed: {title}", "highlighting": "string", "loc": { "start": { - "line": 99, - "column": 26, - "index": 2956 + "line": 112, + "column": 24, + "index": 3179 }, "end": { - "line": 103, + "line": 116, "column": 3, - "index": 3138 + "index": 3280 } }, - "filepath": "src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx" + "filepath": "src/components/date_picker/super_date_picker/date_popover/date_popover_button.tsx" }, { "token": "euiRecentlyUsed.legend", @@ -7379,6 +7361,24 @@ }, "filepath": "src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx" }, + { + "token": "euiCommonlyUsedTimeRanges.legend", + "defString": "Commonly used", + "highlighting": "string", + "loc": { + "start": { + "line": 27, + "column": 16, + "index": 995 + }, + "end": { + "line": 27, + "column": 79, + "index": 1058 + } + }, + "filepath": "src/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.tsx" + }, { "token": "euiQuickSelect.quickSelectTitle", "defString": "Quick select", @@ -7523,24 +7523,6 @@ }, "filepath": "src/components/date_picker/super_date_picker/quick_select_popover/quick_select.tsx" }, - { - "token": "euiCommonlyUsedTimeRanges.legend", - "defString": "Commonly used", - "highlighting": "string", - "loc": { - "start": { - "line": 27, - "column": 16, - "index": 995 - }, - "end": { - "line": 27, - "column": 79, - "index": 1058 - } - }, - "filepath": "src/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.tsx" - }, { "token": "euiCollapsedNavButton.ariaLabelButtonIcon", "defString": "{title}, quick navigation menu", diff --git a/packages/eui/src/components/toast/__snapshots__/global_toast_list.test.tsx.snap b/packages/eui/src/components/toast/__snapshots__/global_toast_list.test.tsx.snap index d35e4ff73edf..81a406c31d44 100644 --- a/packages/eui/src/components/toast/__snapshots__/global_toast_list.test.tsx.snap +++ b/packages/eui/src/components/toast/__snapshots__/global_toast_list.test.tsx.snap @@ -17,97 +17,135 @@ exports[`EuiGlobalToastList props side can be changed to left 1`] = ` role="log" >
-

- A new notification appears -

-
-
- a -
-
-
-

- A new notification appears -

-
-
- -
- b + A new notification appears +

+
+
+
+
@@ -120,97 +158,135 @@ exports[`EuiGlobalToastList props toasts is rendered 1`] = ` role="log" >
-

- A new notification appears -

-
-
- a -
-
-
-

- A new notification appears -

-
-
- -
- b + A new notification appears +

+
+
+
+
diff --git a/packages/eui/src/components/toast/__snapshots__/toast.test.tsx.snap b/packages/eui/src/components/toast/__snapshots__/toast.test.tsx.snap index 6c530cda117f..66cddba92570 100644 --- a/packages/eui/src/components/toast/__snapshots__/toast.test.tsx.snap +++ b/packages/eui/src/components/toast/__snapshots__/toast.test.tsx.snap @@ -1,184 +1,53 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`EuiToast Props color danger is rendered 1`] = ` -
-

- A new notification appears -

-
- - test title - -
-
-`; - -exports[`EuiToast Props color primary is rendered 1`] = ` -
-

- A new notification appears -

-
- - test title - -
-
-`; - -exports[`EuiToast Props color success is rendered 1`] = ` -
-

- A new notification appears -

-
- - test title - -
-
-`; - -exports[`EuiToast Props color warning is rendered 1`] = ` -
-

- A new notification appears -

-
- - test title - -
-
-`; - -exports[`EuiToast Props iconType is rendered 1`] = ` -
-

- A new notification appears -

-
-
-
-`; - -exports[`EuiToast Props title is rendered 1`] = ` -
-

- A new notification appears -

-
- - toast title - -
-
-`; - exports[`EuiToast is rendered 1`] = `
+
`; diff --git a/packages/eui/src/components/toast/global_toast_list.stories.tsx b/packages/eui/src/components/toast/global_toast_list.stories.tsx index 5eaeed9e86a0..6d33c6979f46 100644 --- a/packages/eui/src/components/toast/global_toast_list.stories.tsx +++ b/packages/eui/src/components/toast/global_toast_list.stories.tsx @@ -46,6 +46,7 @@ const meta: Meta = { showClearAllButtonAt: 3, // stub for testing/QA dismissToast: () => {}, + showNotificationBadge: false, }, }; enableFunctionToggleControls(meta, ['onClearAllToasts']); diff --git a/packages/eui/src/components/toast/global_toast_list.styles.ts b/packages/eui/src/components/toast/global_toast_list.styles.ts index ffb6603a02a9..f5917f64cd25 100644 --- a/packages/eui/src/components/toast/global_toast_list.styles.ts +++ b/packages/eui/src/components/toast/global_toast_list.styles.ts @@ -8,6 +8,7 @@ import { css, keyframes } from '@emotion/react'; import { + euiCanAnimate, euiMaxBreakpoint, euiMinBreakpoint, euiScrollBarStyles, @@ -19,7 +20,13 @@ import { UseEuiTheme } from '../../services'; export const euiGlobalToastListStyles = (euiThemeContext: UseEuiTheme) => { const { euiTheme } = euiThemeContext; - const euiToastWidth = euiTheme.base * 25; + const euiToastWidth = euiTheme.base * 27.5; // 440px -> results in 360px toast width + + const showNotificationBadge = keyframes` + from { opacity: 0; } + to { opacity: 1; } + `; + return { /** * 1. Allow list to expand as items are added, but cap it at the screen height. @@ -45,6 +52,12 @@ export const euiGlobalToastListStyles = (euiThemeContext: UseEuiTheme) => { ${logicalSizeCSS(0, 0)} } + /* Pause the toast progress bar animation while the user hovers the list */ + &:hover .euiToastDecor::before, + &:focus-within .euiToastDecor::before { + animation-play-state: paused; + } + /* The top and bottom padding give height to the list creating a dead-zone effect when there's no toasts in the list, meaning you can't click anything beneath it. Only add the padding if there's content. */ @@ -61,6 +74,29 @@ export const euiGlobalToastListStyles = (euiThemeContext: UseEuiTheme) => { } } `, + content: css` + position: relative; + `, + notificationBadge: { + notificationBadge: css` + position: absolute; + inset-block-start: -${euiTheme.size.s}; + inset-inline-start: -${euiTheme.size.s}; + z-index: ${Number(euiTheme.levels.content) + 1}; + + ${euiCanAnimate} { + /* initial fade-in animation on mount; uses \`animation.normal\` to sync it with the toast animation */ + animation: ${euiTheme.animation.normal} ${showNotificationBadge} + ${euiTheme.animation.resistance}; + + /* fade-out animation when a toast is dismissed. Uses \`animation.fast\` to be snappier */ + transition: opacity ${euiTheme.animation.fast}; + } + `, + hasFadeOut: css` + opacity: 0; + `, + }, // Variants right: css` &:not(:empty) { diff --git a/packages/eui/src/components/toast/global_toast_list.test.tsx b/packages/eui/src/components/toast/global_toast_list.test.tsx index 8fa2e1751152..c45f86bc0ca2 100644 --- a/packages/eui/src/components/toast/global_toast_list.test.tsx +++ b/packages/eui/src/components/toast/global_toast_list.test.tsx @@ -271,6 +271,115 @@ describe('EuiGlobalToastList', () => { }); }); + describe('showNotificationBadge', () => { + const badgeSelector = 'euiGlobalToastListNotificationBadge'; + + const toasts: Toast[] = [ + { id: 'a', 'data-test-subj': 'toast-a' }, + { id: 'b', 'data-test-subj': 'toast-b' }, + ]; + + it('is not rendered by default', () => { + const { queryByTestSubject } = render( + {}} + toastLifeTimeMs={5} + /> + ); + + expect(queryByTestSubject(badgeSelector)).not.toBeInTheDocument(); + }); + + it('renders when showNotificationBadge is true and toasts are present', () => { + const { queryByTestSubject } = render( + {}} + toastLifeTimeMs={5} + showNotificationBadge + /> + ); + + expect(queryByTestSubject(badgeSelector)).toBeInTheDocument(); + }); + + it('displays the number of toasts', () => { + const { getByTestSubject } = render( + {}} + toastLifeTimeMs={5} + showNotificationBadge + /> + ); + + expect(getByTestSubject(badgeSelector)).toHaveTextContent( + String(toasts.length) + ); + }); + + it('is not rendered when there are no toasts', () => { + const { queryByTestSubject } = render( + {}} + toastLifeTimeMs={5} + /> + ); + + expect(queryByTestSubject(badgeSelector)).not.toBeInTheDocument(); + }); + + it('is not rendered when showNotificationBadge is false', () => { + const { queryByTestSubject } = render( + {}} + toastLifeTimeMs={5} + showNotificationBadge={false} + /> + ); + + expect(queryByTestSubject(badgeSelector)).not.toBeInTheDocument(); + }); + + it('is removed from the DOM once all toasts are dismissed', () => { + const dismissToast = jest.fn(); + const { queryByTestSubject, getByTestSubject, rerender } = render( + + ); + + expect(queryByTestSubject(badgeSelector)).toBeInTheDocument(); + + fireEvent.click( + within(getByTestSubject('toast-a')).getByTestSubject( + 'toastCloseButton' + ) + ); + + act(() => { + jest.advanceTimersByTime(TOAST_FADE_OUT_MS); + }); + + rerender( + + ); + + expect(queryByTestSubject(badgeSelector)).not.toBeInTheDocument(); + }); + }); + test('role', () => { const { queryByRole } = render( ['role']; + /** + * Renders a notification badge indicating the amount of toasts in the list. + * + * @default false + */ + showNotificationBadge?: boolean; } export const EuiGlobalToastList: FunctionComponent = ({ @@ -85,6 +92,7 @@ export const EuiGlobalToastList: FunctionComponent = ({ onClearAllToasts, side = 'right', showClearAllButtonAt = CLEAR_ALL_TOASTS_THRESHOLD_DEFAULT, + showNotificationBadge = false, ...rest }) => { const [toastIdToDismissedMap, setToastIdToDismissedMap] = useState<{ @@ -291,7 +299,8 @@ export const EuiGlobalToastList: FunctionComponent = ({ const renderedToasts = useMemo( () => toasts.map((toast) => { - const { text, toastLifeTimeMs, ...rest } = toast; + const { text, toastLifeTimeMs: perToastLifeTimeMs, ...rest } = toast; + const effectiveLifeTimeMs = perToastLifeTimeMs ?? toastLifeTimeMs; const onClose = () => dismissToast(toast); return ( @@ -304,13 +313,20 @@ export const EuiGlobalToastList: FunctionComponent = ({ onFocus={onMouseEnter} onBlur={onMouseLeave} {...rest} - > - {text} - + animationMs={effectiveLifeTimeMs} + text={text} + /> ); }), - [toasts, toastIdToDismissedMap, dismissToast, onMouseEnter, onMouseLeave] + [ + toasts, + toastIdToDismissedMap, + dismissToast, + onMouseEnter, + onMouseLeave, + toastLifeTimeMs, + ] ); const clearAllButton = useMemo(() => { @@ -334,7 +350,8 @@ export const EuiGlobalToastList: FunctionComponent = ({ ]: string[]) => ( { toasts.forEach((toast) => dismissToastProp(toast)); @@ -361,6 +378,31 @@ export const EuiGlobalToastList: FunctionComponent = ({ const classes = classNames('euiGlobalToastList', className); + const hasContent = renderedToasts.length > 0 || clearAllButton != null; + const notificationBadge = useMemo(() => { + const toastWasDismissed = toastIdToDismissedMap[toasts[0]?.id] ?? false; + const isListEmpty = toasts.every((t) => toastIdToDismissedMap[t.id]); + + return ( + showNotificationBadge && + toasts.length > 0 && ( + + {toasts.length} + + ) + ); + }, [showNotificationBadge, toasts, toastIdToDismissedMap, styles]); + return (
= ({ className={classes} {...rest} > - {renderedToasts} - {clearAllButton} + {hasContent && ( +
+ {notificationBadge} + {renderedToasts} + {clearAllButton} +
+ )}
); }; diff --git a/packages/eui/src/components/toast/toast.stories.tsx b/packages/eui/src/components/toast/toast.stories.tsx index 9b93f321fc55..ce2de38f4f97 100644 --- a/packages/eui/src/components/toast/toast.stories.tsx +++ b/packages/eui/src/components/toast/toast.stories.tsx @@ -6,13 +6,25 @@ * Side Public License, v 1. */ +import React, { useEffect } from 'react'; import type { Meta, StoryObj } from '@storybook/react'; +import { action } from '@storybook/addon-actions'; +import { css } from '@emotion/react'; import { enableFunctionToggleControls, hideStorybookControls, } from '../../../.storybook/utils'; -import { EuiToast, EuiToastProps, COLORS } from './toast'; +import { EuiFlexGroup } from '../flex'; +import { EuiSpacer } from '../spacer'; +import { EuiToast, EuiToastProps } from './toast'; +import { COLORS } from './types'; +import { EuiButton } from '../button'; + +const title = "It's a toast!"; +const text = 'A short toast text'; +const textLong = + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'; const meta: Meta = { title: 'Display/EuiToast', @@ -29,8 +41,7 @@ const meta: Meta = { }, args: { // set up for easier testing/QA - title: '', - iconType: '', + color: 'primary', }, }; enableFunctionToggleControls(meta, ['onClose']); @@ -41,9 +52,164 @@ type Story = StoryObj; export const Playground: Story = { args: { - title: "It's a Toast!", - children: 'Toast content', + title, + text, // @ts-ignore - using story specific types onClose: false, // overwriting to false to mimick the default state without close button }, }; + +export const OnDismiss: Story = { + parameters: { + controls: { + include: ['title', 'text', 'onClose'], + }, + }, + args: { + title, + text, + onClose: action('onClose'), + }, +}; + +export const WithActions: Story = { + parameters: { + controls: { + include: ['title', 'text', 'actionProps', 'color', 'onClose'], + }, + }, + args: { + title, + text, + actionProps: { + primary: { + children: 'Primary action', + onClick: action('primary onClick'), + }, + secondary: { + children: 'Secondary action', + onClick: action('secondary onClick'), + }, + }, + }, +}; + +export const WithAnimation: Story = { + parameters: { + controls: { + include: ['animationMs'], + }, + loki: { + skip: true, // functional story only + }, + }, + args: { + title, + text, + animationMs: 3000, + }, + render: function Render({ animationMs: _animationMs, ...rest }) { + const [animationMs, setAnimationMs] = React.useState( + undefined + ); + + useEffect(() => { + setAnimationMs(_animationMs); + }, [_animationMs]); + + return ( + + setAnimationMs(animationMs ? undefined : _animationMs)} + > + {animationMs != null ? 'Reset animation' : 'Start animation'} + + + + ); + }, +}; + +export const KitchenSink: Story = { + tags: ['vrt-only'], + parameters: { + controls: { + include: [], + }, + }, + render: function Render(args) { + const customContent = Some additional custom content; + const actionPrimaryProps = { + children: 'Primary action', + }; + const actionSecondaryProps = { + children: 'Secondary action', + }; + + const renderToasts = ({ + onClose, + actionProps, + }: { + onClose?: boolean; + actionProps?: EuiToastProps['actionProps']; + }) => { + const props = { + ...args, + onClose: onClose ? () => {} : undefined, + actionProps, + } as EuiToastProps; + + return ( + <> + + + + {customContent} + + + {customContent} + + + + + ); + }; + + return ( + + {renderToasts({})} + {renderToasts({ onClose: true })} + {renderToasts({ + actionProps: { + primary: actionPrimaryProps, + }, + })} + {renderToasts({ + onClose: true, + actionProps: { + primary: actionPrimaryProps, + secondary: actionSecondaryProps, + }, + })} + + ); + }, +}; diff --git a/packages/eui/src/components/toast/toast.styles.ts b/packages/eui/src/components/toast/toast.styles.ts index bc4e91560033..b626f49a568f 100644 --- a/packages/eui/src/components/toast/toast.styles.ts +++ b/packages/eui/src/components/toast/toast.styles.ts @@ -6,122 +6,162 @@ * Side Public License, v 1. */ -import { CSSProperties } from 'react'; -import { css } from '@emotion/react'; -import { euiShadowLarge, mathWithUnits } from '@elastic/eui-theme-common'; +import { css, keyframes } from '@emotion/react'; +import { + euiCanAnimate, + euiShadowLarge, + mathWithUnits, +} from '@elastic/eui-theme-common'; import { euiTextBreakWord, logicalCSS } from '../../global_styling'; -import { - highContrastModeStyles, - preventForcedColors, -} from '../../global_styling/functions/high_contrast'; +import { preventForcedColors } from '../../global_styling/functions/high_contrast'; import { UseEuiTheme } from '../../services'; import { euiTitle } from '../title/title.styles'; import { euiPanelBorderStyles } from '../panel/panel.styles'; +const TEXT_MAX_WIDTH = 1200; +const CONTAINER_NAME = 'euiToast'; +const CQC_BREAKPOINT_NARROWEST = '(max-width: 320px)'; + +const euiToastAnimation = keyframes` + from { + transform: scaleX(1); + } + to { + transform: scaleX(0); + } +`; + export const euiToastStyles = (euiThemeContext: UseEuiTheme) => { - const { euiTheme, highContrastMode } = euiThemeContext; - - const highlightStyles = ( - color: string, - width?: CSSProperties['borderWidth'] - ) => ` - &:before { - content: ''; - position: absolute; - /* ensure highlight border is on top of panel border */ - z-index: 1; - inset: 0; - border-radius: inherit; - ${logicalCSS('border-top', `${width} solid ${color}`)} - pointer-events: none; - } - `; + const { euiTheme } = euiThemeContext; + + const highlightSize = mathWithUnits( + [euiTheme.border.width.thin, euiTheme.border.width.thick], + (x, y) => x + y + ); + const paddingTop = mathWithUnits( + [euiTheme.size.base, highlightSize], + (x, y) => x + y + ); + const offsetTop = mathWithUnits( + [euiTheme.size.s, highlightSize], + (x, y) => x + y + ); return { // Base euiToast: css` + container-type: inline-size; + container-name: ${CONTAINER_NAME}; + position: relative; + overflow: hidden; border-radius: ${euiTheme.border.radius.medium}; ${euiShadowLarge(euiThemeContext, { borderAllInHighContrastMode: true })} - position: relative; + ${logicalCSS('padding-top', paddingTop)} + ${logicalCSS('padding-bottom', euiTheme.size.base)} ${logicalCSS('padding-horizontal', euiTheme.size.base)} - ${logicalCSS('padding-vertical', euiTheme.size.base)} - background-color: ${euiTheme.colors.emptyShade}; + background-color: ${euiTheme.colors.backgroundBasePlain}; ${logicalCSS('width', '100%')} ${euiTextBreakWord()} /* Prevent long lines from overflowing */ - ${euiPanelBorderStyles(euiThemeContext)} + `, + decor: css` + position: absolute; + inset-block-start: 0; + inset-inline: 0; + ${logicalCSS('height', highlightSize)} + background-color: var(--euiToastTypeBackgroundColor); + + ${preventForcedColors(euiThemeContext)} + + &::before { + content: ''; + position: absolute; + /* ensure highlight is on top of panel border */ + z-index: ${euiTheme.levels.content}; + inset-block-start: 0; + inset-inline: 0; + ${logicalCSS('height', '100%')} + background-color: var(--euiToastTypeColor); + pointer-events: none; + ${preventForcedColors(euiThemeContext)} + transform-origin: left center; - &:hover, - &:focus { - [class*='euiToast__closeButton'] { - opacity: 1; + [dir='rtl'] & { + transform-origin: right center; } } `, - // Elements - euiToast__closeButton: css` + // handles content + actions layout + wrapper: css` + display: flex; + flex-direction: column; + gap: ${euiTheme.size.m}; + inline-size: 100%; + `, + // handles icon + text layout + body: css` + display: flex; + flex-direction: row; + align-self: center; + gap: ${euiTheme.size.m}; + inline-size: 100%; + `, + // handles text layout + content: css` + display: flex; + flex-direction: column; + gap: ${euiTheme.size.xs}; + align-self: center; + inline-size: 100%; + max-inline-size: ${TEXT_MAX_WIDTH}px; + + .euiToast__text + .euiToast__additionalContent { + ${logicalCSS('margin-top', euiTheme.size.s)} + } + `, + text: css` + display: flex; + flex-direction: column; + gap: ${euiTheme.size.xs}; + `, + icon: css` + grid-area: icon; + position: relative; + ${logicalCSS('margin-vertical', euiTheme.size.xxs)} + `, + actions: css` + grid-area: actions; + display: flex; + gap: ${euiTheme.size.s}; + ${logicalCSS('margin-left', euiTheme.size.xl)} + + /* uses container query directly as it should apply generically independent of size */ + @container ${CONTAINER_NAME} ${CQC_BREAKPOINT_NARROWEST} { + flex-wrap: wrap; + + /* use full width actions */ + > * { + inline-size: 100%; + } + } + `, + dismissButton: css` position: absolute; - ${logicalCSS('top', euiTheme.size.base)} - ${logicalCSS('right', euiTheme.size.base)} + ${logicalCSS('top', offsetTop)}; + ${logicalCSS('right', euiTheme.size.s)} + `, + + hasAnimation: css` + &::before { + ${euiCanAnimate} { + animation: ${euiToastAnimation} var(--euiToastAnimationMs) linear + forwards; + } + } `, - // Variants - colors: { - _getStyles: (color: string) => { - // Increase color/border thickness for all high contrast modes - const borderWidth = highContrastMode - ? mathWithUnits(euiTheme.border.width.thick, (x) => x * 2) - : euiTheme.border.width.thick; - - return highContrastModeStyles(euiThemeContext, { - none: highlightStyles(color, borderWidth), - preferred: ` - ${highlightStyles(color, borderWidth)} - - &::before { - ${logicalCSS( - 'width', - `calc(100% + ${mathWithUnits( - euiTheme.border.width.thin, - (x) => x * 2 - )})` - )} - ${logicalCSS('margin-top', `-${euiTheme.border.width.thin}`)} - ${logicalCSS('margin-left', `-${euiTheme.border.width.thin}`)} - } - `, - // Windows high contrast mode ignores/overrides border colors, which have semantic meaning here. To get around this, we'll use a pseudo element that ignores forced colors - forced: ` - overflow: hidden; - - &::before { - content: ''; - position: absolute; - ${logicalCSS('top', 0)} - ${logicalCSS('horizontal', 0)} - ${logicalCSS('height', borderWidth)} - background-color: ${color}; - ${preventForcedColors(euiThemeContext)} - pointer-events: none; - } - `, - }); - }, - get primary() { - return css(this._getStyles(euiTheme.colors.primary)); - }, - get success() { - return css(this._getStyles(euiTheme.colors.success)); - }, - get warning() { - return css(this._getStyles(euiTheme.colors.warning)); - }, - get danger() { - return css(this._getStyles(euiTheme.colors.danger)); - }, - }, }; }; @@ -133,29 +173,11 @@ export const euiToastHeaderStyles = (euiThemeContext: UseEuiTheme) => { display: flex; /* Align icon with first line of title text if it wraps */ align-items: baseline; - /* Account for close button */ - ${logicalCSS('padding-right', euiTheme.size.l)} - - > * + * { - /* Apply margin to all but last item in the flex */ - ${logicalCSS('margin-left', euiTheme.size.s)} - } - `, - // Elements - euiToastHeader__icon: css` - flex: 0 0 auto; - fill: ${euiTheme.colors.textHeading}; - - /* Vertically center icon with first line of title */ - transform: translateY(2px); - `, - euiToastHeader__title: css` ${euiTitle(euiThemeContext, 'xs')} font-weight: ${euiTheme.font.weight.bold}; `, - // Variants - withBody: css` - ${logicalCSS('margin-bottom', euiTheme.size.s)} + hasDismissButton: css` + padding-inline-end: ${euiTheme.size.l}; `, }; }; diff --git a/packages/eui/src/components/toast/toast.test.tsx b/packages/eui/src/components/toast/toast.test.tsx index f3d7cca0d0ee..76144a9cfc12 100644 --- a/packages/eui/src/components/toast/toast.test.tsx +++ b/packages/eui/src/components/toast/toast.test.tsx @@ -11,59 +11,185 @@ import { fireEvent } from '@testing-library/react'; import { requiredProps } from '../../test'; import { render } from '../../test/rtl'; -import { COLORS, EuiToast } from './toast'; +import { EuiToast, COLOR_TO_NOTIFICATION_ICON_MAP } from './toast'; +import { COLORS } from './types'; +import { NOTIFICATION_ICONS_MAP } from '../notification_icon/notification_icon'; describe('EuiToast', () => { test('is rendered', () => { const { container } = render( - -

Hi

-
+ ); expect(container.firstChild).toMatchSnapshot(); }); - describe('Props', () => { + describe('props', () => { describe('title', () => { - test('is rendered', () => { - const { container } = render(); - expect(container.firstChild).toMatchSnapshot(); + it('is rendered', () => { + const title = 'Toast title'; + const { getByTestSubject } = render(); + + expect(getByTestSubject('euiToastHeader__title')).toHaveTextContent( + title + ); + }); + }); + + describe('text', () => { + it('is rendered', () => { + const text = 'Toast body text'; + const { getByTestSubject } = render( + + ); + + expect(getByTestSubject('euiToast')).toHaveTextContent(text); }); }); describe('color', () => { COLORS.forEach((color) => { - test(`${color} is rendered`, () => { - const { container } = render( - - ); - expect(container.firstChild).toMatchSnapshot(); + test(`${color} renders default notification icon`, () => { + const { container } = render(); + const iconType = COLOR_TO_NOTIFICATION_ICON_MAP[color]; + const iconName = NOTIFICATION_ICONS_MAP[iconType].name; + + expect( + container.querySelector(`[data-euiicon-type="${iconName}"]`) + ).toBeInTheDocument(); }); }); }); describe('iconType', () => { - test('is rendered', () => { + it('renders a custom icon', () => { const { container } = render( - + ); - expect(container.firstChild).toMatchSnapshot(); + + expect( + container.querySelector('[data-euiicon-type="user"]') + ).toBeInTheDocument(); + }); + + it('renders default notification icon if not passed', () => { + const { container } = render(); + + expect( + container.querySelector( + `[data-euiicon-type="${NOTIFICATION_ICONS_MAP.info.name}"]` + ) + ).toBeInTheDocument(); }); }); - describe('onClose', () => { - test('is called when the close button is clicked', () => { - const onCloseHandler = jest.fn(); + describe('actionProps', () => { + it('renders a primary action button', () => { + const { getByTestSubject } = render( + + ); + + expect(getByTestSubject('primaryAction')).toBeInTheDocument(); + }); + + it('renders a primary and secondary action button', () => { + const { getByTestSubject } = render( + + ); + + expect(getByTestSubject('primaryAction')).toBeInTheDocument(); + expect(getByTestSubject('secondaryAction')).toBeInTheDocument(); + }); + it('renders a standalone secondary action button', () => { + const { container } = render( + + ); + + expect( + container.querySelector('[data-test-subj="secondaryAction"]') + ).toBeInTheDocument(); + }); + }); + + describe('animationMs', () => { + it('sets the animation duration CSS variable when provided', () => { const { getByTestSubject } = render( - + ); - const closeButton = getByTestSubject('toastCloseButton'); - fireEvent.click(closeButton); + expect( + getByTestSubject('euiToast').style.getPropertyValue( + '--euiToastAnimationMs' + ) + ).toBe('5000ms'); + }); + + it('does not set the animation duration CSS variable when not provided', () => { + const { getByTestSubject } = render( + + ); - expect(onCloseHandler).toHaveBeenCalledTimes(1); + expect( + getByTestSubject('euiToast').style.getPropertyValue( + '--euiToastAnimationMs' + ) + ).toBe(''); + }); + }); + + describe('onClose', () => { + it('renders dismiss button and fires callback', () => { + const onClose = jest.fn(); + const { getByTestSubject } = render( + + ); + + fireEvent.click(getByTestSubject('toastCloseButton')); + expect(onClose).toHaveBeenCalledTimes(1); + }); + + it('dismiss button has aria-label', () => { + const { getByTestSubject } = render( + {}} title="Toast title" /> + ); + + expect(getByTestSubject('toastCloseButton')).toHaveAttribute( + 'aria-label', + 'Dismiss toast' + ); }); }); }); diff --git a/packages/eui/src/components/toast/toast.tsx b/packages/eui/src/components/toast/toast.tsx index 44a29b957284..5528cf48ba62 100644 --- a/packages/eui/src/components/toast/toast.tsx +++ b/packages/eui/src/components/toast/toast.tsx @@ -6,10 +6,20 @@ * Side Public License, v 1. */ -import React, { FunctionComponent, HTMLAttributes, ReactNode } from 'react'; +import React, { + FunctionComponent, + HTMLAttributes, + ReactNode, + useMemo, +} from 'react'; import classNames from 'classnames'; +import { + _EuiThemeBackgroundColors, + _EuiThemeBorderColors, + getTokenName, +} from '@elastic/eui-theme-common'; -import { useEuiMemoizedStyles } from '../../services'; +import { useEuiMemoizedStyles, useEuiTheme } from '../../services'; import { CommonProps } from '../common'; import { EuiScreenReaderOnly } from '../accessibility'; import { EuiButtonIcon } from '../button'; @@ -18,41 +28,247 @@ import { IconType, EuiIcon } from '../icon'; import { EuiText } from '../text'; import { euiToastStyles, euiToastHeaderStyles } from './toast.styles'; +import { + EuiNotificationIcon, + type EuiNotificationIconType, +} from '../notification_icon/notification_icon'; +import { euiNotificationIconStyles } from '../notification_icon/notification_icon.styles'; +import { + EuiToastAction, + EuiToastActionPrimaryProps, + EuiToastActionSecondaryProps, +} from './toast_action'; +import { EuiToastColor } from './types'; +import { EuiTitle } from '../title'; -export const COLORS = ['primary', 'success', 'warning', 'danger'] as const; - -type ToastColor = (typeof COLORS)[number]; +export const COLOR_TO_NOTIFICATION_ICON_MAP: Record< + EuiToastColor, + EuiNotificationIconType +> = { + primary: 'info', + success: 'success', + warning: 'warning', + danger: 'error', +}; export interface EuiToastProps extends CommonProps, Omit, 'title'> { + /** + * Title of the toast. Should be used with text only. Do not pass complex content or custom components. + * Ensure to always pass a title. It's currently marked as optional for backwards compatibility. + * In a future major release, this will be required. + */ title?: ReactNode; - color?: ToastColor; + /** + * Main component text. Accepts text, text block elements such as `

`, and inline elements such as ``, ``, `` or ``. + * Avoid passing complex layouts or custom components. Use `children` instead. + */ + text?: ReactNode; + /** + * Can be used for additional, non-inline content. Use sparingly, as toasts are not meant to have complex content. + * Where possible, use `text` and `actionProps` instead to display text and actions. + */ + children?: ReactNode; + color?: EuiToastColor; + /** + * Defines a custom icon to be displayed. + * When no `iconType` is set, a default icon will be used based on the `color` of the toast. + */ iconType?: IconType; onClose?: () => void; + /** + * Duration in milliseconds that drives a countdown animation on the toast's decor bar. + * When not set the bar is static at full width. + */ + animationMs?: number; + /** + * Props for primary and secondary actions within the toast. + */ + actionProps?: { + primary?: EuiToastActionPrimaryProps; + secondary?: EuiToastActionSecondaryProps; + }; } export const EuiToast: FunctionComponent = ({ title, - color, + text, + color = 'primary', iconType, - onClose, children, className, + actionProps, + style, + onClose, + animationMs, ...rest }) => { - const baseStyles = useEuiMemoizedStyles(euiToastStyles); - const baseCss = [baseStyles.euiToast, color && baseStyles.colors[color]]; + const { euiTheme } = useEuiTheme(); + + const styles = useEuiMemoizedStyles(euiToastStyles); + const iconStyles = useEuiMemoizedStyles(euiNotificationIconStyles); const headerStyles = useEuiMemoizedStyles(euiToastHeaderStyles); - const headerCss = [ - headerStyles.euiToastHeader, - children && headerStyles.withBody, - ]; - const classes = classNames('euiToast', className); + const cssStyles = [styles.euiToast]; + const decorCssStyles = [styles.decor, animationMs && styles.hasAnimation]; + + const classes = classNames('euiToast', className, { + [`euiToast--${color}`]: color, + }); + + const highlightColorToken = getTokenName( + 'borderStrong', + color + ) as keyof _EuiThemeBorderColors; + const typeColor = euiTheme.colors[highlightColorToken]; + const backgroundLightToken = getTokenName( + 'backgroundLight', + color + ) as keyof _EuiThemeBackgroundColors; + const backgroundLightColor = euiTheme.colors[backgroundLightToken]; + + const cssVariables = useMemo( + () => ({ + '--euiToastTypeColor': typeColor, + '--euiToastTypeBackgroundColor': backgroundLightColor, + ...(animationMs && { + '--euiToastAnimationMs': `${animationMs}ms`, + }), + }), + [typeColor, backgroundLightColor, animationMs] + ); + + const dismissButton = useMemo(() => { + if (!onClose) return; + + return ( + + {(dismissToast: string) => ( + + )} + + ); + }, [onClose, styles]); + + const header = useMemo(() => { + if (!title) return; + + const headerCssStyles = [ + headerStyles.euiToastHeader, + onClose && headerStyles.hasDismissButton, + ]; + + return ( + +

{title}

+ + ); + }, [title, headerStyles, onClose]); + + const icon = useMemo(() => { + if (!iconType) { + const defaultIconType = COLOR_TO_NOTIFICATION_ICON_MAP[color] ?? 'info'; + + return ( + + ); + } + + return ( +