-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12b3e4d
commit cdf5653
Showing
16 changed files
with
175 additions
and
76 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
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,28 @@ | ||
export type CheckboxCheckedIconProps = { | ||
title?: string; | ||
className?: string; | ||
}; | ||
|
||
/** | ||
* Checkbox for lists and list items | ||
*/ | ||
export const CheckboxCheckedIcon = ({ title = 'Checkbox', className }: CheckboxCheckedIconProps) => { | ||
return ( | ||
<svg | ||
width="1em" | ||
height="1em" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
className={className} | ||
> | ||
<title>{title}</title> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M2.5 0C1.11929 0 0 1.11929 0 2.5V21.5C0 22.8807 1.11929 24 2.5 24H21.5C22.8807 24 24 22.8807 24 21.5V2.5C24 1.11929 22.8807 0 21.5 0H2.5ZM18.5547 5.76815C19.0142 6.07451 19.1384 6.69538 18.8321 7.1549L11.6321 17.9549C11.4659 18.2042 11.1967 18.3658 10.8985 18.3953C10.6004 18.4249 10.3047 18.3192 10.0929 18.1073L5.29289 13.3073C4.90237 12.9168 4.90237 12.2836 5.29289 11.8931C5.68342 11.5026 6.31658 11.5026 6.70711 11.8931L10.6446 15.8306L17.1679 6.0455C17.4743 5.58598 18.0952 5.4618 18.5547 5.76815Z" | ||
fill="black" | ||
/> | ||
</svg> | ||
); | ||
}; |
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 |
---|---|---|
@@ -1,29 +1,17 @@ | ||
import cx from 'classnames'; | ||
import styles from './checkboxIcon.module.css'; | ||
import { CheckboxCheckedIcon } from './CheckboxCheckedIcon'; | ||
import { CheckboxUncheckedIcon } from './CheckboxUncheckedIcon'; | ||
|
||
export type CheckboxIconProps = { | ||
checked: boolean; | ||
hover?: boolean; | ||
title?: string; | ||
className?: string; | ||
}; | ||
|
||
/** | ||
* Checkbox for lists and list items | ||
*/ | ||
export const CheckboxIcon = ({ checked, title, className }: CheckboxIconProps) => { | ||
return ( | ||
<div data-checked={checked} className={cx(styles.checkbox, className)}> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
strokeWidth={2.5} | ||
stroke="currentColor" | ||
className={styles.icon} | ||
> | ||
<title>{title}</title> | ||
<path strokeLinecap="round" strokeLinejoin="round" d="M4.5 12.75l6 6 9-13.5" /> | ||
</svg> | ||
</div> | ||
); | ||
export const CheckboxIcon = ({ checked, title = 'checkbox', hover = false, className }: CheckboxIconProps) => { | ||
const iconProps = { title, className }; | ||
return checked ? <CheckboxCheckedIcon {...iconProps} /> : <CheckboxUncheckedIcon {...iconProps} hover={hover} />; | ||
}; |
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,38 @@ | ||
export type CheckboxUncheckedIconProps = { | ||
title?: string; | ||
className?: string; | ||
hover?: boolean; | ||
}; | ||
|
||
/** | ||
* Checkbox for lists and list items | ||
*/ | ||
export const CheckboxUncheckedIcon = ({ title = 'Checkbox', className, hover = false }: CheckboxUncheckedIconProps) => { | ||
return ( | ||
<svg | ||
width="1em" | ||
height="1em" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
className={className} | ||
> | ||
<title>{title}</title> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M21.5 2.5H2.5V21.5H21.5V2.5ZM2.5 0C1.11929 0 0 1.11929 0 2.5V21.5C0 22.8807 1.11929 24 2.5 24H21.5C22.8807 24 24 22.8807 24 21.5V2.5C24 1.11929 22.8807 0 21.5 0H2.5Z" | ||
fill="black" | ||
/> | ||
{hover && ( | ||
<path | ||
data-hover={true} | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M18.5547 5.76815C19.0142 6.07451 19.1384 6.69538 18.8321 7.1549L11.6321 17.9549C11.4659 18.2042 11.1967 18.3658 10.8985 18.3953C10.6004 18.4249 10.3047 18.3192 10.0929 18.1073L5.29289 13.3073C4.90237 12.9168 4.90237 12.2836 5.29289 11.8931C5.68342 11.5026 6.31658 11.5026 6.70711 11.8931L10.6446 15.8306L17.1679 6.0455C17.4743 5.58598 18.0952 5.4618 18.5547 5.76815Z" | ||
fill="currentColor" | ||
/> | ||
)} | ||
</svg> | ||
); | ||
}; |
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,29 @@ | ||
export type RadioCheckedIconProps = { | ||
title?: string; | ||
className?: string; | ||
}; | ||
|
||
/** | ||
* Radio for lists and list items | ||
*/ | ||
export const RadioCheckedIcon = ({ title = 'Radio', className }: RadioCheckedIconProps) => { | ||
return ( | ||
<svg | ||
width="1em" | ||
height="1em" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
className={className} | ||
> | ||
<title>{title}</title> | ||
|
||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM12 17C14.7614 17 17 14.7614 17 12C17 9.23858 14.7614 7 12 7C9.23858 7 7 9.23858 7 12C7 14.7614 9.23858 17 12 17Z" | ||
fill="black" | ||
/> | ||
</svg> | ||
); | ||
}; |
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 |
---|---|---|
@@ -1,29 +1,17 @@ | ||
import cx from 'classnames'; | ||
import styles from './radioIcon.module.css'; | ||
import { RadioCheckedIcon } from './RadioCheckedIcon'; | ||
import { RadioUncheckedIcon } from './RadioUncheckedIcon'; | ||
|
||
export type RadioIconProps = { | ||
checked: boolean; | ||
hover?: boolean; | ||
title?: string; | ||
className?: string; | ||
}; | ||
|
||
/** | ||
* Radio icon for lists and list items | ||
* Radio for lists and list items | ||
*/ | ||
export const RadioIcon = ({ checked, title, className }: RadioIconProps) => { | ||
return ( | ||
<div data-checked={checked} className={cx(styles.radio, className)}> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
strokeWidth={2.5} | ||
stroke="currentColor" | ||
className={styles.icon} | ||
> | ||
<title>{title}</title> | ||
<circle cx="12" cy="12" r="6" fill="currentColor" /> | ||
</svg> | ||
</div> | ||
); | ||
export const RadioIcon = ({ checked, title = 'Radio', hover = false, className }: RadioIconProps) => { | ||
const iconProps = { title, className }; | ||
return checked ? <RadioCheckedIcon {...iconProps} /> : <RadioUncheckedIcon {...iconProps} hover={hover} />; | ||
}; |
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,30 @@ | ||
export type RadioUncheckedIconProps = { | ||
title?: string; | ||
className?: string; | ||
hover?: boolean; | ||
}; | ||
|
||
/** | ||
* Radio for lists and list items | ||
*/ | ||
export const RadioUncheckedIcon = ({ title = 'Radio', className, hover = false }: RadioUncheckedIconProps) => { | ||
return ( | ||
<svg | ||
width="1em" | ||
height="1em" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
className={className} | ||
> | ||
<title>{title}</title> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M12 21.5C17.2467 21.5 21.5 17.2467 21.5 12C21.5 6.75329 17.2467 2.5 12 2.5C6.75329 2.5 2.5 6.75329 2.5 12C2.5 17.2467 6.75329 21.5 12 21.5ZM12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z" | ||
fill="black" | ||
/> | ||
{hover && <circle data-hover={true} cx="12" cy="12" r="5" fill="black" />} | ||
</svg> | ||
); | ||
}; |
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