@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
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props of the `Alert` root, i.e. what `Alert.tsx` passes to `S.Alert`. Value types come
|
|
3
|
+
* from that file's propTypes; all optional per §J.5.
|
|
4
|
+
*/
|
|
5
|
+
export interface AlertStyleProps {
|
|
6
|
+
/** `isWarning` — derived in the component from `type === 'warning'`, so `boolean`. */
|
|
7
|
+
$warning?: boolean;
|
|
8
|
+
/** `isError` — derived from `type === 'error'`. */
|
|
9
|
+
$error?: boolean;
|
|
10
|
+
/** `isInfo` — derived; the component initialises it `true`. */
|
|
11
|
+
$info?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* `verticalPadding` — `PropTypes.number`, px. `number` and not `number | string`: the
|
|
14
|
+
* template interpolates `${…}px`, so a string would already emit `padding: 17pxpx`.
|
|
15
|
+
*/
|
|
16
|
+
$verticalPadding?: number;
|
|
17
|
+
/** `horizontalPadding` — `PropTypes.number`, px, interpolated the same way. */
|
|
18
|
+
$horizontalPadding?: number;
|
|
19
|
+
/**
|
|
20
|
+
* `alertMessage` — `PropTypes.string`.
|
|
21
|
+
*
|
|
22
|
+
* DECLARED BECAUSE THE COMPONENT PASSES IT, NOT BECAUSE ANYTHING READS IT. No
|
|
23
|
+
* interpolation below mentions `$alertMessage`; the message is rendered as the
|
|
24
|
+
* `<span>` child of `AlertRender` instead. `shouldForwardProp` filters it, so it
|
|
25
|
+
* reaches neither the CSS nor the DOM — a dead prop, harmless, and dropping it from
|
|
26
|
+
* `Alert.tsx` is a separate cleanup.
|
|
27
|
+
*/
|
|
28
|
+
$alertMessage?: string;
|
|
29
|
+
/**
|
|
30
|
+
* `align` — `PropTypes.oneOf(['left', 'center'])`.
|
|
31
|
+
*
|
|
32
|
+
* DEFECT, DECLARED NOT FIXED: this is the prop the component passes, and NOTHING READS
|
|
33
|
+
* IT. The `text-align` rule at the bottom of this template reads the non-`$` `align`
|
|
34
|
+
* (declared below) instead, and that is never passed — so `align="center"` has never
|
|
35
|
+
* had any effect and every Alert renders `text-align: left`.
|
|
36
|
+
*
|
|
37
|
+
* The fix is to repoint that read from `props.align` to `props.$align`, which ACTIVATES
|
|
38
|
+
* A BRANCH THAT HAS NEVER FIRED and so changes rendered CSS. §J.8 lists that as C10
|
|
39
|
+
* work with a baseline re-record; it must not ride along in a type-only commit.
|
|
40
|
+
*/
|
|
41
|
+
$align?: 'left' | 'center';
|
|
42
|
+
/**
|
|
43
|
+
* `width` — `PropTypes.number`, px.
|
|
44
|
+
*
|
|
45
|
+
* DEFECT, DECLARED NOT FIXED: no `$`. `Alert.tsx` passes `width={width}` and
|
|
46
|
+
* `shouldForwardProp` forwards every non-`$` prop, so whenever a caller sets `width` it
|
|
47
|
+
* also lands on the rendered `<div>`, which is not a valid attribute on a `<div>`.
|
|
48
|
+
* CONFIRMED, not inferred: `scripts/r19-harness/baseline.json` records
|
|
49
|
+
* `<div width="480" …>` for `data/Alert`. The fix is to rename it `$width` at both ends,
|
|
50
|
+
* which REMOVES a DOM attribute and so needs C10's re-record. §E.4's third case.
|
|
51
|
+
*/
|
|
52
|
+
width?: number;
|
|
53
|
+
/**
|
|
54
|
+
* `align` again, in its non-`$` form — the key this template actually reads. Same
|
|
55
|
+
* defect as `$align` above, stated from the reading end: nothing passes this, so the
|
|
56
|
+
* `=== 'center'` comparison is always `false`.
|
|
57
|
+
*/
|
|
58
|
+
align?: 'left' | 'center';
|
|
59
|
+
}
|
|
60
|
+
/** Props of `AlertRender`, i.e. what `Alert.tsx` passes to `S.AlertRender`. */
|
|
61
|
+
interface AlertRenderStyleProps {
|
|
62
|
+
/** `lineHeight` — `PropTypes.number`, px, interpolated as `${…}px`. */
|
|
63
|
+
$lineHeight?: number;
|
|
64
|
+
/**
|
|
65
|
+
* `lineClamp` — `PropTypes.number`, the `-webkit-line-clamp` count. The component
|
|
66
|
+
* defaults it to `0`, which is falsy, so the clamp block is opt-in.
|
|
67
|
+
*/
|
|
68
|
+
$lineClamp?: number;
|
|
69
|
+
/**
|
|
70
|
+
* `fontSize` — `PropTypes.number`, px.
|
|
71
|
+
*
|
|
72
|
+
* DEFECT, DECLARED NOT FIXED: no `$`. `Alert.tsx` passes `fontSize={fontSize}`, so
|
|
73
|
+
* whenever a caller sets it, it also leaks onto the rendered `<div>` — AS
|
|
74
|
+
* `font-size="12"`, NOT `fontSize="12"`: React maps this particular camelCase name to
|
|
75
|
+
* its hyphenated attribute form. CONFIRMED, not inferred:
|
|
76
|
+
* `scripts/r19-harness/baseline.json` records `<div font-size="12" …>` for every
|
|
77
|
+
* `data/Alert` entry. The fix is `$fontSize` at both ends — a DOM change, so C10. §E.4.
|
|
78
|
+
*/
|
|
79
|
+
fontSize?: number;
|
|
80
|
+
}
|
|
81
|
+
export declare const Alert: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, AlertStyleProps>, never>> & string;
|
|
82
|
+
export declare const AlertRender: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, AlertRenderStyleProps>, never>> & string;
|
|
83
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Alert';
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as S from './Badge.styled';
|
|
3
|
+
type BadgeOwnProps = {
|
|
4
|
+
/**
|
|
5
|
+
* An Icon to show in the badge alongside with a text
|
|
6
|
+
*/
|
|
7
|
+
badgeIcon?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Content to be showed in the badge – e.g. number of results.
|
|
10
|
+
*
|
|
11
|
+
* NMB-3998: this is `React.ReactNode` and NOT the four-way union the propTypes
|
|
12
|
+
* codemod produced from `oneOfType([string, number, func, element])`. The `func`
|
|
13
|
+
* member was never a legal value: line 182 renders `{badgeContent}` as a child, and
|
|
14
|
+
* React THROWS "Functions are not valid as a React child" for a function. So the
|
|
15
|
+
* propTypes documented a value that cannot work, and transcribing them faithfully
|
|
16
|
+
* published that mistake as a type — which is what TS2769 on line 182 was reporting.
|
|
17
|
+
* The union was also missing `null`, used by `Badge badgeContent={null}` in
|
|
18
|
+
* Tabs.stories; that only compiled because `strictNullChecks` is off.
|
|
19
|
+
*/
|
|
20
|
+
badgeContent?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* The element(s) for which the badge will be displayed – e.g. an icon or a text.
|
|
23
|
+
*/
|
|
24
|
+
children?: React.ReactNode | string;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the badge should be displayed in an elevated position on top of the child element(s) or not.
|
|
27
|
+
*/
|
|
28
|
+
elevated?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the element is active or not (e.g. the currently selected menu item). This changes the color of the badge.
|
|
31
|
+
*/
|
|
32
|
+
active?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* There is an error present – 'error be prioritized over warnings if both are set to `true`.
|
|
35
|
+
*/
|
|
36
|
+
error?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* There is a warning present.
|
|
39
|
+
*/
|
|
40
|
+
warning?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Font size for the badge
|
|
43
|
+
*/
|
|
44
|
+
fontSize?: number | string;
|
|
45
|
+
/**
|
|
46
|
+
* Font weight for the badge
|
|
47
|
+
*/
|
|
48
|
+
fontWeight?: number | string;
|
|
49
|
+
/**
|
|
50
|
+
* Line weight for the badge
|
|
51
|
+
*/
|
|
52
|
+
lineHeight?: number | string;
|
|
53
|
+
/**
|
|
54
|
+
* Colors of the font in the manner of [darkThemeColor, lightThemeColor]
|
|
55
|
+
*/
|
|
56
|
+
colors?: string[];
|
|
57
|
+
/**
|
|
58
|
+
* Background colors for the badge in the manner of [darkThemeColor, lightThemeColor]
|
|
59
|
+
*/
|
|
60
|
+
backgroundColors?: string[];
|
|
61
|
+
/**
|
|
62
|
+
* Top and bottom padding for the badge
|
|
63
|
+
*/
|
|
64
|
+
verticalPadding?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Left and right padding for the badge
|
|
67
|
+
*/
|
|
68
|
+
horizontalPadding?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Height of the badge
|
|
71
|
+
*/
|
|
72
|
+
height?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Minimum height of the badge
|
|
75
|
+
*/
|
|
76
|
+
minHeight?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Width of the badge
|
|
79
|
+
*/
|
|
80
|
+
width?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Minimum width of the badge
|
|
83
|
+
*/
|
|
84
|
+
minWidth?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Border colors in the manner of [darkThemeColor, lightThemeColor]. When provided, a 1px solid border is applied.
|
|
87
|
+
*/
|
|
88
|
+
borderColors?: string[];
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Badges show a bubble containing a `number` or a `string`. It may be used by itself or with children passed as props
|
|
92
|
+
* (to display a badge on top of an icon, for example, pass the icon as the child).
|
|
93
|
+
*
|
|
94
|
+
* If the badge content is passed as a `float`, it will be rounded up to the nearest `integer`,
|
|
95
|
+
* and if the number is higher than 1 000 or 1 000 000 it will be abbreviated to for example "1.4K" or "1.4M" respectively.
|
|
96
|
+
* If you need to display a `float` instead of a rounded `integer`, pass it as a `string` instead (e.g. "1,4").
|
|
97
|
+
*
|
|
98
|
+
* ### Import
|
|
99
|
+
*
|
|
100
|
+
* ``` js
|
|
101
|
+
* import { Badge } from '@ntbjs/react-components/data'
|
|
102
|
+
* // or
|
|
103
|
+
* import Badge from '@ntbjs/react-components/data/Badge'
|
|
104
|
+
* ```
|
|
105
|
+
* ## Props
|
|
106
|
+
* ```
|
|
107
|
+
* Pass `badgeIcon={<svg></svg>}` to display an icon.
|
|
108
|
+
* Pass a number or string to the badgeContent to display it alongside the icon.
|
|
109
|
+
* Pass `align={"left"}`or `align={"center"}` to align content.
|
|
110
|
+
* Pass `elevated={true}` to display the badge on top of the children
|
|
111
|
+
* Pass `active={true}` to reflect the active status of the badge
|
|
112
|
+
* Pass `error={true}` to reflect the error status of the badge
|
|
113
|
+
* Pass `warning={true}` to reflect the warning status of the badge
|
|
114
|
+
* Pass `fontSize={15}` to set the font size of the badge in pixel
|
|
115
|
+
* Pass `fontWeight={500}` to set the font weight of the badge
|
|
116
|
+
* Pass `lineHeight={12}` to set the line height of the badge in pixel
|
|
117
|
+
* Pass `colors={[#ffffff, #000000]}` to set the font color of the badge
|
|
118
|
+
* Pass `backgroundColors={[#ffffff, #000000]}` to set the background color of the badge
|
|
119
|
+
* Pass `verticalPadding={15}` to set the bottom and top padding of the badge in pixel
|
|
120
|
+
* Pass `horizontalPadding={20}` to set the left and right padding of the badge in pixel
|
|
121
|
+
* Pass `height={24}` to set the height of the badge in pixel
|
|
122
|
+
* Pass `minHeight={24}` to set the minimum height of the badge in pixel
|
|
123
|
+
* Pass `width={50}` to set the width of the badge in pixel
|
|
124
|
+
* Pass `minWidth={32}` to set the minimum width of the badge in pixel
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
declare const Badge: React.ForwardRefExoticComponent<Omit<Omit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>, S.BadgeStyleProps>, never>, "ref">, keyof BadgeOwnProps> & BadgeOwnProps & React.RefAttributes<any>>;
|
|
128
|
+
export default Badge;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/** Props of the `Badge` root, i.e. what `Badge.tsx` passes to `S.Badge`. */
|
|
2
|
+
export interface BadgeStyleProps {
|
|
3
|
+
/** `elevated` — `PropTypes.bool`; positions the label on top of the children. */
|
|
4
|
+
$elevated?: boolean;
|
|
5
|
+
/** `Boolean(children)`, derived in the component, so genuinely `boolean`. */
|
|
6
|
+
$hasChildren?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Props of `BadgeLabel`. Value types from `Badge.tsx`'s propTypes; all optional per §J.5.
|
|
10
|
+
*
|
|
11
|
+
* Read the file header before adding to this list: eight of these members exist because
|
|
12
|
+
* the template and the component disagree about the key, not because they are wanted.
|
|
13
|
+
*/
|
|
14
|
+
interface BadgeLabelStyleProps {
|
|
15
|
+
/** `elevated` — drives border-radius, margin, position and transform below. */
|
|
16
|
+
$elevated?: boolean;
|
|
17
|
+
/** `active` — `PropTypes.bool`. */
|
|
18
|
+
$active?: boolean;
|
|
19
|
+
/** `error` — `PropTypes.bool`. Takes priority over `$warning`. */
|
|
20
|
+
$error?: boolean;
|
|
21
|
+
/** `warning` — `PropTypes.bool`. */
|
|
22
|
+
$warning?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* `lineHeight` — `PropTypes.oneOfType([number, string])`.
|
|
25
|
+
*
|
|
26
|
+
* DEFECT, DECLARED NOT FIXED: `Badge.tsx` DEFAULTS `lineHeight` TO THE STRING
|
|
27
|
+
* `'normal'`, and the template emits `${props.$lineHeight}px` whenever the value is
|
|
28
|
+
* truthy — so every Badge that does not override it renders the invalid declaration
|
|
29
|
+
* `line-height: normalpx`, which browsers drop. The effect happens to match the
|
|
30
|
+
* intended `normal`, which is why it has gone unnoticed. Fixing it (default `undefined`,
|
|
31
|
+
* or a unit-aware interpolation) changes the emitted CSS text, so it is C10 work.
|
|
32
|
+
*/
|
|
33
|
+
$lineHeight?: number | string;
|
|
34
|
+
/** `horizontalPadding` — `PropTypes.number`, px. The one padding key that matches. */
|
|
35
|
+
$horizontalPadding?: number;
|
|
36
|
+
/** `minHeight` — `PropTypes.number`, px. */
|
|
37
|
+
$minHeight?: number;
|
|
38
|
+
/** `minWidth` — `PropTypes.number`, px. */
|
|
39
|
+
$minWidth?: number;
|
|
40
|
+
/** `backgroundColors` — `[darkThemeColor, lightThemeColor]`, read by index. */
|
|
41
|
+
$backgroundColors?: string[];
|
|
42
|
+
/** `colors` — font colour as `[darkThemeColor, lightThemeColor]`, read by index. */
|
|
43
|
+
$colors?: string[];
|
|
44
|
+
/** `borderColors` — `[dark, light]`; when set, a 1px solid border is applied. */
|
|
45
|
+
$borderColors?: string[];
|
|
46
|
+
/**
|
|
47
|
+
* `verticalPadding` — `PropTypes.number`, px.
|
|
48
|
+
*
|
|
49
|
+
* DEFECT, DECLARED NOT FIXED, AND IT IS THE §E.3 RUN-TOGETHER-NAME FAMILY.
|
|
50
|
+
* `Badge.tsx:85` passes `$elevatedverticalPadding={verticalPadding}` — `$elevated` and
|
|
51
|
+
* `verticalPadding` run together — while the template below reads the plain
|
|
52
|
+
* `verticalPadding`. Neither name is the other's, so BOTH sides are dead: nothing ever
|
|
53
|
+
* supplies the key this reads, and nothing ever reads the key the component supplies.
|
|
54
|
+
* `verticalPadding` has therefore never had any effect; every Badge falls through to
|
|
55
|
+
* the `$elevated ? '4px' : '6px'` default.
|
|
56
|
+
*
|
|
57
|
+
* The fix is to make both ends `$verticalPadding`, which ACTIVATES A BRANCH THAT HAS
|
|
58
|
+
* NEVER FIRED and so changes rendered padding. C10, with a re-record.
|
|
59
|
+
*/
|
|
60
|
+
verticalPadding?: number;
|
|
61
|
+
/**
|
|
62
|
+
* `$elevatedverticalPadding` — the key `Badge.tsx:85` actually passes. DECLARED BECAUSE
|
|
63
|
+
* THE COMPONENT PASSES IT, NOT BECAUSE ANYTHING READS IT; see `verticalPadding` above.
|
|
64
|
+
* Harmless in the DOM (the `$` prefix means `shouldForwardProp` still filters it), so
|
|
65
|
+
* unlike the four leaks below this one is invisible rather than wrong.
|
|
66
|
+
*/
|
|
67
|
+
$elevatedverticalPadding?: number;
|
|
68
|
+
/**
|
|
69
|
+
* `elevated` in its non-`$` form — read at the `font-size` block below, and NEVER
|
|
70
|
+
* PASSED (the component passes `$elevated`).
|
|
71
|
+
*
|
|
72
|
+
* DEFECT, DECLARED NOT FIXED: the ternary always takes the false arm, so an elevated
|
|
73
|
+
* Badge renders `font-size: 0.750rem` instead of the intended `0.625rem`. Fix: read
|
|
74
|
+
* `props.$elevated`, which is already declared above — a CSS change, so C10.
|
|
75
|
+
*/
|
|
76
|
+
elevated?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* `error` in its non-`$` form — read inside the dark-mode `color` callback, and NEVER
|
|
79
|
+
* PASSED.
|
|
80
|
+
*
|
|
81
|
+
* DEFECT, DECLARED NOT FIXED: it makes the second disjunct of
|
|
82
|
+
* `(props.$warning && !props.$error) || (props.error && !props.$active)` permanently
|
|
83
|
+
* `false`, so an inactive error Badge never gets the `gray-900` text colour in dark
|
|
84
|
+
* mode. Fix: `props.$error` — a colour change, so C10.
|
|
85
|
+
*/
|
|
86
|
+
error?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* `fontSize` — `PropTypes.oneOfType([number, string])`.
|
|
89
|
+
*
|
|
90
|
+
* DEFECT, DECLARED NOT FIXED: no `$`. `Badge.tsx:79` passes it and
|
|
91
|
+
* `shouldForwardProp` forwards every non-`$` prop, so a caller-supplied `fontSize` also
|
|
92
|
+
* lands on the rendered `<span>` — AS `font-size="15"`, NOT `fontSize="15"`: React maps
|
|
93
|
+
* this particular camelCase name to its hyphenated attribute form. CONFIRMED, not
|
|
94
|
+
* inferred: `scripts/r19-harness/baseline.json` records `<span font-size="12" …>` for
|
|
95
|
+
* every `data/Badge` entry. Note the `string` half of the propTypes union is also a
|
|
96
|
+
* trap: the template emits `${props.fontSize}px`, so `fontSize="15px"` would render
|
|
97
|
+
* `15pxpx`. Fix: `$fontSize` at both ends — removes a DOM attribute, so C10. §E.4's
|
|
98
|
+
* third case.
|
|
99
|
+
*/
|
|
100
|
+
fontSize?: number | string;
|
|
101
|
+
/**
|
|
102
|
+
* `fontWeight` — `PropTypes.oneOfType([number, string])`, interpolated raw so both
|
|
103
|
+
* halves are safe. Same non-`$` DOM leak as `fontSize`, hyphenated the same way, and
|
|
104
|
+
* this is the UNCONDITIONAL one: `Badge.tsx:80` passes it and `Badge.tsx:49` defaults it
|
|
105
|
+
* to `'normal'`, so `font-weight="normal"` is on EVERY rendered label whether the caller
|
|
106
|
+
* sets anything or not. Verified by rendering `<Badge badgeContent={5} />` with no other
|
|
107
|
+
* prop. Fix: `$fontWeight` at both ends — C10.
|
|
108
|
+
*/
|
|
109
|
+
fontWeight?: number | string;
|
|
110
|
+
/**
|
|
111
|
+
* `height` — `PropTypes.number`, px. Same non-`$` DOM leak; `Badge.tsx:87` passes it.
|
|
112
|
+
* `height` is not a valid attribute on a `<span>`. CONFIRMED: the baseline records
|
|
113
|
+
* `<span … height="24" …>` for every `data/Badge` entry. Fix: `$height` — C10.
|
|
114
|
+
*/
|
|
115
|
+
height?: number;
|
|
116
|
+
/**
|
|
117
|
+
* `width` — `PropTypes.number`, px. Same non-`$` DOM leak; `Badge.tsx:89` passes it. No
|
|
118
|
+
* baseline fixture sets it, so it is absent there, but rendering the built `Badge` with
|
|
119
|
+
* `width={50}` puts `width="50"` on the `<span>`. Fix: `$width` — C10.
|
|
120
|
+
*/
|
|
121
|
+
width?: number;
|
|
122
|
+
}
|
|
123
|
+
/** Props of `BadgeIcon`. */
|
|
124
|
+
interface BadgeIconStyleProps {
|
|
125
|
+
/** `!!badgeContent`, derived in the component — adds the gutter between icon and text. */
|
|
126
|
+
$useGutter?: boolean;
|
|
127
|
+
}
|
|
128
|
+
export declare const Badge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>, BadgeStyleProps>, never>> & string;
|
|
129
|
+
export declare const BadgeChildrenContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>, never>, never>> & string;
|
|
130
|
+
export declare const BadgeLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>, BadgeLabelStyleProps>, never>> & string;
|
|
131
|
+
export declare const BadgeIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>, BadgeIconStyleProps>, never>> & string;
|
|
132
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Badge';
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Middleware } from '@floating-ui/react';
|
|
3
|
+
import type { PopoverPlacement } from '../../../hooks/useFloatingPopover';
|
|
4
|
+
/**
|
|
5
|
+
* tippy's `appendTo`, and the three-way rule it implies. `'parent'` and an implicit-parent
|
|
6
|
+
* case are real tippy behaviours, not inventions — measured in
|
|
7
|
+
* `tippy.js/dist/tippy.cjs.js`:
|
|
8
|
+
*
|
|
9
|
+
* ```js
|
|
10
|
+
* if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') {
|
|
11
|
+
* parentNode = node.parentNode; // INLINE, next to the reference
|
|
12
|
+
* } else {
|
|
13
|
+
* parentNode = invokeWithArgsOrReturn(appendTo, [node]); // portal
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* ⚠️ **`Popover` DEFAULTS `interactive` TO `true`, SO ITS DEFAULT IS THE INLINE BRANCH.**
|
|
18
|
+
* `appendTo` appears in 6 files per consumer out of 30 `<Popover>` call sites across both,
|
|
19
|
+
* so a blanket `FloatingPortal` would relocate the MAJORITY of call sites out of their
|
|
20
|
+
* current DOM position — a stacking/`z-index` regression across both apps, not a
|
|
21
|
+
* preservation. Plan §A3 originally resolved C4 as "portal by default" on half the evidence
|
|
22
|
+
* and was corrected in `0ef5f71`; `Tooltip.tsx:77-97` is where the branch was first found.
|
|
23
|
+
*
|
|
24
|
+
* | `appendTo` | `interactive` | where it renders |
|
|
25
|
+
* | --- | --- | --- |
|
|
26
|
+
* | given | any | `FloatingPortal` rooted at `appendTo` |
|
|
27
|
+
* | absent | `false` | `FloatingPortal` rooted at `document.body` |
|
|
28
|
+
* | absent | `true` *(the default)* | **INLINE**, into the reference's parent |
|
|
29
|
+
*
|
|
30
|
+
* All 12 `appendTo` sites across both consumers pass `document.body`; the `'parent'` and
|
|
31
|
+
* function forms are supported because tippy supported them and the render-gate fixture
|
|
32
|
+
* uses `'parent'` to make an open popover capturable.
|
|
33
|
+
*/
|
|
34
|
+
export type PopoverAppendTo = 'parent' | Element | ((reference: Element) => Element);
|
|
35
|
+
type PopoverOwnProps = {
|
|
36
|
+
/**
|
|
37
|
+
* The content of the `Popover`.
|
|
38
|
+
*/
|
|
39
|
+
content: string | React.ReactElement<any>;
|
|
40
|
+
/**
|
|
41
|
+
* Determines if the `Popover` has interactive content inside of it, so that it can be
|
|
42
|
+
* hovered over and clicked inside without hiding.
|
|
43
|
+
*
|
|
44
|
+
* **It also decides where the popover renders** — see `PopoverAppendTo`. It defaults to
|
|
45
|
+
* `true`, so a `Popover` renders INLINE unless `appendTo` or `interactive={false}` says
|
|
46
|
+
* otherwise.
|
|
47
|
+
*/
|
|
48
|
+
interactive?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The preferred placement of the `Popover`. Note that the flip middleware can change this
|
|
51
|
+
* to the opposite placement if it has more space.
|
|
52
|
+
*
|
|
53
|
+
* The 12 concrete names are spelled identically in Popper and Floating UI, so they need no
|
|
54
|
+
* translation. The three `auto*` values have no Floating UI string — they select
|
|
55
|
+
* `autoPlacement()` instead of `flip()`; see `useFloatingPopover`.
|
|
56
|
+
*/
|
|
57
|
+
placement?: PopoverPlacement;
|
|
58
|
+
/**
|
|
59
|
+
* Duration in ms of the transition animation.
|
|
60
|
+
*/
|
|
61
|
+
duration?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Determines the events that cause the `Popover` to show. Multiple event names are separated by
|
|
64
|
+
* spaces.
|
|
65
|
+
*
|
|
66
|
+
* *Example events:*
|
|
67
|
+
*
|
|
68
|
+
* `trigger: 'click'`
|
|
69
|
+
*
|
|
70
|
+
* `trigger: 'focusin'`
|
|
71
|
+
*
|
|
72
|
+
* `trigger: 'mouseenter click'`
|
|
73
|
+
*
|
|
74
|
+
* `''` means no triggers at all, and `undefined` means tippy's default
|
|
75
|
+
* (`'mouseenter focus'`) — though this component overrides that with its own default of
|
|
76
|
+
* `'click focus'`. See `parseTrigger`.
|
|
77
|
+
*
|
|
78
|
+
* --
|
|
79
|
+
*/
|
|
80
|
+
trigger?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Displaces the popover from its reference element in pixels (skidding and distance).
|
|
83
|
+
*
|
|
84
|
+
* `[skidding, distance]`
|
|
85
|
+
*
|
|
86
|
+
* `distance` is the gap between the reference and the ARROW TIP, not the box — which is
|
|
87
|
+
* what it has always meant here, because the old implementation handed tippy
|
|
88
|
+
* `offset[1] + (arrow ? 15 : 0)`. `useFloatingPopover` adds the arrow height back, so the
|
|
89
|
+
* prop keeps its meaning; see `DEFAULT_ARROW_HEIGHT` for the derivation of the 15.
|
|
90
|
+
*/
|
|
91
|
+
offset?: number[];
|
|
92
|
+
/**
|
|
93
|
+
* Determines if the popover has an arrow.
|
|
94
|
+
*
|
|
95
|
+
* ⚠️ It also moves the box even when the arrow is NOT drawn — see the block comment at
|
|
96
|
+
* `arrowDrivesTheOffset` in the body. That is the existing behaviour, reproduced.
|
|
97
|
+
*/
|
|
98
|
+
arrow?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Use React's state to fully control the `Popover` instead of relying on the native trigger
|
|
101
|
+
* and `hideOnClick` props
|
|
102
|
+
*
|
|
103
|
+
* Passing a boolean — **including `false`** — switches the popover to CONTROLLED mode and
|
|
104
|
+
* its own triggers stop firing. `undefined` leaves it uncontrolled. `onClickOutside` still
|
|
105
|
+
* fires in controlled mode, which is how 12 consumer call sites close a controlled
|
|
106
|
+
* popover.
|
|
107
|
+
*/
|
|
108
|
+
visible?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* @deprecated Accepted and IGNORED. This was a Popper `modifiers` array, appended to
|
|
111
|
+
* `popperOptions.modifiers`; Floating UI has middleware instead and the two are not
|
|
112
|
+
* translatable prop-for-prop. Kept so that no existing call site throws — plan C6. No
|
|
113
|
+
* consumer passes it. Pass `middleware` instead.
|
|
114
|
+
*/
|
|
115
|
+
modifiers?: any[];
|
|
116
|
+
/**
|
|
117
|
+
* Extra Floating UI middleware, appended after the built-in chain
|
|
118
|
+
* (`offset` → `flip`/`autoPlacement` → `shift` → `arrow` → `size`). This is the honest
|
|
119
|
+
* replacement for `modifiers`, and it exists because one internal caller genuinely needed
|
|
120
|
+
* it: `MultiLevelCheckboxSelect` matched the popover's width to its input with a
|
|
121
|
+
* hand-written Popper `sameWidth` modifier, which C6's accept-and-ignore would have
|
|
122
|
+
* silently dropped.
|
|
123
|
+
*/
|
|
124
|
+
middleware?: Middleware[];
|
|
125
|
+
/**
|
|
126
|
+
* Max-width of the popover box, as a CSS length. Defaults to `'none'`, which is what tippy
|
|
127
|
+
* received and wrote inline on every popover in both consumers.
|
|
128
|
+
*/
|
|
129
|
+
maxWidth?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Whether the `Popover` contains a context menu.
|
|
132
|
+
* This will remove the default arrow, and apply styling.
|
|
133
|
+
*
|
|
134
|
+
* It also makes a click on a `ContextMenuItem` close the menu — see
|
|
135
|
+
* `handleContextMenuClick`.
|
|
136
|
+
*/
|
|
137
|
+
contextMenu?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Whether the `Popover` contains a context menu which is the sublevel of another context menu.
|
|
140
|
+
* This will automatically set placement, spacing and trigger events, add a dropdown icon, etc.
|
|
141
|
+
*/
|
|
142
|
+
contextMenuSublevel?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* `z-index` of the positioned element. Defaults to 9999, tippy's default. 10 consumer call
|
|
145
|
+
* sites pass this.
|
|
146
|
+
*/
|
|
147
|
+
zIndex?: number;
|
|
148
|
+
/**
|
|
149
|
+
* A disabled popover can never open, even under a controlled `visible={true}` — tippy's
|
|
150
|
+
* semantics.
|
|
151
|
+
*/
|
|
152
|
+
disabled?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Where the popover is rendered. Omitting it means INLINE for an `interactive` popover
|
|
155
|
+
* (the default) and `document.body` otherwise. See `PopoverAppendTo`.
|
|
156
|
+
*/
|
|
157
|
+
appendTo?: PopoverAppendTo;
|
|
158
|
+
/** Fired when a press lands outside both the reference and the popover. */
|
|
159
|
+
onClickOutside?: (event?: Event) => void;
|
|
160
|
+
/**
|
|
161
|
+
* Fired when the popover opens. tippy's `onShow`, minus its instance argument.
|
|
162
|
+
*/
|
|
163
|
+
onShow?: () => void;
|
|
164
|
+
/**
|
|
165
|
+
* Fired when the popover closes. tippy's `onHide`, minus its instance argument.
|
|
166
|
+
*
|
|
167
|
+
* ONE INTERNAL CALLER DEPENDS ON IT: `inputs/Button` passes
|
|
168
|
+
* `onHide={handleDropdownClose}` to reset its `dropdown-is-active` class, so this is not a
|
|
169
|
+
* courtesy re-export. It fires on every close the component decides for itself —
|
|
170
|
+
* outside press, a second click on the trigger, a context-menu item click. It does NOT
|
|
171
|
+
* fire when a CONTROLLED popover is closed by its owner flipping `visible` to `false`,
|
|
172
|
+
* because nothing asks this component to close in that case; tippy did fire there. No
|
|
173
|
+
* call site pairs `onHide` with `visible`, so the difference is currently unobservable.
|
|
174
|
+
*/
|
|
175
|
+
onHide?: () => void;
|
|
176
|
+
/**
|
|
177
|
+
* Content of the `Popover`.
|
|
178
|
+
*/
|
|
179
|
+
children: React.ReactNode;
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* The `Popover` is a transient view that shows on a content screen when a user clicks on a control button or within a defined area.
|
|
183
|
+
* A `Popover` renders a temporary context to get user’s attention and to hide unnecessary interactions.
|
|
184
|
+
*
|
|
185
|
+
* This component is used with the `Button` and `ContextMenu` components to create dropdown menus and context menus.
|
|
186
|
+
* See their documentation for usage examples.
|
|
187
|
+
*
|
|
188
|
+
* ### Import
|
|
189
|
+
*
|
|
190
|
+
* ``` js
|
|
191
|
+
* import { Popover } from '@ntbjs/react-components/data'
|
|
192
|
+
* // or
|
|
193
|
+
* import Popover from '@ntbjs/react-components/data/Popover'
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* ### Usage example
|
|
197
|
+
*
|
|
198
|
+
* ``` js
|
|
199
|
+
<Popover content={<img alt="Dummy content" src={dummyImage} />}>
|
|
200
|
+
<ActionButton icon={<DeleteIcon />} onClick={() => {}} />
|
|
201
|
+
</Popover>
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
204
|
+
declare const Popover: React.ForwardRefExoticComponent<Omit<Omit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>, "ref">, keyof PopoverOwnProps> & PopoverOwnProps & React.RefAttributes<any>>;
|
|
205
|
+
export default Popover;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The popover box — what `.tippy-box` was.
|
|
3
|
+
*
|
|
4
|
+
* `Popover.tsx` puts the transition styles and the `max-width` on this element inline and
|
|
5
|
+
* the POSITION on its parent, matching the split tippy used (animated box inside a
|
|
6
|
+
* Popper-positioned root) and the one `Tooltip` and the three existing Floating UI sites
|
|
7
|
+
* use.
|
|
8
|
+
*
|
|
9
|
+
* `max-height: inherit` is not decorative and neither is the `.tippy-content` chain below
|
|
10
|
+
* it. `size()` writes its cap onto the POSITIONER (`elements.floating`), exactly where
|
|
11
|
+
* `popper-max-size-modifier` + `applyMaxSize` used to write `state.styles.popper.maxHeight`,
|
|
12
|
+
* so the cap has to be inherited down box → `.tippy-content` → its child to reach the
|
|
13
|
+
* element that actually scrolls.
|
|
14
|
+
*/
|
|
15
|
+
export declare const Popover: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Popover';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type SeverityBadgeOwnProps = {
|
|
3
|
+
/** Severity level (1-5). 1-2 = Info, 3-4 = Limited use, 5 = Highly restricted. */
|
|
4
|
+
severity: 1 | 2 | 3 | 4 | 5;
|
|
5
|
+
/** Badge content — string or JSX node (e.g. label with remove button). */
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
/** Override the default information icon. Pass null to suppress. */
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
/** Font size in pixels. */
|
|
10
|
+
fontSize?: number;
|
|
11
|
+
/** Font weight. */
|
|
12
|
+
fontWeight?: number;
|
|
13
|
+
/** Badge height in pixels. */
|
|
14
|
+
height?: number;
|
|
15
|
+
/** Left and right padding in pixels. */
|
|
16
|
+
horizontalPadding?: number;
|
|
17
|
+
/** Top and bottom padding in pixels. */
|
|
18
|
+
verticalPadding?: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A severity-aware badge that maps a severity level (1-5) to the appropriate
|
|
22
|
+
* color scheme and icon. Thin wrapper around Badge.
|
|
23
|
+
*
|
|
24
|
+
* ### Import
|
|
25
|
+
*
|
|
26
|
+
* ```js
|
|
27
|
+
* import { SeverityBadge } from "@ntbjs/react-components/data";
|
|
28
|
+
* // named exports for advanced use
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
declare const SeverityBadge: React.ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>, import("../Badge/Badge.styled").BadgeStyleProps>, never>, "ref">, keyof {
|
|
32
|
+
badgeIcon?: React.ReactNode;
|
|
33
|
+
badgeContent?: React.ReactNode;
|
|
34
|
+
children?: React.ReactNode | string;
|
|
35
|
+
elevated?: boolean;
|
|
36
|
+
active?: boolean;
|
|
37
|
+
error?: boolean;
|
|
38
|
+
warning?: boolean;
|
|
39
|
+
fontSize?: number | string;
|
|
40
|
+
fontWeight?: number | string;
|
|
41
|
+
lineHeight?: number | string;
|
|
42
|
+
colors?: string[];
|
|
43
|
+
backgroundColors?: string[];
|
|
44
|
+
verticalPadding?: number;
|
|
45
|
+
horizontalPadding?: number;
|
|
46
|
+
height?: number;
|
|
47
|
+
minHeight?: number;
|
|
48
|
+
width?: number;
|
|
49
|
+
minWidth?: number;
|
|
50
|
+
borderColors?: string[];
|
|
51
|
+
}> & {
|
|
52
|
+
badgeIcon?: React.ReactNode;
|
|
53
|
+
badgeContent?: React.ReactNode;
|
|
54
|
+
children?: React.ReactNode | string;
|
|
55
|
+
elevated?: boolean;
|
|
56
|
+
active?: boolean;
|
|
57
|
+
error?: boolean;
|
|
58
|
+
warning?: boolean;
|
|
59
|
+
fontSize?: number | string;
|
|
60
|
+
fontWeight?: number | string;
|
|
61
|
+
lineHeight?: number | string;
|
|
62
|
+
colors?: string[];
|
|
63
|
+
backgroundColors?: string[];
|
|
64
|
+
verticalPadding?: number;
|
|
65
|
+
horizontalPadding?: number;
|
|
66
|
+
height?: number;
|
|
67
|
+
minHeight?: number;
|
|
68
|
+
width?: number;
|
|
69
|
+
minWidth?: number;
|
|
70
|
+
borderColors?: string[];
|
|
71
|
+
} & React.RefAttributes<any>, "ref">, keyof SeverityBadgeOwnProps> & SeverityBadgeOwnProps & React.RefAttributes<any>>;
|
|
72
|
+
export default SeverityBadge;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SeverityBadge';
|