Skip to content

Commit 77334fd

Browse files
committed
new DEFAULT_COLORS constant
1 parent 475126c commit 77334fd

3 files changed

Lines changed: 403 additions & 76 deletions

File tree

packages/components/releaseNotes/components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Components, models, actions, and utility functions for LabKey applications and p
77
- ChartColorInputs for single color geomOptions and series specific color and shape value map
88
- ChartConfig measuresOptions to store per series mapping object
99
- Hide and show color options based on selected chart type and measures
10-
- ColorPickerInput update to use fixed position by default
10+
- ColorPickerInput update to use fixed position by default and new DEFAULT_COLORS constant
1111
- Add LetterIcon for use with "Auto" set series values
1212

1313
### version 7.1.0

packages/components/src/internal/components/forms/input/ColorPickerInput.tsx

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,73 @@
1-
import React, { FC, memo, useCallback, useState, useRef } from 'react';
1+
import React, { FC, memo, useCallback, useRef, useState } from 'react';
22
import { ColorResult, CompactPicker } from 'react-color';
33
import classNames from 'classnames';
44

55
import { ColorIcon } from '../../base/ColorIcon';
66
import { RemoveEntityButton } from '../../buttons/RemoveEntityButton';
77

8+
const DEFAULT_COLORS = [
9+
'#FFFFFF',
10+
'#F07575',
11+
'#F4AE71',
12+
'#F0E075',
13+
'#E3F075',
14+
'#A8E477',
15+
'#7FF0C3',
16+
'#81C6E9',
17+
'#AC8EEB',
18+
'#D983EC',
19+
'#EE96BC',
20+
'#D6C1A4',
21+
'#BFBFBF',
22+
'#EA4545',
23+
'#EC7812',
24+
'#E3C919',
25+
'#BCCF17',
26+
'#6BC026',
27+
'#1ADB8E',
28+
'#269BD6',
29+
'#7C4DE0',
30+
'#B921DB',
31+
'#E1478A',
32+
'#BB9868',
33+
'#808080',
34+
'#D11717',
35+
'#D26B10',
36+
'#DCB118',
37+
'#A9B314',
38+
'#589E1F',
39+
'#16BB79',
40+
'#2084B6',
41+
'#5B25D0',
42+
'#961BB1',
43+
'#B81E61',
44+
'#8D6C3F',
45+
'#404040',
46+
'#A11212',
47+
'#AF590D',
48+
'#AA8813',
49+
'#868E10',
50+
'#4A841A',
51+
'#13A067',
52+
'#1B6E98',
53+
'#481DA5',
54+
'#7C1692',
55+
'#95184E',
56+
'#745934',
57+
'#000000',
58+
'#7C0E0E',
59+
'#8A460A',
60+
'#8A6E0F',
61+
'#6C730D',
62+
'#396614',
63+
'#108456',
64+
'#175E82',
65+
'#351579',
66+
'#651278',
67+
'#72133C',
68+
'#634C2C',
69+
];
70+
871
interface Props {
972
allowRemove?: boolean;
1073
colors?: string[];
@@ -19,7 +82,7 @@ interface Props {
1982
export const ColorPickerInput: FC<Props> = memo(props => {
2083
const {
2184
allowRemove,
22-
colors,
85+
colors = DEFAULT_COLORS,
2386
disabled,
2487
name,
2588
onChange,

0 commit comments

Comments
 (0)