@synerise/ds-color-picker 0.1.2 → 0.1.3

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
@@ -3,6 +3,19 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.1.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-color-picker@0.1.2...@synerise/ds-color-picker@0.1.3) (2023-01-02)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **color-picker:** fix adding dot to tags and typing,copy text ([b33b588](https://github.com/Synerise/synerise-design/commit/b33b5882d5d357b745d2b9421c4d30d09c651871))
12
+ * **color-picker:** fix height of dropdown ([0f1d964](https://github.com/Synerise/synerise-design/commit/0f1d9647cfd29936c98218f4fd7de9a175dcb3e2))
13
+ * **color-picker:** remove select and add input to pick color ([dd9cd1a](https://github.com/Synerise/synerise-design/commit/dd9cd1aba392af05637ee89b51f09ffc59e9c5b7))
14
+
15
+
16
+
17
+
18
+
6
19
  ## [0.1.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-color-picker@0.1.1...@synerise/ds-color-picker@0.1.2) (2022-12-08)
7
20
 
8
21
 
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { ColorPickerProps } from './ColorPicker.types';
3
- export declare function ColorPicker({ value, onChange, colors, onSaveColors, infix, placeholder, selectProps, maxSavedColors, }: ColorPickerProps): JSX.Element;
3
+ export declare function ColorPicker({ value, onChange, colors, onSaveColors, infix, placeholder, inputProps, maxSavedColors, tooltipText, isShownSavedColors, size, errorText, description, }: ColorPickerProps): JSX.Element;
4
4
  export default ColorPicker;
@@ -2,12 +2,14 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
2
2
 
3
3
  import * as React from 'react';
4
4
  import { HexColorPicker as ReactColorful } from 'react-colorful';
5
- import Select from '@synerise/ds-select';
6
- import Button from '@synerise/ds-button';
7
5
  import Divider from '@synerise/ds-divider';
8
- import { Input } from '@synerise/ds-input';
9
- import Tags, { TagShape } from '@synerise/ds-tags';
6
+ import Tags, { TagShape, Tag } from '@synerise/ds-tags';
10
7
  import Icon, { FormulaPlusM } from '@synerise/ds-icon';
8
+ import { CopyClipboardM } from '@synerise/ds-icon/src';
9
+ import * as copy from 'copy-to-clipboard';
10
+ import Tooltip from '@synerise/ds-tooltip';
11
+ import Dropdown from '@synerise/ds-dropdown';
12
+ import { useOnClickOutside } from '@synerise/ds-utils';
11
13
  import ColorPickerStyles from './ColorPicker.styles';
12
14
  export function ColorPicker(_ref) {
13
15
  var _ref$value = _ref.value,
@@ -21,22 +23,55 @@ export function ColorPicker(_ref) {
21
23
  return /*#__PURE__*/React.createElement(React.Fragment, null);
22
24
  } : _ref$infix,
23
25
  placeholder = _ref.placeholder,
24
- selectProps = _ref.selectProps,
26
+ inputProps = _ref.inputProps,
25
27
  _ref$maxSavedColors = _ref.maxSavedColors,
26
- maxSavedColors = _ref$maxSavedColors === void 0 ? 10 : _ref$maxSavedColors;
28
+ maxSavedColors = _ref$maxSavedColors === void 0 ? 9 : _ref$maxSavedColors,
29
+ tooltipText = _ref.tooltipText,
30
+ isShownSavedColors = _ref.isShownSavedColors,
31
+ _ref$size = _ref.size,
32
+ size = _ref$size === void 0 ? 'M' : _ref$size,
33
+ errorText = _ref.errorText,
34
+ description = _ref.description;
27
35
 
28
36
  var _React$useState = React.useState(value),
29
37
  color = _React$useState[0],
30
38
  setColor = _React$useState[1];
31
39
 
40
+ var _React$useState2 = React.useState(-1),
41
+ pressed = _React$useState2[0],
42
+ setPressed = _React$useState2[1];
43
+
32
44
  var onChangeColor = function onChangeColor(colorValue) {
33
45
  setColor(colorValue);
34
46
  onChange && onChange(colorValue);
35
47
  };
36
48
 
37
- var _React$useState2 = React.useState(colors),
38
- savedColors = _React$useState2[0],
39
- setSavedColors = _React$useState2[1];
49
+ var heightOfDropdown = React.useCallback(function () {
50
+ if (errorText || description) {
51
+ if (errorText && description) {
52
+ return -40;
53
+ }
54
+
55
+ return -20;
56
+ }
57
+
58
+ return 4;
59
+ }, [errorText, description]);
60
+
61
+ var _React$useState3 = React.useState(false),
62
+ dropdownVisible = _React$useState3[0],
63
+ setDropdownVisible = _React$useState3[1];
64
+
65
+ var ref = React.useRef(null);
66
+ useOnClickOutside(ref, function () {
67
+ setDropdownVisible(false);
68
+ });
69
+
70
+ var _React$useState4 = React.useState(colors),
71
+ savedColors = _React$useState4[0],
72
+ setSavedColors = _React$useState4[1];
73
+
74
+ var hash = '#';
40
75
 
41
76
  var saveColor = function saveColor() {
42
77
  setSavedColors(function (ar) {
@@ -46,48 +81,92 @@ export function ColorPicker(_ref) {
46
81
  });
47
82
  };
48
83
 
49
- var swatchSection = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
84
+ var swatchSection = /*#__PURE__*/React.createElement(ColorPickerStyles.SwatchSectionWrapper, null, /*#__PURE__*/React.createElement(Tooltip, {
85
+ title: "Save color swatch"
86
+ }, /*#__PURE__*/React.createElement(ColorPickerStyles.AddColorButton, {
50
87
  mode: "single-icon",
88
+ type: "ghost",
51
89
  onClick: saveColor
52
90
  }, /*#__PURE__*/React.createElement(Icon, {
91
+ size: 16,
53
92
  component: /*#__PURE__*/React.createElement(FormulaPlusM, null)
54
- })), infix({
93
+ }))), infix({
55
94
  color: color,
56
95
  setColor: onChangeColor
57
96
  }), savedColors.length > 0 && /*#__PURE__*/React.createElement(Tags, {
58
- tagShape: TagShape.SINGLE_CHARACTER_SQUARE,
97
+ tagShape: TagShape.SINGLE_CHARACTER_SQUARE // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
98
+ // @ts-ignore
99
+ ,
59
100
  selected: savedColors.map(function (colorEntry, i) {
60
101
  return {
61
102
  id: i,
62
103
  key: "color-" + i,
63
- name: '',
104
+ name: /*#__PURE__*/React.createElement(Tooltip, {
105
+ title: colorEntry
106
+ }, /*#__PURE__*/React.createElement(ColorPickerStyles.TagDot, {
107
+ pressed: i === pressed
108
+ })),
64
109
  color: colorEntry,
65
110
  onClick: function onClick() {
66
111
  onChangeColor(colorEntry);
112
+ setPressed(i);
67
113
  }
68
114
  };
69
115
  }),
70
116
  disabled: false
71
117
  }));
72
- var dropdown = /*#__PURE__*/React.createElement(ColorPickerStyles.Container, null, /*#__PURE__*/React.createElement(ReactColorful, {
118
+ var dropdown = /*#__PURE__*/React.createElement(ColorPickerStyles.Container, {
119
+ ref: ref,
120
+ size: size
121
+ }, /*#__PURE__*/React.createElement(ReactColorful, {
73
122
  color: color,
74
123
  onChange: onChangeColor
75
- }), /*#__PURE__*/React.createElement(ColorPickerStyles.Subcontainer, null, /*#__PURE__*/React.createElement(Input, {
76
- value: color,
124
+ }), /*#__PURE__*/React.createElement(ColorPickerStyles.PrefixTag, {
125
+ height: isShownSavedColors
126
+ }, /*#__PURE__*/React.createElement(Tag, {
127
+ shape: TagShape.SINGLE_CHARACTER_SQUARE,
128
+ color: color,
129
+ disabled: false
130
+ })), /*#__PURE__*/React.createElement(ColorPickerStyles.SubContainer, {
131
+ savedColors: isShownSavedColors
132
+ }, /*#__PURE__*/React.createElement(ColorPickerStyles.ColorPickerInput, {
133
+ value: color.substr(1),
134
+ prefixel: /*#__PURE__*/React.createElement(ColorPickerStyles.PreffixWrapper, null, "#"),
135
+ onChange: function onChange(ev) {
136
+ return setColor(hash + ev.target.value);
137
+ },
138
+ placeholder: placeholder,
139
+ icon1: /*#__PURE__*/React.createElement(ColorPickerStyles.CopyIcon, {
140
+ onClick: function onClick() {
141
+ copy(color);
142
+ },
143
+ component: /*#__PURE__*/React.createElement(CopyClipboardM, null)
144
+ }),
145
+ icon1Tooltip: /*#__PURE__*/React.createElement("span", null, tooltipText)
146
+ }), isShownSavedColors && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Divider, null), swatchSection)));
147
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Dropdown, {
148
+ align: {
149
+ offset: [0, heightOfDropdown()]
150
+ },
151
+ visible: dropdownVisible,
152
+ overlay: dropdown,
153
+ placement: "bottomLeft"
154
+ }, /*#__PURE__*/React.createElement(ColorPickerStyles.ColorPickerSelect, _extends({
155
+ prefix: /*#__PURE__*/React.createElement(ColorPickerStyles.ColorTag, {
156
+ shape: TagShape.SINGLE_CHARACTER_ROUND,
157
+ color: color,
158
+ disabled: false
159
+ }),
77
160
  onChange: function onChange(ev) {
78
161
  return setColor(ev.target.value);
79
162
  },
80
- placeholder: placeholder
81
- }), /*#__PURE__*/React.createElement(Divider, null), swatchSection));
82
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Select, _extends({
83
- showSearch: true,
84
- showArrow: false,
163
+ placeholder: placeholder,
164
+ onClick: function onClick() {
165
+ return setDropdownVisible(!dropdownVisible);
166
+ },
85
167
  value: color,
86
- dropdownMatchSelectWidth: false,
87
- filterOption: false,
88
- dropdownRender: function dropdownRender() {
89
- return dropdown;
90
- }
91
- }, selectProps)));
168
+ description: description,
169
+ errorText: errorText
170
+ }, inputProps))));
92
171
  }
