Skip to content

Commit

Permalink
Form CheckBox design-system
Browse files Browse the repository at this point in the history
  • Loading branch information
JadhavJeet committed Mar 6, 2024
1 parent a44747f commit a024c90
Show file tree
Hide file tree
Showing 13 changed files with 591 additions and 124 deletions.
21 changes: 21 additions & 0 deletions src/design-system/formcheckbox.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.dcx-checkbox {
color: token('color-text-formcontrol_label');
font-weight: token('font-weight-formcontrol_label');
font-size: token('font-size-formcontrol_label');

& .dcx-checkbox-container--error {
color: token('color-text-formcontrol_label-error');
}

& .dcx-checkbox-checkbox--error {
color: token('color-text-formcontrol_label-error');
}

& .dcx-checkbox-label--error {
color: token('color-text-formcontrol_label-error');
}

& .focusCheckBox:focus {
box-shadow: 0 0 5px #007bff;
}
}
1 change: 1 addition & 0 deletions src/design-system/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
@import './keyboard-input.css';
@import './preformattedText.css';
@import './form-input.css';
@import './formcheckbox.css';
1 change: 1 addition & 0 deletions src/formCheckbox/FormCheckbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const FormCheckbox = ({
isError?: boolean;
}) => {
const containerClasses = classNames([
'dcx-checkbox',
itemClassName,
{ 'dcx-checkbox-container--error': isError },
]);
Expand Down
2 changes: 1 addition & 1 deletion src/formCheckbox/__test__/FormCheckbox.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ describe('FormCheckbox', () => {

const checkbox: any = container.querySelector('#checkbox-item');

expect(checkbox.className.trim()).toBe('my-checkbox-class');
expect(checkbox.className.trim()).toBe('dcx-checkbox my-checkbox-class');
});

it('should style the checkbox input', () => {
Expand Down

0 comments on commit a024c90

Please sign in to comment.