-
Notifications
You must be signed in to change notification settings - Fork 15
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
Showing
6 changed files
with
85 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
'@toptal/picasso-icons': minor | ||
'@toptal/picasso-avatar': patch | ||
--- | ||
|
||
### Icons | ||
|
||
- add `LogoNoTrademark` icon | ||
|
||
### Avatar | ||
|
||
- fix icon sizes to match Base design |
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,65 @@ | ||
import type { Ref } from 'react' | ||
import React, { forwardRef } from 'react' | ||
import cx from 'classnames' | ||
import { makeStyles } from '@material-ui/core/styles' | ||
import type { StandardProps } from '@toptal/picasso-shared' | ||
import { kebabToCamelCase } from '@toptal/picasso-utils' | ||
|
||
import styles from './styles' | ||
const BASE_SIZE = 16 | ||
|
||
type ScaleType = 1 | 2 | 3 | 4 | ||
export interface Props extends StandardProps { | ||
scale?: ScaleType | ||
color?: string | ||
base?: number | ||
} | ||
const useStyles = makeStyles(styles, { | ||
name: 'PicassoSvgLogoNoTrademark', | ||
}) | ||
const SvgLogoNoTrademark = forwardRef(function SvgLogoNoTrademark( | ||
props: Props, | ||
ref: Ref<SVGSVGElement> | ||
) { | ||
const { | ||
className, | ||
style = {}, | ||
color, | ||
scale, | ||
base, | ||
'data-testid': testId, | ||
} = props | ||
const classes: Record<string, string> = useStyles(props) | ||
const classNames = [classes.root, className] | ||
const scaledSize = base || BASE_SIZE * Math.ceil(scale || 1) | ||
const colorClassName = kebabToCamelCase(`${color}`) | ||
|
||
if (classes[colorClassName]) { | ||
classNames.push(classes[colorClassName]) | ||
} | ||
|
||
const svgStyle = { | ||
minWidth: `${scaledSize}px`, | ||
minHeight: `${scaledSize}px`, | ||
...style, | ||
} | ||
|
||
return ( | ||
<svg | ||
fill='none' | ||
viewBox='0 0 9 13' | ||
className={cx(...classNames)} | ||
style={svgStyle} | ||
ref={ref} | ||
data-testid={testId} | ||
> | ||
<path | ||
fillRule='evenodd' | ||
d='m3.125 1.2-.603.596.884.883.883.884-1.942 1.919A235.688 235.688 0 0 0 .408 7.409c.003.005 1.178 1.175 2.613 2.601l2.608 2.593.137-.133.598-.59.461-.457-.891-.893-.891-.893 1.95-1.927 1.951-1.927-1.836-1.827C6.099 2.952 4.925 1.786 4.5 1.367L3.728.604l-.603.596m2.359 3.697c.062.026.835.776.887.861.04.065.042.127.007.192-.014.026-.552.568-1.195 1.204-.839.829-1.183 1.16-1.22 1.172-.115.038-.127.03-.578-.419a8.41 8.41 0 0 1-.439-.455.23.23 0 0 1 0-.189c.012-.022.547-.562 1.191-1.198C5.41 4.804 5.362 4.846 5.484 4.897' | ||
/> | ||
</svg> | ||
) | ||
}) | ||
|
||
SvgLogoNoTrademark.displayName = 'SvgLogoNoTrademark' | ||
export default SvgLogoNoTrademark |
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.