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
|
@@ -8,7 +8,6 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
8
8
|
}
|
|
9
9
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
10
|
};
|
|
11
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
11
|
import { useRef, useState, useEffect, useMemo } from "react";
|
|
13
12
|
import { cn } from "../../../lib/utils";
|
|
14
13
|
import { Badge } from "../../../components/Badge/Badge";
|
|
@@ -96,25 +95,35 @@ var Combobox = function (props) {
|
|
|
96
95
|
: multiValue.includes(option.value);
|
|
97
96
|
});
|
|
98
97
|
if (selectedOptions.length <= maxVisibleBadges) {
|
|
99
|
-
return (
|
|
98
|
+
return (<div className="flex flex-wrap gap-1">
|
|
99
|
+
{selectedOptions.map(function (option) {
|
|
100
100
|
return renderBadge(typeof option === "string"
|
|
101
101
|
? { key: option, value: option }
|
|
102
102
|
: option, handleRemove);
|
|
103
|
-
})
|
|
103
|
+
})}
|
|
104
|
+
</div>);
|
|
104
105
|
}
|
|
105
106
|
var remainingCount = selectedOptions.length - maxVisibleBadges;
|
|
106
107
|
var remainingOptions = selectedOptions.slice(maxVisibleBadges);
|
|
107
|
-
return (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
108
|
+
return (<div className="flex flex-wrap gap-1">
|
|
109
|
+
{selectedOptions
|
|
110
|
+
.slice(0, maxVisibleBadges)
|
|
111
|
+
.map(function (option) {
|
|
112
|
+
return renderBadge(typeof option === "string"
|
|
113
|
+
? { key: option, value: option }
|
|
114
|
+
: option, handleRemove);
|
|
115
|
+
})}
|
|
116
|
+
{/* TODO: Update Tooltip design */}
|
|
117
|
+
<Tooltip title={remainingOptions
|
|
118
|
+
.map(function (option) {
|
|
119
|
+
return typeof option === "string" ? option : option.key;
|
|
120
|
+
})
|
|
121
|
+
.join(", ")}>
|
|
122
|
+
<Badge color="light-blue" className="cursor-help">
|
|
123
|
+
+{remainingCount}
|
|
124
|
+
</Badge>
|
|
125
|
+
</Tooltip>
|
|
126
|
+
</div>);
|
|
118
127
|
}
|
|
119
128
|
else {
|
|
120
129
|
if (!singleValue)
|
|
@@ -141,20 +150,49 @@ var Combobox = function (props) {
|
|
|
141
150
|
setSingleValue,
|
|
142
151
|
]);
|
|
143
152
|
var normalizedOptions = useMemo(function () { return (Array.isArray(options) ? options : []); }, [options]);
|
|
144
|
-
return (
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
153
|
+
return (<Popover open={open} onOpenChange={setOpen}>
|
|
154
|
+
<PopoverTrigger asChild>
|
|
155
|
+
<Button ref={buttonRef} variant="outline" role="combobox" color="light-gray" aria-expanded={open} className={cn("w-full justify-between !py-3 !px-4 font-normal !leading-normal hover:!bg-transparent active:!bg-transparent", comboboxSizes[size], comboboxSelectType[variant], comboboxColor[variant][color], open && comboboxColor[variant]["blue"], disabled && [
|
|
156
|
+
variant === "fill" && "bg-gray-100",
|
|
157
|
+
"border border-gray-300 cursor-not-allowed pointer-events-none",
|
|
158
|
+
], "min-h-[42px]")} shape={comboboxShapes[shape]} disabled={disabled} tabIndex={disabled ? -1 : 0}>
|
|
159
|
+
<div className="flex-grow flex items-center">{getDisplay}</div>
|
|
160
|
+
<LUIcon icon="angle-down" size={iconSizeMap[size]} color="light-gray"/>
|
|
161
|
+
</Button>
|
|
162
|
+
</PopoverTrigger>
|
|
163
|
+
<PopoverContent className="p-0" style={popoverWidth ? { width: popoverWidth } : {}}>
|
|
164
|
+
<Command>
|
|
165
|
+
{isSearch && (<CommandInput placeholder="Search" className={comboboxSizes[size]}/>)}
|
|
166
|
+
{isMulti && normalizedOptions.length > 0 && (<div className="flex flex-col gap-1 !px-4 !py-3 rounded-sm bg-gray-50 text-gray-800">
|
|
167
|
+
<div className="flex items-center gap-2">
|
|
168
|
+
<Checkbox id="select-all" checked={multiValue.length === normalizedOptions.length} onCheckedChange={handleSelectAll} size={size}/>
|
|
169
|
+
<Label variant={getLabelVariant(size)}>Select All</Label>
|
|
170
|
+
</div>
|
|
171
|
+
<Caption variant="sm" className="text-gray-500">
|
|
172
|
+
Selected ({multiValue.length})
|
|
173
|
+
</Caption>
|
|
174
|
+
</div>)}
|
|
175
|
+
<CommandList>
|
|
176
|
+
<CommandEmpty>{empty_message}</CommandEmpty>
|
|
177
|
+
<CommandGroup>
|
|
178
|
+
{normalizedOptions.map(function (option) {
|
|
179
|
+
var normalizedOption = typeof option === "string"
|
|
180
|
+
? { key: option, value: option }
|
|
181
|
+
: option;
|
|
182
|
+
var selected = isMulti
|
|
183
|
+
? multiValue.includes(normalizedOption.value)
|
|
184
|
+
: singleValue === normalizedOption.value;
|
|
185
|
+
return (<CommandItem key={normalizedOption.value} value={normalizedOption.value} onSelect={function () { return handleSelect(normalizedOption.value); }} size={size} className={cn(selected &&
|
|
186
|
+
"bg-blue-50 text-blue-600 hover:text-blue-600")}>
|
|
187
|
+
{renderOption
|
|
188
|
+
? renderOption(normalizedOption)
|
|
189
|
+
: normalizedOption.key}
|
|
190
|
+
</CommandItem>);
|
|
191
|
+
})}
|
|
192
|
+
</CommandGroup>
|
|
193
|
+
</CommandList>
|
|
194
|
+
</Command>
|
|
195
|
+
</PopoverContent>
|
|
196
|
+
</Popover>);
|
|
159
197
|
};
|
|
160
198
|
export default Combobox;
|
|
@@ -3,11 +3,11 @@ import { Meta } from "@storybook/react";
|
|
|
3
3
|
declare const _default: Meta<ComboboxProps>;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ComboboxProps>;
|
|
6
|
-
export declare const Basic: () => import("react
|
|
7
|
-
export declare const ComboboxSize: () => import("react
|
|
8
|
-
export declare const ComboboxType: () => import("react
|
|
9
|
-
export declare const ComboboxWithCheckbox: () => import("react
|
|
10
|
-
export declare const ComboboxWithUserIcon: () => import("react
|
|
11
|
-
export declare const ComboboxWithDefaultValue: () => import("react
|
|
12
|
-
export declare const ListOfArray: () => import("react
|
|
13
|
-
export declare const ComboboxValidation: () => import("react
|
|
6
|
+
export declare const Basic: () => import("react").JSX.Element;
|
|
7
|
+
export declare const ComboboxSize: () => import("react").JSX.Element;
|
|
8
|
+
export declare const ComboboxType: () => import("react").JSX.Element;
|
|
9
|
+
export declare const ComboboxWithCheckbox: () => import("react").JSX.Element;
|
|
10
|
+
export declare const ComboboxWithUserIcon: () => import("react").JSX.Element;
|
|
11
|
+
export declare const ComboboxWithDefaultValue: () => import("react").JSX.Element;
|
|
12
|
+
export declare const ListOfArray: () => import("react").JSX.Element;
|
|
13
|
+
export declare const ComboboxValidation: () => import("react").JSX.Element;
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
import { useState } from "react";
|
|
11
|
+
import Combobox from "./Combobox";
|
|
12
|
+
import { comboboxColor, comboboxSelectType, comboboxShapes, comboboxSizes, } from ".";
|
|
13
|
+
import LUIcon from "../../../components/Icons/LUIcon";
|
|
14
|
+
import { Label } from "../../../components/Label/Label";
|
|
15
|
+
import Tooltip from "../../../components/ToolTip/Tooltip";
|
|
16
|
+
import { Caption } from "../../../components/Typography/Caption/caption";
|
|
17
|
+
import { Button } from "../../../components/Button/Button/Button";
|
|
18
|
+
import { Checkbox } from "../../../components/Checkbox/checkbox";
|
|
19
|
+
import { Badge } from "../../../components/Badge/Badge";
|
|
20
|
+
export default {
|
|
21
|
+
title: "Components/Dropdown/Combobox",
|
|
22
|
+
component: Combobox,
|
|
23
|
+
tags: ["autodocs"],
|
|
24
|
+
argTypes: {
|
|
25
|
+
options: {
|
|
26
|
+
control: { type: "object" },
|
|
27
|
+
description: "Options for the combobox dropdown",
|
|
28
|
+
table: {
|
|
29
|
+
type: { summary: "Array<{ value: string; label: string }>" },
|
|
30
|
+
defaultValue: { summary: "See default" },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
control: { type: "select" },
|
|
35
|
+
options: Object.keys(comboboxSizes),
|
|
36
|
+
description: "Size of the combobox button",
|
|
37
|
+
table: {
|
|
38
|
+
type: { summary: "comboboxSizes" },
|
|
39
|
+
defaultValue: { summary: "md" },
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
placeholder: {
|
|
43
|
+
control: { type: "text" },
|
|
44
|
+
description: "Placeholder text for the combobox",
|
|
45
|
+
table: {
|
|
46
|
+
type: { summary: "string" },
|
|
47
|
+
defaultValue: { summary: "Select Options" },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
shape: {
|
|
51
|
+
control: { type: "select" },
|
|
52
|
+
options: Object.keys(comboboxShapes),
|
|
53
|
+
description: "Shape of the combobox button",
|
|
54
|
+
table: {
|
|
55
|
+
type: { summary: "comboboxShapes" },
|
|
56
|
+
defaultValue: { summary: "rectangular" },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
variant: {
|
|
60
|
+
control: { type: "select" },
|
|
61
|
+
options: Object.keys(comboboxSelectType),
|
|
62
|
+
description: "Type of the combobox",
|
|
63
|
+
table: {
|
|
64
|
+
type: { summary: "comboboxSelectType" },
|
|
65
|
+
defaultValue: { summary: "fill" },
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
color: {
|
|
69
|
+
control: { type: "select" },
|
|
70
|
+
options: Object.keys(comboboxColor.fill),
|
|
71
|
+
description: "Color of the combobox",
|
|
72
|
+
table: {
|
|
73
|
+
type: { summary: "comboboxColor" },
|
|
74
|
+
defaultValue: { summary: "default" },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
isSearch: {
|
|
78
|
+
control: { type: "boolean" },
|
|
79
|
+
description: "Enable search functionality",
|
|
80
|
+
table: {
|
|
81
|
+
type: { summary: "boolean" },
|
|
82
|
+
defaultValue: { summary: "false" },
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
isMulti: {
|
|
86
|
+
control: { type: "boolean" },
|
|
87
|
+
description: "Enable multi-select functionality",
|
|
88
|
+
table: {
|
|
89
|
+
type: { summary: "boolean" },
|
|
90
|
+
defaultValue: { summary: "false" },
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
onSelect: {
|
|
94
|
+
control: false,
|
|
95
|
+
description: "Callback fired when an option is selected",
|
|
96
|
+
table: {
|
|
97
|
+
type: { summary: "(selected: any) => void" },
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
disabled: {
|
|
101
|
+
control: { type: "boolean" },
|
|
102
|
+
description: "Disable the combobox",
|
|
103
|
+
table: {
|
|
104
|
+
type: { summary: "boolean" },
|
|
105
|
+
defaultValue: { summary: "false" },
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
renderOption: {
|
|
109
|
+
control: false,
|
|
110
|
+
description: "Custom render function for options",
|
|
111
|
+
table: {
|
|
112
|
+
type: { summary: "(option: any) => ReactNode" },
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
defaultValue: {
|
|
116
|
+
control: { type: "text" },
|
|
117
|
+
description: "Default value for the combobox",
|
|
118
|
+
table: {
|
|
119
|
+
type: { summary: "string | string[]" },
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
var Template = function (args) { return <Combobox {...args}/>; };
|
|
125
|
+
export var Default = Template.bind({});
|
|
126
|
+
Default.args = {
|
|
127
|
+
size: "md",
|
|
128
|
+
placeholder: "Select Options",
|
|
129
|
+
shape: "rectangular",
|
|
130
|
+
options: [
|
|
131
|
+
{ key: "next.js", value: "Next.js" },
|
|
132
|
+
{ key: "sveltekit", value: "SvelteKit" },
|
|
133
|
+
{ key: "nest.js", value: "Nest.js" },
|
|
134
|
+
{ key: "remix", value: "Remix" },
|
|
135
|
+
{ key: "astro", value: "Astro" },
|
|
136
|
+
{ key: "react", value: "React" },
|
|
137
|
+
{ key: "nest", value: "Nest" },
|
|
138
|
+
{ key: "python", value: "Python" },
|
|
139
|
+
{ key: "ai", value: "AI" },
|
|
140
|
+
],
|
|
141
|
+
isSearch: true,
|
|
142
|
+
isMulti: true,
|
|
143
|
+
renderOption: function (option) { return (<>
|
|
144
|
+
{option.icon && <LUIcon icon={option.icon} size="md"/>}
|
|
145
|
+
<span>{option.key}</span>
|
|
146
|
+
</>); },
|
|
147
|
+
onSelect: function (value) { return console.log(value); },
|
|
148
|
+
};
|
|
149
|
+
export var Basic = function () { return (<Combobox options={[
|
|
150
|
+
{ key: "React", value: "react" },
|
|
151
|
+
{ key: "Vue", value: "vue" },
|
|
152
|
+
]} onSelect={function (value) { return console.log(value); }}/>); };
|
|
153
|
+
export var ComboboxSize = function () { return (<div className="space-y-4">
|
|
154
|
+
<Combobox size="sm" options={[
|
|
155
|
+
{ key: "React", value: "react" },
|
|
156
|
+
{ key: "Vue", value: "vue" },
|
|
157
|
+
]} onSelect={function (value) { return console.log(value); }}/>
|
|
158
|
+
<Combobox size="md" options={[
|
|
159
|
+
{ key: "React", value: "react" },
|
|
160
|
+
{ key: "Vue", value: "vue" },
|
|
161
|
+
]} onSelect={function (value) { return console.log(value); }}/>
|
|
162
|
+
<Combobox size="lg" options={[
|
|
163
|
+
{ key: "React", value: "react" },
|
|
164
|
+
{ key: "Vue", value: "vue" },
|
|
165
|
+
]} onSelect={function (value) { return console.log(value); }}/>
|
|
166
|
+
</div>); };
|
|
167
|
+
export var ComboboxType = function () { return (<div className="space-y-4">
|
|
168
|
+
<Label variant="label-sm">Text</Label>
|
|
169
|
+
<Combobox isMulti options={["React", "Vue", "Angular"]} renderOption={function (option) { return <span>{option.value}</span>; }}/>
|
|
170
|
+
|
|
171
|
+
<Label variant="label-sm">Text With Right Icon</Label>
|
|
172
|
+
<Combobox isMulti options={["React", "Vue", "Angular"]} renderOption={function (option) { return (<div className="flex items-center justify-between w-full">
|
|
173
|
+
<span>{option.value}</span>
|
|
174
|
+
<LUIcon icon="plus"/>
|
|
175
|
+
</div>); }}/>
|
|
176
|
+
|
|
177
|
+
<Label variant="label-sm">Text With Left Icon</Label>
|
|
178
|
+
<Combobox isMulti options={[
|
|
179
|
+
{ key: "next.js", value: "Next.js", icon: "plus" },
|
|
180
|
+
{ key: "sveltekit", value: "SvelteKit", icon: "star" },
|
|
181
|
+
{ key: "nest.js", value: "Nest.js", icon: "check" },
|
|
182
|
+
{ key: "remix", value: "Remix", icon: "minus" },
|
|
183
|
+
{ key: "astro", value: "Astro", icon: "plus" },
|
|
184
|
+
]} renderOption={function (option) { return (<div className="flex items-center gap-2 w-full">
|
|
185
|
+
<LUIcon icon={option.icon}/>
|
|
186
|
+
<span>{option.value}</span>
|
|
187
|
+
</div>); }}/>
|
|
188
|
+
|
|
189
|
+
<Label variant="label-sm">Badge</Label>
|
|
190
|
+
<Combobox isMulti options={["React", "Vue", "Angular"]} renderOption={function (option) { return (<Badge startIcon="star" color="light-blue">
|
|
191
|
+
{option.value}
|
|
192
|
+
</Badge>); }}/>
|
|
193
|
+
|
|
194
|
+
<Label variant="label-sm">Text+Counter</Label>
|
|
195
|
+
<Combobox isMulti options={["React", "Vue", "Angular"]} renderOption={function (option) { return (<div className="flex items-center justify-between w-full">
|
|
196
|
+
<span>{option.value}</span>
|
|
197
|
+
<Badge color="light-blue">{+3}</Badge>
|
|
198
|
+
</div>); }}/>
|
|
199
|
+
</div>); };
|
|
200
|
+
export var ComboboxWithCheckbox = function () {
|
|
201
|
+
var _a = useState([]), selected = _a[0], setSelected = _a[1];
|
|
202
|
+
var options = ["React", "Vue", "Angular"];
|
|
203
|
+
var onCheckChange = function (value) {
|
|
204
|
+
setSelected(function (prev) {
|
|
205
|
+
return prev.includes(value) ? prev.filter(function (v) { return v !== value; }) : __spreadArray(__spreadArray([], prev, true), [value], false);
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
return (<Combobox isMulti options={options} onSelect={function (value) {
|
|
209
|
+
if (Array.isArray(value)) {
|
|
210
|
+
setSelected(value);
|
|
211
|
+
}
|
|
212
|
+
}} renderOption={function (option) { return (<div className="flex items-center gap-2 w-full">
|
|
213
|
+
<Checkbox id={"checkbox-".concat(option.value)} checked={selected.includes(option.value)} onCheckedChange={function () {
|
|
214
|
+
onCheckChange(option.value);
|
|
215
|
+
}}/>
|
|
216
|
+
<span>{option.value}</span>
|
|
217
|
+
</div>); }}/>);
|
|
218
|
+
};
|
|
219
|
+
export var ComboboxWithUserIcon = function () { return (<Combobox isMulti options={["React", "Vue", "Angular", "Nest", "Next"]} renderOption={function (option) { return (<div className="flex items-center gap-2 w-full">
|
|
220
|
+
{/* TODO: Replace it with Avatar */}
|
|
221
|
+
<LUIcon icon="user" variant="padded"/>
|
|
222
|
+
<span>{option.value}</span>
|
|
223
|
+
</div>); }}/>); };
|
|
224
|
+
export var ComboboxWithDefaultValue = function () { return (<div className="space-y-4">
|
|
225
|
+
<Label variant="label-sm">Multiple Default Values in Multiple Select</Label>
|
|
226
|
+
<Combobox isMulti isSearch options={["React", "Vue", "Angular", "Nest", "Next"]} defaultValue={["React", "Vue"]} renderOption={function (option) { return (<div className="flex items-center gap-2 w-full">
|
|
227
|
+
<LUIcon icon="plus"/>
|
|
228
|
+
<span>{option.value}</span>
|
|
229
|
+
</div>); }}/>
|
|
230
|
+
|
|
231
|
+
<Label variant="label-sm">Single Default Value in Multiple Select</Label>
|
|
232
|
+
<Combobox isMulti isSearch options={["React", "Vue", "Angular", "Nest", "Next"]} defaultValue={["React"]} renderOption={function (option) { return (<div className="flex items-center gap-2 w-full">
|
|
233
|
+
<LUIcon icon="plus"/>
|
|
234
|
+
<span>{option.value}</span>
|
|
235
|
+
</div>); }}/>
|
|
236
|
+
|
|
237
|
+
<Label variant="label-sm">Single Default Value in Single Select</Label>
|
|
238
|
+
<Combobox isSearch options={["React", "Vue", "Angular", "Nest", "Next"]} defaultValue={"React"} renderOption={function (option) { return (<div className="flex items-center gap-2 w-full">
|
|
239
|
+
<LUIcon icon="plus"/>
|
|
240
|
+
<span>{option.value}</span>
|
|
241
|
+
</div>); }}/>
|
|
242
|
+
</div>); };
|
|
243
|
+
export var ListOfArray = function () { return (<Combobox isMulti isSearch options={["React", "Vue", "Angular", "Nest", "Next"]} renderOption={function (option) { return (<div className="flex items-center gap-2 w-full">
|
|
244
|
+
<LUIcon icon="plus"/>
|
|
245
|
+
<span>{option.value}</span>
|
|
246
|
+
</div>); }}/>); };
|
|
247
|
+
export var ComboboxValidation = function () {
|
|
248
|
+
var _a = useState(""), selected = _a[0], setSelected = _a[1];
|
|
249
|
+
var _b = useState(false), error = _b[0], setError = _b[1];
|
|
250
|
+
var handleSelect = function (value) {
|
|
251
|
+
// Since isMulti is false, value will be string
|
|
252
|
+
if (typeof value === "string") {
|
|
253
|
+
setSelected(value);
|
|
254
|
+
if (value && error)
|
|
255
|
+
setError(false);
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
var handleSubmit = function (e) {
|
|
259
|
+
e.preventDefault();
|
|
260
|
+
if (!selected) {
|
|
261
|
+
setError(true);
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
setError(false);
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
return (<form className="space-y-4" onSubmit={handleSubmit}>
|
|
268
|
+
<div className="flex items-center gap-2 mb-2">
|
|
269
|
+
<Label variant="label-sm">Select Category</Label>
|
|
270
|
+
<span className="text-red-600">*</span>
|
|
271
|
+
<Tooltip title="Select Option">
|
|
272
|
+
<LUIcon variant="padded" size="xs" shape="rounded" icon="question" color="light-blue"/>
|
|
273
|
+
</Tooltip>
|
|
274
|
+
</div>
|
|
275
|
+
<div>
|
|
276
|
+
<Combobox placeholder="Select framework..." size="md" options={[
|
|
277
|
+
{ key: "next.js", value: "Next.js" },
|
|
278
|
+
{ key: "sveltekit", value: "SvelteKit" },
|
|
279
|
+
{ key: "nest.js", value: "Nest.js" },
|
|
280
|
+
{ key: "remix", value: "Remix" },
|
|
281
|
+
{ key: "astro", value: "Astro" },
|
|
282
|
+
]} isSearch onSelect={handleSelect} color={error ? "red" : "default"} renderOption={function (option) { return <span>{option.value}</span>; }}/>
|
|
283
|
+
{error && (<Caption variant="md" className="mt-1 text-red-600">
|
|
284
|
+
field is required
|
|
285
|
+
</Caption>)}
|
|
286
|
+
</div>
|
|
287
|
+
<Button type="submit">Submit</Button>
|
|
288
|
+
</form>);
|
|
289
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
-
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>):
|
|
4
|
-
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>):
|
|
5
|
-
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>):
|
|
6
|
-
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>):
|
|
7
|
-
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>):
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
|
8
8
|
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
9
|
showCloseButton?: boolean;
|
|
10
|
-
}):
|
|
11
|
-
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">):
|
|
12
|
-
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">):
|
|
13
|
-
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>):
|
|
14
|
-
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>):
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
13
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
|
|
14
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
|
|
15
15
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
15
|
+
import { XIcon } from "lucide-react";
|
|
16
|
+
import { cn } from "../../../lib/utils";
|
|
17
|
+
function Dialog(_a) {
|
|
18
|
+
var props = __rest(_a, []);
|
|
19
|
+
return <DialogPrimitive.Root data-slot="dialog" {...props}/>;
|
|
20
|
+
}
|
|
21
|
+
function DialogTrigger(_a) {
|
|
22
|
+
var props = __rest(_a, []);
|
|
23
|
+
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props}/>;
|
|
24
|
+
}
|
|
25
|
+
function DialogPortal(_a) {
|
|
26
|
+
var props = __rest(_a, []);
|
|
27
|
+
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props}/>;
|
|
28
|
+
}
|
|
29
|
+
function DialogClose(_a) {
|
|
30
|
+
var props = __rest(_a, []);
|
|
31
|
+
return <DialogPrimitive.Close data-slot="dialog-close" {...props}/>;
|
|
32
|
+
}
|
|
33
|
+
function DialogOverlay(_a) {
|
|
34
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
35
|
+
return (<DialogPrimitive.Overlay data-slot="dialog-overlay" className={cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className)} {...props}/>);
|
|
36
|
+
}
|
|
37
|
+
function DialogContent(_a) {
|
|
38
|
+
var className = _a.className, children = _a.children, _b = _a.showCloseButton, showCloseButton = _b === void 0 ? true : _b, props = __rest(_a, ["className", "children", "showCloseButton"]);
|
|
39
|
+
return (<DialogPortal data-slot="dialog-portal">
|
|
40
|
+
<DialogOverlay />
|
|
41
|
+
<DialogPrimitive.Content data-slot="dialog-content" className={cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200", className)} {...props}>
|
|
42
|
+
{children}
|
|
43
|
+
{showCloseButton && (<DialogPrimitive.Close data-slot="dialog-close" className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
|
|
44
|
+
<XIcon />
|
|
45
|
+
<span className="sr-only">Close</span>
|
|
46
|
+
</DialogPrimitive.Close>)}
|
|
47
|
+
</DialogPrimitive.Content>
|
|
48
|
+
</DialogPortal>);
|
|
49
|
+
}
|
|
50
|
+
function DialogHeader(_a) {
|
|
51
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
52
|
+
return (<div data-slot="dialog-header" className={cn("flex flex-col gap-2 text-center sm:text-left", className)} {...props}/>);
|
|
53
|
+
}
|
|
54
|
+
function DialogFooter(_a) {
|
|
55
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
56
|
+
return (<div data-slot="dialog-footer" className={cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className)} {...props}/>);
|
|
57
|
+
}
|
|
58
|
+
function DialogTitle(_a) {
|
|
59
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
60
|
+
return (<DialogPrimitive.Title data-slot="dialog-title" className={cn("text-lg leading-none font-semibold", className)} {...props}/>);
|
|
61
|
+
}
|
|
62
|
+
function DialogDescription(_a) {
|
|
63
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
64
|
+
return (<DialogPrimitive.Description data-slot="dialog-description" className={cn("text-muted-foreground text-sm", className)} {...props}/>);
|
|
65
|
+
}
|
|
66
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Badge } from "../../../../components/Badge/Badge";
|
|
3
|
+
export var renderBadge = function (option, handleRemove) {
|
|
4
|
+
return (<Badge key={option.value} color="light-blue" startIcon={option.icon} onRemove={function () { return handleRemove(option.value); }}>
|
|
5
|
+
{option.key}
|
|
6
|
+
</Badge>);
|
|
7
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
-
import { checkBoxSize, dropdownMenuSize } from ".";
|
|
3
|
+
import { checkBoxSize, dropdownContentPosition, dropdownMenuSize } from ".";
|
|
4
4
|
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
5
5
|
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -13,9 +13,13 @@ declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<Dropd
|
|
|
13
13
|
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
14
14
|
size?: keyof typeof dropdownMenuSize;
|
|
15
15
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export type DropdownMenuContentProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> & {
|
|
17
|
+
size?: keyof typeof dropdownMenuSize;
|
|
18
|
+
align?: keyof typeof dropdownContentPosition;
|
|
19
|
+
};
|
|
16
20
|
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
17
21
|
size?: keyof typeof dropdownMenuSize;
|
|
18
|
-
align?:
|
|
22
|
+
align?: keyof typeof dropdownContentPosition;
|
|
19
23
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
20
24
|
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
21
25
|
inset?: boolean;
|
|
@@ -31,7 +35,7 @@ declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMe
|
|
|
31
35
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
32
36
|
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
37
|
declare const DropdownMenuShortcut: {
|
|
34
|
-
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>):
|
|
38
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
|
35
39
|
displayName: string;
|
|
36
40
|
};
|
|
37
41
|
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|