@atlaskit/color-picker 3.2.14 → 3.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/codemods/1.0.0-popper-props.ts +75 -88
- package/codemods/__tests__/1.0.0-popper-props.ts +51 -51
- package/codemods/utils/helpers.ts +250 -261
- package/dist/cjs/components/ColorCard.js +19 -17
- package/dist/cjs/components/ColorPaletteMenu.js +9 -4
- package/dist/cjs/components/ColorPicker.js +3 -5
- package/dist/cjs/components/Trigger.js +8 -14
- package/dist/cjs/components/components.js +1 -0
- package/dist/cjs/messages.js +5 -0
- package/dist/cjs/utils.js +1 -2
- package/dist/es2019/components/ColorCard.js +20 -17
- package/dist/es2019/components/ColorPaletteMenu.js +9 -4
- package/dist/es2019/components/ColorPicker.js +3 -5
- package/dist/es2019/components/Trigger.js +8 -14
- package/dist/es2019/components/components.js +1 -0
- package/dist/es2019/messages.js +5 -0
- package/dist/es2019/utils.js +1 -2
- package/dist/esm/components/ColorCard.js +19 -17
- package/dist/esm/components/ColorPaletteMenu.js +9 -4
- package/dist/esm/components/ColorPicker.js +3 -5
- package/dist/esm/components/Trigger.js +8 -14
- package/dist/esm/components/components.js +1 -0
- package/dist/esm/messages.js +5 -0
- package/dist/esm/utils.js +1 -2
- package/dist/types/messages.d.ts +5 -0
- package/dist/types-ts4.5/messages.d.ts +5 -0
- package/docs/0-intro.tsx +35 -34
- package/package.json +5 -8
- package/report.api.md +103 -107
package/dist/esm/utils.js
CHANGED
|
@@ -4,7 +4,6 @@ import { gridSize } from '@atlaskit/theme';
|
|
|
4
4
|
import { COLOR_CARD_SIZE } from './constants';
|
|
5
5
|
import memoizeOne from 'memoize-one';
|
|
6
6
|
import { Mode } from './types';
|
|
7
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
export var getWidth = function getWidth(cols, mode) {
|
|
9
8
|
var width = cols * (COLOR_CARD_SIZE + gridSize() / 2);
|
|
10
9
|
return mode === Mode.Standard ? width + gridSize() : width;
|
|
@@ -12,7 +11,7 @@ export var getWidth = function getWidth(cols, mode) {
|
|
|
12
11
|
export var getOptions = memoizeOne(function (palette, selectedColor, showDefaultSwatchColor) {
|
|
13
12
|
var focusedItemIndex = 0;
|
|
14
13
|
var defaultSelectedColor = palette[0];
|
|
15
|
-
if (
|
|
14
|
+
if (!showDefaultSwatchColor) {
|
|
16
15
|
defaultSelectedColor = {
|
|
17
16
|
label: '',
|
|
18
17
|
value: ''
|
package/dist/types/messages.d.ts
CHANGED
package/docs/0-intro.tsx
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
md,
|
|
4
|
+
code,
|
|
5
|
+
Example,
|
|
6
|
+
Props,
|
|
7
|
+
AtlassianInternalWarning,
|
|
8
|
+
DevPreviewWarning,
|
|
9
9
|
} from '@atlaskit/docs';
|
|
10
10
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
11
11
|
|
|
12
12
|
const marginBottomStyles = xcss({
|
|
13
|
-
|
|
13
|
+
marginBottom: 'space.100',
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
const marginTopStyles = xcss({
|
|
17
|
-
|
|
17
|
+
marginBottom: 'space.100',
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
20
21
|
export default md`
|
|
21
22
|
${(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
<>
|
|
24
|
+
<Box xcss={marginBottomStyles}>
|
|
25
|
+
<AtlassianInternalWarning />
|
|
26
|
+
</Box>
|
|
27
|
+
<Box xcss={marginTopStyles}>
|
|
28
|
+
<DevPreviewWarning />
|
|
29
|
+
</Box>
|
|
30
|
+
</>
|
|
30
31
|
)}
|
|
31
32
|
|
|
32
33
|
This component allows to pick colors from color palette.
|
|
@@ -38,29 +39,29 @@ ${code`
|
|
|
38
39
|
`}
|
|
39
40
|
|
|
40
41
|
${(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
<Example
|
|
43
|
+
packageName="@atlaskit/color-picker"
|
|
44
|
+
Component={require('../examples/00-color-picker').default}
|
|
45
|
+
source={require('!!raw-loader!../examples/00-color-picker')}
|
|
46
|
+
title="Basic Usage"
|
|
47
|
+
language="jsx"
|
|
48
|
+
/>
|
|
48
49
|
)}
|
|
49
50
|
|
|
50
51
|
${(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
<Example
|
|
53
|
+
packageName="@atlaskit/color-picker"
|
|
54
|
+
Component={require('../examples/01-multi-columns-color-picker').default}
|
|
55
|
+
source={require('!!raw-loader!../examples/01-multi-columns-color-picker')}
|
|
56
|
+
title="Color picker with multiple columns palette"
|
|
57
|
+
language="jsx"
|
|
58
|
+
/>
|
|
58
59
|
)}
|
|
59
60
|
|
|
60
61
|
${(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
<Props
|
|
63
|
+
heading="Color picker props"
|
|
64
|
+
props={require('!!extract-react-types-loader!../src/components/ColorPicker')}
|
|
65
|
+
/>
|
|
65
66
|
)}
|
|
66
67
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/color-picker",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.16",
|
|
4
4
|
"description": "Jira Color Picker Component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"@atlaskit/icon": "^22.3.0",
|
|
37
37
|
"@atlaskit/platform-feature-flags": "^0.2.5",
|
|
38
38
|
"@atlaskit/select": "^17.10.0",
|
|
39
|
-
"@atlaskit/theme": "^12.
|
|
40
|
-
"@atlaskit/tokens": "^1.
|
|
39
|
+
"@atlaskit/theme": "^12.9.0",
|
|
40
|
+
"@atlaskit/tokens": "^1.50.0",
|
|
41
41
|
"@atlaskit/tooltip": "^18.4.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|
|
43
43
|
"@emotion/react": "^11.7.1",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@af/visual-regression": "*",
|
|
52
|
-
"@atlaskit/primitives": "^
|
|
52
|
+
"@atlaskit/primitives": "^7.0.0",
|
|
53
53
|
"@atlaskit/visual-regression": "*",
|
|
54
54
|
"@testing-library/react": "^12.1.5",
|
|
55
55
|
"@testing-library/user-event": "^14.4.3",
|
|
@@ -77,10 +77,7 @@
|
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
"platform-feature-flags": {
|
|
80
|
-
"platform.
|
|
81
|
-
"type": "boolean"
|
|
82
|
-
},
|
|
83
|
-
"platform.jca11y-1559-dashboard-view-dashboard-remove-duplicate-aria-label_g5i3i": {
|
|
80
|
+
"platform.jca11y-2997-remove-duplicate-screen-reader-announcements_fz13s": {
|
|
84
81
|
"type": "boolean"
|
|
85
82
|
}
|
|
86
83
|
}
|
package/report.api.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/color-picker"
|
|
4
4
|
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
8
|
|
|
8
9
|
### Table of contents
|
|
@@ -26,112 +27,107 @@ import { WithContextProps } from '@atlaskit/analytics-next';
|
|
|
26
27
|
|
|
27
28
|
// @public (undocumented)
|
|
28
29
|
interface Color {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
// (undocumented)
|
|
31
|
+
label: string;
|
|
32
|
+
// (undocumented)
|
|
33
|
+
value: string;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
// @public (undocumented)
|
|
36
37
|
export const ColorPaletteMenu: React_2.ForwardRefExoticComponent<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
| 'onChange'
|
|
66
|
-
| 'palette'
|
|
67
|
-
| 'selectedColor'
|
|
68
|
-
> &
|
|
69
|
-
React_2.RefAttributes<any>
|
|
38
|
+
Pick<
|
|
39
|
+
Pick<
|
|
40
|
+
Omit<ColorPaletteMenuProps, keyof WithAnalyticsEventsProps>,
|
|
41
|
+
'checkMarkColor' | 'label' | 'onChange' | 'palette' | 'selectedColor'
|
|
42
|
+
> &
|
|
43
|
+
Partial<Pick<Omit<ColorPaletteMenuProps, keyof WithAnalyticsEventsProps>, 'cols' | 'mode'>> &
|
|
44
|
+
Partial<
|
|
45
|
+
Pick<
|
|
46
|
+
{
|
|
47
|
+
cols: number;
|
|
48
|
+
mode: Mode;
|
|
49
|
+
},
|
|
50
|
+
never
|
|
51
|
+
>
|
|
52
|
+
> &
|
|
53
|
+
React_2.RefAttributes<any> &
|
|
54
|
+
WithContextProps,
|
|
55
|
+
| 'analyticsContext'
|
|
56
|
+
| 'checkMarkColor'
|
|
57
|
+
| 'cols'
|
|
58
|
+
| 'key'
|
|
59
|
+
| 'label'
|
|
60
|
+
| 'mode'
|
|
61
|
+
| 'onChange'
|
|
62
|
+
| 'palette'
|
|
63
|
+
| 'selectedColor'
|
|
64
|
+
> &
|
|
65
|
+
React_2.RefAttributes<any>
|
|
70
66
|
>;
|
|
71
67
|
|
|
72
68
|
// @public (undocumented)
|
|
73
69
|
export interface ColorPaletteMenuProps {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
checkMarkColor?: string;
|
|
71
|
+
cols: number;
|
|
72
|
+
createAnalyticsEvent?: any;
|
|
73
|
+
label?: string;
|
|
74
|
+
mode?: Mode;
|
|
75
|
+
onChange: (value: string, analyticsEvent?: object) => void;
|
|
76
|
+
palette: Palette;
|
|
77
|
+
selectedColor?: string;
|
|
82
78
|
}
|
|
83
79
|
|
|
84
80
|
// @public (undocumented)
|
|
85
81
|
export class ColorPaletteMenuWithoutAnalytics extends React_2.Component<ColorPaletteMenuProps> {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
82
|
+
// (undocumented)
|
|
83
|
+
changeAnalyticsCaller: () => UIAnalyticsEvent | undefined;
|
|
84
|
+
// (undocumented)
|
|
85
|
+
createAndFireEventOnAtlaskit: (
|
|
86
|
+
payload: AnalyticsEventPayload,
|
|
87
|
+
) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
|
|
88
|
+
// (undocumented)
|
|
89
|
+
static defaultProps: {
|
|
90
|
+
cols: number;
|
|
91
|
+
mode: Mode;
|
|
92
|
+
};
|
|
93
|
+
// (undocumented)
|
|
94
|
+
onChange: (value: string) => void;
|
|
95
|
+
// (undocumented)
|
|
96
|
+
render(): JSX.Element;
|
|
101
97
|
}
|
|
102
98
|
|
|
103
99
|
// @public (undocumented)
|
|
104
100
|
export interface ColorPickerProps {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
101
|
+
checkMarkColor?: string;
|
|
102
|
+
cols?: number;
|
|
103
|
+
createAnalyticsEvent?: any;
|
|
104
|
+
label?: string;
|
|
105
|
+
onChange: (value: string, analyticsEvent?: object) => void;
|
|
106
|
+
palette: Palette;
|
|
107
|
+
popperProps?: PopupSelectProps['popperProps'];
|
|
108
|
+
selectedColor?: string;
|
|
113
109
|
}
|
|
114
110
|
|
|
115
111
|
// @public (undocumented)
|
|
116
112
|
export class ColorPickerWithoutAnalytics extends React_2.Component<ColorPickerProps> {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
113
|
+
// (undocumented)
|
|
114
|
+
changeAnalyticsCaller: () => UIAnalyticsEvent | undefined;
|
|
115
|
+
// (undocumented)
|
|
116
|
+
createAndFireEventOnAtlaskit: (
|
|
117
|
+
payload: AnalyticsEventPayload,
|
|
118
|
+
) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
|
|
119
|
+
// (undocumented)
|
|
120
|
+
onChangeSelect: (option: ValueType<Color>) => void;
|
|
121
|
+
// (undocumented)
|
|
122
|
+
onKeyDown: (e: React_2.KeyboardEvent<HTMLElement>) => void;
|
|
123
|
+
// (undocumented)
|
|
124
|
+
onOptionKeyDown: (value: string) => void;
|
|
125
|
+
// (undocumented)
|
|
126
|
+
render(): JSX.Element;
|
|
127
|
+
// (undocumented)
|
|
128
|
+
state: {
|
|
129
|
+
isTabbing: boolean;
|
|
130
|
+
};
|
|
135
131
|
}
|
|
136
132
|
|
|
137
133
|
// @public (undocumented)
|
|
@@ -139,30 +135,30 @@ export const Compact: Mode;
|
|
|
139
135
|
|
|
140
136
|
// @public (undocumented)
|
|
141
137
|
const _default: React_2.ForwardRefExoticComponent<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
138
|
+
Pick<
|
|
139
|
+
Omit<ColorPickerProps, keyof WithAnalyticsEventsProps> &
|
|
140
|
+
React_2.RefAttributes<any> &
|
|
141
|
+
WithContextProps,
|
|
142
|
+
| 'analyticsContext'
|
|
143
|
+
| 'checkMarkColor'
|
|
144
|
+
| 'cols'
|
|
145
|
+
| 'key'
|
|
146
|
+
| 'label'
|
|
147
|
+
| 'onChange'
|
|
148
|
+
| 'palette'
|
|
149
|
+
| 'popperProps'
|
|
150
|
+
| 'selectedColor'
|
|
151
|
+
> &
|
|
152
|
+
React_2.RefAttributes<any>
|
|
157
153
|
>;
|
|
158
154
|
export default _default;
|
|
159
155
|
|
|
160
156
|
// @public (undocumented)
|
|
161
157
|
enum Mode {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
158
|
+
// (undocumented)
|
|
159
|
+
Compact = 0,
|
|
160
|
+
// (undocumented)
|
|
161
|
+
Standard = 1,
|
|
166
162
|
}
|
|
167
163
|
|
|
168
164
|
// @public (undocumented)
|
|
@@ -182,7 +178,7 @@ export const Standard: Mode;
|
|
|
182
178
|
|
|
183
179
|
```json
|
|
184
180
|
{
|
|
185
|
-
|
|
181
|
+
"react": "^16.8.0"
|
|
186
182
|
}
|
|
187
183
|
```
|
|
188
184
|
|