From 97dc1350af1e6e3300c248c885866d554969e5de Mon Sep 17 00:00:00 2001 From: Rory Hunter Date: Fri, 27 Sep 2019 11:19:27 +0100 Subject: [PATCH] Review feedback --- src/components/call_out/call_out.tsx | 21 +++++++------------ src/components/facet/facet_group.tsx | 15 ++++++------- src/components/key_pad_menu/key_pad_menu.tsx | 4 ++-- .../key_pad_menu/key_pad_menu_item.tsx | 4 ++-- 4 files changed, 18 insertions(+), 26 deletions(-) diff --git a/src/components/call_out/call_out.tsx b/src/components/call_out/call_out.tsx index 3fd5d3c6fdd..5dce716fd7d 100644 --- a/src/components/call_out/call_out.tsx +++ b/src/components/call_out/call_out.tsx @@ -10,16 +10,13 @@ import { EuiText } from '../text'; type Color = 'primary' | 'success' | 'warning' | 'danger'; type Size = 's' | 'm'; -export interface EuiCallOutProps { - title?: ReactNode; - iconType?: IconType; - color?: Color; - size?: Size; -} - -type Props = CommonProps & - EuiCallOutProps & - Omit, 'title'>; +export type EuiCallOutProps = CommonProps & + Omit, 'title'> & { + title?: ReactNode; + iconType?: IconType; + color?: Color; + size?: Size; + }; const colorToClassNameMap: { [color in Color]: string } = { primary: 'euiCallOut--primary', @@ -35,9 +32,7 @@ const sizeToClassNameMap: { [size in Size]: string } = { m: '', }; -export const SIZES = Object.keys(sizeToClassNameMap); - -export const EuiCallOut: FunctionComponent = ({ +export const EuiCallOut: FunctionComponent = ({ title, color = 'primary', size = 'm', diff --git a/src/components/facet/facet_group.tsx b/src/components/facet/facet_group.tsx index 72859f2c4bd..93e0e762ff2 100644 --- a/src/components/facet/facet_group.tsx +++ b/src/components/facet/facet_group.tsx @@ -1,7 +1,7 @@ import React, { FunctionComponent, HTMLAttributes } from 'react'; import classNames from 'classnames'; -import { CommonProps, keysOf } from '../common'; +import { CommonProps } from '../common'; import { EuiFlexGroup } from '../flex'; type FacetGroupLayout = 'vertical' | 'horizontal'; @@ -11,15 +11,12 @@ const layoutToClassNameMap: { [layout in FacetGroupLayout]: string } = { horizontal: 'euiFacetGroup--horizontal', }; -export const LAYOUTS = keysOf(layoutToClassNameMap); +export type EuiFacetGroupProps = CommonProps & + HTMLAttributes & { + layout?: FacetGroupLayout; + }; -export interface EuiFacetGroupProps { - layout?: FacetGroupLayout; -} - -type Props = CommonProps & HTMLAttributes & EuiFacetGroupProps; - -export const EuiFacetGroup: FunctionComponent = ({ +export const EuiFacetGroup: FunctionComponent = ({ children, className, layout = 'vertical', diff --git a/src/components/key_pad_menu/key_pad_menu.tsx b/src/components/key_pad_menu/key_pad_menu.tsx index b3467c7c6c2..c2f2594f212 100644 --- a/src/components/key_pad_menu/key_pad_menu.tsx +++ b/src/components/key_pad_menu/key_pad_menu.tsx @@ -3,9 +3,9 @@ import classNames from 'classnames'; import { CommonProps } from '../common'; -type Props = CommonProps & HTMLAttributes; +export type EuiKeyPadMenuProps = CommonProps & HTMLAttributes; -export const EuiKeyPadMenu: FunctionComponent = ({ +export const EuiKeyPadMenu: FunctionComponent = ({ children, className, ...rest diff --git a/src/components/key_pad_menu/key_pad_menu_item.tsx b/src/components/key_pad_menu/key_pad_menu_item.tsx index bfe69d07b25..4f6a9fb8a04 100644 --- a/src/components/key_pad_menu/key_pad_menu_item.tsx +++ b/src/components/key_pad_menu/key_pad_menu_item.tsx @@ -58,7 +58,7 @@ interface EuiKeyPadMenuItemCommonProps { betaBadgeTooltipContent?: ReactNode; } -type EuiKeyPadMenuItemProps = CommonProps & +export type EuiKeyPadMenuItemProps = CommonProps & AnchorHTMLAttributes & EuiKeyPadMenuItemCommonProps; @@ -113,7 +113,7 @@ export const EuiKeyPadMenuItem: FunctionComponent = ({ ); }; -type EuiKeyPadMenuItemButtonProps = CommonProps & +export type EuiKeyPadMenuItemButtonProps = CommonProps & ButtonHTMLAttributes & EuiKeyPadMenuItemCommonProps;