@ohif/ui-next 3.14.0-beta.97 → 3.14.0-beta.99
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/dist/ohif-ui-next.umd.js +4 -1925
- package/package.json +18 -7
- package/src/__mocks__/fileMock.js +7 -0
- package/src/assets/fonts.css +50 -0
- package/src/assets/styles.css +55 -0
- package/src/assets/woff2/latin.woff2 +0 -0
- package/src/components/Accordion/Accordion.tsx +70 -0
- package/src/components/Accordion/index.ts +3 -0
- package/src/components/AllInOneMenu/BackItem.tsx +32 -0
- package/src/components/AllInOneMenu/DividerItem.tsx +11 -0
- package/src/components/AllInOneMenu/HeaderItem.tsx +15 -0
- package/src/components/AllInOneMenu/IconMenu.tsx +83 -0
- package/src/components/AllInOneMenu/Item.tsx +51 -0
- package/src/components/AllInOneMenu/ItemPanel.tsx +38 -0
- package/src/components/AllInOneMenu/Menu.tsx +231 -0
- package/src/components/AllInOneMenu/PanelSelector.tsx +32 -0
- package/src/components/AllInOneMenu/SubMenu.tsx +36 -0
- package/src/components/AllInOneMenu/index.ts +42 -0
- package/src/components/BackgroundColorSelect/BackgroundColorSelect.tsx +38 -0
- package/src/components/BackgroundColorSelect/index.tsx +1 -0
- package/src/components/Badge/Badge.tsx +38 -0
- package/src/components/Badge/index.ts +1 -0
- package/src/components/Button/Button.tsx +65 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Calendar/Calendar.tsx +258 -0
- package/src/components/Calendar/index.tsx +3 -0
- package/src/components/Card/Card.tsx +83 -0
- package/src/components/Card/index.ts +2 -0
- package/src/components/Checkbox/Checkbox.tsx +27 -0
- package/src/components/Checkbox/index.tsx +3 -0
- package/src/components/CinePlayer/CinePlayer.tsx +187 -0
- package/src/components/CinePlayer/index.ts +5 -0
- package/src/components/Clipboard/Clipboard.tsx +58 -0
- package/src/components/Clipboard/index.tsx +3 -0
- package/src/components/ColorCircle.tsx +12 -0
- package/src/components/Combobox/Combobox.tsx +66 -0
- package/src/components/Combobox/index.ts +3 -0
- package/src/components/Command/Command.tsx +149 -0
- package/src/components/Command/index.ts +23 -0
- package/src/components/ContextMenu/ContextMenu.tsx +202 -0
- package/src/components/ContextMenu/index.ts +35 -0
- package/src/components/ContextMenuViewport/ContextMenuViewport.tsx +47 -0
- package/src/components/ContextMenuViewport/index.ts +1 -0
- package/src/components/DataRow/DataRow.tsx +532 -0
- package/src/components/DataRow/index.ts +1 -0
- package/src/components/DataRow/types.ts +31 -0
- package/src/components/DataTable/ActionOverlayCell.tsx +153 -0
- package/src/components/DataTable/ColumnHeader.tsx +70 -0
- package/src/components/DataTable/DataTable.tsx +532 -0
- package/src/components/DataTable/FilterRow.tsx +52 -0
- package/src/components/DataTable/Pagination.tsx +78 -0
- package/src/components/DataTable/Title.tsx +5 -0
- package/src/components/DataTable/Toolbar.tsx +5 -0
- package/src/components/DataTable/ViewOptions.tsx +86 -0
- package/src/components/DataTable/context.tsx +21 -0
- package/src/components/DataTable/index.ts +5 -0
- package/src/components/DataTable/types.ts +27 -0
- package/src/components/DataTable/useResponsiveColumns.tsx +346 -0
- package/src/components/DateRange/DateRange.tsx +163 -0
- package/src/components/DateRange/index.ts +3 -0
- package/src/components/Dialog/Dialog.tsx +201 -0
- package/src/components/Dialog/index.ts +25 -0
- package/src/components/Dialog/useDraggable.ts +108 -0
- package/src/components/DisplaySetMessageListTooltip/DisplaySetMessageListTooltip.tsx +64 -0
- package/src/components/DisplaySetMessageListTooltip/index.ts +3 -0
- package/src/components/DoubleSlider/DoubleSlider.test.ts +232 -0
- package/src/components/DoubleSlider/DoubleSlider.tsx +211 -0
- package/src/components/DoubleSlider/index.tsx +3 -0
- package/src/components/DropdownMenu/DropdownMenu.tsx +213 -0
- package/src/components/DropdownMenu/index.ts +35 -0
- package/src/components/Errorboundary/ErrorBoundary.tsx +345 -0
- package/src/components/Errorboundary/index.tsx +3 -0
- package/src/components/FooterAction/FooterAction.tsx +115 -0
- package/src/components/FooterAction/index.tsx +3 -0
- package/src/components/Header/Header.tsx +140 -0
- package/src/components/Header/index.js +2 -0
- package/src/components/HoverCard/HoverCard.tsx +30 -0
- package/src/components/HoverCard/index.ts +1 -0
- package/src/components/Icons/Icons.tsx +852 -0
- package/src/components/Icons/Sources/ActionNewDialog.tsx +64 -0
- package/src/components/Icons/Sources/Actions.tsx +47 -0
- package/src/components/Icons/Sources/Add.tsx +51 -0
- package/src/components/Icons/Sources/Alert.tsx +32 -0
- package/src/components/Icons/Sources/AlertOutline.tsx +30 -0
- package/src/components/Icons/Sources/ArrowLeftBold.tsx +49 -0
- package/src/components/Icons/Sources/ArrowRight.tsx +25 -0
- package/src/components/Icons/Sources/Cancel.tsx +37 -0
- package/src/components/Icons/Sources/CheckBoxChecked.tsx +39 -0
- package/src/components/Icons/Sources/CheckBoxUnChecked.tsx +25 -0
- package/src/components/Icons/Sources/Checked.tsx +23 -0
- package/src/components/Icons/Sources/ChevronClosed.tsx +40 -0
- package/src/components/Icons/Sources/ChevronLeft.tsx +28 -0
- package/src/components/Icons/Sources/ChevronOpen.tsx +38 -0
- package/src/components/Icons/Sources/Clear.tsx +34 -0
- package/src/components/Icons/Sources/Clipboard.tsx +15 -0
- package/src/components/Icons/Sources/Close.tsx +28 -0
- package/src/components/Icons/Sources/CloudSettings.tsx +34 -0
- package/src/components/Icons/Sources/Code.tsx +7 -0
- package/src/components/Icons/Sources/ColorChange.tsx +100 -0
- package/src/components/Icons/Sources/ContentNext.tsx +35 -0
- package/src/components/Icons/Sources/ContentPrev.tsx +35 -0
- package/src/components/Icons/Sources/Controls.tsx +99 -0
- package/src/components/Icons/Sources/Copy.tsx +44 -0
- package/src/components/Icons/Sources/Database.tsx +33 -0
- package/src/components/Icons/Sources/Delete.tsx +58 -0
- package/src/components/Icons/Sources/DicomTagBrowser.tsx +79 -0
- package/src/components/Icons/Sources/DisplayFillAndOutline.tsx +49 -0
- package/src/components/Icons/Sources/DisplayFillOnly.tsx +40 -0
- package/src/components/Icons/Sources/DisplayOutlineOnly.tsx +40 -0
- package/src/components/Icons/Sources/Download.tsx +75 -0
- package/src/components/Icons/Sources/Export.tsx +53 -0
- package/src/components/Icons/Sources/ExternalLink.tsx +26 -0
- package/src/components/Icons/Sources/EyeHidden.tsx +32 -0
- package/src/components/Icons/Sources/EyeVisible.tsx +28 -0
- package/src/components/Icons/Sources/FeedbackComplete.tsx +35 -0
- package/src/components/Icons/Sources/GearSettings.tsx +59 -0
- package/src/components/Icons/Sources/GroupLayers.tsx +33 -0
- package/src/components/Icons/Sources/Helpers.tsx +398 -0
- package/src/components/Icons/Sources/Hide.tsx +45 -0
- package/src/components/Icons/Sources/IconColorLUT.tsx +103 -0
- package/src/components/Icons/Sources/IconMPR.tsx +55 -0
- package/src/components/Icons/Sources/IconTransferring.tsx +25 -0
- package/src/components/Icons/Sources/IllustrationNotFound.tsx +102 -0
- package/src/components/Icons/Sources/Info.tsx +55 -0
- package/src/components/Icons/Sources/InfoLink.tsx +23 -0
- package/src/components/Icons/Sources/InfoSeries.tsx +52 -0
- package/src/components/Icons/Sources/InvestigationalUse.tsx +82 -0
- package/src/components/Icons/Sources/JumpToSlice.tsx +69 -0
- package/src/components/Icons/Sources/LaunchArrow.tsx +34 -0
- package/src/components/Icons/Sources/LaunchInfo.tsx +38 -0
- package/src/components/Icons/Sources/LayerBackground.tsx +28 -0
- package/src/components/Icons/Sources/LayerForeground.tsx +34 -0
- package/src/components/Icons/Sources/LayerSegmentation.tsx +20 -0
- package/src/components/Icons/Sources/Layout.tsx +433 -0
- package/src/components/Icons/Sources/Link.tsx +58 -0
- package/src/components/Icons/Sources/ListView.tsx +79 -0
- package/src/components/Icons/Sources/LoadingOHIFMark.tsx +21 -0
- package/src/components/Icons/Sources/LoadingSpinner.tsx +49 -0
- package/src/components/Icons/Sources/Lock.tsx +35 -0
- package/src/components/Icons/Sources/Magnifier.tsx +37 -0
- package/src/components/Icons/Sources/Minus.tsx +40 -0
- package/src/components/Icons/Sources/MissingIcon.tsx +6 -0
- package/src/components/Icons/Sources/More.tsx +53 -0
- package/src/components/Icons/Sources/MultiplePatients.tsx +76 -0
- package/src/components/Icons/Sources/NavigationPanelReveal.tsx +25 -0
- package/src/components/Icons/Sources/NotificationInfo.tsx +33 -0
- package/src/components/Icons/Sources/NotificationWarning.tsx +44 -0
- package/src/components/Icons/Sources/OHIFLogo.tsx +72 -0
- package/src/components/Icons/Sources/OHIFLogoColorDarkBackground.tsx +78 -0
- package/src/components/Icons/Sources/OHIFLogoHorizontal.tsx +139 -0
- package/src/components/Icons/Sources/Opacity.tsx +106 -0
- package/src/components/Icons/Sources/OrientationSwitch.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchA.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchC.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchR.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchS.tsx +41 -0
- package/src/components/Icons/Sources/PanelRight.tsx +29 -0
- package/src/components/Icons/Sources/Patient.tsx +58 -0
- package/src/components/Icons/Sources/PatientStudyList.tsx +62 -0
- package/src/components/Icons/Sources/Pause.tsx +26 -0
- package/src/components/Icons/Sources/Pencil.tsx +16 -0
- package/src/components/Icons/Sources/Pin.tsx +50 -0
- package/src/components/Icons/Sources/PinFill.tsx +51 -0
- package/src/components/Icons/Sources/Play.tsx +25 -0
- package/src/components/Icons/Sources/Plus.tsx +29 -0
- package/src/components/Icons/Sources/PowerOff.tsx +19 -0
- package/src/components/Icons/Sources/Redo.tsx +51 -0
- package/src/components/Icons/Sources/Refresh.tsx +42 -0
- package/src/components/Icons/Sources/Rename.tsx +50 -0
- package/src/components/Icons/Sources/Search.tsx +35 -0
- package/src/components/Icons/Sources/SegActions.tsx +594 -0
- package/src/components/Icons/Sources/Series.tsx +47 -0
- package/src/components/Icons/Sources/SeriesPlaceholder.tsx +40 -0
- package/src/components/Icons/Sources/Settings.tsx +105 -0
- package/src/components/Icons/Sources/SettingsStudyList.tsx +28 -0
- package/src/components/Icons/Sources/Show.tsx +67 -0
- package/src/components/Icons/Sources/SidePanelCloseLeft.tsx +75 -0
- package/src/components/Icons/Sources/SidePanelCloseRight.tsx +74 -0
- package/src/components/Icons/Sources/SocialGithub.tsx +39 -0
- package/src/components/Icons/Sources/Sorting.tsx +39 -0
- package/src/components/Icons/Sources/SortingAscending.tsx +28 -0
- package/src/components/Icons/Sources/SortingDescending.tsx +26 -0
- package/src/components/Icons/Sources/SortingNew.tsx +20 -0
- package/src/components/Icons/Sources/SortingNewAscending.tsx +35 -0
- package/src/components/Icons/Sources/SortingNewDescending.tsx +35 -0
- package/src/components/Icons/Sources/StatusAlert.tsx +36 -0
- package/src/components/Icons/Sources/StatusError.tsx +57 -0
- package/src/components/Icons/Sources/StatusLocked.tsx +35 -0
- package/src/components/Icons/Sources/StatusSuccess.tsx +45 -0
- package/src/components/Icons/Sources/StatusTracking.tsx +37 -0
- package/src/components/Icons/Sources/StatusUntracked.tsx +30 -0
- package/src/components/Icons/Sources/StatusWarning.tsx +58 -0
- package/src/components/Icons/Sources/Tab4D.tsx +54 -0
- package/src/components/Icons/Sources/TabContours.tsx +63 -0
- package/src/components/Icons/Sources/TabLinear.tsx +47 -0
- package/src/components/Icons/Sources/TabPatientInfo.tsx +33 -0
- package/src/components/Icons/Sources/TabRoiThreshold.tsx +38 -0
- package/src/components/Icons/Sources/TabSegmentation.tsx +38 -0
- package/src/components/Icons/Sources/TabStudies.tsx +62 -0
- package/src/components/Icons/Sources/Threshold.tsx +38 -0
- package/src/components/Icons/Sources/ThumbnailView.tsx +67 -0
- package/src/components/Icons/Sources/Tools.tsx +3659 -0
- package/src/components/Icons/Sources/Trash.tsx +17 -0
- package/src/components/Icons/Sources/Undo.tsx +51 -0
- package/src/components/Icons/Sources/Upload.tsx +29 -0
- package/src/components/Icons/Sources/ViewportViews.tsx +45 -0
- package/src/components/Icons/Sources/ViewportWindowLevel.tsx +58 -0
- package/src/components/Icons/Sources/WindowLevelAdvanced.tsx +30 -0
- package/src/components/Icons/index.ts +4 -0
- package/src/components/Icons/types.ts +3 -0
- package/src/components/Input/Input.tsx +25 -0
- package/src/components/Input/index.tsx +3 -0
- package/src/components/InputFilter/InputFilter.tsx +200 -0
- package/src/components/InputFilter/index.ts +2 -0
- package/src/components/InputMultiSelect/InputMultiSelect.tsx +370 -0
- package/src/components/InputMultiSelect/index.ts +1 -0
- package/src/components/InputNumber/InputNumber.tsx +439 -0
- package/src/components/InputNumber/index.ts +3 -0
- package/src/components/InvestigationalUseDialog/InvestigationalUseDialog.tsx +98 -0
- package/src/components/InvestigationalUseDialog/index.ts +3 -0
- package/src/components/Label/Label.tsx +24 -0
- package/src/components/Label/index.tsx +3 -0
- package/src/components/Labelling/LabellingFlow.tsx +92 -0
- package/src/components/Labelling/index.ts +2 -0
- package/src/components/LayoutSelector/LayoutSelector.tsx +345 -0
- package/src/components/LayoutSelector/index.ts +4 -0
- package/src/components/LineChart/LineChart.css +40 -0
- package/src/components/LineChart/LineChart.tsx +101 -0
- package/src/components/LineChart/d3LineChart/chart.ts +365 -0
- package/src/components/LineChart/d3LineChart/events.ts +149 -0
- package/src/components/LineChart/d3LineChart/index.ts +3 -0
- package/src/components/LineChart/d3LineChart/lineChart.ts +272 -0
- package/src/components/LineChart/index.ts +1 -0
- package/src/components/LoadingIndicatorProgress/LoadingIndicatorProgress.tsx +29 -0
- package/src/components/LoadingIndicatorProgress/index.ts +2 -0
- package/src/components/LoadingIndicatorTotalPercent/LoadingIndicatorTotalPercent.tsx +49 -0
- package/src/components/LoadingIndicatorTotalPercent/index.ts +2 -0
- package/src/components/MeasurementTable/MeasurementTable.tsx +144 -0
- package/src/components/MeasurementTable/index.js +3 -0
- package/src/components/Modal/Modal.tsx +44 -0
- package/src/components/NavBar/NavBar.tsx +32 -0
- package/src/components/NavBar/index.js +2 -0
- package/src/components/Numeric/Numeric.test.ts +124 -0
- package/src/components/Numeric/Numeric.tsx +576 -0
- package/src/components/Numeric/index.ts +3 -0
- package/src/components/OHIFDialogs/InputDialog.tsx +287 -0
- package/src/components/OHIFDialogs/PresetDialog.tsx +106 -0
- package/src/components/OHIFDialogs/index.ts +2 -0
- package/src/components/OHIFModals/AboutModal.tsx +114 -0
- package/src/components/OHIFModals/AppearanceModal.tsx +38 -0
- package/src/components/OHIFModals/ImageModal.tsx +251 -0
- package/src/components/OHIFModals/UserPreferencesModal.tsx +229 -0
- package/src/components/OHIFModals/index.ts +4 -0
- package/src/components/OHIFPanels/WindowLevel.tsx +162 -0
- package/src/components/OHIFPanels/WindowLevelHistogram.tsx +237 -0
- package/src/components/OHIFPanels/index.ts +3 -0
- package/src/components/OHIFPanels/types.ts +41 -0
- package/src/components/OHIFToolSettings/RowDoubleRange.tsx +67 -0
- package/src/components/OHIFToolSettings/RowInputRange.tsx +65 -0
- package/src/components/OHIFToolSettings/RowSegmentedControl.tsx +77 -0
- package/src/components/OHIFToolSettings/ToolSettings.tsx +253 -0
- package/src/components/OHIFToolSettings/index.ts +1 -0
- package/src/components/OHIFToolbox/ToolboxUI.tsx +104 -0
- package/src/components/OHIFToolbox/index.ts +1 -0
- package/src/components/Onboarding/Onboarding.css +48 -0
- package/src/components/Onboarding/Onboarding.tsx +58 -0
- package/src/components/Onboarding/index.ts +3 -0
- package/src/components/Onboarding/utilities.ts +91 -0
- package/src/components/PanelSection/PanelSection.tsx +70 -0
- package/src/components/PanelSection/index.ts +2 -0
- package/src/components/Popover/Popover.tsx +35 -0
- package/src/components/Popover/index.ts +3 -0
- package/src/components/ProgressDropdown/ProgressDiscreteBar.tsx +24 -0
- package/src/components/ProgressDropdown/ProgressDropdown.tsx +158 -0
- package/src/components/ProgressDropdown/ProgressItem.tsx +27 -0
- package/src/components/ProgressDropdown/ProgressItemDetail.tsx +89 -0
- package/src/components/ProgressDropdown/index.ts +1 -0
- package/src/components/ProgressDropdown/types.ts +9 -0
- package/src/components/ProgressLoadingBar/ProgressLoadingBar.css +26 -0
- package/src/components/ProgressLoadingBar/ProgressLoadingBar.tsx +32 -0
- package/src/components/ProgressLoadingBar/index.ts +2 -0
- package/src/components/Resizable/Resizable.tsx +43 -0
- package/src/components/Resizable/index.ts +3 -0
- package/src/components/ScrollArea/ScrollArea.tsx +127 -0
- package/src/components/ScrollArea/index.tsx +3 -0
- package/src/components/SegmentationTable/AddSegmentRow.tsx +78 -0
- package/src/components/SegmentationTable/AddSegmentationRow.tsx +56 -0
- package/src/components/SegmentationTable/SegmentStatistics.tsx +104 -0
- package/src/components/SegmentationTable/SegmentationCollapsed.tsx +211 -0
- package/src/components/SegmentationTable/SegmentationExpanded.tsx +173 -0
- package/src/components/SegmentationTable/SegmentationHeader.tsx +58 -0
- package/src/components/SegmentationTable/SegmentationLabel.tsx +27 -0
- package/src/components/SegmentationTable/SegmentationSegments.tsx +206 -0
- package/src/components/SegmentationTable/SegmentationTable.tsx +169 -0
- package/src/components/SegmentationTable/SegmentationTableConfig.tsx +194 -0
- package/src/components/SegmentationTable/contexts/SegmentStatisticsContext.tsx +45 -0
- package/src/components/SegmentationTable/contexts/SegmentationExpandedContext.tsx +45 -0
- package/src/components/SegmentationTable/contexts/SegmentationTableContext.tsx +148 -0
- package/src/components/SegmentationTable/contexts/index.ts +15 -0
- package/src/components/SegmentationTable/index.ts +24 -0
- package/src/components/Select/Select.tsx +167 -0
- package/src/components/Select/index.tsx +40 -0
- package/src/components/Separator/Separator.tsx +32 -0
- package/src/components/Separator/index.ts +3 -0
- package/src/components/Separator/index.tsx +3 -0
- package/src/components/SidePanel/SidePanel.tsx +479 -0
- package/src/components/SidePanel/index.ts +2 -0
- package/src/components/Slider/Slider.tsx +24 -0
- package/src/components/Slider/index.tsx +3 -0
- package/src/components/SmartScrollbar/SmartScrollbar.tsx +349 -0
- package/src/components/SmartScrollbar/SmartScrollbarEndpoints.tsx +82 -0
- package/src/components/SmartScrollbar/SmartScrollbarFill.tsx +54 -0
- package/src/components/SmartScrollbar/SmartScrollbarIndicator.tsx +59 -0
- package/src/components/SmartScrollbar/SmartScrollbarTrack.tsx +104 -0
- package/src/components/SmartScrollbar/defaultSmartScrollbarIndicatorConfig.tsx +48 -0
- package/src/components/SmartScrollbar/index.ts +11 -0
- package/src/components/SmartScrollbar/useByteArray.ts +146 -0
- package/src/components/SmartScrollbar/utils.test.ts +124 -0
- package/src/components/SmartScrollbar/utils.ts +168 -0
- package/src/components/Sonner/Sonner.tsx +31 -0
- package/src/components/Sonner/index.ts +4 -0
- package/src/components/StudyBrowser/StudyBrowser.tsx +89 -0
- package/src/components/StudyBrowser/index.ts +2 -0
- package/src/components/StudyBrowserSort/StudyBrowserSort.tsx +87 -0
- package/src/components/StudyBrowserSort/index.ts +3 -0
- package/src/components/StudyBrowserViewOptions/StudyBrowserViewOptions.tsx +50 -0
- package/src/components/StudyBrowserViewOptions/index.ts +3 -0
- package/src/components/StudyItem/StudyItem.tsx +100 -0
- package/src/components/StudyItem/index.ts +2 -0
- package/src/components/StudyList/columns/defaultColumns.tsx +258 -0
- package/src/components/StudyList/components/ActionCell.tsx +19 -0
- package/src/components/StudyList/components/Layout.tsx +206 -0
- package/src/components/StudyList/components/PreviewContainer.tsx +45 -0
- package/src/components/StudyList/components/PreviewContent.tsx +186 -0
- package/src/components/StudyList/components/PreviewHeader.tsx +5 -0
- package/src/components/StudyList/components/PreviewPatientSummary.tsx +224 -0
- package/src/components/StudyList/components/PreviewSeriesList.tsx +64 -0
- package/src/components/StudyList/components/PreviewToggleButton.tsx +69 -0
- package/src/components/StudyList/components/SettingsPopover.tsx +214 -0
- package/src/components/StudyList/components/Table.tsx +247 -0
- package/src/components/StudyList/components/WorkflowMenu.tsx +72 -0
- package/src/components/StudyList/components/WorkflowsProvider.tsx +169 -0
- package/src/components/StudyList/hooks/useDefaultWorkflow.ts +60 -0
- package/src/components/StudyList/index.ts +52 -0
- package/src/components/StudyList/types/types.ts +42 -0
- package/src/components/StudyList/utils/tokenizeModalities.ts +6 -0
- package/src/components/StudySummary/StudySummary.tsx +27 -0
- package/src/components/StudySummary/index.tsx +3 -0
- package/src/components/Switch/Switch.tsx +28 -0
- package/src/components/Switch/index.tsx +3 -0
- package/src/components/Table/Table.tsx +134 -0
- package/src/components/Table/index.ts +11 -0
- package/src/components/Tabs/Tabs.tsx +56 -0
- package/src/components/Tabs/index.ts +3 -0
- package/src/components/Tabs/index.tsx +3 -0
- package/src/components/ThemeWrapper/ThemeWrapper.tsx +5 -0
- package/src/components/ThemeWrapper/index.ts +1 -0
- package/src/components/Thumbnail/Thumbnail.test.ts +71 -0
- package/src/components/Thumbnail/Thumbnail.tsx +351 -0
- package/src/components/Thumbnail/index.ts +2 -0
- package/src/components/ThumbnailList/ThumbnailList.tsx +94 -0
- package/src/components/ThumbnailList/index.ts +2 -0
- package/src/components/Toggle/Toggle.tsx +45 -0
- package/src/components/Toggle/index.ts +3 -0
- package/src/components/Toggle/index.tsx +3 -0
- package/src/components/ToggleGroup/ToggleGroup.tsx +63 -0
- package/src/components/ToggleGroup/index.ts +3 -0
- package/src/components/ToolButton/ToolButton.tsx +134 -0
- package/src/components/ToolButton/ToolButtonList.tsx +243 -0
- package/src/components/ToolButton/index.ts +8 -0
- package/src/components/Tooltip/Tooltip.tsx +34 -0
- package/src/components/Tooltip/index.ts +3 -0
- package/src/components/Viewport/ImageScrollbar.module.css +89 -0
- package/src/components/Viewport/ImageScrollbar.tsx +71 -0
- package/src/components/Viewport/PatientInfo.tsx +126 -0
- package/src/components/Viewport/ViewportActionArrows.tsx +36 -0
- package/src/components/Viewport/ViewportActionBar.tsx +107 -0
- package/src/components/Viewport/ViewportActionButton.tsx +25 -0
- package/src/components/Viewport/ViewportActionCorners.tsx +171 -0
- package/src/components/Viewport/ViewportGrid.tsx +24 -0
- package/src/components/Viewport/ViewportOverlay.css +32 -0
- package/src/components/Viewport/ViewportOverlay.tsx +54 -0
- package/src/components/Viewport/ViewportPane.tsx +82 -0
- package/src/components/Viewport/index.ts +9 -0
- package/src/components/ViewportDialog/ViewportDialog.tsx +128 -0
- package/src/components/ViewportDialog/index.ts +2 -0
- package/src/components/index.ts +323 -0
- package/src/contextProviders/ActiveThemeProvider.tsx +204 -0
- package/src/contextProviders/CineProvider.tsx +98 -0
- package/src/contextProviders/DialogProvider.tsx +103 -0
- package/src/contextProviders/DragAndDropProvider.tsx +37 -0
- package/src/contextProviders/IconPresentationProvider.tsx +88 -0
- package/src/contextProviders/ImageViewerProvider.tsx +15 -0
- package/src/contextProviders/ManagedDialog.tsx +176 -0
- package/src/contextProviders/ModalProvider.tsx +102 -0
- package/src/contextProviders/NotificationProvider.tsx +246 -0
- package/src/contextProviders/UserAuthenticationProvider.tsx +118 -0
- package/src/contextProviders/ViewportDialogProvider.tsx +42 -0
- package/src/contextProviders/ViewportGridProvider.tsx +556 -0
- package/src/contextProviders/index.ts +26 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useDynamicMaxHeight.ts +105 -0
- package/src/hooks/useSessionStorage.test.js +103 -0
- package/src/hooks/useSessionStorage.tsx +71 -0
- package/src/index.ts +7 -0
- package/src/lib/utils.ts +6 -0
- package/src/tailwind.css +266 -0
- package/src/themes/arctic.json +31 -0
- package/src/themes/deep.json +31 -0
- package/src/themes/index.ts +16 -0
- package/src/themes/midnight.json +31 -0
- package/src/themes/orchid.json +31 -0
- package/src/themes/slate.json +31 -0
- package/src/themes/themes.css +206 -0
- package/src/themes/verdant.json +31 -0
- package/src/types/ActionCorners.ts +18 -0
- package/src/types/AppTypes.ts +24 -0
- package/src/types/ContextMenuItem.ts +9 -0
- package/src/types/Predicate.ts +1 -0
- package/src/types/ThumbnailType.ts +3 -0
- package/src/types/ViewportActionCornersTypes.ts +13 -0
- package/src/types/global.d.ts +4 -0
- package/src/types/index.ts +21 -0
- package/src/utils/formatDICOMDate.test.ts +61 -0
- package/src/utils/formatDICOMDate.ts +65 -0
- package/src/utils/formatDICOMTime.test.ts +62 -0
- package/src/utils/formatDICOMTime.ts +49 -0
- package/src/utils/getToggledClassName.tsx +5 -0
- package/src/utils/index.ts +15 -0
- package/src/utils/parseStudyDateTimestamp.test.ts +47 -0
- package/src/utils/parseStudyDateTimestamp.ts +27 -0
- package/src/utils/roundNumber.ts +43 -0
- package/tailwind.config.js +120 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import React, { createContext, ReactNode, useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import DividerItem from './DividerItem';
|
|
4
|
+
import PanelSelector from './PanelSelector';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import BackItem from './BackItem';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The vertical direction that the menu will be opened/used with.
|
|
10
|
+
*
|
|
11
|
+
* A TopToBottom menu would be used for cases where the menu is opened "near"
|
|
12
|
+
* the top edge of its container. Likewise a BottomToTop menu would be used
|
|
13
|
+
* for cases where the menu is opened "near" the bottom edge of its container.
|
|
14
|
+
*
|
|
15
|
+
* See IconMenu for more information.
|
|
16
|
+
*/
|
|
17
|
+
export enum VerticalDirection {
|
|
18
|
+
TopToBottom,
|
|
19
|
+
BottomToTop,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The horizontal direction that the menu is opened/used with.
|
|
24
|
+
* This direction dictates the general direction sub-menus and
|
|
25
|
+
* back-to-menus are opened with. For example, a RightToLeft menu
|
|
26
|
+
* will have sub-menu items indicated with a left pointing chevron
|
|
27
|
+
* and aligned with the left edge of the menu. Similarly back-to items of a
|
|
28
|
+
* RightToLeft menu are indicated with a right pointing chevron and
|
|
29
|
+
* aligned with the right edge of the menu.
|
|
30
|
+
*
|
|
31
|
+
* It is also worth noting that a LeftToRight menu would be used for
|
|
32
|
+
* cases where a menu is opened "near" the left edge of its container.
|
|
33
|
+
* Likewise, a RightToLeft menu would be used for cases where a menu is opened
|
|
34
|
+
* "near" the right edge of its container.
|
|
35
|
+
*
|
|
36
|
+
* See IconMenu for more information.
|
|
37
|
+
*/
|
|
38
|
+
export enum HorizontalDirection {
|
|
39
|
+
LeftToRight,
|
|
40
|
+
RightToLeft,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface MenuProps {
|
|
44
|
+
menuStyle?: unknown;
|
|
45
|
+
menuClassName?: string;
|
|
46
|
+
isVisible?: boolean;
|
|
47
|
+
preventHideMenu?: boolean;
|
|
48
|
+
backLabel?: string;
|
|
49
|
+
headerComponent?: ReactNode;
|
|
50
|
+
showHeaderDivider?: boolean;
|
|
51
|
+
activePanelIndex?: number;
|
|
52
|
+
onVisibilityChange?: (isVisible: boolean) => void;
|
|
53
|
+
// New props that can be used as alternatives to horizontalDirection and verticalDirection
|
|
54
|
+
align?: 'start' | 'end' | 'center';
|
|
55
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
56
|
+
children: ReactNode;
|
|
57
|
+
}
|
|
58
|
+
type MenuContextProps = {
|
|
59
|
+
showSubMenu: (subMenuProps: MenuProps) => void;
|
|
60
|
+
hideMenu: () => void;
|
|
61
|
+
addItemPanel: (index: number, label: string) => void;
|
|
62
|
+
horizontalDirection: HorizontalDirection;
|
|
63
|
+
verticalDirection?: VerticalDirection;
|
|
64
|
+
activePanelIndex: number;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
type MenuPathState = {
|
|
68
|
+
props: MenuProps;
|
|
69
|
+
activePanelIndex: number;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const MenuContext = createContext<MenuContextProps>(null);
|
|
73
|
+
|
|
74
|
+
const Menu = (props: MenuProps) => {
|
|
75
|
+
const {
|
|
76
|
+
isVisible,
|
|
77
|
+
onVisibilityChange,
|
|
78
|
+
activePanelIndex,
|
|
79
|
+
preventHideMenu,
|
|
80
|
+
menuClassName,
|
|
81
|
+
menuStyle,
|
|
82
|
+
align,
|
|
83
|
+
side,
|
|
84
|
+
} = props;
|
|
85
|
+
|
|
86
|
+
// Derive horizontalDirection and verticalDirection from align and side if provided
|
|
87
|
+
let horizontalDirection = HorizontalDirection.LeftToRight;
|
|
88
|
+
let verticalDirection = VerticalDirection.BottomToTop;
|
|
89
|
+
|
|
90
|
+
if (align !== undefined) {
|
|
91
|
+
horizontalDirection =
|
|
92
|
+
align === 'start' ? HorizontalDirection.LeftToRight : HorizontalDirection.RightToLeft;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (side !== undefined) {
|
|
96
|
+
verticalDirection =
|
|
97
|
+
side === 'bottom' ? VerticalDirection.TopToBottom : VerticalDirection.BottomToTop;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const [isMenuVisible, setIsMenuVisible] = useState(isVisible);
|
|
101
|
+
|
|
102
|
+
// The menuPath is an array consisting of this top Menu and every SubMenu
|
|
103
|
+
// that has been traversed/opened by the user with the last item in the array
|
|
104
|
+
// being the current (sub)menu that is currently visible. This allows for the previously
|
|
105
|
+
// viewed menus to be returned to via the Back button at the top of the menu.
|
|
106
|
+
const [menuPath, setMenuPath] = useState<Array<MenuPathState>>([
|
|
107
|
+
{ props, activePanelIndex: activePanelIndex || 0 },
|
|
108
|
+
]);
|
|
109
|
+
const [itemPanelLabels, setItemPanelLabels] = useState<Array<string>>([]);
|
|
110
|
+
|
|
111
|
+
// Store latest function references in refs so we can use them in effects
|
|
112
|
+
// without triggering re-runs when they change
|
|
113
|
+
const onVisibilityChangeRef = useRef(onVisibilityChange);
|
|
114
|
+
const preventHideMenuRef = useRef(preventHideMenu);
|
|
115
|
+
|
|
116
|
+
// Keep refs up to date
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
onVisibilityChangeRef.current = onVisibilityChange;
|
|
119
|
+
}, [onVisibilityChange]);
|
|
120
|
+
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
preventHideMenuRef.current = preventHideMenu;
|
|
123
|
+
}, [preventHideMenu]);
|
|
124
|
+
|
|
125
|
+
// If the props change for the this top level menu then we have to update the menu path
|
|
126
|
+
// because the props to be rendered are maintained in the state.
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
setMenuPath(menuPath => [
|
|
129
|
+
{ props, activePanelIndex: activePanelIndex || 0 },
|
|
130
|
+
...menuPath.slice(1),
|
|
131
|
+
]);
|
|
132
|
+
}, [activePanelIndex, props]);
|
|
133
|
+
|
|
134
|
+
const hideMenu = useCallback(() => {
|
|
135
|
+
if (preventHideMenuRef.current) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
setMenuPath(path => [path[0]]);
|
|
139
|
+
setItemPanelLabels([]);
|
|
140
|
+
setIsMenuVisible(false);
|
|
141
|
+
onVisibilityChangeRef.current?.(false);
|
|
142
|
+
}, []);
|
|
143
|
+
|
|
144
|
+
// Only run this effect when isVisible changes, not when functions change.
|
|
145
|
+
// Note that hideMenu is stable with no dependencies and thus will not trigger the useEffect to run.
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
if (isVisible) {
|
|
148
|
+
setIsMenuVisible(isVisible);
|
|
149
|
+
onVisibilityChangeRef.current?.(isVisible);
|
|
150
|
+
} else {
|
|
151
|
+
hideMenu();
|
|
152
|
+
}
|
|
153
|
+
}, [isVisible, hideMenu]);
|
|
154
|
+
|
|
155
|
+
const showSubMenu = useCallback((subMenuProps: MenuProps) => {
|
|
156
|
+
setMenuPath(path => {
|
|
157
|
+
return [
|
|
158
|
+
...path,
|
|
159
|
+
{ props: subMenuProps, activePanelIndex: subMenuProps.activePanelIndex || 0 },
|
|
160
|
+
];
|
|
161
|
+
});
|
|
162
|
+
setItemPanelLabels([]);
|
|
163
|
+
}, []);
|
|
164
|
+
|
|
165
|
+
const addItemPanel = useCallback((index, label) => {
|
|
166
|
+
setItemPanelLabels(labels => {
|
|
167
|
+
return [...labels.slice(0, index), label, ...labels.slice(index + 1, labels.length)];
|
|
168
|
+
});
|
|
169
|
+
}, []);
|
|
170
|
+
|
|
171
|
+
const onActivePanelIndexChange = useCallback(index => {
|
|
172
|
+
setMenuPath(path => {
|
|
173
|
+
return [
|
|
174
|
+
...path.slice(0, path.length - 1),
|
|
175
|
+
{ ...path[path.length - 1], activePanelIndex: index },
|
|
176
|
+
];
|
|
177
|
+
});
|
|
178
|
+
}, []);
|
|
179
|
+
|
|
180
|
+
const onBackClick = useCallback(() => {
|
|
181
|
+
setMenuPath(path => [...path.slice(0, path.length - 1)]);
|
|
182
|
+
setItemPanelLabels([]);
|
|
183
|
+
}, []);
|
|
184
|
+
|
|
185
|
+
const { props: currentMenuProps, activePanelIndex: currentMenuActivePanelIndex } =
|
|
186
|
+
menuPath[menuPath.length - 1];
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<>
|
|
190
|
+
<MenuContext.Provider
|
|
191
|
+
value={{
|
|
192
|
+
showSubMenu,
|
|
193
|
+
hideMenu,
|
|
194
|
+
addItemPanel,
|
|
195
|
+
activePanelIndex: currentMenuActivePanelIndex,
|
|
196
|
+
horizontalDirection,
|
|
197
|
+
verticalDirection,
|
|
198
|
+
}}
|
|
199
|
+
>
|
|
200
|
+
{isMenuVisible && (
|
|
201
|
+
<div
|
|
202
|
+
className={classNames(
|
|
203
|
+
'bg-popover/90 text-foreground flex select-none flex-col rounded px-1 py-1.5',
|
|
204
|
+
menuClassName
|
|
205
|
+
)}
|
|
206
|
+
style={menuStyle}
|
|
207
|
+
>
|
|
208
|
+
{menuPath.length > 1 && (
|
|
209
|
+
<BackItem
|
|
210
|
+
backLabel={menuPath[menuPath.length - 2].props.backLabel}
|
|
211
|
+
onBackClick={onBackClick}
|
|
212
|
+
/>
|
|
213
|
+
)}
|
|
214
|
+
{itemPanelLabels.length > 1 && (
|
|
215
|
+
<PanelSelector
|
|
216
|
+
panelLabels={itemPanelLabels}
|
|
217
|
+
activeIndex={currentMenuActivePanelIndex}
|
|
218
|
+
onActiveIndexChange={onActivePanelIndexChange}
|
|
219
|
+
></PanelSelector>
|
|
220
|
+
)}
|
|
221
|
+
{currentMenuProps.headerComponent}
|
|
222
|
+
{currentMenuProps.showHeaderDivider && <DividerItem />}
|
|
223
|
+
{currentMenuProps.children}
|
|
224
|
+
</div>
|
|
225
|
+
)}
|
|
226
|
+
</MenuContext.Provider>
|
|
227
|
+
</>
|
|
228
|
+
);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export default Menu;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { Tabs, TabsList, TabsTrigger } from '../Tabs';
|
|
3
|
+
|
|
4
|
+
type PanelSelectorProps = {
|
|
5
|
+
panelLabels: Array<ReactNode>;
|
|
6
|
+
onActiveIndexChange: (index: number) => void;
|
|
7
|
+
activeIndex: number;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const PanelSelector = ({ panelLabels, onActiveIndexChange, activeIndex }: PanelSelectorProps) => {
|
|
11
|
+
return (
|
|
12
|
+
<div className="mx-2 my-1 flex justify-center">
|
|
13
|
+
<Tabs
|
|
14
|
+
value={String(activeIndex)}
|
|
15
|
+
onValueChange={val => onActiveIndexChange(parseInt(val, 10))}
|
|
16
|
+
>
|
|
17
|
+
<TabsList>
|
|
18
|
+
{panelLabels.map((panelLabel, index) => (
|
|
19
|
+
<TabsTrigger
|
|
20
|
+
key={index}
|
|
21
|
+
value={String(index)}
|
|
22
|
+
>
|
|
23
|
+
{panelLabel}
|
|
24
|
+
</TabsTrigger>
|
|
25
|
+
))}
|
|
26
|
+
</TabsList>
|
|
27
|
+
</Tabs>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default PanelSelector;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { MenuContext, MenuProps } from './Menu';
|
|
3
|
+
import { Icons } from '@ohif/ui-next';
|
|
4
|
+
export interface SubMenuProps extends MenuProps {
|
|
5
|
+
itemLabel: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
itemIcon?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const SubMenu = (props: SubMenuProps) => {
|
|
11
|
+
const { showSubMenu } = useContext(MenuContext);
|
|
12
|
+
|
|
13
|
+
const onClickHandler = () => {
|
|
14
|
+
showSubMenu(props);
|
|
15
|
+
props.onClick?.();
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div
|
|
20
|
+
className="hover:bg-accent flex h-8 w-full cursor-pointer items-center px-2 text-base hover:rounded"
|
|
21
|
+
onClick={onClickHandler}
|
|
22
|
+
>
|
|
23
|
+
{props.itemIcon && (
|
|
24
|
+
<div className="flex w-7 flex-shrink-0 items-center justify-center">
|
|
25
|
+
<Icons.ByName name={props.itemIcon}></Icons.ByName>
|
|
26
|
+
</div>
|
|
27
|
+
)}
|
|
28
|
+
<span className="flex-grow">{props.itemLabel}</span>
|
|
29
|
+
<div className="ml-2 flex-shrink-0">
|
|
30
|
+
<Icons.ByName name="content-next"></Icons.ByName>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default SubMenu;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import Menu, { VerticalDirection, HorizontalDirection } from './Menu';
|
|
2
|
+
import SubMenu from './SubMenu';
|
|
3
|
+
import BackItem from './BackItem';
|
|
4
|
+
import HeaderItem from './HeaderItem';
|
|
5
|
+
import DividerItem from './DividerItem';
|
|
6
|
+
import IconMenu from './IconMenu';
|
|
7
|
+
import ItemPanel from './ItemPanel';
|
|
8
|
+
import PanelSelector from './PanelSelector';
|
|
9
|
+
import Item from './Item';
|
|
10
|
+
|
|
11
|
+
// Export enums
|
|
12
|
+
export { VerticalDirection, HorizontalDirection };
|
|
13
|
+
|
|
14
|
+
// Export components
|
|
15
|
+
export {
|
|
16
|
+
Menu,
|
|
17
|
+
SubMenu,
|
|
18
|
+
BackItem,
|
|
19
|
+
HeaderItem,
|
|
20
|
+
DividerItem,
|
|
21
|
+
IconMenu,
|
|
22
|
+
ItemPanel,
|
|
23
|
+
PanelSelector,
|
|
24
|
+
Item,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// Namespace for components and enums
|
|
28
|
+
const AllInOneMenu = {
|
|
29
|
+
Menu,
|
|
30
|
+
SubMenu,
|
|
31
|
+
BackItem,
|
|
32
|
+
HeaderItem,
|
|
33
|
+
DividerItem,
|
|
34
|
+
IconMenu,
|
|
35
|
+
ItemPanel,
|
|
36
|
+
PanelSelector,
|
|
37
|
+
Item,
|
|
38
|
+
VerticalDirection,
|
|
39
|
+
HorizontalDirection,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default AllInOneMenu;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useState, useEffect } from 'react';
|
|
5
|
+
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '../Select';
|
|
6
|
+
|
|
7
|
+
const BackgroundColorSelect: React.FC = () => {
|
|
8
|
+
const [selectedColor, setSelectedColor] = useState('#050615');
|
|
9
|
+
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const rows = document.querySelectorAll('.row') as NodeListOf<HTMLElement>;
|
|
12
|
+
rows.forEach(row => {
|
|
13
|
+
row.style.backgroundColor = selectedColor;
|
|
14
|
+
});
|
|
15
|
+
}, [selectedColor]);
|
|
16
|
+
|
|
17
|
+
const handleColorChange = (value: string) => {
|
|
18
|
+
setSelectedColor(value);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div>
|
|
23
|
+
<Select onValueChange={handleColorChange}>
|
|
24
|
+
<SelectTrigger className="w-[180px]">
|
|
25
|
+
<SelectValue placeholder="Select Color" />
|
|
26
|
+
</SelectTrigger>
|
|
27
|
+
<SelectContent>
|
|
28
|
+
<SelectItem value="black">Viewport (Black)</SelectItem>
|
|
29
|
+
<SelectItem value="#050615">Base</SelectItem>
|
|
30
|
+
<SelectItem value="#090C29">Medium</SelectItem>
|
|
31
|
+
<SelectItem value="#041C4A">Header</SelectItem>
|
|
32
|
+
</SelectContent>
|
|
33
|
+
</Select>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default BackgroundColorSelect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BackgroundColorSelect } from './BackgroundColorSelect';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
|
|
6
|
+
const badgeVariants = cva(
|
|
7
|
+
'inline-flex items-center rounded-xl border px-1 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: 'border-transparent bg-primary/25 text-primary shadow hover:bg-primary/35',
|
|
12
|
+
secondary:
|
|
13
|
+
'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
14
|
+
destructive:
|
|
15
|
+
'border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80',
|
|
16
|
+
outline: 'text-foreground',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
variant: 'default',
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export interface BadgeProps
|
|
26
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
27
|
+
VariantProps<typeof badgeVariants> {}
|
|
28
|
+
|
|
29
|
+
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
className={cn(badgeVariants({ variant }), className)}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Badge, badgeVariants, type BadgeProps } from './Badge';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
|
|
7
|
+
const buttonVariants = cva(
|
|
8
|
+
'inline-flex items-center justify-center whitespace-nowrap rounded text-base font-normal leading-tight transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: 'bg-primary/85 text-primary-foreground hover:bg-primary/100',
|
|
13
|
+
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
|
|
14
|
+
outline:
|
|
15
|
+
'border border-primary/25 bg-background hover:bg-primary/25 text-primary hover:text-primary',
|
|
16
|
+
secondary: 'bg-secondary/85 text-secondary-foreground hover:bg-secondary/100',
|
|
17
|
+
ghost: 'font-normal text-primary hover:bg-primary/25',
|
|
18
|
+
link: 'font-normal text-primary underline-offset-4 hover:underline',
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
default: 'h-7 px-2 py-2',
|
|
22
|
+
sm: 'h-6 rounded px-2',
|
|
23
|
+
lg: 'h-9 rounded px-2',
|
|
24
|
+
icon: 'h-6 w-6',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
variant: 'default',
|
|
29
|
+
size: 'default',
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export interface ButtonProps
|
|
35
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
36
|
+
VariantProps<typeof buttonVariants> {
|
|
37
|
+
asChild?: boolean;
|
|
38
|
+
dataCY?: string;
|
|
39
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const Button = ({
|
|
43
|
+
className,
|
|
44
|
+
variant,
|
|
45
|
+
size,
|
|
46
|
+
asChild = false,
|
|
47
|
+
dataCY,
|
|
48
|
+
ref,
|
|
49
|
+
...props
|
|
50
|
+
}: ButtonProps) => {
|
|
51
|
+
const Comp = asChild ? Slot : 'button';
|
|
52
|
+
const testId = dataCY || `${props.name}-btn`;
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<Comp
|
|
56
|
+
data-cy={testId}
|
|
57
|
+
className={cn(buttonVariants({ variant, size }), className)}
|
|
58
|
+
ref={ref}
|
|
59
|
+
{...props}
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
Button.displayName = 'Button';
|
|
64
|
+
|
|
65
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button, buttonVariants } from './Button';
|