Skip to content

Commit

Permalink
[EuiText] Add 'align' property (#1487)
Browse files Browse the repository at this point in the history
This also adds the missing definition for `EuiTextAlign`.
  • Loading branch information
pickypg authored Jan 29, 2019
1 parent ec3727e commit e5e2b49
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## [`master`](https://github.com/elastic/eui/tree/master)

No public interface changes since `6.7.3`.
- Added `textAlign` property to TypeScript definition for `EuiText` ([#1487](https://github.com/elastic/eui/pull/1487))
- Added missing `'m'` option for text `size` for `EuiText`'s TypeScript definition ([#1487](https://github.com/elastic/eui/pull/1487))
- Added missing TypeScript definition for `EuiTextAlign` ([#1487](https://github.com/elastic/eui/pull/1487))

## [`6.7.3`](https://github.com/elastic/eui/tree/v6.7.3)

Expand Down
19 changes: 17 additions & 2 deletions src/components/text/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ declare module '@elastic/eui' {
* @see './text.js'
* @see './text_color.js'
*/
type TEXT_SIZES = 's' | 'xs';
type TEXT_SIZES = 'm' | 's' | 'xs';

/**
* text alignment options
*
* @see './text.js'
* @see './text_align.js'
*/
type ALIGNMENTS = 'left' | 'center' | 'right';

type COLORS =
| 'default'
Expand All @@ -19,8 +27,12 @@ declare module '@elastic/eui' {
| 'warning'
| 'ghost';

type EuiTextProps = CommonProps &
type EuiTextAlignProps = CommonProps &
HTMLAttributes<HTMLDivElement> & {
textAlign?: ALIGNMENTS;
};

type EuiTextProps = EuiTextAlignProps & {
size?: TEXT_SIZES;
color?: COLORS;
grow?: boolean;
Expand All @@ -32,6 +44,9 @@ declare module '@elastic/eui' {
color?: COLORS;
};



export const EuiText: SFC<EuiTextProps>;
export const EuiTextAlign: SFC<EuiTextAlignProps>;
export const EuiTextColor: SFC<EuiTextColorProps>;
}

0 comments on commit e5e2b49

Please sign in to comment.