|
4 | 4 | [![codecov][codecov-image]][codecov-url] |
5 | 5 | [![NPM version][npm-image]][npm-url] |
6 | 6 | [![License][license-image]][license-url] |
| 7 | +[![minisize][min-image]][min-url] |
7 | 8 |
|
8 | 9 | [action-image]: https://github.com/mikbry/material-ui-color-components/workflows/Build%20and%20Deploy/badge.svg |
9 | 10 | [action-url]: https://mikbry.github.io/material-ui-color-components/ |
10 | 11 | [codecov-image]: https://codecov.io/gh/mikbry/material-ui-color-components/branch/master/graph/badge.svg?token=K4P0vnM5fh |
11 | 12 | [codecov-url]: https://codecov.io/gh/mikbry/material-ui-color-components |
12 | 13 | [npm-image]: https://img.shields.io/npm/v/material-ui-color-components.svg |
13 | 14 | [npm-url]: https://npmjs.org/package/material-ui-color-components |
14 | | -[license-image]: https://img.shields.io/npm/l/amaterial-ui-color-components.svg |
15 | | -[License-url]:./LICENSE |
| 15 | +[license-image]: https://img.shields.io/github/license/mikbry/material-ui-color-components |
| 16 | +[License-url]:https://github.com/mikbry/material-ui-color-components/blob/master/LICENSE |
| 17 | +[min-image]:https://badgen.net/bundlephobia/min/material-ui-color-components |
| 18 | +[min-url]:https://bundlephobia.com/result?p=material-ui-color-components |
16 | 19 |
|
17 | | -> **[Prerelease, not ready for production]** Collections of color components for `material-ui` components for React Material-UI. Highly customizable and theming support ! |
| 20 | +> Collections of color components for `material-ui`. No dependencies, small, highly customizable and theming support ! |
18 | 21 |
|
19 | 22 |  |
20 | 23 |
|
| 24 | +## Why another ColorPicker ? |
| 25 | + |
| 26 | +- Fully compatible with Material-UI : theming and low level components |
| 27 | +- Styled with `styled-components` |
| 28 | +- Highly customizable ColorPicker : gradient picker, palette, input format, deferred mode |
| 29 | +- Small in size (<30kb) without any extra dependencies |
| 30 | +- Use modern React hook and coding conventions |
| 31 | +- Documentation made with Storybook, using Component Story Format and MDX |
| 32 | + |
| 33 | +## Documentation |
| 34 | + |
| 35 | +Full documentation is available here : |
| 36 | + |
21 | 37 | https://mikbry.github.io/material-ui-color-components/ |
22 | 38 |
|
23 | | -## Why ? |
24 | 39 |
|
25 | | -- Fully compatible with Material-UI : Theming and low level components |
26 | | -- Highly customizable ColorPicker : gradient picker, palette, input format, deferred mode |
27 | | -- Small in size without extra dependencies |
28 | | -- Use modern hooks and coding conventions |
| 40 | +## Requirements |
| 41 | +- Works on modern browsers supporting ES6+ (Not compatible with IE) |
| 42 | +- Latest React, Styled-Component and Material-UI frameworks |
29 | 43 |
|
30 | 44 | ## Install |
31 | 45 |
|
32 | | -`yarn add material-ui-color-components` |
| 46 | +```bash |
| 47 | +yarn add material-ui-color-components |
| 48 | +``` |
| 49 | + |
| 50 | +Or using npm |
| 51 | +```bash |
| 52 | +npm add material-ui-color-components |
| 53 | +``` |
| 54 | + |
| 55 | +## Usage |
| 56 | + |
| 57 | +you need to have in your dependencies: |
| 58 | + |
| 59 | +``` |
| 60 | + "@material-ui/core": "^4.9.5", |
| 61 | + "material-ui-popup-state": "^1.5.3", |
| 62 | + "prop-types": "15.7.2", |
| 63 | + "react": "^16.12.0", |
| 64 | + "react-dom": "^16.12.0", |
| 65 | + "styled-components": "^5.0.1" |
| 66 | +``` |
| 67 | + |
| 68 | +`material-ui-color-components` bring 5 components. |
| 69 | + |
| 70 | +### `<ColorPicker/>` |
| 71 | + |
| 72 | +A popover component to display a color tool box (use `ColorBox`) |
| 73 | +```javascript |
| 74 | +import { ColorPicker } from 'material-ui-color-components'; |
| 75 | + |
| 76 | +export const Container = () => ( |
| 77 | + <div> |
| 78 | + <ColorPicker defaultValue="transparent"/> |
| 79 | + </div> |
| 80 | +); |
| 81 | +``` |
| 82 | + |
| 83 | +At first it display a button + an input |
| 84 | + |
| 85 | +[ColorPicker documentation](https://mikbry.github.io/material-ui-color-components/?path=/story/components-colorpicker--basic) |
| 86 | + |
| 87 | +### `<ColorBox />` |
| 88 | + |
| 89 | +A component to display a color tool box |
| 90 | +```javascript |
| 91 | +import { ColorBox } from 'material-ui-color-components'; |
| 92 | + |
| 93 | +export const Container = () => ( |
| 94 | + <div> |
| 95 | + <ColorBox defaultValue="transparent"/> |
| 96 | + </div> |
| 97 | +); |
| 98 | +``` |
| 99 | + |
| 100 | +[ColorBox documentation](https://mikbry.github.io/material-ui-color-components/?path=/story/components-colorbox--basic) |
| 101 | + |
| 102 | +### `<ColorInput />` |
| 103 | + |
| 104 | +An input component to display/edit color values in different format (plain, hex, rgb, hsl, hsv). |
| 105 | + |
| 106 | +```javascript |
| 107 | +import { ColorInput } from 'material-ui-color-components'; |
| 108 | + |
| 109 | +export const Container = () => ( |
| 110 | + <div> |
| 111 | + <ColorInput defaultValue="red"/> |
| 112 | + </div> |
| 113 | +); |
| 114 | +``` |
| 115 | + |
| 116 | +[ColorInput documentation](https://mikbry.github.io/material-ui-color-components/?path=/story/components-colorinput--basic) |
| 117 | + |
| 118 | +### `<ColorPalette />` |
| 119 | + |
| 120 | +A component to display a grid of color buckets. |
| 121 | + |
| 122 | +```javascript |
| 123 | +import { ColorPalette } from 'material-ui-color-components'; |
33 | 124 |
|
| 125 | +const palette = { |
| 126 | + red: '#ff0000', |
| 127 | + blue: '#0000ff', |
| 128 | + green: '#00ff00', |
| 129 | + yellow: 'yellow', |
| 130 | + cyan: 'cyan', |
| 131 | + lime: 'lime', |
| 132 | + gray: 'gray', |
| 133 | + orange: 'orange', |
| 134 | + purple: 'purple', |
| 135 | + black: 'black', |
| 136 | + white: 'white', |
| 137 | + pink: 'pink', |
| 138 | + darkBlue: 'darkBlue', |
| 139 | +}; |
34 | 140 |
|
| 141 | +export const Container = () => ( |
| 142 | + <div> |
| 143 | + <ColorPalette palette={palette} /> |
| 144 | + </div> |
| 145 | +); |
| 146 | +``` |
35 | 147 |
|
36 | | -## `<ColorPicker/>` |
| 148 | +[ColorPalette documentation](https://mikbry.github.io/material-ui-color-components/?path=/story/components-colorpalette--basic) |
37 | 149 |
|
38 | | -TODO : doc |
| 150 | +### `<ColorButton />` |
39 | 151 |
|
40 | | -## `<ColorBox />` |
| 152 | +Displays a button filled with a color |
41 | 153 |
|
42 | | -TODO : doc |
| 154 | +```javascript |
| 155 | +import { ColorButton } from 'material-ui-color-components'; |
43 | 156 |
|
44 | | -## `<ColorInput />` |
| 157 | +export const Container = () => ( |
| 158 | + <div> |
| 159 | + <ColorButton red="red"/> |
| 160 | + </div> |
| 161 | +); |
| 162 | +``` |
45 | 163 |
|
46 | | -TODO : doc |
| 164 | +[ColorButton documentation](https://mikbry.github.io/material-ui-color-components/?path=/story/components-colorbutton--basic) |
47 | 165 |
|
48 | | -## `<ColorPalette />` |
| 166 | +## Contribute |
49 | 167 |
|
50 | | -TODO : doc |
| 168 | +Contributions welcome! Read the [contribution guidelines](CONTRIBUTING.md) first. |
51 | 169 |
|
52 | | -## `<ColorButton />` |
53 | 170 |
|
54 | | -TODO : doc |
| 171 | +## License |
55 | 172 |
|
56 | | -## WIP |
57 | | -TODO list |
58 | | -- [x] init project |
59 | | -- [x] create simple color picker |
60 | | -- [x] create color tools/helpers |
61 | | -- [x] publish |
62 | | -- [ ] finish tests / coverage |
63 | | -- [ ] documentation |
| 173 | +Released under MIT License |
0 commit comments