linkedunion-design-kit 1.11.2 → 1.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/layout.d.ts +1 -1
- package/dist/app/{layout.jsx → layout.js} +2 -3
- package/dist/app/page.d.ts +1 -1
- package/dist/app/page.js +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/src/components/Accordion/Accordion.stories.js +32 -0
- package/dist/src/components/Accordion/accordion.d.ts +4 -4
- package/dist/src/components/Accordion/{accordion.jsx → accordion.js} +16 -11
- package/dist/src/components/Alerts/Alert/alert.d.ts +7 -7
- package/dist/src/components/Alerts/Alert/{alert.jsx → alert.js} +25 -21
- package/dist/src/components/Alerts/Alert/alert.stories.d.ts +8 -8
- package/dist/src/components/Alerts/Alert/alert.stories.js +166 -0
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.d.ts +11 -11
- package/dist/src/components/Alerts/AlertDialog/{alert-dialog.jsx → alert-dialog.js} +24 -26
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.d.ts +10 -10
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.js +213 -0
- package/dist/src/components/AppIcons/AndroidIcon.js +28 -0
- package/dist/src/components/AppIcons/{AppIcon.jsx → AppIcon.js} +15 -4
- package/dist/src/components/AppIcons/AppleIcon.js +28 -0
- package/dist/src/components/AppIcons/PlayStoreIcon.js +28 -0
- package/dist/src/components/Avatar/Avatar/{Avatar.jsx → Avatar.js} +18 -13
- package/dist/src/components/Avatar/Avatar/Avatar.stories.d.ts +7 -7
- package/dist/src/components/Avatar/Avatar/Avatar.stories.js +69 -0
- package/dist/src/components/Avatar/Avatar/{Avatar.test.jsx → Avatar.test.js} +2 -1
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.js +8 -0
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.stories.js +14 -0
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.js +18 -0
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.stories.d.ts +2 -2
- package/dist/src/components/Avatar/StatusIndicator/{StatusIndicator.stories.jsx → StatusIndicator.stories.js} +3 -12
- package/dist/src/components/Badge/Badge.d.ts +1 -1
- package/dist/src/components/Badge/{Badge.jsx → Badge.js} +13 -8
- package/dist/src/components/Badge/Badge.stories.d.ts +10 -10
- package/dist/src/components/Badge/Badge.stories.js +145 -0
- package/dist/src/components/Button/Button/Button.d.ts +1 -1
- package/dist/src/components/Button/Button/{Button.jsx → Button.js} +13 -6
- package/dist/src/components/Button/Button/Button.stories.d.ts +1 -1
- package/dist/src/components/Button/Button/{Button.stories.jsx → Button.stories.js} +13 -1
- package/dist/src/components/Button/Button/Button.test.js +10 -0
- package/dist/src/components/Button/IconButton/IconButton.d.ts +1 -1
- package/dist/src/components/Button/IconButton/{IconButton.jsx → IconButton.js} +13 -4
- package/dist/src/components/Button/IconButton/IconButton.stories.d.ts +1 -1
- package/dist/src/components/Button/IconButton/{IconButton.stories.jsx → IconButton.stories.js} +13 -1
- package/dist/src/components/Button/IconButton/{IconButton.test.jsx → IconButton.test.js} +6 -5
- package/dist/src/components/Card/MultipleNews/MultiNews.d.ts +1 -1
- package/dist/src/components/Card/MultipleNews/MultiNews.js +46 -0
- package/dist/src/components/Card/MultipleNews/{MultiNews.stories.jsx → MultiNews.stories.js} +2 -1
- package/dist/src/components/Card/PostByCategory/PostByCategory.d.ts +1 -1
- package/dist/src/components/Card/PostByCategory/PostByCategory.js +37 -0
- package/dist/src/components/Card/PostByCategory/{PostByCategory.stories.jsx → PostByCategory.stories.js} +2 -1
- package/dist/src/components/Card/SinglePost/SinglePost.d.ts +1 -1
- package/dist/src/components/Card/SinglePost/SinglePost.js +10 -0
- package/dist/src/components/Card/card.d.ts +1 -2
- package/dist/src/components/Card/{card.jsx → card.js} +13 -2
- package/dist/src/components/Card/contactProfile/ContactProfile.d.ts +1 -1
- package/dist/src/components/Card/contactProfile/ContactProfile.js +39 -0
- package/dist/src/components/Card/contactProfile/{ContactProfile.stories.jsx → ContactProfile.stories.js} +2 -1
- package/dist/src/components/Card/photoAlbum/PhotoAlbum.d.ts +1 -1
- package/dist/src/components/Card/photoAlbum/PhotoAlbum.js +16 -0
- package/dist/src/components/Card/photoAlbum/{PhotoAlbum.stories.jsx → PhotoAlbum.stories.js} +13 -1
- package/dist/src/components/Card/photoGallery/PhotoGallery.d.ts +1 -1
- package/dist/src/components/Card/photoGallery/PhotoGallery.js +8 -0
- package/dist/src/components/Card/photoGallery/{PhotoGallery.stories.jsx → PhotoGallery.stories.js} +13 -1
- package/dist/src/components/Checkbox/checkbox.d.ts +1 -1
- package/dist/src/components/Checkbox/{checkbox.jsx → checkbox.js} +13 -6
- package/dist/src/components/Checkbox/checkbox.stories.js +78 -0
- package/dist/src/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/src/components/ColorPicker/{ColorPicker.jsx → ColorPicker.js} +13 -6
- package/dist/src/components/ColorPicker/ColorPicker.stories.d.ts +5 -5
- package/dist/src/components/ColorPicker/ColorPicker.stories.js +77 -0
- package/dist/src/components/Colors/color.d.ts +1 -1
- package/dist/src/components/Colors/{color.jsx → color.js} +2 -1
- package/dist/src/components/Colors/color.stories.js +32 -0
- package/dist/src/components/Colors/{color.test.jsx → color.test.js} +4 -3
- package/dist/src/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/src/components/DatePicker/DatePicker.js +64 -0
- package/dist/src/components/DatePicker/DatePicker.stories.d.ts +9 -9
- package/dist/src/components/DatePicker/DatePicker.stories.js +171 -0
- package/dist/src/components/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/src/components/DateRangePicker/{DateRangePicker.jsx → DateRangePicker.js} +44 -92
- package/dist/src/components/DateRangePicker/DateRangePicker.stories.d.ts +19 -19
- package/dist/src/components/DateRangePicker/DateRangePicker.stories.js +318 -0
- package/dist/src/components/Dropdown/Combobox/Combobox.d.ts +1 -1
- package/dist/src/components/Dropdown/Combobox/{Combobox.jsx → Combobox.js} +29 -67
- package/dist/src/components/Dropdown/Combobox/Combobox.stories.d.ts +8 -8
- package/dist/src/components/Dropdown/Combobox/Combobox.stories.js +225 -0
- package/dist/src/components/Dropdown/Combobox/dialog.d.ts +10 -10
- package/dist/src/components/Dropdown/Combobox/dialog.js +68 -0
- package/dist/src/components/Dropdown/Combobox/utils/renderBadge.js +5 -0
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/src/components/Dropdown/DropdownMenu/{DropdownMenu.jsx → DropdownMenu.js} +22 -28
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.d.ts +11 -11
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.js +253 -0
- package/dist/src/components/Dropdown/DropdownMenu/SelectAllSection.js +9 -0
- package/dist/src/components/Dropdown/Select.stories.d.ts +6 -7
- package/dist/src/components/Dropdown/{Select.stories.jsx → Select.stories.js} +8 -71
- package/dist/src/components/Dropdown/select.d.ts +10 -10
- 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.jsx → LUIcon.js} +13 -10
- package/dist/src/components/Icons/stories/IconDropdown.js +38 -0
- package/dist/src/components/Icons/stories/IconGallery.js +31 -0
- package/dist/src/components/Icons/stories/InteractiveIconSelector.js +26 -0
- package/dist/src/components/Icons/stories/LUIcon.stories.d.ts +5 -5
- package/dist/src/components/Icons/stories/{LUIcon.stories.jsx → LUIcon.stories.js} +8 -23
- package/dist/src/components/ImageUploader/imageUploader.d.ts +1 -1
- package/dist/src/components/ImageUploader/{imageUploader.jsx → imageUploader.js} +13 -28
- package/dist/src/components/Images/LuImage.d.ts +1 -1
- package/dist/src/components/Images/{LuImage.jsx → LuImage.js} +13 -1
- package/dist/src/components/Images/{LuImage.stories.jsx → LuImage.stories.js} +13 -1
- package/dist/src/components/Images/{LuImage.test.jsx → LuImage.test.js} +18 -6
- package/dist/src/components/Input/Input.stories.d.ts +8 -9
- package/dist/src/components/Input/Input.stories.js +133 -0
- package/dist/src/components/Input/input.d.ts +1 -1
- package/dist/src/components/Input/{input.jsx → input.js} +13 -10
- package/dist/src/components/Label/Label.d.ts +1 -1
- package/dist/src/components/Label/{Label.jsx → Label.js} +13 -2
- package/dist/src/components/Label/{Label.stories.jsx → Label.stories.js} +13 -1
- package/dist/src/components/Modal/Modal.d.ts +2 -2
- package/dist/src/components/Modal/{Modal.jsx → Modal.js} +18 -15
- package/dist/src/components/Modal/Modal.stories.d.ts +4 -4
- package/dist/src/components/Modal/Modal.stories.js +44 -0
- package/dist/src/components/Pagination/pagination.d.ts +5 -5
- package/dist/src/components/Pagination/{pagination.jsx → pagination.js} +21 -18
- package/dist/src/components/Pagination/pagination.stories.d.ts +6 -6
- package/dist/src/components/Pagination/pagination.stories.js +168 -0
- package/dist/src/components/RadioGroup/{RadioGroup.stories.jsx → RadioGroup.stories.js} +22 -52
- package/dist/src/components/RadioGroup/radio-group.d.ts +1 -1
- package/dist/src/components/RadioGroup/{radio-group.jsx → radio-group.js} +14 -6
- package/dist/src/components/Skeleton/skeleton.d.ts +14 -14
- package/dist/src/components/Skeleton/{skeleton.jsx → skeleton.js} +27 -23
- package/dist/src/components/Skeleton/skeleton.stories.d.ts +14 -14
- package/dist/src/components/Skeleton/skeleton.stories.js +414 -0
- package/dist/src/components/Slider/slider.d.ts +1 -1
- package/dist/src/components/Slider/slider.js +38 -0
- package/dist/src/components/SweetAlert/SweetAlert.d.ts +9 -9
- package/dist/src/components/SweetAlert/{SweetAlert.jsx → SweetAlert.js} +21 -18
- package/dist/src/components/SweetAlert/SweetAlert.stories.d.ts +7 -7
- package/dist/src/components/SweetAlert/{SweetAlert.stories.jsx → SweetAlert.stories.js} +15 -215
- package/dist/src/components/Switch/{Switch.stories.jsx → Switch.stories.js} +13 -1
- package/dist/src/components/Switch/switch.d.ts +1 -1
- package/dist/src/components/Switch/{switch.jsx → switch.js} +13 -4
- package/dist/src/components/Table/{Table.jsx → Table.js} +58 -111
- package/dist/src/components/Table/Table.stories.d.ts +13 -13
- package/dist/src/components/Table/{Table.stories.jsx → Table.stories.js} +45 -299
- package/dist/src/components/Table/{Table.test.jsx → Table.test.js} +7 -39
- package/dist/src/components/Tabs/{Tabs.stories.jsx → Tabs.stories.js} +3 -10
- package/dist/src/components/Tabs/tabs.d.ts +4 -4
- package/dist/src/components/Tabs/tabs.js +43 -0
- package/dist/src/components/TimePicker/TimePicker.d.ts +1 -1
- package/dist/src/components/TimePicker/{TimePicker.jsx → TimePicker.js} +30 -54
- package/dist/src/components/TimePicker/TimePicker.stories.d.ts +10 -10
- package/dist/src/components/TimePicker/TimePicker.stories.js +176 -0
- package/dist/src/components/Title/Title.d.ts +1 -1
- package/dist/src/components/Title/{Title.jsx → Title.js} +2 -2
- package/dist/src/components/Title/{Title.stories.jsx → Title.stories.js} +13 -1
- package/dist/src/components/Title/{Title.test.jsx → Title.test.js} +5 -4
- package/dist/src/components/ToolTip/Tooltip.d.ts +1 -1
- package/dist/src/components/ToolTip/Tooltip.js +8 -0
- package/dist/src/components/ToolTip/{Tooltip.stories.jsx → Tooltip.stories.js} +14 -2
- package/dist/src/components/Typography/Body/{Body.stories.jsx → Body.stories.js} +13 -1
- package/dist/src/components/Typography/Body/body.d.ts +1 -1
- package/dist/src/components/Typography/Body/{body.jsx → body.js} +13 -4
- package/dist/src/components/Typography/Caption/{Caption.stories.jsx → Caption.stories.js} +13 -1
- package/dist/src/components/Typography/Caption/caption.d.ts +1 -1
- package/dist/src/components/Typography/Caption/{caption.jsx → caption.js} +13 -4
- package/dist/src/components/Typography/Display/{Display.stories.jsx → Display.stories.js} +13 -1
- package/dist/src/components/Typography/Display/display.d.ts +1 -1
- package/dist/src/components/Typography/Display/{display.jsx → display.js} +13 -4
- package/dist/src/components/Typography/Heading/Heading.stories.d.ts +6 -6
- package/dist/src/components/Typography/Heading/Heading.stories.js +67 -0
- package/dist/src/components/Typography/Heading/{heading.jsx → heading.js} +14 -5
- package/dist/src/components/VerticalTabs/{VerticalTabs.jsx → VerticalTabs.js} +17 -9
- package/dist/src/components/VerticalTabs/VerticalTabs.stories.js +100 -0
- package/dist/src/components/VerticalTabs/VerticalTabs.test.js +48 -0
- package/dist/src/components/ui/calendar.d.ts +2 -2
- package/dist/src/components/ui/{calendar.jsx → calendar.js} +22 -36
- package/dist/src/components/ui/command.d.ts +9 -9
- package/dist/src/components/ui/command.js +65 -0
- package/dist/src/components/ui/popover.d.ts +4 -4
- package/dist/src/components/ui/popover.js +42 -0
- package/dist/src/components/ui/tooltip.d.ts +4 -4
- package/dist/src/components/ui/tooltip.js +42 -0
- package/dist/src/components/ui/typography.d.ts +1 -1
- package/dist/src/components/ui/{typography.jsx → typography.js} +13 -4
- package/package.json +1 -1
- package/dist/app/page.jsx +0 -5
- package/dist/src/components/Accordion/Accordion.stories.jsx +0 -33
- package/dist/src/components/Alerts/Alert/alert.stories.jsx +0 -344
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.jsx +0 -552
- package/dist/src/components/AppIcons/AndroidIcon.jsx +0 -24
- package/dist/src/components/AppIcons/AppleIcon.jsx +0 -31
- package/dist/src/components/AppIcons/PlayStoreIcon.jsx +0 -29
- package/dist/src/components/Avatar/Avatar/Avatar.stories.jsx +0 -95
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.jsx +0 -17
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.stories.jsx +0 -32
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.jsx +0 -20
- package/dist/src/components/Badge/Badge.stories.jsx +0 -201
- package/dist/src/components/Button/Button/Button.test.jsx +0 -73
- package/dist/src/components/Card/MultipleNews/MultiNews.jsx +0 -71
- package/dist/src/components/Card/PostByCategory/PostByCategory.jsx +0 -57
- package/dist/src/components/Card/SinglePost/SinglePost.jsx +0 -26
- package/dist/src/components/Card/contactProfile/ContactProfile.jsx +0 -76
- package/dist/src/components/Card/photoAlbum/PhotoAlbum.jsx +0 -41
- package/dist/src/components/Card/photoGallery/PhotoGallery.jsx +0 -17
- package/dist/src/components/Checkbox/checkbox.stories.jsx +0 -113
- package/dist/src/components/ColorPicker/ColorPicker.stories.jsx +0 -138
- package/dist/src/components/Colors/color.stories.jsx +0 -20
- package/dist/src/components/DatePicker/DatePicker.jsx +0 -67
- package/dist/src/components/DatePicker/DatePicker.stories.jsx +0 -291
- package/dist/src/components/DateRangePicker/DateRangePicker.stories.jsx +0 -582
- package/dist/src/components/Dropdown/Combobox/Combobox.stories.jsx +0 -289
- package/dist/src/components/Dropdown/Combobox/dialog.jsx +0 -66
- package/dist/src/components/Dropdown/Combobox/utils/renderBadge.jsx +0 -7
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.jsx +0 -464
- package/dist/src/components/Dropdown/DropdownMenu/SelectAllSection.jsx +0 -19
- package/dist/src/components/Dropdown/select.jsx +0 -93
- package/dist/src/components/Icons/stories/IconDropdown.jsx +0 -67
- package/dist/src/components/Icons/stories/IconGallery.jsx +0 -77
- package/dist/src/components/Icons/stories/InteractiveIconSelector.jsx +0 -86
- package/dist/src/components/Input/Input.stories.jsx +0 -250
- package/dist/src/components/Modal/Modal.stories.jsx +0 -151
- package/dist/src/components/Pagination/pagination.stories.jsx +0 -301
- package/dist/src/components/Skeleton/skeleton.stories.jsx +0 -734
- package/dist/src/components/Slider/slider.jsx +0 -31
- package/dist/src/components/Tabs/tabs.jsx +0 -32
- package/dist/src/components/TimePicker/TimePicker.stories.jsx +0 -298
- package/dist/src/components/ToolTip/Tooltip.jsx +0 -18
- package/dist/src/components/Typography/Heading/Heading.stories.jsx +0 -85
- package/dist/src/components/VerticalTabs/VerticalTabs.stories.jsx +0 -154
- package/dist/src/components/VerticalTabs/VerticalTabs.test.jsx +0 -97
- package/dist/src/components/ui/command.jsx +0 -67
- package/dist/src/components/ui/popover.jsx +0 -33
- package/dist/src/components/ui/tooltip.jsx +0 -38
- /package/dist/src/components/AppIcons/{AppIcon.stories.jsx → AppIcon.stories.js} +0 -0
- /package/dist/src/components/Card/SinglePost/{SinglePost.stories.jsx → SinglePost.stories.js} +0 -0
- /package/dist/src/components/Icons/{LUIcon.test.jsx → LUIcon.test.js} +0 -0
- /package/dist/src/components/ImageUploader/{ImageUploader.stories.jsx → ImageUploader.stories.js} +0 -0
- /package/dist/src/components/Slider/{Slider.stories.jsx → Slider.stories.js} +0 -0
- /package/dist/src/components/ui/{collapsible.jsx → collapsible.js} +0 -0
package/dist/app/layout.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Inter } from "next/font/google";
|
|
2
3
|
import "@/styles/globals.css";
|
|
3
4
|
var inter = Inter({ subsets: ["latin"] });
|
|
@@ -7,7 +8,5 @@ export var metadata = {
|
|
|
7
8
|
};
|
|
8
9
|
export default function RootLayout(_a) {
|
|
9
10
|
var children = _a.children;
|
|
10
|
-
return (
|
|
11
|
-
<body className={inter.className}>{children}</body>
|
|
12
|
-
</html>);
|
|
11
|
+
return (_jsx("html", { lang: "en", children: _jsx("body", { className: inter.className, children: children }) }));
|
|
13
12
|
}
|
package/dist/app/page.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function Home(): import("react").JSX.Element;
|
|
1
|
+
export default function Home(): import("react/jsx-runtime").JSX.Element;
|
package/dist/app/page.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export default function Home() {
|
|
3
|
+
return (_jsx("div", { className: "text-center flex flex-col items-center justify-center min-h-screen p-24 gap-5", children: _jsx("h1", { children: " Welcome to Linkedunion Design kit" }) }));
|
|
4
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -35,4 +35,4 @@ export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, Dialog
|
|
|
35
35
|
export { DatePicker } from "./src/components/DatePicker/DatePicker";
|
|
36
36
|
export { DateRangePicker } from "./src/components/DateRangePicker/DateRangePicker";
|
|
37
37
|
export { TimePicker } from "./src/components/TimePicker/TimePicker";
|
|
38
|
-
export
|
|
38
|
+
export { Alert, AlertAction, AlertCancel, AlertHeader, AlertTitle, AlertDescription, AlertFooter, } from "./src/components/Alerts/Alert/alert";
|
package/dist/index.js
CHANGED
|
@@ -35,4 +35,4 @@ export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, Dialog
|
|
|
35
35
|
export { DatePicker } from "./src/components/DatePicker/DatePicker";
|
|
36
36
|
export { DateRangePicker } from "./src/components/DateRangePicker/DateRangePicker";
|
|
37
37
|
export { TimePicker } from "./src/components/TimePicker/TimePicker";
|
|
38
|
-
export
|
|
38
|
+
export { Alert, AlertAction, AlertCancel, AlertHeader, AlertTitle, AlertDescription, AlertFooter, } from "./src/components/Alerts/Alert/alert";
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from "../../components/Accordion/accordion";
|
|
14
|
+
import ColorPicker from "../ColorPicker/ColorPicker";
|
|
15
|
+
export default {
|
|
16
|
+
title: "Components/Accordion",
|
|
17
|
+
component: Accordion,
|
|
18
|
+
tags: ["autodocs"],
|
|
19
|
+
};
|
|
20
|
+
var Template = function (args) { return (_jsx(Accordion, __assign({ type: "single", collapsible: true, defaultValue: "menus" }, args))); };
|
|
21
|
+
export var _Accordion = Template.bind({});
|
|
22
|
+
_Accordion.args = {
|
|
23
|
+
children: (_jsxs(_Fragment, { children: [_jsxs(AccordionItem, { value: "menus", children: [_jsx(AccordionTrigger, { children: "Menus" }), _jsx(AccordionContent, { children: _jsx(ColorPicker, { value: "#000000", onChange: function () { return console.log("color"); } }) })] }), _jsxs(AccordionItem, { value: "second", children: [_jsx(AccordionTrigger, { children: "Menus" }), _jsx(AccordionContent, { children: _jsx(ColorPicker, { value: "#000000", onChange: function () { return console.log("color"); } }) })] })] })),
|
|
24
|
+
};
|
|
25
|
+
_Accordion.argTypes = {
|
|
26
|
+
children: {
|
|
27
|
+
description: "Pass `AccordionItem` components as children. Each item includes an `AccordionTrigger` (the clickable label) and `AccordionContent` (collapsible body). You can customize both with any valid React nodes \n\nFor more details and usage examples, refer to the [ShadCN Accordion documentation](https://ui.shadcn.com/docs/components/accordion).",
|
|
28
|
+
table: {
|
|
29
|
+
type: { summary: "React.ReactNode" },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
-
declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>):
|
|
4
|
-
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>):
|
|
5
|
-
declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>):
|
|
6
|
-
declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>):
|
|
3
|
+
declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -1,3 +1,14 @@
|
|
|
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
|
+
};
|
|
1
12
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
13
|
var t = {};
|
|
3
14
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -9,17 +20,18 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
20
|
}
|
|
10
21
|
return t;
|
|
11
22
|
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
24
|
import * as React from "react";
|
|
13
25
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
14
26
|
import { cn } from "../../lib/utils";
|
|
15
27
|
import LUIcon from "../Icons/LUIcon";
|
|
16
28
|
function Accordion(_a) {
|
|
17
29
|
var props = __rest(_a, []);
|
|
18
|
-
return
|
|
30
|
+
return _jsx(AccordionPrimitive.Root, __assign({ "data-slot": "accordion" }, props));
|
|
19
31
|
}
|
|
20
32
|
function AccordionItem(_a) {
|
|
21
33
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
22
|
-
return (
|
|
34
|
+
return (_jsx(AccordionPrimitive.Item, __assign({ "data-slot": "accordion-item", className: cn("!py-5 !border-b last:!border-b !border-gray-100", className) }, props)));
|
|
23
35
|
}
|
|
24
36
|
function AccordionTrigger(_a) {
|
|
25
37
|
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
|
@@ -43,17 +55,10 @@ function AccordionTrigger(_a) {
|
|
|
43
55
|
}
|
|
44
56
|
return function () { return observer.disconnect(); };
|
|
45
57
|
}, []);
|
|
46
|
-
return (
|
|
47
|
-
<AccordionPrimitive.Trigger 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}>
|
|
48
|
-
<LUIcon color="light-gray" icon={isOpen ? "minus" : "plus"} size="md" className="pointer-events-none shrink-0"/>
|
|
49
|
-
{children}
|
|
50
|
-
</AccordionPrimitive.Trigger>
|
|
51
|
-
</AccordionPrimitive.Header>);
|
|
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] })) }));
|
|
52
59
|
}
|
|
53
60
|
function AccordionContent(_a) {
|
|
54
61
|
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
|
55
|
-
return (
|
|
56
|
-
<div className={cn(className)}>{children}</div>
|
|
57
|
-
</AccordionPrimitive.Content>);
|
|
62
|
+
return (_jsx(AccordionPrimitive.Content, __assign({ "data-slot": "accordion-content", className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down !overflow-visible !text-sm !py-2" }, props, { children: _jsx("div", { className: cn(className), children: children }) })));
|
|
58
63
|
}
|
|
59
64
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -9,10 +9,10 @@ export declare const alertVariants: (props?: ({
|
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
export interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "color">, VariantProps<typeof alertVariants> {
|
|
11
11
|
}
|
|
12
|
-
export declare function Alert({ className, size, shadow, color, variant, ...props }: AlertProps):
|
|
13
|
-
export declare function AlertHeader({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>):
|
|
14
|
-
export declare function AlertTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>):
|
|
15
|
-
export declare function AlertDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>):
|
|
16
|
-
export declare function AlertFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>):
|
|
17
|
-
export declare const AlertAction: ({ className, color: colorProp, ...props }: React.ComponentProps<typeof Button>) =>
|
|
18
|
-
export declare const AlertCancel: ({ className, color: colorProp, ...props }: React.ComponentProps<typeof Button>) =>
|
|
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;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
14
|
var t = {};
|
|
4
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -10,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
21
|
}
|
|
11
22
|
return t;
|
|
12
23
|
};
|
|
13
|
-
import
|
|
24
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
25
|
import { createContext, useContext, Children, isValidElement, cloneElement, } from "react";
|
|
15
26
|
import { cva } from "class-variance-authority";
|
|
16
27
|
import { cn } from "../../../lib/utils";
|
|
@@ -84,14 +95,12 @@ var AlertContext = createContext({});
|
|
|
84
95
|
var useAlertContext = function () { return useContext(AlertContext); };
|
|
85
96
|
export function Alert(_a) {
|
|
86
97
|
var className = _a.className, size = _a.size, shadow = _a.shadow, color = _a.color, variant = _a.variant, props = __rest(_a, ["className", "size", "shadow", "color", "variant"]);
|
|
87
|
-
return (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}), className)} {...props}/>
|
|
94
|
-
</AlertContext.Provider>);
|
|
98
|
+
return (_jsx(AlertContext.Provider, { value: { color: color || undefined }, children: _jsx("div", __assign({ "data-slot": "inline-alert", className: cn(alertVariants({
|
|
99
|
+
size: size,
|
|
100
|
+
shadow: shadow,
|
|
101
|
+
color: color,
|
|
102
|
+
variant: variant,
|
|
103
|
+
}), className) }, props)) }));
|
|
95
104
|
}
|
|
96
105
|
export function AlertHeader(_a) {
|
|
97
106
|
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
|
@@ -116,38 +125,33 @@ export function AlertHeader(_a) {
|
|
|
116
125
|
otherChildren_1.push(child);
|
|
117
126
|
}
|
|
118
127
|
});
|
|
119
|
-
return (
|
|
120
|
-
{iconWithClass_1}
|
|
121
|
-
<div>{otherChildren_1}</div>
|
|
122
|
-
</div>);
|
|
128
|
+
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 })] })));
|
|
123
129
|
}
|
|
124
|
-
return (
|
|
125
|
-
{children}
|
|
126
|
-
</div>);
|
|
130
|
+
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 })));
|
|
127
131
|
}
|
|
128
132
|
export function AlertTitle(_a) {
|
|
129
133
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
130
|
-
return (
|
|
134
|
+
return (_jsx("h2", __assign({ "data-slot": "alert-dialog-title", className: cn("text-lg font-semibold", className) }, props)));
|
|
131
135
|
}
|
|
132
136
|
export function AlertDescription(_a) {
|
|
133
137
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
134
|
-
return (
|
|
138
|
+
return (_jsx("p", __assign({ "data-slot": "alert-dialog-description", className: cn("text-black text-sm", className) }, props)));
|
|
135
139
|
}
|
|
136
140
|
export function AlertFooter(_a) {
|
|
137
141
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
138
|
-
return (
|
|
142
|
+
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)));
|
|
139
143
|
}
|
|
140
144
|
// Also create a simple button component that matches the style of AlertDialogAction
|
|
141
145
|
export var AlertAction = function (_a) {
|
|
142
146
|
var className = _a.className, colorProp = _a.color, props = __rest(_a, ["className", "color"]);
|
|
143
147
|
var contextColor = useAlertContext().color;
|
|
144
148
|
var color = colorProp || contextColor || undefined;
|
|
145
|
-
return (
|
|
149
|
+
return (_jsx(Button, __assign({ variant: "link", color: color, "data-slot": "alert-dialog-action", className: cn("h-auto p-0", className) }, props)));
|
|
146
150
|
};
|
|
147
151
|
// And a cancel button that matches AlertDialogCancel
|
|
148
152
|
export var AlertCancel = function (_a) {
|
|
149
153
|
var className = _a.className, colorProp = _a.color, props = __rest(_a, ["className", "color"]);
|
|
150
154
|
var contextColor = useAlertContext().color;
|
|
151
155
|
var color = colorProp || contextColor || undefined;
|
|
152
|
-
return (
|
|
156
|
+
return (_jsx(Button, __assign({ variant: "link", color: color, "data-slot": "alert-dialog-cancel", className: cn("h-auto p-0", className) }, props)));
|
|
153
157
|
};
|
|
@@ -3,7 +3,7 @@ declare const _default: Meta;
|
|
|
3
3
|
export default _default;
|
|
4
4
|
export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, any>;
|
|
5
5
|
export declare const Example: {
|
|
6
|
-
(): import("react").JSX.Element;
|
|
6
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
parameters: {
|
|
8
8
|
docs: {
|
|
9
9
|
description: {
|
|
@@ -12,14 +12,14 @@ export declare const Example: {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
export declare const AllColors: () => import("react").JSX.Element;
|
|
16
|
-
export declare const AllSizes: () => import("react").JSX.Element;
|
|
17
|
-
export declare const Variants: () => import("react").JSX.Element;
|
|
18
|
-
export declare const ComparisonWithAlertDialog: () => import("react").JSX.Element;
|
|
19
|
-
export declare const NoButtons: () => import("react").JSX.Element;
|
|
20
|
-
export declare const WithShadow: () => import("react").JSX.Element;
|
|
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
21
|
export declare const CustomizeAlert: {
|
|
22
|
-
(): import("react").JSX.Element;
|
|
22
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
parameters: {
|
|
24
24
|
docs: {
|
|
25
25
|
description: {
|
|
@@ -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
|
+
};
|
|
@@ -31,15 +31,15 @@ declare const alertDialogContentVariants: (props?: ({
|
|
|
31
31
|
color?: "blue" | "green" | "yellow" | "red" | "indigo" | "gray" | null | undefined;
|
|
32
32
|
variant?: "fill" | "outline" | null | undefined;
|
|
33
33
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
34
|
-
declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>):
|
|
35
|
-
declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>):
|
|
36
|
-
declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>):
|
|
37
|
-
declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>):
|
|
38
|
-
declare function AlertDialogContent({ className, size, shadow, color, variant, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content> & VariantProps<typeof alertDialogContentVariants>):
|
|
39
|
-
declare function AlertDialogHeader({ className, children, ...props }: React.ComponentProps<"div">):
|
|
40
|
-
declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">):
|
|
41
|
-
declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>):
|
|
42
|
-
declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>):
|
|
43
|
-
declare function AlertDialogAction({ className, color: colorProp, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action> & React.ComponentProps<typeof Button>):
|
|
44
|
-
declare function AlertDialogCancel({ className, color: colorProp, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> & React.ComponentProps<typeof Button>):
|
|
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
45
|
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
@@ -1,3 +1,14 @@
|
|
|
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
|
+
};
|
|
1
12
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
13
|
var t = {};
|
|
3
14
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -9,6 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
20
|
}
|
|
10
21
|
return t;
|
|
11
22
|
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
24
|
import * as React from "react";
|
|
13
25
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
14
26
|
import { cva } from "class-variance-authority";
|
|
@@ -84,28 +96,23 @@ var alertDialogContentVariants = cva("data-[state=open]:animate-in data-[state=c
|
|
|
84
96
|
});
|
|
85
97
|
function AlertDialog(_a) {
|
|
86
98
|
var props = __rest(_a, []);
|
|
87
|
-
return
|
|
99
|
+
return _jsx(AlertDialogPrimitive.Root, __assign({ "data-slot": "alert-dialog" }, props));
|
|
88
100
|
}
|
|
89
101
|
function AlertDialogTrigger(_a) {
|
|
90
102
|
var props = __rest(_a, []);
|
|
91
|
-
return (
|
|
103
|
+
return (_jsx(AlertDialogPrimitive.Trigger, __assign({ "data-slot": "alert-dialog-trigger" }, props)));
|
|
92
104
|
}
|
|
93
105
|
function AlertDialogPortal(_a) {
|
|
94
106
|
var props = __rest(_a, []);
|
|
95
|
-
return (
|
|
107
|
+
return (_jsx(AlertDialogPrimitive.Portal, __assign({ "data-slot": "alert-dialog-portal" }, props)));
|
|
96
108
|
}
|
|
97
109
|
function AlertDialogOverlay(_a) {
|
|
98
110
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
99
|
-
return (
|
|
111
|
+
return (_jsx(AlertDialogPrimitive.Overlay, __assign({ "data-slot": "alert-dialog-overlay", className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className) }, props)));
|
|
100
112
|
}
|
|
101
113
|
function AlertDialogContent(_a) {
|
|
102
114
|
var className = _a.className, size = _a.size, shadow = _a.shadow, color = _a.color, variant = _a.variant, props = __rest(_a, ["className", "size", "shadow", "color", "variant"]);
|
|
103
|
-
return (
|
|
104
|
-
<AlertDialogPortal>
|
|
105
|
-
<AlertDialogOverlay />
|
|
106
|
-
<AlertDialogPrimitive.Content data-slot="alert-dialog-content" className={cn(alertDialogContentVariants({ size: size, shadow: shadow, color: color, variant: variant }), className)} {...props}/>
|
|
107
|
-
</AlertDialogPortal>
|
|
108
|
-
</AlertDialogContext.Provider>);
|
|
115
|
+
return (_jsx(AlertDialogContext.Provider, { value: { color: color || undefined }, children: _jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, __assign({ "data-slot": "alert-dialog-content", className: cn(alertDialogContentVariants({ size: size, shadow: shadow, color: color, variant: variant }), className) }, props))] }) }));
|
|
109
116
|
}
|
|
110
117
|
function AlertDialogHeader(_a) {
|
|
111
118
|
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
|
@@ -130,41 +137,32 @@ function AlertDialogHeader(_a) {
|
|
|
130
137
|
otherChildren_1.push(child);
|
|
131
138
|
}
|
|
132
139
|
});
|
|
133
|
-
return (
|
|
134
|
-
{iconWithClass_1}
|
|
135
|
-
<div>{otherChildren_1}</div>
|
|
136
|
-
</div>);
|
|
140
|
+
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 })] })));
|
|
137
141
|
}
|
|
138
|
-
return (
|
|
139
|
-
{children}
|
|
140
|
-
</div>);
|
|
142
|
+
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 })));
|
|
141
143
|
}
|
|
142
144
|
function AlertDialogFooter(_a) {
|
|
143
145
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
144
|
-
return (
|
|
146
|
+
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)));
|
|
145
147
|
}
|
|
146
148
|
function AlertDialogTitle(_a) {
|
|
147
149
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
148
|
-
return (
|
|
150
|
+
return (_jsx(AlertDialogPrimitive.Title, __assign({ "data-slot": "alert-dialog-title", className: cn("text-lg font-semibold", className) }, props)));
|
|
149
151
|
}
|
|
150
152
|
function AlertDialogDescription(_a) {
|
|
151
153
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
152
|
-
return (
|
|
154
|
+
return (_jsx(AlertDialogPrimitive.Description, __assign({ "data-slot": "alert-dialog-description", className: cn("text-black text-sm", className) }, props)));
|
|
153
155
|
}
|
|
154
156
|
function AlertDialogAction(_a) {
|
|
155
157
|
var className = _a.className, colorProp = _a.color, props = __rest(_a, ["className", "color"]);
|
|
156
158
|
var contextColor = useAlertDialogContext().color;
|
|
157
159
|
var color = colorProp || contextColor || undefined;
|
|
158
|
-
return (
|
|
159
|
-
<Button variant="link" color={color} data-slot="alert-dialog-action" className={cn("h-auto p-0", className)} {...props}/>
|
|
160
|
-
</AlertDialogPrimitive.Action>);
|
|
160
|
+
return (_jsx(AlertDialogPrimitive.Action, { asChild: true, children: _jsx(Button, __assign({ variant: "link", color: color, "data-slot": "alert-dialog-action", className: cn("h-auto p-0", className) }, props)) }));
|
|
161
161
|
}
|
|
162
162
|
function AlertDialogCancel(_a) {
|
|
163
163
|
var className = _a.className, colorProp = _a.color, props = __rest(_a, ["className", "color"]);
|
|
164
164
|
var contextColor = useAlertDialogContext().color;
|
|
165
165
|
var color = colorProp || contextColor || undefined;
|
|
166
|
-
return (
|
|
167
|
-
<Button variant="link" color={color} data-slot="alert-dialog-cancel" className={cn("h-auto p-0", className)} {...props}/>
|
|
168
|
-
</AlertDialogPrimitive.Cancel>);
|
|
166
|
+
return (_jsx(AlertDialogPrimitive.Cancel, { asChild: true, children: _jsx(Button, __assign({ variant: "link", color: color, "data-slot": "alert-dialog-cancel", className: cn("h-auto p-0", className) }, props)) }));
|
|
169
167
|
}
|
|
170
168
|
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|