Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo * Setup prettierrc in root and remove other configs Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
// since it doesn't support React 19 and is not maintained anymore.
|
||||
// We should probably move to a different solution in the future.
|
||||
|
||||
import type { ElementType, CSSProperties, ReactElement, Ref } from 'react'
|
||||
import type { ElementType, CSSProperties, ReactElement, Ref } from "react"
|
||||
import type {
|
||||
MaterialSymbolWeight,
|
||||
PolymorphicComponentProps,
|
||||
SymbolCodepoints,
|
||||
} from './types'
|
||||
import { cx } from 'class-variance-authority'
|
||||
export type { MaterialSymbolWeight, SymbolCodepoints } from './types'
|
||||
} from "./types"
|
||||
import { cx } from "class-variance-authority"
|
||||
export type { MaterialSymbolWeight, SymbolCodepoints } from "./types"
|
||||
|
||||
export type MaterialSymbolProps = {
|
||||
/** Required. The name of the icon to render. */
|
||||
@@ -29,7 +29,7 @@ export type MaterialSymbolProps = {
|
||||
/** Default `'inherit'`
|
||||
*
|
||||
* Color accepts key values (`'red'`, `'blue'`, `'indigo'`, etc.), `<hex-color>`, `<rgb()>`, `<hsl()>` and `<hwb()>` values. */
|
||||
color?: CSSProperties['color']
|
||||
color?: CSSProperties["color"]
|
||||
className?: string
|
||||
style?: CSSProperties
|
||||
}
|
||||
@@ -54,34 +54,34 @@ export const MaterialSymbol = (<C extends ElementType>(
|
||||
ref: Ref<C>
|
||||
): ReactElement => {
|
||||
const Component =
|
||||
onClick !== undefined ? 'button' : ((as as ElementType) ?? 'span')
|
||||
onClick !== undefined ? "button" : ((as as ElementType) ?? "span")
|
||||
const style = { color, ...propStyle }
|
||||
|
||||
if (fill)
|
||||
style.fontVariationSettings = [style.fontVariationSettings, '"FILL" 1']
|
||||
.filter(Boolean)
|
||||
.join(', ')
|
||||
.join(", ")
|
||||
if (weight)
|
||||
style.fontVariationSettings = [
|
||||
style.fontVariationSettings,
|
||||
`"wght" ${weight}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(', ')
|
||||
.join(", ")
|
||||
if (grade)
|
||||
style.fontVariationSettings = [
|
||||
style.fontVariationSettings,
|
||||
`"GRAD" ${grade}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(', ')
|
||||
.join(", ")
|
||||
if (size) {
|
||||
style.fontVariationSettings = [
|
||||
style.fontVariationSettings,
|
||||
`"opsz" ${size}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(', ')
|
||||
.join(", ")
|
||||
style.fontSize = size
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ export const MaterialSymbol = (<C extends ElementType>(
|
||||
ref={ref}
|
||||
style={style}
|
||||
onClick={onClick}
|
||||
className={cx('material-symbols', className)}
|
||||
className={cx("material-symbols", className)}
|
||||
>
|
||||
{icon}
|
||||
</Component>
|
||||
|
||||
Reference in New Issue
Block a user