@eyesee/ui-components 0.8.0 → 0.10.0
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/README.md +2 -0
- package/dist/components/Avatar/Avatar.d.ts +139 -0
- package/dist/components/Avatar/Avatar.js +8 -7
- package/dist/components/Badge/Badge.d.ts +59 -0
- package/dist/components/Badge/Badge.js +7 -7
- package/dist/components/Badge/badgeVariants.d.ts +17 -0
- package/dist/components/Button/Button.d.ts +299 -0
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Checkbox/Checkbox.d.ts +124 -0
- package/dist/components/Checkbox/Checkbox.js +13 -12
- package/dist/components/DropdownList/DropdownList.d.ts +153 -0
- package/dist/components/DropdownList/DropdownList.js +15 -15
- package/dist/components/EllipsisTooltip/EllipsisTooltip.d.ts +114 -0
- package/dist/components/EllipsisTooltip/EllipsisTooltip.js +3 -3
- package/dist/components/ExpandableItem/ExpandableItem.d.ts +89 -0
- package/dist/components/ExpandableItem/ExpandableItem.js +6 -6
- package/dist/components/Fields/InputField/InputField.d.ts +309 -0
- package/dist/components/Fields/InputField/InputField.js +54 -49
- package/dist/components/Fields/InputFieldContainer.d.ts +11 -0
- package/dist/components/Fields/SelectField/SelectField.d.ts +404 -0
- package/dist/components/Fields/SelectField/SelectField.js +61 -56
- package/dist/components/Fields/SelectField/SelectFieldTags.d.ts +6 -0
- package/dist/components/Fields/SelectField/selectOptionRow.d.ts +1 -0
- package/dist/components/Fields/SelectField/selectUtils.d.ts +35 -0
- package/dist/components/Fields/SelectField/useSelectFieldDropdownPosition.d.ts +7 -0
- package/dist/components/Fields/TextField/TextField.d.ts +272 -0
- package/dist/components/Fields/TextField/TextField.js +68 -61
- package/dist/components/FileType/FileType.d.ts +61 -0
- package/dist/components/FileType/FileType.js +6 -5
- package/dist/components/FileType/PaperIcon.d.ts +5 -0
- package/dist/components/ImagePlaceholder/ImageHoverPreview/ImageHoverPreview.d.ts +75 -0
- package/dist/components/ImagePlaceholder/ImageHoverPreview/ImageHoverPreview.js +13 -12
- package/dist/components/ImagePlaceholder/ImagePlaceholder.d.ts +606 -0
- package/dist/components/ImagePlaceholder/ImagePlaceholder.js +3 -3
- package/dist/components/ImagePlaceholder/constantsImgPh.d.ts +16 -0
- package/dist/components/ImagePlaceholder/utilsImgPh.d.ts +18 -0
- package/dist/components/ImageWithData/ImageWithData.d.ts +284 -0
- package/dist/components/ImageWithData/ImageWithData.js +11 -11
- package/dist/components/Infobox/Infobox.d.ts +90 -0
- package/dist/components/Infobox/Infobox.js +5 -5
- package/dist/components/Infobox/infoboxVariants.d.ts +8 -0
- package/dist/components/ListItem/ListItem.d.ts +311 -0
- package/dist/components/ListItem/ListItem.js +7 -7
- package/dist/components/ListItem/useListItems.d.ts +108 -0
- package/dist/components/ListItem/useListItems.js +18 -17
- package/dist/components/Modal/Modal.d.ts +239 -0
- package/dist/components/Modal/Modal.js +4 -3
- package/dist/components/Notifications/Notifications.d.ts +261 -0
- package/dist/components/Notifications/Notifications.js +4 -3
- package/dist/components/Notifications/useNotifications.d.ts +59 -0
- package/dist/components/Notifications/useNotifications.js +3 -2
- package/dist/components/Pill/Pill.d.ts +81 -0
- package/dist/components/Pill/Pill.js +7 -12
- package/dist/components/Pill/pillVariants.d.ts +16 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +111 -0
- package/dist/components/ProgressBar/ProgressBar.js +17 -16
- package/dist/components/Radio/Radio.d.ts +58 -0
- package/dist/components/Radio/Radio.js +12 -11
- package/dist/components/Tab/Tab.d.ts +204 -0
- package/dist/components/Tab/Tab.js +3 -3
- package/dist/components/Tabs/Tabs.d.ts +356 -0
- package/dist/components/Tabs/Tabs.js +3 -3
- package/dist/components/Tabs/tabsUtils.d.ts +33 -0
- package/dist/components/Tabs/tabsUtils.js +18 -12
- package/dist/components/Tag/Tag.d.ts +93 -0
- package/dist/components/Tag/Tag.js +4 -3
- package/dist/components/Tag/tagVariants.d.ts +7 -0
- package/dist/components/TextHoverable/TextHoverable.d.ts +46 -0
- package/dist/components/TextHoverable/TextHoverable.js +5 -3
- package/dist/components/Toggle/Toggle.d.ts +115 -0
- package/dist/components/Toggle/Toggle.js +6 -5
- package/dist/components/Tooltip/Tooltip.d.ts +294 -0
- package/dist/components/Tooltip/Tooltip.js +3 -3
- package/dist/components/Tooltip/useTooltipPositioning.d.ts +21 -0
- package/dist/components/icons-v2/AdIcon.d.ts +2 -0
- package/dist/components/icons-v2/AddMessageIcon.d.ts +13 -0
- package/dist/components/icons-v2/AddUserIcon.d.ts +13 -0
- package/dist/components/icons-v2/AdjustmentsIcon.d.ts +13 -0
- package/dist/components/icons-v2/AlertIcon.d.ts +13 -0
- package/dist/components/icons-v2/AlignCenterIcon.d.ts +13 -0
- package/dist/components/icons-v2/AlignHorizontallyIcon.d.ts +13 -0
- package/dist/components/icons-v2/AlignJustifyIcon.d.ts +13 -0
- package/dist/components/icons-v2/AlignLeftIcon.d.ts +13 -0
- package/dist/components/icons-v2/AlignRightIcon.d.ts +13 -0
- package/dist/components/icons-v2/AlignVerticallyIcon.d.ts +13 -0
- package/dist/components/icons-v2/AlphabetIcon.d.ts +20 -0
- package/dist/components/icons-v2/ArchiveIcon.d.ts +13 -0
- package/dist/components/icons-v2/ArrowDownIcon.d.ts +13 -0
- package/dist/components/icons-v2/ArrowDownRightIcon.d.ts +13 -0
- package/dist/components/icons-v2/ArrowLeftIcon.d.ts +13 -0
- package/dist/components/icons-v2/ArrowMoveDownIcon.d.ts +13 -0
- package/dist/components/icons-v2/ArrowRightIcon.d.ts +13 -0
- package/dist/components/icons-v2/ArrowUpIcon.d.ts +13 -0
- package/dist/components/icons-v2/AspectRatioIcon.d.ts +13 -0
- package/dist/components/icons-v2/AspectRatioIcon.js +15 -0
- package/dist/components/icons-v2/AttributesEvaluationIcon.d.ts +13 -0
- package/dist/components/icons-v2/BellIcon.d.ts +13 -0
- package/dist/components/icons-v2/BoldIcon.d.ts +13 -0
- package/dist/components/icons-v2/BoltIcon.d.ts +13 -0
- package/dist/components/icons-v2/BookIcon.d.ts +13 -0
- package/dist/components/icons-v2/BookmarkIcon.d.ts +13 -0
- package/dist/components/icons-v2/BooksIcon.d.ts +13 -0
- package/dist/components/icons-v2/BoxIcon.d.ts +13 -0
- package/dist/components/icons-v2/BugIcon.d.ts +13 -0
- package/dist/components/icons-v2/CalendarIcon.d.ts +13 -0
- package/dist/components/icons-v2/CameraPlusIcon.d.ts +13 -0
- package/dist/components/icons-v2/CardsIcon.d.ts +13 -0
- package/dist/components/icons-v2/CellIcon.d.ts +13 -0
- package/dist/components/icons-v2/ChartbarIcon.d.ts +13 -0
- package/dist/components/icons-v2/ChartbarOffIcon.d.ts +13 -0
- package/dist/components/icons-v2/ChatBubbleIcon.d.ts +13 -0
- package/dist/components/icons-v2/ChatbotIcon.d.ts +13 -0
- package/dist/components/icons-v2/CheckCircleIcon.d.ts +13 -0
- package/dist/components/icons-v2/CheckboxIcon.d.ts +13 -0
- package/dist/components/icons-v2/CheckmarkDoubleIcon.d.ts +13 -0
- package/dist/components/icons-v2/CheckmarkLargeIcon.d.ts +13 -0
- package/dist/components/icons-v2/ChevronDownIcon.d.ts +13 -0
- package/dist/components/icons-v2/ChevronLeftIcon.d.ts +13 -0
- package/dist/components/icons-v2/ChevronRightIcon.d.ts +13 -0
- package/dist/components/icons-v2/ChevronUpIcon.d.ts +13 -0
- package/dist/components/icons-v2/ChevronsDownIcon.d.ts +13 -0
- package/dist/components/icons-v2/ChevronsLeftIcon.d.ts +13 -0
- package/dist/components/icons-v2/ChevronsRightIcon.d.ts +13 -0
- package/dist/components/icons-v2/ChevronsUpIcon.d.ts +13 -0
- package/dist/components/icons-v2/CircleIcon.d.ts +11 -0
- package/dist/components/icons-v2/CirclesIcon.d.ts +13 -0
- package/dist/components/icons-v2/ClickIcon.d.ts +13 -0
- package/dist/components/icons-v2/ClipboardIcon.d.ts +13 -0
- package/dist/components/icons-v2/ClockIcon.d.ts +13 -0
- package/dist/components/icons-v2/ClockShareIcon.d.ts +13 -0
- package/dist/components/icons-v2/CloseIcon.d.ts +13 -0
- package/dist/components/icons-v2/ColumnIcon.d.ts +1 -0
- package/dist/components/icons-v2/CopyIcon.d.ts +13 -0
- package/dist/components/icons-v2/CreditCardIcon.d.ts +13 -0
- package/dist/components/icons-v2/CropIcon.d.ts +13 -0
- package/dist/components/icons-v2/DashboardMeterIcon.d.ts +13 -0
- package/dist/components/icons-v2/DatabaseCheckIcon.d.ts +13 -0
- package/dist/components/icons-v2/DatabaseIcon.d.ts +13 -0
- package/dist/components/icons-v2/DeleteIcon.d.ts +12 -0
- package/dist/components/icons-v2/DetailsIcon.d.ts +13 -0
- package/dist/components/icons-v2/DevicesIcon.d.ts +13 -0
- package/dist/components/icons-v2/DislikeIcon.d.ts +13 -0
- package/dist/components/icons-v2/DollarIcon.d.ts +13 -0
- package/dist/components/icons-v2/DownloadIcon.d.ts +13 -0
- package/dist/components/icons-v2/DragToolIcon.d.ts +13 -0
- package/dist/components/icons-v2/DrawRectangleIcon.d.ts +13 -0
- package/dist/components/icons-v2/EditIcon.d.ts +12 -0
- package/dist/components/icons-v2/EmailIcon.d.ts +13 -0
- package/dist/components/icons-v2/EmojiNeutralIcon.d.ts +13 -0
- package/dist/components/icons-v2/EmojiSadIcon.d.ts +13 -0
- package/dist/components/icons-v2/EmojiSlightSmileyIcon.d.ts +13 -0
- package/dist/components/icons-v2/EmojiSmileyIcon.d.ts +13 -0
- package/dist/components/icons-v2/EmojiVerySadIcon.d.ts +13 -0
- package/dist/components/icons-v2/EraserIcon.d.ts +13 -0
- package/dist/components/icons-v2/EtShelfIcon.d.ts +13 -0
- package/dist/components/icons-v2/EtStandaloneIcon.d.ts +13 -0
- package/dist/components/icons-v2/ExternalLinkIcon.d.ts +13 -0
- package/dist/components/icons-v2/EyeSeeTokenIcon.d.ts +1 -0
- package/dist/components/icons-v2/FileExportIcon.d.ts +13 -0
- package/dist/components/icons-v2/FileIcon.d.ts +13 -0
- package/dist/components/icons-v2/FileImportIcon.d.ts +13 -0
- package/dist/components/icons-v2/FileNewIcon.d.ts +13 -0
- package/dist/components/icons-v2/FileRemoveIcon.d.ts +13 -0
- package/dist/components/icons-v2/FileTemplateIcon.d.ts +13 -0
- package/dist/components/icons-v2/FileUploadIcon.d.ts +13 -0
- package/dist/components/icons-v2/FilesIcon.d.ts +13 -0
- package/dist/components/icons-v2/FilterOffIcon.d.ts +13 -0
- package/dist/components/icons-v2/FilterOnIcon.d.ts +13 -0
- package/dist/components/icons-v2/FlagIcon.d.ts +13 -0
- package/dist/components/icons-v2/FolderIcon.d.ts +13 -0
- package/dist/components/icons-v2/FullscreenIcon.d.ts +13 -0
- package/dist/components/icons-v2/GridviewIcon.d.ts +13 -0
- package/dist/components/icons-v2/HelpIcon.d.ts +10 -0
- package/dist/components/icons-v2/HomeIcon.d.ts +13 -0
- package/dist/components/icons-v2/ImageIcon.d.ts +13 -0
- package/dist/components/icons-v2/ImageOffIcon.d.ts +13 -0
- package/dist/components/icons-v2/ImageStarIcon.d.ts +15 -0
- package/dist/components/icons-v2/ImageUploadIcon.d.ts +13 -0
- package/dist/components/icons-v2/ImagesIcon.d.ts +123 -0
- package/dist/components/icons-v2/ImagesIcon.js +15 -0
- package/dist/components/icons-v2/InfoIcon.d.ts +13 -0
- package/dist/components/icons-v2/ItalicIcon.d.ts +13 -0
- package/dist/components/icons-v2/LanguageIcon.d.ts +13 -0
- package/dist/components/icons-v2/LaunchIcon.d.ts +13 -0
- package/dist/components/icons-v2/LayersIcon.d.ts +13 -0
- package/dist/components/icons-v2/LeftSidebarCollapseIcon.d.ts +13 -0
- package/dist/components/icons-v2/LeftSidebarExpandIcon.d.ts +13 -0
- package/dist/components/icons-v2/LightDarkIcon.d.ts +13 -0
- package/dist/components/icons-v2/LightbulbIcon.d.ts +13 -0
- package/dist/components/icons-v2/LikeIcon.d.ts +13 -0
- package/dist/components/icons-v2/LinkIcon.d.ts +13 -0
- package/dist/components/icons-v2/ListCheckIcon.d.ts +1 -0
- package/dist/components/icons-v2/ListViewIcon.d.ts +13 -0
- package/dist/components/icons-v2/LoaderIcon.d.ts +14 -0
- package/dist/components/icons-v2/LoadingIcon.d.ts +14 -0
- package/dist/components/icons-v2/LockIcon.d.ts +13 -0
- package/dist/components/icons-v2/LockOffIcon.d.ts +13 -0
- package/dist/components/icons-v2/LoginIcon.d.ts +13 -0
- package/dist/components/icons-v2/LogoutIcon.d.ts +13 -0
- package/dist/components/icons-v2/MagicwandIcon.d.ts +13 -0
- package/dist/components/icons-v2/MaximizeIcon.d.ts +13 -0
- package/dist/components/icons-v2/MenuIcon.d.ts +13 -0
- package/dist/components/icons-v2/MessageIcon.d.ts +13 -0
- package/dist/components/icons-v2/MeterIcon.d.ts +13 -0
- package/dist/components/icons-v2/MinimizeIcon.d.ts +13 -0
- package/dist/components/icons-v2/MinusIcon.d.ts +13 -0
- package/dist/components/icons-v2/MoreHorizontalIcon.d.ts +13 -0
- package/dist/components/icons-v2/MoreIcon.d.ts +13 -0
- package/dist/components/icons-v2/MouseIcon.d.ts +13 -0
- package/dist/components/icons-v2/MoveIcon.d.ts +13 -0
- package/dist/components/icons-v2/Multiplier05Icon.d.ts +13 -0
- package/dist/components/icons-v2/Multiplier10Icon.d.ts +13 -0
- package/dist/components/icons-v2/Multiplier15Icon.d.ts +13 -0
- package/dist/components/icons-v2/Multiplier20Icon.d.ts +13 -0
- package/dist/components/icons-v2/NoteIcon.d.ts +13 -0
- package/dist/components/icons-v2/NoteOffIcon.d.ts +13 -0
- package/dist/components/icons-v2/NotifyIcon.d.ts +13 -0
- package/dist/components/icons-v2/PackAIIcon.d.ts +13 -0
- package/dist/components/icons-v2/PackseeIcon.d.ts +1 -0
- package/dist/components/icons-v2/PaperclipIcon.d.ts +13 -0
- package/dist/components/icons-v2/PauseIcon.d.ts +13 -0
- package/dist/components/icons-v2/PdfIcon.d.ts +13 -0
- package/dist/components/icons-v2/PentoolIcon.d.ts +13 -0
- package/dist/components/icons-v2/PiechartIcon.d.ts +13 -0
- package/dist/components/icons-v2/PinIcon.d.ts +13 -0
- package/dist/components/icons-v2/PinskewedIcon.d.ts +13 -0
- package/dist/components/icons-v2/PlayIcon.d.ts +13 -0
- package/dist/components/icons-v2/PlusIcon.d.ts +12 -0
- package/dist/components/icons-v2/PredictiveETIcon.d.ts +13 -0
- package/dist/components/icons-v2/RectanglesAddIcon.d.ts +1 -0
- package/dist/components/icons-v2/RedoIcon.d.ts +13 -0
- package/dist/components/icons-v2/RefreshAlertIcon.d.ts +13 -0
- package/dist/components/icons-v2/RefreshIcon.d.ts +13 -0
- package/dist/components/icons-v2/ReplaceIcon.d.ts +13 -0
- package/dist/components/icons-v2/ReplyIcon.d.ts +13 -0
- package/dist/components/icons-v2/SaveIcon.d.ts +12 -0
- package/dist/components/icons-v2/ScalesIcon.d.ts +13 -0
- package/dist/components/icons-v2/SearchIcon.d.ts +13 -0
- package/dist/components/icons-v2/SendIcon.d.ts +13 -0
- package/dist/components/icons-v2/SettingsIcon.d.ts +13 -0
- package/dist/components/icons-v2/ShareIcon.d.ts +13 -0
- package/dist/components/icons-v2/ShelfAddIcon.d.ts +13 -0
- package/dist/components/icons-v2/ShelfIcon.d.ts +13 -0
- package/dist/components/icons-v2/ShelfInfoIcon.d.ts +13 -0
- package/dist/components/icons-v2/ShoppingIcon.d.ts +13 -0
- package/dist/components/icons-v2/SlideshowIcon.d.ts +13 -0
- package/dist/components/icons-v2/SocialFacebookIcon.d.ts +13 -0
- package/dist/components/icons-v2/SocialInstagramIcon.d.ts +13 -0
- package/dist/components/icons-v2/SocialSnapchatIcon.d.ts +13 -0
- package/dist/components/icons-v2/SocialTiktok2Icon.d.ts +13 -0
- package/dist/components/icons-v2/SocialTiktokIcon.d.ts +13 -0
- package/dist/components/icons-v2/SocialXIcon.d.ts +13 -0
- package/dist/components/icons-v2/SocialYoutubeIcon.d.ts +13 -0
- package/dist/components/icons-v2/SortHorizontalIcon.d.ts +13 -0
- package/dist/components/icons-v2/SquareAddIcon.d.ts +1 -0
- package/dist/components/icons-v2/StarIcon.d.ts +20 -0
- package/dist/components/icons-v2/StopIcon.d.ts +11 -0
- package/dist/components/icons-v2/SurveyIcon.d.ts +13 -0
- package/dist/components/icons-v2/TableExportIcon.d.ts +13 -0
- package/dist/components/icons-v2/TableIcon.d.ts +13 -0
- package/dist/components/icons-v2/TableOptionsIcon.d.ts +13 -0
- package/dist/components/icons-v2/TagIcon.d.ts +13 -0
- package/dist/components/icons-v2/TargetArrowIcon.d.ts +13 -0
- package/dist/components/icons-v2/TargetIcon.d.ts +13 -0
- package/dist/components/icons-v2/TextRecognitionIcon.d.ts +13 -0
- package/dist/components/icons-v2/TriangleFlagIcon.d.ts +13 -0
- package/dist/components/icons-v2/TrophyIcon.d.ts +13 -0
- package/dist/components/icons-v2/UnderlineIcon.d.ts +13 -0
- package/dist/components/icons-v2/UndoIcon.d.ts +13 -0
- package/dist/components/icons-v2/UnitBuyRateIcon.d.ts +13 -0
- package/dist/components/icons-v2/UploadIcon.d.ts +13 -0
- package/dist/components/icons-v2/UserGroupIcon.d.ts +13 -0
- package/dist/components/icons-v2/UserIcon.d.ts +13 -0
- package/dist/components/icons-v2/UsersIcon.d.ts +13 -0
- package/dist/components/icons-v2/ValueBuyRateIcon.d.ts +13 -0
- package/dist/components/icons-v2/VideoIcon.d.ts +13 -0
- package/dist/components/icons-v2/ViewOffIcon.d.ts +13 -0
- package/dist/components/icons-v2/ViewOnIcon.d.ts +13 -0
- package/dist/components/icons-v2/VolumeOffIcon.d.ts +13 -0
- package/dist/components/icons-v2/VolumeOnIcon.d.ts +13 -0
- package/dist/components/icons-v2/WebIcon.d.ts +13 -0
- package/dist/components/icons-v2/XIcon.d.ts +13 -0
- package/dist/components/icons-v2/ZipFileIcon.d.ts +13 -0
- package/dist/components/icons-v2/ZonePercentageIcon.d.ts +1 -0
- package/dist/components/icons-v2/ZoomInIcon.d.ts +1 -0
- package/dist/components/icons-v2/ZoomOutIcon.d.ts +1 -0
- package/dist/components/icons-v2/constants.d.ts +61 -0
- package/dist/components/icons-v2/createIcon.d.ts +45 -0
- package/dist/components/icons-v2/index.d.ts +210 -0
- package/dist/components/icons-v2/index.js +378 -374
- package/dist/components/index.d.ts +30 -0
- package/dist/hooks/useClickOutside.d.ts +2 -0
- package/dist/hooks/useEscapeKey.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +17 -4
|
@@ -2,9 +2,10 @@ import { jsxs as f, Fragment as p, jsx as m } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef as I, useState as E } from "react";
|
|
3
3
|
import { createPortal as M } from "react-dom";
|
|
4
4
|
import P from "../ImagePlaceholder.js";
|
|
5
|
-
import
|
|
6
|
-
const w = 200, r = 8,
|
|
7
|
-
|
|
5
|
+
import u from "./ImageHoverPreview.module.scss.js";
|
|
6
|
+
const w = 200, r = 8, d = 8, x = () => document.getElementById("modal") ?? document.body, g = (t, e, a) => Math.min(Math.max(t, e), a);
|
|
7
|
+
function j({ previewSize: t = w, ...e }) {
|
|
8
|
+
const a = I(null), [s, i] = E(null);
|
|
8
9
|
return /* @__PURE__ */ f(p, { children: [
|
|
9
10
|
/* @__PURE__ */ m(
|
|
10
11
|
P,
|
|
@@ -12,12 +13,12 @@ const w = 200, r = 8, u = 8, x = () => document.getElementById("modal") ?? docum
|
|
|
12
13
|
...e,
|
|
13
14
|
imageAreaRef: a,
|
|
14
15
|
onImageAreaMouseEnter: (l) => {
|
|
15
|
-
var
|
|
16
|
+
var c;
|
|
16
17
|
l.stopPropagation();
|
|
17
|
-
const o = (
|
|
18
|
+
const o = (c = a.current) == null ? void 0 : c.getBoundingClientRect();
|
|
18
19
|
if (!o) return;
|
|
19
|
-
let n = o.right +
|
|
20
|
-
n + t > window.innerWidth - r && (n = o.left - t -
|
|
20
|
+
let n = o.right + d;
|
|
21
|
+
n + t > window.innerWidth - r && (n = o.left - t - d), n = g(
|
|
21
22
|
n,
|
|
22
23
|
r,
|
|
23
24
|
window.innerWidth - t - r
|
|
@@ -27,10 +28,10 @@ const w = 200, r = 8, u = 8, x = () => document.getElementById("modal") ?? docum
|
|
|
27
28
|
r,
|
|
28
29
|
window.innerHeight - t - r
|
|
29
30
|
);
|
|
30
|
-
|
|
31
|
+
i({ top: h, left: n });
|
|
31
32
|
},
|
|
32
33
|
onImageAreaMouseLeave: (l) => {
|
|
33
|
-
l.stopPropagation(),
|
|
34
|
+
l.stopPropagation(), i(null);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
),
|
|
@@ -38,7 +39,7 @@ const w = 200, r = 8, u = 8, x = () => document.getElementById("modal") ?? docum
|
|
|
38
39
|
/* @__PURE__ */ m(
|
|
39
40
|
"div",
|
|
40
41
|
{
|
|
41
|
-
className:
|
|
42
|
+
className: u.preview,
|
|
42
43
|
style: {
|
|
43
44
|
top: s.top,
|
|
44
45
|
left: s.left,
|
|
@@ -50,7 +51,7 @@ const w = 200, r = 8, u = 8, x = () => document.getElementById("modal") ?? docum
|
|
|
50
51
|
{
|
|
51
52
|
src: e.url,
|
|
52
53
|
alt: e.text ?? "",
|
|
53
|
-
className:
|
|
54
|
+
className: u.previewImage
|
|
54
55
|
}
|
|
55
56
|
)
|
|
56
57
|
}
|
|
@@ -58,7 +59,7 @@ const w = 200, r = 8, u = 8, x = () => document.getElementById("modal") ?? docum
|
|
|
58
59
|
x()
|
|
59
60
|
)
|
|
60
61
|
] });
|
|
61
|
-
}
|
|
62
|
+
}
|
|
62
63
|
export {
|
|
63
64
|
j as ImageHoverPreview
|
|
64
65
|
};
|
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @callback ImagePlaceholderCheckedHandler
|
|
3
|
+
* @param {import('react').ChangeEvent<HTMLInputElement>|import('react').MouseEvent} [event]
|
|
4
|
+
* Checkbox change or image-area click.
|
|
5
|
+
* @returns {void}
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @callback ImagePlaceholderCloseHandler
|
|
9
|
+
* @returns {void}
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* @callback ImagePlaceholderClickHandler
|
|
13
|
+
* @returns {void}
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* @callback ImagePlaceholderTagDismissHandler
|
|
17
|
+
* @returns {void}
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* @callback ImagePlaceholderMouseAreaHandler
|
|
21
|
+
* @param {import('react').MouseEvent} event
|
|
22
|
+
* @returns {void}
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Pill tag config. Rendered as {@link Pill}.
|
|
26
|
+
*
|
|
27
|
+
* @typedef {object} ImagePlaceholderPillTag
|
|
28
|
+
* @property {'pill'} type
|
|
29
|
+
* @property {string} [label]
|
|
30
|
+
* Tag text (`text` alias supported).
|
|
31
|
+
* @property {string} [text]
|
|
32
|
+
* Tag text alias for `label`.
|
|
33
|
+
* @property {'light'|'dark'|'outline'} [color]
|
|
34
|
+
* {@link Pill} colour. Default first pill colour.
|
|
35
|
+
* @property {'turquoise'|'purple'|'green'|'red'|'yellow'|'orange'|'greenyellow'|'neutral'} [status]
|
|
36
|
+
* {@link Pill} status. Default `'neutral'`.
|
|
37
|
+
* @property {React.ReactNode} [icon]
|
|
38
|
+
* Optional {@link Pill} icon.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* Badge tag config. Rendered as {@link Badge}.
|
|
42
|
+
*
|
|
43
|
+
* @typedef {object} ImagePlaceholderBadgeTag
|
|
44
|
+
* @property {'badge'} type
|
|
45
|
+
* @property {string} [label]
|
|
46
|
+
* Badge text (`text` alias supported).
|
|
47
|
+
* @property {string} [text]
|
|
48
|
+
* Badge text alias for `label`.
|
|
49
|
+
* @property {'rectangle'|'pill'} [shape]
|
|
50
|
+
* {@link Badge} shape. Default `'rectangle'`.
|
|
51
|
+
* @property {'neutral'|'warning'|'error'} [state]
|
|
52
|
+
* {@link Badge} state. Default `'neutral'`.
|
|
53
|
+
*/
|
|
54
|
+
/**
|
|
55
|
+
* Tag config. Rendered as {@link Tag}.
|
|
56
|
+
*
|
|
57
|
+
* @typedef {object} ImagePlaceholderTagTag
|
|
58
|
+
* @property {'tag'} type
|
|
59
|
+
* @property {string} [label]
|
|
60
|
+
* Tag text (`text` alias supported).
|
|
61
|
+
* @property {string} [text]
|
|
62
|
+
* Tag text alias for `label`.
|
|
63
|
+
* @property {'rectangle'|'pill'} [shape]
|
|
64
|
+
* {@link Tag} shape. Default `'rectangle'`.
|
|
65
|
+
* @property {'default'|'secondary'|'disabled'} [state]
|
|
66
|
+
* {@link Tag} foreground state. Default `'default'`.
|
|
67
|
+
* @property {boolean} [showLeadingIcon=false]
|
|
68
|
+
* Shows help icon. Default `false`.
|
|
69
|
+
* @property {ImagePlaceholderTagDismissHandler} [onDismiss]
|
|
70
|
+
* Enables dismiss control on {@link Tag}.
|
|
71
|
+
*/
|
|
72
|
+
/** @typedef {ImagePlaceholderPillTag|ImagePlaceholderBadgeTag|ImagePlaceholderTagTag} ImagePlaceholderTagConfig */
|
|
73
|
+
/**
|
|
74
|
+
* Context menu row passed to {@link ListItem}.
|
|
75
|
+
*
|
|
76
|
+
* @typedef {object} ImagePlaceholderMenuItem
|
|
77
|
+
* @property {string} title - Row label.
|
|
78
|
+
* @property {string} value - Unique React key.
|
|
79
|
+
*/
|
|
80
|
+
/**
|
|
81
|
+
* Extra {@link Tooltip} props. Used only when `tooltipContent` is set.
|
|
82
|
+
*
|
|
83
|
+
* @typedef {object} ImagePlaceholderTooltipProps
|
|
84
|
+
* @property {'top'|'bottom'|'left'|'right'} [position='bottom']
|
|
85
|
+
* @property {'dark'|'light'} [variant='light']
|
|
86
|
+
* @property {boolean} [showArrow=true]
|
|
87
|
+
*/
|
|
88
|
+
/**
|
|
89
|
+
* @typedef {object} ImagePlaceholderProps
|
|
90
|
+
*
|
|
91
|
+
* @property {string} [id]
|
|
92
|
+
* React key / card identifier.
|
|
93
|
+
* @property {string} [url]
|
|
94
|
+
* Image source URL.
|
|
95
|
+
* @property {string} [text]
|
|
96
|
+
* Caption below the image.
|
|
97
|
+
* @property {'inside'|'outside'} [textPosition='inside']
|
|
98
|
+
* Caption placement. Default `'inside'`.
|
|
99
|
+
* @property {ImagePlaceholderTagConfig} [tag]
|
|
100
|
+
* Optional {@link Pill}, {@link Badge}, or {@link Tag} on image or caption.
|
|
101
|
+
*
|
|
102
|
+
* @property {'checkbox'|'close'} [overlay]
|
|
103
|
+
* Overlay control on the image.
|
|
104
|
+
* @property {boolean} [isChecked]
|
|
105
|
+
* Checked state when `overlay` is `'checkbox'`.
|
|
106
|
+
* @property {ImagePlaceholderCheckedHandler} [onChecked]
|
|
107
|
+
* Checkbox overlay toggle handler.
|
|
108
|
+
* @property {ImagePlaceholderMenuItem[]} [menu]
|
|
109
|
+
* Three-dot menu items (shown when `text` is set).
|
|
110
|
+
*
|
|
111
|
+
* @property {'1/1'|'4/3'|'16/9'|'9/16'} [aspectRatio='1/1']
|
|
112
|
+
* Image frame aspect ratio. Default `'1/1'`.
|
|
113
|
+
* @property {'1'|'2'} [lines='1']
|
|
114
|
+
* Max caption lines (`-webkit-line-clamp`). Default `'1'`.
|
|
115
|
+
* @property {boolean} [disabled=false]
|
|
116
|
+
* Disables interaction. Default `false`.
|
|
117
|
+
* @property {ImagePlaceholderCloseHandler} [onClose]
|
|
118
|
+
* Close overlay click handler. Default `() => {}`.
|
|
119
|
+
*
|
|
120
|
+
* @property {React.ReactNode} [tooltipContent]
|
|
121
|
+
* Wraps the card in {@link Tooltip} when set.
|
|
122
|
+
* @property {string} [tooltipTitle]
|
|
123
|
+
* Tooltip heading.
|
|
124
|
+
* @property {ImagePlaceholderTooltipProps} [tooltipProps]
|
|
125
|
+
* Extra {@link Tooltip} props. Default `{ variant: 'light', showArrow: true, position: 'bottom' }`.
|
|
126
|
+
*
|
|
127
|
+
* @property {import('react').Ref} [imageAreaRef]
|
|
128
|
+
* Ref on the image area (used by {@link ImageHoverPreview}).
|
|
129
|
+
* @property {ImagePlaceholderMouseAreaHandler} [onImageAreaMouseEnter]
|
|
130
|
+
* Mouse enter on the image area.
|
|
131
|
+
* @property {ImagePlaceholderMouseAreaHandler} [onImageAreaMouseLeave]
|
|
132
|
+
* Mouse leave on the image area.
|
|
133
|
+
* @property {ImagePlaceholderClickHandler} [onClick]
|
|
134
|
+
* Whole-card click handler (ignored when `disabled`).
|
|
135
|
+
*
|
|
136
|
+
* @property {boolean} [selected=false]
|
|
137
|
+
* Selected-state styling. Default `false`.
|
|
138
|
+
* @property {'always'|'hover'} [overlayDisplay='always']
|
|
139
|
+
* When to show the overlay. Default `'always'`.
|
|
140
|
+
*
|
|
141
|
+
* @see {@link Tooltip}
|
|
142
|
+
* @see {@link Button}
|
|
143
|
+
* @see {@link ListItem}
|
|
144
|
+
* @see {@link Pill}
|
|
145
|
+
* @see {@link Badge}
|
|
146
|
+
* @see {@link Tag}
|
|
147
|
+
* @see {@link Checkbox}
|
|
148
|
+
* @see {@link DropdownList}
|
|
149
|
+
* @see {@link EllipsisTooltip}
|
|
150
|
+
*/
|
|
151
|
+
/**
|
|
152
|
+
* Image card with optional caption, tag, overlay, tooltip, and context menu.
|
|
153
|
+
*
|
|
154
|
+
* ## Props
|
|
155
|
+
*
|
|
156
|
+
* **id** `string` — no default
|
|
157
|
+
* React key / card identifier.
|
|
158
|
+
*
|
|
159
|
+
* **url** `string` — no default
|
|
160
|
+
* Image source URL.
|
|
161
|
+
*
|
|
162
|
+
* **text** `string` — no default
|
|
163
|
+
* Caption below the image.
|
|
164
|
+
*
|
|
165
|
+
* **textPosition** `'inside' | 'outside'` — default `'inside'`
|
|
166
|
+
* Caption placement relative to the card.
|
|
167
|
+
*
|
|
168
|
+
* **tag** `ImagePlaceholderTagConfig` — no default
|
|
169
|
+
* Optional tag on the image (no caption) or above the caption.
|
|
170
|
+
* - Pill: `type: 'pill'`, `label`, `color`, `status`, `icon`
|
|
171
|
+
* - Badge: `type: 'badge'`, `label`, `shape`, `state`
|
|
172
|
+
* - Tag: `type: 'tag'`, `label`, `shape`, `state`, `showLeadingIcon`, `onDismiss`
|
|
173
|
+
*
|
|
174
|
+
* **overlay** `'checkbox' | 'close'` — no default
|
|
175
|
+
* Overlay control on the image.
|
|
176
|
+
*
|
|
177
|
+
* **isChecked** `boolean` — no default
|
|
178
|
+
* Checked state when `overlay` is `'checkbox'`.
|
|
179
|
+
*
|
|
180
|
+
* **onChecked** `(event?) => void` — no default
|
|
181
|
+
* Checkbox overlay toggle handler.
|
|
182
|
+
*
|
|
183
|
+
* **menu** `ImagePlaceholderMenuItem[]` — no default
|
|
184
|
+
* Three-dot {@link ListItem} menu (shown when `text` is set).
|
|
185
|
+
* - `title` `string` — required. Row label.
|
|
186
|
+
* - `value` `string` — required. Unique key.
|
|
187
|
+
*
|
|
188
|
+
* **aspectRatio** `'1/1' | '4/3' | '16/9' | '9/16'` — default `'1/1'`
|
|
189
|
+
* Image frame aspect ratio.
|
|
190
|
+
*
|
|
191
|
+
* **lines** `'1' | '2'` — default `'1'`
|
|
192
|
+
* Max caption lines.
|
|
193
|
+
*
|
|
194
|
+
* **disabled** `boolean` — default `false`
|
|
195
|
+
* Disables interaction.
|
|
196
|
+
*
|
|
197
|
+
* **onClose** `() => void` — default `() => {}`
|
|
198
|
+
* Close overlay click handler.
|
|
199
|
+
*
|
|
200
|
+
* **tooltipContent** `ReactNode` — no default
|
|
201
|
+
* Wraps the card in {@link Tooltip} when set.
|
|
202
|
+
*
|
|
203
|
+
* **tooltipTitle** `string` — no default
|
|
204
|
+
* Tooltip heading.
|
|
205
|
+
*
|
|
206
|
+
* **tooltipProps** `ImagePlaceholderTooltipProps` — default `{ variant: 'light', showArrow: true, position: 'bottom' }`
|
|
207
|
+
* Extra {@link Tooltip} props. Used only when `tooltipContent` is set.
|
|
208
|
+
* - `position` `'top' | 'bottom' | 'left' | 'right'` — default `'bottom'`
|
|
209
|
+
* - `variant` `'dark' | 'light'` — default `'light'`
|
|
210
|
+
* - `showArrow` `boolean` — default `true`
|
|
211
|
+
*
|
|
212
|
+
* **imageAreaRef** `Ref` — no default
|
|
213
|
+
* Ref on the image area.
|
|
214
|
+
*
|
|
215
|
+
* **onImageAreaMouseEnter** `(event: MouseEvent) => void` — no default
|
|
216
|
+
* Mouse enter on the image area.
|
|
217
|
+
*
|
|
218
|
+
* **onImageAreaMouseLeave** `(event: MouseEvent) => void` — no default
|
|
219
|
+
* Mouse leave on the image area.
|
|
220
|
+
*
|
|
221
|
+
* **onClick** `() => void` — no default
|
|
222
|
+
* Whole-card click handler (ignored when `disabled`).
|
|
223
|
+
*
|
|
224
|
+
* **selected** `boolean` — default `false`
|
|
225
|
+
* Selected-state styling.
|
|
226
|
+
*
|
|
227
|
+
* **overlayDisplay** `'always' | 'hover'` — default `'always'`
|
|
228
|
+
* `'hover'` reveals the overlay only while hovered.
|
|
229
|
+
*
|
|
230
|
+
* @param {ImagePlaceholderProps} props
|
|
231
|
+
* @returns {import('react').ReactElement}
|
|
232
|
+
*
|
|
233
|
+
* @example <caption>Default</caption>
|
|
234
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
235
|
+
*
|
|
236
|
+
* <ImagePlaceholder url="https://picsum.photos/400/400" text="Image caption" />
|
|
237
|
+
*
|
|
238
|
+
* @example <caption>Image only</caption>
|
|
239
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
240
|
+
*
|
|
241
|
+
* <ImagePlaceholder url="https://picsum.photos/400/400" />
|
|
242
|
+
*
|
|
243
|
+
* @example <caption>Two-line caption</caption>
|
|
244
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
245
|
+
*
|
|
246
|
+
* <ImagePlaceholder
|
|
247
|
+
* url="https://picsum.photos/400/400"
|
|
248
|
+
* text="This is a longer caption that wraps onto a second line."
|
|
249
|
+
* lines="2"
|
|
250
|
+
* />
|
|
251
|
+
*
|
|
252
|
+
* @example <caption>With pill tag</caption>
|
|
253
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
254
|
+
*
|
|
255
|
+
* <ImagePlaceholder
|
|
256
|
+
* url="https://picsum.photos/400/400"
|
|
257
|
+
* text="Tagged item"
|
|
258
|
+
* tag={{ type: 'pill', label: 'Active', color: 'light', status: 'green' }}
|
|
259
|
+
* />
|
|
260
|
+
*
|
|
261
|
+
* @example <caption>With badge tag</caption>
|
|
262
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
263
|
+
*
|
|
264
|
+
* <ImagePlaceholder
|
|
265
|
+
* url="https://picsum.photos/400/400"
|
|
266
|
+
* text="Album with overflow count"
|
|
267
|
+
* tag={{ type: 'badge', label: '+100', shape: 'rectangle', state: 'neutral' }}
|
|
268
|
+
* />
|
|
269
|
+
*
|
|
270
|
+
* @example <caption>With tag</caption>
|
|
271
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
272
|
+
*
|
|
273
|
+
* <ImagePlaceholder
|
|
274
|
+
* url="https://picsum.photos/400/400"
|
|
275
|
+
* text="Tagged asset"
|
|
276
|
+
* tag={{ type: 'tag', label: 'Tag', shape: 'rectangle', state: 'secondary', showLeadingIcon: true }}
|
|
277
|
+
* />
|
|
278
|
+
*
|
|
279
|
+
* @example <caption>Tag on image</caption>
|
|
280
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
281
|
+
*
|
|
282
|
+
* <ImagePlaceholder
|
|
283
|
+
* url="https://picsum.photos/400/400"
|
|
284
|
+
* tag={{ type: 'pill', label: 'New', color: 'light', status: 'turquoise' }}
|
|
285
|
+
* />
|
|
286
|
+
*
|
|
287
|
+
* @example <caption>Checkbox overlay</caption>
|
|
288
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
289
|
+
*
|
|
290
|
+
* <ImagePlaceholder
|
|
291
|
+
* url="https://picsum.photos/400/400"
|
|
292
|
+
* text="Selectable image"
|
|
293
|
+
* overlay="checkbox"
|
|
294
|
+
* isChecked={false}
|
|
295
|
+
* />
|
|
296
|
+
*
|
|
297
|
+
* @example <caption>Selected</caption>
|
|
298
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
299
|
+
*
|
|
300
|
+
* <ImagePlaceholder
|
|
301
|
+
* url="https://picsum.photos/400/400"
|
|
302
|
+
* text="Selected card"
|
|
303
|
+
* selected
|
|
304
|
+
* overlay="checkbox"
|
|
305
|
+
* isChecked
|
|
306
|
+
* />
|
|
307
|
+
*
|
|
308
|
+
* @example <caption>Selected vs default</caption>
|
|
309
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
310
|
+
*
|
|
311
|
+
* <ImagePlaceholder url="https://picsum.photos/400/400" text="Default" overlay="checkbox" />
|
|
312
|
+
* <ImagePlaceholder url="https://picsum.photos/400/400" text="Selected" selected overlay="checkbox" isChecked />
|
|
313
|
+
*
|
|
314
|
+
* @example <caption>Close overlay</caption>
|
|
315
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
316
|
+
*
|
|
317
|
+
* <ImagePlaceholder url="https://picsum.photos/400/400" text="Dismissible image" overlay="close" />
|
|
318
|
+
*
|
|
319
|
+
* @example <caption>Overlay on hover</caption>
|
|
320
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
321
|
+
*
|
|
322
|
+
* <ImagePlaceholder
|
|
323
|
+
* url="https://picsum.photos/400/400"
|
|
324
|
+
* text="Hover to reveal overlay"
|
|
325
|
+
* overlay="checkbox"
|
|
326
|
+
* overlayDisplay="hover"
|
|
327
|
+
* />
|
|
328
|
+
*
|
|
329
|
+
* @example <caption>Clickable</caption>
|
|
330
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
331
|
+
*
|
|
332
|
+
* <ImagePlaceholder url="https://picsum.photos/400/400" text="Click anywhere on the card" overlay="checkbox" onClick={() => {}} />
|
|
333
|
+
*
|
|
334
|
+
* @example <caption>With tooltip</caption>
|
|
335
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
336
|
+
*
|
|
337
|
+
* <ImagePlaceholder url="https://picsum.photos/400/400" text="Hover for preview" tooltipContent="Full-size preview image" />
|
|
338
|
+
*
|
|
339
|
+
* @example <caption>With tooltip title</caption>
|
|
340
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
341
|
+
*
|
|
342
|
+
* <ImagePlaceholder
|
|
343
|
+
* url="https://picsum.photos/400/400"
|
|
344
|
+
* text="Asset thumbnail"
|
|
345
|
+
* tooltipTitle="Asset ID"
|
|
346
|
+
* tooltipContent="EXT-001 — uploaded 12 Jan 2026"
|
|
347
|
+
* tooltipProps={{ variant: 'dark', showArrow: true, position: 'bottom' }}
|
|
348
|
+
* />
|
|
349
|
+
*
|
|
350
|
+
* @example <caption>Clickable with tooltip</caption>
|
|
351
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
352
|
+
*
|
|
353
|
+
* <ImagePlaceholder
|
|
354
|
+
* url="https://picsum.photos/400/400"
|
|
355
|
+
* text="Select or preview"
|
|
356
|
+
* tooltipContent="Click to select · hover for preview"
|
|
357
|
+
* onClick={() => {}}
|
|
358
|
+
* />
|
|
359
|
+
*
|
|
360
|
+
* @example <caption>With context menu</caption>
|
|
361
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
362
|
+
*
|
|
363
|
+
* <ImagePlaceholder
|
|
364
|
+
* url="https://picsum.photos/400/400"
|
|
365
|
+
* text="Click the three-dot icon"
|
|
366
|
+
* menu={[
|
|
367
|
+
* { title: 'Edit', value: 'edit' },
|
|
368
|
+
* { title: 'Duplicate', value: 'duplicate' },
|
|
369
|
+
* { title: 'Delete', value: 'delete' },
|
|
370
|
+
* ]}
|
|
371
|
+
* />
|
|
372
|
+
*
|
|
373
|
+
* @example <caption>Aspect ratios</caption>
|
|
374
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
375
|
+
*
|
|
376
|
+
* <ImagePlaceholder url="https://picsum.photos/400/400" text="1/1" aspectRatio="1/1" />
|
|
377
|
+
* <ImagePlaceholder url="https://picsum.photos/640/360" text="16/9" aspectRatio="16/9" />
|
|
378
|
+
* <ImagePlaceholder url="https://picsum.photos/270/480" text="9/16" aspectRatio="9/16" />
|
|
379
|
+
*
|
|
380
|
+
* @example <caption>Full — all features</caption>
|
|
381
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
382
|
+
*
|
|
383
|
+
* <ImagePlaceholder
|
|
384
|
+
* url="https://picsum.photos/400/400"
|
|
385
|
+
* text="Project thumbnail with all options enabled"
|
|
386
|
+
* tag={{ type: 'pill', label: 'Draft', color: 'light', status: 'orange' }}
|
|
387
|
+
* overlay="checkbox"
|
|
388
|
+
* isChecked
|
|
389
|
+
* selected
|
|
390
|
+
* aspectRatio="4/3"
|
|
391
|
+
* lines="2"
|
|
392
|
+
* menu={[
|
|
393
|
+
* { title: 'Edit', value: 'edit' },
|
|
394
|
+
* { title: 'Delete', value: 'delete' },
|
|
395
|
+
* ]}
|
|
396
|
+
* />
|
|
397
|
+
*
|
|
398
|
+
* @example <caption>Grid layout</caption>
|
|
399
|
+
* import { ImagePlaceholder } from '@eyesee/ui-components';
|
|
400
|
+
*
|
|
401
|
+
* <ImagePlaceholder
|
|
402
|
+
* url="https://picsum.photos/400/400"
|
|
403
|
+
* text="Alpha"
|
|
404
|
+
* tag={{ type: 'pill', label: 'Active', color: 'light', status: 'green' }}
|
|
405
|
+
* overlay="checkbox"
|
|
406
|
+
* isChecked
|
|
407
|
+
* selected
|
|
408
|
+
* />
|
|
409
|
+
* <ImagePlaceholder url="https://picsum.photos/400/400" text="Beta" overlay="checkbox" />
|
|
410
|
+
*/
|
|
411
|
+
export default function ImagePlaceholder({ id, url, text, textPosition, tag, overlay, isChecked, onChecked, menu, aspectRatio, lines, disabled, onClose, tooltipContent, tooltipTitle, tooltipProps, imageAreaRef, onImageAreaMouseEnter, onImageAreaMouseLeave, onClick, selected, overlayDisplay, }: ImagePlaceholderProps): import("react").ReactElement;
|
|
412
|
+
export type ImagePlaceholderCheckedHandler = (event?: import("react").ChangeEvent<HTMLInputElement> | import("react").MouseEvent) => void;
|
|
413
|
+
export type ImagePlaceholderCloseHandler = () => void;
|
|
414
|
+
export type ImagePlaceholderClickHandler = () => void;
|
|
415
|
+
export type ImagePlaceholderTagDismissHandler = () => void;
|
|
416
|
+
export type ImagePlaceholderMouseAreaHandler = (event: import("react").MouseEvent) => void;
|
|
417
|
+
/**
|
|
418
|
+
* Pill tag config. Rendered as {@link Pill}.
|
|
419
|
+
*/
|
|
420
|
+
export type ImagePlaceholderPillTag = {
|
|
421
|
+
type: "pill";
|
|
422
|
+
/**
|
|
423
|
+
* Tag text (`text` alias supported).
|
|
424
|
+
*/
|
|
425
|
+
label?: string;
|
|
426
|
+
/**
|
|
427
|
+
* Tag text alias for `label`.
|
|
428
|
+
*/
|
|
429
|
+
text?: string;
|
|
430
|
+
/**
|
|
431
|
+
* {@link Pill} colour. Default first pill colour.
|
|
432
|
+
*/
|
|
433
|
+
color?: "light" | "dark" | "outline";
|
|
434
|
+
/**
|
|
435
|
+
* {@link Pill} status. Default `'neutral'`.
|
|
436
|
+
*/
|
|
437
|
+
status?: "turquoise" | "purple" | "green" | "red" | "yellow" | "orange" | "greenyellow" | "neutral";
|
|
438
|
+
/**
|
|
439
|
+
* Optional {@link Pill} icon.
|
|
440
|
+
*/
|
|
441
|
+
icon?: React.ReactNode;
|
|
442
|
+
};
|
|
443
|
+
/**
|
|
444
|
+
* Badge tag config. Rendered as {@link Badge}.
|
|
445
|
+
*/
|
|
446
|
+
export type ImagePlaceholderBadgeTag = {
|
|
447
|
+
type: "badge";
|
|
448
|
+
/**
|
|
449
|
+
* Badge text (`text` alias supported).
|
|
450
|
+
*/
|
|
451
|
+
label?: string;
|
|
452
|
+
/**
|
|
453
|
+
* Badge text alias for `label`.
|
|
454
|
+
*/
|
|
455
|
+
text?: string;
|
|
456
|
+
/**
|
|
457
|
+
* {@link Badge} shape. Default `'rectangle'`.
|
|
458
|
+
*/
|
|
459
|
+
shape?: "rectangle" | "pill";
|
|
460
|
+
/**
|
|
461
|
+
* {@link Badge} state. Default `'neutral'`.
|
|
462
|
+
*/
|
|
463
|
+
state?: "neutral" | "warning" | "error";
|
|
464
|
+
};
|
|
465
|
+
/**
|
|
466
|
+
* Tag config. Rendered as {@link Tag}.
|
|
467
|
+
*/
|
|
468
|
+
export type ImagePlaceholderTagTag = {
|
|
469
|
+
type: "tag";
|
|
470
|
+
/**
|
|
471
|
+
* Tag text (`text` alias supported).
|
|
472
|
+
*/
|
|
473
|
+
label?: string;
|
|
474
|
+
/**
|
|
475
|
+
* Tag text alias for `label`.
|
|
476
|
+
*/
|
|
477
|
+
text?: string;
|
|
478
|
+
/**
|
|
479
|
+
* {@link Tag} shape. Default `'rectangle'`.
|
|
480
|
+
*/
|
|
481
|
+
shape?: "rectangle" | "pill";
|
|
482
|
+
/**
|
|
483
|
+
* {@link Tag} foreground state. Default `'default'`.
|
|
484
|
+
*/
|
|
485
|
+
state?: "default" | "secondary" | "disabled";
|
|
486
|
+
/**
|
|
487
|
+
* Shows help icon. Default `false`.
|
|
488
|
+
*/
|
|
489
|
+
showLeadingIcon?: boolean;
|
|
490
|
+
/**
|
|
491
|
+
* Enables dismiss control on {@link Tag}.
|
|
492
|
+
*/
|
|
493
|
+
onDismiss?: ImagePlaceholderTagDismissHandler;
|
|
494
|
+
};
|
|
495
|
+
export type ImagePlaceholderTagConfig = ImagePlaceholderPillTag | ImagePlaceholderBadgeTag | ImagePlaceholderTagTag;
|
|
496
|
+
/**
|
|
497
|
+
* Context menu row passed to {@link ListItem}.
|
|
498
|
+
*/
|
|
499
|
+
export type ImagePlaceholderMenuItem = {
|
|
500
|
+
/**
|
|
501
|
+
* - Row label.
|
|
502
|
+
*/
|
|
503
|
+
title: string;
|
|
504
|
+
/**
|
|
505
|
+
* - Unique React key.
|
|
506
|
+
*/
|
|
507
|
+
value: string;
|
|
508
|
+
};
|
|
509
|
+
/**
|
|
510
|
+
* Extra {@link Tooltip} props. Used only when `tooltipContent` is set.
|
|
511
|
+
*/
|
|
512
|
+
export type ImagePlaceholderTooltipProps = {
|
|
513
|
+
position?: "top" | "bottom" | "left" | "right";
|
|
514
|
+
variant?: "dark" | "light";
|
|
515
|
+
showArrow?: boolean;
|
|
516
|
+
};
|
|
517
|
+
export type ImagePlaceholderProps = {
|
|
518
|
+
/**
|
|
519
|
+
* React key / card identifier.
|
|
520
|
+
*/
|
|
521
|
+
id?: string;
|
|
522
|
+
/**
|
|
523
|
+
* Image source URL.
|
|
524
|
+
*/
|
|
525
|
+
url?: string;
|
|
526
|
+
/**
|
|
527
|
+
* Caption below the image.
|
|
528
|
+
*/
|
|
529
|
+
text?: string;
|
|
530
|
+
/**
|
|
531
|
+
* Caption placement. Default `'inside'`.
|
|
532
|
+
*/
|
|
533
|
+
textPosition?: "inside" | "outside";
|
|
534
|
+
/**
|
|
535
|
+
* Optional {@link Pill}, {@link Badge}, or {@link Tag} on image or caption.
|
|
536
|
+
*/
|
|
537
|
+
tag?: ImagePlaceholderTagConfig;
|
|
538
|
+
/**
|
|
539
|
+
* Overlay control on the image.
|
|
540
|
+
*/
|
|
541
|
+
overlay?: "checkbox" | "close";
|
|
542
|
+
/**
|
|
543
|
+
* Checked state when `overlay` is `'checkbox'`.
|
|
544
|
+
*/
|
|
545
|
+
isChecked?: boolean;
|
|
546
|
+
/**
|
|
547
|
+
* Checkbox overlay toggle handler.
|
|
548
|
+
*/
|
|
549
|
+
onChecked?: ImagePlaceholderCheckedHandler;
|
|
550
|
+
/**
|
|
551
|
+
* Three-dot menu items (shown when `text` is set).
|
|
552
|
+
*/
|
|
553
|
+
menu?: ImagePlaceholderMenuItem[];
|
|
554
|
+
/**
|
|
555
|
+
* Image frame aspect ratio. Default `'1/1'`.
|
|
556
|
+
*/
|
|
557
|
+
aspectRatio?: "1/1" | "4/3" | "16/9" | "9/16";
|
|
558
|
+
/**
|
|
559
|
+
* Max caption lines (`-webkit-line-clamp`). Default `'1'`.
|
|
560
|
+
*/
|
|
561
|
+
lines?: "1" | "2";
|
|
562
|
+
/**
|
|
563
|
+
* Disables interaction. Default `false`.
|
|
564
|
+
*/
|
|
565
|
+
disabled?: boolean;
|
|
566
|
+
/**
|
|
567
|
+
* Close overlay click handler. Default `() => {}`.
|
|
568
|
+
*/
|
|
569
|
+
onClose?: ImagePlaceholderCloseHandler;
|
|
570
|
+
/**
|
|
571
|
+
* Wraps the card in {@link Tooltip} when set.
|
|
572
|
+
*/
|
|
573
|
+
tooltipContent?: React.ReactNode;
|
|
574
|
+
/**
|
|
575
|
+
* Tooltip heading.
|
|
576
|
+
*/
|
|
577
|
+
tooltipTitle?: string;
|
|
578
|
+
/**
|
|
579
|
+
* Extra {@link Tooltip} props. Default `{ variant: 'light', showArrow: true, position: 'bottom' }`.
|
|
580
|
+
*/
|
|
581
|
+
tooltipProps?: ImagePlaceholderTooltipProps;
|
|
582
|
+
/**
|
|
583
|
+
* Ref on the image area (used by {@link ImageHoverPreview}).
|
|
584
|
+
*/
|
|
585
|
+
imageAreaRef?: any;
|
|
586
|
+
/**
|
|
587
|
+
* Mouse enter on the image area.
|
|
588
|
+
*/
|
|
589
|
+
onImageAreaMouseEnter?: ImagePlaceholderMouseAreaHandler;
|
|
590
|
+
/**
|
|
591
|
+
* Mouse leave on the image area.
|
|
592
|
+
*/
|
|
593
|
+
onImageAreaMouseLeave?: ImagePlaceholderMouseAreaHandler;
|
|
594
|
+
/**
|
|
595
|
+
* Whole-card click handler (ignored when `disabled`).
|
|
596
|
+
*/
|
|
597
|
+
onClick?: ImagePlaceholderClickHandler;
|
|
598
|
+
/**
|
|
599
|
+
* Selected-state styling. Default `false`.
|
|
600
|
+
*/
|
|
601
|
+
selected?: boolean;
|
|
602
|
+
/**
|
|
603
|
+
* When to show the overlay. Default `'always'`.
|
|
604
|
+
*/
|
|
605
|
+
overlayDisplay?: "always" | "hover";
|
|
606
|
+
};
|
|
@@ -16,7 +16,7 @@ import { ListItem as ro } from "../ListItem/ListItem.js";
|
|
|
16
16
|
import { Tag as lo } from "../Tag/Tag.js";
|
|
17
17
|
import { Badge as so } from "../Badge/Badge.js";
|
|
18
18
|
import { Pill as io } from "../Pill/Pill.js";
|
|
19
|
-
|
|
19
|
+
function Eo({
|
|
20
20
|
id: g,
|
|
21
21
|
url: E,
|
|
22
22
|
text: a,
|
|
@@ -40,7 +40,7 @@ const Eo = ({
|
|
|
40
40
|
onClick: u,
|
|
41
41
|
selected: F = !1,
|
|
42
42
|
overlayDisplay: R = "always"
|
|
43
|
-
})
|
|
43
|
+
}) {
|
|
44
44
|
const [f, W] = N(!1), [n, z] = N(!1), v = () => {
|
|
45
45
|
switch (l == null ? void 0 : l.type) {
|
|
46
46
|
case "pill":
|
|
@@ -165,7 +165,7 @@ const Eo = ({
|
|
|
165
165
|
g
|
|
166
166
|
);
|
|
167
167
|
return Y ? /* @__PURE__ */ e(G, { title: y, content: h, ...A, fullWidth: !0, children: k }) : k;
|
|
168
|
-
}
|
|
168
|
+
}
|
|
169
169
|
export {
|
|
170
170
|
Eo as default
|
|
171
171
|
};
|