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,16 +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
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
2
|
import { useState, useEffect } from "react";
|
|
15
3
|
import { useDropzone } from "react-dropzone";
|
|
16
4
|
import { cn } from "../../lib/utils";
|
|
@@ -74,6 +62,33 @@ var ImageUploader = function (_a) {
|
|
|
74
62
|
"image/*": acceptedTypes,
|
|
75
63
|
},
|
|
76
64
|
}), getRootProps = _g.getRootProps, getInputProps = _g.getInputProps;
|
|
77
|
-
return (
|
|
65
|
+
return (<div className={cn("flex flex-col items-center", className)}>
|
|
66
|
+
<div {...getRootProps()} className={cn("!border !border-dashed !border-gray-300 !rounded-lg cursor-pointer w-64 !p-2")}>
|
|
67
|
+
<div className="min-h-40 flex items-center justify-center bg-gray-100 !rounded-lg">
|
|
68
|
+
<input {...getInputProps()}/>
|
|
69
|
+
|
|
70
|
+
{preview ? (<div className="relative w-full h-40 !mx-auto overflow-hidden">
|
|
71
|
+
<LuImage src={preview} alt="Uploaded" className="aspect-square object-contain" fill/>
|
|
72
|
+
</div>) : (<div className="text-center text-sm text-muted-foreground">
|
|
73
|
+
<LUIcon icon="upload" size="lg" className="!mx-auto !mb-4"/>
|
|
74
|
+
<Body variant="body-xs-600" className="!px-1">
|
|
75
|
+
{labels === null || labels === void 0 ? void 0 : labels.chooseFile}
|
|
76
|
+
</Body>
|
|
77
|
+
<p className="text-xs text-muted-foreground">
|
|
78
|
+
{labels === null || labels === void 0 ? void 0 : labels.supportedFormats}
|
|
79
|
+
</p>
|
|
80
|
+
</div>)}
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
{fileError && (<p className="text-sm text-red-500 text-center mt-2">{fileError}</p>)}
|
|
84
|
+
|
|
85
|
+
{required && !preview && !fileError && (<p className="text-sm text-red-500 text-center !mt-2">
|
|
86
|
+
{labels === null || labels === void 0 ? void 0 : labels.imageRequired}
|
|
87
|
+
</p>)}
|
|
88
|
+
|
|
89
|
+
{preview && (<Button variant="link" color="red" onClick={removeFile} className="!mt-2">
|
|
90
|
+
{labels === null || labels === void 0 ? void 0 : labels.removeImage}
|
|
91
|
+
</Button>)}
|
|
92
|
+
</div>);
|
|
78
93
|
};
|
|
79
94
|
export default ImageUploader;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AspectRatioProps } from "./type";
|
|
2
|
-
declare const LuImage: ({ ratio, ...props }: AspectRatioProps) => import("react
|
|
2
|
+
declare const LuImage: ({ ratio, ...props }: AspectRatioProps) => import("react").JSX.Element;
|
|
3
3
|
export default LuImage;
|
|
@@ -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,12 +9,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
9
|
}
|
|
21
10
|
return t;
|
|
22
11
|
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
12
|
import Image from "next/image";
|
|
25
13
|
import { aspectRatio } from ".";
|
|
26
14
|
var LuImage = function (_a) {
|
|
27
15
|
var _b = _a.ratio, ratio = _b === void 0 ? "square" : _b, props = __rest(_a, ["ratio"]);
|
|
28
16
|
// eslint-disable-next-line jsx-a11y/alt-text
|
|
29
|
-
return
|
|
17
|
+
return <Image className={"".concat(aspectRatio[ratio])} {...props}/>;
|
|
30
18
|
};
|
|
31
19
|
export default LuImage;
|
|
@@ -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 LuImage from "./LuImage";
|
|
14
2
|
import { aspectRatio } from ".";
|
|
15
3
|
export default {
|
|
@@ -145,7 +133,7 @@ export default {
|
|
|
145
133
|
},
|
|
146
134
|
},
|
|
147
135
|
};
|
|
148
|
-
var Template = function (args) { return
|
|
136
|
+
var Template = function (args) { return <LuImage {...args}/>; };
|
|
149
137
|
export var _Image = Template.bind({});
|
|
150
138
|
_Image.args = {
|
|
151
139
|
src: "/images/demo-image.jpg",
|
|
@@ -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 { render, screen } from "@testing-library/react";
|
|
14
2
|
import LuImage from "./LuImage";
|
|
15
3
|
import { aspectRatio } from ".";
|
|
@@ -18,12 +6,12 @@ jest.mock("next/image", function () { return ({
|
|
|
18
6
|
__esModule: true,
|
|
19
7
|
default: function (props) {
|
|
20
8
|
// eslint-disable-next-line @next/next/no-img-element
|
|
21
|
-
return
|
|
9
|
+
return <img alt="" {...props}/>;
|
|
22
10
|
},
|
|
23
11
|
}); });
|
|
24
12
|
describe("LuImage component", function () {
|
|
25
13
|
it("renders with default props", function () {
|
|
26
|
-
render(
|
|
14
|
+
render(<LuImage src="/test.jpg" width={100} height={100} alt="Demo Image"/>);
|
|
27
15
|
var image = screen.getByAltText("Demo Image");
|
|
28
16
|
expect(image).toBeInTheDocument();
|
|
29
17
|
expect(image).toHaveAttribute("src", "/test.jpg");
|
|
@@ -31,24 +19,24 @@ describe("LuImage component", function () {
|
|
|
31
19
|
});
|
|
32
20
|
it("uses correct aspect ratio class", function () {
|
|
33
21
|
var ratio = "aspect-4/3";
|
|
34
|
-
render(
|
|
22
|
+
render(<LuImage src="/test.jpg" width={100} height={100} ratio={ratio} alt="Demo Image"/>);
|
|
35
23
|
var image = screen.getByAltText("Demo Image");
|
|
36
24
|
expect(image).toHaveClass(aspectRatio[ratio]);
|
|
37
25
|
});
|
|
38
26
|
it("accepts custom alt text", function () {
|
|
39
|
-
render(
|
|
27
|
+
render(<LuImage src="/test.jpg" width={100} height={100} alt="Custom Alt"/>);
|
|
40
28
|
var image = screen.getByAltText("Custom Alt");
|
|
41
29
|
expect(image).toBeInTheDocument();
|
|
42
30
|
});
|
|
43
31
|
it("accepts additional className", function () {
|
|
44
|
-
render(
|
|
32
|
+
render(<LuImage src="/test.jpg" width={100} height={100} className="rounded-full" alt="Demo Image"/>);
|
|
45
33
|
var image = screen.getByAltText("Demo Image");
|
|
46
34
|
expect(image).toHaveClass("rounded-full");
|
|
47
35
|
});
|
|
48
36
|
it("renders with different aspect ratios", function () {
|
|
49
37
|
for (var ratio in aspectRatio) {
|
|
50
38
|
var typedRatio = ratio;
|
|
51
|
-
render(
|
|
39
|
+
render(<LuImage key={typedRatio} src="/test.jpg" width={100} height={100} ratio={typedRatio} alt={"Image with ratio ".concat(typedRatio)}/>);
|
|
52
40
|
var image = screen.getByAltText("Image with ratio ".concat(typedRatio));
|
|
53
41
|
expect(image).toHaveClass(aspectRatio[typedRatio]);
|
|
54
42
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { Meta } from "@storybook/react";
|
|
2
3
|
import { InputFieldProps } from "./type";
|
|
3
4
|
declare const _default: Meta<InputFieldProps>;
|
|
4
5
|
export default _default;
|
|
5
6
|
export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, InputFieldProps>;
|
|
6
|
-
export declare const WithIcons: () =>
|
|
7
|
-
export declare const IconSizes: () =>
|
|
8
|
-
export declare const Variants: () =>
|
|
9
|
-
export declare const Sizes: () =>
|
|
10
|
-
export declare const VariantsWithIcons: () =>
|
|
11
|
-
export declare const ErrorValidation: () =>
|
|
12
|
-
export declare const SuccessValidation: () =>
|
|
13
|
-
export declare const WarningValidation: () =>
|
|
7
|
+
export declare const WithIcons: () => React.JSX.Element;
|
|
8
|
+
export declare const IconSizes: () => React.JSX.Element;
|
|
9
|
+
export declare const Variants: () => React.JSX.Element;
|
|
10
|
+
export declare const Sizes: () => React.JSX.Element;
|
|
11
|
+
export declare const VariantsWithIcons: () => React.JSX.Element;
|
|
12
|
+
export declare const ErrorValidation: () => React.JSX.Element;
|
|
13
|
+
export declare const SuccessValidation: () => React.JSX.Element;
|
|
14
|
+
export declare const WarningValidation: () => React.JSX.Element;
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Input, inputVariantConfig } from "./input";
|
|
3
|
+
import { inputType } from "."; // Ensure this exports an object like { text: 'text', email: 'email', ... }
|
|
4
|
+
import { Label } from "../Label/Label";
|
|
5
|
+
import LUIcon from "../Icons/LUIcon";
|
|
6
|
+
import Tooltip from "../ToolTip/Tooltip";
|
|
7
|
+
import { Caption } from "../Typography/Caption/caption";
|
|
8
|
+
export default {
|
|
9
|
+
title: "Components/Input",
|
|
10
|
+
component: Input,
|
|
11
|
+
tags: ["autodocs"],
|
|
12
|
+
argTypes: {
|
|
13
|
+
type: {
|
|
14
|
+
control: {
|
|
15
|
+
type: "select",
|
|
16
|
+
labels: Object.keys(inputType),
|
|
17
|
+
},
|
|
18
|
+
options: Object.keys(inputType),
|
|
19
|
+
defaultValue: "text",
|
|
20
|
+
},
|
|
21
|
+
variant: {
|
|
22
|
+
control: {
|
|
23
|
+
type: "select",
|
|
24
|
+
},
|
|
25
|
+
options: Object.keys(inputVariantConfig.variant),
|
|
26
|
+
defaultValue: "filled",
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
control: {
|
|
30
|
+
type: "select",
|
|
31
|
+
},
|
|
32
|
+
options: Object.keys(inputVariantConfig.size),
|
|
33
|
+
defaultValue: "lg",
|
|
34
|
+
},
|
|
35
|
+
color: {
|
|
36
|
+
control: {
|
|
37
|
+
type: "select",
|
|
38
|
+
},
|
|
39
|
+
options: Object.keys(inputVariantConfig.color),
|
|
40
|
+
defaultValue: "default",
|
|
41
|
+
},
|
|
42
|
+
startIcon: {
|
|
43
|
+
control: "text",
|
|
44
|
+
description: "Icon to display at the start of the input",
|
|
45
|
+
},
|
|
46
|
+
endIcon: {
|
|
47
|
+
control: "text",
|
|
48
|
+
description: "Icon to display at the end of the input",
|
|
49
|
+
},
|
|
50
|
+
placeholder: {
|
|
51
|
+
control: "text",
|
|
52
|
+
defaultValue: "Enter text",
|
|
53
|
+
},
|
|
54
|
+
disabled: {
|
|
55
|
+
control: "boolean",
|
|
56
|
+
defaultValue: false,
|
|
57
|
+
},
|
|
58
|
+
className: {
|
|
59
|
+
control: "text",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
var Template = function (args) { return <Input {...args}/>; };
|
|
64
|
+
export var Default = Template.bind({});
|
|
65
|
+
Default.args = {
|
|
66
|
+
type: "text",
|
|
67
|
+
placeholder: "Enter your input",
|
|
68
|
+
variant: "filled",
|
|
69
|
+
size: "lg",
|
|
70
|
+
};
|
|
71
|
+
export var WithIcons = function () { return (<div className="space-y-4">
|
|
72
|
+
<div>
|
|
73
|
+
<Label variant={"label-md"}>Search with start icon</Label>
|
|
74
|
+
<Input placeholder="Search..." startIcon="magnifying-glass"/>
|
|
75
|
+
</div>
|
|
76
|
+
<div>
|
|
77
|
+
<Label className="block text-sm font-medium mb-2">
|
|
78
|
+
Email with end icon
|
|
79
|
+
</Label>
|
|
80
|
+
<Input placeholder="Enter email" endIcon="envelope" type="email"/>
|
|
81
|
+
</div>
|
|
82
|
+
<div>
|
|
83
|
+
<Label variant={"label-md"}>Password with both icons</Label>
|
|
84
|
+
<Input placeholder="Enter password" startIcon="lock" endIcon="eye" type="password"/>
|
|
85
|
+
</div>
|
|
86
|
+
<div>
|
|
87
|
+
<Label variant={"label-sm"}>User input</Label>
|
|
88
|
+
<Input placeholder="Enter username" startIcon="user"/>
|
|
89
|
+
</div>
|
|
90
|
+
</div>); };
|
|
91
|
+
export var IconSizes = function () { return (<div className="space-y-4">
|
|
92
|
+
<div>
|
|
93
|
+
<Label variant={"label-sm"}>Small with icons</Label>
|
|
94
|
+
<Input placeholder="Small size" size="sm" startIcon="magnifying-glass" endIcon="xMark"/>
|
|
95
|
+
</div>
|
|
96
|
+
<div>
|
|
97
|
+
<Label variant={"label-md"}>Medium with icons</Label>
|
|
98
|
+
<Input placeholder="Medium size" size="md" startIcon="magnifying-glass" endIcon="xMark"/>
|
|
99
|
+
</div>
|
|
100
|
+
<div>
|
|
101
|
+
<Label variant={"label-lg"}>Large with icons</Label>
|
|
102
|
+
<Input placeholder="Large size" size="lg" startIcon="magnifying-glass" endIcon="xMark"/>
|
|
103
|
+
</div>
|
|
104
|
+
</div>); };
|
|
105
|
+
export var Variants = function () { return (<div className="space-y-4">
|
|
106
|
+
<div>
|
|
107
|
+
<Label variant={"label-md"}>Filled</Label>
|
|
108
|
+
<Input placeholder="Filled variant" variant="filled"/>
|
|
109
|
+
</div>
|
|
110
|
+
<div>
|
|
111
|
+
<Label variant={"label-md"}>Outlined</Label>
|
|
112
|
+
<Input placeholder="Outlined variant" variant="outlined"/>
|
|
113
|
+
</div>
|
|
114
|
+
</div>); };
|
|
115
|
+
export var Sizes = function () { return (<div className="space-y-4">
|
|
116
|
+
<div>
|
|
117
|
+
<Label variant={"label-md"}>Small</Label>
|
|
118
|
+
<Input placeholder="Small size" size="sm"/>
|
|
119
|
+
</div>
|
|
120
|
+
<div>
|
|
121
|
+
<Label variant={"label-md"}>Medium</Label>
|
|
122
|
+
<Input placeholder="Medium size" size="md"/>
|
|
123
|
+
</div>
|
|
124
|
+
<div>
|
|
125
|
+
<Label variant={"label-lg"}>Large (Default)</Label>
|
|
126
|
+
<Input placeholder="Large size" size="lg"/>
|
|
127
|
+
</div>
|
|
128
|
+
</div>); };
|
|
129
|
+
export var VariantsWithIcons = function () { return (<div className="space-y-4">
|
|
130
|
+
<div>
|
|
131
|
+
<Label variant={"label-md"}>Filled with icons</Label>
|
|
132
|
+
<Input placeholder="Filled variant" variant="filled" startIcon="magnifying-glass" endIcon="xMark"/>
|
|
133
|
+
</div>
|
|
134
|
+
<div>
|
|
135
|
+
<Label variant={"label-md"}>Outlined with icons</Label>
|
|
136
|
+
<Input placeholder="Outlined variant" variant="outlined" startIcon="magnifying-glass" endIcon="xMark"/>
|
|
137
|
+
</div>
|
|
138
|
+
</div>); };
|
|
139
|
+
export var ErrorValidation = function () {
|
|
140
|
+
var _a = React.useState("Steve"), email = _a[0], setEmail = _a[1];
|
|
141
|
+
var maxLength = 5;
|
|
142
|
+
var isError = email.length === 5;
|
|
143
|
+
var characterCount = email.length;
|
|
144
|
+
var handleEmailChange = function (e) {
|
|
145
|
+
var newValue = e.target.value;
|
|
146
|
+
// Restrict typing when exactly 5 characters
|
|
147
|
+
if (newValue.length <= 5) {
|
|
148
|
+
setEmail(newValue);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
return (<div className="space-y-4">
|
|
152
|
+
<div>
|
|
153
|
+
<div className="flex items-center gap-2 mb-2">
|
|
154
|
+
<Label variant={"label-md"}>Name</Label>
|
|
155
|
+
<span className="text-red-600">*</span>
|
|
156
|
+
<Tooltip title="This is a tooltip for the email input field">
|
|
157
|
+
<LUIcon variant="padded" size="xs" shape="rounded" icon="question" color="light-blue"/>
|
|
158
|
+
</Tooltip>
|
|
159
|
+
|
|
160
|
+
<Caption variant="md" className={"ms-auto mb-1 ".concat(isError ? "text-red-600" : "text-gray-500")}>
|
|
161
|
+
<span className={isError ? "text-red-600" : "text-gray-900"}>
|
|
162
|
+
{characterCount}
|
|
163
|
+
</span>
|
|
164
|
+
/{maxLength}
|
|
165
|
+
</Caption>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<Input color={isError ? "danger" : "default"} placeholder="Enter your email address" variant="filled" type="email" value={email} onChange={handleEmailChange} startIcon="user" endIcon="envelope"/>
|
|
169
|
+
{email.length > 4 && (<Caption variant="md" className={"mt-1 ".concat(isError ? "text-red-600" : "text-gray-500")}>
|
|
170
|
+
{isError
|
|
171
|
+
? "Email must be longer than 5 characters"
|
|
172
|
+
: "Please enter a valid email address"}
|
|
173
|
+
</Caption>)}
|
|
174
|
+
</div>
|
|
175
|
+
</div>);
|
|
176
|
+
};
|
|
177
|
+
export var SuccessValidation = function () {
|
|
178
|
+
var _a = React.useState("john_doe"), username = _a[0], setUsername = _a[1];
|
|
179
|
+
var maxLength = 20;
|
|
180
|
+
var isSuccess = username.length >= 6 && username.length <= 15;
|
|
181
|
+
var characterCount = username.length;
|
|
182
|
+
var handleUsernameChange = function (e) {
|
|
183
|
+
var newValue = e.target.value;
|
|
184
|
+
if (newValue.length <= maxLength) {
|
|
185
|
+
setUsername(newValue);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
return (<div className="space-y-4">
|
|
189
|
+
<div>
|
|
190
|
+
<div className="flex items-center gap-2 mb-2">
|
|
191
|
+
<Label variant={"label-sm"}>Username</Label>
|
|
192
|
+
<span className="text-red-600">*</span>
|
|
193
|
+
<Tooltip title="Username must be 6-15 characters long">
|
|
194
|
+
<LUIcon variant="padded" size="xs" shape="rounded" icon="question" color="light-blue"/>
|
|
195
|
+
</Tooltip>
|
|
196
|
+
|
|
197
|
+
<Caption variant="md" className={"ms-auto mb-1 ".concat(isSuccess ? "text-green-600" : "text-gray-500")}>
|
|
198
|
+
<span className={isSuccess ? "text-green-600" : "text-gray-900"}>
|
|
199
|
+
{characterCount}
|
|
200
|
+
</span>
|
|
201
|
+
/{maxLength}
|
|
202
|
+
</Caption>
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
<Input color={isSuccess ? "success" : "default"} placeholder="Enter your username" variant="filled" type="text" value={username} onChange={handleUsernameChange} startIcon="user" endIcon={isSuccess ? "check" : "user-gear"}/>
|
|
206
|
+
<Caption variant="md" className={"mt-1 ".concat(isSuccess ? "text-green-600" : "text-gray-500")}>
|
|
207
|
+
{isSuccess
|
|
208
|
+
? "Great! Username is available"
|
|
209
|
+
: "Username must be 6-15 characters"}
|
|
210
|
+
</Caption>
|
|
211
|
+
</div>
|
|
212
|
+
</div>);
|
|
213
|
+
};
|
|
214
|
+
export var WarningValidation = function () {
|
|
215
|
+
var _a = React.useState("pass123"), password = _a[0], setPassword = _a[1];
|
|
216
|
+
var maxLength = 30;
|
|
217
|
+
var hasWarning = password.length >= 4 && password.length < 8;
|
|
218
|
+
var characterCount = password.length;
|
|
219
|
+
var handlePasswordChange = function (e) {
|
|
220
|
+
var newValue = e.target.value;
|
|
221
|
+
if (newValue.length <= maxLength) {
|
|
222
|
+
setPassword(newValue);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
return (<div className="space-y-4">
|
|
226
|
+
<div>
|
|
227
|
+
<div className="flex items-center gap-2 mb-2">
|
|
228
|
+
<Label variant={"label-md"}>Password</Label>
|
|
229
|
+
<span className="text-red-600">*</span>
|
|
230
|
+
<Tooltip title="Password should be at least 8 characters for better security">
|
|
231
|
+
<LUIcon variant="padded" size="xs" shape="rounded" icon="question" color="light-blue"/>
|
|
232
|
+
</Tooltip>
|
|
233
|
+
|
|
234
|
+
<Caption variant="md" className={"ms-auto mb-1 ".concat(hasWarning ? "text-yellow-600" : "text-gray-500")}>
|
|
235
|
+
<span className={hasWarning ? "text-yellow-600" : "text-gray-900"}>
|
|
236
|
+
{characterCount}
|
|
237
|
+
</span>
|
|
238
|
+
/{maxLength}
|
|
239
|
+
</Caption>
|
|
240
|
+
</div>
|
|
241
|
+
|
|
242
|
+
<Input color={hasWarning ? "warning" : "default"} placeholder="Enter your password" variant="filled" type="password" value={password} onChange={handlePasswordChange} startIcon="lock" endIcon={hasWarning ? "circle-exclamation" : "eye"}/>
|
|
243
|
+
<Caption variant="md" className={"mt-1 ".concat(hasWarning ? "text-yellow-600" : "text-gray-500")}>
|
|
244
|
+
{hasWarning
|
|
245
|
+
? "Password is weak. Consider using 8+ characters"
|
|
246
|
+
: "Enter a secure password"}
|
|
247
|
+
</Caption>
|
|
248
|
+
</div>
|
|
249
|
+
</div>);
|
|
250
|
+
};
|
|
@@ -33,5 +33,5 @@ export interface InputProps extends Omit<React.ComponentProps<"input">, "size" |
|
|
|
33
33
|
endIcon?: keyof typeof iconList;
|
|
34
34
|
shape?: "rounded" | "square";
|
|
35
35
|
}
|
|
36
|
-
declare function Input({ className, variant, size, type, startIcon, endIcon, shape, color, ...props }: InputProps):
|
|
36
|
+
declare function Input({ className, variant, size, type, startIcon, endIcon, shape, color, ...props }: InputProps): React.JSX.Element;
|
|
37
37
|
export { Input };
|
|
@@ -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
|
import LUIcon from "../Icons/LUIcon";
|
|
@@ -108,6 +97,14 @@ function Input(_a) {
|
|
|
108
97
|
var iconSizeClass = getIconSize(size);
|
|
109
98
|
var paddingClass = getPadding(size, !!startIcon, !!endIcon);
|
|
110
99
|
var iconPosition = getIconPosition(size || "md");
|
|
111
|
-
return (
|
|
100
|
+
return (<div className="relative">
|
|
101
|
+
{startIcon && (<div className={"absolute ".concat(iconPosition.left, " top-1/2 -translate-y-1/2 pointer-events-none z-10")}>
|
|
102
|
+
<LUIcon icon={startIcon} size={iconSizeClass}/>
|
|
103
|
+
</div>)}
|
|
104
|
+
<input type={type} data-slot="input" className={cn(inputVariants({ variant: variant, size: size, color: color, shape: shape }), paddingClass, className)} {...props}/>
|
|
105
|
+
{endIcon && (<div className={"absolute ".concat(iconPosition.right, " top-1/2 -translate-y-1/2 pointer-events-none z-10")}>
|
|
106
|
+
<LUIcon icon={endIcon} size={iconSizeClass}/>
|
|
107
|
+
</div>)}
|
|
108
|
+
</div>);
|
|
112
109
|
}
|
|
113
110
|
export { Input };
|
|
@@ -10,5 +10,5 @@ export declare const variant: {
|
|
|
10
10
|
declare const labelVariants: (props?: ({
|
|
11
11
|
variant?: "label-sm" | "label-xl" | "label-lg" | "label-md" | null | undefined;
|
|
12
12
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
-
declare function Label({ className, variant, ...props }: React.ComponentProps<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>):
|
|
13
|
+
declare function Label({ className, variant, ...props }: React.ComponentProps<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>): React.JSX.Element;
|
|
14
14
|
export { Label, labelVariants };
|
|
@@ -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 * as LabelPrimitive from "@radix-ui/react-label";
|
|
25
14
|
import { cva } from "class-variance-authority";
|
|
26
15
|
import { cn } from "../../lib/utils";
|
|
@@ -38,6 +27,6 @@ var labelVariants = cva("select-none group-data-[disabled=true]:pointer-events-n
|
|
|
38
27
|
});
|
|
39
28
|
function Label(_a) {
|
|
40
29
|
var className = _a.className, variant = _a.variant, props = __rest(_a, ["className", "variant"]);
|
|
41
|
-
return (
|
|
30
|
+
return (<LabelPrimitive.Root data-slot="label" className={cn(labelVariants({ variant: variant, className: className }))} {...props}/>);
|
|
42
31
|
}
|
|
43
32
|
export { Label, labelVariants };
|
|
@@ -1,22 +1,10 @@
|
|
|
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 { Label, variant } from "./Label";
|
|
14
2
|
export default {
|
|
15
3
|
title: "Components/Label",
|
|
16
4
|
component: Label,
|
|
17
5
|
tags: ["autodocs"],
|
|
18
6
|
};
|
|
19
|
-
var Template = function (args) { return
|
|
7
|
+
var Template = function (args) { return <Label {...args}></Label>; };
|
|
20
8
|
export var _Label = Template.bind({});
|
|
21
9
|
_Label.args = {
|
|
22
10
|
children: "Label",
|
|
@@ -17,11 +17,11 @@ type DialogHeaderProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
17
17
|
size?: keyof typeof sizes;
|
|
18
18
|
};
|
|
19
19
|
declare const DialogHeader: {
|
|
20
|
-
({ className, variant, size, ...props }: DialogHeaderProps):
|
|
20
|
+
({ className, variant, size, ...props }: DialogHeaderProps): React.JSX.Element;
|
|
21
21
|
displayName: string;
|
|
22
22
|
};
|
|
23
23
|
declare const DialogBody: {
|
|
24
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>):
|
|
24
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
25
25
|
displayName: string;
|
|
26
26
|
};
|
|
27
27
|
type DialogFooterProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
@@ -29,7 +29,7 @@ type DialogFooterProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
29
29
|
variant?: keyof typeof footerVariants;
|
|
30
30
|
};
|
|
31
31
|
declare const DialogFooter: {
|
|
32
|
-
({ className, size, variant, ...props }: DialogFooterProps):
|
|
32
|
+
({ className, size, variant, ...props }: DialogFooterProps): React.JSX.Element;
|
|
33
33
|
displayName: string;
|
|
34
34
|
};
|
|
35
35
|
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & {
|