From cbd58ee7071ab7989a99400617077075988923cc Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Fri, 12 Apr 2024 18:37:32 +0200 Subject: [PATCH] chore(Toast): improve progress bar --- src/theme/toast.ts | 6 +-- .../__snapshots__/Toast.spec.ts.snap | 50 +++++++++---------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/theme/toast.ts b/src/theme/toast.ts index 24874879..b33a1043 100644 --- a/src/theme/toast.ts +++ b/src/theme/toast.ts @@ -7,13 +7,13 @@ export default (config: { colors: string[] }) => ({ icon: 'shrink-0 size-5', avatar: 'shrink-0', actions: 'flex gap-1.5 shrink-0', - progress: 'absolute inset-0 border-b-2 z-[-1]', - close: 'p-1' + progress: 'absolute inset-x-0 bottom-0 h-1 z-[-1]', + close: 'p-0' }, variants: { color: Object.fromEntries(config.colors.map((color: string) => [color, { icon: `text-${color}-500 dark:text-${color}-400`, - progress: `border-${color}-500 dark:border-${color}-400` + progress: `bg-${color}-500 dark:bg-${color}-400` }])), multiline: { true: { diff --git a/test/components/__snapshots__/Toast.spec.ts.snap b/test/components/__snapshots__/Toast.spec.ts.snap index 368ac18c..59f0284b 100644 --- a/test/components/__snapshots__/Toast.spec.ts.snap +++ b/test/components/__snapshots__/Toast.spec.ts.snap @@ -13,15 +13,15 @@ exports[`Toast > renders with actions correctly 1`] = ` -
-
+
" @@ -39,12 +39,12 @@ exports[`Toast > renders with avatar correctly 1`] = ` -
-
+
" @@ -63,12 +63,12 @@ exports[`Toast > renders with class correctly 1`] = ` -
-
+
" @@ -87,12 +87,12 @@ exports[`Toast > renders with color correctly 1`] = ` -
-
+
" @@ -109,19 +109,19 @@ exports[`Toast > renders with description actions correctly 1`] = `
Toast
This is a toast
-
-
-
+
" @@ -140,12 +140,12 @@ exports[`Toast > renders with description correctly 1`] = `
This is a toast
-
-
+
" @@ -164,12 +164,12 @@ exports[`Toast > renders with icon correctly 1`] = ` -
-
+
" @@ -189,13 +189,13 @@ exports[`Toast > renders with title & description correctly 1`] = `
-
-
+
" @@ -214,12 +214,12 @@ exports[`Toast > renders with title correctly 1`] = ` -
-
+
" @@ -238,12 +238,12 @@ exports[`Toast > renders with type correctly 1`] = ` -
-
+
" @@ -262,12 +262,12 @@ exports[`Toast > renders with ui correctly 1`] = ` -
-
+
" @@ -287,7 +287,7 @@ exports[`Toast > renders without close correctly 1`] = ` -
+
"