mirror of
https://github.com/apache/superset.git
synced 2026-08-04 13:02:41 +00:00
feat(build): migrate from Prettier to Oxfmt for performant code formatting (#42434)
This commit is contained in:
@@ -33,65 +33,58 @@ The Avatar component from Superset's UI library.
|
||||
<StoryWithControls
|
||||
component="Avatar"
|
||||
props={{
|
||||
children: "AB",
|
||||
alt: "",
|
||||
gap: 4,
|
||||
shape: "circle",
|
||||
size: "default",
|
||||
src: "",
|
||||
draggable: false
|
||||
}}
|
||||
children: 'AB',
|
||||
alt: '',
|
||||
gap: 4,
|
||||
shape: 'circle',
|
||||
size: 'default',
|
||||
src: '',
|
||||
draggable: false,
|
||||
}}
|
||||
controls={[
|
||||
{
|
||||
name: "children",
|
||||
label: "Children",
|
||||
type: "text",
|
||||
description: "Text or initials to display inside the avatar."
|
||||
},
|
||||
{
|
||||
name: "alt",
|
||||
label: "Alt",
|
||||
type: "text"
|
||||
},
|
||||
{
|
||||
name: "gap",
|
||||
label: "Gap",
|
||||
type: "number",
|
||||
description: "Letter spacing inside the avatar."
|
||||
},
|
||||
{
|
||||
name: "shape",
|
||||
label: "Shape",
|
||||
type: "select",
|
||||
options: [
|
||||
"circle",
|
||||
"square"
|
||||
],
|
||||
description: "The shape of the avatar."
|
||||
},
|
||||
{
|
||||
name: "size",
|
||||
label: "Size",
|
||||
type: "select",
|
||||
options: [
|
||||
"small",
|
||||
"default",
|
||||
"large"
|
||||
],
|
||||
description: "The size of the avatar."
|
||||
},
|
||||
{
|
||||
name: "src",
|
||||
label: "Src",
|
||||
type: "text",
|
||||
description: "Image URL for the avatar. If provided, overrides children."
|
||||
},
|
||||
{
|
||||
name: "draggable",
|
||||
label: "Draggable",
|
||||
type: "boolean"
|
||||
}
|
||||
]}
|
||||
{
|
||||
name: 'children',
|
||||
label: 'Children',
|
||||
type: 'text',
|
||||
description: 'Text or initials to display inside the avatar.',
|
||||
},
|
||||
{
|
||||
name: 'alt',
|
||||
label: 'Alt',
|
||||
type: 'text',
|
||||
},
|
||||
{
|
||||
name: 'gap',
|
||||
label: 'Gap',
|
||||
type: 'number',
|
||||
description: 'Letter spacing inside the avatar.',
|
||||
},
|
||||
{
|
||||
name: 'shape',
|
||||
label: 'Shape',
|
||||
type: 'select',
|
||||
options: ['circle', 'square'],
|
||||
description: 'The shape of the avatar.',
|
||||
},
|
||||
{
|
||||
name: 'size',
|
||||
label: 'Size',
|
||||
type: 'select',
|
||||
options: ['small', 'default', 'large'],
|
||||
description: 'The size of the avatar.',
|
||||
},
|
||||
{
|
||||
name: 'src',
|
||||
label: 'Src',
|
||||
type: 'text',
|
||||
description: 'Image URL for the avatar. If provided, overrides children.',
|
||||
},
|
||||
{
|
||||
name: 'draggable',
|
||||
label: 'Draggable',
|
||||
type: 'boolean',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
## Try It
|
||||
@@ -101,13 +94,7 @@ Edit the code below to experiment with the component:
|
||||
```tsx live
|
||||
function Demo() {
|
||||
return (
|
||||
<Avatar
|
||||
alt=""
|
||||
gap={4}
|
||||
shape="circle"
|
||||
size="default"
|
||||
src=""
|
||||
>
|
||||
<Avatar alt="" gap={4} shape="circle" size="default" src="">
|
||||
AB
|
||||
</Avatar>
|
||||
);
|
||||
@@ -116,15 +103,15 @@ function Demo() {
|
||||
|
||||
## Props
|
||||
|
||||
| Prop | Type | Default | Description |
|
||||
|------|------|---------|-------------|
|
||||
| `children` | `string` | `"AB"` | Text or initials to display inside the avatar. |
|
||||
| `alt` | `string` | `""` | - |
|
||||
| `gap` | `number` | `4` | Letter spacing inside the avatar. |
|
||||
| `shape` | `string` | `"circle"` | The shape of the avatar. |
|
||||
| `size` | `string` | `"default"` | The size of the avatar. |
|
||||
| `src` | `string` | `""` | Image URL for the avatar. If provided, overrides children. |
|
||||
| `draggable` | `boolean` | `false` | - |
|
||||
| Prop | Type | Default | Description |
|
||||
| ----------- | --------- | ----------- | ---------------------------------------------------------- |
|
||||
| `children` | `string` | `"AB"` | Text or initials to display inside the avatar. |
|
||||
| `alt` | `string` | `""` | - |
|
||||
| `gap` | `number` | `4` | Letter spacing inside the avatar. |
|
||||
| `shape` | `string` | `"circle"` | The shape of the avatar. |
|
||||
| `size` | `string` | `"default"` | The size of the avatar. |
|
||||
| `src` | `string` | `""` | Image URL for the avatar. If provided, overrides children. |
|
||||
| `draggable` | `boolean` | `false` | - |
|
||||
|
||||
## Import
|
||||
|
||||
|
||||
Reference in New Issue
Block a user