mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 11:05:39 -04:00
Moved sidebar_pop to styles.
This commit is contained in:
parent
3fde5ff6a4
commit
23037f2600
4 changed files with 44 additions and 27 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React, { FunctionComponent } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { EuiTabbedContent } from '@elastic/eui';
|
||||
import { useEuiTheme, EuiTabbedContent } from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
// @ts-expect-error unconverted component
|
||||
|
@ -15,6 +15,7 @@ import { Datasource } from '../../datasource';
|
|||
// @ts-expect-error unconverted component
|
||||
import { FunctionFormList } from '../../function_form_list';
|
||||
import { PositionedElement } from '../../../../types';
|
||||
import { sidebarPopStylesFactory } from '../sidebar_pop.styles';
|
||||
|
||||
const strings = {
|
||||
getDataTabLabel: () =>
|
||||
|
@ -39,23 +40,22 @@ interface Props {
|
|||
}
|
||||
|
||||
export const ElementSettings: FunctionComponent<Props> = ({ element }) => {
|
||||
const { euiTheme } = useEuiTheme();
|
||||
const tabs = [
|
||||
{
|
||||
id: 'edit',
|
||||
name: strings.getDisplayTabLabel(),
|
||||
content: (
|
||||
<div className="canvasSidebar__pop">
|
||||
<div className="canvasSidebar--args">
|
||||
<div css={sidebarPopStylesFactory(euiTheme)}>
|
||||
<FunctionFormList element={element} />
|
||||
</div>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
id: 'data',
|
||||
name: strings.getDataTabLabel(),
|
||||
content: (
|
||||
<div className="canvasSidebar__pop">
|
||||
<div css={sidebarPopStylesFactory(euiTheme)}>
|
||||
<Datasource />
|
||||
</div>
|
||||
),
|
||||
|
|
|
@ -6,10 +6,11 @@
|
|||
*/
|
||||
|
||||
import React, { Fragment, FC } from 'react';
|
||||
import { EuiTabbedContent, EuiTitle, EuiSpacer } from '@elastic/eui';
|
||||
import { useEuiTheme, EuiTabbedContent, EuiTitle, EuiSpacer } from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { GeneralConfig } from './general_config';
|
||||
import { FilterConfig } from './filter_config';
|
||||
import { sidebarPopStylesFactory } from '../sidebar_pop.styles';
|
||||
|
||||
const strings = {
|
||||
getTitle: () =>
|
||||
|
@ -27,12 +28,14 @@ const strings = {
|
|||
};
|
||||
|
||||
export const GlobalConfig: FC = () => {
|
||||
const { euiTheme } = useEuiTheme();
|
||||
|
||||
const tabs = [
|
||||
{
|
||||
id: 'general',
|
||||
name: strings.getGeneralLabel(),
|
||||
content: (
|
||||
<div className="canvasSidebar__pop">
|
||||
<div css={sidebarPopStylesFactory(euiTheme)}>
|
||||
<EuiSpacer size="m" />
|
||||
<GeneralConfig />
|
||||
</div>
|
||||
|
@ -42,7 +45,7 @@ export const GlobalConfig: FC = () => {
|
|||
id: 'filter',
|
||||
name: strings.getFilterLabel(),
|
||||
content: (
|
||||
<div className="canvasSidebar__pop">
|
||||
<div css={sidebarPopStylesFactory(euiTheme)}>
|
||||
<FilterConfig />
|
||||
</div>
|
||||
),
|
||||
|
|
|
@ -9,21 +9,3 @@
|
|||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.canvasSidebar__pop {
|
||||
animation: sidebarPop $euiAnimSpeedFast $euiAnimSlightResistance;
|
||||
}
|
||||
|
||||
@keyframes sidebarPop {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
1% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* 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; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { EuiThemeComputed } from '@elastic/eui';
|
||||
import { css, keyframes } from '@emotion/react';
|
||||
|
||||
export const sidebarPanelClassName = 'canvasSidebar__panel';
|
||||
export const sidebarAccordionClassName = 'canvasSidebar__accordion';
|
||||
export const sidebarExpandableClassName = 'canvasSidebar__expandable';
|
||||
export const sidebarFiltersClassName = 'filtersSidebar__accordion';
|
||||
|
||||
const sidebarPopKeyFrames = keyframes`
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
1% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
`;
|
||||
|
||||
export const sidebarPopStylesFactory = (theme: EuiThemeComputed) => css`
|
||||
animation: ${sidebarPopKeyFrames} ${theme.animation.fast} ${theme.animation.resistance};
|
||||
`;
|
Loading…
Add table
Add a link
Reference in a new issue