@ntbjs/react-components 2.0.14 → 3.0.0-rc.2
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 +34 -0
- 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 +54 -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 -122
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +99 -286
- 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 +84 -36
- package/styles/utils/colors-export.d.ts +54 -0
- package/types/components/data/Alert/Alert.d.ts +76 -0
- package/types/components/data/Alert/Alert.styled.d.ts +52 -0
- package/types/components/data/Alert/index.d.ts +1 -0
- package/types/components/data/Badge/Badge.d.ts +120 -0
- package/types/components/data/Badge/Badge.styled.d.ts +33 -0
- package/types/components/data/Badge/index.d.ts +1 -0
- package/types/components/data/Popover/Popover.d.ts +116 -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 +14 -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 +26 -0
- package/types/components/data/Tabs/index.d.ts +1 -0
- package/types/components/data/Tooltip/Tooltip.d.ts +88 -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 +27 -0
- package/types/components/data/VerificationStatusIcon/index.d.ts +1 -0
- package/types/components/data/_shared/FloatingArrow.styled.d.ts +29 -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 +16 -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 +60 -0
- package/types/components/inputs/Button/index.d.ts +1 -0
- package/types/components/inputs/Checkbox/Checkbox.d.ts +83 -0
- package/types/components/inputs/Checkbox/Checkbox.styled.d.ts +29 -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 +104 -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 +34 -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 +42 -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 +13 -0
- package/types/components/inputs/MultiLevelCheckbox/index.d.ts +2 -0
- package/types/components/inputs/MultiLevelCheckbox/types.d.ts +29 -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 +115 -0
- package/types/components/inputs/MultiSelect/MultiSelect.styled.d.ts +34 -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 +16 -0
- package/types/components/inputs/Switch/index.d.ts +1 -0
- package/types/components/inputs/TextArea/TextArea.d.ts +120 -0
- package/types/components/inputs/TextArea/TextArea.styled.d.ts +93 -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 +7 -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 +15 -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 +76 -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 +52 -0
- package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.d.ts +2 -0
- package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.d.ts +49 -0
- package/types/components/widgets/AssetGallery/asset.types.d.ts +329 -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 +21 -0
- package/types/components/widgets/AssetPreview/AssetPreviewTopBar/index.d.ts +1 -0
- package/types/components/widgets/ContextMenu/ContextMenu.d.ts +118 -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 +18 -0
- package/types/components/widgets/ContextMenu/ContextMenuItem/index.d.ts +1 -0
- package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.d.ts +23 -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 +28 -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 +30 -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 +14 -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 +41 -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 +29 -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 +14 -0
- package/types/hooks/useEventListner.d.ts +14 -0
- package/types/hooks/useFloatingPopover.d.ts +161 -0
- package/types/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
- package/types/hooks/useOnClickOutside.d.ts +13 -0
- package/types/hooks/useTooltipAutoShow.d.ts +31 -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 +54 -0
- package/types/utils/dateTime.d.ts +8 -0
- package/types/utils/defaultTheme.d.ts +95 -0
- package/types/utils/getElementRef.d.ts +2 -0
- package/types/utils/parseTrigger.d.ts +22 -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
|
@@ -35,41 +35,27 @@ const defaultTheme = {
|
|
|
35
35
|
};
|
|
36
36
|
function themeProp(property, darkMode, lightMode, specificity = 2) {
|
|
37
37
|
const specificityString = Array(specificity).fill('&').join('');
|
|
38
|
-
return css
|
|
39
|
-
body.dark-theme ${specificityString} {
|
|
40
|
-
${property}: ${darkMode};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
body.light-theme ${specificityString} {
|
|
44
|
-
${property}: ${lightMode};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
body:not(.light-theme):not(.dark-theme) ${specificityString} {
|
|
48
|
-
${property}: ${lightMode};
|
|
49
|
-
|
|
50
|
-
@media (prefers-color-scheme: dark) {
|
|
51
|
-
${property}: ${darkMode};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
38
|
+
return css(["body.dark-theme ", "{", ":", ";}body.light-theme ", "{", ":", ";}body:not(.light-theme):not(.dark-theme) ", "{", ":", ";@media (prefers-color-scheme:dark){", ":", ";}}"], specificityString, property, darkMode, specificityString, property, lightMode, specificityString, property, lightMode, property, darkMode);
|
|
55
39
|
}
|
|
56
40
|
function applyDefaultTheme({
|
|
57
41
|
theme = {},
|
|
58
42
|
...props
|
|
59
43
|
}) {
|
|
60
|
-
|
|
44
|
+
const merged = {
|
|
45
|
+
...defaultTheme,
|
|
46
|
+
...theme,
|
|
47
|
+
getColor: typeof theme.getColor === 'function' ? theme.getColor : defaultTheme.getColor,
|
|
48
|
+
themeProp: typeof theme.themeProp === 'function' ? theme.themeProp : defaultTheme.themeProp,
|
|
49
|
+
primaryFontFamily: theme.primaryFontFamily || defaultTheme.primaryFontFamily,
|
|
50
|
+
secondaryFontFamily: theme.secondaryFontFamily || defaultTheme.secondaryFontFamily,
|
|
51
|
+
spacing: theme.spacing || defaultTheme.spacing,
|
|
52
|
+
colors: theme.colors || defaultTheme.colors
|
|
53
|
+
};
|
|
54
|
+
const attrs = {
|
|
61
55
|
...props,
|
|
62
|
-
theme:
|
|
63
|
-
...defaultTheme,
|
|
64
|
-
...theme,
|
|
65
|
-
getColor: typeof theme.getColor === 'function' ? theme.getColor : defaultTheme.getColor,
|
|
66
|
-
themeProp: typeof theme.themeProp === 'function' ? theme.themeProp : defaultTheme.themeProp,
|
|
67
|
-
primaryFontFamily: theme.primaryFontFamily || defaultTheme.primaryFontFamily,
|
|
68
|
-
secondaryFontFamily: theme.secondaryFontFamily || defaultTheme.secondaryFontFamily,
|
|
69
|
-
spacing: theme.spacing || defaultTheme.spacing,
|
|
70
|
-
colors: theme.colors || defaultTheme.colors
|
|
71
|
-
}
|
|
56
|
+
theme: merged
|
|
72
57
|
};
|
|
58
|
+
return attrs;
|
|
73
59
|
}
|
|
74
60
|
|
|
75
61
|
export { applyDefaultTheme, defaultTheme };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultTheme.js","sources":["../../src/utils/defaultTheme.
|
|
1
|
+
{"version":3,"file":"defaultTheme.js","sources":["../../src/utils/defaultTheme.ts"],"sourcesContent":["/// <reference path=\"../types/assets.d.ts\" />\n// Theme contract. Two load-bearing facts:\n// 1. The `/// <reference>` on line 1 makes assets.d.ts reachable to consumers\n// (declarations must flow through the import graph, not just tsconfig include).\n// 2. DefaultTheme augmentation lives here, not separate — reachable by construction\n// from all 36 importers with no import cycle.\nimport { colors } from '../styles/utils/colors-export';\nimport { css } from 'styled-components';\n\nimport type { ColorName } from '../styles/utils/colors-export';\nimport type { Interpolation, RuleSet } from 'styled-components';\n\nexport type { ColorName };\n\n// Throws at runtime for unregistered names. Parameter is closed ColorName union\n// (not string) so the error is compile-time at the call site, not runtime in template.\nexport type GetColor = (name: ColorName) => string;\n\n// Value themeProp interpolates — widened to Interpolation to accept callbacks and numbers.\n// The guarantee is ARITY (it works in css`` templates), not value narrowness.\nexport type ThemePropValue = Interpolation<object>;\n\n/**\n * Emits three declarations: body.dark-theme, body.light-theme, and\n * neither-class with prefers-color-scheme fallback, so one property can\n * differ between themes.\n *\n * Two unenforceable conventions that cause visual bugs: (1) Don't call inside\n * `&::after` / `&::before` — generated selector can't address pseudo-elements;\n * write rules explicitly instead. (2) Use static `&[data-x='state']` selectors,\n * not dynamic `${props => css\\`\\`}` — dynamic rules share componentId, so\n * instances collide.\n *\n * @param property CSS property (e.g. color, background, --custom-prop)\n * @param darkMode value for body.dark-theme\n * @param lightMode value for body.light-theme (also fallback when no class)\n * @param specificity how many `&` to repeat in selector; a number (prevents\n * passing '!important' by mistake)\n */\nexport type ThemeProp = (\n property: string,\n darkMode: ThemePropValue,\n lightMode: ThemePropValue,\n specificity?: number\n) => RuleSet<object>;\n\n// Spacing scale. Member names are react-select's (consumed by their theme prop).\nexport interface ThemeSpacing {\n baseUnit: number;\n controlHeight: number;\n menuGutter: number;\n}\n\n// react-select's color contract. Names are react-select's, not ours — don't rename.\nexport interface ThemeColors {\n primary: string;\n primary75: string;\n primary50: string;\n primary25: string;\n danger: string;\n neutral0: string;\n neutral5: string;\n neutral10: string;\n neutral20: string;\n neutral30: string;\n neutral40: string;\n neutral50: string;\n neutral60: string;\n neutral70: string;\n neutral80: string;\n neutral90: string;\n}\n\n// Whole theme as seen in styled templates. Every member required (truth in interpolations\n// and at ThemeProvider boundary). Consumers override with PartialNtbTheme + applyDefaultTheme.\nexport interface NtbTheme {\n getColor: GetColor;\n primaryFontFamily: string;\n secondaryFontFamily: string;\n themeProp: ThemeProp;\n spacing: ThemeSpacing;\n colors: ThemeColors;\n}\n\nexport type PartialNtbTheme = Partial<NtbTheme>;\n\n// Parameter for applyDefaultTheme. Not `ExecutionProps & ...` — intersection would\n// make theme required again (DefaultTheme is now NtbTheme with all members required).\n// Extra props still accepted and spread through at runtime.\nexport interface ThemedProps {\n theme?: PartialNtbTheme;\n}\n\nexport const defaultTheme = {\n getColor: name => {\n if (!colors[name]) throw Error(`The color \"${name}\" is not registered.`);\n return colors[name];\n },\n primaryFontFamily: \"'Roboto', sans-serif\",\n secondaryFontFamily: \"'Overpass', sans-serif\",\n themeProp,\n spacing: {\n baseUnit: 4,\n controlHeight: 38,\n menuGutter: 8\n },\n colors: {\n primary: colors['emerald-500'],\n primary75: colors['emerald-400'],\n primary50: colors['emerald-300'],\n primary25: colors['emerald-200'],\n danger: colors['red-500'],\n neutral0: colors['white'],\n neutral5: colors['gray-50'],\n neutral10: colors['gray-100'],\n neutral20: colors['gray-300'],\n neutral30: colors['gray-400'],\n neutral40: colors['gray-500'],\n neutral50: colors['gray-600'],\n neutral60: colors['gray-700'],\n neutral70: colors['gray-800'],\n neutral80: colors['gray-900'],\n neutral90: colors['black']\n }\n // satisfies (not : NtbTheme) — checks both directions and keeps literal types.\n // Drift guard: runtime object and interface cannot disagree. Annotation would\n // widen strings; deriving contract would lose JSDoc and named exports.\n} satisfies NtbTheme;\n\n// Applies different CSS values for dark/light mode (see ThemeProp type for conventions).\nfunction themeProp(\n property: string,\n darkMode: ThemePropValue,\n lightMode: ThemePropValue,\n specificity: number = 2\n): RuleSet<object> {\n const specificityString = Array(specificity).fill('&').join('');\n\n return css`\n body.dark-theme ${specificityString} {\n ${property}: ${darkMode};\n }\n\n body.light-theme ${specificityString} {\n ${property}: ${lightMode};\n }\n\n body:not(.light-theme):not(.dark-theme) ${specificityString} {\n ${property}: ${lightMode};\n\n @media (prefers-color-scheme: dark) {\n ${property}: ${darkMode};\n }\n }\n `;\n}\n\n// .attrs() helper: merges caller's partial theme over defaultTheme.\n// Return type { theme: NtbTheme } (not P & ...) describes what this contributes,\n// not what attrs spreads back (avoiding 25-31 TS2345 assignability errors).\nexport function applyDefaultTheme({ theme = {}, ...props }: ThemedProps): { theme: NtbTheme } {\n const merged: NtbTheme = {\n ...defaultTheme,\n ...theme,\n getColor: typeof theme.getColor === 'function' ? theme.getColor : defaultTheme.getColor,\n themeProp: typeof theme.themeProp === 'function' ? theme.themeProp : defaultTheme.themeProp,\n primaryFontFamily: theme.primaryFontFamily || defaultTheme.primaryFontFamily,\n secondaryFontFamily: theme.secondaryFontFamily || defaultTheme.secondaryFontFamily,\n spacing: theme.spacing || defaultTheme.spacing,\n colors: theme.colors || defaultTheme.colors\n };\n\n // Assigned to local so returned object isn't a fresh literal (would fail excess-property check).\n const attrs = { ...props, theme: merged };\n return attrs;\n}\n\n// Module augmentation of styled-components DefaultTheme (not a separate interface).\n// Needed because ExecutionContext.theme is typed as DefaultTheme in styled-components' own declarations.\ndeclare module 'styled-components' {\n export interface DefaultTheme extends NtbTheme {}\n}\n"],"names":["defaultTheme","getColor","name","colors","Error","primaryFontFamily","secondaryFontFamily","themeProp","spacing","baseUnit","controlHeight","menuGutter","primary","primary75","primary50","primary25","danger","neutral0","neutral5","neutral10","neutral20","neutral30","neutral40","neutral50","neutral60","neutral70","neutral80","neutral90","property","darkMode","lightMode","specificity","specificityString","Array","fill","join","css","applyDefaultTheme","theme","props","merged","attrs"],"mappings":";;;AA6FO,MAAMA,YAAY,GAAG;EAC1BC,QAAQ,EAAEC,IAAI,IAAI;AAChB,IAAA,IAAI,CAACC,MAAM,CAACD,IAAI,CAAC,EAAE,MAAME,KAAK,CAAC,CAAA,WAAA,EAAcF,IAAI,CAAA,oBAAA,CAAsB,CAAC;IACxE,OAAOC,MAAM,CAACD,IAAI,CAAC;EACrB,CAAC;AACDG,EAAAA,iBAAiB,EAAE,sBAAsB;AACzCC,EAAAA,mBAAmB,EAAE,wBAAwB;EAC7CC,SAAS;AACTC,EAAAA,OAAO,EAAE;AACPC,IAAAA,QAAQ,EAAE,CAAC;AACXC,IAAAA,aAAa,EAAE,EAAE;AACjBC,IAAAA,UAAU,EAAE;GACb;AACDR,EAAAA,MAAM,EAAE;AACNS,IAAAA,OAAO,EAAET,MAAM,CAAC,aAAa,CAAC;AAC9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,iBAAiBA,CAAC;EAAEC,KAAK,GAAG,EAAE;EAAE,GAAGC;AAAmB,CAAC,EAAuB;AAC5F,EAAA,MAAMC,MAAgB,GAAG;AACvB,IAAA,GAAGxC,YAAY;AACf,IAAA,GAAGsC,KAAK;AACRrC,IAAAA,QAAQ,EAAE,OAAOqC,KAAK,CAACrC,QAAQ,KAAK,UAAU,GAAGqC,KAAK,CAACrC,QAAQ,GAAGD,YAAY,CAACC,QAAQ;AACvFM,IAAAA,SAAS,EAAE,OAAO+B,KAAK,CAAC/B,SAAS,KAAK,UAAU,GAAG+B,KAAK,CAAC/B,SAAS,GAAGP,YAAY,CAACO,SAAS;AAC3FF,IAAAA,iBAAiB,EAAEiC,KAAK,CAACjC,iBAAiB,IAAIL,YAAY,CAACK,iBAAiB;AAC5EC,IAAAA,mBAAmB,EAAEgC,KAAK,CAAChC,mBAAmB,IAAIN,YAAY,CAACM,mBAAmB;AAClFE,IAAAA,OAAO,EAAE8B,KAAK,CAAC9B,OAAO,IAAIR,YAAY,CAACQ,OAAO;AAC9CL,IAAAA,MAAM,EAAEmC,KAAK,CAACnC,MAAM,IAAIH,YAAY,CAACG;GACtC;AAGD,EAAA,MAAMsC,KAAK,GAAG;AAAE,IAAA,GAAGF,KAAK;AAAED,IAAAA,KAAK,EAAEE;GAAQ;AACzC,EAAA,OAAOC,KAAK;AACd;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function getElementRef(element) {
|
|
2
|
+
const withRef = element;
|
|
3
|
+
const propsRef = Object.getOwnPropertyDescriptor(element.props, 'ref');
|
|
4
|
+
if (propsRef?.get && propsRef.get.isReactWarning) {
|
|
5
|
+
return withRef.ref ?? null;
|
|
6
|
+
}
|
|
7
|
+
if (propsRef) {
|
|
8
|
+
return withRef.props.ref ?? null;
|
|
9
|
+
}
|
|
10
|
+
return withRef.ref ?? null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { getElementRef };
|
|
14
|
+
//# sourceMappingURL=getElementRef.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getElementRef.js","sources":["../../src/utils/getElementRef.ts"],"sourcesContent":["import * as React from 'react';\n\n// Reads a child's ref across react >= 16.14.\n// React 19 has ref as a regular prop; <19 moves it to element.ref. The property shape\n// (data prop vs warning getter) determines which branch to use — early return on React 19's\n// data prop avoids warning getters in all branches.\nexport function getElementRef(element: React.ReactElement): React.Ref<unknown> | null {\n type WarningGetter = (() => unknown) & { isReactWarning?: boolean };\n\n const withRef = element as React.ReactElement<{ ref?: React.Ref<unknown> }> & {\n ref?: React.Ref<unknown>;\n };\n\n const propsRef = Object.getOwnPropertyDescriptor(element.props as object, 'ref');\n\n // React 18.3: props.ref warns — read from element.ref instead.\n if (propsRef?.get && (propsRef.get as WarningGetter).isReactWarning) {\n return withRef.ref ?? null;\n }\n\n // React 19: props.ref is a genuine data prop (avoids deprecated element.ref getter).\n if (propsRef) {\n return withRef.props.ref ?? null;\n }\n\n // React <19 or React 19 with no ref — element.ref is a data property.\n return withRef.ref ?? null;\n}\n"],"names":["getElementRef","element","withRef","propsRef","Object","getOwnPropertyDescriptor","props","get","isReactWarning","ref"],"mappings":"AAMO,SAASA,aAAaA,CAACC,OAA2B,EAA6B;EAGpF,MAAMC,OAAO,GAAGD,OAEf;EAED,MAAME,QAAQ,GAAGC,MAAM,CAACC,wBAAwB,CAACJ,OAAO,CAACK,KAAK,EAAY,KAAK,CAAC;EAGhF,IAAIH,QAAQ,EAAEI,GAAG,IAAKJ,QAAQ,CAACI,GAAG,CAAmBC,cAAc,EAAE;AACnE,IAAA,OAAON,OAAO,CAACO,GAAG,IAAI,IAAI;AAC5B,EAAA;AAGA,EAAA,IAAIN,QAAQ,EAAE;AACZ,IAAA,OAAOD,OAAO,CAACI,KAAK,CAACG,GAAG,IAAI,IAAI;AAClC,EAAA;AAGA,EAAA,OAAOP,OAAO,CAACO,GAAG,IAAI,IAAI;AAC5B;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const TIPPY_DEFAULT_TRIGGER = 'mouseenter focus';
|
|
2
|
+
const CLICK_TOKEN = 'click';
|
|
3
|
+
const HOVER_TOKEN = 'mouseenter';
|
|
4
|
+
const FOCUS_TOKENS = ['focus', 'focusin'];
|
|
5
|
+
function parseTrigger(trigger) {
|
|
6
|
+
const source = trigger == null ? TIPPY_DEFAULT_TRIGGER : trigger;
|
|
7
|
+
const tokens = source.split(/\s+/).filter(Boolean);
|
|
8
|
+
return {
|
|
9
|
+
click: tokens.includes(CLICK_TOKEN),
|
|
10
|
+
hover: tokens.includes(HOVER_TOKEN),
|
|
11
|
+
focus: tokens.some(token => FOCUS_TOKENS.includes(token))
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { TIPPY_DEFAULT_TRIGGER, parseTrigger };
|
|
16
|
+
//# sourceMappingURL=parseTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseTrigger.js","sources":["../../src/utils/parseTrigger.ts"],"sourcesContent":["// Parses tippy's trigger space-string into Floating UI's three separate Hook flags.\n// Pure function: no Hook call, so it's testable and reusable beyond useFloatingPopover.\n\n// Floating UI interaction Hooks enabled by a tippy trigger string.\n// All three members required (not optional) — \"not mentioned\" and \"off\" are the same.\nexport interface ParsedTrigger {\n /** `click` token present → `useClick`. */\n click: boolean;\n /** `mouseenter` token present → `useHover`. */\n hover: boolean;\n /** `focus` or `focusin` token present → `useFocus`. */\n focus: boolean;\n}\n\n// tippy's default. Tooltip passes undefined for trigger, meaning this default applies.\n// Popover has its own default ('click focus'), so only Tooltip relies on this.\nexport const TIPPY_DEFAULT_TRIGGER = 'mouseenter focus';\n\n// Token mappings: click → useClick, mouseenter → useHover, focus/focusin → useFocus.\n// focus and focusin collapse (useFocus covers both). Unrecognized tokens are silently\n// inert (matching tippy), not thrown — a typo at a working call site stays working.\nconst CLICK_TOKEN = 'click';\nconst HOVER_TOKEN = 'mouseenter';\nconst FOCUS_TOKENS = ['focus', 'focusin'];\n\n/**\n * Parses a tippy trigger string into Floating UI Hook flags.\n *\n * Three inputs are easy to get wrong: `undefined`/`null` → tippy default (hover+focus,\n * NOT \"no triggers\"); `''` → no triggers (used in sales overlays to conditionally\n * suppress tooltips); filter(Boolean) is load-bearing (empty string splits to ['']\n * which would otherwise be treated as an unrecognised token). Controlled mode is\n * NOT handled here — useFloatingPopover gates the Hooks based on visible.\n *\n * @param trigger tippy's trigger prop; `undefined`/`null` → 'mouseenter focus';\n * `''` → all flags false\n */\nexport function parseTrigger(trigger?: string | null): ParsedTrigger {\n const source = trigger == null ? TIPPY_DEFAULT_TRIGGER : trigger;\n const tokens = source.split(/\\s+/).filter(Boolean);\n\n return {\n click: tokens.includes(CLICK_TOKEN),\n hover: tokens.includes(HOVER_TOKEN),\n focus: tokens.some(token => FOCUS_TOKENS.includes(token))\n };\n}\n"],"names":["TIPPY_DEFAULT_TRIGGER","CLICK_TOKEN","HOVER_TOKEN","FOCUS_TOKENS","parseTrigger","trigger","source","tokens","split","filter","Boolean","click","includes","hover","focus","some","token"],"mappings":"AAgBO,MAAMA,qBAAqB,GAAG;AAKrC,MAAMC,WAAW,GAAG,OAAO;AAC3B,MAAMC,WAAW,GAAG,YAAY;AAChC,MAAMC,YAAY,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC;AAclC,SAASC,YAAYA,CAACC,OAAuB,EAAiB;EACnE,MAAMC,MAAM,GAAGD,OAAO,IAAI,IAAI,GAAGL,qBAAqB,GAAGK,OAAO;AAChE,EAAA,MAAME,MAAM,GAAGD,MAAM,CAACE,KAAK,CAAC,KAAK,CAAC,CAACC,MAAM,CAACC,OAAO,CAAC;EAElD,OAAO;AACLC,IAAAA,KAAK,EAAEJ,MAAM,CAACK,QAAQ,CAACX,WAAW,CAAC;AACnCY,IAAAA,KAAK,EAAEN,MAAM,CAACK,QAAQ,CAACV,WAAW,CAAC;AACnCY,IAAAA,KAAK,EAAEP,MAAM,CAACQ,IAAI,CAACC,KAAK,IAAIb,YAAY,CAACS,QAAQ,CAACI,KAAK,CAAC;GACzD;AACH;;;;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import React__default, { useRef, useState, useCallback } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
2
|
import { AssetAction as AssetAction$1, AssetActionButton, Floating, ActionTitle, StyledFloatingArrow } from './AssetAction.styled.js';
|
|
5
3
|
import { isFunction } from 'lodash';
|
|
6
4
|
import { useFloating, autoUpdate, offset, flip, shift, arrow, useTransitionStyles, useHover, useDismiss, useInteractions } from '@floating-ui/react';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
6
|
|
|
8
7
|
const AssetAction = React__default.forwardRef(function AssetAction({
|
|
9
8
|
action,
|
|
@@ -62,38 +61,32 @@ const AssetAction = React__default.forwardRef(function AssetAction({
|
|
|
62
61
|
action.onClick(asset);
|
|
63
62
|
}
|
|
64
63
|
}, [action]);
|
|
65
|
-
return
|
|
66
|
-
ref: forwardedRef
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
64
|
+
return jsxs(AssetAction$1, {
|
|
65
|
+
ref: forwardedRef,
|
|
66
|
+
...props,
|
|
67
|
+
children: [jsx(AssetActionButton, {
|
|
68
|
+
ref: refs.setReference,
|
|
69
|
+
...getReferenceProps(),
|
|
70
|
+
onClick: e => onActionClick(e, action.onClick(asset), itemKey),
|
|
71
|
+
$actionWidthHeight: action.actionWidthHeight,
|
|
72
|
+
children: action.icon
|
|
73
|
+
}, itemKey), isOpen && isMounted && jsxs(Floating, {
|
|
74
|
+
className: "floating",
|
|
75
|
+
ref: refs.setFloating,
|
|
76
|
+
style: floatingStyles,
|
|
77
|
+
...getFloatingProps(),
|
|
78
|
+
children: [jsx(ActionTitle, {
|
|
79
|
+
style: styles,
|
|
80
|
+
children: action.title
|
|
81
|
+
}), jsx(StyledFloatingArrow, {
|
|
82
|
+
ref: arrowRef,
|
|
83
|
+
context: context,
|
|
84
|
+
width: ARROW_WIDTH,
|
|
85
|
+
height: ARROW_HEIGHT
|
|
86
|
+
})]
|
|
87
|
+
})]
|
|
88
|
+
});
|
|
85
89
|
});
|
|
86
|
-
AssetAction.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
87
|
-
action: PropTypes.shape({
|
|
88
|
-
icon: PropTypes.node,
|
|
89
|
-
onClick: PropTypes.func,
|
|
90
|
-
actionWidthHeight: PropTypes.arrayOf(PropTypes.number),
|
|
91
|
-
title: PropTypes.string
|
|
92
|
-
}),
|
|
93
|
-
asset: PropTypes.object,
|
|
94
|
-
itemKey: PropTypes.string
|
|
95
|
-
} : {};
|
|
96
|
-
AssetAction.defaultProps = {};
|
|
97
90
|
|
|
98
91
|
export { AssetAction as default };
|
|
99
92
|
//# sourceMappingURL=AssetAction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetAction.js","sources":["../../../src/components/widgets/AssetAction/AssetAction.
|
|
1
|
+
{"version":3,"file":"AssetAction.js","sources":["../../../src/components/widgets/AssetAction/AssetAction.tsx"],"sourcesContent":["import React, { useRef, useState, useCallback } from 'react';\nimport * as S from './AssetAction.styled';\n\nimport { isFunction } from 'lodash';\n\nimport {\n useFloating,\n useHover,\n useInteractions,\n useTransitionStyles,\n flip,\n shift,\n arrow,\n autoUpdate,\n offset,\n useDismiss\n} from '@floating-ui/react';\n\ntype AssetActionOwnProps = {\n action?: {\n icon?: React.ReactNode;\n onClick?: (...args: any[]) => any;\n actionWidthHeight?: number[];\n title?: string;\n };\n asset?: any;\n itemKey?: string;\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype Props = Omit<React.ComponentPropsWithoutRef<typeof S.AssetAction>, keyof AssetActionOwnProps> &\n AssetActionOwnProps;\n\n/**\n * This is a component to help you get started with development.\n */\nconst AssetAction = React.forwardRef<any, Props>(function AssetAction(\n { action, asset, itemKey, ...props },\n forwardedRef\n) {\n const ARROW_WIDTH = 10;\n const ARROW_HEIGHT = 5;\n const GAP = 3;\n\n const arrowRef = useRef(null);\n\n const [isOpen, setIsOpen] = useState(false);\n // `useState('bottom')` widens to `string`, not the Placement union; `as const` pins it to the literal.\n const [placement] = useState('bottom' as const);\n\n const { refs, floatingStyles, context } = useFloating({\n placement,\n open: isOpen,\n onOpenChange: setIsOpen,\n whileElementsMounted: autoUpdate,\n middleware: [\n offset(ARROW_HEIGHT + GAP),\n flip({ padding: 5 }),\n shift({ padding: 5 }),\n arrow({\n element: arrowRef\n })\n ]\n });\n\n const { isMounted, styles } = useTransitionStyles(context, {\n initial: {\n transform: 'translateY(-8px)',\n opacity: 0\n },\n duration: {\n open: 200,\n close: 100\n }\n });\n\n const hover = useHover(context);\n const dismiss = useDismiss(context, {\n referencePress: true\n });\n\n const { getReferenceProps, getFloatingProps } = useInteractions([dismiss, hover]);\n\n const onActionClick = useCallback(\n (e, action) => {\n e.preventDefault();\n e.stopPropagation();\n\n if (isFunction(action?.onClick)) {\n action.onClick(asset);\n }\n },\n [action]\n );\n\n return (\n <S.AssetAction ref={forwardedRef} {...props}>\n <S.AssetActionButton\n key={itemKey}\n ref={refs.setReference}\n {...getReferenceProps()}\n onClick={e => onActionClick(e, action.onClick(asset), itemKey)}\n $actionWidthHeight={action.actionWidthHeight}\n >\n {action.icon}\n </S.AssetActionButton>\n\n {isOpen && isMounted && (\n <S.Floating\n className=\"floating\"\n ref={refs.setFloating}\n style={floatingStyles}\n {...getFloatingProps()}\n >\n <S.ActionTitle style={styles}>{action.title}</S.ActionTitle>\n <S.StyledFloatingArrow\n ref={arrowRef}\n context={context}\n width={ARROW_WIDTH}\n height={ARROW_HEIGHT}\n />\n </S.Floating>\n )}\n </S.AssetAction>\n );\n});\n\nexport default AssetAction;\n"],"names":["AssetAction","React","forwardRef","action","asset","itemKey","props","forwardedRef","ARROW_WIDTH","ARROW_HEIGHT","GAP","arrowRef","useRef","isOpen","setIsOpen","useState","placement","refs","floatingStyles","context","useFloating","open","onOpenChange","whileElementsMounted","autoUpdate","middleware","offset","flip","padding","shift","arrow","element","isMounted","styles","useTransitionStyles","initial","transform","opacity","duration","close","hover","useHover","dismiss","useDismiss","referencePress","getReferenceProps","getFloatingProps","useInteractions","onActionClick","useCallback","e","preventDefault","stopPropagation","isFunction","onClick","_jsxs","S","ref","children","_jsx","setReference","$actionWidthHeight","actionWidthHeight","icon","className","setFloating","style","title","width","height"],"mappings":";;;;;;AAoCA,MAAMA,WAAW,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,WAAWA,CACnE;EAAEG,MAAM;EAAEC,KAAK;EAAEC,OAAO;EAAE,GAAGC;AAAM,CAAC,EACpCC,YAAY,EACZ;EACA,MAAMC,WAAW,GAAG,EAAE;EACtB,MAAMC,YAAY,GAAG,CAAC;EACtB,MAAMC,GAAG,GAAG,CAAC;AAEb,EAAA,MAAMC,QAAQ,GAAGC,MAAM,CAAC,IAAI,CAAC;EAE7B,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC;AAE3C,EAAA,MAAM,CAACC,SAAS,CAAC,GAAGD,QAAQ,CAAC,QAAiB,CAAC;EAE/C,MAAM;IAAEE,IAAI;IAAEC,cAAc;AAAEC,IAAAA;GAAS,GAAGC,WAAW,CAAC;IACpDJ,SAAS;AACTK,IAAAA,IAAI,EAAER,MAAM;AACZS,IAAAA,YAAY,EAAER,SAAS;AACvBS,IAAAA,oBAAoB,EAAEC,UAAU;IAChCC,UAAU,EAAE,CACVC,MAAM,CAACjB,YAAY,GAAGC,GAAG,CAAC,EAC1BiB,IAAI,CAAC;AA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AI,CAAC2C,YAAa;MAAA,GACnBf,iBAAiB,EAAE;AACvBS,MAAAA,OAAO,EAAEJ,CAAC,IAAIF,aAAa,CAACE,CAAC,EAAE/C,MAAM,CAACmD,OAAO,CAAClD,KAAK,CAAC,EAAEC,OAAO,CAAE;MAC/DwD,kBAAkB,EAAE1D,MAAM,CAAC2D,iBAAkB;MAAAJ,QAAA,EAE5CvD,MAAM,CAAC4D;KAAI,EANP1D,OAOc,CAAC,EAErBQ,MAAM,IAAImB,SAAS,IAClBuB,IAAA,CAACC,QAAU,EAAA;AACTQ,MAAAA,SAAS,EAAC,UAAU;MACpBP,GAAG,EAAExC,IAAI,CAACgD,WAAY;AACtBC,MAAAA,KAAK,EAAEhD,cAAe;MAAA,GAClB4B,gBAAgB,EAAE;AAAAY,MAAAA,QAAA,EAAA,CAEtBC,GAAA,CAACH,WAAa,EAAA;AAACU,QAAAA,KAAK,EAAEjC,MAAO;QAAAyB,QAAA,EAAEvD,MAAM,CAACgE;AAAK,OAAgB,CAAC,EAC5DR,GAAA,CAACH,mBAAqB,EAAA;AACpBC,QAAAA,GAAG,EAAE9C,QAAS;AACdQ,QAAAA,OAAO,EAAEA,OAAQ;AACjBiD,QAAAA,KAAK,EAAE5D,WAAY;AACnB6D,QAAAA,MAAM,EAAE5D;AAAa,OACtB,CAAC;AAAA,KACQ,CACb;AAAA,GACY,CAAC;AAEpB,CAAC;;;;"}
|
|
@@ -7,46 +7,32 @@ const shouldForwardProp = prop => {
|
|
|
7
7
|
};
|
|
8
8
|
const AssetAction = styled.div.withConfig({
|
|
9
9
|
shouldForwardProp
|
|
10
|
-
}).attrs(applyDefaultTheme)
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
11
|
+
displayName: "AssetActionstyled__AssetAction",
|
|
12
|
+
componentId: "sc-htu0wd-0"
|
|
13
|
+
})(["font-family:", ";"], props => props.theme.primaryFontFamily);
|
|
13
14
|
const AssetActionButton = styled.div.withConfig({
|
|
14
15
|
shouldForwardProp
|
|
15
|
-
}).attrs(applyDefaultTheme)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
cursor: pointer;
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
align-items: center;
|
|
23
|
-
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
|
|
24
|
-
${props => props.theme.themeProp('background-color', props.theme.getColor('gray-900'), props.theme.getColor('white'))};
|
|
25
|
-
svg {
|
|
26
|
-
pointer-events: none;
|
|
27
|
-
width: ${props => props.$actionWidthHeightactionWidthHeight ? `${props.$actionWidthHeight[0] - 14}px` : 'auto'};
|
|
28
|
-
height: ${props => props.$actionWidthHeight ? `${props.$actionWidthHeight[1] - 14}px` : 'auto'};
|
|
29
|
-
${props => props.theme.themeProp('color', props.theme.getColor('gray-900'), props.theme.getColor('white'))};
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
16
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
17
|
+
displayName: "AssetActionstyled__AssetActionButton",
|
|
18
|
+
componentId: "sc-htu0wd-1"
|
|
19
|
+
})(["border-radius:50%;width:", ";height:", ";cursor:pointer;display:flex;justify-content:center;align-items:center;box-shadow:0px 3px 6px rgba(0,0,0,0.16);", ";svg{pointer-events:none;width:", ";height:", ";", ";}"], props => props.$actionWidthHeight ? `${props.$actionWidthHeight[0]}px` : 'auto', props => props.$actionWidthHeight ? `${props.$actionWidthHeight[1]}px` : 'auto', props => props.theme.themeProp('background-color', props.theme.getColor('gray-900'), props.theme.getColor('white')), props => props.$actionWidthHeight ? `${props.$actionWidthHeight[0] - 14}px` : 'auto', props => props.$actionWidthHeight ? `${props.$actionWidthHeight[1] - 14}px` : 'auto', props => props.theme.themeProp('color', props.theme.getColor('gray-900'), props.theme.getColor('white')));
|
|
32
20
|
const ActionTitle = styled.div.withConfig({
|
|
33
21
|
shouldForwardProp
|
|
34
|
-
}).attrs(applyDefaultTheme)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const StyledFloatingArrow = styled(FloatingArrow).attrs(applyDefaultTheme)`
|
|
43
|
-
fill: ${props => props.theme.getColor('gray-700')};
|
|
44
|
-
`;
|
|
22
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
23
|
+
displayName: "AssetActionstyled__ActionTitle",
|
|
24
|
+
componentId: "sc-htu0wd-2"
|
|
25
|
+
})(["font-size:14px;border-radius:4px;padding:8px 12px;white-space:nowrap;color:white;background:", ";"], props => props.theme.getColor('gray-700'));
|
|
26
|
+
const StyledFloatingArrow = styled(FloatingArrow).attrs(applyDefaultTheme).withConfig({
|
|
27
|
+
displayName: "AssetActionstyled__StyledFloatingArrow",
|
|
28
|
+
componentId: "sc-htu0wd-3"
|
|
29
|
+
})(["fill:", ";"], props => props.theme.getColor('gray-700'));
|
|
45
30
|
const Floating = styled.div.withConfig({
|
|
46
31
|
shouldForwardProp
|
|
47
|
-
}).attrs(applyDefaultTheme)
|
|
48
|
-
|
|
49
|
-
|
|
32
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
33
|
+
displayName: "AssetActionstyled__Floating",
|
|
34
|
+
componentId: "sc-htu0wd-4"
|
|
35
|
+
})(["pointer-events:none;"]);
|
|
50
36
|
|
|
51
37
|
export { ActionTitle, AssetAction, AssetActionButton, Floating, StyledFloatingArrow };
|
|
52
38
|
//# sourceMappingURL=AssetAction.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetAction.styled.js","sources":["../../../src/components/widgets/AssetAction/AssetAction.styled.
|
|
1
|
+
{"version":3,"file":"AssetAction.styled.js","sources":["../../../src/components/widgets/AssetAction/AssetAction.styled.ts"],"sourcesContent":["// Fixed defect: guard now reads $actionWidthHeight (was run-together $actionWidthHeightactionWidthHeight).\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nimport { FloatingArrow } from '@floating-ui/react';\n\n/**\n * Props passed by `AssetAction.tsx` to `<S.AssetActionButton>`.\n */\ninterface AssetActionButtonStyleProps {\n /**\n * `[width, height]` in pixels, used arithmetically.\n */\n $actionWidthHeight?: number[];\n}\n\n// Single-argument to stay compatible with styled-components v5.1 and v6. Annotation required despite noImplicitAny being off.\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const AssetAction = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-family: ${props => props.theme.primaryFontFamily};\n`;\n\nexport const AssetActionButton = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<AssetActionButtonStyleProps>(applyDefaultTheme)`\n border-radius: 50%;\n width: ${props => (props.$actionWidthHeight ? `${props.$actionWidthHeight[0]}px` : 'auto')};\n height: ${props => (props.$actionWidthHeight ? `${props.$actionWidthHeight[1]}px` : 'auto')};\n cursor: pointer;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-900'),\n props.theme.getColor('white')\n )};\n svg {\n pointer-events: none;\n width: ${props =>\n props.$actionWidthHeight ? `${props.$actionWidthHeight[0] - 14}px` : 'auto'};\n height: ${props =>\n props.$actionWidthHeight ? `${props.$actionWidthHeight[1] - 14}px` : 'auto'};\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-900'),\n props.theme.getColor('white')\n )};\n }\n`;\n\nexport const ActionTitle = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 14px;\n border-radius: 4px;\n padding: 8px 12px;\n white-space: nowrap;\n color: white;\n background: ${props => props.theme.getColor('gray-700')};\n`;\n\nexport const StyledFloatingArrow = styled(FloatingArrow).attrs(applyDefaultTheme)`\n fill: ${props => props.theme.getColor('gray-700')};\n`;\n\nexport const Floating = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n pointer-events: none;\n`;\n"],"names":["shouldForwardProp","prop","startsWith","AssetAction","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","theme","primaryFontFamily","AssetActionButton","$actionWidthHeight","themeProp","getColor","ActionTitle","StyledFloatingArrow","FloatingArrow","Floating"],"mappings":";;;;AAiBA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,WAAW,GAAGC,MAAM,CAACC,GAAG,CAClCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,gCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,cAAA,EAAA,GAAA,CAAA,EACVC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,iBAAiB;AAGhD,MAAMC,iBAAiB,GAAGV,MAAM,CAACC,GAAG,CACxCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAA8BC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,sCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,0BAAA,EAAA,UAAA,EAAA,iHAAA,EAAA,iCAAA,EAAA,UAAA,EAAA,GAAA,EAAA,IAAA,CAAA,EAE7CC,KAAK,IAAKA,KAAK,CAACI,kBAAkB,GAAG,CAAA,EAAGJ,KAAK,CAACI,kBAAkB,CAAC,CAAC,CAAC,CAAA,EAAA,CAAI,GAAG,MAAO,EAChFJ,KAAK,IAAKA,KAAK,CAACI,kBAAkB,GAAG,CAAA,EAAGJ,KAAK,CAACI,kBAAkB,CAAC,CAAC,CAAC,CAAA,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AAK,CAACK,QAAQ,CAAC,UAAU,CAAC;AAG5C,MAAMI,QAAQ,GAAGjB,MAAM,CAACC,GAAG,CAC/BC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,6BAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,sBAAA,CAAA;;;;"}
|
|
@@ -1,29 +1,24 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import React__default from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
2
|
import { AssetActions } from './AssetActionsBase.styled.js';
|
|
5
3
|
import AssetAction from '../AssetAction/AssetAction.js';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
5
|
|
|
7
6
|
const AssetActionsBase = React__default.forwardRef(function AssetActionsBase({
|
|
8
7
|
actions,
|
|
9
8
|
asset,
|
|
10
9
|
...props
|
|
11
10
|
}, forwardedRef) {
|
|
12
|
-
const assetActions = actions.map((action, index) =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}, props, {
|
|
11
|
+
const assetActions = actions.map((action, index) => jsx(AssetAction, {
|
|
12
|
+
ref: forwardedRef,
|
|
13
|
+
...props,
|
|
16
14
|
action: action,
|
|
17
15
|
asset: asset,
|
|
18
16
|
itemKey: `${index}-${action.title}`
|
|
19
|
-
}))
|
|
20
|
-
return
|
|
17
|
+
}, `index_${action.title}`));
|
|
18
|
+
return jsx(AssetActions, {
|
|
19
|
+
children: assetActions
|
|
20
|
+
});
|
|
21
21
|
});
|
|
22
|
-
AssetActionsBase.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
23
|
-
actions: PropTypes.arrayOf(PropTypes.object),
|
|
24
|
-
asset: PropTypes.object
|
|
25
|
-
} : {};
|
|
26
|
-
AssetActionsBase.defaultProps = {};
|
|
27
22
|
|
|
28
23
|
export { AssetActionsBase as default };
|
|
29
24
|
//# sourceMappingURL=AssetActionsBase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetActionsBase.js","sources":["../../../src/components/widgets/AssetActionsBase/AssetActionsBase.
|
|
1
|
+
{"version":3,"file":"AssetActionsBase.js","sources":["../../../src/components/widgets/AssetActionsBase/AssetActionsBase.tsx"],"sourcesContent":["import React from 'react';\n\nimport * as S from './AssetActionsBase.styled';\n\nimport AssetAction from '../AssetAction/AssetAction';\n\ntype AssetActionsBaseOwnProps = {\n actions?: any[];\n asset?: any;\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype Props = Omit<\n React.ComponentPropsWithoutRef<typeof AssetAction>,\n keyof AssetActionsBaseOwnProps\n> &\n AssetActionsBaseOwnProps;\n\nconst AssetActionsBase = React.forwardRef<any, Props>(function AssetActionsBase(\n { actions, asset, ...props },\n forwardedRef\n) {\n const assetActions = actions.map((action, index) => (\n <AssetAction\n key={`index_${action.title}`}\n ref={forwardedRef}\n {...props}\n action={action}\n asset={asset}\n itemKey={`${index}-${action.title}`}\n />\n ));\n\n return <S.AssetActions>{assetActions}</S.AssetActions>;\n});\n\nexport default AssetActionsBase;\n"],"names":["AssetActionsBase","React","forwardRef","actions","asset","props","forwardedRef","assetActions","map","action","index","_jsx","AssetAction","ref","itemKey","title","S","children"],"mappings":";;;;;AAkBA,MAAMA,gBAAgB,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,gBAAgBA,CAC7E;EAAEG,OAAO;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAC5BC,YAAY,EACZ;AACA,EAAA,MAAMC,YAAY,GAAGJ,OAAO,CAACK,GAAG,CAAC,CAACC,MAAM,EAAEC,KAAK,KAC7CC,GAAA,CAACC,WAAW,EAAA;AAEVC,IAAAA,GAAG,EAAEP,YAAa;AAAA,IAAA,GACdD,KAAK;AACTI,IAAAA,MAAM,EAAEA,MAAO;AACfL,IAAAA,KAAK,EAAEA,KAAM;AACbU,IAAAA,OAAO,EAAE,CAAA,EAAGJ,KAAK,CAAA,CAAA,EAAID,MAAM,CAACM,KAAK,CAAA;AAAG,GAAA,EAL/B,SAASN,MAAM,CAACM,KAAK,CAAA,CAM3B,CACF,CAAC;AAEF,EAAA,OAAOJ,GAAA,CAACK,YAAc,EAAA;AAAAC,IAAAA,QAAA,EAAEV;AAAY,GAAiB,CAAC;AACxD,CAAC;;;;"}
|
|
@@ -6,15 +6,10 @@ const shouldForwardProp = prop => {
|
|
|
6
6
|
};
|
|
7
7
|
const AssetActions = styled.div.withConfig({
|
|
8
8
|
shouldForwardProp
|
|
9
|
-
}).attrs(applyDefaultTheme)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
display: flex;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
padding: 2px;
|
|
16
|
-
gap: 8px;
|
|
17
|
-
`;
|
|
9
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
10
|
+
displayName: "AssetActionsBasestyled__AssetActions",
|
|
11
|
+
componentId: "sc-41xsmz-0"
|
|
12
|
+
})(["font-family:", ";font-size:1rem;font-weight:500;display:flex;flex-direction:column;padding:2px;gap:8px;"], props => props.theme.primaryFontFamily);
|
|
18
13
|
|
|
19
14
|
export { AssetActions };
|
|
20
15
|
//# sourceMappingURL=AssetActionsBase.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetActionsBase.styled.js","sources":["../../../src/components/widgets/AssetActionsBase/AssetActionsBase.styled.
|
|
1
|
+
{"version":3,"file":"AssetActionsBase.styled.js","sources":["../../../src/components/widgets/AssetActionsBase/AssetActionsBase.styled.ts"],"sourcesContent":["// No components read props, so no transient-prop types to declare.\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n// Single-argument to stay compatible with styled-components v5.1 and v6. Annotation required despite noImplicitAny being off.\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const AssetActions = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 1rem;\n font-weight: 500;\n display: flex;\n flex-direction: column;\n padding: 2px;\n gap: 8px;\n`;\n"],"names":["shouldForwardProp","prop","startsWith","AssetActions","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","theme","primaryFontFamily"],"mappings":";;;AAKA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,YAAY,GAAGC,MAAM,CAACC,GAAG,CACnCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,sCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,cAAA,EAAA,yFAAA,CAAA,EACVC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,iBAAiB;;;;"}
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { isFunction } from 'lodash';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
2
|
import React__default, { useState, useEffect, useCallback } from 'react';
|
|
5
3
|
import AssetGalleryBase from './AssetGalleryBase/AssetGalleryBase.js';
|
|
6
|
-
import {
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
5
|
|
|
6
|
+
const EMPTY_ARRAY = [];
|
|
8
7
|
const AssetGallery = React__default.forwardRef(function AssetGallery({
|
|
9
|
-
assets,
|
|
10
|
-
activeSummaryCard,
|
|
11
|
-
viewMode,
|
|
12
|
-
thumbnailMaxHeight,
|
|
8
|
+
assets = EMPTY_ARRAY,
|
|
9
|
+
activeSummaryCard = false,
|
|
10
|
+
viewMode = 'compact',
|
|
11
|
+
thumbnailMaxHeight = 300,
|
|
13
12
|
selectable,
|
|
14
|
-
customSelectedBorder,
|
|
15
|
-
selectedAssetKeys,
|
|
13
|
+
customSelectedBorder = EMPTY_ARRAY,
|
|
14
|
+
selectedAssetKeys = EMPTY_ARRAY,
|
|
16
15
|
onSelectedChanged,
|
|
17
16
|
softSelectable,
|
|
18
17
|
scrollElement,
|
|
19
18
|
onSoftSelectedChanged,
|
|
20
19
|
component,
|
|
21
|
-
displayIcon,
|
|
20
|
+
displayIcon = '',
|
|
22
21
|
hideConsentSummary,
|
|
23
22
|
...props
|
|
24
23
|
}, forwardedRef) {
|
|
25
|
-
const [selectedAssetKeysInternalState, setSelectedAssetKeysInternalState] = useState(selectedAssetKeys ||
|
|
24
|
+
const [selectedAssetKeysInternalState, setSelectedAssetKeysInternalState] = useState(selectedAssetKeys || EMPTY_ARRAY);
|
|
26
25
|
const [softSelectedAssetKeyInternalState, setSoftSelectedAssetKeyInternalState] = useState(null);
|
|
27
26
|
useEffect(() => {
|
|
28
|
-
setSelectedAssetKeysInternalState(selectedAssetKeys ||
|
|
27
|
+
setSelectedAssetKeysInternalState(selectedAssetKeys || EMPTY_ARRAY);
|
|
29
28
|
}, [selectedAssetKeys]);
|
|
30
29
|
useEffect(() => {
|
|
31
30
|
setSelectedAssetKeysInternalState(current => {
|
|
@@ -52,7 +51,7 @@ const AssetGallery = React__default.forwardRef(function AssetGallery({
|
|
|
52
51
|
const onAssetSoftSelectedChanged = useCallback((assetKey = null) => {
|
|
53
52
|
setSoftSelectedAssetKeyInternalState(assetKey);
|
|
54
53
|
}, []);
|
|
55
|
-
return
|
|
54
|
+
return jsx(AssetGalleryBase, {
|
|
56
55
|
ref: forwardedRef,
|
|
57
56
|
assets: assets,
|
|
58
57
|
activeSummaryCard: activeSummaryCard,
|
|
@@ -69,34 +68,10 @@ const AssetGallery = React__default.forwardRef(function AssetGallery({
|
|
|
69
68
|
onAssetSoftSelectedChanged: onAssetSoftSelectedChanged,
|
|
70
69
|
component: component,
|
|
71
70
|
viewMode: viewMode,
|
|
72
|
-
hideConsentSummary: hideConsentSummary
|
|
73
|
-
|
|
71
|
+
hideConsentSummary: hideConsentSummary,
|
|
72
|
+
...props
|
|
73
|
+
});
|
|
74
74
|
});
|
|
75
|
-
AssetGallery.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
76
|
-
assets: PropTypes.arrayOf(PropTypes.shape(assetShape)),
|
|
77
|
-
displayIcon: PropTypes.string,
|
|
78
|
-
activeSummaryCard: PropTypes.bool,
|
|
79
|
-
viewMode: PropTypes.oneOf(['compact', 'grid']),
|
|
80
|
-
thumbnailMaxHeight: PropTypes.number,
|
|
81
|
-
selectable: PropTypes.bool,
|
|
82
|
-
customSelectedBorder: PropTypes.arrayOf(PropTypes.string),
|
|
83
|
-
selectedAssetKeys: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number)]),
|
|
84
|
-
onSelectedChanged: PropTypes.func,
|
|
85
|
-
softSelectable: PropTypes.bool,
|
|
86
|
-
scrollElement: PropTypes.instanceOf(Element),
|
|
87
|
-
onSoftSelectedChanged: PropTypes.func,
|
|
88
|
-
component: PropTypes.func,
|
|
89
|
-
hideConsentSummary: PropTypes.bool
|
|
90
|
-
} : {};
|
|
91
|
-
AssetGallery.defaultProps = {
|
|
92
|
-
assets: [],
|
|
93
|
-
viewMode: 'compact',
|
|
94
|
-
thumbnailMaxHeight: 300,
|
|
95
|
-
selectedAssetKeys: [],
|
|
96
|
-
customSelectedBorder: [],
|
|
97
|
-
activeSummaryCard: false,
|
|
98
|
-
displayIcon: ''
|
|
99
|
-
};
|
|
100
75
|
|
|
101
76
|
export { AssetGallery as default };
|
|
102
77
|
//# sourceMappingURL=AssetGallery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetGallery.js","sources":["../../../src/components/widgets/AssetGallery/AssetGallery.js"],"sourcesContent":["import { isFunction } from 'lodash';\nimport PropTypes from 'prop-types';\nimport React, { useCallback, useEffect, useState } from 'react';\nimport AssetGalleryBase from './AssetGalleryBase/AssetGalleryBase';\nimport { assetShape } from './asset.propType';\n\n/**\n * An asset gallery that can be used to display a larger amounts of assets. The Asset Gallery supports displaying\n * images and videos.\n *\n * ### Import\n *\n * ``` js\n * import { AssetGallery } from '@ntbjs/react-components/widgets'\n * // or\n * import AssetGallery from '@ntbjs/react-components/widgets/AssetGallery'\n * ```\n *\n * ### Custom asset card element\n * In some cases you may want to swap out the boring `<div>`-tag that wraps each individual asset in the gallery for\n * something more useful.\n * By doing this you can achieve side-effects that this library has no concept about – like wrapping the assets\n * in [React-routers](https://reactrouter.com/web/api/Link) `<Link>`-component for internal application routing when\n * you click the asset.\n *\n * The asset gallery allows you to change the root element that will be rendered around all individual asset via a\n * property on the asset object called `component`.\n *\n * ```jsx\n * const assets = [{\n * previewUrl: 'https://preview.sdl.no/v1/no/7Zb20FDFCu-dne-lxi1thQ/uRs25Mh-FJY?v=1613865342365',\n * width: 512,\n * height: 324\n * }]\n *\n * const customComponent = (asset, children) => (\n * <a href={`https://www.ntb.no/?fromAssetId=${asset.key}`} target=\"_blank\">\n * {children}\n * </a>\n * )\n *\n * <AssetGallery assets={assets} component={customComponent} />\n * ```\n *\n * When providing a custom element it will take the place of the `<div>` being the outer most parent of the\n * asset itself. All required props will then be automatically applied, like the `style`-attribute containing the\n * positioning style of the asset. To tell the asset gallery where you want the rest of the asset card we provide the `{children}`.\n *\n * **Note:** If the root-element of the custom component is a React component the component must accept rest props (`{...props}`).\n *\n * This pattern is very powerful and allows for great flexibility, as well as a way to interoperate with other\n * libraries, such as your favorite routing or forms library. **But it also comes with a small caveat!**\n *\n * #### Caveat with inlining\n * Using an inline function as an argument for the component prop may result in unexpected unmounting, since a new\n * component is passed every time React renders.\n *\n * If we are using an inline function to change the rendered component, React will remount each individual assets every\n * time `AssetGallery` is re-rendered. Not only will React update the DOM unnecessarily, the ripple effect of the individual\n * assets will also not work correctly.\n *\n * To fix this issue **avoid using inline functions or wrap the function in some sort of memoization**\n * like `React.useMemo()`.\n *\n * #### Prop Collisions\n * Prop Collisions is something to be aware of. The asset gallery will render your custom element like this:\n *\n * ```js\n * return React.createElement(props.component, props)\n * ```\n *\n * That means that all the required props that the library automatically applies will take precedence over consumer\n * defined props. An example of this is the `style`-prop.\n *\n */\nconst AssetGallery = React.forwardRef(function AssetGallery(\n {\n assets,\n activeSummaryCard,\n viewMode,\n thumbnailMaxHeight,\n selectable,\n customSelectedBorder,\n selectedAssetKeys,\n onSelectedChanged,\n softSelectable,\n scrollElement,\n onSoftSelectedChanged,\n component,\n displayIcon,\n hideConsentSummary,\n ...props\n },\n forwardedRef\n) {\n // Internal state of the selected assets\n const [selectedAssetKeysInternalState, setSelectedAssetKeysInternalState] = useState(\n selectedAssetKeys || []\n );\n\n // Internal state of the soft selected asset\n const [softSelectedAssetKeyInternalState, setSoftSelectedAssetKeyInternalState] = useState(null);\n\n // Whenever the `selectedAssetKeys`-props changes we need to update the internal state\n useEffect(() => {\n setSelectedAssetKeysInternalState(selectedAssetKeys || []);\n }, [selectedAssetKeys]);\n\n // When the assets change we need to check if we have to update the list of selected assets\n // (removing keys of assets that is no longer present in `assets`)\n useEffect(() => {\n setSelectedAssetKeysInternalState(current => {\n return current.filter(c => assets.some(a => a.key === c));\n });\n }, [assets.length]);\n\n // Run the `onSelectedChanged` callback whenever `selectedAssetKeysInternalState` change\n useEffect(() => {\n // If the external and internal state of selected assets is in sync we can skip this update callback\n if (selectedAssetKeys === selectedAssetKeysInternalState) return;\n\n if (isFunction(onSelectedChanged)) {\n onSelectedChanged(selectedAssetKeysInternalState);\n }\n }, [selectedAssetKeysInternalState]);\n\n // Run the `onSoftSelectedChanged` callback whenever `softSelectedAssetKeyInternalState` change\n useEffect(() => {\n if (isFunction(onSoftSelectedChanged)) {\n onSoftSelectedChanged(softSelectedAssetKeyInternalState);\n }\n }, [softSelectedAssetKeyInternalState]);\n\n const onSelected = useCallback(assetKey => {\n setSelectedAssetKeysInternalState(currentState => [...currentState, assetKey]);\n }, []);\n\n const onUnselected = useCallback(assetKey => {\n setSelectedAssetKeysInternalState(currentState =>\n currentState.filter(filteredAssetKey => filteredAssetKey !== assetKey)\n );\n }, []);\n\n const onAssetSoftSelectedChanged = useCallback((assetKey = null) => {\n setSoftSelectedAssetKeyInternalState(assetKey);\n }, []);\n\n return (\n <AssetGalleryBase\n ref={forwardedRef}\n assets={assets}\n activeSummaryCard={activeSummaryCard}\n displayIcon={displayIcon}\n thumbnailMaxHeight={thumbnailMaxHeight}\n selectable={selectable}\n customSelectedBorder={customSelectedBorder}\n selectedAssetKeys={selectedAssetKeysInternalState}\n onAssetSelected={onSelected}\n onAssetUnselected={onUnselected}\n softSelectable={softSelectable}\n softSelectedAssetKey={softSelectedAssetKeyInternalState}\n scrollElement={scrollElement}\n onAssetSoftSelectedChanged={onAssetSoftSelectedChanged}\n component={component}\n viewMode={viewMode}\n hideConsentSummary={hideConsentSummary}\n {...props}\n />\n );\n});\n\nAssetGallery.propTypes = {\n /**\n * An array of assets to display in the gallery.\n */\n assets: PropTypes.arrayOf(PropTypes.shape(assetShape)),\n\n /**\n * Whether the asset gallery should display the Version Count or Verifications on default.\n */\n displayIcon: PropTypes.string,\n\n /**\n * Whether the asset gallery should render the Asset Summary Card on hover.\n */\n activeSummaryCard: PropTypes.bool,\n\n /**\n * The view mode of the gallery.\n */\n viewMode: PropTypes.oneOf(['compact', 'grid']),\n\n /**\n * The maximum height of thumbnails in the gallery. When the grid is computed the gallery will try\n * to have each row of the gallery as close to the max height as possible.\n * This option is ignored unless `viewMode: 'compact'`.\n */\n thumbnailMaxHeight: PropTypes.number,\n\n /**\n * Whether or not the asset gallery should have selectable asset cards\n */\n selectable: PropTypes.bool,\n\n /**\n * Whether or not the asset gallery should have custom borders on selected asset: Example: customSelectedBorder: ['#893FEB', '#EB513F'], where: customSelectedBorder.[0] is for darkMode and customSelectedBorder.[1] is for lightMode\n */\n customSelectedBorder: PropTypes.arrayOf(PropTypes.string),\n\n /**\n * An array containing the keys of all selected assets\n */\n selectedAssetKeys: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.arrayOf(PropTypes.number)\n ]),\n\n /**\n * A callback function to run when the selected assets change\n */\n onSelectedChanged: PropTypes.func,\n\n /**\n * Whether the asset gallery should have soft selectable asset cards\n */\n softSelectable: PropTypes.bool,\n\n /**\n * Scrollable element to attach event listeners to. Defaults to window.\n */\n scrollElement: PropTypes.instanceOf(Element),\n\n /**\n * A callback function to run when the soft selected asset change\n */\n onSoftSelectedChanged: PropTypes.func,\n\n /**\n * A function that returns a custom component to use for the card in the gallery - The function provides\n * `asset` as its first argument\n */\n component: PropTypes.func,\n\n /**\n * When true, hides the consent summary footer on grid cards (CardFooter + CardDivider). Default: false.\n */\n hideConsentSummary: PropTypes.bool\n};\n\nAssetGallery.defaultProps = {\n assets: [],\n viewMode: 'compact',\n thumbnailMaxHeight: 300,\n selectedAssetKeys: [],\n customSelectedBorder: [],\n activeSummaryCard: false,\n displayIcon: ''\n};\n\nexport default AssetGallery;\n"],"names":["AssetGallery","React","forwardRef","assets","activeSummaryCard","viewMode","thumbnailMaxHeight","selectable","customSelectedBorder","selectedAssetKeys","onSelectedChanged","softSelectable","scrollElement","onSoftSelectedChanged","component","displayIcon","hideConsentSummary","props","forwardedRef","selectedAssetKeysInternalState","setSelectedAssetKeysInternalState","useState","softSelectedAssetKeyInternalState","setSoftSelectedAssetKeyInternalState","useEffect","current","filter","c","some","a","key","length","isFunction","onSelected","useCallback","assetKey","currentState","onUnselected","filteredAssetKey","onAssetSoftSelectedChanged","createElement","AssetGalleryBase","_extends","ref","onAssetSelected","onAssetUnselected","softSelectedAssetKey","propTypes","process","env","NODE_ENV","PropTypes","arrayOf","shape","assetShape","string","bool","oneOf","number","oneOfType","func","instanceOf","Element","defaultProps"],"mappings":";;;;;;;AA2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AG;AAC1B5D,EAAAA,MAAM,EAAE,EAAE;AACVE,EAAAA,QAAQ,EAAE,SAAS;AACnBC,EAAAA,kBAAkB,EAAE,GAAG;AACvBG,EAAAA,iBAAiB,EAAE,EAAE;AACrBD,EAAAA,oBAAoB,EAAE,EAAE;AACxBJ,EAAAA,iBAAiB,EAAE,KAAK;AACxBW,EAAAA,WAAW,EAAE,EAAA;AACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"AssetGallery.js","sources":["../../../src/components/widgets/AssetGallery/AssetGallery.tsx"],"sourcesContent":["import { isFunction } from 'lodash';\nimport React, { useCallback, useEffect, useState } from 'react';\nimport AssetGalleryBase from './AssetGalleryBase/AssetGalleryBase';\n\nconst EMPTY_ARRAY = [];\nimport type { Asset } from './asset.types';\n\ntype AssetGalleryOwnProps = {\n /**\n * An array of assets to display in the gallery.\n */\n assets?: Asset[];\n /**\n * Whether the asset gallery should display the Version Count or Verifications on default.\n */\n displayIcon?: string;\n /**\n * Whether the asset gallery should render the Asset Summary Card on hover.\n */\n activeSummaryCard?: boolean;\n /**\n * The view mode of the gallery.\n */\n viewMode?: 'compact' | 'grid';\n /**\n * The maximum height of thumbnails in the gallery. When the grid is computed the gallery will try\n * to have each row of the gallery as close to the max height as possible.\n * This option is ignored unless `viewMode: 'compact'`.\n */\n thumbnailMaxHeight?: number;\n /**\n * Whether or not the asset gallery should have selectable asset cards\n */\n selectable?: boolean;\n /**\n * Whether or not the asset gallery should have custom borders on selected asset: Example: customSelectedBorder: ['#893FEB', '#EB513F'], where: customSelectedBorder.[0] is for darkMode and customSelectedBorder.[1] is for lightMode\n */\n customSelectedBorder?: string[];\n /**\n * An array containing the keys of all selected assets\n */\n selectedAssetKeys?: string[] | number[];\n /**\n * A callback function to run when the selected assets change\n */\n onSelectedChanged?: (...args: any[]) => any;\n /**\n * Whether the asset gallery should have soft selectable asset cards\n */\n softSelectable?: boolean;\n /**\n * Scrollable element to attach event listeners to. Defaults to window.\n */\n scrollElement?: any; // TODO: PropTypes.instanceOf(Element)\n /**\n * A callback function to run when the soft selected asset change\n */\n onSoftSelectedChanged?: (...args: any[]) => any;\n /**\n * A function that returns a custom component to use for the card in the gallery - The function provides\n * `asset` as its first argument\n */\n component?: (...args: any[]) => any;\n /**\n * When true, hides the consent summary footer on grid cards (CardFooter + CardDivider). Default: false.\n */\n hideConsentSummary?: boolean;\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype Props = Omit<\n React.ComponentPropsWithoutRef<typeof AssetGalleryBase>,\n keyof AssetGalleryOwnProps\n> &\n AssetGalleryOwnProps;\n\n/**\n * An asset gallery that can be used to display a larger amounts of assets. The Asset Gallery supports displaying\n * images and videos.\n *\n * ### Import\n *\n * ``` js\n * import { AssetGallery } from '@ntbjs/react-components/widgets'\n * // or\n * import AssetGallery from '@ntbjs/react-components/widgets/AssetGallery'\n * ```\n *\n * ### Custom asset card element\n * In some cases you may want to swap out the boring `<div>`-tag that wraps each individual asset in the gallery for\n * something more useful.\n * By doing this you can achieve side-effects that this library has no concept about – like wrapping the assets\n * in [React-routers](https://reactrouter.com/web/api/Link) `<Link>`-component for internal application routing when\n * you click the asset.\n *\n * The asset gallery allows you to change the root element that will be rendered around all individual asset via a\n * property on the asset object called `component`.\n *\n * ```jsx\n * const assets = [{\n * previewUrl: 'https://preview.sdl.no/v1/no/7Zb20FDFCu-dne-lxi1thQ/uRs25Mh-FJY?v=1613865342365',\n * width: 512,\n * height: 324\n * }]\n *\n * const customComponent = (asset, children) => (\n * <a href={`https://www.ntb.no/?fromAssetId=${asset.key}`} target=\"_blank\">\n * {children}\n * </a>\n * )\n *\n * <AssetGallery assets={assets} component={customComponent} />\n * ```\n *\n * When providing a custom element it will take the place of the `<div>` being the outer most parent of the\n * asset itself. All required props will then be automatically applied, like the `style`-attribute containing the\n * positioning style of the asset. To tell the asset gallery where you want the rest of the asset card we provide the `{children}`.\n *\n * **Note:** If the root-element of the custom component is a React component the component must accept rest props (`{...props}`).\n *\n * This pattern is very powerful and allows for great flexibility, as well as a way to interoperate with other\n * libraries, such as your favorite routing or forms library. **But it also comes with a small caveat!**\n *\n * #### Caveat with inlining\n * Using an inline function as an argument for the component prop may result in unexpected unmounting, since a new\n * component is passed every time React renders.\n *\n * If we are using an inline function to change the rendered component, React will remount each individual assets every\n * time `AssetGallery` is re-rendered. Not only will React update the DOM unnecessarily, the ripple effect of the individual\n * assets will also not work correctly.\n *\n * To fix this issue **avoid using inline functions or wrap the function in some sort of memoization**\n * like `React.useMemo()`.\n *\n * #### Prop Collisions\n * Prop Collisions is something to be aware of. The asset gallery will render your custom element like this:\n *\n * ```js\n * return React.createElement(props.component, props)\n * ```\n *\n * That means that all the required props that the library automatically applies will take precedence over consumer\n * defined props. An example of this is the `style`-prop.\n *\n */\nconst AssetGallery = React.forwardRef<any, Props>(function AssetGallery(\n {\n assets = EMPTY_ARRAY,\n activeSummaryCard = false,\n viewMode = 'compact',\n thumbnailMaxHeight = 300,\n selectable,\n customSelectedBorder = EMPTY_ARRAY,\n selectedAssetKeys = EMPTY_ARRAY,\n onSelectedChanged,\n softSelectable,\n scrollElement,\n onSoftSelectedChanged,\n component,\n displayIcon = '',\n hideConsentSummary,\n ...props\n },\n forwardedRef\n) {\n // Internal state of the selected assets\n const [selectedAssetKeysInternalState, setSelectedAssetKeysInternalState] = useState(\n selectedAssetKeys || EMPTY_ARRAY\n );\n\n // Internal state of the soft selected asset\n const [softSelectedAssetKeyInternalState, setSoftSelectedAssetKeyInternalState] = useState(null);\n\n // Whenever the `selectedAssetKeys`-props changes we need to update the internal state\n useEffect(() => {\n setSelectedAssetKeysInternalState(selectedAssetKeys || EMPTY_ARRAY);\n }, [selectedAssetKeys]);\n\n // When the assets change we need to check if we have to update the list of selected assets\n // (removing keys of assets that is no longer present in `assets`)\n useEffect(() => {\n setSelectedAssetKeysInternalState(current => {\n return current.filter(c => assets.some(a => a.key === c));\n });\n }, [assets.length]);\n\n // Run the `onSelectedChanged` callback whenever `selectedAssetKeysInternalState` change\n useEffect(() => {\n // If the external and internal state of selected assets is in sync we can skip this update callback\n if (selectedAssetKeys === selectedAssetKeysInternalState) return;\n\n if (isFunction(onSelectedChanged)) {\n onSelectedChanged(selectedAssetKeysInternalState);\n }\n }, [selectedAssetKeysInternalState]);\n\n // Run the `onSoftSelectedChanged` callback whenever `softSelectedAssetKeyInternalState` change\n useEffect(() => {\n if (isFunction(onSoftSelectedChanged)) {\n onSoftSelectedChanged(softSelectedAssetKeyInternalState);\n }\n }, [softSelectedAssetKeyInternalState]);\n\n const onSelected = useCallback(assetKey => {\n setSelectedAssetKeysInternalState(currentState => [...currentState, assetKey]);\n }, []);\n\n const onUnselected = useCallback(assetKey => {\n setSelectedAssetKeysInternalState(currentState =>\n currentState.filter(filteredAssetKey => filteredAssetKey !== assetKey)\n );\n }, []);\n\n const onAssetSoftSelectedChanged = useCallback((assetKey = null) => {\n setSoftSelectedAssetKeyInternalState(assetKey);\n }, []);\n\n return (\n <AssetGalleryBase\n ref={forwardedRef}\n assets={assets}\n activeSummaryCard={activeSummaryCard}\n displayIcon={displayIcon}\n thumbnailMaxHeight={thumbnailMaxHeight}\n selectable={selectable}\n customSelectedBorder={customSelectedBorder}\n selectedAssetKeys={selectedAssetKeysInternalState}\n onAssetSelected={onSelected}\n onAssetUnselected={onUnselected}\n softSelectable={softSelectable}\n softSelectedAssetKey={softSelectedAssetKeyInternalState}\n scrollElement={scrollElement}\n onAssetSoftSelectedChanged={onAssetSoftSelectedChanged}\n component={component}\n viewMode={viewMode}\n hideConsentSummary={hideConsentSummary}\n {...props}\n />\n );\n});\n\nexport default AssetGallery;\n"],"names":["EMPTY_ARRAY","AssetGallery","React","forwardRef","assets","activeSummaryCard","viewMode","thumbnailMaxHeight","selectable","customSelectedBorder","selectedAssetKeys","onSelectedChanged","softSelectable","scrollElement","onSoftSelectedChanged","component","displayIcon","hideConsentSummary","props","forwardedRef","selectedAssetKeysInternalState","setSelectedAssetKeysInternalState","useState","softSelectedAssetKeyInternalState","setSoftSelectedAssetKeyInternalState","useEffect","current","filter","c","some","a","key","length","isFunction","onSelected","useCallback","assetKey","currentState","onUnselected","filteredAssetKey","onAssetSoftSelectedChanged","_jsx","AssetGalleryBase","ref","onAssetSelected","onAssetUnselected","softSelectedAssetKey"],"mappings":";;;;;AAIA,MAAMA,WAAW,GAAG,EAAE;AA6ItB,MAAMC,YAAY,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,YAAYA,CACrE;AACEG,EAAAA,MAAM,GAAGJ,WAAW;AACpBK,EAAAA,iBAAiB,GAAG,KAAK;AACzBC,EAAAA,QAAQ,GAAG,SAAS;AACpBC,EAAAA,kBAAkB,GAAG,GAAG;EACxBC,UAAU;AACVC,EAAAA,oBAAoB,GAAGT,WAAW;AAClCU,EAAAA,iBAAiB,GAAGV,WAAW;EAC/BW,iBAAiB;EACjBC,cAAc;EACdC,aAAa;EACbC,qBAAqB;EACrBC,SAAS;AACTC,EAAAA,WAAW,GAAG,EAAE;EAChBC,kBAAkB;EAClB,GAAGC;AACL,CAAC,EACDC,YAAY,EACZ;EAEA,MAAM,CAACC,8BAA8B,EAAEC,iCAAiC,CAAC,GAAGC,QAAQ,CAClFZ,iBAAiB,IAAIV,WACvB,CAAC;EAGD,MAAM,CAACuB,iCAAiC,EAAEC,oCAAoC,CAAC,GAAGF,QAAQ,CAAC,IAAI,CAAC;AAGhGG,EAAAA,SAAS,CAAC,MAAM;AACdJ,IAAAA,iCAAiC,CAACX,iBAAiB,IAAIV,WAAW,CAAC;AACrE,EAAA,CAAC,EAAE,CAACU,iBAAiB,CAAC,CAAC;AAIvBe,EAAAA,SAAS,CAAC,MAAM;IACdJ,iCAAiC,CAACK,OAAO,IAAI;AAC3C,MAAA,OAAOA,OAAO,CAACC,MAAM,CAACC,CAAC,IAAIxB,MAAM,CAACyB,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACC,GAAG,KAAKH,CAAC,CAAC,CAAC;AAC3D,IAAA,CAAC,CAAC;AACJ,EAAA,C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