@eyesee/ui-components 0.7.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 +24 -24
- package/dist/components/EllipsisTooltip/EllipsisTooltip.module.scss.js +4 -6
- 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 +78 -76
- package/dist/components/ImagePlaceholder/ImagePlaceholder.module.scss.js +34 -32
- 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 +22 -21
- package/dist/components/Tooltip/Tooltip.module.scss.js +30 -28
- 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/dist/style.css +1 -1
- package/package.json +17 -4
|
@@ -3,23 +3,23 @@ import { useState as d } from "react";
|
|
|
3
3
|
import s from "./ExpandableItem.module.scss.js";
|
|
4
4
|
import { ChevronDownIcon as h } from "../icons-v2/ChevronDownIcon.js";
|
|
5
5
|
import { ChevronUpIcon as u } from "../icons-v2/ChevronUpIcon.js";
|
|
6
|
-
|
|
6
|
+
function j({
|
|
7
7
|
title: n,
|
|
8
8
|
children: r,
|
|
9
9
|
defaultOpen: a = !1,
|
|
10
10
|
arrowPositionEnd: m = !1
|
|
11
|
-
})
|
|
11
|
+
}) {
|
|
12
12
|
const [o, l] = d(a), c = (f) => {
|
|
13
13
|
l(f.target.open);
|
|
14
|
-
},
|
|
14
|
+
}, i = o ? u : h, p = m ? "space-between" : "flex-start";
|
|
15
15
|
return /* @__PURE__ */ t("details", { className: s.details, open: o, onToggle: c, children: [
|
|
16
|
-
/* @__PURE__ */ t("summary", { className: s.summary, style: { justifyContent:
|
|
16
|
+
/* @__PURE__ */ t("summary", { className: s.summary, style: { justifyContent: p }, children: [
|
|
17
17
|
/* @__PURE__ */ e("span", { className: s.summaryText, children: n }),
|
|
18
|
-
/* @__PURE__ */ e(
|
|
18
|
+
/* @__PURE__ */ e(i, {})
|
|
19
19
|
] }),
|
|
20
20
|
/* @__PURE__ */ e("section", { children: r })
|
|
21
21
|
] });
|
|
22
|
-
}
|
|
22
|
+
}
|
|
23
23
|
export {
|
|
24
24
|
j as ExpandableItem
|
|
25
25
|
};
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @callback InputFieldChangeHandler
|
|
3
|
+
* @param {import('react').ChangeEvent<HTMLInputElement>} event
|
|
4
|
+
* @returns {void}
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @callback InputFieldEnterHandler
|
|
8
|
+
* @returns {void}
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* @callback InputFieldFieldClickHandler
|
|
12
|
+
* @returns {void}
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* @callback InputFieldEndIconClickHandler
|
|
16
|
+
* @returns {void}
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* @callback InputFieldBlurHandler
|
|
20
|
+
* @param {import('react').FocusEvent<HTMLInputElement>} event
|
|
21
|
+
* @returns {void}
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* @typedef {object} InputFieldProps
|
|
25
|
+
*
|
|
26
|
+
* @property {string} [label]
|
|
27
|
+
* Field label.
|
|
28
|
+
* @property {string} [infoText]
|
|
29
|
+
* Helper or character-count text below the field. Overridden by `error.message`.
|
|
30
|
+
* @property {'default'|'error'} [status='default']
|
|
31
|
+
* Validation shell state. Default `'default'`.
|
|
32
|
+
* @property {boolean} [disabled=false]
|
|
33
|
+
* Disables the input. Default `false`.
|
|
34
|
+
* @property {boolean} [required=false]
|
|
35
|
+
* Shows required mark when `label` is set. Default `false`.
|
|
36
|
+
*
|
|
37
|
+
* @property {string} [id]
|
|
38
|
+
* Input `id`. Auto-generated when omitted.
|
|
39
|
+
* @property {string} [name]
|
|
40
|
+
* Input `name`; also RHF field name with `control`.
|
|
41
|
+
* @property {string} [type='text']
|
|
42
|
+
* Native input `type`. Default `'text'`.
|
|
43
|
+
* @property {string} [value]
|
|
44
|
+
* Controlled value.
|
|
45
|
+
* @property {string} [defaultValue]
|
|
46
|
+
* Uncontrolled initial value.
|
|
47
|
+
* @property {string} [placeholder='Text']
|
|
48
|
+
* Placeholder text. Default `'Text'`.
|
|
49
|
+
*
|
|
50
|
+
* @property {InputFieldChangeHandler} [onChange]
|
|
51
|
+
* Input change handler. Default `() => {}`.
|
|
52
|
+
* @property {InputFieldBlurHandler} [onBlur]
|
|
53
|
+
* Input blur handler.
|
|
54
|
+
*
|
|
55
|
+
* @property {'lg'|'md'|'sm'|'xs'} [size='lg']
|
|
56
|
+
* Field height. Default `'lg'`.
|
|
57
|
+
* @property {React.ReactNode} [startIcon]
|
|
58
|
+
* Leading icon inside the field.
|
|
59
|
+
* @property {React.ReactNode} [endIcon]
|
|
60
|
+
* Trailing icon inside the field.
|
|
61
|
+
* @property {InputFieldEndIconClickHandler} [onEndIconClick]
|
|
62
|
+
* Click handler for `endIcon`.
|
|
63
|
+
* @property {InputFieldEnterHandler} [onEnter]
|
|
64
|
+
* Fired on Enter when not disabled.
|
|
65
|
+
* @property {InputFieldFieldClickHandler} [onFieldClick]
|
|
66
|
+
* Click handler for the field shell (not the native input).
|
|
67
|
+
* @property {React.ReactNode} [content]
|
|
68
|
+
* Custom inline content; hides placeholder and uses a visually hidden input.
|
|
69
|
+
*
|
|
70
|
+
* @property {object} [control]
|
|
71
|
+
* react-hook-form `control`. With `name`, wires via `useController`.
|
|
72
|
+
* @property {object} [rules]
|
|
73
|
+
* RHF validation rules.
|
|
74
|
+
* @property {object} [error]
|
|
75
|
+
* RHF field error (`error.message` → info text and error status).
|
|
76
|
+
* @property {import('react').Ref} [inputRef]
|
|
77
|
+
* Ref forwarded to the native `<input>`.
|
|
78
|
+
*
|
|
79
|
+
* @property {string} [aria-label]
|
|
80
|
+
* Accessible name when `label` is omitted. Default `'input field'`.
|
|
81
|
+
*
|
|
82
|
+
* @see {@link InputFieldContainer}
|
|
83
|
+
*/
|
|
84
|
+
/**
|
|
85
|
+
* Inner input chrome used by {@link InputField} and {@link SelectField}.
|
|
86
|
+
*
|
|
87
|
+
* @param {InputFieldProps} props
|
|
88
|
+
* @returns {import('react').ReactElement}
|
|
89
|
+
*/
|
|
90
|
+
export function InputFieldContent({ id, name, type, value, defaultValue, placeholder, disabled, onChange, startIcon, endIcon, onEndIconClick, onEnter, onFieldClick, size, ariaLabel, label, inputProps, containerFieldClassName, content, }: InputFieldProps): import("react").ReactElement;
|
|
91
|
+
/**
|
|
92
|
+
* Single-line input with label, icons, and optional react-hook-form wiring.
|
|
93
|
+
*
|
|
94
|
+
* ## Props
|
|
95
|
+
*
|
|
96
|
+
* Rest props (e.g. `maxLength`, `autoComplete`) pass through to the native `<input>`.
|
|
97
|
+
*
|
|
98
|
+
* **label** `string` — no default
|
|
99
|
+
* Field label.
|
|
100
|
+
*
|
|
101
|
+
* **infoText** `string` — no default
|
|
102
|
+
* Helper or character-count text below the field. Overridden by `error.message`.
|
|
103
|
+
*
|
|
104
|
+
* **status** `'default' | 'error'` — default `'default'`
|
|
105
|
+
* Validation shell state.
|
|
106
|
+
*
|
|
107
|
+
* **disabled** `boolean` — default `false`
|
|
108
|
+
* Disables the input.
|
|
109
|
+
*
|
|
110
|
+
* **required** `boolean` — default `false`
|
|
111
|
+
* Shows required mark when `label` is set.
|
|
112
|
+
*
|
|
113
|
+
* **id** `string` — no default
|
|
114
|
+
* Input `id`. Auto-generated when omitted.
|
|
115
|
+
*
|
|
116
|
+
* **name** `string` — no default
|
|
117
|
+
* Input `name`. Also used as RHF field name with `control`.
|
|
118
|
+
*
|
|
119
|
+
* **type** `string` — default `'text'`
|
|
120
|
+
* Native input `type`.
|
|
121
|
+
*
|
|
122
|
+
* **value** `string` — no default
|
|
123
|
+
* Controlled value.
|
|
124
|
+
*
|
|
125
|
+
* **defaultValue** `string` — no default
|
|
126
|
+
* Uncontrolled initial value.
|
|
127
|
+
*
|
|
128
|
+
* **placeholder** `string` — default `'Text'`
|
|
129
|
+
* Placeholder text.
|
|
130
|
+
*
|
|
131
|
+
* **onChange** `(event: ChangeEvent<HTMLInputElement>) => void` — default `() => {}`
|
|
132
|
+
* Input change handler.
|
|
133
|
+
*
|
|
134
|
+
* **onBlur** `(event: FocusEvent<HTMLInputElement>) => void` — no default
|
|
135
|
+
* Input blur handler.
|
|
136
|
+
*
|
|
137
|
+
* **size** `'lg' | 'md' | 'sm' | 'xs'` — default `'lg'`
|
|
138
|
+
* Field height.
|
|
139
|
+
*
|
|
140
|
+
* **startIcon** `ReactNode` — no default
|
|
141
|
+
* Leading icon inside the field.
|
|
142
|
+
*
|
|
143
|
+
* **endIcon** `ReactNode` — no default
|
|
144
|
+
* Trailing icon inside the field.
|
|
145
|
+
*
|
|
146
|
+
* **onEndIconClick** `() => void` — no default
|
|
147
|
+
* Click handler for `endIcon`.
|
|
148
|
+
*
|
|
149
|
+
* **onEnter** `() => void` — no default
|
|
150
|
+
* Fired on Enter when not disabled.
|
|
151
|
+
*
|
|
152
|
+
* **onFieldClick** `() => void` — no default
|
|
153
|
+
* Click handler for the field shell.
|
|
154
|
+
*
|
|
155
|
+
* **content** `ReactNode` — default `null`
|
|
156
|
+
* Custom inline content; hides placeholder and uses a visually hidden input.
|
|
157
|
+
*
|
|
158
|
+
* **control** `object` — no default
|
|
159
|
+
* react-hook-form `control`. With `name`, wires via `useController`.
|
|
160
|
+
*
|
|
161
|
+
* **rules** `object` — no default
|
|
162
|
+
* RHF validation rules.
|
|
163
|
+
*
|
|
164
|
+
* **error** `object` — no default
|
|
165
|
+
* RHF field error (`error.message` → info text and error status).
|
|
166
|
+
*
|
|
167
|
+
* **inputRef** `Ref` — no default
|
|
168
|
+
* Ref forwarded to the native `<input>`.
|
|
169
|
+
*
|
|
170
|
+
* **aria-label** `string` — default `'input field'` when no `label`
|
|
171
|
+
* Accessible name when `label` is omitted.
|
|
172
|
+
*
|
|
173
|
+
* @param {InputFieldProps} props
|
|
174
|
+
* @returns {import('react').ReactElement}
|
|
175
|
+
*
|
|
176
|
+
* @example <caption>Playground</caption>
|
|
177
|
+
* import { InputField } from '@eyesee/ui-components';
|
|
178
|
+
* import { SearchIcon, CalendarIcon } from '@eyesee/ui-components/icons';
|
|
179
|
+
*
|
|
180
|
+
* <InputField
|
|
181
|
+
* label="Label"
|
|
182
|
+
* infoText="100/160"
|
|
183
|
+
* placeholder="Text"
|
|
184
|
+
* size="lg"
|
|
185
|
+
* startIcon={<SearchIcon iconSize="m" />}
|
|
186
|
+
* endIcon={<CalendarIcon iconSize="m" />}
|
|
187
|
+
* />
|
|
188
|
+
*
|
|
189
|
+
* @example <caption>In Context</caption>
|
|
190
|
+
* import { InputField } from '@eyesee/ui-components';
|
|
191
|
+
* import { SearchIcon, CalendarIcon } from '@eyesee/ui-components/icons';
|
|
192
|
+
*
|
|
193
|
+
* <InputField
|
|
194
|
+
* label="Project name"
|
|
195
|
+
* placeholder="e.g. Brand Lift Spring 2026"
|
|
196
|
+
* infoText="12/24"
|
|
197
|
+
* status="default"
|
|
198
|
+
* startIcon={<SearchIcon iconSize="m" />}
|
|
199
|
+
* endIcon={<CalendarIcon iconSize="m" />}
|
|
200
|
+
* />
|
|
201
|
+
*/
|
|
202
|
+
export function InputField(props: InputFieldProps): import("react").ReactElement;
|
|
203
|
+
export type InputFieldChangeHandler = (event: import("react").ChangeEvent<HTMLInputElement>) => void;
|
|
204
|
+
export type InputFieldEnterHandler = () => void;
|
|
205
|
+
export type InputFieldFieldClickHandler = () => void;
|
|
206
|
+
export type InputFieldEndIconClickHandler = () => void;
|
|
207
|
+
export type InputFieldBlurHandler = (event: import("react").FocusEvent<HTMLInputElement>) => void;
|
|
208
|
+
export type InputFieldProps = {
|
|
209
|
+
/**
|
|
210
|
+
* Field label.
|
|
211
|
+
*/
|
|
212
|
+
label?: string;
|
|
213
|
+
/**
|
|
214
|
+
* Helper or character-count text below the field. Overridden by `error.message`.
|
|
215
|
+
*/
|
|
216
|
+
infoText?: string;
|
|
217
|
+
/**
|
|
218
|
+
* Validation shell state. Default `'default'`.
|
|
219
|
+
*/
|
|
220
|
+
status?: "default" | "error";
|
|
221
|
+
/**
|
|
222
|
+
* Disables the input. Default `false`.
|
|
223
|
+
*/
|
|
224
|
+
disabled?: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Shows required mark when `label` is set. Default `false`.
|
|
227
|
+
*/
|
|
228
|
+
required?: boolean;
|
|
229
|
+
/**
|
|
230
|
+
* Input `id`. Auto-generated when omitted.
|
|
231
|
+
*/
|
|
232
|
+
id?: string;
|
|
233
|
+
/**
|
|
234
|
+
* Input `name`; also RHF field name with `control`.
|
|
235
|
+
*/
|
|
236
|
+
name?: string;
|
|
237
|
+
/**
|
|
238
|
+
* Native input `type`. Default `'text'`.
|
|
239
|
+
*/
|
|
240
|
+
type?: string;
|
|
241
|
+
/**
|
|
242
|
+
* Controlled value.
|
|
243
|
+
*/
|
|
244
|
+
value?: string;
|
|
245
|
+
/**
|
|
246
|
+
* Uncontrolled initial value.
|
|
247
|
+
*/
|
|
248
|
+
defaultValue?: string;
|
|
249
|
+
/**
|
|
250
|
+
* Placeholder text. Default `'Text'`.
|
|
251
|
+
*/
|
|
252
|
+
placeholder?: string;
|
|
253
|
+
/**
|
|
254
|
+
* Input change handler. Default `() => {}`.
|
|
255
|
+
*/
|
|
256
|
+
onChange?: InputFieldChangeHandler;
|
|
257
|
+
/**
|
|
258
|
+
* Input blur handler.
|
|
259
|
+
*/
|
|
260
|
+
onBlur?: InputFieldBlurHandler;
|
|
261
|
+
/**
|
|
262
|
+
* Field height. Default `'lg'`.
|
|
263
|
+
*/
|
|
264
|
+
size?: "lg" | "md" | "sm" | "xs";
|
|
265
|
+
/**
|
|
266
|
+
* Leading icon inside the field.
|
|
267
|
+
*/
|
|
268
|
+
startIcon?: React.ReactNode;
|
|
269
|
+
/**
|
|
270
|
+
* Trailing icon inside the field.
|
|
271
|
+
*/
|
|
272
|
+
endIcon?: React.ReactNode;
|
|
273
|
+
/**
|
|
274
|
+
* Click handler for `endIcon`.
|
|
275
|
+
*/
|
|
276
|
+
onEndIconClick?: InputFieldEndIconClickHandler;
|
|
277
|
+
/**
|
|
278
|
+
* Fired on Enter when not disabled.
|
|
279
|
+
*/
|
|
280
|
+
onEnter?: InputFieldEnterHandler;
|
|
281
|
+
/**
|
|
282
|
+
* Click handler for the field shell (not the native input).
|
|
283
|
+
*/
|
|
284
|
+
onFieldClick?: InputFieldFieldClickHandler;
|
|
285
|
+
/**
|
|
286
|
+
* Custom inline content; hides placeholder and uses a visually hidden input.
|
|
287
|
+
*/
|
|
288
|
+
content?: React.ReactNode;
|
|
289
|
+
/**
|
|
290
|
+
* react-hook-form `control`. With `name`, wires via `useController`.
|
|
291
|
+
*/
|
|
292
|
+
control?: object;
|
|
293
|
+
/**
|
|
294
|
+
* RHF validation rules.
|
|
295
|
+
*/
|
|
296
|
+
rules?: object;
|
|
297
|
+
/**
|
|
298
|
+
* RHF field error (`error.message` → info text and error status).
|
|
299
|
+
*/
|
|
300
|
+
error?: object;
|
|
301
|
+
/**
|
|
302
|
+
* Ref forwarded to the native `<input>`.
|
|
303
|
+
*/
|
|
304
|
+
inputRef?: any;
|
|
305
|
+
/**
|
|
306
|
+
* Accessible name when `label` is omitted. Default `'input field'`.
|
|
307
|
+
*/
|
|
308
|
+
"aria-label"?: string;
|
|
309
|
+
};
|
|
@@ -1,84 +1,89 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as o, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import s from "clsx";
|
|
3
3
|
import e from "./InputField.module.scss.js";
|
|
4
|
-
import { createField as
|
|
5
|
-
const
|
|
4
|
+
import { createField as V } from "../InputFieldContainer.js";
|
|
5
|
+
const Z = (
|
|
6
6
|
/** @type {const} */
|
|
7
7
|
["lg", "md", "sm", "xs"]
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
);
|
|
9
|
+
function b({
|
|
10
|
+
id: r,
|
|
11
|
+
name: N,
|
|
11
12
|
type: y = "text",
|
|
12
13
|
value: g,
|
|
13
14
|
defaultValue: D,
|
|
14
15
|
placeholder: w = "Text",
|
|
15
16
|
disabled: i = !1,
|
|
16
|
-
onChange:
|
|
17
|
+
onChange: F = () => {
|
|
17
18
|
},
|
|
18
|
-
startIcon:
|
|
19
|
-
endIcon:
|
|
20
|
-
onEndIconClick:
|
|
21
|
-
onEnter:
|
|
22
|
-
onFieldClick:
|
|
19
|
+
startIcon: c,
|
|
20
|
+
endIcon: d,
|
|
21
|
+
onEndIconClick: n,
|
|
22
|
+
onEnter: m,
|
|
23
|
+
onFieldClick: u,
|
|
23
24
|
size: f = "lg",
|
|
24
|
-
ariaLabel:
|
|
25
|
-
label:
|
|
25
|
+
ariaLabel: K,
|
|
26
|
+
label: S,
|
|
26
27
|
inputProps: l = {},
|
|
27
|
-
containerFieldClassName:
|
|
28
|
-
content:
|
|
29
|
-
})
|
|
30
|
-
const
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
},
|
|
28
|
+
containerFieldClassName: j,
|
|
29
|
+
content: v = null
|
|
30
|
+
}) {
|
|
31
|
+
const R = Z.includes(f) ? f : "lg", t = v != null, T = (a) => {
|
|
32
|
+
var x;
|
|
33
|
+
a.key === "Enter" && m && !i && (a.preventDefault(), m()), (x = l.onKeyDown) == null || x.call(l, a);
|
|
34
|
+
}, h = /* @__PURE__ */ o(
|
|
34
35
|
"input",
|
|
35
36
|
{
|
|
36
|
-
id:
|
|
37
|
-
name:
|
|
37
|
+
id: r,
|
|
38
|
+
name: N,
|
|
38
39
|
type: y,
|
|
39
|
-
value:
|
|
40
|
-
defaultValue:
|
|
41
|
-
placeholder:
|
|
40
|
+
value: t ? "" : g,
|
|
41
|
+
defaultValue: t ? void 0 : D,
|
|
42
|
+
placeholder: t ? void 0 : w,
|
|
42
43
|
disabled: i,
|
|
43
|
-
onChange:
|
|
44
|
-
"aria-label":
|
|
44
|
+
onChange: F,
|
|
45
|
+
"aria-label": K ?? (S ? void 0 : "input field"),
|
|
45
46
|
...l,
|
|
46
|
-
className:
|
|
47
|
-
onKeyDown:
|
|
47
|
+
className: s(t && e.hiddenInput, l.className),
|
|
48
|
+
onKeyDown: T
|
|
48
49
|
}
|
|
49
50
|
);
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ p(
|
|
51
52
|
"div",
|
|
52
53
|
{
|
|
53
|
-
className:
|
|
54
|
+
className: s(
|
|
54
55
|
e.field,
|
|
55
|
-
|
|
56
|
-
e[
|
|
57
|
-
|
|
56
|
+
j,
|
|
57
|
+
e[R],
|
|
58
|
+
u && e.clickable
|
|
58
59
|
),
|
|
59
|
-
onClick: i ? void 0 :
|
|
60
|
+
onClick: i ? void 0 : u,
|
|
60
61
|
children: [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
] }) :
|
|
66
|
-
|
|
62
|
+
c ? /* @__PURE__ */ o("span", { "data-field-icon": !0, className: s(e.icon), children: c }) : null,
|
|
63
|
+
t ? /* @__PURE__ */ p("div", { className: e.content, children: [
|
|
64
|
+
v,
|
|
65
|
+
h
|
|
66
|
+
] }) : h,
|
|
67
|
+
d ? /* @__PURE__ */ o(
|
|
67
68
|
"span",
|
|
68
69
|
{
|
|
69
70
|
"data-field-icon": !0,
|
|
70
|
-
className:
|
|
71
|
-
onClick: i ? void 0 : (
|
|
72
|
-
|
|
71
|
+
className: s(e.icon, n && e.clickable),
|
|
72
|
+
onClick: i ? void 0 : (a) => {
|
|
73
|
+
a.stopPropagation(), n == null || n();
|
|
73
74
|
},
|
|
74
|
-
children:
|
|
75
|
+
children: d
|
|
75
76
|
}
|
|
76
77
|
) : null
|
|
77
78
|
]
|
|
78
79
|
}
|
|
79
80
|
);
|
|
80
|
-
}
|
|
81
|
+
}
|
|
82
|
+
const q = V(b);
|
|
83
|
+
function H(r) {
|
|
84
|
+
return /* @__PURE__ */ o(q, { ...r });
|
|
85
|
+
}
|
|
81
86
|
export {
|
|
82
87
|
H as InputField,
|
|
83
|
-
|
|
88
|
+
b as InputFieldContent
|
|
84
89
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function InputFieldContainer({ id, label, isRequiredField, validationStatus, disabled, computedInfoText, children, }: {
|
|
2
|
+
id: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
isRequiredField?: boolean;
|
|
5
|
+
validationStatus?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
computedInfoText?: string;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export function createField(FieldContentComponent: any): (props: any) => import("react").JSX.Element;
|
|
11
|
+
export function withFieldContainer(FieldContentComponent: any): (props: any) => import("react").JSX.Element;
|