fix: 🐛 Fix broken Note UIs

This commit is contained in:
Jesse Wierzbinski 2025-04-10 14:48:03 +02:00
parent b6080eff60
commit ac0a571ecc
No known key found for this signature in database
20 changed files with 154 additions and 95 deletions

View file

@ -6,13 +6,14 @@ import { type AlertVariants, alertVariants } from ".";
const props = defineProps<{
class?: HTMLAttributes["class"];
variant?: AlertVariants["variant"];
layout?: AlertVariants["layout"];
}>();
</script>
<template>
<div
data-slot="alert"
:class="cn(alertVariants({ variant }), props.class)"
:class="cn(alertVariants({ variant, layout }), props.class)"
role="alert"
>
<slot />

View file

@ -10,7 +10,7 @@ const props = defineProps<{
<template>
<div
data-slot="alert-description"
:class="cn('text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed', props.class)"
:class="cn('text-muted-foreground text-sm [&_p]:leading-relaxed', props.class)"
>
<slot />
</div>

View file

@ -10,7 +10,7 @@ const props = defineProps<{
<template>
<div
data-slot="alert-title"
:class="cn('col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight', props.class)"
:class="cn('line-clamp-1 min-h-4 font-medium tracking-tight', props.class)"
>
<slot />
</div>

View file

@ -5,7 +5,7 @@ export { default as AlertDescription } from "./AlertDescription.vue";
export { default as AlertTitle } from "./AlertTitle.vue";
export const alertVariants = cva(
"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
"relative w-full rounded-lg border px-4 py-3 grid text-sm [&>svg]:size-4 [&>svg]:text-current",
{
variants: {
variant: {
@ -13,9 +13,15 @@ export const alertVariants = cva(
destructive:
"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
},
layout: {
default:
"has-[>svg]:grid-cols-[1fr_auto] grid-rows-2 gap-x-3 gap-y-1 items-start",
button: "grid-cols-[auto_1fr_auto] items-center gap-x-3 gap-y-0.5",
},
},
defaultVariants: {
variant: "default",
layout: "default",
},
},
);