@cleen/ui 0.1.0 → 0.1.2
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/README.md +37 -0
- package/dist/charts/index.d.ts +118 -0
- package/dist/charts/index.js +1 -0
- package/dist/icons/index.d.ts +35 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.d.ts +2959 -0
- package/dist/index.js +19 -0
- package/package.json +54 -54
- package/src/charts/chart/Chart.tsx +0 -82
- package/src/charts/chart/constant.ts +0 -50
- package/src/charts/chart/index.ts +0 -2
- package/src/charts/chart/types/apexcharts.ts +0 -9
- package/src/charts/chart/variants/BellCurve/BellCurve.tsx +0 -215
- package/src/charts/chart/variants/BellCurve/constant.ts +0 -112
- package/src/charts/chart/variants/BellCurve/helper.ts +0 -116
- package/src/charts/chart/variants/BellCurve/index.ts +0 -2
- package/src/charts/chart/variants/BellCurve/types/bellCurve.ts +0 -47
- package/src/charts/chart/variants/BellCurve/types/props.ts +0 -21
- package/src/charts/chart/variants/RadarChart/RadarChart.tsx +0 -22
- package/src/charts/chart/variants/RadarChart/constant.ts +0 -28
- package/src/charts/chart/variants/RadarChart/index.ts +0 -1
- package/src/charts/chart/variants/ScatterChart/ScatterChart.tsx +0 -23
- package/src/charts/chart/variants/ScatterChart/constant.ts +0 -54
- package/src/charts/chart/variants/ScatterChart/index.ts +0 -1
- package/src/charts/chart/variants/index.ts +0 -3
- package/src/charts/index.ts +0 -2
- package/src/charts/simpleChart/SimpleChart.tsx +0 -54
- package/src/charts/simpleChart/index.ts +0 -1
- package/src/components/advancedProgressBar/AdvancedProgressBar.tsx +0 -156
- package/src/components/advancedProgressBar/blocks/Bar.tsx +0 -118
- package/src/components/advancedProgressBar/blocks/BlockLabel.tsx +0 -49
- package/src/components/advancedProgressBar/blocks/Clamp.tsx +0 -85
- package/src/components/advancedProgressBar/constants.ts +0 -6
- package/src/components/advancedProgressBar/index.ts +0 -2
- package/src/components/advancedProgressBar/types/props.ts +0 -69
- package/src/components/advancedProgressBar/utils.ts +0 -17
- package/src/components/audioPlayback/AudioPlayback.tsx +0 -141
- package/src/components/audioPlayback/index.ts +0 -2
- package/src/components/audioRecorder/AudioRecorder.tsx +0 -391
- package/src/components/audioRecorder/constant/default.ts +0 -19
- package/src/components/audioRecorder/constant/labels.ts +0 -9
- package/src/components/audioRecorder/index.ts +0 -2
- package/src/components/audioRecorder/types/props.ts +0 -56
- package/src/components/avatar/Avatar.tsx +0 -132
- package/src/components/avatar/index.ts +0 -1
- package/src/components/avatar/variants.ts +0 -9
- package/src/components/avatarRow/AvatarRow.tsx +0 -127
- package/src/components/avatarRow/index.ts +0 -1
- package/src/components/breadcrumb/Breadcrumb.tsx +0 -158
- package/src/components/breadcrumb/index.ts +0 -1
- package/src/components/button/Button.tsx +0 -114
- package/src/components/button/index.ts +0 -2
- package/src/components/button/variants.ts +0 -41
- package/src/components/card/Card.tsx +0 -197
- package/src/components/card/index.ts +0 -3
- package/src/components/card/variants/CardIcon/CardIcon.tsx +0 -158
- package/src/components/card/variants/CardMedia/CardMedia.tsx +0 -127
- package/src/components/checkbox/Checkbox.tsx +0 -246
- package/src/components/checkbox/index.ts +0 -1
- package/src/components/checkbox/variants.ts +0 -13
- package/src/components/checkboxGroup/CheckboxGroup.tsx +0 -163
- package/src/components/checkboxGroup/index.ts +0 -1
- package/src/components/cleenIcon/CleenIcon.tsx +0 -674
- package/src/components/cleenIcon/icons/IconAlertCircle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconAlertFeatured.tsx +0 -30
- package/src/components/cleenIcon/icons/IconAlertOctagon.tsx +0 -21
- package/src/components/cleenIcon/icons/IconAlertTriangle.tsx +0 -25
- package/src/components/cleenIcon/icons/IconAlignRight.tsx +0 -25
- package/src/components/cleenIcon/icons/IconArrowDown.tsx +0 -25
- package/src/components/cleenIcon/icons/IconArrowLeft.tsx +0 -25
- package/src/components/cleenIcon/icons/IconArrowLeft2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconArrowRight.tsx +0 -25
- package/src/components/cleenIcon/icons/IconArrowToTop.tsx +0 -20
- package/src/components/cleenIcon/icons/IconArrowUp.tsx +0 -22
- package/src/components/cleenIcon/icons/IconArrowUpRight.tsx +0 -22
- package/src/components/cleenIcon/icons/IconArrowUpRightNarrow.tsx +0 -22
- package/src/components/cleenIcon/icons/IconArrowUpRightSquare.tsx +0 -22
- package/src/components/cleenIcon/icons/IconAttachment.tsx +0 -22
- package/src/components/cleenIcon/icons/IconBarChartSquare.tsx +0 -22
- package/src/components/cleenIcon/icons/IconBold.tsx +0 -16
- package/src/components/cleenIcon/icons/IconBookmarkCheck.tsx +0 -22
- package/src/components/cleenIcon/icons/IconBookmarkCheckFill.tsx +0 -37
- package/src/components/cleenIcon/icons/IconBookmarkPlus.tsx +0 -22
- package/src/components/cleenIcon/icons/IconBookmarkX.tsx +0 -22
- package/src/components/cleenIcon/icons/IconBoxLines.tsx +0 -16
- package/src/components/cleenIcon/icons/IconBoxText.tsx +0 -24
- package/src/components/cleenIcon/icons/IconBracketsCheck.tsx +0 -25
- package/src/components/cleenIcon/icons/IconBracketsEllipses.tsx +0 -22
- package/src/components/cleenIcon/icons/IconBuilding.tsx +0 -22
- package/src/components/cleenIcon/icons/IconCalendar.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCertificateHeart.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCheck.tsx +0 -22
- package/src/components/cleenIcon/icons/IconCheckCircle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconCheckCircleBroken.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCheckFill.tsx +0 -45
- package/src/components/cleenIcon/icons/IconCheckVerified.tsx +0 -22
- package/src/components/cleenIcon/icons/IconChevronDown.tsx +0 -22
- package/src/components/cleenIcon/icons/IconChevronLeft.tsx +0 -25
- package/src/components/cleenIcon/icons/IconChevronLeftDouble.tsx +0 -22
- package/src/components/cleenIcon/icons/IconChevronRight.tsx +0 -25
- package/src/components/cleenIcon/icons/IconChevronRightDouble.tsx +0 -22
- package/src/components/cleenIcon/icons/IconChevronSelectorVertical.tsx +0 -22
- package/src/components/cleenIcon/icons/IconChevronUp.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCircleSwap.tsx +0 -22
- package/src/components/cleenIcon/icons/IconClockFastForward.tsx +0 -25
- package/src/components/cleenIcon/icons/IconClockRewind.tsx +0 -25
- package/src/components/cleenIcon/icons/IconClockRewind2.tsx +0 -21
- package/src/components/cleenIcon/icons/IconCodeBrowser.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCodeCircle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconColors.tsx +0 -25
- package/src/components/cleenIcon/icons/IconColumnEdit.tsx +0 -19
- package/src/components/cleenIcon/icons/IconCopy.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCopy2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconCopy3.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCopy4.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCopy5.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCopyCheck.tsx +0 -22
- package/src/components/cleenIcon/icons/IconCube.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCubeOutline.tsx +0 -22
- package/src/components/cleenIcon/icons/IconCursorBox.tsx +0 -25
- package/src/components/cleenIcon/icons/IconDataflow.tsx +0 -22
- package/src/components/cleenIcon/icons/IconDataflow2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconDataflow3.tsx +0 -29
- package/src/components/cleenIcon/icons/IconDelete.tsx +0 -25
- package/src/components/cleenIcon/icons/IconDollarCircle.tsx +0 -25
- package/src/components/cleenIcon/icons/IconDotsGrid.tsx +0 -74
- package/src/components/cleenIcon/icons/IconDotsHorizontal.tsx +0 -34
- package/src/components/cleenIcon/icons/IconDotsVertical.tsx +0 -38
- package/src/components/cleenIcon/icons/IconEdit.tsx +0 -25
- package/src/components/cleenIcon/icons/IconEditable.tsx +0 -25
- package/src/components/cleenIcon/icons/IconExpand.tsx +0 -22
- package/src/components/cleenIcon/icons/IconEye.tsx +0 -28
- package/src/components/cleenIcon/icons/IconEyeHidden.tsx +0 -25
- package/src/components/cleenIcon/icons/IconEyeHidden2.tsx +0 -24
- package/src/components/cleenIcon/icons/IconFaceSmile.tsx +0 -24
- package/src/components/cleenIcon/icons/IconFilter.tsx +0 -22
- package/src/components/cleenIcon/icons/IconFilter2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconFlag.tsx +0 -22
- package/src/components/cleenIcon/icons/IconFlag2.tsx +0 -25
- package/src/components/cleenIcon/icons/IconFlag3.tsx +0 -16
- package/src/components/cleenIcon/icons/IconHandShield.tsx +0 -22
- package/src/components/cleenIcon/icons/IconHash.tsx +0 -22
- package/src/components/cleenIcon/icons/IconHeadsetMic.tsx +0 -21
- package/src/components/cleenIcon/icons/IconHeart.tsx +0 -24
- package/src/components/cleenIcon/icons/IconHouseLine.tsx +0 -22
- package/src/components/cleenIcon/icons/IconImage.tsx +0 -22
- package/src/components/cleenIcon/icons/IconImage2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconImage3.tsx +0 -17
- package/src/components/cleenIcon/icons/IconImage4.tsx +0 -25
- package/src/components/cleenIcon/icons/IconImageCheck.tsx +0 -22
- package/src/components/cleenIcon/icons/IconInfoCircle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconInfoHexagon.tsx +0 -25
- package/src/components/cleenIcon/icons/IconItalic.tsx +0 -16
- package/src/components/cleenIcon/icons/IconLayersMultiple.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLayersSingle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLayout.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLayout2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLayoutColumns.tsx +0 -20
- package/src/components/cleenIcon/icons/IconLayoutCustom.tsx +0 -16
- package/src/components/cleenIcon/icons/IconLayoutSequential.tsx +0 -16
- package/src/components/cleenIcon/icons/IconLayoutStuffed.tsx +0 -20
- package/src/components/cleenIcon/icons/IconLayoutTile.tsx +0 -16
- package/src/components/cleenIcon/icons/IconLifeBuoy.tsx +0 -29
- package/src/components/cleenIcon/icons/IconLightbulb.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLightning.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLightning2.tsx +0 -25
- package/src/components/cleenIcon/icons/IconLightningFast.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLineChartBar.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLineChartBreakoutSquare.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLineChartUp.tsx +0 -25
- package/src/components/cleenIcon/icons/IconLineChartUp2.tsx +0 -34
- package/src/components/cleenIcon/icons/IconLines.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLinesCheck.tsx +0 -16
- package/src/components/cleenIcon/icons/IconLinesPlay.tsx +0 -23
- package/src/components/cleenIcon/icons/IconLink.tsx +0 -25
- package/src/components/cleenIcon/icons/IconLink2.tsx +0 -24
- package/src/components/cleenIcon/icons/IconLink3.tsx +0 -21
- package/src/components/cleenIcon/icons/IconLink4.tsx +0 -17
- package/src/components/cleenIcon/icons/IconLink5.tsx +0 -22
- package/src/components/cleenIcon/icons/IconListBullet.tsx +0 -18
- package/src/components/cleenIcon/icons/IconListOrder.tsx +0 -20
- package/src/components/cleenIcon/icons/IconListOrder2.tsx +0 -16
- package/src/components/cleenIcon/icons/IconLock.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLock2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLogIn.tsx +0 -25
- package/src/components/cleenIcon/icons/IconLogOut.tsx +0 -25
- package/src/components/cleenIcon/icons/IconLogOut2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconMagicWand.tsx +0 -25
- package/src/components/cleenIcon/icons/IconMagicWand2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconMail.tsx +0 -25
- package/src/components/cleenIcon/icons/IconMessageSquare.tsx +0 -25
- package/src/components/cleenIcon/icons/IconMessageSquare2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconMessageXSquare.tsx +0 -25
- package/src/components/cleenIcon/icons/IconMinusCircle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconMobile.tsx +0 -25
- package/src/components/cleenIcon/icons/IconMonitor.tsx +0 -22
- package/src/components/cleenIcon/icons/IconMonitor2.tsx +0 -25
- package/src/components/cleenIcon/icons/IconMonitor3.tsx +0 -25
- package/src/components/cleenIcon/icons/IconMoonCircle.tsx +0 -28
- package/src/components/cleenIcon/icons/IconNavigationPointer.tsx +0 -22
- package/src/components/cleenIcon/icons/IconNotificationBox.tsx +0 -22
- package/src/components/cleenIcon/icons/IconPCSetup.tsx +0 -22
- package/src/components/cleenIcon/icons/IconPalette.tsx +0 -40
- package/src/components/cleenIcon/icons/IconPasscodeLock.tsx +0 -25
- package/src/components/cleenIcon/icons/IconPencil.tsx +0 -25
- package/src/components/cleenIcon/icons/IconPercentageCircle.tsx +0 -29
- package/src/components/cleenIcon/icons/IconPerspective.tsx +0 -22
- package/src/components/cleenIcon/icons/IconPhoneCall.tsx +0 -25
- package/src/components/cleenIcon/icons/IconPin.tsx +0 -22
- package/src/components/cleenIcon/icons/IconPlayCircle.tsx +0 -28
- package/src/components/cleenIcon/icons/IconPlus.tsx +0 -22
- package/src/components/cleenIcon/icons/IconPlusCircle.tsx +0 -25
- package/src/components/cleenIcon/icons/IconPulse.tsx +0 -25
- package/src/components/cleenIcon/icons/IconQuestionCircle.tsx +0 -24
- package/src/components/cleenIcon/icons/IconRadioButton.tsx +0 -27
- package/src/components/cleenIcon/icons/IconRadioButtonActive.tsx +0 -39
- package/src/components/cleenIcon/icons/IconReceiptCheck.tsx +0 -25
- package/src/components/cleenIcon/icons/IconRedo.tsx +0 -16
- package/src/components/cleenIcon/icons/IconRefresh.tsx +0 -22
- package/src/components/cleenIcon/icons/IconRefresh2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconRefresh3.tsx +0 -20
- package/src/components/cleenIcon/icons/IconRepeat.tsx +0 -22
- package/src/components/cleenIcon/icons/IconRepeat2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconRetweet.tsx +0 -33
- package/src/components/cleenIcon/icons/IconRoundChart.tsx +0 -25
- package/src/components/cleenIcon/icons/IconRoundChart2.tsx +0 -29
- package/src/components/cleenIcon/icons/IconRoute.tsx +0 -22
- package/src/components/cleenIcon/icons/IconSave.tsx +0 -25
- package/src/components/cleenIcon/icons/IconSave2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconScanDots.tsx +0 -22
- package/src/components/cleenIcon/icons/IconSearch.tsx +0 -22
- package/src/components/cleenIcon/icons/IconSend.tsx +0 -25
- package/src/components/cleenIcon/icons/IconSettings.tsx +0 -32
- package/src/components/cleenIcon/icons/IconSettings2.tsx +0 -25
- package/src/components/cleenIcon/icons/IconSettings3.tsx +0 -22
- package/src/components/cleenIcon/icons/IconShieldLightning.tsx +0 -22
- package/src/components/cleenIcon/icons/IconShieldPlus.tsx +0 -22
- package/src/components/cleenIcon/icons/IconShieldRemove.tsx +0 -16
- package/src/components/cleenIcon/icons/IconShuffle.tsx +0 -25
- package/src/components/cleenIcon/icons/IconSlashCircle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconSlashOctagon.tsx +0 -22
- package/src/components/cleenIcon/icons/IconSocialGlobe.tsx +0 -23
- package/src/components/cleenIcon/icons/IconSocialLinkedin.tsx +0 -21
- package/src/components/cleenIcon/icons/IconSocialX.tsx +0 -28
- package/src/components/cleenIcon/icons/IconSpeedometer.tsx +0 -22
- package/src/components/cleenIcon/icons/IconStairsRound.tsx +0 -21
- package/src/components/cleenIcon/icons/IconStar.tsx +0 -22
- package/src/components/cleenIcon/icons/IconStarHalf.tsx +0 -39
- package/src/components/cleenIcon/icons/IconStars.tsx +0 -28
- package/src/components/cleenIcon/icons/IconStars2.tsx +0 -29
- package/src/components/cleenIcon/icons/IconStrikethrough.tsx +0 -16
- package/src/components/cleenIcon/icons/IconSuccessFeatured.tsx +0 -30
- package/src/components/cleenIcon/icons/IconSun.tsx +0 -22
- package/src/components/cleenIcon/icons/IconSwitchHorizontal.tsx +0 -22
- package/src/components/cleenIcon/icons/IconTag.tsx +0 -22
- package/src/components/cleenIcon/icons/IconTarget.tsx +0 -21
- package/src/components/cleenIcon/icons/IconTarget2.tsx +0 -34
- package/src/components/cleenIcon/icons/IconTextFormat.tsx +0 -17
- package/src/components/cleenIcon/icons/IconTextFormat2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconTextHighlight.tsx +0 -16
- package/src/components/cleenIcon/icons/IconTranslate.tsx +0 -25
- package/src/components/cleenIcon/icons/IconTrash.tsx +0 -25
- package/src/components/cleenIcon/icons/IconTrending.tsx +0 -22
- package/src/components/cleenIcon/icons/IconUnderline.tsx +0 -16
- package/src/components/cleenIcon/icons/IconUndo.tsx +0 -22
- package/src/components/cleenIcon/icons/IconUndo2.tsx +0 -16
- package/src/components/cleenIcon/icons/IconUploadCloud.tsx +0 -22
- package/src/components/cleenIcon/icons/IconUser.tsx +0 -22
- package/src/components/cleenIcon/icons/IconUserEdit.tsx +0 -25
- package/src/components/cleenIcon/icons/IconUserRight.tsx +0 -22
- package/src/components/cleenIcon/icons/IconUserSquare.tsx +0 -25
- package/src/components/cleenIcon/icons/IconUsers.tsx +0 -25
- package/src/components/cleenIcon/icons/IconUsersUp.tsx +0 -25
- package/src/components/cleenIcon/icons/IconVolume.tsx +0 -25
- package/src/components/cleenIcon/icons/IconWrench.tsx +0 -22
- package/src/components/cleenIcon/icons/IconX.tsx +0 -25
- package/src/components/cleenIcon/icons/IconXCircle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconXCircle2.tsx +0 -42
- package/src/components/cleenIcon/icons/IconXClose.tsx +0 -25
- package/src/components/cleenIcon/icons/IconXSquare.tsx +0 -22
- package/src/components/cleenIcon/icons/index.ts +0 -215
- package/src/components/cleenIcon/index.ts +0 -4
- package/src/components/cleenIcon/types/icon.ts +0 -226
- package/src/components/collapsible/Collapsible.tsx +0 -148
- package/src/components/collapsible/index.ts +0 -5
- package/src/components/creditCardInput/CreditCardInput.tsx +0 -236
- package/src/components/creditCardInput/index.ts +0 -2
- package/src/components/creditCardInput/types/card.ts +0 -13
- package/src/components/creditCardInput/types/props.ts +0 -44
- package/src/components/creditCardInput/util/format.ts +0 -102
- package/src/components/datePicker/DatePicker.tsx +0 -235
- package/src/components/datePicker/index.ts +0 -2
- package/src/components/datePicker/types/props.ts +0 -47
- package/src/components/datePicker/utils/date.ts +0 -40
- package/src/components/divider/Divider.tsx +0 -43
- package/src/components/divider/index.ts +0 -1
- package/src/components/drawer/Drawer.tsx +0 -222
- package/src/components/drawer/index.ts +0 -1
- package/src/components/dropdown/Dropdown.tsx +0 -224
- package/src/components/dropdown/index.ts +0 -1
- package/src/components/filterDrawer/FilterDrawer.tsx +0 -147
- package/src/components/filterDrawer/blocks/FilterDrawerFooter.tsx +0 -119
- package/src/components/filterDrawer/blocks/SaveFilterStep.tsx +0 -56
- package/src/components/filterDrawer/blocks/SavedFilterRow.tsx +0 -166
- package/src/components/filterDrawer/blocks/SavedFiltersDropdown.tsx +0 -142
- package/src/components/filterDrawer/constants/filter.ts +0 -4
- package/src/components/filterDrawer/constants/labels.ts +0 -52
- package/src/components/filterDrawer/constants/tab.ts +0 -7
- package/src/components/filterDrawer/context/context.ts +0 -28
- package/src/components/filterDrawer/context/provider.tsx +0 -50
- package/src/components/filterDrawer/index.ts +0 -7
- package/src/components/filterDrawer/types/filters.ts +0 -28
- package/src/components/filterDrawer/types/props.ts +0 -107
- package/src/components/filterDrawer/types/validation.ts +0 -6
- package/src/components/formGroup/FormGroup.tsx +0 -165
- package/src/components/formGroup/index.ts +0 -1
- package/src/components/groupSelector/GroupSelector.tsx +0 -729
- package/src/components/groupSelector/index.ts +0 -6
- package/src/components/index.ts +0 -44
- package/src/components/infoLabels/InfoLabels.tsx +0 -88
- package/src/components/infoLabels/index.ts +0 -1
- package/src/components/input/Input.tsx +0 -269
- package/src/components/input/index.ts +0 -1
- package/src/components/loader/Loader.tsx +0 -91
- package/src/components/loader/index.ts +0 -1
- package/src/components/lookup/Lookup.tsx +0 -433
- package/src/components/lookup/blocks/LookupOptionList.tsx +0 -130
- package/src/components/lookup/index.ts +0 -2
- package/src/components/lookup/types/lookup.ts +0 -97
- package/src/components/menu/Menu.tsx +0 -103
- package/src/components/menu/blocks/MenuContent.tsx +0 -105
- package/src/components/menu/blocks/MenuItem.tsx +0 -120
- package/src/components/menu/index.ts +0 -2
- package/src/components/menu/types/menu.ts +0 -30
- package/src/components/menu/types/menuItem.ts +0 -48
- package/src/components/modal/Modal.tsx +0 -191
- package/src/components/modal/index.ts +0 -1
- package/src/components/notification/Notification.tsx +0 -79
- package/src/components/notification/constant/notification.ts +0 -30
- package/src/components/notification/index.ts +0 -2
- package/src/components/notification/wrappers/CleenNotificationContainer.tsx +0 -9
- package/src/components/pagination/Pagination.tsx +0 -294
- package/src/components/pagination/blocks/PaginationGoToPage.tsx +0 -91
- package/src/components/pagination/blocks/PaginationPageSize.tsx +0 -145
- package/src/components/pagination/constants/labels.ts +0 -15
- package/src/components/pagination/index.ts +0 -9
- package/src/components/pillBadge/PillBadge.tsx +0 -130
- package/src/components/pillBadge/helper.ts +0 -11
- package/src/components/pillBadge/index.ts +0 -1
- package/src/components/pillBadge/variants.ts +0 -47
- package/src/components/popover/Popover.tsx +0 -108
- package/src/components/popover/index.ts +0 -2
- package/src/components/popover/types/popover.ts +0 -21
- package/src/components/progressBar/ProgressBar.tsx +0 -179
- package/src/components/progressBar/index.ts +0 -1
- package/src/components/progressCircle/ProgressCircle.tsx +0 -142
- package/src/components/progressCircle/index.ts +0 -1
- package/src/components/radioBoxGroup/RadioBoxGroup.tsx +0 -207
- package/src/components/radioBoxGroup/index.ts +0 -1
- package/src/components/radioButtonGroup/RadioButtonGroup.tsx +0 -208
- package/src/components/radioButtonGroup/blocks/RadioButton.tsx +0 -22
- package/src/components/radioButtonGroup/index.ts +0 -4
- package/src/components/radioButtonGroup/types/radioButton.ts +0 -10
- package/src/components/rangeSlider/RangeSlider.tsx +0 -366
- package/src/components/rangeSlider/index.ts +0 -1
- package/src/components/select/Select.tsx +0 -349
- package/src/components/select/blocks/SelectCustomMenuList.tsx +0 -70
- package/src/components/select/blocks/SelectNoOptionsMessage.tsx +0 -22
- package/src/components/select/blocks/SelectOption.tsx +0 -19
- package/src/components/select/blocks/SelectSingleValue.tsx +0 -28
- package/src/components/select/index.ts +0 -1
- package/src/components/sidebar/Sidebar.tsx +0 -210
- package/src/components/sidebar/SidebarItem.tsx +0 -88
- package/src/components/sidebar/drawerContainer/DrawerContainer.tsx +0 -36
- package/src/components/sidebar/drawerContainer/DrawerContentTitle.tsx +0 -165
- package/src/components/sidebar/drawerContainer/index.ts +0 -2
- package/src/components/sidebar/index.ts +0 -13
- package/src/components/sidebar/types.ts +0 -157
- package/src/components/skeletons/blocks/Skeleton.tsx +0 -72
- package/src/components/skeletons/blocks/SkeletonAvatar.tsx +0 -43
- package/src/components/skeletons/blocks/SkeletonBadge.tsx +0 -30
- package/src/components/skeletons/blocks/SkeletonBanner.tsx +0 -44
- package/src/components/skeletons/blocks/SkeletonButton.tsx +0 -31
- package/src/components/skeletons/blocks/SkeletonCard.tsx +0 -39
- package/src/components/skeletons/blocks/SkeletonCard2.tsx +0 -57
- package/src/components/skeletons/blocks/SkeletonCard3.tsx +0 -89
- package/src/components/skeletons/blocks/SkeletonCardStack.tsx +0 -22
- package/src/components/skeletons/blocks/SkeletonChart.tsx +0 -114
- package/src/components/skeletons/blocks/SkeletonContentCard.tsx +0 -75
- package/src/components/skeletons/blocks/SkeletonDataGrid.tsx +0 -73
- package/src/components/skeletons/blocks/SkeletonForm.tsx +0 -50
- package/src/components/skeletons/blocks/SkeletonImage.tsx +0 -45
- package/src/components/skeletons/blocks/SkeletonInfoCard.tsx +0 -130
- package/src/components/skeletons/blocks/SkeletonInput.tsx +0 -32
- package/src/components/skeletons/blocks/SkeletonList.tsx +0 -67
- package/src/components/skeletons/blocks/SkeletonParagraph.tsx +0 -52
- package/src/components/skeletons/blocks/SkeletonText.tsx +0 -22
- package/src/components/skeletons/blocks/SkeletonVideo.tsx +0 -71
- package/src/components/skeletons/blocks/SkeletonWidgetCard.tsx +0 -56
- package/src/components/skeletons/blocks/SkeletonWrapper.tsx +0 -140
- package/src/components/skeletons/index.ts +0 -24
- package/src/components/skeletons/styles/skeleton.ts +0 -2
- package/src/components/skeletons/types/skeleton.ts +0 -8
- package/src/components/slider/Slider.tsx +0 -298
- package/src/components/slider/index.ts +0 -1
- package/src/components/stepper/Stepper.tsx +0 -185
- package/src/components/stepper/index.ts +0 -1
- package/src/components/switch/Switch.tsx +0 -152
- package/src/components/switch/index.ts +0 -1
- package/src/components/tabs/Tabs.tsx +0 -140
- package/src/components/tabs/index.ts +0 -2
- package/src/components/tabs/types/tab.ts +0 -33
- package/src/components/tabs/variants.ts +0 -49
- package/src/components/textArea/TextArea.tsx +0 -244
- package/src/components/textArea/index.ts +0 -1
- package/src/components/tooltip/Tooltip.tsx +0 -200
- package/src/components/tooltip/index.ts +0 -1
- package/src/icons/IconFromLibrary.tsx +0 -13
- package/src/icons/getIconByName.ts +0 -81
- package/src/icons/index.ts +0 -16
- package/src/index.ts +0 -1
- package/tsconfig.json +0 -27
- package/tsup.config.ts +0 -23
package/package.json
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@cleen/ui",
|
|
3
|
-
"version": "0.1.
|
|
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
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@cleen/ui",
|
|
3
|
+
"version": "0.1.2",
|
|
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
|
+
"tailwindcss": "^3.4.17",
|
|
51
|
+
"tsup": "^8.5.1",
|
|
52
|
+
"typescript": "~5.8.3"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -1,82 +0,0 @@
|
|
|
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;
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
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];
|
|
@@ -1,215 +0,0 @@
|
|
|
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
|
-
);
|
|
@@ -1,112 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,116 +0,0 @@
|
|
|
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
|
-
};
|