-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Convert `EuiFacetButton` and `EuiFacetGroup` to emotion * Deleting `.scss` files * Moving buttons mixins to functions * Removed unused mixin. Adding CL. Improving gutter size func. * Improving example * Better code for calling `euiTheme` * Renaming `contentElementStyles` to `contentElementsStyles` * Fix typo. CL. * Better gap styles * Adding `euiCanAnimate` for transitions * Moving button functions and using `euiLinkFocusCSS` * Typo * Adding `logicalCSS` * Adding new EuiButtonDisplay * Adding `logicalTextAlignCSS` * Removing `EuiFlexGroup` * Better styles * Better `isDisabled` styles * Text`isSelected` style * Identantion * CL * Improving regex in render_custom_styles * Deprecating EuiButtonDisplay and EuiButtonContent components * Adding `euiLoadingSpinnerBorderColorsCSS` mixin * Adding `_buttonSize()` and renaming files to contain `_deprecated` * Keeping `EuiButtonDisplay_Deprecated` in button file * Improving text * Fixing error due to `euiFontSize` being updated in main * Preventing test to get `EuiButtonDisplay_Deprecated` * Renaming deprecated components * Addressing PR review * Added new `color` prop to `EuiLoadingSpinner` * Removing unnecessary prop comment * Making `EuiLoadingSpinnerProps['color']` show in props table * Better props table for `EuiLoadingSpinnerColor` * Update src/components/loading/loading_spinner.tsx Co-authored-by: Caroline Horn <[email protected]> * Update src/components/loading/loading_spinner.tsx Co-authored-by: Caroline Horn <[email protected]> * Update upcoming_changelogs/5878.md Co-authored-by: Caroline Horn <[email protected]> * Update src/components/button/button_display/_button_display.tsx Co-authored-by: Caroline Horn <[email protected]> * Moving CL entry out of `CSS-in-JS` Co-authored-by: Caroline Horn <[email protected]>
- Loading branch information
Showing
49 changed files
with
768 additions
and
304 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
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
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
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
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
63 changes: 63 additions & 0 deletions
63
src/components/button/button_display/_button_display.styles.ts
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
import { css } from '@emotion/react'; | ||
import { UseEuiTheme } from '../../../services'; | ||
import { | ||
euiFontSize, | ||
logicalCSS, | ||
logicalTextAlignStyle, | ||
} from '../../../global_styling'; | ||
|
||
// Provides a solid reset and base for handling sizing layout | ||
// Does not include any visual styles | ||
export const euiButtonBaseCSS = () => { | ||
return ` | ||
display: inline-block; | ||
appearance: none; | ||
cursor: pointer; | ||
${logicalTextAlignStyle('center')}; | ||
white-space: nowrap; | ||
${logicalCSS('max-width', '100%')}; | ||
vertical-align: middle; | ||
`; | ||
}; | ||
|
||
const _buttonSize = (size: string) => { | ||
return ` | ||
${logicalCSS('height', size)}; | ||
// prevents descenders from getting cut off | ||
line-height: ${size}; | ||
`; | ||
}; | ||
|
||
export const euiButtonDisplayStyles = ( | ||
euiThemeContext: UseEuiTheme, | ||
minWidth: string | ||
) => { | ||
const { euiTheme } = euiThemeContext; | ||
|
||
return { | ||
// Base | ||
euiButtonDisplay: css` | ||
${euiButtonBaseCSS()}; | ||
${minWidth && logicalCSS('min-width', minWidth)}; | ||
`, | ||
// States | ||
isDisabled: css` | ||
cursor: not-allowed; | ||
`, | ||
fullWidth: css` | ||
display: block; | ||
width: 100%; | ||
`, | ||
// Sizes | ||
xs: css(_buttonSize(euiTheme.size.l), euiFontSize(euiThemeContext, 'xs')), | ||
s: css(_buttonSize(euiTheme.size.xl), euiFontSize(euiThemeContext, 's')), | ||
m: css(_buttonSize(euiTheme.size.xxl), euiFontSize(euiThemeContext, 's')), | ||
}; | ||
}; |
Oops, something went wrong.