Skip to content
Snippets Groups Projects

refactor(colors)!: merge color props under common prop

Merged Kasper Seweryn requested to merge merge-boolean-props into main
14 files
+ 94
124
Compare changes
  • Side-by-side
  • Inline
Files
14
@@ -6,17 +6,15 @@ const click = () => new Promise(resolve => setTimeout(resolve, 1000))
@@ -6,17 +6,15 @@ const click = () => new Promise(resolve => setTimeout(resolve, 1000))
Buttons are UI elements that users can interact with to perform actions. Funkwhale uses buttons in many contexts.
Buttons are UI elements that users can interact with to perform actions. Funkwhale uses buttons in many contexts.
| Prop | Data type | Required? | Description |
| Prop | Data type | Required? | Default | Description |
| ------------- | --------- | --------- | -------------------------------------------------- |
| ------------- | ----------------------------------------- | --------- | --------- | -------------------------------------------------- |
| `outline` | Boolean | No | Whether to render the button as an outline button. |
| `outline` | Boolean | No | `false` | Whether to render the button as an outline button. |
| `shadow` | Boolean | No | Whether to render the button with a shadow |
| `shadow` | Boolean | No | `false` | Whether to render the button with a shadow |
| `round` | Boolean | No | Whether to render the button as a round button |
| `round` | Boolean | No | `false` | Whether to render the button as a round button |
| `icon` | String | No | The icon attached to the button |
| `icon` | String | No | | The icon attached to the button |
| `is-active` | Boolean | No | Whether the button is in an active state |
| `is-active` | Boolean | No | `false` | Whether the button is in an active state |
| `is-loading` | Boolean | No | Whether the button is in a loading state |
| `is-loading` | Boolean | No | `false` | Whether the button is in a loading state |
| `primary` | Boolean | No | Renders a primary button |
| `color` | `primary` \| `secondary` \| `destructive` | No | `primary` | Renders a colored button |
| `secondary` | Boolean | No | Renders a secondary button |
| `destructive` | Boolean | No | Renders a destructive button |
## Button types
## Button types
@@ -45,12 +43,12 @@ This is the default type. If you don't specify a type, a primary button is rende
@@ -45,12 +43,12 @@ This is the default type. If you don't specify a type, a primary button is rende
Secondary buttons represent **neutral** actions such as cancelling a change or dismissing a notification.
Secondary buttons represent **neutral** actions such as cancelling a change or dismissing a notification.
```vue-html
```vue-html
<fw-button secondary>
<fw-button color="secondary">
Secondary button
Secondary button
</fw-button>
</fw-button>
```
```
<fw-button secondary>
<fw-button color="secondary">
Secondary button
Secondary button
</fw-button>
</fw-button>
@@ -59,12 +57,12 @@ Secondary buttons represent **neutral** actions such as cancelling a change or d
@@ -59,12 +57,12 @@ Secondary buttons represent **neutral** actions such as cancelling a change or d
Desctrutive buttons represent **dangerous** actions including deleting items or purging domain information.
Desctrutive buttons represent **dangerous** actions including deleting items or purging domain information.
```vue-html
```vue-html
<fw-button destructive>
<fw-button color="destructive">
Destructive button
Destructive button
</fw-button>
</fw-button>
```
```
<fw-button destructive>
<fw-button color="destructive">
Destructive button
Destructive button
</fw-button>
</fw-button>
@@ -243,20 +241,20 @@ Icon buttons shrink down to the icon size if you don't pass any content. If you
@@ -243,20 +241,20 @@ Icon buttons shrink down to the icon size if you don't pass any content. If you
:::
:::
```vue-html
```vue-html
<fw-button secondary icon="bi-three-dots-vertical" />
<fw-button color="secondary" icon="bi-three-dots-vertical" />
<fw-button secondary is-round icon="bi-x" />
<fw-button color="secondary" is-round icon="bi-x" />
<fw-button icon="bi-save">&nbsp;</fw-button>
<fw-button icon="bi-save">&nbsp;</fw-button>
<fw-button destructive icon="bi-trash">
<fw-button color="destructive" icon="bi-trash">
Delete
Delete
</fw-button>
</fw-button>
```
```
<fw-button secondary icon="bi-three-dots-vertical" />
<fw-button color="secondary" icon="bi-three-dots-vertical" />
<fw-button secondary round icon="bi-x" />
<fw-button color="secondary" round icon="bi-x" />
<fw-button icon="bi-save">&nbsp;</fw-button>
<fw-button icon="bi-save">&nbsp;</fw-button>
<fw-button destructive icon="bi-trash">
<fw-button color="destructive" icon="bi-trash">
Delete
Delete
</fw-button>
</fw-button>
Loading