93
172
  export default ColorPicker;
@@ -1,5 +1,95 @@
1
+ /// <reference types="react" />
2
+ import Button from '@synerise/ds-button';
3
+ export declare const TagDot: import("styled-components").StyledComponent<"div", any, {
4
+ pressed?: boolean | undefined;
5
+ }, never>;
6
+ export declare const ColorTag: import("styled-components").StyledComponent<import("react").FC<import("@synerise/ds-tags/dist/Tag/Tag.types").Props>, any, {}, never>;
7
+ export declare const AddColorButton: import("styled-components").StyledComponent<typeof Button, any, {}, never>;
8
+ export declare const CopyIcon: import("styled-components").StyledComponent<import("react").FC<import("@synerise/ds-icon").IconProps>, any, {}, never>;
9
+ export declare const ColorPickerInput: import("styled-components").StyledComponent<(import("react").ComponentClass<(object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps & {
10
+ mask: string;
11
+ formatCharacters?: object | undefined;
12
+ placeholderChar?: string | undefined;
13
+ value?: string | undefined;
14
+ }) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").TextAreaProps), any> & {
15
+ displayName: string;
16
+ }) | (import("react").FunctionComponent<(object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").TextAreaProps) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps & {
17
+ mask: string;
18
+ formatCharacters?: object | undefined;
19
+ placeholderChar?: string | undefined;
20
+ value?: string | undefined;
21
+ })> & {
22
+ displayName: string;
23
+ }), any, {}, never>;
24
+ export declare const ColorPickerSelect: import("styled-components").StyledComponent<(import("react").ComponentClass<(object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps & {
25
+ mask: string;
26
+ formatCharacters?: object | undefined;
27
+ placeholderChar?: string | undefined;
28
+ value?: string | undefined;
29
+ }) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").TextAreaProps), any> & {
30
+ displayName: string;
31
+ }) | (import("react").FunctionComponent<(object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").TextAreaProps) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps & {
32
+ mask: string;
33
+ formatCharacters?: object | undefined;
34
+ placeholderChar?: string | undefined;
35
+ value?: string | undefined;
36
+ })> & {
37
+ displayName: string;
38
+ }), any, {}, never>;
39
+ export declare const PrefixTag: import("styled-components").StyledComponent<"div", any, {
40
+ height?: boolean | undefined;
41
+ }, never>;
42
+ export declare const SwatchSectionWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
43
+ export declare const PreffixWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
44
+ export declare const ValueWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
1
45
  declare const _default: {
2
- Container: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- Subcontainer: import("styled-components").StyledComponent<"div", any, {}, never>;
46
+ Container: import("styled-components").StyledComponent<"div", any, {
47
+ size?: "S" | "M" | "L" | undefined;
48
+ }, never>;
49
+ SubContainer: import("styled-components").StyledComponent<"div", any, {
50
+ savedColors?: boolean | undefined;
51
+ }, never>;
52
+ ColorTag: import("styled-components").StyledComponent<import("react").FC<import("@synerise/ds-tags/dist/Tag/Tag.types").Props>, any, {}, never>;
53
+ PrefixTag: import("styled-components").StyledComponent<"div", any, {
54
+ height?: boolean | undefined;
55
+ }, never>;
56
+ AddColorButton: import("styled-components").StyledComponent<typeof Button, any, {}, never>;
57
+ SwatchSectionWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
58
+ PreffixWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
59
+ ValueWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
60
+ CopyIcon: import("styled-components").StyledComponent<import("react").FC<import("@synerise/ds-icon").IconProps>, any, {}, never>;
61
+ ColorPickerInput: import("styled-components").StyledComponent<(import("react").ComponentClass<(object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps & {
62
+ mask: string;
63
+ formatCharacters?: object | undefined;
64
+ placeholderChar?: string | undefined;
65
+ value?: string | undefined;
66
+ }) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").TextAreaProps), any> & {
67
+ displayName: string;
68
+ }) | (import("react").FunctionComponent<(object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").TextAreaProps) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps & {
69
+ mask: string;
70
+ formatCharacters?: object | undefined;
71
+ placeholderChar?: string | undefined;
72
+ value?: string | undefined;
73
+ })> & {
74
+ displayName: string;
75
+ }), any, {}, never>;
76
+ TagDot: import("styled-components").StyledComponent<"div", any, {
77
+ pressed?: boolean | undefined;
78
+ }, never>;
79
+ ColorPickerSelect: import("styled-components").StyledComponent<(import("react").ComponentClass<(object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps & {
80
+ mask: string;
81
+ formatCharacters?: object | undefined;
82
+ placeholderChar?: string | undefined;
83
+ value?: string | undefined;
84
+ }) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").TextAreaProps), any> & {
85
+ displayName: string;
86
+ }) | (import("react").FunctionComponent<(object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").TextAreaProps) | (object & import("@synerise/ds-input").InputProps & import("antd/lib/input").InputProps & {
87
+ mask: string;
88
+ formatCharacters?: object | undefined;
89
+ placeholderChar?: string | undefined;
90
+ value?: string | undefined;
91
+ })> & {
92
+ displayName: string;
93
+ }), any, {}, never>;
4
94
  };
