@eyesee/ui-components 0.8.0 → 0.9.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/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 +209 -0
- package/dist/components/icons-v2/index.js +376 -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
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const ASPECT_RATIOS: {
|
|
2
|
+
'1/1': string;
|
|
3
|
+
'4/3': string;
|
|
4
|
+
'16/9': string;
|
|
5
|
+
'9/16': string;
|
|
6
|
+
};
|
|
7
|
+
export const LINES: {
|
|
8
|
+
1: string;
|
|
9
|
+
2: string;
|
|
10
|
+
};
|
|
11
|
+
export namespace TEXT_POSITIONS {
|
|
12
|
+
let inside: string;
|
|
13
|
+
let outside: string;
|
|
14
|
+
}
|
|
15
|
+
export const TAG_TYPES: Set<string>;
|
|
16
|
+
export const OVERLAYS: Set<string>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function tagPropsFromTag(tag: any): {
|
|
2
|
+
label: any;
|
|
3
|
+
shape: any;
|
|
4
|
+
state: any;
|
|
5
|
+
showLeadingIcon: boolean;
|
|
6
|
+
onDismiss: any;
|
|
7
|
+
};
|
|
8
|
+
export function badgePropsFromTag(tag: any): {
|
|
9
|
+
label: any;
|
|
10
|
+
shape: any;
|
|
11
|
+
state: any;
|
|
12
|
+
};
|
|
13
|
+
export function pillPropsFromTag(tag: any): {
|
|
14
|
+
label: any;
|
|
15
|
+
color: any;
|
|
16
|
+
status: string;
|
|
17
|
+
icon: any;
|
|
18
|
+
};
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @callback ImageWithDataCheckedHandler
|
|
3
|
+
* @returns {void}
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @callback ImageWithDataCloseHandler
|
|
7
|
+
* @returns {void}
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @callback ImageWithDataIconClickHandler
|
|
11
|
+
* @returns {void}
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Pill tag config. Rendered as {@link Pill}.
|
|
15
|
+
*
|
|
16
|
+
* @typedef {object} ImageWithDataPillTag
|
|
17
|
+
* @property {'pill'} type
|
|
18
|
+
* @property {string} [label]
|
|
19
|
+
* @property {string} [text]
|
|
20
|
+
* @property {'light'|'dark'|'outline'} [color]
|
|
21
|
+
* @property {'turquoise'|'purple'|'green'|'red'|'yellow'|'orange'|'greenyellow'|'neutral'} [status]
|
|
22
|
+
* @property {React.ReactNode} [icon]
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Badge tag config. Rendered as {@link Badge}.
|
|
26
|
+
*
|
|
27
|
+
* @typedef {object} ImageWithDataBadgeTag
|
|
28
|
+
* @property {'badge'} type
|
|
29
|
+
* @property {string} [label]
|
|
30
|
+
* @property {string} [text]
|
|
31
|
+
* @property {'rectangle'|'pill'} [shape]
|
|
32
|
+
* @property {'neutral'|'warning'|'error'} [state]
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Tag config. Rendered as {@link Tag}.
|
|
36
|
+
*
|
|
37
|
+
* @typedef {object} ImageWithDataTagTag
|
|
38
|
+
* @property {'tag'} type
|
|
39
|
+
* @property {string} [label]
|
|
40
|
+
* @property {string} [text]
|
|
41
|
+
* @property {'rectangle'|'pill'} [shape]
|
|
42
|
+
* @property {'default'|'secondary'|'disabled'} [state]
|
|
43
|
+
* @property {boolean} [showLeadingIcon=false]
|
|
44
|
+
* @property {() => void} [onDismiss]
|
|
45
|
+
*/
|
|
46
|
+
/** @typedef {ImageWithDataPillTag|ImageWithDataBadgeTag|ImageWithDataTagTag} ImageWithDataTagConfig */
|
|
47
|
+
/**
|
|
48
|
+
* @typedef {object} ImageWithDataProps
|
|
49
|
+
*
|
|
50
|
+
* @property {string} [id]
|
|
51
|
+
* React key / card identifier.
|
|
52
|
+
* @property {string} [url]
|
|
53
|
+
* Image source URL.
|
|
54
|
+
* @property {string} [text]
|
|
55
|
+
* Caption below the image.
|
|
56
|
+
* @property {'inside'|'outside'} [textPosition='inside']
|
|
57
|
+
* Caption placement. Default `'inside'`.
|
|
58
|
+
* @property {ImageWithDataTagConfig} [tag]
|
|
59
|
+
* Optional {@link Pill}, {@link Badge}, or {@link Tag}.
|
|
60
|
+
*
|
|
61
|
+
* @property {'checkbox'|'close'|'icon'} [overlay]
|
|
62
|
+
* Overlay control on the image.
|
|
63
|
+
* @property {boolean} [isChecked]
|
|
64
|
+
* Checked state when `overlay` is `'checkbox'`.
|
|
65
|
+
* @property {ImageWithDataCheckedHandler} [onChecked]
|
|
66
|
+
* Checkbox overlay toggle handler.
|
|
67
|
+
*
|
|
68
|
+
* @property {'1/1'|'4/3'|'16/9'|'9/16'} [aspectRatio='1/1']
|
|
69
|
+
* Image frame aspect ratio. Default `'1/1'`.
|
|
70
|
+
* @property {'1'|'2'} [lines='1']
|
|
71
|
+
* Max caption lines. Default `'1'`.
|
|
72
|
+
* @property {string|number|null} [number=null]
|
|
73
|
+
* Metric shown beside the caption. Default `null`.
|
|
74
|
+
*
|
|
75
|
+
* @property {boolean} [disabled=false]
|
|
76
|
+
* Disables the whole card. Default `false`.
|
|
77
|
+
* @property {boolean} [disabledOverlay=false]
|
|
78
|
+
* Disables overlay controls only. Default `false`.
|
|
79
|
+
* @property {ImageWithDataCloseHandler} [onClose]
|
|
80
|
+
* Close overlay click handler.
|
|
81
|
+
* @property {React.ReactNode} [icon]
|
|
82
|
+
* Icon for `overlay="icon"`.
|
|
83
|
+
* @property {ImageWithDataIconClickHandler} [onIconClick]
|
|
84
|
+
* Icon overlay click handler.
|
|
85
|
+
*
|
|
86
|
+
* @see {@link Button}
|
|
87
|
+
* @see {@link Pill}
|
|
88
|
+
* @see {@link Badge}
|
|
89
|
+
* @see {@link Tag}
|
|
90
|
+
* @see {@link Checkbox}
|
|
91
|
+
* @see {@link EllipsisTooltip}
|
|
92
|
+
*/
|
|
93
|
+
/**
|
|
94
|
+
* Image card with caption, optional tag, overlay controls, and supporting number.
|
|
95
|
+
*
|
|
96
|
+
* ## Props
|
|
97
|
+
*
|
|
98
|
+
* **id** `string` — no default
|
|
99
|
+
* React key / card identifier.
|
|
100
|
+
*
|
|
101
|
+
* **url** `string` — no default
|
|
102
|
+
* Image source URL.
|
|
103
|
+
*
|
|
104
|
+
* **text** `string` — no default
|
|
105
|
+
* Caption below the image.
|
|
106
|
+
*
|
|
107
|
+
* **textPosition** `'inside' | 'outside'` — default `'inside'`
|
|
108
|
+
* Caption placement relative to the card.
|
|
109
|
+
*
|
|
110
|
+
* **tag** `ImageWithDataTagConfig` — no default
|
|
111
|
+
* Optional tag on the image (no caption) or above the caption.
|
|
112
|
+
* - Pill: `type: 'pill'`, `label`, `color`, `status`, `icon`
|
|
113
|
+
* - Badge: `type: 'badge'`, `label`, `shape`, `state`
|
|
114
|
+
* - Tag: `type: 'tag'`, `label`, `shape`, `state`, `showLeadingIcon`, `onDismiss`
|
|
115
|
+
*
|
|
116
|
+
* **overlay** `'checkbox' | 'close' | 'icon'` — no default
|
|
117
|
+
* Overlay control on the image.
|
|
118
|
+
*
|
|
119
|
+
* **isChecked** `boolean` — no default
|
|
120
|
+
* Checked state when `overlay` is `'checkbox'`.
|
|
121
|
+
*
|
|
122
|
+
* **onChecked** `() => void` — no default
|
|
123
|
+
* Checkbox overlay toggle handler.
|
|
124
|
+
*
|
|
125
|
+
* **aspectRatio** `'1/1' | '4/3' | '16/9' | '9/16'` — default `'1/1'`
|
|
126
|
+
* Image frame aspect ratio.
|
|
127
|
+
*
|
|
128
|
+
* **lines** `'1' | '2'` — default `'1'`
|
|
129
|
+
* Max caption lines.
|
|
130
|
+
*
|
|
131
|
+
* **number** `string | number | null` — default `null`
|
|
132
|
+
* Metric shown beside the caption.
|
|
133
|
+
*
|
|
134
|
+
* **disabled** `boolean` — default `false`
|
|
135
|
+
* Disables the whole card.
|
|
136
|
+
*
|
|
137
|
+
* **disabledOverlay** `boolean` — default `false`
|
|
138
|
+
* Disables overlay controls only (also implied when `disabled`).
|
|
139
|
+
*
|
|
140
|
+
* **onClose** `() => void` — no default
|
|
141
|
+
* Close overlay click handler.
|
|
142
|
+
*
|
|
143
|
+
* **icon** `ReactNode` — no default
|
|
144
|
+
* Icon for `overlay="icon"` (rendered in {@link Button}).
|
|
145
|
+
*
|
|
146
|
+
* **onIconClick** `() => void` — no default
|
|
147
|
+
* Icon overlay click handler.
|
|
148
|
+
*
|
|
149
|
+
* @param {ImageWithDataProps} props
|
|
150
|
+
* @returns {import('react').ReactElement}
|
|
151
|
+
*
|
|
152
|
+
* @example <caption>Default</caption>
|
|
153
|
+
* import { ImageWithData } from '@eyesee/ui-components';
|
|
154
|
+
*
|
|
155
|
+
* <ImageWithData id="storybook-image" url="https://picsum.photos/400/400" text="Image caption" />
|
|
156
|
+
*
|
|
157
|
+
* @example <caption>WithNumber</caption>
|
|
158
|
+
* import { ImageWithData } from '@eyesee/ui-components';
|
|
159
|
+
*
|
|
160
|
+
* <ImageWithData url="https://picsum.photos/400/400" text="Image with supporting number" number={12} />
|
|
161
|
+
*
|
|
162
|
+
* @example <caption>WithTag</caption>
|
|
163
|
+
* import { ImageWithData } from '@eyesee/ui-components';
|
|
164
|
+
*
|
|
165
|
+
* <ImageWithData
|
|
166
|
+
* url="https://picsum.photos/400/400"
|
|
167
|
+
* text="Image caption"
|
|
168
|
+
* tag={{ type: 'pill', label: 'Active', color: 'light', status: 'green' }}
|
|
169
|
+
* />
|
|
170
|
+
*
|
|
171
|
+
* @example <caption>CheckboxOverlay</caption>
|
|
172
|
+
* import { ImageWithData } from '@eyesee/ui-components';
|
|
173
|
+
*
|
|
174
|
+
* <ImageWithData url="https://picsum.photos/400/400" text="Image caption" overlay="checkbox" />
|
|
175
|
+
*
|
|
176
|
+
* @example <caption>Disabled</caption>
|
|
177
|
+
* import { ImageWithData } from '@eyesee/ui-components';
|
|
178
|
+
*
|
|
179
|
+
* <ImageWithData url="https://picsum.photos/400/400" text="Image caption" disabled overlay="checkbox" isChecked />
|
|
180
|
+
*/
|
|
181
|
+
export default function ImageWithData({ id, url, text, textPosition, tag, overlay, isChecked, onChecked, aspectRatio, lines, number, disabled, disabledOverlay, onClose, icon, onIconClick, }: ImageWithDataProps): import("react").ReactElement;
|
|
182
|
+
export type ImageWithDataCheckedHandler = () => void;
|
|
183
|
+
export type ImageWithDataCloseHandler = () => void;
|
|
184
|
+
export type ImageWithDataIconClickHandler = () => void;
|
|
185
|
+
/**
|
|
186
|
+
* Pill tag config. Rendered as {@link Pill}.
|
|
187
|
+
*/
|
|
188
|
+
export type ImageWithDataPillTag = {
|
|
189
|
+
type: "pill";
|
|
190
|
+
label?: string;
|
|
191
|
+
text?: string;
|
|
192
|
+
color?: "light" | "dark" | "outline";
|
|
193
|
+
status?: "turquoise" | "purple" | "green" | "red" | "yellow" | "orange" | "greenyellow" | "neutral";
|
|
194
|
+
icon?: React.ReactNode;
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* Badge tag config. Rendered as {@link Badge}.
|
|
198
|
+
*/
|
|
199
|
+
export type ImageWithDataBadgeTag = {
|
|
200
|
+
type: "badge";
|
|
201
|
+
label?: string;
|
|
202
|
+
text?: string;
|
|
203
|
+
shape?: "rectangle" | "pill";
|
|
204
|
+
state?: "neutral" | "warning" | "error";
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Tag config. Rendered as {@link Tag}.
|
|
208
|
+
*/
|
|
209
|
+
export type ImageWithDataTagTag = {
|
|
210
|
+
type: "tag";
|
|
211
|
+
label?: string;
|
|
212
|
+
text?: string;
|
|
213
|
+
shape?: "rectangle" | "pill";
|
|
214
|
+
state?: "default" | "secondary" | "disabled";
|
|
215
|
+
showLeadingIcon?: boolean;
|
|
216
|
+
onDismiss?: () => void;
|
|
217
|
+
};
|
|
218
|
+
export type ImageWithDataTagConfig = ImageWithDataPillTag | ImageWithDataBadgeTag | ImageWithDataTagTag;
|
|
219
|
+
export type ImageWithDataProps = {
|
|
220
|
+
/**
|
|
221
|
+
* React key / card identifier.
|
|
222
|
+
*/
|
|
223
|
+
id?: string;
|
|
224
|
+
/**
|
|
225
|
+
* Image source URL.
|
|
226
|
+
*/
|
|
227
|
+
url?: string;
|
|
228
|
+
/**
|
|
229
|
+
* Caption below the image.
|
|
230
|
+
*/
|
|
231
|
+
text?: string;
|
|
232
|
+
/**
|
|
233
|
+
* Caption placement. Default `'inside'`.
|
|
234
|
+
*/
|
|
235
|
+
textPosition?: "inside" | "outside";
|
|
236
|
+
/**
|
|
237
|
+
* Optional {@link Pill}, {@link Badge}, or {@link Tag}.
|
|
238
|
+
*/
|
|
239
|
+
tag?: ImageWithDataTagConfig;
|
|
240
|
+
/**
|
|
241
|
+
* Overlay control on the image.
|
|
242
|
+
*/
|
|
243
|
+
overlay?: "checkbox" | "close" | "icon";
|
|
244
|
+
/**
|
|
245
|
+
* Checked state when `overlay` is `'checkbox'`.
|
|
246
|
+
*/
|
|
247
|
+
isChecked?: boolean;
|
|
248
|
+
/**
|
|
249
|
+
* Checkbox overlay toggle handler.
|
|
250
|
+
*/
|
|
251
|
+
onChecked?: ImageWithDataCheckedHandler;
|
|
252
|
+
/**
|
|
253
|
+
* Image frame aspect ratio. Default `'1/1'`.
|
|
254
|
+
*/
|
|
255
|
+
aspectRatio?: "1/1" | "4/3" | "16/9" | "9/16";
|
|
256
|
+
/**
|
|
257
|
+
* Max caption lines. Default `'1'`.
|
|
258
|
+
*/
|
|
259
|
+
lines?: "1" | "2";
|
|
260
|
+
/**
|
|
261
|
+
* Metric shown beside the caption. Default `null`.
|
|
262
|
+
*/
|
|
263
|
+
number?: string | number | null;
|
|
264
|
+
/**
|
|
265
|
+
* Disables the whole card. Default `false`.
|
|
266
|
+
*/
|
|
267
|
+
disabled?: boolean;
|
|
268
|
+
/**
|
|
269
|
+
* Disables overlay controls only. Default `false`.
|
|
270
|
+
*/
|
|
271
|
+
disabledOverlay?: boolean;
|
|
272
|
+
/**
|
|
273
|
+
* Close overlay click handler.
|
|
274
|
+
*/
|
|
275
|
+
onClose?: ImageWithDataCloseHandler;
|
|
276
|
+
/**
|
|
277
|
+
* Icon for `overlay="icon"`.
|
|
278
|
+
*/
|
|
279
|
+
icon?: React.ReactNode;
|
|
280
|
+
/**
|
|
281
|
+
* Icon overlay click handler.
|
|
282
|
+
*/
|
|
283
|
+
onIconClick?: ImageWithDataIconClickHandler;
|
|
284
|
+
};
|
|
@@ -3,7 +3,7 @@ import { useState as z } from "react";
|
|
|
3
3
|
import n from "clsx";
|
|
4
4
|
import { Checkbox as F } from "../Checkbox/Checkbox.js";
|
|
5
5
|
import { tagPropsFromTag as R, badgePropsFromTag as _, pillPropsFromTag as j } from "../ImagePlaceholder/utilsImgPh.js";
|
|
6
|
-
import { ASPECT_RATIOS as
|
|
6
|
+
import { ASPECT_RATIOS as h, TAG_TYPES as b, OVERLAYS as B, TEXT_POSITIONS as x, LINES as D } from "../ImagePlaceholder/constantsImgPh.js";
|
|
7
7
|
import { ImageOffIcon as W } from "../icons-v2/ImageOffIcon.js";
|
|
8
8
|
import { XIcon as X } from "../icons-v2/XIcon.js";
|
|
9
9
|
import e from "./ImageWithData.module.scss.js";
|
|
@@ -12,7 +12,7 @@ import { EllipsisTooltip as Y } from "../EllipsisTooltip/EllipsisTooltip.js";
|
|
|
12
12
|
import { Tag as G } from "../Tag/Tag.js";
|
|
13
13
|
import { Badge as V } from "../Badge/Badge.js";
|
|
14
14
|
import { Pill as q } from "../Pill/Pill.js";
|
|
15
|
-
|
|
15
|
+
function ae({
|
|
16
16
|
id: T,
|
|
17
17
|
url: k,
|
|
18
18
|
text: s,
|
|
@@ -21,7 +21,7 @@ const ae = ({
|
|
|
21
21
|
overlay: i,
|
|
22
22
|
isChecked: v,
|
|
23
23
|
onChecked: d,
|
|
24
|
-
aspectRatio: I =
|
|
24
|
+
aspectRatio: I = h["1/1"],
|
|
25
25
|
lines: S = D[1],
|
|
26
26
|
number: p = null,
|
|
27
27
|
disabled: m = !1,
|
|
@@ -29,8 +29,8 @@ const ae = ({
|
|
|
29
29
|
onClose: E,
|
|
30
30
|
icon: g,
|
|
31
31
|
onIconClick: P
|
|
32
|
-
})
|
|
33
|
-
const [c, y] = z(!1),
|
|
32
|
+
}) {
|
|
33
|
+
const [c, y] = z(!1), u = () => {
|
|
34
34
|
switch (r == null ? void 0 : r.type) {
|
|
35
35
|
case "pill":
|
|
36
36
|
return /* @__PURE__ */ o(q, { ...j(r) });
|
|
@@ -41,7 +41,7 @@ const ae = ({
|
|
|
41
41
|
default:
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
|
-
},
|
|
44
|
+
}, f = !s || t === x.outside ? "8px" : "8px 8px 0 0", A = Number(S), O = n(e.contentText, e.contentTextClamped), w = { WebkitLineClamp: A }, l = C || m;
|
|
45
45
|
return /* @__PURE__ */ a("div", { className: n(e.imagePlaceholder, m && e.disabled), children: [
|
|
46
46
|
/* @__PURE__ */ a(
|
|
47
47
|
"div",
|
|
@@ -51,14 +51,14 @@ const ae = ({
|
|
|
51
51
|
i === "checkbox" && e.clickable,
|
|
52
52
|
i === "checkbox" && !c && e.checkboxSelectable
|
|
53
53
|
),
|
|
54
|
-
style: { borderRadius:
|
|
54
|
+
style: { borderRadius: f },
|
|
55
55
|
onClick: i === "checkbox" && !c && !m ? d : void 0,
|
|
56
56
|
children: [
|
|
57
57
|
/* @__PURE__ */ o(
|
|
58
58
|
"div",
|
|
59
59
|
{
|
|
60
60
|
className: e.imageFrame,
|
|
61
|
-
style: { aspectRatio:
|
|
61
|
+
style: { aspectRatio: h[I], borderRadius: f },
|
|
62
62
|
children: c ? /* @__PURE__ */ o("div", { className: e.imageError, children: /* @__PURE__ */ o(
|
|
63
63
|
W,
|
|
64
64
|
{
|
|
@@ -76,7 +76,7 @@ const ae = ({
|
|
|
76
76
|
)
|
|
77
77
|
}
|
|
78
78
|
),
|
|
79
|
-
!s && b.has(r == null ? void 0 : r.type) ? /* @__PURE__ */ o("div", { className: e.tagInImage, children:
|
|
79
|
+
!s && b.has(r == null ? void 0 : r.type) ? /* @__PURE__ */ o("div", { className: e.tagInImage, children: u() }) : null,
|
|
80
80
|
B.has(i) && /* @__PURE__ */ a("div", { className: e.overlay, onClick: (L) => L.stopPropagation(), children: [
|
|
81
81
|
i === "checkbox" && !c ? /* @__PURE__ */ o(
|
|
82
82
|
F,
|
|
@@ -114,7 +114,7 @@ const ae = ({
|
|
|
114
114
|
}
|
|
115
115
|
),
|
|
116
116
|
s ? /* @__PURE__ */ a("div", { className: n(e.belowImage, e[t]), children: [
|
|
117
|
-
b.has(r == null ? void 0 : r.type) ? /* @__PURE__ */ o("div", { children:
|
|
117
|
+
b.has(r == null ? void 0 : r.type) ? /* @__PURE__ */ o("div", { children: u() }) : null,
|
|
118
118
|
/* @__PURE__ */ a("div", { className: e.content, children: [
|
|
119
119
|
/* @__PURE__ */ o(
|
|
120
120
|
Y,
|
|
@@ -130,7 +130,7 @@ const ae = ({
|
|
|
130
130
|
] })
|
|
131
131
|
] }) : null
|
|
132
132
|
] }, T);
|
|
133
|
-
}
|
|
133
|
+
}
|
|
134
134
|
export {
|
|
135
135
|
ae as default
|
|
136
136
|
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All props are optional.
|
|
3
|
+
*
|
|
4
|
+
* @typedef {object} InfoboxProps
|
|
5
|
+
*
|
|
6
|
+
* @property {string} [title='']
|
|
7
|
+
* Heading text. Default `''`.
|
|
8
|
+
* @property {string} [text='']
|
|
9
|
+
* Body copy below the heading (or inline when no title). Default `''`.
|
|
10
|
+
* @property {'fill'|'outline'} [color='fill']
|
|
11
|
+
* Visual style. Default `'fill'`.
|
|
12
|
+
* @property {'success'|'error'|'primary'|'warning'} [status='success']
|
|
13
|
+
* Semantic status colour. Default `'success'`.
|
|
14
|
+
* @property {React.ReactNode} [icon=null]
|
|
15
|
+
* Optional custom leading icon. Default `null`.
|
|
16
|
+
* @property {boolean} [fullWidth=false]
|
|
17
|
+
* Stretch to parent width. Default `false`.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Informational block with semantic status colours.
|
|
21
|
+
*
|
|
22
|
+
* ## Props
|
|
23
|
+
*
|
|
24
|
+
* All optional.
|
|
25
|
+
*
|
|
26
|
+
* **title** `string` — default `''`
|
|
27
|
+
* Heading text.
|
|
28
|
+
*
|
|
29
|
+
* **text** `string` — default `''`
|
|
30
|
+
* Body copy below the heading (or inline when no title).
|
|
31
|
+
*
|
|
32
|
+
* **color** `'fill' | 'outline'` — default `'fill'`
|
|
33
|
+
* Visual style.
|
|
34
|
+
*
|
|
35
|
+
* **status** `'success' | 'error' | 'primary' | 'warning'` — default `'success'`
|
|
36
|
+
* Semantic status colour.
|
|
37
|
+
*
|
|
38
|
+
* **icon** `ReactNode` — default `null`
|
|
39
|
+
* Optional custom leading icon.
|
|
40
|
+
*
|
|
41
|
+
* **fullWidth** `boolean` — default `false`
|
|
42
|
+
* Stretch to parent width.
|
|
43
|
+
*
|
|
44
|
+
* @param {InfoboxProps} props
|
|
45
|
+
* @returns {import('react').ReactElement}
|
|
46
|
+
*
|
|
47
|
+
* @example <caption>Default</caption>
|
|
48
|
+
* import { Infobox } from '@eyesee/ui-components';
|
|
49
|
+
*
|
|
50
|
+
* <Infobox status="success" color="fill" />
|
|
51
|
+
*
|
|
52
|
+
* @example <caption>All variants</caption>
|
|
53
|
+
* import { Infobox } from '@eyesee/ui-components';
|
|
54
|
+
*
|
|
55
|
+
* <Infobox status="success" color="fill" />
|
|
56
|
+
* <Infobox status="success" color="outline" />
|
|
57
|
+
* <Infobox status="error" color="fill" />
|
|
58
|
+
* <Infobox status="primary" color="outline" />
|
|
59
|
+
* <Infobox status="warning" color="fill" />
|
|
60
|
+
*/
|
|
61
|
+
export function Infobox({ title, text, color, status, icon, fullWidth, }: InfoboxProps): import("react").ReactElement;
|
|
62
|
+
/**
|
|
63
|
+
* All props are optional.
|
|
64
|
+
*/
|
|
65
|
+
export type InfoboxProps = {
|
|
66
|
+
/**
|
|
67
|
+
* Heading text. Default `''`.
|
|
68
|
+
*/
|
|
69
|
+
title?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Body copy below the heading (or inline when no title). Default `''`.
|
|
72
|
+
*/
|
|
73
|
+
text?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Visual style. Default `'fill'`.
|
|
76
|
+
*/
|
|
77
|
+
color?: "fill" | "outline";
|
|
78
|
+
/**
|
|
79
|
+
* Semantic status colour. Default `'success'`.
|
|
80
|
+
*/
|
|
81
|
+
status?: "success" | "error" | "primary" | "warning";
|
|
82
|
+
/**
|
|
83
|
+
* Optional custom leading icon. Default `null`.
|
|
84
|
+
*/
|
|
85
|
+
icon?: React.ReactNode;
|
|
86
|
+
/**
|
|
87
|
+
* Stretch to parent width. Default `false`.
|
|
88
|
+
*/
|
|
89
|
+
fullWidth?: boolean;
|
|
90
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import x from "clsx";
|
|
3
|
-
import { getInfoboxStyles as p, INFOBOX_STATUSES as h, INFOBOX_COLORS as
|
|
3
|
+
import { getInfoboxStyles as p, INFOBOX_STATUSES as h, INFOBOX_COLORS as u } from "./infoboxVariants.js";
|
|
4
4
|
import s from "./Infobox.module.scss.js";
|
|
5
|
-
|
|
5
|
+
function y({
|
|
6
6
|
title: o = "",
|
|
7
7
|
text: t = "",
|
|
8
8
|
color: c = "fill",
|
|
9
9
|
status: i = "success",
|
|
10
10
|
icon: n = null,
|
|
11
11
|
fullWidth: r = !1
|
|
12
|
-
})
|
|
13
|
-
const f = h.includes(i) ? i : "success", m =
|
|
12
|
+
}) {
|
|
13
|
+
const f = h.includes(i) ? i : "success", m = u.includes(c) ? c : "fill", d = p(m, f), l = !!o;
|
|
14
14
|
return /* @__PURE__ */ a(
|
|
15
15
|
"div",
|
|
16
16
|
{
|
|
@@ -27,7 +27,7 @@ const y = ({
|
|
|
27
27
|
]
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
|
-
}
|
|
30
|
+
}
|
|
31
31
|
export {
|
|
32
32
|
y as Infobox
|
|
33
33
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {'fill'|'outline'} color
|
|
3
|
+
* @param {'success'|'error'|'primary'|'warning'} status
|
|
4
|
+
* @returns {Record<string, string>}
|
|
5
|
+
*/
|
|
6
|
+
export function getInfoboxStyles(color: "fill" | "outline", status: "success" | "error" | "primary" | "warning"): Record<string, string>;
|
|
7
|
+
export const INFOBOX_STATUSES: string[];
|
|
8
|
+
export const INFOBOX_COLORS: string[];
|