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,15 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
3
|
var t = {};
|
|
15
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -30,7 +19,6 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
30
19
|
}
|
|
31
20
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
32
21
|
};
|
|
33
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
22
|
import { format, startOfDay } from "date-fns";
|
|
35
23
|
import { cn } from "../../lib/utils";
|
|
36
24
|
import { Calendar } from "../ui/calendar";
|
|
@@ -74,7 +62,17 @@ export function DateRangePicker(_a) {
|
|
|
74
62
|
? format(dateRange.from, dateFormat)
|
|
75
63
|
: startLabel;
|
|
76
64
|
var endText = hasEndDate ? format(dateRange.to, dateFormat) : endLabel;
|
|
77
|
-
return (
|
|
65
|
+
return (<>
|
|
66
|
+
<Body as="span" className={cn(!hasStartDate && "text-muted-foreground")}>
|
|
67
|
+
{startText}
|
|
68
|
+
</Body>
|
|
69
|
+
<Body as="span" className="text-gray-400 mx-2">
|
|
70
|
+
{separator}
|
|
71
|
+
</Body>
|
|
72
|
+
<Body as="span" className={cn(!hasEndDate && "text-muted-foreground")}>
|
|
73
|
+
{endText}
|
|
74
|
+
</Body>
|
|
75
|
+
</>);
|
|
78
76
|
};
|
|
79
77
|
var handlePresetClick = function (range) {
|
|
80
78
|
if (showApplyButton) {
|
|
@@ -127,35 +125,85 @@ export function DateRangePicker(_a) {
|
|
|
127
125
|
}
|
|
128
126
|
}
|
|
129
127
|
};
|
|
130
|
-
return (
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
128
|
+
return (<Popover open={!disabled && open} onOpenChange={disabled ? undefined : handleOpenChange}>
|
|
129
|
+
<PopoverTrigger asChild>
|
|
130
|
+
<div className="relative">
|
|
131
|
+
{startIcon && (<LUIcon icon={startIcon} size={iconSizeClass} className={cn("absolute top-1/2 -translate-y-1/2 pointer-events-none z-10", iconPosition.left)}/>)}
|
|
132
|
+
<Button color="light-gray" aria-expanded={open} data-slot="date-range-picker-input" className={cn("w-full justify-between !p-0", inputVariants({ variant: variant, size: size, color: color, shape: shape }), "text-left flex items-center", !hasStartDate && "text-muted-foreground", open &&
|
|
133
|
+
color === "default" &&
|
|
134
|
+
"border-blue-600 ring-2 ring-blue-200", disabled && [
|
|
135
|
+
variant === "filled" && "bg-gray-100",
|
|
136
|
+
"border border-gray-300 cursor-not-allowed pointer-events-none opacity-50",
|
|
137
|
+
])} shape={inputVariantConfig.shape[shape]} disabled={disabled} tabIndex={disabled ? -1 : 0}>
|
|
138
|
+
<div className={cn("flex-grow flex items-center gap-2", paddingClass)}>
|
|
139
|
+
{renderDateRange()}
|
|
140
|
+
</div>
|
|
141
|
+
</Button>
|
|
142
|
+
{hasClearButton && (<span onClick={handleClear}>
|
|
143
|
+
<LUIcon icon="xMark" size="lg" color="gray" variant="padded" className={cn("absolute top-1/2 -translate-y-1/2 z-10", iconPosition.right)}/>
|
|
144
|
+
</span>)}
|
|
145
|
+
{!hasClearButton && endIcon && (<LUIcon icon={endIcon} size={iconSizeClass} className={cn("absolute top-1/2 -translate-y-1/2 pointer-events-none z-10", iconPosition.right)}/>)}
|
|
146
|
+
</div>
|
|
147
|
+
</PopoverTrigger>
|
|
148
|
+
<PopoverContent align="start" className={cn("w-auto p-0 bg-white", shadow && "rounded-md shadow-lg border border-gray-200", presets && "flex", className)} {...props}>
|
|
149
|
+
{presets && presets.length > 0 && (<div className="flex flex-col gap-1 p-3 border-r border-gray-200">
|
|
150
|
+
<Body variant="body-sm-500" className="mb-2">
|
|
151
|
+
Quick Select
|
|
152
|
+
</Body>
|
|
153
|
+
{presets.map(function (preset, index) { return (<Button key={index} variant="ghost" size="sm" className="justify-start text-left whitespace-nowrap" onClick={function () { return handlePresetClick(preset.range); }}>
|
|
154
|
+
{preset.label}
|
|
155
|
+
</Button>); })}
|
|
156
|
+
</div>)}
|
|
157
|
+
<div className="flex flex-col">
|
|
158
|
+
{isMobile && (<div className="px-4 py-3 border-b border-gray-200 bg-gray-50">
|
|
159
|
+
<Body variant="body-sm-500" className="mb-1">
|
|
160
|
+
{mobileStep === "start" && "Select start date"}
|
|
161
|
+
{mobileStep === "end" && "Select end date"}
|
|
162
|
+
{mobileStep === "complete" && "Date range selected"}
|
|
163
|
+
</Body>
|
|
164
|
+
{mobileStep === "end" && (tempDateRange === null || tempDateRange === void 0 ? void 0 : tempDateRange.from) && (<Caption variant="sm" color="gray">
|
|
165
|
+
From: {format(tempDateRange.from, dateFormat)}
|
|
166
|
+
</Caption>)}
|
|
167
|
+
{mobileStep === "complete" &&
|
|
168
|
+
(tempDateRange === null || tempDateRange === void 0 ? void 0 : tempDateRange.from) &&
|
|
169
|
+
(tempDateRange === null || tempDateRange === void 0 ? void 0 : tempDateRange.to) && (<Caption variant="sm" color="gray">
|
|
170
|
+
{format(tempDateRange.from, dateFormat)} -{" "}
|
|
171
|
+
{format(tempDateRange.to, dateFormat)}
|
|
172
|
+
</Caption>)}
|
|
173
|
+
</div>)}
|
|
174
|
+
<Calendar {...{
|
|
175
|
+
mode: "range",
|
|
176
|
+
selected: showApplyButton
|
|
177
|
+
? (tempDateRange !== null && tempDateRange !== void 0 ? tempDateRange : undefined)
|
|
178
|
+
: (dateRange !== null && dateRange !== void 0 ? dateRange : undefined),
|
|
179
|
+
onSelect: function (selectedRange) {
|
|
180
|
+
if (isMobile) {
|
|
181
|
+
handleMobileDateSelect(selectedRange);
|
|
182
|
+
}
|
|
183
|
+
else if (showApplyButton) {
|
|
184
|
+
setTempDateRange(selectedRange !== null && selectedRange !== void 0 ? selectedRange : null);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(selectedRange !== null && selectedRange !== void 0 ? selectedRange : null);
|
|
188
|
+
if ((selectedRange === null || selectedRange === void 0 ? void 0 : selectedRange.from) && (selectedRange === null || selectedRange === void 0 ? void 0 : selectedRange.to)) {
|
|
189
|
+
setOpen(false);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
calendarSize: size,
|
|
194
|
+
autoFocus: true,
|
|
195
|
+
numberOfMonths: isMobile ? 1 : numberOfMonths,
|
|
196
|
+
disabled: disabledDates,
|
|
197
|
+
}}/>
|
|
198
|
+
{(showApplyButton || (isMobile && mobileStep === "complete")) && (<div className="flex items-center justify-end gap-2 p-3 border-t border-gray-200">
|
|
199
|
+
<Button variant="ghost" size="sm" onClick={handleCancel} className="text-gray-700">
|
|
200
|
+
Cancel
|
|
201
|
+
</Button>
|
|
202
|
+
<Button size="sm" onClick={handleApply} disabled={!(tempDateRange === null || tempDateRange === void 0 ? void 0 : tempDateRange.from) || !(tempDateRange === null || tempDateRange === void 0 ? void 0 : tempDateRange.to)} className="bg-black text-white hover:!bg-gray-900">
|
|
203
|
+
Apply
|
|
204
|
+
</Button>
|
|
205
|
+
</div>)}
|
|
206
|
+
</div>
|
|
207
|
+
</PopoverContent>
|
|
208
|
+
</Popover>);
|
|
161
209
|
}
|
|
@@ -3,22 +3,22 @@ import { DateRangePickerProps } from ".";
|
|
|
3
3
|
declare const _default: Meta;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, DateRangePickerProps>;
|
|
6
|
-
export declare const WithStartEndLabels: () => import("react
|
|
7
|
-
export declare const WithIcons: () => import("react
|
|
8
|
-
export declare const Sizes: () => import("react
|
|
9
|
-
export declare const Variants: () => import("react
|
|
10
|
-
export declare const Shapes: () => import("react
|
|
11
|
-
export declare const WithPresets: () => import("react
|
|
12
|
-
export declare const SingleMonth: () => import("react
|
|
13
|
-
export declare const WithDateRestrictions: () => import("react
|
|
14
|
-
export declare const DisabledState: () => import("react
|
|
15
|
-
export declare const CustomFormatting: () => import("react
|
|
16
|
-
export declare const Colors: () => import("react
|
|
17
|
-
export declare const FormIntegration: () => import("react
|
|
18
|
-
export declare const WithTooltip: () => import("react
|
|
19
|
-
export declare const RealWorldExamples: () => import("react
|
|
20
|
-
export declare const WithClearButton: () => import("react
|
|
21
|
-
export declare const WithApplyButton: () => import("react
|
|
22
|
-
export declare const WithApplyButtonAndPresets: () => import("react
|
|
23
|
-
export declare const ClearButtonCallbacks: () => import("react
|
|
24
|
-
export declare const MobileResponsive: () => import("react
|
|
6
|
+
export declare const WithStartEndLabels: () => import("react").JSX.Element;
|
|
7
|
+
export declare const WithIcons: () => import("react").JSX.Element;
|
|
8
|
+
export declare const Sizes: () => import("react").JSX.Element;
|
|
9
|
+
export declare const Variants: () => import("react").JSX.Element;
|
|
10
|
+
export declare const Shapes: () => import("react").JSX.Element;
|
|
11
|
+
export declare const WithPresets: () => import("react").JSX.Element;
|
|
12
|
+
export declare const SingleMonth: () => import("react").JSX.Element;
|
|
13
|
+
export declare const WithDateRestrictions: () => import("react").JSX.Element;
|
|
14
|
+
export declare const DisabledState: () => import("react").JSX.Element;
|
|
15
|
+
export declare const CustomFormatting: () => import("react").JSX.Element;
|
|
16
|
+
export declare const Colors: () => import("react").JSX.Element;
|
|
17
|
+
export declare const FormIntegration: () => import("react").JSX.Element;
|
|
18
|
+
export declare const WithTooltip: () => import("react").JSX.Element;
|
|
19
|
+
export declare const RealWorldExamples: () => import("react").JSX.Element;
|
|
20
|
+
export declare const WithClearButton: () => import("react").JSX.Element;
|
|
21
|
+
export declare const WithApplyButton: () => import("react").JSX.Element;
|
|
22
|
+
export declare const WithApplyButtonAndPresets: () => import("react").JSX.Element;
|
|
23
|
+
export declare const ClearButtonCallbacks: () => import("react").JSX.Element;
|
|
24
|
+
export declare const MobileResponsive: () => import("react").JSX.Element;
|