From cc5fa7707dd33146b68dcc3c79f4608ecbb4e723 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ja=CC=81n=20Mikla=CC=81s=CC=8C?=
Date: Tue, 20 Apr 2021 15:37:53 +0200
Subject: [PATCH] Add destructive variant to
+
@@ -54,6 +61,12 @@ export const WithoutIcons = () => (
>
Tertiary button
+
@@ -74,6 +87,12 @@ export const WithoutIcons = () => (
>
Tertiary button
+
@@ -94,6 +113,12 @@ export const WithoutIcons = () => (
>
Tertiary button
+
@@ -119,6 +144,13 @@ export const WithoutIcons = () => (
>
Tertiary button
+
>
diff --git a/assets/js/src/common/button/_stories/button_icons.tsx b/assets/js/src/common/button/_stories/button_icons.tsx
index 8de40c773c..5985d1555f 100644
--- a/assets/js/src/common/button/_stories/button_icons.tsx
+++ b/assets/js/src/common/button/_stories/button_icons.tsx
@@ -41,6 +41,14 @@ export const WithIcons = () => (
variant="tertiary"
iconStart={icon}
/>
+
@@ -70,6 +78,13 @@ export const WithIcons = () => (
variant="tertiary"
iconStart={icon}
/>
+
@@ -99,6 +114,13 @@ export const WithIcons = () => (
variant="tertiary"
iconStart={icon}
/>
+
@@ -128,6 +150,13 @@ export const WithIcons = () => (
variant="tertiary"
iconStart={icon}
/>
+
@@ -161,6 +190,14 @@ export const WithIcons = () => (
variant="tertiary"
iconStart={icon}
/>
+
>
diff --git a/assets/js/src/common/button/button.tsx b/assets/js/src/common/button/button.tsx
index f76006b65d..89f49fa3d3 100644
--- a/assets/js/src/common/button/button.tsx
+++ b/assets/js/src/common/button/button.tsx
@@ -4,7 +4,7 @@ import classnames from 'classnames';
interface Props extends React.ButtonHTMLAttributes {
children?: React.ReactNode;
dimension?: 'small';
- variant?: 'secondary' | 'tertiary';
+ variant?: 'secondary' | 'tertiary' | 'destructive';
withSpinner?: boolean; // also disables href and onClick (via pointer-events in CSS)
isDisabled?: boolean; // also disables href and onClick (via pointer-events in CSS)
isFullWidth?: boolean;