Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EuiToolTip] Convert to Emotion styling #6104

Merged
merged 21 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ exports[`EuiBetaBadge props size s is rendered 1`] = `

exports[`EuiBetaBadge props tooltip and anchorProps are rendered 1`] = `
<span
class="euiToolTipAnchor customAnchorClass"
class="euiToolTipAnchor customAnchorClass emotion-euiToolTipAnchor-inlineBlock"
data-test-subj="DTS"
>
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`CollapsedItemActions render 1`] = `
class="euiPopover__anchor css-16vtueo-render"
>
<span
class="euiToolTipAnchor"
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<button
aria-label="All actions"
Expand Down
415 changes: 299 additions & 116 deletions src/components/code/__snapshots__/code_block.test.tsx.snap

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions src/components/datagrid/__snapshots__/data_grid.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ Array [
class="euiPopover__anchor css-16vtueo-render"
>
<span
class="euiToolTipAnchor"
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<button
aria-label="Display options"
Expand All @@ -1009,7 +1009,7 @@ Array [
</div>
</div>
<span
class="euiToolTipAnchor"
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<button
aria-label="Enter fullscreen"
Expand Down Expand Up @@ -1435,7 +1435,7 @@ Array [
class="euiPopover__anchor css-16vtueo-render"
>
<span
class="euiToolTipAnchor"
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<button
aria-label="Display options"
Expand All @@ -1454,7 +1454,7 @@ Array [
</div>
</div>
<span
class="euiToolTipAnchor"
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<button
aria-label="Enter fullscreen"
Expand Down Expand Up @@ -2221,7 +2221,7 @@ Array [
class="euiPopover__anchor css-16vtueo-render"
>
<span
class="euiToolTipAnchor"
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<button
aria-label="Display options"
Expand All @@ -2240,7 +2240,7 @@ Array [
</div>
</div>
<span
class="euiToolTipAnchor"
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<button
aria-label="Enter fullscreen"
Expand Down Expand Up @@ -2665,7 +2665,7 @@ Array [
class="euiPopover__anchor css-16vtueo-render"
>
<span
class="euiToolTipAnchor"
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<button
aria-label="Display options"
Expand All @@ -2684,7 +2684,7 @@ Array [
</div>
</div>
<span
class="euiToolTipAnchor"
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<button
aria-label="Enter fullscreen"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import React, { Component, MouseEventHandler, Ref } from 'react';
import React, { Component, MouseEventHandler, ElementRef } from 'react';
import classNames from 'classnames';

import { EuiButton, EuiButtonProps } from '../../button';
Expand All @@ -15,6 +15,8 @@ import { EuiToolTip, EuiToolTipProps } from '../../tool_tip';
import { EuiBreakpointSize } from '../../../services/breakpoint';
import { EuiHideFor, EuiShowFor } from '../../responsive';

type ToolTipRef = ElementRef<typeof EuiToolTip> | null;

type EuiSuperUpdateButtonInternalProps = {
isDisabled?: boolean;
isLoading?: boolean;
Expand Down Expand Up @@ -58,7 +60,7 @@ export class EuiSuperUpdateButton extends Component<
};
_isMounted = false;
tooltipTimeout: number | undefined;
tooltip: EuiToolTip | null = null;
tooltip: ToolTipRef = null;

componentWillUnmount() {
this._isMounted = false;
Expand All @@ -82,7 +84,7 @@ export class EuiSuperUpdateButton extends Component<
}
}

setTootipRef: Ref<EuiToolTip> = (node) => {
setTootipRef = (node: ToolTipRef) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is much nicer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's actually required for functional components, but I left it in after reverting to a class component.

this.tooltip = node;
};

Expand Down
1 change: 0 additions & 1 deletion src/components/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@
@import 'suggest/index';
@import 'table/index';
@import 'tabs/index';
@import 'tool_tip/index';
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ exports[`EuiKeyPadMenuItem is rendered 1`] = `

exports[`EuiKeyPadMenuItem props betaBadge renders 1`] = `
<span
class="euiToolTipAnchor"
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<button
class="euiKeyPadMenuItem euiKeyPadMenuItem--hasBetaBadge"
Expand Down Expand Up @@ -128,7 +128,7 @@ exports[`EuiKeyPadMenuItem props betaBadge renders 1`] = `

exports[`EuiKeyPadMenuItem props betaBadge renders extra betaBadgeTooltipProps 1`] = `
<span
class="euiToolTipAnchor customTooltipClass"
class="euiToolTipAnchor customTooltipClass emotion-euiToolTipAnchor-inlineBlock"
>
<button
class="euiKeyPadMenuItem euiKeyPadMenuItem--hasBetaBadge"
Expand Down Expand Up @@ -161,7 +161,7 @@ exports[`EuiKeyPadMenuItem props betaBadge renders extra betaBadgeTooltipProps 1

exports[`EuiKeyPadMenuItem props betaBadge renders with betaBadgeIconType 1`] = `
<span
class="euiToolTipAnchor"
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<button
class="euiKeyPadMenuItem euiKeyPadMenuItem--hasBetaBadge"
Expand Down Expand Up @@ -199,7 +199,7 @@ exports[`EuiKeyPadMenuItem props betaBadge renders with betaBadgeIconType 1`] =

exports[`EuiKeyPadMenuItem props betaBadge renders with betaBadgeTooltipContent 1`] = `
<span
class="euiToolTipAnchor"
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<button
class="euiKeyPadMenuItem euiKeyPadMenuItem--hasBetaBadge"
Expand Down
Loading