@synerise/ds-color-picker 1.3.48 → 1.3.50
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 +8 -0
- package/dist/ColorPicker.js +17 -19
- package/dist/ColorPicker.styles.d.ts +56 -52
- package/dist/ColorPicker.styles.js +39 -27
- package/package.json +5 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [1.3.50](https://github.com/Synerise/synerise-design/compare/@synerise/ds-color-picker@1.3.49...@synerise/ds-color-picker@1.3.50) (2026-07-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-color-picker
|
|
9
|
+
|
|
10
|
+
## [1.3.49](https://github.com/Synerise/synerise-design/compare/@synerise/ds-color-picker@1.3.48...@synerise/ds-color-picker@1.3.49) (2026-07-09)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @synerise/ds-color-picker
|
|
13
|
+
|
|
6
14
|
## [1.3.48](https://github.com/Synerise/synerise-design/compare/@synerise/ds-color-picker@1.3.47...@synerise/ds-color-picker@1.3.48) (2026-07-09)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-color-picker
|
package/dist/ColorPicker.js
CHANGED
|
@@ -4,10 +4,10 @@ import { HexColorPicker } from "react-colorful";
|
|
|
4
4
|
import Divider from "@synerise/ds-divider";
|
|
5
5
|
import Dropdown from "@synerise/ds-dropdown";
|
|
6
6
|
import Icon, { FormulaPlusM } from "@synerise/ds-icon";
|
|
7
|
-
import
|
|
7
|
+
import { Tag, TagShape } from "@synerise/ds-tags";
|
|
8
8
|
import Tooltip from "@synerise/ds-tooltip";
|
|
9
9
|
import { useOnClickOutside, getPopupContainer } from "@synerise/ds-utils";
|
|
10
|
-
import { SwatchSectionWrapper,
|
|
10
|
+
import { SwatchSectionWrapper, SwatchCreatorButton, SwatchPlaceholder, Swatch, SwatchDot, Container, PrefixTag, SubContainer, ColorPickerInput, StyledCopyIcon, PreffixWrapper, ColorPickerSelect, ColorTag, ColorPickerModalStyle } from "./ColorPicker.styles.js";
|
|
11
11
|
import { isValidTextColor, standardizeColor, isValidHexColor, convert3DigitHexTo6Digit, filterAlphanumeric } from "./utils.js";
|
|
12
12
|
const DEFAULT_MAX_WIDTH_PICKER = 228;
|
|
13
13
|
const DEFAULT_COLOR = "#ffffff";
|
|
@@ -110,27 +110,25 @@ const ColorPicker = ({
|
|
|
110
110
|
onChangeTextColor(event.target.value);
|
|
111
111
|
}, [onChangeTextColor]);
|
|
112
112
|
const swatchSection = /* @__PURE__ */ jsxs(SwatchSectionWrapper, { children: [
|
|
113
|
-
/* @__PURE__ */ jsx(Tooltip, { title: "Save color swatch", children: /* @__PURE__ */ jsx(
|
|
113
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "Save color swatch", children: /* @__PURE__ */ jsx(SwatchCreatorButton, { type: "button", "aria-label": "Save color swatch", onClick: saveColor, children: /* @__PURE__ */ jsx(Icon, { size: 16, component: /* @__PURE__ */ jsx(FormulaPlusM, {}) }) }) }),
|
|
114
114
|
infix({
|
|
115
115
|
color: colorTextInput,
|
|
116
116
|
setColor: onChangeTextColor
|
|
117
117
|
}),
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
key: `color-${i}`,
|
|
125
|
-
name: /* @__PURE__ */ jsx(Tooltip, { title: colorEntry, children: /* @__PURE__ */ jsx(TagDot, { pressed: i === pressed }) }),
|
|
126
|
-
color: colorEntry,
|
|
127
|
-
onClick() {
|
|
128
|
-
onChangeHexColor(colorEntry);
|
|
129
|
-
setPressed(i);
|
|
130
|
-
}
|
|
131
|
-
}))
|
|
118
|
+
Array.from({
|
|
119
|
+
length: maxSavedColors
|
|
120
|
+
}, (_, i) => {
|
|
121
|
+
const colorEntry = savedColors[i];
|
|
122
|
+
if (colorEntry === void 0) {
|
|
123
|
+
return /* @__PURE__ */ jsx(SwatchPlaceholder, { className: "ds-color-swatch-placeholder" }, `swatch-placeholder-${i}`);
|
|
132
124
|
}
|
|
133
|
-
|
|
125
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: colorEntry, children: /* @__PURE__ */ jsx(Swatch, { type: "button", className: "ds-color-swatch", "aria-label": colorEntry, "aria-pressed": i === pressed, style: {
|
|
126
|
+
backgroundColor: colorEntry
|
|
127
|
+
}, onClick: () => {
|
|
128
|
+
onChangeHexColor(colorEntry);
|
|
129
|
+
setPressed(i);
|
|
130
|
+
}, children: i === pressed && /* @__PURE__ */ jsx(SwatchDot, {}) }) }, `swatch-${i}`);
|
|
131
|
+
})
|
|
134
132
|
] });
|
|
135
133
|
const dropdown = /* @__PURE__ */ jsxs(Container, { ref, size, children: [
|
|
136
134
|
/* @__PURE__ */ jsx(HexColorPicker, { color: lastValidHexColor, onChange: onChangeHexColor }),
|
|
@@ -150,7 +148,7 @@ const ColorPicker = ({
|
|
|
150
148
|
] });
|
|
151
149
|
const trigger = useMemo(() => {
|
|
152
150
|
const isClickable = !disabled && !readOnly;
|
|
153
|
-
return /* @__PURE__ */ jsx(ColorPickerSelect, { "data-testid": "color-picker", disabled, readOnly,
|
|
151
|
+
return /* @__PURE__ */ jsx(ColorPickerSelect, { "data-testid": "color-picker", disabled, readOnly, innerPrefix: /* @__PURE__ */ jsx(ColorTag, { shape: TagShape.SINGLE_CHARACTER_ROUND, color: lastValidHexColor, disabled: false, onClick: isClickable ? onClickHandler : void 0 }), onClick: isClickable ? onClickHandler : void 0, onChange: isClickable ? onChangeHandler : void 0, onBlur: onBlurHandler, placeholder, value: colorTextInput, description, errorText, error, ...inputProps });
|
|
154
152
|
}, [disabled, error, readOnly, onClickHandler, onChangeHandler, onBlurHandler, lastValidHexColor, placeholder, colorTextInput, description, errorText, inputProps]);
|
|
155
153
|
if (readOnly || disabled) {
|
|
156
154
|
return trigger;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export declare const TagDot: import('styled-components').StyledComponent<"div", any, {
|
|
2
|
-
pressed?: boolean;
|
|
3
|
-
}, never>;
|
|
4
1
|
export declare const Container: import('styled-components').StyledComponent<"div", any, {
|
|
5
2
|
size?: "S" | "M" | "L";
|
|
6
3
|
}, never>;
|
|
@@ -26,27 +23,14 @@ export declare const ColorTag: import('styled-components').StyledComponent<impor
|
|
|
26
23
|
dashed?: boolean;
|
|
27
24
|
tooltipProps?: import('@synerise/ds-tooltip').TooltipProps;
|
|
28
25
|
} & Omit<import('react').HTMLAttributes<HTMLDivElement>, "id" | "disabled" | "name" | "className" | "color" | "onClick" | "prefixel" | "suffixel" | "image" | "shape" | "textColor" | "removable" | "onRemove" | "texts" | "asPill" | "dashed" | "tooltipProps"> & import('@synerise/ds-utils').DataAttributes & import('react').RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
icon?: import('react').ReactNode;
|
|
38
|
-
onClick?: (event: import('react').MouseEvent<HTMLElement>) => void;
|
|
39
|
-
iconColor?: import('@synerise/ds-utils').LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
40
|
-
error?: boolean;
|
|
41
|
-
readOnly?: boolean;
|
|
42
|
-
tagProps?: import('@synerise/ds-tags').TagProps;
|
|
43
|
-
tooltipProps?: import('@synerise/ds-tooltip').TooltipProps;
|
|
44
|
-
} & import('react').RefAttributes<HTMLButtonElement>> & {
|
|
45
|
-
Creator: import('react').ForwardRefExoticComponent<Omit<import('@synerise/ds-button').CreatorProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
46
|
-
Expander: ({ size, expanded, disabled, onClick, className, }: import('@synerise/ds-button').ExpanderProps) => import("react").JSX.Element;
|
|
47
|
-
Star: (props: import('@synerise/ds-button').StarButtonProps) => React.ReactElement;
|
|
48
|
-
Checkbox: (props: import('@synerise/ds-button').CheckboxButtonProps) => React.ReactElement;
|
|
49
|
-
}, any, {}, never>;
|
|
26
|
+
/** The "+" swatch creator (Figma: Swatch Creator). Plain button, not ds-button. */
|
|
27
|
+
export declare const SwatchCreatorButton: import('styled-components').StyledComponent<"button", any, {}, never>;
|
|
28
|
+
/** A single filled saved-colour swatch (Figma: Swatch — Filled / Filled Selected). */
|
|
29
|
+
export declare const Swatch: import('styled-components').StyledComponent<"button", any, {}, never>;
|
|
30
|
+
/** The centred white dot shown on the currently-selected swatch (Figma: Filled Selected). */
|
|
31
|
+
export declare const SwatchDot: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
32
|
+
/** An empty swatch slot (Figma: Swatch — Default). */
|
|
33
|
+
export declare const SwatchPlaceholder: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
50
34
|
export declare const StyledCopyIcon: import('styled-components').StyledComponent<({ copyValue, texts, onMouseEnter, onMouseLeave, icon, placement, onCopy, onClick, ...rest }: import('@synerise/ds-copy-icon').CopyIconProps) => React.JSX.Element, any, {}, never>;
|
|
51
35
|
export declare const ColorPickerInput: import('styled-components').StyledComponent<import('react').ForwardRefExoticComponent<{
|
|
52
36
|
error?: boolean;
|
|
@@ -65,7 +49,17 @@ export declare const ColorPickerInput: import('styled-components').StyledCompone
|
|
|
65
49
|
autoResizeProps?: Partial<Pick<import('@synerise/ds-input').AutosizeInputProps, "placeholderIsMinWidth" | "wrapperClassName" | "wrapperStyle" | "extraWidth">>;
|
|
66
50
|
expandable?: boolean;
|
|
67
51
|
expandableTooltip?: React.ReactNode;
|
|
68
|
-
} & Omit<import('@synerise/ds-form-field').ContentAboveProps, "id" | "rightSide"> & import('@synerise/ds-form-field').ContentBelowProps & import('
|
|
52
|
+
} & Omit<import('@synerise/ds-form-field').ContentAboveProps, "id" | "rightSide"> & import('@synerise/ds-form-field').ContentBelowProps & Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> & {
|
|
53
|
+
size?: import('@synerise/ds-input/dist/Input.types').InputSize;
|
|
54
|
+
allowClear?: boolean;
|
|
55
|
+
bordered?: boolean;
|
|
56
|
+
innerPrefix?: React.ReactNode;
|
|
57
|
+
prefix?: React.ReactNode;
|
|
58
|
+
suffix?: React.ReactNode;
|
|
59
|
+
onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
60
|
+
addonBefore?: React.ReactNode;
|
|
61
|
+
addonAfter?: React.ReactNode;
|
|
62
|
+
} & import('react').RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
69
63
|
export declare const ColorPickerSelect: import('styled-components').StyledComponent<import('react').ForwardRefExoticComponent<{
|
|
70
64
|
error?: boolean;
|
|
71
65
|
className?: string;
|
|
@@ -83,7 +77,17 @@ export declare const ColorPickerSelect: import('styled-components').StyledCompon
|
|
|
83
77
|
autoResizeProps?: Partial<Pick<import('@synerise/ds-input').AutosizeInputProps, "placeholderIsMinWidth" | "wrapperClassName" | "wrapperStyle" | "extraWidth">>;
|
|
84
78
|
expandable?: boolean;
|
|
85
79
|
expandableTooltip?: React.ReactNode;
|
|
86
|
-
} & Omit<import('@synerise/ds-form-field').ContentAboveProps, "id" | "rightSide"> & import('@synerise/ds-form-field').ContentBelowProps & import('
|
|
80
|
+
} & Omit<import('@synerise/ds-form-field').ContentAboveProps, "id" | "rightSide"> & import('@synerise/ds-form-field').ContentBelowProps & Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> & {
|
|
81
|
+
size?: import('@synerise/ds-input/dist/Input.types').InputSize;
|
|
82
|
+
allowClear?: boolean;
|
|
83
|
+
bordered?: boolean;
|
|
84
|
+
innerPrefix?: React.ReactNode;
|
|
85
|
+
prefix?: React.ReactNode;
|
|
86
|
+
suffix?: React.ReactNode;
|
|
87
|
+
onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
88
|
+
addonBefore?: React.ReactNode;
|
|
89
|
+
addonAfter?: React.ReactNode;
|
|
90
|
+
} & import('react').RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
87
91
|
export declare const PrefixTag: import('styled-components').StyledComponent<"div", any, {
|
|
88
92
|
height?: boolean;
|
|
89
93
|
size?: "S" | "M" | "L";
|
|
@@ -124,27 +128,10 @@ declare const _default: {
|
|
|
124
128
|
height?: boolean;
|
|
125
129
|
size?: "S" | "M" | "L";
|
|
126
130
|
}, never>;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
groupVariant?: import('@synerise/ds-utils').LiteralStringUnion<"left-rounded" | "squared" | "right-rounded">;
|
|
132
|
-
loading?: boolean | {
|
|
133
|
-
delay?: number;
|
|
134
|
-
};
|
|
135
|
-
icon?: import('react').ReactNode;
|
|
136
|
-
onClick?: (event: import('react').MouseEvent<HTMLElement>) => void;
|
|
137
|
-
iconColor?: import('@synerise/ds-utils').LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
138
|
-
error?: boolean;
|
|
139
|
-
readOnly?: boolean;
|
|
140
|
-
tagProps?: import('@synerise/ds-tags').TagProps;
|
|
141
|
-
tooltipProps?: import('@synerise/ds-tooltip').TooltipProps;
|
|
142
|
-
} & import('react').RefAttributes<HTMLButtonElement>> & {
|
|
143
|
-
Creator: import('react').ForwardRefExoticComponent<Omit<import('@synerise/ds-button').CreatorProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
144
|
-
Expander: ({ size, expanded, disabled, onClick, className, }: import('@synerise/ds-button').ExpanderProps) => import("react").JSX.Element;
|
|
145
|
-
Star: (props: import('@synerise/ds-button').StarButtonProps) => React.ReactElement;
|
|
146
|
-
Checkbox: (props: import('@synerise/ds-button').CheckboxButtonProps) => React.ReactElement;
|
|
147
|
-
}, any, {}, never>;
|
|
131
|
+
SwatchCreatorButton: import('styled-components').StyledComponent<"button", any, {}, never>;
|
|
132
|
+
Swatch: import('styled-components').StyledComponent<"button", any, {}, never>;
|
|
133
|
+
SwatchDot: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
134
|
+
SwatchPlaceholder: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
148
135
|
SwatchSectionWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
149
136
|
PreffixWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
150
137
|
ValueWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -166,10 +153,17 @@ declare const _default: {
|
|
|
166
153
|
autoResizeProps?: Partial<Pick<import('@synerise/ds-input').AutosizeInputProps, "placeholderIsMinWidth" | "wrapperClassName" | "wrapperStyle" | "extraWidth">>;
|
|
167
154
|
expandable?: boolean;
|
|
168
155
|
expandableTooltip?: React.ReactNode;
|
|
169
|
-
} & Omit<import('@synerise/ds-form-field').ContentAboveProps, "id" | "rightSide"> & import('@synerise/ds-form-field').ContentBelowProps & import('
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
156
|
+
} & Omit<import('@synerise/ds-form-field').ContentAboveProps, "id" | "rightSide"> & import('@synerise/ds-form-field').ContentBelowProps & Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> & {
|
|
157
|
+
size?: import('@synerise/ds-input/dist/Input.types').InputSize;
|
|
158
|
+
allowClear?: boolean;
|
|
159
|
+
bordered?: boolean;
|
|
160
|
+
innerPrefix?: React.ReactNode;
|
|
161
|
+
prefix?: React.ReactNode;
|
|
162
|
+
suffix?: React.ReactNode;
|
|
163
|
+
onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
164
|
+
addonBefore?: React.ReactNode;
|
|
165
|
+
addonAfter?: React.ReactNode;
|
|
166
|
+
} & import('react').RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
173
167
|
ColorPickerSelect: import('styled-components').StyledComponent<import('react').ForwardRefExoticComponent<{
|
|
174
168
|
error?: boolean;
|
|
175
169
|
className?: string;
|
|
@@ -187,7 +181,17 @@ declare const _default: {
|
|
|
187
181
|
autoResizeProps?: Partial<Pick<import('@synerise/ds-input').AutosizeInputProps, "placeholderIsMinWidth" | "wrapperClassName" | "wrapperStyle" | "extraWidth">>;
|
|
188
182
|
expandable?: boolean;
|
|
189
183
|
expandableTooltip?: React.ReactNode;
|
|
190
|
-
} & Omit<import('@synerise/ds-form-field').ContentAboveProps, "id" | "rightSide"> & import('@synerise/ds-form-field').ContentBelowProps & import('
|
|
184
|
+
} & Omit<import('@synerise/ds-form-field').ContentAboveProps, "id" | "rightSide"> & import('@synerise/ds-form-field').ContentBelowProps & Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> & {
|
|
185
|
+
size?: import('@synerise/ds-input/dist/Input.types').InputSize;
|
|
186
|
+
allowClear?: boolean;
|
|
187
|
+
bordered?: boolean;
|
|
188
|
+
innerPrefix?: React.ReactNode;
|
|
189
|
+
prefix?: React.ReactNode;
|
|
190
|
+
suffix?: React.ReactNode;
|
|
191
|
+
onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
192
|
+
addonBefore?: React.ReactNode;
|
|
193
|
+
addonAfter?: React.ReactNode;
|
|
194
|
+
} & import('react').RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
191
195
|
ColorPickerModalStyle: import('styled-components').GlobalStyleComponent<{
|
|
192
196
|
maxWidth: number;
|
|
193
197
|
}, import('styled-components').DefaultTheme>;
|
|
@@ -1,57 +1,65 @@
|
|
|
1
1
|
import styled, { createGlobalStyle } from "styled-components";
|
|
2
|
-
import Button from "@synerise/ds-button";
|
|
3
2
|
import CopyIcon from "@synerise/ds-copy-icon";
|
|
4
3
|
import { Input } from "@synerise/ds-input";
|
|
5
|
-
import {
|
|
4
|
+
import { Tag } from "@synerise/ds-tags";
|
|
6
5
|
import { ColorPickerSize } from "./ColorPicker.types.js";
|
|
7
|
-
const TagDot = /* @__PURE__ */ styled.div.withConfig({
|
|
8
|
-
displayName: "ColorPickerstyles__TagDot",
|
|
9
|
-
componentId: "sc-1iu8b6j-0"
|
|
10
|
-
})(["display:", ";width:4px;height:4px;background-color:", ";border-radius:50%;"], (props) => props.pressed ? "flex" : "none", (props) => props.theme.palette.white);
|
|
11
6
|
const SIZE_DEFAULT = 168;
|
|
12
7
|
const Container = /* @__PURE__ */ styled.div.withConfig({
|
|
13
8
|
displayName: "ColorPickerstyles__Container",
|
|
14
|
-
componentId: "sc-1iu8b6j-
|
|
15
|
-
})(["width:100%;@media (min-width:200px){min-width:200px;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{width:100%;height:100%;}}
|
|
9
|
+
componentId: "sc-1iu8b6j-0"
|
|
10
|
+
})(["width:100%;@media (min-width:200px){min-width:200px;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{width:100%;height:100%;}}.react-colorful__pointer{width:16px;height:16px;}.react-colorful{width:100%;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;}"], (props) => props.theme.palette.white, (props) => props.size ? ColorPickerSize[props.size] : SIZE_DEFAULT, (props) => props.theme.palette["grey-300"], (props) => props.theme.palette.white);
|
|
16
11
|
const SubContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
17
12
|
displayName: "ColorPickerstyles__SubContainer",
|
|
18
|
-
componentId: "sc-1iu8b6j-
|
|
13
|
+
componentId: "sc-1iu8b6j-1"
|
|
19
14
|
})(["padding:8px 16px 16px;margin-bottom:", ";"], (props) => props.savedColors ? `0` : `-16px`);
|
|
20
15
|
const ColorTag = /* @__PURE__ */ styled(Tag).withConfig({
|
|
21
16
|
displayName: "ColorPickerstyles__ColorTag",
|
|
22
|
-
componentId: "sc-1iu8b6j-
|
|
17
|
+
componentId: "sc-1iu8b6j-2"
|
|
23
18
|
})(["width:16px;height:16px;border:1px solid ", ";"], (props) => props.theme.palette["grey-300"]);
|
|
24
|
-
const
|
|
25
|
-
|
|
19
|
+
const SWATCH_SIZE = 16;
|
|
20
|
+
const SwatchCreatorButton = /* @__PURE__ */ styled.button.withConfig({
|
|
21
|
+
displayName: "ColorPickerstyles__SwatchCreatorButton",
|
|
22
|
+
componentId: "sc-1iu8b6j-3"
|
|
23
|
+
})(["display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:", "px;height:", "px;padding:0;border:none;border-radius:3px;background-color:transparent;color:", ";cursor:pointer;transition:background-color 0.2s ease;&:hover{background-color:", ";}&:focus-visible{outline:1px solid ", ";outline-offset:1px;}"], SWATCH_SIZE, SWATCH_SIZE, (props) => props.theme.palette["grey-800"], (props) => props.theme.palette["grey-200"], (props) => props.theme.palette["blue-600"]);
|
|
24
|
+
const Swatch = /* @__PURE__ */ styled.button.withConfig({
|
|
25
|
+
displayName: "ColorPickerstyles__Swatch",
|
|
26
26
|
componentId: "sc-1iu8b6j-4"
|
|
27
|
-
})(["
|
|
27
|
+
})(["display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:", "px;height:", "px;padding:0;border:1px solid transparent;border-radius:3px;cursor:pointer;&:focus-visible{outline:1px solid ", ";outline-offset:1px;}"], SWATCH_SIZE, SWATCH_SIZE, (props) => props.theme.palette["blue-600"]);
|
|
28
|
+
const SwatchDot = /* @__PURE__ */ styled.span.withConfig({
|
|
29
|
+
displayName: "ColorPickerstyles__SwatchDot",
|
|
30
|
+
componentId: "sc-1iu8b6j-5"
|
|
31
|
+
})(["width:4px;height:4px;border-radius:50%;background-color:", ";"], (props) => props.theme.palette.white);
|
|
32
|
+
const SwatchPlaceholder = /* @__PURE__ */ styled.div.withConfig({
|
|
33
|
+
displayName: "ColorPickerstyles__SwatchPlaceholder",
|
|
34
|
+
componentId: "sc-1iu8b6j-6"
|
|
35
|
+
})(["flex:0 0 auto;width:", "px;height:", "px;border:1px solid ", ";border-radius:3px;"], SWATCH_SIZE, SWATCH_SIZE, (props) => props.theme.palette["grey-300"]);
|
|
28
36
|
const StyledCopyIcon = /* @__PURE__ */ styled(CopyIcon).withConfig({
|
|
29
37
|
displayName: "ColorPickerstyles__StyledCopyIcon",
|
|
30
|
-
componentId: "sc-1iu8b6j-
|
|
38
|
+
componentId: "sc-1iu8b6j-7"
|
|
31
39
|
})(["display:none;"]);
|
|
32
40
|
const ColorPickerInput = /* @__PURE__ */ styled(Input).withConfig({
|
|
33
41
|
displayName: "ColorPickerstyles__ColorPickerInput",
|
|
34
|
-
componentId: "sc-1iu8b6j-
|
|
35
|
-
})(["&:hover{", "{display:flex;}}"], StyledCopyIcon);
|
|
42
|
+
componentId: "sc-1iu8b6j-8"
|
|
43
|
+
})(["&:hover{", "{display:flex;}}input{font-variant-numeric:tabular-nums;}"], StyledCopyIcon);
|
|
36
44
|
const ColorPickerSelect = /* @__PURE__ */ styled(Input).withConfig({
|
|
37
45
|
displayName: "ColorPickerstyles__ColorPickerSelect",
|
|
38
|
-
componentId: "sc-1iu8b6j-
|
|
39
|
-
})(["&&&{
|
|
46
|
+
componentId: "sc-1iu8b6j-9"
|
|
47
|
+
})(["&&&{width:100px;input{box-shadow:none;font-variant-numeric:tabular-nums;}}"]);
|
|
40
48
|
const PrefixTag = /* @__PURE__ */ styled.div.withConfig({
|
|
41
49
|
displayName: "ColorPickerstyles__PrefixTag",
|
|
42
|
-
componentId: "sc-1iu8b6j-
|
|
50
|
+
componentId: "sc-1iu8b6j-10"
|
|
43
51
|
})(["&&& .ds-tag{margin:0;width:24px;height:24px;border:1px solid ", ";cursor:auto;&:hover:before{cursor:auto;filter:brightness(100%);}}position:absolute;right:16px;top:", "px;z-index:2;cursor:auto;"], (props) => props.theme.palette["grey-300"], (props) => (props.size ? ColorPickerSize[props.size] : SIZE_DEFAULT) - 25);
|
|
44
52
|
const SwatchSectionWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
45
53
|
displayName: "ColorPickerstyles__SwatchSectionWrapper",
|
|
46
|
-
componentId: "sc-1iu8b6j-
|
|
47
|
-
})(["display:flex;
|
|
54
|
+
componentId: "sc-1iu8b6j-11"
|
|
55
|
+
})(["display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding-top:16px;"]);
|
|
48
56
|
const PreffixWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
49
57
|
displayName: "ColorPickerstyles__PreffixWrapper",
|
|
50
|
-
componentId: "sc-1iu8b6j-
|
|
58
|
+
componentId: "sc-1iu8b6j-12"
|
|
51
59
|
})(["margin:0px 12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:", ";"], (props) => props.theme.palette["grey-500"]);
|
|
52
60
|
const ValueWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
53
61
|
displayName: "ColorPickerstyles__ValueWrapper",
|
|
54
|
-
componentId: "sc-1iu8b6j-
|
|
62
|
+
componentId: "sc-1iu8b6j-13"
|
|
55
63
|
})(["display:flex;font-size:12px;"]);
|
|
56
64
|
const ColorPickerModalStyle = /* @__PURE__ */ createGlobalStyle([".color-picker-overlay{min-width:unset !important;max-width:", "px;width:100%;}"], ({
|
|
57
65
|
maxWidth
|
|
@@ -61,18 +69,19 @@ const ColorPicker_styles = {
|
|
|
61
69
|
SubContainer,
|
|
62
70
|
ColorTag,
|
|
63
71
|
PrefixTag,
|
|
64
|
-
|
|
72
|
+
SwatchCreatorButton,
|
|
73
|
+
Swatch,
|
|
74
|
+
SwatchDot,
|
|
75
|
+
SwatchPlaceholder,
|
|
65
76
|
SwatchSectionWrapper,
|
|
66
77
|
PreffixWrapper,
|
|
67
78
|
ValueWrapper,
|
|
68
79
|
CopyIcon,
|
|
69
80
|
ColorPickerInput,
|
|
70
|
-
TagDot,
|
|
71
81
|
ColorPickerSelect,
|
|
72
82
|
ColorPickerModalStyle
|
|
73
83
|
};
|
|
74
84
|
export {
|
|
75
|
-
AddColorButton,
|
|
76
85
|
ColorPickerInput,
|
|
77
86
|
ColorPickerModalStyle,
|
|
78
87
|
ColorPickerSelect,
|
|
@@ -82,8 +91,11 @@ export {
|
|
|
82
91
|
PrefixTag,
|
|
83
92
|
StyledCopyIcon,
|
|
84
93
|
SubContainer,
|
|
94
|
+
Swatch,
|
|
95
|
+
SwatchCreatorButton,
|
|
96
|
+
SwatchDot,
|
|
97
|
+
SwatchPlaceholder,
|
|
85
98
|
SwatchSectionWrapper,
|
|
86
|
-
TagDot,
|
|
87
99
|
ValueWrapper,
|
|
88
100
|
ColorPicker_styles as default
|
|
89
101
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-color-picker",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.50",
|
|
4
4
|
"description": "Color-Picker Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -41,14 +41,13 @@
|
|
|
41
41
|
],
|
|
42
42
|
"types": "dist/index.d.ts",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@synerise/ds-button": "^1.5.33",
|
|
45
44
|
"@synerise/ds-copy-icon": "^1.2.15",
|
|
46
45
|
"@synerise/ds-divider": "^1.3.15",
|
|
47
|
-
"@synerise/ds-dropdown": "^1.3.
|
|
46
|
+
"@synerise/ds-dropdown": "^1.3.19",
|
|
48
47
|
"@synerise/ds-form-field": "^1.3.23",
|
|
49
48
|
"@synerise/ds-icon": "^1.18.4",
|
|
50
|
-
"@synerise/ds-input": "^1.7.
|
|
51
|
-
"@synerise/ds-tags": "^1.5.
|
|
49
|
+
"@synerise/ds-input": "^1.7.12",
|
|
50
|
+
"@synerise/ds-tags": "^1.5.50",
|
|
52
51
|
"@synerise/ds-tooltip": "^1.5.3",
|
|
53
52
|
"@synerise/ds-utils": "^1.10.1",
|
|
54
53
|
"react-colorful": "^5.2.0"
|
|
@@ -62,5 +61,5 @@
|
|
|
62
61
|
"react": ">=16.9.0 <= 18.3.1",
|
|
63
62
|
"styled-components": "^5.3.3"
|
|
64
63
|
},
|
|
65
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "a81ab6519d49a3dea9c0cfebcdc9104cbb4f4226"
|
|
66
65
|
}
|