-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from cratebind/rework/checkbox
feat: rework and simplify Checkbox component
- Loading branch information
Showing
5 changed files
with
207 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Checkbox can have checked state changed by theme: Checked Checkbox 1`] = ` | ||
<input | ||
aria-checked="true" | ||
class="sc-AxjAm sc-AxhUy kZhFvc" | ||
data-reach-custom-checkbox-input="" | ||
type="checkbox" | ||
/> | ||
`; | ||
|
||
exports[`Checkbox can have checked state changed by theme: Unchecked Checkbox 1`] = ` | ||
.c0 { | ||
box-sizing: border-box; | ||
min-width: 0; | ||
color: #374151; | ||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='192' fill='%23000000' viewBox='0 0 256 256'%3E%3Crect width='256' height='256' fill='none'%3E%3C/rect%3E%3Cpolyline points='216 72.005 104 184 48 128.005' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'%3E%3C/polyline%3E%3C/svg%3E"); | ||
background-size: 100%; | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
-webkit-appearance: none; | ||
-moz-appearance: none; | ||
appearance: none; | ||
width: 18px; | ||
height: 18px; | ||
margin-right: 8px; | ||
border-radius: 4px; | ||
border-width: 1px; | ||
border-style: solid; | ||
padding: 2px; | ||
background-color: #333; | ||
-webkit-transition: background-color,border-color 150ms cubic-bezier(0.4,0,0.2,1); | ||
transition: background-color,border-color 150ms cubic-bezier(0.4,0,0.2,1); | ||
} | ||
.c0:focus { | ||
border-color: #a4cafe; | ||
box-shadow: 0 0 0 3px rgba(118,169,250,.45); | ||
outline: 0; | ||
} | ||
.c0[aria-checked=true], | ||
.c0[data-state="checked"] { | ||
background-color: #c33333; | ||
} | ||
<input | ||
aria-checked="false" | ||
class="c0" | ||
data-reach-custom-checkbox-input="" | ||
type="checkbox" | ||
/> | ||
`; | ||
|
||
exports[`Checkbox shows checkbox when checked: Checked Checkbox 1`] = ` | ||
<input | ||
aria-checked="true" | ||
class="sc-AxjAm sc-AxhUy gFWAqT" | ||
data-reach-custom-checkbox-input="" | ||
type="checkbox" | ||
/> | ||
`; | ||
|
||
exports[`Checkbox shows checkbox when checked: Unchecked Checkbox 1`] = ` | ||
.c0 { | ||
box-sizing: border-box; | ||
min-width: 0; | ||
color: #374151; | ||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='192' fill='%23000000' viewBox='0 0 256 256'%3E%3Crect width='256' height='256' fill='none'%3E%3C/rect%3E%3Cpolyline points='216 72.005 104 184 48 128.005' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'%3E%3C/polyline%3E%3C/svg%3E"); | ||
background-size: 100%; | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
-webkit-appearance: none; | ||
-moz-appearance: none; | ||
appearance: none; | ||
width: 18px; | ||
height: 18px; | ||
margin-right: 8px; | ||
border-radius: 4px; | ||
border-width: 1px; | ||
border-style: solid; | ||
padding: 2px; | ||
background-color: #fff; | ||
-webkit-transition: background-color,border-color 150ms cubic-bezier(0.4,0,0.2,1); | ||
transition: background-color,border-color 150ms cubic-bezier(0.4,0,0.2,1); | ||
} | ||
.c0:focus { | ||
border-color: #a4cafe; | ||
box-shadow: 0 0 0 3px rgba(118,169,250,.45); | ||
outline: 0; | ||
} | ||
.c0[aria-checked=true], | ||
.c0[data-state="checked"] { | ||
background-color: #5850ec; | ||
border-color: #5850ec; | ||
} | ||
<input | ||
aria-checked="false" | ||
class="c0" | ||
data-reach-custom-checkbox-input="" | ||
type="checkbox" | ||
/> | ||
`; |
Oops, something went wrong.
4b936fa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: