mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-26 12:29:06 +01:00
c5368c152b
* added storybook test runner * added test runner in ci * updated test for ci and fixed lint error * updated lavamoat policy * updated test command * updated playwright * changed command to storybook;ci * updated command * updated instance for test-storybook * updated playwright * added playwright step * replaced concurrently with start-server-and-test * updated the static storybook directory * replaced first with last * updated lock file * replaced first with last * updated test-storybook with maxworkers * updated .depchechrc * updated yml * removed id from banner base * replaced broken stories with .stories-to-do.js extesnsion * updated token allowance story * removed duplicacies from yarn * fixed lavamoat * removed filename comment * updated links for docs * fixed file extension for stories * updated path for stories.json * updated stories.json path * yarn updated * updated stories * updated yarn * updated wait on |
||
---|---|---|
.. | ||
__snapshots__ | ||
avatar-base.constants.js | ||
avatar-base.js | ||
avatar-base.scss | ||
avatar-base.stories.js | ||
avatar-base.test.js | ||
index.js | ||
README.mdx |
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'; import { AvatarBase } from './avatar-base'; ### This is a base component. It should not be used in your feature code directly but as a "base" for other UI components # AvatarBase The `AvatarBase` is a wrapper component responsible for enforcing dimensions and border radius for Avatar components <Canvas> <Story id="components-componentlibrary-avatarbase--default-story" /> </Canvas> ## Props The `AvatarBase` accepts all props below as well as all [Box](/docs/components-ui-box--default-story#props) component props. <ArgsTable of={AvatarBase} /> ### Size Use the `size` prop to set the size of the `AvatarBase`. Possible sizes include: - `xs` 16px - `sm` 24px - `md` 32px - `lg` 40px - `xl` 48px Defaults to `md` <Canvas> <Story id="components-componentlibrary-avatarbase--size" /> </Canvas> ```jsx import { AVATAR_BASE_SIZES } from '../ui/component-library/avatar-base'; import { AvatarBase } from '../../component-library'; <AvatarBase size={AVATAR_BASE_SIZES.XS} /> <AvatarBase size={AVATAR_BASE_SIZES.SM} /> <AvatarBase size={AVATAR_BASE_SIZES.MD} /> <AvatarBase size={AVATAR_BASE_SIZES.LG} /> <AvatarBase size={AVATAR_BASE_SIZES.XL} /> ``` ### Children The `AvatarBase` component can contain images, icons or text <Canvas> <Story id="components-componentlibrary-avatarbase--children" /> </Canvas> ```jsx import { AvatarBase } from '../../component-library'; <AvatarBase> <img src="./images/eth_logo.svg" /> </AvatarBase> <AvatarBase> <img width="100%" src="./images/arbitrum.svg" /> </AvatarBase> <AvatarBase> <img width="100%" src="./images/avax-token.png" /> </AvatarBase> <AvatarBase>A</AvatarBase> ``` ### Color, Background Color And Border Color Use the `color`, `backgroundColor` and `borderColor` props to set the text color, background-color and border-color of the `AvatarBase`. <Canvas> <Story id="components-componentlibrary-avatarbase--color-background-color-and-border-color" /> </Canvas> ```jsx import { COLORS } from '../../../helpers/constants/design-system'; import { AvatarBase } from '../../component-library'; <AvatarBase>B</AvatarBase> <AvatarBase backgroundColor={COLORS.GOERLI} borderColor={COLORS.GOERLI} color={COLORS.PRIMARY_INVERSE} > G </AvatarBase> <AvatarBase backgroundColor={COLORS.SEPOLIA} borderColor={COLORS.SEPOLIA} color={COLORS.PRIMARY_INVERSE} > S </AvatarBase> ```