casesandberg / casesandberg/react-color
3.0.0 Proposal
- Dominant language
- JavaScript
- Stars
- 12.3k
- Forks
- 920
- PR merge metrics
- No merged PRs in 30d
Description
I would like to start a discussion on some features and proposals for the next major version of React Color. Here is what I have been thinking:
## ~React Native Support~
~~This would require a rewrite of all of the components to use [react-primitives](https://github.com/lelandrichardson/react-primitives). Everything has already been written with inline styles so this will make our job much easier. Along with support for RN, I think we should introduce a few new color pickers that are prevalent in native (Snapchat, Facebook, etc..)~~
## Base Draggable Component
I propose a base component that handles the dragging and calculating of pixel values and position and leaves the translation of color spaces to the components that use it. Right now each component does [a bunch of math on their own](https://github.com/casesandberg/react-color/blob/master/src/helpers/hue.js) to figure this out. There have been a couple of requests (#395, #313) to create more sliders or gradient components. This would make them easier to add as well as a great common component for people to use to make their own.
## Using Children For Swatches
The API footprint [has grown](https://github.com/casesandberg/react-color/pull/316) [quite a bit](https://github.com/casesandberg/react-color/pull/366) to allow for extended functionality of the swatches (#305). I propose we instead move everything over into [a new Palette component](https://github.com/SpencerDawson/react-color/commit/b4538bffe807d763ba25f3c0ffb119775c5e65ce) like the one that @SpencerDawson has been working on and allow people to change the swatches by passing them down as children:
```jsx
// or
{ colors.map((color) => (
)) }
```
## Support AMD, UMD & CDN's
I also propose that the NPM package have a `dist` folder with both a bundled and a minified version of react-color for use as drop in JS files. This has been requested in #310 and #364.
## Type Definition Files
There is a [ts definition file](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-color) in definitely typed, but it is always out of date. I think we should provide both TS and Flow definition files alongside the library for people using typed environments.
## New Documentation Backing
Right now the documentation site uses a very janky setup that I created a long time ago. I think we should probably move it over to something that has better community support such as [Gatsby](https://github.com/gatsbyjs/gatsby). I am open to suggestions here.
## Smaller Things
* Investigate if there is a better, smaller library than tinycolor2 for our color conversions. #184
* Look into adding more accessibility support. #359
* Collaborate to create a vision doc that explains where the project is going.
* Make all components that take user input uncontrolled when focused #404, #216, #371
* Extend color spectrums that pickers return on change #66, #215
Contributor guide
Assessment
This issue has not been assessed yet.