From 190a43eb462ca930f1b75f628a9c1459786f157f Mon Sep 17 00:00:00 2001 From: Shrey Dubey <53302612+shrey@users.noreply.github.com> Date: Thu, 25 Jun 2020 22:16:14 +0530 Subject: [PATCH] [EuiCode] and [EuiCodeBlock] updated the props (#3647) * [EuiCode] updated the props to reflect used * Updated changelog * Updated changes * Fixed exporting * Fixed lint * CL update Co-authored-by: Greg Thompson --- CHANGELOG.md | 1 + src/components/code/_code_block.tsx | 2 +- src/components/code/code.tsx | 8 -------- src/components/code/code_block.tsx | 7 +++++++ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3184e97155f..6e649171278 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [`master`](https://github.com/elastic/eui/tree/master) - Added `gutterSize` prop to `EuiFacetGroup` ([#3639](https://github.com/elastic/eui/pull/3639)) +- Updated props of `EuiCode` and `EuiCodeBlock` to reflect only functional props ([#3647](https://github.com/elastic/eui/pull/3647)) **Bug fixes** diff --git a/src/components/code/_code_block.tsx b/src/components/code/_code_block.tsx index ac0ec462604..24dd9dc1c52 100644 --- a/src/components/code/_code_block.tsx +++ b/src/components/code/_code_block.tsx @@ -41,7 +41,7 @@ import { keys } from '../../services'; import { EuiI18n } from '../i18n'; import { EuiInnerText } from '../inner_text'; import { keysOf } from '../common'; -import { FontSize, PaddingSize } from './code'; +import { FontSize, PaddingSize } from './code_block'; const fontSizeToClassNameMap = { s: 'euiCodeBlock--fontSmall', diff --git a/src/components/code/code.tsx b/src/components/code/code.tsx index abb156b4a31..4bbaffd3f77 100644 --- a/src/components/code/code.tsx +++ b/src/components/code/code.tsx @@ -23,22 +23,14 @@ import React, { FunctionComponent, HTMLAttributes } from 'react'; import { EuiCodeBlockImpl } from './_code_block'; -export type FontSize = 's' | 'm' | 'l'; -export type PaddingSize = 'none' | 's' | 'm' | 'l'; - export interface EuiCodeSharedProps { - paddingSize?: PaddingSize; - /** * Sets the syntax highlighting for a specific language * @see http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html#language-names-and-aliases * for options */ language?: string; - overflowHeight?: number; - fontSize?: FontSize; transparentBackground?: boolean; - isCopyable?: boolean; } interface Props extends EuiCodeSharedProps { diff --git a/src/components/code/code_block.tsx b/src/components/code/code_block.tsx index fa680ed165d..58298a048b7 100644 --- a/src/components/code/code_block.tsx +++ b/src/components/code/code_block.tsx @@ -23,8 +23,15 @@ import { CommonProps } from '../common'; import { EuiCodeBlockImpl } from './_code_block'; import { EuiCodeSharedProps } from './code'; +export type PaddingSize = 'none' | 's' | 'm' | 'l'; +export type FontSize = 's' | 'm' | 'l'; + interface OwnProps extends EuiCodeSharedProps { inline?: false; + paddingSize?: PaddingSize; + fontSize?: FontSize; + overflowHeight?: number; + isCopyable?: boolean; } export type EuiCodeBlockProps = CommonProps &