Skip to content

Commit

Permalink
[EuiCode] and [EuiCodeBlock] updated the props (#3647)
Browse files Browse the repository at this point in the history
* [EuiCode] updated the props to reflect used

* Updated changelog

* Updated changes

* Fixed exporting

* Fixed lint

* CL update

Co-authored-by: Greg Thompson <thompson.glowe@gmail.com>
  • Loading branch information
shrey and thompsongl authored Jun 25, 2020
1 parent 70aa5fc commit 190a43e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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**

Expand Down
2 changes: 1 addition & 1 deletion src/components/code/_code_block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
8 changes: 0 additions & 8 deletions src/components/code/code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 7 additions & 0 deletions src/components/code/code_block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 &
Expand Down

0 comments on commit 190a43e

Please sign in to comment.