@atlaskit/color-picker 3.0.1 → 3.0.2

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/color-picker
2
2
 
3
+ ## 3.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
8
+
3
9
  ## 3.0.1
4
10
 
5
11
  ### Patch Changes
@@ -3,5 +3,12 @@
3
3
  "main": "../dist/cjs/components/ColorPaletteMenu.js",
4
4
  "module": "../dist/esm/components/ColorPaletteMenu.js",
5
5
  "module:es2019": "../dist/es2019/components/ColorPaletteMenu.js",
6
- "types": "../dist/types/components/ColorPaletteMenu.d.ts"
6
+ "types": "../dist/types/components/ColorPaletteMenu.d.ts",
7
+ "typesVersions": {
8
+ ">=4.0 <4.5": {
9
+ "*": [
10
+ "../dist/types-ts4.0/components/ColorPaletteMenu.d.ts"
11
+ ]
12
+ }
13
+ }
7
14
  }
@@ -60,7 +60,7 @@ var defaultPopperProps = {
60
60
  placement: 'bottom-start'
61
61
  };
62
62
  var packageName = "@atlaskit/color-picker";
63
- var packageVersion = "3.0.1";
63
+ var packageVersion = "3.0.2";
64
64
 
65
65
  var ColorPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
66
66
  (0, _inherits2.default)(ColorPickerWithoutAnalytics, _React$Component);
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/color-picker",
3
- "version": "3.0.1"
3
+ "version": "3.0.2"
4
4
  }
@@ -19,7 +19,7 @@ const defaultPopperProps = {
19
19
  placement: 'bottom-start'
20
20
  };
21
21
  const packageName = "@atlaskit/color-picker";
