Skip to content

Commit 3474aec

Browse files
committed
feat: add checkbox indeterminate state
- update checkbox story to show indeterminate state Closes DO-530
1 parent 7521790 commit 3474aec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

system/stories/src/Checkbox.stories.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ const states = [false, true, indeterminate] as const;
1111
const labelSelector = checkboxRadioLabel.selectors.find((selector) =>
1212
selector.includes('checkbox')
1313
);
14+
const textEmoji = (state: boolean | string) => {
15+
if (state === true) return '☑';
16+
if (state === false) return '☐';
17+
return '-';
18+
};
1419

1520
export default {
1621
title: 'Components/Checkbox',
@@ -39,7 +44,7 @@ const Template: Story = ({ Checkbox, LabelComponent }) => (
3944
}
4045
}}
4146
/>
42-
{variant} {state ? '☑' : '☐'}
47+
{variant} {textEmoji(state)}
4348
</LabelComponent>
4449
))
4550
)}

0 commit comments

Comments
 (0)