@team-monolith/cds 1.115.2 → 1.115.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.
|
@@ -153,9 +153,9 @@ const Checkbox = React.forwardRef(function Checkbox(props, ref) {
|
|
|
153
153
|
? "partial"
|
|
154
154
|
: "default";
|
|
155
155
|
const clampedSize = Math.max(hitAreaSize, DEFAULT_CHECKBOX_SIZE);
|
|
156
|
-
return (_jsxs(CheckboxContainer, Object.assign({ className: className, spacer: spacer, disabled: disabled,
|
|
156
|
+
return (_jsxs(CheckboxContainer, Object.assign({ className: className, spacer: spacer, disabled: disabled, hitAreaSize: clampedSize, ref: ref }, other, { children: [_jsx(StyledInput, Object.assign({ type: "checkbox" }, inputProps, { checked: checked, disabled: disabled, onClick: onClick, onChange: onChange, size: clampedSize })), _jsx(CheckboxIcon, { type: type, disabled: disabled })] })));
|
|
157
157
|
});
|
|
158
|
-
const CheckboxContainer = styled.span(({ theme, spacer, disabled,
|
|
158
|
+
const CheckboxContainer = styled.span(({ theme, spacer, disabled, hitAreaSize }) => css `
|
|
159
159
|
display: flex;
|
|
160
160
|
align-items: center;
|
|
161
161
|
justify-content: center;
|
|
@@ -170,7 +170,7 @@ const CheckboxContainer = styled.span(({ theme, spacer, disabled, size }) => css
|
|
|
170
170
|
pointer-events: none;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
${
|
|
173
|
+
${hitAreaSize > DEFAULT_CHECKBOX_SIZE &&
|
|
174
174
|
css `
|
|
175
175
|
&::before {
|
|
176
176
|
content: "";
|
|
@@ -178,8 +178,8 @@ const CheckboxContainer = styled.span(({ theme, spacer, disabled, size }) => css
|
|
|
178
178
|
top: 50%;
|
|
179
179
|
left: 50%;
|
|
180
180
|
transform: translate(-50%, -50%);
|
|
181
|
-
width: ${
|
|
182
|
-
height: ${
|
|
181
|
+
width: ${hitAreaSize}px;
|
|
182
|
+
height: ${hitAreaSize}px;
|
|
183
183
|
border-radius: 50%;
|
|
184
184
|
background: ${theme.color.background.neutralAltActive};
|
|
185
185
|
opacity: 0;
|