index.ts 1.0 KB

1234567891011121314151617181920212223242526
  1. import type { VariantProps } from "class-variance-authority"
  2. import { cva } from "class-variance-authority"
  3. export { default as Alert } from "./Alert.vue"
  4. export { default as AlertDescription } from "./AlertDescription.vue"
  5. export { default as AlertTitle } from "./AlertTitle.vue"
  6. export const alertVariants = cva(
  7. "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",
  8. {
  9. variants: {
  10. variant: {
  11. default: "bg-card text-card-foreground",
  12. positive:
  13. "text-positive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-positive/90",
  14. destructive:
  15. "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
  16. },
  17. },
  18. defaultVariants: {
  19. variant: "default",
  20. },
  21. },
  22. )
  23. export type AlertVariants = VariantProps<typeof alertVariants>