@ntbjs/react-components 2.0.13 → 3.0.0-rc.1
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/build/data/Alert/Alert.js +18 -33
- package/build/data/Alert/Alert.js.map +1 -1
- package/build/data/Alert/Alert.styled.js +9 -47
- package/build/data/Alert/Alert.styled.js.map +1 -1
- package/build/data/Badge/Badge.js +36 -61
- package/build/data/Badge/Badge.js.map +1 -1
- package/build/data/Badge/Badge.styled.js +21 -70
- package/build/data/Badge/Badge.styled.js.map +1 -1
- package/build/data/Popover/Popover.js +125 -71
- package/build/data/Popover/Popover.js.map +1 -1
- package/build/data/Popover/Popover.styled.js +10 -140
- package/build/data/Popover/Popover.styled.js.map +1 -1
- package/build/data/SeverityBadge/SeverityBadge.js +13 -22
- package/build/data/SeverityBadge/SeverityBadge.js.map +1 -1
- package/build/data/SeverityBadge/index.js +2 -0
- package/build/data/SeverityBadge/index.js.map +1 -0
- package/build/data/Tab/Tab.js +7 -13
- package/build/data/Tab/Tab.js.map +1 -1
- package/build/data/Tab/Tab.styled.js +4 -7
- package/build/data/Tab/Tab.styled.js.map +1 -1
- package/build/data/Tabs/Tabs.js +30 -32
- package/build/data/Tabs/Tabs.js.map +1 -1
- package/build/data/Tabs/Tabs.styled.js +21 -57
- package/build/data/Tabs/Tabs.styled.js.map +1 -1
- package/build/data/Tooltip/Tooltip.js +102 -33
- package/build/data/Tooltip/Tooltip.js.map +1 -1
- package/build/data/Tooltip/Tooltip.styled.js +9 -22
- package/build/data/Tooltip/Tooltip.styled.js.map +1 -1
- package/build/data/VerificationStatusIcon/VerificationStatusIcon.js +16 -23
- package/build/data/VerificationStatusIcon/VerificationStatusIcon.js.map +1 -1
- package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js +13 -31
- package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js.map +1 -1
- package/build/data/VerificationStatusIcon/index.js +2 -0
- package/build/data/VerificationStatusIcon/index.js.map +1 -0
- package/build/data/_shared/FloatingArrow.styled.js +30 -0
- package/build/data/_shared/FloatingArrow.styled.js.map +1 -0
- package/build/hooks/useEventListner.js.map +1 -1
- package/build/hooks/useFloatingPopover.js +187 -0
- package/build/hooks/useFloatingPopover.js.map +1 -0
- package/build/hooks/useIsomorphicLayoutEffect.js.map +1 -1
- package/build/hooks/useOnClickOutside.js.map +1 -1
- package/build/hooks/useTooltipAutoShow.js.map +1 -1
- package/build/icons/arrow-back.svg.js +3 -3
- package/build/icons/arrow-back.svg.js.map +1 -1
- package/build/icons/arrow-forward.svg.js +4 -4
- package/build/icons/arrow-forward.svg.js.map +1 -1
- package/build/icons/check-rectangle-filled.svg.js +3 -3
- package/build/icons/check-rectangle-filled.svg.js.map +1 -1
- package/build/icons/close.svg.js +3 -3
- package/build/icons/close.svg.js.map +1 -1
- package/build/icons/edit-note.svg.js +3 -3
- package/build/icons/edit-note.svg.js.map +1 -1
- package/build/icons/expand-more.svg.js +3 -3
- package/build/icons/expand-more.svg.js.map +1 -1
- package/build/icons/headset.svg.js +3 -3
- package/build/icons/headset.svg.js.map +1 -1
- package/build/icons/layers.svg.js +3 -3
- package/build/icons/layers.svg.js.map +1 -1
- package/build/icons/link.svg.js +3 -3
- package/build/icons/link.svg.js.map +1 -1
- package/build/icons/play.svg.js +3 -3
- package/build/icons/play.svg.js.map +1 -1
- package/build/icons/search.svg.js +3 -3
- package/build/icons/search.svg.js.map +1 -1
- package/build/icons/star-filled.svg.js +3 -3
- package/build/icons/star-filled.svg.js.map +1 -1
- package/build/icons/star.svg.js +3 -3
- package/build/icons/star.svg.js.map +1 -1
- package/build/icons/triangle-right.svg.js +3 -3
- package/build/icons/triangle-right.svg.js.map +1 -1
- package/build/icons/verification.svg.js +3 -3
- package/build/icons/verification.svg.js.map +1 -1
- package/build/icons/warning-circle.svg.js +3 -3
- package/build/icons/warning-circle.svg.js.map +1 -1
- package/build/inputs/ActionButton/ActionButton.js +11 -22
- package/build/inputs/ActionButton/ActionButton.js.map +1 -1
- package/build/inputs/ActionButton/ActionButton.styled.js +5 -54
- package/build/inputs/ActionButton/ActionButton.styled.js.map +1 -1
- package/build/inputs/Button/Button.js +125 -121
- package/build/inputs/Button/Button.js.map +1 -1
- package/build/inputs/Button/Button.styled.js +42 -260
- package/build/inputs/Button/Button.styled.js.map +1 -1
- package/build/inputs/Checkbox/Checkbox.js +45 -61
- package/build/inputs/Checkbox/Checkbox.js.map +1 -1
- package/build/inputs/Checkbox/Checkbox.styled.js +24 -153
- package/build/inputs/Checkbox/Checkbox.styled.js.map +1 -1
- package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js +106 -111
- package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js.map +1 -1
- package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js +88 -273
- package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js.map +1 -1
- package/build/inputs/CompactStarRating/CompactStarRating.js +56 -77
- package/build/inputs/CompactStarRating/CompactStarRating.js.map +1 -1
- package/build/inputs/CompactStarRating/CompactStarRating.styled.js +32 -211
- package/build/inputs/CompactStarRating/CompactStarRating.styled.js.map +1 -1
- package/build/inputs/CompactTextInput/CompactTextInput.js +86 -105
- package/build/inputs/CompactTextInput/CompactTextInput.js.map +1 -1
- package/build/inputs/CompactTextInput/CompactTextInput.styled.js +55 -258
- package/build/inputs/CompactTextInput/CompactTextInput.styled.js.map +1 -1
- package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js +70 -77
- package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js.map +1 -1
- package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js +28 -60
- package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js.map +1 -1
- package/build/inputs/MultiLevelCheckbox/types.js +12 -12
- package/build/inputs/MultiLevelCheckbox/types.js.map +1 -1
- package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js +69 -73
- package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js.map +1 -1
- package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js +44 -87
- package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js.map +1 -1
- package/build/inputs/MultiSelect/MultiSelect.js +69 -79
- package/build/inputs/MultiSelect/MultiSelect.js.map +1 -1
- package/build/inputs/MultiSelect/MultiSelect.styled.js +70 -76
- package/build/inputs/MultiSelect/MultiSelect.styled.js.map +1 -1
- package/build/inputs/Radio/Radio.js +20 -33
- package/build/inputs/Radio/Radio.js.map +1 -1
- package/build/inputs/Radio/Radio.styled.js +15 -96
- package/build/inputs/Radio/Radio.styled.js.map +1 -1
- package/build/inputs/Switch/Switch.js +28 -40
- package/build/inputs/Switch/Switch.js.map +1 -1
- package/build/inputs/Switch/Switch.styled.js +24 -94
- package/build/inputs/Switch/Switch.styled.js.map +1 -1
- package/build/inputs/TextArea/TextArea.js +98 -123
- package/build/inputs/TextArea/TextArea.js.map +1 -1
- package/build/inputs/TextArea/TextArea.styled.js +64 -379
- package/build/inputs/TextArea/TextArea.styled.js.map +1 -1
- package/build/inputs/TextInput/TextInput.js +59 -79
- package/build/inputs/TextInput/TextInput.js.map +1 -1
- package/build/inputs/TextInput/TextInput.styled.js +33 -224
- package/build/inputs/TextInput/TextInput.styled.js.map +1 -1
- package/build/layout/InputGroup/InputGroup.js +6 -9
- package/build/layout/InputGroup/InputGroup.js.map +1 -1
- package/build/layout/InputGroup/InputGroup.styled.js +4 -3
- package/build/layout/InputGroup/InputGroup.styled.js.map +1 -1
- package/build/layout/InputGroup/index.js +2 -0
- package/build/layout/InputGroup/index.js.map +1 -0
- package/build/layout/SectionSeparator/SectionSeparator.js +5 -9
- package/build/layout/SectionSeparator/SectionSeparator.js.map +1 -1
- package/build/layout/SectionSeparator/SectionSeparator.styled.js +4 -8
- package/build/layout/SectionSeparator/SectionSeparator.styled.js.map +1 -1
- package/build/styles/utils/colors-export.d.ts +73 -0
- package/build/styles/utils/colors-export.js.map +1 -1
- package/build/utils/dateTime.js.map +1 -1
- package/build/utils/defaultTheme.js +14 -28
- package/build/utils/defaultTheme.js.map +1 -1
- package/build/utils/getElementRef.js +14 -0
- package/build/utils/getElementRef.js.map +1 -0
- package/build/utils/parseTrigger.js +16 -0
- package/build/utils/parseTrigger.js.map +1 -0
- package/build/widgets/AssetAction/AssetAction.js +26 -33
- package/build/widgets/AssetAction/AssetAction.js.map +1 -1
- package/build/widgets/AssetAction/AssetAction.styled.js +20 -34
- package/build/widgets/AssetAction/AssetAction.styled.js.map +1 -1
- package/build/widgets/AssetActionsBase/AssetActionsBase.js +8 -13
- package/build/widgets/AssetActionsBase/AssetActionsBase.js.map +1 -1
- package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js +4 -9
- package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGallery.js +15 -40
- package/build/widgets/AssetGallery/AssetGallery.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js +55 -70
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js +12 -24
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js +146 -120
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +99 -285
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js +170 -125
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js +135 -364
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js.map +1 -1
- package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js +20 -21
- package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js.map +1 -1
- package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js +20 -71
- package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js.map +1 -1
- package/build/widgets/ContextMenu/ContextMenu.js +12 -11
- package/build/widgets/ContextMenu/ContextMenu.js.map +1 -1
- package/build/widgets/ContextMenu/ContextMenu.styled.js +4 -4
- package/build/widgets/ContextMenu/ContextMenu.styled.js.map +1 -1
- package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js +17 -25
- package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js.map +1 -1
- package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js +16 -71
- package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js.map +1 -1
- package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js +7 -11
- package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js.map +1 -1
- package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js +4 -11
- package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js.map +1 -1
- package/build/widgets/InfoCard/InfoCard.js +26 -21
- package/build/widgets/InfoCard/InfoCard.js.map +1 -1
- package/build/widgets/InfoCard/InfoCard.styled.js +36 -84
- package/build/widgets/InfoCard/InfoCard.styled.js.map +1 -1
- package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js +28 -34
- package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js.map +1 -1
- package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js +21 -57
- package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js.map +1 -1
- package/build/widgets/InstructionSeverityDisplay/index.js +2 -0
- package/build/widgets/InstructionSeverityDisplay/index.js.map +1 -0
- package/build/widgets/Instructions/Instructions.js +53 -95
- package/build/widgets/Instructions/Instructions.js.map +1 -1
- package/build/widgets/Instructions/Instructions.styled.js +27 -26
- package/build/widgets/Instructions/Instructions.styled.js.map +1 -1
- package/build/widgets/ProgressBar/ProgressBar.js +39 -37
- package/build/widgets/ProgressBar/ProgressBar.js.map +1 -1
- package/build/widgets/ProgressBar/ProgressBar.styled.js +56 -125
- package/build/widgets/ProgressBar/ProgressBar.styled.js.map +1 -1
- package/build/widgets/SummaryCard/SummaryCard.js +55 -64
- package/build/widgets/SummaryCard/SummaryCard.js.map +1 -1
- package/build/widgets/SummaryCard/SummaryCard.styled.js +51 -106
- package/build/widgets/SummaryCard/SummaryCard.styled.js.map +1 -1
- package/package.json +77 -36
- package/styles/utils/colors-export.d.ts +73 -0
- package/types/components/data/Alert/Alert.d.ts +76 -0
- package/types/components/data/Alert/Alert.styled.d.ts +83 -0
- package/types/components/data/Alert/index.d.ts +1 -0
- package/types/components/data/Badge/Badge.d.ts +128 -0
- package/types/components/data/Badge/Badge.styled.d.ts +132 -0
- package/types/components/data/Badge/index.d.ts +1 -0
- package/types/components/data/Popover/Popover.d.ts +205 -0
- package/types/components/data/Popover/Popover.styled.d.ts +15 -0
- package/types/components/data/Popover/index.d.ts +1 -0
- package/types/components/data/SeverityBadge/SeverityBadge.d.ts +72 -0
- package/types/components/data/SeverityBadge/index.d.ts +1 -0
- package/types/components/data/Tab/Tab.d.ts +27 -0
- package/types/components/data/Tab/Tab.styled.d.ts +1 -0
- package/types/components/data/Tab/index.d.ts +1 -0
- package/types/components/data/Tabs/Tabs.d.ts +111 -0
- package/types/components/data/Tabs/Tabs.styled.d.ts +42 -0
- package/types/components/data/Tabs/index.d.ts +1 -0
- package/types/components/data/Tooltip/Tooltip.d.ts +134 -0
- package/types/components/data/Tooltip/Tooltip.styled.d.ts +8 -0
- package/types/components/data/Tooltip/index.d.ts +1 -0
- package/types/components/data/VerificationStatusIcon/VerificationStatusIcon.d.ts +35 -0
- package/types/components/data/VerificationStatusIcon/VerificationStatusIcon.styled.d.ts +46 -0
- package/types/components/data/VerificationStatusIcon/index.d.ts +1 -0
- package/types/components/data/_shared/FloatingArrow.styled.d.ts +129 -0
- package/types/components/data/index.d.ts +8 -0
- package/types/components/index.d.ts +3 -0
- package/types/components/inputs/ActionButton/ActionButton.d.ts +55 -0
- package/types/components/inputs/ActionButton/ActionButton.styled.d.ts +34 -0
- package/types/components/inputs/ActionButton/index.d.ts +1 -0
- package/types/components/inputs/Button/Button.d.ts +82 -0
- package/types/components/inputs/Button/Button.styled.d.ts +102 -0
- package/types/components/inputs/Button/index.d.ts +1 -0
- package/types/components/inputs/Checkbox/Checkbox.d.ts +92 -0
- package/types/components/inputs/Checkbox/Checkbox.styled.d.ts +33 -0
- package/types/components/inputs/Checkbox/index.d.ts +1 -0
- package/types/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.d.ts +242 -0
- package/types/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.d.ts +157 -0
- package/types/components/inputs/CompactAutocompleteSelect/index.d.ts +1 -0
- package/types/components/inputs/CompactStarRating/CompactStarRating.d.ts +96 -0
- package/types/components/inputs/CompactStarRating/CompactStarRating.styled.d.ts +86 -0
- package/types/components/inputs/CompactStarRating/index.d.ts +1 -0
- package/types/components/inputs/CompactTextInput/CompactTextInput.d.ts +116 -0
- package/types/components/inputs/CompactTextInput/CompactTextInput.styled.d.ts +70 -0
- package/types/components/inputs/CompactTextInput/index.d.ts +1 -0
- package/types/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.d.ts +41 -0
- package/types/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.d.ts +21 -0
- package/types/components/inputs/MultiLevelCheckbox/index.d.ts +2 -0
- package/types/components/inputs/MultiLevelCheckbox/types.d.ts +72 -0
- package/types/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.d.ts +44 -0
- package/types/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.d.ts +11 -0
- package/types/components/inputs/MultiLevelCheckboxSelect/index.d.ts +1 -0
- package/types/components/inputs/MultiSelect/MultiSelect.d.ts +172 -0
- package/types/components/inputs/MultiSelect/MultiSelect.styled.d.ts +99 -0
- package/types/components/inputs/MultiSelect/index.d.ts +1 -0
- package/types/components/inputs/Radio/Radio.d.ts +65 -0
- package/types/components/inputs/Radio/Radio.styled.d.ts +11 -0
- package/types/components/inputs/Radio/index.d.ts +1 -0
- package/types/components/inputs/Switch/Switch.d.ts +62 -0
- package/types/components/inputs/Switch/Switch.styled.d.ts +20 -0
- package/types/components/inputs/Switch/index.d.ts +1 -0
- package/types/components/inputs/TextArea/TextArea.d.ts +124 -0
- package/types/components/inputs/TextArea/TextArea.styled.d.ts +95 -0
- package/types/components/inputs/TextArea/index.d.ts +1 -0
- package/types/components/inputs/TextInput/TextInput.d.ts +109 -0
- package/types/components/inputs/TextInput/TextInput.styled.d.ts +43 -0
- package/types/components/inputs/TextInput/index.d.ts +1 -0
- package/types/components/inputs/index.d.ts +13 -0
- package/types/components/layout/InputGroup/InputGroup.d.ts +31 -0
- package/types/components/layout/InputGroup/InputGroup.styled.d.ts +1 -0
- package/types/components/layout/InputGroup/index.d.ts +1 -0
- package/types/components/layout/SectionSeparator/SectionSeparator.d.ts +28 -0
- package/types/components/layout/SectionSeparator/SectionSeparator.styled.d.ts +14 -0
- package/types/components/layout/SectionSeparator/index.d.ts +1 -0
- package/types/components/layout/index.d.ts +2 -0
- package/types/components/widgets/AssetAction/AssetAction.d.ts +16 -0
- package/types/components/widgets/AssetAction/AssetAction.styled.d.ts +20 -0
- package/types/components/widgets/AssetAction/index.d.ts +1 -0
- package/types/components/widgets/AssetActionsBase/AssetActionsBase.d.ts +25 -0
- package/types/components/widgets/AssetActionsBase/AssetActionsBase.styled.d.ts +1 -0
- package/types/components/widgets/AssetActionsBase/index.d.ts +1 -0
- package/types/components/widgets/AssetGallery/AssetGallery.d.ts +170 -0
- package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.d.ts +88 -0
- package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.d.ts +3 -0
- package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.d.ts +3 -0
- package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.d.ts +100 -0
- package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.d.ts +2 -0
- package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.d.ts +85 -0
- package/types/components/widgets/AssetGallery/asset.types.d.ts +446 -0
- package/types/components/widgets/AssetGallery/index.d.ts +1 -0
- package/types/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.d.ts +60 -0
- package/types/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.d.ts +35 -0
- package/types/components/widgets/AssetPreview/AssetPreviewTopBar/index.d.ts +1 -0
- package/types/components/widgets/ContextMenu/ContextMenu.d.ts +134 -0
- package/types/components/widgets/ContextMenu/ContextMenu.styled.d.ts +1 -0
- package/types/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.d.ts +45 -0
- package/types/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.d.ts +26 -0
- package/types/components/widgets/ContextMenu/ContextMenuItem/index.d.ts +1 -0
- package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.d.ts +41 -0
- package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.d.ts +1 -0
- package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/index.d.ts +1 -0
- package/types/components/widgets/ContextMenu/index.d.ts +1 -0
- package/types/components/widgets/InfoCard/InfoCard.d.ts +33 -0
- package/types/components/widgets/InfoCard/InfoCard.styled.d.ts +45 -0
- package/types/components/widgets/InfoCard/index.d.ts +1 -0
- package/types/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.d.ts +46 -0
- package/types/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.d.ts +40 -0
- package/types/components/widgets/InstructionSeverityDisplay/index.d.ts +1 -0
- package/types/components/widgets/Instructions/Instructions.d.ts +156 -0
- package/types/components/widgets/Instructions/Instructions.styled.d.ts +26 -0
- package/types/components/widgets/Instructions/index.d.ts +1 -0
- package/types/components/widgets/ProgressBar/ProgressBar.d.ts +30 -0
- package/types/components/widgets/ProgressBar/ProgressBar.styled.d.ts +78 -0
- package/types/components/widgets/ProgressBar/index.d.ts +1 -0
- package/types/components/widgets/SummaryCard/SummaryCard.d.ts +83 -0
- package/types/components/widgets/SummaryCard/SummaryCard.styled.d.ts +68 -0
- package/types/components/widgets/SummaryCard/index.d.ts +1 -0
- package/types/components/widgets/index.d.ts +11 -0
- package/types/hooks/useElementSize.d.ts +25 -0
- package/types/hooks/useEventListner.d.ts +46 -0
- package/types/hooks/useFloatingPopover.d.ts +242 -0
- package/types/hooks/useIsomorphicLayoutEffect.d.ts +26 -0
- package/types/hooks/useOnClickOutside.d.ts +31 -0
- package/types/hooks/useTooltipAutoShow.d.ts +80 -0
- package/types/icons/index.d.ts +41 -0
- package/types/ssr/index.d.ts +1 -0
- package/types/styles/utils/colors-export.d.ts +73 -0
- package/types/utils/dateTime.d.ts +13 -0
- package/types/utils/defaultTheme.d.ts +174 -0
- package/types/utils/getElementRef.d.ts +21 -0
- package/types/utils/parseTrigger.d.ts +92 -0
- package/build/_virtual/_rollupPluginBabelHelpers.js +0 -12
- package/build/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
- package/build/widgets/AssetGallery/asset.propType.js +0 -56
- package/build/widgets/AssetGallery/asset.propType.js.map +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as S from './ProgressBar.styled';
|
|
3
|
+
type ProgressBarOwnProps = {
|
|
4
|
+
totalAssets: number;
|
|
5
|
+
completedAssets: number;
|
|
6
|
+
percentageText?: string;
|
|
7
|
+
barColor?: string;
|
|
8
|
+
height?: number;
|
|
9
|
+
label?: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
linkText?: string;
|
|
12
|
+
onClick?: (...args: any[]) => any;
|
|
13
|
+
};
|
|
14
|
+
type Props = Omit<React.ComponentPropsWithoutRef<typeof S.Container>, keyof ProgressBarOwnProps> & ProgressBarOwnProps;
|
|
15
|
+
/**
|
|
16
|
+
* ProgressBar that let you progress through a task.
|
|
17
|
+
*
|
|
18
|
+
*
|
|
19
|
+
* ### Import
|
|
20
|
+
*
|
|
21
|
+
* ``` js
|
|
22
|
+
* import { ProgressBar } from '@ntbjs/react-components/widgets/ProgressBar'
|
|
23
|
+
* // or
|
|
24
|
+
* import ProgressBar from '@ntbjs/react-components/widgets/ProgressBar'
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
declare const ProgressBar: ({ totalAssets, completedAssets, percentageText, barColor, height, label, type, linkText, onClick, ...props }: Props) => React.JSX.Element;
|
|
30
|
+
export default ProgressBar;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `height` — `PropTypes.number`, px, interpolated as `${props.height}px` with a `50px`
|
|
3
|
+
* fallback, so `number` and not `number | string`.
|
|
4
|
+
*
|
|
5
|
+
* NO `$`, AND THAT IS A DEFECT THAT IS ALREADY IN THE RENDER BASELINE. `height` is not a
|
|
6
|
+
* member of `HTMLAttributes<HTMLDivElement>` — hence the declaration — but React does
|
|
7
|
+
* recognise it and renders it, so `widgets/ProgressBar` in
|
|
8
|
+
* `scripts/r19-harness/baseline.json` opens with `<div height="50" class="…">`. Renaming
|
|
9
|
+
* it `$height` removes that attribute and MOVES the baseline — C10, §E.4.
|
|
10
|
+
*/
|
|
11
|
+
interface ProgressBarContainerStyleProps {
|
|
12
|
+
height?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* `$hasLink` — `Boolean(linkText)`, so genuinely boolean and not `linkText`'s `string`.
|
|
16
|
+
*
|
|
17
|
+
* Declared for `MetricsContainer` only. `ProgressBar.tsx` also passes `$hasLink` to
|
|
18
|
+
* `PercentageIndicator`, WHICH NEVER READS IT — so per rule 2 (declare only what is
|
|
19
|
+
* actually consumed) that component gets no generic, and the pass is recorded here as the
|
|
20
|
+
* dead prop it is. It is transient, so it does not reach the DOM either way.
|
|
21
|
+
*/
|
|
22
|
+
interface ProgressBarMetricsStyleProps {
|
|
23
|
+
$hasLink?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** `ProgressBarFill`, the one component here whose props are read from two places. */
|
|
26
|
+
interface ProgressBarFillStyleProps {
|
|
27
|
+
/**
|
|
28
|
+
* `type` — `PropTypes.string`, selecting a row of `colorMap`. Left as `string` rather
|
|
29
|
+
* than narrowed to the five `colorMap` keys, because `string` is what the published
|
|
30
|
+
* propTypes say; narrowing it here would invent a contract the component does not have
|
|
31
|
+
* (§E.1 rule 2). The `|| colorMap.default` fallback is what makes that safe.
|
|
32
|
+
*
|
|
33
|
+
* NO `$`, AND THAT IS A DEFECT ALREADY IN THE RENDER BASELINE — but on OTHER components.
|
|
34
|
+
* `ProgressBar.tsx` passes `type` to `InnerContainer`, `Completed` and `ProgressBarFill`
|
|
35
|
+
* alike; the first two never read it, and a string-valued `type` renders on a `<div>`,
|
|
36
|
+
* so `widgets/ProgressBar` records `<div type="success">` twice. Renaming it removes
|
|
37
|
+
* those attributes — C10, §E.4.
|
|
38
|
+
*/
|
|
39
|
+
type?: string;
|
|
40
|
+
/** `barColor` — `PropTypes.string`, a whole CSS colour that short-circuits `colorMap`
|
|
41
|
+
* entirely. NO `$` either, and it is unread by any other component, so it leaks only
|
|
42
|
+
* from this one and only when a consumer passes it — no fixture does. */
|
|
43
|
+
barColor?: string;
|
|
44
|
+
/** `(completedAssets / totalAssets) * 100`, interpolated as `${props.$percentage}%`, so
|
|
45
|
+
* `number`. Not rounded — the rounding is only for the label text. */
|
|
46
|
+
$percentage?: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* `$isHovered` — the `Link`'s hover state from `ProgressBar.tsx`'s `useState`, so
|
|
50
|
+
* genuinely `boolean`. Like `InfoCard`'s, it is `false` in every static render, so the
|
|
51
|
+
* rule blocks it guards are unreachable from the render gate.
|
|
52
|
+
*
|
|
53
|
+
* Hosts: `ButtonLink` and `StyledArrowIcon`.
|
|
54
|
+
*/
|
|
55
|
+
interface ProgressBarHoverStyleProps {
|
|
56
|
+
$isHovered?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export declare const ProgressBar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>>, never>, never>> & string;
|
|
59
|
+
export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, ProgressBarContainerStyleProps>, never>> & string;
|
|
60
|
+
export declare const InnerContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
61
|
+
export declare const MetricsContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, ProgressBarMetricsStyleProps>, never>> & string;
|
|
62
|
+
export declare const Label: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
63
|
+
export declare const Percentage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
64
|
+
export declare const ProgressBarTrack: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
65
|
+
export declare const Completed: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
66
|
+
export declare const PercentageIndicator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
67
|
+
export declare const ExternalPercentageIndicator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
68
|
+
export declare const ProgressBarFill: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, ProgressBarFillStyleProps>, never>> & string;
|
|
69
|
+
export declare const Link: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
70
|
+
export declare const ButtonLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, ProgressBarHoverStyleProps>, never>> & string;
|
|
71
|
+
export declare const StyledArrowIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").SVGProps<SVGSVGElement> & {
|
|
72
|
+
title?: string;
|
|
73
|
+
}, import("react").SVGProps<SVGSVGElement> & {
|
|
74
|
+
title?: string;
|
|
75
|
+
}>, ProgressBarHoverStyleProps>, never>> & string & Omit<import("react").FunctionComponent<import("react").SVGProps<SVGSVGElement> & {
|
|
76
|
+
title?: string;
|
|
77
|
+
}>, keyof import("react").Component<any, {}, any>>;
|
|
78
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ProgressBar';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as S from './SummaryCard.styled';
|
|
3
|
+
type AssetSummaryCardOwnProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Wether the SummaryCard is active or not.
|
|
6
|
+
*/
|
|
7
|
+
activeSummaryCard?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Title of the content
|
|
10
|
+
*/
|
|
11
|
+
title?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Description of the content
|
|
14
|
+
*/
|
|
15
|
+
description?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Special instructions for the content
|
|
18
|
+
*/
|
|
19
|
+
instructions?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Type of instructions
|
|
22
|
+
*/
|
|
23
|
+
instructionSeverity?: 1 | 2 | 3 | 4 | 5;
|
|
24
|
+
/**
|
|
25
|
+
* One or more children to render in the left half of the header
|
|
26
|
+
*/
|
|
27
|
+
headerLeft?: React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* One or more children to render in the right half of the header
|
|
30
|
+
*/
|
|
31
|
+
headerRight?: React.ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* One or more children to render in the left half of the footer
|
|
34
|
+
*/
|
|
35
|
+
footerLeft?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* One or more children to render in the right half of the footer
|
|
38
|
+
*/
|
|
39
|
+
footerRight?: React.ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Width of the card
|
|
42
|
+
*/
|
|
43
|
+
width?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Whether or not to use a border around the card
|
|
46
|
+
*/
|
|
47
|
+
useBorder?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether or not the Summary Card is within the CompactCard view or Grid view
|
|
50
|
+
*/
|
|
51
|
+
view?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Translated labels object for instruction(Info,Limited Use etc)
|
|
54
|
+
*/
|
|
55
|
+
instructionLabels?: {
|
|
56
|
+
[key: string]: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* ### Import
|
|
61
|
+
*
|
|
62
|
+
* ``` js
|
|
63
|
+
* import { SummaryCard } from '@ntbjs/react-components/widgets'
|
|
64
|
+
* // or
|
|
65
|
+
* import SummaryCard from '@ntbjs/react-components/widgets/SummaryCard'
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* ### Props
|
|
69
|
+
* ```
|
|
70
|
+
* Pass `title="Title"` to set the title of the card.
|
|
71
|
+
* Pass `description="Description"` to set the description of the card.
|
|
72
|
+
* Pass `instructions="Instructions"` to set the instructions of the card.
|
|
73
|
+
* Pass 1-5 to `instructionSeverity` to reflect the severity of the instructions.
|
|
74
|
+
* Pass `headerLeft={<div>Left</div>}` to set the left header of the card.
|
|
75
|
+
* Pass `headerRight={<div>Right</div>}` to set the right header of the card.
|
|
76
|
+
* Pass `footerLeft={<div>Left</div>}` to set the left footer of the card.
|
|
77
|
+
* Pass `footerRight={<div>Right</div>}` to set the right footer of the card.
|
|
78
|
+
* Pass `width={300}` to set the width of the card.
|
|
79
|
+
* Pass `useBorder={true}` to set the border of the card.
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
declare const SummaryCard: React.ForwardRefExoticComponent<Omit<Omit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, S.SummaryCardStyleProps>, never>, "ref">, keyof AssetSummaryCardOwnProps> & AssetSummaryCardOwnProps & React.RefAttributes<any>>;
|
|
83
|
+
export default SummaryCard;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/** The card root, i.e. what `SummaryCard.tsx` passes to `<S.SummaryCard>`. */
|
|
2
|
+
export interface SummaryCardStyleProps {
|
|
3
|
+
/**
|
|
4
|
+
* `view` — `PropTypes.string`. The template tests `=== 'compact'` twice and treats every
|
|
5
|
+
* other value as the grid view. Left as `string` rather than narrowed to
|
|
6
|
+
* `'compact' | 'grid'`: that is what the published propTypes say, and narrowing it here
|
|
7
|
+
* would invent a contract the component does not have (§E.1 rule 2). Note the asymmetry
|
|
8
|
+
* with `AssetGalleryCompactCard`'s `type`, which IS narrowed — there the propTypes
|
|
9
|
+
* really do declare a closed set.
|
|
10
|
+
*
|
|
11
|
+
* NO `$`, AND THAT IS A DEFECT ALREADY IN THE RENDER BASELINE. A string-valued `view`
|
|
12
|
+
* renders on a `<div>`, so `widgets/SummaryCard` records `<div width="300" view="grid">`
|
|
13
|
+
* and its `#compact` variant records `view="compact"`. Renaming it removes that
|
|
14
|
+
* attribute and MOVES the baseline — C10, §E.4.
|
|
15
|
+
*/
|
|
16
|
+
view?: string;
|
|
17
|
+
/**
|
|
18
|
+
* `width` — `PropTypes.number`, px, interpolated as `${props.width}px` with a `100%`
|
|
19
|
+
* fallback, so `number` and not `number | string`.
|
|
20
|
+
*
|
|
21
|
+
* NO `$`, AND ALSO ALREADY IN THE BASELINE: `<div width="300" …>` on the same element.
|
|
22
|
+
* `width` is not a member of `HTMLAttributes<HTMLDivElement>` — hence the declaration —
|
|
23
|
+
* but React recognises and renders it. C10, §E.4.
|
|
24
|
+
*/
|
|
25
|
+
width?: number;
|
|
26
|
+
/** `useBorder` — `PropTypes.bool`; the component defaults it to `false`, which is not a
|
|
27
|
+
* default HERE (nothing but `theme` is injected by `applyDefaultTheme`), so it stays
|
|
28
|
+
* optional per §J.5. */
|
|
29
|
+
$useBorder?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* `Gutter`, the spacer component. `SummaryCard.tsx` renders it seven times and passes
|
|
33
|
+
* `$gutter` every time.
|
|
34
|
+
*/
|
|
35
|
+
interface SummaryCardGutterStyleProps {
|
|
36
|
+
/** `$gutter` — px, always a literal (`4`, `8` or `16`) at the seven call sites, so
|
|
37
|
+
* `number`. The `|| 8` fallback is unreachable from inside this library. */
|
|
38
|
+
$gutter?: number;
|
|
39
|
+
/**
|
|
40
|
+
* `renderAsMargin` IS READ AND NEVER PASSED — DECLARED, NOT FIXED.
|
|
41
|
+
*
|
|
42
|
+
* None of the seven `<S.Gutter>` sites passes it and nothing else in `src` constructs
|
|
43
|
+
* this component, so the `if` branch below never runs: `margin-bottom` is never emitted
|
|
44
|
+
* and the `else` branch is what always applies. And the `else` branch is REDUNDANT with
|
|
45
|
+
* the unconditional `padding-bottom` on the line after the block, which emits the same
|
|
46
|
+
* declaration a second time — so today the whole conditional contributes nothing at all.
|
|
47
|
+
*
|
|
48
|
+
* Two separate things to fix, neither of them here: wiring up `renderAsMargin` is a
|
|
49
|
+
* feature, and deleting the dead conditional REMOVES a duplicate declaration from the
|
|
50
|
+
* generated CSS and therefore moves the baseline (§J.8). It also has NO `$`, though
|
|
51
|
+
* that part is harmless: React drops an unrecognised camelCase prop whose value is
|
|
52
|
+
* `true`, so it could not reach the DOM even if it were passed.
|
|
53
|
+
*/
|
|
54
|
+
renderAsMargin?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export declare const SummaryCard: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, SummaryCardStyleProps>, never>> & string;
|
|
57
|
+
export declare const Gutter: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, SummaryCardGutterStyleProps>, never>> & string;
|
|
58
|
+
export declare const Header: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
59
|
+
export declare const HeaderLeft: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
60
|
+
export declare const HeaderRight: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
61
|
+
export declare const Title: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>, never>, never>> & string;
|
|
62
|
+
export declare const Description: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>, never>, never>> & string;
|
|
63
|
+
export declare const Instruction: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
64
|
+
export declare const Footer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
65
|
+
export declare const FooterLeft: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
66
|
+
export declare const FooterRight: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
67
|
+
export declare const StyledFloatingArrow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<Omit<import("@floating-ui/react").FloatingArrowProps, "ref"> & import("react").RefAttributes<SVGSVGElement>, Omit<import("@floating-ui/react").FloatingArrowProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>, never>, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<import("@floating-ui/react").FloatingArrowProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>, keyof import("react").Component<any, {}, any>>;
|
|
68
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SummaryCard';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as AssetGallery } from './AssetGallery';
|
|
2
|
+
export { default as ContextMenu } from './ContextMenu';
|
|
3
|
+
export { default as ContextMenuItem } from './ContextMenu/ContextMenuItem';
|
|
4
|
+
export { default as ContextMenuItemsGroup } from './ContextMenu/ContextMenuItemsGroup';
|
|
5
|
+
export { default as AssetPreviewTopBar } from './AssetPreview/AssetPreviewTopBar';
|
|
6
|
+
export { default as SummaryCard } from './SummaryCard';
|
|
7
|
+
export { default as AssetActionBase } from './AssetActionsBase';
|
|
8
|
+
export { default as AssetAction } from './AssetAction';
|
|
9
|
+
export { default as ProgressBar } from './ProgressBar';
|
|
10
|
+
export { default as InfoCard } from './InfoCard';
|
|
11
|
+
export { default as InstructionSeverityDisplay } from './InstructionSeverityDisplay';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
/** The layout box this hook reports: `offsetWidth` / `offsetHeight`, in px. */
|
|
3
|
+
export interface ElementSize {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Tracks an element's `offsetWidth` / `offsetHeight` across window resizes.
|
|
9
|
+
*
|
|
10
|
+
* `ref` IS REQUIRED AND NOT NULLABLE, because the body reads `ref.current`
|
|
11
|
+
* without a guard — passing `null` throws. The type records the existing
|
|
12
|
+
* contract rather than papering over it; adding `?.` would be a behaviour
|
|
13
|
+
* change, and this commit is type-only.
|
|
14
|
+
*
|
|
15
|
+
* NOTE FOR WHOEVER TOUCHES THIS NEXT: this hook has zero importers in `src`, is
|
|
16
|
+
* not reachable through `package.json#exports` (there is no `./hooks` entry),
|
|
17
|
+
* and a grep of the `ntb-dam` consumer finds no use of it. Playbook §A.2/C8
|
|
18
|
+
* schedules it for deletion for exactly that reason. It is typed here rather
|
|
19
|
+
* than deleted because deletion is a separate, labelled commit — but do not
|
|
20
|
+
* invest further in it before checking whether it should exist at all.
|
|
21
|
+
*
|
|
22
|
+
* @param ref element to measure
|
|
23
|
+
* @param delayWindowResizeUpdate debounce window for the `resize` handler, in ms
|
|
24
|
+
*/
|
|
25
|
+
export declare function useElementSize<T extends HTMLElement = HTMLElement>(ref: RefObject<T | null>, delayWindowResizeUpdate?: number): ElementSize;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Every event name this hook accepts, mapped to the event object the handler
|
|
4
|
+
* actually receives.
|
|
5
|
+
*
|
|
6
|
+
* AN INTERSECTION, NOT `interface DomEventMap extends WindowEventMap,
|
|
7
|
+
* HTMLElementEventMap, DocumentEventMap {}`. The three lib.dom maps share keys
|
|
8
|
+
* through `GlobalEventHandlersEventMap`, and an interface extending all three is
|
|
9
|
+
* a TS2320 candidate ("named property 'X' of types … are not identical") as soon
|
|
10
|
+
* as two of them declare a shared key with types that are equivalent rather than
|
|
11
|
+
* identical — a lib.dom detail that changes between TypeScript releases. An
|
|
12
|
+
* intersection has no such rule: overlapping keys become `MouseEvent &
|
|
13
|
+
* MouseEvent`, `keyof` is still the union of all three key sets, and lib.dom
|
|
14
|
+
* stays the single source of truth for which event class each name carries. Do
|
|
15
|
+
* not "tidy" this into an interface.
|
|
16
|
+
*
|
|
17
|
+
* All three maps are needed because the target is chosen at runtime:
|
|
18
|
+
* `element?.current ?? window`.
|
|
19
|
+
*/
|
|
20
|
+
export type DomEventMap = WindowEventMap & HTMLElementEventMap & DocumentEventMap;
|
|
21
|
+
/** Any DOM event name this hook accepts — `keyof DomEventMap`. */
|
|
22
|
+
export type DomEventName = keyof DomEventMap;
|
|
23
|
+
/**
|
|
24
|
+
* Subscribes to a DOM event for the lifetime of the component, always calling
|
|
25
|
+
* the latest `handler` without re-subscribing when it changes identity.
|
|
26
|
+
*
|
|
27
|
+
* `element` AND `options` ARE OPTIONAL, AND THAT IS THE ENTIRE FIX FOR THE
|
|
28
|
+
* TS2554 ARITY ERRORS IN THIS DIRECTORY. In JavaScript a missing argument is
|
|
29
|
+
* `undefined`; in TypeScript a parameter with neither `?` nor a default is
|
|
30
|
+
* REQUIRED. Annotating the original four parameters without marking the last two
|
|
31
|
+
* optional is what made every existing 2- and 3-argument call site a hard error
|
|
32
|
+
* (`useOnClickOutside.ts:4`, `useElementSize.ts:22`,
|
|
33
|
+
* `MultiLevelCheckboxSelect.tsx:65-67`). `element` really is optional — the hook
|
|
34
|
+
* falls back to `window` — and `options` really is optional, so the declaration
|
|
35
|
+
* below records what this function has always done. The body is unchanged.
|
|
36
|
+
*
|
|
37
|
+
* @param eventName any DOM event name; it selects the handler's event type
|
|
38
|
+
* @param handler receives the event. Stored in a ref, so it may be a fresh
|
|
39
|
+
* closure on every render without rebinding the listener
|
|
40
|
+
* @param element ref to the target. Omit it — or pass a ref whose `current` is
|
|
41
|
+
* still `null` — to listen on `window`
|
|
42
|
+
* @param options forwarded verbatim to `addEventListener` and
|
|
43
|
+
* `removeEventListener`
|
|
44
|
+
*/
|
|
45
|
+
declare function useEventListener<K extends DomEventName, T extends EventTarget = HTMLElement>(eventName: K, handler: (event: DomEventMap[K]) => void, element?: RefObject<T | null> | null, options?: boolean | AddEventListenerOptions): void;
|
|
46
|
+
export { useEventListener };
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { useInteractions, useTransitionStyles } from '@floating-ui/react';
|
|
2
|
+
import type { Middleware, OpenChangeReason, Placement, UseClickProps, UseDismissProps, UseFloatingReturn, UseFocusProps, UseHoverProps, UseTransitionStylesProps } from '@floating-ui/react';
|
|
3
|
+
/**
|
|
4
|
+
* THE ARROW HEIGHT, RE-DERIVED — AND THE `+15` IN `Popover.tsx` WAS NEVER A FUDGE.
|
|
5
|
+
*
|
|
6
|
+
* `Popover.tsx` computes `const errorOffset = useMemo(() => (arrow ? 15 : 0), [arrow])`
|
|
7
|
+
* and passes `offset={[offset[0], offset[1] + errorOffset]}`. The name says the
|
|
8
|
+
* 15 is a correction for a mistake. It is not: it is the arrow's height, and here
|
|
9
|
+
* is the measurement chain.
|
|
10
|
+
*
|
|
11
|
+
* 1. `Popover.styled.ts` OVERRIDES tippy's default arrow geometry. For a top
|
|
12
|
+
* placement it writes `border-width: 15px 13px 0` on both `.tippy-arrow::before`
|
|
13
|
+
* and `::after` — a CSS border triangle **15px tall on a 26px base**
|
|
14
|
+
* (13px + 13px). The same 15/13 pair appears on all four sides.
|
|
15
|
+
* 2. The FILL layer, `& > .tippy-arrow:after`, is positioned `bottom: -15px`. The
|
|
16
|
+
* `.tippy-arrow` box's bottom edge is the `.tippy-box` edge, so all 15px of
|
|
17
|
+
* that triangle sit OUTSIDE the box: **the arrow protrudes exactly 15px.**
|
|
18
|
+
* (The outline layer, `::before`, is at `-16px` — 1px further out. That 1px is
|
|
19
|
+
* the popover's border continued around the arrow, not extra arrow.)
|
|
20
|
+
* 3. So with `offset={[0, 8]}` (the `Popover` default) plus 15, tippy puts the BOX
|
|
21
|
+
* 23px from the reference and the arrow TIP 23 − 15 = **8px** from it. The
|
|
22
|
+
* public `offset` prop has therefore always meant "gap between the arrow tip
|
|
23
|
+
* and the reference", and `15` is the term that makes it mean that.
|
|
24
|
+
* 4. Floating UI's `FloatingArrow` positions its `<svg>` at `[side]: '100%'` —
|
|
25
|
+
* flush against the outside edge of the floating element — so the full
|
|
26
|
+
* `height` prop protrudes, exactly like tippy's fill layer. Therefore
|
|
27
|
+
* `mainAxis = distance + height` reproduces today's geometry when, and only
|
|
28
|
+
* when, `height === 15`.
|
|
29
|
+
*
|
|
30
|
+
* Get this wrong and it is immediately visible: leaving Floating UI's own default
|
|
31
|
+
* `height = 7` would put a 7px arrow in a 23px gap (16px of daylight between tip
|
|
32
|
+
* and reference), and dropping the term would put the box 8px out with a 15px
|
|
33
|
+
* arrow, i.e. the tip 7px INSIDE the reference.
|
|
34
|
+
*
|
|
35
|
+
* One sub-pixel inconsistency does not survive: tippy's bottom-placement fill
|
|
36
|
+
* layer is at `top: -14.5px`, half a pixel less than the other three sides. 15 is
|
|
37
|
+
* used uniformly here.
|
|
38
|
+
*
|
|
39
|
+
* The `Tooltip` arrow is a different size — it never overrode tippy's default
|
|
40
|
+
* geometry — and its number is derived at `TOOLTIP_ARROW` in
|
|
41
|
+
* `src/components/data/_shared/FloatingArrow.styled.ts`, which also re-exports
|
|
42
|
+
* this constant as the popover arrow's height so the offset maths and the rendered
|
|
43
|
+
* `<svg>` cannot disagree.
|
|
44
|
+
*/
|
|
45
|
+
export declare const DEFAULT_ARROW_HEIGHT = 15;
|
|
46
|
+
/**
|
|
47
|
+
* The placement vocabulary of our public props: Floating UI's `Placement` plus
|
|
48
|
+
* Popper's three `auto` values.
|
|
49
|
+
*
|
|
50
|
+
* The 12 concrete names are identical in both libraries (`bottom-end`,
|
|
51
|
+
* `right-start`, …) so they need no translation. `auto*` has no Floating UI
|
|
52
|
+
* equivalent — it is a different middleware — which is handled in
|
|
53
|
+
* `buildMiddleware` below.
|
|
54
|
+
*/
|
|
55
|
+
export type PopoverPlacement = Placement | AutoPlacement;
|
|
56
|
+
/** Popper's three `auto` values, which Floating UI has no string for. */
|
|
57
|
+
export type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';
|
|
58
|
+
/** Popper's `offset` modifier shape: `[skidding, distance]`. */
|
|
59
|
+
export type PopperOffset = readonly [skidding: number, distance: number];
|
|
60
|
+
/** What `useFloatingPopover` accepts. Every member is optional. */
|
|
61
|
+
export interface UseFloatingPopoverOptions {
|
|
62
|
+
/**
|
|
63
|
+
* Preferred placement, in the shared Popper/Floating UI vocabulary. `auto`,
|
|
64
|
+
* `auto-start` and `auto-end` swap `flip()` for `autoPlacement()`.
|
|
65
|
+
*
|
|
66
|
+
* @default 'bottom'
|
|
67
|
+
*/
|
|
68
|
+
placement?: PopoverPlacement;
|
|
69
|
+
/**
|
|
70
|
+
* Controlled open state — our `visible` prop. `undefined` (the default) means
|
|
71
|
+
* UNCONTROLLED: the hook owns the state and the parsed `trigger` drives it. Any
|
|
72
|
+
* boolean, INCLUDING `false`, means controlled and turns the trigger Hooks off;
|
|
73
|
+
* see rule 1 in the file header.
|
|
74
|
+
*/
|
|
75
|
+
open?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Called on every open-state change, controlled or not, with Floating UI's
|
|
78
|
+
* `reason`. `reason === 'outside-press'` is what `Popover`'s `onClickOutside`
|
|
79
|
+
* prop maps onto.
|
|
80
|
+
*/
|
|
81
|
+
onOpenChange?: (open: boolean, event?: Event, reason?: OpenChangeReason) => void;
|
|
82
|
+
/**
|
|
83
|
+
* tippy's `trigger` space-string, e.g. `'click focus'`, `'mouseenter'`, `''`.
|
|
84
|
+
* `undefined` means tippy's default (`'mouseenter focus'`) and `''` means no
|
|
85
|
+
* triggers at all — `parseTrigger` owns both rules and documents where `''` is
|
|
86
|
+
* used in the consumers.
|
|
87
|
+
*/
|
|
88
|
+
trigger?: string | null;
|
|
89
|
+
/**
|
|
90
|
+
* Popper's `[skidding, distance]`, where `distance` is the gap between the
|
|
91
|
+
* ARROW TIP and the reference (rule 3 in the file header). `skidding` maps to
|
|
92
|
+
* Floating UI's `crossAxis` and NOT `alignmentAxis`: Popper applies skidding as
|
|
93
|
+
* a plain shift along the cross axis with no sign flip for `-end` placements
|
|
94
|
+
* (`distanceAndSkiddingToXY` in `@popperjs/core`), which is `crossAxis`'s
|
|
95
|
+
* behaviour, whereas `alignmentAxis` inverts on `end`. Every consumer offset
|
|
96
|
+
* measured so far is `[0, n]`, so the distinction is currently unobservable —
|
|
97
|
+
* which is exactly why it is written down rather than discovered later.
|
|
98
|
+
*
|
|
99
|
+
* @default [0, 0]
|
|
100
|
+
*/
|
|
101
|
+
offset?: PopperOffset;
|
|
102
|
+
/**
|
|
103
|
+
* Whether an arrow is rendered. The hook does not render it — it only adds the
|
|
104
|
+
* `arrow()` middleware, exposes `arrowRef`, and adds `arrowHeight` to the
|
|
105
|
+
* main-axis offset.
|
|
106
|
+
*
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
109
|
+
arrow?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Height in px of the arrow the caller renders, i.e. how far it protrudes from
|
|
112
|
+
* the floating element. Only read when `arrow` is `true`.
|
|
113
|
+
*
|
|
114
|
+
* @default DEFAULT_ARROW_HEIGHT (15 — the popover arrow; see its derivation)
|
|
115
|
+
*/
|
|
116
|
+
arrowHeight?: number;
|
|
117
|
+
/**
|
|
118
|
+
* tippy's `interactive`: the pointer may travel from the reference into the
|
|
119
|
+
* floating element without closing it. Implemented as
|
|
120
|
+
* `useHover(context, { handleClose: safePolygon() })`, which is only
|
|
121
|
+
* meaningful for a hover trigger — a click-triggered popover is "interactive"
|
|
122
|
+
* by construction.
|
|
123
|
+
*
|
|
124
|
+
* Also decides `pointerEvents` in the return value, because tippy sets
|
|
125
|
+
* `pointer-events: none` on its popper root for a non-interactive instance.
|
|
126
|
+
*
|
|
127
|
+
* @default false
|
|
128
|
+
*/
|
|
129
|
+
interactive?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* tippy's `disabled`: can never open. Forces the resolved open state to `false`
|
|
132
|
+
* and disables every interaction Hook (rule 2 in the file header).
|
|
133
|
+
*
|
|
134
|
+
* @default false
|
|
135
|
+
*/
|
|
136
|
+
disabled?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Transition duration in ms — our `duration` prop, fed to
|
|
139
|
+
* `useTransitionStyles`. tippy's own default is the asymmetric `[300, 250]`;
|
|
140
|
+
* both our components default it to `350`, so there is no default here and the
|
|
141
|
+
* caller states it.
|
|
142
|
+
*/
|
|
143
|
+
duration?: UseTransitionStylesProps['duration'];
|
|
144
|
+
/**
|
|
145
|
+
* Overrides for the transition. `initial` defaults to a placement-aware
|
|
146
|
+
* reproduction of tippy's `animation="shift-away-subtle"`, which both
|
|
147
|
+
* components hardcode.
|
|
148
|
+
*/
|
|
149
|
+
transition?: Omit<UseTransitionStylesProps, 'duration'>;
|
|
150
|
+
/**
|
|
151
|
+
* `useDismiss` overrides. The hook's own defaults are tippy's behaviour:
|
|
152
|
+
* `outsidePress: true` (tippy's `hideOnClick` default), `referencePress: false`
|
|
153
|
+
* (tippy explicitly does NOT hide when a hover-triggered reference is pressed)
|
|
154
|
+
* and `escapeKey: false` (rule 4 in the file header).
|
|
155
|
+
*
|
|
156
|
+
* `enabled` is NOT overridable — it is `!disabled`, because a disabled instance
|
|
157
|
+
* has nothing to dismiss.
|
|
158
|
+
*/
|
|
159
|
+
dismiss?: Omit<UseDismissProps, 'enabled'>;
|
|
160
|
+
/** `useHover` overrides, e.g. `restMs`. `enabled` and `handleClose` are owned here. */
|
|
161
|
+
hover?: Omit<UseHoverProps, 'enabled' | 'handleClose'>;
|
|
162
|
+
/** `useClick` overrides. `enabled` is owned here. */
|
|
163
|
+
click?: Omit<UseClickProps, 'enabled'>;
|
|
164
|
+
/**
|
|
165
|
+
* `useFocus` overrides. `enabled` is owned here, and `visibleOnly` DEFAULTS TO
|
|
166
|
+
* `false` rather than Floating UI's `true`: tippy's `focus`/`focusin` triggers
|
|
167
|
+
* attach a plain `focusin` listener with no `:focus-visible` test, so leaving
|
|
168
|
+
* `visibleOnly` at `true` would stop every `trigger="mouseenter focus"` tooltip
|
|
169
|
+
* from opening on a mouse-driven focus. 6 consumer call sites pass
|
|
170
|
+
* `"mouseenter focus"`.
|
|
171
|
+
*/
|
|
172
|
+
focus?: Omit<UseFocusProps, 'enabled'>;
|
|
173
|
+
/**
|
|
174
|
+
* Cap the floating element's height to the space available, replacing the
|
|
175
|
+
* `popper-max-size-modifier` + `applyMaxSize` pair in `Popover.tsx`.
|
|
176
|
+
*
|
|
177
|
+
* OPT-IN, because only `Popover` has it today. Turning it on for `Tooltip`
|
|
178
|
+
* would add a `max-height` to every tooltip in both consumers.
|
|
179
|
+
*
|
|
180
|
+
* @default false
|
|
181
|
+
*/
|
|
182
|
+
constrainHeight?: boolean;
|
|
183
|
+
/** `padding` for the height cap. @default 10, from the modifier it replaces */
|
|
184
|
+
maxHeightPadding?: number;
|
|
185
|
+
/** `padding` for `flip()` / `shift()`. @default 5 */
|
|
186
|
+
collisionPadding?: number;
|
|
187
|
+
/**
|
|
188
|
+
* `FloatingTree` node id, for nested context-menu submenus. Passed straight to
|
|
189
|
+
* `useFloating`; unused until the `contextMenuSublevel` work (plan C5).
|
|
190
|
+
*/
|
|
191
|
+
nodeId?: string;
|
|
192
|
+
/** Extra middleware, appended last. */
|
|
193
|
+
middleware?: Middleware[];
|
|
194
|
+
}
|
|
195
|
+
/** What `useFloatingPopover` returns. */
|
|
196
|
+
export interface UseFloatingPopoverReturn {
|
|
197
|
+
/** `refs.setReference` / `refs.setFloating`, straight from `useFloating`. */
|
|
198
|
+
refs: UseFloatingReturn['refs'];
|
|
199
|
+
/** Absolute-position styles for the floating element. */
|
|
200
|
+
floatingStyles: UseFloatingReturn['floatingStyles'];
|
|
201
|
+
/** The Floating UI context — needed by `FloatingArrow`, `FloatingPortal`, `FloatingTree`. */
|
|
202
|
+
context: UseFloatingReturn['context'];
|
|
203
|
+
/** Spread onto the reference element. */
|
|
204
|
+
getReferenceProps: ReturnType<typeof useInteractions>['getReferenceProps'];
|
|
205
|
+
/** Spread onto the floating element. */
|
|
206
|
+
getFloatingProps: ReturnType<typeof useInteractions>['getFloatingProps'];
|
|
207
|
+
/** `true` while the element should be in the DOM, including during the close transition. */
|
|
208
|
+
isMounted: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* The transition styles for the current phase. Named `transitionStyles` and not
|
|
211
|
+
* `styles` so a call site cannot confuse it with `floatingStyles` — the two are
|
|
212
|
+
* applied to different elements (position on the outer, transition on the
|
|
213
|
+
* inner) in all three existing implementations.
|
|
214
|
+
*/
|
|
215
|
+
transitionStyles: ReturnType<typeof useTransitionStyles>['styles'];
|
|
216
|
+
/** Attach to the rendered arrow. Already wired into the `arrow()` middleware. */
|
|
217
|
+
arrowRef: React.MutableRefObject<SVGSVGElement | null>;
|
|
218
|
+
/** The resolved open state, after `disabled` and controlled/uncontrolled resolution. */
|
|
219
|
+
isOpen: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* Imperative open/close, honouring controlled mode by reporting through
|
|
222
|
+
* `onOpenChange`. This is what replaces the `_tippy.hide()` + `[data-tippy-root]`
|
|
223
|
+
* DOM sweep in `Popover.tsx`'s `handleContextMenuItemClick`.
|
|
224
|
+
*/
|
|
225
|
+
setOpen: (open: boolean, event?: Event, reason?: OpenChangeReason) => void;
|
|
226
|
+
/** The placement actually used after `flip()` / `autoPlacement()` resolved it. */
|
|
227
|
+
placement: Placement;
|
|
228
|
+
/**
|
|
229
|
+
* `'none'` when `interactive` is `false`, otherwise `undefined`. tippy sets
|
|
230
|
+
* `pointer-events: none` on the popper root of a non-interactive instance; the
|
|
231
|
+
* hook reports the value rather than applying it, because which element carries
|
|
232
|
+
* it differs per call site.
|
|
233
|
+
*/
|
|
234
|
+
pointerEvents: 'none' | undefined;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Positions and drives one floating element.
|
|
238
|
+
*
|
|
239
|
+
* @param options see `UseFloatingPopoverOptions`; every member is optional
|
|
240
|
+
*/
|
|
241
|
+
export declare function useFloatingPopover(options?: UseFloatingPopoverOptions): UseFloatingPopoverReturn;
|
|
242
|
+
export default useFloatingPopover;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { DependencyList, EffectCallback } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* `useLayoutEffect` in the browser, `useEffect` on the server.
|
|
4
|
+
*
|
|
5
|
+
* WHY THE ANNOTATION IS EXPLICIT RATHER THAN INFERRED. The two hooks have
|
|
6
|
+
* identical signatures, so the inferred type of the ternary is a UNION of two
|
|
7
|
+
* call signatures — and a union of signatures is only callable through their
|
|
8
|
+
* intersection, which is a worse thing to hand 1 call site and every future one
|
|
9
|
+
* than the single signature they agree on. Naming that signature is also what
|
|
10
|
+
* the deleted `@type` JSDoc was clumsily trying to say by listing the same
|
|
11
|
+
* signature twice.
|
|
12
|
+
*
|
|
13
|
+
* WHY THE RUNTIME TERNARY MUST STAY A RUNTIME TERNARY. The two hooks are
|
|
14
|
+
* interchangeable to the type system and NOT interchangeable to React:
|
|
15
|
+
* `useLayoutEffect` logs "useLayoutEffect does nothing on the server" under
|
|
16
|
+
* `renderToStaticMarkup` — which the render gate captures as a warning with its
|
|
17
|
+
* own exit code — and it runs before paint rather than after it. So this file
|
|
18
|
+
* cannot be simplified into a plain re-export, and no type here can protect
|
|
19
|
+
* that. Hence this comment.
|
|
20
|
+
*
|
|
21
|
+
* `typeof window !== 'undefined'` is evaluated ONCE, at module scope, on
|
|
22
|
+
* purpose: the choice must not vary between renders or React sees a different
|
|
23
|
+
* hook in the same slot.
|
|
24
|
+
*/
|
|
25
|
+
declare const useIsomorphicLayoutEffect: (effect: EffectCallback, deps?: DependencyList) => void;
|
|
26
|
+
export default useIsomorphicLayoutEffect;
|