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,14 +1,3 @@
|
|
|
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
1
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
2
|
var t = {};
|
|
14
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -20,49 +9,57 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
9
|
}
|
|
21
10
|
return t;
|
|
22
11
|
};
|
|
23
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
24
12
|
import * as React from "react";
|
|
25
13
|
import { cn } from "../../lib/utils";
|
|
26
14
|
import { buttonVariants } from "../Button/Button/Button";
|
|
27
15
|
import LUIcon from "../Icons/LUIcon";
|
|
28
16
|
var Pagination = function (_a) {
|
|
29
17
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
30
|
-
return (
|
|
18
|
+
return (<nav role="navigation" aria-label="pagination" className={cn("mx-auto flex w-full justify-center", className)} {...props}/>);
|
|
31
19
|
};
|
|
32
20
|
Pagination.displayName = "Pagination";
|
|
33
21
|
var PaginationContent = React.forwardRef(function (_a, ref) {
|
|
34
22
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
35
|
-
return (
|
|
23
|
+
return (<ul data-slot="reset-bs-ul" ref={ref} className={cn("flex flex-row items-center gap-1", className)} {...props}/>);
|
|
36
24
|
});
|
|
37
25
|
PaginationContent.displayName = "PaginationContent";
|
|
38
26
|
var PaginationItem = React.forwardRef(function (_a, ref) {
|
|
39
27
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
40
|
-
return (
|
|
28
|
+
return (<li ref={ref} className={cn("", className)} {...props}/>);
|
|
41
29
|
});
|
|
42
30
|
PaginationItem.displayName = "PaginationItem";
|
|
43
31
|
var PaginationLink = function (_a) {
|
|
44
32
|
var className = _a.className, isActive = _a.isActive, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.color, color = _c === void 0 ? "gray" : _c, _d = _a.variant, variant = _d === void 0 ? "ghost" : _d, props = __rest(_a, ["className", "isActive", "size", "color", "variant"]);
|
|
45
|
-
return (
|
|
33
|
+
return (<a aria-current={isActive ? "page" : undefined} data-slot="reset-bs-link" className={cn(buttonVariants({
|
|
46
34
|
variant: isActive ? (variant === "link" ? variant : "fill") : variant,
|
|
47
35
|
size: size,
|
|
48
36
|
color: color,
|
|
49
|
-
}), className)
|
|
37
|
+
}), className)} {...props}/>);
|
|
50
38
|
};
|
|
51
39
|
PaginationLink.displayName = "PaginationLink";
|
|
52
40
|
var PaginationPrevious = function (_a) {
|
|
53
41
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
54
|
-
return (
|
|
42
|
+
return (<PaginationLink aria-label="Go to previous page" size="md" className={cn("gap-1 pl-2.5", className)} {...props}>
|
|
43
|
+
<LUIcon icon="arrow-left"/>
|
|
44
|
+
<span className="max-sm:hidden">Previous</span>
|
|
45
|
+
</PaginationLink>);
|
|
55
46
|
};
|
|
56
47
|
PaginationPrevious.displayName = "PaginationPrevious";
|
|
57
48
|
var PaginationNext = function (_a) {
|
|
58
49
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
59
|
-
return (
|
|
50
|
+
return (<PaginationLink aria-label="Go to next page" size="md" className={cn("gap-1 pr-2.5", className)} {...props}>
|
|
51
|
+
<span className="max-sm:hidden">Next</span>
|
|
52
|
+
<LUIcon icon="arrow-right"/>
|
|
53
|
+
</PaginationLink>);
|
|
60
54
|
};
|
|
61
55
|
PaginationNext.displayName = "PaginationNext";
|
|
62
56
|
var PaginationEllipsis = function (_a) {
|
|
63
57
|
var color = _a.color, props = __rest(_a, ["color"]);
|
|
64
|
-
return (
|
|
65
|
-
|
|
58
|
+
return (<>
|
|
59
|
+
<LUIcon icon="ellipsis-horizontal" // Always use ellipsis-horizontal
|
|
60
|
+
color={color} {...props}/>
|
|
61
|
+
<span className="sr-only">More pages</span>
|
|
62
|
+
</>);
|
|
66
63
|
};
|
|
67
64
|
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
68
65
|
export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, };
|
|
@@ -13,7 +13,7 @@ type PaginationStoryArgs = {
|
|
|
13
13
|
};
|
|
14
14
|
export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, PaginationStoryArgs>;
|
|
15
15
|
export declare const WithEllipsis: {
|
|
16
|
-
(): import("react
|
|
16
|
+
(): import("react").JSX.Element;
|
|
17
17
|
parameters: {
|
|
18
18
|
docs: {
|
|
19
19
|
description: {
|
|
@@ -23,7 +23,7 @@ export declare const WithEllipsis: {
|
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
export declare const AllColors: {
|
|
26
|
-
(): import("react
|
|
26
|
+
(): import("react").JSX.Element;
|
|
27
27
|
parameters: {
|
|
28
28
|
docs: {
|
|
29
29
|
description: {
|
|
@@ -33,7 +33,7 @@ export declare const AllColors: {
|
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
export declare const AllVariants: {
|
|
36
|
-
(): import("react
|
|
36
|
+
(): import("react").JSX.Element;
|
|
37
37
|
parameters: {
|
|
38
38
|
docs: {
|
|
39
39
|
description: {
|
|
@@ -43,7 +43,7 @@ export declare const AllVariants: {
|
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
45
|
export declare const AllSizes: {
|
|
46
|
-
(): import("react
|
|
46
|
+
(): import("react").JSX.Element;
|
|
47
47
|
parameters: {
|
|
48
48
|
docs: {
|
|
49
49
|
description: {
|
|
@@ -53,7 +53,7 @@ export declare const AllSizes: {
|
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
55
|
export declare const TablePagination: {
|
|
56
|
-
(): import("react
|
|
56
|
+
(): import("react").JSX.Element;
|
|
57
57
|
parameters: {
|
|
58
58
|
docs: {
|
|
59
59
|
description: {
|
|
@@ -63,7 +63,7 @@ export declare const TablePagination: {
|
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
export declare const MultiPagination: {
|
|
66
|
-
(): import("react
|
|
66
|
+
(): import("react").JSX.Element;
|
|
67
67
|
parameters: {
|
|
68
68
|
docs: {
|
|
69
69
|
description: {
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { buttonStyles } from "../Button";
|
|
2
|
+
import { variant } from "../Button/Button/Button";
|
|
3
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "../Dropdown/select";
|
|
4
|
+
import { Body } from "../Typography/Body/body";
|
|
5
|
+
import { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis, } from "./pagination";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
var range = function (start, end) {
|
|
8
|
+
return Array.from({ length: end - start + 1 }, function (_, i) { return start + i; });
|
|
9
|
+
};
|
|
10
|
+
export default {
|
|
11
|
+
title: "Components/Pagination",
|
|
12
|
+
component: Pagination,
|
|
13
|
+
tags: ["autodocs"],
|
|
14
|
+
parameters: {
|
|
15
|
+
docs: {
|
|
16
|
+
description: {
|
|
17
|
+
component: "A component for displaying pagination controls.",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
var Template = function (args) { return (<Pagination>
|
|
23
|
+
<PaginationContent>
|
|
24
|
+
<PaginationItem>
|
|
25
|
+
<PaginationPrevious size={args.size} color={args.color} variant={args.variant} href="#"/>
|
|
26
|
+
</PaginationItem>
|
|
27
|
+
{range(1, 5).map(function (page) { return (<PaginationItem key={page}>
|
|
28
|
+
<PaginationLink size={args.size} color={args.color} variant={args.variant} href="#" isActive={page === 1}>
|
|
29
|
+
{page}
|
|
30
|
+
</PaginationLink>
|
|
31
|
+
</PaginationItem>); })}
|
|
32
|
+
<PaginationItem>
|
|
33
|
+
<PaginationNext size={args.size} color={args.color} variant={args.variant} href="#"/>
|
|
34
|
+
</PaginationItem>
|
|
35
|
+
</PaginationContent>
|
|
36
|
+
</Pagination>); };
|
|
37
|
+
export var Default = Template.bind({});
|
|
38
|
+
Default.args = {};
|
|
39
|
+
Default.argTypes = {
|
|
40
|
+
size: {
|
|
41
|
+
control: { type: "select" },
|
|
42
|
+
options: Object.keys(buttonStyles.size),
|
|
43
|
+
description: "Size variant for Pagination",
|
|
44
|
+
table: {
|
|
45
|
+
defaultValue: { summary: "md" },
|
|
46
|
+
type: { summary: "enum" },
|
|
47
|
+
category: "Pagination",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
color: {
|
|
51
|
+
control: { type: "select" },
|
|
52
|
+
options: Object.keys(buttonStyles.fillColor),
|
|
53
|
+
description: "Color theme for Pagination",
|
|
54
|
+
table: {
|
|
55
|
+
defaultValue: { summary: "gray" },
|
|
56
|
+
type: { summary: "enum" },
|
|
57
|
+
category: "Pagination",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
variant: {
|
|
61
|
+
control: { type: "select" },
|
|
62
|
+
options: Object.keys(variant),
|
|
63
|
+
description: "Variant for Pagination (outline | fill | link)",
|
|
64
|
+
table: {
|
|
65
|
+
defaultValue: { summary: "ghost" },
|
|
66
|
+
type: { summary: "enum" },
|
|
67
|
+
category: "Pagination",
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
// Pagination with Ellipsis
|
|
72
|
+
export var WithEllipsis = function () {
|
|
73
|
+
var pages = [1, 2, "ellipsis", 8, 9, 10];
|
|
74
|
+
return (<Pagination>
|
|
75
|
+
<PaginationContent>
|
|
76
|
+
<PaginationItem>
|
|
77
|
+
<PaginationPrevious color="red" href="#"/>
|
|
78
|
+
</PaginationItem>
|
|
79
|
+
{pages.map(function (page, idx) {
|
|
80
|
+
return page === "ellipsis" ? (<PaginationItem key={"ellipsis-" + idx}>
|
|
81
|
+
<PaginationEllipsis color="red"/>
|
|
82
|
+
</PaginationItem>) : (<PaginationItem key={page}>
|
|
83
|
+
<PaginationLink color="red" href="#" isActive={page === 1}>
|
|
84
|
+
{page}
|
|
85
|
+
</PaginationLink>
|
|
86
|
+
</PaginationItem>);
|
|
87
|
+
})}
|
|
88
|
+
<PaginationItem>
|
|
89
|
+
<PaginationNext color="red" href="#"/>
|
|
90
|
+
</PaginationItem>
|
|
91
|
+
</PaginationContent>
|
|
92
|
+
</Pagination>);
|
|
93
|
+
};
|
|
94
|
+
WithEllipsis.parameters = {
|
|
95
|
+
docs: {
|
|
96
|
+
description: {
|
|
97
|
+
story: "Pagination example with an ellipsis to indicate skipped pages.",
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
// All Colors
|
|
102
|
+
export var AllColors = function () { return (<div className="flex flex-col gap-6">
|
|
103
|
+
{Object.keys(buttonStyles.fillColor).map(function (color) { return (<div key={color}>
|
|
104
|
+
<div className="text-xl font-medium">{color}</div>
|
|
105
|
+
<Pagination>
|
|
106
|
+
<PaginationContent>
|
|
107
|
+
<PaginationItem>
|
|
108
|
+
<PaginationPrevious color={color} href="#"/>
|
|
109
|
+
</PaginationItem>
|
|
110
|
+
{range(1, 5).map(function (page) { return (<PaginationItem key={page}>
|
|
111
|
+
<PaginationLink color={color} href="#" isActive={page === 1}>
|
|
112
|
+
{page}
|
|
113
|
+
</PaginationLink>
|
|
114
|
+
</PaginationItem>); })}
|
|
115
|
+
<PaginationItem>
|
|
116
|
+
<PaginationNext color={color} href="#"/>
|
|
117
|
+
</PaginationItem>
|
|
118
|
+
</PaginationContent>
|
|
119
|
+
</Pagination>
|
|
120
|
+
</div>); })}
|
|
121
|
+
</div>); };
|
|
122
|
+
AllColors.parameters = {
|
|
123
|
+
docs: {
|
|
124
|
+
description: {
|
|
125
|
+
story: "Shows Pagination in all color variants.",
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
// All Variants
|
|
130
|
+
export var AllVariants = function () { return (<div className="flex flex-col gap-6">
|
|
131
|
+
{Object.keys(variant).map(function (v) { return (<div key={v}>
|
|
132
|
+
<div className="text-xl font-medium">{v}</div>
|
|
133
|
+
<Pagination>
|
|
134
|
+
<PaginationContent>
|
|
135
|
+
<PaginationItem>
|
|
136
|
+
<PaginationPrevious variant={v} href="#"/>
|
|
137
|
+
</PaginationItem>
|
|
138
|
+
{range(1, 5).map(function (page) { return (<PaginationItem key={page}>
|
|
139
|
+
<PaginationLink variant={v} href="#" isActive={page === 1}>
|
|
140
|
+
{page}
|
|
141
|
+
</PaginationLink>
|
|
142
|
+
</PaginationItem>); })}
|
|
143
|
+
<PaginationItem>
|
|
144
|
+
<PaginationNext variant={v} href="#"/>
|
|
145
|
+
</PaginationItem>
|
|
146
|
+
</PaginationContent>
|
|
147
|
+
</Pagination>
|
|
148
|
+
</div>); })}
|
|
149
|
+
</div>); };
|
|
150
|
+
AllVariants.parameters = {
|
|
151
|
+
docs: {
|
|
152
|
+
description: {
|
|
153
|
+
story: "Shows Pagination in all variant styles (fill, outline, link, ghost).",
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
// All Sizes
|
|
158
|
+
export var AllSizes = function () { return (<div className="flex flex-col gap-6">
|
|
159
|
+
{Object.keys(buttonStyles.size).map(function (size) { return (<div key={size}>
|
|
160
|
+
<div className="text-xl font-medium">{size}</div>
|
|
161
|
+
<Pagination>
|
|
162
|
+
<PaginationContent>
|
|
163
|
+
<PaginationItem>
|
|
164
|
+
<PaginationPrevious size={size} href="#"/>
|
|
165
|
+
</PaginationItem>
|
|
166
|
+
{range(1, 5).map(function (page) { return (<PaginationItem key={page}>
|
|
167
|
+
<PaginationLink size={size} href="#" isActive={page === 1}>
|
|
168
|
+
{page}
|
|
169
|
+
</PaginationLink>
|
|
170
|
+
</PaginationItem>); })}
|
|
171
|
+
<PaginationItem>
|
|
172
|
+
<PaginationNext size={size} href="#"/>
|
|
173
|
+
</PaginationItem>
|
|
174
|
+
</PaginationContent>
|
|
175
|
+
</Pagination>
|
|
176
|
+
</div>); })}
|
|
177
|
+
</div>); };
|
|
178
|
+
AllSizes.parameters = {
|
|
179
|
+
docs: {
|
|
180
|
+
description: {
|
|
181
|
+
story: "Shows Pagination in all size variants.",
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
// Table of Pagination Stories
|
|
186
|
+
export var TablePagination = function () { return (<div className="flex gap-6">
|
|
187
|
+
<Pagination>
|
|
188
|
+
<PaginationContent>
|
|
189
|
+
<PaginationItem>
|
|
190
|
+
<PaginationPrevious href="#"/>
|
|
191
|
+
</PaginationItem>
|
|
192
|
+
{range(1, 5).map(function (page) { return (<PaginationItem key={page}>
|
|
193
|
+
<PaginationLink href="#" isActive={page === 1}>
|
|
194
|
+
{page}
|
|
195
|
+
</PaginationLink>
|
|
196
|
+
</PaginationItem>); })}
|
|
197
|
+
<PaginationItem>
|
|
198
|
+
<PaginationNext href="#"/>
|
|
199
|
+
</PaginationItem>
|
|
200
|
+
</PaginationContent>
|
|
201
|
+
</Pagination>
|
|
202
|
+
<div className="inline-flex items-center gap-4">
|
|
203
|
+
<Select defaultValue="10" onValueChange={function () { }}>
|
|
204
|
+
<SelectTrigger color="default" shape="rectangular" size="md" variant="fill" defaultValue={"10"}>
|
|
205
|
+
<SelectValue placeholder="Select an option" defaultValue={"10"}/>
|
|
206
|
+
</SelectTrigger>
|
|
207
|
+
<SelectContent defaultValue={"10"} className="w-32">
|
|
208
|
+
<SelectItem value="10">10</SelectItem>
|
|
209
|
+
<SelectItem value="20">20</SelectItem>
|
|
210
|
+
<SelectItem value="30">30</SelectItem>
|
|
211
|
+
</SelectContent>
|
|
212
|
+
</Select>
|
|
213
|
+
<Body variant={"body-sm"} className="text-nowrap">
|
|
214
|
+
Showing 1 - 10 of 13
|
|
215
|
+
</Body>
|
|
216
|
+
</div>
|
|
217
|
+
</div>); };
|
|
218
|
+
TablePagination.parameters = {
|
|
219
|
+
docs: {
|
|
220
|
+
description: {
|
|
221
|
+
story: "Shows Pagination in all size variants.",
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
// Material-UI Style Pagination
|
|
226
|
+
export var MultiPagination = function () {
|
|
227
|
+
var _a = useState(1), selectedPage = _a[0], setSelectedPage = _a[1];
|
|
228
|
+
var totalPages = 10;
|
|
229
|
+
var siblingCount = 1; // Number of pages to show on each side of the current page
|
|
230
|
+
var boundaryCount = 1; // Always show first and last page
|
|
231
|
+
// Helper to generate the pagination range
|
|
232
|
+
function getPaginationRange() {
|
|
233
|
+
var range = [];
|
|
234
|
+
var leftSibling = Math.max(selectedPage - siblingCount, boundaryCount + 2);
|
|
235
|
+
var rightSibling = Math.min(selectedPage + siblingCount, totalPages - boundaryCount - 1);
|
|
236
|
+
// Show all pages if total is small
|
|
237
|
+
if (totalPages <= 7) {
|
|
238
|
+
for (var i = 1; i <= totalPages; i++)
|
|
239
|
+
range.push(i);
|
|
240
|
+
return range;
|
|
241
|
+
}
|
|
242
|
+
// Always show first N pages
|
|
243
|
+
for (var i = 1; i <= boundaryCount; i++) {
|
|
244
|
+
range.push(i);
|
|
245
|
+
}
|
|
246
|
+
// Show left ellipsis if needed
|
|
247
|
+
if (leftSibling > boundaryCount + 2) {
|
|
248
|
+
range.push("ellipsis");
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
for (var i = boundaryCount + 1; i < leftSibling; i++) {
|
|
252
|
+
range.push(i);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
// Show middle pages
|
|
256
|
+
for (var i = leftSibling; i <= rightSibling; i++) {
|
|
257
|
+
range.push(i);
|
|
258
|
+
}
|
|
259
|
+
// Show right ellipsis if needed
|
|
260
|
+
if (rightSibling < totalPages - boundaryCount - 1) {
|
|
261
|
+
range.push("ellipsis");
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
for (var i = rightSibling + 1; i < totalPages - boundaryCount + 1; i++) {
|
|
265
|
+
range.push(i);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
// Always show last N pages
|
|
269
|
+
for (var i = totalPages - boundaryCount + 1; i <= totalPages; i++) {
|
|
270
|
+
range.push(i);
|
|
271
|
+
}
|
|
272
|
+
return range;
|
|
273
|
+
}
|
|
274
|
+
var pages = getPaginationRange();
|
|
275
|
+
return (<Pagination>
|
|
276
|
+
<PaginationContent>
|
|
277
|
+
<PaginationItem>
|
|
278
|
+
<PaginationPrevious href="#" onClick={function () { return setSelectedPage(function (p) { return Math.max(1, p - 1); }); }}/>
|
|
279
|
+
</PaginationItem>
|
|
280
|
+
{pages.map(function (page, idx) {
|
|
281
|
+
return page === "ellipsis" ? (<PaginationItem key={"ellipsis-" + idx}>
|
|
282
|
+
<PaginationEllipsis />
|
|
283
|
+
</PaginationItem>) : (<PaginationItem key={page}>
|
|
284
|
+
<PaginationLink href="#" isActive={selectedPage === page} onClick={function () { return setSelectedPage(Number(page)); }}>
|
|
285
|
+
{page}
|
|
286
|
+
</PaginationLink>
|
|
287
|
+
</PaginationItem>);
|
|
288
|
+
})}
|
|
289
|
+
<PaginationItem>
|
|
290
|
+
<PaginationNext href="#" onClick={function () { return setSelectedPage(function (p) { return Math.min(totalPages, p + 1); }); }}/>
|
|
291
|
+
</PaginationItem>
|
|
292
|
+
</PaginationContent>
|
|
293
|
+
</Pagination>);
|
|
294
|
+
};
|
|
295
|
+
MultiPagination.parameters = {
|
|
296
|
+
docs: {
|
|
297
|
+
description: {
|
|
298
|
+
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.",
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
};
|
|
@@ -1,14 +1,3 @@
|
|
|
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
1
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
2
|
var t = {};
|
|
14
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -20,10 +9,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
9
|
}
|
|
21
10
|
return t;
|
|
22
11
|
};
|
|
23
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
24
12
|
import { RadioGroup, RadioGroupItem, sizeClass } from "./radio-group";
|
|
25
13
|
import { Label } from "../Label/Label";
|
|
26
|
-
import { useState } from "react";
|
|
14
|
+
import React, { useState } from "react";
|
|
27
15
|
import { Caption } from "../Typography/Caption/caption";
|
|
28
16
|
import { Button } from "../Button/Button/Button";
|
|
29
17
|
var meta = {
|
|
@@ -88,29 +76,71 @@ export var Basic = {
|
|
|
88
76
|
setCurrentValue(value);
|
|
89
77
|
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(value); // safe call for Storybook action
|
|
90
78
|
};
|
|
91
|
-
return (
|
|
79
|
+
return (<>
|
|
80
|
+
<RadioGroup {...radioGroupProps} onValueChange={handleChange} value={currentValue}>
|
|
81
|
+
<div className="flex items-center space-x-2">
|
|
82
|
+
<RadioGroupItem value="option-1" id="option-1" size={size}/>
|
|
83
|
+
<Label htmlFor="option-1">Option 1</Label>
|
|
84
|
+
</div>
|
|
85
|
+
<div className="flex items-center space-x-2">
|
|
86
|
+
<RadioGroupItem value="option-2" id="option-2" size={size}/>
|
|
87
|
+
<Label htmlFor="option-2">Option 2</Label>
|
|
88
|
+
</div>
|
|
89
|
+
<div className="flex items-center space-x-2">
|
|
90
|
+
<RadioGroupItem value="option-3" id="option-3" size={size}/>
|
|
91
|
+
<Label htmlFor="option-3">Option 3</Label>
|
|
92
|
+
</div>
|
|
93
|
+
</RadioGroup>
|
|
94
|
+
</>);
|
|
92
95
|
},
|
|
93
96
|
};
|
|
94
97
|
export var Disabled = {
|
|
95
98
|
args: {
|
|
96
99
|
disabled: true,
|
|
97
100
|
},
|
|
98
|
-
render: function (args) { return (
|
|
101
|
+
render: function (args) { return (<RadioGroup {...args}>
|
|
102
|
+
<div className="flex items-center space-x-2">
|
|
103
|
+
<RadioGroupItem value="option-1" id="disabled-1" disabled/>
|
|
104
|
+
<Label htmlFor="disabled-1">Option 1</Label>
|
|
105
|
+
</div>
|
|
106
|
+
<div className="flex items-center space-x-2">
|
|
107
|
+
<RadioGroupItem value="option-2" id="disabled-2" disabled/>
|
|
108
|
+
<Label htmlFor="disabled-2">Option 2</Label>
|
|
109
|
+
</div>
|
|
110
|
+
</RadioGroup>); },
|
|
99
111
|
};
|
|
100
112
|
export var ValidationComponent = function () {
|
|
101
113
|
var _a = useState(""), selected = _a[0], setSelected = _a[1];
|
|
102
114
|
var _b = useState(false), submitted = _b[0], setSubmitted = _b[1];
|
|
103
115
|
var hasError = submitted && !selected;
|
|
104
|
-
return (
|
|
116
|
+
return (<form onSubmit={function (e) {
|
|
105
117
|
e.preventDefault();
|
|
106
118
|
setSubmitted(true);
|
|
107
119
|
if (selected) {
|
|
108
120
|
alert("Selected: ".concat(selected));
|
|
109
121
|
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
122
|
+
}} className="w-fit space-y-4">
|
|
123
|
+
<div className="space-y-2">
|
|
124
|
+
<Label>Choose an option</Label>
|
|
125
|
+
<RadioGroup value={selected} onValueChange={function (val) {
|
|
126
|
+
if (typeof val === "string") {
|
|
127
|
+
setSelected(val);
|
|
128
|
+
setSubmitted(false); // clear error on change
|
|
129
|
+
}
|
|
130
|
+
}} className="flex flex-col gap-2">
|
|
131
|
+
<div className="flex items-center space-x-2">
|
|
132
|
+
<RadioGroupItem value="option-1" id="validation-1" color={hasError ? "red" : "default"} className="border"/>
|
|
133
|
+
<Label htmlFor="validation-1">Option 1</Label>
|
|
134
|
+
</div>
|
|
135
|
+
<div className="flex items-center space-x-2">
|
|
136
|
+
<RadioGroupItem value="option-2" id="validation-2" color={hasError ? "red" : "default"} className="border"/>
|
|
137
|
+
<Label htmlFor="validation-2">Option 2</Label>
|
|
138
|
+
</div>
|
|
139
|
+
</RadioGroup>
|
|
140
|
+
{hasError && (<Caption className="text-red-500">Please select an option.</Caption>)}
|
|
141
|
+
</div>
|
|
142
|
+
<Button type="submit" className="px-4 py-2 bg-blue-600 text-white rounded">
|
|
143
|
+
Submit
|
|
144
|
+
</Button>
|
|
145
|
+
</form>);
|
|
116
146
|
};
|
|
@@ -10,5 +10,5 @@ interface RadioGroupItemProps extends Omit<React.ComponentProps<typeof RadioGrou
|
|
|
10
10
|
size?: keyof typeof sizeClass;
|
|
11
11
|
color?: "default" | "red";
|
|
12
12
|
}
|
|
13
|
-
declare function RadioGroupItem(props: RadioGroupItemProps):
|
|
13
|
+
declare function RadioGroupItem(props: RadioGroupItemProps): React.JSX.Element;
|
|
14
14
|
export { RadioGroup, RadioGroupItem };
|
|
@@ -1,14 +1,3 @@
|
|
|
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
1
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
2
|
var t = {};
|
|
14
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -20,7 +9,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
9
|
}
|
|
21
10
|
return t;
|
|
22
11
|
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
12
|
import * as React from "react";
|
|
25
13
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
26
14
|
import { CircleIcon } from "lucide-react";
|
|
@@ -37,7 +25,7 @@ var checkedCircleSize = {
|
|
|
37
25
|
};
|
|
38
26
|
var RadioGroup = React.forwardRef(function (_a, ref) {
|
|
39
27
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
40
|
-
return (
|
|
28
|
+
return (<RadioGroupPrimitive.Root ref={ref} data-slot="radio-group" className={cn("grid !gap-2", className)} {...props}/>);
|
|
41
29
|
});
|
|
42
30
|
RadioGroup.displayName = "RadioGroup";
|
|
43
31
|
function RadioGroupItem(props) {
|
|
@@ -52,6 +40,10 @@ function RadioGroupItem(props) {
|
|
|
52
40
|
default: "fill-blue-600 stroke-blue-600",
|
|
53
41
|
red: "fill-red-600 stroke-red-600",
|
|
54
42
|
};
|
|
55
|
-
return (
|
|
43
|
+
return (<RadioGroupPrimitive.Item data-slot="radio-group-item" className={cn(size && sizeClass[size], colorClasses[color], "focus-visible:border-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square shrink-0 !rounded-full !border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:border-gray-300 disabled:bg-gray-100", className)} {...rest}>
|
|
44
|
+
<RadioGroupPrimitive.Indicator data-slot="radio-group-indicator" className="relative flex items-center justify-center">
|
|
45
|
+
<CircleIcon className={cn(indicatorColor[color], "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2", checkedCircleSize[size])}/>
|
|
46
|
+
</RadioGroupPrimitive.Indicator>
|
|
47
|
+
</RadioGroupPrimitive.Item>);
|
|
56
48
|
}
|
|
57
49
|
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Separator } from "../../components/Separator/separator";
|
|
3
|
+
declare const meta: Meta<typeof Separator>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Separator>;
|
|
6
|
+
export declare function SeparatorDemo({ orientation, decorative, className, }: {
|
|
7
|
+
orientation?: "horizontal" | "vertical";
|
|
8
|
+
decorative?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
export declare const Horizontal: Story;
|
|
12
|
+
export declare const Vertical: Story;
|
|
13
|
+
export declare const Demo: Story;
|
|
14
|
+
export declare const DecorativeTrue: Story;
|
|
15
|
+
export declare const DecorativeFalse: Story;
|