@zentauri-ui/zentauri-components 0.0.84 → 0.0.92
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/README.md +47 -29
- package/dist/chunk-BZSIXBA7.js +70 -0
- package/dist/chunk-BZSIXBA7.js.map +1 -0
- package/dist/chunk-E5UX537J.js +11 -0
- package/dist/chunk-E5UX537J.js.map +1 -0
- package/dist/chunk-MEWYFWBX.mjs +14 -0
- package/dist/chunk-MEWYFWBX.mjs.map +1 -0
- package/dist/chunk-VJHD7QZH.mjs +73 -0
- package/dist/chunk-VJHD7QZH.mjs.map +1 -0
- package/dist/ui/accordion.d.mts +70 -0
- package/dist/ui/accordion.d.ts +70 -0
- package/dist/ui/accordion.js +280 -0
- package/dist/ui/accordion.js.map +1 -0
- package/dist/ui/accordion.mjs +282 -0
- package/dist/ui/accordion.mjs.map +1 -0
- package/dist/ui/alert.d.mts +66 -0
- package/dist/ui/alert.d.ts +66 -0
- package/dist/ui/alert.js +218 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/alert.mjs +220 -0
- package/dist/ui/alert.mjs.map +1 -0
- package/dist/ui/badge.d.mts +37 -0
- package/dist/ui/badge.d.ts +37 -0
- package/dist/ui/badge.js +159 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/badge.mjs +161 -0
- package/dist/ui/badge.mjs.map +1 -0
- package/dist/ui/buttons.d.mts +27 -0
- package/dist/ui/buttons.d.ts +27 -0
- package/dist/ui/buttons.js +107 -0
- package/dist/ui/buttons.js.map +1 -0
- package/dist/ui/buttons.mjs +109 -0
- package/dist/ui/buttons.mjs.map +1 -0
- package/dist/ui/card.d.mts +77 -0
- package/dist/ui/card.d.ts +77 -0
- package/dist/ui/card.js +252 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/card.mjs +254 -0
- package/dist/ui/card.mjs.map +1 -0
- package/dist/ui/divider.d.mts +39 -0
- package/dist/ui/divider.d.ts +39 -0
- package/dist/ui/divider.js +194 -0
- package/dist/ui/divider.js.map +1 -0
- package/dist/ui/divider.mjs +196 -0
- package/dist/ui/divider.mjs.map +1 -0
- package/dist/ui/drawer.d.mts +81 -0
- package/dist/ui/drawer.d.ts +81 -0
- package/dist/ui/drawer.js +377 -0
- package/dist/ui/drawer.js.map +1 -0
- package/dist/ui/drawer.mjs +379 -0
- package/dist/ui/drawer.mjs.map +1 -0
- package/dist/ui/dropdown.d.mts +50 -0
- package/dist/ui/dropdown.d.ts +50 -0
- package/dist/ui/dropdown.js +272 -0
- package/dist/ui/dropdown.js.map +1 -0
- package/dist/ui/dropdown.mjs +274 -0
- package/dist/ui/dropdown.mjs.map +1 -0
- package/dist/ui/empty-state.d.mts +55 -0
- package/dist/ui/empty-state.d.ts +55 -0
- package/dist/ui/empty-state.js +148 -0
- package/dist/ui/empty-state.js.map +1 -0
- package/dist/ui/empty-state.mjs +150 -0
- package/dist/ui/empty-state.mjs.map +1 -0
- package/dist/ui/inputs.d.mts +35 -0
- package/dist/ui/inputs.d.ts +35 -0
- package/dist/ui/inputs.js +426 -0
- package/dist/ui/inputs.js.map +1 -0
- package/dist/ui/inputs.mjs +428 -0
- package/dist/ui/inputs.mjs.map +1 -0
- package/dist/ui/modal.d.mts +84 -0
- package/dist/ui/modal.d.ts +84 -0
- package/dist/ui/modal.js +378 -0
- package/dist/ui/modal.js.map +1 -0
- package/dist/ui/modal.mjs +380 -0
- package/dist/ui/modal.mjs.map +1 -0
- package/dist/ui/pagination.d.mts +114 -0
- package/dist/ui/pagination.d.ts +114 -0
- package/dist/ui/pagination.js +425 -0
- package/dist/ui/pagination.js.map +1 -0
- package/dist/ui/pagination.mjs +427 -0
- package/dist/ui/pagination.mjs.map +1 -0
- package/dist/ui/progress.d.mts +61 -0
- package/dist/ui/progress.d.ts +61 -0
- package/dist/ui/progress.js +231 -0
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/progress.mjs +233 -0
- package/dist/ui/progress.mjs.map +1 -0
- package/dist/ui/select.d.mts +73 -0
- package/dist/ui/select.d.ts +73 -0
- package/dist/ui/select.js +321 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/select.mjs +323 -0
- package/dist/ui/select.mjs.map +1 -0
- package/dist/ui/skeleton.d.mts +90 -0
- package/dist/ui/skeleton.d.ts +90 -0
- package/dist/ui/skeleton.js +538 -0
- package/dist/ui/skeleton.js.map +1 -0
- package/dist/ui/skeleton.mjs +540 -0
- package/dist/ui/skeleton.mjs.map +1 -0
- package/dist/ui/spinner.d.mts +27 -0
- package/dist/ui/spinner.d.ts +27 -0
- package/dist/ui/spinner.js +187 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/spinner.mjs +189 -0
- package/dist/ui/spinner.mjs.map +1 -0
- package/dist/ui/table.d.mts +81 -0
- package/dist/ui/table.d.ts +81 -0
- package/dist/ui/table.js +287 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/table.mjs +289 -0
- package/dist/ui/table.mjs.map +1 -0
- package/dist/ui/tabs.d.mts +58 -0
- package/dist/ui/tabs.d.ts +58 -0
- package/dist/ui/tabs.js +268 -0
- package/dist/ui/tabs.js.map +1 -0
- package/dist/ui/tabs.mjs +270 -0
- package/dist/ui/tabs.mjs.map +1 -0
- package/dist/ui/toast.d.mts +86 -0
- package/dist/ui/toast.d.ts +86 -0
- package/dist/ui/toast.js +252 -0
- package/dist/ui/toast.js.map +1 -0
- package/dist/ui/toast.mjs +254 -0
- package/dist/ui/toast.mjs.map +1 -0
- package/dist/ui/toggle.d.mts +37 -0
- package/dist/ui/toggle.d.ts +37 -0
- package/dist/ui/toggle.js +152 -0
- package/dist/ui/toggle.js.map +1 -0
- package/dist/ui/toggle.mjs +154 -0
- package/dist/ui/toggle.mjs.map +1 -0
- package/dist/ui/tooltip.d.mts +46 -0
- package/dist/ui/tooltip.d.ts +46 -0
- package/dist/ui/tooltip.js +208 -0
- package/dist/ui/tooltip.js.map +1 -0
- package/dist/ui/tooltip.mjs +210 -0
- package/dist/ui/tooltip.mjs.map +1 -0
- package/dist/variants-Dd9pe-ov.d.mts +8 -0
- package/dist/variants-Dd9pe-ov.d.ts +8 -0
- package/package.json +15 -14
- package/dist/ui/index.cjs +0 -5764
- package/dist/ui/index.cjs.map +0 -1
- package/dist/ui/index.d.cts +0 -1164
- package/dist/ui/index.d.ts +0 -1164
- package/dist/ui/index.js +0 -5626
- package/dist/ui/index.js.map +0 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
|
+
|
|
7
|
+
declare const alertVariants: (props?: ({
|
|
8
|
+
appearance?: "default" | "success" | "warning" | "error" | "info" | "ghost" | "purple" | "pink" | "orange" | "yellow" | "teal" | "indigo" | "gray" | "violet" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | "gradient-orange" | null | undefined;
|
|
9
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
declare const alertTitleVariants: (props?: ({
|
|
12
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
13
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
14
|
+
declare const alertDescriptionVariants: (props?: ({
|
|
15
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
16
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
17
|
+
|
|
18
|
+
type AlertAnimation = "none" | "slide-down" | "fade" | "pop";
|
|
19
|
+
type AlertVariantProps = VariantProps<typeof alertVariants> & {
|
|
20
|
+
closable?: boolean;
|
|
21
|
+
};
|
|
22
|
+
type AlertProps = AlertVariantProps & Omit<HTMLMotionProps<"div">, "children"> & {
|
|
23
|
+
triggerClassName?: string;
|
|
24
|
+
animation?: AlertAnimation;
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
onClose?: () => void;
|
|
27
|
+
closeLabel?: string;
|
|
28
|
+
};
|
|
29
|
+
type AlertSectionProps = {
|
|
30
|
+
className?: string;
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
};
|
|
33
|
+
type AlertSize = NonNullable<AlertProps["size"]>;
|
|
34
|
+
|
|
35
|
+
declare function Alert(props: AlertProps): react_jsx_runtime.JSX.Element;
|
|
36
|
+
declare namespace Alert {
|
|
37
|
+
var displayName: string;
|
|
38
|
+
}
|
|
39
|
+
declare function AlertIcon({ className, children }: AlertSectionProps): react_jsx_runtime.JSX.Element;
|
|
40
|
+
declare namespace AlertIcon {
|
|
41
|
+
var displayName: string;
|
|
42
|
+
}
|
|
43
|
+
declare function AlertTitle({ className, children }: AlertSectionProps): react_jsx_runtime.JSX.Element;
|
|
44
|
+
declare namespace AlertTitle {
|
|
45
|
+
var displayName: string;
|
|
46
|
+
}
|
|
47
|
+
declare function AlertDescription({ className, children }: AlertSectionProps): react_jsx_runtime.JSX.Element;
|
|
48
|
+
declare namespace AlertDescription {
|
|
49
|
+
var displayName: string;
|
|
50
|
+
}
|
|
51
|
+
declare function AlertClose({ className, children, "aria-label": ariaLabel, onClick, }: AlertSectionProps & {
|
|
52
|
+
onClick?: () => void;
|
|
53
|
+
"aria-label"?: string;
|
|
54
|
+
}): react_jsx_runtime.JSX.Element;
|
|
55
|
+
declare namespace AlertClose {
|
|
56
|
+
var displayName: string;
|
|
57
|
+
}
|
|
58
|
+
declare function AlertDefaultIcon({ appearance }: {
|
|
59
|
+
appearance?: AlertProps["appearance"];
|
|
60
|
+
}): react_jsx_runtime.JSX.Element;
|
|
61
|
+
|
|
62
|
+
type AlertPresetMotionProps = Pick<HTMLMotionProps<"div">, "initial" | "animate" | "transition">;
|
|
63
|
+
type AlertAnimationPresets = Record<AlertAnimation, AlertPresetMotionProps>;
|
|
64
|
+
declare const alertAnimationPresets: AlertAnimationPresets;
|
|
65
|
+
|
|
66
|
+
export { Alert, type AlertAnimation, AlertClose, AlertDefaultIcon, AlertDescription, AlertIcon, type AlertProps, type AlertSectionProps, type AlertSize, AlertTitle, alertAnimationPresets, alertDescriptionVariants, alertTitleVariants, alertVariants };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
|
+
|
|
7
|
+
declare const alertVariants: (props?: ({
|
|
8
|
+
appearance?: "default" | "success" | "warning" | "error" | "info" | "ghost" | "purple" | "pink" | "orange" | "yellow" | "teal" | "indigo" | "gray" | "violet" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | "gradient-orange" | null | undefined;
|
|
9
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
declare const alertTitleVariants: (props?: ({
|
|
12
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
13
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
14
|
+
declare const alertDescriptionVariants: (props?: ({
|
|
15
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
16
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
17
|
+
|
|
18
|
+
type AlertAnimation = "none" | "slide-down" | "fade" | "pop";
|
|
19
|
+
type AlertVariantProps = VariantProps<typeof alertVariants> & {
|
|
20
|
+
closable?: boolean;
|
|
21
|
+
};
|
|
22
|
+
type AlertProps = AlertVariantProps & Omit<HTMLMotionProps<"div">, "children"> & {
|
|
23
|
+
triggerClassName?: string;
|
|
24
|
+
animation?: AlertAnimation;
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
onClose?: () => void;
|
|
27
|
+
closeLabel?: string;
|
|
28
|
+
};
|
|
29
|
+
type AlertSectionProps = {
|
|
30
|
+
className?: string;
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
};
|
|
33
|
+
type AlertSize = NonNullable<AlertProps["size"]>;
|
|
34
|
+
|
|
35
|
+
declare function Alert(props: AlertProps): react_jsx_runtime.JSX.Element;
|
|
36
|
+
declare namespace Alert {
|
|
37
|
+
var displayName: string;
|
|
38
|
+
}
|
|
39
|
+
declare function AlertIcon({ className, children }: AlertSectionProps): react_jsx_runtime.JSX.Element;
|
|
40
|
+
declare namespace AlertIcon {
|
|
41
|
+
var displayName: string;
|
|
42
|
+
}
|
|
43
|
+
declare function AlertTitle({ className, children }: AlertSectionProps): react_jsx_runtime.JSX.Element;
|
|
44
|
+
declare namespace AlertTitle {
|
|
45
|
+
var displayName: string;
|
|
46
|
+
}
|
|
47
|
+
declare function AlertDescription({ className, children }: AlertSectionProps): react_jsx_runtime.JSX.Element;
|
|
48
|
+
declare namespace AlertDescription {
|
|
49
|
+
var displayName: string;
|
|
50
|
+
}
|
|
51
|
+
declare function AlertClose({ className, children, "aria-label": ariaLabel, onClick, }: AlertSectionProps & {
|
|
52
|
+
onClick?: () => void;
|
|
53
|
+
"aria-label"?: string;
|
|
54
|
+
}): react_jsx_runtime.JSX.Element;
|
|
55
|
+
declare namespace AlertClose {
|
|
56
|
+
var displayName: string;
|
|
57
|
+
}
|
|
58
|
+
declare function AlertDefaultIcon({ appearance }: {
|
|
59
|
+
appearance?: AlertProps["appearance"];
|
|
60
|
+
}): react_jsx_runtime.JSX.Element;
|
|
61
|
+
|
|
62
|
+
type AlertPresetMotionProps = Pick<HTMLMotionProps<"div">, "initial" | "animate" | "transition">;
|
|
63
|
+
type AlertAnimationPresets = Record<AlertAnimation, AlertPresetMotionProps>;
|
|
64
|
+
declare const alertAnimationPresets: AlertAnimationPresets;
|
|
65
|
+
|
|
66
|
+
export { Alert, type AlertAnimation, AlertClose, AlertDefaultIcon, AlertDescription, AlertIcon, type AlertProps, type AlertSectionProps, type AlertSize, AlertTitle, alertAnimationPresets, alertDescriptionVariants, alertTitleVariants, alertVariants };
|
package/dist/ui/alert.js
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
var _chunkE5UX537Jjs = require('../chunk-E5UX537J.js');
|
|
4
|
+
|
|
5
|
+
// src/ui/alert/alert.tsx
|
|
6
|
+
var _react = require('react');
|
|
7
|
+
var _framermotion = require('framer-motion');
|
|
8
|
+
var _hi2 = require('react-icons/hi2');
|
|
9
|
+
|
|
10
|
+
// src/ui/alert/animations.ts
|
|
11
|
+
var alertAnimationPresets = {
|
|
12
|
+
none: {},
|
|
13
|
+
"slide-down": {
|
|
14
|
+
initial: { y: -8, opacity: 0 },
|
|
15
|
+
animate: { y: 0, opacity: 1 },
|
|
16
|
+
transition: { type: "spring", stiffness: 420, damping: 30 }
|
|
17
|
+
},
|
|
18
|
+
fade: {
|
|
19
|
+
initial: { opacity: 0 },
|
|
20
|
+
animate: { opacity: 1 },
|
|
21
|
+
transition: { duration: 0.2 }
|
|
22
|
+
},
|
|
23
|
+
pop: {
|
|
24
|
+
initial: { scale: 0.96, opacity: 0 },
|
|
25
|
+
animate: { scale: 1, opacity: 1 },
|
|
26
|
+
transition: { type: "spring", stiffness: 520, damping: 28 }
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// src/ui/alert/variants.ts
|
|
31
|
+
var _classvarianceauthority = require('class-variance-authority');
|
|
32
|
+
var alertVariants = _classvarianceauthority.cva.call(void 0,
|
|
33
|
+
"relative flex w-full gap-3 border text-sm ring-offset-slate-950 transition-colors",
|
|
34
|
+
{
|
|
35
|
+
variants: {
|
|
36
|
+
appearance: {
|
|
37
|
+
default: "border-white/10 bg-white/5 text-slate-50",
|
|
38
|
+
success: "border-emerald-500/40 bg-emerald-500/10 text-emerald-50",
|
|
39
|
+
warning: "border-amber-500/40 bg-amber-500/10 text-amber-50",
|
|
40
|
+
error: "border-rose-500/50 bg-rose-500/10 text-rose-50",
|
|
41
|
+
info: "border-sky-500/40 bg-sky-500/10 text-sky-50",
|
|
42
|
+
ghost: "border-transparent bg-transparent text-slate-200",
|
|
43
|
+
purple: "border-purple-600 bg-purple-950/70 backdrop-blur-xl",
|
|
44
|
+
pink: "border-pink-600 bg-pink-950/70 backdrop-blur-xl",
|
|
45
|
+
orange: "border-orange-600 bg-orange-950/70 backdrop-blur-xl",
|
|
46
|
+
yellow: "border-yellow-600 bg-yellow-950/70 backdrop-blur-xl",
|
|
47
|
+
teal: "border-teal-600 bg-teal-950/70 backdrop-blur-xl",
|
|
48
|
+
indigo: "border-indigo-600 bg-indigo-950/70 backdrop-blur-xl",
|
|
49
|
+
gray: "border-gray-600 bg-gray-950/70 backdrop-blur-xl",
|
|
50
|
+
violet: "border-violet-600 bg-violet-950/70 backdrop-blur-xl",
|
|
51
|
+
"gradient-blue": "border-gradient-to-r from-blue-600 to-purple-600 bg-gradient-to-r from-blue-950/70 to-purple-950/70 backdrop-blur-xl",
|
|
52
|
+
"gradient-green": "border-gradient-to-r from-green-600 to-lime-600 bg-gradient-to-r from-green-950/70 to-lime-950/70 backdrop-blur-xl",
|
|
53
|
+
"gradient-red": "border-gradient-to-r from-red-600 to-pink-600 bg-gradient-to-r from-red-950/70 to-pink-950/70 backdrop-blur-xl",
|
|
54
|
+
"gradient-yellow": "border-gradient-to-r from-yellow-600 to-orange-600 bg-gradient-to-r from-yellow-950/70 to-orange-950/70 backdrop-blur-xl",
|
|
55
|
+
"gradient-purple": "border-gradient-to-r from-purple-600 to-pink-600 bg-gradient-to-r from-purple-950/70 to-pink-950/70 backdrop-blur-xl",
|
|
56
|
+
"gradient-teal": "border-gradient-to-r from-teal-600 to-cyan-600 bg-gradient-to-r from-teal-950/70 to-cyan-950/70 backdrop-blur-xl",
|
|
57
|
+
"gradient-indigo": "border-gradient-to-r from-indigo-600 to-purple-600 bg-gradient-to-r from-indigo-950/70 to-purple-950/70 backdrop-blur-xl",
|
|
58
|
+
"gradient-pink": "border-gradient-to-r from-pink-600 to-rose-600 bg-gradient-to-r from-pink-950/70 to-rose-950/70 backdrop-blur-xl",
|
|
59
|
+
"gradient-orange": "border-gradient-to-r from-orange-600 to-red-600 bg-gradient-to-r from-orange-950/70 to-red-950/70 backdrop-blur-xl"
|
|
60
|
+
},
|
|
61
|
+
size: {
|
|
62
|
+
sm: "rounded-lg p-3",
|
|
63
|
+
md: "rounded-xl p-4",
|
|
64
|
+
lg: "rounded-2xl p-5 text-base"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
defaultVariants: {
|
|
68
|
+
appearance: "default",
|
|
69
|
+
size: "md"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
var alertTitleVariants = _classvarianceauthority.cva.call(void 0, "font-semibold leading-tight", {
|
|
74
|
+
variants: {
|
|
75
|
+
size: {
|
|
76
|
+
sm: "text-xs md:text-sm",
|
|
77
|
+
md: "text-xs md:text-sm",
|
|
78
|
+
lg: "text-xs md:text-sm"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
defaultVariants: { size: "md" }
|
|
82
|
+
});
|
|
83
|
+
var alertDescriptionVariants = _classvarianceauthority.cva.call(void 0, "text-slate-300", {
|
|
84
|
+
variants: {
|
|
85
|
+
size: {
|
|
86
|
+
sm: "text-xs md:text-sm",
|
|
87
|
+
md: "text-xs md:text-sm",
|
|
88
|
+
lg: "text-xs md:text-sm"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
defaultVariants: { size: "md" }
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// src/ui/alert/alert.tsx
|
|
95
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
96
|
+
var AlertSizeContext = _react.createContext.call(void 0, "md");
|
|
97
|
+
function useAlertSize() {
|
|
98
|
+
const ctx = _react.useContext.call(void 0, AlertSizeContext);
|
|
99
|
+
if (!ctx) {
|
|
100
|
+
throw new Error("useAlertSize must be used within an Alert");
|
|
101
|
+
}
|
|
102
|
+
return ctx;
|
|
103
|
+
}
|
|
104
|
+
function Alert(props) {
|
|
105
|
+
const {
|
|
106
|
+
className,
|
|
107
|
+
triggerClassName,
|
|
108
|
+
appearance,
|
|
109
|
+
size = "md",
|
|
110
|
+
animation = "none",
|
|
111
|
+
closable = false,
|
|
112
|
+
onClose,
|
|
113
|
+
closeLabel = "Dismiss alert",
|
|
114
|
+
children,
|
|
115
|
+
ref,
|
|
116
|
+
...rest
|
|
117
|
+
} = props;
|
|
118
|
+
const motionProps = alertAnimationPresets[animation];
|
|
119
|
+
const live = appearance === "error" ? "assertive" : "polite";
|
|
120
|
+
const ctx = _react.useMemo.call(void 0, () => _nullishCoalesce(size, () => ( "md")), [size]);
|
|
121
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AlertSizeContext.Provider, { value: ctx, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
122
|
+
_framermotion.motion.div,
|
|
123
|
+
{
|
|
124
|
+
ref,
|
|
125
|
+
"data-slot": "alert",
|
|
126
|
+
role: "alert",
|
|
127
|
+
"aria-live": live,
|
|
128
|
+
className: _chunkE5UX537Jjs.cn.call(void 0,
|
|
129
|
+
alertVariants({ appearance, size }),
|
|
130
|
+
closable ? "pr-12" : "",
|
|
131
|
+
className
|
|
132
|
+
),
|
|
133
|
+
initial: animation === "none" ? false : void 0,
|
|
134
|
+
...motionProps,
|
|
135
|
+
...rest,
|
|
136
|
+
children: [
|
|
137
|
+
children,
|
|
138
|
+
closable ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
139
|
+
"button",
|
|
140
|
+
{
|
|
141
|
+
type: "button",
|
|
142
|
+
"data-slot": "alert-close",
|
|
143
|
+
"aria-label": closeLabel,
|
|
144
|
+
onClick: onClose,
|
|
145
|
+
className: _chunkE5UX537Jjs.cn.call(void 0,
|
|
146
|
+
"absolute right-3 top-3 inline-flex size-8 items-center justify-center rounded-md text-slate-200 transition hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/30",
|
|
147
|
+
triggerClassName
|
|
148
|
+
),
|
|
149
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _hi2.HiXMark, { className: "size-4", "aria-hidden": true })
|
|
150
|
+
}
|
|
151
|
+
) : null
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
) });
|
|
155
|
+
}
|
|
156
|
+
Alert.displayName = "Alert";
|
|
157
|
+
function AlertIcon({ className, children }) {
|
|
158
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-slot": "alert-icon", className: _chunkE5UX537Jjs.cn.call(void 0, "mt-0.5 shrink-0 text-current", className), children });
|
|
159
|
+
}
|
|
160
|
+
AlertIcon.displayName = "AlertIcon";
|
|
161
|
+
function AlertTitle({ className, children }) {
|
|
162
|
+
const size = useAlertSize();
|
|
163
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "data-slot": "alert-title", className: _chunkE5UX537Jjs.cn.call(void 0, alertTitleVariants({ size }), className), children });
|
|
164
|
+
}
|
|
165
|
+
AlertTitle.displayName = "AlertTitle";
|
|
166
|
+
function AlertDescription({ className, children }) {
|
|
167
|
+
const size = useAlertSize();
|
|
168
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
169
|
+
"div",
|
|
170
|
+
{
|
|
171
|
+
"data-slot": "alert-description",
|
|
172
|
+
className: _chunkE5UX537Jjs.cn.call(void 0, alertDescriptionVariants({ size }), className),
|
|
173
|
+
children
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
AlertDescription.displayName = "AlertDescription";
|
|
178
|
+
function AlertClose({
|
|
179
|
+
className,
|
|
180
|
+
children,
|
|
181
|
+
"aria-label": ariaLabel = "Dismiss alert",
|
|
182
|
+
onClick
|
|
183
|
+
}) {
|
|
184
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
185
|
+
"button",
|
|
186
|
+
{
|
|
187
|
+
type: "button",
|
|
188
|
+
"data-slot": "alert-close",
|
|
189
|
+
"aria-label": ariaLabel,
|
|
190
|
+
onClick,
|
|
191
|
+
className: _chunkE5UX537Jjs.cn.call(void 0,
|
|
192
|
+
"inline-flex size-8 items-center justify-center rounded-md text-slate-200 transition hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/30",
|
|
193
|
+
className
|
|
194
|
+
),
|
|
195
|
+
children: _nullishCoalesce(children, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _hi2.HiXMark, { className: "size-4", "aria-hidden": true })))
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
AlertClose.displayName = "AlertClose";
|
|
200
|
+
function AlertDefaultIcon({ appearance }) {
|
|
201
|
+
if (appearance === "error") {
|
|
202
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _hi2.HiExclamationTriangle, { className: "size-5", "aria-hidden": true });
|
|
203
|
+
}
|
|
204
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _hi2.HiInformationCircle, { className: "size-5", "aria-hidden": true });
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
exports.Alert = Alert; exports.AlertClose = AlertClose; exports.AlertDefaultIcon = AlertDefaultIcon; exports.AlertDescription = AlertDescription; exports.AlertIcon = AlertIcon; exports.AlertTitle = AlertTitle; exports.alertAnimationPresets = alertAnimationPresets; exports.alertDescriptionVariants = alertDescriptionVariants; exports.alertTitleVariants = alertTitleVariants; exports.alertVariants = alertVariants;
|
|
218
|
+
//# sourceMappingURL=alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/shubham/Desktop/Repos/NEXT%20JS/zentauri-ui/packages/components/dist/ui/alert.js"],"names":[],"mappings":"AAAA;AACE;AACF,uDAA6B;AAC7B;AACA;AACA,8BAA0D;AAC1D,6CAAsC;AACtC,sCAAqF;AACrF;AACA;AACA,IAAI,sBAAsB,EAAE;AAC5B,EAAE,IAAI,EAAE,CAAC,CAAC;AACV,EAAE,YAAY,EAAE;AAChB,IAAI,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC;AAClC,IAAI,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC;AACjC,IAAI,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG;AAC9D,EAAE,CAAC;AACH,EAAE,IAAI,EAAE;AACR,IAAI,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC;AAC3B,IAAI,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC;AAC3B,IAAI,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI;AAChC,EAAE,CAAC;AACH,EAAE,GAAG,EAAE;AACP,IAAI,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC;AACxC,IAAI,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC;AACrC,IAAI,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG;AAC9D,EAAE;AACF,CAAC;AACD;AACA;A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B,MAAM,OAAO;AACb,MAAM,SAAS,EAAE,iCAAE;AACnB,QAAQ,mLAAmL;AAC3L,QAAQ;AACR,MAAM,CAAC;AACP,MAAM,QAAQ,mBAAE,QAAS,0BAAmB,6BAAG,YAAQ,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,CAAC;AACrG,IAAI;AACJ,EAAE,CAAC;AACH;AACA,UAAU,CAAC,YAAY,EAAE,YAAY;AACrC,SAAS,gBAAgB,CAAC,EAAE,WAAW,CAAC,EAAE;AAC1C,EAAE,GAAG,CAAC,WAAW,IAAI,OAAO,EAAE;AAC9B,IAAI,uBAAuB,6BAAG,0BAAsB,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;AACnG,EAAE;AACF,EAAE,uBAAuB,6BAAG,wBAAoB,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;AAC/F;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,6ZAAC","file":"/Users/shubham/Desktop/Repos/NEXT JS/zentauri-ui/packages/components/dist/ui/alert.js","sourcesContent":[null]}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
cn
|
|
5
|
+
} from "../chunk-MEWYFWBX.mjs";
|
|
6
|
+
|
|
7
|
+
// src/ui/alert/alert.tsx
|
|
8
|
+
import { createContext, useContext, useMemo } from "react";
|
|
9
|
+
import { motion } from "framer-motion";
|
|
10
|
+
import { HiExclamationTriangle, HiInformationCircle, HiXMark } from "react-icons/hi2";
|
|
11
|
+
|
|
12
|
+
// src/ui/alert/animations.ts
|
|
13
|
+
var alertAnimationPresets = {
|
|
14
|
+
none: {},
|
|
15
|
+
"slide-down": {
|
|
16
|
+
initial: { y: -8, opacity: 0 },
|
|
17
|
+
animate: { y: 0, opacity: 1 },
|
|
18
|
+
transition: { type: "spring", stiffness: 420, damping: 30 }
|
|
19
|
+
},
|
|
20
|
+
fade: {
|
|
21
|
+
initial: { opacity: 0 },
|
|
22
|
+
animate: { opacity: 1 },
|
|
23
|
+
transition: { duration: 0.2 }
|
|
24
|
+
},
|
|
25
|
+
pop: {
|
|
26
|
+
initial: { scale: 0.96, opacity: 0 },
|
|
27
|
+
animate: { scale: 1, opacity: 1 },
|
|
28
|
+
transition: { type: "spring", stiffness: 520, damping: 28 }
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// src/ui/alert/variants.ts
|
|
33
|
+
import { cva } from "class-variance-authority";
|
|
34
|
+
var alertVariants = cva(
|
|
35
|
+
"relative flex w-full gap-3 border text-sm ring-offset-slate-950 transition-colors",
|
|
36
|
+
{
|
|
37
|
+
variants: {
|
|
38
|
+
appearance: {
|
|
39
|
+
default: "border-white/10 bg-white/5 text-slate-50",
|
|
40
|
+
success: "border-emerald-500/40 bg-emerald-500/10 text-emerald-50",
|
|
41
|
+
warning: "border-amber-500/40 bg-amber-500/10 text-amber-50",
|
|
42
|
+
error: "border-rose-500/50 bg-rose-500/10 text-rose-50",
|
|
43
|
+
info: "border-sky-500/40 bg-sky-500/10 text-sky-50",
|
|
44
|
+
ghost: "border-transparent bg-transparent text-slate-200",
|
|
45
|
+
purple: "border-purple-600 bg-purple-950/70 backdrop-blur-xl",
|
|
46
|
+
pink: "border-pink-600 bg-pink-950/70 backdrop-blur-xl",
|
|
47
|
+
orange: "border-orange-600 bg-orange-950/70 backdrop-blur-xl",
|
|
48
|
+
yellow: "border-yellow-600 bg-yellow-950/70 backdrop-blur-xl",
|
|
49
|
+
teal: "border-teal-600 bg-teal-950/70 backdrop-blur-xl",
|
|
50
|
+
indigo: "border-indigo-600 bg-indigo-950/70 backdrop-blur-xl",
|
|
51
|
+
gray: "border-gray-600 bg-gray-950/70 backdrop-blur-xl",
|
|
52
|
+
violet: "border-violet-600 bg-violet-950/70 backdrop-blur-xl",
|
|
53
|
+
"gradient-blue": "border-gradient-to-r from-blue-600 to-purple-600 bg-gradient-to-r from-blue-950/70 to-purple-950/70 backdrop-blur-xl",
|
|
54
|
+
"gradient-green": "border-gradient-to-r from-green-600 to-lime-600 bg-gradient-to-r from-green-950/70 to-lime-950/70 backdrop-blur-xl",
|
|
55
|
+
"gradient-red": "border-gradient-to-r from-red-600 to-pink-600 bg-gradient-to-r from-red-950/70 to-pink-950/70 backdrop-blur-xl",
|
|
56
|
+
"gradient-yellow": "border-gradient-to-r from-yellow-600 to-orange-600 bg-gradient-to-r from-yellow-950/70 to-orange-950/70 backdrop-blur-xl",
|
|
57
|
+
"gradient-purple": "border-gradient-to-r from-purple-600 to-pink-600 bg-gradient-to-r from-purple-950/70 to-pink-950/70 backdrop-blur-xl",
|
|
58
|
+
"gradient-teal": "border-gradient-to-r from-teal-600 to-cyan-600 bg-gradient-to-r from-teal-950/70 to-cyan-950/70 backdrop-blur-xl",
|
|
59
|
+
"gradient-indigo": "border-gradient-to-r from-indigo-600 to-purple-600 bg-gradient-to-r from-indigo-950/70 to-purple-950/70 backdrop-blur-xl",
|
|
60
|
+
"gradient-pink": "border-gradient-to-r from-pink-600 to-rose-600 bg-gradient-to-r from-pink-950/70 to-rose-950/70 backdrop-blur-xl",
|
|
61
|
+
"gradient-orange": "border-gradient-to-r from-orange-600 to-red-600 bg-gradient-to-r from-orange-950/70 to-red-950/70 backdrop-blur-xl"
|
|
62
|
+
},
|
|
63
|
+
size: {
|
|
64
|
+
sm: "rounded-lg p-3",
|
|
65
|
+
md: "rounded-xl p-4",
|
|
66
|
+
lg: "rounded-2xl p-5 text-base"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
defaultVariants: {
|
|
70
|
+
appearance: "default",
|
|
71
|
+
size: "md"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
var alertTitleVariants = cva("font-semibold leading-tight", {
|
|
76
|
+
variants: {
|
|
77
|
+
size: {
|
|
78
|
+
sm: "text-xs md:text-sm",
|
|
79
|
+
md: "text-xs md:text-sm",
|
|
80
|
+
lg: "text-xs md:text-sm"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
defaultVariants: { size: "md" }
|
|
84
|
+
});
|
|
85
|
+
var alertDescriptionVariants = cva("text-slate-300", {
|
|
86
|
+
variants: {
|
|
87
|
+
size: {
|
|
88
|
+
sm: "text-xs md:text-sm",
|
|
89
|
+
md: "text-xs md:text-sm",
|
|
90
|
+
lg: "text-xs md:text-sm"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
defaultVariants: { size: "md" }
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// src/ui/alert/alert.tsx
|
|
97
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
98
|
+
var AlertSizeContext = createContext("md");
|
|
99
|
+
function useAlertSize() {
|
|
100
|
+
const ctx = useContext(AlertSizeContext);
|
|
101
|
+
if (!ctx) {
|
|
102
|
+
throw new Error("useAlertSize must be used within an Alert");
|
|
103
|
+
}
|
|
104
|
+
return ctx;
|
|
105
|
+
}
|
|
106
|
+
function Alert(props) {
|
|
107
|
+
const {
|
|
108
|
+
className,
|
|
109
|
+
triggerClassName,
|
|
110
|
+
appearance,
|
|
111
|
+
size = "md",
|
|
112
|
+
animation = "none",
|
|
113
|
+
closable = false,
|
|
114
|
+
onClose,
|
|
115
|
+
closeLabel = "Dismiss alert",
|
|
116
|
+
children,
|
|
117
|
+
ref,
|
|
118
|
+
...rest
|
|
119
|
+
} = props;
|
|
120
|
+
const motionProps = alertAnimationPresets[animation];
|
|
121
|
+
const live = appearance === "error" ? "assertive" : "polite";
|
|
122
|
+
const ctx = useMemo(() => size ?? "md", [size]);
|
|
123
|
+
return /* @__PURE__ */ jsx(AlertSizeContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxs(
|
|
124
|
+
motion.div,
|
|
125
|
+
{
|
|
126
|
+
ref,
|
|
127
|
+
"data-slot": "alert",
|
|
128
|
+
role: "alert",
|
|
129
|
+
"aria-live": live,
|
|
130
|
+
className: cn(
|
|
131
|
+
alertVariants({ appearance, size }),
|
|
132
|
+
closable ? "pr-12" : "",
|
|
133
|
+
className
|
|
134
|
+
),
|
|
135
|
+
initial: animation === "none" ? false : void 0,
|
|
136
|
+
...motionProps,
|
|
137
|
+
...rest,
|
|
138
|
+
children: [
|
|
139
|
+
children,
|
|
140
|
+
closable ? /* @__PURE__ */ jsx(
|
|
141
|
+
"button",
|
|
142
|
+
{
|
|
143
|
+
type: "button",
|
|
144
|
+
"data-slot": "alert-close",
|
|
145
|
+
"aria-label": closeLabel,
|
|
146
|
+
onClick: onClose,
|
|
147
|
+
className: cn(
|
|
148
|
+
"absolute right-3 top-3 inline-flex size-8 items-center justify-center rounded-md text-slate-200 transition hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/30",
|
|
149
|
+
triggerClassName
|
|
150
|
+
),
|
|
151
|
+
children: /* @__PURE__ */ jsx(HiXMark, { className: "size-4", "aria-hidden": true })
|
|
152
|
+
}
|
|
153
|
+
) : null
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
) });
|
|
157
|
+
}
|
|
158
|
+
Alert.displayName = "Alert";
|
|
159
|
+
function AlertIcon({ className, children }) {
|
|
160
|
+
return /* @__PURE__ */ jsx("span", { "data-slot": "alert-icon", className: cn("mt-0.5 shrink-0 text-current", className), children });
|
|
161
|
+
}
|
|
162
|
+
AlertIcon.displayName = "AlertIcon";
|
|
163
|
+
function AlertTitle({ className, children }) {
|
|
164
|
+
const size = useAlertSize();
|
|
165
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "alert-title", className: cn(alertTitleVariants({ size }), className), children });
|
|
166
|
+
}
|
|
167
|
+
AlertTitle.displayName = "AlertTitle";
|
|
168
|
+
function AlertDescription({ className, children }) {
|
|
169
|
+
const size = useAlertSize();
|
|
170
|
+
return /* @__PURE__ */ jsx(
|
|
171
|
+
"div",
|
|
172
|
+
{
|
|
173
|
+
"data-slot": "alert-description",
|
|
174
|
+
className: cn(alertDescriptionVariants({ size }), className),
|
|
175
|
+
children
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
AlertDescription.displayName = "AlertDescription";
|
|
180
|
+
function AlertClose({
|
|
181
|
+
className,
|
|
182
|
+
children,
|
|
183
|
+
"aria-label": ariaLabel = "Dismiss alert",
|
|
184
|
+
onClick
|
|
185
|
+
}) {
|
|
186
|
+
return /* @__PURE__ */ jsx(
|
|
187
|
+
"button",
|
|
188
|
+
{
|
|
189
|
+
type: "button",
|
|
190
|
+
"data-slot": "alert-close",
|
|
191
|
+
"aria-label": ariaLabel,
|
|
192
|
+
onClick,
|
|
193
|
+
className: cn(
|
|
194
|
+
"inline-flex size-8 items-center justify-center rounded-md text-slate-200 transition hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/30",
|
|
195
|
+
className
|
|
196
|
+
),
|
|
197
|
+
children: children ?? /* @__PURE__ */ jsx(HiXMark, { className: "size-4", "aria-hidden": true })
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
AlertClose.displayName = "AlertClose";
|
|
202
|
+
function AlertDefaultIcon({ appearance }) {
|
|
203
|
+
if (appearance === "error") {
|
|
204
|
+
return /* @__PURE__ */ jsx(HiExclamationTriangle, { className: "size-5", "aria-hidden": true });
|
|
205
|
+
}
|
|
206
|
+
return /* @__PURE__ */ jsx(HiInformationCircle, { className: "size-5", "aria-hidden": true });
|
|
207
|
+
}
|
|
208
|
+
export {
|
|
209
|
+
Alert,
|
|
210
|
+
AlertClose,
|
|
211
|
+
AlertDefaultIcon,
|
|
212
|
+
AlertDescription,
|
|
213
|
+
AlertIcon,
|
|
214
|
+
AlertTitle,
|
|
215
|
+
alertAnimationPresets,
|
|
216
|
+
alertDescriptionVariants,
|
|
217
|
+
alertTitleVariants,
|
|
218
|
+
alertVariants
|
|
219
|
+
};
|
|
220
|
+
//# sourceMappingURL=alert.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/alert/alert.tsx","../../src/ui/alert/animations.ts","../../src/ui/alert/variants.ts"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, useMemo } from \"react\";\nimport { motion } from \"framer-motion\";\nimport { HiExclamationTriangle, HiInformationCircle, HiXMark } from \"react-icons/hi2\";\n\nimport { cn } from \"../../lib/utils\";\n\nimport { alertAnimationPresets } from \"./animations\";\nimport type { AlertProps, AlertSectionProps, AlertSize } from \"./types\";\nimport {\n alertDescriptionVariants,\n alertTitleVariants,\n alertVariants,\n} from \"./variants\";\n\nconst AlertSizeContext = createContext<AlertSize>(\"md\");\n\nfunction useAlertSize(): AlertSize {\n const ctx = useContext(AlertSizeContext);\n if (!ctx) {\n throw new Error(\"useAlertSize must be used within an Alert\");\n }\n return ctx;\n}\n\nexport function Alert(props: AlertProps) {\n const {\n className,\n triggerClassName,\n appearance,\n size = \"md\",\n animation = \"none\",\n closable = false,\n onClose,\n closeLabel = \"Dismiss alert\",\n children,\n ref,\n ...rest\n } = props;\n const motionProps = alertAnimationPresets[animation];\n const live = appearance === \"error\" ? \"assertive\" : \"polite\";\n\n const ctx = useMemo(() => size ?? \"md\", [size]);\n\n return (\n <AlertSizeContext.Provider value={ctx}>\n <motion.div\n ref={ref}\n data-slot=\"alert\"\n role=\"alert\"\n aria-live={live}\n className={cn(\n alertVariants({ appearance, size }),\n closable ? \"pr-12\" : \"\",\n className,\n )}\n initial={animation === \"none\" ? false : undefined}\n {...motionProps}\n {...rest}\n >\n {children}\n {closable ? (\n <button\n type=\"button\"\n data-slot=\"alert-close\"\n aria-label={closeLabel}\n onClick={onClose}\n className={cn(\n \"absolute right-3 top-3 inline-flex size-8 items-center justify-center rounded-md text-slate-200 transition hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/30\",\n triggerClassName,\n )}\n >\n <HiXMark className=\"size-4\" aria-hidden />\n </button>\n ) : null}\n </motion.div>\n </AlertSizeContext.Provider>\n );\n}\n\nAlert.displayName = \"Alert\";\n\nexport function AlertIcon({ className, children }: AlertSectionProps) {\n return (\n <span data-slot=\"alert-icon\" className={cn(\"mt-0.5 shrink-0 text-current\", className)}>\n {children}\n </span>\n );\n}\n\nAlertIcon.displayName = \"AlertIcon\";\n\nexport function AlertTitle({ className, children }: AlertSectionProps) {\n const size = useAlertSize();\n return (\n <div data-slot=\"alert-title\" className={cn(alertTitleVariants({ size }), className)}>\n {children}\n </div>\n );\n}\n\nAlertTitle.displayName = \"AlertTitle\";\n\nexport function AlertDescription({ className, children }: AlertSectionProps) {\n const size = useAlertSize();\n return (\n <div\n data-slot=\"alert-description\"\n className={cn(alertDescriptionVariants({ size }), className)}\n >\n {children}\n </div>\n );\n}\n\nAlertDescription.displayName = \"AlertDescription\";\n\nexport function AlertClose({\n className,\n children,\n \"aria-label\": ariaLabel = \"Dismiss alert\",\n onClick,\n}: AlertSectionProps & { onClick?: () => void; \"aria-label\"?: string }) {\n return (\n <button\n type=\"button\"\n data-slot=\"alert-close\"\n aria-label={ariaLabel}\n onClick={onClick}\n className={cn(\n \"inline-flex size-8 items-center justify-center rounded-md text-slate-200 transition hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/30\",\n className,\n )}\n >\n {children ?? <HiXMark className=\"size-4\" aria-hidden />}\n </button>\n );\n}\n\nAlertClose.displayName = \"AlertClose\";\n\nexport function AlertDefaultIcon({ appearance }: { appearance?: AlertProps[\"appearance\"] }) {\n if (appearance === \"error\") {\n return <HiExclamationTriangle className=\"size-5\" aria-hidden />;\n }\n return <HiInformationCircle className=\"size-5\" aria-hidden />;\n}\n","import type { HTMLMotionProps } from \"framer-motion\";\n\nimport type { AlertAnimation } from \"./types\";\n\ntype AlertPresetMotionProps = Pick<\n HTMLMotionProps<\"div\">,\n \"initial\" | \"animate\" | \"transition\"\n>;\n\nexport type AlertAnimationPresets = Record<AlertAnimation, AlertPresetMotionProps>;\n\nexport const alertAnimationPresets: AlertAnimationPresets = {\n none: {},\n \"slide-down\": {\n initial: { y: -8, opacity: 0 },\n animate: { y: 0, opacity: 1 },\n transition: { type: \"spring\", stiffness: 420, damping: 30 },\n },\n fade: {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n transition: { duration: 0.2 },\n },\n pop: {\n initial: { scale: 0.96, opacity: 0 },\n animate: { scale: 1, opacity: 1 },\n transition: { type: \"spring\", stiffness: 520, damping: 28 },\n },\n};\n","import { cva } from \"class-variance-authority\";\n\nexport const alertVariants = cva(\n \"relative flex w-full gap-3 border text-sm ring-offset-slate-950 transition-colors\",\n {\n variants: {\n appearance: {\n default: \"border-white/10 bg-white/5 text-slate-50\",\n success: \"border-emerald-500/40 bg-emerald-500/10 text-emerald-50\",\n warning: \"border-amber-500/40 bg-amber-500/10 text-amber-50\",\n error: \"border-rose-500/50 bg-rose-500/10 text-rose-50\",\n info: \"border-sky-500/40 bg-sky-500/10 text-sky-50\",\n ghost: \"border-transparent bg-transparent text-slate-200\",\n purple: \"border-purple-600 bg-purple-950/70 backdrop-blur-xl\",\n pink: \"border-pink-600 bg-pink-950/70 backdrop-blur-xl\",\n orange: \"border-orange-600 bg-orange-950/70 backdrop-blur-xl\",\n yellow: \"border-yellow-600 bg-yellow-950/70 backdrop-blur-xl\",\n teal: \"border-teal-600 bg-teal-950/70 backdrop-blur-xl\",\n indigo: \"border-indigo-600 bg-indigo-950/70 backdrop-blur-xl\",\n gray: \"border-gray-600 bg-gray-950/70 backdrop-blur-xl\",\n violet: \"border-violet-600 bg-violet-950/70 backdrop-blur-xl\",\n \"gradient-blue\": \"border-gradient-to-r from-blue-600 to-purple-600 bg-gradient-to-r from-blue-950/70 to-purple-950/70 backdrop-blur-xl\",\n \"gradient-green\": \"border-gradient-to-r from-green-600 to-lime-600 bg-gradient-to-r from-green-950/70 to-lime-950/70 backdrop-blur-xl\",\n \"gradient-red\": \"border-gradient-to-r from-red-600 to-pink-600 bg-gradient-to-r from-red-950/70 to-pink-950/70 backdrop-blur-xl\",\n \"gradient-yellow\": \"border-gradient-to-r from-yellow-600 to-orange-600 bg-gradient-to-r from-yellow-950/70 to-orange-950/70 backdrop-blur-xl\",\n \"gradient-purple\": \"border-gradient-to-r from-purple-600 to-pink-600 bg-gradient-to-r from-purple-950/70 to-pink-950/70 backdrop-blur-xl\",\n \"gradient-teal\": \"border-gradient-to-r from-teal-600 to-cyan-600 bg-gradient-to-r from-teal-950/70 to-cyan-950/70 backdrop-blur-xl\",\n \"gradient-indigo\": \"border-gradient-to-r from-indigo-600 to-purple-600 bg-gradient-to-r from-indigo-950/70 to-purple-950/70 backdrop-blur-xl\",\n \"gradient-pink\": \"border-gradient-to-r from-pink-600 to-rose-600 bg-gradient-to-r from-pink-950/70 to-rose-950/70 backdrop-blur-xl\",\n \"gradient-orange\": \"border-gradient-to-r from-orange-600 to-red-600 bg-gradient-to-r from-orange-950/70 to-red-950/70 backdrop-blur-xl\",\n },\n size: {\n sm: \"rounded-lg p-3\",\n md: \"rounded-xl p-4\",\n lg: \"rounded-2xl p-5 text-base\",\n },\n },\n defaultVariants: {\n appearance: \"default\",\n size: \"md\",\n },\n },\n);\n\nexport const alertTitleVariants = cva(\"font-semibold leading-tight\", {\n variants: {\n size: {\n sm: \"text-xs md:text-sm\",\n md: \"text-xs md:text-sm\",\n lg: \"text-xs md:text-sm\",\n },\n },\n defaultVariants: { size: \"md\" },\n});\n\nexport const alertDescriptionVariants = cva(\"text-slate-300\", {\n variants: {\n size: {\n sm: \"text-xs md:text-sm\",\n md: \"text-xs md:text-sm\",\n lg: \"text-xs md:text-sm\",\n },\n },\n defaultVariants: { size: \"md\" },\n});\n"],"mappings":";;;;;;;AAEA,SAAS,eAAe,YAAY,eAAe;AACnD,SAAS,cAAc;AACvB,SAAS,uBAAuB,qBAAqB,eAAe;;;ACO7D,IAAM,wBAA+C;AAAA,EAC1D,MAAM,CAAC;AAAA,EACP,cAAc;AAAA,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F,MAAI,eAAe,SAAS;AAC1B,WAAO,oBAAC,yBAAsB,WAAU,UAAS,eAAW,MAAC;AAAA,EAC/D;AACA,SAAO,oBAAC,uBAAoB,WAAU,UAAS,eAAW,MAAC;AAC7D;","names":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
4
|
+
import { MouseEventHandler, ReactNode } from 'react';
|
|
5
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
|
+
|
|
7
|
+
declare const badgeVariants: (props?: ({
|
|
8
|
+
appearance?: "default" | "outline" | "ghost" | "secondary" | "destructive" | "glass" | "emerald" | "indigo" | "purple" | "pink" | "rose" | "sky" | "teal" | "yellow" | "orange" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | "gradient-orange" | null | undefined;
|
|
9
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
10
|
+
shape?: "pill" | "square" | "dot" | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
declare const badgeCloseButtonVariants: (props?: ({
|
|
13
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
14
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
|
+
|
|
16
|
+
type BadgeAnimation = "none" | "pop" | "bounce" | "fade";
|
|
17
|
+
type BadgeVariantProps = VariantProps<typeof badgeVariants>;
|
|
18
|
+
type BadgeProps = BadgeVariantProps & Omit<HTMLMotionProps<"span">, "children"> & {
|
|
19
|
+
animation?: BadgeAnimation;
|
|
20
|
+
closable?: boolean;
|
|
21
|
+
onClose?: MouseEventHandler<HTMLButtonElement>;
|
|
22
|
+
closeLabel?: string;
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
/** Dot shape hides text; set for accessibility. */
|
|
25
|
+
"aria-label"?: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
declare function Badge(props: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
29
|
+
declare namespace Badge {
|
|
30
|
+
var displayName: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type BadgePresetMotionProps = Pick<HTMLMotionProps<"span">, "style" | "transition" | "whileHover" | "whileTap" | "animate" | "initial">;
|
|
34
|
+
type BadgeAnimationPresets = Record<BadgeAnimation, BadgePresetMotionProps>;
|
|
35
|
+
declare const badgeAnimationPresets: BadgeAnimationPresets;
|
|
36
|
+
|
|
37
|
+
export { Badge, type BadgeAnimation, type BadgeProps, badgeAnimationPresets, badgeCloseButtonVariants, badgeVariants };
|