forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds EUI to Text Style Picker (elastic#601)
* Created popover HOC for EuiPopover. Refactored existing popovers. Added popover HOC. Refactored refresh_control Added paddingSize prop to popover Added EuiButtonIcon and EuiPopover to arg_add_popover Added aria-label to euibuttonicon in arg_add_popover Added ids to all popovers Fixed position of popovers * Replaced EUI Popover with bootstrap popover * Removed comments and unused props * Fix: popover closes when clicking outside of the popover * Fixed CSS for arg_form * Changed div to span in popover * Fixed button prop type in popover * Refactored popover to use bootstrap overlay. * Fixed popover props to match EuiPopover props * Fixed popover title in refresh_control * Removed window resize and wheel event listeners * Added eui styles to fauxSelect for font picker * Cleaned up styles for font picker * Fixed width of font picker popover * Fixed spacing of text style buttons * Added comments in text_style_picker and font_picker * Changed spacing in text_style_picker * Refactored font_picker with popover HOC * Fixed uncontrolled select warning * Changed button in font_picker * Fixed font_picker CSS * Fixed padding * Added EuiLinks to font picker * Added anchorPosition prop to font picker
- Loading branch information
Showing
6 changed files
with
118 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
import React from 'react'; | ||
import './faux_select.less'; | ||
import { PropTypes } from 'prop-types'; | ||
import { EuiIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; | ||
|
||
export const FauxSelect = ({ children }) => <div className="canvas__faux-select">{children}</div>; | ||
//TODO: remove this when EUI has a better select component | ||
export const FauxSelect = ({ handleClick, children }) => ( | ||
<EuiFlexGroup | ||
gutterSize="none" | ||
alignItems="center" | ||
justifyContent="spaceBetween" | ||
className="euiSelect canvas__faux-select" | ||
style={{ padding: 12 }} // match padding with EuiSelect | ||
onClick={handleClick} | ||
> | ||
<EuiFlexItem>{children}</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiIcon type="arrowDown" /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
|
||
FauxSelect.propTypes = { | ||
handleClick: PropTypes.func, | ||
children: PropTypes.node, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
@import (reference) "../../style/main"; | ||
|
||
.canvas__font-picker--popover { | ||
.popover-content { | ||
padding: 0px; | ||
} | ||
} | ||
@import (reference) '../../style/main'; | ||
|
||
.canvas__font-picker { | ||
height: 200px; | ||
overflow-y: scroll; | ||
|
||
.canvas__font-picker--font { | ||
display: block; | ||
width: 100%; | ||
padding: @spacingXS @spacingM; | ||
color: black; | ||
} | ||
} | ||
|
||
&:hover { | ||
background-color: @lightestGrey; | ||
cursor: pointer; | ||
} | ||
.canvas__font-picker--popover { | ||
.popover-content { | ||
padding: 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 4 additions & 14 deletions
18
public/components/text_style_picker/text_style_picker.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,9 @@ | ||
@import (reference) "../../style/main"; | ||
@import (reference) '../../style/main'; | ||
|
||
.canvas__text-style-picker--top { | ||
display: flex; | ||
.canvas__font-picker--preview { | ||
width: 100%; | ||
|
||
.canvas__font-picker--preview { | ||
flex-grow: 1; | ||
margin-left: @spacingS; | ||
.canvas__faux-select { | ||
width: 100%; | ||
|
||
.canvas__faux-select { | ||
width: 100%; | ||
} | ||
} | ||
} | ||
|
||
.canvas__text-style-picker--bottom > * { | ||
margin-right: @spacingS; | ||
} |