-
Notifications
You must be signed in to change notification settings - Fork 842
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
Add EuiColorPalettePicker #3192
Merged
Merged
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
7620c69
Adding initial code
elizabetdev c13ec9c
Adding initial code
elizabetdev 8cf0339
Merge branch 'color-palette-picker' of https://github.com/miukimiu/eu…
elizabetdev e6482ac
Merge remote-tracking branch 'upstream/master' into color-palette-picker
elizabetdev 079488a
Adding getLinearGradient method
elizabetdev 5541dbc
Improving palettes
elizabetdev 25e684e
initial tests
elizabetdev 2c353dc
More improvements
elizabetdev f4da589
Merge remote-tracking branch 'upstream/master' into color-palette-picker
elizabetdev b3357fe
Deleting palettes file
elizabetdev 9858418
Adding display togles
elizabetdev 5740a20
Simplifying button
elizabetdev 5996803
Custom option value
elizabetdev d695167
Update some types
7cc2855
Merge pull request #2 from cchaos/miukimiu-color-palette-picker
elizabetdev f57b801
getFixedLinearGradient
elizabetdev 01b88f8
Merge remote-tracking branch 'upstream/master' into color-palette-picker
elizabetdev c3ae30b
Text as an option
elizabetdev 1ae241c
Improving props description
elizabetdev 94c0efd
Improving sass
elizabetdev d17c797
Merge remote-tracking branch 'upstream/master' into color-palette-picker
elizabetdev c2ebf33
Adding selectionDisplay
elizabetdev e68ee37
Merge remote-tracking branch 'upstream/master' into color-palette-picker
elizabetdev 18d79da
More examples
elizabetdev aaa3692
Addressing pr review
elizabetdev eb2d66d
Update src-docs/src/views/color_picker/color_palette_picker.tsx
elizabetdev 391e49d
Update src/components/color_picker/color_palette_picker/color_palette…
elizabetdev 16aeb06
Update src/components/color_picker/color_palette_picker/color_palette…
elizabetdev 8dc7046
Merge branch 'color-palette-picker' of https://github.com/miukimiu/eu…
elizabetdev 1f9c89a
Extending EuiSuperSelectProp
elizabetdev ddec2ca
Simplifying structure
elizabetdev 9020be3
Merge remote-tracking branch 'upstream/master' into color-palette-picker
elizabetdev 1ad7005
Changelog
elizabetdev b4bd5c3
Improving example
elizabetdev 12d841d
Improving snippet
elizabetdev 2477f90
Adding more tests
elizabetdev b165463
Improving props description
elizabetdev 32d3ea1
Improving docs text
elizabetdev 3b86ed2
Merge remote-tracking branch 'upstream/master' into color-palette-picker
elizabetdev c2bf5b2
Improve text
elizabetdev 6983edd
Merge remote-tracking branch 'upstream/master' into color-palette-picker
elizabetdev c199152
Merge remote-tracking branch 'upstream/master' into color-palette-picker
elizabetdev 1d9c50b
Addressing review
elizabetdev 6dfb4e4
Update src/components/color_picker/utils.ts
elizabetdev dab0fc3
Update src/components/color_picker/utils.ts
elizabetdev 4d69d19
Update src/components/color_picker/color_palette_picker/color_palette…
elizabetdev aa276d9
Update src/components/color_picker/color_palette_picker/color_palette…
elizabetdev 4743542
Merge branch 'color-palette-picker' of https://github.com/miukimiu/eu…
elizabetdev 4e4d2e5
Update src/components/color_picker/utils.ts
elizabetdev 8e558e5
Update src/components/color_picker/color_palette_picker/color_palette…
elizabetdev 77b7bc8
Improving TS
elizabetdev 7794f0b
Improving palette doc
elizabetdev 45c7323
Palette doc
elizabetdev a6674a3
Changing name of gray palette
cchaos 344ab48
Slimming the description a bit
cchaos 9003578
removing console log
elizabetdev 93fc2b9
more strict types
thompsongl ee7b0b7
Update src/components/color_picker/color_palette_picker/color_palette…
elizabetdev 62dc72c
Merge pull request #5 from thompsongl/color-palette-picker
elizabetdev 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import React, { useState } from 'react'; | ||
import { | ||
euiPaletteColorBlind, | ||
euiPaletteForStatus, | ||
euiPaletteForTemperature, | ||
} from '../../../../src/services'; | ||
import { EuiSwitch } from '../../../../src/components/form'; | ||
import { EuiSpacer } from '../../../../src/components/spacer'; | ||
import { EuiCode } from '../../../../src/components/code'; | ||
import { | ||
EuiColorPalettePicker, | ||
EuiColorPalettePickerPaletteProps, | ||
} from '../../../../src/components/color_picker/color_palette_picker'; | ||
// @ts-ignore | ||
import { DisplayToggles } from '../form_controls/display_toggles'; | ||
|
||
const palettes: EuiColorPalettePickerPaletteProps[] = [ | ||
{ | ||
value: 'pallette_1', | ||
title: 'EUI color blind (fixed)', | ||
palette: euiPaletteColorBlind(), | ||
type: 'fixed', | ||
}, | ||
{ | ||
value: 'pallette_2', | ||
title: 'EUI palette for temperature (fixed)', | ||
palette: euiPaletteForTemperature(5), | ||
type: 'fixed', | ||
}, | ||
{ | ||
value: 'pallette_3', | ||
title: 'Grayscale (gradient with stops)', | ||
palette: [ | ||
{ | ||
stop: 100, | ||
color: 'white', | ||
}, | ||
{ | ||
stop: 250, | ||
color: 'gray', | ||
}, | ||
{ | ||
stop: 350, | ||
color: 'dimgray', | ||
}, | ||
{ | ||
stop: 470, | ||
color: 'black', | ||
}, | ||
], | ||
type: 'gradient', | ||
}, | ||
{ | ||
value: 'pallette_4', | ||
title: 'EUI palette for status (gradient)', | ||
palette: euiPaletteForStatus(5), | ||
type: 'gradient', | ||
}, | ||
{ | ||
value: 'custom', | ||
title: 'Plain text as a custom option', | ||
type: 'text', | ||
}, | ||
]; | ||
|
||
export const ColorPalettePicker = () => { | ||
const [selectionDisplay, setSelectionDisplay] = useState(false); | ||
const [pallette, setPallette] = useState('pallette_1'); | ||
|
||
return ( | ||
<> | ||
<EuiSwitch | ||
label={ | ||
<span> | ||
Display selected item as a <EuiCode>title</EuiCode> | ||
</span> | ||
} | ||
checked={selectionDisplay} | ||
onChange={() => setSelectionDisplay(!selectionDisplay)} | ||
/> | ||
<EuiSpacer /> | ||
<DisplayToggles canPrepend={true} canAppend={true} canReadOnly={false}> | ||
<EuiColorPalettePicker | ||
palettes={palettes} | ||
onChange={setPallette} | ||
valueOfSelected={pallette} | ||
selectionDisplay={selectionDisplay ? 'title' : 'palette'} | ||
/> | ||
</DisplayToggles> | ||
</> | ||
); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
|
||
import { EuiColorPalettePickerPaletteProps } from '../../../../src/components/color_picker/color_palette_picker'; | ||
|
||
export const EuiColorPalettePickerPalette: FunctionComponent< | ||
EuiColorPalettePickerPaletteProps | ||
> = () => <div />; |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
@import 'hue'; | ||
@import 'saturation'; | ||
@import 'color_stops/index'; | ||
@import 'color_palette_picker/index'; |
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.
I think this removal was accidental?
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.
Actually it's weird in master this line doesn't exist: https://github.com/elastic/eui/blob/master/CHANGELOG.md