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)
|
|
@@ -21,7 +10,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
10
|
}
|
|
22
11
|
return t;
|
|
23
12
|
};
|
|
24
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
13
|
import { cn } from "../../lib/utils";
|
|
26
14
|
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
|
|
27
15
|
import LUIcon from "../Icons/LUIcon";
|
|
@@ -33,23 +21,34 @@ import { useCallback, useEffect, useState } from "react";
|
|
|
33
21
|
import { pad } from "./utils";
|
|
34
22
|
function MenuItemLabel(_a) {
|
|
35
23
|
var label = _a.label;
|
|
36
|
-
return (
|
|
24
|
+
return (<div className="font-normal text-sm h-9 flex items-center justify-center text-gray-950">
|
|
25
|
+
{label}
|
|
26
|
+
</div>);
|
|
37
27
|
}
|
|
38
28
|
function MenuItem(_a) {
|
|
39
29
|
var label = _a.label, data = _a.data, onClick = _a.onClick, activeItem = _a.activeItem, _b = _a.padZero, padZero = _b === void 0 ? false : _b, size = _a.size;
|
|
40
|
-
return (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
return (<div className="flex flex-col">
|
|
31
|
+
<MenuItemLabel label={label}/>
|
|
32
|
+
<div className={cn("overflow-y-auto space-y-1 border-r border-gray-200 scrollbar-hide", timePickerMenuStyles.container[size])}>
|
|
33
|
+
{data.map(function (item) {
|
|
34
|
+
var isActive = activeItem === item;
|
|
35
|
+
return (<Button key={item} onClick={function () { return onClick(item); }} variant={isActive ? "fill" : "ghost"} color={isActive ? "light-blue" : "gray"} size="sm" className={cn("w-full", isActive
|
|
36
|
+
? "hover:bg-blue-100 hover:text-blue-600"
|
|
37
|
+
: "text-gray-400 hover:text-gray-400", timePickerMenuStyles.buttonHeight[size])} shape="rounded-none">
|
|
38
|
+
{padZero ? pad(item) : item}
|
|
39
|
+
</Button>);
|
|
40
|
+
})}
|
|
41
|
+
</div>
|
|
42
|
+
</div>);
|
|
46
43
|
}
|
|
47
44
|
function PeriodButton(_a) {
|
|
48
45
|
var onClick = _a.onClick, periodLabel = _a.periodLabel, activePeriod = _a.activePeriod, size = _a.size;
|
|
49
46
|
var isActive = activePeriod === periodLabel;
|
|
50
|
-
return (
|
|
47
|
+
return (<Button onClick={onClick} variant={isActive ? "fill" : "ghost"} color={isActive ? "light-blue" : "gray"} size="sm" className={cn("w-full", isActive
|
|
51
48
|
? "hover:bg-blue-100 hover:text-blue-600"
|
|
52
|
-
: "text-gray-400 hover:text-gray-400", timePickerMenuStyles.buttonHeight[size])
|
|
49
|
+
: "text-gray-400 hover:text-gray-400", timePickerMenuStyles.buttonHeight[size])} shape="rounded-none">
|
|
50
|
+
{periodLabel}
|
|
51
|
+
</Button>);
|
|
53
52
|
}
|
|
54
53
|
function TimePickerMenu(_a) {
|
|
55
54
|
var onTimeSelect = _a.onTimeSelect, selectedTime = _a.selectedTime, _b = _a.size, size = _b === void 0 ? Default_TimePicker_Size : _b;
|
|
@@ -81,7 +80,17 @@ function TimePickerMenu(_a) {
|
|
|
81
80
|
onTimeSelect("");
|
|
82
81
|
}
|
|
83
82
|
}, [hour, minute, period, formatTime, onTimeSelect]);
|
|
84
|
-
return (
|
|
83
|
+
return (<div className="grid grid-cols-[124px_124px_124px]">
|
|
84
|
+
<MenuItem label="Hour" data={hours} onClick={function (item) { return setHour(hour === item ? null : item); }} activeItem={hour} size={size}/>
|
|
85
|
+
<MenuItem label="Minutes" data={minutes} onClick={function (item) { return setMinute(minute === item ? null : item); }} activeItem={minute} padZero size={size}/>
|
|
86
|
+
<div className="flex flex-col">
|
|
87
|
+
<MenuItemLabel label="AM/PM"/>
|
|
88
|
+
<div className="space-y-1 h-full content-center -mt-6">
|
|
89
|
+
<PeriodButton onClick={function () { return setPeriod(period === "AM" ? null : "AM"); }} periodLabel="AM" activePeriod={period} size={size}/>
|
|
90
|
+
<PeriodButton onClick={function () { return setPeriod(period === "PM" ? null : "PM"); }} periodLabel="PM" activePeriod={period} size={size}/>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>);
|
|
85
94
|
}
|
|
86
95
|
export function TimePicker(_a) {
|
|
87
96
|
var className = _a.className, _b = _a.variant, variant = _b === void 0 ? Default_TimePicker_Variant : _b, _c = _a.size, size = _c === void 0 ? Default_TimePicker_Size : _c, _d = _a.color, color = _d === void 0 ? Default_TimePicker_Color : _d, _e = _a.shape, shape = _e === void 0 ? Default_TimePicker_Shape : _e, time = _a.time, onChange = _a.onChange, _f = _a.placeholder, placeholder = _f === void 0 ? "Select time" : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, startIcon = _a.startIcon, endIcon = _a.endIcon, _h = _a.shadow, shadow = _h === void 0 ? Default_TimePicker_Shadow : _h, triggerClassName = _a.triggerClassName, props = __rest(_a, ["className", "variant", "size", "color", "shape", "time", "onChange", "placeholder", "disabled", "startIcon", "endIcon", "shadow", "triggerClassName"]);
|
|
@@ -98,12 +107,27 @@ export function TimePicker(_a) {
|
|
|
98
107
|
var displayHour = h % 12 || 12;
|
|
99
108
|
return "".concat(displayHour, ":").concat(minutes, " ").concat(period);
|
|
100
109
|
};
|
|
101
|
-
return (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
return (<Popover open={!disabled && open} onOpenChange={disabled ? undefined : setOpen}>
|
|
111
|
+
<PopoverTrigger asChild>
|
|
112
|
+
<div className={cn("relative", triggerClassName)}>
|
|
113
|
+
{startIcon && (<LUIcon icon={startIcon} size={iconSizeClass} className={cn("absolute top-1/2 -translate-y-1/2 pointer-events-none z-10", iconPosition.left)}/>)}
|
|
114
|
+
<Button color="light-gray" aria-expanded={open} data-slot="time-picker-input" className={cn("w-full justify-between !p-0 hover:!bg-transparent active:!bg-transparent", inputVariants({ variant: variant, size: size, color: color, shape: shape }), "text-left flex items-center", !time && "text-muted-foreground", open &&
|
|
115
|
+
color === "default" &&
|
|
116
|
+
"border-blue-600 ring-2 ring-blue-200", disabled && [
|
|
117
|
+
variant === "filled" && "bg-gray-100",
|
|
118
|
+
"border border-gray-300 cursor-not-allowed pointer-events-none opacity-50",
|
|
119
|
+
])} shape={inputVariantConfig.shape[shape]} disabled={disabled} tabIndex={disabled ? -1 : 0}>
|
|
120
|
+
<div className={cn("flex-grow flex items-center", paddingClass)}>
|
|
121
|
+
{time ? formatDisplayTime(time) : placeholder}
|
|
122
|
+
</div>
|
|
123
|
+
</Button>
|
|
124
|
+
{endIcon && (<LUIcon icon={endIcon} size={iconSizeClass} className={cn("absolute top-1/2 -translate-y-1/2 pointer-events-none z-10", iconPosition.right)}/>)}
|
|
125
|
+
</div>
|
|
126
|
+
</PopoverTrigger>
|
|
127
|
+
<PopoverContent align="start" className={cn("w-full p-0 bg-white", timePickerMenuStyles.shadow[shadow], className)} {...props}>
|
|
128
|
+
<TimePickerMenu onTimeSelect={function (selectedTime) {
|
|
129
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(selectedTime || null);
|
|
130
|
+
}} selectedTime={time !== null && time !== void 0 ? time : null} size={size || Default_TimePicker_Size}/>
|
|
131
|
+
</PopoverContent>
|
|
132
|
+
</Popover>);
|
|
109
133
|
}
|
|
@@ -3,13 +3,13 @@ import { TimePickerProps } from ".";
|
|
|
3
3
|
declare const _default: Meta<TimePickerProps>;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, TimePickerProps>;
|
|
6
|
-
export declare const WithLabel: () => import("react
|
|
7
|
-
export declare const WithLabelAndCaption: () => import("react
|
|
8
|
-
export declare const Sizes: () => import("react
|
|
9
|
-
export declare const Variants: () => import("react
|
|
10
|
-
export declare const WithIcons: () => import("react
|
|
11
|
-
export declare const ValidationStates: () => import("react
|
|
12
|
-
export declare const Disabled: () => import("react
|
|
13
|
-
export declare const Shapes: () => import("react
|
|
14
|
-
export declare const Shadows: () => import("react
|
|
15
|
-
export declare const PreselectedTime: () => import("react
|
|
6
|
+
export declare const WithLabel: () => import("react").JSX.Element;
|
|
7
|
+
export declare const WithLabelAndCaption: () => 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 WithIcons: () => import("react").JSX.Element;
|
|
11
|
+
export declare const ValidationStates: () => import("react").JSX.Element;
|
|
12
|
+
export declare const Disabled: () => import("react").JSX.Element;
|
|
13
|
+
export declare const Shapes: () => import("react").JSX.Element;
|
|
14
|
+
export declare const Shadows: () => import("react").JSX.Element;
|
|
15
|
+
export declare const PreselectedTime: () => import("react").JSX.Element;
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { TimePicker } from "./TimePicker";
|
|
13
|
+
import { inputVariantConfig } from "../Input/input";
|
|
14
|
+
import { Body } from "../Typography/Body/body";
|
|
15
|
+
import { Label } from "../Label/Label";
|
|
16
|
+
import { Caption } from "../Typography/Caption/caption";
|
|
17
|
+
import Tooltip from "../ToolTip/Tooltip";
|
|
18
|
+
import LUIcon from "../Icons/LUIcon";
|
|
19
|
+
import { Default_TimePicker_Variant, Default_TimePicker_Color, Default_TimePicker_Shape, Default_TimePicker_Size, timePickerMenuStyles, Default_TimePicker_Shadow, } from ".";
|
|
20
|
+
import { useEffect, useState } from "react";
|
|
21
|
+
export default {
|
|
22
|
+
title: "Components/TimePicker",
|
|
23
|
+
component: TimePicker,
|
|
24
|
+
tags: ["autodocs"],
|
|
25
|
+
argTypes: {
|
|
26
|
+
variant: {
|
|
27
|
+
control: {
|
|
28
|
+
type: "select",
|
|
29
|
+
},
|
|
30
|
+
options: Object.keys(inputVariantConfig.variant),
|
|
31
|
+
defaultValue: Default_TimePicker_Variant,
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
control: {
|
|
35
|
+
type: "select",
|
|
36
|
+
},
|
|
37
|
+
options: Object.keys(inputVariantConfig.size),
|
|
38
|
+
defaultValue: Default_TimePicker_Size,
|
|
39
|
+
},
|
|
40
|
+
color: {
|
|
41
|
+
control: {
|
|
42
|
+
type: "select",
|
|
43
|
+
},
|
|
44
|
+
options: Object.keys(inputVariantConfig.color),
|
|
45
|
+
defaultValue: Default_TimePicker_Color,
|
|
46
|
+
description: "Color variant of the trigger button",
|
|
47
|
+
table: {
|
|
48
|
+
type: { summary: "string" },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
shape: {
|
|
52
|
+
control: {
|
|
53
|
+
type: "select",
|
|
54
|
+
},
|
|
55
|
+
options: Object.keys(inputVariantConfig.shape),
|
|
56
|
+
defaultValue: Default_TimePicker_Shape,
|
|
57
|
+
description: "Shape variant of the trigger button (border radius)",
|
|
58
|
+
table: {
|
|
59
|
+
type: { summary: "string" },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
time: {
|
|
63
|
+
control: "text",
|
|
64
|
+
description: "Time in 24-hour format (HH:MM).",
|
|
65
|
+
table: {
|
|
66
|
+
type: { summary: "string" },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
placeholder: {
|
|
70
|
+
control: "text",
|
|
71
|
+
defaultValue: "Select time",
|
|
72
|
+
},
|
|
73
|
+
disabled: {
|
|
74
|
+
control: "boolean",
|
|
75
|
+
defaultValue: false,
|
|
76
|
+
},
|
|
77
|
+
shadow: {
|
|
78
|
+
control: {
|
|
79
|
+
type: "select",
|
|
80
|
+
},
|
|
81
|
+
options: Object.keys(timePickerMenuStyles.shadow),
|
|
82
|
+
defaultValue: Default_TimePicker_Shadow,
|
|
83
|
+
description: "Shadow styling for the time picker menu when opened",
|
|
84
|
+
table: {
|
|
85
|
+
type: { summary: "string" },
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
var Template = function (args) {
|
|
91
|
+
var _a;
|
|
92
|
+
var _b = useState((_a = args.time) !== null && _a !== void 0 ? _a : null), time = _b[0], setTime = _b[1];
|
|
93
|
+
useEffect(function () {
|
|
94
|
+
var _a;
|
|
95
|
+
setTime((_a = args.time) !== null && _a !== void 0 ? _a : null);
|
|
96
|
+
}, [args.time]);
|
|
97
|
+
return (<div className="w-full max-w-md">
|
|
98
|
+
<TimePicker {...args} time={time} onChange={setTime}/>
|
|
99
|
+
</div>);
|
|
100
|
+
};
|
|
101
|
+
export var Default = Template.bind({});
|
|
102
|
+
Default.args = {
|
|
103
|
+
placeholder: "Select time",
|
|
104
|
+
variant: Default_TimePicker_Variant,
|
|
105
|
+
size: Default_TimePicker_Size,
|
|
106
|
+
};
|
|
107
|
+
export var WithLabel = function () {
|
|
108
|
+
var _a = useState(), time = _a[0], setTime = _a[1];
|
|
109
|
+
return (<div className="w-full max-w-md">
|
|
110
|
+
<div className="flex flex-col gap-1">
|
|
111
|
+
<div className="flex items-center gap-2">
|
|
112
|
+
<Label variant="label-lg">Label</Label>
|
|
113
|
+
<Tooltip title="?">
|
|
114
|
+
<LUIcon variant="padded" size="md" shape="rounded" icon="question" color="light-blue"/>
|
|
115
|
+
</Tooltip>
|
|
116
|
+
</div>
|
|
117
|
+
<TimePicker placeholder="Select time" time={time} onChange={setTime}/>
|
|
118
|
+
</div>
|
|
119
|
+
</div>);
|
|
120
|
+
};
|
|
121
|
+
export var WithLabelAndCaption = function () {
|
|
122
|
+
var _a = useState(), time = _a[0], setTime = _a[1];
|
|
123
|
+
return (<div className="w-full max-w-md">
|
|
124
|
+
<div className="flex flex-col gap-1">
|
|
125
|
+
<div className="flex items-center gap-2">
|
|
126
|
+
<Label variant="label-lg">Label</Label>
|
|
127
|
+
<Tooltip title="?">
|
|
128
|
+
<LUIcon variant="padded" size="md" shape="rounded" icon="question" color="light-blue"/>
|
|
129
|
+
</Tooltip>
|
|
130
|
+
</div>
|
|
131
|
+
<TimePicker placeholder="Select time" time={time} onChange={setTime}/>
|
|
132
|
+
<Caption variant="sm">
|
|
133
|
+
Enter your application/validation/helper content here
|
|
134
|
+
</Caption>
|
|
135
|
+
</div>
|
|
136
|
+
</div>);
|
|
137
|
+
};
|
|
138
|
+
export var Sizes = function () {
|
|
139
|
+
var sizes = Object.keys(inputVariantConfig.size);
|
|
140
|
+
var _a = useState({}), times = _a[0], setTimes = _a[1];
|
|
141
|
+
var handleTimeChange = function (size, time) {
|
|
142
|
+
setTimes(function (prev) {
|
|
143
|
+
var _a;
|
|
144
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[size] = time, _a)));
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
return (<div className="space-y-4 w-full max-w-md">
|
|
148
|
+
{sizes.map(function (size) { return (<div key={size}>
|
|
149
|
+
<Body variant="body-sm-500" className="mb-2">
|
|
150
|
+
{size.charAt(0).toUpperCase() + size.slice(1)}
|
|
151
|
+
</Body>
|
|
152
|
+
<TimePicker size={size} placeholder="Select time" time={times[size]} onChange={function (time) { return handleTimeChange(size, time); }}/>
|
|
153
|
+
</div>); })}
|
|
154
|
+
</div>);
|
|
155
|
+
};
|
|
156
|
+
export var Variants = function () {
|
|
157
|
+
var variants = Object.keys(inputVariantConfig.variant);
|
|
158
|
+
var _a = useState({}), times = _a[0], setTimes = _a[1];
|
|
159
|
+
var handleTimeChange = function (variant, time) {
|
|
160
|
+
setTimes(function (prev) {
|
|
161
|
+
var _a;
|
|
162
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[variant] = time, _a)));
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
return (<div className="space-y-4 w-full max-w-md">
|
|
166
|
+
{variants.map(function (variant) { return (<div key={variant}>
|
|
167
|
+
<Body variant="body-sm-500" className="mb-2">
|
|
168
|
+
{variant.charAt(0).toUpperCase() + variant.slice(1)}
|
|
169
|
+
</Body>
|
|
170
|
+
<TimePicker variant={variant} placeholder="Select time" time={times[variant]} onChange={function (time) { return handleTimeChange(variant, time); }}/>
|
|
171
|
+
</div>); })}
|
|
172
|
+
</div>);
|
|
173
|
+
};
|
|
174
|
+
export var WithIcons = function () {
|
|
175
|
+
var _a = useState(), timeStart = _a[0], setTimeStart = _a[1];
|
|
176
|
+
var _b = useState(), timeBoth = _b[0], setTimeBoth = _b[1];
|
|
177
|
+
return (<div className="space-y-4 w-full max-w-md">
|
|
178
|
+
<div>
|
|
179
|
+
<Body variant="body-sm-500" className="mb-2">
|
|
180
|
+
With Start Icon
|
|
181
|
+
</Body>
|
|
182
|
+
<TimePicker startIcon="plus" placeholder="Select time" time={timeStart} onChange={setTimeStart}/>
|
|
183
|
+
</div>
|
|
184
|
+
<div>
|
|
185
|
+
<Body variant="body-sm-500" className="mb-2">
|
|
186
|
+
With Both Icons
|
|
187
|
+
</Body>
|
|
188
|
+
<TimePicker startIcon="plus" endIcon="clock" placeholder="Select time" time={timeBoth} onChange={setTimeBoth}/>
|
|
189
|
+
</div>
|
|
190
|
+
</div>);
|
|
191
|
+
};
|
|
192
|
+
export var ValidationStates = function () {
|
|
193
|
+
var _a = useState(), timeDefault = _a[0], setTimeDefault = _a[1];
|
|
194
|
+
var _b = useState("14:02"), timeSuccess = _b[0], setTimeSuccess = _b[1];
|
|
195
|
+
var _c = useState(), timeWarning = _c[0], setTimeWarning = _c[1];
|
|
196
|
+
var _d = useState(), timeError = _d[0], setTimeError = _d[1];
|
|
197
|
+
return (<div className="space-y-4 w-full max-w-md">
|
|
198
|
+
<div>
|
|
199
|
+
<Body variant="body-sm-500" className="mb-2">
|
|
200
|
+
Default
|
|
201
|
+
</Body>
|
|
202
|
+
<div className="flex flex-col gap-1">
|
|
203
|
+
<Label variant="label-lg">Label</Label>
|
|
204
|
+
<TimePicker placeholder="Select time" time={timeDefault} onChange={setTimeDefault}/>
|
|
205
|
+
<Caption variant="sm">
|
|
206
|
+
Enter your application/validation/helper content here
|
|
207
|
+
</Caption>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
<div>
|
|
211
|
+
<Body variant="body-sm-500" className="mb-2">
|
|
212
|
+
Success
|
|
213
|
+
</Body>
|
|
214
|
+
<div className="flex flex-col gap-1">
|
|
215
|
+
<Label variant="label-lg">Label</Label>
|
|
216
|
+
<TimePicker placeholder="Select time" color="success" time={timeSuccess} onChange={setTimeSuccess}/>
|
|
217
|
+
<Caption variant="sm">Correct time selected</Caption>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
<div>
|
|
221
|
+
<Body variant="body-sm-500" className="mb-2">
|
|
222
|
+
Warning
|
|
223
|
+
</Body>
|
|
224
|
+
<div className="flex flex-col gap-1">
|
|
225
|
+
<Label variant="label-lg">Label</Label>
|
|
226
|
+
<TimePicker placeholder="Select time" color="warning" time={timeWarning} onChange={setTimeWarning}/>
|
|
227
|
+
<Caption variant="sm">Please verify the selected time</Caption>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
<div>
|
|
231
|
+
<Body variant="body-sm-500" className="mb-2">
|
|
232
|
+
Error
|
|
233
|
+
</Body>
|
|
234
|
+
<div className="flex flex-col gap-1">
|
|
235
|
+
<Label variant="label-lg">Label</Label>
|
|
236
|
+
<TimePicker placeholder="Select time" color="danger" time={timeError} onChange={setTimeError}/>
|
|
237
|
+
<Caption variant="sm">Invalid time selection</Caption>
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
</div>);
|
|
241
|
+
};
|
|
242
|
+
export var Disabled = function () {
|
|
243
|
+
return (<div className="w-full max-w-md">
|
|
244
|
+
<div className="flex flex-col gap-1">
|
|
245
|
+
<Label variant="label-lg">Label</Label>
|
|
246
|
+
<TimePicker placeholder="Select time" disabled={true}/>
|
|
247
|
+
</div>
|
|
248
|
+
</div>);
|
|
249
|
+
};
|
|
250
|
+
export var Shapes = function () {
|
|
251
|
+
var shapes = Object.keys(inputVariantConfig.shape);
|
|
252
|
+
var _a = useState({}), times = _a[0], setTimes = _a[1];
|
|
253
|
+
var handleTimeChange = function (shape, time) {
|
|
254
|
+
setTimes(function (prev) {
|
|
255
|
+
var _a;
|
|
256
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[shape] = time, _a)));
|
|
257
|
+
});
|
|
258
|
+
};
|
|
259
|
+
return (<div className="space-y-4 w-full max-w-md">
|
|
260
|
+
{shapes.map(function (shape) { return (<div key={shape}>
|
|
261
|
+
<Body variant="body-sm-500" className="mb-2">
|
|
262
|
+
{shape.charAt(0).toUpperCase() + shape.slice(1)}
|
|
263
|
+
</Body>
|
|
264
|
+
<TimePicker shape={shape} placeholder="Select time" time={times[shape]} onChange={function (time) { return handleTimeChange(shape, time); }}/>
|
|
265
|
+
</div>); })}
|
|
266
|
+
</div>);
|
|
267
|
+
};
|
|
268
|
+
export var Shadows = function () {
|
|
269
|
+
var shadows = Object.keys(timePickerMenuStyles.shadow);
|
|
270
|
+
var _a = useState({}), times = _a[0], setTimes = _a[1];
|
|
271
|
+
var handleTimeChange = function (shadow, time) {
|
|
272
|
+
setTimes(function (prev) {
|
|
273
|
+
var _a;
|
|
274
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[shadow] = time, _a)));
|
|
275
|
+
});
|
|
276
|
+
};
|
|
277
|
+
return (<div className="space-y-4 w-full max-w-md">
|
|
278
|
+
{shadows.map(function (shadow) { return (<div key={shadow}>
|
|
279
|
+
<Body variant="body-sm-500" className="mb-2">
|
|
280
|
+
{shadow !== "none" ? "With Shadow" : "Without Shadow"}
|
|
281
|
+
</Body>
|
|
282
|
+
<div className="flex flex-col gap-1">
|
|
283
|
+
<Label variant="label-lg">Label</Label>
|
|
284
|
+
<TimePicker placeholder="Select time" shadow={shadow} time={times[shadow]} onChange={function (time) { return handleTimeChange(shadow, time); }}/>
|
|
285
|
+
</div>
|
|
286
|
+
</div>); })}
|
|
287
|
+
</div>);
|
|
288
|
+
};
|
|
289
|
+
export var PreselectedTime = function () {
|
|
290
|
+
var _a = useState("14:02"), time = _a[0], setTime = _a[1];
|
|
291
|
+
return (<div className="w-full max-w-md">
|
|
292
|
+
<div className="flex flex-col gap-1">
|
|
293
|
+
<Label variant="label-lg">Label</Label>
|
|
294
|
+
<TimePicker time={time} onChange={setTime}/>
|
|
295
|
+
<Caption variant="sm">Preselected time: 2:02 PM</Caption>
|
|
296
|
+
</div>
|
|
297
|
+
</div>);
|
|
298
|
+
};
|
|
@@ -3,5 +3,5 @@ export interface TitleProps {
|
|
|
3
3
|
className?: string;
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
}
|
|
6
|
-
declare const Title: ({ className, children }: TitleProps) =>
|
|
6
|
+
declare const Title: ({ className, children }: TitleProps) => React.JSX.Element;
|
|
7
7
|
export default Title;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { Dummy_Title } from "../../utils/constants";
|
|
3
3
|
import TitleStyles from "./Title.module.css";
|
|
4
4
|
var Title = function (_a) {
|
|
5
5
|
var _b = _a.className, className = _b === void 0 ? "" : _b, _c = _a.children, children = _c === void 0 ? Dummy_Title : _c;
|
|
6
|
-
return (
|
|
6
|
+
return (<h2 className={"".concat(TitleStyles["main-title"], " ").concat(className)}>{children}</h2>);
|
|
7
7
|
};
|
|
8
8
|
export default Title;
|
|
@@ -1,15 +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
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
1
|
import { Dummy_Title } from "../../utils/constants";
|
|
14
2
|
import Title from "./Title";
|
|
15
3
|
export default {
|
|
@@ -41,7 +29,7 @@ export default {
|
|
|
41
29
|
},
|
|
42
30
|
},
|
|
43
31
|
};
|
|
44
|
-
var Template = function (args) { return
|
|
32
|
+
var Template = function (args) { return <Title {...args}/>; };
|
|
45
33
|
export var _Title = Template.bind({});
|
|
46
34
|
_Title.args = {
|
|
47
35
|
children: Dummy_Title,
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { render, screen } from "@testing-library/react";
|
|
3
2
|
import { Dummy_Title } from "../../utils/constants";
|
|
4
3
|
import Title from "./Title";
|
|
5
4
|
describe("Title Component", function () {
|
|
6
5
|
it("renders with default props", function () {
|
|
7
|
-
render(
|
|
6
|
+
render(<Title />);
|
|
8
7
|
expect(screen.getByText(Dummy_Title)).toBeInTheDocument();
|
|
9
8
|
});
|
|
10
9
|
it("renders with custom children", function () {
|
|
11
10
|
var customText = "Custom Title";
|
|
12
|
-
render(
|
|
11
|
+
render(<Title>{customText}</Title>);
|
|
13
12
|
expect(screen.getByText(customText)).toBeInTheDocument();
|
|
14
13
|
});
|
|
15
14
|
it("applies custom className", function () {
|
|
16
15
|
var customClass = "custom-class";
|
|
17
|
-
render(
|
|
16
|
+
render(<Title className={customClass}/>);
|
|
18
17
|
var titleElement = screen.getByText(Dummy_Title);
|
|
19
18
|
expect(titleElement).toHaveClass("main-title custom-class");
|
|
20
19
|
});
|
|
21
20
|
it("renders without crashing", function () {
|
|
22
|
-
var container = render(
|
|
21
|
+
var container = render(<Title />).container;
|
|
23
22
|
expect(container).toBeDefined();
|
|
24
23
|
});
|
|
25
24
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ToolTipInterface } from "./type";
|
|
2
|
-
declare const Tooltip: ({ title, className, children }: ToolTipInterface) => import("react
|
|
2
|
+
declare const Tooltip: ({ title, className, children }: ToolTipInterface) => import("react").JSX.Element;
|
|
3
3
|
export default Tooltip;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Tooltip as ShadTooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "../ui/tooltip";
|
|
2
|
+
import { Body } from "../Typography/Body/body";
|
|
3
|
+
var Tooltip = function (_a) {
|
|
4
|
+
var title = _a.title, className = _a.className, children = _a.children;
|
|
5
|
+
return (<TooltipProvider>
|
|
6
|
+
<ShadTooltip>
|
|
7
|
+
<TooltipTrigger asChild className={className}>
|
|
8
|
+
{children}
|
|
9
|
+
</TooltipTrigger>
|
|
10
|
+
<TooltipContent>
|
|
11
|
+
<Body variant="body-md" className="text-center">
|
|
12
|
+
{title}
|
|
13
|
+
</Body>
|
|
14
|
+
</TooltipContent>
|
|
15
|
+
</ShadTooltip>
|
|
16
|
+
</TooltipProvider>);
|
|
17
|
+
};
|
|
18
|
+
export default Tooltip;
|
|
@@ -1,15 +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
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
1
|
import Tooltip from "./Tooltip";
|
|
14
2
|
import { IconButton } from "../Button/IconButton/IconButton";
|
|
15
3
|
export default {
|
|
@@ -17,10 +5,10 @@ export default {
|
|
|
17
5
|
component: Tooltip,
|
|
18
6
|
tags: ["autodocs"],
|
|
19
7
|
};
|
|
20
|
-
var Template = function (args) { return (
|
|
8
|
+
var Template = function (args) { return (<Tooltip {...args}></Tooltip>); };
|
|
21
9
|
export var _ToolTip = Template.bind({});
|
|
22
10
|
_ToolTip.args = {
|
|
23
|
-
children:
|
|
11
|
+
children: <IconButton icon="volume-high" shape="rounded-full"/>,
|
|
24
12
|
title: "Tooltip",
|
|
25
13
|
};
|
|
26
14
|
_ToolTip.argTypes = {
|
|
@@ -1,15 +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
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
1
|
import { Dummy_Para } from "../../../utils/constants";
|
|
14
2
|
import { Body, variant } from "../../../components/Typography/Body/body";
|
|
15
3
|
export default {
|
|
@@ -17,7 +5,7 @@ export default {
|
|
|
17
5
|
component: Body,
|
|
18
6
|
tags: ["autodocs"],
|
|
19
7
|
};
|
|
20
|
-
var Template = function (args) { return
|
|
8
|
+
var Template = function (args) { return <Body {...args}></Body>; };
|
|
21
9
|
export var _Body = Template.bind({});
|
|
22
10
|
_Body.args = {
|
|
23
11
|
children: Dummy_Para,
|
|
@@ -31,5 +31,5 @@ type BodyProps<T extends AllowedTags = "p"> = {
|
|
|
31
31
|
className?: string;
|
|
32
32
|
children?: React.ReactNode;
|
|
33
33
|
} & Omit<React.ComponentPropsWithoutRef<T>, "as" | "className"> & VariantProps<typeof bodyVariants>;
|
|
34
|
-
declare function Body<T extends AllowedTags = "p">({ as, className, variant, children, ...props }: BodyProps<T>):
|
|
34
|
+
declare function Body<T extends AllowedTags = "p">({ as, className, variant, children, ...props }: BodyProps<T>): React.JSX.Element;
|
|
35
35
|
export { Body, bodyVariants };
|
|
@@ -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,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
9
|
}
|
|
21
10
|
return t;
|
|
22
11
|
};
|
|
23
|
-
import
|
|
12
|
+
import * as React from "react";
|
|
24
13
|
import { cva } from "class-variance-authority";
|
|
25
14
|
import { cn } from "../../../lib/utils";
|
|
26
15
|
export var variant = {
|
|
@@ -56,6 +45,8 @@ var bodyVariants = cva("!leading-normal m-0", {
|
|
|
56
45
|
function Body(_a) {
|
|
57
46
|
var as = _a.as, className = _a.className, variant = _a.variant, children = _a.children, props = __rest(_a, ["as", "className", "variant", "children"]);
|
|
58
47
|
var Tag = as || "p";
|
|
59
|
-
return (
|
|
48
|
+
return (<Tag className={cn(bodyVariants({ variant: variant }), className)} {...props}>
|
|
49
|
+
{children}
|
|
50
|
+
</Tag>);
|
|
60
51
|
}
|
|
61
52
|
export { Body, bodyVariants };
|