diff --git a/.buildkite/pipelines/pipeline_pull_request_test.yml b/.buildkite/pipelines/pipeline_pull_request_test.yml index af25c625a9f..418acd54bb5 100644 --- a/.buildkite/pipelines/pipeline_pull_request_test.yml +++ b/.buildkite/pipelines/pipeline_pull_request_test.yml @@ -1,9 +1,75 @@ # 🏠/.buildkite/pipelines/pipeline_pull_request_test.yml steps: - - agents: + - command: .buildkite/scripts/pipeline_test.sh + label: ":typescript: Linting" + agents: provider: "gcp" - command: .buildkite/scripts/pipeline_test.sh - if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup + env: + TEST_TYPE: 'lint' + if: build.branch != "main" # This job is triggered by the combined test and deploy docs for every PR + + - command: .buildkite/scripts/pipeline_test.sh + label: ":jest: TS unit tests" + agents: + provider: "gcp" + env: + TEST_TYPE: 'unit:ts' + if: build.branch != "main" + + - command: .buildkite/scripts/pipeline_test.sh + label: ":jest: TSX unit tests on React 16" + agents: + provider: "gcp" + env: + TEST_TYPE: 'unit:tsx:16' + if: build.branch != "main" + + - command: .buildkite/scripts/pipeline_test.sh + label: ":jest: TSX unit tests on React 17" + agents: + provider: "gcp" + env: + TEST_TYPE: 'unit:tsx:17' + if: build.branch != "main" + + - command: .buildkite/scripts/pipeline_test.sh + label: ":jest: TSX unit tests on React 18" + agents: + provider: "gcp" + env: + TEST_TYPE: 'unit:tsx' + if: build.branch != "main" + + - command: .buildkite/scripts/pipeline_test.sh + label: ":cypress: Cypress tests on React 16" + agents: + provider: "gcp" + env: + TEST_TYPE: 'cypress:16' + if: build.branch != "main" + artifact_paths: + - "cypress/screenshots/**/*.png" + - "cypress/videos/**/*.mp4" + + - command: .buildkite/scripts/pipeline_test.sh + label: ":cypress: Cypress tests on React 17" + agents: + provider: "gcp" + env: + TEST_TYPE: 'cypress:17' + if: build.branch != "main" + artifact_paths: + - "cypress/screenshots/**/*.png" + - "cypress/videos/**/*.mp4" + + - command: .buildkite/scripts/pipeline_test.sh + label: ":cypress: Cypress tests on React 18" + agents: + provider: "gcp" + env: + TEST_TYPE: 'cypress:18' + if: build.branch != "main" artifact_paths: - "cypress/screenshots/**/*.png" + - "cypress/videos/**/*.mp4" diff --git a/.buildkite/scripts/pipeline_test.sh b/.buildkite/scripts/pipeline_test.sh index bad0e5ce24a..0ab290d4ed1 100644 --- a/.buildkite/scripts/pipeline_test.sh +++ b/.buildkite/scripts/pipeline_test.sh @@ -2,17 +2,63 @@ set -euo pipefail -docker run \ - -i --rm \ - --env GIT_COMMITTER_NAME=test \ - --env GIT_COMMITTER_EMAIL=test \ - --env HOME=/tmp \ - --user="$(id -u):$(id -g)" \ - --volume="$(pwd):/app" \ - --workdir=/app \ - docker.elastic.co/eui/ci:5.3 \ - bash -c "/opt/yarn*/bin/yarn \ - && yarn cypress install \ - && yarn lint \ - && yarn test-unit --node-options=--max_old_space_size=2048 \ - && yarn test-cypress --node-options=--max_old_space_size=2048" +DOCKER_OPTIONS=( + -i --rm + --env GIT_COMMITTER_NAME=test + --env GIT_COMMITTER_EMAIL=test + --env HOME=/tmp + --user="$(id -u):$(id -g)" + --volume="$(pwd):/app" + --workdir=/app + docker.elastic.co/eui/ci:5.5 +) + +case $TEST_TYPE in + lint) + echo "[TASK]: Running linters" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn lint") + ;; + + unit:ts) + echo "[TASK]: Running .ts and .js unit tests" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn test-unit --node-options=--max_old_space_size=2048 --testMatch=non-react") + ;; + + unit:tsx:16) + echo "[TASK]: Running Jest .tsx tests against React 16" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn test-unit --node-options=--max_old_space_size=2048 --react-version=16 --testMatch=react") + ;; + + unit:tsx:17) + echo "[TASK]: Running Jest .tsx tests against React 17" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn test-unit --node-options=--max_old_space_size=2048 --react-version=17 --testMatch=react") + ;; + + unit:tsx) + echo "[TASK]: Running Jest .tsx tests against React 18" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn test-unit --node-options=--max_old_space_size=2048 --testMatch=react") + ;; + + cypress:16) + echo "[TASK]: Running Cypress tests against React 16" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && yarn test-cypress --node-options=--max_old_space_size=2048 --react-version=16") + ;; + + cypress:17) + echo "[TASK]: Running Cypress tests against React 17" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && yarn test-cypress --node-options=--max_old_space_size=2048 --react-version=17") + ;; + + cypress:18) + echo "[TASK]: Running Cypress tests against React 18" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && yarn test-cypress --node-options=--max_old_space_size=2048") + ;; + + *) + echo "[ERROR]: Unknown task" + echo "Exit code: 1" + exit 1 + ;; +esac + +docker run "${DOCKER_OPTIONS[@]}" diff --git a/.nvmrc b/.nvmrc index 4a1f488b6c3..f6610cade82 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18.17.1 +18.18.1 diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e2ba33fff7d..857654a3218 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -38,10 +38,20 @@ import { writingModeStyles } from './writing_mode.styles'; // once all EUI components are converted to Emotion import '../dist/eui_theme_light.css'; +/** + * Prop controls + */ + +import type { CommonProps } from '../src/components/common'; +import { hideStorybookControls } from './utils'; + const preview: Preview = { decorators: [ (Story, context) => ( - +
([ + 'css', + 'className', + 'data-test-subj', + ]), }; export default preview; diff --git a/.storybook/utils.test.ts b/.storybook/utils.test.ts new file mode 100644 index 00000000000..d570363a393 --- /dev/null +++ b/.storybook/utils.test.ts @@ -0,0 +1,49 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { hideStorybookControls, disableStorybookControls } from './utils'; + +describe('hideStorybookControls', () => { + it('outputs the expected `argTypes` object when passed prop name strings', () => { + expect( + hideStorybookControls(['isDisabled', 'isLoading', 'isInvalid']) + ).toEqual({ + isDisabled: { table: { disable: true } }, + isLoading: { table: { disable: true } }, + isInvalid: { table: { disable: true } }, + }); + }); + + it('throws a typescript error if a generic is passed and the prop names do not match', () => { + type TestComponentProps = { hello: boolean; world: boolean }; + // No typescript error + hideStorybookControls(['hello', 'world']); + // @ts-expect-error - will fail `yarn lint` if a TS error is *not* produced + hideStorybookControls(['hello', 'world', 'error']); + }); +}); + +describe('disableStorybookControls', () => { + it('outputs the expected `argTypes` object when passed prop name strings', () => { + expect( + disableStorybookControls(['isDisabled', 'isLoading', 'isInvalid']) + ).toEqual({ + isDisabled: { control: false }, + isLoading: { control: false }, + isInvalid: { control: false }, + }); + }); + + it('throws a typescript error if a generic is passed and the prop names do not match', () => { + type TestComponentProps = { hello: boolean; world: boolean }; + // No typescript error + disableStorybookControls(['hello', 'world']); + // @ts-expect-error - will fail `yarn lint` if a TS error is *not* produced + disableStorybookControls(['hello', 'world', 'error']); + }); +}); diff --git a/.storybook/utils.ts b/.storybook/utils.ts new file mode 100644 index 00000000000..517b93421c2 --- /dev/null +++ b/.storybook/utils.ts @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +/** + * argTypes configurations + */ + +/** + * Completely hide props from Storybook's controls panel. + * Should be passed or spread to `argTypes` + */ +export const hideStorybookControls = ( + propNames: Array +): Record | {} => { + return propNames.reduce( + (obj, name) => ({ ...obj, [name]: HIDE_CONTROL }), + {} + ); +}; +const HIDE_CONTROL = { table: { disable: true } }; + +/** + * Leave props visible in Storybook's controls panel, but disable them + * from being controllable (renders a `-`). + * + * Should be passed or spread to `argTypes` + */ +export const disableStorybookControls = ( + propNames: Array +): Record | {} => { + return propNames.reduce( + (obj, name) => ({ ...obj, [name]: DISABLE_CONTROL }), + {} + ); +}; +const DISABLE_CONTROL = { control: false }; + +/** + * parameters configurations + */ + +/** + * Will hide all props/controls. Pass to `parameters` + * + * TODO: Figure out some way to not show Storybook's "setup" text? + */ +export const hideAllStorybookControls = { + controls: { exclude: /.*/g }, +}; + +/** + * Will hide the control/addon panel entirely for a specific story. + * Should be passed or spread to to `parameters`. + * + * Note that users can choose to re-show the panel in the UI + */ +export const hidePanel = { + options: { showPanel: false }, +}; diff --git a/CHANGELOG.md b/CHANGELOG.md index 9380fce9570..81f888d4f88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,41 @@ +## [`89.1.0`](https://github.com/elastic/eui/tree/v89.1.0) + +- Added `tokenVectorSparse` token and updated `tokenDenseVector` token (now named `tokenVectorDense`). ([#7282](https://github.com/elastic/eui/pull/7282)) + +**CSS-in-JS conversions** + +- Reduced default CSS prefixes generated by Emotion to only browsers supported by EUI (latest evergreen browsers). This can be customized by passing your own Emotion cache to `EuiProvider`. ([#7272](https://github.com/elastic/eui/pull/7272)) + +## [`89.0.0`](https://github.com/elastic/eui/tree/v89.0.0) + +- Added new `pushAnimation` prop to push `EuiFlyout`s, which enables a slide in animation ([#7239](https://github.com/elastic/eui/pull/7239)) +- Updated `EuiComboBox` to use `EuiInputPopover` under the hood ([#7246](https://github.com/elastic/eui/pull/7246)) +- Added `inputPopoverProps` to `EuiComboBox`, which allows customizing the underlying popover ([#7246](https://github.com/elastic/eui/pull/7246)) +- Added a new beta `EuiTextBlockTruncate` component for multi-line truncation ([#7250](https://github.com/elastic/eui/pull/7250)) +- Updated `EuiBasicTable` and `EuiInMemoryTable` to support multi-line truncation. This can be set via `truncateText.lines` in the `columns` prop. ([#7254](https://github.com/elastic/eui/pull/7254)) + +**Bug fixes** + +- Fixed `EuiFlexGroup` and `EuiFlexGrid's `m` gutter size ([#7251](https://github.com/elastic/eui/pull/7251)) +- Fixed focus trap rerender issues in `EuiFlyout` with memoization ([#7259](https://github.com/elastic/eui/pull/7259)) +- Fixed a visual bug with `EuiContextMenu`'s animation between panels ([#7268](https://github.com/elastic/eui/pull/7268)) + +**Breaking changes** + +- EUI's global body font-size now respects the `font.defaultUnits` token. This means that the global font size will use the `rem` unit by default, instead of `px`. ([#7182](https://github.com/elastic/eui/pull/7182)) +- Removed exported `accessibleClickKeys`, `comboBoxKeys`, and `cascadingMenuKeys` services. Use the generic `keys` service instead ([#7256](https://github.com/elastic/eui/pull/7256)) +- Removed `EuiColorStops` due to low usage ([#7262](https://github.com/elastic/eui/pull/7262)) +- Removed `EuiSuggest`. We recommend using `EuiSelectable` or `EuiComboBox` instead ([#7263](https://github.com/elastic/eui/pull/7263)) +- Removed `euiHeaderAffordForFixed` Sass mixin, and `$euiHeaderHeight` and `$euiHeaderHeightCompensation` Sass variables. Use the CSS variable `--var(euiFixedHeadersOffset, 0)` instead. ([#7264](https://github.com/elastic/eui/pull/7264)) + +**Accessibility** + +- When using `rem` or `em` font units, EUI now respects, instead of ignoring, browser default font sizes set by end users. ([#7182](https://github.com/elastic/eui/pull/7182)) + +## [`88.5.4`](https://github.com/elastic/eui/tree/v88.5.4) + +- This release contains internal changes to a beta component needed by Kibana. + ## [`88.5.3`](https://github.com/elastic/eui/tree/v88.5.3) **Bug fixes** diff --git a/cypress.config.ts b/cypress.config.ts index 0436068c760..4c53af5bf36 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,4 +1,5 @@ import { defineConfig } from 'cypress'; +import { unlinkSync } from 'fs'; import webpackConfig from './cypress/webpack.config'; export default defineConfig({ @@ -28,9 +29,25 @@ export default defineConfig({ }, }); + on( + 'after:spec', + (spec: Cypress.Spec, results: CypressCommandLine.RunResult) => { + if (config.video) { + if (results.stats.failures !== 0) { + console.log( + `[FAILURE]: Recording video for ${results.spec.name}.` + ); + } else { + unlinkSync(results.video!); + } + } + } + ); + return config; }, specPattern: ['./src/**/*.spec.tsx', './src/**/*.a11y.tsx'], // scripts/cypress.js splits this using the CLI --spec argument video: false, + videoCompression: 32, // more time to process, but a smaller file to upload as an artifact }, }); diff --git a/i18ntokens.json b/i18ntokens.json index 94affb3d45f..01b05ed3709 100644 --- a/i18ntokens.json +++ b/i18ntokens.json @@ -455,14 +455,14 @@ "highlighting": "string", "loc": { "start": { - "line": 151, + "line": 165, "column": 27, - "index": 5087 + "index": 5469 }, "end": { - "line": 154, + "line": 168, "column": 3, - "index": 5157 + "index": 5539 } }, "filepath": "src/components/collapsible_nav_beta/collapsible_nav_beta.tsx" @@ -647,132 +647,6 @@ }, "filepath": "src/components/color_picker/color_picker.tsx" }, - { - "token": "euiColorStopThumb.buttonAriaLabel", - "defString": "Press the Enter key to modify this stop. Press Escape to focus the group", - "highlighting": "string", - "loc": { - "start": { - "line": 289, - "column": 8, - "index": 7845 - }, - "end": { - "line": 298, - "column": 9, - "index": 8162 - } - }, - "filepath": "src/components/color_picker/color_stops/color_stop_thumb.tsx" - }, - { - "token": "euiColorStopThumb.buttonTitle", - "defString": "Click to edit, drag to reposition", - "highlighting": "string", - "loc": { - "start": { - "line": 289, - "column": 8, - "index": 7845 - }, - "end": { - "line": 298, - "column": 9, - "index": 8162 - } - }, - "filepath": "src/components/color_picker/color_stops/color_stop_thumb.tsx" - }, - { - "token": "euiColorStopThumb.screenReaderAnnouncement", - "defString": "A popup with a color stop edit form opened.\n Tab forward to cycle through form controls or press\n escape to close this popup.", - "highlighting": "string", - "loc": { - "start": { - "line": 340, - "column": 12, - "index": 9548 - }, - "end": { - "line": 345, - "column": 14, - "index": 9808 - } - }, - "filepath": "src/components/color_picker/color_stops/color_stop_thumb.tsx" - }, - { - "token": "euiColorStopThumb.stopLabel", - "defString": "Stop value", - "highlighting": "string", - "loc": { - "start": { - "line": 350, - "column": 12, - "index": 9948 - }, - "end": { - "line": 356, - "column": 13, - "index": 10177 - } - }, - "filepath": "src/components/color_picker/color_stops/color_stop_thumb.tsx" - }, - { - "token": "euiColorStopThumb.stopErrorMessage", - "defString": "Value is out of range", - "highlighting": "string", - "loc": { - "start": { - "line": 350, - "column": 12, - "index": 9948 - }, - "end": { - "line": 356, - "column": 13, - "index": 10177 - } - }, - "filepath": "src/components/color_picker/color_stops/color_stop_thumb.tsx" - }, - { - "token": "euiColorStopThumb.removeLabel", - "defString": "Remove this stop", - "highlighting": "string", - "loc": { - "start": { - "line": 382, - "column": 16, - "index": 11269 - }, - "end": { - "line": 385, - "column": 17, - "index": 11396 - } - }, - "filepath": "src/components/color_picker/color_stops/color_stop_thumb.tsx" - }, - { - "token": "euiColorStops.screenReaderAnnouncement", - "defString": "{label}: {readOnly} {disabled} Color stop picker. Each stop consists of a number and corresponding color value. Use the Down and Up arrow keys to select individual stops. Press the Enter key to create a new stop.", - "highlighting": "string", - "loc": { - "start": { - "line": 543, - "column": 10, - "index": 16200 - }, - "end": { - "line": 551, - "column": 12, - "index": 16680 - } - }, - "filepath": "src/components/color_picker/color_stops/color_stops.tsx" - }, { "token": "euiHue.label", "defString": "Select the HSV color mode 'hue' value", @@ -851,14 +725,14 @@ "highlighting": "string", "loc": { "start": { - "line": 415, + "line": 335, "column": 12, - "index": 12237 + "index": 9466 }, "end": { - "line": 418, + "line": 338, "column": 14, - "index": 12360 + "index": 9589 } }, "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" @@ -869,14 +743,14 @@ "highlighting": "string", "loc": { "start": { - "line": 428, + "line": 348, "column": 16, - "index": 12799 + "index": 10028 }, "end": { - "line": 432, + "line": 352, "column": 18, - "index": 13030 + "index": 10259 } }, "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" @@ -887,14 +761,14 @@ "highlighting": "string", "loc": { "start": { - "line": 447, + "line": 367, "column": 16, - "index": 13459 + "index": 10688 }, "end": { - "line": 453, + "line": 373, "column": 18, - "index": 13732 + "index": 10961 } }, "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" @@ -905,14 +779,14 @@ "highlighting": "string", "loc": { "start": { - "line": 482, + "line": 402, "column": 20, - "index": 14723 + "index": 11952 }, "end": { - "line": 488, + "line": 408, "column": 22, - "index": 15021 + "index": 12250 } }, "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" @@ -923,14 +797,14 @@ "highlighting": "string", "loc": { "start": { - "line": 499, + "line": 419, "column": 12, - "index": 15225 + "index": 12454 }, "end": { - "line": 503, + "line": 423, "column": 14, - "index": 15446 + "index": 12675 } }, "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" @@ -941,14 +815,14 @@ "highlighting": "string", "loc": { "start": { - "line": 510, + "line": 430, "column": 10, - "index": 15565 + "index": 12794 }, "end": { - "line": 513, + "line": 433, "column": 12, - "index": 15705 + "index": 12934 } }, "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" @@ -959,14 +833,14 @@ "highlighting": "string", "loc": { "start": { - "line": 519, + "line": 439, "column": 10, - "index": 15818 + "index": 13047 }, "end": { - "line": 522, + "line": 442, "column": 12, - "index": 15961 + "index": 13190 } }, "filepath": "src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx" @@ -977,14 +851,14 @@ "highlighting": "string", "loc": { "start": { - "line": 970, - "column": 10, - "index": 28029 + "line": 767, + "column": 8, + "index": 22243 }, "end": { - "line": 973, - "column": 11, - "index": 28154 + "line": 770, + "column": 9, + "index": 22362 } }, "filepath": "src/components/combo_box/combo_box.tsx" @@ -1049,14 +923,14 @@ "highlighting": "string", "loc": { "start": { - "line": 38, + "line": 41, "column": 4, - "index": 1346 + "index": 1427 }, "end": { - "line": 42, + "line": 45, "column": 5, - "index": 1501 + "index": 1582 } }, "filepath": "src/components/datagrid/body/data_grid_cell_actions.tsx" @@ -1067,14 +941,14 @@ "highlighting": "string", "loc": { "start": { - "line": 100, - "column": 12, - "index": 2981 + "line": 135, + "column": 10, + "index": 4290 }, "end": { - "line": 108, - "column": 14, - "index": 3288 + "line": 143, + "column": 12, + "index": 4581 } }, "filepath": "src/components/datagrid/body/data_grid_cell.tsx" @@ -4703,14 +4577,14 @@ "highlighting": "string", "loc": { "start": { - "line": 295, + "line": 311, "column": 8, - "index": 9503 + "index": 9875 }, "end": { - "line": 295, + "line": 311, "column": 78, - "index": 9573 + "index": 9945 } }, "filepath": "src/components/flyout/flyout.tsx" @@ -4721,14 +4595,14 @@ "highlighting": "string", "loc": { "start": { - "line": 359, + "line": 385, "column": 12, - "index": 11856 + "index": 12431 }, "end": { - "line": 362, + "line": 388, "column": 14, - "index": 12065 + "index": 12640 } }, "filepath": "src/components/flyout/flyout.tsx" @@ -4739,14 +4613,14 @@ "highlighting": "string", "loc": { "start": { - "line": 364, + "line": 390, "column": 12, - "index": 12094 + "index": 12669 }, "end": { - "line": 367, + "line": 393, "column": 14, - "index": 12266 + "index": 12841 } }, "filepath": "src/components/flyout/flyout.tsx" @@ -4757,14 +4631,14 @@ "highlighting": "string", "loc": { "start": { - "line": 370, + "line": 396, "column": 12, - "index": 12337 + "index": 12912 }, "end": { - "line": 373, + "line": 399, "column": 14, - "index": 12524 + "index": 13099 } }, "filepath": "src/components/flyout/flyout.tsx" @@ -6055,12 +5929,12 @@ "start": { "line": 687, "column": 16, - "index": 20276 + "index": 20250 }, "end": { "line": 690, "column": 18, - "index": 20470 + "index": 20444 } }, "filepath": "src/components/popover/popover.tsx" @@ -6893,114 +6767,6 @@ }, "filepath": "src/components/steps/step_strings.tsx" }, - { - "token": "euiSuggest.stateSavedTooltip", - "defString": "Saved.", - "highlighting": "string", - "loc": { - "start": { - "line": 210, - "column": 39, - "index": 5033 - }, - "end": { - "line": 213, - "column": 3, - "index": 5167 - } - }, - "filepath": "src/components/suggest/suggest.tsx" - }, - { - "token": "euiSuggest.stateUnsavedTooltip", - "defString": "Changes have not been saved.", - "highlighting": "string", - "loc": { - "start": { - "line": 210, - "column": 39, - "index": 5033 - }, - "end": { - "line": 213, - "column": 3, - "index": 5167 - } - }, - "filepath": "src/components/suggest/suggest.tsx" - }, - { - "token": "euiSuggest.stateLoading", - "defString": "State: loading.", - "highlighting": "string", - "loc": { - "start": { - "line": 236, - "column": 67, - "index": 5883 - }, - "end": { - "line": 244, - "column": 3, - "index": 6124 - } - }, - "filepath": "src/components/suggest/suggest.tsx" - }, - { - "token": "euiSuggest.stateSaved", - "defString": "State: saved.", - "highlighting": "string", - "loc": { - "start": { - "line": 236, - "column": 67, - "index": 5883 - }, - "end": { - "line": 244, - "column": 3, - "index": 6124 - } - }, - "filepath": "src/components/suggest/suggest.tsx" - }, - { - "token": "euiSuggest.stateUnsaved", - "defString": "State: unsaved.", - "highlighting": "string", - "loc": { - "start": { - "line": 236, - "column": 67, - "index": 5883 - }, - "end": { - "line": 244, - "column": 3, - "index": 6124 - } - }, - "filepath": "src/components/suggest/suggest.tsx" - }, - { - "token": "euiSuggest.stateUnchanged", - "defString": "State: unchanged.", - "highlighting": "string", - "loc": { - "start": { - "line": 236, - "column": 67, - "index": 5883 - }, - "end": { - "line": 244, - "column": 3, - "index": 6124 - } - }, - "filepath": "src/components/suggest/suggest.tsx" - }, { "token": "euiTableSortMobile.sorting", "defString": "Sorting", diff --git a/i18ntokens_changelog.json b/i18ntokens_changelog.json index 5ce5286fb2c..3c34a0048f0 100644 --- a/i18ntokens_changelog.json +++ b/i18ntokens_changelog.json @@ -1,4 +1,61 @@ [ + { + "version": "89.0.0", + "changes": [ + { + "token": "euiColorStopThumb.buttonAriaLabel", + "changeType": "deleted" + }, + { + "token": "euiColorStopThumb.buttonTitle", + "changeType": "deleted" + }, + { + "token": "euiColorStopThumb.screenReaderAnnouncement", + "changeType": "deleted" + }, + { + "token": "euiColorStopThumb.stopLabel", + "changeType": "deleted" + }, + { + "token": "euiColorStopThumb.stopErrorMessage", + "changeType": "deleted" + }, + { + "token": "euiColorStopThumb.removeLabel", + "changeType": "deleted" + }, + { + "token": "euiColorStops.screenReaderAnnouncement", + "changeType": "deleted" + }, + { + "token": "euiSuggest.stateSavedTooltip", + "changeType": "deleted" + }, + { + "token": "euiSuggest.stateUnsavedTooltip", + "changeType": "deleted" + }, + { + "token": "euiSuggest.stateLoading", + "changeType": "deleted" + }, + { + "token": "euiSuggest.stateSaved", + "changeType": "deleted" + }, + { + "token": "euiSuggest.stateUnsaved", + "changeType": "deleted" + }, + { + "token": "euiSuggest.stateUnchanged", + "changeType": "deleted" + } + ] + }, { "version": "88.5.0", "changes": [ diff --git a/package.json b/package.json index ca6ad3ae8bc..2ff09dcd9b1 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "@elastic/eui", "description": "Elastic UI Component Library", - "version": "88.5.3", + "version": "89.1.0", "license": "SEE LICENSE IN LICENSE.txt", "main": "lib", "module": "es", "types": "eui.d.ts", - "docker_image": "18.17.1", + "docker_image": "18.18.1", "engines": { "node": "16.x || 18.x || >=20.0" }, @@ -32,17 +32,14 @@ "test": "yarn lint && yarn test-unit", "test-ci": "yarn test && yarn test-cypress", "test-unit": "node ./scripts/test-unit", - "test-a11y": "node ./scripts/a11y-testing", "test-staged": "yarn lint && node scripts/test-staged.js", "test-cypress": "node ./scripts/test-cypress", "test-cypress-dev": "yarn test-cypress --dev", "test-cypress-a11y": "yarn test-cypress --a11y", "combine-test-coverage": "sh ./scripts/combine-coverage.sh", - "start-test-server": "BABEL_MODULES=false NODE_ENV=puppeteer NODE_OPTIONS=--max-old-space-size=4096 webpack-dev-server --config src-docs/webpack.config.js --port 9999", "yo-component": "yo ./generator-eui/app/component.js", "update-token-changelog": "node ./scripts/update-token-changelog.js", "update-changelog-manual": "node -e \"require('./scripts/update-changelog').manualChangelog('${npm_config_release}')\"", - "start-test-server-and-a11y-test": "cross-env WAIT_ON_TIMEOUT=600000 start-server-and-test start-test-server http-get://localhost:9999 test-a11y", "yo-doc": "yo ./generator-eui/app/documentation.js", "yo-changelog": "yo ./generator-eui/changelog/index.js", "release": "node ./scripts/release.js", @@ -99,7 +96,6 @@ "vfile": "^4.2.0" }, "devDependencies": { - "@axe-core/puppeteer": "^4.4.2", "@babel/cli": "^7.21.5", "@babel/core": "^7.21.8", "@babel/plugin-proposal-class-properties": "^7.18.6", @@ -145,11 +141,11 @@ "@types/classnames": "^2.3.1", "@types/enzyme": "^3.10.5", "@types/jest": "^24.0.6", - "@types/node": "^10.17.5", "@types/react": "^18.2.14", "@types/react-dom": "^18.2.6", "@types/react-is": "^17.0.3", "@types/react-router-dom": "^5.3.3", + "@types/stylis": "^4.2.1", "@types/testing-library__jest-dom": "^5.14.3", "@types/url-parse": "^1.4.8", "@types/uuid": "^8.3.0", @@ -176,7 +172,7 @@ "cross-env": "^7.0.2", "css-loader": "^6.7.1", "cssnano": "^4.1.10", - "cypress": "^12.17.2", + "cypress": "^13.3.1", "cypress-axe": "^1.0.0", "cypress-plugin-tab": "^1.0.5", "cypress-real-events": "^1.7.0", @@ -221,7 +217,6 @@ "prettier": "^2.8.8", "process": "^0.11.10", "prop-types": "^15.6.0", - "puppeteer": "^5.5.0", "raw-loader": "^4.0.1", "react": "^18.2.0", "react-16": "npm:react@^16.14.0", diff --git a/scripts/a11y-testing.js b/scripts/a11y-testing.js deleted file mode 100644 index b24125830d4..00000000000 --- a/scripts/a11y-testing.js +++ /dev/null @@ -1,106 +0,0 @@ -const chalk = require('chalk'); -const puppeteer = require('puppeteer'); -const { AxePuppeteer } = require('@axe-core/puppeteer'); - -const docsPages = async (root, page) => { - const pagesToSkip = [ - `${root}#/display/aspect-ratio`, // Has issues with the embedded audio player - `${root}#/layout/accordion`, // Has an issue with ARIA attributes - `${root}#/templates/page-template` // Has multiple `main` elements that we don't want to remove for bad copy/paste code - ]; - - return [ - root, - ...(await page.$$eval('nav a', (anchors) => anchors.map((a) => a.href))), - ].filter((link) => !pagesToSkip.includes(link)); -}; - -const printResult = (violations) => { - const violationData = violations.map( - ({ id, impact, description, nodes }) => ({ - id, - impact, - description, - nodes: nodes.length - })); - console.table(violationData); -} - -(async () => { - let totalViolationsCount = 0; - let root = 'http://localhost:9999/'; - let browser; - let page; - - try { - browser = await puppeteer.launch({ args: ['--no-sandbox'] }); - page = await browser.newPage(); - - await page.setBypassCSP(true); - } catch (e) { - console.log(chalk.red('Failed to setup puppeteer')); - console.log(e); - process.exit(1); - } - - try { - await page.goto(root); - } catch (e) { - root = 'http://localhost:8030/'; - try { - await page.goto(root); - } catch (e) { - console.log( - chalk.red( - 'No local server found. Expecting localhost:9999 or localhost:8030 to resolve.' - ) - ); - process.exit(1); - } - } - const links = await docsPages(root, page); - - for (const link of links) { - await page.goto(link); - - const { violations } = await new AxePuppeteer(page) - .options({ - runOnly: { - type: 'tag', - values: ['section508', 'wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'] - }, - rules: { - 'color-contrast': { enabled: false }, - 'scrollable-region-focusable': { enabled: false }, - 'frame-title': { enabled: false }, // axe reports 18 page violations, but no