-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Emotion] Convert EuiFacetButton
and EuiFacetGroup
#5878
Merged
Merged
Changes from 43 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
3aaf346
Convert `EuiFacetButton` and `EuiFacetGroup` to emotion
miukimiu 8be0805
Deleting `.scss` files
miukimiu 265fc72
Moving buttons mixins to functions
miukimiu 322793f
Removed unused mixin. Adding CL. Improving gutter size func.
miukimiu f4784a1
Merge remote-tracking branch 'upstream/main' into emotion-facet-conve…
miukimiu b8f9133
Improving example
miukimiu 1ddd2cd
Better code for calling `euiTheme`
miukimiu cd2f2ec
Renaming `contentElementStyles` to `contentElementsStyles`
miukimiu e29df48
Fix typo. CL.
miukimiu 54172b4
Better gap styles
miukimiu a8a4eec
Adding `euiCanAnimate` for transitions
miukimiu 9db464c
Merge remote-tracking branch 'upstream/main' into emotion-facet-conve…
miukimiu 781f93b
Moving button functions and using `euiLinkFocusCSS`
miukimiu 80a149b
Typo
miukimiu 2452e51
Adding `logicalCSS`
miukimiu bbfff1c
Merge remote-tracking branch 'upstream/main' into emotion-facet-conve…
miukimiu 45c412a
Merge remote-tracking branch 'upstream/main' into emotion-facet-conve…
miukimiu a037373
Adding new EuiButtonDisplay
miukimiu e02cb0c
Adding `logicalTextAlignCSS`
miukimiu 4f0d7d8
Removing `EuiFlexGroup`
miukimiu 90572aa
Better styles
miukimiu 4fd0f89
Better `isDisabled` styles
miukimiu eaa0c90
Text`isSelected` style
miukimiu 7f60484
Identantion
miukimiu 955a32b
CL
miukimiu 5adff69
Improving regex in render_custom_styles
miukimiu cd757e4
Merge remote-tracking branch 'upstream/main' into emotion-facet-conve…
miukimiu 9c669da
Deprecating EuiButtonDisplay and EuiButtonContent components
miukimiu 755774f
Adding `euiLoadingSpinnerBorderColorsCSS` mixin
miukimiu 8bf188a
Adding `_buttonSize()` and renaming files to contain `_deprecated`
miukimiu 3cd0483
Keeping `EuiButtonDisplay_Deprecated` in button file
miukimiu c62946f
Merge remote-tracking branch 'upstream/main' into emotion-facet-conve…
miukimiu 024de57
Improving text
miukimiu b0d2012
Merge remote-tracking branch 'upstream/main' into emotion-facet-conve…
miukimiu d72e521
Fixing error due to `euiFontSize` being updated in main
miukimiu 7505bea
Preventing test to get `EuiButtonDisplay_Deprecated`
miukimiu 3f51ca0
Renaming deprecated components
miukimiu e5a1d1c
Addressing PR review
miukimiu a522250
Added new `color` prop to `EuiLoadingSpinner`
miukimiu 51eec20
Merge remote-tracking branch 'upstream/main' into emotion-facet-conve…
miukimiu fe6cbc9
Removing unnecessary prop comment
miukimiu 533fa71
Making `EuiLoadingSpinnerProps['color']` show in props table
miukimiu be920ca
Better props table for `EuiLoadingSpinnerColor`
miukimiu 1555212
Update src/components/loading/loading_spinner.tsx
miukimiu 8668a50
Update src/components/loading/loading_spinner.tsx
miukimiu 344a8f0
Update upcoming_changelogs/5878.md
miukimiu 9327062
Update src/components/button/button_display/_button_display.tsx
miukimiu 2bc4cb9
Moving CL entry out of `CSS-in-JS`
miukimiu daf148d
Merge remote-tracking branch 'upstream/main' into emotion-facet-conve…
miukimiu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch