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

[EuiCode] and [EuiCodeBlock] updated the props #3647

Merged
merged 7 commits into from
Jun 25, 2020
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
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