Skip to content

Commit

Permalink
docs(read-only): checkbox docs (#3404)
Browse files Browse the repository at this point in the history
* update usage.mdx

* update style.mdx

* add link to pattern guidance

* chore: format

---------

Co-authored-by: Alison Joseph <alison.joseph@us.ibm.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Mar 2, 2023
1 parent f3b0e91 commit 665db58
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
Binary file modified src/pages/components/checkbox/images/checkbox-style-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/pages/components/checkbox/images/checkbox-style-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/pages/components/checkbox/images/checkbox-usage-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 10 additions & 7 deletions src/pages/components/checkbox/style.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@ tabs: ['Usage', 'Style', 'Code', 'Accessibility']

### Interactive states

| Element | Property | Color token |
| ----------------- | ---------- | ---------------- |
| Checkbox:focus | border | `$focus` |
| Label:disabled | text color | `$text-disabled` |
| Checkbox:disabled | border | `$icon-disabled` |
| | background | `$icon-disabled` |
| State | Element | Property | Color token |
| --------- | -------- | ---------- | ---------------- |
| Focus | Checkbox | border | `$focus` |
| Disabled | Label | text color | `$text-disabled` |
| | Checkbox | border | `$icon-disabled` |
| | | background | `$icon-disabled` |
| Read-only | Label | text color | `$text-primary` |
| | Checkbox | border | `$icon-disabled` |
| | | inner fill | `$icon-primary` |

<Row>
<Column colLg={8}>
<Column colLg={12}>

![Checkbox interactive states](images/checkbox-style-2.png)

Expand Down
13 changes: 8 additions & 5 deletions src/pages/components/checkbox/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -261,20 +261,23 @@ option selected.
<Row>
<Column colLg={8}>

![Unselected, selected and indeterminate states of checkbox.](images/checkbox-usage-7.png)
![Unselected, selected, and indeterminate states of checkbox.](images/checkbox-usage-7.png)

</Column>
</Row>

Use the indeterminate state when the checkbox contains a sublist of selections,
some of which are selected, and some unselected. In addition to unselected,
selected, and indeterminate states, checkboxes also have states for focus and
disabled.
selected, and indeterminate states, checkboxes also have states for focus,
disabled, and read-only. When deciding whether to use a disabled or read-only
state for checkboxes, see our
[Read-only states pattern](https://carbondesignsystem.com/patterns/read-only-states-pattern/)
guidance.

<Row>
<Column colLg={8}>
<Column colLg={12}>

![Focus and disabled states of checkbox.](images/checkbox-usage-8.png)
![Focus, disabled, and read-only states of checkbox.](images/checkbox-usage-8.png)

</Column>
</Row>
Expand Down

1 comment on commit 665db58

@vercel
Copy link

@vercel vercel bot commented on 665db58 Mar 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.