@synerise/ds-color-picker 2.0.14 → 2.1.1
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 +19 -0
- package/CLAUDE.md +3 -2
- package/dist/ColorPicker.styles.d.ts +2 -38
- package/dist/ColorPicker.styles.js +9 -9
- package/package.json +12 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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
|
+
## [2.1.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-color-picker@2.1.0...@synerise/ds-color-picker@2.1.1) (2026-11-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-color-picker
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [2.1.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-color-picker@2.0.14...@synerise/ds-color-picker@2.1.0) (2026-10-29)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* integrate Token Studio design tokens across the design system ([aabb447](https://github.com/Synerise/synerise-design/commit/aabb447edfb2d0c85e3de1f07e809ef84083453b))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [2.0.14](https://github.com/Synerise/synerise-design/compare/@synerise/ds-color-picker@2.0.13...@synerise/ds-color-picker@2.0.14) (2026-10-28)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-color-picker
|
package/CLAUDE.md
CHANGED
|
@@ -85,11 +85,11 @@ const [savedColors, setSavedColors] = useState<string[]>([]);
|
|
|
85
85
|
|
|
86
86
|
## Styling
|
|
87
87
|
|
|
88
|
-
All styles are in `ColorPicker.styles.ts`. Uses `
|
|
88
|
+
All styles are in `ColorPicker.styles.ts`. Uses `var(--ds-*)` tokens (mostly the shared `--ds-form-field-*` ones, plus `--ds-dropdown-bg`) for borders, backgrounds, and text. `react-colorful` internal class names (`.react-colorful__*`) are overridden directly inside the `Container` styled-component.
|
|
89
89
|
|
|
90
90
|
`ColorPickerModalStyle` is a `createGlobalStyle` that targets `.color-picker-overlay` — it is only injected into the DOM when `maxWidth >= 228`. This is a **global CSS side-effect**.
|
|
91
91
|
|
|
92
|
-
The saved-colour **swatch section** is built from plain styled elements matching the Figma spec (16×16, `border-radius: 3px`): `SwatchCreatorButton` (the "+" button, `<button>` — hover shows a
|
|
92
|
+
The saved-colour **swatch section** is built from plain styled elements matching the Figma spec (16×16, `border-radius: 3px`): `SwatchCreatorButton` (the "+" button, `<button>` — hover shows a `--ds-color-background-base-mutedhover` background), `Swatch` (a filled `<button>` whose `background-color` is the saved colour; the selected one renders a centred `SwatchDot`), and `SwatchPlaceholder` (an empty `<div>` slot with a `--ds-form-field-affix-border` border, no hover change). It does **not** use `ds-tags`/`ds-button` for swatches. Filled swatches carry `.ds-color-swatch`; empty slots carry `.ds-color-swatch-placeholder`.
|
|
93
93
|
|
|
94
94
|
## Key dependencies
|
|
95
95
|
|
|
@@ -97,6 +97,7 @@ The saved-colour **swatch section** is built from plain styled elements matching
|
|
|
97
97
|
- `@synerise/ds-dropdown` — popover/overlay shell for the picker panel
|
|
98
98
|
- `@synerise/ds-input` — trigger text input and the hex input inside the dropdown
|
|
99
99
|
- `@synerise/ds-tags` — `Tag` for the colour preview swatch (trigger `innerPrefix` + the dropdown preview square); **not** used for saved-colour swatches
|
|
100
|
+
- `@synerise/ds-tag` — no runtime import; listed because the published `ColorPicker.styles.d.ts` names `TagShape`/`TagTexts` from it (the inferred type of the styled `Tag`)
|
|
100
101
|
- `@synerise/ds-copy-icon` — copy-to-clipboard button in the dropdown hex input
|
|
101
102
|
- `@synerise/ds-icon` — the `FormulaPlusM` plus glyph inside the swatch creator button
|
|
102
103
|
- `@synerise/ds-form-field` — `FormFieldCommonProps` for `description`/`errorText`
|
|
@@ -4,25 +4,7 @@ export declare const Container: import('styled-components').StyledComponent<"div
|
|
|
4
4
|
export declare const SubContainer: import('styled-components').StyledComponent<"div", any, {
|
|
5
5
|
savedColors?: boolean;
|
|
6
6
|
}, never>;
|
|
7
|
-
export declare const ColorTag: import('styled-components').StyledComponent<import('react').ForwardRefExoticComponent<{
|
|
8
|
-
id?: string | number;
|
|
9
|
-
name?: string;
|
|
10
|
-
textColor?: string;
|
|
11
|
-
color?: string;
|
|
12
|
-
image?: string;
|
|
13
|
-
shape?: import('@synerise/ds-tags').TagShape;
|
|
14
|
-
removable?: boolean;
|
|
15
|
-
className?: string;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
onClick?: () => void;
|
|
18
|
-
onRemove?: (tag: string | number) => void;
|
|
19
|
-
prefixel?: React.ReactNode;
|
|
20
|
-
suffixel?: React.ReactNode;
|
|
21
|
-
texts?: import('@synerise/ds-tags').TagTexts;
|
|
22
|
-
asPill?: boolean;
|
|
23
|
-
dashed?: boolean;
|
|
24
|
-
tooltipProps?: import('@synerise/ds-tooltip').TooltipProps;
|
|
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>;
|
|
7
|
+
export declare const ColorTag: import('styled-components').StyledComponent<import('react').ForwardRefExoticComponent<import('@synerise/ds-tag').TagProps & import('react').RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
26
8
|
/** The "+" swatch creator (Figma: Swatch Creator). Plain button, not ds-button. */
|
|
27
9
|
export declare const SwatchCreatorButton: import('styled-components').StyledComponent<"button", any, {}, never>;
|
|
28
10
|
/** A single filled saved-colour swatch (Figma: Swatch — Filled / Filled Selected). */
|
|
@@ -105,25 +87,7 @@ declare const _default: {
|
|
|
105
87
|
SubContainer: import('styled-components').StyledComponent<"div", any, {
|
|
106
88
|
savedColors?: boolean;
|
|
107
89
|
}, never>;
|
|
108
|
-
ColorTag: import('styled-components').StyledComponent<import('react').ForwardRefExoticComponent<{
|
|
109
|
-
id?: string | number;
|
|
110
|
-
name?: string;
|
|
111
|
-
textColor?: string;
|
|
112
|
-
color?: string;
|
|
113
|
-
image?: string;
|
|
114
|
-
shape?: import('@synerise/ds-tags').TagShape;
|
|
115
|
-
removable?: boolean;
|
|
116
|
-
className?: string;
|
|
117
|
-
disabled?: boolean;
|
|
118
|
-
onClick?: () => void;
|
|
119
|
-
onRemove?: (tag: string | number) => void;
|
|
120
|
-
prefixel?: React.ReactNode;
|
|
121
|
-
suffixel?: React.ReactNode;
|
|
122
|
-
texts?: import('@synerise/ds-tags').TagTexts;
|
|
123
|
-
asPill?: boolean;
|
|
124
|
-
dashed?: boolean;
|
|
125
|
-
tooltipProps?: import('@synerise/ds-tooltip').TooltipProps;
|
|
126
|
-
} & 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>;
|
|
90
|
+
ColorTag: import('styled-components').StyledComponent<import('react').ForwardRefExoticComponent<import('@synerise/ds-tag').TagProps & import('react').RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
127
91
|
PrefixTag: import('styled-components').StyledComponent<"div", any, {
|
|
128
92
|
height?: boolean;
|
|
129
93
|
size?: "S" | "M" | "L";
|
|
@@ -7,7 +7,7 @@ const SIZE_DEFAULT = 168;
|
|
|
7
7
|
const Container = /* @__PURE__ */ styled.div.withConfig({
|
|
8
8
|
displayName: "ColorPickerstyles__Container",
|
|
9
9
|
componentId: "sc-1iu8b6j-0"
|
|
10
|
-
})(["width:100%;@media (min-width:200px){min-width:200px;background-color:
|
|
10
|
+
})(["width:100%;@media (min-width:200px){min-width:200px;background-color:var(--ds-dropdown-bg);}.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 var(--ds-form-field-affix-border);box-shadow:none !important;.react-colorful__pointer-fill{background-color:var(--ds-form-field-bg-default) !important;}}.ant-divider-horizontal{margin:16px 0px;}"], (props) => props.size ? ColorPickerSize[props.size] : SIZE_DEFAULT);
|
|
11
11
|
const SubContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
12
12
|
displayName: "ColorPickerstyles__SubContainer",
|
|
13
13
|
componentId: "sc-1iu8b6j-1"
|
|
@@ -15,24 +15,24 @@ const SubContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
|
15
15
|
const ColorTag = /* @__PURE__ */ styled(Tag).withConfig({
|
|
16
16
|
displayName: "ColorPickerstyles__ColorTag",
|
|
17
17
|
componentId: "sc-1iu8b6j-2"
|
|
18
|
-
})(["width:16px;height:16px;border:1px solid
|
|
18
|
+
})(["width:16px;height:16px;border:1px solid var(--ds-form-field-affix-border);"]);
|
|
19
19
|
const SWATCH_SIZE = 16;
|
|
20
20
|
const SwatchCreatorButton = /* @__PURE__ */ styled.button.withConfig({
|
|
21
21
|
displayName: "ColorPickerstyles__SwatchCreatorButton",
|
|
22
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:
|
|
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:var(--ds-color-icon-base-default);cursor:pointer;transition:background-color 0.2s ease;&:hover{background-color:var(--ds-color-background-base-mutedhover);}&:focus-visible{outline:1px solid var(--ds-form-field-border-focus);outline-offset:1px;}"], SWATCH_SIZE, SWATCH_SIZE);
|
|
24
24
|
const Swatch = /* @__PURE__ */ styled.button.withConfig({
|
|
25
25
|
displayName: "ColorPickerstyles__Swatch",
|
|
26
26
|
componentId: "sc-1iu8b6j-4"
|
|
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
|
|
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 var(--ds-form-field-border-focus);outline-offset:1px;}"], SWATCH_SIZE, SWATCH_SIZE);
|
|
28
28
|
const SwatchDot = /* @__PURE__ */ styled.span.withConfig({
|
|
29
29
|
displayName: "ColorPickerstyles__SwatchDot",
|
|
30
30
|
componentId: "sc-1iu8b6j-5"
|
|
31
|
-
})(["width:4px;height:4px;border-radius:50%;background-color:
|
|
31
|
+
})(["width:4px;height:4px;border-radius:50%;background-color:var(--ds-color-icon-base-onsolid);"]);
|
|
32
32
|
const SwatchPlaceholder = /* @__PURE__ */ styled.div.withConfig({
|
|
33
33
|
displayName: "ColorPickerstyles__SwatchPlaceholder",
|
|
34
34
|
componentId: "sc-1iu8b6j-6"
|
|
35
|
-
})(["flex:0 0 auto;width:", "px;height:", "px;border:1px solid
|
|
35
|
+
})(["flex:0 0 auto;width:", "px;height:", "px;border:1px solid var(--ds-form-field-affix-border);border-radius:3px;"], SWATCH_SIZE, SWATCH_SIZE);
|
|
36
36
|
const StyledCopyIcon = /* @__PURE__ */ styled(CopyIcon).withConfig({
|
|
37
37
|
displayName: "ColorPickerstyles__StyledCopyIcon",
|
|
38
38
|
componentId: "sc-1iu8b6j-7"
|
|
@@ -44,11 +44,11 @@ const ColorPickerInput = /* @__PURE__ */ styled(Input).withConfig({
|
|
|
44
44
|
const ColorPickerSelect = /* @__PURE__ */ styled(Input).withConfig({
|
|
45
45
|
displayName: "ColorPickerstyles__ColorPickerSelect",
|
|
46
46
|
componentId: "sc-1iu8b6j-9"
|
|
47
|
-
})(["&&&{width:100px;input{
|
|
47
|
+
})(["&&&{width:100px;input{font-variant-numeric:tabular-nums;}}"]);
|
|
48
48
|
const PrefixTag = /* @__PURE__ */ styled.div.withConfig({
|
|
49
49
|
displayName: "ColorPickerstyles__PrefixTag",
|
|
50
50
|
componentId: "sc-1iu8b6j-10"
|
|
51
|
-
})(["&&& .ds-tag{margin:0;width:24px;height:24px;border:1px solid
|
|
51
|
+
})(["&&& .ds-tag{margin:0;width:24px;height:24px;border:1px solid var(--ds-form-field-affix-border);cursor:auto;&:hover:before{cursor:auto;filter:brightness(100%);}}position:absolute;right:16px;top:", "px;z-index:2;cursor:auto;"], (props) => (props.size ? ColorPickerSize[props.size] : SIZE_DEFAULT) - 25);
|
|
52
52
|
const SwatchSectionWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
53
53
|
displayName: "ColorPickerstyles__SwatchSectionWrapper",
|
|
54
54
|
componentId: "sc-1iu8b6j-11"
|
|
@@ -56,7 +56,7 @@ const SwatchSectionWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
|
56
56
|
const PreffixWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
57
57
|
displayName: "ColorPickerstyles__PreffixWrapper",
|
|
58
58
|
componentId: "sc-1iu8b6j-12"
|
|
59
|
-
})(["margin:0px 12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:
|
|
59
|
+
})(["margin:0px 12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--ds-form-field-affix-text);"]);
|
|
60
60
|
const ValueWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
61
61
|
displayName: "ColorPickerstyles__ValueWrapper",
|
|
62
62
|
componentId: "sc-1iu8b6j-13"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-color-picker",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Color-Picker Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -42,15 +42,16 @@
|
|
|
42
42
|
],
|
|
43
43
|
"types": "dist/index.d.ts",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@synerise/ds-copy-icon": "^2.
|
|
46
|
-
"@synerise/ds-divider": "^2.
|
|
47
|
-
"@synerise/ds-dropdown": "^2.1
|
|
48
|
-
"@synerise/ds-form-field": "^2.
|
|
49
|
-
"@synerise/ds-icon": "^2.
|
|
50
|
-
"@synerise/ds-input": "^2.
|
|
51
|
-
"@synerise/ds-
|
|
52
|
-
"@synerise/ds-
|
|
53
|
-
"@synerise/ds-
|
|
45
|
+
"@synerise/ds-copy-icon": "^2.1.1",
|
|
46
|
+
"@synerise/ds-divider": "^2.1.1",
|
|
47
|
+
"@synerise/ds-dropdown": "^2.2.1",
|
|
48
|
+
"@synerise/ds-form-field": "^2.1.1",
|
|
49
|
+
"@synerise/ds-icon": "^2.3.1",
|
|
50
|
+
"@synerise/ds-input": "^2.1.1",
|
|
51
|
+
"@synerise/ds-tag": "^2.1.1",
|
|
52
|
+
"@synerise/ds-tags": "^2.1.1",
|
|
53
|
+
"@synerise/ds-tooltip": "^2.1.1",
|
|
54
|
+
"@synerise/ds-utils": "^2.3.1",
|
|
54
55
|
"react-colorful": "^5.2.0"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
@@ -61,5 +62,5 @@
|
|
|
61
62
|
"react": ">=16.9.0 <= 18.3.1",
|
|
62
63
|
"styled-components": "^5.3.3"
|
|
63
64
|
},
|
|
64
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "2d2a540b35fddf8855da45f0dec2f4612c6d87b6"
|
|
65
66
|
}
|