Skip to content
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

ColorPicker: allow customisation of the auxiliary controls #38065

Open
Tracked by #34284
ciampo opened this issue Jan 19, 2022 · 3 comments
Open
Tracked by #34284

ColorPicker: allow customisation of the auxiliary controls #38065

ciampo opened this issue Jan 19, 2022 · 3 comments
Labels
[Feature] Component System WordPress component system [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Comments

@ciampo
Copy link
Contributor

ciampo commented Jan 19, 2022

With the recent updates, the ColorPicker component has a few auxiliary controls (collapsed by default) in its lower part.

the color picker component, with the auxiliary controls highlighted

We should investigate the best way to allow consumers of this component more flexibility around the auxiliary controls.

The main aspect to consider is if we should allow consumers of this component to provide their own version of auxiliary controls, and whether the custom auxiliary controls should have access to the internal state of the color picker. In this scenario, we could have ColorPicker assume that custom auxiliary controls are provided through the children prop.

A simpler alternative would be to add a new boolean prop to ColorPicker for hiding/showing the auxiliary controls. In this scenario, consumers of the ColorPicker component would need to add any additional UI as a sibling of the component.


(This issue is related to the problem flagged in #37599 by @andreiglingeanu )

@ciampo
Copy link
Contributor Author

ciampo commented Jan 19, 2022

Applying the enhancements discussed in this issue also to the GradientPicker requires more changes, discussed in #38066

@ciampo ciampo mentioned this issue Jan 19, 2022
31 tasks
@ciampo
Copy link
Contributor Author

ciampo commented Jan 19, 2022

One more thing: the two options highlighted above are also not mutually exclusive. We could, for example:

  • in a first PR, add a hideAuxiliaryControls prop to ColorPicker in order to toggle the standard auxiliary controls on/off
  • separately, evaluate also accepting custom auxiliary controls as children of ColorPicker

@ciampo
Copy link
Contributor Author

ciampo commented Mar 1, 2022

Hey @andreiglingeanu , would you be able to provide exactly what is the reason which prompted you to request this feature (i.e customizing the ColorPicker's auxiliary controls) ? It'd be great if you could highlight exactly which limitations you're encountering with the current version of the component, add screenshots/videos and (even better) a live demo.

This would help us greatly in assessing what the next steps would be (cc @jasmussen @jorgefilipecosta )

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Component System WordPress component system [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

1 participant