@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
|
@@ -6,81 +6,26 @@ const shouldForwardProp = prop => {
|
|
|
6
6
|
};
|
|
7
7
|
const ContextMenuItem = styled.span.withConfig({
|
|
8
8
|
shouldForwardProp
|
|
9
|
-
}).attrs(applyDefaultTheme)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
font-family: ${props => props.theme.primaryFontFamily};
|
|
14
|
-
font-size: 0.875rem;
|
|
15
|
-
font-weight: normal;
|
|
16
|
-
height: 31px;
|
|
17
|
-
min-width: 160px;
|
|
18
|
-
padding: ${props => props.$openssublevel ? '0 8px' : '0 28px 0 8px'};
|
|
19
|
-
|
|
20
|
-
${props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-700'))}
|
|
21
|
-
|
|
22
|
-
${props => props.theme.themeProp('background-color', props.theme.getColor('gray-700'), '#FEFEFE')}
|
|
23
|
-
|
|
24
|
-
${props => !props.$icon && css`
|
|
25
|
-
padding-left: 28px;
|
|
26
|
-
`}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
:last-of-type {
|
|
30
|
-
height: 32px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&:hover {
|
|
34
|
-
cursor: pointer;
|
|
35
|
-
|
|
36
|
-
${props => props.theme.themeProp('background-color', props.theme.getColor('gray-600'), props.theme.getColor('gray-200'))}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
${props => props.$openssublevelhoverColors && props.$hoverColors[0] && props.$hoverColors[1] && css`
|
|
40
|
-
&&:hover {
|
|
41
|
-
${props => props.theme.themeProp('color', props.hoverColors[0], props.hoverColors[1])}
|
|
42
|
-
}
|
|
43
|
-
`}
|
|
44
|
-
|
|
45
|
-
${props => props.$hoverBackgroundColors && props.$hoverBackgroundColors[0] && props.$hoverBackgroundColors[1] && css`
|
|
46
|
-
&&:hover {
|
|
47
|
-
${props => props.theme.themeProp('background-color', props.$hoverBackgroundColors[0], props.$hoverBackgroundColors[1])}
|
|
48
|
-
}
|
|
49
|
-
`}
|
|
50
|
-
`;
|
|
9
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
10
|
+
displayName: "ContextMenuItemstyled__ContextMenuItem",
|
|
11
|
+
componentId: "sc-8s6zvg-0"
|
|
12
|
+
})(["align-items:center;cursor:pointer;display:flex;font-family:", ";font-size:0.875rem;font-weight:normal;height:31px;min-width:160px;padding:", ";", " ", " ", " :last-of-type{height:32px;}&:hover{cursor:pointer;", "}", " ", ""], props => props.theme.primaryFontFamily, props => props.$openssublevel ? '0 8px' : '0 28px 0 8px', props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-700')), props => props.theme.themeProp('background-color', props.theme.getColor('gray-700'), '#FEFEFE'), props => !props.$icon && css(["padding-left:28px;"]), props => props.theme.themeProp('background-color', props.theme.getColor('gray-600'), props.theme.getColor('gray-200')), props => props.$hoverColors && props.$hoverColors[0] && props.$hoverColors[1] && css(["&&:hover{", "}"], props => props.theme.themeProp('color', props.$hoverColors[0], props.$hoverColors[1])), props => props.$hoverBackgroundColors && props.$hoverBackgroundColors[0] && props.$hoverBackgroundColors[1] && css(["&&:hover{", "}"], props => props.theme.themeProp('background-color', props.$hoverBackgroundColors[0], props.$hoverBackgroundColors[1])));
|
|
51
13
|
const IconContainer = styled.span.withConfig({
|
|
52
14
|
shouldForwardProp
|
|
53
|
-
}).attrs(applyDefaultTheme)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
max-width: 12px;
|
|
58
|
-
margin-right: 8px;
|
|
59
|
-
|
|
60
|
-
svg {
|
|
61
|
-
height: 12px;
|
|
62
|
-
}
|
|
63
|
-
`;
|
|
15
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
16
|
+
displayName: "ContextMenuItemstyled__IconContainer",
|
|
17
|
+
componentId: "sc-8s6zvg-1"
|
|
18
|
+
})(["align-items:center;display:flex;height:fit-content;max-width:12px;margin-right:8px;svg{height:12px;}"]);
|
|
64
19
|
const SublevelIconContainer = styled.span.withConfig({
|
|
65
20
|
shouldForwardProp
|
|
66
|
-
}).attrs(applyDefaultTheme)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
svg {
|
|
76
|
-
height: 6px;
|
|
77
|
-
width: 6px;
|
|
78
|
-
}
|
|
79
|
-
`;
|
|
80
|
-
const Label = styled.span`
|
|
81
|
-
align-items: center;
|
|
82
|
-
display: flex;
|
|
83
|
-
`;
|
|
21
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
22
|
+
displayName: "ContextMenuItemstyled__SublevelIconContainer",
|
|
23
|
+
componentId: "sc-8s6zvg-2"
|
|
24
|
+
})(["align-items:center;display:flex;height:fit-content;max-width:12px;margin-left:auto;margin-right:8px;padding-left:24px;svg{height:6px;width:6px;}"]);
|
|
25
|
+
const Label = styled.span.withConfig({
|
|
26
|
+
displayName: "ContextMenuItemstyled__Label",
|
|
27
|
+
componentId: "sc-8s6zvg-3"
|
|
28
|
+
})(["align-items:center;display:flex;"]);
|
|
84
29
|
|
|
85
30
|
export { ContextMenuItem, IconContainer, Label, SublevelIconContainer };
|
|
86
31
|
//# sourceMappingURL=ContextMenuItem.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuItem.styled.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.
|
|
1
|
+
{"version":3,"file":"ContextMenuItem.styled.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.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 two stacked defects this file used to carry in its first `&&:hover` block are FIXED,\n * together, because fixing either alone throws: the guard read the run-together\n * `$openssublevelhoverColors` and the rule inside it read `props.hoverColors` with no `$`.\n * Both now read `$hoverColors`, and the guard tests the array's presence before indexing\n * it, exactly like the `$hoverBackgroundColors` block below. That activates a rule that has\n * never been emitted, so it moves the render baseline (§E.3/§J.8); the re-record is a\n * separate, reviewed commit.\n */\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../../utils/defaultTheme';\n\nimport type { ReactElement } from 'react';\n\n/**\n * `ContextMenuItem`'s props, i.e. what `ContextMenuItem.tsx` passes to\n * `<S.ContextMenuItem>`: `$icon`, `$hoverColors`, `$hoverBackgroundColors` and\n * `$openssublevel`. Value types from that file's propTypes; all optional per §J.5.\n */\nexport interface ContextMenuItemStyleProps {\n /** `icon` — `PropTypes.element`, so a React element and not a `ReactNode`. Read only\n * as `!props.$icon`, i.e. for presence. */\n $icon?: ReactElement<any>;\n /** `opensSublevel` — `PropTypes.bool`. Selects the right-hand padding, since a\n * sublevel item has its own chevron in that space. Lower-case by existing convention\n * at both ends; renaming it would be a two-file change for no type benefit. */\n $openssublevel?: boolean;\n /** `hoverColors` — `PropTypes.arrayOf(PropTypes.string)`, documented as exactly\n * `[darkModeColor, lightModeColor]` hex strings. `string[]` and not\n * `[string, string]`: the propTypes say an array of any length, which is why the\n * template guards the array's presence and then `[0]` and `[1]` individually. */\n $hoverColors?: string[];\n /** `hoverBackgroundColors` — same shape as `$hoverColors`. */\n $hoverBackgroundColors?: string[];\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 ContextMenuItem = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs<ContextMenuItemStyleProps>(applyDefaultTheme)`\n align-items: center;\n cursor: pointer;\n display: flex;\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 0.875rem;\n font-weight: normal;\n height: 31px;\n min-width: 160px;\n padding: ${props => (props.$openssublevel ? '0 8px' : '0 28px 0 8px')};\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-700')\n )}\n\n ${props => props.theme.themeProp('background-color', props.theme.getColor('gray-700'), '#FEFEFE')}\n\n ${props =>\n !props.$icon &&\n css`\n padding-left: 28px;\n `}\n\n\n :last-of-type {\n height: 32px;\n }\n\n &:hover {\n cursor: pointer;\n\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-600'),\n props.theme.getColor('gray-200')\n )}\n }\n\n ${props =>\n props.$hoverColors &&\n props.$hoverColors[0] &&\n props.$hoverColors[1] &&\n css<Pick<ContextMenuItemStyleProps, '$hoverColors'>>`\n &&:hover {\n ${props => props.theme.themeProp('color', props.$hoverColors[0], props.$hoverColors[1])}\n }\n `}\n\n ${props =>\n props.$hoverBackgroundColors &&\n props.$hoverBackgroundColors[0] &&\n props.$hoverBackgroundColors[1] &&\n css<Pick<ContextMenuItemStyleProps, '$hoverBackgroundColors'>>`\n &&:hover {\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.$hoverBackgroundColors[0],\n props.$hoverBackgroundColors[1]\n )}\n }\n `}\n`;\n\nexport const IconContainer = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n display: flex;\n height: fit-content;\n max-width: 12px;\n margin-right: 8px;\n\n svg {\n height: 12px;\n }\n`;\n\nexport const SublevelIconContainer = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n display: flex;\n height: fit-content;\n max-width: 12px;\n margin-left: auto;\n margin-right: 8px;\n padding-left: 24px;\n\n svg {\n height: 6px;\n width: 6px;\n }\n`;\n\nexport const Label = styled.span`\n align-items: center;\n display: flex;\n`;\n"],"names":["shouldForwardProp","prop","startsWith","ContextMenuItem","styled","span","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","theme","primaryFontFamily","$openssublevel","themeProp","getColor","$icon","css","$hoverColors","$hoverBackgroundColors","IconContainer","SublevelIconContainer","Label"],"mappings":";;;AA6CA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,eAAe,GAAGC,MAAM,CAACC,IAAI,CACvCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAA4BC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,wCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,6DAAA,EAAA,6EAAA,EAAA,GAAA,EAAA,GAAA,EAAA,GAAA,EAAA,qDAAA,EAAA,GAAA,EAAA,GAAA,EAAA,EAAA,CAAA,EAIrCC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,iBAAiB,EAK1CF,KAAK,IAAKA,KAAK,CAACG,cAAc,GAAG,OAAO,GAAG,cAAe,EAEnEH,KAAK,IACLA,KAAK,CAACC,KAAK,CAACG,SAAS,CACnB,OAAO,EACPJ,KAAK,CAACC,KAAK,CAACI,QAAQ,CAAC,UAAU,CAAC,EAChCL,KAAK,CAACC,KAAK,CAACI,QAAQ,CAAC,UAAU,CACjC,CAAC,EAEDL,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACG,SAAS,CAAC,kBAAkB,EAAEJ,KAAK,CAACC,KAAK,CAACI,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC,EAE/FL,KAAK,IACL,CAACA,KAAK,CAACM,KAAK,IACZC,GAAG,CAAA,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C,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,8CAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,kJAAA,CAAA;MAeda,KAAK,GAAGnB,MAAM,CAACC,IAAI,CAAAC,UAAA,CAAA;EAAAG,WAAA,EAAA,8BAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,kCAAA,CAAA;;;;"}
|
|
@@ -1,22 +1,18 @@
|
|
|
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 { ContextMenuItemsGroup as ContextMenuItemsGroup$1 } from './ContextMenuItemsGroup.styled.js';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
4
|
|
|
6
5
|
const ContextMenuItemsGroup = React__default.forwardRef(function ContextMenuItemsGroup({
|
|
7
6
|
children,
|
|
8
7
|
...props
|
|
9
8
|
}, forwardedRef) {
|
|
10
|
-
return
|
|
11
|
-
ref: forwardedRef
|
|
12
|
-
|
|
13
|
-
role: "group"
|
|
14
|
-
|
|
9
|
+
return jsx(ContextMenuItemsGroup$1, {
|
|
10
|
+
ref: forwardedRef,
|
|
11
|
+
...props,
|
|
12
|
+
role: "group",
|
|
13
|
+
children: children
|
|
14
|
+
});
|
|
15
15
|
});
|
|
16
|
-
ContextMenuItemsGroup.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
17
|
-
children: PropTypes.arrayOf(PropTypes.node)
|
|
18
|
-
} : {};
|
|
19
|
-
ContextMenuItemsGroup.defaultProps = {};
|
|
20
16
|
|
|
21
17
|
export { ContextMenuItemsGroup as default };
|
|
22
18
|
//# sourceMappingURL=ContextMenuItemsGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuItemsGroup.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.
|
|
1
|
+
{"version":3,"file":"ContextMenuItemsGroup.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './ContextMenuItemsGroup.styled';\n\ntype ContextMenuItemsGroupOwnProps = {\n /**\n * Nodes of the `ContextMenuItem` component — one, or an array.\n *\n * DEFECT FIXED, NOT TRANSCRIBED. The propTypes said\n * `children: PropTypes.arrayOf(PropTypes.node)`, and the codemod faithfully rendered\n * that as `React.ReactNode[]` — which REJECTS A SINGLE JSX CHILD, because React does not\n * wrap one child in an array:\n *\n * <ContextMenuItemsGroup><ContextMenuItem title=\"Edit\" /></ContextMenuItemsGroup>\n *\n * gives `children` as one element. On React 16 this was a dev-time propTypes warning\n * only, which is how it survived — the React 16 gate is what surfaced it. Under the\n * generated closed type it became a hard COMPILE error at every such call site, in the\n * consumer as well as here, so faithfully reproducing the propTypes would have shipped a\n * type that forbids the component's most obvious usage.\n *\n * `React.ReactNode` is the accurate type and it still admits the array form, since\n * `ReactNode` includes `Iterable<ReactNode>`. The component only forwards `children` to\n * `S.ContextMenuItemsGroup`, so nothing here depends on it being an array. Zero runtime\n * change: the propTypes this replaces were already deleted by the codemod.\n */\n children?: React.ReactNode;\n};\n\n/*\n * NMB-3998 §C.2: `props` is spread onto `S.ContextMenuItemsGroup`, 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 ContextMenuItemsGroupOwnProps`);\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.ContextMenuItemsGroup>,\n keyof ContextMenuItemsGroupOwnProps\n> &\n ContextMenuItemsGroupOwnProps;\n\n/**\n * Simple wrapper for a group of context menu items. These will be displayed without a border between each item.\n *\n * See the documentation for `ContextMenu` for an example.\n *\n * ### Import\n *\n * ``` js\n * import { ContextMenuItemsGroup } from '@ntbjs/react-components/widgets/ContextMenu'\n * // or\n * import ContextMenuItemsGroup from '@ntbjs/react-components/widgets/ContextMenu/ContextMenuItemsGroup'\n * ```\n *\n */\nconst ContextMenuItemsGroup = React.forwardRef<any, Props>(function ContextMenuItemsGroup(\n { children, ...props },\n forwardedRef\n) {\n return (\n <S.ContextMenuItemsGroup ref={forwardedRef} {...props} role=\"group\">\n {children}\n </S.ContextMenuItemsGroup>\n );\n});\n\nexport default ContextMenuItemsGroup;\n"],"names":["ContextMenuItemsGroup","React","forwardRef","children","props","forwardedRef","_jsx","S","ref","role"],"mappings":";;;;AAuDA,MAAMA,qBAAqB,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,qBAAqBA,CACvF;EAAEG,QAAQ;EAAE,GAAGC;AAAM,CAAC,EACtBC,YAAY,EACZ;AACA,EAAA,OACEC,GAAA,CAACC,uBAAuB,EAAA;AAACC,IAAAA,GAAG,EAAEH,YAAa;AAAA,IAAA,GAAKD,KAAK;AAAEK,IAAAA,IAAI,EAAC,OAAO;AAAAN,IAAAA,QAAA,EAChEA;AAAQ,GACc,CAAC;AAE9B,CAAC;;;;"}
|
|
@@ -6,17 +6,10 @@ const shouldForwardProp = prop => {
|
|
|
6
6
|
};
|
|
7
7
|
const ContextMenuItemsGroup = styled.div.withConfig({
|
|
8
8
|
shouldForwardProp
|
|
9
|
-
}).attrs(applyDefaultTheme)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
border-bottom: none !important;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
> *:not(:last-child) {
|
|
17
|
-
height: 32px;
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
9
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
10
|
+
displayName: "ContextMenuItemsGroupstyled__ContextMenuItemsGroup",
|
|
11
|
+
componentId: "sc-ot5edl-0"
|
|
12
|
+
})(["> *{border-bottom:none !important;}> *:not(:last-child){height:32px;}"]);
|
|
20
13
|
|
|
21
14
|
export { ContextMenuItemsGroup };
|
|
22
15
|
//# sourceMappingURL=ContextMenuItemsGroup.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuItemsGroup.styled.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.
|
|
1
|
+
{"version":3,"file":"ContextMenuItemsGroup.styled.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.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 ContextMenuItemsGroup = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n\n\n > * {\n border-bottom: none !important;\n }\n\n > *:not(:last-child) {\n height: 32px;\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","ContextMenuItemsGroup","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId"],"mappings":";;;AAwBA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,qBAAqB,GAAGC,MAAM,CAACC,GAAG,CAC5CC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,oDAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,uEAAA,CAAA;;;;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import React__default, { useState } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
2
|
import { Container, MetricsContainer, IconTotalContainer, IconContainer, Total, Label, Link, ButtonLink, StyledArrowIcon } from './InfoCard.styled.js';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
4
|
|
|
6
5
|
const InfoCard = React__default.forwardRef(function InfoCard({
|
|
7
6
|
icon,
|
|
@@ -14,27 +13,33 @@ const InfoCard = React__default.forwardRef(function InfoCard({
|
|
|
14
13
|
}, forwardedRef) {
|
|
15
14
|
const [isLinkHovered, setIsLinkHovered] = useState(false);
|
|
16
15
|
const handleLinkClick = e => onClick(e);
|
|
17
|
-
return
|
|
16
|
+
return jsxs(Container, {
|
|
18
17
|
height: height,
|
|
19
|
-
ref: forwardedRef
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
ref: forwardedRef,
|
|
19
|
+
...props,
|
|
20
|
+
children: [jsxs(MetricsContainer, {
|
|
21
|
+
children: [jsxs(IconTotalContainer, {
|
|
22
|
+
children: [jsx(IconContainer, {
|
|
23
|
+
children: icon
|
|
24
|
+
}), jsx(Total, {
|
|
25
|
+
children: total
|
|
26
|
+
})]
|
|
27
|
+
}), jsx(Label, {
|
|
28
|
+
children: label
|
|
29
|
+
})]
|
|
30
|
+
}), linkLabel && onClick && jsxs(Link, {
|
|
31
|
+
onClick: handleLinkClick,
|
|
32
|
+
onMouseEnter: () => setIsLinkHovered(true),
|
|
33
|
+
onMouseLeave: () => setIsLinkHovered(false),
|
|
34
|
+
children: [jsx(ButtonLink, {
|
|
35
|
+
$isHovered: isLinkHovered,
|
|
36
|
+
children: linkLabel
|
|
37
|
+
}), jsx(StyledArrowIcon, {
|
|
38
|
+
$isHovered: isLinkHovered
|
|
39
|
+
})]
|
|
40
|
+
})]
|
|
41
|
+
});
|
|
29
42
|
});
|
|
30
|
-
InfoCard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
31
|
-
icon: PropTypes.element.isRequired,
|
|
32
|
-
total: PropTypes.number.isRequired,
|
|
33
|
-
label: PropTypes.string.isRequired,
|
|
34
|
-
linkLabel: PropTypes.string,
|
|
35
|
-
onClick: PropTypes.func,
|
|
36
|
-
height: PropTypes.number
|
|
37
|
-
} : {};
|
|
38
43
|
|
|
39
44
|
export { InfoCard as default };
|
|
40
45
|
//# sourceMappingURL=InfoCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoCard.js","sources":["../../../src/components/widgets/InfoCard/InfoCard.
|
|
1
|
+
{"version":3,"file":"InfoCard.js","sources":["../../../src/components/widgets/InfoCard/InfoCard.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport * as S from './InfoCard.styled';\n\ntype InfoCardOwnProps = {\n icon: React.ReactElement<any>;\n total: number;\n label: string;\n linkLabel?: string;\n onClick?: (...args: any[]) => any;\n height?: number;\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 InfoCardOwnProps`);\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 InfoCardOwnProps> &\n InfoCardOwnProps;\n\n/**\n * Info Card\n *\n * ### Import\n *\n * ``` js\n * import { InfoCard } from '@ntbjs/react-components/widgets'\n * // or\n * import InfoCard from '@ntbjs/react-components/widgets/InfoCard'\n * ```\n *\n * ### Props\n * ```\n * Pass `icon={<svg></svg>}` to display an icon.\n * Pass `total={100}` to display number.\n * Pass `label={\"this is a label\"}` to display a label.\n * Pass `linkLabel={\"this is a label\"}` to display a link next to the arrow icon.\n * Pass `height={50}` to adjust the card´s height.\n * Pass `onClick={function}` to handle click event.\n * ```\n */\n\nconst InfoCard = React.forwardRef<any, Props>(function InfoCard(\n { icon, total, label, linkLabel, onClick, height, ...props },\n forwardedRef\n) {\n const [isLinkHovered, setIsLinkHovered] = useState(false);\n\n const handleLinkClick = e => onClick(e);\n\n return (\n <S.Container height={height} ref={forwardedRef} {...props}>\n <S.MetricsContainer>\n <S.IconTotalContainer>\n <S.IconContainer>{icon}</S.IconContainer>\n <S.Total>{total}</S.Total>\n </S.IconTotalContainer>\n <S.Label>{label}</S.Label>\n </S.MetricsContainer>\n {linkLabel && onClick && (\n <S.Link\n onClick={handleLinkClick}\n onMouseEnter={() => setIsLinkHovered(true)}\n onMouseLeave={() => setIsLinkHovered(false)}\n >\n <S.ButtonLink $isHovered={isLinkHovered}>{linkLabel}</S.ButtonLink>\n <S.StyledArrowIcon $isHovered={isLinkHovered} />\n </S.Link>\n )}\n </S.Container>\n );\n});\n\nexport default InfoCard;\n"],"names":["InfoCard","React","forwardRef","icon","total","label","linkLabel","onClick","height","props","forwardedRef","isLinkHovered","setIsLinkHovered","useState","handleLinkClick","e","_jsxs","S","ref","children","_jsx","onMouseEnter","onMouseLeave","$isHovered"],"mappings":";;;;AA4CA,MAAMA,QAAQ,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,QAAQA,CAC7D;EAAEG,IAAI;EAAEC,KAAK;EAAEC,KAAK;EAAEC,SAAS;EAAEC,OAAO;EAAEC,MAAM;EAAE,GAAGC;AAAM,CAAC,EAC5DC,YAAY,EACZ;EACA,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC;AAEzD,EAAA,MAAMC,eAAe,GAAGC,CAAC,IAAIR,OAAO,CAACQ,CAAC,CAAC;AAEvC,EAAA,OACEC,IAAA,CAACC,SAAW,EAAA;AAACT,IAAAA,MAAM,EAAEA,MAAO;AAACU,IAAAA,GAAG,EAAER,YAAa;AAAA,IAAA,GAAKD,KAAK;AAAAU,IAAAA,QAAA,EAAA,CACvDH,IAAA,CAACC,gBAAkB,EAAA;AAAAE,MAAAA,QAAA,EAAA,CACjBH,IAAA,CAACC,kBAAoB,EAAA;AAAAE,QAAAA,QAAA,EAAA,CACnBC,GAAA,CAACH,aAAe,EAAA;AAAAE,UAAAA,QAAA,EAAEhB;AAAI,SAAkB,CAAC,EACzCiB,GAAA,CAACH,KAAO,EAAA;AAAAE,UAAAA,QAAA,EAAEf;AAAK,SAAU,CAAC;AAAA,OACN,CAAC,EACvBgB,GAAA,CAACH,KAAO,EAAA;AAAAE,QAAAA,QAAA,EAAEd;AAAK,OAAU,CAAC;KACR,CAAC,EACpBC,SAAS,IAAIC,OAAO,IACnBS,IAAA,CAACC,IAAM,EAAA;AACLV,MAAAA,OAAO,EAAEO,eAAgB;AACzBO,MAAAA,YAAY,EAAEA,MAAMT,gBAAgB,CAAC,IAAI,CAAE;AAC3CU,MAAAA,YAAY,EAAEA,MAAMV,gBAAgB,CAAC,KAAK,CAAE;AAAAO,MAAAA,QAAA,EAAA,CAE5CC,GAAA,CAACH,UAAY,EAAA;AAACM,QAAAA,UAAU,EAAEZ,aAAc;AAAAQ,QAAAA,QAAA,EAAEb;AAAS,OAAe,CAAC,EACnEc,GAAA,CAACH,eAAiB,EAAA;AAACM,QAAAA,UAAU,EAAEZ;AAAc,OAAE,CAAC;AAAA,KAC1C,CACT;AAAA,GACU,CAAC;AAElB,CAAC;;;;"}
|
|
@@ -8,106 +8,58 @@ const shouldForwardProp = prop => {
|
|
|
8
8
|
};
|
|
9
9
|
const Container = styled.div.withConfig({
|
|
10
10
|
shouldForwardProp
|
|
11
|
-
}).attrs(applyDefaultTheme)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
${props => props.theme.themeProp('background', props.theme.getColor('gray-800'), props.theme.getColor('gray-50'))};
|
|
16
|
-
height: ${props => props.height ? `${props.height}px` : '50px'};
|
|
17
|
-
border-radius: 3px;
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: row;
|
|
20
|
-
align-items: center;
|
|
21
|
-
padding: 5px 0;
|
|
22
|
-
`;
|
|
11
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
12
|
+
displayName: "InfoCardstyled__Container",
|
|
13
|
+
componentId: "sc-gnifwb-0"
|
|
14
|
+
})(["font-family:", ";font-size:1rem;font-weight:500;", ";height:", ";border-radius:3px;display:flex;flex-direction:row;align-items:center;padding:5px 0;"], props => props.theme.primaryFontFamily, props => props.theme.themeProp('background', props.theme.getColor('gray-800'), props.theme.getColor('gray-50')), props => props.height ? `${props.height}px` : '50px');
|
|
23
15
|
const MetricsContainer = styled.div.withConfig({
|
|
24
16
|
shouldForwardProp
|
|
25
|
-
}).attrs(applyDefaultTheme)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
align-items: flex-start;
|
|
30
|
-
width: 70%;
|
|
31
|
-
gap: 5px;
|
|
32
|
-
padding-left: 15px;
|
|
33
|
-
`;
|
|
17
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
18
|
+
displayName: "InfoCardstyled__MetricsContainer",
|
|
19
|
+
componentId: "sc-gnifwb-1"
|
|
20
|
+
})(["display:flex;flex-direction:column;justify-content:center;align-items:flex-start;width:70%;gap:5px;padding-left:15px;"]);
|
|
34
21
|
const IconTotalContainer = styled.div.withConfig({
|
|
35
22
|
shouldForwardProp
|
|
36
|
-
}).attrs(applyDefaultTheme)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
gap: 10px;
|
|
41
|
-
`;
|
|
23
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
24
|
+
displayName: "InfoCardstyled__IconTotalContainer",
|
|
25
|
+
componentId: "sc-gnifwb-2"
|
|
26
|
+
})(["display:flex;justify-content:center;align-items:center;gap:10px;"]);
|
|
42
27
|
const Total = styled.div.withConfig({
|
|
43
28
|
shouldForwardProp
|
|
44
|
-
}).attrs(applyDefaultTheme)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
`;
|
|
29
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
30
|
+
displayName: "InfoCardstyled__Total",
|
|
31
|
+
componentId: "sc-gnifwb-3"
|
|
32
|
+
})(["font-size:1.22rem;font-weight:700;", ";"], props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900')));
|
|
49
33
|
const Label = styled.div.withConfig({
|
|
50
34
|
shouldForwardProp
|
|
51
|
-
}).attrs(applyDefaultTheme)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
${props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-500'))};
|
|
56
|
-
`;
|
|
35
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
36
|
+
displayName: "InfoCardstyled__Label",
|
|
37
|
+
componentId: "sc-gnifwb-4"
|
|
38
|
+
})(["font-size:0.875rem;font-weight:400;opacity:0.8;", ";"], props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-500')));
|
|
57
39
|
const IconContainer = styled.div.withConfig({
|
|
58
40
|
shouldForwardProp
|
|
59
|
-
}).attrs(applyDefaultTheme)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
width: 18px;
|
|
64
|
-
margin-top: -0.05rem;
|
|
65
|
-
`;
|
|
41
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
42
|
+
displayName: "InfoCardstyled__IconContainer",
|
|
43
|
+
componentId: "sc-gnifwb-5"
|
|
44
|
+
})(["display:flex;justify-content:center;align-items:center;width:18px;margin-top:-0.05rem;"]);
|
|
66
45
|
const Link = styled.div.withConfig({
|
|
67
46
|
shouldForwardProp
|
|
68
|
-
}).attrs(applyDefaultTheme)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
opacity: 0.7;
|
|
73
|
-
display: flex;
|
|
74
|
-
align-items: center;
|
|
75
|
-
justify-content: flex-end;
|
|
76
|
-
margin-right: 20px;
|
|
77
|
-
cursor: pointer;
|
|
78
|
-
height: 100%;
|
|
79
|
-
gap: 10px;
|
|
80
|
-
svg {
|
|
81
|
-
transition: transform 0.2s ease-in-out;
|
|
82
|
-
}
|
|
83
|
-
&:hover svg {
|
|
84
|
-
transform: translateX(2px);
|
|
85
|
-
}
|
|
86
|
-
`;
|
|
47
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
48
|
+
displayName: "InfoCardstyled__Link",
|
|
49
|
+
componentId: "sc-gnifwb-6"
|
|
50
|
+
})(["font-size:0.875rem;font-weight:400;width:30%;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);}"]);
|
|
87
51
|
const ButtonLink = styled.div.withConfig({
|
|
88
52
|
shouldForwardProp
|
|
89
|
-
}).attrs(applyDefaultTheme)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
display: flex;
|
|
94
|
-
align-items: center;
|
|
95
|
-
white-space: nowrap;
|
|
96
|
-
opacity: ${props => props.$isHovered ? 1 : 0.8};
|
|
97
|
-
transition: color 0.2s ease-in-out;
|
|
98
|
-
${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'))};
|
|
99
|
-
`;
|
|
53
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
54
|
+
displayName: "InfoCardstyled__ButtonLink",
|
|
55
|
+
componentId: "sc-gnifwb-7"
|
|
56
|
+
})(["font-size:0.875rem;font-weight:500;height:100%;display:flex;align-items:center;white-space:nowrap;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')));
|
|
100
57
|
const StyledArrowIcon = styled(SvgArrowForward).withConfig({
|
|
101
58
|
shouldForwardProp
|
|
102
|
-
}).attrs(applyDefaultTheme)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
transition: transform 0.2s ease-in-out, fill 0.2s ease-in-out;
|
|
107
|
-
transform: ${props => props.$isHovered ? 'translateX(2px)' : 'translateX(0)'};
|
|
108
|
-
|
|
109
|
-
${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'))};
|
|
110
|
-
`;
|
|
59
|
+
}).attrs(applyDefaultTheme).withConfig({
|
|
60
|
+
displayName: "InfoCardstyled__StyledArrowIcon",
|
|
61
|
+
componentId: "sc-gnifwb-8"
|
|
62
|
+
})(["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')));
|
|
111
63
|
|
|
112
64
|
export { ButtonLink, Container, IconContainer, IconTotalContainer, Label, Link, MetricsContainer, StyledArrowIcon, Total };
|
|
113
65
|
//# sourceMappingURL=InfoCard.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoCard.styled.js","sources":["../../../src/components/widgets/InfoCard/InfoCard.styled.
|
|
1
|
+
{"version":3,"file":"InfoCard.styled.js","sources":["../../../src/components/widgets/InfoCard/InfoCard.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 */\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\nimport { ArrowForwardIcon } from '../../../icons';\n\n/**\n * `height` — `PropTypes.number`, px, interpolated as `${props.height}px` with a `50px`\n * fallback. `number` and not `number | string`: a string here would already render\n * `height: 60pxpx`.\n *\n * NO `$`, AND THAT IS A DEFECT THAT IS ALREADY IN THE RENDER BASELINE. `height` is not a\n * member of `HTMLAttributes<HTMLDivElement>` (which is why the read needs this\n * declaration at all) but React DOES recognise it and renders it, so `widgets/InfoCard`\n * in `scripts/r19-harness/baseline.json` opens with `<div height=\"60\" class=\"…\">`.\n * Renaming it `$height` removes that attribute and therefore MOVES the baseline — C10\n * work, §E.4.\n */\nexport interface InfoCardContainerStyleProps {\n height?: number;\n}\n\n/**\n * `$isHovered` — the `Link`'s hover state, held in `InfoCard.tsx`'s `useState`, so\n * genuinely `boolean` and not derived from any prop.\n *\n * NOT COVERABLE BY THE RENDER GATE, and the fixture says so: it comes from `useState`, so\n * it is `false` in every static render whatever props are passed. Both of its hosts\n * therefore have rule blocks the baseline can never exercise — which is exactly why the\n * type matters here more than it would on a prop a fixture pins.\n *\n * Hosts: `ButtonLink` and `StyledArrowIcon`.\n */\ninterface InfoCardHoverStyleProps {\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\nexport const Container = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<InfoCardContainerStyleProps>(applyDefaultTheme)`\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 1rem;\n font-weight: 500;\n ${props =>\n props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-800'),\n props.theme.getColor('gray-50')\n )};\n height: ${props => (props.height ? `${props.height}px` : '50px')};\n border-radius: 3px;\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 5px 0;\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: flex-start;\n width: 70%;\n gap: 5px;\n padding-left: 15px;\n`;\n\nexport const IconTotalContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 10px;\n`;\nexport const Total = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 1.22rem;\n font-weight: 700;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )};\n`;\n\nexport const Label = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 0.875rem;\n font-weight: 400;\n opacity: 0.8;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-500')\n )};\n`;\nexport const IconContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n justify-content: center;\n align-items: center;\n width: 18px;\n margin-top: -0.05rem;\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: 30%;\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<InfoCardHoverStyleProps>(applyDefaultTheme)`\n font-size: 0.875rem;\n font-weight: 500;\n height: 100%;\n display: flex;\n align-items: center;\n white-space: nowrap;\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<InfoCardHoverStyleProps>(applyDefaultTheme)`\n height: 15px;\n margin-right: 10px;\n opacity: ${props => (props.$isHovered ? 1 : 0.8)};\n transition: transform 0.2s ease-in-out, 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","Container","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","theme","primaryFontFamily","themeProp","getColor","height","MetricsContainer","Icon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AAI,EAEnCb,KAAK,IAAKA,KAAK,CAACa,UAAU,GAAG,iBAAiB,GAAG,eAAgB,EAE5Eb,KAAK,IACLA,KAAK,CAACa,UAAU,GACZb,KAAK,CAACC,KAAK,CAACE,SAAS,CAAC,MAAM,EAAEH,KAAK,CAACC,KAAK,CAACG,QAAQ,CAAC,OAAO,CAAC,EAAEJ,KAAK,CAACC,KAAK,CAACG,QAAQ,CAAC,OAAO,CAAC,CAAC,GAC3FJ,KAAK,CAACC,KAAK,CAACE,SAAS,CACnB,MAAM,EACNH,KAAK,CAACC,KAAK,CAACG,QAAQ,CAAC,OAAO,CAAC,EAC7BJ,KAAK,CAACC,KAAK,CAACG,QAAQ,CAAC,OAAO,CAC9B,CAAC;;;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
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 SeverityBadge from '../../data/SeverityBadge/SeverityBadge.js';
|
|
5
3
|
import { InstructionText, Card, ThumbnailWrapper, ThumbnailImage, ContentWrapper } from './InstructionSeverityDisplay.styled.js';
|
|
4
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
6
5
|
|
|
7
6
|
const defaultLabels = {
|
|
8
7
|
1: 'Info',
|
|
@@ -33,45 +32,40 @@ const InstructionSeverityDisplay = React__default.forwardRef(function Instructio
|
|
|
33
32
|
const effectiveSeverity = severity ?? 1;
|
|
34
33
|
const displayLabel = severityLabel || labels && labels[effectiveSeverity] || defaultLabels[effectiveSeverity];
|
|
35
34
|
const hasThumbnail = thumbnail !== undefined;
|
|
36
|
-
const content =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
const content = jsxs(Fragment, {
|
|
36
|
+
children: [jsx(SeverityBadge, {
|
|
37
|
+
severity: severity,
|
|
38
|
+
label: displayLabel,
|
|
39
|
+
icon: icon,
|
|
40
|
+
fontSize: badgeFontSize ? parseFloat(badgeFontSize) : undefined
|
|
41
|
+
}), jsx(InstructionText, {
|
|
42
|
+
$fontSize: detailsFontSize,
|
|
43
|
+
$maxLines: maxLines,
|
|
44
|
+
children: maxLines ? jsx("span", {
|
|
45
|
+
title: instructionText,
|
|
46
|
+
children: instructionText
|
|
47
|
+
}) : instructionText
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
return jsxs(Card, {
|
|
48
51
|
ref: forwardedRef,
|
|
49
52
|
$severity: severity,
|
|
50
53
|
$showCard: showCard,
|
|
51
54
|
$padding: padding,
|
|
52
55
|
$bgLight: bgLight,
|
|
53
56
|
$bgDark: bgDark,
|
|
54
|
-
$hasThumbnail: hasThumbnail
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
$hasThumbnail: hasThumbnail,
|
|
58
|
+
...props,
|
|
59
|
+
children: [hasThumbnail && jsx(ThumbnailWrapper, {
|
|
60
|
+
children: thumbnail && jsx(ThumbnailImage, {
|
|
61
|
+
src: thumbnail,
|
|
62
|
+
alt: ""
|
|
63
|
+
})
|
|
64
|
+
}), hasThumbnail ? jsx(ContentWrapper, {
|
|
65
|
+
children: content
|
|
66
|
+
}) : content]
|
|
67
|
+
});
|
|
59
68
|
});
|
|
60
|
-
InstructionSeverityDisplay.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
61
|
-
severity: PropTypes.oneOf([1, 2, 3, 4, 5]),
|
|
62
|
-
instructionText: PropTypes.string,
|
|
63
|
-
severityLabel: PropTypes.string,
|
|
64
|
-
labels: PropTypes.objectOf(PropTypes.string),
|
|
65
|
-
icon: PropTypes.element,
|
|
66
|
-
showCard: PropTypes.bool,
|
|
67
|
-
padding: PropTypes.string,
|
|
68
|
-
badgeFontSize: PropTypes.string,
|
|
69
|
-
detailsFontSize: PropTypes.string,
|
|
70
|
-
bgLight: PropTypes.string,
|
|
71
|
-
bgDark: PropTypes.string,
|
|
72
|
-
maxLines: PropTypes.number,
|
|
73
|
-
thumbnail: PropTypes.string
|
|
74
|
-
} : {};
|
|
75
69
|
|
|
76
70
|
export { InstructionSeverityDisplay as default };
|
|
77
71
|
//# sourceMappingURL=InstructionSeverityDisplay.js.map
|