@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,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @callback CheckboxChangeHandler
|
|
3
|
+
* @param {import('react').ChangeEvent<HTMLInputElement>} event
|
|
4
|
+
* @returns {void}
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {object} CheckboxProps
|
|
8
|
+
*
|
|
9
|
+
* @property {boolean} [checked=false]
|
|
10
|
+
* Checked state. Default `false`.
|
|
11
|
+
* @property {boolean} [indeterminate=false]
|
|
12
|
+
* Minus icon when `checked`. Default `false`.
|
|
13
|
+
* @property {CheckboxChangeHandler} [onChange]
|
|
14
|
+
* Input change handler. Default `() => {}`.
|
|
15
|
+
* @property {boolean} [disabled=false]
|
|
16
|
+
* Native disabled. Default `false`.
|
|
17
|
+
* @property {'lg'|'md'} [size='md']
|
|
18
|
+
* `lg` → 20px (`m` token); `md` → 16px (`s`). Default `'md'`.
|
|
19
|
+
* @property {string} [id]
|
|
20
|
+
* Input id. Auto-generated when omitted.
|
|
21
|
+
* @property {string} [name]
|
|
22
|
+
* Input `name`.
|
|
23
|
+
* @property {string} [value]
|
|
24
|
+
* Input `value`.
|
|
25
|
+
* @property {string} [label]
|
|
26
|
+
* Label text after the box.
|
|
27
|
+
* @property {string} [aria-label]
|
|
28
|
+
* Accessible name when `label` is omitted. Falls back to `'checkbox'`.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Design-system checkbox. Icons render only when `checked` is true.
|
|
32
|
+
*
|
|
33
|
+
* ## Props
|
|
34
|
+
*
|
|
35
|
+
* **checked** `boolean` — default `false`
|
|
36
|
+
* Checked state.
|
|
37
|
+
*
|
|
38
|
+
* **indeterminate** `boolean` — default `false`
|
|
39
|
+
* Minus icon when `checked`.
|
|
40
|
+
*
|
|
41
|
+
* **onChange** `(event: ChangeEvent<HTMLInputElement>) => void` — default `() => {}`
|
|
42
|
+
* Input change handler.
|
|
43
|
+
*
|
|
44
|
+
* **disabled** `boolean` — default `false`
|
|
45
|
+
* Native disabled.
|
|
46
|
+
*
|
|
47
|
+
* **size** `'lg' | 'md'` — default `'md'`
|
|
48
|
+
* `lg` → 20px box (`m` token); `md` → 16px (`s`).
|
|
49
|
+
*
|
|
50
|
+
* **id** `string` — no default
|
|
51
|
+
* Input id. Auto-generated when omitted.
|
|
52
|
+
*
|
|
53
|
+
* **name** `string` — no default
|
|
54
|
+
* Input `name`.
|
|
55
|
+
*
|
|
56
|
+
* **value** `string` — no default
|
|
57
|
+
* Input `value`.
|
|
58
|
+
*
|
|
59
|
+
* **label** `string` — no default
|
|
60
|
+
* Label text after the box.
|
|
61
|
+
*
|
|
62
|
+
* **aria-label** `string` — no default
|
|
63
|
+
* Accessible name when `label` is omitted. Falls back to `'checkbox'`.
|
|
64
|
+
*
|
|
65
|
+
* @param {CheckboxProps} props
|
|
66
|
+
* @returns {import('react').ReactElement}
|
|
67
|
+
*
|
|
68
|
+
* @example <caption>Default</caption>
|
|
69
|
+
* import { Checkbox } from '@eyesee/ui-components';
|
|
70
|
+
*
|
|
71
|
+
* <Checkbox checked={false} size="md" aria-label="Example checkbox" />
|
|
72
|
+
*
|
|
73
|
+
* @example <caption>All states (matrix)</caption>
|
|
74
|
+
* import { Checkbox } from '@eyesee/ui-components';
|
|
75
|
+
*
|
|
76
|
+
* <Checkbox size="lg" checked={false} aria-label="Unselected" />
|
|
77
|
+
* <Checkbox size="lg" checked aria-label="Selected" />
|
|
78
|
+
* <Checkbox size="lg" checked indeterminate aria-label="Indeterminate" />
|
|
79
|
+
* <Checkbox size="md" checked disabled aria-label="Disabled selected" />
|
|
80
|
+
*/
|
|
81
|
+
export function Checkbox({ label, checked, indeterminate, onChange, disabled, size, id: idProp, name, value, "aria-label": ariaLabel, }: CheckboxProps): import("react").ReactElement;
|
|
82
|
+
export type CheckboxChangeHandler = (event: import("react").ChangeEvent<HTMLInputElement>) => void;
|
|
83
|
+
export type CheckboxProps = {
|
|
84
|
+
/**
|
|
85
|
+
* Checked state. Default `false`.
|
|
86
|
+
*/
|
|
87
|
+
checked?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Minus icon when `checked`. Default `false`.
|
|
90
|
+
*/
|
|
91
|
+
indeterminate?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Input change handler. Default `() => {}`.
|
|
94
|
+
*/
|
|
95
|
+
onChange?: CheckboxChangeHandler;
|
|
96
|
+
/**
|
|
97
|
+
* Native disabled. Default `false`.
|
|
98
|
+
*/
|
|
99
|
+
disabled?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* `lg` → 20px (`m` token); `md` → 16px (`s`). Default `'md'`.
|
|
102
|
+
*/
|
|
103
|
+
size?: "lg" | "md";
|
|
104
|
+
/**
|
|
105
|
+
* Input id. Auto-generated when omitted.
|
|
106
|
+
*/
|
|
107
|
+
id?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Input `name`.
|
|
110
|
+
*/
|
|
111
|
+
name?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Input `value`.
|
|
114
|
+
*/
|
|
115
|
+
value?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Label text after the box.
|
|
118
|
+
*/
|
|
119
|
+
label?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Accessible name when `label` is omitted. Falls back to `'checkbox'`.
|
|
122
|
+
*/
|
|
123
|
+
"aria-label"?: string;
|
|
124
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsxs as z, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useId as C } from "react";
|
|
3
|
-
import
|
|
3
|
+
import l from "clsx";
|
|
4
4
|
import { CheckmarkLargeIcon as I } from "../icons-v2/CheckmarkLargeIcon.js";
|
|
5
5
|
import { MinusIcon as y } from "../icons-v2/MinusIcon.js";
|
|
6
6
|
import { iconSizes as a } from "../icons-v2/constants.js";
|
|
7
7
|
import o from "./Checkbox.module.scss.js";
|
|
8
|
-
const N = (e) => e === "lg" ? "m" : "s"
|
|
8
|
+
const N = (e) => e === "lg" ? "m" : "s";
|
|
9
|
+
function W({
|
|
9
10
|
label: e,
|
|
10
11
|
checked: c = !1,
|
|
11
12
|
indeterminate: t = !1,
|
|
@@ -13,16 +14,16 @@ const N = (e) => e === "lg" ? "m" : "s", W = ({
|
|
|
13
14
|
},
|
|
14
15
|
disabled: i = !1,
|
|
15
16
|
size: p = "md",
|
|
16
|
-
id:
|
|
17
|
-
name:
|
|
18
|
-
value:
|
|
17
|
+
id: f,
|
|
18
|
+
name: x,
|
|
19
|
+
value: d,
|
|
19
20
|
"aria-label": h
|
|
20
|
-
})
|
|
21
|
-
const k = C(), b =
|
|
21
|
+
}) {
|
|
22
|
+
const k = C(), b = f ?? k, s = N(p), u = a[s] ?? a.m, n = "var(--color--icon--on-color--on-color)";
|
|
22
23
|
return /* @__PURE__ */ z(
|
|
23
24
|
"label",
|
|
24
25
|
{
|
|
25
|
-
className:
|
|
26
|
+
className: l(o.checkboxWrapper, i && o.disabled),
|
|
26
27
|
style: { "--checkbox-size": u },
|
|
27
28
|
children: [
|
|
28
29
|
/* @__PURE__ */ r(
|
|
@@ -30,8 +31,8 @@ const N = (e) => e === "lg" ? "m" : "s", W = ({
|
|
|
30
31
|
{
|
|
31
32
|
id: b,
|
|
32
33
|
type: "checkbox",
|
|
33
|
-
name:
|
|
34
|
-
value:
|
|
34
|
+
name: x,
|
|
35
|
+
value: d,
|
|
35
36
|
className: o.input,
|
|
36
37
|
checked: c,
|
|
37
38
|
disabled: i,
|
|
@@ -39,12 +40,12 @@ const N = (e) => e === "lg" ? "m" : "s", W = ({
|
|
|
39
40
|
onChange: m
|
|
40
41
|
}
|
|
41
42
|
),
|
|
42
|
-
/* @__PURE__ */ r("span", { className:
|
|
43
|
+
/* @__PURE__ */ r("span", { className: l(o.checkbox, c && o.filled), "aria-hidden": !0, children: c && (t ? /* @__PURE__ */ r(y, { iconSize: s, strokeColor: n }) : /* @__PURE__ */ r(I, { iconSize: s, strokeColor: n })) }),
|
|
43
44
|
e ? /* @__PURE__ */ r("span", { className: o.labelText, children: e }) : null
|
|
44
45
|
]
|
|
45
46
|
}
|
|
46
47
|
);
|
|
47
|
-
}
|
|
48
|
+
}
|
|
48
49
|
export {
|
|
49
50
|
W as Checkbox
|
|
50
51
|
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @callback DropdownListLoadMoreHandler
|
|
3
|
+
* @returns {void}
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {object} DropdownListProps
|
|
7
|
+
*
|
|
8
|
+
* @property {React.ReactNode} children
|
|
9
|
+
* Menu rows (typically {@link ListItem}).
|
|
10
|
+
* @property {'start'|'end'} [align='start']
|
|
11
|
+
* Horizontal alignment relative to the trigger. Default `'start'`.
|
|
12
|
+
* @property {string} [className]
|
|
13
|
+
* Extra class on the menu `<div>`.
|
|
14
|
+
* @property {'down'|'up'} [dir='down']
|
|
15
|
+
* Opens below or above the trigger. Default `'down'`.
|
|
16
|
+
* @property {string} [id]
|
|
17
|
+
* Id for `aria-controls` wiring.
|
|
18
|
+
* @property {React.RefObject} [listRef]
|
|
19
|
+
* Ref forwarded to the menu `<div>`.
|
|
20
|
+
* @property {string} [maxWidth='320px']
|
|
21
|
+
* Maximum list width. Default `'320px'`.
|
|
22
|
+
* @property {string} [maxHeight]
|
|
23
|
+
* Maximum list height (enables scroll).
|
|
24
|
+
* @property {DropdownListLoadMoreHandler} [onLoadMore]
|
|
25
|
+
* Called when scrolling near the list bottom.
|
|
26
|
+
* @property {object} [style]
|
|
27
|
+
* Inline styles merged onto the menu `<div>`.
|
|
28
|
+
*
|
|
29
|
+
* @see {@link ListItem}
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Floating menu container. Positioned absolutely relative to a positioned ancestor.
|
|
33
|
+
*
|
|
34
|
+
* ## Props
|
|
35
|
+
*
|
|
36
|
+
* **children** `ReactNode` — no default
|
|
37
|
+
* Menu rows (typically {@link ListItem}).
|
|
38
|
+
*
|
|
39
|
+
* **align** `'start' | 'end'` — default `'start'`
|
|
40
|
+
* Horizontal alignment relative to the trigger.
|
|
41
|
+
*
|
|
42
|
+
* **className** `string` — no default
|
|
43
|
+
* Extra class on the menu `<div>`.
|
|
44
|
+
*
|
|
45
|
+
* **dir** `'down' | 'up'` — default `'down'`
|
|
46
|
+
* Opens below or above the trigger.
|
|
47
|
+
*
|
|
48
|
+
* **id** `string` — no default
|
|
49
|
+
* Id for `aria-controls` wiring.
|
|
50
|
+
*
|
|
51
|
+
* **listRef** `RefObject` — no default
|
|
52
|
+
* Ref forwarded to the menu `<div>`.
|
|
53
|
+
*
|
|
54
|
+
* **maxWidth** `string` — default `'320px'`
|
|
55
|
+
* Maximum list width.
|
|
56
|
+
*
|
|
57
|
+
* **maxHeight** `string` — no default
|
|
58
|
+
* Maximum list height (enables scroll).
|
|
59
|
+
*
|
|
60
|
+
* **onLoadMore** `() => void` — no default
|
|
61
|
+
* Called when scrolling near the list bottom.
|
|
62
|
+
*
|
|
63
|
+
* **style** `object` — no default
|
|
64
|
+
* Inline styles merged onto the menu `<div>`.
|
|
65
|
+
*
|
|
66
|
+
* @param {DropdownListProps} props
|
|
67
|
+
* @returns {import('react').ReactElement}
|
|
68
|
+
*
|
|
69
|
+
* @example <caption>Default</caption>
|
|
70
|
+
* import { DropdownList } from '@eyesee/ui-components';
|
|
71
|
+
*
|
|
72
|
+
* <DropdownList>
|
|
73
|
+
* <li role="menuitem">Edit</li>
|
|
74
|
+
* <li role="menuitem">Duplicate</li>
|
|
75
|
+
* <li role="menuitem">Archive</li>
|
|
76
|
+
* <li role="menuitem">Delete</li>
|
|
77
|
+
* </DropdownList>
|
|
78
|
+
*
|
|
79
|
+
* @example <caption>Short list (2 items)</caption>
|
|
80
|
+
* import { DropdownList } from '@eyesee/ui-components';
|
|
81
|
+
*
|
|
82
|
+
* <DropdownList>
|
|
83
|
+
* <li role="menuitem">Rename</li>
|
|
84
|
+
* <li role="menuitem">Remove</li>
|
|
85
|
+
* </DropdownList>
|
|
86
|
+
*
|
|
87
|
+
* @example <caption>Long list (8 items)</caption>
|
|
88
|
+
* import { DropdownList } from '@eyesee/ui-components';
|
|
89
|
+
*
|
|
90
|
+
* <DropdownList>
|
|
91
|
+
* <li role="menuitem">Open</li>
|
|
92
|
+
* <li role="menuitem">Edit</li>
|
|
93
|
+
* <li role="menuitem">Duplicate</li>
|
|
94
|
+
* <li role="menuitem">Move to…</li>
|
|
95
|
+
* <li role="menuitem">Copy link</li>
|
|
96
|
+
* <li role="menuitem">Export</li>
|
|
97
|
+
* <li role="menuitem">Archive</li>
|
|
98
|
+
* <li role="menuitem">Delete</li>
|
|
99
|
+
* </DropdownList>
|
|
100
|
+
*
|
|
101
|
+
* @example <caption>Load more on scroll</caption>
|
|
102
|
+
* import { DropdownList } from '@eyesee/ui-components';
|
|
103
|
+
*
|
|
104
|
+
* <DropdownList maxHeight="220px" onLoadMore={() => {}}>
|
|
105
|
+
* {Array.from({ length: 20 }, (_, i) => (
|
|
106
|
+
* <li key={i} role="menuitem">Option {i + 1}</li>
|
|
107
|
+
* ))}
|
|
108
|
+
* </DropdownList>
|
|
109
|
+
*/
|
|
110
|
+
export function DropdownList({ children, align, className, dir, id, listRef, maxWidth, maxHeight, onLoadMore, style: styleProp, }: DropdownListProps): import("react").ReactElement;
|
|
111
|
+
export type DropdownListLoadMoreHandler = () => void;
|
|
112
|
+
export type DropdownListProps = {
|
|
113
|
+
/**
|
|
114
|
+
* Menu rows (typically {@link ListItem}).
|
|
115
|
+
*/
|
|
116
|
+
children: React.ReactNode;
|
|
117
|
+
/**
|
|
118
|
+
* Horizontal alignment relative to the trigger. Default `'start'`.
|
|
119
|
+
*/
|
|
120
|
+
align?: "start" | "end";
|
|
121
|
+
/**
|
|
122
|
+
* Extra class on the menu `<div>`.
|
|
123
|
+
*/
|
|
124
|
+
className?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Opens below or above the trigger. Default `'down'`.
|
|
127
|
+
*/
|
|
128
|
+
dir?: "down" | "up";
|
|
129
|
+
/**
|
|
130
|
+
* Id for `aria-controls` wiring.
|
|
131
|
+
*/
|
|
132
|
+
id?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Ref forwarded to the menu `<div>`.
|
|
135
|
+
*/
|
|
136
|
+
listRef?: import("react").RefObject<any>;
|
|
137
|
+
/**
|
|
138
|
+
* Maximum list width. Default `'320px'`.
|
|
139
|
+
*/
|
|
140
|
+
maxWidth?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Maximum list height (enables scroll).
|
|
143
|
+
*/
|
|
144
|
+
maxHeight?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Called when scrolling near the list bottom.
|
|
147
|
+
*/
|
|
148
|
+
onLoadMore?: DropdownListLoadMoreHandler;
|
|
149
|
+
/**
|
|
150
|
+
* Inline styles merged onto the menu `<div>`.
|
|
151
|
+
*/
|
|
152
|
+
style?: object;
|
|
153
|
+
};
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
2
|
import w from "clsx";
|
|
3
3
|
import r from "./DropdownList.module.scss.js";
|
|
4
|
-
|
|
4
|
+
function a({
|
|
5
5
|
children: e,
|
|
6
|
-
align:
|
|
7
|
-
className:
|
|
6
|
+
align: n = "start",
|
|
7
|
+
className: s,
|
|
8
8
|
dir: o = "down",
|
|
9
9
|
id: c,
|
|
10
|
-
listRef:
|
|
11
|
-
maxWidth:
|
|
10
|
+
listRef: i,
|
|
11
|
+
maxWidth: p = "320px",
|
|
12
12
|
maxHeight: m,
|
|
13
13
|
onLoadMore: t,
|
|
14
14
|
style: d
|
|
15
|
-
})
|
|
16
|
-
const f = (
|
|
17
|
-
const l =
|
|
15
|
+
}) {
|
|
16
|
+
const f = (u) => {
|
|
17
|
+
const l = u.currentTarget;
|
|
18
18
|
l.scrollHeight - l.scrollTop - l.clientHeight < 48 && (t == null || t());
|
|
19
19
|
};
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ g(
|
|
21
21
|
"div",
|
|
22
22
|
{
|
|
23
|
-
ref:
|
|
23
|
+
ref: i,
|
|
24
24
|
id: c,
|
|
25
25
|
className: w(
|
|
26
26
|
r.dropdown,
|
|
27
27
|
o === "up" && r.dropdownUp,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
n === "end" && r.alignEnd,
|
|
29
|
+
s
|
|
30
30
|
),
|
|
31
31
|
role: "menu",
|
|
32
|
-
style: { maxWidth:
|
|
32
|
+
style: { maxWidth: p, maxHeight: m, ...d },
|
|
33
33
|
onScroll: f,
|
|
34
34
|
children: e
|
|
35
35
|
}
|
|
36
36
|
);
|
|
37
|
-
}
|
|
37
|
+
}
|
|
38
38
|
export {
|
|
39
39
|
a as DropdownList
|
|
40
40
|
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns whether an element's content overflows its box.
|
|
3
|
+
*
|
|
4
|
+
* @param {HTMLElement|null} el
|
|
5
|
+
* @returns {boolean}
|
|
6
|
+
*/
|
|
7
|
+
export function isEllipsisActive(el: HTMLElement | null): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {object} EllipsisTooltipProps
|
|
10
|
+
*
|
|
11
|
+
* @property {React.ReactNode} children
|
|
12
|
+
* Content to measure; also used as tooltip body when truncated.
|
|
13
|
+
* @property {'top'|'bottom'|'left'|'right'} [position='top']
|
|
14
|
+
* Passed to {@link Tooltip}. Default `'top'`.
|
|
15
|
+
* @property {'dark'|'light'} [variant='light']
|
|
16
|
+
* Passed to {@link Tooltip}. Default `'light'`.
|
|
17
|
+
* @property {boolean} [showArrow=false]
|
|
18
|
+
* Passed to {@link Tooltip}. Default `false`.
|
|
19
|
+
* @property {string} [className]
|
|
20
|
+
* Extra class on the truncation wrapper `<div>`.
|
|
21
|
+
* @property {object} [wrapperStyle]
|
|
22
|
+
* Inline styles on the truncation wrapper `<div>`.
|
|
23
|
+
*
|
|
24
|
+
* @see {@link Tooltip}
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Wraps content and shows a {@link Tooltip} only when truncated.
|
|
28
|
+
*
|
|
29
|
+
* ## Props
|
|
30
|
+
*
|
|
31
|
+
* **children** `ReactNode` — no default
|
|
32
|
+
* Content to measure; also used as tooltip body when truncated.
|
|
33
|
+
*
|
|
34
|
+
* **position** `'top' | 'bottom' | 'left' | 'right'` — default `'top'`
|
|
35
|
+
* Passed to {@link Tooltip}.
|
|
36
|
+
*
|
|
37
|
+
* **variant** `'dark' | 'light'` — default `'light'`
|
|
38
|
+
* Passed to {@link Tooltip}.
|
|
39
|
+
*
|
|
40
|
+
* **showArrow** `boolean` — default `false`
|
|
41
|
+
* Passed to {@link Tooltip}.
|
|
42
|
+
*
|
|
43
|
+
* **className** `string` — no default
|
|
44
|
+
* Extra class on the truncation wrapper `<div>`.
|
|
45
|
+
*
|
|
46
|
+
* **wrapperStyle** `object` — no default
|
|
47
|
+
* Inline styles on the truncation wrapper `<div>`.
|
|
48
|
+
*
|
|
49
|
+
* @param {EllipsisTooltipProps} props
|
|
50
|
+
* @returns {import('react').ReactElement}
|
|
51
|
+
*
|
|
52
|
+
* @example <caption>Default</caption>
|
|
53
|
+
* import { EllipsisTooltip } from '@eyesee/ui-components';
|
|
54
|
+
*
|
|
55
|
+
* const longText =
|
|
56
|
+
* 'This is a very long label that should be truncated inside a narrow container and reveal the full text in a tooltip on hover.';
|
|
57
|
+
*
|
|
58
|
+
* <EllipsisTooltip>
|
|
59
|
+
* <p style={{ margin: 0, whiteSpace: 'nowrap' }}>{longText}</p>
|
|
60
|
+
* </EllipsisTooltip>
|
|
61
|
+
*
|
|
62
|
+
* @example <caption>Short text</caption>
|
|
63
|
+
* import { EllipsisTooltip } from '@eyesee/ui-components';
|
|
64
|
+
*
|
|
65
|
+
* <EllipsisTooltip>
|
|
66
|
+
* <p style={{ margin: 0, whiteSpace: 'nowrap' }}>Short label</p>
|
|
67
|
+
* </EllipsisTooltip>
|
|
68
|
+
*
|
|
69
|
+
* @example <caption>Multi line</caption>
|
|
70
|
+
* import { EllipsisTooltip } from '@eyesee/ui-components';
|
|
71
|
+
*
|
|
72
|
+
* const longText =
|
|
73
|
+
* 'This is a very long label that should be truncated inside a narrow container and reveal the full text in a tooltip on hover.';
|
|
74
|
+
*
|
|
75
|
+
* <EllipsisTooltip>
|
|
76
|
+
* <p
|
|
77
|
+
* style={{
|
|
78
|
+
* margin: 0,
|
|
79
|
+
* display: '-webkit-box',
|
|
80
|
+
* WebkitBoxOrient: 'vertical',
|
|
81
|
+
* WebkitLineClamp: 2,
|
|
82
|
+
* }}
|
|
83
|
+
* >
|
|
84
|
+
* {longText}
|
|
85
|
+
* </p>
|
|
86
|
+
* </EllipsisTooltip>
|
|
87
|
+
*/
|
|
88
|
+
export function EllipsisTooltip({ children, position, variant, showArrow, className, wrapperStyle, }: EllipsisTooltipProps): import("react").ReactElement;
|
|
89
|
+
export type EllipsisTooltipProps = {
|
|
90
|
+
/**
|
|
91
|
+
* Content to measure; also used as tooltip body when truncated.
|
|
92
|
+
*/
|
|
93
|
+
children: React.ReactNode;
|
|
94
|
+
/**
|
|
95
|
+
* Passed to {@link Tooltip}. Default `'top'`.
|
|
96
|
+
*/
|
|
97
|
+
position?: "top" | "bottom" | "left" | "right";
|
|
98
|
+
/**
|
|
99
|
+
* Passed to {@link Tooltip}. Default `'light'`.
|
|
100
|
+
*/
|
|
101
|
+
variant?: "dark" | "light";
|
|
102
|
+
/**
|
|
103
|
+
* Passed to {@link Tooltip}. Default `false`.
|
|
104
|
+
*/
|
|
105
|
+
showArrow?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Extra class on the truncation wrapper `<div>`.
|
|
108
|
+
*/
|
|
109
|
+
className?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Inline styles on the truncation wrapper `<div>`.
|
|
112
|
+
*/
|
|
113
|
+
wrapperStyle?: object;
|
|
114
|
+
};
|
|
@@ -6,14 +6,14 @@ import k from "./EllipsisTooltip.module.scss.js";
|
|
|
6
6
|
function v(t) {
|
|
7
7
|
return t ? t.scrollWidth > t.clientWidth || t.scrollHeight > t.clientHeight : !1;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
function j({
|
|
10
10
|
children: t,
|
|
11
11
|
position: c = "top",
|
|
12
12
|
variant: f = "light",
|
|
13
13
|
showArrow: n = !1,
|
|
14
14
|
className: u,
|
|
15
15
|
wrapperStyle: s
|
|
16
|
-
})
|
|
16
|
+
}) {
|
|
17
17
|
const i = a(null), [p, m] = E(!1), o = h(() => {
|
|
18
18
|
const l = i.current;
|
|
19
19
|
m(!!l && !!t && v(l));
|
|
@@ -33,7 +33,7 @@ const j = ({
|
|
|
33
33
|
children: e
|
|
34
34
|
}
|
|
35
35
|
);
|
|
36
|
-
}
|
|
36
|
+
}
|
|
37
37
|
export {
|
|
38
38
|
j as EllipsisTooltip,
|
|
39
39
|
v as isEllipsisActive
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {object} ExpandableItemProps
|
|
3
|
+
*
|
|
4
|
+
* @property {string} title
|
|
5
|
+
* Header text shown in the summary bar.
|
|
6
|
+
* @property {React.ReactNode} children
|
|
7
|
+
* Content revealed when expanded.
|
|
8
|
+
* @property {boolean} [defaultOpen=false]
|
|
9
|
+
* Start expanded on first mount. Default `false`.
|
|
10
|
+
* @property {boolean} [arrowPositionEnd=false]
|
|
11
|
+
* Place chevron at the end of the summary row. Default `false`.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Accordion section on native `<details>`/`<summary>`.
|
|
15
|
+
*
|
|
16
|
+
* ## Props
|
|
17
|
+
*
|
|
18
|
+
* **title** `string` — no default
|
|
19
|
+
* Header text shown in the summary bar.
|
|
20
|
+
*
|
|
21
|
+
* **children** `ReactNode` — no default
|
|
22
|
+
* Content revealed when expanded.
|
|
23
|
+
*
|
|
24
|
+
* **defaultOpen** `boolean` — default `false`
|
|
25
|
+
* Start expanded on first mount.
|
|
26
|
+
*
|
|
27
|
+
* **arrowPositionEnd** `boolean` — default `false`
|
|
28
|
+
* Place chevron at the end of the summary row.
|
|
29
|
+
*
|
|
30
|
+
* @param {ExpandableItemProps} props
|
|
31
|
+
* @returns {import('react').ReactElement}
|
|
32
|
+
*
|
|
33
|
+
* @example <caption>Default (closed)</caption>
|
|
34
|
+
* import { ExpandableItem } from '@eyesee/ui-components';
|
|
35
|
+
*
|
|
36
|
+
* <ExpandableItem title="Section title" defaultOpen={false}>
|
|
37
|
+
* <p>This is the body content revealed when the item is expanded.</p>
|
|
38
|
+
* </ExpandableItem>
|
|
39
|
+
*
|
|
40
|
+
* @example <caption>Default Open</caption>
|
|
41
|
+
* import { ExpandableItem } from '@eyesee/ui-components';
|
|
42
|
+
*
|
|
43
|
+
* <ExpandableItem title="Section title" defaultOpen>
|
|
44
|
+
* <p>Content is visible on load because defaultOpen is true.</p>
|
|
45
|
+
* </ExpandableItem>
|
|
46
|
+
*
|
|
47
|
+
* @example <caption>Rich Content</caption>
|
|
48
|
+
* import { ExpandableItem } from '@eyesee/ui-components';
|
|
49
|
+
*
|
|
50
|
+
* <ExpandableItem title="Filter options" defaultOpen>
|
|
51
|
+
* <ul>
|
|
52
|
+
* <li>Option A</li>
|
|
53
|
+
* <li>Option B</li>
|
|
54
|
+
* <li>Option C</li>
|
|
55
|
+
* </ul>
|
|
56
|
+
* </ExpandableItem>
|
|
57
|
+
*
|
|
58
|
+
* @example <caption>Multiple Stacked</caption>
|
|
59
|
+
* import { ExpandableItem } from '@eyesee/ui-components';
|
|
60
|
+
*
|
|
61
|
+
* <ExpandableItem title="General settings" defaultOpen>
|
|
62
|
+
* <p>General settings content goes here.</p>
|
|
63
|
+
* </ExpandableItem>
|
|
64
|
+
* <ExpandableItem title="Advanced options">
|
|
65
|
+
* <p>Advanced options content goes here.</p>
|
|
66
|
+
* </ExpandableItem>
|
|
67
|
+
* <ExpandableItem title="Permissions">
|
|
68
|
+
* <p>Permissions content goes here.</p>
|
|
69
|
+
* </ExpandableItem>
|
|
70
|
+
*/
|
|
71
|
+
export function ExpandableItem({ title, children, defaultOpen, arrowPositionEnd, }: ExpandableItemProps): import("react").ReactElement;
|
|
72
|
+
export type ExpandableItemProps = {
|
|
73
|
+
/**
|
|
74
|
+
* Header text shown in the summary bar.
|
|
75
|
+
*/
|
|
76
|
+
title: string;
|
|
77
|
+
/**
|
|
78
|
+
* Content revealed when expanded.
|
|
79
|
+
*/
|
|
80
|
+
children: React.ReactNode;
|
|
81
|
+
/**
|
|
82
|
+
* Start expanded on first mount. Default `false`.
|
|
83
|
+
*/
|
|
84
|
+
defaultOpen?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Place chevron at the end of the summary row. Default `false`.
|
|
87
|
+
*/
|
|
88
|
+
arrowPositionEnd?: boolean;
|
|
89
|
+
};
|
|
@@ -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
|
};
|