5
95
  export default _default;
@@ -1,14 +1,95 @@
1
- import styled from 'styled-components';
2
- import { TagsStyles } from '@synerise/ds-tags';
1
+ import styled from 'styled-components'; // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
2
+ // @ts-ignore
3
+
4
+ import { TagsStyles, Tag } from '@synerise/ds-tags';
5
+ import Button from '@synerise/ds-button';
6
+ import Icon from '@synerise/ds-icon';
7
+ import { Input } from '@synerise/ds-input';
8
+ import { ColorPickerSize } from './ColorPicker.types';
9
+ export var TagDot = styled.div.withConfig({
10
+ displayName: "ColorPickerstyles__TagDot",
11
+ componentId: "sc-1iu8b6j-0"
12
+ })(["display:", ";width:4px;height:4px;background-color:", ";border-radius:50%;"], function (props) {
13
+ return props.pressed ? 'flex' : 'none';
14
+ }, function (props) {
15
+ return props.theme.palette.white;
16
+ });
17
+ var SIZE_DEFAULT = 167;
3
18
  var Container = styled.div.withConfig({
4
19
  displayName: "ColorPickerstyles__Container",
5
- componentId: "sc-1iu8b6j-0"
6
- })(["@media (min-width:200px){min-width:200px;}.react-colorful__last-control{margin:16px 46px 8px 16px;border-radius:4px;height:8px;}.ant-divider-horizontal{margin:16px 0px;}", "{margin-bottom:-8px;}"], TagsStyles.Container);
7
- var Subcontainer = styled.div.withConfig({
8
- displayName: "ColorPickerstyles__Subcontainer",
9
20
  componentId: "sc-1iu8b6j-1"
10
- })(["padding:16px;padding-top:8px;"]);
21
+ })(["@media (min-width:200px){min-width:200px;margin:-8px;background-color:", ";}.react-colorful__last-control{margin:24px 56px 8px 17px;border-radius:4px;height:8px;}.react-colorful__saturation{border-bottom:0px;border-radius:4px 4px 0 0;height:96px;.react-colorful__interactive{height:96px;}}&&& .ds-tag{width:16px;height:16px;margin:0px 4px 8px;border:1px solid ", ";&:hover{", "{display:flex;}}}.react-colorful__pointer{width:16px;height:16px;}.react-colorful{width:268px;max-width:268px;height:", "px;}.react-colorful__hue-pointer{border:1px solid ", ";box-shadow:none !important;.react-colorful__pointer-fill{background-color:", " !important;}}.ant-divider-horizontal{margin:16px 0px;}", "{margin-bottom:-8px;}"], function (props) {
22
+ return props.theme.palette.white;
23
+ }, function (props) {
24
+ return props.theme.palette['grey-300'];
25
+ }, TagDot, function (props) {
26
+ return ColorPickerSize[props.size] || SIZE_DEFAULT;
27
+ }, function (props) {
28
+ return props.theme.palette['grey-300'];
29
+ }, function (props) {
30
+ return props.theme.palette.white;
31
+ }, TagsStyles.Container);
32
+ var SubContainer = styled.div.withConfig({
33
+ displayName: "ColorPickerstyles__SubContainer",
34
+ componentId: "sc-1iu8b6j-2"
35
+ })(["padding:", ";"], function (props) {
36
+ return props.savedColors ? '8px 16px 16px' : '8px 16px 0;';
37
+ });
38
+ export var ColorTag = styled(Tag).withConfig({
39
+ displayName: "ColorPickerstyles__ColorTag",
40
+ componentId: "sc-1iu8b6j-3"
41
+ })(["width:16px;height:16px;border:1px solid ", ";"], function (props) {
42
+ return props.theme.palette['grey-300'];
43
+ });
44
+ export var AddColorButton = styled(Button).withConfig({
45
+ displayName: "ColorPickerstyles__AddColorButton",
46
+ componentId: "sc-1iu8b6j-4"
47
+ })(["&&&.ant-btn{width:16px;height:16px;margin-right:2px;}"]);
48
+ export var CopyIcon = styled(Icon).withConfig({
49
+ displayName: "ColorPickerstyles__CopyIcon",
50
+ componentId: "sc-1iu8b6j-5"
51
+ })(["display:none;"]);
52
+ export var ColorPickerInput = styled(Input).withConfig({
53
+ displayName: "ColorPickerstyles__ColorPickerInput",
54
+ componentId: "sc-1iu8b6j-6"
55
+ })(["&:hover{", "{display:flex;}}"], CopyIcon);
56
+ export var ColorPickerSelect = styled(Input).withConfig({
57
+ displayName: "ColorPickerstyles__ColorPickerSelect",
58
+ componentId: "sc-1iu8b6j-7"
59
+ })([".ant-input-affix-wrapper{padding:4px 4px;}.ant-input-prefix{margin-right:8px;}&&& .ant-input{padding-right:4px;box-shadow:none;}width:100px;max-width:100px;"]);
60
+ export var PrefixTag = styled.div.withConfig({
61
+ displayName: "ColorPickerstyles__PrefixTag",
62
+ componentId: "sc-1iu8b6j-8"
63
+ })(["&&& .ds-tag{width:24px;height:24px;border:1px solid ", ";cursor:auto;&:hover:before{cursor:auto;filter:brightness(100%);}}position:absolute;right:", ";bottom:", ";z-index:2;cursor:auto;"], function (props) {
64
+ return props.theme.palette['grey-300'];
65
+ }, function (props) {
66
+ return props.height ? '12px' : '12px';
67
+ }, function (props) {
68
+ return props.height ? '97px' : '48px';
69
+ });
70
+ export var SwatchSectionWrapper = styled.div.withConfig({
71
+ displayName: "ColorPickerstyles__SwatchSectionWrapper",
72
+ componentId: "sc-1iu8b6j-9"
73
+ })(["display:flex;alignitems:center;"]);
74
+ export var PreffixWrapper = styled.div.withConfig({
75
+ displayName: "ColorPickerstyles__PreffixWrapper",
76
+ componentId: "sc-1iu8b6j-10"
77
+ })(["padding:6px 12px;"]);
78
+ export var ValueWrapper = styled.div.withConfig({
79
+ displayName: "ColorPickerstyles__ValueWrapper",
80
+ componentId: "sc-1iu8b6j-11"
81
+ })(["display:flex;font-size:12px;"]);
11
82
  export default {
12
83
  Container: Container,
13
- Subcontainer: Subcontainer
84
+ SubContainer: SubContainer,
85
+ ColorTag: ColorTag,
86
+ PrefixTag: PrefixTag,
87
+ AddColorButton: AddColorButton,
88
+ SwatchSectionWrapper: SwatchSectionWrapper,
89
+ PreffixWrapper: PreffixWrapper,
90
+ ValueWrapper: ValueWrapper,
91
+ CopyIcon: CopyIcon,
92
+ ColorPickerInput: ColorPickerInput,
93
+ TagDot: TagDot,
94
+ ColorPickerSelect: ColorPickerSelect
14
95
  };
