@ntbjs/react-components 2.0.13 → 3.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/data/Alert/Alert.js +18 -33
- package/build/data/Alert/Alert.js.map +1 -1
- package/build/data/Alert/Alert.styled.js +9 -47
- package/build/data/Alert/Alert.styled.js.map +1 -1
- package/build/data/Badge/Badge.js +36 -61
- package/build/data/Badge/Badge.js.map +1 -1
- package/build/data/Badge/Badge.styled.js +21 -70
- package/build/data/Badge/Badge.styled.js.map +1 -1
- package/build/data/Popover/Popover.js +125 -71
- package/build/data/Popover/Popover.js.map +1 -1
- package/build/data/Popover/Popover.styled.js +10 -140
- package/build/data/Popover/Popover.styled.js.map +1 -1
- package/build/data/SeverityBadge/SeverityBadge.js +13 -22
- package/build/data/SeverityBadge/SeverityBadge.js.map +1 -1
- package/build/data/SeverityBadge/index.js +2 -0
- package/build/data/SeverityBadge/index.js.map +1 -0
- package/build/data/Tab/Tab.js +7 -13
- package/build/data/Tab/Tab.js.map +1 -1
- package/build/data/Tab/Tab.styled.js +4 -7
- package/build/data/Tab/Tab.styled.js.map +1 -1
- package/build/data/Tabs/Tabs.js +30 -32
- package/build/data/Tabs/Tabs.js.map +1 -1
- package/build/data/Tabs/Tabs.styled.js +21 -57
- package/build/data/Tabs/Tabs.styled.js.map +1 -1
- package/build/data/Tooltip/Tooltip.js +102 -33
- package/build/data/Tooltip/Tooltip.js.map +1 -1
- package/build/data/Tooltip/Tooltip.styled.js +9 -22
- package/build/data/Tooltip/Tooltip.styled.js.map +1 -1
- package/build/data/VerificationStatusIcon/VerificationStatusIcon.js +16 -23
- package/build/data/VerificationStatusIcon/VerificationStatusIcon.js.map +1 -1
- package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js +13 -31
- package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js.map +1 -1
- package/build/data/VerificationStatusIcon/index.js +2 -0
- package/build/data/VerificationStatusIcon/index.js.map +1 -0
- package/build/data/_shared/FloatingArrow.styled.js +30 -0
- package/build/data/_shared/FloatingArrow.styled.js.map +1 -0
- package/build/hooks/useEventListner.js.map +1 -1
- package/build/hooks/useFloatingPopover.js +187 -0
- package/build/hooks/useFloatingPopover.js.map +1 -0
- package/build/hooks/useIsomorphicLayoutEffect.js.map +1 -1
- package/build/hooks/useOnClickOutside.js.map +1 -1
- package/build/hooks/useTooltipAutoShow.js.map +1 -1
- package/build/icons/arrow-back.svg.js +3 -3
- package/build/icons/arrow-back.svg.js.map +1 -1
- package/build/icons/arrow-forward.svg.js +4 -4
- package/build/icons/arrow-forward.svg.js.map +1 -1
- package/build/icons/check-rectangle-filled.svg.js +3 -3
- package/build/icons/check-rectangle-filled.svg.js.map +1 -1
- package/build/icons/close.svg.js +3 -3
- package/build/icons/close.svg.js.map +1 -1
- package/build/icons/edit-note.svg.js +3 -3
- package/build/icons/edit-note.svg.js.map +1 -1
- package/build/icons/expand-more.svg.js +3 -3
- package/build/icons/expand-more.svg.js.map +1 -1
- package/build/icons/headset.svg.js +3 -3
- package/build/icons/headset.svg.js.map +1 -1
- package/build/icons/layers.svg.js +3 -3
- package/build/icons/layers.svg.js.map +1 -1
- package/build/icons/link.svg.js +3 -3
- package/build/icons/link.svg.js.map +1 -1
- package/build/icons/play.svg.js +3 -3
- package/build/icons/play.svg.js.map +1 -1
- package/build/icons/search.svg.js +3 -3
- package/build/icons/search.svg.js.map +1 -1
- package/build/icons/star-filled.svg.js +3 -3
- package/build/icons/star-filled.svg.js.map +1 -1
- package/build/icons/star.svg.js +3 -3
- package/build/icons/star.svg.js.map +1 -1
- package/build/icons/triangle-right.svg.js +3 -3
- package/build/icons/triangle-right.svg.js.map +1 -1
- package/build/icons/verification.svg.js +3 -3
- package/build/icons/verification.svg.js.map +1 -1
- package/build/icons/warning-circle.svg.js +3 -3
- package/build/icons/warning-circle.svg.js.map +1 -1
- package/build/inputs/ActionButton/ActionButton.js +11 -22
- package/build/inputs/ActionButton/ActionButton.js.map +1 -1
- package/build/inputs/ActionButton/ActionButton.styled.js +5 -54
- package/build/inputs/ActionButton/ActionButton.styled.js.map +1 -1
- package/build/inputs/Button/Button.js +125 -121
- package/build/inputs/Button/Button.js.map +1 -1
- package/build/inputs/Button/Button.styled.js +42 -260
- package/build/inputs/Button/Button.styled.js.map +1 -1
- package/build/inputs/Checkbox/Checkbox.js +45 -61
- package/build/inputs/Checkbox/Checkbox.js.map +1 -1
- package/build/inputs/Checkbox/Checkbox.styled.js +24 -153
- package/build/inputs/Checkbox/Checkbox.styled.js.map +1 -1
- package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js +106 -111
- package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js.map +1 -1
- package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js +88 -273
- package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js.map +1 -1
- package/build/inputs/CompactStarRating/CompactStarRating.js +56 -77
- package/build/inputs/CompactStarRating/CompactStarRating.js.map +1 -1
- package/build/inputs/CompactStarRating/CompactStarRating.styled.js +32 -211
- package/build/inputs/CompactStarRating/CompactStarRating.styled.js.map +1 -1
- package/build/inputs/CompactTextInput/CompactTextInput.js +86 -105
- package/build/inputs/CompactTextInput/CompactTextInput.js.map +1 -1
- package/build/inputs/CompactTextInput/CompactTextInput.styled.js +55 -258
- package/build/inputs/CompactTextInput/CompactTextInput.styled.js.map +1 -1
- package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js +70 -77
- package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js.map +1 -1
- package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js +28 -60
- package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js.map +1 -1
- package/build/inputs/MultiLevelCheckbox/types.js +12 -12
- package/build/inputs/MultiLevelCheckbox/types.js.map +1 -1
- package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js +69 -73
- package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js.map +1 -1
- package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js +44 -87
- package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js.map +1 -1
- package/build/inputs/MultiSelect/MultiSelect.js +69 -79
- package/build/inputs/MultiSelect/MultiSelect.js.map +1 -1
- package/build/inputs/MultiSelect/MultiSelect.styled.js +70 -76
- package/build/inputs/MultiSelect/MultiSelect.styled.js.map +1 -1
- package/build/inputs/Radio/Radio.js +20 -33
- package/build/inputs/Radio/Radio.js.map +1 -1
- package/build/inputs/Radio/Radio.styled.js +15 -96
- package/build/inputs/Radio/Radio.styled.js.map +1 -1
- package/build/inputs/Switch/Switch.js +28 -40
- package/build/inputs/Switch/Switch.js.map +1 -1
- package/build/inputs/Switch/Switch.styled.js +24 -94
- package/build/inputs/Switch/Switch.styled.js.map +1 -1
- package/build/inputs/TextArea/TextArea.js +98 -123
- package/build/inputs/TextArea/TextArea.js.map +1 -1
- package/build/inputs/TextArea/TextArea.styled.js +64 -379
- package/build/inputs/TextArea/TextArea.styled.js.map +1 -1
- package/build/inputs/TextInput/TextInput.js +59 -79
- package/build/inputs/TextInput/TextInput.js.map +1 -1
- package/build/inputs/TextInput/TextInput.styled.js +33 -224
- package/build/inputs/TextInput/TextInput.styled.js.map +1 -1
- package/build/layout/InputGroup/InputGroup.js +6 -9
- package/build/layout/InputGroup/InputGroup.js.map +1 -1
- package/build/layout/InputGroup/InputGroup.styled.js +4 -3
- package/build/layout/InputGroup/InputGroup.styled.js.map +1 -1
- package/build/layout/InputGroup/index.js +2 -0
- package/build/layout/InputGroup/index.js.map +1 -0
- package/build/layout/SectionSeparator/SectionSeparator.js +5 -9
- package/build/layout/SectionSeparator/SectionSeparator.js.map +1 -1
- package/build/layout/SectionSeparator/SectionSeparator.styled.js +4 -8
- package/build/layout/SectionSeparator/SectionSeparator.styled.js.map +1 -1
- package/build/styles/utils/colors-export.d.ts +73 -0
- package/build/styles/utils/colors-export.js.map +1 -1
- package/build/utils/dateTime.js.map +1 -1
- package/build/utils/defaultTheme.js +14 -28
- package/build/utils/defaultTheme.js.map +1 -1
- package/build/utils/getElementRef.js +14 -0
- package/build/utils/getElementRef.js.map +1 -0
- package/build/utils/parseTrigger.js +16 -0
- package/build/utils/parseTrigger.js.map +1 -0
- package/build/widgets/AssetAction/AssetAction.js +26 -33
- package/build/widgets/AssetAction/AssetAction.js.map +1 -1
- package/build/widgets/AssetAction/AssetAction.styled.js +20 -34
- package/build/widgets/AssetAction/AssetAction.styled.js.map +1 -1
- package/build/widgets/AssetActionsBase/AssetActionsBase.js +8 -13
- package/build/widgets/AssetActionsBase/AssetActionsBase.js.map +1 -1
- package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js +4 -9
- package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGallery.js +15 -40
- package/build/widgets/AssetGallery/AssetGallery.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js +55 -70
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js +12 -24
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js +146 -120
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +99 -285
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js +170 -125
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js +135 -364
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js.map +1 -1
- package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js +20 -21
- package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js.map +1 -1
- package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js +20 -71
- package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js.map +1 -1
- package/build/widgets/ContextMenu/ContextMenu.js +12 -11
- package/build/widgets/ContextMenu/ContextMenu.js.map +1 -1
- package/build/widgets/ContextMenu/ContextMenu.styled.js +4 -4
- package/build/widgets/ContextMenu/ContextMenu.styled.js.map +1 -1
- package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js +17 -25
- package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js.map +1 -1
- package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js +16 -71
- package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js.map +1 -1
- package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js +7 -11
- package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js.map +1 -1
- package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js +4 -11
- package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js.map +1 -1
- package/build/widgets/InfoCard/InfoCard.js +26 -21
- package/build/widgets/InfoCard/InfoCard.js.map +1 -1
- package/build/widgets/InfoCard/InfoCard.styled.js +36 -84
- package/build/widgets/InfoCard/InfoCard.styled.js.map +1 -1
- package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js +28 -34
- package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js.map +1 -1
- package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js +21 -57
- package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js.map +1 -1
- package/build/widgets/InstructionSeverityDisplay/index.js +2 -0
- package/build/widgets/InstructionSeverityDisplay/index.js.map +1 -0
- package/build/widgets/Instructions/Instructions.js +53 -95
- package/build/widgets/Instructions/Instructions.js.map +1 -1
- package/build/widgets/Instructions/Instructions.styled.js +27 -26
- package/build/widgets/Instructions/Instructions.styled.js.map +1 -1
- package/build/widgets/ProgressBar/ProgressBar.js +39 -37
- package/build/widgets/ProgressBar/ProgressBar.js.map +1 -1
- package/build/widgets/ProgressBar/ProgressBar.styled.js +56 -125
- package/build/widgets/ProgressBar/ProgressBar.styled.js.map +1 -1
- package/build/widgets/SummaryCard/SummaryCard.js +55 -64
- package/build/widgets/SummaryCard/SummaryCard.js.map +1 -1
- package/build/widgets/SummaryCard/SummaryCard.styled.js +51 -106
- package/build/widgets/SummaryCard/SummaryCard.styled.js.map +1 -1
- package/package.json +77 -36
- package/styles/utils/colors-export.d.ts +73 -0
- package/types/components/data/Alert/Alert.d.ts +76 -0
- package/types/components/data/Alert/Alert.styled.d.ts +83 -0
- package/types/components/data/Alert/index.d.ts +1 -0
- package/types/components/data/Badge/Badge.d.ts +128 -0
- package/types/components/data/Badge/Badge.styled.d.ts +132 -0
- package/types/components/data/Badge/index.d.ts +1 -0
- package/types/components/data/Popover/Popover.d.ts +205 -0
- package/types/components/data/Popover/Popover.styled.d.ts +15 -0
- package/types/components/data/Popover/index.d.ts +1 -0
- package/types/components/data/SeverityBadge/SeverityBadge.d.ts +72 -0
- package/types/components/data/SeverityBadge/index.d.ts +1 -0
- package/types/components/data/Tab/Tab.d.ts +27 -0
- package/types/components/data/Tab/Tab.styled.d.ts +1 -0
- package/types/components/data/Tab/index.d.ts +1 -0
- package/types/components/data/Tabs/Tabs.d.ts +111 -0
- package/types/components/data/Tabs/Tabs.styled.d.ts +42 -0
- package/types/components/data/Tabs/index.d.ts +1 -0
- package/types/components/data/Tooltip/Tooltip.d.ts +134 -0
- package/types/components/data/Tooltip/Tooltip.styled.d.ts +8 -0
- package/types/components/data/Tooltip/index.d.ts +1 -0
- package/types/components/data/VerificationStatusIcon/VerificationStatusIcon.d.ts +35 -0
- package/types/components/data/VerificationStatusIcon/VerificationStatusIcon.styled.d.ts +46 -0
- package/types/components/data/VerificationStatusIcon/index.d.ts +1 -0
- package/types/components/data/_shared/FloatingArrow.styled.d.ts +129 -0
- package/types/components/data/index.d.ts +8 -0
- package/types/components/index.d.ts +3 -0
- package/types/components/inputs/ActionButton/ActionButton.d.ts +55 -0
- package/types/components/inputs/ActionButton/ActionButton.styled.d.ts +34 -0
- package/types/components/inputs/ActionButton/index.d.ts +1 -0
- package/types/components/inputs/Button/Button.d.ts +82 -0
- package/types/components/inputs/Button/Button.styled.d.ts +102 -0
- package/types/components/inputs/Button/index.d.ts +1 -0
- package/types/components/inputs/Checkbox/Checkbox.d.ts +92 -0
- package/types/components/inputs/Checkbox/Checkbox.styled.d.ts +33 -0
- package/types/components/inputs/Checkbox/index.d.ts +1 -0
- package/types/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.d.ts +242 -0
- package/types/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.d.ts +157 -0
- package/types/components/inputs/CompactAutocompleteSelect/index.d.ts +1 -0
- package/types/components/inputs/CompactStarRating/CompactStarRating.d.ts +96 -0
- package/types/components/inputs/CompactStarRating/CompactStarRating.styled.d.ts +86 -0
- package/types/components/inputs/CompactStarRating/index.d.ts +1 -0
- package/types/components/inputs/CompactTextInput/CompactTextInput.d.ts +116 -0
- package/types/components/inputs/CompactTextInput/CompactTextInput.styled.d.ts +70 -0
- package/types/components/inputs/CompactTextInput/index.d.ts +1 -0
- package/types/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.d.ts +41 -0
- package/types/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.d.ts +21 -0
- package/types/components/inputs/MultiLevelCheckbox/index.d.ts +2 -0
- package/types/components/inputs/MultiLevelCheckbox/types.d.ts +72 -0
- package/types/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.d.ts +44 -0
- package/types/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.d.ts +11 -0
- package/types/components/inputs/MultiLevelCheckboxSelect/index.d.ts +1 -0
- package/types/components/inputs/MultiSelect/MultiSelect.d.ts +172 -0
- package/types/components/inputs/MultiSelect/MultiSelect.styled.d.ts +99 -0
- package/types/components/inputs/MultiSelect/index.d.ts +1 -0
- package/types/components/inputs/Radio/Radio.d.ts +65 -0
- package/types/components/inputs/Radio/Radio.styled.d.ts +11 -0
- package/types/components/inputs/Radio/index.d.ts +1 -0
- package/types/components/inputs/Switch/Switch.d.ts +62 -0
- package/types/components/inputs/Switch/Switch.styled.d.ts +20 -0
- package/types/components/inputs/Switch/index.d.ts +1 -0
- package/types/components/inputs/TextArea/TextArea.d.ts +124 -0
- package/types/components/inputs/TextArea/TextArea.styled.d.ts +95 -0
- package/types/components/inputs/TextArea/index.d.ts +1 -0
- package/types/components/inputs/TextInput/TextInput.d.ts +109 -0
- package/types/components/inputs/TextInput/TextInput.styled.d.ts +43 -0
- package/types/components/inputs/TextInput/index.d.ts +1 -0
- package/types/components/inputs/index.d.ts +13 -0
- package/types/components/layout/InputGroup/InputGroup.d.ts +31 -0
- package/types/components/layout/InputGroup/InputGroup.styled.d.ts +1 -0
- package/types/components/layout/InputGroup/index.d.ts +1 -0
- package/types/components/layout/SectionSeparator/SectionSeparator.d.ts +28 -0
- package/types/components/layout/SectionSeparator/SectionSeparator.styled.d.ts +14 -0
- package/types/components/layout/SectionSeparator/index.d.ts +1 -0
- package/types/components/layout/index.d.ts +2 -0
- package/types/components/widgets/AssetAction/AssetAction.d.ts +16 -0
- package/types/components/widgets/AssetAction/AssetAction.styled.d.ts +20 -0
- package/types/components/widgets/AssetAction/index.d.ts +1 -0
- package/types/components/widgets/AssetActionsBase/AssetActionsBase.d.ts +25 -0
- package/types/components/widgets/AssetActionsBase/AssetActionsBase.styled.d.ts +1 -0
- package/types/components/widgets/AssetActionsBase/index.d.ts +1 -0
- package/types/components/widgets/AssetGallery/AssetGallery.d.ts +170 -0
- package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.d.ts +88 -0
- package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.d.ts +3 -0
- package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.d.ts +3 -0
- package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.d.ts +100 -0
- package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.d.ts +2 -0
- package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.d.ts +85 -0
- package/types/components/widgets/AssetGallery/asset.types.d.ts +446 -0
- package/types/components/widgets/AssetGallery/index.d.ts +1 -0
- package/types/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.d.ts +60 -0
- package/types/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.d.ts +35 -0
- package/types/components/widgets/AssetPreview/AssetPreviewTopBar/index.d.ts +1 -0
- package/types/components/widgets/ContextMenu/ContextMenu.d.ts +134 -0
- package/types/components/widgets/ContextMenu/ContextMenu.styled.d.ts +1 -0
- package/types/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.d.ts +45 -0
- package/types/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.d.ts +26 -0
- package/types/components/widgets/ContextMenu/ContextMenuItem/index.d.ts +1 -0
- package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.d.ts +41 -0
- package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.d.ts +1 -0
- package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/index.d.ts +1 -0
- package/types/components/widgets/ContextMenu/index.d.ts +1 -0
- package/types/components/widgets/InfoCard/InfoCard.d.ts +33 -0
- package/types/components/widgets/InfoCard/InfoCard.styled.d.ts +45 -0
- package/types/components/widgets/InfoCard/index.d.ts +1 -0
- package/types/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.d.ts +46 -0
- package/types/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.d.ts +40 -0
- package/types/components/widgets/InstructionSeverityDisplay/index.d.ts +1 -0
- package/types/components/widgets/Instructions/Instructions.d.ts +156 -0
- package/types/components/widgets/Instructions/Instructions.styled.d.ts +26 -0
- package/types/components/widgets/Instructions/index.d.ts +1 -0
- package/types/components/widgets/ProgressBar/ProgressBar.d.ts +30 -0
- package/types/components/widgets/ProgressBar/ProgressBar.styled.d.ts +78 -0
- package/types/components/widgets/ProgressBar/index.d.ts +1 -0
- package/types/components/widgets/SummaryCard/SummaryCard.d.ts +83 -0
- package/types/components/widgets/SummaryCard/SummaryCard.styled.d.ts +68 -0
- package/types/components/widgets/SummaryCard/index.d.ts +1 -0
- package/types/components/widgets/index.d.ts +11 -0
- package/types/hooks/useElementSize.d.ts +25 -0
- package/types/hooks/useEventListner.d.ts +46 -0
- package/types/hooks/useFloatingPopover.d.ts +242 -0
- package/types/hooks/useIsomorphicLayoutEffect.d.ts +26 -0
- package/types/hooks/useOnClickOutside.d.ts +31 -0
- package/types/hooks/useTooltipAutoShow.d.ts +80 -0
- package/types/icons/index.d.ts +41 -0
- package/types/ssr/index.d.ts +1 -0
- package/types/styles/utils/colors-export.d.ts +73 -0
- package/types/utils/dateTime.d.ts +13 -0
- package/types/utils/defaultTheme.d.ts +174 -0
- package/types/utils/getElementRef.d.ts +21 -0
- package/types/utils/parseTrigger.d.ts +92 -0
- package/build/_virtual/_rollupPluginBabelHelpers.js +0 -12
- package/build/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
- package/build/widgets/AssetGallery/asset.propType.js +0 -56
- package/build/widgets/AssetGallery/asset.propType.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompactAutocompleteSelect.styled.js","sources":["../../../src/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js"],"sourcesContent":["import styled, { css, keyframes } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nimport Select, { components } from 'react-select';\nimport { AsyncPaginate, withAsyncPaginate } from 'react-select-async-paginate';\nimport CreatableSelect from 'react-select/creatable';\n\nimport { ReactComponent as CloseIcon } from '../../../icons/close.svg';\nimport { ReactComponent as ExpandMoreIcon } from '../../../icons/expand-more.svg';\n\nconst fadeIn = keyframes`\n from {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};\n }\n to {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};\n }\n`;\n\nconst fadeOut = keyframes`\n from {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};\n }\n to {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};\n }\n`;\n\nconst fadeInCheck = keyframes`\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n`;\n\nconst fadeOutCheck = keyframes`\n from {\n opacity: 1\n }\n to {\n opacity: 0\n }\n`;\n\nconst AsyncCreatableSelectPaginate = withAsyncPaginate(CreatableSelect);\n\nconst sharedStyle = css`\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 0.875rem;\n line-height: 1rem;\n width: 100%;\n display: block;\n box-shadow: 'none';\n flex-basis: ${props => (props.$hasLabel ? '66.66%' : '100%')};\n`;\n\nconst shouldForwardProp = prop => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const CompactAutocompleteSelect = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n height: 24px;\n font-family: ${props => props.theme.primaryFontFamily};\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n `}\n`;\n\nexport const Label = styled.label\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n flex-basis: 33.33%;\n font-size: 0.875rem;\n line-height: 1rem;\n height: 19px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-top: 2px;\n ${props =>\n props.disabled &&\n css`\n cursor: not-allowed;\n `}\n`;\n\nexport const InputContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n width: 100%;\n height: 19px;\n`;\n\nexport const SuccessContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n opacity: 1;\n pointer-events: none;\n display: flex;\n opacity: ${props => (props.fadeIn ? 0 : 1)};\n animation: ${props => (props.fadeIn ? fadeOutCheck : fadeInCheck)} 0.5s ease-in-out;\n transition: opacity 0.5s ease-in-out;\n margin-right: 5px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-500')\n )}\n > svg {\n width: 13px;\n }\n`;\n\nexport const AsyncCreatableAutocompleteSelect = styled(AsyncCreatableSelectPaginate).attrs(\n applyDefaultTheme\n)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n `}\n &&:hover:not(:focus) {\n ${props =>\n props.disabled &&\n css`\n background: none !important;\n cursor: not-allowed;\n `}\n }\n`;\n\nexport const AsyncAutocompleteSelect = styled(AsyncPaginate).attrs(applyDefaultTheme)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n `}\n &&:hover:not(:focus) {\n ${props =>\n props.disabled &&\n css`\n background: none !important;\n cursor: not-allowed;\n `}\n }\n`;\n\nexport const AutocompletSelect = styled(Select).attrs(applyDefaultTheme)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n `}\n &&:hover:not(:focus) {\n ${props =>\n props.disabled &&\n css`\n background: none !important;\n cursor: not-allowed;\n `}\n }\n`;\n\nexport const AutocompletCreatableSelect = styled(CreatableSelect).attrs(applyDefaultTheme)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n `}\n`;\n\nexport const Control = styled(components.Control).attrs(applyDefaultTheme)`\n && {\n ${props =>\n props.edit &&\n props.theme.themeProp('background', 'rgba(39,39,42, 0.7)', 'rgba(244,244,245, 0.3)')};\n ${props =>\n props.edit &&\n props.theme.themeProp('border-color', 'rgba(39,39,42, 0.7)', 'rgba(228,228,231, 0.3)')};\n\n height: 22px;\n min-height: 22px;\n box-shadow: none;\n box-sizing: border-box;\n padding: 1px 3px 0 8.7px;\n cursor: pointer;\n border: 1px solid transparent;\n background-color: transparent;\n ${props =>\n props.type &&\n css`\n animation: ${props => (props.type === 'success' ? fadeIn : fadeOut)} 0.5s ease-in-out;\n `}\n\n ${props =>\n props.type === 'warning' &&\n !props.isFocused &&\n props.theme.themeProp('background-color', '#634e01', '#FFFDE8')};\n\n ${props =>\n props.type === 'instructions-warning' &&\n !props.isFocused &&\n props.theme.themeProp('background-color', '#634e01', '#FFF36C')};\n\n ${props =>\n props.type === 'instructions-warning' &&\n props.isFocused &&\n props.theme.themeProp('background-color', '#634e01', '#FFF36C')};\n\n ${props =>\n props.type === 'error' &&\n !props.isFocused &&\n props.theme.themeProp('background-color', '#7f1b1b', '#FBEAE6')};\n\n ${props =>\n props.isFocused &&\n !props.type === 'instructions-warning' &&\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-600'),\n props.theme.getColor('gray-600')\n )}\n ${props =>\n props.type === 'warning' &&\n props.isFocused &&\n props.theme.themeProp('border-color', '#F4E21E', '#F4E21E')}\n ${props =>\n props.type === 'error' &&\n props.isFocused &&\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('red-500'),\n props.theme.getColor('red-500')\n )}\n }\n\n & .dropdown-indicator {\n display: none;\n }\n\n &:hover .dropdown-indicator {\n display: flex;\n }\n\n &&:hover {\n border-color: transparent;\n ${props =>\n !props.isFocused &&\n props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-100')\n )};\n\n ${props =>\n props.type === 'warning' &&\n !props.isFocused &&\n props.theme.themeProp('background', '#806403', '#FFFEBF')};\n\n ${props =>\n props.type === 'instructions-warning' &&\n !props.isFocused &&\n props.theme.themeProp('background', '#806403', '#F4E21E')};\n\n ${props =>\n props.type === 'error' &&\n !props.isFocused &&\n props.theme.themeProp('background', '#901d1d', '#f7d5d0')};\n }\n`;\n\nexport const Option = styled(components.Option).attrs(applyDefaultTheme)`\n && {\n min-height: 22px;\n height: 22px;\n display: flex;\n align-items: center;\n padding: 6px;\n cursor: pointer;\n padding: 1px 13px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n ${props =>\n props.isFocused &&\n css`\n ${props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-200')\n )}\n `}\n ${props =>\n props.isSelected &&\n css`\n ${props.theme.themeProp('background-color', 'transparent', 'transparent')}\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n `}\n ${props =>\n props.isFocused &&\n props.isSelected &&\n css`\n ${props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-200')\n )}\n `}\n }\n svg {\n width: 15px;\n margin: 0 9px 0 0;\n }\n a {\n display: flex;\n text-decoration: none;\n color: inherit;\n }\n`;\n\nexport const Placeholder = styled(components.Placeholder).attrs(applyDefaultTheme)`\n && {\n ${props =>\n (props.type === 'error' || props.type === 'warning') &&\n css`\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n `}\n ${props =>\n (props.type === 'error' || props.type === 'warning') &&\n props.theme.themeProp('opacity', '0.6', '0.6')};\n }\n`;\n\nexport const SingleValue = styled(components.SingleValue).attrs(applyDefaultTheme)`\n && {\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )};\n }\n`;\n\nexport const Input = styled(components.Input).attrs(applyDefaultTheme)`\n && {\n margin: 0;\n padding: 0;\n padding-left: 2px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n }\n`;\n\nexport const Menu = styled(components.Menu).attrs(applyDefaultTheme)`\n && {\n ${props =>\n props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-700'),\n props.theme.getColor('white')\n )};\n }\n`;\n\nexport const ValueContainer = styled(components.ValueContainer).attrs(applyDefaultTheme)`\n && {\n padding: 0;\n }\n`;\n\nexport const ClearIndicator = styled(components.ClearIndicator).attrs(applyDefaultTheme)`\n && {\n display: ${props => (props.isFocused ? 'flex' : 'none')};\n padding: 0;\n cursor: pointer;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n }\n`;\n\nexport const DropdownIndicator = styled(components.DropdownIndicator).attrs(applyDefaultTheme)`\n && {\n display: ${props => (props.isFocused ? 'flex' : 'none')};\n padding: 0;\n width: 18px;\n margin-left: 2px;\n cursor: pointer;\n margin-top: 1px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n }\n`;\nexport const DropdownIndicatorIcon = styled(ExpandMoreIcon).attrs(applyDefaultTheme)`\n width: 12px;\n`;\n\nexport const ClearIndicatorIcon = styled(CloseIcon).attrs(applyDefaultTheme)`\n width: 8px;\n margin-right: 4px;\n ${props =>\n props.theme.themeProp(\n 'stroke',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n stroke-width: 2px;\n`;\n\nexport const IndicatorSeparator = styled(components.IndicatorSeparator).attrs(applyDefaultTheme)`\n && {\n display: ${props => (props.isFocused ? 'flex' : 'none')};\n margin: 4px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n }\n`;\n"],"names":["fadeIn","keyframes","props","theme","themeProp","fadeOut","fadeInCheck","fadeOutCheck","AsyncCreatableSelectPaginate","withAsyncPaginate","CreatableSelect","sharedStyle","css","primaryFontFamily","$hasLabel","shouldForwardProp","prop","startsWith","CompactAutocompleteSelect","styled","div","withConfig","attrs","applyDefaultTheme","disabled","Label","label","getColor","InputContainer","SuccessContainer","AsyncCreatableAutocompleteSelect","AsyncAutocompleteSelect","AsyncPaginate","AutocompletSelect","Select","AutocompletCreatableSelect","Control","components","edit","type","isFocused","Option","isSelected","Placeholder","SingleValue","Input","Menu","ValueContainer","ClearIndicator","DropdownIndicator","DropdownIndicatorIcon","ExpandMoreIcon","ClearIndicatorIcon","CloseIcon","IndicatorSeparator"],"mappings":";;;;;;;;AAUA,MAAMA,MAAM,GAAGC,SAAS,CAAA;AACxB;AACA,sBAAwBC,EAAAA,KAAK,IACvBA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,CAAA;AAC9E;AACA;AACA,sBAAwBF,EAAAA,KAAK,IACvBA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,CAAA;AAC9E;AACA,CAAC,CAAA;AAED,MAAMC,OAAO,GAAGJ,SAAS,CAAA;AACzB;AACA,sBAAw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,KAAK,CAACwB,QAAQ,CAAC,UAAU,CAAC,EAChCzB,KAAK,CAACC,KAAK,CAACwB,QAAQ,CAAC,UAAU,CACjC,CAAC,CAAA;AACL;AACA,EAAC;AAEY2B,MAAAA,kBAAkB,GAAGnC,MAAM,CAACkB,UAAU,CAACiB,kBAAkB,CAAC,CAAChC,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAChG;AACA,aAAerB,EAAAA,KAAK,IAAKA,KAAK,CAACsC,SAAS,GAAG,MAAM,GAAG,MAAO,CAAA;AAC3D;AACA,IAAMtC,EAAAA,KAAK,IACLA,KAAK,CAACC,KAAK,CAACC,SAAS,CACnB,OAAO,EACPF,KAAK,CAACC,KAAK,CAACwB,QAAQ,CAAC,UAAU,CAAC,EAChCzB,KAAK,CAACC,KAAK,CAACwB,QAAQ,CAAC,UAAU,CACjC,CAAC,CAAA;AACP;AACA;;;;"}
|
|
1
|
+
{"version":3,"file":"CompactAutocompleteSelect.styled.js","sources":["../../../src/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.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 * THIS FILE DOES NOT REACH ZERO, AND THAT IS THE CORRECT OUTCOME. 49 errors -> 5. The 5\n * that remain are defects the type checker is RIGHT about, and every available fix for\n * them changes rendered CSS, so they belong to the C9/C10 group with its baseline\n * re-record and must not ride along in a type-only commit (§E.3, §J.8). Each is marked\n * `DEFERRED DEFECT` at its site:\n *\n * - 4x TS2554 `themeProp()` called with 2 arguments in the `fadeIn`/`fadeOut`\n * keyframes, lines 109, 113, 120 and 124. These are literally §E.3 defects 1-8.\n * - 1x TS2367 `!props.type === 'instructions-warning'` in `Control`, line 485 — the\n * note for it is on `ControlStyleProps`, because backticks cannot appear inside a\n * styled template literal.\n *\n * NEITHER IS A TYPING GAP. `themeProp` has one signature and it takes 3-4 arguments; and\n * `!props.type` is `boolean` for EVERY possible declaration of `type` — even `any` —\n * so no annotation anywhere can remove the TS2367. Adding a suppression is explicitly\n * refused: §E.1 rule 3 and §E.3's \"Do not `@ts-ignore`\".\n *\n * Otherwise this is the react-select case at full size: 18 components, 14 of them\n * `styled(<react-select component>)` needing `SelectThemeProp`, one shared `css` helper\n * subject to the weak-type rule, one nested `css` block, and four non-`$` props of which\n * two leak to the DOM and two are dead — one of the dead pair, `fadeIn`, is now DELETED\n * rather than merely declared; see the note above `SuccessContainer`.\n */\nimport type React from 'react';\nimport styled, { css, keyframes } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nimport Select, { components } from 'react-select';\nimport { AsyncPaginate, withAsyncPaginate } from 'react-select-async-paginate';\nimport CreatableSelect from 'react-select/creatable';\n\nimport { ReactComponent as CloseIcon } from '../../../icons/close.svg';\nimport { ReactComponent as ExpandMoreIcon } from '../../../icons/expand-more.svg';\n\nimport type { PartialNtbTheme } from '../../../utils/defaultTheme';\n\n/**\n * `CompactAutocompleteSelect.tsx`'s `type` prop, verbatim from its\n * `PropTypes.oneOf(['', 'error', 'warning', 'instructions-warning', 'loading', 'success'])`,\n * carried WITHOUT a `$` to `Control`, `ValueContainer` and `Placeholder` — see\n * `ControlStyleProps` for why that is not a DOM leak here.\n *\n * Closed on purpose (§J.6): the templates below compare against this value 14 times, so a\n * mistyped state name is TS2367 rather than a branch that silently never fires. `''` is a\n * member because the component defaults `type = ''` (tsx line 172).\n */\ntype CompactAutocompleteSelectType =\n | ''\n | 'error'\n | 'warning'\n | 'instructions-warning'\n | 'loading'\n | 'success';\n\n/**\n * The `theme` prop of every `styled(<react-select component>)` in this file — 14 of them.\n *\n * `theme` is the one prop name that both styled-components and react-select claim.\n * react-select types it `ThemeConfig = Theme | ((t: Theme) => Theme)` and its `Theme`\n * REQUIRES `borderRadius`, which `NtbTheme` does not have, so `.attrs(applyDefaultTheme)`\n * — return type `{ theme: NtbTheme }` — was unassignable at all 14 sites, each reporting\n * the same last line:\n *\n * TS2345 … Types of property 'theme' are incompatible.\n * Property 'borderRadius' is missing in type 'NtbTheme' but required in type 'Theme'.\n *\n * Declaring `theme` in the `.attrs<P>()` generic fixes it because the generic is applied\n * as `Substitute<OuterProps, P> = FastOmit<OuterProps, keyof P> & P`, i.e. it REPLACES\n * react-select's declaration rather than intersecting with it. That is the truth about\n * this boundary: react-select's `getTheme()` is `{ ...its defaultTheme, ...props.theme }`,\n * so our `colors`/`spacing` win — which is why `ThemeColors`/`ThemeSpacing` in\n * `utils/defaultTheme.ts` carry react-select's member names — and `borderRadius` falls\n * through to react-select's own `4`. `NtbTheme` is deliberately a PARTIAL override of\n * react-select's theme. Do NOT add `borderRadius` to `NtbTheme` to \"fix\" this: that hands\n * react-select a border radius it does not get today, which is a render change.\n *\n * `MultiSelect.styled.ts` carries the same interface for the same reason.\n */\ninterface SelectThemeProp {\n /** A partial override merged over `defaultTheme` by `applyDefaultTheme`. */\n theme?: PartialNtbTheme;\n}\n\n/*\n * ============================ DEFERRED DEFECT (§E.3 #1-8) ============================\n * THE FOUR `themeProp()` CALLS IN THE NEXT TWO KEYFRAMES TAKE 2 ARGUMENTS, NOT 3.\n *\n * The signature is `(property, darkMode, lightMode, specificity = 2)`, so in\n * `themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')` the CSS PROPERTY NAME is\n * an rgba string and `lightMode` is `undefined`. What these emit is garbage — a nested\n * `body.dark-theme && { rgba(48, 130, 106, 0): … }` ruleset inside a keyframe block — and\n * `keyframes` never receives props at all, so `props.theme` is not even reachable here at\n * runtime.\n *\n * 4 of this file's 5 remaining errors are these, as TS2554 \"Expected 3-4 arguments, but\n * got 2\". THEY ARE LEFT AS ERRORS DELIBERATELY. §E.3 lists them among the twelve defects\n * that must be FIXED and says \"Do not `@ts-ignore`\", and the fix — delete the\n * interpolations or write literal colours — changes the emitted CSS, so it belongs to C9\n * with C10's baseline re-record and not to a type-only commit. The identical four sites\n * exist at `CompactStarRating.styled.ts:7,11,18,22`.\n * =====================================================================================\n */\nconst fadeIn = keyframes`\n from {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};\n }\n to {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};\n }\n`;\n\nconst fadeOut = keyframes`\n from {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};\n }\n to {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};\n }\n`;\n\nconst fadeInCheck = keyframes`\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n`;\n\nconst AsyncCreatableSelectPaginate = withAsyncPaginate(CreatableSelect);\n\n/**\n * The WRITTEN type of the four `styled(<react-select component>)` exports below. Same\n * mechanism, same wording and the same audit as `SelectWrapper` in\n * `src/components/inputs/MultiSelect/MultiSelect.styled.ts` — read that one; it is the\n * canonical note. §G.4.\n *\n * Short version: the INFERRED type is correct and unprintable. Under `--declaration` its\n * printed form expands to react-select's `PublicBaseSelectProps` and\n * `StateManagerAdditionalProps`, which `react-select`'s `exports` map does not serve, so\n * tsc reported 8 x TS2883 here and — because `noEmitOnError` is false — silently declined\n * to write this file's `.d.ts` at all. That in turn erased the props of the PUBLISHED\n * `CompactAutocompleteSelect` declaration down to\n * `ForwardRefExoticComponent<RefAttributes<unknown>>`, a closed props type with zero\n * members: the exact §G.4 poison, arriving from react-select rather than from `allowJs`.\n *\n * tsc prints a generic alias APPLICATION by reference, so `SelectWrapper<typeof Select>`\n * is writeable where the expansion is not. `Omit<ComponentProps<C>, keyof P> & P` is\n * styled-components' own `Substitute<OuterProps, P>`, so no prop is widened or narrowed.\n */\ntype SelectWrapper<C extends React.ComponentType<any>> = React.ComponentType<\n Omit<React.ComponentProps<C>, keyof SelectWrapperStyleProps> & SelectWrapperStyleProps\n>;\n\n/*\n * Spelled out rather than written inline at the export site, and that is not cosmetic:\n * `SelectWrapper<typeof AsyncCreatableSelectPaginate>` pushes the declaration head past\n * `printWidth: 100`, prettier then breaks after the `=` and re-indents the whole styled\n * template by two spaces — which changes the CSS TEXT of a component in a commit that is\n * supposed to be type-only. Proven by transpiling before and after with rollup's own\n * Babel config: with the inline form this file's emitted bytes changed (10096 -> 10118);\n * with the alias they are identical.\n */\ntype AsyncCreatablePaginateWrapper = SelectWrapper<typeof AsyncCreatableSelectPaginate>;\n\n/**\n * A module-scope `css` helper is its own generic slot: unannotated its props are\n * `ExecutionContext & object` and `props.$hasLabel` is TS2339 no matter what the hosting\n * component declares. §J.7.\n *\n * Hosts, for whoever changes this block: the four select wrappers —\n * `AsyncCreatableAutocompleteSelect`, `AsyncAutocompleteSelect`, `AutocompletSelect`,\n * `AutocompletCreatableSelect`. `CompactAutocompleteSelect.tsx` passes\n * `$hasLabel={!isEmpty(label)}` to all four (tsx lines 392, 398, 405, 410).\n *\n * ALL FOUR HOSTS MUST DECLARE `$hasLabel` THEMSELVES, and that is not redundant: this\n * type is all-optional, i.e. a WEAK TYPE, and assignability to a weak type requires at\n * least one member in common. react-select's props have no `$hasLabel`, so without the\n * declaration on the host the interpolation is TS2345 \"has no properties in common with\".\n * §J.7 — the same mechanism as `CompactTextInput`'s `linkColor`/`StyledLink`, except here\n * every host genuinely does pass it.\n */\nconst sharedStyle = css<{ $hasLabel?: boolean }>`\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 0.875rem;\n line-height: 1rem;\n width: 100%;\n display: block;\n box-shadow: 'none';\n flex-basis: ${props => (props.$hasLabel ? '66.66%' : '100%')};\n`;\n\n/**\n * The four select wrappers share this: `$hasLabel` for `sharedStyle`'s sake, `theme` for\n * react-select's sake, and `disabled` — which is a deferred defect, see below.\n */\nexport interface SelectWrapperStyleProps extends SelectThemeProp {\n /** `!isEmpty(label)` — narrows the control to 66.66% so the label gets the other third. */\n $hasLabel?: boolean;\n /*\n * ======================== DEFERRED DEFECT (dead branch, §E.4) =======================\n * `disabled` IS DECLARED BECAUSE THE TEMPLATES READ IT, NOT BECAUSE ANYTHING PASSES IT.\n *\n * `CompactAutocompleteSelect.tsx` builds `sharedSelectProps` with\n * `isDisabled: disabled || readOnly` (tsx line 306) and passes NO `disabled` to any of\n * the four wrappers — which is why tsc's message on the reads was TS2551 \"Did you mean\n * 'isDisabled'?\" rather than a plain TS2339. So `props.disabled` is always `undefined`\n * here and every `opacity: 0.5` / `cursor: not-allowed` block in the four wrappers is\n * DEAD: a disabled autocomplete has never dimmed, at 7 sites.\n *\n * The fix is to repoint the reads to `isDisabled`, which is a real react-select prop and\n * IS passed — so it ACTIVATES seven rules that have never fired. That is a visual change\n * and belongs to C9/C10 with the baseline re-record, not here. §J.8's second forbidden\n * category, verbatim.\n * ===================================================================================\n */\n disabled?: 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\n/*\n * ====================== DEFERRED DEFECT (DOM leak, §E.4 third case) ====================\n * `disabled` HAS NO `$` ON EITHER OF THE NEXT TWO COMPONENTS, AND THAT IS A DEFECT —\n * declared here, not fixed here.\n *\n * `CompactAutocompleteSelect.tsx` passes `<S.CompactAutocompleteSelect disabled={disabled}>`\n * (tsx line 378) and `<S.Label htmlFor={uniqueId} disabled={disabled}>` (tsx line 381).\n * `disabled` is not a member of `HTMLAttributes<HTMLDivElement>` or of\n * `LabelHTMLAttributes`, and `shouldForwardProp` forwards every non-`$` prop, so\n * `disabled=\"\"` is on the rendered `<div>` and `<label>` today and is in the recorded\n * render baseline. Prefixing it `$disabled` at both ends REMOVES two DOM attributes, so it\n * is C10 work with the re-record. `CompactTextInput.styled.ts`'s `Label` carries the\n * identical defect. §J.9.\n * ======================================================================================\n */\ninterface DisabledStyleProps {\n /** `disabled` — dims and blocks the pointer. Also reaches the DOM; see above. */\n disabled?: boolean;\n}\n\nexport const CompactAutocompleteSelect = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<DisabledStyleProps>(applyDefaultTheme)`\n display: flex;\n align-items: center;\n height: 24px;\n font-family: ${props => props.theme.primaryFontFamily};\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n `}\n`;\n\nexport const Label = styled.label\n .withConfig({\n shouldForwardProp\n })\n .attrs<DisabledStyleProps>(applyDefaultTheme)`\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n flex-basis: 33.33%;\n font-size: 0.875rem;\n line-height: 1rem;\n height: 19px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-top: 2px;\n ${props =>\n props.disabled &&\n css`\n cursor: not-allowed;\n `}\n`;\n\nexport const InputContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n width: 100%;\n height: 19px;\n`;\n\n/*\n * ============ `fadeIn` IS GONE — DEAD BRANCH REMOVED (§E.4 first case) ===============\n * This component read `props.fadeIn` twice:\n *\n * opacity: ${props => (props.fadeIn ? 0 : 1)};\n * animation: ${props => (props.fadeIn ? fadeOutCheck : fadeInCheck)} 0.5s ease-in-out;\n *\n * NOTHING HAS EVER PASSED IT — `CompactAutocompleteSelect.tsx` renders\n * `<S.SuccessContainer>` (tsx:512) with no props at all, and `git log --all -S'fadeIn='`\n * finds no commit in the repo's history that writes the prop anywhere in `src`. So\n * `props.fadeIn` was always `undefined`, `opacity` was always the `1` two lines above\n * already sets, and `fadeOutCheck` was unreachable — which is also why it goes with the\n * branch: this file's last other reader of it was that read.\n *\n * It was a MISTYPED `success`, not an unimplemented feature: it entered the repo in\n * `4ed910a` in `CompactTextInput.styled.js` next to a `props.success` read, and\n * `NMB-3183` (`7e46b9d`, `59b0041`) already deleted the identical two lines and the\n * orphaned keyframes from that file. This one was missed.\n *\n * Wiring it up was rejected: this container is mounted unconditionally inside `S.Label`\n * and only swaps its children, so there is no \"success is going away\" transition to hang\n * a fade-out on. Removing the branch also removes the would-be DOM leak — the prop had no\n * `$`, so `shouldForwardProp` would have forwarded `fadeIn=\"\"` onto the `<div>` the day\n * anything passed it.\n *\n * The `animation` is kept, now static, because the branch it always took is the live one.\n * `TextArea.styled.ts`'s `SuccessContainer` carries the full derivation.\n * ====================================================================================\n */\nexport const SuccessContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n opacity: 1;\n pointer-events: none;\n display: flex;\n animation: ${fadeInCheck} 0.5s ease-in-out;\n transition: opacity 0.5s ease-in-out;\n margin-right: 5px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-500')\n )}\n > svg {\n width: 13px;\n }\n`;\n\nexport const AsyncCreatableAutocompleteSelect: AsyncCreatablePaginateWrapper = styled(\n AsyncCreatableSelectPaginate\n).attrs<SelectWrapperStyleProps>(applyDefaultTheme)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n `}\n &&:hover:not(:focus) {\n ${props =>\n props.disabled &&\n css`\n background: none !important;\n cursor: not-allowed;\n `}\n }\n`;\n\nexport const AsyncAutocompleteSelect: SelectWrapper<typeof AsyncPaginate> = styled(\n AsyncPaginate\n).attrs<SelectWrapperStyleProps>(applyDefaultTheme)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n `}\n &&:hover:not(:focus) {\n ${props =>\n props.disabled &&\n css`\n background: none !important;\n cursor: not-allowed;\n `}\n }\n`;\n\nexport const AutocompletSelect: SelectWrapper<typeof Select> = styled(\n Select\n).attrs<SelectWrapperStyleProps>(applyDefaultTheme)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n `}\n &&:hover:not(:focus) {\n ${props =>\n props.disabled &&\n css`\n background: none !important;\n cursor: not-allowed;\n `}\n }\n`;\n\nexport const AutocompletCreatableSelect: SelectWrapper<typeof CreatableSelect> = styled(\n CreatableSelect\n).attrs<SelectWrapperStyleProps>(applyDefaultTheme)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n `}\n`;\n\n/**\n * Props of `Control`, the react-select control wrapper.\n *\n * `edit` and `type` HAVE NO `$` AND STILL DO NOT LEAK TO THE DOM, which makes this the one\n * benign member of §E.4's non-`$` list in this file and worth stating so nobody \"fixes\" it\n * blind. There is no `withConfig`/`shouldForwardProp` on a `styled(<component>)` — there is\n * no DOM element to filter for — and react-select's `Control` renders only its\n * `innerProps` onto the `<div>`, ignoring props it does not know. So\n * `<S.Control edit={edit} type={type} …>` (tsx line 193) reaches the template and stops\n * there. Prefixing them would be tidier but is not a bug fix, and it still touches two\n * files for no type benefit.\n *\n * `isFocused` is deliberately ABSENT: it is a real `ControlProps` member, so the template's\n * seven reads of it already typecheck. §J.9's first case.\n *\n * ================== DEFERRED DEFECT in this component's template =====================\n * `!props.type === 'instructions-warning'` (the `isFocused` border-color rule, ~40 lines\n * down; the note has to live here because backticks cannot appear inside the styled\n * template) NEGATES FIRST AND THEN COMPARES A BOOLEAN TO A STRING. It is always false, so\n * that whole `border-color` rule is dead — a FOCUSED control has never received the\n * gray-600 border.\n *\n * That is the 5th and last remaining error in this file, TS2367 \"This comparison appears\n * to be unintentional because the types 'boolean' and 'string' have no overlap\", and NO\n * ANNOTATION CAN REMOVE IT: `!props.type` is `boolean` whatever `type` is declared as,\n * `any` included. It is a defect in the expression, and §E.1 rule 3 says fix the code, not\n * the type. The fix is `props.type !== 'instructions-warning'`, which ACTIVATES a rule that\n * has never fired on the most visible state of the component — C9 for the fix, C10 for the\n * re-record, not this commit. §J.8.\n * ====================================================================================\n */\ninterface ControlStyleProps extends SelectThemeProp {\n /** `edit` (`PropTypes.bool`) — grey \"this is editable\" background. */\n edit?: boolean;\n /** `type` — see `CompactAutocompleteSelectType`. Branched on 11 times below. */\n type?: CompactAutocompleteSelectType;\n}\n\nexport const Control = styled(components.Control).attrs<ControlStyleProps>(applyDefaultTheme)`\n && {\n ${props =>\n props.edit &&\n props.theme.themeProp('background', 'rgba(39,39,42, 0.7)', 'rgba(244,244,245, 0.3)')};\n ${props =>\n props.edit &&\n props.theme.themeProp('border-color', 'rgba(39,39,42, 0.7)', 'rgba(228,228,231, 0.3)')};\n\n height: 22px;\n min-height: 22px;\n box-shadow: none;\n box-sizing: border-box;\n padding: 1px 3px 0 8.7px;\n cursor: pointer;\n border: 1px solid transparent;\n background-color: transparent;\n ${props =>\n props.type &&\n /*\n * A `css` block nested inside an interpolation opens its OWN `${props => …}`, which\n * SHADOWS the outer one, so `ControlStyleProps` from the `.attrs<P>()` above does not\n * reach in here and this block needs its own generic. §J.7, second shape. The\n * weak-type rule is satisfied because the host declares `type` too.\n */\n css<{ type?: CompactAutocompleteSelectType }>`\n animation: ${props => (props.type === 'success' ? fadeIn : fadeOut)} 0.5s ease-in-out;\n `}\n\n ${props =>\n props.type === 'warning' &&\n !props.isFocused &&\n props.theme.themeProp('background-color', '#634e01', '#FFFDE8')};\n\n ${props =>\n props.type === 'instructions-warning' &&\n !props.isFocused &&\n props.theme.themeProp('background-color', '#634e01', '#FFF36C')};\n\n ${props =>\n props.type === 'instructions-warning' &&\n props.isFocused &&\n props.theme.themeProp('background-color', '#634e01', '#FFF36C')};\n\n ${props =>\n props.type === 'error' &&\n !props.isFocused &&\n props.theme.themeProp('background-color', '#7f1b1b', '#FBEAE6')};\n\n ${props =>\n props.isFocused &&\n !props.type === 'instructions-warning' &&\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-600'),\n props.theme.getColor('gray-600')\n )}\n ${props =>\n props.type === 'warning' &&\n props.isFocused &&\n props.theme.themeProp('border-color', '#F4E21E', '#F4E21E')}\n ${props =>\n props.type === 'error' &&\n props.isFocused &&\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('red-500'),\n props.theme.getColor('red-500')\n )}\n }\n\n & .dropdown-indicator {\n display: none;\n }\n\n &:hover .dropdown-indicator {\n display: flex;\n }\n\n &&:hover {\n border-color: transparent;\n ${props =>\n !props.isFocused &&\n props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-100')\n )};\n\n ${props =>\n props.type === 'warning' &&\n !props.isFocused &&\n props.theme.themeProp('background', '#806403', '#FFFEBF')};\n\n ${props =>\n props.type === 'instructions-warning' &&\n !props.isFocused &&\n props.theme.themeProp('background', '#806403', '#F4E21E')};\n\n ${props =>\n props.type === 'error' &&\n !props.isFocused &&\n props.theme.themeProp('background', '#901d1d', '#f7d5d0')};\n }\n`;\n\nexport const Option = styled(components.Option).attrs<SelectThemeProp>(applyDefaultTheme)`\n && {\n min-height: 22px;\n height: 22px;\n display: flex;\n align-items: center;\n padding: 6px;\n cursor: pointer;\n padding: 1px 13px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n ${props =>\n props.isFocused &&\n css`\n ${props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-200')\n )}\n `}\n ${props =>\n props.isSelected &&\n css`\n ${props.theme.themeProp('background-color', 'transparent', 'transparent')}\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n `}\n ${props =>\n props.isFocused &&\n props.isSelected &&\n css`\n ${props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-200')\n )}\n `}\n }\n svg {\n width: 15px;\n margin: 0 9px 0 0;\n }\n a {\n display: flex;\n text-decoration: none;\n color: inherit;\n }\n`;\n\n/**\n * `CompactAutocompleteSelect.tsx` passes `<S.Placeholder className=\"select-placeholder\"\n * type={type} …>` (tsx line 225). Same non-`$`-but-not-leaking situation as `Control`.\n */\ninterface PlaceholderStyleProps extends SelectThemeProp {\n /** `type` — dims the placeholder for the `error` and `warning` states only. */\n type?: CompactAutocompleteSelectType;\n}\n\nexport const Placeholder = styled(components.Placeholder).attrs<PlaceholderStyleProps>(\n applyDefaultTheme\n)`\n && {\n ${props =>\n (props.type === 'error' || props.type === 'warning') &&\n css`\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n `}\n ${props =>\n (props.type === 'error' || props.type === 'warning') &&\n props.theme.themeProp('opacity', '0.6', '0.6')};\n }\n`;\n\nexport const SingleValue = styled(components.SingleValue).attrs<SelectThemeProp>(applyDefaultTheme)`\n && {\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )};\n }\n`;\n\nexport const Input = styled(components.Input).attrs<SelectThemeProp>(applyDefaultTheme)`\n && {\n margin: 0;\n padding: 0;\n padding-left: 2px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n }\n`;\n\nexport const Menu = styled(components.Menu).attrs<SelectThemeProp>(applyDefaultTheme)`\n && {\n ${props =>\n props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-700'),\n props.theme.getColor('white')\n )};\n }\n`;\n\nexport const ValueContainer = styled(components.ValueContainer).attrs<SelectThemeProp>(\n applyDefaultTheme\n)`\n && {\n padding: 0;\n }\n`;\n\nexport const ClearIndicator = styled(components.ClearIndicator).attrs<SelectThemeProp>(\n applyDefaultTheme\n)`\n && {\n display: ${props => (props.isFocused ? 'flex' : 'none')};\n padding: 0;\n cursor: pointer;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n }\n`;\n\nexport const DropdownIndicator = styled(components.DropdownIndicator).attrs<SelectThemeProp>(\n applyDefaultTheme\n)`\n && {\n display: ${props => (props.isFocused ? 'flex' : 'none')};\n padding: 0;\n width: 18px;\n margin-left: 2px;\n cursor: pointer;\n margin-top: 1px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n }\n`;\nexport const DropdownIndicatorIcon = styled(ExpandMoreIcon)\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n width: 12px;\n`;\n\nexport const ClearIndicatorIcon = styled(CloseIcon)\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n width: 8px;\n margin-right: 4px;\n ${props =>\n props.theme.themeProp(\n 'stroke',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n stroke-width: 2px;\n`;\n\nexport const IndicatorSeparator = styled(components.IndicatorSeparator).attrs<SelectThemeProp>(\n applyDefaultTheme\n)`\n && {\n display: ${props => (props.isFocused ? 'flex' : 'none')};\n margin: 4px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n }\n`;\n"],"names":["fadeIn","keyframes","props","theme","themeProp","fadeOut","fadeInCheck","AsyncCreatableSelectPaginate","withAsyncPaginate","CreatableSelect","sharedStyle","css","primaryFontFamily","$hasLabel","shouldForwardProp","prop","startsWith","CompactAutocompleteSelect","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","disabled","Label","label","getColor","InputContainer","SuccessContainer","AsyncCreatableAutocompleteSelect","AsyncAutocompleteSelect","AsyncPaginate","AutocompletSelect","Select","AutocompletCreatableSelect","Control","components","edit","type","isFocused","Option","isSelected","Placeholder","SingleValue","Input","Menu","ValueContainer","ClearIndicator","DropdownIndicator","DropdownIndicatorIcon","ExpandMoreIcon","ClearIndicatorIcon","CloseIcon","IndicatorSeparator"],"mappings":";;;;;;;;AA2GA,MAAMA,MAAM,GAAGC,SAAS,CAAA,CAAA,wBAAA,EAAA,wBAAA,EAAA,IAAA,CAAA,EAEAC,KAAK,IACvB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AK,CAACC,KAAK,CAACyB,QAAQ,CAAC,UAAU,CACjC,CAAC;;;;"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
1
|
import React__default, { useState, useRef, useEffect, useMemo } from 'react';
|
|
4
2
|
import { ReactComponent as SvgStarFilled } from '../../icons/star-filled.svg.js';
|
|
5
3
|
import { ReactComponent as SvgStar } from '../../icons/star.svg.js';
|
|
@@ -12,24 +10,28 @@ import '../../data/Tabs/Tabs.js';
|
|
|
12
10
|
import Tooltip from '../../data/Tooltip/Tooltip.js';
|
|
13
11
|
import '../../data/VerificationStatusIcon/VerificationStatusIcon.js';
|
|
14
12
|
import { CompactStarRating as CompactStarRating$1, labelWidth, SuccessContainer, starsWidth, StarFill, Star } from './CompactStarRating.styled.js';
|
|
13
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
15
14
|
|
|
15
|
+
const NOOP = () => {};
|
|
16
|
+
const DEFAULT_ICON = jsx(SvgStar, {});
|
|
17
|
+
const DEFAULT_ICON_FILL = jsx(SvgStarFilled, {});
|
|
16
18
|
const CompactStarRating = React__default.forwardRef(function CompactStarRating({
|
|
17
|
-
label,
|
|
18
|
-
icon,
|
|
19
|
-
iconFill,
|
|
20
|
-
max,
|
|
21
|
-
defaultValue,
|
|
22
|
-
value,
|
|
19
|
+
label = 'Rating',
|
|
20
|
+
icon = DEFAULT_ICON,
|
|
21
|
+
iconFill = DEFAULT_ICON_FILL,
|
|
22
|
+
max = 5,
|
|
23
|
+
defaultValue = 0,
|
|
24
|
+
value = 0,
|
|
23
25
|
name,
|
|
24
|
-
viewEmpty,
|
|
25
|
-
onChange,
|
|
26
|
+
viewEmpty = true,
|
|
27
|
+
onChange = NOOP,
|
|
26
28
|
onBlur,
|
|
27
|
-
type,
|
|
28
|
-
descriptionToolTip,
|
|
29
|
+
type = '',
|
|
30
|
+
descriptionToolTip = '',
|
|
29
31
|
disabled,
|
|
30
32
|
readOnly,
|
|
31
33
|
edit,
|
|
32
|
-
hidden,
|
|
34
|
+
hidden = false,
|
|
33
35
|
loadingIcon,
|
|
34
36
|
successIcon,
|
|
35
37
|
...props
|
|
@@ -39,7 +41,7 @@ const CompactStarRating = React__default.forwardRef(function CompactStarRating({
|
|
|
39
41
|
const [hover, setHover] = useState(false);
|
|
40
42
|
const [tempRating, setTempRating] = useState('');
|
|
41
43
|
const [initialRating, setInitialRating] = useState('');
|
|
42
|
-
const inputRef = useRef();
|
|
44
|
+
const inputRef = useRef(undefined);
|
|
43
45
|
useEffect(() => {
|
|
44
46
|
setRating(value || defaultValue);
|
|
45
47
|
setInitialRating(value || defaultValue);
|
|
@@ -60,7 +62,7 @@ const CompactStarRating = React__default.forwardRef(function CompactStarRating({
|
|
|
60
62
|
}, [descriptionToolTip]);
|
|
61
63
|
const starIconRender = key => {
|
|
62
64
|
if (rating > 0 && rating >= key + 1) {
|
|
63
|
-
return
|
|
65
|
+
return jsx(StarFill, {
|
|
64
66
|
readOnly: readOnly,
|
|
65
67
|
disabled: disabled,
|
|
66
68
|
onClick: event => {
|
|
@@ -83,10 +85,10 @@ const CompactStarRating = React__default.forwardRef(function CompactStarRating({
|
|
|
83
85
|
},
|
|
84
86
|
$hover: hover && key + 1 <= tempRating,
|
|
85
87
|
type: "button",
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
+
children: iconFill
|
|
89
|
+
}, key);
|
|
88
90
|
} else if (viewEmpty) {
|
|
89
|
-
return
|
|
91
|
+
return jsx(Star, {
|
|
90
92
|
readOnly: readOnly,
|
|
91
93
|
disabled: disabled,
|
|
92
94
|
onClick: event => {
|
|
@@ -103,75 +105,52 @@ const CompactStarRating = React__default.forwardRef(function CompactStarRating({
|
|
|
103
105
|
},
|
|
104
106
|
$hover: hover && key + 1 <= tempRating,
|
|
105
107
|
type: "button",
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
+
children: icon
|
|
109
|
+
}, key);
|
|
108
110
|
}
|
|
109
111
|
};
|
|
110
112
|
const input = () => {
|
|
111
|
-
return
|
|
113
|
+
return jsxs(CompactStarRating$1, {
|
|
112
114
|
ref: forwardedRef,
|
|
113
115
|
readOnly: readOnly,
|
|
114
116
|
disabled: disabled,
|
|
115
117
|
onChange: onChange,
|
|
116
|
-
onBlur: onBlur
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
118
|
+
onBlur: onBlur,
|
|
119
|
+
...props,
|
|
120
|
+
children: [jsxs(labelWidth, {
|
|
121
|
+
disabled: disabled,
|
|
122
|
+
children: [label, jsxs(SuccessContainer, {
|
|
123
|
+
children: [type === 'loading' && loadingIcon, type === 'success' && successIcon]
|
|
124
|
+
})]
|
|
125
|
+
}), jsx(starsWidth, {
|
|
126
|
+
$edit: edit,
|
|
127
|
+
type: type,
|
|
128
|
+
readOnly: readOnly,
|
|
129
|
+
children: stars.map(key => {
|
|
130
|
+
return jsxs("div", {
|
|
131
|
+
children: [jsx("input", {
|
|
132
|
+
type: "number",
|
|
133
|
+
name: name,
|
|
134
|
+
ref: inputRef
|
|
135
|
+
}), starIconRender(key)]
|
|
136
|
+
}, key);
|
|
137
|
+
})
|
|
138
|
+
})]
|
|
139
|
+
});
|
|
132
140
|
};
|
|
133
141
|
if (hidden) return null;
|
|
134
|
-
return
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
return jsxs(Fragment, {
|
|
143
|
+
children: [!memoizedDescriptionToolTip && input(), memoizedDescriptionToolTip && jsx("div", {
|
|
144
|
+
children: jsx(Tooltip, {
|
|
145
|
+
content: memoizedDescriptionToolTip,
|
|
146
|
+
placement: "bottom-end",
|
|
147
|
+
trigger: 'mouseenter',
|
|
148
|
+
zIndex: 999999,
|
|
149
|
+
children: input()
|
|
150
|
+
}, "tooltipTextArea1")
|
|
151
|
+
})]
|
|
152
|
+
});
|
|
141
153
|
});
|
|
142
|
-
CompactStarRating.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
143
|
-
readOnly: PropTypes.bool,
|
|
144
|
-
disabled: PropTypes.bool,
|
|
145
|
-
edit: PropTypes.bool,
|
|
146
|
-
value: PropTypes.number,
|
|
147
|
-
type: PropTypes.oneOf(['', 'error', 'warning', 'loading', 'success']),
|
|
148
|
-
defaultValue: PropTypes.number,
|
|
149
|
-
label: PropTypes.string,
|
|
150
|
-
name: PropTypes.string,
|
|
151
|
-
icon: PropTypes.element,
|
|
152
|
-
iconFill: PropTypes.element,
|
|
153
|
-
max: PropTypes.number,
|
|
154
|
-
viewEmpty: PropTypes.bool,
|
|
155
|
-
onChange: PropTypes.func,
|
|
156
|
-
onBlur: PropTypes.func,
|
|
157
|
-
hidden: PropTypes.bool,
|
|
158
|
-
loadingIcon: PropTypes.element,
|
|
159
|
-
successIcon: PropTypes.element,
|
|
160
|
-
descriptionToolTip: PropTypes.string
|
|
161
|
-
} : {};
|
|
162
|
-
CompactStarRating.defaultProps = {
|
|
163
|
-
label: 'Rating',
|
|
164
|
-
max: 5,
|
|
165
|
-
value: 0,
|
|
166
|
-
defaultValue: 0,
|
|
167
|
-
viewEmpty: true,
|
|
168
|
-
icon: React__default.createElement(SvgStar, null),
|
|
169
|
-
iconFill: React__default.createElement(SvgStarFilled, null),
|
|
170
|
-
hidden: false,
|
|
171
|
-
type: '',
|
|
172
|
-
descriptionToolTip: '',
|
|
173
|
-
onChange: () => {}
|
|
174
|
-
};
|
|
175
154
|
|
|
176
155
|
export { CompactStarRating as default };
|
|
177
156
|
//# sourceMappingURL=CompactStarRating.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompactStarRating.js","sources":["../../../src/components/inputs/CompactStarRating/CompactStarRating.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useEffect, useRef, useState, useMemo } from 'react';\nimport { ReactComponent as StarIconFill } from '../../../icons/star-filled.svg';\nimport { ReactComponent as StarIcon } from '../../../icons/star.svg';\nimport { Tooltip } from '../../data';\n\nimport * as S from './CompactStarRating.styled';\n\n/**\n * A compact star rating.\n *\n * To remove a rating (i.e. show 0 stars), click the first star to give a 1-star rating, and then click the first star again.\n *\n * ### Import\n *\n * ``` js\n * import { CompactStarRating } from '@ntbjs/react-components/inputs'\n * // or\n * import CompactStarRating from '@ntbjs/react-components/inputs/CompactStarRating'\n * ```\n * ### Values\n * Pass default value as a prop (`defaultValue`) into the component: 0 or state value.\n * ```\n */\n\nconst CompactStarRating = React.forwardRef(function CompactStarRating(\n {\n label,\n icon,\n iconFill,\n max,\n defaultValue,\n value,\n name,\n viewEmpty,\n onChange,\n onBlur,\n type,\n descriptionToolTip,\n disabled,\n readOnly,\n edit,\n hidden,\n loadingIcon,\n successIcon,\n ...props\n },\n forwardedRef\n) {\n const stars = Array.from(Array(max).keys());\n const [rating, setRating] = useState('');\n const [hover, setHover] = useState(false);\n const [tempRating, setTempRating] = useState('');\n const [initialRating, setInitialRating] = useState('');\n const inputRef = useRef();\n\n useEffect(() => {\n setRating(value || defaultValue);\n setInitialRating(value || defaultValue);\n }, [value, defaultValue]);\n\n useEffect(() => {\n inputRef.current.value = String(rating);\n if (rating === initialRating) {\n return undefined;\n } else {\n setInitialRating(rating);\n onChange({ target: inputRef.current });\n }\n }, [rating]);\n\n const memoizedDescriptionToolTip = useMemo(() => {\n return descriptionToolTip;\n }, [descriptionToolTip]);\n\n const starIconRender = key => {\n if (rating > 0 && rating >= key + 1) {\n return (\n <S.StarFill\n readOnly={readOnly}\n disabled={disabled}\n onClick={event => {\n event.preventDefault();\n if (key + 1 > 1) {\n return setRating(key + 1);\n } else if (key + 1 == 1) {\n setRating(current => {\n return current === 1 ? 0 : key + 1;\n });\n }\n }}\n onMouseEnter={() => {\n setTempRating(key + 1);\n setHover(true);\n }}\n onMouseLeave={() => {\n setTempRating(0);\n setHover(false);\n }}\n $hover={hover && key + 1 <= tempRating}\n type=\"button\"\n key={key}\n >\n {iconFill}\n </S.StarFill>\n );\n } else if (viewEmpty) {\n return (\n <S.Star\n readOnly={readOnly}\n disabled={disabled}\n onClick={event => {\n event.preventDefault();\n setRating(key + 1);\n }}\n onMouseEnter={() => {\n setTempRating(key + 1);\n setHover(true);\n }}\n onMouseLeave={() => {\n setTempRating(0);\n setHover(false);\n }}\n $hover={hover && key + 1 <= tempRating}\n type=\"button\"\n key={key}\n >\n {icon}\n </S.Star>\n );\n }\n };\n\n const input = () => {\n return (\n <S.CompactStarRating\n ref={forwardedRef}\n readOnly={readOnly}\n disabled={disabled}\n onChange={onChange}\n onBlur={onBlur}\n {...props}\n >\n <S.labelWidth disabled={disabled}>\n {label}\n <S.SuccessContainer>\n {type === 'loading' && loadingIcon}\n {type === 'success' && successIcon}\n </S.SuccessContainer>\n </S.labelWidth>\n <S.starsWidth $edit={edit} type={type} readOnly={readOnly}>\n {stars.map(key => {\n return (\n <div key={key}>\n <input type=\"number\" name={name} ref={inputRef} />\n {starIconRender(key, value)}\n </div>\n );\n })}\n </S.starsWidth>\n </S.CompactStarRating>\n );\n };\n\n if (hidden) return null;\n\n return (\n <>\n {!memoizedDescriptionToolTip && input()}\n {memoizedDescriptionToolTip && (\n <div>\n <Tooltip\n content={memoizedDescriptionToolTip}\n key=\"tooltipTextArea1\"\n placement=\"bottom-end\"\n trigger={'mouseenter'}\n zIndex={999999}\n >\n {input()}\n </Tooltip>\n </div>\n )}\n </>\n );\n});\n\nCompactStarRating.propTypes = {\n /**\n * Whether the star rating is read-only\n */\n readOnly: PropTypes.bool,\n /**\n * Whether the star rating is disabled\n */\n disabled: PropTypes.bool,\n /**\n * Displays a grey background to show that the star rating is editable\n */\n edit: PropTypes.bool,\n /**\n * Rating value (0-5)\n */\n value: PropTypes.number,\n /**\n * Define the type based on error, warning, loading and success.\n */\n type: PropTypes.oneOf(['', 'error', 'warning', 'loading', 'success']),\n /**\n * Default rating value\n */\n defaultValue: PropTypes.number,\n /**\n * Compact star rating label\n */\n label: PropTypes.string,\n /**\n * Name of the text area (used when sending form data)\n */\n name: PropTypes.string,\n /**\n * Icon element – E.g: `icon={<StarIcon />}`\n */\n icon: PropTypes.element,\n /**\n * Filled icon element – E.g: `icon={<StarIcon />}`\n */\n iconFill: PropTypes.element,\n /**\n * Max number of stars: 5\n */\n max: PropTypes.number,\n /**\n * View Compact Star Rating component when no values have been assigned\n */\n viewEmpty: PropTypes.bool,\n\n /**\n * Optional callback function for `onChange`\n */\n onChange: PropTypes.func,\n /**\n * Optional callback function for `onBlur`\n */\n onBlur: PropTypes.func,\n /**\n * Whether the component is hidden or visible.\n */\n hidden: PropTypes.bool,\n /**\n * Icon element – E.g: `icon={<Spinner />}`\n */\n loadingIcon: PropTypes.element,\n /**\n * Icon element – E.g: `icon={<Check />}`\n */\n successIcon: PropTypes.element,\n /**\n * Description ToolTip text.\n */\n descriptionToolTip: PropTypes.string\n};\n\nCompactStarRating.defaultProps = {\n label: 'Rating',\n max: 5,\n value: 0,\n defaultValue: 0,\n viewEmpty: true,\n icon: <StarIcon />,\n iconFill: <StarIconFill />,\n hidden: false,\n type: '',\n descriptionToolTip: '',\n onChange: () => {}\n};\n\nexport default CompactStarRating;\n"],"names":["CompactStarRating","React","forwardRef","label","icon","iconFill","max","defaultValue","value","name","viewEmpty","onChange","onBlur","type","descriptionToolTip","disabled","readOnly","edit","hidden","loadingIcon","successIcon","props","forwardedRef","stars","Array","from","keys","rating","setRating","useState","hover","setHover","tempRating","setTempRating","initialRating","setInitialRating","inputRef","useRef","useEffect","current","String","undefined","target","memoizedDescriptionToolTip","useMemo","starIconRender","key","createElement","S","onClick","event","preventDefault","onMouseEnter","onMouseLeave","$hover","input","_extends","ref","$edit","map","Fragment","Tooltip","content","placement","trigger","zIndex","propTypes","process","env","NODE_ENV","PropTypes","bool","number","oneOf","string","element","func","defaultProps","StarIcon","StarIconFill"],"mappings":";;;;;;;;;;;;;;;AAyBMA,MAAAA,iBAAiB,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,iBAAiBA,CACnE;EACEG,KAAK;EACLC,IAAI;EACJC,QAAQ;EACRC,GAAG;EACHC,YAAY;EACZC,KAAK;EACLC,IAAI;EACJC,SAAS;EACTC,QAAQ;EACRC,MAAM;EACNC,IAAI;EACJC,kBAAkB;EAClBC,QAAQ;EACRC,QAAQ;EACRC,IAAI;EACJC,MAAM;EACNC,WAAW;EACXC,WAAW;EACX,GAAGC,KAAAA;AACL,CAAC,EACDC,YAAY,EACZ;AACA,EAAA,MAAMC,KAAK,GAAGC,KAAK,CAACC,IAAI,CAACD,KAAK,CAAClB,GAAG,CAAC,CAACoB,IAAI,EAAE,CAAC,CAAA;EAC3C,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGC,QAAQ,CAAC,EAAE,CAAC,CAAA;EACxC,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGF,QAAQ,CAAC,KAAK,CAAC,CAAA;EACzC,MAAM,CAACG,UAAU,EAAEC,aAAa,CAAC,GAAGJ,QAAQ,CAAC,EAAE,CAAC,CAAA;EAChD,MAAM,CAACK,aAAa,EAAEC,gBAAgB,CAAC,GAAGN,QAAQ,CAAC,EAAE,CAAC,CAAA;AACtD,EAAA,MAAMO,QAAQ,GAAGC,MAAM,EAAE,CAAA;AAEzBC,EAAAA,SAAS,CAAC,MAAM;AACdV,IAAAA,SAAS,CAACpB,KAAK,IAAID,YAAY,CAAC,CAAA;AAChC4B,IAAAA,gBAAgB,CAAC3B,KAAK,IAAID,YAAY,CAAC,CAAA;AACzC,GAAC,EAAE,CAACC,KAAK,EAAED,YAAY,CAAC,CAAC,CAAA;AAEzB+B,EAAAA,SAAS,CAAC,MAAM;IACdF,QAAQ,CAACG,OAAO,CAAC/B,KAAK,GAAGgC,MAAM,CAACb,MA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C;AACRD,EAAAA,YAAY,EAAE,CAAC;AACfG,EAAAA,SAAS,EAAE,IAAI;AACfN,EAAAA,IAAI,EAAEH,cAAA,CAAA8C,aAAA,CAAC+B,OAAQ,MAAE,CAAC;AAClBzE,EAAAA,QAAQ,EAAEJ,cAAA,CAAA8C,aAAA,CAACgC,aAAY,MAAE,CAAC;AAC1B7D,EAAAA,MAAM,EAAE,KAAK;AACbL,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,kBAAkB,EAAE,EAAE;EACtBH,QAAQ,EAAEA,MAAM,EAAC;AACnB,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"CompactStarRating.js","sources":["../../../src/components/inputs/CompactStarRating/CompactStarRating.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState, useMemo } from 'react';\nimport { ReactComponent as StarIconFill } from '../../../icons/star-filled.svg';\nimport { ReactComponent as StarIcon } from '../../../icons/star.svg';\nimport { Tooltip } from '../../data';\n\nimport * as S from './CompactStarRating.styled';\n\nconst NOOP = () => {};\nconst DEFAULT_ICON = <StarIcon />;\nconst DEFAULT_ICON_FILL = <StarIconFill />;\n\ntype CompactStarRatingOwnProps = {\n /**\n * Whether the star rating is read-only\n */\n readOnly?: boolean;\n /**\n * Whether the star rating is disabled\n */\n disabled?: boolean;\n /**\n * Displays a grey background to show that the star rating is editable\n */\n edit?: boolean;\n /**\n * Rating value (0-5)\n */\n value?: number;\n /**\n * Define the type based on error, warning, loading and success.\n */\n type?: '' | 'error' | 'warning' | 'loading' | 'success';\n /**\n * Default rating value\n */\n defaultValue?: number;\n /**\n * Compact star rating label\n */\n label?: string;\n /**\n * Name of the text area (used when sending form data)\n */\n name?: string;\n /**\n * Icon element – E.g: `icon={<StarIcon />}`\n */\n icon?: React.ReactElement<any>;\n /**\n * Filled icon element – E.g: `icon={<StarIcon />}`\n */\n iconFill?: React.ReactElement<any>;\n /**\n * Max number of stars: 5\n */\n max?: number;\n /**\n * View Compact Star Rating component when no values have been assigned\n */\n viewEmpty?: boolean;\n /**\n * Optional callback function for `onChange`\n */\n onChange?: (...args: any[]) => any;\n /**\n * Optional callback function for `onBlur`\n */\n onBlur?: (...args: any[]) => any;\n /**\n * Whether the component is hidden or visible.\n */\n hidden?: boolean;\n /**\n * Icon element – E.g: `icon={<Spinner />}`\n */\n loadingIcon?: React.ReactElement<any>;\n /**\n * Icon element – E.g: `icon={<Check />}`\n */\n successIcon?: React.ReactElement<any>;\n /**\n * Description ToolTip text.\n */\n descriptionToolTip?: string;\n};\n\n/*\n * NMB-3998 §C.2: `props` is spread onto `S.CompactStarRating`, 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 CompactStarRatingOwnProps`);\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 CompactStarRatingProps = Omit<\n React.ComponentPropsWithoutRef<typeof S.CompactStarRating>,\n keyof CompactStarRatingOwnProps\n> &\n CompactStarRatingOwnProps;\n\n/**\n * A compact star rating.\n *\n * To remove a rating (i.e. show 0 stars), click the first star to give a 1-star rating, and then click the first star again.\n *\n * ### Import\n *\n * ``` js\n * import { CompactStarRating } from '@ntbjs/react-components/inputs'\n * // or\n * import CompactStarRating from '@ntbjs/react-components/inputs/CompactStarRating'\n * ```\n * ### Values\n * Pass default value as a prop (`defaultValue`) into the component: 0 or state value.\n * ```\n */\n\nconst CompactStarRating = React.forwardRef<any, CompactStarRatingProps>(function CompactStarRating(\n {\n label = 'Rating',\n icon = DEFAULT_ICON,\n iconFill = DEFAULT_ICON_FILL,\n max = 5,\n defaultValue = 0,\n value = 0,\n name,\n viewEmpty = true,\n onChange = NOOP,\n onBlur,\n type = '',\n descriptionToolTip = '',\n disabled,\n readOnly,\n edit,\n hidden = false,\n loadingIcon,\n successIcon,\n ...props\n },\n forwardedRef\n) {\n const stars = Array.from(Array(max).keys());\n /*\n * NMB-3998: these three are numeric states initialised to `''`. Every write is a number\n * — `value || defaultValue` (both props are `number`, defaulted to 0), `key + 1`, and\n * `0` — so inference from `''` alone made the setters `SetStateAction<string>` and\n * rejected all of them (4 x TS2345, plus TS2367 on `current === 1`).\n *\n * `number | ''` is EXACTLY what the code does today, so this is a pure annotation: the\n * initial value is still `''` and the emitted JavaScript is unchanged. `useState(0)` is\n * what the state *should* probably be, and is deliberately NOT done here — the first\n * render feeds `String(rating)` into the input's value (line ~154), so `''` -> `'0'` is a\n * visible change, and it belongs with the rest of this component in the §D tail rather\n * than in a commit that must not move the baseline.\n */\n const [rating, setRating] = useState<number | ''>('');\n const [hover, setHover] = useState(false);\n const [tempRating, setTempRating] = useState<number | ''>('');\n const [initialRating, setInitialRating] = useState<number | ''>('');\n const inputRef = useRef(undefined);\n\n useEffect(() => {\n setRating(value || defaultValue);\n setInitialRating(value || defaultValue);\n }, [value, defaultValue]);\n\n useEffect(() => {\n inputRef.current.value = String(rating);\n if (rating === initialRating) {\n return undefined;\n } else {\n setInitialRating(rating);\n onChange({ target: inputRef.current });\n }\n }, [rating]);\n\n const memoizedDescriptionToolTip = useMemo(() => {\n return descriptionToolTip;\n }, [descriptionToolTip]);\n\n const starIconRender = key => {\n if (rating > 0 && rating >= key + 1) {\n return (\n <S.StarFill\n readOnly={readOnly}\n disabled={disabled}\n onClick={event => {\n event.preventDefault();\n if (key + 1 > 1) {\n return setRating(key + 1);\n } else if (key + 1 == 1) {\n setRating(current => {\n return current === 1 ? 0 : key + 1;\n });\n }\n }}\n onMouseEnter={() => {\n setTempRating(key + 1);\n setHover(true);\n }}\n onMouseLeave={() => {\n setTempRating(0);\n setHover(false);\n }}\n $hover={hover && key + 1 <= tempRating}\n type=\"button\"\n key={key}\n >\n {iconFill}\n </S.StarFill>\n );\n } else if (viewEmpty) {\n return (\n <S.Star\n readOnly={readOnly}\n disabled={disabled}\n onClick={event => {\n event.preventDefault();\n setRating(key + 1);\n }}\n onMouseEnter={() => {\n setTempRating(key + 1);\n setHover(true);\n }}\n onMouseLeave={() => {\n setTempRating(0);\n setHover(false);\n }}\n $hover={hover && key + 1 <= tempRating}\n type=\"button\"\n key={key}\n >\n {icon}\n </S.Star>\n );\n }\n };\n\n const input = () => {\n return (\n <S.CompactStarRating\n ref={forwardedRef}\n readOnly={readOnly}\n disabled={disabled}\n onChange={onChange}\n onBlur={onBlur}\n {...props}\n >\n <S.labelWidth disabled={disabled}>\n {label}\n <S.SuccessContainer>\n {type === 'loading' && loadingIcon}\n {type === 'success' && successIcon}\n </S.SuccessContainer>\n </S.labelWidth>\n <S.starsWidth $edit={edit} type={type} readOnly={readOnly}>\n {stars.map(key => {\n return (\n <div key={key}>\n <input type=\"number\" name={name} ref={inputRef} />\n {/*\n * NMB-3998: was `starIconRender(key, value)`. `starIconRender` is declared\n * `key => …` and takes ONE parameter, so `value` was evaluated and\n * discarded — TS2554 \"Expected 1 arguments, but got 2\". Dropping it is\n * behaviour-identical (the callee never had a binding for it, and reads\n * the `value` prop from the enclosing scope anyway), so this emits the\n * same DOM. Passing it looked like it made the star fill track `value`,\n * which is what makes it worth recording rather than quietly deleting.\n */}\n {starIconRender(key)}\n </div>\n );\n })}\n </S.starsWidth>\n </S.CompactStarRating>\n );\n };\n\n if (hidden) return null;\n\n return (\n <>\n {!memoizedDescriptionToolTip && input()}\n {memoizedDescriptionToolTip && (\n <div>\n <Tooltip\n content={memoizedDescriptionToolTip}\n key=\"tooltipTextArea1\"\n placement=\"bottom-end\"\n trigger={'mouseenter'}\n zIndex={999999}\n >\n {input()}\n </Tooltip>\n </div>\n )}\n </>\n );\n});\n\nexport default CompactStarRating;\n"],"names":["NOOP","DEFAULT_ICON","_jsx","StarIcon","DEFAULT_ICON_FILL","StarIconFill","CompactStarRating","React","forwardRef","label","icon","iconFill","max","defaultValue","value","name","viewEmpty","onChange","onBlur","type","descriptionToolTip","disabled","readOnly","edit","hidden","loadingIcon","successIcon","props","forwardedRef","stars","Array","from","keys","rating","setRating","useState","hover","setHover","tempRating","setTempRating","initialRating","setInitialRating","inputRef","useRef","undefined","useEffect","current","String","target","memoizedDescriptionToolTip","useMemo","starIconRender","key","S","onClick","event","preventDefault","onMouseEnter","onMouseLeave","$hover","children","input","_jsxs","ref","$edit","map","_Fragment","Tooltip","content","placement","trigger","zIndex"],"mappings":";;;;;;;;;;;;;;AAOA,MAAMA,IAAI,GAAGA,MAAM,CAAC,CAAC;AACrB,MAAMC,YAAY,GAAGC,GAAA,CAACC,OAAQ,IAAE,CAAC;AACjC,MAAMC,iBAAiB,GAAGF,GAAA,CAACG,aAAY,IAAE,CAAC;AA2G1C,MAAMC,iBAAiB,GAAGC,cAAK,CAACC,UAAU,CAA8B,SAASF,iBAAiBA,CAChG;AACEG,EAAAA,KAAK,GAAG,QAAQ;AAChBC,EAAAA,IAAI,GAAGT,YAAY;AACnBU,EAAAA,QAAQ,GAAGP,iBAAiB;AAC5BQ,EAAAA,GAAG,GAAG,CAAC;AACPC,EAAAA,YAAY,GAAG,CAAC;AAChBC,EAAAA,KAAK,GAAG,CAAC;EACTC,IAAI;AACJC,EAAAA,SAAS,GAAG,IAAI;AAChBC,EAAAA,QAAQ,GAAGjB,IAAI;EACfkB,MAAM;AACNC,EAAAA,IAAI,GAAG,EAAE;AACTC,EAAAA,kBAAkB,GAAG,EAAE;EACvBC,QAAQ;EACRC,QAAQ;EACRC,IAAI;AACJC,EAAAA,MAAM,GAAG,KAAK;EACdC,WAAW;EACXC,WAAW;EACX,GAAGC;AACL,CAAC,EACDC,YAAY,EACZ;AACA,EAAA,MAAMC,KAAK,GAAGC,KAAK,CAACC,IAAI,CAACD,KAAK,CAAClB,GAAG,CAAC,CAACoB,IAAI,EAAE,CAAC;EAc3C,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGC,QAAQ,CAAc,EAAE,CAAC;EACrD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGF,QAAQ,CAAC,KAAK,CAAC;EACzC,MAAM,CAACG,UAAU,EAAEC,aAAa,CAAC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