Skip to content

Commit f134685

Browse files
author
Kubit
committed
Add new configuration for styles to CheckBox component
1 parent 474416b commit f134685

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

src/components/checkbox/checkbox.styled.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,34 @@ type SpanChecked = {
1212
$isChecked?: boolean;
1313
};
1414

15-
export const CheckboxContainerStyled = styled.div`
15+
export const CheckboxContainerStyled = styled.div<ThemeStylesType>`
1616
width: fit-content;
17+
${props => getStyles(props.styles?.container)}
1718
`;
1819

19-
export const CheckboxIconLabelWrapperStyled = styled.div`
20+
export const CheckboxIconLabelWrapperStyled = styled.div<ThemeStylesType>`
2021
display: flex;
2122
flex-direction: row;
2223
align-items: flex-start;
24+
${props => getStyles(props.styles?.iconLabelWrapper)}
2325
`;
2426

2527
export const CheckboxStyled = styled.input<ThemeStylesType>`
26-
${props => getStyles(props.styles?.checkbox)}
2728
appearance: none;
2829
cursor: pointer;
2930
display: grid;
3031
place-content: center;
3132
&:disabled {
3233
cursor: default;
3334
}
35+
${props => getStyles(props.styles?.checkbox)}
3436
`;
3537

36-
export const CheckboxFrameStyled = styled.div`
38+
export const CheckboxFrameStyled = styled.div<ThemeStylesType>`
3739
position: relative;
3840
height: fit-content;
3941
width: fit-content;
42+
${props => getStyles(props.styles?.frameContainer)}
4043
`;
4144

4245
export const CheckedIcon = styled.span<ThemeStylesType & SpanChecked>`

src/components/checkbox/checkboxStandAlone.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ const CheckboxStandAloneComponent = (
122122
};
123123

124124
return (
125-
<CheckboxContainerStyled>
126-
<CheckboxIconLabelWrapperStyled>
127-
<CheckboxFrameStyled>
125+
<CheckboxContainerStyled styles={styles}>
126+
<CheckboxIconLabelWrapperStyled styles={styles}>
127+
<CheckboxFrameStyled styles={styles}>
128128
<CheckboxStyled
129129
ref={ref}
130130
aria-describedby={buildAriaDescribedBy({

src/components/checkbox/types/checkboxTheme.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export type CheckboxPropsStylesType = {
1919
errorWrapper?: CommonStyleType;
2020
errorIcon?: IconTypes;
2121
textError?: TypographyTypes;
22+
container?: CommonStyleType;
23+
iconLabelWrapper?: CommonStyleType;
24+
frameContainer?: CommonStyleType;
2225
};
2326

2427
export type CheckboxPropsStateStylesType = {

0 commit comments

Comments
 (0)