Files
web/packages/design-system/lib/components/Icons/MaterialIcon/MaterialIcon.tsx
Joakim Jäderberg f531c7a49f Merged in feature/storybook-tests (pull request #2623)
Feature/storybook tests

* feature: add interaction tests for storybook and upgrade storybook@9

* add a11y testing for storybook

* Merge branch 'master' of bitbucket.org:scandic-swap/web into feature/storybook-tests

* Test and build only required packages

* .

* .

* .

* .

* .

* .

* .

* disable playwright tests in netlify ci

* .

* debug out process.env

* don't run playwright on CI

* remove unused netlify-plugin-playwright-cache

* .

* .

* .

* .

* .

* .

* remove turbo dependancy to design-system#test

* merge

* merge


Approved-by: Anton Gunnarsson
2025-08-14 06:25:08 +00:00

34 lines
917 B
TypeScript

import { MaterialSymbol, type MaterialSymbolProps } from './MaterialSymbol'
import { iconVariants } from '../variants'
import type { VariantProps } from 'class-variance-authority'
export interface MaterialIconProps
extends Pick<MaterialSymbolProps, 'size' | 'icon' | 'className' | 'style'>,
VariantProps<typeof iconVariants> {
isFilled?: boolean
}
export type MaterialIconSetIconProps = Omit<MaterialIconProps, 'icon'>
export function MaterialIcon({
color,
size = 24,
className,
isFilled = false,
...props
}: MaterialIconProps) {
const classNames = iconVariants({ className, color })
return (
// The span is used to prevent the MaterialSymbol from being underlined when used inside a link or button
<span>
<MaterialSymbol
className={classNames}
data-testid="MaterialIcon"
size={size}
{...props}
fill={isFilled}
/>
</span>
)
}