|
47 | 47 | } |
48 | 48 | ], |
49 | 49 | "snippet": [ |
50 | | - "<ColorPicker", |
51 | | - " colors={[Colors.green10, Colors.green20, Colors.green30, Colors.green40, Colors.green50, Colors.green60, Colors.green70]$1}", |
52 | | - " initialColor={Colors.green10$2}", |
53 | | - " value={currentColor$3}", |
54 | | - " onDismiss={() => console.log('dismissed')$4}", |
55 | | - " onSubmit={() => console.log('submit')$5}", |
56 | | - " onValueChange={() => console.log('value changed')$6}", |
57 | | - "/>" |
| 50 | + "function Example(props) {", |
| 51 | + " const [colors, setColors] = useState([Colors.green30, Colors.yellow30, Colors.red30]);", |
| 52 | + " const [color, setColor] = useState();", |
| 53 | + " return (", |
| 54 | + " <View flex padding-s5>", |
| 55 | + " <ColorPicker", |
| 56 | + " colors={colors}", |
| 57 | + " initialColor={Colors.green10}", |
| 58 | + " value={color}", |
| 59 | + " onDismiss={() => console.log('dismissed')}", |
| 60 | + " onSubmit={(newColor) => setColors([newColor, ...colors])}", |
| 61 | + " onValueChange={setColor}", |
| 62 | + " />", |
| 63 | + " </View>", |
| 64 | + " );", |
| 65 | + "}" |
58 | 66 | ], |
59 | 67 | "docs": { |
60 | 68 | "hero": { |
|
77 | 85 | "items": [ |
78 | 86 | { |
79 | 87 | "title": "", |
80 | | - "description": "markdown:1. Tapping 'Add New' in the Color Palette opens a color picker dialog.
\n2. Using HLS controls (or even typing actual HEX value) user can achieve any color. ", |
| 88 | + "description": "markdown: 1. Tapping 'Add New' in the Color Palette opens a color picker dialog. \n2. Using HLS controls (or even typing actual HEX value) user can achieve any color. ", |
81 | 89 | "content": [ |
82 | 90 | { |
83 | 91 | "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/ColorPicker/ColorPicker_usage1.png" |
|
113 | 121 | "items": [ |
114 | 122 | { |
115 | 123 | "title": "", |
116 | | - "description": "markdown:1. Tapping on the HEX value will “activate” the input field (Main Input) and display the keyboard. New color can be created either by typing a hex value or by pasting a specific value. \n2. Until new valid hex value is provided, the initial color background is kept. Hex value is highlighted with either white at 25% or black at 25%, depending on the background color. ", |
| 124 | + "description": "markdown: 1. Tapping on the HEX value will “activate” the input field (Main Input) and display the keyboard. New color can be created either by typing a hex value or by pasting a specific value. \n2. Until new valid hex value is provided, the initial color background is kept. Hex value is highlighted with either white at 25% or black at 25%, depending on the background color. ", |
117 | 125 | "content": [ |
118 | 126 | { |
119 | 127 | "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/ColorPicker/ColorPicker_hex1.png" |
|
122 | 130 | }, |
123 | 131 | { |
124 | 132 | "title": "", |
125 | | - "description": "markdown:3. ‘#’ symbol is permanent and cant be deleted. \n4. Once hex value is valid (6 characters), background color changes accordingly. ", |
| 133 | + "description": "markdown: 3. ‘#’ symbol is permanent and cant be deleted. \n4. Once hex value is valid (6 characters), background color changes accordingly. ", |
126 | 134 | "content": [ |
127 | 135 | { |
128 | 136 | "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/ColorPicker/ColorPicker_hex2.png" |
|
0 commit comments