@@ -1,9 +1,14 @@
1
1
  /// <reference types="react" />
2
- import type { SelectProps } from '@synerise/ds-select';
2
+ import type { InputProps } from '@synerise/ds-input';
3
3
  export declare type ColorHookType = {
4
4
  color: string;
5
5
  setColor: (color: string) => void;
6
6
  };
7
+ export declare enum ColorPickerSize {
8
+ 'S' = 135,
9
+ 'M' = 167,
10
+ 'L' = 199
11
+ }
7
12
  export interface ColorPickerProps extends Partial<Pick<HTMLInputElement, 'placeholder'>> {
8
13
  value?: string;
9
14
  onChange?: (color: string) => void;
@@ -15,5 +20,10 @@ export interface ColorPickerProps extends Partial<Pick<HTMLInputElement, 'placeh
15
20
  */
16
21
  infix?: (colorHooks?: Partial<ColorHookType>) => JSX.Element;
17
22
  maxSavedColors?: number;
18
- selectProps?: Omit<SelectProps, 'value' | 'onChange' | 'defaultValue'>;
23
+ inputProps?: Omit<InputProps, 'value' | 'onChange' | 'defaultValue'>;
24
+ tooltipText?: string;
25
+ isShownSavedColors?: boolean;
26
+ size?: 'S' | 'M' | 'L';
27
+ errorText?: string;
28
+ description?: string;
19
29
  }
