linkedunion-design-kit 1.11.6 → 1.11.8
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.js → layout.jsx} +3 -2
- package/dist/app/page.d.ts +1 -1
- package/dist/app/page.jsx +5 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/src/components/Accordion/Accordion.stories.jsx +33 -0
- package/dist/src/components/Accordion/accordion.d.ts +4 -4
- package/dist/src/components/Accordion/{accordion.js → accordion.jsx} +11 -16
- package/dist/src/components/Alerts/Alert/alert.d.ts +7 -7
- package/dist/src/components/Alerts/Alert/{alert.js → alert.jsx} +21 -25
- package/dist/src/components/Alerts/Alert/alert.stories.d.ts +8 -8
- package/dist/src/components/Alerts/Alert/alert.stories.jsx +344 -0
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.d.ts +11 -11
- package/dist/src/components/Alerts/AlertDialog/{alert-dialog.js → alert-dialog.jsx} +26 -24
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.d.ts +10 -10
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.jsx +552 -0
- package/dist/src/components/AppIcons/AndroidIcon.jsx +24 -0
- package/dist/src/components/AppIcons/{AppIcon.js → AppIcon.jsx} +4 -15
- package/dist/src/components/AppIcons/AppleIcon.jsx +31 -0
- package/dist/src/components/AppIcons/PlayStoreIcon.jsx +29 -0
- package/dist/src/components/Avatar/Avatar/{Avatar.js → Avatar.jsx} +13 -18
- package/dist/src/components/Avatar/Avatar/Avatar.stories.d.ts +7 -7
- package/dist/src/components/Avatar/Avatar/Avatar.stories.jsx +95 -0
- package/dist/src/components/Avatar/Avatar/{Avatar.test.js → Avatar.test.jsx} +1 -2
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.jsx +17 -0
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.stories.jsx +32 -0
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.jsx +20 -0
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.stories.d.ts +2 -2
- package/dist/src/components/Avatar/StatusIndicator/{StatusIndicator.stories.js → StatusIndicator.stories.jsx} +12 -3
- package/dist/src/components/Badge/Badge.d.ts +1 -1
- package/dist/src/components/Badge/{Badge.js → Badge.jsx} +8 -13
- package/dist/src/components/Badge/Badge.stories.d.ts +10 -10
- package/dist/src/components/Badge/Badge.stories.jsx +201 -0
- package/dist/src/components/Button/Button/Button.d.ts +3 -2
- package/dist/src/components/Button/Button/{Button.js → Button.jsx} +24 -8
- package/dist/src/components/Button/Button/Button.stories.d.ts +5 -3
- package/dist/src/components/Button/Button/{Button.stories.js → Button.stories.jsx} +1 -13
- package/dist/src/components/Button/Button/Button.test.jsx +73 -0
- package/dist/src/components/Button/IconButton/IconButton.d.ts +1 -1
- package/dist/src/components/Button/IconButton/{IconButton.js → IconButton.jsx} +4 -13
- package/dist/src/components/Button/IconButton/IconButton.stories.d.ts +1 -1
- package/dist/src/components/Button/IconButton/{IconButton.stories.js → IconButton.stories.jsx} +1 -13
- package/dist/src/components/Button/IconButton/{IconButton.test.js → IconButton.test.jsx} +5 -6
- package/dist/src/components/Button/index.d.ts +1 -0
- package/dist/src/components/Button/index.js +3 -2
- package/dist/src/components/Card/MultipleNews/MultiNews.d.ts +1 -1
- package/dist/src/components/Card/MultipleNews/MultiNews.jsx +71 -0
- package/dist/src/components/Card/MultipleNews/{MultiNews.stories.js → MultiNews.stories.jsx} +1 -2
- package/dist/src/components/Card/PostByCategory/PostByCategory.d.ts +1 -1
- package/dist/src/components/Card/PostByCategory/PostByCategory.jsx +57 -0
- package/dist/src/components/Card/PostByCategory/{PostByCategory.stories.js → PostByCategory.stories.jsx} +1 -2
- package/dist/src/components/Card/SinglePost/SinglePost.d.ts +1 -1
- package/dist/src/components/Card/SinglePost/SinglePost.jsx +26 -0
- package/dist/src/components/Card/card.d.ts +2 -1
- package/dist/src/components/Card/{card.js → card.jsx} +2 -13
- package/dist/src/components/Card/contactProfile/ContactProfile.d.ts +1 -1
- package/dist/src/components/Card/contactProfile/ContactProfile.jsx +76 -0
- package/dist/src/components/Card/contactProfile/{ContactProfile.stories.js → ContactProfile.stories.jsx} +1 -2
- package/dist/src/components/Card/photoAlbum/PhotoAlbum.d.ts +1 -1
- package/dist/src/components/Card/photoAlbum/PhotoAlbum.jsx +41 -0
- package/dist/src/components/Card/photoAlbum/{PhotoAlbum.stories.js → PhotoAlbum.stories.jsx} +1 -13
- package/dist/src/components/Card/photoGallery/PhotoGallery.d.ts +1 -1
- package/dist/src/components/Card/photoGallery/PhotoGallery.jsx +17 -0
- package/dist/src/components/Card/photoGallery/{PhotoGallery.stories.js → PhotoGallery.stories.jsx} +1 -13
- package/dist/src/components/Checkbox/checkbox.d.ts +1 -1
- package/dist/src/components/Checkbox/{checkbox.js → checkbox.jsx} +6 -13
- package/dist/src/components/Checkbox/checkbox.stories.jsx +113 -0
- package/dist/src/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/src/components/ColorPicker/{ColorPicker.js → ColorPicker.jsx} +6 -13
- package/dist/src/components/ColorPicker/ColorPicker.stories.d.ts +5 -5
- package/dist/src/components/ColorPicker/ColorPicker.stories.jsx +138 -0
- package/dist/src/components/Colors/color.d.ts +1 -1
- package/dist/src/components/Colors/{color.js → color.jsx} +1 -2
- package/dist/src/components/Colors/color.stories.jsx +20 -0
- package/dist/src/components/Colors/{color.test.js → color.test.jsx} +3 -4
- package/dist/src/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/src/components/DatePicker/DatePicker.jsx +67 -0
- package/dist/src/components/DatePicker/DatePicker.stories.d.ts +9 -9
- package/dist/src/components/DatePicker/DatePicker.stories.jsx +291 -0
- package/dist/src/components/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/src/components/DateRangePicker/{DateRangePicker.js → DateRangePicker.jsx} +92 -44
- package/dist/src/components/DateRangePicker/DateRangePicker.stories.d.ts +19 -19
- package/dist/src/components/DateRangePicker/DateRangePicker.stories.jsx +582 -0
- package/dist/src/components/Dropdown/Combobox/Combobox.d.ts +1 -1
- package/dist/src/components/Dropdown/Combobox/{Combobox.js → Combobox.jsx} +67 -29
- package/dist/src/components/Dropdown/Combobox/Combobox.stories.d.ts +8 -8
- package/dist/src/components/Dropdown/Combobox/Combobox.stories.jsx +289 -0
- package/dist/src/components/Dropdown/Combobox/dialog.d.ts +10 -10
- package/dist/src/components/Dropdown/Combobox/dialog.jsx +66 -0
- package/dist/src/components/Dropdown/Combobox/utils/renderBadge.jsx +7 -0
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.d.ts +7 -3
- package/dist/src/components/Dropdown/DropdownMenu/{DropdownMenu.js → DropdownMenu.jsx} +29 -22
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.d.ts +19 -12
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.jsx +552 -0
- package/dist/src/components/Dropdown/DropdownMenu/SelectAllSection.jsx +19 -0
- package/dist/src/components/Dropdown/DropdownMenu/index.d.ts +5 -0
- package/dist/src/components/Dropdown/DropdownMenu/index.js +5 -0
- package/dist/src/components/Dropdown/Select.stories.d.ts +7 -6
- package/dist/src/components/Dropdown/{Select.stories.js → Select.stories.jsx} +71 -8
- package/dist/src/components/Dropdown/select.d.ts +10 -10
- package/dist/src/components/Dropdown/select.jsx +94 -0
- package/dist/src/components/Icons/LUIcon.d.ts +1 -1
- package/dist/src/components/Icons/{LUIcon.js → LUIcon.jsx} +10 -13
- package/dist/src/components/Icons/stories/IconDropdown.jsx +67 -0
- package/dist/src/components/Icons/stories/IconGallery.jsx +77 -0
- package/dist/src/components/Icons/stories/InteractiveIconSelector.jsx +86 -0
- package/dist/src/components/Icons/stories/LUIcon.stories.d.ts +5 -5
- package/dist/src/components/Icons/stories/{LUIcon.stories.js → LUIcon.stories.jsx} +23 -8
- package/dist/src/components/ImageUploader/imageUploader.d.ts +1 -1
- package/dist/src/components/ImageUploader/{imageUploader.js → imageUploader.jsx} +28 -13
- package/dist/src/components/Images/LuImage.d.ts +1 -1
- package/dist/src/components/Images/{LuImage.js → LuImage.jsx} +1 -13
- package/dist/src/components/Images/{LuImage.stories.js → LuImage.stories.jsx} +1 -13
- package/dist/src/components/Images/{LuImage.test.js → LuImage.test.jsx} +6 -18
- package/dist/src/components/Input/Input.stories.d.ts +9 -8
- package/dist/src/components/Input/Input.stories.jsx +250 -0
- package/dist/src/components/Input/input.d.ts +1 -1
- package/dist/src/components/Input/{input.js → input.jsx} +10 -13
- package/dist/src/components/Label/Label.d.ts +1 -1
- package/dist/src/components/Label/{Label.js → Label.jsx} +2 -13
- package/dist/src/components/Label/{Label.stories.js → Label.stories.jsx} +1 -13
- package/dist/src/components/Modal/Modal.d.ts +3 -3
- package/dist/src/components/Modal/{Modal.js → Modal.jsx} +20 -19
- package/dist/src/components/Modal/Modal.stories.d.ts +15 -15
- package/dist/src/components/Modal/Modal.stories.jsx +487 -0
- package/dist/src/components/Pagination/pagination.d.ts +5 -5
- package/dist/src/components/Pagination/{pagination.js → pagination.jsx} +18 -21
- package/dist/src/components/Pagination/pagination.stories.d.ts +6 -6
- package/dist/src/components/Pagination/pagination.stories.jsx +301 -0
- package/dist/src/components/RadioGroup/{RadioGroup.stories.js → RadioGroup.stories.jsx} +52 -22
- package/dist/src/components/RadioGroup/radio-group.d.ts +1 -1
- package/dist/src/components/RadioGroup/{radio-group.js → radio-group.jsx} +6 -14
- package/dist/src/components/Separator/Separator.stories.d.ts +15 -0
- package/dist/src/components/Separator/Separator.stories.jsx +94 -0
- package/dist/src/components/Separator/index.d.ts +1 -0
- package/dist/src/components/Separator/index.js +1 -0
- package/dist/src/components/Separator/separator.d.ts +4 -0
- package/dist/src/components/Separator/separator.jsx +20 -0
- package/dist/src/components/Sheet/index.d.ts +1 -0
- package/dist/src/components/Sheet/index.js +1 -0
- package/dist/src/components/Sheet/sheet.d.ts +25 -0
- package/dist/src/components/Sheet/sheet.jsx +73 -0
- package/dist/src/components/Sheet/sheet.stories.d.ts +4 -0
- package/dist/src/components/Sheet/sheet.stories.jsx +34 -0
- package/dist/src/components/Skeleton/skeleton.d.ts +14 -14
- package/dist/src/components/Skeleton/{skeleton.js → skeleton.jsx} +23 -27
- package/dist/src/components/Skeleton/skeleton.stories.d.ts +14 -14
- package/dist/src/components/Skeleton/skeleton.stories.jsx +734 -0
- package/dist/src/components/Slider/slider.d.ts +1 -1
- package/dist/src/components/Slider/slider.jsx +31 -0
- package/dist/src/components/SweetAlert/SweetAlert.d.ts +9 -9
- package/dist/src/components/SweetAlert/{SweetAlert.js → SweetAlert.jsx} +18 -21
- package/dist/src/components/SweetAlert/SweetAlert.stories.d.ts +7 -7
- package/dist/src/components/SweetAlert/{SweetAlert.stories.js → SweetAlert.stories.jsx} +215 -15
- package/dist/src/components/Switch/{Switch.stories.js → Switch.stories.jsx} +1 -13
- package/dist/src/components/Switch/switch.d.ts +1 -1
- package/dist/src/components/Switch/{switch.js → switch.jsx} +4 -13
- package/dist/src/components/Table/{Table.js → Table.jsx} +111 -58
- package/dist/src/components/Table/Table.stories.d.ts +13 -13
- package/dist/src/components/Table/{Table.stories.js → Table.stories.jsx} +299 -45
- package/dist/src/components/Table/{Table.test.js → Table.test.jsx} +39 -7
- package/dist/src/components/Tabs/{Tabs.stories.js → Tabs.stories.jsx} +10 -3
- package/dist/src/components/Tabs/tabs.d.ts +4 -4
- package/dist/src/components/Tabs/tabs.jsx +32 -0
- package/dist/src/components/TimePicker/TimePicker.d.ts +1 -1
- package/dist/src/components/TimePicker/{TimePicker.js → TimePicker.jsx} +54 -30
- package/dist/src/components/TimePicker/TimePicker.stories.d.ts +10 -10
- package/dist/src/components/TimePicker/TimePicker.stories.jsx +298 -0
- package/dist/src/components/Title/Title.d.ts +1 -1
- package/dist/src/components/Title/{Title.js → Title.jsx} +2 -2
- package/dist/src/components/Title/{Title.stories.js → Title.stories.jsx} +1 -13
- package/dist/src/components/Title/{Title.test.js → Title.test.jsx} +4 -5
- package/dist/src/components/ToolTip/Tooltip.d.ts +1 -1
- package/dist/src/components/ToolTip/Tooltip.jsx +18 -0
- package/dist/src/components/ToolTip/{Tooltip.stories.js → Tooltip.stories.jsx} +2 -14
- package/dist/src/components/Typography/Body/{Body.stories.js → Body.stories.jsx} +1 -13
- package/dist/src/components/Typography/Body/body.d.ts +1 -1
- package/dist/src/components/Typography/Body/{body.js → body.jsx} +4 -13
- package/dist/src/components/Typography/Caption/{Caption.stories.js → Caption.stories.jsx} +1 -13
- package/dist/src/components/Typography/Caption/caption.d.ts +1 -1
- package/dist/src/components/Typography/Caption/{caption.js → caption.jsx} +4 -13
- package/dist/src/components/Typography/Display/{Display.stories.js → Display.stories.jsx} +1 -13
- package/dist/src/components/Typography/Display/display.d.ts +1 -1
- package/dist/src/components/Typography/Display/{display.js → display.jsx} +4 -13
- package/dist/src/components/Typography/Heading/Heading.stories.d.ts +6 -6
- package/dist/src/components/Typography/Heading/Heading.stories.jsx +85 -0
- package/dist/src/components/Typography/Heading/{heading.js → heading.jsx} +5 -14
- package/dist/src/components/VerticalTabs/{VerticalTabs.js → VerticalTabs.jsx} +9 -17
- package/dist/src/components/VerticalTabs/VerticalTabs.stories.jsx +154 -0
- package/dist/src/components/VerticalTabs/VerticalTabs.test.jsx +97 -0
- package/dist/src/components/ui/calendar.d.ts +2 -2
- package/dist/src/components/ui/{calendar.js → calendar.jsx} +36 -22
- package/dist/src/components/ui/command.d.ts +9 -9
- package/dist/src/components/ui/command.jsx +67 -0
- package/dist/src/components/ui/popover.d.ts +4 -4
- package/dist/src/components/ui/popover.jsx +33 -0
- package/dist/src/components/ui/tooltip.d.ts +4 -4
- package/dist/src/components/ui/tooltip.jsx +38 -0
- package/dist/src/components/ui/typography.d.ts +1 -1
- package/dist/src/components/ui/{typography.js → typography.jsx} +4 -13
- package/dist/styles/global.css +107 -5
- package/package.json +4 -3
- package/dist/app/page.js +0 -4
- package/dist/src/components/Accordion/Accordion.stories.js +0 -32
- package/dist/src/components/Alerts/Alert/alert.stories.js +0 -166
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.js +0 -213
- package/dist/src/components/AppIcons/AndroidIcon.js +0 -28
- package/dist/src/components/AppIcons/AppleIcon.js +0 -28
- package/dist/src/components/AppIcons/PlayStoreIcon.js +0 -28
- package/dist/src/components/Avatar/Avatar/Avatar.stories.js +0 -69
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.js +0 -8
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.stories.js +0 -14
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.js +0 -18
- package/dist/src/components/Badge/Badge.stories.js +0 -145
- package/dist/src/components/Button/Button/Button.test.js +0 -10
- package/dist/src/components/Card/MultipleNews/MultiNews.js +0 -46
- package/dist/src/components/Card/PostByCategory/PostByCategory.js +0 -37
- package/dist/src/components/Card/SinglePost/SinglePost.js +0 -10
- package/dist/src/components/Card/contactProfile/ContactProfile.js +0 -39
- package/dist/src/components/Card/photoAlbum/PhotoAlbum.js +0 -16
- package/dist/src/components/Card/photoGallery/PhotoGallery.js +0 -8
- package/dist/src/components/Checkbox/checkbox.stories.js +0 -78
- package/dist/src/components/ColorPicker/ColorPicker.stories.js +0 -77
- package/dist/src/components/Colors/color.stories.js +0 -32
- package/dist/src/components/DatePicker/DatePicker.js +0 -64
- package/dist/src/components/DatePicker/DatePicker.stories.js +0 -171
- package/dist/src/components/DateRangePicker/DateRangePicker.stories.js +0 -318
- package/dist/src/components/Dropdown/Combobox/Combobox.stories.js +0 -225
- package/dist/src/components/Dropdown/Combobox/dialog.js +0 -68
- package/dist/src/components/Dropdown/Combobox/utils/renderBadge.js +0 -5
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.js +0 -253
- package/dist/src/components/Dropdown/DropdownMenu/SelectAllSection.js +0 -9
- package/dist/src/components/Dropdown/select.js +0 -87
- package/dist/src/components/Icons/stories/IconDropdown.js +0 -38
- package/dist/src/components/Icons/stories/IconGallery.js +0 -31
- package/dist/src/components/Icons/stories/InteractiveIconSelector.js +0 -26
- package/dist/src/components/Input/Input.stories.js +0 -133
- package/dist/src/components/Modal/Modal.stories.js +0 -115
- package/dist/src/components/Pagination/pagination.stories.js +0 -168
- package/dist/src/components/Skeleton/skeleton.stories.js +0 -414
- package/dist/src/components/Slider/slider.js +0 -38
- package/dist/src/components/Tabs/tabs.js +0 -43
- package/dist/src/components/TimePicker/TimePicker.stories.js +0 -176
- package/dist/src/components/ToolTip/Tooltip.js +0 -8
- package/dist/src/components/Typography/Heading/Heading.stories.js +0 -67
- package/dist/src/components/VerticalTabs/VerticalTabs.stories.js +0 -100
- package/dist/src/components/VerticalTabs/VerticalTabs.test.js +0 -48
- package/dist/src/components/ui/command.js +0 -65
- package/dist/src/components/ui/popover.js +0 -42
- package/dist/src/components/ui/tooltip.js +0 -42
- /package/dist/src/components/AppIcons/{AppIcon.stories.js → AppIcon.stories.jsx} +0 -0
- /package/dist/src/components/Card/SinglePost/{SinglePost.stories.js → SinglePost.stories.jsx} +0 -0
- /package/dist/src/components/Icons/{LUIcon.test.js → LUIcon.test.jsx} +0 -0
- /package/dist/src/components/ImageUploader/{ImageUploader.stories.js → ImageUploader.stories.jsx} +0 -0
- /package/dist/src/components/Slider/{Slider.stories.js → Slider.stories.jsx} +0 -0
- /package/dist/src/components/ui/{collapsible.js → collapsible.jsx} +0 -0
|
@@ -1,115 +0,0 @@
|
|
|
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 { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogSubTitle, DialogBody, DialogFooter, DialogClose, DialogAction, } from "./Modal";
|
|
25
|
-
import { Button } from "../Button/Button/Button";
|
|
26
|
-
import { Body } from "../Typography/Body/body";
|
|
27
|
-
import { Heading } from "../Typography/Heading/heading";
|
|
28
|
-
import LUIcon from "../Icons/LUIcon";
|
|
29
|
-
import { Avatar, AvatarFallback, AvatarImage } from "../Avatar/Avatar/Avatar";
|
|
30
|
-
import { Dummy_Para } from "../../utils/constants";
|
|
31
|
-
import { footerVariants, headerVariants, sizes } from ".";
|
|
32
|
-
export default {
|
|
33
|
-
title: "Components/Modal",
|
|
34
|
-
component: Dialog,
|
|
35
|
-
tags: ["autodocs"],
|
|
36
|
-
argTypes: {
|
|
37
|
-
size: {
|
|
38
|
-
control: { type: "select" },
|
|
39
|
-
options: Object.keys(sizes),
|
|
40
|
-
description: "Defines the size of the modal.",
|
|
41
|
-
table: {
|
|
42
|
-
type: { summary: "string" },
|
|
43
|
-
defaultValue: { summary: "md" },
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
headerVariants: {
|
|
47
|
-
control: { type: "select" },
|
|
48
|
-
options: Object.keys(headerVariants),
|
|
49
|
-
description: "Defines the variant style of the modal header.",
|
|
50
|
-
table: {
|
|
51
|
-
type: { summary: "string" },
|
|
52
|
-
defaultValue: { summary: "none" },
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
footerVariants: {
|
|
56
|
-
control: { type: "select" },
|
|
57
|
-
options: Object.keys(footerVariants),
|
|
58
|
-
description: "Defines the variant style of the modal footer.",
|
|
59
|
-
table: {
|
|
60
|
-
type: { summary: "string" },
|
|
61
|
-
defaultValue: { summary: "none" },
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
shadow: {
|
|
65
|
-
control: { type: "boolean" },
|
|
66
|
-
description: "Enable or disable modal shadow.",
|
|
67
|
-
table: {
|
|
68
|
-
type: { summary: "boolean" },
|
|
69
|
-
defaultValue: { summary: true },
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
showCloseIcon: {
|
|
73
|
-
control: { type: "boolean" },
|
|
74
|
-
description: "Show or hide the close icon in the modal.",
|
|
75
|
-
table: {
|
|
76
|
-
type: { summary: "boolean" },
|
|
77
|
-
defaultValue: { summary: true },
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
var Template = function (args) {
|
|
83
|
-
var headerVariantProp = args.headerVariants, footerVariantProp = args.footerVariants, shadow = args.shadow, contentProps = __rest(args, ["headerVariants", "footerVariants", "shadow"]);
|
|
84
|
-
return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { children: "Open Modal" }) }), _jsxs(DialogContent, __assign({}, contentProps, { shadow: shadow, children: [_jsxs(DialogHeader, { variant: headerVariantProp, children: [_jsx(DialogTitle, { children: "Modal Title" }), _jsx(DialogSubTitle, { children: "Subtitle" })] }), _jsx(DialogBody, { children: "You can put any content here." }), _jsx(DialogFooter, { variant: footerVariantProp, children: _jsx(DialogClose, { asChild: true, children: _jsx(Button, { children: "Close" }) }) })] }))] }));
|
|
85
|
-
};
|
|
86
|
-
export var Default = Template.bind({});
|
|
87
|
-
Default.args = {
|
|
88
|
-
size: "md",
|
|
89
|
-
headerVariants: "none",
|
|
90
|
-
footerVariants: "none",
|
|
91
|
-
shadow: true,
|
|
92
|
-
showCloseIcon: true,
|
|
93
|
-
};
|
|
94
|
-
export var SimpleModal = function () { return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { children: "Open Modal" }) }), _jsxs(DialogContent, { size: "sm", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Simple Modal" }), _jsx(DialogSubTitle, { children: "Subtitle" })] }), _jsx(DialogBody, { children: "You can put any content here." }), _jsx(DialogFooter, { children: _jsx(DialogClose, { asChild: true, children: _jsx(Button, { children: "Close" }) }) })] })] })); };
|
|
95
|
-
export var ModalSizes = function () { return (_jsx("div", { className: "flex flex-row gap-4", children: Object.keys(sizes).map(function (size) { return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsxs(Button, { children: ["Open ", size, " Modal"] }) }), _jsxs(DialogContent, { size: size, children: [_jsxs(DialogHeader, { children: [_jsxs(DialogTitle, { children: [size, " Modal"] }), _jsxs(DialogSubTitle, { children: ["This is a ", size, " modal example using the Modal component."] })] }), _jsx(DialogBody, { children: "You can put any content here." }), _jsx(DialogFooter, { children: _jsx(DialogClose, { asChild: true, children: _jsx(Button, { children: "Close" }) }) })] })] }, size)); }) })); };
|
|
96
|
-
export var HeaderVariants = function () { return (_jsx("div", { className: "flex flex-row gap-4", children: Object.keys(headerVariants).map(function (variant) { return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsxs(Button, { children: ["Open ", variant, " Header"] }) }), _jsxs(DialogContent, { size: "md", children: [_jsxs(DialogHeader, { variant: variant, children: [_jsxs(DialogTitle, { children: [variant, " Header"] }), _jsxs(DialogSubTitle, { children: ["This modal uses the \"", variant, "\" header variant."] })] }), _jsx(DialogBody, { children: _jsxs(Body, { variant: "body-md", children: ["This demonstrates the ", variant, " header style."] }) }), _jsx(DialogFooter, { children: _jsx(DialogClose, { asChild: true, children: _jsx(Button, { children: "Close" }) }) })] })] }, variant)); }) })); };
|
|
97
|
-
export var FooterVariants = function () { return (_jsx("div", { className: "flex flex-row gap-4", children: Object.keys(footerVariants).map(function (variant) { return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsxs(Button, { children: ["Open ", variant, " Footer"] }) }), _jsxs(DialogContent, { size: "md", children: [_jsxs(DialogHeader, { children: [_jsxs(DialogTitle, { children: [variant, " Footer"] }), _jsxs(DialogSubTitle, { children: ["This modal uses the \"", variant, "\" footer variant."] })] }), _jsx(DialogBody, { children: _jsxs(Body, { variant: "body-md", children: ["This demonstrates the ", variant, " footer style."] }) }), _jsx(DialogFooter, { variant: variant, children: _jsx(DialogClose, { asChild: true, children: _jsx(Button, { children: "Close" }) }) })] })] }, variant)); }) })); };
|
|
98
|
-
export var FooterButtonsLeftPosition = function () { return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { children: "Open Modal" }) }), _jsxs(DialogContent, { size: "md", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Confirm Action" }), _jsx(DialogSubTitle, { children: "SubTitle" })] }), _jsx(DialogBody, { children: _jsx(Body, { variant: "body-md", children: Dummy_Para }) }), _jsxs(DialogFooter, { className: "gap-2", children: [_jsx(Button, { onClick: function () { return alert("Action confirmed!"); }, children: "Confirm" }), _jsx(Button, { variant: "outline", onClick: function () { return alert("Action cancelled!"); }, children: "Cancel" }), _jsx(Button, { className: "ms-auto", children: "Help" })] })] })] })); };
|
|
99
|
-
FooterButtonsLeftPosition.parameters = {
|
|
100
|
-
docs: {
|
|
101
|
-
description: {
|
|
102
|
-
story: "On lg, footer buttons will be lg; on md, footer buttons will be md; and so on. The button size matches the modal size.",
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
export var FooterButtonsRightPosition = function () { return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { children: "Open Modal" }) }), _jsxs(DialogContent, { size: "md", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Confirm Action" }), _jsx(DialogSubTitle, { children: "SubTitle" })] }), _jsx(DialogBody, { children: _jsx(Body, { variant: "body-md", children: Dummy_Para }) }), _jsxs(DialogFooter, { children: [_jsx(Button, { children: "Help" }), _jsx(Button, { onClick: function () { return alert("Action confirmed!"); }, className: "ms-auto mr-2", children: "Confirm" }), _jsx(Button, { variant: "outline", onClick: function () { return alert("Action cancelled!"); }, children: "Cancel" })] })] })] })); };
|
|
107
|
-
export var FooterButtonsMiddlePosition = function () { return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { children: "Open Modal" }) }), _jsxs(DialogContent, { size: "md", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Confirm Action" }), _jsx(DialogSubTitle, { children: "SubTitle" })] }), _jsx(DialogBody, { children: _jsx(Body, { variant: "body-md", children: Dummy_Para }) }), _jsxs(DialogFooter, { className: "flex-row justify-center items-center gap-2", children: [_jsx(Button, { onClick: function () { return alert("Action confirmed!"); }, children: "Confirm" }), _jsx(Button, { variant: "outline", onClick: function () { return alert("Action cancelled!"); }, children: "Cancel" })] })] })] })); };
|
|
108
|
-
export var ShadowVariations = function () { return (_jsxs("div", { className: "flex flex-row gap-4", children: [_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { children: "Open Shadow" }) }), _jsxs(DialogContent, { size: "md", shadow: true, children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Shadow True" }), _jsx(DialogSubTitle, { children: "This modal uses the custom shadow." })] }), _jsx(DialogBody, { children: _jsx(Body, { variant: "body-md", children: "This demonstrates the shadow style." }) }), _jsx(DialogFooter, { children: _jsx(DialogClose, { asChild: true, children: _jsx(Button, { children: "Close" }) }) })] })] }), _jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { children: "Open No Shadow" }) }), _jsxs(DialogContent, { size: "md", shadow: false, children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Shadow False" }), _jsx(DialogSubTitle, { children: "This modal has no shadow." })] }), _jsx(DialogBody, { children: _jsx(Body, { variant: "body-md", children: "This demonstrates the no shadow style." }) }), _jsx(DialogFooter, { children: _jsx(DialogClose, { asChild: true, children: _jsx(Button, { children: "Close" }) }) })] })] })] })); };
|
|
109
|
-
export var InformationModalWithoutFooter = function () { return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { children: "Open Info Modal" }) }), _jsxs(DialogContent, { size: "lg", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { size: "lg", className: "text-center", children: "Contact Profile" }) }), _jsxs(DialogBody, { className: "flex flex-col items-center justify-center gap-7", children: [_jsxs(Avatar, { size: "huge", children: [_jsx(AvatarImage, { alt: "Avatar", src: "/images/avatar.png" }), _jsx(AvatarFallback, { children: "AB" })] }), _jsxs("div", { className: "flex flex-col items-center", children: [_jsx(Body, { variant: "body-md", children: "Designation" }), _jsx(Heading, { variant: "heading-md", children: "Heading" })] }), _jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [_jsx(LUIcon, { icon: "envelope", size: "lg" }), _jsx(Body, { variant: "body-md", className: "text-gray-600 truncate min-w-0", children: "testing@gmail.com" })] }), _jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [_jsx(LUIcon, { icon: "phone", size: "lg" }), _jsx(Body, { variant: "body-md", className: "text-gray-600 truncate min-w-0", children: "03764734829" })] })] }), _jsx(Body, { variant: "body-md", children: Dummy_Para })] })] })] })); };
|
|
110
|
-
export var ModalWithActionButtons = function () { return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { children: "Open Modal" }) }), _jsxs(DialogContent, { size: "md", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Confirm Action" }), _jsx(DialogSubTitle, { children: "Are you sure you want to proceed with this action? This cannot be undone." })] }), _jsx(DialogBody, { children: _jsx(Body, { variant: "body-md", children: Dummy_Para }) }), _jsxs(DialogFooter, { children: [_jsx(DialogAction, { asChild: true, children: _jsx(Button, { variant: "fill", className: "mr-2", onClick: function () { return alert("Action confirmed!"); }, children: "Confirm" }) }), _jsx(DialogClose, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Cancel" }) })] })] })] })); };
|
|
111
|
-
export var OutlineModal = function () { return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { children: "Open Outline Modal" }) }), _jsxs(DialogContent, { size: "md", children: [_jsxs(DialogHeader, { variant: "outline", children: [_jsx(DialogTitle, { children: "Outline Modal" }), _jsx(DialogSubTitle, { children: "This modal uses the \"outline\" header variant." })] }), _jsx(DialogBody, { children: _jsx(Body, { variant: "body-md", children: Dummy_Para }) }), _jsx(DialogFooter, { variant: "outline", children: _jsx(DialogClose, { asChild: true, children: _jsx(Button, { children: "Close" }) }) })] })] })); };
|
|
112
|
-
export var FullWidthButtonsModal = function () { return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { children: "Open Full Width Modal" }) }), _jsxs(DialogContent, { size: "lg", children: [_jsxs(DialogHeader, { variant: "outline", children: [_jsx(DialogTitle, { children: "Outline Modal" }), _jsx(DialogSubTitle, { children: "This modal uses the \"outline\" shadow variant." })] }), _jsx(DialogBody, { children: _jsx(Body, { variant: "body-md", children: Dummy_Para }) }), _jsxs(DialogFooter, { variant: "outline", children: [_jsx(DialogAction, { asChild: true, children: _jsx(Button, { variant: "fill", size: "lg", className: "w-1/2 mr-2", onClick: function () { return alert("Action confirmed!"); }, children: "Confirm" }) }), _jsx(DialogClose, { asChild: true, children: _jsx(Button, { variant: "outline", size: "lg", className: "w-1/2", onClick: function () { return alert("Action cancelled!"); }, children: "Close" }) })] })] })] })); };
|
|
113
|
-
export var BlockButtonModal = function () { return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { children: "Open Block Modal" }) }), _jsxs(DialogContent, { size: "lg", children: [_jsxs(DialogHeader, { variant: "outline", children: [_jsx(DialogTitle, { children: "Outline Modal" }), _jsx(DialogSubTitle, { children: "This modal uses the \"outline\" shadow variant." })] }), _jsx(DialogBody, { children: _jsx(Body, { variant: "body-md", children: Dummy_Para }) }), _jsx(DialogFooter, { variant: "outline", children: _jsx(DialogAction, { asChild: true, children: _jsx(Button, { variant: "fill", size: "lg", className: "w-full", onClick: function () { return alert("Action confirmed!"); }, children: "Confirm" }) }) })] })] })); };
|
|
114
|
-
export var NoCloseIconModal = function () { return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { children: "Open Modal Without Close Icon" }) }), _jsxs(DialogContent, { size: "md", showCloseIcon: false, children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "No Close Icon" }), _jsx(DialogSubTitle, { children: "This modal does not show the close icon." })] }), _jsx(DialogBody, { children: "You can put any content here. Use the footer button to close." }), _jsx(DialogFooter, { children: _jsx(DialogClose, { asChild: true, children: _jsx(Button, { children: "Close" }) }) })] })] })); };
|
|
115
|
-
export var ModalWithoutHeader = function () { return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { children: "Open Info Modal" }) }), _jsxs(DialogContent, { size: "lg", children: [_jsx(DialogHeader, { className: "min-h-[3rem]", variant: "outline" }), _jsxs(DialogBody, { className: "flex flex-col items-center justify-center gap-7", children: [_jsxs(Avatar, { size: "huge", children: [_jsx(AvatarImage, { alt: "Avatar", src: "/images/avatar.png" }), _jsx(AvatarFallback, { children: "AB" })] }), _jsxs("div", { className: "flex flex-col items-center", children: [_jsx(Body, { variant: "body-md", children: "Designation" }), _jsx(Heading, { variant: "heading-md", children: "Heading" })] }), _jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [_jsx(LUIcon, { icon: "envelope", size: "lg" }), _jsx(Body, { variant: "body-md", className: "text-gray-600 truncate min-w-0", children: "testing@gmail.com" })] }), _jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [_jsx(LUIcon, { icon: "phone", size: "lg" }), _jsx(Body, { variant: "body-md", className: "text-gray-600 truncate min-w-0", children: "03764734829" })] })] }), _jsx(Body, { variant: "body-md", children: Dummy_Para })] })] })] })); };
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { buttonStyles } from "../Button";
|
|
3
|
-
import { variant } from "../Button/Button/Button";
|
|
4
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "../Dropdown/select";
|
|
5
|
-
import { Body } from "../Typography/Body/body";
|
|
6
|
-
import { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis, } from "./pagination";
|
|
7
|
-
import { useState } from "react";
|
|
8
|
-
var range = function (start, end) {
|
|
9
|
-
return Array.from({ length: end - start + 1 }, function (_, i) { return start + i; });
|
|
10
|
-
};
|
|
11
|
-
export default {
|
|
12
|
-
title: "Components/Pagination",
|
|
13
|
-
component: Pagination,
|
|
14
|
-
tags: ["autodocs"],
|
|
15
|
-
parameters: {
|
|
16
|
-
docs: {
|
|
17
|
-
description: {
|
|
18
|
-
component: "A component for displaying pagination controls.",
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
var Template = function (args) { return (_jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { size: args.size, color: args.color, variant: args.variant, href: "#" }) }), range(1, 5).map(function (page) { return (_jsx(PaginationItem, { children: _jsx(PaginationLink, { size: args.size, color: args.color, variant: args.variant, href: "#", isActive: page === 1, children: page }) }, page)); }), _jsx(PaginationItem, { children: _jsx(PaginationNext, { size: args.size, color: args.color, variant: args.variant, href: "#" }) })] }) })); };
|
|
24
|
-
export var Default = Template.bind({});
|
|
25
|
-
Default.args = {};
|
|
26
|
-
Default.argTypes = {
|
|
27
|
-
size: {
|
|
28
|
-
control: { type: "select" },
|
|
29
|
-
options: Object.keys(buttonStyles.size),
|
|
30
|
-
description: "Size variant for Pagination",
|
|
31
|
-
table: {
|
|
32
|
-
defaultValue: { summary: "md" },
|
|
33
|
-
type: { summary: "enum" },
|
|
34
|
-
category: "Pagination",
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
color: {
|
|
38
|
-
control: { type: "select" },
|
|
39
|
-
options: Object.keys(buttonStyles.fillColor),
|
|
40
|
-
description: "Color theme for Pagination",
|
|
41
|
-
table: {
|
|
42
|
-
defaultValue: { summary: "gray" },
|
|
43
|
-
type: { summary: "enum" },
|
|
44
|
-
category: "Pagination",
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
variant: {
|
|
48
|
-
control: { type: "select" },
|
|
49
|
-
options: Object.keys(variant),
|
|
50
|
-
description: "Variant for Pagination (outline | fill | link)",
|
|
51
|
-
table: {
|
|
52
|
-
defaultValue: { summary: "ghost" },
|
|
53
|
-
type: { summary: "enum" },
|
|
54
|
-
category: "Pagination",
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
// Pagination with Ellipsis
|
|
59
|
-
export var WithEllipsis = function () {
|
|
60
|
-
var pages = [1, 2, "ellipsis", 8, 9, 10];
|
|
61
|
-
return (_jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { color: "red", href: "#" }) }), pages.map(function (page, idx) {
|
|
62
|
-
return page === "ellipsis" ? (_jsx(PaginationItem, { children: _jsx(PaginationEllipsis, { color: "red" }) }, "ellipsis-" + idx)) : (_jsx(PaginationItem, { children: _jsx(PaginationLink, { color: "red", href: "#", isActive: page === 1, children: page }) }, page));
|
|
63
|
-
}), _jsx(PaginationItem, { children: _jsx(PaginationNext, { color: "red", href: "#" }) })] }) }));
|
|
64
|
-
};
|
|
65
|
-
WithEllipsis.parameters = {
|
|
66
|
-
docs: {
|
|
67
|
-
description: {
|
|
68
|
-
story: "Pagination example with an ellipsis to indicate skipped pages.",
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
// All Colors
|
|
73
|
-
export var AllColors = function () { return (_jsx("div", { className: "flex flex-col gap-6", children: Object.keys(buttonStyles.fillColor).map(function (color) { return (_jsxs("div", { children: [_jsx("div", { className: "text-xl font-medium", children: color }), _jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { color: color, href: "#" }) }), range(1, 5).map(function (page) { return (_jsx(PaginationItem, { children: _jsx(PaginationLink, { color: color, href: "#", isActive: page === 1, children: page }) }, page)); }), _jsx(PaginationItem, { children: _jsx(PaginationNext, { color: color, href: "#" }) })] }) })] }, color)); }) })); };
|
|
74
|
-
AllColors.parameters = {
|
|
75
|
-
docs: {
|
|
76
|
-
description: {
|
|
77
|
-
story: "Shows Pagination in all color variants.",
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
// All Variants
|
|
82
|
-
export var AllVariants = function () { return (_jsx("div", { className: "flex flex-col gap-6", children: Object.keys(variant).map(function (v) { return (_jsxs("div", { children: [_jsx("div", { className: "text-xl font-medium", children: v }), _jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { variant: v, href: "#" }) }), range(1, 5).map(function (page) { return (_jsx(PaginationItem, { children: _jsx(PaginationLink, { variant: v, href: "#", isActive: page === 1, children: page }) }, page)); }), _jsx(PaginationItem, { children: _jsx(PaginationNext, { variant: v, href: "#" }) })] }) })] }, v)); }) })); };
|
|
83
|
-
AllVariants.parameters = {
|
|
84
|
-
docs: {
|
|
85
|
-
description: {
|
|
86
|
-
story: "Shows Pagination in all variant styles (fill, outline, link, ghost).",
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
// All Sizes
|
|
91
|
-
export var AllSizes = function () { return (_jsx("div", { className: "flex flex-col gap-6", children: Object.keys(buttonStyles.size).map(function (size) { return (_jsxs("div", { children: [_jsx("div", { className: "text-xl font-medium", children: size }), _jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { size: size, href: "#" }) }), range(1, 5).map(function (page) { return (_jsx(PaginationItem, { children: _jsx(PaginationLink, { size: size, href: "#", isActive: page === 1, children: page }) }, page)); }), _jsx(PaginationItem, { children: _jsx(PaginationNext, { size: size, href: "#" }) })] }) })] }, size)); }) })); };
|
|
92
|
-
AllSizes.parameters = {
|
|
93
|
-
docs: {
|
|
94
|
-
description: {
|
|
95
|
-
story: "Shows Pagination in all size variants.",
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
// Table of Pagination Stories
|
|
100
|
-
export var TablePagination = function () { return (_jsxs("div", { className: "flex gap-6", children: [_jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { href: "#" }) }), range(1, 5).map(function (page) { return (_jsx(PaginationItem, { children: _jsx(PaginationLink, { href: "#", isActive: page === 1, children: page }) }, page)); }), _jsx(PaginationItem, { children: _jsx(PaginationNext, { href: "#" }) })] }) }), _jsxs("div", { className: "inline-flex items-center gap-4", children: [_jsxs(Select, { defaultValue: "10", onValueChange: function () { }, children: [_jsx(SelectTrigger, { color: "default", shape: "rectangular", size: "md", variant: "fill", defaultValue: "10", children: _jsx(SelectValue, { placeholder: "Select an option", defaultValue: "10" }) }), _jsxs(SelectContent, { defaultValue: "10", className: "w-32", children: [_jsx(SelectItem, { value: "10", children: "10" }), _jsx(SelectItem, { value: "20", children: "20" }), _jsx(SelectItem, { value: "30", children: "30" })] })] }), _jsx(Body, { variant: "body-sm", className: "text-nowrap", children: "Showing 1 - 10 of 13" })] })] })); };
|
|
101
|
-
TablePagination.parameters = {
|
|
102
|
-
docs: {
|
|
103
|
-
description: {
|
|
104
|
-
story: "Shows Pagination in all size variants.",
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
|
-
// Material-UI Style Pagination
|
|
109
|
-
export var MultiPagination = function () {
|
|
110
|
-
var _a = useState(1), selectedPage = _a[0], setSelectedPage = _a[1];
|
|
111
|
-
var totalPages = 10;
|
|
112
|
-
var siblingCount = 1; // Number of pages to show on each side of the current page
|
|
113
|
-
var boundaryCount = 1; // Always show first and last page
|
|
114
|
-
// Helper to generate the pagination range
|
|
115
|
-
function getPaginationRange() {
|
|
116
|
-
var range = [];
|
|
117
|
-
var leftSibling = Math.max(selectedPage - siblingCount, boundaryCount + 2);
|
|
118
|
-
var rightSibling = Math.min(selectedPage + siblingCount, totalPages - boundaryCount - 1);
|
|
119
|
-
// Show all pages if total is small
|
|
120
|
-
if (totalPages <= 7) {
|
|
121
|
-
for (var i = 1; i <= totalPages; i++)
|
|
122
|
-
range.push(i);
|
|
123
|
-
return range;
|
|
124
|
-
}
|
|
125
|
-
// Always show first N pages
|
|
126
|
-
for (var i = 1; i <= boundaryCount; i++) {
|
|
127
|
-
range.push(i);
|
|
128
|
-
}
|
|
129
|
-
// Show left ellipsis if needed
|
|
130
|
-
if (leftSibling > boundaryCount + 2) {
|
|
131
|
-
range.push("ellipsis");
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
for (var i = boundaryCount + 1; i < leftSibling; i++) {
|
|
135
|
-
range.push(i);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
// Show middle pages
|
|
139
|
-
for (var i = leftSibling; i <= rightSibling; i++) {
|
|
140
|
-
range.push(i);
|
|
141
|
-
}
|
|
142
|
-
// Show right ellipsis if needed
|
|
143
|
-
if (rightSibling < totalPages - boundaryCount - 1) {
|
|
144
|
-
range.push("ellipsis");
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
for (var i = rightSibling + 1; i < totalPages - boundaryCount + 1; i++) {
|
|
148
|
-
range.push(i);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
// Always show last N pages
|
|
152
|
-
for (var i = totalPages - boundaryCount + 1; i <= totalPages; i++) {
|
|
153
|
-
range.push(i);
|
|
154
|
-
}
|
|
155
|
-
return range;
|
|
156
|
-
}
|
|
157
|
-
var pages = getPaginationRange();
|
|
158
|
-
return (_jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { href: "#", onClick: function () { return setSelectedPage(function (p) { return Math.max(1, p - 1); }); } }) }), pages.map(function (page, idx) {
|
|
159
|
-
return page === "ellipsis" ? (_jsx(PaginationItem, { children: _jsx(PaginationEllipsis, {}) }, "ellipsis-" + idx)) : (_jsx(PaginationItem, { children: _jsx(PaginationLink, { href: "#", isActive: selectedPage === page, onClick: function () { return setSelectedPage(Number(page)); }, children: page }) }, page));
|
|
160
|
-
}), _jsx(PaginationItem, { children: _jsx(PaginationNext, { href: "#", onClick: function () { return setSelectedPage(function (p) { return Math.min(totalPages, p + 1); }); } }) })] }) }));
|
|
161
|
-
};
|
|
162
|
-
MultiPagination.parameters = {
|
|
163
|
-
docs: {
|
|
164
|
-
description: {
|
|
165
|
-
story: "MultiPagination-UI style pagination: shows a window of pages, ellipses, and always the first/last page. Ellipses appear and disappear as you select different pages.",
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
};
|