@@ -16,7 +16,7 @@ import classNames from 'classnames';
1616import moment , { LocaleSpecifier , Moment } from 'moment' ; // eslint-disable-line import/named
1717import dateMath from '@elastic/datemath' ;
1818
19- import { useEuiMemoizedStyles } from '../../../services' ;
19+ import { useEuiMemoizedStyles , RenderWithEuiTheme } from '../../../services' ;
2020import { isObject } from '../../../services/predicate' ;
2121import { EuiI18nConsumer } from '../../context' ;
2222import { CommonProps } from '../../common' ;
@@ -638,39 +638,49 @@ export class EuiSuperDatePickerInternal extends Component<
638638 endMoment ?. format ( dateFormat ) ;
639639
640640 return (
641- < EuiFormControlLayout { ...formControlLayoutProps } >
642- { ! isQuickSelectOnly && (
643- < EuiToolTip
644- css = { styles . euiSuperDatePicker__prettyDurationTooltip }
645- content = { formattedFullRange }
646- display = "block"
647- offset = { styles . prettyDurationToolTipOffset }
648- >
649- < EuiFormControlButton
650- type = "button"
651- className = { classNames ( 'euiSuperDatePicker__prettyFormat' , {
652- 'euiSuperDatePicker__prettyFormat--disabled' : isDisabled ,
653- } ) }
654- compressed = { compressed }
655- data-test-subj = "superDatePickerShowDatesButton"
656- disabled = { ! ! isDisabled }
657- onClick = { this . hidePrettyDuration }
658- onFocus = { onFocus }
659- >
660- { isDisabledDisplay ? (
661- isDisabled . display
662- ) : (
663- < PrettyDuration
664- timeFrom = { start }
665- timeTo = { end }
666- quickRanges = { commonlyUsedRanges }
667- dateFormat = { dateFormat }
668- />
641+ < RenderWithEuiTheme >
642+ { ( euiTheme ) => {
643+ return (
644+ < EuiFormControlLayout { ...formControlLayoutProps } >
645+ { ! isQuickSelectOnly && (
646+ < EuiToolTip
647+ css = { styles . euiSuperDatePicker__prettyDurationTooltip }
648+ content = { formattedFullRange }
649+ display = "block"
650+ offset = { euiTheme . euiTheme . base * 0.5 }
651+ >
652+ < EuiFormControlButton
653+ type = "button"
654+ className = { classNames (
655+ 'euiSuperDatePicker__prettyFormat' ,
656+ {
657+ 'euiSuperDatePicker__prettyFormat--disabled' :
658+ isDisabled ,
659+ }
660+ ) }
661+ compressed = { compressed }
662+ data-test-subj = "superDatePickerShowDatesButton"
663+ disabled = { ! ! isDisabled }
664+ onClick = { this . hidePrettyDuration }
665+ onFocus = { onFocus }
666+ >
667+ { isDisabledDisplay ? (
668+ isDisabled . display
669+ ) : (
670+ < PrettyDuration
671+ timeFrom = { start }
672+ timeTo = { end }
673+ quickRanges = { commonlyUsedRanges }
674+ dateFormat = { dateFormat }
675+ />
676+ ) }
677+ </ EuiFormControlButton >
678+ </ EuiToolTip >
669679 ) }
670- </ EuiFormControlButton >
671- </ EuiToolTip >
672- ) }
673- </ EuiFormControlLayout >
680+ </ EuiFormControlLayout >
681+ ) ;
682+ } }
683+ </ RenderWithEuiTheme >
674684 ) ;
675685 }
676686
0 commit comments