@brainfish-ai/components 0.15.1 → 0.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/alert.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/dist/types';
|
|
2
|
+
import * as React_2 from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
export declare const Alert: React_2.ForwardRefExoticComponent<Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
6
|
+
variant?: "default" | "success" | "danger" | "warning" | "info" | null | undefined;
|
|
7
|
+
} & ClassProp) | undefined) => string>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
|
|
9
|
+
export declare function AlertCloseButton({ className, ...props }: React_2.ComponentProps<"button">): React_2.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export declare const AlertDescription: React_2.ForwardRefExoticComponent<Omit<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
|
|
13
|
+
export declare const AlertTitle: React_2.ForwardRefExoticComponent<Omit<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & React_2.RefAttributes<HTMLHeadingElement>>;
|
|
14
|
+
|
|
15
|
+
export { }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const Alert: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
4
|
+
variant?: "default" | "success" | "danger" | "warning" | "info" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const AlertTitle: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
7
|
+
declare const AlertDescription: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare function AlertCloseButton({ className, ...props }: React.ComponentProps<"button">): React.JSX.Element;
|
|
9
|
+
export { Alert, AlertTitle, AlertDescription, AlertCloseButton };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from './button.js';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { c as cn } from '../../chunks/utils.DaMF_LVC.js';
|
|
5
|
+
|
|
6
|
+
const alertVariants = cva(
|
|
7
|
+
"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:has-[>[data-slot=alert-close-button]]:grid-cols-[auto_1fr_auto] has-[>svg]:grid-cols-[auto_1fr] has-[>[data-slot=alert-close-button]]:grid-cols-[0_1fr_auto] 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 has-[>[data-slot=alert-close-button]]:pr-2 [&:has([data-slot=alert-title])_[data-slot=alert-description]]:row-start-2",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-card text-card-foreground",
|
|
12
|
+
danger: "border-red bg-red-100 text-dark [&>svg]:text-red",
|
|
13
|
+
success: "border-green bg-green-100 text-dark [&>svg]:text-green",
|
|
14
|
+
warning: "border-yellow bg-yellow-100 text-dark [&>svg]:text-yellow",
|
|
15
|
+
info: "border-blue bg-blue-100 text-dark [&>svg]:text-blue"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
variant: "default"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
const Alert = React.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
ref,
|
|
27
|
+
"data-slot": "alert",
|
|
28
|
+
role: "alert",
|
|
29
|
+
className: cn(alertVariants({ variant }), className),
|
|
30
|
+
...props
|
|
31
|
+
}
|
|
32
|
+
));
|
|
33
|
+
Alert.displayName = "Alert";
|
|
34
|
+
const AlertTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
35
|
+
"h5",
|
|
36
|
+
{
|
|
37
|
+
ref,
|
|
38
|
+
"data-slot": "alert-title",
|
|
39
|
+
className: cn(
|
|
40
|
+
"col-start-2 row-start-1 line-clamp-1 min-h-4 font-medium tracking-tight",
|
|
41
|
+
className
|
|
42
|
+
),
|
|
43
|
+
...props
|
|
44
|
+
}
|
|
45
|
+
));
|
|
46
|
+
AlertTitle.displayName = "AlertTitle";
|
|
47
|
+
const AlertDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
ref,
|
|
51
|
+
"data-slot": "alert-description",
|
|
52
|
+
className: cn(
|
|
53
|
+
"text-card-foreground/70 col-start-2 row-start-1 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
54
|
+
className
|
|
55
|
+
),
|
|
56
|
+
...props
|
|
57
|
+
}
|
|
58
|
+
));
|
|
59
|
+
AlertDescription.displayName = "AlertDescription";
|
|
60
|
+
function AlertCloseButton({ className, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ React.createElement(
|
|
62
|
+
Button,
|
|
63
|
+
{
|
|
64
|
+
"data-slot": "alert-close-button",
|
|
65
|
+
variant: "ghost",
|
|
66
|
+
size: "sm",
|
|
67
|
+
className: cn("col-start-3 row-start-1 row-end-3 self-start p-2 relative -top-1", className),
|
|
68
|
+
...props
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { Alert, AlertCloseButton, AlertDescription, AlertTitle };
|
|
74
|
+
//# sourceMappingURL=alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.js","sources":["../../../../src/components/ui/alert.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Button } from \"./button\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst alertVariants = cva(\n \"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:has-[>[data-slot=alert-close-button]]:grid-cols-[auto_1fr_auto] has-[>svg]:grid-cols-[auto_1fr] has-[>[data-slot=alert-close-button]]:grid-cols-[0_1fr_auto] 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 has-[>[data-slot=alert-close-button]]:pr-2 [&:has([data-slot=alert-title])_[data-slot=alert-description]]:row-start-2\",\n {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground\",\n danger:\n \"border-red bg-red-100 text-dark [&>svg]:text-red\",\n success:\n \"border-green bg-green-100 text-dark [&>svg]:text-green\",\n warning:\n \"border-yellow bg-yellow-100 text-dark [&>svg]:text-yellow\",\n info:\n \"border-blue bg-blue-100 text-dark [&>svg]:text-blue\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nconst Alert = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & VariantProps<typeof alertVariants>\n>(({ className, variant, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"alert\"\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n))\nAlert.displayName = \"Alert\"\n\nconst AlertTitle = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentProps<\"h5\">\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n data-slot=\"alert-title\"\n className={cn(\n \"col-start-2 row-start-1 line-clamp-1 min-h-4 font-medium tracking-tight\",\n className\n )}\n {...props}\n />\n))\nAlertTitle.displayName = \"AlertTitle\"\n\nconst AlertDescription = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"alert-description\"\n className={cn(\n \"text-card-foreground/70 col-start-2 row-start-1 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed\",\n className\n )}\n {...props}\n />\n))\nAlertDescription.displayName = \"AlertDescription\"\n\nfunction AlertCloseButton({ className, ...props }: React.ComponentProps<\"button\">) {\n return (\n <Button\n data-slot=\"alert-close-button\"\n variant=\"ghost\"\n size=\"sm\"\n className={cn(\"col-start-3 row-start-1 row-end-3 self-start p-2 relative -top-1\", className)}\n {...props}\n />\n )\n}\n\nexport { Alert, AlertTitle, AlertDescription, AlertCloseButton }\n"],"names":[],"mappings":";;;;;AAMA,MAAM,aAAgB,GAAA,GAAA;AAAA,EACpB,+cAAA;AAAA,EACA;AAAA,IACE,QAAU,EAAA;AAAA,MACR,OAAS,EAAA;AAAA,QACP,OAAS,EAAA,8BAAA;AAAA,QACT,MACE,EAAA,kDAAA;AAAA,QACF,OACE,EAAA,wDAAA;AAAA,QACF,OACE,EAAA,2DAAA;AAAA,QACF,IACE,EAAA;AAAA;AACJ,KACF;AAAA,IACA,eAAiB,EAAA;AAAA,MACf,OAAS,EAAA;AAAA;AACX;AAEJ,CAAA;AAEM,MAAA,KAAA,GAAQ,KAAM,CAAA,UAAA,CAGlB,CAAC,EAAE,WAAW,OAAS,EAAA,GAAG,KAAM,EAAA,EAAG,GACnC,qBAAA,KAAA,CAAA,aAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,WAAU,EAAA,OAAA;A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