Skip to content

Commit

Permalink
feat: add checkbox indeterminate state
Browse files Browse the repository at this point in the history
  - update checkbox story to show indeterminate state

Closes DO-530
  • Loading branch information
donaldIvanTC committed Aug 8, 2024
1 parent 522ff4e commit 90e13b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion system/stories/src/Checkbox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ const states = [false, true, indeterminate] as const;
const labelSelector = checkboxRadioLabel.selectors.find((selector) =>
selector.includes('checkbox')
);
const textEmoji = (state: boolean | string) => {
if (state === true) return '☑';
if (state === false) return '☐';
return '-';
};

export default {
title: 'Components/Checkbox',
Expand Down Expand Up @@ -39,7 +44,7 @@ const Template: Story = ({ Checkbox, LabelComponent }) => (
}
}}
/>
{variant} {state ? '☑' : '☐'}
{variant} {textEmoji(state)}
</LabelComponent>
))
)}
Expand Down

0 comments on commit 90e13b3

Please sign in to comment.