@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/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 (getBooleanFF('platform.color-picker-radio-button-functionality_6hkcy') && !showDefaultSwatchColor) {
14
+ if (!showDefaultSwatchColor) {
16
15
  defaultSelectedColor = {
17
16
  label: '',
18
17
  value: ''
@@ -4,5 +4,10 @@ declare const _default: {
4
4
  defaultMessage: string;
5
5
  description: string;
6
6
  };
7
+ colorCardRadioItemLabel: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
7
12
  };
8
13
  export default _default;
@@ -4,5 +4,10 @@ declare const _default: {
4
4
  defaultMessage: string;
5
5
  description: string;
6
6
  };
7
+ colorCardRadioItemLabel: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
7
12
  };
8
13
  export default _default;
package/docs/0-intro.tsx CHANGED
@@ -1,32 +1,33 @@
1
1
  import React from 'react';
2
2
  import {
3
- md,
4
- code,
5
- Example,
6
- Props,
7
- AtlassianInternalWarning,
8
- DevPreviewWarning,
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
- marginBottom: 'space.100',
13
+ marginBottom: 'space.100',
14
14
  });
15
15
 
16
16
  const marginTopStyles = xcss({
17
- marginBottom: 'space.100',
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
- <Box xcss={marginBottomStyles}>
24
- <AtlassianInternalWarning />
25
- </Box>
26
- <Box xcss={marginTopStyles}>
27
- <DevPreviewWarning />
28
- </Box>
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
- <Example
42
- packageName="@atlaskit/color-picker"
43
- Component={require('../examples/00-color-picker').default}
44
- source={require('!!raw-loader!../examples/00-color-picker')}
45
- title="Basic Usage"
46
- language="jsx"
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
- <Example
52
- packageName="@atlaskit/color-picker"
53
- Component={require('../examples/01-multi-columns-color-picker').default}
54
- source={require('!!raw-loader!../examples/01-multi-columns-color-picker')}
55
- title="Color picker with multiple columns palette"
56
- language="jsx"
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
- <Props
62
- heading="Color picker props"
63
- props={require('!!extract-react-types-loader!../src/components/ColorPicker')}
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.14",
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.8.0",
40
- "@atlaskit/tokens": "^1.49.0",
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": "^6.5.0",
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.color-picker-radio-button-functionality_6hkcy": {
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 [API Extractor](https://api-extractor.com/).
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
- // (undocumented)
30
- label: string;
31
- // (undocumented)
32
- value: string;
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
- Pick<
38
- Pick<
39
- Omit<ColorPaletteMenuProps, keyof WithAnalyticsEventsProps>,
40
- 'checkMarkColor' | 'label' | 'onChange' | 'palette' | 'selectedColor'
41
- > &
42
- Partial<
43
- Pick<
44
- Omit<ColorPaletteMenuProps, keyof WithAnalyticsEventsProps>,
45
- 'cols' | 'mode'
46
- >
47
- > &
48
- Partial<
49
- Pick<
50
- {
51
- cols: number;
52
- mode: Mode;
53
- },
54
- never
55
- >
56
- > &
57
- React_2.RefAttributes<any> &
58
- WithContextProps,
59
- | 'analyticsContext'
60
- | 'checkMarkColor'
61
- | 'cols'
62
- | 'key'
63
- | 'label'
64
- | 'mode'
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
- checkMarkColor?: string;
75
- cols: number;
76
- createAnalyticsEvent?: any;
77
- label?: string;
78
- mode?: Mode;
79
- onChange: (value: string, analyticsEvent?: object) => void;
80
- palette: Palette;
81
- selectedColor?: string;
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
- // (undocumented)
87
- changeAnalyticsCaller: () => UIAnalyticsEvent | undefined;
88
- // (undocumented)
89
- createAndFireEventOnAtlaskit: (
90
- payload: AnalyticsEventPayload,
91
- ) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
92
- // (undocumented)
93
- static defaultProps: {
94
- cols: number;
95
- mode: Mode;
96
- };
97
- // (undocumented)
98
- onChange: (value: string) => void;
99
- // (undocumented)
100
- render(): JSX.Element;
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
- checkMarkColor?: string;
106
- cols?: number;
107
- createAnalyticsEvent?: any;
108
- label?: string;
109
- onChange: (value: string, analyticsEvent?: object) => void;
110
- palette: Palette;
111
- popperProps?: PopupSelectProps['popperProps'];
112
- selectedColor?: string;
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
- // (undocumented)
118
- changeAnalyticsCaller: () => UIAnalyticsEvent | undefined;
119
- // (undocumented)
120
- createAndFireEventOnAtlaskit: (
121
- payload: AnalyticsEventPayload,
122
- ) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
123
- // (undocumented)
124
- onChangeSelect: (option: ValueType<Color>) => void;
125
- // (undocumented)
126
- onKeyDown: (e: React_2.KeyboardEvent<HTMLElement>) => void;
127
- // (undocumented)
128
- onOptionKeyDown: (value: string) => void;
129
- // (undocumented)
130
- render(): JSX.Element;
131
- // (undocumented)
132
- state: {
133
- isTabbing: boolean;
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
- Pick<
143
- Omit<ColorPickerProps, keyof WithAnalyticsEventsProps> &
144
- React_2.RefAttributes<any> &
145
- WithContextProps,
146
- | 'analyticsContext'
147
- | 'checkMarkColor'
148
- | 'cols'
149
- | 'key'
150
- | 'label'
151
- | 'onChange'
152
- | 'palette'
153
- | 'popperProps'
154
- | 'selectedColor'
155
- > &
156
- React_2.RefAttributes<any>
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
- // (undocumented)
163
- Compact = 0,
164
- // (undocumented)
165
- Standard = 1,
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
- "react": "^16.8.0"
181
+ "react": "^16.8.0"
186
182
  }
187
183
  ```
188
184