linkedunion-design-kit 1.9.0 → 1.9.2
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/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/src/components/Accordion/accordion.js +1 -1
- package/dist/src/components/Alerts/Alert/alert.d.ts +19 -0
- package/dist/src/components/Alerts/Alert/alert.js +156 -0
- package/dist/src/components/Alerts/Alert/alert.stories.d.ts +30 -0
- package/dist/src/components/Alerts/Alert/alert.stories.js +166 -0
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.d.ts +45 -0
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.js +168 -0
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.d.ts +69 -0
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.js +213 -0
- package/dist/src/components/Alerts/AlertDialog/index.d.ts +44 -0
- package/dist/src/components/Alerts/AlertDialog/index.js +189 -0
- package/dist/src/components/Avatar/Avatar/Avatar.d.ts +12 -3
- package/dist/src/components/Avatar/Avatar/Avatar.js +49 -11
- package/dist/src/components/Avatar/Avatar/Avatar.stories.d.ts +16 -2
- package/dist/src/components/Avatar/Avatar/Avatar.stories.js +51 -25
- package/dist/src/components/Avatar/Avatar/Avatar.test.js +6 -46
- package/dist/src/components/Avatar/Avatar/Avatar1.stories.d.ts +17 -0
- package/dist/src/components/Avatar/Avatar/Avatar1.stories.js +68 -0
- package/dist/src/components/Avatar/Avatar/index.d.ts +51 -28
- package/dist/src/components/Avatar/Avatar/index.js +76 -28
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.js +1 -1
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.stories.js +1 -1
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.d.ts +3 -0
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.js +18 -0
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.stories.d.ts +44 -0
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.stories.js +41 -0
- package/dist/src/components/Avatar/StatusIndicator/index.d.ts +27 -0
- package/dist/src/components/Avatar/StatusIndicator/index.js +29 -0
- package/dist/src/components/Avatar/StatusIndicator/type.d.ts +6 -0
- package/dist/src/components/Badge/Badge.d.ts +21 -0
- package/dist/src/components/Badge/Badge.js +59 -0
- package/dist/src/components/Badge/Badge.stories.d.ts +719 -0
- package/dist/src/components/Badge/Badge.stories.js +145 -0
- package/dist/src/components/Badge/index.d.ts +47 -0
- package/dist/src/components/Badge/index.js +49 -0
- package/dist/src/components/Button/Button/Button.d.ts +2 -2
- package/dist/src/components/Button/Button/Button.stories.d.ts +4 -4
- package/dist/src/components/Button/IconButton/IconButton.d.ts +2 -2
- package/dist/src/components/Button/IconButton/IconButton.stories.d.ts +4 -4
- package/dist/src/components/Dropdown/Combobox/Combobox.d.ts +3 -0
- package/dist/src/components/Dropdown/Combobox/Combobox.js +160 -0
- package/dist/src/components/Dropdown/Combobox/Combobox.stories.d.ts +13 -0
- package/dist/src/components/Dropdown/Combobox/Combobox.stories.js +225 -0
- package/dist/src/components/Dropdown/Combobox/index.d.ts +35 -0
- package/dist/src/components/Dropdown/Combobox/index.js +36 -0
- package/dist/src/components/Dropdown/Combobox/type.d.ts +25 -0
- package/dist/src/components/Dropdown/Combobox/utils/getLabelVariant.d.ts +3 -0
- package/dist/src/components/Dropdown/Combobox/utils/getLabelVariant.js +7 -0
- package/dist/src/components/Dropdown/Combobox/utils/renderBadge.d.ts +6 -0
- package/dist/src/components/Dropdown/Combobox/utils/renderBadge.js +5 -0
- package/dist/src/components/Dropdown/Combobox/utils/useResponsiveBadge.d.ts +1 -0
- package/dist/src/components/Dropdown/Combobox/utils/useResponsiveBadge.js +14 -0
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.d.ts +37 -0
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.js +96 -0
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.d.ts +25 -0
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.js +253 -0
- package/dist/src/components/Dropdown/DropdownMenu/SelectAllSection.d.ts +3 -0
- package/dist/src/components/Dropdown/DropdownMenu/SelectAllSection.js +9 -0
- package/dist/src/components/Dropdown/DropdownMenu/index.d.ts +20 -0
- package/dist/src/components/Dropdown/DropdownMenu/index.js +21 -0
- package/dist/src/components/Dropdown/DropdownMenu/type.d.ts +7 -0
- package/dist/src/components/Dropdown/Select.stories.d.ts +162 -0
- package/dist/src/components/Dropdown/Select.stories.js +138 -0
- package/dist/src/components/Dropdown/index.d.ts +37 -0
- package/dist/src/components/Dropdown/index.js +32 -0
- package/dist/src/components/Dropdown/select.d.ts +38 -0
- package/dist/src/components/Dropdown/select.js +87 -0
- package/dist/src/components/Icons/LUIcon.d.ts +1 -1
- package/dist/src/components/Icons/LUIcon.js +15 -8
- package/dist/src/components/Icons/LUIcon.test.d.ts +0 -1
- package/dist/src/components/Icons/LUIcon.test.js +306 -253
- package/dist/src/components/Icons/index.d.ts +23 -8
- package/dist/src/components/Icons/index.js +43 -28
- package/dist/src/components/Icons/stories/InteractiveIconSelector.js +3 -3
- package/dist/src/components/Icons/stories/LUIcon.stories.d.ts +9 -5
- package/dist/src/components/Icons/stories/LUIcon.stories.js +28 -43
- package/dist/src/components/Icons/type.d.ts +0 -1
- package/dist/src/components/SweetAlert/SweetAlert.d.ts +40 -0
- package/dist/src/components/SweetAlert/SweetAlert.js +150 -0
- package/dist/src/components/SweetAlert/SweetAlert.stories.d.ts +86 -0
- package/dist/src/components/SweetAlert/SweetAlert.stories.js +305 -0
- package/dist/src/components/SweetAlert/index.d.ts +24 -0
- package/dist/src/components/SweetAlert/index.js +137 -0
- package/dist/src/components/ui/avatar.d.ts +10 -3
- package/dist/src/components/ui/avatar.js +27 -12
- package/dist/src/components/ui/command.d.ts +22 -0
- package/dist/src/components/ui/command.js +65 -0
- package/dist/src/components/ui/dialog.d.ts +15 -0
- package/dist/src/components/ui/dialog.js +68 -0
- package/dist/src/components/ui/popover.d.ts +7 -0
- package/dist/src/components/ui/popover.js +42 -0
- package/dist/src/utils/constants.d.ts +1 -0
- package/dist/src/utils/constants.js +1 -0
- package/dist/styles/global.css +935 -51
- package/dist/tailwind.config.js +6 -0
- package/package.json +7 -1
- package/dist/next.config.d.ts +0 -8
- package/dist/next.config.js +0 -10
- package/dist/src/components/Button/Button/index.d.ts +0 -63
- package/dist/src/components/Button/Button/index.js +0 -64
- package/dist/src/components/Button/Button.d.ts +0 -20
- package/dist/src/components/Button/Button.js +0 -83
- package/dist/src/components/Button/Button.stories.d.ts +0 -725
- package/dist/src/components/Button/Button.stories.js +0 -288
- package/dist/src/components/Button/Button.test.js +0 -10
- package/dist/src/components/Button/IconButton/index.d.ts +0 -0
- package/dist/src/components/Button/IconButton/index.js +0 -1
- package/dist/src/components/Button/IconButton.d.ts +0 -33
- package/dist/src/components/Button/IconButton.js +0 -79
- package/dist/src/components/Button/IconButton.stories.d.ts +0 -4
- package/dist/src/components/Button/IconButton.stories.js +0 -65
- package/dist/src/components/Button/IconButton.test.js +0 -28
- package/dist/src/components/Icons/IconList.test.d.ts +0 -1
- package/dist/src/components/Icons/IconList.test.js +0 -58
- package/dist/src/components/Icons/IconView.d.ts +0 -1
- package/dist/src/components/Icons/IconView.js +0 -8
- package/dist/src/components/Icons/IconView.stories.d.ts +0 -4
- package/dist/src/components/Icons/IconView.stories.js +0 -20
- package/dist/src/components/Icons/LUIcon.stories.d.ts +0 -6
- package/dist/src/components/Icons/LUIcon.stories.js +0 -75
- package/dist/src/components/Icons/SingleIcon.test.d.ts +0 -1
- package/dist/src/components/Icons/SingleIcon.test.js +0 -68
- package/dist/src/components/MediaCard/Card.d.ts +0 -3
- package/dist/src/components/MediaCard/Card.js +0 -45
- package/dist/src/components/MediaCard/Card.stories.d.ts +0 -4
- package/dist/src/components/MediaCard/Card.stories.js +0 -57
- package/dist/src/components/MediaCard/Card.test.d.ts +0 -1
- package/dist/src/components/MediaCard/Card.test.js +0 -28
- package/dist/src/components/MediaCard/ContactProfile/ContactProfile.d.ts +0 -2
- package/dist/src/components/MediaCard/ContactProfile/ContactProfile.js +0 -27
- package/dist/src/components/MediaCard/ContactProfile/ContactProfile.test.d.ts +0 -1
- package/dist/src/components/MediaCard/ContactProfile/ContactProfile.test.js +0 -61
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.d.ts +0 -2
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.js +0 -7
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.test.d.ts +0 -1
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.test.js +0 -99
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.d.ts +0 -2
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.js +0 -7
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.test.d.ts +0 -1
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.test.js +0 -99
- package/dist/src/components/MediaCard/PostByCategory/PostByCategory.d.ts +0 -2
- package/dist/src/components/MediaCard/PostByCategory/PostByCategory.js +0 -31
- package/dist/src/components/MediaCard/PostByCategory/PostByCategory.test.d.ts +0 -1
- package/dist/src/components/MediaCard/PostByCategory/PostByCategory.test.js +0 -62
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.d.ts +0 -2
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.js +0 -7
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.test.d.ts +0 -1
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.test.js +0 -99
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.d.ts +0 -2
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.js +0 -7
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.test.d.ts +0 -1
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.test.js +0 -99
- package/dist/src/components/MediaCard/VerticalCard/VerticalCard.d.ts +0 -3
- package/dist/src/components/MediaCard/VerticalCard/VerticalCard.js +0 -13
- package/dist/src/components/MediaCard/VerticalCard/VerticalCard.stories.d.ts +0 -5
- package/dist/src/components/MediaCard/VerticalCard/VerticalCard.stories.js +0 -40
- package/dist/src/components/MediaCard/index.d.ts +0 -9
- package/dist/src/components/MediaCard/index.js +0 -13
- package/dist/src/components/MediaCard/type.d.ts +0 -47
- package/dist/src/components/RadioButton/RadioButton.stories.d.ts +0 -10
- package/dist/src/components/RadioButton/RadioButton.stories.js +0 -82
- package/dist/src/components/RadioButton/RadioGroup.stories.d.ts +0 -10
- package/dist/src/components/RadioButton/RadioGroup.stories.js +0 -131
- package/dist/src/components/RadioButton/radio-button.d.ts +0 -14
- package/dist/src/components/RadioButton/radio-button.js +0 -57
- package/dist/src/components/RadioButton/radio-group.d.ts +0 -21
- package/dist/src/components/RadioButton/radio-group.js +0 -59
- package/dist/src/components/ui/accordion.d.ts +0 -7
- package/dist/src/components/ui/accordion.js +0 -64
- package/dist/src/components/ui/caption.d.ts +0 -8
- package/dist/src/components/ui/caption.js +0 -34
- package/dist/src/components/ui/checkbox.d.ts +0 -4
- package/dist/src/components/ui/checkbox.js +0 -31
- package/dist/src/components/ui/input.d.ts +0 -3
- package/dist/src/components/ui/input.js +0 -29
- package/dist/src/components/ui/switch.d.ts +0 -22
- package/dist/src/components/ui/switch.js +0 -70
- package/dist/src/context/LocalizationContext.d.ts +0 -23
- package/dist/src/context/LocalizationContext.js +0 -17
- package/dist/src/utils/index.d.ts +0 -17
- package/dist/src/utils/index.js +0 -20
- /package/dist/src/components/{MediaCard → Avatar/StatusIndicator}/type.js +0 -0
- /package/dist/src/components/{Button/Button.test.d.ts → Dropdown/Combobox/type.js} +0 -0
- /package/dist/src/components/{Button/IconButton.test.d.ts → Dropdown/DropdownMenu/type.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { default as LUIcon } from "./src/components/Icons/LUIcon";
|
|
2
2
|
export { default as Card } from "./src/components/Card/card";
|
|
3
3
|
export { default as LuImage } from "./src/components/Images/LuImage";
|
|
4
|
-
export { default as Avatar } from "./src/components/Avatar/Avatar/Avatar";
|
|
5
4
|
export { default as Title } from "./src/components/Title/Title";
|
|
6
5
|
export { IconButton } from "./src/components/Button/IconButton/IconButton";
|
|
7
6
|
export { default as ColorPicker } from "./src/components/ColorPicker/ColorPicker";
|
|
@@ -22,3 +21,6 @@ export { Slider } from "./src/components/Slider/slider";
|
|
|
22
21
|
export { RadioGroup, RadioGroupItem, } from "./src/components/RadioGroup/radio-group";
|
|
23
22
|
export { AppIcon } from "./src/components/AppIcons";
|
|
24
23
|
export { Tabs, TabsList, TabsTrigger, TabsContent, } from "./src/components/Tabs/tabs";
|
|
24
|
+
export { Select, SelectTrigger, SelectContent, SelectItem, SelectGroup, SelectLabel, SelectSeparator, SelectValue, } from "./src/components/Dropdown/select";
|
|
25
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "./src/components/Alerts/AlertDialog";
|
|
26
|
+
export { Avatar, AvatarImage, AvatarFallback, } from "./src/components/Avatar/Avatar/Avatar";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { default as LUIcon } from "./src/components/Icons/LUIcon";
|
|
2
2
|
export { default as Card } from "./src/components/Card/card";
|
|
3
3
|
export { default as LuImage } from "./src/components/Images/LuImage";
|
|
4
|
-
export { default as Avatar } from "./src/components/Avatar/Avatar/Avatar";
|
|
5
4
|
export { default as Title } from "./src/components/Title/Title";
|
|
6
5
|
export { IconButton } from "./src/components/Button/IconButton/IconButton";
|
|
7
6
|
export { default as ColorPicker } from "./src/components/ColorPicker/ColorPicker";
|
|
@@ -22,3 +21,6 @@ export { Slider } from "./src/components/Slider/slider";
|
|
|
22
21
|
export { RadioGroup, RadioGroupItem, } from "./src/components/RadioGroup/radio-group";
|
|
23
22
|
export { AppIcon } from "./src/components/AppIcons";
|
|
24
23
|
export { Tabs, TabsList, TabsTrigger, TabsContent, } from "./src/components/Tabs/tabs";
|
|
24
|
+
export { Select, SelectTrigger, SelectContent, SelectItem, SelectGroup, SelectLabel, SelectSeparator, SelectValue, } from "./src/components/Dropdown/select";
|
|
25
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "./src/components/Alerts/AlertDialog";
|
|
26
|
+
export { Avatar, AvatarImage, AvatarFallback, } from "./src/components/Avatar/Avatar/Avatar";
|
|
@@ -55,7 +55,7 @@ function AccordionTrigger(_a) {
|
|
|
55
55
|
}
|
|
56
56
|
return function () { return observer.disconnect(); };
|
|
57
57
|
}, []);
|
|
58
|
-
return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, __assign({ ref: ref, "data-slot": "accordion-trigger", className: cn("flex items-center gap-2 cursor-pointer !text-sm !font-normal !leading-normal grow m-0", className) }, props, { children: [_jsx(LUIcon, { color: "
|
|
58
|
+
return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, __assign({ ref: ref, "data-slot": "accordion-trigger", className: cn("flex items-center gap-2 cursor-pointer !text-sm !font-normal !leading-normal grow m-0", className) }, props, { children: [_jsx(LUIcon, { color: "light-gray", icon: isOpen ? "minus" : "plus", size: "md", className: "pointer-events-none shrink-0" }), children] })) }));
|
|
59
59
|
}
|
|
60
60
|
function AccordionContent(_a) {
|
|
61
61
|
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Button } from "../../Button/Button/Button";
|
|
4
|
+
declare const alertVariants: (props?: ({
|
|
5
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
6
|
+
shadow?: "lg" | "none" | null | undefined;
|
|
7
|
+
color?: "blue" | "green" | "yellow" | "red" | "indigo" | "gray" | null | undefined;
|
|
8
|
+
variant?: "fill" | "outline" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "color">, VariantProps<typeof alertVariants> {
|
|
11
|
+
}
|
|
12
|
+
export declare function Alert({ className, size, shadow, color, variant, ...props }: AlertProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function AlertHeader({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function AlertTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function AlertDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function AlertFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare const AlertAction: ({ className, color: colorProp, ...props }: React.ComponentProps<typeof Button>) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const AlertCancel: ({ className, color: colorProp, ...props }: React.ComponentProps<typeof Button>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { createContext, useContext, Children, isValidElement, cloneElement, } from "react";
|
|
25
|
+
import { cva } from "class-variance-authority";
|
|
26
|
+
import { cn } from "../../../lib/utils";
|
|
27
|
+
import LUIcon from "../../Icons/LUIcon";
|
|
28
|
+
import { Button } from "../../Button/Button/Button";
|
|
29
|
+
var alertVariants = cva("grid w-full gap-4 rounded-lg border-l-4 p-4", {
|
|
30
|
+
variants: {
|
|
31
|
+
size: {
|
|
32
|
+
lg: "[&_[data-slot='alert-dialog-header']_svg:not(.lu-icon-custom-size)]:size-9 gap-4 [&_h2[data-slot='alert-dialog-title']]:text-2xl [&_h2[data-slot='alert-dialog-title']]:font-medium [&_p[data-slot='alert-dialog-description']]:text-lg [&_p[data-slot='alert-dialog-description']]:font-normal",
|
|
33
|
+
md: "[&_[data-slot='alert-dialog-header']_svg:not(.lu-icon-custom-size)]:size-8 gap-3 [&_h2[data-slot='alert-dialog-title']]:text-xl [&_h2[data-slot='alert-dialog-title']]:font-medium [&_p[data-slot='alert-dialog-description']]:text-base [&_p[data-slot='alert-dialog-description']]:font-normal",
|
|
34
|
+
sm: "[&_[data-slot='alert-dialog-header']_svg:not(.lu-icon-custom-size)]:size-7 gap-2 [&_h2[data-slot='alert-dialog-title']]:text-lg [&_h2[data-slot='alert-dialog-title']]:font-medium [&_p[data-slot='alert-dialog-description']]:text-sm [&_p[data-slot='alert-dialog-description']]:font-normal",
|
|
35
|
+
},
|
|
36
|
+
shadow: {
|
|
37
|
+
none: "",
|
|
38
|
+
lg: "shadow-lg",
|
|
39
|
+
},
|
|
40
|
+
color: {
|
|
41
|
+
blue: "bg-gray-50 text-blue-900 border-blue-600 [&_[data-slot='alert-dialog-header']_svg:not(.lu-icon-custom-color)]:text-blue-600 [&_h2[data-slot='alert-dialog-title']]:text-blue-600",
|
|
42
|
+
red: "bg-gray-50 text-red-900 border-red-600 [&_[data-slot='alert-dialog-header']_svg:not(.lu-icon-custom-color)]:text-red-600 [&_h2[data-slot='alert-dialog-title']]:text-red-600",
|
|
43
|
+
indigo: "bg-gray-50 text-indigo-900 border-indigo-600 [&_[data-slot='alert-dialog-header']_svg:not(.lu-icon-custom-color)]:text-indigo-600 [&_h2[data-slot='alert-dialog-title']]:text-indigo-600",
|
|
44
|
+
yellow: "bg-gray-50 text-yellow-900 border-yellow-600 [&_[data-slot='alert-dialog-header']_svg:not(.lu-icon-custom-color)]:text-yellow-600 [&_h2[data-slot='alert-dialog-title']]:text-yellow-600",
|
|
45
|
+
green: "bg-gray-50 text-green-900 border-green-600 [&_[data-slot='alert-dialog-header']_svg:not(.lu-icon-custom-color)]:text-green-600 [&_h2[data-slot='alert-dialog-title']]:text-green-600",
|
|
46
|
+
gray: "bg-gray-50 text-gray-900 border-gray-600 [&_[data-slot='alert-dialog-header']_svg:not(.lu-icon-custom-color)]:text-gray-600 [&_h2[data-slot='alert-dialog-title']]:text-gray-600",
|
|
47
|
+
},
|
|
48
|
+
variant: {
|
|
49
|
+
outline: "",
|
|
50
|
+
fill: "",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
defaultVariants: {
|
|
54
|
+
size: "md",
|
|
55
|
+
shadow: "none",
|
|
56
|
+
color: "blue",
|
|
57
|
+
variant: "outline",
|
|
58
|
+
},
|
|
59
|
+
compoundVariants: [
|
|
60
|
+
{
|
|
61
|
+
color: "blue",
|
|
62
|
+
variant: "fill",
|
|
63
|
+
class: "bg-blue-100 text-blue-900 border-blue-600 [&_[data-slot='alert-dialog-header']_svg:not(.lu-icon-custom-color)]:text-blue-600 [&_h2[data-slot='alert-dialog-title']]:text-blue-600",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
color: "red",
|
|
67
|
+
variant: "fill",
|
|
68
|
+
class: "bg-red-100 text-red-900 border-red-600 [&_[data-slot='alert-dialog-header']_svg:not(.lu-icon-custom-color)]:text-red-600 [&_h2[data-slot='alert-dialog-title']]:text-red-600",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
color: "indigo",
|
|
72
|
+
variant: "fill",
|
|
73
|
+
class: "bg-indigo-100 text-indigo-900 border-indigo-600 [&_[data-slot='alert-dialog-header']_svg:not(.lu-icon-custom-color)]:text-indigo-600 [&_h2[data-slot='alert-dialog-title']]:text-indigo-600",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
color: "yellow",
|
|
77
|
+
variant: "fill",
|
|
78
|
+
class: "bg-yellow-100 text-yellow-900 border-yellow-600 [&_[data-slot='alert-dialog-header']_svg:not(.lu-icon-custom-color)]:text-yellow-600 [&_h2[data-slot='alert-dialog-title']]:text-yellow-600",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
color: "green",
|
|
82
|
+
variant: "fill",
|
|
83
|
+
class: "bg-green-100 text-green-900 border-green-600 [&_[data-slot='alert-dialog-header']_svg:not(.lu-icon-custom-color)]:text-green-600 [&_h2[data-slot='alert-dialog-title']]:text-green-600",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
color: "gray",
|
|
87
|
+
variant: "fill",
|
|
88
|
+
class: "bg-gray-100 text-gray-900 border-gray-600 [&_[data-slot='alert-dialog-header']_svg:not(.lu-icon-custom-color)]:text-gray-600 [&_h2[data-slot='alert-dialog-title']]:text-gray-600",
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
});
|
|
92
|
+
// Create context for Alert color
|
|
93
|
+
var AlertContext = createContext({});
|
|
94
|
+
var useAlertContext = function () { return useContext(AlertContext); };
|
|
95
|
+
export function Alert(_a) {
|
|
96
|
+
var className = _a.className, size = _a.size, shadow = _a.shadow, color = _a.color, variant = _a.variant, props = __rest(_a, ["className", "size", "shadow", "color", "variant"]);
|
|
97
|
+
return (_jsx(AlertContext.Provider, { value: { color: color || undefined }, children: _jsx("div", __assign({ "data-slot": "inline-alert", className: cn(alertVariants({
|
|
98
|
+
size: size,
|
|
99
|
+
shadow: shadow,
|
|
100
|
+
color: color,
|
|
101
|
+
variant: variant,
|
|
102
|
+
}), className) }, props)) }));
|
|
103
|
+
}
|
|
104
|
+
export function AlertHeader(_a) {
|
|
105
|
+
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
|
106
|
+
// Check if children contains LUIcon
|
|
107
|
+
var childrenArray = Children.toArray(children);
|
|
108
|
+
var hasIcon = childrenArray.some(function (child) { return isValidElement(child) && child.type === LUIcon; });
|
|
109
|
+
if (hasIcon) {
|
|
110
|
+
var iconWithClass_1 = null;
|
|
111
|
+
var otherChildren_1 = [];
|
|
112
|
+
childrenArray.forEach(function (child) {
|
|
113
|
+
if (isValidElement(child) && child.type === LUIcon) {
|
|
114
|
+
var iconElement = child;
|
|
115
|
+
// If LUIcon has a size prop, add .lu-icon-custom-size to className
|
|
116
|
+
var hasSizeProp = !!iconElement.props.size;
|
|
117
|
+
// If LUIcon has a color prop, add .lu-icon-custom-color to className
|
|
118
|
+
var hasColorProp = !!iconElement.props.color;
|
|
119
|
+
iconWithClass_1 = cloneElement(iconElement, {
|
|
120
|
+
className: cn(iconElement.props.className, hasSizeProp && "lu-icon-custom-size", hasColorProp && "lu-icon-custom-color"),
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
otherChildren_1.push(child);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
return (_jsxs("div", __assign({ "data-slot": "alert-dialog-header", className: cn("flex flex-row gap-3 items-start text-left", className) }, props, { children: [iconWithClass_1, _jsx("div", { children: otherChildren_1 })] })));
|
|
128
|
+
}
|
|
129
|
+
return (_jsx("div", __assign({ "data-slot": "alert-dialog-header", className: cn("flex flex-col gap-2 text-center sm:text-left", className) }, props, { children: children })));
|
|
130
|
+
}
|
|
131
|
+
export function AlertTitle(_a) {
|
|
132
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
133
|
+
return (_jsx("h2", __assign({ "data-slot": "alert-dialog-title", className: cn("text-lg font-semibold", className) }, props)));
|
|
134
|
+
}
|
|
135
|
+
export function AlertDescription(_a) {
|
|
136
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
137
|
+
return (_jsx("p", __assign({ "data-slot": "alert-dialog-description", className: cn("text-black text-sm", className) }, props)));
|
|
138
|
+
}
|
|
139
|
+
export function AlertFooter(_a) {
|
|
140
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
141
|
+
return (_jsx("div", __assign({ "data-slot": "alert-dialog-footer", className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className) }, props)));
|
|
142
|
+
}
|
|
143
|
+
// Also create a simple button component that matches the style of AlertDialogAction
|
|
144
|
+
export var AlertAction = function (_a) {
|
|
145
|
+
var className = _a.className, colorProp = _a.color, props = __rest(_a, ["className", "color"]);
|
|
146
|
+
var contextColor = useAlertContext().color;
|
|
147
|
+
var color = colorProp || contextColor || undefined;
|
|
148
|
+
return (_jsx(Button, __assign({ variant: "link", color: color, "data-slot": "alert-dialog-action", className: cn("h-auto p-0", className) }, props)));
|
|
149
|
+
};
|
|
150
|
+
// And a cancel button that matches AlertDialogCancel
|
|
151
|
+
export var AlertCancel = function (_a) {
|
|
152
|
+
var className = _a.className, colorProp = _a.color, props = __rest(_a, ["className", "color"]);
|
|
153
|
+
var contextColor = useAlertContext().color;
|
|
154
|
+
var color = colorProp || contextColor || undefined;
|
|
155
|
+
return (_jsx(Button, __assign({ variant: "link", color: color, "data-slot": "alert-dialog-cancel", className: cn("h-auto p-0", className) }, props)));
|
|
156
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Meta } from "@storybook/react";
|
|
2
|
+
declare const _default: Meta;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, any>;
|
|
5
|
+
export declare const Example: {
|
|
6
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
story: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare const AllColors: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const AllSizes: () => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare const Variants: () => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const ComparisonWithAlertDialog: () => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const NoButtons: () => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const WithShadow: () => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const CustomizeAlert: {
|
|
22
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
parameters: {
|
|
24
|
+
docs: {
|
|
25
|
+
description: {
|
|
26
|
+
story: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Alert, AlertAction, AlertCancel, AlertHeader, AlertTitle, AlertDescription, AlertFooter, colorOptions, sizeOptions, shadowOptions, variantOptions, getIconForColor, getContentForColor, } from "../AlertDialog/index";
|
|
3
|
+
import LUIcon from "../../Icons/LUIcon";
|
|
4
|
+
import { Button } from "../../Button/Button/Button";
|
|
5
|
+
import { Heading } from "../../Typography/Heading/heading";
|
|
6
|
+
import { Body } from "../../Typography/Body/body";
|
|
7
|
+
export default {
|
|
8
|
+
title: "Components/Alert/Alert",
|
|
9
|
+
component: Alert,
|
|
10
|
+
tags: ["autodocs"],
|
|
11
|
+
parameters: {
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component: "A non-modal alert component that uses the same styling as AlertDialog but renders directly in the page flow without requiring a dialog context.",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
// Template for stories with args
|
|
20
|
+
var Template = function (args) { return (_jsxs(Alert, { size: args.size, shadow: args.shadow, color: args.color, variant: args.variant, children: [_jsxs(AlertHeader, { children: [args.Icon && _jsx(LUIcon, { icon: args.Icon, variant: "padded" }), _jsx(AlertTitle, { children: args.title }), _jsx(AlertDescription, { children: args.description })] }), _jsxs(AlertFooter, { children: [args.showCancel && (_jsx(AlertCancel, { onClick: function () { return alert("Cancel clicked"); }, className: "text-blue-600 hover:text-blue-700 hover:underline", children: args.cancelText })), args.showAction && (_jsx(AlertAction, { onClick: function () { return alert("Action clicked"); }, className: "text-blue-600 hover:text-blue-700 hover:underline", children: args.actionText }))] })] })); };
|
|
21
|
+
// Default story with all controls
|
|
22
|
+
export var Default = Template.bind({});
|
|
23
|
+
Default.args = {
|
|
24
|
+
size: "md",
|
|
25
|
+
shadow: "none",
|
|
26
|
+
color: "blue",
|
|
27
|
+
variant: "outline",
|
|
28
|
+
Icon: "info",
|
|
29
|
+
title: "Update Available",
|
|
30
|
+
description: "A new version of the application is available. Would you like to update now? The update includes bug fixes and performance improvements.",
|
|
31
|
+
cancelText: "Later",
|
|
32
|
+
actionText: "Update Now",
|
|
33
|
+
showCancel: true,
|
|
34
|
+
showAction: true,
|
|
35
|
+
};
|
|
36
|
+
Default.argTypes = {
|
|
37
|
+
size: {
|
|
38
|
+
control: { type: "select" },
|
|
39
|
+
options: sizeOptions,
|
|
40
|
+
description: "Size variant for Alert",
|
|
41
|
+
table: {
|
|
42
|
+
defaultValue: { summary: "md" },
|
|
43
|
+
type: { summary: "enum" },
|
|
44
|
+
category: "Alert",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
shadow: {
|
|
48
|
+
control: { type: "select" },
|
|
49
|
+
options: shadowOptions,
|
|
50
|
+
description: "Shadow variant for Alert",
|
|
51
|
+
table: {
|
|
52
|
+
defaultValue: { summary: "none" },
|
|
53
|
+
type: { summary: "enum" },
|
|
54
|
+
category: "Alert",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
color: {
|
|
58
|
+
control: { type: "select" },
|
|
59
|
+
options: colorOptions,
|
|
60
|
+
description: "Color theme for Alert",
|
|
61
|
+
table: {
|
|
62
|
+
defaultValue: { summary: "blue" },
|
|
63
|
+
type: { summary: "enum" },
|
|
64
|
+
category: "Alert",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
variant: {
|
|
68
|
+
control: { type: "select" },
|
|
69
|
+
options: variantOptions,
|
|
70
|
+
description: "Variant for Alert (outline | fill)",
|
|
71
|
+
table: {
|
|
72
|
+
defaultValue: { summary: "outline" },
|
|
73
|
+
type: { summary: "enum" },
|
|
74
|
+
category: "Alert",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
Icon: {
|
|
78
|
+
control: { type: "text" },
|
|
79
|
+
description: "Icon to display in AlertHeader (LUIcon name)",
|
|
80
|
+
table: {
|
|
81
|
+
type: { summary: "string" },
|
|
82
|
+
category: "AlertHeader",
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
title: {
|
|
86
|
+
control: { type: "text" },
|
|
87
|
+
description: "Title text for AlertTitle",
|
|
88
|
+
table: {
|
|
89
|
+
type: { summary: "string" },
|
|
90
|
+
category: "AlertTitle",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
description: {
|
|
94
|
+
control: { type: "text" },
|
|
95
|
+
description: "Description text for AlertDescription",
|
|
96
|
+
table: {
|
|
97
|
+
type: { summary: "string" },
|
|
98
|
+
category: "AlertDescription",
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
cancelText: {
|
|
102
|
+
control: { type: "text" },
|
|
103
|
+
description: "Text for AlertCancel button",
|
|
104
|
+
table: {
|
|
105
|
+
type: { summary: "string" },
|
|
106
|
+
category: "AlertCancel",
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
actionText: {
|
|
110
|
+
control: { type: "text" },
|
|
111
|
+
description: "Text for AlertAction button",
|
|
112
|
+
table: {
|
|
113
|
+
type: { summary: "string" },
|
|
114
|
+
category: "AlertAction",
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
showCancel: {
|
|
118
|
+
control: { type: "boolean" },
|
|
119
|
+
description: "Whether to show the cancel button",
|
|
120
|
+
table: {
|
|
121
|
+
type: { summary: "boolean" },
|
|
122
|
+
category: "Alert",
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
showAction: {
|
|
126
|
+
control: { type: "boolean" },
|
|
127
|
+
description: "Whether to show the action button",
|
|
128
|
+
table: {
|
|
129
|
+
type: { summary: "boolean" },
|
|
130
|
+
category: "Alert",
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
// Simple Example showing the exact code structure
|
|
135
|
+
export var Example = function () { return (_jsxs(Alert, { color: "blue", size: "md", shadow: "none", children: [_jsxs(AlertHeader, { children: [_jsx(LUIcon, { icon: "info", variant: "padded" }), _jsx(AlertTitle, { children: "Update Available" }), _jsx(AlertDescription, { children: "A new version of the application is available. Would you like to update now? The update includes bug fixes and performance improvements." })] }), _jsxs(AlertFooter, { children: [_jsx(AlertCancel, { className: "text-blue-600 hover:text-blue-700 hover:underline", onClick: function () { return console.log("Later clicked"); }, children: "Later" }), _jsx(AlertAction, { className: "text-blue-600 hover:text-blue-700 hover:underline", onClick: function () { return console.log("Update Now clicked"); }, children: "Update Now" })] })] })); };
|
|
136
|
+
Example.parameters = {
|
|
137
|
+
docs: {
|
|
138
|
+
description: {
|
|
139
|
+
story: "This example shows the exact code structure you should use to implement the Alert component.",
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
// All Colors Example
|
|
144
|
+
export var AllColors = function () { return (_jsx("div", { className: "flex flex-col gap-4", children: colorOptions.map(function (color) {
|
|
145
|
+
var content = getContentForColor(color);
|
|
146
|
+
return (_jsxs(Alert, { color: color, children: [_jsxs(AlertHeader, { children: [_jsx(LUIcon, { icon: getIconForColor(color), variant: "padded" }), _jsx(AlertTitle, { children: content.title }), _jsx(AlertDescription, { children: content.description })] }), _jsxs(AlertFooter, { children: [_jsx(AlertCancel, { className: "text-".concat(color, "-600 hover:text-").concat(color, "-700 hover:underline"), children: "Cancel" }), _jsx(AlertAction, { className: "text-".concat(color, "-600 hover:text-").concat(color, "-700 hover:underline"), children: content.button })] })] }, color));
|
|
147
|
+
}) })); };
|
|
148
|
+
// All Sizes Example
|
|
149
|
+
export var AllSizes = function () { return (_jsx("div", { className: "flex flex-col gap-4", children: sizeOptions.map(function (size) { return (_jsxs(Alert, { size: size, color: "blue", children: [_jsxs(AlertHeader, { children: [_jsx(LUIcon, { icon: "info", color: "blue", variant: "padded" }), _jsxs(AlertTitle, { children: ["Size: ", size.toUpperCase()] }), _jsxs(AlertDescription, { children: ["This is an example of the Alert component with size ", size, "."] })] }), _jsxs(AlertFooter, { children: [_jsx(AlertCancel, { className: "text-blue-600 hover:text-blue-700 hover:underline", children: "Cancel" }), _jsx(AlertAction, { className: "text-blue-600 hover:text-blue-700 hover:underline", children: "Action" })] })] }, size)); }) })); };
|
|
150
|
+
// Variants Example
|
|
151
|
+
export var Variants = function () { return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs(Alert, { variant: "outline", color: "blue", children: [_jsxs(AlertHeader, { children: [_jsx(LUIcon, { icon: "info", variant: "padded" }), _jsx(AlertTitle, { children: "Outline Variant" }), _jsx(AlertDescription, { children: "This is an example of the Alert component with the outline variant." })] }), _jsxs(AlertFooter, { children: [_jsx(AlertCancel, { className: "text-blue-600 hover:text-blue-700 hover:underline", children: "Cancel" }), _jsx(AlertAction, { className: "text-blue-600 hover:text-blue-700 hover:underline", children: "Action" })] })] }), _jsxs(Alert, { variant: "fill", color: "blue", children: [_jsxs(AlertHeader, { children: [_jsx(LUIcon, { icon: "info", variant: "padded" }), _jsx(AlertTitle, { children: "Fill Variant" }), _jsx(AlertDescription, { children: "This is an example of the Alert component with the fill variant." })] }), _jsxs(AlertFooter, { children: [_jsx(AlertCancel, { className: "text-blue-600 hover:text-blue-700 hover:underline", children: "Cancel" }), _jsx(AlertAction, { className: "text-blue-600 hover:text-blue-700 hover:underline", children: "Action" })] })] })] })); };
|
|
152
|
+
// Comparison with regular AlertDialog
|
|
153
|
+
export var ComparisonWithAlertDialog = function () { return (_jsxs("div", { className: "flex flex-col gap-8", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold mb-2", children: "Alert (Non-Modal)" }), _jsx("p", { className: "text-sm text-gray-600 mb-4", children: "This version renders directly in the page flow and does not create a modal overlay." }), _jsxs(Alert, { color: "green", children: [_jsxs(AlertHeader, { children: [_jsx(LUIcon, { icon: "check", variant: "padded" }), _jsx(AlertTitle, { children: "Success!" }), _jsx(AlertDescription, { children: "Your changes have been saved successfully." })] }), _jsx(AlertFooter, { children: _jsx(AlertAction, { className: "text-green-600 hover:text-green-700 hover:underline", children: "Close" }) })] })] }), _jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold mb-2", children: "AlertDialog Button (Modal - Click to Open)" }), _jsx("p", { className: "text-sm text-gray-600 mb-4", children: "This is the regular AlertDialog component that creates a modal overlay." }), _jsx(Button, { color: "light-green", onClick: function () { }, children: "Open Modal AlertDialog (See in Stories)" })] })] })); };
|
|
154
|
+
// No Buttons Example
|
|
155
|
+
export var NoButtons = function () { return (_jsx(Alert, { color: "yellow", children: _jsxs(AlertHeader, { children: [_jsx(LUIcon, { icon: "info", variant: "padded" }), _jsx(AlertTitle, { children: "Maintenance Notice" }), _jsx(AlertDescription, { children: "System maintenance is scheduled for tonight at 10:00 PM. The system will be unavailable for approximately 30 minutes." })] }) })); };
|
|
156
|
+
// With Shadow Example
|
|
157
|
+
export var WithShadow = function () { return (_jsxs(Alert, { color: "blue", shadow: "lg", children: [_jsxs(AlertHeader, { children: [_jsx(LUIcon, { icon: "info", variant: "padded" }), _jsx(AlertTitle, { children: "Information" }), _jsx(AlertDescription, { children: "This alert has a large shadow applied to it." })] }), _jsx(AlertFooter, { children: _jsx(AlertAction, { className: "text-blue-600 hover:text-blue-700 hover:underline", children: "Got it" }) })] })); };
|
|
158
|
+
// CustomizeAlert Example - showing how to customize with Typography components
|
|
159
|
+
export var CustomizeAlert = function () { return (_jsxs(Alert, { color: "red", size: "md", variant: "fill", children: [_jsxs(AlertHeader, { children: [_jsx(LUIcon, { icon: "info", size: "9xl", color: "light-red", variant: "padded" }), _jsx(AlertTitle, { children: _jsx(Heading, { variant: "h1-700", children: "Customize Alert Title" }) }), _jsx(AlertDescription, { children: _jsx(Body, { variant: "body-xs", children: "This Alert uses a customized icon size, custom typography variants, and different button colors to demonstrate full customization capabilities." }) })] }), _jsxs(AlertFooter, { children: [_jsx(AlertCancel, { variant: "fill", color: "indigo", children: "Close" }), _jsx(AlertAction, { variant: "outline", color: "light-green", children: "OK" })] })] })); };
|
|
160
|
+
CustomizeAlert.parameters = {
|
|
161
|
+
docs: {
|
|
162
|
+
description: {
|
|
163
|
+
story: "This example demonstrates how to customize the Alert component with different typography variants, icon sizes, colors, and button styles. The alert uses a fill variant with red color, custom typography components, a 9xl icon size, and mixed button variants with different colors.",
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
import { Button } from "../../Button/Button/Button";
|
|
5
|
+
export declare const alertDialogVariants: {
|
|
6
|
+
size: {
|
|
7
|
+
lg: string;
|
|
8
|
+
md: string;
|
|
9
|
+
sm: string;
|
|
10
|
+
};
|
|
11
|
+
shadow: {
|
|
12
|
+
none: string;
|
|
13
|
+
lg: string;
|
|
14
|
+
};
|
|
15
|
+
color: {
|
|
16
|
+
blue: string;
|
|
17
|
+
red: string;
|
|
18
|
+
indigo: string;
|
|
19
|
+
yellow: string;
|
|
20
|
+
green: string;
|
|
21
|
+
gray: string;
|
|
22
|
+
};
|
|
23
|
+
variant: {
|
|
24
|
+
outline: string;
|
|
25
|
+
fill: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
declare const alertDialogContentVariants: (props?: ({
|
|
29
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
30
|
+
shadow?: "lg" | "none" | null | undefined;
|
|
31
|
+
color?: "blue" | "green" | "yellow" | "red" | "indigo" | "gray" | null | undefined;
|
|
32
|
+
variant?: "fill" | "outline" | null | undefined;
|
|
33
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
34
|
+
declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
declare function AlertDialogContent({ className, size, shadow, color, variant, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content> & VariantProps<typeof alertDialogContentVariants>): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
declare function AlertDialogHeader({ className, children, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
declare function AlertDialogAction({ className, color: colorProp, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action> & React.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
declare function AlertDialogCancel({ className, color: colorProp, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> & React.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|