22
- const packageVersion = "3.0.1";
22
+ const packageVersion = "3.0.2";
23
23
  export class ColorPickerWithoutAnalytics extends React.Component {
24
24
  constructor(...args) {
25
25
  super(...args);
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/color-picker",
3
- "version": "3.0.1"
3
+ "version": "3.0.2"
4
4
  }
@@ -30,7 +30,7 @@ var defaultPopperProps = {
30
30
  placement: 'bottom-start'
31
31
  };
32
32
  var packageName = "@atlaskit/color-picker";
33
- var packageVersion = "3.0.1";
33
+ var packageVersion = "3.0.2";
34
34
  export var ColorPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
35
35
  _inherits(ColorPickerWithoutAnalytics, _React$Component);
36
36
 
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/color-picker",
3
- "version": "3.0.1"
3
+ "version": "3.0.2"
4
4
  }
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { PureComponent } from 'react';
3
+ export interface Props {
4
+ value: string;
5
+ label: string;
6
+ onClick?: (value: string) => void;
7
+ onKeyDown?: (value: string) => void;
8
+ checkMarkColor?: string;
9
+ selected?: boolean;
10
+ focused?: boolean;
11
+ isOption?: boolean;
12
+ isTabbing?: boolean;
13
+ }
14
+ export default class ColorCard extends PureComponent<Props> {
15
+ onMouseDown: (event: React.MouseEvent<HTMLDivElement>) => void;
16
+ onClick: (event: React.MouseEvent<HTMLDivElement>) => void;
17
+ onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
18
+ ref: React.RefObject<HTMLButtonElement>;
19
+ render(): JSX.Element;
20
+ }
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import { Palette, Mode } from '../types';
3
+ export interface Props {
4
+ /** color picker button label */
5
+ label?: string;
6
+ /** list of available colors */
7
+ palette: Palette;
8
+ /** selected color */
9
+ selectedColor?: string;
10
+ /** maximum column length */
11
+ cols: number;
12
+ /** color of checkmark on selected color */
13
+ checkMarkColor?: string;
14
+ /** onChange handler */
15
+ onChange: (value: string, analyticsEvent?: object) => void;
16
+ /** You should not be accessing this prop under any circumstances. It is provided by @atlaskit/analytics-next. */
17
+ createAnalyticsEvent?: any;
18
+ /** style of the color-picker, either 'Compact' or 'Standard', default value is 'Standard' */
19
+ mode?: Mode;
20
+ }
21
+ export declare class ColorPaletteMenuWithoutAnalytics extends React.Component<Props> {
22
+ static defaultProps: {
23
+ cols: number;
24
+ mode: Mode;
25
+ };
26
+ createAndFireEventOnAtlaskit: (payload: import("@atlaskit/analytics-next").AnalyticsEventPayload) => (createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent) => import("@atlaskit/analytics-next").UIAnalyticsEvent;
27
+ changeAnalyticsCaller: () => import("@atlaskit/analytics-next").UIAnalyticsEvent | undefined;
28
+ onChange: (value: string) => void;
29
+ render(): JSX.Element;
30
+ }
31
+ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "label" | "onChange" | "checkMarkColor" | "palette" | "selectedColor"> & Partial<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "cols" | "mode">> & Partial<Pick<{
32
+ cols: number;
33
+ mode: Mode;
34
+ }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "label" | "key" | "onChange" | "checkMarkColor" | "cols" | "mode" | "palette" | "selectedColor" | "analyticsContext"> & React.RefAttributes<any>>;
35
+ export default _default;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { ValueType, PopupSelectProps } from '@atlaskit/select';
3
+ import { Palette, Color } from '../types';
4
+ export interface Props {
5
+ /** color picker button label */
6
+ label?: string;
7
+ /** list of available colors */
8
+ palette: Palette;
9
+ /** selected color */
10
+ selectedColor?: string;
11
+ /** maximum column length */
12
+ cols?: number;
13
+ /** color of checkmark on selected color */
14
+ checkMarkColor?: string;
15
+ /** props for react-popper */
16
+ popperProps?: PopupSelectProps['popperProps'];
17
+ /** onChange handler */
18
+ onChange: (value: string, analyticsEvent?: object) => void;
19
+ /** You should not be accessing this prop under any circumstances. It is provided by @atlaskit/analytics-next. */
20
+ createAnalyticsEvent?: any;
21
+ }
22
+ export declare class ColorPickerWithoutAnalytics extends React.Component<Props> {
23
+ createAndFireEventOnAtlaskit: (payload: import("@atlaskit/analytics-next").AnalyticsEventPayload) => (createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent) => import("@atlaskit/analytics-next").UIAnalyticsEvent;
24
+ state: {
25
+ isTabbing: boolean;
26
+ };
27
+ changeAnalyticsCaller: () => import("@atlaskit/analytics-next").UIAnalyticsEvent | undefined;
28
+ onChangeSelect: (option: ValueType<Color>) => void;
29
+ onOptionKeyDown: (value: string) => void;
30
+ onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
31
+ render(): JSX.Element;
32
+ }
33
+ declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "label" | "key" | "onChange" | "checkMarkColor" | "cols" | "popperProps" | "palette" | "selectedColor" | "analyticsContext"> & React.RefAttributes<any>>;
34
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export interface Props {
3
+ value: string;
4
+ label?: string;
5
+ onClick?: () => void;
6
+ expanded?: boolean;
7
+ }
8
+ export default class ColorCard extends React.PureComponent<Props> {
9
+ onMouseDown: (event: React.MouseEvent<HTMLButtonElement>) => void;
10
+ onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
11
+ render(): JSX.Element;
12
+ }
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { MenuListComponentProps, OptionProps } from '@atlaskit/select';
3
+ import { Color } from '../types';
4
+ export declare const MenuList: (props: MenuListComponentProps<Color>) => JSX.Element;
5
+ export declare const Option: (props: OptionProps<Color>) => JSX.Element;
6
+ export declare const DropdownIndicator: () => null;
7
+ export declare const Placeholder: () => null;
@@ -0,0 +1,6 @@
1
+ export declare const COLOR_CARD_SIZE = 30;
2
+ export declare const KEY_SPACE = " ";
3
+ export declare const KEY_ENTER = "Enter";
4
+ export declare const KEY_ARROW_UP = "ArrowDown";
5
+ export declare const KEY_ARROW_DOWN = "ArrowUp";
6
+ export declare const KEY_TAB = "Tab";
@@ -0,0 +1,10 @@
1
+ import ColorPicker from './components/ColorPicker';
2
+ import { Mode } from './types';
3
+ declare const Compact: Mode, Standard: Mode;
4
+ export { ColorPickerWithoutAnalytics } from './components/ColorPicker';
5
+ export type { Props as ColorPickerProps } from './components/ColorPicker';
6
+ export { ColorPaletteMenuWithoutAnalytics } from './components/ColorPaletteMenu';
7
+ export type { Props as ColorPaletteMenuProps } from './components/ColorPaletteMenu';
8
+ export default ColorPicker;
9
+ export { default as ColorPaletteMenu } from './components/ColorPaletteMenu';
10
+ export { Standard, Compact };
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ declare type ColorCardProps = {
3
+ focused?: boolean;
4
+ isTabbing?: boolean;
5
+ };
6
+ export declare const ColorCardOption: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & ColorCardProps, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & ColorCardProps>;
7
+ export declare const ColorCardButton: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & ColorCardProps, any, import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & ColorCardProps>;
8
+ declare type ColorCardContentProps = {
9
+ color: string;
10
+ };
11
+ export declare const ColorCardContent: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & ColorCardContentProps, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & ColorCardContentProps>;
12
+ export declare const ColorCardContentCheckMark: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
13
+ export {};
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { Mode } from '../types';
3
+ declare type Props = {
4
+ mode?: Mode;
5
+ };
6
+ declare type ColorPaletteMenuProps = {
7
+ cols: number;
8
+ mode?: Mode;
9
+ };
10
+ export declare const ColorCardWrapper: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
11
+ export declare const ColorPaletteContainer: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Props, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Props>;
12
+ export declare const ColorPaletteMenu: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & ColorPaletteMenuProps, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & ColorPaletteMenuProps>;
13
+ export {};
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const ColorCardWrapper: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
@@ -0,0 +1,9 @@
1
+ export interface Color {
2
+ label: string;
3
+ value: string;
4
+ }
5
+ export declare type Palette = Color[];
6
+ export declare enum Mode {
7
+ Compact = 0,
8
+ Standard = 1
9
+ }
@@ -0,0 +1,7 @@
1
+ import { Palette } from './types';
2
+ export declare const getWidth: (cols: number) => number;
3
+ export declare const getOptions: import("memoize-one").MemoizedFn<(palette: Palette, selectedColor?: string | undefined) => {
4
+ options: Palette;
5
+ value: import("./types").Color;
6
+ focusedItemIndex: number;
7
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/color-picker",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Jira Color Picker Component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,6 +12,13 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
+ "typesVersions": {
16
+ ">=4.0 <4.5": {
17
+ "*": [
18
+ "dist/types-ts4.0/*"
19
+ ]
20
+ }
21
+ },
15
22
  "atlaskit:src": "src/index.ts",
16
23
  "atlassian": {
17
24
  "team": "Jira Software: Roadmaps",
@@ -23,8 +30,8 @@
23
30
  "dependencies": {
24
31
  "@atlaskit/analytics-next": "^8.2.0",
25
32
  "@atlaskit/icon": "^21.10.0",
26
- "@atlaskit/select": "^15.6.0",
27
- "@atlaskit/theme": "^12.1.0",
33
+ "@atlaskit/select": "^15.7.0",
34
+ "@atlaskit/theme": "^12.2.0",
28
35
  "@atlaskit/tokens": "^0.10.0",
29
36
  "@babel/runtime": "^7.0.0",
30
37
  "memoize-one": "^6.0.0",
@@ -42,7 +49,7 @@
42
49
  "enzyme-adapter-react-16": "^1.15.1",
43
50
  "jscodeshift": "^0.13.0",
44
51
  "react": "^16.8.0",
45
- "typescript": "4.3.5"
52
+ "typescript": "4.5.5"
46
53
  },
47
54
  "keywords": [
48
55
  "ui",
package/report.api.md CHANGED
@@ -1,6 +1,10 @@
1
- ## API Report File for "@atlaskit/color-picker".
1
+ ## API Report File for "@atlaskit/color-picker"
2
2
 
3
- > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ <!--
6
+ Generated API Report version: 2.0
7
+ -->
4
8
 
5
9
  [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
6
10
 
@@ -14,12 +18,16 @@ import { ValueType } from '@atlaskit/select';
14
18
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
15
19
  import { WithContextProps } from '@atlaskit/analytics-next';
16
20
 
17
- declare interface Color {
21
+ // @public (undocumented)
22
+ interface Color {
23
+ // (undocumented)
18
24
  label: string;
25
+ // (undocumented)
19
26
  value: string;
20
27
  }
21
28
 
22
- export declare const ColorPaletteMenu: React_2.ForwardRefExoticComponent<
29
+ // @public (undocumented)
30
+ export const ColorPaletteMenu: React_2.ForwardRefExoticComponent<
23
31
  Pick<
24
32
  Pick<
25
33
  Omit<ColorPaletteMenuProps, keyof WithAnalyticsEventsProps>,
@@ -55,78 +63,80 @@ export declare const ColorPaletteMenu: React_2.ForwardRefExoticComponent<
55
63
  React_2.RefAttributes<any>
56
64
  >;
57
65
 
58
- export declare interface ColorPaletteMenuProps {
59
- /** color picker button label */
60
- label?: string;
61
- /** list of available colors */
62
- palette: Palette;
63
- /** selected color */
64
- selectedColor?: string;
65
- /** maximum column length */
66
- cols: number;
67
- /** color of checkmark on selected color */
66
+ // @public (undocumented)
67
+ export interface ColorPaletteMenuProps {
68
68
  checkMarkColor?: string;
69
- /** onChange handler */
70
- onChange: (value: string, analyticsEvent?: object) => void;
71
- /** You should not be accessing this prop under any circumstances. It is provided by @atlaskit/analytics-next. */
69
+ cols: number;
72
70
  createAnalyticsEvent?: any;
73
- /** style of the color-picker, either 'Compact' or 'Standard', default value is 'Standard' */
71
+ label?: string;
74
72
  mode?: Mode;
73
+ onChange: (value: string, analyticsEvent?: object) => void;
74
+ palette: Palette;
75
+ selectedColor?: string;
75
76
  }
76
77
 
77
- export declare class ColorPaletteMenuWithoutAnalytics extends React_2.Component<
78
+ // @public (undocumented)
79
+ export class ColorPaletteMenuWithoutAnalytics extends React_2.Component<
78
80
  ColorPaletteMenuProps
79
81
  > {
82
+ // (undocumented)
83
+ changeAnalyticsCaller: () => UIAnalyticsEvent | undefined;
84
+ // (undocumented)
85
+ createAndFireEventOnAtlaskit: (
86
+ payload: AnalyticsEventPayload,
87
+ ) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
88
+ // (undocumented)
80
89
  static defaultProps: {
81
90
  cols: number;
82
91
  mode: Mode;
83
92
  };
84
- createAndFireEventOnAtlaskit: (
85
- payload: AnalyticsEventPayload,
86
- ) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
87
- changeAnalyticsCaller: () => UIAnalyticsEvent | undefined;
93
+ // (undocumented)
88
94
  onChange: (value: string) => void;
95
+ // (undocumented)
89
96
  render(): JSX.Element;
90
97
  }
91
98
 
92
- export declare interface ColorPickerProps {
93
- /** color picker button label */
99
+ // @public (undocumented)
100
+ export interface ColorPickerProps {
101
+ checkMarkColor?: string;
102
+ cols?: number;
103
+ createAnalyticsEvent?: any;
94
104
  label?: string;
95
- /** list of available colors */
105
+ onChange: (value: string, analyticsEvent?: object) => void;
96
106
  palette: Palette;
97
- /** selected color */
98
- selectedColor?: string;
99
- /** maximum column length */
100
- cols?: number;
101
- /** color of checkmark on selected color */
102
- checkMarkColor?: string;
103
- /** props for react-popper */
104
107
  popperProps?: PopupSelectProps['popperProps'];
105
- /** onChange handler */
106
- onChange: (value: string, analyticsEvent?: object) => void;
107
- /** You should not be accessing this prop under any circumstances. It is provided by @atlaskit/analytics-next. */
108
- createAnalyticsEvent?: any;
108
+ selectedColor?: string;
109
109
  }
110
110
 
111
- export declare class ColorPickerWithoutAnalytics extends React_2.Component<
111
+ // @public (undocumented)
112
+ export class ColorPickerWithoutAnalytics extends React_2.Component<
112
113
  ColorPickerProps
113
114
  > {
115
+ // (undocumented)
116
+ changeAnalyticsCaller: () => UIAnalyticsEvent | undefined;
117
+ // (undocumented)
114
118
  createAndFireEventOnAtlaskit: (
115
119
  payload: AnalyticsEventPayload,
116
120
  ) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
117
- state: {
118
- isTabbing: boolean;
119
- };
120
- changeAnalyticsCaller: () => UIAnalyticsEvent | undefined;
121
+ // (undocumented)
121
122
  onChangeSelect: (option: ValueType<Color>) => void;
122
- onOptionKeyDown: (value: string) => void;
123
+ // (undocumented)
123
124
  onKeyDown: (e: React_2.KeyboardEvent<HTMLElement>) => void;
125
+ // (undocumented)
126
+ onOptionKeyDown: (value: string) => void;
127
+ // (undocumented)
124
128
  render(): JSX.Element;
129
+ // (undocumented)
130
+ state: {
131
+ isTabbing: boolean;
132
+ };
125
133
  }
126
134
 
127
- export declare const Compact: Mode;
135
+ // @public (undocumented)
136
+ export const Compact: Mode;
128
137
 
129
- declare const _default: React_2.ForwardRefExoticComponent<
138
+ // @public (undocumented)
139
+ const _default: React_2.ForwardRefExoticComponent<
130
140
  Pick<
131
141
  Omit<ColorPickerProps, keyof WithAnalyticsEventsProps> &
132
142
  React_2.RefAttributes<any> &
@@ -145,14 +155,19 @@ declare const _default: React_2.ForwardRefExoticComponent<
145
155
  >;
146
156
  export default _default;
147
157
 
148
- declare enum Mode {
158
+ // @public (undocumented)
159
+ enum Mode {
160
+ // (undocumented)
149
161
  Compact = 0,
162
+ // (undocumented)
150
163
  Standard = 1,
151
164
  }
152
165
 
153
- declare type Palette = Color[];
166
+ // @public (undocumented)
167
+ type Palette = Color[];
154
168
 
155
- export declare const Standard: Mode;
169
+ // @public (undocumented)
170
+ export const Standard: Mode;
156
171
 
157
- export {};
172
+ // (No @packageDocumentation comment for this package)
158
173
  ```