@@ -1 +1,7 @@
1
- export {};
1
+ export var ColorPickerSize;
2
+
3
+ (function (ColorPickerSize) {
4
+ ColorPickerSize[ColorPickerSize["S"] = 135] = "S";
5
+ ColorPickerSize[ColorPickerSize["M"] = 167] = "M";
6
+ ColorPickerSize[ColorPickerSize["L"] = 199] = "L";
7
+ })(ColorPickerSize || (ColorPickerSize = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-color-picker",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Color-Picker Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -35,9 +35,9 @@
35
35
  "@synerise/ds-button": "^0.17.10",
36
36
  "@synerise/ds-divider": "^0.5.26",
37
37
  "@synerise/ds-icon": "^0.52.0",
38
- "@synerise/ds-input": "^0.18.27",
39
- "@synerise/ds-select": "^0.14.29",
40
- "@synerise/ds-tags": "^0.7.1",
38
+ "@synerise/ds-input": "^0.18.28",
39
+ "@synerise/ds-select": "^0.14.30",
40
+ "@synerise/ds-tags": "^0.7.2",
41
41
  "rc-select": "~11.4.0",
42
42
  "react-colorful": "^5.2.0"
43
43
  },
@@ -45,5 +45,5 @@
45
45
  "@synerise/ds-core": "*",
46
46
  "react": ">=16.9.0 < 17.0.0"
47
47
  },
48
- "gitHead": "6b7a49d1e4ab90ba861c6037226988f9629b744e"
48
+ "gitHead": "dc78070c73476c9959230e11a5ae020d413e5c16"
49
49
  }