@cleen/ui 0.1.0
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/package.json +54 -0
- package/src/charts/chart/Chart.tsx +82 -0
- package/src/charts/chart/constant.ts +50 -0
- package/src/charts/chart/index.ts +2 -0
- package/src/charts/chart/types/apexcharts.ts +9 -0
- package/src/charts/chart/variants/BellCurve/BellCurve.tsx +215 -0
- package/src/charts/chart/variants/BellCurve/constant.ts +112 -0
- package/src/charts/chart/variants/BellCurve/helper.ts +116 -0
- package/src/charts/chart/variants/BellCurve/index.ts +2 -0
- package/src/charts/chart/variants/BellCurve/types/bellCurve.ts +47 -0
- package/src/charts/chart/variants/BellCurve/types/props.ts +21 -0
- package/src/charts/chart/variants/RadarChart/RadarChart.tsx +22 -0
- package/src/charts/chart/variants/RadarChart/constant.ts +28 -0
- package/src/charts/chart/variants/RadarChart/index.ts +1 -0
- package/src/charts/chart/variants/ScatterChart/ScatterChart.tsx +23 -0
- package/src/charts/chart/variants/ScatterChart/constant.ts +54 -0
- package/src/charts/chart/variants/ScatterChart/index.ts +1 -0
- package/src/charts/chart/variants/index.ts +3 -0
- package/src/charts/index.ts +2 -0
- package/src/charts/simpleChart/SimpleChart.tsx +54 -0
- package/src/charts/simpleChart/index.ts +1 -0
- package/src/components/advancedProgressBar/AdvancedProgressBar.tsx +156 -0
- package/src/components/advancedProgressBar/blocks/Bar.tsx +118 -0
- package/src/components/advancedProgressBar/blocks/BlockLabel.tsx +49 -0
- package/src/components/advancedProgressBar/blocks/Clamp.tsx +85 -0
- package/src/components/advancedProgressBar/constants.ts +6 -0
- package/src/components/advancedProgressBar/index.ts +2 -0
- package/src/components/advancedProgressBar/types/props.ts +69 -0
- package/src/components/advancedProgressBar/utils.ts +17 -0
- package/src/components/audioPlayback/AudioPlayback.tsx +141 -0
- package/src/components/audioPlayback/index.ts +2 -0
- package/src/components/audioRecorder/AudioRecorder.tsx +391 -0
- package/src/components/audioRecorder/constant/default.ts +19 -0
- package/src/components/audioRecorder/constant/labels.ts +9 -0
- package/src/components/audioRecorder/index.ts +2 -0
- package/src/components/audioRecorder/types/props.ts +56 -0
- package/src/components/avatar/Avatar.tsx +132 -0
- package/src/components/avatar/index.ts +1 -0
- package/src/components/avatar/variants.ts +9 -0
- package/src/components/avatarRow/AvatarRow.tsx +127 -0
- package/src/components/avatarRow/index.ts +1 -0
- package/src/components/breadcrumb/Breadcrumb.tsx +158 -0
- package/src/components/breadcrumb/index.ts +1 -0
- package/src/components/button/Button.tsx +114 -0
- package/src/components/button/index.ts +2 -0
- package/src/components/button/variants.ts +41 -0
- package/src/components/card/Card.tsx +197 -0
- package/src/components/card/index.ts +3 -0
- package/src/components/card/variants/CardIcon/CardIcon.tsx +158 -0
- package/src/components/card/variants/CardMedia/CardMedia.tsx +127 -0
- package/src/components/checkbox/Checkbox.tsx +246 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/checkbox/variants.ts +13 -0
- package/src/components/checkboxGroup/CheckboxGroup.tsx +163 -0
- package/src/components/checkboxGroup/index.ts +1 -0
- package/src/components/cleenIcon/CleenIcon.tsx +674 -0
- package/src/components/cleenIcon/icons/IconAlertCircle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconAlertFeatured.tsx +30 -0
- package/src/components/cleenIcon/icons/IconAlertOctagon.tsx +21 -0
- package/src/components/cleenIcon/icons/IconAlertTriangle.tsx +25 -0
- package/src/components/cleenIcon/icons/IconAlignRight.tsx +25 -0
- package/src/components/cleenIcon/icons/IconArrowDown.tsx +25 -0
- package/src/components/cleenIcon/icons/IconArrowLeft.tsx +25 -0
- package/src/components/cleenIcon/icons/IconArrowLeft2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconArrowRight.tsx +25 -0
- package/src/components/cleenIcon/icons/IconArrowToTop.tsx +20 -0
- package/src/components/cleenIcon/icons/IconArrowUp.tsx +22 -0
- package/src/components/cleenIcon/icons/IconArrowUpRight.tsx +22 -0
- package/src/components/cleenIcon/icons/IconArrowUpRightNarrow.tsx +22 -0
- package/src/components/cleenIcon/icons/IconArrowUpRightSquare.tsx +22 -0
- package/src/components/cleenIcon/icons/IconAttachment.tsx +22 -0
- package/src/components/cleenIcon/icons/IconBarChartSquare.tsx +22 -0
- package/src/components/cleenIcon/icons/IconBold.tsx +16 -0
- package/src/components/cleenIcon/icons/IconBookmarkCheck.tsx +22 -0
- package/src/components/cleenIcon/icons/IconBookmarkCheckFill.tsx +37 -0
- package/src/components/cleenIcon/icons/IconBookmarkPlus.tsx +22 -0
- package/src/components/cleenIcon/icons/IconBookmarkX.tsx +22 -0
- package/src/components/cleenIcon/icons/IconBoxLines.tsx +16 -0
- package/src/components/cleenIcon/icons/IconBoxText.tsx +24 -0
- package/src/components/cleenIcon/icons/IconBracketsCheck.tsx +25 -0
- package/src/components/cleenIcon/icons/IconBracketsEllipses.tsx +22 -0
- package/src/components/cleenIcon/icons/IconBuilding.tsx +22 -0
- package/src/components/cleenIcon/icons/IconCalendar.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCertificateHeart.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCheck.tsx +22 -0
- package/src/components/cleenIcon/icons/IconCheckCircle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconCheckCircleBroken.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCheckFill.tsx +45 -0
- package/src/components/cleenIcon/icons/IconCheckVerified.tsx +22 -0
- package/src/components/cleenIcon/icons/IconChevronDown.tsx +22 -0
- package/src/components/cleenIcon/icons/IconChevronLeft.tsx +25 -0
- package/src/components/cleenIcon/icons/IconChevronLeftDouble.tsx +22 -0
- package/src/components/cleenIcon/icons/IconChevronRight.tsx +25 -0
- package/src/components/cleenIcon/icons/IconChevronRightDouble.tsx +22 -0
- package/src/components/cleenIcon/icons/IconChevronSelectorVertical.tsx +22 -0
- package/src/components/cleenIcon/icons/IconChevronUp.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCircleSwap.tsx +22 -0
- package/src/components/cleenIcon/icons/IconClockFastForward.tsx +25 -0
- package/src/components/cleenIcon/icons/IconClockRewind.tsx +25 -0
- package/src/components/cleenIcon/icons/IconClockRewind2.tsx +21 -0
- package/src/components/cleenIcon/icons/IconCodeBrowser.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCodeCircle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconColors.tsx +25 -0
- package/src/components/cleenIcon/icons/IconColumnEdit.tsx +19 -0
- package/src/components/cleenIcon/icons/IconCopy.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCopy2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconCopy3.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCopy4.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCopy5.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCopyCheck.tsx +22 -0
- package/src/components/cleenIcon/icons/IconCube.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCubeOutline.tsx +22 -0
- package/src/components/cleenIcon/icons/IconCursorBox.tsx +25 -0
- package/src/components/cleenIcon/icons/IconDataflow.tsx +22 -0
- package/src/components/cleenIcon/icons/IconDataflow2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconDataflow3.tsx +29 -0
- package/src/components/cleenIcon/icons/IconDelete.tsx +25 -0
- package/src/components/cleenIcon/icons/IconDollarCircle.tsx +25 -0
- package/src/components/cleenIcon/icons/IconDotsGrid.tsx +74 -0
- package/src/components/cleenIcon/icons/IconDotsHorizontal.tsx +34 -0
- package/src/components/cleenIcon/icons/IconDotsVertical.tsx +38 -0
- package/src/components/cleenIcon/icons/IconEdit.tsx +25 -0
- package/src/components/cleenIcon/icons/IconEditable.tsx +25 -0
- package/src/components/cleenIcon/icons/IconExpand.tsx +22 -0
- package/src/components/cleenIcon/icons/IconEye.tsx +28 -0
- package/src/components/cleenIcon/icons/IconEyeHidden.tsx +25 -0
- package/src/components/cleenIcon/icons/IconEyeHidden2.tsx +24 -0
- package/src/components/cleenIcon/icons/IconFaceSmile.tsx +24 -0
- package/src/components/cleenIcon/icons/IconFilter.tsx +22 -0
- package/src/components/cleenIcon/icons/IconFilter2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconFlag.tsx +22 -0
- package/src/components/cleenIcon/icons/IconFlag2.tsx +25 -0
- package/src/components/cleenIcon/icons/IconFlag3.tsx +16 -0
- package/src/components/cleenIcon/icons/IconHandShield.tsx +22 -0
- package/src/components/cleenIcon/icons/IconHash.tsx +22 -0
- package/src/components/cleenIcon/icons/IconHeadsetMic.tsx +21 -0
- package/src/components/cleenIcon/icons/IconHeart.tsx +24 -0
- package/src/components/cleenIcon/icons/IconHouseLine.tsx +22 -0
- package/src/components/cleenIcon/icons/IconImage.tsx +22 -0
- package/src/components/cleenIcon/icons/IconImage2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconImage3.tsx +17 -0
- package/src/components/cleenIcon/icons/IconImage4.tsx +25 -0
- package/src/components/cleenIcon/icons/IconImageCheck.tsx +22 -0
- package/src/components/cleenIcon/icons/IconInfoCircle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconInfoHexagon.tsx +25 -0
- package/src/components/cleenIcon/icons/IconItalic.tsx +16 -0
- package/src/components/cleenIcon/icons/IconLayersMultiple.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLayersSingle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLayout.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLayout2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLayoutColumns.tsx +20 -0
- package/src/components/cleenIcon/icons/IconLayoutCustom.tsx +16 -0
- package/src/components/cleenIcon/icons/IconLayoutSequential.tsx +16 -0
- package/src/components/cleenIcon/icons/IconLayoutStuffed.tsx +20 -0
- package/src/components/cleenIcon/icons/IconLayoutTile.tsx +16 -0
- package/src/components/cleenIcon/icons/IconLifeBuoy.tsx +29 -0
- package/src/components/cleenIcon/icons/IconLightbulb.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLightning.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLightning2.tsx +25 -0
- package/src/components/cleenIcon/icons/IconLightningFast.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLineChartBar.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLineChartBreakoutSquare.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLineChartUp.tsx +25 -0
- package/src/components/cleenIcon/icons/IconLineChartUp2.tsx +34 -0
- package/src/components/cleenIcon/icons/IconLines.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLinesCheck.tsx +16 -0
- package/src/components/cleenIcon/icons/IconLinesPlay.tsx +23 -0
- package/src/components/cleenIcon/icons/IconLink.tsx +25 -0
- package/src/components/cleenIcon/icons/IconLink2.tsx +24 -0
- package/src/components/cleenIcon/icons/IconLink3.tsx +21 -0
- package/src/components/cleenIcon/icons/IconLink4.tsx +17 -0
- package/src/components/cleenIcon/icons/IconLink5.tsx +22 -0
- package/src/components/cleenIcon/icons/IconListBullet.tsx +18 -0
- package/src/components/cleenIcon/icons/IconListOrder.tsx +20 -0
- package/src/components/cleenIcon/icons/IconListOrder2.tsx +16 -0
- package/src/components/cleenIcon/icons/IconLock.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLock2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLogIn.tsx +25 -0
- package/src/components/cleenIcon/icons/IconLogOut.tsx +25 -0
- package/src/components/cleenIcon/icons/IconLogOut2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconMagicWand.tsx +25 -0
- package/src/components/cleenIcon/icons/IconMagicWand2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconMail.tsx +25 -0
- package/src/components/cleenIcon/icons/IconMessageSquare.tsx +25 -0
- package/src/components/cleenIcon/icons/IconMessageSquare2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconMessageXSquare.tsx +25 -0
- package/src/components/cleenIcon/icons/IconMinusCircle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconMobile.tsx +25 -0
- package/src/components/cleenIcon/icons/IconMonitor.tsx +22 -0
- package/src/components/cleenIcon/icons/IconMonitor2.tsx +25 -0
- package/src/components/cleenIcon/icons/IconMonitor3.tsx +25 -0
- package/src/components/cleenIcon/icons/IconMoonCircle.tsx +28 -0
- package/src/components/cleenIcon/icons/IconNavigationPointer.tsx +22 -0
- package/src/components/cleenIcon/icons/IconNotificationBox.tsx +22 -0
- package/src/components/cleenIcon/icons/IconPCSetup.tsx +22 -0
- package/src/components/cleenIcon/icons/IconPalette.tsx +40 -0
- package/src/components/cleenIcon/icons/IconPasscodeLock.tsx +25 -0
- package/src/components/cleenIcon/icons/IconPencil.tsx +25 -0
- package/src/components/cleenIcon/icons/IconPercentageCircle.tsx +29 -0
- package/src/components/cleenIcon/icons/IconPerspective.tsx +22 -0
- package/src/components/cleenIcon/icons/IconPhoneCall.tsx +25 -0
- package/src/components/cleenIcon/icons/IconPin.tsx +22 -0
- package/src/components/cleenIcon/icons/IconPlayCircle.tsx +28 -0
- package/src/components/cleenIcon/icons/IconPlus.tsx +22 -0
- package/src/components/cleenIcon/icons/IconPlusCircle.tsx +25 -0
- package/src/components/cleenIcon/icons/IconPulse.tsx +25 -0
- package/src/components/cleenIcon/icons/IconQuestionCircle.tsx +24 -0
- package/src/components/cleenIcon/icons/IconRadioButton.tsx +27 -0
- package/src/components/cleenIcon/icons/IconRadioButtonActive.tsx +39 -0
- package/src/components/cleenIcon/icons/IconReceiptCheck.tsx +25 -0
- package/src/components/cleenIcon/icons/IconRedo.tsx +16 -0
- package/src/components/cleenIcon/icons/IconRefresh.tsx +22 -0
- package/src/components/cleenIcon/icons/IconRefresh2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconRefresh3.tsx +20 -0
- package/src/components/cleenIcon/icons/IconRepeat.tsx +22 -0
- package/src/components/cleenIcon/icons/IconRepeat2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconRetweet.tsx +33 -0
- package/src/components/cleenIcon/icons/IconRoundChart.tsx +25 -0
- package/src/components/cleenIcon/icons/IconRoundChart2.tsx +29 -0
- package/src/components/cleenIcon/icons/IconRoute.tsx +22 -0
- package/src/components/cleenIcon/icons/IconSave.tsx +25 -0
- package/src/components/cleenIcon/icons/IconSave2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconScanDots.tsx +22 -0
- package/src/components/cleenIcon/icons/IconSearch.tsx +22 -0
- package/src/components/cleenIcon/icons/IconSend.tsx +25 -0
- package/src/components/cleenIcon/icons/IconSettings.tsx +32 -0
- package/src/components/cleenIcon/icons/IconSettings2.tsx +25 -0
- package/src/components/cleenIcon/icons/IconSettings3.tsx +22 -0
- package/src/components/cleenIcon/icons/IconShieldLightning.tsx +22 -0
- package/src/components/cleenIcon/icons/IconShieldPlus.tsx +22 -0
- package/src/components/cleenIcon/icons/IconShieldRemove.tsx +16 -0
- package/src/components/cleenIcon/icons/IconShuffle.tsx +25 -0
- package/src/components/cleenIcon/icons/IconSlashCircle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconSlashOctagon.tsx +22 -0
- package/src/components/cleenIcon/icons/IconSocialGlobe.tsx +23 -0
- package/src/components/cleenIcon/icons/IconSocialLinkedin.tsx +21 -0
- package/src/components/cleenIcon/icons/IconSocialX.tsx +28 -0
- package/src/components/cleenIcon/icons/IconSpeedometer.tsx +22 -0
- package/src/components/cleenIcon/icons/IconStairsRound.tsx +21 -0
- package/src/components/cleenIcon/icons/IconStar.tsx +22 -0
- package/src/components/cleenIcon/icons/IconStarHalf.tsx +39 -0
- package/src/components/cleenIcon/icons/IconStars.tsx +28 -0
- package/src/components/cleenIcon/icons/IconStars2.tsx +29 -0
- package/src/components/cleenIcon/icons/IconStrikethrough.tsx +16 -0
- package/src/components/cleenIcon/icons/IconSuccessFeatured.tsx +30 -0
- package/src/components/cleenIcon/icons/IconSun.tsx +22 -0
- package/src/components/cleenIcon/icons/IconSwitchHorizontal.tsx +22 -0
- package/src/components/cleenIcon/icons/IconTag.tsx +22 -0
- package/src/components/cleenIcon/icons/IconTarget.tsx +21 -0
- package/src/components/cleenIcon/icons/IconTarget2.tsx +34 -0
- package/src/components/cleenIcon/icons/IconTextFormat.tsx +17 -0
- package/src/components/cleenIcon/icons/IconTextFormat2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconTextHighlight.tsx +16 -0
- package/src/components/cleenIcon/icons/IconTranslate.tsx +25 -0
- package/src/components/cleenIcon/icons/IconTrash.tsx +25 -0
- package/src/components/cleenIcon/icons/IconTrending.tsx +22 -0
- package/src/components/cleenIcon/icons/IconUnderline.tsx +16 -0
- package/src/components/cleenIcon/icons/IconUndo.tsx +22 -0
- package/src/components/cleenIcon/icons/IconUndo2.tsx +16 -0
- package/src/components/cleenIcon/icons/IconUploadCloud.tsx +22 -0
- package/src/components/cleenIcon/icons/IconUser.tsx +22 -0
- package/src/components/cleenIcon/icons/IconUserEdit.tsx +25 -0
- package/src/components/cleenIcon/icons/IconUserRight.tsx +22 -0
- package/src/components/cleenIcon/icons/IconUserSquare.tsx +25 -0
- package/src/components/cleenIcon/icons/IconUsers.tsx +25 -0
- package/src/components/cleenIcon/icons/IconUsersUp.tsx +25 -0
- package/src/components/cleenIcon/icons/IconVolume.tsx +25 -0
- package/src/components/cleenIcon/icons/IconWrench.tsx +22 -0
- package/src/components/cleenIcon/icons/IconX.tsx +25 -0
- package/src/components/cleenIcon/icons/IconXCircle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconXCircle2.tsx +42 -0
- package/src/components/cleenIcon/icons/IconXClose.tsx +25 -0
- package/src/components/cleenIcon/icons/IconXSquare.tsx +22 -0
- package/src/components/cleenIcon/icons/index.ts +215 -0
- package/src/components/cleenIcon/index.ts +4 -0
- package/src/components/cleenIcon/types/icon.ts +226 -0
- package/src/components/collapsible/Collapsible.tsx +148 -0
- package/src/components/collapsible/index.ts +5 -0
- package/src/components/creditCardInput/CreditCardInput.tsx +236 -0
- package/src/components/creditCardInput/index.ts +2 -0
- package/src/components/creditCardInput/types/card.ts +13 -0
- package/src/components/creditCardInput/types/props.ts +44 -0
- package/src/components/creditCardInput/util/format.ts +102 -0
- package/src/components/datePicker/DatePicker.tsx +235 -0
- package/src/components/datePicker/index.ts +2 -0
- package/src/components/datePicker/types/props.ts +47 -0
- package/src/components/datePicker/utils/date.ts +40 -0
- package/src/components/divider/Divider.tsx +43 -0
- package/src/components/divider/index.ts +1 -0
- package/src/components/drawer/Drawer.tsx +222 -0
- package/src/components/drawer/index.ts +1 -0
- package/src/components/dropdown/Dropdown.tsx +224 -0
- package/src/components/dropdown/index.ts +1 -0
- package/src/components/filterDrawer/FilterDrawer.tsx +147 -0
- package/src/components/filterDrawer/blocks/FilterDrawerFooter.tsx +119 -0
- package/src/components/filterDrawer/blocks/SaveFilterStep.tsx +56 -0
- package/src/components/filterDrawer/blocks/SavedFilterRow.tsx +166 -0
- package/src/components/filterDrawer/blocks/SavedFiltersDropdown.tsx +142 -0
- package/src/components/filterDrawer/constants/filter.ts +4 -0
- package/src/components/filterDrawer/constants/labels.ts +52 -0
- package/src/components/filterDrawer/constants/tab.ts +7 -0
- package/src/components/filterDrawer/context/context.ts +28 -0
- package/src/components/filterDrawer/context/provider.tsx +50 -0
- package/src/components/filterDrawer/index.ts +7 -0
- package/src/components/filterDrawer/types/filters.ts +28 -0
- package/src/components/filterDrawer/types/props.ts +107 -0
- package/src/components/filterDrawer/types/validation.ts +6 -0
- package/src/components/formGroup/FormGroup.tsx +165 -0
- package/src/components/formGroup/index.ts +1 -0
- package/src/components/groupSelector/GroupSelector.tsx +729 -0
- package/src/components/groupSelector/index.ts +6 -0
- package/src/components/index.ts +44 -0
- package/src/components/infoLabels/InfoLabels.tsx +88 -0
- package/src/components/infoLabels/index.ts +1 -0
- package/src/components/input/Input.tsx +269 -0
- package/src/components/input/index.ts +1 -0
- package/src/components/loader/Loader.tsx +91 -0
- package/src/components/loader/index.ts +1 -0
- package/src/components/lookup/Lookup.tsx +433 -0
- package/src/components/lookup/blocks/LookupOptionList.tsx +130 -0
- package/src/components/lookup/index.ts +2 -0
- package/src/components/lookup/types/lookup.ts +97 -0
- package/src/components/menu/Menu.tsx +103 -0
- package/src/components/menu/blocks/MenuContent.tsx +105 -0
- package/src/components/menu/blocks/MenuItem.tsx +120 -0
- package/src/components/menu/index.ts +2 -0
- package/src/components/menu/types/menu.ts +30 -0
- package/src/components/menu/types/menuItem.ts +48 -0
- package/src/components/modal/Modal.tsx +191 -0
- package/src/components/modal/index.ts +1 -0
- package/src/components/notification/Notification.tsx +79 -0
- package/src/components/notification/constant/notification.ts +30 -0
- package/src/components/notification/index.ts +2 -0
- package/src/components/notification/wrappers/CleenNotificationContainer.tsx +9 -0
- package/src/components/pagination/Pagination.tsx +294 -0
- package/src/components/pagination/blocks/PaginationGoToPage.tsx +91 -0
- package/src/components/pagination/blocks/PaginationPageSize.tsx +145 -0
- package/src/components/pagination/constants/labels.ts +15 -0
- package/src/components/pagination/index.ts +9 -0
- package/src/components/pillBadge/PillBadge.tsx +130 -0
- package/src/components/pillBadge/helper.ts +11 -0
- package/src/components/pillBadge/index.ts +1 -0
- package/src/components/pillBadge/variants.ts +47 -0
- package/src/components/popover/Popover.tsx +108 -0
- package/src/components/popover/index.ts +2 -0
- package/src/components/popover/types/popover.ts +21 -0
- package/src/components/progressBar/ProgressBar.tsx +179 -0
- package/src/components/progressBar/index.ts +1 -0
- package/src/components/progressCircle/ProgressCircle.tsx +142 -0
- package/src/components/progressCircle/index.ts +1 -0
- package/src/components/radioBoxGroup/RadioBoxGroup.tsx +207 -0
- package/src/components/radioBoxGroup/index.ts +1 -0
- package/src/components/radioButtonGroup/RadioButtonGroup.tsx +208 -0
- package/src/components/radioButtonGroup/blocks/RadioButton.tsx +22 -0
- package/src/components/radioButtonGroup/index.ts +4 -0
- package/src/components/radioButtonGroup/types/radioButton.ts +10 -0
- package/src/components/rangeSlider/RangeSlider.tsx +366 -0
- package/src/components/rangeSlider/index.ts +1 -0
- package/src/components/select/Select.tsx +349 -0
- package/src/components/select/blocks/SelectCustomMenuList.tsx +70 -0
- package/src/components/select/blocks/SelectNoOptionsMessage.tsx +22 -0
- package/src/components/select/blocks/SelectOption.tsx +19 -0
- package/src/components/select/blocks/SelectSingleValue.tsx +28 -0
- package/src/components/select/index.ts +1 -0
- package/src/components/sidebar/Sidebar.tsx +210 -0
- package/src/components/sidebar/SidebarItem.tsx +88 -0
- package/src/components/sidebar/drawerContainer/DrawerContainer.tsx +36 -0
- package/src/components/sidebar/drawerContainer/DrawerContentTitle.tsx +165 -0
- package/src/components/sidebar/drawerContainer/index.ts +2 -0
- package/src/components/sidebar/index.ts +13 -0
- package/src/components/sidebar/types.ts +157 -0
- package/src/components/skeletons/blocks/Skeleton.tsx +72 -0
- package/src/components/skeletons/blocks/SkeletonAvatar.tsx +43 -0
- package/src/components/skeletons/blocks/SkeletonBadge.tsx +30 -0
- package/src/components/skeletons/blocks/SkeletonBanner.tsx +44 -0
- package/src/components/skeletons/blocks/SkeletonButton.tsx +31 -0
- package/src/components/skeletons/blocks/SkeletonCard.tsx +39 -0
- package/src/components/skeletons/blocks/SkeletonCard2.tsx +57 -0
- package/src/components/skeletons/blocks/SkeletonCard3.tsx +89 -0
- package/src/components/skeletons/blocks/SkeletonCardStack.tsx +22 -0
- package/src/components/skeletons/blocks/SkeletonChart.tsx +114 -0
- package/src/components/skeletons/blocks/SkeletonContentCard.tsx +75 -0
- package/src/components/skeletons/blocks/SkeletonDataGrid.tsx +73 -0
- package/src/components/skeletons/blocks/SkeletonForm.tsx +50 -0
- package/src/components/skeletons/blocks/SkeletonImage.tsx +45 -0
- package/src/components/skeletons/blocks/SkeletonInfoCard.tsx +130 -0
- package/src/components/skeletons/blocks/SkeletonInput.tsx +32 -0
- package/src/components/skeletons/blocks/SkeletonList.tsx +67 -0
- package/src/components/skeletons/blocks/SkeletonParagraph.tsx +52 -0
- package/src/components/skeletons/blocks/SkeletonText.tsx +22 -0
- package/src/components/skeletons/blocks/SkeletonVideo.tsx +71 -0
- package/src/components/skeletons/blocks/SkeletonWidgetCard.tsx +56 -0
- package/src/components/skeletons/blocks/SkeletonWrapper.tsx +140 -0
- package/src/components/skeletons/index.ts +24 -0
- package/src/components/skeletons/styles/skeleton.ts +2 -0
- package/src/components/skeletons/types/skeleton.ts +8 -0
- package/src/components/slider/Slider.tsx +298 -0
- package/src/components/slider/index.ts +1 -0
- package/src/components/stepper/Stepper.tsx +185 -0
- package/src/components/stepper/index.ts +1 -0
- package/src/components/switch/Switch.tsx +152 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/tabs/Tabs.tsx +140 -0
- package/src/components/tabs/index.ts +2 -0
- package/src/components/tabs/types/tab.ts +33 -0
- package/src/components/tabs/variants.ts +49 -0
- package/src/components/textArea/TextArea.tsx +244 -0
- package/src/components/textArea/index.ts +1 -0
- package/src/components/tooltip/Tooltip.tsx +200 -0
- package/src/components/tooltip/index.ts +1 -0
- package/src/icons/IconFromLibrary.tsx +13 -0
- package/src/icons/getIconByName.ts +81 -0
- package/src/icons/index.ts +16 -0
- package/src/index.ts +1 -0
- package/tsconfig.json +27 -0
- package/tsup.config.ts +23 -0
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cleen/ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./icons": {
|
|
15
|
+
"import": "./dist/icons/index.js",
|
|
16
|
+
"types": "./dist/icons/index.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./charts": {
|
|
19
|
+
"import": "./dist/charts/index.js",
|
|
20
|
+
"types": "./dist/charts/index.d.ts"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dev": "tsup --watch --onSuccess 'tsc'",
|
|
25
|
+
"build": "tsup",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"lint": "eslint \"src/**/*.{ts,tsx}\"",
|
|
28
|
+
"format": "prettier --write \"src/**/*.{ts,tsx}\""
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@cleen/ui-core": "*",
|
|
32
|
+
"@wavesurfer/react": "^1.0.12",
|
|
33
|
+
"apexcharts": "^5.3.0",
|
|
34
|
+
"react-apexcharts": "^2.1.0",
|
|
35
|
+
"react-day-picker": "^9.11.1",
|
|
36
|
+
"react-icons": "^5.3.0",
|
|
37
|
+
"react-select": "^5.10.2",
|
|
38
|
+
"react-toastify": "^11.0.5",
|
|
39
|
+
"wavesurfer.js": "^7.12.1"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"react": "^18.3.1",
|
|
43
|
+
"react-dom": "^18.3.1",
|
|
44
|
+
"react-router-dom": "^6.23.1"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/react": "^19.1.10",
|
|
48
|
+
"@types/react-dom": "^19.1.7",
|
|
49
|
+
"@types/react-router-dom": "^5.3.3",
|
|
50
|
+
"tsup": "^8.5.1",
|
|
51
|
+
"typescript": "~5.8.3",
|
|
52
|
+
"tailwindcss": "^3.4.17"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { cn } from '@cleen/ui-core';
|
|
2
|
+
import type { ApexOptions } from 'apexcharts';
|
|
3
|
+
import { forwardRef, type CSSProperties } from 'react';
|
|
4
|
+
import ReactApexChart from 'react-apexcharts';
|
|
5
|
+
import { defaultOptions } from './constant';
|
|
6
|
+
|
|
7
|
+
export interface ChartProps {
|
|
8
|
+
/**
|
|
9
|
+
* Type of chart to render. [Apexcharts API Reference](https://apexcharts.com/docs/options/chart/type/)
|
|
10
|
+
*/
|
|
11
|
+
type?: ReactApexChart['props']['type'];
|
|
12
|
+
/**
|
|
13
|
+
* Chart data series. [Apexcharts API Reference](https://apexcharts.com/docs/options/series/)
|
|
14
|
+
*/
|
|
15
|
+
series: ApexOptions['series'];
|
|
16
|
+
/**
|
|
17
|
+
* Chart options. [Apexcharts API Reference](https://apexcharts.com/docs/options/annotations/)
|
|
18
|
+
*/
|
|
19
|
+
options?: ApexOptions;
|
|
20
|
+
/**
|
|
21
|
+
* Chart width. [Apexcharts API Reference](https://apexcharts.com/docs/options/chart/width/)
|
|
22
|
+
*/
|
|
23
|
+
width?: string | number;
|
|
24
|
+
/**
|
|
25
|
+
* Chart height. [Apexcharts API Reference](https://apexcharts.com/docs/options/chart/height/)
|
|
26
|
+
*/
|
|
27
|
+
height?: string | number;
|
|
28
|
+
/**
|
|
29
|
+
* Additional CSS class names applied to the wrapper of the chart
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Additional CSS style props applied to the wrapper of the chart
|
|
35
|
+
*/
|
|
36
|
+
style?: CSSProperties;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Chart component built on ApexCharts
|
|
41
|
+
* Provides a flexible wrapper for various chart types
|
|
42
|
+
*/
|
|
43
|
+
export const Chart = forwardRef<
|
|
44
|
+
InstanceType<typeof ReactApexChart>,
|
|
45
|
+
ChartProps
|
|
46
|
+
>(function Chart(
|
|
47
|
+
{
|
|
48
|
+
type = 'line',
|
|
49
|
+
series,
|
|
50
|
+
options = {},
|
|
51
|
+
width = '100%',
|
|
52
|
+
height = 350,
|
|
53
|
+
className,
|
|
54
|
+
style,
|
|
55
|
+
},
|
|
56
|
+
ref
|
|
57
|
+
) {
|
|
58
|
+
const mergedOptions: ApexOptions = {
|
|
59
|
+
...defaultOptions,
|
|
60
|
+
...options,
|
|
61
|
+
chart: {
|
|
62
|
+
...defaultOptions.chart,
|
|
63
|
+
...options.chart,
|
|
64
|
+
type,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<div className={cn('cleen', className)} style={style}>
|
|
70
|
+
<ReactApexChart
|
|
71
|
+
options={mergedOptions}
|
|
72
|
+
series={series}
|
|
73
|
+
type={type}
|
|
74
|
+
width={width}
|
|
75
|
+
height={height}
|
|
76
|
+
ref={ref}
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
export default Chart;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ApexOptions } from 'apexcharts';
|
|
2
|
+
|
|
3
|
+
export const defaultOptions: ApexOptions = {
|
|
4
|
+
chart: {
|
|
5
|
+
toolbar: {
|
|
6
|
+
show: true,
|
|
7
|
+
tools: {
|
|
8
|
+
download: true,
|
|
9
|
+
selection: true,
|
|
10
|
+
zoom: true,
|
|
11
|
+
zoomin: true,
|
|
12
|
+
zoomout: true,
|
|
13
|
+
pan: true,
|
|
14
|
+
reset: true,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
animations: {
|
|
18
|
+
enabled: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
dataLabels: {
|
|
22
|
+
enabled: false,
|
|
23
|
+
},
|
|
24
|
+
stroke: {
|
|
25
|
+
curve: 'smooth',
|
|
26
|
+
width: 2,
|
|
27
|
+
},
|
|
28
|
+
xaxis: {
|
|
29
|
+
labels: {
|
|
30
|
+
style: {
|
|
31
|
+
fontSize: '12px',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
yaxis: {
|
|
36
|
+
labels: {
|
|
37
|
+
style: {
|
|
38
|
+
fontSize: '12px',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
legend: {
|
|
43
|
+
position: 'top',
|
|
44
|
+
horizontalAlign: 'left',
|
|
45
|
+
},
|
|
46
|
+
tooltip: {
|
|
47
|
+
enabled: true,
|
|
48
|
+
theme: 'light',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ApexOptions } from 'apexcharts';
|
|
2
|
+
|
|
3
|
+
export type ApexAnnotations = NonNullable<ApexOptions['annotations']>;
|
|
4
|
+
|
|
5
|
+
export type PointAnnotations = NonNullable<ApexAnnotations['points']>;
|
|
6
|
+
export type PointAnnotation = PointAnnotations[number];
|
|
7
|
+
|
|
8
|
+
export type XAxisAnnotations = NonNullable<ApexAnnotations['xaxis']>;
|
|
9
|
+
export type XAxisAnnotation = XAxisAnnotations[number];
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
PointAnnotation,
|
|
3
|
+
PointAnnotations,
|
|
4
|
+
XAxisAnnotation,
|
|
5
|
+
XAxisAnnotations,
|
|
6
|
+
} from '@/charts/chart/types/apexcharts';
|
|
7
|
+
import { applyDefaults } from '@cleen/ui-core';
|
|
8
|
+
import type { ApexOptions } from 'apexcharts';
|
|
9
|
+
import { forwardRef, useMemo } from 'react';
|
|
10
|
+
import type ReactApexChart from 'react-apexcharts';
|
|
11
|
+
import Chart from '../../Chart';
|
|
12
|
+
import {
|
|
13
|
+
DEFAULT_CHART_OPTIONS,
|
|
14
|
+
HIGHLIGHT_LABEL_ANNOTATIONS_PROPS,
|
|
15
|
+
HIGHLIGHT_MARKER_ANNOTATIONS_PROPS,
|
|
16
|
+
POINT_ANNOTATIONS_PROPS,
|
|
17
|
+
RANGE_ANNOTATIONS_PROPS,
|
|
18
|
+
} from './constant';
|
|
19
|
+
import {
|
|
20
|
+
calculateAnnotationAxisX,
|
|
21
|
+
getAnnotationAxisX,
|
|
22
|
+
getAnnotationPointX,
|
|
23
|
+
} from './helper';
|
|
24
|
+
import type { BellCurveSerie, HighlightAnnotation } from './types/bellCurve';
|
|
25
|
+
import type { BellCurveProps } from './types/props';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* BellCurve component built on ApexCharts
|
|
29
|
+
* Provides a custom BellCurve chart with annotations and series segmentation
|
|
30
|
+
*/
|
|
31
|
+
export const BellCurve = forwardRef<ReactApexChart, BellCurveProps>(
|
|
32
|
+
function BellCurve(
|
|
33
|
+
{
|
|
34
|
+
serie,
|
|
35
|
+
labels,
|
|
36
|
+
sigma,
|
|
37
|
+
pointAnnotations,
|
|
38
|
+
rangeAnnotations,
|
|
39
|
+
highlightAnnotations,
|
|
40
|
+
options,
|
|
41
|
+
height = 360,
|
|
42
|
+
...props
|
|
43
|
+
},
|
|
44
|
+
ref
|
|
45
|
+
) {
|
|
46
|
+
const sortedSerie = useMemo(() => serie.sort((a, b) => a.x - b.x), [serie]);
|
|
47
|
+
const serieMap = useMemo(() => {
|
|
48
|
+
const map = new Map<number, number>();
|
|
49
|
+
serie.forEach(el => map.set(el.x, el.y));
|
|
50
|
+
|
|
51
|
+
return map;
|
|
52
|
+
}, [serie]);
|
|
53
|
+
const middlePoint = sortedSerie[Math.floor(sortedSerie.length / 2)];
|
|
54
|
+
|
|
55
|
+
const calculatedSeries: ApexOptions['series'] = useMemo(() => {
|
|
56
|
+
const { below, middle, above } = serie.reduce<{
|
|
57
|
+
below: BellCurveSerie;
|
|
58
|
+
middle: BellCurveSerie;
|
|
59
|
+
above: BellCurveSerie;
|
|
60
|
+
}>(
|
|
61
|
+
(acc, val) => {
|
|
62
|
+
if (val.x < middlePoint.x - 2 * sigma) {
|
|
63
|
+
acc.below.push(val);
|
|
64
|
+
} else if (val.x >= middlePoint.x + 2 * sigma) {
|
|
65
|
+
if (val.x === middlePoint.x + 2 * sigma) {
|
|
66
|
+
acc.middle.push(val);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
acc.above.push(val);
|
|
70
|
+
} else {
|
|
71
|
+
if (val.x === middlePoint.x - 2 * sigma) {
|
|
72
|
+
acc.below.push(val);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
acc.middle.push(val);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return acc;
|
|
79
|
+
},
|
|
80
|
+
{ below: [], middle: [], above: [] }
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
return [
|
|
84
|
+
{ name: labels?.below || 'Below threshold', data: below },
|
|
85
|
+
{ name: labels?.middle || 'Middle grounds', data: middle },
|
|
86
|
+
{ name: labels?.above || 'Above threshold', data: above },
|
|
87
|
+
];
|
|
88
|
+
}, [sigma, serie, labels, middlePoint]);
|
|
89
|
+
|
|
90
|
+
const formattedPointAnnotations = useMemo(() => {
|
|
91
|
+
if (!pointAnnotations) {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const positions = getAnnotationPointX(middlePoint.x, sigma);
|
|
96
|
+
|
|
97
|
+
return Object.entries(pointAnnotations).map<PointAnnotation>(
|
|
98
|
+
([field, value]) => {
|
|
99
|
+
const x = positions[field as keyof typeof pointAnnotations];
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
x,
|
|
103
|
+
y: serieMap.get(x) || 0,
|
|
104
|
+
...applyDefaults(POINT_ANNOTATIONS_PROPS, value),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
}, [pointAnnotations, sigma, serieMap]);
|
|
109
|
+
|
|
110
|
+
const formattedXAxisAnnotations = useMemo(() => {
|
|
111
|
+
if (!rangeAnnotations) {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const positions = getAnnotationAxisX(
|
|
116
|
+
middlePoint.x,
|
|
117
|
+
sigma,
|
|
118
|
+
sortedSerie[0].x,
|
|
119
|
+
sortedSerie[sortedSerie.length - 1].x
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
return rangeAnnotations.map<XAxisAnnotation>(annotation => {
|
|
123
|
+
const pos = calculateAnnotationAxisX(annotation, positions);
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
...applyDefaults(RANGE_ANNOTATIONS_PROPS, annotation),
|
|
127
|
+
...pos,
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
}, [rangeAnnotations, sigma, sortedSerie]);
|
|
131
|
+
|
|
132
|
+
const { highlightPointAnnotations, highlightLineAnnotations } =
|
|
133
|
+
useMemo(() => {
|
|
134
|
+
if (!highlightAnnotations) {
|
|
135
|
+
return {
|
|
136
|
+
highlightLineAnnotations: [],
|
|
137
|
+
highlightPointAnnotations: [],
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const highlightPointAnnotations: PointAnnotations = [];
|
|
142
|
+
const highlightLineAnnotations: XAxisAnnotations = [];
|
|
143
|
+
|
|
144
|
+
const addLine = ({ x, line }: HighlightAnnotation) => {
|
|
145
|
+
highlightLineAnnotations.push(
|
|
146
|
+
applyDefaults(HIGHLIGHT_LABEL_ANNOTATIONS_PROPS, {
|
|
147
|
+
x,
|
|
148
|
+
...line,
|
|
149
|
+
})
|
|
150
|
+
);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const addPoint = ({ x, y, point }: HighlightAnnotation) => {
|
|
154
|
+
highlightPointAnnotations.push(
|
|
155
|
+
applyDefaults(HIGHLIGHT_MARKER_ANNOTATIONS_PROPS, {
|
|
156
|
+
x,
|
|
157
|
+
y,
|
|
158
|
+
...point,
|
|
159
|
+
})
|
|
160
|
+
);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
highlightAnnotations?.forEach(annotation => {
|
|
164
|
+
switch (annotation.show) {
|
|
165
|
+
case 'line':
|
|
166
|
+
addLine(annotation);
|
|
167
|
+
break;
|
|
168
|
+
|
|
169
|
+
case 'point':
|
|
170
|
+
addPoint(annotation);
|
|
171
|
+
break;
|
|
172
|
+
|
|
173
|
+
case 'both':
|
|
174
|
+
addLine(annotation);
|
|
175
|
+
addPoint(annotation);
|
|
176
|
+
break;
|
|
177
|
+
|
|
178
|
+
default:
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
highlightPointAnnotations,
|
|
185
|
+
highlightLineAnnotations,
|
|
186
|
+
};
|
|
187
|
+
}, [highlightAnnotations]);
|
|
188
|
+
|
|
189
|
+
return (
|
|
190
|
+
<Chart
|
|
191
|
+
series={calculatedSeries}
|
|
192
|
+
options={{
|
|
193
|
+
...applyDefaults(DEFAULT_CHART_OPTIONS, options),
|
|
194
|
+
annotations: {
|
|
195
|
+
...options?.annotations,
|
|
196
|
+
points: [
|
|
197
|
+
...formattedPointAnnotations,
|
|
198
|
+
...highlightPointAnnotations,
|
|
199
|
+
...(options?.annotations?.points || []),
|
|
200
|
+
],
|
|
201
|
+
xaxis: [
|
|
202
|
+
...formattedXAxisAnnotations,
|
|
203
|
+
...highlightLineAnnotations,
|
|
204
|
+
...(options?.annotations?.xaxis || []),
|
|
205
|
+
],
|
|
206
|
+
},
|
|
207
|
+
}}
|
|
208
|
+
height={height}
|
|
209
|
+
ref={ref}
|
|
210
|
+
type="area"
|
|
211
|
+
{...props}
|
|
212
|
+
/>
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
);
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ColorHelpers } from '@cleen/ui-core';
|
|
2
|
+
import type { ApexOptions } from 'apexcharts';
|
|
3
|
+
import type {
|
|
4
|
+
PointAnnotation,
|
|
5
|
+
XAxisAnnotation,
|
|
6
|
+
} from '@/charts/chart/types/apexcharts';
|
|
7
|
+
|
|
8
|
+
export const POINT_ANNOTATIONS_PROPS: PointAnnotation = {
|
|
9
|
+
marker: {
|
|
10
|
+
size: 2,
|
|
11
|
+
fillColor: 'rgba(var(--cleen-gray), 0.8)',
|
|
12
|
+
strokeColor: 'rgba(var(--cleen-gray), 0.8)',
|
|
13
|
+
offsetY: -16,
|
|
14
|
+
shape: 'triangle',
|
|
15
|
+
},
|
|
16
|
+
label: {
|
|
17
|
+
borderWidth: 0,
|
|
18
|
+
offsetY: -20,
|
|
19
|
+
style: {
|
|
20
|
+
color: 'rgba(var(--cleen-gray), 0.8)',
|
|
21
|
+
background: 'transparent',
|
|
22
|
+
fontSize: '11px',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const RANGE_ANNOTATIONS_PROPS: XAxisAnnotation = {
|
|
28
|
+
label: {
|
|
29
|
+
borderColor: 'transparent',
|
|
30
|
+
style: {
|
|
31
|
+
color: 'rgba(var(--cleen-white))',
|
|
32
|
+
background: 'rgba(var(--cleen-primary))',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
fillColor: 'rgba(var(--cleen-primary))',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const HIGHLIGHT_LABEL_ANNOTATIONS_PROPS: XAxisAnnotation = {
|
|
39
|
+
label: {
|
|
40
|
+
borderWidth: 0,
|
|
41
|
+
offsetY: -15,
|
|
42
|
+
orientation: 'horizontal',
|
|
43
|
+
style: {
|
|
44
|
+
color: 'rgba(var(--cleen-primary))',
|
|
45
|
+
background: 'transparent',
|
|
46
|
+
fontSize: '16px',
|
|
47
|
+
fontWeight: 700,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
borderColor: 'rgba(var(--cleen-primary))',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const HIGHLIGHT_MARKER_ANNOTATIONS_PROPS: PointAnnotation = {
|
|
54
|
+
marker: {
|
|
55
|
+
size: 8,
|
|
56
|
+
fillColor: 'rgba(var(--cleen-primary))',
|
|
57
|
+
strokeColor: 'rgba(var(--cleen-white))',
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const DEFAULT_CHART_OPTIONS: ApexOptions = {
|
|
62
|
+
chart: {
|
|
63
|
+
zoom: { enabled: false },
|
|
64
|
+
toolbar: { show: false },
|
|
65
|
+
animations: {
|
|
66
|
+
enabled: false,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
stroke: { curve: 'monotoneCubic', width: 2.5 },
|
|
70
|
+
colors: [
|
|
71
|
+
ColorHelpers.getComputedColor('var(--cleen-error)'),
|
|
72
|
+
ColorHelpers.getComputedColor('var(--cleen-primary)'),
|
|
73
|
+
ColorHelpers.getComputedColor('var(--cleen-success)'),
|
|
74
|
+
],
|
|
75
|
+
fill: {
|
|
76
|
+
type: 'gradient',
|
|
77
|
+
gradient: {
|
|
78
|
+
shade: 'light',
|
|
79
|
+
type: 'vertical',
|
|
80
|
+
shadeIntensity: 0.6,
|
|
81
|
+
gradientToColors: [
|
|
82
|
+
ColorHelpers.getComputedColor('var(--cleen-error)') || '',
|
|
83
|
+
ColorHelpers.getComputedColor('var(--cleen-primary)') || '',
|
|
84
|
+
ColorHelpers.getComputedColor('var(--cleen-success)') || '',
|
|
85
|
+
],
|
|
86
|
+
inverseColors: false,
|
|
87
|
+
opacityFrom: 0.95,
|
|
88
|
+
opacityTo: 0.6,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
yaxis: {
|
|
92
|
+
show: false,
|
|
93
|
+
},
|
|
94
|
+
tooltip: {
|
|
95
|
+
enabled: true,
|
|
96
|
+
x: {
|
|
97
|
+
formatter: function (val: string | number) {
|
|
98
|
+
const n = typeof val === 'string' ? Number(val) : val;
|
|
99
|
+
return `Score: ${n}`;
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
y: {
|
|
103
|
+
formatter: function (val: number) {
|
|
104
|
+
return `${Number(val).toFixed(4)}`;
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
grid: { show: false },
|
|
109
|
+
legend: {
|
|
110
|
+
show: false,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { XAxisAnnotation } from '@/charts/chart/types/apexcharts';
|
|
2
|
+
import type { BellCurveRangeAnnotation } from './types/bellCurve';
|
|
3
|
+
|
|
4
|
+
export const getAnnotationPointX = (middle: number, sigma: number) => {
|
|
5
|
+
return {
|
|
6
|
+
middle,
|
|
7
|
+
leftSigma: middle - sigma,
|
|
8
|
+
left2Sigma: middle - 2 * sigma,
|
|
9
|
+
left: middle - 3 * sigma,
|
|
10
|
+
rightSigma: middle + 2 * sigma,
|
|
11
|
+
right2Sigma: middle + 2 * sigma,
|
|
12
|
+
right: middle + 3 * sigma,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const getAnnotationAxisX = (
|
|
17
|
+
middle: number,
|
|
18
|
+
sigma: number,
|
|
19
|
+
minX: number,
|
|
20
|
+
maxX: number
|
|
21
|
+
) => {
|
|
22
|
+
return {
|
|
23
|
+
middle,
|
|
24
|
+
leftSigma: middle - sigma,
|
|
25
|
+
left2Sigma: middle - 2 * sigma,
|
|
26
|
+
left: minX,
|
|
27
|
+
rightSigma: middle + sigma,
|
|
28
|
+
right2Sigma: middle + 2 * sigma,
|
|
29
|
+
right: maxX,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const calculateAnnotationAxisX = (
|
|
34
|
+
annotation: BellCurveRangeAnnotation,
|
|
35
|
+
positions: ReturnType<typeof getAnnotationAxisX>
|
|
36
|
+
) => {
|
|
37
|
+
let props: Partial<XAxisAnnotation> = {};
|
|
38
|
+
|
|
39
|
+
switch (annotation.type) {
|
|
40
|
+
case 'range':
|
|
41
|
+
props = {
|
|
42
|
+
x: positions[annotation.x],
|
|
43
|
+
x2: positions[annotation.x2],
|
|
44
|
+
};
|
|
45
|
+
break;
|
|
46
|
+
|
|
47
|
+
case 'offset':
|
|
48
|
+
props = {
|
|
49
|
+
x: annotation.x - annotation.offset,
|
|
50
|
+
x2: annotation.x + annotation.offset,
|
|
51
|
+
};
|
|
52
|
+
break;
|
|
53
|
+
|
|
54
|
+
case 'region':
|
|
55
|
+
if (
|
|
56
|
+
annotation.x >= positions.left &&
|
|
57
|
+
annotation.x < positions.left2Sigma
|
|
58
|
+
) {
|
|
59
|
+
props = {
|
|
60
|
+
x: positions.left,
|
|
61
|
+
x2: positions.left2Sigma,
|
|
62
|
+
};
|
|
63
|
+
} else if (
|
|
64
|
+
annotation.x >= positions.left2Sigma &&
|
|
65
|
+
annotation.x < positions.leftSigma
|
|
66
|
+
) {
|
|
67
|
+
props = {
|
|
68
|
+
x: positions.left2Sigma,
|
|
69
|
+
x2: positions.leftSigma,
|
|
70
|
+
};
|
|
71
|
+
} else if (
|
|
72
|
+
annotation.x >= positions.leftSigma &&
|
|
73
|
+
annotation.x < positions.middle
|
|
74
|
+
) {
|
|
75
|
+
props = {
|
|
76
|
+
x: positions.leftSigma,
|
|
77
|
+
x2: positions.middle,
|
|
78
|
+
};
|
|
79
|
+
} else if (
|
|
80
|
+
annotation.x >= positions.middle &&
|
|
81
|
+
annotation.x < positions.rightSigma
|
|
82
|
+
) {
|
|
83
|
+
props = {
|
|
84
|
+
x: positions.middle,
|
|
85
|
+
x2: positions.rightSigma,
|
|
86
|
+
};
|
|
87
|
+
} else if (
|
|
88
|
+
annotation.x >= positions.rightSigma &&
|
|
89
|
+
annotation.x < positions.right2Sigma
|
|
90
|
+
) {
|
|
91
|
+
props = {
|
|
92
|
+
x: positions.rightSigma,
|
|
93
|
+
x2: positions.right2Sigma,
|
|
94
|
+
};
|
|
95
|
+
} else if (
|
|
96
|
+
annotation.x >= positions.right2Sigma &&
|
|
97
|
+
annotation.x < positions.right
|
|
98
|
+
) {
|
|
99
|
+
props = {
|
|
100
|
+
x: positions.right2Sigma,
|
|
101
|
+
x2: positions.right,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
|
|
106
|
+
case 'custom':
|
|
107
|
+
default:
|
|
108
|
+
props = {
|
|
109
|
+
x: annotation.x,
|
|
110
|
+
x2: annotation.x2,
|
|
111
|
+
};
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return props;
|
|
116
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
PointAnnotation,
|
|
3
|
+
XAxisAnnotation,
|
|
4
|
+
} from '@/charts/chart/types/apexcharts';
|
|
5
|
+
|
|
6
|
+
export type BellPoints =
|
|
7
|
+
| 'middle'
|
|
8
|
+
| 'leftSigma'
|
|
9
|
+
| 'left2Sigma'
|
|
10
|
+
| 'left'
|
|
11
|
+
| 'rightSigma'
|
|
12
|
+
| 'right2Sigma'
|
|
13
|
+
| 'right';
|
|
14
|
+
|
|
15
|
+
export type BellCurveSerie = {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
}[];
|
|
19
|
+
|
|
20
|
+
export interface HighlightAnnotation {
|
|
21
|
+
x: number;
|
|
22
|
+
y?: number;
|
|
23
|
+
show?: 'line' | 'point' | 'both';
|
|
24
|
+
line?: XAxisAnnotation;
|
|
25
|
+
point?: PointAnnotation;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
type RangeAnnotation = Omit<XAxisAnnotation, 'x' | 'x2'>;
|
|
29
|
+
|
|
30
|
+
export type BellCurveRangeAnnotation =
|
|
31
|
+
| (RangeAnnotation & {
|
|
32
|
+
type: 'range';
|
|
33
|
+
x: BellPoints;
|
|
34
|
+
x2: BellPoints;
|
|
35
|
+
})
|
|
36
|
+
| (RangeAnnotation & {
|
|
37
|
+
type: 'region';
|
|
38
|
+
x: number;
|
|
39
|
+
})
|
|
40
|
+
| (RangeAnnotation & {
|
|
41
|
+
type: 'offset';
|
|
42
|
+
x: number;
|
|
43
|
+
offset: number;
|
|
44
|
+
})
|
|
45
|
+
| (XAxisAnnotation & {
|
|
46
|
+
type: 'custom';
|
|
47
|
+
});
|