@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors-export.js","sources":["../../../src/styles/utils/colors-export.js"],"sourcesContent":["export const colors = {\n 'orange-600': '#634e01',\n 'orange-500': '#ff9900',\n 'orange-400': '#ffcb7e',\n 'emerald-600': '#296c58',\n 'emerald-500': '#30826a',\n 'emerald-400': '#64b49d',\n 'emerald-300': '#bfe0d5',\n 'emerald-200': '#f3f9f7',\n 'gray-900': '#141313',\n 'gray-800': '#272727',\n 'gray-700': '#323232',\n 'gray-600': '#505050',\n 'gray-500': '#767676',\n 'gray-400': '#b0b6b9',\n 'gray-300': '#d9dce0',\n 'gray-200': '#eff1f4',\n 'gray-100': '#f7f8f9',\n 'gray-50': '#f4f4f5',\n 'cercise-500': '#5f1031',\n 'cercise-400': '#854962',\n 'cercise-300': '#d099b0',\n 'cercise-200': '#fecaca',\n 'cercise-100': '#f9f3f5',\n 'red-600': '#7f1b1b',\n 'red-500': '#d83000',\n 'red-200': '#fbeae6',\n 'brown-500': '#634e01',\n 'signal-yellow-500': '#f4e21e',\n 'signal-yellow-400': '#fff36c',\n 'signal-green-500': '#00bd98',\n 'signal-green-400': '#a3ffe0',\n 'black': '#202435',\n 'white': '#ffffff'\n};"],"names":["colors"],"mappings":"AAAO,MAAMA,MAAM,GAAG;AACpB,EAAA,YAAY,EAAE,SAAS;AACvB,EAAA,YAAY,EAAE,SAAS;AACvB,EAAA,YAAY,EAAE,SAAS;AACvB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,SAAS,EAAE,SAAS;AACpB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,SAAS,EAAE,SAAS;AACpB,EAAA,SAAS,EAAE,SAAS;AACpB,EAAA,SAAS,EAAE,SAAS;AACpB,EAAA,WAAW,EAAE,SAAS;AACtB,EAAA,mBAAmB,EAAE,SAAS;AAC9B,EAAA,mBAAmB,EAAE,SAAS;AAC9B,EAAA,kBAAkB,EAAE,SAAS;AAC7B,EAAA,kBAAkB,EAAE,SAAS;AAC7B,EAAA,OAAO,EAAE,SAAS;AAClB,EAAA,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"colors-export.js","sources":["../../../src/styles/utils/colors-export.js"],"sourcesContent":["export const colors = {\n 'orange-600': '#634e01',\n 'orange-500': '#ff9900',\n 'orange-400': '#ffcb7e',\n 'emerald-600': '#296c58',\n 'emerald-500': '#30826a',\n 'emerald-400': '#64b49d',\n 'emerald-300': '#bfe0d5',\n 'emerald-200': '#f3f9f7',\n 'gray-900': '#141313',\n 'gray-800': '#272727',\n 'gray-700': '#323232',\n 'gray-600': '#505050',\n 'gray-500': '#767676',\n 'gray-400': '#b0b6b9',\n 'gray-300': '#d9dce0',\n 'gray-200': '#eff1f4',\n 'gray-100': '#f7f8f9',\n 'gray-50': '#f4f4f5',\n 'cercise-500': '#5f1031',\n 'cercise-400': '#854962',\n 'cercise-300': '#d099b0',\n 'cercise-200': '#fecaca',\n 'cercise-100': '#f9f3f5',\n 'red-600': '#7f1b1b',\n 'red-500': '#d83000',\n 'red-200': '#fbeae6',\n 'brown-500': '#634e01',\n 'signal-yellow-500': '#f4e21e',\n 'signal-yellow-400': '#fff36c',\n 'signal-green-500': '#00bd98',\n 'signal-green-400': '#a3ffe0',\n 'black': '#202435',\n 'white': '#ffffff'\n};"],"names":["colors"],"mappings":"AAAO,MAAMA,MAAM,GAAG;AACpB,EAAA,YAAY,EAAE,SAAS;AACvB,EAAA,YAAY,EAAE,SAAS;AACvB,EAAA,YAAY,EAAE,SAAS;AACvB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,UAAU,EAAE,SAAS;AACrB,EAAA,SAAS,EAAE,SAAS;AACpB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,aAAa,EAAE,SAAS;AACxB,EAAA,SAAS,EAAE,SAAS;AACpB,EAAA,SAAS,EAAE,SAAS;AACpB,EAAA,SAAS,EAAE,SAAS;AACpB,EAAA,WAAW,EAAE,SAAS;AACtB,EAAA,mBAAmB,EAAE,SAAS;AAC9B,EAAA,mBAAmB,EAAE,SAAS;AAC9B,EAAA,kBAAkB,EAAE,SAAS;AAC7B,EAAA,kBAAkB,EAAE,SAAS;AAC7B,EAAA,OAAO,EAAE,SAAS;AAClB,EAAA,OAAO,EAAE;AACX;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateTime.js","sources":["../../src/utils/dateTime.
|
|
1
|
+
{"version":3,"file":"dateTime.js","sources":["../../src/utils/dateTime.ts"],"sourcesContent":["/**\n * Convert time given in miliseconds to a string representation of hours, minutes and seconds\n * in the format HH:MM:SS\n *\n * The hours segment is omitted entirely for durations under an hour, so the\n * result is `MM:SS` there — the `HH:` above is the maximal form, not a promise\n * about width. Both call sites (`AssetGalleryGridCard`,\n * `AssetGalleryCompactCard`) feed it straight into a `Badge`.\n *\n * @param ms duration in milliseconds. `number`, not `number | string`: the body\n * divides it, and a string would produce `NaN:NaN` rather than fail\n */\nexport const convertMsToHMS = (ms: number): string => {\n const seconds = Math.floor(ms / 1000);\n const minutes = Math.floor(seconds / 60);\n const hours = Math.floor(minutes / 60);\n\n const secondsLeft = seconds % 60;\n const minutesLeft = minutes % 60;\n\n let hmsString = '';\n if (hours) {\n hmsString += hours < 10 ? `0${hours}:` : `${hours}:`;\n }\n\n hmsString += `${minutesLeft < 10 ? `0${minutesLeft}` : `${minutesLeft}`}:`;\n hmsString += secondsLeft < 10 ? `0${secondsLeft}` : `${secondsLeft}`;\n\n return hmsString;\n};\n"],"names":["convertMsToHMS","ms","seconds","Math","floor","minutes","hours","secondsLeft","minutesLeft","hmsString"],"mappings":"AAYO,MAAMA,cAAc,GAAIC,EAAU,IAAa;EACpD,MAAMC,OAAO,GAAGC,IAAI,CAACC,KAAK,CAACH,EAAE,GAAG,IAAI,CAAC;EACrC,MAAMI,OAAO,GAAGF,IAAI,CAACC,KAAK,CAACF,OAAO,GAAG,EAAE,CAAC;EACxC,MAAMI,KAAK,GAAGH,IAAI,CAACC,KAAK,CAACC,OAAO,GAAG,EAAE,CAAC;AAEtC,EAAA,MAAME,WAAW,GAAGL,OAAO,GAAG,EAAE;AAChC,EAAA,MAAMM,WAAW,GAAGH,OAAO,GAAG,EAAE;EAEhC,IAAII,SAAS,GAAG,EAAE;AAClB,EAAA,IAAIH,KAAK,EAAE;IACTG,SAAS,IAAIH,KAAK,GAAG,EAAE,GAAG,CAAA,CAAA,EAAIA,KAAK,CAAA,CAAA,CAAG,GAAG,CAAA,EAAGA,KAAK,CAAA,CAAA,CAAG;AACtD,EAAA;AAEAG,EAAAA,SAAS,IAAI,CAAA,EAAGD,WAAW,GAAG,EAAE,GAAG,CAAA,CAAA,EAAIA,WAAW,CAAA,CAAE,GAAG,CAAA,EAAGA,WAAW,EAAE,CAAA,CAAA,CAAG;EAC1EC,SAAS,IAAIF,WAAW,GAAG,EAAE,GAAG,CAAA,CAAA,EAAIA,WAAW,CAAA,CAAE,GAAG,CAAA,EAAGA,WAAW,CAAA,CAAE;AAEpE,EAAA,OAAOE,SAAS;AAClB;;;;"}
|
|
@@ -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.js"],"sourcesContent":["import { colors } from '../styles/utils/colors-export';\nimport { css } from 'styled-components';\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};\n\n/**\n * Applies a different css property value for dark and light mode\n * @param {string} property - The css property to apply - Eg: `color`, `background`\n * @param {string} darkMode - The value that will be applied in dark mode\n * @param {string} lightMode - The value that will be applied in light mode - Will also be used if either dark or light mode is set\n * @param specificity\n */\nfunction themeProp(property, darkMode, lightMode, specificity = 2) {\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\nexport function applyDefaultTheme({ theme = {}, ...props }) {\n return {\n ...props,\n theme: {\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}\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"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"defaultTheme.js","sources":["../../src/utils/defaultTheme.ts"],"sourcesContent":["/// <reference path=\"../types/assets.d.ts\" />\n/**\n * The theme contract. Fan-in 36 — every `*.styled.ts` file in the library\n * imports from here, and 737 interpolations read `props.theme`.\n *\n * ================== TWO THINGS IN THIS FILE ARE LOAD-BEARING =================\n *\n * 1. THE `/// <reference>` ON LINE 1 IS NOT REDUNDANT WITH tsconfig's `include`.\n * It is what makes src/types/assets.d.ts reachable from the CONSUMER's\n * program. Declarations have to be reachable through the IMPORT GRAPH, not\n * merely present in the repo: the consumer's program roots are its own files\n * and it will never add `<lib>/src/types/*.d.ts` to its `include`. Measured —\n * with the declarations present but unreferenced, the consumer-shaped program\n * still reported all 40 svg and 5 css errors while our own typecheck showed\n * none. This file is the right host because everything reaches it: fan-in 36.\n * `scripts/ts-migration/tsconfig.reachability-probe.json` is the gate.\n *\n * 2. THE `DefaultTheme` AUGMENTATION LIVES HERE, NOT IN A SEPARATE MODULE.\n * styled-components v6 ships `DefaultTheme` as an empty interface\n * (`interface DefaultTheme extends Record<keyof object, any> {}`), which is\n * why all 737 `props.theme.getColor(...)` / `themeProp(...)` reads were\n * TS2339. Augmenting it from a separate `src/types/styled-theme.ts` measured\n * the same (773 vs 774 errors) but needed a side-effect import or a\n * `/// <reference>` in every consumer to be reachable. Here it is reachable\n * BY CONSTRUCTION from all 36 importers, with no scaffolding and no runtime\n * import cycle. See playbook §A.1.\n * ============================================================================\n */\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/**\n * Looks up a design-token colour.\n *\n * Throws at runtime for an unregistered name, which is why the parameter is the\n * closed `ColorName` union rather than `string`: the error moves from a runtime\n * throw inside a styled template to a compile error at the call site.\n */\nexport type GetColor = (name: ColorName) => string;\n\n/**\n * A value `themeProp` interpolates into the generated rule. Widened to\n * styled-components' own `Interpolation` because that is literally what happens\n * to it — six call sites in `Badge.styled.ts` and `Tabs.styled.ts` pass a\n * `() => string` callback rather than a string, and two in `TextInput.styled.ts`\n * pass numbers. The guarantee this type buys is ARITY, not value narrowness.\n */\nexport type ThemePropValue = Interpolation<object>;\n\n/**\n * Emits one declaration three times — for `body.dark-theme`, for\n * `body.light-theme`, and for neither-class-set with a\n * `prefers-color-scheme: dark` fallback — so a single property can differ\n * between themes.\n *\n * TWO REPO CONVENTIONS THE TYPE SYSTEM CANNOT ENFORCE, and both cause real\n * visual bugs when broken:\n *\n * - **Never call `themeProp()` inside an `&::after` / `&::before` block.** The\n * generated `body.dark-theme &&` selector cannot address a pseudo-element from\n * inside one. Write the two rules out explicitly instead:\n * `body.light-theme &::after { … }` and `body.dark-theme &::after { … }`.\n *\n * - **Prefer static `&[data-x='state']` selectors over dynamic\n * `${props => css\\`…\\`}` rules for per-instance state.** Interpolated rules\n * share the component's `componentId`, so two instances in different states\n * collide and one wins for both.\n *\n * @param property the CSS property, e.g. `color`, `background`, or a custom\n * property like `--checkbox-black-box`\n * @param darkMode the value applied under `body.dark-theme`\n * @param lightMode the value applied under `body.light-theme`, and the fallback\n * when neither class is present\n * @param specificity how many `&` to repeat in the generated selector. A NUMBER —\n * the implementation does `Array(specificity).fill('&')`, so a\n * string silently produces a one-element array and specificity\n * 1. Typing it `number` is deliberate: it turns the one site\n * that passes `'!important'` here into a compile error rather\n * than blessing it.\n */\nexport type ThemeProp = (\n property: string,\n darkMode: ThemePropValue,\n lightMode: ThemePropValue,\n specificity?: number\n) => RuleSet<object>;\n\n/**\n * Spacing scale. Consumed by react-select through its own `theme` prop as well\n * as by our styled templates, which is why the member names are react-select's.\n */\nexport interface ThemeSpacing {\n baseUnit: number;\n controlHeight: number;\n menuGutter: number;\n}\n\n/**\n * react-select's colour contract, filled from our palette. These names are\n * react-select's, not ours — do not rename them to design-token names.\n */\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/**\n * The whole theme, as a styled template sees it.\n *\n * Every member is REQUIRED, which is the truth inside an interpolation\n * (`props.theme.getColor` is always there) and a constraint at the\n * `<ThemeProvider>` boundary. Nothing in this repo hands over a partial theme —\n * the only `ThemeProvider` is `.storybook/preview.js`, with the full\n * `defaultTheme`. A consumer that wants to override part of it uses\n * `PartialNtbTheme` + `applyDefaultTheme`, which is what every `.styled` file\n * here does.\n */\nexport interface NtbTheme {\n getColor: GetColor;\n primaryFontFamily: string;\n secondaryFontFamily: string;\n themeProp: ThemeProp;\n spacing: ThemeSpacing;\n colors: ThemeColors;\n}\n\n/** A theme override: any subset of `NtbTheme`. */\nexport type PartialNtbTheme = Partial<NtbTheme>;\n\n/**\n * What `applyDefaultTheme` accepts.\n *\n * DELIBERATELY NOT `ExecutionProps & { theme?: PartialNtbTheme }`.\n * `ExecutionProps['theme']` is `DefaultTheme | undefined`, and after the\n * augmentation below `DefaultTheme` is `NtbTheme` with every member required —\n * so intersecting makes the override required again and the function's own\n * `theme = {}` default stops compiling (TS2322). Extra props still flow in\n * fine: this is a parameter position, so a caller passing the full styled\n * execution context is accepted and the runtime spreads the rest through\n * unchanged.\n */\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 /*\n * `satisfies`, not `: NtbTheme`. It checks the object against the contract in\n * BOTH directions — a missing member fails assignability and an extra one\n * fails the excess-property check on this fresh literal — while keeping the\n * inferred literal types of the members. That is the drift guard: the runtime\n * object and the published interface cannot disagree.\n *\n * An annotation (`const defaultTheme: NtbTheme = …`) would widen\n * `primaryFontFamily` to `string`, and deriving the contract the other way\n * (`type NtbTheme = typeof defaultTheme`) would give up the per-member JSDoc\n * that surfaces at 737 call sites, the closed `ColorName` parameter on\n * `getColor`, and the nameable `ThemeColors` / `ThemeSpacing` exports.\n */\n} satisfies NtbTheme;\n\n/**\n * Applies a different css property value for dark and light mode.\n *\n * Read `ThemeProp` above before changing the signature — its JSDoc carries the\n * two conventions that the type system cannot enforce and that cause real\n * visual bugs when broken.\n */\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/**\n * `.attrs()` helper: merges a caller's partial theme over `defaultTheme` so\n * every interpolation can rely on the full contract.\n *\n * THE RETURN TYPE IS `{ theme: NtbTheme }` AND NOT `P & { theme: NtbTheme }`,\n * ON PURPOSE. `attrs` merges its result OVER the incoming props, so a declared\n * type only has to describe what this function CONTRIBUTES. Saying it also\n * returns the caller's props re-declares them from a position that knows nothing\n * about them, which is what produced the measured 25–31 TS2345 `.attrs()`\n * assignability errors. The runtime still spreads the rest through — that part\n * is unchanged, and 36 `.styled` files depend on it.\n */\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 /*\n * Assigned to a local first so the returned object is not a fresh literal at\n * the `return`. The excess-property check would otherwise reject the spread\n * props against the narrow `{ theme: NtbTheme }` return type — and widening\n * the return type to keep the literal is exactly the mistake the JSDoc above\n * is about.\n */\n const attrs = { ...props, theme: merged };\n return attrs;\n}\n\n/*\n * The augmentation. This is the 21 lines that were worth 774 errors: it tells\n * styled-components what `props.theme` is, everywhere, for every `.styled` file\n * and for the consumer.\n *\n * It has to be a module augmentation of 'styled-components' rather than an\n * interface in our own namespace, because `ExecutionContext.theme` is typed as\n * `DefaultTheme` inside styled-components' own declarations and nothing we\n * export can influence that from outside.\n */\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":";;;AAoKO,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;AAC9BU,IAAAA,SAAS,EAAEV,MAAM,CAAC,aAAa,CAAC;AAChCW,IAAAA,SAAS,EAAEX,MAAM,CAAC,aAAa,CAAC;AAChCY,IAAAA,SAAS,EAAEZ,MAAM,CAAC,aAAa,CAAC;AAChCa,IAAAA,MAAM,EAAEb,MAAM,CAAC,SAAS,CAAC;AACzBc,IAAAA,QAAQ,EAAEd,MAAM,CAAC,OAAO,CAAC;AACzBe,IAAAA,QAAQ,EAAEf,MAAM,CAAC,SAAS,CAAC;AAC3BgB,IAAAA,SAAS,EAAEhB,MAAM,CAAC,UAAU,CAAC;AAC7BiB,IAAAA,SAAS,EAAEjB,MAAM,CAAC,UAAU,CAAC;AAC7BkB,IAAAA,SAAS,EAAElB,MAAM,CAAC,UAAU,CAAC;AAC7BmB,IAAAA,SAAS,EAAEnB,MAAM,CAAC,UAAU,CAAC;AAC7BoB,IAAAA,SAAS,EAAEpB,MAAM,CAAC,UAAU,CAAC;AAC7BqB,IAAAA,SAAS,EAAErB,MAAM,CAAC,UAAU,CAAC;AAC7BsB,IAAAA,SAAS,EAAEtB,MAAM,CAAC,UAAU,CAAC;AAC7BuB,IAAAA,SAAS,EAAEvB,MAAM,CAAC,UAAU,CAAC;IAC7BwB,SAAS,EAAExB,MAAM,CAAC,OAAO;AAC3B;AAcF;AASA,SAASI,SAASA,CAChBqB,QAAgB,EAChBC,QAAwB,EACxBC,SAAyB,EACzBC,WAAmB,GAAG,CAAC,EACN;AACjB,EAAA,MAAMC,iBAAiB,GAAGC,KAAK,CAACF,WAAW,CAAC,CAACG,IAAI,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC,EAAE,CAAC;EAE/D,OAAOC,GAAG,8KACUJ,iBAAiB,EAC/BJ,QAAQ,EAAKC,QAAQ,EAGNG,iBAAiB,EAChCJ,QAAQ,EAAKE,SAAS,EAGgBE,iBAAiB,EACvDJ,QAAQ,EAAKE,SAAS,EAGpBF,QAAQ,EAAKC,QAAQ,CAAA;AAI/B;AAcO,SAASQ,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;AASD,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/**\n * Reads a child element's `ref` across the peer range (`react >= 16.14`).\n *\n * `ref` is a regular prop only from React 19. Before that `createElement` moves it to\n * `element.ref`, so reading `element.props.ref` silently returns `undefined` and the\n * `cloneElement(children, { ref })` that follows destroys the child's ref.\n *\n * Neither location can be read unconditionally: React 19 warns on `element.ref`, React\n * 18.3 warns on `props.ref`. Both warnings are `console.error`, which the stories gate\n * fails on. The property SHAPE says which is live, measured on 19.2.4:\n *\n * React 19, ref passed props.ref data prop element.ref warning getter\n * React 19, no ref props.ref absent element.ref data prop (null)\n * React <19 props.ref absent element.ref data prop\n * React 18.3, ref passed props.ref warning get element.ref data prop\n *\n * Returning early on React 19's data-property `props.ref` is what keeps every branch off\n * a warning getter.\n */\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, the live ref is on the element.\n if (propsRef?.get && (propsRef.get as WarningGetter).isReactWarning) {\n return withRef.ref ?? null;\n }\n\n // React 19: a genuine prop. Returning here avoids the deprecated element.ref getter.\n if (propsRef) {\n return withRef.props.ref ?? null;\n }\n\n // React 19 with no ref, or any React before 19 — element.ref is a plain data property.\n return withRef.ref ?? null;\n}\n"],"names":["getElementRef","element","withRef","propsRef","Object","getOwnPropertyDescriptor","props","get","isReactWarning","ref"],"mappings":"AAqBO,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":["/**\n * tippy's `trigger` space-string, parsed into the three discrete Floating UI\n * interaction hooks.\n *\n * WHY THIS EXISTS AS A SEPARATE, PURE FUNCTION. tippy takes ONE prop —\n * `trigger=\"mouseenter focus\"` — and does its own tokenising\n * (`splitBySpaces(instance.props.trigger).forEach(...)` in\n * `tippy.js/dist/tippy.cjs.js`). Floating UI has no equivalent: it has three\n * separate Hooks (`useClick`, `useHover`, `useFocus`), each with its own\n * `enabled` flag. `Popover` and `Tooltip` both publish `trigger` as a documented\n * prop and 62 consumer call sites pass it, so the string has to survive — which\n * means exactly one place has to own the string → flags translation. This is it,\n * and it is a pure function so it can be reasoned about (and later tested)\n * without mounting anything.\n *\n * It lives in `src/utils/` rather than `src/hooks/` deliberately: it calls no\n * Hook, has no React import, and `useFloatingPopover` is not its only plausible\n * caller — a `<Popover>` that needs to know \"does this trigger imply hover?\" for\n * a styling decision can ask without pulling in a Hook.\n */\n\n/**\n * Which Floating UI interaction Hooks a tippy trigger string turns on.\n *\n * All three are REQUIRED and always present. This is a computed result, not a\n * bag of options: \"the caller did not mention hover\" and \"hover is off\" are the\n * same statement here, and an optional member would let a caller write\n * `if (parsed.hover === undefined)` as though there were a third state.\n */\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/**\n * tippy's own default, measured — `tippy.js/dist/tippy.cjs.js`:\n *\n * ```js\n * var defaultProps = Object.assign({\n * …\n * trigger: 'mouseenter focus',\n * …\n * }, pluginProps, renderProps);\n * ```\n *\n * `Tooltip.tsx` declares no default for `trigger` and passes `undefined`\n * straight through, so `undefined` HAS ALWAYS MEANT `'mouseenter focus'` for\n * every tooltip in the library and in both consumers. `parseTrigger(undefined)`\n * therefore has to return hover+focus, not nothing — see the `trigger`\n * parameter's note.\n *\n * (`Popover.tsx` declares its own default, `'click focus'`, so it never relies\n * on this one.)\n */\nexport const TIPPY_DEFAULT_TRIGGER = 'mouseenter focus';\n\n/**\n * The tokens tippy recognises, and what each one becomes.\n *\n * | token | tippy listeners | Floating UI |\n * | ------------ | -------------------------------- | ---------------- |\n * | `click` | `click` | `useClick` |\n * | `mouseenter` | `mouseenter` + `mouseleave` | `useHover` |\n * | `focus` | `focusin` + `blur` | `useFocus` |\n * | `focusin` | `focusin` + `focusout` | `useFocus` |\n * | `manual` | none — tippy `return`s early | none |\n *\n * `focus` and `focusin` collapse to the same Hook. tippy distinguishes them only\n * by which *close* event it listens for (non-bubbling `blur` vs bubbling\n * `focusout`), and `useFocus` attaches `focus`/`blur` to the reference itself,\n * which covers both. The distinction was never observable through our public\n * props: both components document `focusin` as an example value and pass the\n * string through unread.\n *\n * Anything else — including `manual`, and including a typo — turns nothing on.\n * That is tippy's behaviour too: it iterates the tokens and only its four\n * `switch` cases attach anything, so an unrecognised token is silently inert. We\n * do not throw on it, because throwing would turn a consumer's harmless typo\n * into a runtime crash at a call site that works today.\n */\nconst CLICK_TOKEN = 'click';\nconst HOVER_TOKEN = 'mouseenter';\nconst FOCUS_TOKENS = ['focus', 'focusin'];\n\n/**\n * Parses a tippy `trigger` prop into `{ click, hover, focus }`.\n *\n * THE THREE INPUTS THAT ARE EASY TO GET WRONG, all of them in use:\n *\n * - **`undefined`** (and `null`) means \"tippy's default\", i.e. hover+focus. It\n * does NOT mean \"no triggers\". Every `<Tooltip>` in the library that does not\n * pass `trigger` relies on this.\n * - **`''`** means NO TRIGGERS AT ALL, and it is used. Measured, in BOTH\n * consumers — `mb-main-client/src/components/assets/sales_overlay.tsx:246` and\n * `ntb-dam/client/src/components/assets/sales_overlay.js:245`:\n *\n * ```jsx\n * trigger={assetsHasAllRequiredData ? \"\" : \"mouseenter focus\"}\n * ```\n *\n * i.e. `''` is how that call site turns the tooltip OFF conditionally. Return\n * anything truthy for it and a tooltip appears where the consumer suppressed\n * one. `''.split(/\\s+/)` is `['']`, which is why the `filter(Boolean)`\n * below is load-bearing rather than tidiness — without it `''` would be\n * treated as an unrecognised token, which happens to give the same answer here\n * but would stop doing so the moment a token were matched loosely.\n * - **A controlled popover ignores the result entirely.** That decision is NOT\n * made here: this function reports what the string says, and\n * `useFloatingPopover` is what gates the Hooks off when `visible` is a\n * boolean. Keeping the two apart means the parse stays testable and the\n * controlled-mode rule lives in one place instead of two.\n *\n * Whitespace is split on `/\\s+/` and not `' '`, matching tippy's\n * `splitBySpaces`, so `'click\\n focus'` parses the same way tippy parses it.\n *\n * @param trigger tippy's `trigger` prop. `undefined`/`null` → the tippy default\n * (`'mouseenter focus'`); `''` → nothing enabled\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":"AA0DO,MAAMA,qBAAqB,GAAG;AA0BrC,MAAMC,WAAW,GAAG,OAAO;AAC3B,MAAMC,WAAW,GAAG,YAAY;AAChC,MAAMC,YAAY,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC;AAoClC,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/*\n * NMB-3998 §C.2: `props` is spread onto `S.AssetAction`, so the published type\n * has to admit that target's props too — a closed type here is worse than `any` for the\n * 125 consumer files. Declared members win over the base (`Omit` by `keyof AssetActionOwnProps`);\n * a bare `&` would INTERSECT a colliding member instead of overriding it, which narrows\n * it (measured: `rows?: number | string` & `rows?: number`) or empties it to `never`.\n */\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 /*\n * NMB-3998: `useState('bottom')` widens to `string`, and `useFloating`'s `placement` is\n * the closed `Placement` union — TS2322. `as const` pins it to the literal `'bottom'`,\n * which IS a `Placement`. No setter is destructured here, so this state is a constant and\n * the literal type cannot be too narrow. `as const` erases, so the emitted JS is\n * identical.\n */\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":"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"}
|
|
@@ -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":["/*\n * $-transient-prop pattern: rules in\n * `src/components/layout/SectionSeparator/SectionSeparator.styled.ts`, derivation and\n * measurements in `scripts/TS-MIGRATION-PLAYBOOK.md` §J.\n *\n * The run-together `$actionWidthHeightactionWidthHeight` read that used to guard\n * `AssetActionButton`'s `svg { width: … }` is FIXED — it now reads `$actionWidthHeight`,\n * the only key `AssetAction.tsx` passes, so the svg's width and height are once again\n * derived from the same array. That activates a branch which had never fired, so it moves\n * the render baseline (§E.3/§J.8); the re-record is a separate, reviewed commit.\n */\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nimport { FloatingArrow } from '@floating-ui/react';\n\n/**\n * `AssetActionButton`'s props, i.e. what `AssetAction.tsx` passes to it:\n * `$actionWidthHeight={action.actionWidthHeight}` and nothing else.\n */\ninterface AssetActionButtonStyleProps {\n /**\n * `action.actionWidthHeight` — `PropTypes.arrayOf(PropTypes.number)`, read as\n * `[width, height]`. `number[]` and not `[number, number]`: the propTypes say an\n * array of numbers of any length, and the template guards on the array's presence\n * rather than its length. The values are px and are also used arithmetically\n * (`- 14`), so `number` and not `number | string`.\n */\n $actionWidthHeight?: number[];\n}\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`, and\n * the two majors disagree on the second parameter. §J.4. `prop` needs the annotation\n * because `withConfig` takes this by reference, so it gets no contextual typing.\n */\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":"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"}
|
|
@@ -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/*\n * NMB-3998 §C.2: `props` is spread onto `AssetAction`, so the published type\n * has to admit that target's props too — a closed type here is worse than `any` for the\n * 125 consumer files. Declared members win over the base (`Omit` by `keyof AssetActionsBaseOwnProps`);\n * a bare `&` would INTERSECT a colliding member instead of overriding it, which narrows\n * it (measured: `rows?: number | string` & `rows?: number`) or empties it to `never`.\n */\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":";;;;;AAwBA,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":["/*\n * $-transient-prop pattern: rules in\n * `src/components/layout/SectionSeparator/SectionSeparator.styled.ts`, derivation and\n * measurements in `scripts/TS-MIGRATION-PLAYBOOK.md` §J.\n *\n * NO COMPONENT IN THIS FILE READS A PROP, so there is no transient-prop type to declare —\n * rule 2, declare only what is actually passed and read. It reported ZERO errors before\n * this commit, and the one thing left to do is the predicate below.\n */\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`, and\n * the two majors disagree on the second parameter (v6 `elementToBeCreated`, v5.1\n * `defaultValidatorFn`). A one-parameter function is assignable to both. §J.4.\n *\n * `prop` NEEDS THE ANNOTATION EVEN THOUGH ITS ABSENCE REPORTED NO ERROR. `withConfig`\n * receives this by reference, so it gets no contextual typing and `prop` was an implicit\n * `any` — silent, because `noImplicitAny` is off (+474 errors, see `tsconfig.json`). With\n * `any` there, `prop.startsWith` is unchecked: a typo in the method name would have been a\n * runtime TypeError in the prop filter of every component in the file. A file at zero\n * errors is not the same as a file that is checked.\n */\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":";;;AAwBA,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
|