@synerise/ds-card-select 2.0.11 → 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 +2 -2
- package/dist/CardSelect.d.ts +1 -1
- package/dist/CardSelect.js +2 -4
- package/dist/CardSelect.styles.d.ts +1 -19
- package/dist/CardSelect.styles.js +26 -27
- package/package.json +6 -6
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-card-select@2.1.0...@synerise/ds-card-select@2.1.1) (2026-11-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-card-select
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [2.1.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card-select@2.0.11...@synerise/ds-card-select@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.11](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card-select@2.0.10...@synerise/ds-card-select@2.0.11) (2026-10-28)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-card-select
|
package/CLAUDE.md
CHANGED
|
@@ -103,7 +103,7 @@ const [selected, setSelected] = useState(false);
|
|
|
103
103
|
|
|
104
104
|
## Styling
|
|
105
105
|
|
|
106
|
-
Styles are in `CardSelect.styles.ts` using `styled-is` for `is(prop)` / `isNot(prop)` conditional CSS blocks.
|
|
106
|
+
Styles are in `CardSelect.styles.ts` using `styled-is` for `is(prop)` / `isNot(prop)` conditional CSS blocks. Colours come from `var(--ds-*)` tokens, mostly the `--ds-card-select-*` module tokens — no hardcoded hex values except in comments. The `styled-is` library is an additional dependency not used elsewhere in the DS.
|
|
107
107
|
|
|
108
108
|
## Implementation notes
|
|
109
109
|
|
|
@@ -113,4 +113,4 @@ Styles are in `CardSelect.styles.ts` using `styled-is` for `is(prop)` / `isNot(p
|
|
|
113
113
|
- **Tag ribbon offset**: the `TagRibbonAnchor` padding is calculated from constants (`TAG_LEFT_OFFSET*`) to align the ribbon with or without a tick. Position (`left`/`right`) is mirrored based on `elementsPosition`.
|
|
114
114
|
- **`CardSelectGroup` columns fallback**: when `columns` is `null`, the grid uses `itemsCount` columns (i.e. all items in one row). When both `items` and `children` are provided, `items` takes precedence.
|
|
115
115
|
- **`width` prop is deprecated**: it maps to the same styled `size` prop on the wrapper and only affects gap, not card size. Use `size` for both.
|
|
116
|
-
- **`withTheme` wrapper**: `CardSelect` is exported as `withTheme(CardSelect)` so the component receives `theme` as a prop
|
|
116
|
+
- **`withTheme` wrapper**: `CardSelect` is exported as `withTheme(CardSelect)` so the component receives `theme` as a prop, but nothing reads it any more (no `useTheme()` call). The `theme` prop type is marked `@deprecated`.
|
package/dist/CardSelect.d.ts
CHANGED
|
@@ -287,10 +287,10 @@ declare const _default: React.ForwardRefExoticComponent<{
|
|
|
287
287
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLDivElement> | undefined;
|
|
288
288
|
onTransitionEnd?: React.TransitionEventHandler<HTMLDivElement> | undefined;
|
|
289
289
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLDivElement> | undefined;
|
|
290
|
+
prefixel?: React.ReactNode;
|
|
290
291
|
name?: string | undefined;
|
|
291
292
|
textColor?: string | undefined;
|
|
292
293
|
disabled?: boolean | undefined;
|
|
293
|
-
prefixel?: React.ReactNode;
|
|
294
294
|
suffixel?: React.ReactNode;
|
|
295
295
|
dashed?: boolean | undefined;
|
|
296
296
|
tooltipProps?: import('@synerise/ds-tooltip').TooltipProps | undefined;
|
package/dist/CardSelect.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useRef } from "react";
|
|
3
3
|
import { withTheme } from "styled-components";
|
|
4
|
-
import { useTheme } from "@synerise/ds-core";
|
|
5
4
|
import Icon, { Check3M, InfoFillS } from "@synerise/ds-icon";
|
|
6
5
|
import { TagShape } from "@synerise/ds-tag";
|
|
7
6
|
import Tooltip from "@synerise/ds-tooltip";
|
|
@@ -32,7 +31,6 @@ const CardSelect = ({
|
|
|
32
31
|
infoTooltipProps
|
|
33
32
|
}) => {
|
|
34
33
|
const [isPressed, setIsPressed] = useState(false);
|
|
35
|
-
const theme = useTheme();
|
|
36
34
|
const wrapperRef = useRef(null);
|
|
37
35
|
const tickIconRef = useRef(null);
|
|
38
36
|
const handleClick = () => {
|
|
@@ -53,8 +51,8 @@ const CardSelect = ({
|
|
|
53
51
|
tagElementWithTooltip,
|
|
54
52
|
/* @__PURE__ */ jsxs(Container, { error: !!error, ref: wrapperRef, pressed: isPressed, raised, disabled, value, size, onClick: handleClick, className: `ds-card-select ${className || ""}`, elementsPosition, stretchToFit, children: [
|
|
55
53
|
/* @__PURE__ */ jsxs(Aside, { size, elementsPosition, tickVisible, tabIndex: disabled ? void 0 : 0, ref: tickIconRef, children: [
|
|
56
|
-
tickVisible && /* @__PURE__ */ jsx(TickIcon, { className: "ds-card-select-tick", disabled, elementsPosition, selected: value && !disabled, size, children: value ? /* @__PURE__ */ jsx(Icon, { size: realTickSize, color:
|
|
57
|
-
infoTooltipProps && /* @__PURE__ */ jsx(Tooltip, { ...infoTooltipProps, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(InfoFillS, {}), color:
|
|
54
|
+
tickVisible && /* @__PURE__ */ jsx(TickIcon, { className: "ds-card-select-tick", disabled, elementsPosition, selected: value && !disabled, size, children: value ? /* @__PURE__ */ jsx(Icon, { size: realTickSize, color: "var(--ds-card-select-check-bg-selected)", component: /* @__PURE__ */ jsx(Check3M, {}) }) : /* @__PURE__ */ jsx(RadioShape, { size }) }),
|
|
55
|
+
infoTooltipProps && /* @__PURE__ */ jsx(Tooltip, { ...infoTooltipProps, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(InfoFillS, {}), color: "var(--ds-color-icon-base-muted)" }) })
|
|
58
56
|
] }),
|
|
59
57
|
/* @__PURE__ */ jsxs(Main, { children: [
|
|
60
58
|
icon && /* @__PURE__ */ jsx(IconWrapper, { size, children: /* @__PURE__ */ jsx(Icon, { component: icon, size: realIconSize }) }),
|
|
@@ -33,25 +33,7 @@ export declare const Container: import('styled-components').StyledComponent<"div
|
|
|
33
33
|
error?: boolean;
|
|
34
34
|
} & ThemeProps, never>;
|
|
35
35
|
export declare const TagRibbonAnchor: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
36
|
-
export declare const TagRibbon: import('styled-components').StyledComponent<React.ForwardRefExoticComponent<{
|
|
37
|
-
id?: string | number;
|
|
38
|
-
name?: string;
|
|
39
|
-
textColor?: string;
|
|
40
|
-
color?: string;
|
|
41
|
-
image?: string;
|
|
42
|
-
shape?: import('@synerise/ds-tag').TagShape;
|
|
43
|
-
removable?: boolean;
|
|
44
|
-
className?: string;
|
|
45
|
-
disabled?: boolean;
|
|
46
|
-
onClick?: () => void;
|
|
47
|
-
onRemove?: (tag: string | number) => void;
|
|
48
|
-
prefixel?: React.ReactNode;
|
|
49
|
-
suffixel?: React.ReactNode;
|
|
50
|
-
texts?: import('@synerise/ds-tag').TagTexts;
|
|
51
|
-
asPill?: boolean;
|
|
52
|
-
dashed?: boolean;
|
|
53
|
-
tooltipProps?: import('@synerise/ds-tooltip').TooltipProps;
|
|
54
|
-
} & Omit<React.HTMLAttributes<HTMLDivElement>, "className" | "id" | "color" | "onClick" | "name" | "textColor" | "image" | "shape" | "removable" | "disabled" | "onRemove" | "prefixel" | "suffixel" | "texts" | "asPill" | "dashed" | "tooltipProps"> & import('@synerise/ds-utils').DataAttributes & React.RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
36
|
+
export declare const TagRibbon: import('styled-components').StyledComponent<React.ForwardRefExoticComponent<import('@synerise/ds-tag').TagProps & React.RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
55
37
|
export declare const Main: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
56
38
|
export declare const TickIcon: import('styled-components').StyledComponent<"div", any, {
|
|
57
39
|
size?: CardSelectSizeType;
|
|
@@ -18,7 +18,6 @@ const MAP_ELEMENTS_POSITION = {
|
|
|
18
18
|
right: "flex-end",
|
|
19
19
|
center: "center"
|
|
20
20
|
};
|
|
21
|
-
const getVar = (name) => (props) => props.theme.palette[name];
|
|
22
21
|
const getTransformValues = (props) => {
|
|
23
22
|
if (props.size === "small") {
|
|
24
23
|
return "translate(-2px,-2px)";
|
|
@@ -32,11 +31,11 @@ const sizeCondition = (smallValue, mediumValue, props) => props.size === "small"
|
|
|
32
31
|
const RadioShape = /* @__PURE__ */ styled.div.withConfig({
|
|
33
32
|
displayName: "CardSelectstyles__RadioShape",
|
|
34
33
|
componentId: "sc-tfmgtj-0"
|
|
35
|
-
})(["", ";width:", "px;height:", "px;border-radius:50%;border-width:", "px;border-style:solid;border-color:
|
|
34
|
+
})(["", ";width:", "px;height:", "px;border-radius:50%;border-width:", "px;border-style:solid;border-color:var(--ds-card-select-check-border-color-default);margin:2px;&:hover{border-color:var(--ds-card-select-check-border-color-hover);}"], TRANSITION, (props) => sizeCondition(RADIO_SMALL_WIDTH, RADIO_WIDTH, props), (props) => sizeCondition(RADIO_SMALL_WIDTH, RADIO_WIDTH, props), RADIO_BORDER_WIDTH);
|
|
36
35
|
const Title = /* @__PURE__ */ styled.div.withConfig({
|
|
37
36
|
displayName: "CardSelectstyles__Title",
|
|
38
37
|
componentId: "sc-tfmgtj-1"
|
|
39
|
-
})(["text-align:center;color:
|
|
38
|
+
})(["text-align:center;color:var(--ds-card-select-header-color);font-weight:", ";width:100%;font-size:", ";", ""], (props) => sizeCondition("400", "500", props), (props) => sizeCondition("13px", "14px", props), (props) => props.size === "small" && props.hasIcon && css(["margin-top:4px;"]));
|
|
40
39
|
const Description = /* @__PURE__ */ styled.div.withConfig({
|
|
41
40
|
displayName: "CardSelectstyles__Description",
|
|
42
41
|
componentId: "sc-tfmgtj-2"
|
|
@@ -52,56 +51,56 @@ const Aside = /* @__PURE__ */ styled.div.withConfig({
|
|
|
52
51
|
const Container = /* @__PURE__ */ styled.div.withConfig({
|
|
53
52
|
displayName: "CardSelectstyles__Container",
|
|
54
53
|
componentId: "sc-tfmgtj-5"
|
|
55
|
-
})(["", " ", ";background-color:
|
|
54
|
+
})(["", " ", ";background-color:var(--ds-card-select-bg-default);border-radius:", ";", " display:flex;flex:1;justify-content:", ";border-color:var(--ds-card-select-bg-default);position:relative;padding:", ";cursor:pointer;&&:focus-within{box-shadow:0px 0px 0px 2px var(--ds-card-select-border-color-focused);}", " ", " ", " ", " ", " ", ",", ",", "{text-align:", ";}", "{margin-left:", ";margin-right:", ";}", " ", ";"], is("stretchToFit")`
|
|
56
55
|
height: 100%;
|
|
57
|
-
`, TRANSITION,
|
|
56
|
+
`, TRANSITION, (props) => props.theme.variable("@border-radius-base"), is("error")`
|
|
58
57
|
&&, &&:hover {
|
|
59
|
-
box-shadow: 0px 0px 0px 2px
|
|
58
|
+
box-shadow: 0px 0px 0px 2px var(--ds-color-border-danger-default);
|
|
60
59
|
}
|
|
61
|
-
`, (props) => MAP_ELEMENTS_POSITION[props.elementsPosition],
|
|
62
|
-
box-shadow: 0px 0px 0px 2px
|
|
63
|
-
`, is("value") && is("pressed")` box-shadow: 0px 0px 0px 2px
|
|
64
|
-
box-shadow: 0px 0px 0px 2px
|
|
65
|
-
`, is("value") && is("pressed")` box-shadow: 0px 0px 0px 2px
|
|
66
|
-
|
|
60
|
+
`, (props) => MAP_ELEMENTS_POSITION[props.elementsPosition], (props) => props.size === "small" ? "16px" : "24px", isNot("pressed") && isNot("value")`box-shadow: 0px 0px 0px 1px var(--ds-card-select-border-color-default);`, is("value")`
|
|
61
|
+
box-shadow: 0px 0px 0px 2px var(--ds-card-select-border-color-selected);
|
|
62
|
+
`, is("value") && is("pressed")` box-shadow: 0px 0px 0px 2px var(--ds-card-select-border-color-selected);`, is("value") && is("raised")`
|
|
63
|
+
box-shadow: 0px 0px 0px 2px var(--ds-card-select-border-color-selected);
|
|
64
|
+
`, is("value") && is("pressed")` box-shadow: 0px 0px 0px 2px var(--ds-card-select-border-color-selected);`, Title, Description, IconWrapper, (props) => props.elementsPosition, IconWrapper, (props) => props.elementsPosition === "left" ? "-18px" : "0px", (props) => props.elementsPosition === "right" ? "-18px" : "0px", isNot("disabled")`
|
|
65
|
+
|
|
67
66
|
|
|
68
67
|
&:hover {
|
|
69
68
|
${RadioShape} {
|
|
70
|
-
border-color:
|
|
69
|
+
border-color: var(--ds-card-select-check-border-color-hover);
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
${isNot("raised")`
|
|
75
74
|
${isNot("value")`
|
|
76
|
-
box-shadow: 0px 0px 0px 1px
|
|
77
|
-
|
|
75
|
+
box-shadow: 0px 0px 0px 1px var(--ds-card-select-border-color-default);
|
|
76
|
+
|
|
78
77
|
&:hover, &:active {
|
|
79
|
-
box-shadow: 0px 0px 0px 1px
|
|
78
|
+
box-shadow: 0px 0px 0px 1px var(--ds-card-select-border-color-hover);
|
|
80
79
|
}
|
|
81
80
|
`};
|
|
82
81
|
`};
|
|
83
|
-
|
|
82
|
+
|
|
84
83
|
${is("raised")`
|
|
85
84
|
${isNot("value")`
|
|
86
|
-
box-shadow:
|
|
87
|
-
|
|
85
|
+
box-shadow: var(--ds-card-select-shadow-default);
|
|
86
|
+
|
|
88
87
|
&:hover, &:active {
|
|
89
|
-
box-shadow:
|
|
88
|
+
box-shadow: var(--ds-card-select-shadow-hover);
|
|
90
89
|
}
|
|
91
90
|
`}
|
|
92
|
-
|
|
91
|
+
|
|
93
92
|
`}
|
|
94
93
|
`, is("disabled")`
|
|
95
|
-
opacity:
|
|
94
|
+
opacity: var(--ds-card-select-disabled-opacity);
|
|
96
95
|
pointer-events:none;
|
|
97
96
|
|
|
98
97
|
${isNot("raised")`
|
|
99
98
|
|
|
100
99
|
${isNot("value")`
|
|
101
|
-
box-shadow: 0px 0px 0px 1px
|
|
100
|
+
box-shadow: 0px 0px 0px 1px var(--ds-card-select-border-color-disabled);
|
|
102
101
|
`}
|
|
103
102
|
`}
|
|
104
|
-
|
|
103
|
+
|
|
105
104
|
`);
|
|
106
105
|
const TagRibbonAnchor = /* @__PURE__ */ styled.div.withConfig({
|
|
107
106
|
displayName: "CardSelectstyles__TagRibbonAnchor",
|
|
@@ -119,11 +118,11 @@ const TickIcon = /* @__PURE__ */ styled.div.withConfig({
|
|
|
119
118
|
displayName: "CardSelectstyles__TickIcon",
|
|
120
119
|
componentId: "sc-tfmgtj-9"
|
|
121
120
|
})(["", " ", " ", ""], is("selected")`
|
|
122
|
-
transform: ${(props) => getTransformValues(props)};
|
|
121
|
+
transform: ${(props) => getTransformValues(props)};
|
|
123
122
|
`, is("disabled")`
|
|
124
123
|
${RadioShape} {
|
|
125
|
-
background-color:
|
|
126
|
-
border-color:
|
|
124
|
+
background-color: var(--ds-color-background-base-subtle);
|
|
125
|
+
border-color: var(--ds-card-select-check-border-color-default);
|
|
127
126
|
}
|
|
128
127
|
`, isNot("disabled")`
|
|
129
128
|
${RadioShape} {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-card-select",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Card-Select UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
],
|
|
43
43
|
"types": "dist/index.d.ts",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@synerise/ds-icon": "^2.
|
|
46
|
-
"@synerise/ds-tag": "^2.
|
|
47
|
-
"@synerise/ds-tooltip": "^2.
|
|
48
|
-
"@synerise/ds-utils": "^2.
|
|
45
|
+
"@synerise/ds-icon": "^2.3.1",
|
|
46
|
+
"@synerise/ds-tag": "^2.1.1",
|
|
47
|
+
"@synerise/ds-tooltip": "^2.1.1",
|
|
48
|
+
"@synerise/ds-utils": "^2.3.1",
|
|
49
49
|
"styled-is": "^1.3.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"react": ">=16.9.0 <= 18.3.1",
|
|
57
57
|
"styled-components": "^5.3.3"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "2d2a540b35fddf8855da45f0dec2f4612c6d87b6"
|
|
60
60
|
}
|