-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
138 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<script setup lang="ts"> | ||
import type { HTMLAttributes } from "vue"; | ||
import { type AlertVariants, alertVariants } from "."; | ||
import { cn } from "~/utils/shadcn"; | ||
const props = defineProps<{ | ||
class?: HTMLAttributes["class"]; | ||
variant?: AlertVariants["variant"]; | ||
}>(); | ||
</script> | ||
|
||
<template> | ||
<div :class="cn(alertVariants({ variant }), props.class)" role="alert"> | ||
<slot /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<script setup lang="ts"> | ||
import type { HTMLAttributes } from "vue"; | ||
import { cn } from "~/utils/shadcn"; | ||
const props = defineProps<{ | ||
class?: HTMLAttributes["class"]; | ||
}>(); | ||
</script> | ||
|
||
<template> | ||
<div :class="cn('text-sm [&_p]:leading-relaxed', props.class)"> | ||
<slot /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<script setup lang="ts"> | ||
import type { HTMLAttributes } from "vue"; | ||
import { cn } from "~/utils/shadcn"; | ||
const props = defineProps<{ | ||
class?: HTMLAttributes["class"]; | ||
}>(); | ||
</script> | ||
|
||
<template> | ||
<h5 :class="cn('mb-1 font-bold leading-none tracking-tight', props.class)"> | ||
<slot /> | ||
</h5> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { type VariantProps, cva } from "class-variance-authority"; | ||
|
||
export { default as Alert } from "./Alert.vue"; | ||
export { default as AlertTitle } from "./AlertTitle.vue"; | ||
export { default as AlertDescription } from "./AlertDescription.vue"; | ||
|
||
export const alertVariants = cva( | ||
"relative w-full rounded-md border p-3 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", | ||
{ | ||
variants: { | ||
variant: { | ||
default: "bg-accent/30 text-foreground", | ||
destructive: | ||
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive", | ||
success: | ||
"border-success/60 bg-success/5 [&>svg]:text-success [&>h5]:text-success", | ||
info: "border-info/60 bg-info/5 [&>svg]:text-info [&>h5]:text-info" | ||
} | ||
}, | ||
defaultVariants: { | ||
variant: "default" | ||
} | ||
} | ||
); | ||
|
||
export type AlertVariants = VariantProps<typeof alertVariants>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters