diff --git a/CHANGELOG.md b/CHANGELOG.md index 2875cb088c7..651f8e83c48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,30 @@ - Added `EuiAutoSizer` component for setting dimensions on virtualized lists ([#5278](https://github.com/elastic/eui/pull/5278)) - Added `testenv` mock for `EuiAutoSizer` ([#5278](https://github.com/elastic/eui/pull/5278)) +- Changed render of `useEuiTextDiff` to a `span` instead of `div` ([#5323](https://github.com/elastic/eui/pull/5323)) +- Changed change prop type of `children` for `EuiMark` from `string` to `ReactNode` ([#5323](https://github.com/elastic/eui/pull/5323)) + +**Bug fixes** + +- Fixed styling of `align: center` for mobile version of `EuiTableRowCell` ([#5323](https://github.com/elastic/eui/pull/5323)) + +**Breaking changes** + +- Removed `EuiCodeEditor` ([#5323](https://github.com/elastic/eui/pull/5323)) +- Removed `betaBadgeLabel`, `betaBadgeTooltipContent`, `betaBadgeTitle` props from `EuiCard` ([#5323](https://github.com/elastic/eui/pull/5323)) +- Removed `EuiLoadingKibana` ([#5323](https://github.com/elastic/eui/pull/5323)) +- Removed `secondary` color prop options ([#5323](https://github.com/elastic/eui/pull/5323)) +- Removed `subdued` color prop option from `EuiButtonIcon` ([#5323](https://github.com/elastic/eui/pull/5323)) +- Removed `panelPaddingSize` from `EuiPageContent` ([#5323](https://github.com/elastic/eui/pull/5323)) +- Removed `makeId` ([#5323](https://github.com/elastic/eui/pull/5323)) +- Removed mobile-only props from `EuiTableRowCell` ([#5323](https://github.com/elastic/eui/pull/5323)) ## [`40.1.0`](https://github.com/elastic/eui/tree/v40.1.0) - Added styling support for `valign` prop on `EuiTableRowCell` ([#5283](https://github.com/elastic/eui/pull/5283)) - Added `remark-breaks` plugin to mimic GitHub-flavored markdown line breaks within `EuiMarkdownEditor` ([#5272](https://github.com/elastic/eui/pull/5272)) - Removed `EuiErrorBoundary` from `EuiDatePicker` when unsupported props are used ([#5318](https://github.com/elastic/eui/pull/5318)) - + **Bug fixes** - Fixed default text alignment in `EuiTableRowCell` on Safari ([#5283](https://github.com/elastic/eui/pull/5283)) @@ -37,7 +54,7 @@ ## [`39.1.2`](https://github.com/elastic/eui/tree/v39.1.2) **Note: this release is a backport containing changes originally made in `40.1.0`** - + **Bug fixes** - Fixed `EuiDataGrid` to dynamically update row heights when set to `auto` ([#5281](https://github.com/elastic/eui/pull/5281)) diff --git a/package.json b/package.json index e9e9ea8ffc8..925bb759913 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,6 @@ "mdast-util-to-hast": "^10.0.0", "numeral": "^2.0.6", "prop-types": "^15.6.0", - "react-ace": "^7.0.5", "react-beautiful-dnd": "^13.0.0", "react-dropzone": "^11.2.0", "react-focus-on": "^3.5.0", diff --git a/src-docs/src/routes.js b/src-docs/src/routes.js index 02453ef34b4..f8ef9fc84c4 100644 --- a/src-docs/src/routes.js +++ b/src-docs/src/routes.js @@ -56,8 +56,6 @@ import { CardExample } from './views/card/card_example'; import { CallOutExample } from './views/call_out/call_out_example'; -import { CodeEditorExample } from './views/code_editor/code_editor_example'; - import { CodeExample } from './views/code/code_example'; import { CollapsibleNavExample } from './views/collapsible_nav/collapsible_nav_example'; @@ -480,7 +478,6 @@ const navigation = [ MarkdownFormatExample, MarkdownEditorExample, MarkdownPluginExample, - CodeEditorExample, CodeExample, ].map((example) => createExample(example)), }, diff --git a/src-docs/src/services/playground/knobs.js b/src-docs/src/services/playground/knobs.js index 757b7b89b37..2c8d1110599 100644 --- a/src-docs/src/services/playground/knobs.js +++ b/src-docs/src/services/playground/knobs.js @@ -438,7 +438,7 @@ const KnobColumn = ({ state, knobNames, error, set, isPlayground }) => { textOnly={false} mobileOptions={{ header: false, - fullWidth: true, + width: '100%', }} >
diff --git a/src-docs/src/views/button/button_toggle_aria.js b/src-docs/src/views/button/button_toggle_aria.js index 8092955f012..9ed91f4ee65 100644 --- a/src-docs/src/views/button/button_toggle_aria.js +++ b/src-docs/src/views/button/button_toggle_aria.js @@ -26,7 +26,7 @@ export default () => { title="Autosave" iconType="save" aria-pressed={toggle3On} - color={toggle3On ? 'primary' : 'subdued'} + color={toggle3On ? 'primary' : 'text'} onClick={() => { setToggle3On((isOn) => !isOn); }} diff --git a/src-docs/src/views/button/guidelines.js b/src-docs/src/views/button/guidelines.js index b21bd265452..2aab0cb53e1 100644 --- a/src-docs/src/views/button/guidelines.js +++ b/src-docs/src/views/button/guidelines.js @@ -356,7 +356,7 @@ export default () => ( Continue    - + Save and complete
@@ -434,7 +434,7 @@ export default () => ( - + Add thing @@ -447,7 +447,7 @@ export default () => ( - + Cancel @@ -458,7 +458,7 @@ export default () => ( - + Create thing @@ -471,7 +471,7 @@ export default () => ( - + Delete @@ -495,7 +495,7 @@ export default () => ( - + Remove   ( - + Save   - + Save and complete diff --git a/src-docs/src/views/card/card_beta.js b/src-docs/src/views/card/card_beta.tsx similarity index 54% rename from src-docs/src/views/card/card_beta.js rename to src-docs/src/views/card/card_beta.tsx index 610eb50d04b..cead3eb18a4 100644 --- a/src-docs/src/views/card/card_beta.js +++ b/src-docs/src/views/card/card_beta.tsx @@ -7,31 +7,29 @@ import { EuiFlexItem, } from '../../../../src/components'; -const icons = ['dashboard', 'monitoring']; -const badges = [null, 'Beta']; - -const cardNodes = icons.map(function (item, index) { - return ( - +export default () => ( + + } - title={`Kibana ${item}`} + icon={} + title="Dashboards" description="Example of a card's description. Stick to one or two sentences." - betaBadgeLabel={badges[index]} - betaBadgeTooltipContent={ - badges[index] - ? 'This module is not GA. Please help us by reporting any bugs.' - : undefined - } onClick={() => {}} /> - ); -}); - -export default () => ( - - {cardNodes} + + } + title="Monitoring" + description="Example of a card's description. Stick to one or two sentences." + betaBadgeProps={{ + label: 'Beta', + tooltipContent: + 'This module is not GA. Please help us by reporting any bugs.', + }} + onClick={() => {}} + /> + } @@ -41,9 +39,9 @@ export default () => ( betaBadgeProps={{ href: 'http://www.elastic.co/subscriptions', target: '_blank', + label: 'Basic', + tooltipContent: 'This feature requires a Basic License', }} - betaBadgeLabel="Basic" - betaBadgeTooltipContent="This feature requires a Basic License" onClick={() => {}} /> diff --git a/src-docs/src/views/card/card_display.js b/src-docs/src/views/card/card_display.tsx similarity index 87% rename from src-docs/src/views/card/card_display.js rename to src-docs/src/views/card/card_display.tsx index ba04f40435a..5e6cbedf567 100644 --- a/src-docs/src/views/card/card_display.js +++ b/src-docs/src/views/card/card_display.tsx @@ -38,8 +38,11 @@ export default () => ( title="Transparent" display="transparent" description="This one doesn't have a background color anymore." - betaBadgeLabel="Beta" - betaBadgeTooltipContent="This module is not GA. Please help us by reporting any bugs." + betaBadgeProps={{ + label: 'Beta', + tooltipContent: + 'This module is not GA. Please help us by reporting any bugs.', + }} onClick={() => {}} /> diff --git a/src-docs/src/views/card/card_example.js b/src-docs/src/views/card/card_example.js index 6cb0cbd2817..f99a8d7c973 100644 --- a/src-docs/src/views/card/card_example.js +++ b/src-docs/src/views/card/card_example.js @@ -242,11 +242,11 @@ export const CardExample = { text: (

If the card links to or references a module that is not GA (beta, lab, - etc), you can add a betaBadgeLabel and{' '} - betaBadgeTooltipContent to the card and it will - properly create and position an EuiBetaBadge. If you - want to change the title of the tooltip, supply a{' '} - betaBadgeTitle prop. + etc), you can add a betaBadgeProps.label and{' '} + betaBadgeProps.tooltipContent to the card and it + will properly create and position an EuiBetaBadge. If + you want to change the title of the tooltip, supply a{' '} + betaBadgeProps.title prop.

), props: { EuiCard }, @@ -259,8 +259,10 @@ export const CardExample = { title="title" description="description" onClick={handleClick} - betaBadgeLabel="betaBadgeLabel" - betaBadgeTooltipContent={betaBadgeTooltipContent} + betaBadgeProps={{ + label: 'betaBadgeLabel', + toolTipContent: 'betaBadgeTooltipContent', + }} />`, }, { diff --git a/src-docs/src/views/card/playground.js b/src-docs/src/views/card/playground.js index d31857d4d88..3e0340ae6d9 100644 --- a/src-docs/src/views/card/playground.js +++ b/src-docs/src/views/card/playground.js @@ -52,11 +52,6 @@ export const cardConfig = () => { type: PropTypes.String, }; - propsToUse.betaBadgeTooltipContent = { - ...propsToUse.betaBadgeTooltipContent, - type: PropTypes.String, - }; - propsToUse.onClick = simulateFunction(propsToUse.onClick); propsToUse.display = createOptionalEnum(propsToUse.display); diff --git a/src-docs/src/views/code_editor/code_editor.js b/src-docs/src/views/code_editor/code_editor.js deleted file mode 100644 index fcef8266302..00000000000 --- a/src-docs/src/views/code_editor/code_editor.js +++ /dev/null @@ -1,33 +0,0 @@ -import React, { useState } from 'react'; - -import { EuiCodeEditor } from '../../../../src/components'; -import 'brace/theme/github'; -import 'brace/mode/javascript'; -import 'brace/snippets/javascript'; -import 'brace/ext/language_tools'; - -export default () => { - const [value, updateValue] = useState(''); - - const onChange = (value) => { - updateValue(value); - }; - - return ( - {}} - aria-label="Code Editor" - /> - ); -}; diff --git a/src-docs/src/views/code_editor/code_editor_example.js b/src-docs/src/views/code_editor/code_editor_example.js deleted file mode 100644 index 7f9109c8d55..00000000000 --- a/src-docs/src/views/code_editor/code_editor_example.js +++ /dev/null @@ -1,32 +0,0 @@ -import React from 'react'; - -import { EuiCode, EuiLink, EuiCallOut } from '../../../../src/components'; - -export const CodeEditorExample = { - title: 'Code editor', - sections: [ - { - text: ( - <> - -

- The EuiCodeEditor, a wrapper of{' '} - react-ace, has been deprecated and will be - removed in a{' '} - - future release - - . -
- If you are a Kibana developer, we recommend using the{' '} - - @kbn/monaco package - {' '} - within the Kibana codebase. -

-
- - ), - }, - ], -}; diff --git a/src-docs/src/views/code_editor/custom_mode.js b/src-docs/src/views/code_editor/custom_mode.js deleted file mode 100644 index 0faa4659055..00000000000 --- a/src-docs/src/views/code_editor/custom_mode.js +++ /dev/null @@ -1,30 +0,0 @@ -import React, { useState } from 'react'; -import { EuiCodeEditor } from '../../../../src/components'; -import 'brace/mode/text'; -import 'brace/theme/github'; - -const TextMode = window.ace.acequire('ace/mode/text').Mode; -class MyCustomAceMode extends TextMode { - // Your custom mode definition goes here. - // See https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode -} - -export default () => { - const [value, updateValue] = useState(''); - - const onChange = (value) => { - updateValue(value); - }; - - return ( - - ); -}; diff --git a/src-docs/src/views/code_editor/playground.js b/src-docs/src/views/code_editor/playground.js deleted file mode 100644 index f742c503308..00000000000 --- a/src-docs/src/views/code_editor/playground.js +++ /dev/null @@ -1,147 +0,0 @@ -import { PropTypes } from 'react-view'; -import { EuiCodeEditor } from '../../../../src/components/'; -import { - propUtilityForPlayground, - dummyFunction, -} from '../../services/playground'; - -import 'brace/theme/github'; -import 'brace/theme/cobalt'; -import 'brace/theme/dawn'; -import 'brace/theme/eclipse'; -import 'brace/theme/iplastic'; -import 'brace/theme/monokai'; -import 'brace/theme/solarized_dark'; -import 'brace/theme/solarized_light'; -import 'brace/theme/terminal'; -import 'brace/theme/twilight'; -import 'brace/theme/xcode'; - -import 'brace/mode/c_cpp'; -import 'brace/mode/csharp'; -import 'brace/mode/css'; -import 'brace/mode/dart'; -import 'brace/mode/golang'; -import 'brace/mode/html'; -import 'brace/mode/java'; -import 'brace/mode/javascript'; -import 'brace/mode/less'; -import 'brace/mode/text'; -import 'brace/mode/typescript'; - -import 'brace/snippets/javascript'; -import 'brace/snippets/typescript'; -import 'brace/snippets/java'; -import 'brace/snippets/c_cpp'; -import 'brace/snippets/css'; - -export const codeEditorConfig = () => { - const docgenInfo = Array.isArray(EuiCodeEditor.__docgenInfo) - ? EuiCodeEditor.__docgenInfo[0] - : EuiCodeEditor.__docgenInfo; - const propsToUse = propUtilityForPlayground(docgenInfo.props); - - propsToUse.value = { - ...propsToUse.value, - value: '', - type: PropTypes.String, - }; - - propsToUse.onChange = { - ...propsToUse.onChange, - type: PropTypes.Custom, - value: undefined, - custom: { - use: 'switch', - label: 'Simulate', - }, - }; - - propsToUse.onBlur = { - ...propsToUse.onBlur, - type: PropTypes.Custom, - value: undefined, - custom: { - ...propsToUse.onBlur.custom, - use: 'switch', - label: 'Simulate', - }, - }; - - propsToUse.onFocus = { - ...propsToUse.onFocus, - type: PropTypes.Custom, - value: undefined, - custom: { - ...propsToUse.onFocus.custom, - use: 'switch', - label: 'Simulate', - }, - }; - - propsToUse.theme = { - ...propsToUse.theme, - type: PropTypes.String, - custom: { - ...propsToUse.theme.custom, - helpText: - 'Some available themes are cobalt, dawn, eclipse, github, iplastic, monokai, solarozed_dark, solarized_light, terminal, xcode', - }, - }; - propsToUse.mode = { - ...propsToUse.mode, - type: PropTypes.String, - custom: { - ...propsToUse.mode.custom, - helpText: - 'Some available modes are c_cpp, csharp, css, dart, golang, html, java, javascript, less, text, typescript', - }, - }; - - return { - config: { - componentName: 'EuiCodeEditor', - props: propsToUse, - scope: { - EuiCodeEditor, - }, - imports: { - '@elastic/eui': { - named: ['EuiCodeEditor'], - }, - 'brace/theme/cobalt': {}, - 'brace/theme/dawn': {}, - 'brace/theme/eclipse': {}, - 'brace/theme/github': {}, - 'brace/theme/iplastic': {}, - 'brace/theme/monokai': {}, - 'brace/theme/solarized_dark': {}, - 'brace/theme/solarized_light': {}, - 'brace/theme/terminal': {}, - 'brace/theme/twilight': {}, - 'brace/theme/xcode': {}, - 'brace/mode/c_cpp': {}, - 'brace/mode/csharp': {}, - 'brace/mode/css': {}, - 'brace/mode/dart': {}, - 'brace/mode/golang': {}, - 'brace/mode/html': {}, - 'brace/mode/java': {}, - 'brace/mode/javascript': {}, - 'brace/mode/less': {}, - 'brace/mode/text': {}, - 'brace/mode/typescript': {}, - 'brace/snippets/javascript': {}, - 'brace/snippets/typescript': {}, - 'brace/snippets/java': {}, - 'brace/snippets/c_cpp': {}, - 'brace/snippets/css': {}, - }, - customProps: { - onChange: dummyFunction, - onBlur: dummyFunction, - onFocus: dummyFunction, - }, - }, - }; -}; diff --git a/src-docs/src/views/code_editor/read_only.js b/src-docs/src/views/code_editor/read_only.js deleted file mode 100644 index 46a2177bb41..00000000000 --- a/src-docs/src/views/code_editor/read_only.js +++ /dev/null @@ -1,22 +0,0 @@ -import React from 'react'; - -import { EuiCodeEditor } from '../../../../src/components'; - -import 'brace/mode/less'; -import 'brace/theme/github'; - -export default () => { - const value = '

This code is read only

'; - - return ( - - ); -}; diff --git a/src-docs/src/views/comment/comment.tsx b/src-docs/src/views/comment/comment.tsx index 441530fd236..701dda0f4b8 100644 --- a/src-docs/src/views/comment/comment.tsx +++ b/src-docs/src/views/comment/comment.tsx @@ -16,7 +16,7 @@ const copyAction = ( ); diff --git a/src-docs/src/views/comment/comment_list.tsx b/src-docs/src/views/comment/comment_list.tsx index e5c110fbe09..50082f917a9 100644 --- a/src-docs/src/views/comment/comment_list.tsx +++ b/src-docs/src/views/comment/comment_list.tsx @@ -22,7 +22,7 @@ const copyAction = ( ); diff --git a/src-docs/src/views/expression/truncate.js b/src-docs/src/views/expression/truncate.js index 7f46a8fcf82..738e1f01515 100644 --- a/src-docs/src/views/expression/truncate.js +++ b/src-docs/src/views/expression/truncate.js @@ -24,7 +24,6 @@ export default () => ( {}} @@ -38,7 +37,6 @@ export default () => ( {}} diff --git a/src-docs/src/views/guidelines/accessibility.js b/src-docs/src/views/guidelines/accessibility.js index 68f05e08882..c02bc0defe2 100644 --- a/src-docs/src/views/guidelines/accessibility.js +++ b/src-docs/src/views/guidelines/accessibility.js @@ -348,7 +348,7 @@ export default { text={ <> Though unique, this does not provide enough context.
{' '} - + Use: Watchers - Management - Kibana @@ -367,7 +367,7 @@ export default { <> Although it provides all the context, putting the most important bit at the end is hard to find.
{' '} - + Use: Spaces - Management - Kibana @@ -386,7 +386,7 @@ export default { <> Although this provides all the context and in a good order, a title is not the place for any extra words.
{' '} - + Use: Reporting - Management - Kibana diff --git a/src-docs/src/views/guidelines/colors.js b/src-docs/src/views/guidelines/colors.js index 290e7e34cbc..d8ea4891aa2 100644 --- a/src-docs/src/views/guidelines/colors.js +++ b/src-docs/src/views/guidelines/colors.js @@ -128,8 +128,7 @@ export default ({ selectedTheme }) => { showTextVariants={showTextVariants} >

- Also known as euiColorSecondary. Use this for - success graphics and additive actions. + Use this for success graphics and additive actions.

diff --git a/src-docs/src/views/health/playground.js b/src-docs/src/views/health/playground.js index cc39832201d..7108c401371 100644 --- a/src-docs/src/views/health/playground.js +++ b/src-docs/src/views/health/playground.js @@ -19,7 +19,6 @@ export default () => { options: { default: 'default', primary: 'primary', - secondary: 'secondary', success: 'success', accent: 'accent', warning: 'warning', diff --git a/src-docs/src/views/i18n/i18n_attribute.js b/src-docs/src/views/i18n/i18n_attribute.js index 5100bcf9606..d2de2b6626b 100644 --- a/src-docs/src/views/i18n/i18n_attribute.js +++ b/src-docs/src/views/i18n/i18n_attribute.js @@ -16,29 +16,33 @@ export default () => {

useEuiI18n used in an attribute

-

- - This text field's placeholder reads from{' '} - euiI18nAttribute.placeholderName - - } - > - - -

- - + + + + + This text field's placeholder reads from{' '} + euiI18nAttribute.placeholderName + + } + > + + + +

EuiI18n used as a render prop

+ + + {(placeholderName) => ( { onClick={() => {}} isActive extraAction={{ - color: 'subdued', + color: 'text', onClick: link1Clicked, iconType: favorite1 === 'link1' ? 'starFilled' : 'starEmpty', iconSize: 's', @@ -82,7 +82,7 @@ export default () => { onClick={() => {}} label="EUI button link" extraAction={{ - color: 'subdued', + color: 'text', onClick: link2Clicked, iconType: favorite2 === 'link2' ? 'starFilled' : 'starEmpty', iconSize: 's', @@ -98,7 +98,7 @@ export default () => { onClick={() => {}} label="EUI button link" extraAction={{ - color: 'subdued', + color: 'text', onClick: link3Clicked, iconType: favorite3 === 'link3' ? 'starFilled' : 'starEmpty', iconSize: 's', @@ -113,7 +113,7 @@ export default () => { iconType="broom" label="EUI button link" extraAction={{ - color: 'subdued', + color: 'text', onClick: link4Clicked, iconType: favorite4 === 'link4' ? 'starFilled' : 'starEmpty', iconSize: 's', @@ -129,7 +129,7 @@ export default () => { isDisabled label="EUI button link" extraAction={{ - color: 'subdued', + color: 'text', onClick: () => {}, iconType: 'starEmpty', iconSize: 's', diff --git a/src-docs/src/views/notification_event/notification_event_props_methods.js b/src-docs/src/views/notification_event/notification_event_props_methods.js index b7e618c2257..943a248861a 100644 --- a/src-docs/src/views/notification_event/notification_event_props_methods.js +++ b/src-docs/src/views/notification_event/notification_event_props_methods.js @@ -50,7 +50,7 @@ export default () => {