Skip to content

Commit

Permalink
Merge branch 'master' into rk/add-euistat
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Keairns authored Aug 29, 2018
2 parents 92ef526 + 16ff2df commit 48dbc5b
Show file tree
Hide file tree
Showing 16 changed files with 323 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Added a new `EuiStat` component for displaying prominent stats ([#1146](https://github.com/elastic/eui/pull/1146))
- Added color and monotone icons for AWS and GCP. ([#1135](https://github.com/elastic/eui/pull/1135))
- Added TypeScript definition for `EuiComboBox` ([#1115](https://github.com/elastic/eui/pull/1115))

**Bug fixes**

- Fixed `onChange` typedef on `EuiSwitch` ([#1144](https://github.com/elastic/eui/pull/1144)

## [`3.7.0`](https://github.com/elastic/eui/tree/v3.7.0)

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
"devDependencies": {
"@elastic/eslint-config-kibana": "^0.15.0",
"@types/enzyme": "^3.1.13",
"@types/react": "^16.4.9",
"@types/react": "^16.0.31",
"@types/react-virtualized": "^9.18.6",
"autoprefixer": "^7.1.5",
"babel-cli": "^6.26.0",
"babel-eslint": "^8.0.1",
Expand Down
4 changes: 4 additions & 0 deletions src-docs/src/views/icon/logos_third.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ import {
const iconTypes = [
'logoAerospike',
'logoApache',
'logoAWS',
'logoAWSMono',
'logoCeph',
'logoCouchbase',
'logoDocker',
'logoDropwizard',
'logoEtcd',
'logoGCP',
'logoGCPMono',
'logoGithub',
'logoGmail',
'logoGolang',
Expand Down
73 changes: 73 additions & 0 deletions src/components/combo_box/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import { ButtonHTMLAttributes, ReactNode, SFC } from 'react';
import { ListProps } from 'react-virtualized';
import {
EuiComboBoxOption,
EuiComboBoxOptionProps,
EuiComboBoxOptionsListPosition,
EuiComboBoxOptionsListProps,
} from '@elastic/eui';

declare module '@elastic/eui' {
export type EuiComboBoxOptionProps = ButtonHTMLAttributes<HTMLButtonElement> & {
label: string,
isGroupLabelOption: boolean,
}

export type EuiComboBoxOptionsListPosition = 'top' | 'bottom'

export interface EuiComboBoxOption {
option: EuiComboBoxOptionProps,
children?: ReactNode,
className?: string,
optionRef?: RefCallback<HTMLButtonElement>,
onClick: (option: EuiComboBoxOptionProps) => any,
onEnterKey: (option: EuiComboBoxOptionProps) => any,
disabled?: boolean,
}

export interface EuiComboBoxOptionsListProps {
options?: Array<EuiComboBoxOptionProps>,
isLoading?: boolean,
selectedOptions?: Array<any>,
onCreateOption?: any,
searchValue?: string,
matchingOptions?: Array<EuiComboBoxOptionProps>,
optionRef?: EuiComboBoxOption['optionRef'],
onOptionClick?: EuiComboBoxOption['onClick'],
onOptionEnterKey?: EuiComboBoxOption['onEnterKey'],
areAllOptionsSelected?: boolean,
getSelectedOptionForSearchValue?: (searchValue: string, selectedOptions: Array<any>) => EuiComboBoxOptionProps,
updatePosition: (parameter?: UIEvent | EuiPanelProps['panelRef']) => any,
position?: EuiComboBoxOptionsListPosition,
listRef: EuiPanelProps['panelRef'],
renderOption?: (option: EuiComboBoxOptionProps, searchValue: string, OPTION_CONTENT_CLASSNAME: string) => ReactNode,
width?: number,
scrollToIndex?: number,
onScroll?: ListProps['onScroll'],
rowHeight?: number,
fullWidth?: boolean,
}
export const EuiComboBoxOptionsList: SFC<EuiComboBoxOptionsListProps>;

export interface EuiComboBoxProps {
id?: string,
isDisabled?: boolean,
className?: string,
placeholder?: string,
isLoading?: boolean,
async?: boolean,
singleSelection?: boolean,
noSuggestions?: boolean,
options?: EuiComboBoxOptionsListProps['options'],
selectedOptions?: EuiComboBoxOptionsListProps['selectedOptions'],
onChange?: (options: Array<EuiComboBoxOptionProps>) => any,
onSearchChange?: (searchValue: string) => any,
onCreateOption?: EuiComboBoxOptionsListProps['onCreateOption'],
renderOption?: EuiComboBoxOptionsListProps['renderOption'],
isInvalid?: boolean,
rowHeight?: number,
isClearable?: boolean,
fullWidth?: boolean,
}
export const EuiComboBox: SFC<EuiComboBoxProps>;
}
5 changes: 1 addition & 4 deletions src/components/form/switch/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ declare module '@elastic/eui' {
/**
* @see './switch.js'
*/
export type EuiSwitchChangeCallback = (state: boolean) => void;

export type EuiSwitchProps = CommonProps &
Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> & {
InputHTMLAttributes<HTMLInputElement> & {
label?: ReactNode;
onChange?: EuiSwitchChangeCallback;
};

export const EuiSwitch: SFC<EuiSwitchProps>;
Expand Down
143 changes: 143 additions & 0 deletions src/components/icon/__snapshots__/icon.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2498,6 +2498,64 @@ exports[`EuiIcon props type loggingApp is rendered 1`] = `
</svg>
`;

exports[`EuiIcon props type logoAWS is rendered 1`] = `
<svg
class="euiIcon euiIcon--medium"
focusable="false"
height="32"
viewBox="0 0 32 32"
width="32"
xmlns="http://www.w3.org/2000/svg"
>
<g
fill="none"
fill-rule="evenodd"
>
<path
d="M9.019 13.878c0 .39.042.705.117.936.085.232.191.484.34.758a.454.454 0 0 1 .075.242c0 .105-.064.21-.202.315l-.67.442a.514.514 0 0 1-.277.095c-.107 0-.213-.053-.32-.148a3.258 3.258 0 0 1-.383-.494 8.109 8.109 0 0 1-.33-.62c-.83.967-1.873 1.45-3.128 1.45-.894 0-1.607-.252-2.129-.756-.521-.505-.787-1.178-.787-2.02 0-.894.319-1.62.968-2.166.65-.547 1.511-.82 2.607-.82.362 0 .735.03 1.128.083.394.053.799.137 1.224.232v-.768c0-.8-.17-1.357-.5-1.683-.34-.326-.915-.484-1.735-.484-.372 0-.755.043-1.149.137-.394.095-.777.21-1.15.358-.17.073-.297.115-.372.136a.66.66 0 0 1-.17.032c-.149 0-.223-.105-.223-.326v-.515c0-.169.02-.295.074-.368a.796.796 0 0 1 .298-.221c.373-.19.82-.347 1.34-.474a6.524 6.524 0 0 1 1.661-.2c1.266 0 2.192.285 2.788.852.586.568.884 1.43.884 2.588v3.407h.02zm-4.32 1.6c.35 0 .712-.064 1.095-.19a2.373 2.373 0 0 0 1.011-.673c.17-.2.298-.421.362-.673.064-.253.107-.558.107-.916v-.441a8.982 8.982 0 0 0-.98-.179 8.113 8.113 0 0 0-1-.063c-.713 0-1.234.137-1.586.42-.35.285-.521.684-.521 1.21 0 .494.128.862.394 1.115.255.263.628.39 1.117.39zm8.545 1.135c-.192 0-.32-.032-.405-.105-.085-.063-.16-.21-.223-.41l-2.501-8.13c-.064-.21-.096-.347-.096-.421 0-.168.085-.263.256-.263h1.043c.202 0 .34.032.415.105.085.063.149.21.212.41l1.788 6.963 1.66-6.963c.054-.21.117-.347.203-.41.085-.063.234-.105.425-.105h.852c.202 0 .34.032.425.105.085.063.16.21.203.41l1.681 7.047 1.841-7.047c.064-.21.138-.347.213-.41.085-.063.223-.105.415-.105h.99c.17 0 .266.084.266.263 0 .052-.011.105-.022.168-.01.063-.032.147-.074.263l-2.565 8.13c-.064.21-.138.347-.223.41-.085.063-.224.105-.405.105h-.915c-.202 0-.34-.031-.426-.105-.085-.073-.16-.21-.202-.42l-1.65-6.784-1.638 6.773c-.053.21-.117.347-.202.42-.086.074-.235.106-.426.106h-.915zm13.675.284a7.122 7.122 0 0 1-1.64-.19c-.531-.126-.946-.262-1.223-.42-.17-.095-.287-.2-.33-.295a.735.735 0 0 1-.064-.294v-.536c0-.221.085-.327.245-.327a.61.61 0 0 1 .192.032c.063.021.16.063.266.105.361.158.755.284 1.17.368.426.084.84.127 1.267.127.67 0 1.192-.116 1.553-.348a1.13 1.13 0 0 0 .554-.999c0-.294-.096-.536-.288-.736-.191-.2-.553-.379-1.074-.547l-1.544-.473c-.776-.242-1.351-.6-1.702-1.073a2.487 2.487 0 0 1-.532-1.525c0-.442.095-.83.287-1.167.192-.337.447-.631.766-.863.32-.242.681-.42 1.107-.547a4.69 4.69 0 0 1 1.34-.178c.235 0 .48.01.714.042.245.031.468.073.692.115.212.053.415.105.606.169.192.063.34.126.447.189a.918.918 0 0 1 .32.263c.063.084.095.2.095.347v.494c0 .221-.085.337-.245.337-.085 0-.223-.042-.404-.126-.607-.274-1.288-.41-2.043-.41-.607 0-1.086.094-1.416.294-.33.2-.5.505-.5.936 0 .294.107.547.32.747.212.2.606.4 1.17.578l1.511.473c.766.242 1.32.579 1.65 1.01.33.431.49.926.49 1.473 0 .452-.096.862-.277 1.22a2.836 2.836 0 0 1-.777.925c-.33.263-.724.452-1.182.59-.478.146-.979.22-1.521.22z"
fill="#252F3E"
fill-rule="nonzero"
/>
<g
fill="#F90"
>
<path
d="M28.93 22.009c-3.501 2.556-8.588 3.912-12.962 3.912-6.13 0-11.653-2.24-15.825-5.963-.33-.295-.032-.694.362-.463 4.512 2.587 10.078 4.155 15.836 4.155 3.884 0 8.151-.8 12.078-2.44.586-.263 1.086.378.511.799z"
/>
<path
d="M30.388 20.368c-.447-.568-2.958-.273-4.097-.137-.34.042-.394-.252-.085-.473 2-1.388 5.289-.989 5.672-.526.383.474-.107 3.723-1.98 5.28-.287.242-.564.116-.436-.2.426-1.041 1.373-3.386.926-3.944z"
/>
</g>
</g>
</svg>
`;

exports[`EuiIcon props type logoAWSMono is rendered 1`] = `
<svg
class="euiIcon euiIcon--medium"
focusable="false"
height="32"
viewBox="0 0 32 32"
width="32"
xmlns="http://www.w3.org/2000/svg"
>
<g
fill-rule="evenodd"
>
<path
d="M9.019 13.878c0 .39.042.705.117.936.085.232.191.484.34.758a.454.454 0 0 1 .075.242c0 .105-.064.21-.202.315l-.67.442a.514.514 0 0 1-.277.095c-.107 0-.213-.053-.32-.148a3.258 3.258 0 0 1-.383-.494 8.109 8.109 0 0 1-.33-.62c-.83.967-1.873 1.45-3.128 1.45-.894 0-1.607-.252-2.129-.756-.521-.505-.787-1.178-.787-2.02 0-.894.319-1.62.968-2.166.65-.547 1.511-.82 2.607-.82.362 0 .735.03 1.128.083.394.053.799.137 1.224.232v-.768c0-.8-.17-1.357-.5-1.683-.34-.326-.915-.484-1.735-.484-.372 0-.755.043-1.149.137-.394.095-.777.21-1.15.358-.17.073-.297.115-.372.136a.66.66 0 0 1-.17.032c-.149 0-.223-.105-.223-.326v-.515c0-.169.02-.295.074-.368a.796.796 0 0 1 .298-.221c.373-.19.82-.347 1.34-.474a6.524 6.524 0 0 1 1.661-.2c1.266 0 2.192.285 2.788.852.586.568.884 1.43.884 2.588v3.407h.02zm-4.32 1.6c.35 0 .712-.064 1.095-.19a2.373 2.373 0 0 0 1.011-.673c.17-.2.298-.421.362-.673.064-.253.107-.558.107-.916v-.441a8.982 8.982 0 0 0-.98-.179 8.113 8.113 0 0 0-1-.063c-.713 0-1.234.137-1.586.42-.35.285-.521.684-.521 1.21 0 .494.128.862.394 1.115.255.263.628.39 1.117.39zm8.545 1.135c-.192 0-.32-.032-.405-.105-.085-.063-.16-.21-.223-.41l-2.501-8.13c-.064-.21-.096-.347-.096-.421 0-.168.085-.263.256-.263h1.043c.202 0 .34.032.415.105.085.063.149.21.212.41l1.788 6.963 1.66-6.963c.054-.21.117-.347.203-.41.085-.063.234-.105.425-.105h.852c.202 0 .34.032.425.105.085.063.16.21.203.41l1.681 7.047 1.841-7.047c.064-.21.138-.347.213-.41.085-.063.223-.105.415-.105h.99c.17 0 .266.084.266.263 0 .052-.011.105-.022.168-.01.063-.032.147-.074.263l-2.565 8.13c-.064.21-.138.347-.223.41-.085.063-.224.105-.405.105h-.915c-.202 0-.34-.031-.426-.105-.085-.073-.16-.21-.202-.42l-1.65-6.784-1.638 6.773c-.053.21-.117.347-.202.42-.086.074-.235.106-.426.106h-.915zm13.675.284a7.122 7.122 0 0 1-1.64-.19c-.531-.126-.946-.262-1.223-.42-.17-.095-.287-.2-.33-.295a.735.735 0 0 1-.064-.294v-.536c0-.221.085-.327.245-.327a.61.61 0 0 1 .192.032c.063.021.16.063.266.105.361.158.755.284 1.17.368.426.084.84.127 1.267.127.67 0 1.192-.116 1.553-.348a1.13 1.13 0 0 0 .554-.999c0-.294-.096-.536-.288-.736-.191-.2-.553-.379-1.074-.547l-1.544-.473c-.776-.242-1.351-.6-1.702-1.073a2.487 2.487 0 0 1-.532-1.525c0-.442.095-.83.287-1.167.192-.337.447-.631.766-.863.32-.242.681-.42 1.107-.547a4.69 4.69 0 0 1 1.34-.178c.235 0 .48.01.714.042.245.031.468.073.692.115.212.053.415.105.606.169.192.063.34.126.447.189a.918.918 0 0 1 .32.263c.063.084.095.2.095.347v.494c0 .221-.085.337-.245.337-.085 0-.223-.042-.404-.126-.607-.274-1.288-.41-2.043-.41-.607 0-1.086.094-1.416.294-.33.2-.5.505-.5.936 0 .294.107.547.32.747.212.2.606.4 1.17.578l1.511.473c.766.242 1.32.579 1.65 1.01.33.431.49.926.49 1.473 0 .452-.096.862-.277 1.22a2.836 2.836 0 0 1-.777.925c-.33.263-.724.452-1.182.59-.478.146-.979.22-1.521.22z"
fill-rule="nonzero"
/>
<path
d="M28.93 22.009c-3.501 2.556-8.588 3.912-12.962 3.912-6.13 0-11.653-2.24-15.825-5.963-.33-.295-.032-.694.362-.463 4.512 2.587 10.078 4.155 15.836 4.155 3.884 0 8.151-.8 12.078-2.44.586-.263 1.086.378.511.799z"
/>
<path
d="M30.388 20.368c-.447-.568-2.958-.273-4.097-.137-.34.042-.394-.252-.085-.473 2-1.388 5.289-.989 5.672-.526.383.474-.107 3.723-1.98 5.28-.287.242-.564.116-.436-.2.426-1.041 1.373-3.386.926-3.944z"
/>
</g>
</svg>
`;

exports[`EuiIcon props type logoAerospike is rendered 1`] = `
<svg
class="euiIcon euiIcon--medium"
Expand Down Expand Up @@ -3068,6 +3126,91 @@ exports[`EuiIcon props type logoEtcd is rendered 1`] = `
</svg>
`;

exports[`EuiIcon props type logoGCP is rendered 1`] = `
<svg
class="euiIcon euiIcon--medium"
focusable="false"
height="32"
viewBox="0 0 32 32"
width="32"
xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
>
<defs>
<path
d="M.085.1h4.549v6.291H.085z"
id="logogcp-a"
/>
</defs>
<g
fill="none"
fill-rule="evenodd"
>
<path
d="M22.57 29.982h-5.749c.527 0 .987-.282 1.233-.7L25.857 16 20.93 7.61l5.748.001c.492 0 .97.251 1.232.7l3.698 6.291c.49.837.526 1.9 0 2.797l-6.572 11.185a2.853 2.853 0 0 1-2.464 1.398zm-.71-2.796c0 .386.318.7.71.7a.705.705 0 0 0 .712-.7c0-.386-.318-.7-.711-.7a.705.705 0 0 0-.712.7zm6.927-10.58c.34.193.775.078.971-.256a.692.692 0 0 0-.26-.955.718.718 0 0 0-.972.256.692.692 0 0 0 .26.955z"
fill="#DB4437"
fill-rule="nonzero"
/>
<path
d="M25.036 3.416l2.873 4.894a1.427 1.427 0 0 0-1.232-.699H11.071l-4.928 8.388-2.874-4.892a1.377 1.377 0 0 1 0-1.399l3.696-6.292a2.853 2.853 0 0 1 2.464-1.398h13.143c.982 0 1.937.502 2.464 1.398zM10.14 4.814c0-.386-.318-.7-.71-.7a.705.705 0 0 0-.712.7c0 .386.318.7.711.7a.705.705 0 0 0 .711-.7zm12.787.606a.692.692 0 0 0 .26-.955.718.718 0 0 0-.971-.256.692.692 0 0 0-.26.955.718.718 0 0 0 .971.256z"
fill="#4285F4"
fill-rule="nonzero"
/>
<path
d="M.394 14.601l2.875-4.893c-.263.449-.245.98 0 1.399L11.07 24.39h9.857l-2.874 4.892c-.246.418-.706.7-1.233.7H9.428a2.854 2.854 0 0 1-2.464-1.398L.394 17.398a2.754 2.754 0 0 1 0-2.797zm2.82.793a.718.718 0 0 0-.972.256.693.693 0 0 0 .26.955c.34.193.775.078.971-.256a.692.692 0 0 0-.26-.955zM9.072 26.58a.692.692 0 0 0-.26.955.718.718 0 0 0 .971.256.692.692 0 0 0 .26-.955.718.718 0 0 0-.971-.256z"
fill="#F4B400"
fill-rule="nonzero"
/>
<path
d="M18.054 29.282l2.875-4.892H17.96l-1.138 5.591c.526 0 .986-.28 1.232-.699M26.678 7.611h-5.749l1.484 2.527L27.91 8.31a1.427 1.427 0 0 0-1.232-.7"
fill="#000"
opacity=".1"
/>
<g
opacity=".1"
transform="translate(2.994 9.609)"
>
<mask
fill="#fff"
id="logogcp-b"
>
<use
href="#logogcp-a"
/>
</mask>
<path
d="M.275 1.498L3.15 6.391l1.485-2.527L.275.1c-.263.448-.245.98 0 1.398"
fill="#000"
mask="url(#logogcp-b)"
/>
</g>
<path
d="M11.071 24.39L6.143 16l4.928-8.39h9.858L25.857 16l-4.928 8.39H11.07zM20.268 16c0-2.317-1.91-4.194-4.268-4.194-2.357 0-4.268 1.877-4.268 4.194 0 2.316 1.91 4.194 4.268 4.194 2.357 0 4.268-1.878 4.268-4.194z"
fill="#CCC"
fill-rule="nonzero"
/>
</g>
</svg>
`;

exports[`EuiIcon props type logoGCPMono is rendered 1`] = `
<svg
class="euiIcon euiIcon--medium"
focusable="false"
height="32"
viewBox="0 0 32 32"
width="32"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M20.256 15.982c0-2.316-1.91-4.194-4.268-4.194-2.357 0-4.268 1.878-4.268 4.194 0 2.317 1.911 4.195 4.268 4.195 2.357 0 4.268-1.878 4.268-4.195"
/>
<path
d="M29.87 16.543a.862.862 0 0 1-1.167.308.832.832 0 0 1-.312-1.147.862.862 0 0 1 1.167-.308.832.832 0 0 1 .312 1.147M22.56 28.15a.847.847 0 0 1-.855-.84c0-.464.383-.84.855-.84s.854.376.854.84c0 .464-.382.84-.854.84m-12.715-.113a.863.863 0 0 1-1.167-.308.832.832 0 0 1 .312-1.147.862.862 0 0 1 1.167.308.832.832 0 0 1-.312 1.147M3.586 16.542a.863.863 0 0 1-1.167.308.832.832 0 0 1-.313-1.147.862.862 0 0 1 1.167-.308.832.832 0 0 1 .313 1.147M22.987 5.665a.862.862 0 0 1-1.167-.308.832.832 0 0 1 .312-1.147.863.863 0 0 1 1.168.308.832.832 0 0 1-.313 1.147m-13.57.112a.847.847 0 0 1-.854-.84c0-.464.382-.84.854-.84s.855.376.855.84c0 .464-.383.84-.855.84m22.178 8.797l-3.697-6.292c-.014-.023-.03-.043-.045-.065l-2.83-4.818A2.854 2.854 0 0 0 22.56 2H9.417a2.853 2.853 0 0 0-2.464 1.398L3.257 9.69l3.284 5.59 4.519-7.69h15.605c.491 0 .969.251 1.232.699h-6.565l4.513 7.682-4.935 8.4-2.87 4.883a1.426 1.426 0 0 1-1.23.699l3.279-5.582h-9.03l-4.544-7.738-.384-.653-2.874-4.893a1.377 1.377 0 0 1-.003-1.391L.382 14.584a2.754 2.754 0 0 0 0 2.796l6.57 11.186a2.854 2.854 0 0 0 2.465 1.398h7.392c.054 0 .107-.005.16-.011h5.59a2.853 2.853 0 0 0 2.464-1.397l6.572-11.186c.526-.896.49-1.96 0-2.796"
/>
</svg>
`;

exports[`EuiIcon props type logoGithub is rendered 1`] = `
<svg
class="euiIcon euiIcon--medium"
Expand Down
Loading

0 comments on commit 48dbc5b

Please sign in to comment.