mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-11 21:28:59 +00:00
fix: rename variants
This commit is contained in:
@@ -29,10 +29,10 @@ export const Warning: Story = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Destructive: Story = {
|
export const Danger: Story = {
|
||||||
args: {
|
args: {
|
||||||
children: <ExampleComponent />,
|
children: <ExampleComponent />,
|
||||||
variant: "destructive"
|
variant: "danger"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/* eslint-disable react/prop-types */
|
import { forwardRef } from "react";
|
||||||
import * as React from "react";
|
|
||||||
import {
|
import {
|
||||||
faExclamationCircle,
|
faExclamationCircle,
|
||||||
faExclamationTriangle,
|
faExclamationTriangle,
|
||||||
@@ -15,7 +14,7 @@ const alertVariants = cva(
|
|||||||
variants: {
|
variants: {
|
||||||
variant: {
|
variant: {
|
||||||
default: "",
|
default: "",
|
||||||
destructive: "text-red border-red",
|
danger: "text-red border-red",
|
||||||
warning: "text-yellow border-yellow"
|
warning: "text-yellow border-yellow"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -33,17 +32,17 @@ type AlertProps = {
|
|||||||
|
|
||||||
const variantTitleMap = {
|
const variantTitleMap = {
|
||||||
default: "Info",
|
default: "Info",
|
||||||
destructive: "Danger",
|
danger: "Danger",
|
||||||
warning: "Warning"
|
warning: "Warning"
|
||||||
};
|
};
|
||||||
|
|
||||||
const variantIconMap = {
|
const variantIconMap = {
|
||||||
default: faInfoCircle,
|
default: faInfoCircle,
|
||||||
destructive: faExclamationCircle,
|
danger: faExclamationCircle,
|
||||||
warning: faExclamationTriangle
|
warning: faExclamationTriangle
|
||||||
};
|
};
|
||||||
|
|
||||||
const Alert = React.forwardRef<
|
const Alert = forwardRef<
|
||||||
HTMLDivElement,
|
HTMLDivElement,
|
||||||
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants> & AlertProps
|
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants> & AlertProps
|
||||||
>(({ className, variant, title, icon, hideTitle = false, children, ...props }, ref) => {
|
>(({ className, variant, title, icon, hideTitle = false, children, ...props }, ref) => {
|
||||||
@@ -75,7 +74,7 @@ const Alert = React.forwardRef<
|
|||||||
});
|
});
|
||||||
Alert.displayName = "Alert";
|
Alert.displayName = "Alert";
|
||||||
|
|
||||||
const AlertDescription = React.forwardRef<
|
const AlertDescription = forwardRef<
|
||||||
HTMLParagraphElement,
|
HTMLParagraphElement,
|
||||||
React.HTMLAttributes<HTMLParagraphElement>
|
React.HTMLAttributes<HTMLParagraphElement>
|
||||||
>(({ className, ...props }, ref) => (
|
>(({ className, ...props }, ref) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user