|
| 1 | +import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks'; |
| 2 | +import { Avatar } from '@ui5/webcomponents-react/lib/Avatar'; |
| 3 | +import { AvatarBackgroundColor } from '@ui5/webcomponents-react/lib/AvatarBackgroundColor'; |
| 4 | +import '@ui5/webcomponents-icons/dist/icons/employee.js'; |
| 5 | +import { Icon } from '@ui5/webcomponents-react/lib/Icon'; |
| 6 | +import { AvatarFitType } from '@ui5/webcomponents-react/lib/AvatarFitType'; |
| 7 | +import { AvatarShape } from '@ui5/webcomponents-react/lib/AvatarShape'; |
| 8 | +import { AvatarSize } from '@ui5/webcomponents-react/lib/AvatarSize'; |
| 9 | +import { CSSProperties, Ref } from 'react'; |
| 10 | + |
| 11 | +import { createSelectArgTypes } from '@shared/stories/createSelectArgTypes'; |
| 12 | +import { DocsHeader } from '@shared/stories/DocsHeader'; |
| 13 | + |
| 14 | +<Meta |
| 15 | + title="UI5 Web Components / Avatar" |
| 16 | + component={Avatar} |
| 17 | + argTypes={{ |
| 18 | + ...createSelectArgTypes({ |
| 19 | + backgroundColor: AvatarBackgroundColor, |
| 20 | + imageFitType: AvatarFitType, |
| 21 | + shape: AvatarShape, |
| 22 | + size: AvatarSize |
| 23 | + }), |
| 24 | + slot: { control: { disable: true } }, |
| 25 | + ref: { control: { disable: true } }, |
| 26 | + style: { |
| 27 | + type: CSSProperties, |
| 28 | + description: |
| 29 | + 'Element style which will be appended to the most outer element of a component. Use this prop carefully, some css properties might break the component.' |
| 30 | + }, |
| 31 | + className: { |
| 32 | + type: 'string', |
| 33 | + description: |
| 34 | + 'CSS Class Name which will be appended to the most outer element of a component. Use this prop carefully, overwriting CSS rules might break the component.' |
| 35 | + }, |
| 36 | + tooltip: { type: 'string', description: 'A tooltip which will be shown on hover' } |
| 37 | + }} |
| 38 | + args={{ |
| 39 | + backgroundColor: AvatarBackgroundColor.Accent6, |
| 40 | + icon: 'employee', |
| 41 | + imageFitType: AvatarFitType.Cover, |
| 42 | + shape: AvatarShape.Circle, |
| 43 | + size: AvatarSize.S, |
| 44 | + style: {}, |
| 45 | + className: '', |
| 46 | + tooltip: '', |
| 47 | + slot: '', |
| 48 | + ref: null |
| 49 | + }} |
| 50 | +/> |
| 51 | + |
| 52 | +<DocsHeader /> |
| 53 | + |
| 54 | +<Canvas> |
| 55 | + <Story name="Default"> |
| 56 | + {(args) => { |
| 57 | + return <Avatar {...args} />; |
| 58 | + }} |
| 59 | + </Story> |
| 60 | +</Canvas> |
| 61 | + |
| 62 | +<ArgsTable story="." /> |
0 commit comments