@atlaskit/color-picker 3.1.9 → 3.2.0
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 +6 -0
- package/dist/cjs/components/ColorCard.js +88 -80
- package/dist/cjs/components/ColorPaletteMenu.js +88 -88
- package/dist/cjs/components/ColorPicker.js +12 -8
- package/dist/cjs/components/Trigger.js +72 -56
- package/dist/cjs/components/components.js +35 -27
- package/dist/cjs/utils.js +4 -2
- package/dist/es2019/components/ColorCard.js +93 -70
- package/dist/es2019/components/ColorPaletteMenu.js +89 -73
- package/dist/es2019/components/ColorPicker.js +14 -9
- package/dist/es2019/components/Trigger.js +72 -39
- package/dist/es2019/components/components.js +32 -22
- package/dist/es2019/utils.js +5 -1
- package/dist/esm/components/ColorCard.js +89 -85
- package/dist/esm/components/ColorPaletteMenu.js +89 -90
- package/dist/esm/components/ColorPicker.js +14 -9
- package/dist/esm/components/Trigger.js +71 -57
- package/dist/esm/components/components.js +35 -27
- package/dist/esm/utils.js +4 -2
- package/dist/types/components/ColorCard.d.ts +3 -9
- package/dist/types/components/ColorPaletteMenu.d.ts +8 -18
- package/dist/types/components/ColorPicker.d.ts +6 -4
- package/dist/types/components/Trigger.d.ts +3 -6
- package/dist/types/components/components.d.ts +4 -3
- package/dist/types/utils.d.ts +2 -2
- package/dist/types-ts4.5/components/ColorCard.d.ts +3 -9
- package/dist/types-ts4.5/components/ColorPaletteMenu.d.ts +8 -18
- package/dist/types-ts4.5/components/ColorPicker.d.ts +6 -4
- package/dist/types-ts4.5/components/Trigger.d.ts +3 -6
- package/dist/types-ts4.5/components/components.d.ts +4 -3
- package/dist/types-ts4.5/utils.d.ts +2 -2
- package/package.json +4 -4
- package/dist/cjs/styled/ColorCard.js +0 -40
- package/dist/cjs/styled/ColorPalette.js +0 -24
- package/dist/cjs/styled/ColorPicker.js +0 -11
- package/dist/es2019/styled/ColorCard.js +0 -72
- package/dist/es2019/styled/ColorPalette.js +0 -28
- package/dist/es2019/styled/ColorPicker.js +0 -4
- package/dist/esm/styled/ColorCard.js +0 -30
- package/dist/esm/styled/ColorPalette.js +0 -18
- package/dist/esm/styled/ColorPicker.js +0 -4
- package/dist/types/styled/ColorCard.d.ts +0 -13
- package/dist/types/styled/ColorPalette.d.ts +0 -13
- package/dist/types/styled/ColorPicker.d.ts +0 -2
- package/dist/types-ts4.5/styled/ColorCard.d.ts +0 -13
- package/dist/types-ts4.5/styled/ColorPalette.d.ts +0 -13
- package/dist/types-ts4.5/styled/ColorPicker.d.ts +0 -2
- package/tmp/api-report-tmp.d.ts +0 -114
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import React from 'react';
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
|
|
5
4
|
import ColorCard from './ColorCard';
|
|
6
5
|
import { getWidth } from '../utils';
|
|
7
|
-
import {
|
|
6
|
+
import { COLOR_CARD_SIZE } from '../constants';
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
8
8
|
export var MenuList = function MenuList(props) {
|
|
9
|
-
var
|
|
10
|
-
cols = props.selectProps.cols,
|
|
9
|
+
var cols = props.selectProps.cols,
|
|
11
10
|
innerRef = props.innerRef,
|
|
12
|
-
|
|
13
|
-
return
|
|
11
|
+
children = props.children;
|
|
12
|
+
return jsx("div", {
|
|
13
|
+
css: colorPaletteContainerStyles,
|
|
14
14
|
role: "radiogroup",
|
|
15
15
|
style: {
|
|
16
16
|
maxWidth: cols ? getWidth(cols) : undefined
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
},
|
|
18
|
+
ref: innerRef
|
|
19
|
+
}, children);
|
|
20
20
|
};
|
|
21
21
|
export var Option = function Option(props) {
|
|
22
22
|
var _props$data = props.data,
|
|
@@ -29,26 +29,34 @@ export var Option = function Option(props) {
|
|
|
29
29
|
isFocused = props.isFocused,
|
|
30
30
|
isSelected = props.isSelected,
|
|
31
31
|
innerProps = props.innerProps;
|
|
32
|
-
return (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}))
|
|
47
|
-
);
|
|
32
|
+
return jsx("div", _extends({
|
|
33
|
+
css: colorCardWrapperStyles
|
|
34
|
+
}, innerProps), jsx(ColorCard, {
|
|
35
|
+
label: label,
|
|
36
|
+
value: value,
|
|
37
|
+
checkMarkColor: checkMarkColor,
|
|
38
|
+
isOption: true,
|
|
39
|
+
focused: isFocused,
|
|
40
|
+
selected: isSelected,
|
|
41
|
+
onKeyDown: function onKeyDown(value) {
|
|
42
|
+
return onOptionKeyDown(value);
|
|
43
|
+
},
|
|
44
|
+
isTabbing: isTabbing
|
|
45
|
+
}));
|
|
48
46
|
};
|
|
49
47
|
export var DropdownIndicator = function DropdownIndicator() {
|
|
50
48
|
return null;
|
|
51
49
|
};
|
|
52
50
|
export var Placeholder = function Placeholder() {
|
|
53
51
|
return null;
|
|
54
|
-
};
|
|
52
|
+
};
|
|
53
|
+
var colorCardWrapperStyles = css({
|
|
54
|
+
display: 'flex',
|
|
55
|
+
margin: "var(--ds-space-025, 2px)",
|
|
56
|
+
height: "".concat(COLOR_CARD_SIZE, "px")
|
|
57
|
+
});
|
|
58
|
+
var colorPaletteContainerStyles = css({
|
|
59
|
+
display: 'flex',
|
|
60
|
+
flexWrap: 'wrap',
|
|
61
|
+
padding: "var(--ds-space-050, 4px)"
|
|
62
|
+
});
|
package/dist/esm/utils.js
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
import { gridSize } from '@atlaskit/theme';
|
|
4
4
|
import { COLOR_CARD_SIZE } from './constants';
|
|
5
5
|
import memoizeOne from 'memoize-one';
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { Mode } from './types';
|
|
7
|
+
export var getWidth = function getWidth(cols, mode) {
|
|
8
|
+
var width = cols * (COLOR_CARD_SIZE + gridSize() / 2);
|
|
9
|
+
return mode === Mode.Standard ? width + gridSize() : width;
|
|
8
10
|
};
|
|
9
11
|
export var getOptions = memoizeOne(function (palette, selectedColor) {
|
|
10
12
|
var focusedItemIndex = 0;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PureComponent } from 'react';
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
3
2
|
export interface Props {
|
|
4
3
|
value: string;
|
|
5
4
|
label: string;
|
|
@@ -11,10 +10,5 @@ export interface Props {
|
|
|
11
10
|
isOption?: boolean;
|
|
12
11
|
isTabbing?: boolean;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
onClick: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
17
|
-
onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
|
|
18
|
-
ref: React.RefObject<HTMLButtonElement>;
|
|
19
|
-
render(): JSX.Element;
|
|
20
|
-
}
|
|
13
|
+
declare const ColorCard: (props: Props) => jsx.JSX.Element;
|
|
14
|
+
export default ColorCard;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { Mode, Palette } from '../types';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
export type Props = {
|
|
4
6
|
/** color picker button label */
|
|
5
7
|
label?: string;
|
|
6
8
|
/** list of available colors */
|
|
@@ -17,19 +19,7 @@ export interface Props {
|
|
|
17
19
|
createAnalyticsEvent?: any;
|
|
18
20
|
/** style of the color-picker, either 'Compact' or 'Standard', default value is 'Standard' */
|
|
19
21
|
mode?: Mode;
|
|
20
|
-
}
|
|
21
|
-
export declare
|
|
22
|
-
|
|
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>>;
|
|
22
|
+
};
|
|
23
|
+
export declare const ColorPaletteMenuWithoutAnalytics: ({ createAnalyticsEvent, onChange, palette, selectedColor, checkMarkColor, label, cols, mode, }: Props) => jsx.JSX.Element;
|
|
24
|
+
declare const _default: import("react").ForwardRefExoticComponent<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "label" | "analyticsContext" | "key" | "onChange" | "checkMarkColor" | "cols" | "palette" | "selectedColor" | "mode"> & import("react").RefAttributes<any>>;
|
|
35
25
|
export default _default;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
3
|
+
import { PopupSelectProps, ValueType } from '@atlaskit/select';
|
|
4
|
+
import { Color, Palette } from '../types';
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
4
6
|
export interface Props {
|
|
5
7
|
/** color picker button label */
|
|
6
8
|
label?: string;
|
|
@@ -28,7 +30,7 @@ export declare class ColorPickerWithoutAnalytics extends React.Component<Props>
|
|
|
28
30
|
onChangeSelect: (option: ValueType<Color>) => void;
|
|
29
31
|
onOptionKeyDown: (value: string) => void;
|
|
30
32
|
onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
|
|
31
|
-
render(): JSX.Element;
|
|
33
|
+
render(): jsx.JSX.Element;
|
|
32
34
|
}
|
|
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"
|
|
35
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "label" | "analyticsContext" | "key" | "onChange" | "checkMarkColor" | "cols" | "popperProps" | "palette" | "selectedColor"> & React.RefAttributes<any>>;
|
|
34
36
|
export default _default;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
2
|
export interface Props {
|
|
3
3
|
value: string;
|
|
4
4
|
label?: string;
|
|
5
5
|
onClick?: () => void;
|
|
6
6
|
expanded?: boolean;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
11
|
-
render(): JSX.Element;
|
|
12
|
-
}
|
|
8
|
+
declare const ColorCard: ({ value, label, expanded, onClick }: Props) => jsx.JSX.Element;
|
|
9
|
+
export default ColorCard;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
2
|
import { MenuListComponentProps, OptionProps } from '@atlaskit/select';
|
|
3
3
|
import { Color } from '../types';
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
export declare const MenuList: (props: MenuListComponentProps<Color>) => jsx.JSX.Element;
|
|
6
|
+
export declare const Option: (props: OptionProps<Color>) => jsx.JSX.Element;
|
|
6
7
|
export declare const DropdownIndicator: () => null;
|
|
7
8
|
export declare const Placeholder: () => null;
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Palette } from './types';
|
|
2
|
-
export declare const getWidth: (cols: number) => number;
|
|
1
|
+
import { Mode, Palette } from './types';
|
|
2
|
+
export declare const getWidth: (cols: number, mode?: Mode) => number;
|
|
3
3
|
export declare const getOptions: import("memoize-one").MemoizedFn<(palette: Palette, selectedColor?: string) => {
|
|
4
4
|
options: Palette;
|
|
5
5
|
value: import("./types").Color;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PureComponent } from 'react';
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
3
2
|
export interface Props {
|
|
4
3
|
value: string;
|
|
5
4
|
label: string;
|
|
@@ -11,10 +10,5 @@ export interface Props {
|
|
|
11
10
|
isOption?: boolean;
|
|
12
11
|
isTabbing?: boolean;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
onClick: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
17
|
-
onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
|
|
18
|
-
ref: React.RefObject<HTMLButtonElement>;
|
|
19
|
-
render(): JSX.Element;
|
|
20
|
-
}
|
|
13
|
+
declare const ColorCard: (props: Props) => jsx.JSX.Element;
|
|
14
|
+
export default ColorCard;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { Mode, Palette } from '../types';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
export type Props = {
|
|
4
6
|
/** color picker button label */
|
|
5
7
|
label?: string;
|
|
6
8
|
/** list of available colors */
|
|
@@ -17,19 +19,7 @@ export interface Props {
|
|
|
17
19
|
createAnalyticsEvent?: any;
|
|
18
20
|
/** style of the color-picker, either 'Compact' or 'Standard', default value is 'Standard' */
|
|
19
21
|
mode?: Mode;
|
|
20
|
-
}
|
|
21
|
-
export declare
|
|
22
|
-
|
|
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>>;
|
|
22
|
+
};
|
|
23
|
+
export declare const ColorPaletteMenuWithoutAnalytics: ({ createAnalyticsEvent, onChange, palette, selectedColor, checkMarkColor, label, cols, mode, }: Props) => jsx.JSX.Element;
|
|
24
|
+
declare const _default: import("react").ForwardRefExoticComponent<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "label" | "analyticsContext" | "key" | "onChange" | "checkMarkColor" | "cols" | "palette" | "selectedColor" | "mode"> & import("react").RefAttributes<any>>;
|
|
35
25
|
export default _default;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
3
|
+
import { PopupSelectProps, ValueType } from '@atlaskit/select';
|
|
4
|
+
import { Color, Palette } from '../types';
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
4
6
|
export interface Props {
|
|
5
7
|
/** color picker button label */
|
|
6
8
|
label?: string;
|
|
@@ -28,7 +30,7 @@ export declare class ColorPickerWithoutAnalytics extends React.Component<Props>
|
|
|
28
30
|
onChangeSelect: (option: ValueType<Color>) => void;
|
|
29
31
|
onOptionKeyDown: (value: string) => void;
|
|
30
32
|
onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
|
|
31
|
-
render(): JSX.Element;
|
|
33
|
+
render(): jsx.JSX.Element;
|
|
32
34
|
}
|
|
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"
|
|
35
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "label" | "analyticsContext" | "key" | "onChange" | "checkMarkColor" | "cols" | "popperProps" | "palette" | "selectedColor"> & React.RefAttributes<any>>;
|
|
34
36
|
export default _default;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
2
|
export interface Props {
|
|
3
3
|
value: string;
|
|
4
4
|
label?: string;
|
|
5
5
|
onClick?: () => void;
|
|
6
6
|
expanded?: boolean;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
11
|
-
render(): JSX.Element;
|
|
12
|
-
}
|
|
8
|
+
declare const ColorCard: ({ value, label, expanded, onClick }: Props) => jsx.JSX.Element;
|
|
9
|
+
export default ColorCard;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
2
|
import { MenuListComponentProps, OptionProps } from '@atlaskit/select';
|
|
3
3
|
import { Color } from '../types';
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
export declare const MenuList: (props: MenuListComponentProps<Color>) => jsx.JSX.Element;
|
|
6
|
+
export declare const Option: (props: OptionProps<Color>) => jsx.JSX.Element;
|
|
6
7
|
export declare const DropdownIndicator: () => null;
|
|
7
8
|
export declare const Placeholder: () => null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Palette } from './types';
|
|
2
|
-
export declare const getWidth: (cols: number) => number;
|
|
1
|
+
import { Mode, Palette } from './types';
|
|
2
|
+
export declare const getWidth: (cols: number, mode?: Mode) => number;
|
|
3
3
|
export declare const getOptions: import("memoize-one").MemoizedFn<(palette: Palette, selectedColor?: string) => {
|
|
4
4
|
options: Palette;
|
|
5
5
|
value: import("./types").Color;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/color-picker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Jira Color Picker Component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"@atlaskit/icon": "^22.0.0",
|
|
34
34
|
"@atlaskit/select": "^17.0.0",
|
|
35
35
|
"@atlaskit/theme": "^12.6.0",
|
|
36
|
-
"@atlaskit/tokens": "^1.
|
|
36
|
+
"@atlaskit/tokens": "^1.29.0",
|
|
37
37
|
"@atlaskit/tooltip": "^18.0.0",
|
|
38
38
|
"@babel/runtime": "^7.0.0",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
39
|
+
"@emotion/react": "^11.7.1",
|
|
40
|
+
"memoize-one": "^6.0.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": "^16.8.0"
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.ColorCardOption = exports.ColorCardContentCheckMark = exports.ColorCardContent = exports.ColorCardButton = void 0;
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
-
var _theme = require("@atlaskit/theme");
|
|
12
|
-
var _constants = require("../constants");
|
|
13
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5; // AFP-2532 TODO: Fix automatic suppressions below
|
|
14
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
15
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
var buttonFocusedBorder = "border-color: ".concat("var(--ds-border-focused, ".concat(_theme.colors.B100, ")"), ";");
|
|
18
|
-
var sharedColorContainerStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n position: relative;\n width: ", "px;\n height: ", "px;\n border: 2px solid transparent;\n box-sizing: border-box;\n border-radius: ", "px;\n transition: border-color 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38);\n background-color: transparent;\n border-color: transparent;\n padding: 0;\n cursor: pointer;\n outline: none;\n"])), _constants.COLOR_CARD_SIZE, _constants.COLOR_CARD_SIZE, (0, _theme.borderRadius)() * 2);
|
|
19
|
-
var ColorCardOption = exports.ColorCardOption = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n\n ", "\n\n ", ";\n"])), sharedColorContainerStyles, function (props) {
|
|
20
|
-
if (props.isTabbing === undefined || props.isTabbing) {
|
|
21
|
-
return "&:hover,\n &:focus {\n border-color: ".concat("var(--ds-border-focused, ".concat(_theme.colors.B75, ")"), ";\n }");
|
|
22
|
-
}
|
|
23
|
-
}, function (props) {
|
|
24
|
-
if (props.focused && !props.isTabbing) {
|
|
25
|
-
return "border-color: ".concat("var(--ds-border-focused, ".concat(_theme.colors.B75, ")"));
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
var ColorCardButton = exports.ColorCardButton = _styledComponents.default.button(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n &:hover {\n border-color: transparent;\n }\n &:not(:focus):hover,\n &:focus {\n ", ";\n }\n\n ", ";\n"])), sharedColorContainerStyles, buttonFocusedBorder, function (props) {
|
|
29
|
-
if (props.focused) {
|
|
30
|
-
return buttonFocusedBorder;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
34
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
35
|
-
var ColorCardContent = exports.ColorCardContent = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n top: 1px;\n left: 1px;\n width: 24px;\n height: 24px;\n border-radius: ", "px;\n background: ", ";\n box-shadow: inset 0px 0px 0px 1px\n ", ";\n"])), (0, _theme.borderRadius)(), function (props) {
|
|
36
|
-
return props.color;
|
|
37
|
-
}, "var(--ds-background-inverse-subtle, ".concat(_theme.colors.DN600A, ")"));
|
|
38
|
-
|
|
39
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
40
|
-
var ColorCardContentCheckMark = exports.ColorCardContentCheckMark = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n margin: 1px;\n"])));
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.ColorPaletteMenu = exports.ColorPaletteContainer = exports.ColorCardWrapper = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
var _theme = require("@atlaskit/theme");
|
|
11
|
-
var _utils = require("../utils");
|
|
12
|
-
var _types = require("../types");
|
|
13
|
-
var _constants = require("../constants");
|
|
14
|
-
var _templateObject, _templateObject2, _templateObject3; // AFP-2532 TODO: Fix automatic suppressions below
|
|
15
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
16
|
-
var ColorCardWrapper = exports.ColorCardWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin: ", ";\n height: ", "px;\n"])), "var(--ds-space-025, 2px)", _constants.COLOR_CARD_SIZE);
|
|
17
|
-
var ColorPaletteContainer = exports.ColorPaletteContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-wrap: wrap;\n padding: ", ";\n"])), function (props) {
|
|
18
|
-
return props.mode === _types.Mode.Compact ? "0" : "var(--ds-space-050, 4px)";
|
|
19
|
-
});
|
|
20
|
-
var ColorPaletteMenu = exports.ColorPaletteMenu = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n margin: 0;\n background-color: ", ";\n width: ", "px;\n ", "\n"])), "var(--ds-surface-overlay, ".concat(_theme.colors.N0, ")"), function (props) {
|
|
21
|
-
return (0, _utils.getWidth)(props.cols);
|
|
22
|
-
}, function (props) {
|
|
23
|
-
return props.mode && props.mode === _types.Mode.Standard && "\n box-radius: ".concat("var(--ds-border-radius-100, 3px)", ";\n box-shadow: ", "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(_theme.colors.N40, ", 0 0 8px ").concat(_theme.colors.N40), ")"), ";\n width: ", (0, _utils.getWidth)(props.cols) + (0, _theme.gridSize)(), "px;\n ");
|
|
24
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.ColorCardWrapper = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
var _templateObject;
|
|
11
|
-
var ColorCardWrapper = exports.ColorCardWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n"])));
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components';
|
|
2
|
-
// AFP-2532 TODO: Fix automatic suppressions below
|
|
3
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
4
|
-
import { borderRadius, colors } from '@atlaskit/theme';
|
|
5
|
-
import { COLOR_CARD_SIZE } from '../constants';
|
|
6
|
-
const buttonFocusedBorder = `border-color: ${`var(--ds-border-focused, ${colors.B100})`};`;
|
|
7
|
-
const sharedColorContainerStyles = css`
|
|
8
|
-
display: inline-block;
|
|
9
|
-
position: relative;
|
|
10
|
-
width: ${COLOR_CARD_SIZE}px;
|
|
11
|
-
height: ${COLOR_CARD_SIZE}px;
|
|
12
|
-
border: 2px solid transparent;
|
|
13
|
-
box-sizing: border-box;
|
|
14
|
-
border-radius: ${borderRadius() * 2}px;
|
|
15
|
-
transition: border-color 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38);
|
|
16
|
-
background-color: transparent;
|
|
17
|
-
border-color: transparent;
|
|
18
|
-
padding: 0;
|
|
19
|
-
cursor: pointer;
|
|
20
|
-
outline: none;
|
|
21
|
-
`;
|
|
22
|
-
export const ColorCardOption = styled.div`
|
|
23
|
-
${sharedColorContainerStyles};
|
|
24
|
-
|
|
25
|
-
${props => {
|
|
26
|
-
if (props.isTabbing === undefined || props.isTabbing) {
|
|
27
|
-
return `&:hover,
|
|
28
|
-
&:focus {
|
|
29
|
-
border-color: ${`var(--ds-border-focused, ${colors.B75})`};
|
|
30
|
-
}`;
|
|
31
|
-
}
|
|
32
|
-
}}
|
|
33
|
-
|
|
34
|
-
${props => {
|
|
35
|
-
if (props.focused && !props.isTabbing) {
|
|
36
|
-
return `border-color: ${`var(--ds-border-focused, ${colors.B75})`}`;
|
|
37
|
-
}
|
|
38
|
-
}};
|
|
39
|
-
`;
|
|
40
|
-
export const ColorCardButton = styled.button`
|
|
41
|
-
${sharedColorContainerStyles};
|
|
42
|
-
&:hover {
|
|
43
|
-
border-color: transparent;
|
|
44
|
-
}
|
|
45
|
-
&:not(:focus):hover,
|
|
46
|
-
&:focus {
|
|
47
|
-
${buttonFocusedBorder};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
${props => {
|
|
51
|
-
if (props.focused) {
|
|
52
|
-
return buttonFocusedBorder;
|
|
53
|
-
}
|
|
54
|
-
}};
|
|
55
|
-
`;
|
|
56
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
57
|
-
export const ColorCardContent = styled.div`
|
|
58
|
-
position: absolute;
|
|
59
|
-
top: 1px;
|
|
60
|
-
left: 1px;
|
|
61
|
-
width: 24px;
|
|
62
|
-
height: 24px;
|
|
63
|
-
border-radius: ${borderRadius()}px;
|
|
64
|
-
background: ${props => props.color};
|
|
65
|
-
box-shadow: inset 0px 0px 0px 1px
|
|
66
|
-
${`var(--ds-background-inverse-subtle, ${colors.DN600A})`};
|
|
67
|
-
`;
|
|
68
|
-
|
|
69
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
70
|
-
export const ColorCardContentCheckMark = styled.div`
|
|
71
|
-
margin: 1px;
|
|
72
|
-
`;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
// AFP-2532 TODO: Fix automatic suppressions below
|
|
3
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
4
|
-
import { gridSize, colors } from '@atlaskit/theme';
|
|
5
|
-
import { getWidth } from '../utils';
|
|
6
|
-
import { Mode } from '../types';
|
|
7
|
-
import { COLOR_CARD_SIZE } from '../constants';
|
|
8
|
-
export const ColorCardWrapper = styled.div`
|
|
9
|
-
display: flex;
|
|
10
|
-
margin: ${"var(--ds-space-025, 2px)"};
|
|
11
|
-
height: ${COLOR_CARD_SIZE}px;
|
|
12
|
-
`;
|
|
13
|
-
export const ColorPaletteContainer = styled.div`
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-wrap: wrap;
|
|
16
|
-
padding: ${props => props.mode === Mode.Compact ? `0` : `${"var(--ds-space-050, 4px)"}`};
|
|
17
|
-
`;
|
|
18
|
-
export const ColorPaletteMenu = styled.div`
|
|
19
|
-
position: relative;
|
|
20
|
-
margin: 0;
|
|
21
|
-
background-color: ${`var(--ds-surface-overlay, ${colors.N0})`};
|
|
22
|
-
width: ${props => getWidth(props.cols)}px;
|
|
23
|
-
${props => props.mode && props.mode === Mode.Standard && `
|
|
24
|
-
box-radius: ${"var(--ds-border-radius-100, 3px)"};
|
|
25
|
-
box-shadow: ${`var(--ds-shadow-overlay, ${`0 0 0 1px ${colors.N40}, 0 0 8px ${colors.N40}`})`};
|
|
26
|
-
width: ${getWidth(props.cols) + gridSize()}px;
|
|
27
|
-
`}
|
|
28
|
-
`;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
// AFP-2532 TODO: Fix automatic suppressions below
|
|
5
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
6
|
-
import { borderRadius, colors } from '@atlaskit/theme';
|
|
7
|
-
import { COLOR_CARD_SIZE } from '../constants';
|
|
8
|
-
var buttonFocusedBorder = "border-color: ".concat("var(--ds-border-focused, ".concat(colors.B100, ")"), ";");
|
|
9
|
-
var sharedColorContainerStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n position: relative;\n width: ", "px;\n height: ", "px;\n border: 2px solid transparent;\n box-sizing: border-box;\n border-radius: ", "px;\n transition: border-color 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38);\n background-color: transparent;\n border-color: transparent;\n padding: 0;\n cursor: pointer;\n outline: none;\n"])), COLOR_CARD_SIZE, COLOR_CARD_SIZE, borderRadius() * 2);
|
|
10
|
-
export var ColorCardOption = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n\n ", "\n\n ", ";\n"])), sharedColorContainerStyles, function (props) {
|
|
11
|
-
if (props.isTabbing === undefined || props.isTabbing) {
|
|
12
|
-
return "&:hover,\n &:focus {\n border-color: ".concat("var(--ds-border-focused, ".concat(colors.B75, ")"), ";\n }");
|
|
13
|
-
}
|
|
14
|
-
}, function (props) {
|
|
15
|
-
if (props.focused && !props.isTabbing) {
|
|
16
|
-
return "border-color: ".concat("var(--ds-border-focused, ".concat(colors.B75, ")"));
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
export var ColorCardButton = styled.button(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", ";\n &:hover {\n border-color: transparent;\n }\n &:not(:focus):hover,\n &:focus {\n ", ";\n }\n\n ", ";\n"])), sharedColorContainerStyles, buttonFocusedBorder, function (props) {
|
|
20
|
-
if (props.focused) {
|
|
21
|
-
return buttonFocusedBorder;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
25
|
-
export var ColorCardContent = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 1px;\n left: 1px;\n width: 24px;\n height: 24px;\n border-radius: ", "px;\n background: ", ";\n box-shadow: inset 0px 0px 0px 1px\n ", ";\n"])), borderRadius(), function (props) {
|
|
26
|
-
return props.color;
|
|
27
|
-
}, "var(--ds-background-inverse-subtle, ".concat(colors.DN600A, ")"));
|
|
28
|
-
|
|
29
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
30
|
-
export var ColorCardContentCheckMark = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: 1px;\n"])));
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
// AFP-2532 TODO: Fix automatic suppressions below
|
|
5
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
6
|
-
import { gridSize, colors } from '@atlaskit/theme';
|
|
7
|
-
import { getWidth } from '../utils';
|
|
8
|
-
import { Mode } from '../types';
|
|
9
|
-
import { COLOR_CARD_SIZE } from '../constants';
|
|
10
|
-
export var ColorCardWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n margin: ", ";\n height: ", "px;\n"])), "var(--ds-space-025, 2px)", COLOR_CARD_SIZE);
|
|
11
|
-
export var ColorPaletteContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n padding: ", ";\n"])), function (props) {
|
|
12
|
-
return props.mode === Mode.Compact ? "0" : "var(--ds-space-050, 4px)";
|
|
13
|
-
});
|
|
14
|
-
export var ColorPaletteMenu = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n margin: 0;\n background-color: ", ";\n width: ", "px;\n ", "\n"])), "var(--ds-surface-overlay, ".concat(colors.N0, ")"), function (props) {
|
|
15
|
-
return getWidth(props.cols);
|
|
16
|
-
}, function (props) {
|
|
17
|
-
return props.mode && props.mode === Mode.Standard && "\n box-radius: ".concat("var(--ds-border-radius-100, 3px)", ";\n box-shadow: ", "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(colors.N40, ", 0 0 8px ").concat(colors.N40), ")"), ";\n width: ", getWidth(props.cols) + gridSize(), "px;\n ");
|
|
18
|
-
});
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
export var ColorCardWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n"])));
|