@ntbjs/react-components 2.0.14 → 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 -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 +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,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React__default, { useState } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import { useState } from 'react';
|
|
4
2
|
import { Container, Label, InnerContainer, Completed, ProgressBarTrack, MetricsContainer, ProgressBarFill, PercentageIndicator, ExternalPercentageIndicator, Link, ButtonLink, StyledArrowIcon } from './ProgressBar.styled.js';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
4
|
|
|
6
5
|
const ProgressBar = ({
|
|
7
6
|
totalAssets,
|
|
@@ -32,41 +31,44 @@ const ProgressBar = ({
|
|
|
32
31
|
return shortNum.toFixed(shortNum < 10 ? 1 : 0) + units[unit];
|
|
33
32
|
}
|
|
34
33
|
};
|
|
35
|
-
return
|
|
36
|
-
height: height
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
34
|
+
return jsxs(Container, {
|
|
35
|
+
height: height,
|
|
36
|
+
...props,
|
|
37
|
+
children: [jsx(Label, {
|
|
38
|
+
children: label
|
|
39
|
+
}), jsxs(InnerContainer, {
|
|
40
|
+
type: type,
|
|
41
|
+
children: [jsx(Completed, {
|
|
42
|
+
type: type,
|
|
43
|
+
children: formatNumberNew(completedAssets)
|
|
44
|
+
}), jsxs(ProgressBarTrack, {
|
|
45
|
+
children: [jsxs(MetricsContainer, {
|
|
46
|
+
$hasLink: Boolean(linkText),
|
|
47
|
+
children: [jsx(ProgressBarFill, {
|
|
48
|
+
type: type,
|
|
49
|
+
$percentage: percentage,
|
|
50
|
+
barColor: barColor,
|
|
51
|
+
children: !isLowPercentage && jsx(PercentageIndicator, {
|
|
52
|
+
children: percentageText || formattedPercentage
|
|
53
|
+
})
|
|
54
|
+
}), isLowPercentage && jsx(ExternalPercentageIndicator, {
|
|
55
|
+
children: percentageText || formattedPercentage
|
|
56
|
+
})]
|
|
57
|
+
}), linkText && jsxs(Link, {
|
|
58
|
+
onClick: handleLinkClick,
|
|
59
|
+
onMouseEnter: () => setIsLinkHovered(true),
|
|
60
|
+
onMouseLeave: () => setIsLinkHovered(false),
|
|
61
|
+
children: [jsx(ButtonLink, {
|
|
62
|
+
$isHovered: isLinkHovered,
|
|
63
|
+
children: linkText
|
|
64
|
+
}), jsx(StyledArrowIcon, {
|
|
65
|
+
$isHovered: isLinkHovered
|
|
66
|
+
})]
|
|
67
|
+
})]
|
|
68
|
+
})]
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
58
71
|
};
|
|
59
|
-
ProgressBar.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
60
|
-
totalAssets: PropTypes.number.isRequired,
|
|
61
|
-
completedAssets: PropTypes.number.isRequired,
|
|
62
|
-
percentageText: PropTypes.string,
|
|
63
|
-
barColor: PropTypes.string,
|
|
64
|
-
height: PropTypes.number,
|
|
65
|
-
label: PropTypes.string,
|
|
66
|
-
type: PropTypes.string,
|
|
67
|
-
linkText: PropTypes.string,
|
|
68
|
-
onClick: PropTypes.func
|
|
69
|
-
} : {};
|
|
70
72
|
|
|
71
73
|
export { ProgressBar as default };
|
|
72
74
|
//# sourceMappingURL=ProgressBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","sources":["../../../src/components/widgets/ProgressBar/ProgressBar.
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","sources":["../../../src/components/widgets/ProgressBar/ProgressBar.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport * as S from './ProgressBar.styled';\n\ntype ProgressBarOwnProps = {\n totalAssets: number;\n completedAssets: number;\n percentageText?: string;\n barColor?: string;\n height?: number;\n label?: string;\n type?: string;\n linkText?: string;\n onClick?: (...args: any[]) => any;\n};\n\n/*\n * NMB-3998 §C.2: `props` is spread onto `S.Container`, 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 ProgressBarOwnProps`);\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.Container>, keyof ProgressBarOwnProps> &\n ProgressBarOwnProps;\n\n/**\n * ProgressBar that let you progress through a task.\n *\n *\n * ### Import\n *\n * ``` js\n * import { ProgressBar } from '@ntbjs/react-components/widgets/ProgressBar'\n * // or\n * import ProgressBar from '@ntbjs/react-components/widgets/ProgressBar'\n * ```\n *\n *\n */\n\nconst ProgressBar = ({\n totalAssets,\n completedAssets,\n percentageText,\n barColor,\n height,\n label,\n type,\n linkText,\n onClick,\n ...props\n}: Props) => {\n const [isLinkHovered, setIsLinkHovered] = useState(false);\n\n const safeCompletedAssets = Math.max(0, completedAssets);\n const safeTotalAssets = Math.max(1, totalAssets);\n const percentage = (safeCompletedAssets / safeTotalAssets) * 100;\n const formattedPercentage = `${Math.round(percentage)}%`;\n\n const isLowPercentage = percentage <= 5;\n\n const handleLinkClick = e => onClick(e);\n\n const formatNumberNew = num => {\n if (num < 1000000) {\n return num.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ' ');\n } else {\n const units = ['K', 'M', 'B', 'T'];\n const unit = Math.floor((num.toString().length - 1) / 3) - 1;\n const shortNum = num / Math.pow(1000, unit + 1);\n return shortNum.toFixed(shortNum < 10 ? 1 : 0) + units[unit];\n }\n };\n\n return (\n <S.Container height={height} {...props}>\n <S.Label>{label}</S.Label>\n <S.InnerContainer type={type}>\n <S.Completed type={type}>{formatNumberNew(completedAssets)}</S.Completed>\n <S.ProgressBarTrack>\n <S.MetricsContainer $hasLink={Boolean(linkText)}>\n <S.ProgressBarFill type={type} $percentage={percentage} barColor={barColor}>\n {!isLowPercentage && (\n /*\n * NMB-3998: `$hasLink={Boolean(linkText)}` removed. ProgressBar.styled.ts:32-38\n * already records this as a dead pass — `$hasLink` is declared for\n * MetricsContainer, which reads it for its `width`, while PercentageIndicator\n * \"NEVER READS IT\". Output-neutral: not read by the template, so the class is\n * unchanged, and transient so it never reached the DOM.\n */\n <S.PercentageIndicator>\n {percentageText || formattedPercentage}\n </S.PercentageIndicator>\n )}\n </S.ProgressBarFill>\n {isLowPercentage && (\n <S.ExternalPercentageIndicator>\n {percentageText || formattedPercentage}\n </S.ExternalPercentageIndicator>\n )}\n </S.MetricsContainer>\n {linkText && (\n <S.Link\n onClick={handleLinkClick}\n onMouseEnter={() => setIsLinkHovered(true)}\n onMouseLeave={() => setIsLinkHovered(false)}\n >\n <S.ButtonLink $isHovered={isLinkHovered}>{linkText}</S.ButtonLink>\n <S.StyledArrowIcon $isHovered={isLinkHovered} />\n </S.Link>\n )}\n </S.ProgressBarTrack>\n </S.InnerContainer>\n </S.Container>\n );\n};\n\nexport default ProgressBar;\n"],"names":["ProgressBar","totalAssets","completedAssets","percentageText","barColor","height","label","type","linkText","onClick","props","isLinkHovered","setIsLinkHovered","useState","safeCompletedAssets","Math","max","safeTotalAssets","percentage","formattedPercentage","round","isLowPercentage","handleLinkClick","e","formatNumberNew","num","toString","replace","units","unit","floor","length","shortNum","pow","toFixed","_jsxs","S","children","_jsx","$hasLink","Boolean","$percentage","onMouseEnter","onMouseLeave","$isHovered"],"mappings":";;;;AAwCA,MAAMA,WAAW,GAAGA,CAAC;EACnBC,WAAW;EACXC,eAAe;EACfC,cAAc;EACdC,QAAQ;EACRC,MAAM;EACNC,KAAK;EACLC,IAA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AA,CAACF,UAAY,EAAA;AAACQ,YAAAA,UAAU,EAAEjC,aAAc;AAAA0B,YAAAA,QAAA,EAAE7B;AAAQ,WAAe,CAAC,EAClE8B,GAAA,CAACF,eAAiB,EAAA;AAACQ,YAAAA,UAAU,EAAEjC;AAAc,WAAE,CAAC;AAAA,SAC1C,CACT;AAAA,OACiB,CAAC;AAAA,KACL,CAAC;AAAA,GACR,CAAC;AAElB;;;;"}
|
|
@@ -22,157 +22,88 @@ const getBackgroundColor = props => {
|
|
|
22
22
|
};
|
|
23
23
|
styled.p.withConfig({
|
|
24
24
|
shouldForwardProp
|
|
25
|
-
}).attrs(applyDefaultTheme)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
`;
|
|
25
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
26
|
+
displayName: "ProgressBarstyled__ProgressBar",
|
|
27
|
+
componentId: "sc-zi0dri-0"
|
|
28
|
+
})(["font-family:", ";font-size:1rem;font-weight:500;"], props => props.theme.primaryFontFamily);
|
|
30
29
|
const Container = styled.div.withConfig({
|
|
31
30
|
shouldForwardProp
|
|
32
|
-
}).attrs(applyDefaultTheme)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`;
|
|
31
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
32
|
+
displayName: "ProgressBarstyled__Container",
|
|
33
|
+
componentId: "sc-zi0dri-1"
|
|
34
|
+
})(["width:100%;height:", ";font-family:", ";"], props => props.height ? `${props.height}px` : '50px', props => props.theme.primaryFontFamily);
|
|
37
35
|
const InnerContainer = styled.div.withConfig({
|
|
38
36
|
shouldForwardProp
|
|
39
|
-
}).attrs(applyDefaultTheme)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
38
|
+
displayName: "ProgressBarstyled__InnerContainer",
|
|
39
|
+
componentId: "sc-zi0dri-2"
|
|
40
|
+
})(["display:flex;height:100%;"]);
|
|
43
41
|
const MetricsContainer = styled.div.withConfig({
|
|
44
42
|
shouldForwardProp
|
|
45
|
-
}).attrs(applyDefaultTheme)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
align-items: center;
|
|
50
|
-
width: ${props => props.$hasLink ? '85%' : '100%'};
|
|
51
|
-
height: 100%;
|
|
52
|
-
flex-direction: row;
|
|
53
|
-
justify-content: flex-start;
|
|
54
|
-
`;
|
|
43
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
44
|
+
displayName: "ProgressBarstyled__MetricsContainer",
|
|
45
|
+
componentId: "sc-zi0dri-3"
|
|
46
|
+
})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:", ";height:100%;flex-direction:row;justify-content:flex-start;"], props => props.$hasLink ? '85%' : '100%');
|
|
55
47
|
const Label = styled.div.withConfig({
|
|
56
48
|
shouldForwardProp
|
|
57
|
-
}).attrs(applyDefaultTheme)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
`;
|
|
49
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
50
|
+
displayName: "ProgressBarstyled__Label",
|
|
51
|
+
componentId: "sc-zi0dri-4"
|
|
52
|
+
})(["font-size:0.875rem;padding-bottom:5px;", ""], props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-700')));
|
|
62
53
|
styled.div.withConfig({
|
|
63
54
|
shouldForwardProp
|
|
64
|
-
}).attrs(applyDefaultTheme)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
`;
|
|
55
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
56
|
+
displayName: "ProgressBarstyled__Percentage",
|
|
57
|
+
componentId: "sc-zi0dri-5"
|
|
58
|
+
})(["font-size:0.875rem;font-weight:500;", ""], props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-700')));
|
|
69
59
|
const ProgressBarTrack = styled.div.withConfig({
|
|
70
60
|
shouldForwardProp
|
|
71
|
-
}).attrs(applyDefaultTheme)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
flex-wrap: nowrap;
|
|
76
|
-
justify-content: flex-start;
|
|
77
|
-
align-items: center;
|
|
78
|
-
border-radius: 3px;
|
|
79
|
-
height: 100%;
|
|
80
|
-
${props => props.theme.themeProp('background', props.theme.getColor('gray-800'), props.theme.getColor('gray-50'))}
|
|
81
|
-
`;
|
|
61
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
62
|
+
displayName: "ProgressBarstyled__ProgressBarTrack",
|
|
63
|
+
componentId: "sc-zi0dri-6"
|
|
64
|
+
})(["width:100%;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-items:center;border-radius:3px;height:100%;", ""], props => props.theme.themeProp('background', props.theme.getColor('gray-800'), props.theme.getColor('gray-50')));
|
|
82
65
|
const Completed = styled.div.withConfig({
|
|
83
66
|
shouldForwardProp
|
|
84
|
-
}).attrs(applyDefaultTheme)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
border-radius: 3px;
|
|
89
|
-
display: flex;
|
|
90
|
-
align-items: center;
|
|
91
|
-
width: 96px;
|
|
92
|
-
${props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-800'))};
|
|
93
|
-
`;
|
|
67
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
68
|
+
displayName: "ProgressBarstyled__Completed",
|
|
69
|
+
componentId: "sc-zi0dri-7"
|
|
70
|
+
})(["font-size:1.2rem;font-weight:400;height:100%;border-radius:3px;display:flex;align-items:center;width:96px;", ";"], props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-800')));
|
|
94
71
|
const PercentageIndicator = styled.div.withConfig({
|
|
95
72
|
shouldForwardProp
|
|
96
|
-
}).attrs(applyDefaultTheme)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
font-size: 0.875rem;
|
|
101
|
-
white-space: nowrap;
|
|
102
|
-
opacity: 0.8;
|
|
103
|
-
${props => props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-500'))};
|
|
104
|
-
`;
|
|
73
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
74
|
+
displayName: "ProgressBarstyled__PercentageIndicator",
|
|
75
|
+
componentId: "sc-zi0dri-8"
|
|
76
|
+
})(["position:absolute;right:10px;font-weight:400;font-size:0.875rem;white-space:nowrap;opacity:0.8;", ";"], props => props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-500')));
|
|
105
77
|
const ExternalPercentageIndicator = styled.div.withConfig({
|
|
106
78
|
shouldForwardProp
|
|
107
|
-
}).attrs(applyDefaultTheme)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
font-size: 0.875rem;
|
|
112
|
-
opacity: 0.9;
|
|
113
|
-
${props => props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-500'))};
|
|
114
|
-
display: flex;
|
|
115
|
-
align-items: center;
|
|
116
|
-
`;
|
|
79
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
80
|
+
displayName: "ProgressBarstyled__ExternalPercentageIndicator",
|
|
81
|
+
componentId: "sc-zi0dri-9"
|
|
82
|
+
})(["margin-left:8px;font-size:1.2rem;font-weight:400;font-size:0.875rem;opacity:0.9;", ";display:flex;align-items:center;"], props => props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-500')));
|
|
117
83
|
const ProgressBarFill = styled.div.withConfig({
|
|
118
84
|
shouldForwardProp
|
|
119
|
-
}).attrs(applyDefaultTheme)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
position: relative;
|
|
124
|
-
display: flex;
|
|
125
|
-
align-items: center;
|
|
126
|
-
justify-content: flex-end;
|
|
127
|
-
${props => getBackgroundColor(props)}
|
|
128
|
-
transition: width 0.3s ease;
|
|
129
|
-
`;
|
|
85
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
86
|
+
displayName: "ProgressBarstyled__ProgressBarFill",
|
|
87
|
+
componentId: "sc-zi0dri-10"
|
|
88
|
+
})(["height:100%;border-radius:0 3px 3px 0;width:", "%;position:relative;display:flex;align-items:center;justify-content:flex-end;", " transition:width 0.3s ease;"], props => props.$percentage, props => getBackgroundColor(props));
|
|
130
89
|
const Link = styled.div.withConfig({
|
|
131
90
|
shouldForwardProp
|
|
132
|
-
}).attrs(applyDefaultTheme)
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
opacity: 0.7;
|
|
137
|
-
display: flex;
|
|
138
|
-
align-items: center;
|
|
139
|
-
justify-content: flex-end;
|
|
140
|
-
margin-right: 20px;
|
|
141
|
-
cursor: pointer;
|
|
142
|
-
height: 100%;
|
|
143
|
-
gap: 10px;
|
|
144
|
-
svg {
|
|
145
|
-
transition: transform 0.2s ease-in-out;
|
|
146
|
-
}
|
|
147
|
-
&:hover svg {
|
|
148
|
-
transform: translateX(2px);
|
|
149
|
-
}
|
|
150
|
-
`;
|
|
91
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
92
|
+
displayName: "ProgressBarstyled__Link",
|
|
93
|
+
componentId: "sc-zi0dri-11"
|
|
94
|
+
})(["font-size:0.875rem;font-weight:400;width:15%;opacity:0.7;display:flex;align-items:center;justify-content:flex-end;margin-right:20px;cursor:pointer;height:100%;gap:10px;svg{transition:transform 0.2s ease-in-out;}&:hover svg{transform:translateX(2px);}"]);
|
|
151
95
|
const ButtonLink = styled.div.withConfig({
|
|
152
96
|
shouldForwardProp
|
|
153
|
-
}).attrs(applyDefaultTheme)
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
display: flex;
|
|
158
|
-
align-items: center;
|
|
159
|
-
opacity: ${props => props.$isHovered ? 1 : 0.8};
|
|
160
|
-
transition: color 0.2s ease-in-out;
|
|
161
|
-
${props => props.$isHovered ? props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black')) : props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))};
|
|
162
|
-
`;
|
|
97
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
98
|
+
displayName: "ProgressBarstyled__ButtonLink",
|
|
99
|
+
componentId: "sc-zi0dri-12"
|
|
100
|
+
})(["font-size:0.875rem;font-weight:500;height:100%;display:flex;align-items:center;opacity:", ";transition:color 0.2s ease-in-out;", ";"], props => props.$isHovered ? 1 : 0.8, props => props.$isHovered ? props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black')) : props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900')));
|
|
163
101
|
const StyledArrowIcon = styled(SvgArrowForward).withConfig({
|
|
164
102
|
shouldForwardProp
|
|
165
|
-
}).attrs(applyDefaultTheme)
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
transition:
|
|
170
|
-
transform 0.2s ease-in-out,
|
|
171
|
-
fill 0.2s ease-in-out;
|
|
172
|
-
transform: ${props => props.$isHovered ? 'translateX(2px)' : 'translateX(0)'};
|
|
173
|
-
|
|
174
|
-
${props => props.$isHovered ? props.theme.themeProp('fill', props.theme.getColor('white'), props.theme.getColor('black')) : props.theme.themeProp('fill', props.theme.getColor('white'), props.theme.getColor('black'))};
|
|
175
|
-
`;
|
|
103
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
104
|
+
displayName: "ProgressBarstyled__StyledArrowIcon",
|
|
105
|
+
componentId: "sc-zi0dri-13"
|
|
106
|
+
})(["height:15px;margin-right:10px;opacity:", ";transition:transform 0.2s ease-in-out,fill 0.2s ease-in-out;transform:", ";", ";"], props => props.$isHovered ? 1 : 0.8, props => props.$isHovered ? 'translateX(2px)' : 'translateX(0)', props => props.$isHovered ? props.theme.themeProp('fill', props.theme.getColor('white'), props.theme.getColor('black')) : props.theme.themeProp('fill', props.theme.getColor('white'), props.theme.getColor('black')));
|
|
176
107
|
|
|
177
108
|
export { ButtonLink, Completed, Container, ExternalPercentageIndicator, InnerContainer, Label, Link, MetricsContainer, PercentageIndicator, ProgressBarFill, ProgressBarTrack, StyledArrowIcon };
|
|
178
109
|
//# sourceMappingURL=ProgressBar.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.styled.js","sources":["../../../src/components/widgets/ProgressBar/ProgressBar.styled.js"],"sourcesContent":["import styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\nimport { ArrowForwardIcon } from '../../../icons';\n\nconst shouldForwardProp = prop => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nconst getBackgroundColor = props => {\n if (props.barColor) {\n return `background: ${props.barColor};`;\n }\n const colorMap = {\n success: ['emerald-600', 'emerald-300'],\n error: ['red-600', 'cercise-200'],\n warning: ['orange-600', 'orange-400'],\n none: ['gray-500', 'gray-300'],\n default: ['emerald-600', 'emerald-500']\n };\n\n const [darkColor, lightColor] = colorMap[props.type] || colorMap.default;\n\n return props.theme.themeProp(\n 'background',\n props.theme.getColor(darkColor),\n props.theme.getColor(lightColor)\n );\n};\n\nexport const ProgressBar = styled.p\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 1rem;\n font-weight: 500;\n`;\n\nexport const Container = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n width: 100%;\n height: ${props => (props.height ? `${props.height}px` : '50px')};\n font-family: ${props => props.theme.primaryFontFamily};\n`;\n\nexport const InnerContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n height: 100%;\n`;\n\nexport const MetricsContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: ${props => (props.$hasLink ? '85%' : '100%')};\n height: 100%;\n flex-direction: row;\n justify-content: flex-start;\n`;\n\nexport const Label = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 0.875rem;\n padding-bottom: 5px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-700')\n )}\n`;\n\nexport const Percentage = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 0.875rem;\n font-weight: 500;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-700')\n )}\n`;\n\nexport const ProgressBarTrack = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n border-radius: 3px;\n height: 100%;\n ${props =>\n props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-800'),\n props.theme.getColor('gray-50')\n )}\n`;\n\nexport const Completed = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 1.2rem;\n font-weight: 400;\n height: 100%;\n border-radius: 3px;\n display: flex;\n align-items: center;\n width: 96px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-800')\n )};\n`;\nexport const PercentageIndicator = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n position: absolute;\n right: 10px;\n font-weight: 400;\n font-size: 0.875rem;\n white-space: nowrap;\n opacity: 0.8;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-500')\n )};\n`;\n\nexport const ExternalPercentageIndicator = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n margin-left: 8px;\n font-size: 1.2rem;\n font-weight: 400;\n font-size: 0.875rem;\n opacity: 0.9;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-500')\n )};\n display: flex;\n align-items: center;\n`;\n\nexport const ProgressBarFill = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n height: 100%;\n border-radius: 0 3px 3px 0;\n width: ${props => props.$percentage}%;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n ${props => getBackgroundColor(props)}\n transition: width 0.3s ease;\n`;\n\nexport const Link = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 0.875rem;\n font-weight: 400;\n width: 15%;\n opacity: 0.7;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-right: 20px;\n cursor: pointer;\n height: 100%;\n gap: 10px;\n svg {\n transition: transform 0.2s ease-in-out;\n }\n &:hover svg {\n transform: translateX(2px);\n }\n`;\n\nexport const ButtonLink = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 0.875rem;\n font-weight: 500;\n height: 100%;\n display: flex;\n align-items: center;\n opacity: ${props => (props.$isHovered ? 1 : 0.8)};\n transition: color 0.2s ease-in-out;\n ${props =>\n props.$isHovered\n ? props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black'))\n : props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )};\n`;\n\nexport const StyledArrowIcon = styled(ArrowForwardIcon)\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n height: 15px;\n margin-right: 10px;\n opacity: ${props => (props.$isHovered ? 1 : 0.8)};\n transition:\n transform 0.2s ease-in-out,\n fill 0.2s ease-in-out;\n transform: ${props => (props.$isHovered ? 'translateX(2px)' : 'translateX(0)')};\n\n ${props =>\n props.$isHovered\n ? props.theme.themeProp('fill', props.theme.getColor('white'), props.theme.getColor('black'))\n : props.theme.themeProp(\n 'fill',\n props.theme.getColor('white'),\n props.theme.getColor('black')\n )};\n`;\n"],"names":["shouldForwardProp","prop","startsWith","getBackgroundColor","props","barColor","colorMap","success","error","warning","none","default","darkColor","lightColor","type","theme","themeProp","getColor","styled","p","withConfig","attrs","applyDefaultTheme","primaryFontFamily","Container","div","height","InnerContainer","MetricsContainer","$hasLink","Label","ProgressBarTrack","Completed","PercentageIndicator","ExternalPercentageIndicator","ProgressBarFill","$percentage","Link","ButtonLink","$isHovered","StyledArrowIcon","ArrowForwardIcon"],"mappings":";;;;;AAIA,MAAMA,iBAAiB,GAAGC,IAAI,IAAI;EAChC,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC,CAAA;AAClD,CAAC,CAAA;AAED,MAAMC,kBAAkB,GAAGC,KAAK,IAAI;EAClC,IAAIA,KAAK,CAACC,QAAQ,EAAE;AAClB,IAAA,OAAO,CAAeD,YAAAA,EAAAA,KAAK,CAACC,QAAQ,CAAG,CAAA,CAAA,CAAA;AACzC,GAAA;AACA,EAAA,MAAMC,QAAQ,GAAG;AACfC,IAAAA,OAAO,EAAE,CAAC,aAAa,EAAE,aAAa,CAAC;AACvCC,IAAAA,KAAK,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC;AACjCC,IAAAA,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;AACrCC,IAAAA,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;AAC9BC,IAAAA,OAAO,EAAE,CAAC,aAAa,EAAE,aAAa,CAAA;GACvC,CAAA;AAED,EAAA,MAAM,CAACC,SAAS,EAAEC,UAAU,CAAC,GAAGP,QAAQ,CAACF,KAAK,CAACU,IAAI,CAAC,IAAIR,QAAQ,CAACK,OAAO,CAAA;EAExE,OAAOP,KAAK,CAACW,KAAK,CAACC,SAAS,CAC1B,YAAY,EACZZ,KAAK,CAACW,KAAK,CAACE,QAAQ,CAACL,SAAS,CAAC,EAC/BR,KAAK,CAACW,KAAK,CAACE,QAAQ,CAACJ,UAAU,CACjC,CAAC,CAAA;AACH,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AA,KAAK,IACLA,KAAK,CAACmC,UAAU,GACZnC,KAAK,CAACW,KAAK,CAACC,SAAS,CAAC,MAAM,EAAEZ,KAAK,CAACW,KAAK,CAACE,QAAQ,CAAC,OAAO,CAAC,EAAEb,KAAK,CAACW,KAAK,CAACE,QAAQ,CAAC,OAAO,CAAC,CAAC,GAC3Fb,KAAK,CAACW,KAAK,CAACC,SAAS,CACnB,MAAM,EACNZ,KAAK,CAACW,KAAK,CAACE,QAAQ,CAAC,OAAO,CAAC,EAC7Bb,KAAK,CAACW,KAAK,CAACE,QAAQ,CAAC,OAAO,CAC9B,CAAC,CAAA;AACT;;;;"}
|
|
1
|
+
{"version":3,"file":"ProgressBar.styled.js","sources":["../../../src/components/widgets/ProgressBar/ProgressBar.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 * `getBackgroundColor` below is a module-scope FUNCTION that reads props — the same kind\n * of site as `AssetGalleryGridCard.styled.ts`'s `ringState`, and not one C7 enumerates.\n * Unannotated its parameter is an implicit `any`, and with `noImplicitAny` off that is\n * SILENT: three prop reads and a `getColor()` call stayed unchecked while the file looked\n * converted. Typing it is what surfaced `colorMap` — see the note there.\n */\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\nimport { ArrowForwardIcon } from '../../../icons';\n\nimport type { ColorName, NtbTheme } from '../../../utils/defaultTheme';\n\n/**\n * `height` — `PropTypes.number`, px, interpolated as `${props.height}px` with a `50px`\n * fallback, so `number` and not `number | string`.\n *\n * NO `$`, AND THAT IS A DEFECT THAT IS ALREADY IN THE RENDER BASELINE. `height` is not a\n * member of `HTMLAttributes<HTMLDivElement>` — hence the declaration — but React does\n * recognise it and renders it, so `widgets/ProgressBar` in\n * `scripts/r19-harness/baseline.json` opens with `<div height=\"50\" class=\"…\">`. Renaming\n * it `$height` removes that attribute and MOVES the baseline — C10, §E.4.\n */\ninterface ProgressBarContainerStyleProps {\n height?: number;\n}\n\n/**\n * `$hasLink` — `Boolean(linkText)`, so genuinely boolean and not `linkText`'s `string`.\n *\n * Declared for `MetricsContainer` only. `ProgressBar.tsx` also passes `$hasLink` to\n * `PercentageIndicator`, WHICH NEVER READS IT — so per rule 2 (declare only what is\n * actually consumed) that component gets no generic, and the pass is recorded here as the\n * dead prop it is. It is transient, so it does not reach the DOM either way.\n */\ninterface ProgressBarMetricsStyleProps {\n $hasLink?: boolean;\n}\n\n/** `ProgressBarFill`, the one component here whose props are read from two places. */\ninterface ProgressBarFillStyleProps {\n /**\n * `type` — `PropTypes.string`, selecting a row of `colorMap`. Left as `string` rather\n * than narrowed to the five `colorMap` keys, because `string` is what the published\n * propTypes say; narrowing it here would invent a contract the component does not have\n * (§E.1 rule 2). The `|| colorMap.default` fallback is what makes that safe.\n *\n * NO `$`, AND THAT IS A DEFECT ALREADY IN THE RENDER BASELINE — but on OTHER components.\n * `ProgressBar.tsx` passes `type` to `InnerContainer`, `Completed` and `ProgressBarFill`\n * alike; the first two never read it, and a string-valued `type` renders on a `<div>`,\n * so `widgets/ProgressBar` records `<div type=\"success\">` twice. Renaming it removes\n * those attributes — C10, §E.4.\n */\n type?: string;\n /** `barColor` — `PropTypes.string`, a whole CSS colour that short-circuits `colorMap`\n * entirely. NO `$` either, and it is unread by any other component, so it leaks only\n * from this one and only when a consumer passes it — no fixture does. */\n barColor?: string;\n /** `(completedAssets / totalAssets) * 100`, interpolated as `${props.$percentage}%`, so\n * `number`. Not rounded — the rounding is only for the label text. */\n $percentage?: number;\n}\n\n/**\n * `$isHovered` — the `Link`'s hover state from `ProgressBar.tsx`'s `useState`, so\n * genuinely `boolean`. Like `InfoCard`'s, it is `false` in every static render, so the\n * rule blocks it guards are unreachable from the render gate.\n *\n * Hosts: `ButtonLink` and `StyledArrowIcon`.\n */\ninterface ProgressBarHoverStyleProps {\n $isHovered?: boolean;\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\nconst getBackgroundColor = (\n props: Pick<ProgressBarFillStyleProps, 'type' | 'barColor'> & { theme: NtbTheme }\n) => {\n if (props.barColor) {\n return `background: ${props.barColor};`;\n }\n /*\n * ANNOTATED, AND THE ANNOTATION IS THE POINT. `getColor` takes the closed `ColorName`\n * union and THROWS at runtime for anything else, so without this type the ten colour\n * names below were unchecked strings feeding a function that throws — a typo here would\n * have been a runtime error inside a styled template. All ten were verified against\n * `src/styles/utils/colors-export.js` by making the compiler check them.\n *\n * `Record<string, …>` rather than a closed key union because `props.type` is\n * `PropTypes.string`; the index signature is what lets a caller pass an unknown type and\n * fall through to `colorMap.default`, which is the existing behaviour.\n */\n const colorMap: Record<string, [ColorName, ColorName]> = {\n success: ['emerald-600', 'emerald-300'],\n error: ['red-600', 'cercise-200'],\n warning: ['orange-600', 'orange-400'],\n none: ['gray-500', 'gray-300'],\n default: ['emerald-600', 'emerald-500']\n };\n\n const [darkColor, lightColor] = colorMap[props.type] || colorMap.default;\n\n return props.theme.themeProp(\n 'background',\n props.theme.getColor(darkColor),\n props.theme.getColor(lightColor)\n );\n};\n\nexport const ProgressBar = styled.p\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 1rem;\n font-weight: 500;\n`;\n\nexport const Container = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<ProgressBarContainerStyleProps>(applyDefaultTheme)`\n width: 100%;\n height: ${props => (props.height ? `${props.height}px` : '50px')};\n font-family: ${props => props.theme.primaryFontFamily};\n`;\n\nexport const InnerContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n height: 100%;\n`;\n\nexport const MetricsContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<ProgressBarMetricsStyleProps>(applyDefaultTheme)`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: ${props => (props.$hasLink ? '85%' : '100%')};\n height: 100%;\n flex-direction: row;\n justify-content: flex-start;\n`;\n\nexport const Label = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 0.875rem;\n padding-bottom: 5px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-700')\n )}\n`;\n\nexport const Percentage = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 0.875rem;\n font-weight: 500;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-700')\n )}\n`;\n\nexport const ProgressBarTrack = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n border-radius: 3px;\n height: 100%;\n ${props =>\n props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-800'),\n props.theme.getColor('gray-50')\n )}\n`;\n\nexport const Completed = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 1.2rem;\n font-weight: 400;\n height: 100%;\n border-radius: 3px;\n display: flex;\n align-items: center;\n width: 96px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-800')\n )};\n`;\nexport const PercentageIndicator = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n position: absolute;\n right: 10px;\n font-weight: 400;\n font-size: 0.875rem;\n white-space: nowrap;\n opacity: 0.8;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-500')\n )};\n`;\n\nexport const ExternalPercentageIndicator = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n margin-left: 8px;\n font-size: 1.2rem;\n font-weight: 400;\n font-size: 0.875rem;\n opacity: 0.9;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-500')\n )};\n display: flex;\n align-items: center;\n`;\n\nexport const ProgressBarFill = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<ProgressBarFillStyleProps>(applyDefaultTheme)`\n height: 100%;\n border-radius: 0 3px 3px 0;\n width: ${props => props.$percentage}%;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n ${props => getBackgroundColor(props)}\n transition: width 0.3s ease;\n`;\n\nexport const Link = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 0.875rem;\n font-weight: 400;\n width: 15%;\n opacity: 0.7;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-right: 20px;\n cursor: pointer;\n height: 100%;\n gap: 10px;\n svg {\n transition: transform 0.2s ease-in-out;\n }\n &:hover svg {\n transform: translateX(2px);\n }\n`;\n\nexport const ButtonLink = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<ProgressBarHoverStyleProps>(applyDefaultTheme)`\n font-size: 0.875rem;\n font-weight: 500;\n height: 100%;\n display: flex;\n align-items: center;\n opacity: ${props => (props.$isHovered ? 1 : 0.8)};\n transition: color 0.2s ease-in-out;\n ${props =>\n props.$isHovered\n ? props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black'))\n : props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )};\n`;\n\nexport const StyledArrowIcon = styled(ArrowForwardIcon)\n .withConfig({\n shouldForwardProp\n })\n .attrs<ProgressBarHoverStyleProps>(applyDefaultTheme)`\n height: 15px;\n margin-right: 10px;\n opacity: ${props => (props.$isHovered ? 1 : 0.8)};\n transition:\n transform 0.2s ease-in-out,\n fill 0.2s ease-in-out;\n transform: ${props => (props.$isHovered ? 'translateX(2px)' : 'translateX(0)')};\n\n ${props =>\n props.$isHovered\n ? props.theme.themeProp('fill', props.theme.getColor('white'), props.theme.getColor('black'))\n : props.theme.themeProp(\n 'fill',\n props.theme.getColor('white'),\n props.theme.getColor('black')\n )};\n`;\n"],"names":["shouldForwardProp","prop","startsWith","getBackgroundColor","props","barColor","colorMap","success","error","warning","none","default","darkColor","lightColor","type","theme","themeProp","getColor","styled","p","withConfig","attrs","applyDefaultTheme","displayName","componentId","primaryFontFamily","Container","div","height","InnerContainer","MetricsContainer","$hasLink","Label","ProgressBarTrack","Completed","PercentageIndicator","ExternalPercentageIndicator","ProgressBarFill","$percentage","Link","ButtonLink","$isHovered","StyledArrowIcon","ArrowForwardIcon"],"mappings":";;;;;AAmFA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAED,MAAMC,kBAAkB,GACtBC,KAAiF,IAC9E;EACH,IAAIA,KAAK,CAACC,QAAQ,EAAE;AAClB,IAAA,OAAO,CAAA,YAAA,EAAeD,KAAK,CAACC,QAAQ,CAAA,CAAA,CAAG;AACzC,EAAA;AAYA,EAAA,MAAMC,QAAgD,GAAG;AACvDC,IAAAA,OAAO,EAAE,CAAC,aAAa,EAAE,aAAa,CAAC;AACvCC,IAAAA,KAAK,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC;AACjCC,IAAAA,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;AACrCC,IAAAA,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;AAC9BC,IAAAA,OAAO,EAAE,CAAC,aAAa,EAAE,aAAa;GACvC;AAED,EAAA,MAAM,CAACC,SAAS,EAAEC,UAAU,CAAC,GAAGP,QAAQ,CAACF,K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7Bb,KAAK,CAACW,KAAK,CAACE,QAAQ,CAAC,OAAO,CAC9B,CAAC;;;;"}
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
1
|
import React__default from 'react';
|
|
4
2
|
import InstructionSeverityDisplay from '../InstructionSeverityDisplay/InstructionSeverityDisplay.js';
|
|
5
3
|
import { SummaryCard as SummaryCard$1, Gutter, Header, HeaderLeft, HeaderRight, Title, Description, Footer, FooterLeft, FooterRight } from './SummaryCard.styled.js';
|
|
4
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
6
5
|
|
|
7
6
|
const SummaryCard = React__default.forwardRef(function AssetSummaryCard({
|
|
8
|
-
activeSummaryCard,
|
|
9
|
-
title,
|
|
10
|
-
description,
|
|
11
|
-
instructions,
|
|
12
|
-
instructionSeverity,
|
|
13
|
-
headerLeft,
|
|
14
|
-
headerRight,
|
|
15
|
-
footerLeft,
|
|
16
|
-
footerRight,
|
|
7
|
+
activeSummaryCard = false,
|
|
8
|
+
title = '',
|
|
9
|
+
description = '',
|
|
10
|
+
instructions = '',
|
|
11
|
+
instructionSeverity = 1,
|
|
12
|
+
headerLeft = null,
|
|
13
|
+
headerRight = null,
|
|
14
|
+
footerLeft = null,
|
|
15
|
+
footerRight = null,
|
|
17
16
|
width,
|
|
18
|
-
useBorder,
|
|
17
|
+
useBorder = false,
|
|
19
18
|
view,
|
|
20
19
|
instructionLabels,
|
|
21
20
|
...props
|
|
@@ -27,61 +26,53 @@ const SummaryCard = React__default.forwardRef(function AssetSummaryCard({
|
|
|
27
26
|
const shouldAddGutterAfterTitle = !!title && (!!description || !!instructions || shouldRenderFooter);
|
|
28
27
|
if (!activeSummaryCard) return null;
|
|
29
28
|
const filteredProps = Object.fromEntries(Object.entries(props).filter(([key]) => key !== 'compact'));
|
|
30
|
-
return
|
|
29
|
+
return jsxs(SummaryCard$1, {
|
|
31
30
|
ref: forwardedRef,
|
|
32
31
|
width: width,
|
|
33
|
-
$useBorder: useBorder
|
|
34
|
-
|
|
35
|
-
view: view
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
32
|
+
$useBorder: useBorder,
|
|
33
|
+
...filteredProps,
|
|
34
|
+
view: view,
|
|
35
|
+
children: [shouldRenderHeader && jsxs(Fragment, {
|
|
36
|
+
children: [jsx(Gutter, {
|
|
37
|
+
$gutter: 8
|
|
38
|
+
}), jsxs(Header, {
|
|
39
|
+
children: [jsx(HeaderLeft, {
|
|
40
|
+
children: headerLeft
|
|
41
|
+
}), jsx(HeaderRight, {
|
|
42
|
+
children: headerRight
|
|
43
|
+
})]
|
|
44
|
+
})]
|
|
45
|
+
}), jsx(Gutter, {
|
|
46
|
+
$gutter: shouldRenderHeader ? 8 : 16
|
|
47
|
+
}), title && jsx(Title, {
|
|
48
|
+
children: title
|
|
49
|
+
}), shouldAddGutterAfterTitle && jsx(Gutter, {
|
|
50
|
+
$gutter: 4
|
|
51
|
+
}), description && jsx(Description, {
|
|
52
|
+
children: description
|
|
53
|
+
}), jsx(Gutter, {
|
|
54
|
+
$gutter: 16
|
|
55
|
+
}), shouldRenderInstructions && jsx(InstructionSeverityDisplay, {
|
|
56
|
+
labels: instructionLabels,
|
|
57
|
+
instructionText: instructions,
|
|
58
|
+
severity: instructionSeverity,
|
|
59
|
+
showCard: false,
|
|
60
|
+
padding: `14px 17px`,
|
|
61
|
+
detailsFontSize: `12px`,
|
|
62
|
+
maxLines: view === 'grid' ? 3 : undefined
|
|
63
|
+
}), shouldAddGutterAfterInstructions && jsx(Gutter, {
|
|
64
|
+
$gutter: 16
|
|
65
|
+
}), shouldRenderFooter && jsxs(Footer, {
|
|
66
|
+
children: [jsx(FooterLeft, {
|
|
67
|
+
children: footerLeft
|
|
68
|
+
}), jsx(FooterRight, {
|
|
69
|
+
children: footerRight
|
|
70
|
+
})]
|
|
71
|
+
}), shouldRenderFooter && jsx(Gutter, {
|
|
72
|
+
$gutter: 16
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
57
75
|
});
|
|
58
|
-
SummaryCard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
59
|
-
activeSummaryCard: PropTypes.bool,
|
|
60
|
-
title: PropTypes.string,
|
|
61
|
-
description: PropTypes.string,
|
|
62
|
-
instructions: PropTypes.string,
|
|
63
|
-
instructionSeverity: PropTypes.oneOf([1, 2, 3, 4, 5]),
|
|
64
|
-
headerLeft: PropTypes.node,
|
|
65
|
-
headerRight: PropTypes.node,
|
|
66
|
-
footerLeft: PropTypes.node,
|
|
67
|
-
footerRight: PropTypes.node,
|
|
68
|
-
width: PropTypes.number,
|
|
69
|
-
useBorder: PropTypes.bool,
|
|
70
|
-
view: PropTypes.string,
|
|
71
|
-
instructionLabels: PropTypes.objectOf(PropTypes.string)
|
|
72
|
-
} : {};
|
|
73
|
-
SummaryCard.defaultProps = {
|
|
74
|
-
title: '',
|
|
75
|
-
description: '',
|
|
76
|
-
instructions: '',
|
|
77
|
-
instructionSeverity: 1,
|
|
78
|
-
headerLeft: null,
|
|
79
|
-
headerRight: null,
|
|
80
|
-
footerLeft: null,
|
|
81
|
-
footerRight: null,
|
|
82
|
-
useBorder: false,
|
|
83
|
-
activeSummaryCard: false
|
|
84
|
-
};
|
|
85
76
|
|
|
86
77
|
export { SummaryCard as default };
|
|
87
78
|
//# sourceMappingURL=SummaryCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SummaryCard.js","sources":["../../../src/components/widgets/SummaryCard/SummaryCard.
|
|
1
|
+
{"version":3,"file":"SummaryCard.js","sources":["../../../src/components/widgets/SummaryCard/SummaryCard.tsx"],"sourcesContent":["import React from 'react';\nimport InstructionSeverityDisplay from '../InstructionSeverityDisplay';\nimport * as S from './SummaryCard.styled';\n\ntype AssetSummaryCardOwnProps = {\n /**\n * Wether the SummaryCard is active or not.\n */\n activeSummaryCard?: boolean;\n /**\n * Title of the content\n */\n title?: string;\n /**\n * Description of the content\n */\n description?: string;\n /**\n * Special instructions for the content\n */\n instructions?: string;\n /**\n * Type of instructions\n */\n instructionSeverity?: 1 | 2 | 3 | 4 | 5;\n /**\n * One or more children to render in the left half of the header\n */\n headerLeft?: React.ReactNode;\n /**\n * One or more children to render in the right half of the header\n */\n headerRight?: React.ReactNode;\n /**\n * One or more children to render in the left half of the footer\n */\n footerLeft?: React.ReactNode;\n /**\n * One or more children to render in the right half of the footer\n */\n footerRight?: React.ReactNode;\n /**\n * Width of the card\n */\n width?: number;\n /**\n * Whether or not to use a border around the card\n */\n useBorder?: boolean;\n /**\n * Whether or not the Summary Card is within the CompactCard view or Grid view\n */\n view?: string;\n /**\n * Translated labels object for instruction(Info,Limited Use etc)\n */\n instructionLabels?: {\n [key: string]: string;\n };\n};\n\n/*\n * NMB-3998 §C.2: `props` is spread onto `S.SummaryCard`, 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 AssetSummaryCardOwnProps`);\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 S.SummaryCard>,\n keyof AssetSummaryCardOwnProps\n> &\n AssetSummaryCardOwnProps;\n\n/**\n * ### Import\n *\n * ``` js\n * import { SummaryCard } from '@ntbjs/react-components/widgets'\n * // or\n * import SummaryCard from '@ntbjs/react-components/widgets/SummaryCard'\n * ```\n *\n * ### Props\n * ```\n * Pass `title=\"Title\"` to set the title of the card.\n * Pass `description=\"Description\"` to set the description of the card.\n * Pass `instructions=\"Instructions\"` to set the instructions of the card.\n * Pass 1-5 to `instructionSeverity` to reflect the severity of the instructions.\n * Pass `headerLeft={<div>Left</div>}` to set the left header of the card.\n * Pass `headerRight={<div>Right</div>}` to set the right header of the card.\n * Pass `footerLeft={<div>Left</div>}` to set the left footer of the card.\n * Pass `footerRight={<div>Right</div>}` to set the right footer of the card.\n * Pass `width={300}` to set the width of the card.\n * Pass `useBorder={true}` to set the border of the card.\n * ```\n */\n\nconst SummaryCard = React.forwardRef<any, Props>(function AssetSummaryCard(\n {\n activeSummaryCard = false,\n title = '',\n description = '',\n instructions = '',\n instructionSeverity = 1,\n headerLeft = null,\n headerRight = null,\n footerLeft = null,\n footerRight = null,\n width,\n useBorder = false,\n view,\n instructionLabels,\n ...props\n },\n forwardedRef\n) {\n const shouldRenderInstructions = !!instructions;\n const shouldRenderHeader = !!headerLeft || !!headerRight;\n const shouldRenderFooter = !!footerLeft || !!footerRight;\n const shouldAddGutterAfterInstructions = shouldRenderInstructions && shouldRenderFooter;\n const shouldAddGutterAfterTitle =\n !!title && (!!description || !!instructions || shouldRenderFooter);\n\n if (!activeSummaryCard) return null;\n\n const filteredProps = Object.fromEntries(\n Object.entries(props).filter(([key]) => key !== 'compact')\n );\n\n return (\n <S.SummaryCard\n ref={forwardedRef}\n width={width}\n $useBorder={useBorder}\n {...filteredProps}\n view={view}\n >\n {shouldRenderHeader && (\n <>\n <S.Gutter $gutter={8} />\n <S.Header>\n <S.HeaderLeft>{headerLeft}</S.HeaderLeft>\n <S.HeaderRight>{headerRight}</S.HeaderRight>\n </S.Header>\n </>\n )}\n <S.Gutter $gutter={shouldRenderHeader ? 8 : 16} />\n {title && <S.Title>{title}</S.Title>}\n {shouldAddGutterAfterTitle && <S.Gutter $gutter={4} />}\n {description && <S.Description>{description}</S.Description>}\n <S.Gutter $gutter={16} />\n\n {shouldRenderInstructions && (\n <InstructionSeverityDisplay\n labels={instructionLabels}\n instructionText={instructions}\n severity={instructionSeverity}\n showCard={false}\n padding={`14px 17px`}\n detailsFontSize={`12px`}\n maxLines={view === 'grid' ? 3 : undefined}\n />\n )}\n {shouldAddGutterAfterInstructions && <S.Gutter $gutter={16} />}\n {shouldRenderFooter && (\n <S.Footer>\n <S.FooterLeft>{footerLeft}</S.FooterLeft>\n <S.FooterRight>{footerRight}</S.FooterRight>\n </S.Footer>\n )}\n {shouldRenderFooter && <S.Gutter $gutter={16} />}\n </S.SummaryCard>\n );\n});\n\nexport default SummaryCard;\n"],"names":["SummaryCard","React","forwardRef","AssetSummaryCard","activeSummaryCard","title","description","instructions","instructionSeverity","headerLeft","headerRight","footerLeft","footerRight","width","useBorder","view","instructionLabels","props","forwardedRef","shouldRenderInstructions","shouldRenderHeader","shouldRenderFooter","shouldAddGutterAfterInstructions","shouldAddGutterAfterTitle","filteredProps","Object","fromEntries","entries","filter","key","_jsxs","S","ref","$useBorder","children","_Fragment","_jsx","$gutter","InstructionSeverityDisplay","labels","instructionText","severity","showCard","padding","detailsFontSize","maxLines","undefined"],"mappings":";;;;;AAkGA,MAAMA,WAAW,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASC,gBAAgBA,CACxE;AACEC,EAAAA,iBAAiB,GAAG,KAAK;AACzBC,EAAAA,KAAK,GAAG,EAAE;AACVC,EAAAA,WAAW,GAAG,EAAE;AAChBC,EAAAA,YAAY,GAAG,EAAE;AACjBC,EAAAA,mBAAmB,GAAG,CAAC;AACvBC,EAAAA,UAAU,GAAG,IAAI;AACjBC,EAAAA,WAAW,GAAG,IAAI;AAClBC,EAAAA,UAAU,GAAG,IAAI;AACjBC,EAAAA,WAAW,GAAG,IAAI;EAClBC,KAAK;AACLC,EAAAA,SAAS,GAAG,KAAK;EACjBC,IAAI;EACJC,iBAAiB;EACjB,GAAGC;AACL,CAAC,EACDC,YAAY,EACZ;AACA,EAAA,MAAMC,wBAAwB,GAAG,CAAC,CAACZ,YAAY;EAC/C,MAAMa,kBAAkB,GAAG,CAAC,CAACX,UAA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