-
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #303 from TaloDev/develop
Release 0.38.0
- Loading branch information
Showing
27 changed files
with
382 additions
and
198 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,42 @@ | ||
import { useState } from 'react' | ||
import clsx from 'clsx' | ||
import { IconCheck } from '@tabler/icons-react' | ||
import { hiddenInputStyle, labelFocusStyle } from '../styles/theme' | ||
|
||
type CheckboxButtonProps = { | ||
id: string | ||
checked: boolean | ||
onChange: (checked: boolean) => void | ||
label: string | ||
} | ||
|
||
export default function CheckboxButton({ id, checked, label, onChange }: CheckboxButtonProps) { | ||
const [focus, setFocus] = useState(false) | ||
|
||
return ( | ||
<> | ||
<input | ||
id={id} | ||
type='checkbox' | ||
className={hiddenInputStyle} | ||
onFocus={() => setFocus(true)} | ||
onBlur={() => setFocus(false)} | ||
onChange={() => onChange(!checked)} | ||
/> | ||
|
||
<label | ||
htmlFor={id} | ||
className={clsx('p-1 rounded hover:bg-gray-200 flex items-center space-x-2 cursor-pointer transition-all', { [labelFocusStyle]: focus })} | ||
> | ||
<span className='inline-block rounded w-6 h-6 bg-white border border-black/30 align-text-bottom text-black active:bg-gray-200 transition-colors'> | ||
{checked && | ||
<span className='flex items-center justify-center h-full'> | ||
<IconCheck size={16} stroke={3} /> | ||
</span> | ||
} | ||
</span> | ||
<span>{label}</span> | ||
</label> | ||
</> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.