From 3a7c5c26011bfcffcdf6ac3451adb2af1453b9db Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Mon, 7 Oct 2024 14:57:46 +0200 Subject: [PATCH] fix(Alert): default variant to `solid` for consistency --- docs/content/3.components/alert.md | 22 +++++++++++++--- playground/app/pages/components/alert.vue | 2 +- src/theme/alert.ts | 2 +- .../__snapshots__/Alert.spec.ts.snap | 26 +++++++++---------- 4 files changed, 34 insertions(+), 18 deletions(-) diff --git a/docs/content/3.components/alert.md b/docs/content/3.components/alert.md index f09c86faf5..c7ffbe5d86 100644 --- a/docs/content/3.components/alert.md +++ b/docs/content/3.components/alert.md @@ -98,7 +98,7 @@ ignore: - icon props: color: neutral - variant: solid + variant: subtle title: 'Heads up!' description: 'You can change the primary color in your app config.' icon: 'i-heroicons-command-line' @@ -120,9 +120,13 @@ ignore: - title - description - close + - color + - variant props: title: 'Heads up!' description: 'You can change the primary color in your app config.' + color: neutral + variant: outline close: true --- :: @@ -137,9 +141,13 @@ ignore: - description - close.color - close.variant + - color + - variant props: title: 'Heads up!' description: 'You can change the primary color in your app config.' + color: neutral + variant: outline close: color: primary variant: outline @@ -158,9 +166,13 @@ ignore: - title - description - close + - color + - variant props: title: 'Heads up!' description: 'You can change the primary color in your app config.' + color: neutral + variant: outline close: true closeIcon: 'i-heroicons-arrow-right' --- @@ -180,9 +192,13 @@ prettier: true ignore: - title - actions + - color + - variant props: title: 'Heads up!' description: 'You can change the primary color in your app config.' + color: neutral + variant: outline actions: - label: Action 1 - label: Action 2 @@ -199,7 +215,7 @@ Actions renders differently when the description is not set. You can try to remo ### `class` prop -Use the `class` prop to override the base styles of the Button. +Use the `class` prop to override the base styles of the Alert. ::component-code --- @@ -216,7 +232,7 @@ props: ### `ui` prop -Use the `ui` prop to override the slots styles of the Button. +Use the `ui` prop to override the slots styles of the Alert. ::component-code --- diff --git a/playground/app/pages/components/alert.vue b/playground/app/pages/components/alert.vue index 793dc0c0c7..240056e06b 100644 --- a/playground/app/pages/components/alert.vue +++ b/playground/app/pages/components/alert.vue @@ -25,7 +25,7 @@ const data = { - + diff --git a/src/theme/alert.ts b/src/theme/alert.ts index d5b96b893b..e2a53970f2 100644 --- a/src/theme/alert.ts +++ b/src/theme/alert.ts @@ -85,6 +85,6 @@ export default (options: Required) => ({ }], defaultVariants: { color: 'primary', - variant: 'outline' + variant: 'solid' } }) diff --git a/test/components/__snapshots__/Alert.spec.ts.snap b/test/components/__snapshots__/Alert.spec.ts.snap index 4b1d0b5796..c5544947ca 100644 --- a/test/components/__snapshots__/Alert.spec.ts.snap +++ b/test/components/__snapshots__/Alert.spec.ts.snap @@ -1,7 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`Alert > renders with as correctly 1`] = ` -"
+"
Alert
@@ -13,7 +13,7 @@ exports[`Alert > renders with as correctly 1`] = ` `; exports[`Alert > renders with avatar correctly 1`] = ` -"
+"
Alert
@@ -24,7 +24,7 @@ exports[`Alert > renders with avatar correctly 1`] = ` `; exports[`Alert > renders with class correctly 1`] = ` -"
+"
Alert
@@ -36,7 +36,7 @@ exports[`Alert > renders with class correctly 1`] = ` `; exports[`Alert > renders with close correctly 1`] = ` -"
+"
Alert
@@ -51,7 +51,7 @@ exports[`Alert > renders with close correctly 1`] = ` `; exports[`Alert > renders with close slot correctly 1`] = ` -"
+"
Alert
@@ -63,7 +63,7 @@ exports[`Alert > renders with close slot correctly 1`] = ` `; exports[`Alert > renders with closeIcon correctly 1`] = ` -"
+"
Alert
@@ -78,7 +78,7 @@ exports[`Alert > renders with closeIcon correctly 1`] = ` `; exports[`Alert > renders with description correctly 1`] = ` -"
+"
Alert
@@ -90,7 +90,7 @@ exports[`Alert > renders with description correctly 1`] = ` `; exports[`Alert > renders with description slot correctly 1`] = ` -"
+"
Alert
@@ -102,7 +102,7 @@ exports[`Alert > renders with description slot correctly 1`] = ` `; exports[`Alert > renders with icon correctly 1`] = ` -"
+"
Alert
@@ -113,7 +113,7 @@ exports[`Alert > renders with icon correctly 1`] = ` `; exports[`Alert > renders with leading slot correctly 1`] = ` -"
+"
Leading slot
@@ -221,7 +221,7 @@ exports[`Alert > renders with primary variant subtle correctly 1`] = ` `; exports[`Alert > renders with title correctly 1`] = ` -"
+"
Alert
@@ -233,7 +233,7 @@ exports[`Alert > renders with title correctly 1`] = ` `; exports[`Alert > renders with title slot correctly 1`] = ` -"
+"
Title slot
@@ -245,7 +245,7 @@ exports[`Alert > renders with title slot correctly 1`] = ` `; exports[`Alert > renders with ui correctly 1`] = ` -"
+"
Alert