@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
|
@@ -1,729 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cn,
|
|
3
|
-
useDebounce,
|
|
4
|
-
useOutsideClick,
|
|
5
|
-
usePositionClose,
|
|
6
|
-
type Position,
|
|
7
|
-
} from '@cleen/ui-core';
|
|
8
|
-
import React, {
|
|
9
|
-
useEffect,
|
|
10
|
-
useMemo,
|
|
11
|
-
useRef,
|
|
12
|
-
useState,
|
|
13
|
-
type ComponentProps,
|
|
14
|
-
type CSSProperties,
|
|
15
|
-
type JSX,
|
|
16
|
-
} from 'react';
|
|
17
|
-
import { createPortal } from 'react-dom';
|
|
18
|
-
import { Button } from '../button';
|
|
19
|
-
import {
|
|
20
|
-
IconChevronDown,
|
|
21
|
-
IconChevronUp,
|
|
22
|
-
IconDotsVertical,
|
|
23
|
-
IconPlusCircle,
|
|
24
|
-
} from '../cleenIcon';
|
|
25
|
-
import { Divider } from '../divider';
|
|
26
|
-
import { Input } from '../input';
|
|
27
|
-
import { Loader } from '../loader';
|
|
28
|
-
import { Menu } from '../menu';
|
|
29
|
-
import { PillBadge } from '../pillBadge';
|
|
30
|
-
|
|
31
|
-
function isObject(value: unknown): value is Record<string, unknown> {
|
|
32
|
-
return value !== null && typeof value === 'object';
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function getProp<T = unknown>(obj: unknown, key: string): T | undefined {
|
|
36
|
-
if (!isObject(obj)) return undefined;
|
|
37
|
-
if (!(key in obj)) return undefined;
|
|
38
|
-
return (obj as Record<string, unknown>)[key] as T;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function getArrayProp<T = unknown>(obj: unknown, key: string): T[] {
|
|
42
|
-
const v = getProp<unknown>(obj, key);
|
|
43
|
-
if (Array.isArray(v)) return v as T[];
|
|
44
|
-
return [];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface GroupSelectorSaveResult {
|
|
48
|
-
success: boolean;
|
|
49
|
-
[k: string]: unknown;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface LabelsProps extends ComponentProps<'div'> {
|
|
53
|
-
inputPlaceholder?: string;
|
|
54
|
-
newGroupPlaceholder?: string;
|
|
55
|
-
newItemPlaceholder?: string;
|
|
56
|
-
saveButtonLabel?: string;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface GroupSelectorThreeDotOption<T = unknown> {
|
|
60
|
-
label: string;
|
|
61
|
-
icon?: React.ReactElement;
|
|
62
|
-
onClick: (target: T) => void;
|
|
63
|
-
disabledOptionCallback?: (target: T) => boolean;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface GroupSelectorProps<G = unknown, I = unknown> {
|
|
67
|
-
position?: Position;
|
|
68
|
-
labels?: LabelsProps;
|
|
69
|
-
groups?: G[] | null;
|
|
70
|
-
selectedItemID?: string | number | null;
|
|
71
|
-
groupThreeDotMenuOptions?: GroupSelectorThreeDotOption<G>[];
|
|
72
|
-
itemThreeDotMenuOptions?: GroupSelectorThreeDotOption<I>[];
|
|
73
|
-
refetchData?: () => Promise<void> | void;
|
|
74
|
-
onGroupSave?: (
|
|
75
|
-
payload: Record<string, unknown>
|
|
76
|
-
) => Promise<GroupSelectorSaveResult>;
|
|
77
|
-
onItemSave?: (
|
|
78
|
-
payload: Record<string, unknown>
|
|
79
|
-
) => Promise<GroupSelectorSaveResult>;
|
|
80
|
-
onGroupThreeDotMenuClick?: (group: G | null) => void;
|
|
81
|
-
onItemThreeDotMenuClick?: (item: I | null) => void;
|
|
82
|
-
onSearchChange?: (searchText: string) => void;
|
|
83
|
-
onItemSelect?: (item: I | null) => void;
|
|
84
|
-
groupIDKey: string;
|
|
85
|
-
groupTitleKey: string;
|
|
86
|
-
itemsKey: string;
|
|
87
|
-
itemIDKey: string;
|
|
88
|
-
itemGroupIDKey: string;
|
|
89
|
-
itemTitleKey: string;
|
|
90
|
-
itemSubtitleKey?: string;
|
|
91
|
-
newValueMinLength?: number;
|
|
92
|
-
isLoading?: boolean;
|
|
93
|
-
isGroupSaving?: boolean;
|
|
94
|
-
isItemSaving?: boolean;
|
|
95
|
-
selectedColor?: string;
|
|
96
|
-
className?: string;
|
|
97
|
-
classNames?: {
|
|
98
|
-
container?: string;
|
|
99
|
-
label?: string;
|
|
100
|
-
input?: string;
|
|
101
|
-
columnsContainer?: string;
|
|
102
|
-
leftColumn?: string;
|
|
103
|
-
rightColumn?: string;
|
|
104
|
-
groupItem?: string;
|
|
105
|
-
groupItemTitle?: string;
|
|
106
|
-
newGroupButton?: string;
|
|
107
|
-
item?: string;
|
|
108
|
-
itemTitle?: string;
|
|
109
|
-
itemSubtitle?: string;
|
|
110
|
-
newItemButton?: string;
|
|
111
|
-
};
|
|
112
|
-
style?: CSSProperties;
|
|
113
|
-
styles?: {
|
|
114
|
-
container?: CSSProperties;
|
|
115
|
-
label?: CSSProperties;
|
|
116
|
-
input?: CSSProperties;
|
|
117
|
-
columnsContainer?: CSSProperties;
|
|
118
|
-
leftColumn?: CSSProperties;
|
|
119
|
-
rightColumn?: CSSProperties;
|
|
120
|
-
groupItem?: CSSProperties;
|
|
121
|
-
groupItemTitle?: CSSProperties;
|
|
122
|
-
newGroupButton?: CSSProperties;
|
|
123
|
-
item?: CSSProperties;
|
|
124
|
-
itemTitle?: CSSProperties;
|
|
125
|
-
itemSubtitle?: CSSProperties;
|
|
126
|
-
newItemButton?: CSSProperties;
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* The `GroupSelector` component renders a two-column searchable panel for browsing and selecting items
|
|
132
|
-
* that are organised into labelled groups.
|
|
133
|
-
*
|
|
134
|
-
* - The left column lists groups; selecting one reveals its items in the right column.
|
|
135
|
-
* - Both columns support an inline "add new" input and a three-dot context menu per entry.
|
|
136
|
-
* - Key mapping props (`groupIDKey`, `groupTitleKey`, `itemsKey`, `itemIDKey`, `itemGroupIDKey`,
|
|
137
|
-
* `itemTitleKey`, `itemSubtitleKey`) let you use any plain object shape for groups and items.
|
|
138
|
-
* - `selectedItemID` highlights the currently active item.
|
|
139
|
-
* - `onItemSelect` is fired when the user picks an item; `onGroupSave`/`onItemSave` handle creation.
|
|
140
|
-
* - Use `isLoading`, `isGroupSaving`, `isItemSaving` to show loader states during async operations.
|
|
141
|
-
* - Accepts `classNames` and `styles` for granular visual customisation of every element.
|
|
142
|
-
*/
|
|
143
|
-
export const GroupSelector = <G = unknown, I = unknown>({
|
|
144
|
-
position = 'bottom-right',
|
|
145
|
-
labels,
|
|
146
|
-
groups = [],
|
|
147
|
-
selectedItemID = null,
|
|
148
|
-
groupThreeDotMenuOptions = [],
|
|
149
|
-
itemThreeDotMenuOptions = [],
|
|
150
|
-
refetchData,
|
|
151
|
-
onGroupSave,
|
|
152
|
-
onItemSave,
|
|
153
|
-
onGroupThreeDotMenuClick,
|
|
154
|
-
onItemThreeDotMenuClick,
|
|
155
|
-
onSearchChange,
|
|
156
|
-
onItemSelect,
|
|
157
|
-
groupIDKey,
|
|
158
|
-
groupTitleKey,
|
|
159
|
-
itemsKey,
|
|
160
|
-
itemIDKey,
|
|
161
|
-
itemGroupIDKey,
|
|
162
|
-
itemTitleKey,
|
|
163
|
-
itemSubtitleKey,
|
|
164
|
-
newValueMinLength = 2,
|
|
165
|
-
isLoading = false,
|
|
166
|
-
isGroupSaving = false,
|
|
167
|
-
isItemSaving = false,
|
|
168
|
-
selectedColor = 'rgb(var(--cleen-primary), 0.1)',
|
|
169
|
-
className,
|
|
170
|
-
classNames,
|
|
171
|
-
style,
|
|
172
|
-
styles,
|
|
173
|
-
}: GroupSelectorProps<G, I>): JSX.Element => {
|
|
174
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
175
|
-
const [isAbleToCreateNewGroup, setIsAbleToCreateNewGroup] = useState(false);
|
|
176
|
-
const [isAbleToCreateNewItem, setIsAbleToCreateNewItem] = useState(false);
|
|
177
|
-
const [selectedGroupID, setSelectedGroupID] = useState<
|
|
178
|
-
string | number | null
|
|
179
|
-
>(null);
|
|
180
|
-
const [selectedItem, setSelectedItem] = useState<I | null>(null);
|
|
181
|
-
const [newGroupTitle, setNewGroupTitle] = useState('');
|
|
182
|
-
const [newItemTitle, setNewItemTitle] = useState('');
|
|
183
|
-
const [searchText, setSearchText] = useState('');
|
|
184
|
-
const [debouncedSearch] = useDebounce(searchText, 500);
|
|
185
|
-
|
|
186
|
-
const selectorRef = useRef<HTMLDivElement | null>(null);
|
|
187
|
-
const columnsRef = useRef<HTMLDivElement | null>(null);
|
|
188
|
-
|
|
189
|
-
// Calculate optimal position for the selector dropdown
|
|
190
|
-
const { positionStyles, isMounted } = usePositionClose({
|
|
191
|
-
triggerRef: selectorRef,
|
|
192
|
-
targetRef: columnsRef,
|
|
193
|
-
position,
|
|
194
|
-
isOpen,
|
|
195
|
-
offset: 10,
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
useOutsideClick({
|
|
199
|
-
refs: [columnsRef],
|
|
200
|
-
handler: () => setIsOpen(false),
|
|
201
|
-
enabled: isOpen,
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
const safeGroups = useMemo(() => groups ?? [], [groups]);
|
|
205
|
-
|
|
206
|
-
const groupMap = useMemo(() => {
|
|
207
|
-
const map = new Map<string | number, I[]>();
|
|
208
|
-
for (const g of safeGroups) {
|
|
209
|
-
const gid = getProp<string | number>(g, groupIDKey);
|
|
210
|
-
if (gid != null) map.set(gid, getArrayProp<I>(g, itemsKey));
|
|
211
|
-
}
|
|
212
|
-
return map;
|
|
213
|
-
}, [safeGroups, groupIDKey, itemsKey]);
|
|
214
|
-
|
|
215
|
-
const items = useMemo(() => {
|
|
216
|
-
if (selectedGroupID == null) {
|
|
217
|
-
return Array.from(groupMap?.values()).flat();
|
|
218
|
-
}
|
|
219
|
-
return groupMap?.get(selectedGroupID) ?? [];
|
|
220
|
-
}, [selectedGroupID, groupMap]);
|
|
221
|
-
|
|
222
|
-
useEffect(() => {
|
|
223
|
-
if (selectedItemID == null) {
|
|
224
|
-
setSelectedItem(null);
|
|
225
|
-
setSelectedGroupID(null);
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const allItems = Array.from(groupMap?.values())?.flat();
|
|
230
|
-
const found = allItems?.find(
|
|
231
|
-
it => getProp(it, itemIDKey) === selectedItemID
|
|
232
|
-
);
|
|
233
|
-
|
|
234
|
-
if (found) {
|
|
235
|
-
const gid = getProp<string | number>(found, itemGroupIDKey) ?? null;
|
|
236
|
-
setSelectedItem(found);
|
|
237
|
-
setSelectedGroupID(gid);
|
|
238
|
-
} else {
|
|
239
|
-
setSelectedItem(null);
|
|
240
|
-
setSelectedGroupID(null);
|
|
241
|
-
}
|
|
242
|
-
}, [selectedItemID, groupMap, itemIDKey, itemGroupIDKey]);
|
|
243
|
-
|
|
244
|
-
useEffect(() => {
|
|
245
|
-
if (onSearchChange) void onSearchChange(debouncedSearch ?? '');
|
|
246
|
-
}, [debouncedSearch, onSearchChange]);
|
|
247
|
-
|
|
248
|
-
useEffect(() => {
|
|
249
|
-
if (!isOpen) {
|
|
250
|
-
setIsAbleToCreateNewGroup(false);
|
|
251
|
-
setIsAbleToCreateNewItem(false);
|
|
252
|
-
setNewGroupTitle('');
|
|
253
|
-
setNewItemTitle('');
|
|
254
|
-
}
|
|
255
|
-
}, [isOpen]);
|
|
256
|
-
|
|
257
|
-
const handleGroupClick = (gid: string | number | null) => {
|
|
258
|
-
if (gid === selectedGroupID) {
|
|
259
|
-
setSelectedGroupID(null);
|
|
260
|
-
setSelectedItem(null);
|
|
261
|
-
onItemSelect?.(null);
|
|
262
|
-
} else {
|
|
263
|
-
setSelectedItem(null);
|
|
264
|
-
setSelectedGroupID(gid);
|
|
265
|
-
onItemSelect?.(null);
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
const handleItemClick = (item: I) => {
|
|
270
|
-
const gidRaw = getProp(item, itemGroupIDKey);
|
|
271
|
-
const gid =
|
|
272
|
-
typeof gidRaw === 'string' || typeof gidRaw === 'number' ? gidRaw : null;
|
|
273
|
-
|
|
274
|
-
setSelectedGroupID(gid);
|
|
275
|
-
setSelectedItem(item);
|
|
276
|
-
onItemSelect?.(item);
|
|
277
|
-
setIsOpen(false);
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
async function handleNewGroup() {
|
|
281
|
-
if (!onGroupSave) return;
|
|
282
|
-
const payload: Record<string, unknown> = {
|
|
283
|
-
[groupTitleKey]: newGroupTitle,
|
|
284
|
-
};
|
|
285
|
-
try {
|
|
286
|
-
const res = await onGroupSave(payload);
|
|
287
|
-
if (res?.success) {
|
|
288
|
-
setIsAbleToCreateNewGroup(false);
|
|
289
|
-
setNewGroupTitle('');
|
|
290
|
-
if (refetchData) await refetchData();
|
|
291
|
-
}
|
|
292
|
-
} catch {
|
|
293
|
-
// swallow — parent can handle notifications
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
async function handleNewItem() {
|
|
298
|
-
if (!onItemSave) return;
|
|
299
|
-
const payload: Record<string, unknown> = {
|
|
300
|
-
[itemTitleKey]: newItemTitle,
|
|
301
|
-
...(selectedGroupID != null ? { [itemGroupIDKey]: selectedGroupID } : {}),
|
|
302
|
-
};
|
|
303
|
-
try {
|
|
304
|
-
const res = await onItemSave(payload);
|
|
305
|
-
if (res?.success) {
|
|
306
|
-
setIsAbleToCreateNewItem(false);
|
|
307
|
-
setNewItemTitle('');
|
|
308
|
-
if (refetchData) await refetchData();
|
|
309
|
-
}
|
|
310
|
-
} catch {
|
|
311
|
-
// swallow — parent can handle notifications
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
return (
|
|
316
|
-
<div className={cn('cleen', className)} style={style}>
|
|
317
|
-
<div
|
|
318
|
-
ref={selectorRef}
|
|
319
|
-
className={cn(
|
|
320
|
-
'cleen-relative cleen-w-full cleen-cursor-pointer',
|
|
321
|
-
classNames?.container
|
|
322
|
-
)}
|
|
323
|
-
style={styles?.container}
|
|
324
|
-
onClick={e => {
|
|
325
|
-
e.stopPropagation();
|
|
326
|
-
setIsOpen(true);
|
|
327
|
-
}}
|
|
328
|
-
>
|
|
329
|
-
<Input
|
|
330
|
-
placeholder={labels?.inputPlaceholder}
|
|
331
|
-
rightIcon={
|
|
332
|
-
isOpen ? (
|
|
333
|
-
<IconChevronUp className="cleen-w-5 cleen-h-5 cleen-text-gray/30" />
|
|
334
|
-
) : (
|
|
335
|
-
<IconChevronDown className="cleen-w-5 cleen-h-5 cleen-text-gray/30" />
|
|
336
|
-
)
|
|
337
|
-
}
|
|
338
|
-
value={searchText}
|
|
339
|
-
onChange={e => {
|
|
340
|
-
setSelectedGroupID(null);
|
|
341
|
-
setSelectedItem(null);
|
|
342
|
-
setSearchText(e.target.value);
|
|
343
|
-
}}
|
|
344
|
-
classNames={{
|
|
345
|
-
input: isOpen ? '' : 'cleen-cursor-pointer',
|
|
346
|
-
}}
|
|
347
|
-
className={classNames?.input}
|
|
348
|
-
style={styles?.input}
|
|
349
|
-
/>
|
|
350
|
-
|
|
351
|
-
{isOpen &&
|
|
352
|
-
createPortal(
|
|
353
|
-
<div className="cleen">
|
|
354
|
-
<div
|
|
355
|
-
ref={columnsRef}
|
|
356
|
-
className={cn(
|
|
357
|
-
'cleen-overflow-hidden cleen-flex cleen-items-start cleen-justify-start cleen-w-[500px] cleen-h-[344px] cleen-bg-white cleen-border cleen-border-gray/10 cleen-rounded-lg cleen-shadow-xl cleen-cursor-default',
|
|
358
|
-
'cleen-fixed cleen-z-50',
|
|
359
|
-
{
|
|
360
|
-
'cleen-opacity-0': !isMounted,
|
|
361
|
-
},
|
|
362
|
-
classNames?.columnsContainer
|
|
363
|
-
)}
|
|
364
|
-
style={{
|
|
365
|
-
top: `${positionStyles.top}px`,
|
|
366
|
-
left: `${positionStyles.left}px`,
|
|
367
|
-
...styles?.columnsContainer,
|
|
368
|
-
}}
|
|
369
|
-
>
|
|
370
|
-
<div className="cleen-w-1/2 cleen-h-full">
|
|
371
|
-
<div
|
|
372
|
-
className={cn(
|
|
373
|
-
'cleen-overflow-scroll cleen-no-scrollbar cleen-flex cleen-flex-col cleen-items-start cleen-justify-start cleen-w-full cleen-h-[300px]',
|
|
374
|
-
classNames?.leftColumn
|
|
375
|
-
)}
|
|
376
|
-
style={styles?.leftColumn}
|
|
377
|
-
>
|
|
378
|
-
{isLoading ? (
|
|
379
|
-
<div className="cleen-flex cleen-items-center cleen-justify-center cleen-w-full cleen-h-full">
|
|
380
|
-
<Loader size="sm" />
|
|
381
|
-
</div>
|
|
382
|
-
) : (
|
|
383
|
-
groups?.map((group, idx) => {
|
|
384
|
-
const gid = getProp<string | number>(group, groupIDKey);
|
|
385
|
-
const isSelected = gid === selectedGroupID;
|
|
386
|
-
const groupTitle = String(
|
|
387
|
-
getProp(group, groupTitleKey) ?? ''
|
|
388
|
-
);
|
|
389
|
-
const itemsCount =
|
|
390
|
-
getArrayProp(group, itemsKey)?.length ?? 0;
|
|
391
|
-
|
|
392
|
-
return (
|
|
393
|
-
<div
|
|
394
|
-
key={`group-${idx}-${String(gid ?? idx)}`}
|
|
395
|
-
className={cn(
|
|
396
|
-
'cleen-group cleen-flex cleen-items-center cleen-justify-between cleen-gap-2 cleen-px-3 cleen-w-full cleen-min-h-10 cleen-cursor-pointer hover:cleen-bg-primary/10',
|
|
397
|
-
classNames?.groupItem
|
|
398
|
-
)}
|
|
399
|
-
style={{
|
|
400
|
-
...(styles?.groupItem || {}),
|
|
401
|
-
...(isSelected
|
|
402
|
-
? { backgroundColor: selectedColor }
|
|
403
|
-
: {}),
|
|
404
|
-
}}
|
|
405
|
-
onClick={e => {
|
|
406
|
-
e.stopPropagation();
|
|
407
|
-
e.preventDefault();
|
|
408
|
-
handleGroupClick(gid ?? null);
|
|
409
|
-
}}
|
|
410
|
-
>
|
|
411
|
-
<div
|
|
412
|
-
className={cn(
|
|
413
|
-
'cleen-flex cleen-items-center cleen-justify-start cleen-gap-2',
|
|
414
|
-
groupThreeDotMenuOptions?.length > 0
|
|
415
|
-
? 'cleen-w-[calc(100%-30px)]'
|
|
416
|
-
: 'cleen-w-full'
|
|
417
|
-
)}
|
|
418
|
-
>
|
|
419
|
-
<span
|
|
420
|
-
className={cn(
|
|
421
|
-
'cleen-truncate cleen-font-semibold cleen-text-[14px] cleen-text-gray/90',
|
|
422
|
-
classNames?.groupItemTitle
|
|
423
|
-
)}
|
|
424
|
-
style={styles?.groupItemTitle}
|
|
425
|
-
>
|
|
426
|
-
{groupTitle}
|
|
427
|
-
</span>
|
|
428
|
-
<PillBadge
|
|
429
|
-
color="lighter-blue"
|
|
430
|
-
label={itemsCount}
|
|
431
|
-
/>
|
|
432
|
-
</div>
|
|
433
|
-
{groupThreeDotMenuOptions?.length > 0 && (
|
|
434
|
-
<div
|
|
435
|
-
className="cleen-opacity-0 group-hover:cleen-opacity-100"
|
|
436
|
-
onClick={e => {
|
|
437
|
-
e.stopPropagation();
|
|
438
|
-
onGroupThreeDotMenuClick?.(group);
|
|
439
|
-
}}
|
|
440
|
-
>
|
|
441
|
-
<Menu
|
|
442
|
-
position="bottom-right"
|
|
443
|
-
keepOpenOnClick={false}
|
|
444
|
-
items={groupThreeDotMenuOptions?.map(
|
|
445
|
-
option => {
|
|
446
|
-
const isOptionDisabled =
|
|
447
|
-
option?.disabledOptionCallback?.(group);
|
|
448
|
-
|
|
449
|
-
return {
|
|
450
|
-
...option,
|
|
451
|
-
type: 'button' as const,
|
|
452
|
-
label: (
|
|
453
|
-
<span className="cleen-font-semibold cleen-text-[14px] cleen-text-gray/70">
|
|
454
|
-
{option?.label}
|
|
455
|
-
</span>
|
|
456
|
-
),
|
|
457
|
-
onClick: () => {
|
|
458
|
-
if (!isOptionDisabled) {
|
|
459
|
-
option?.onClick(group);
|
|
460
|
-
}
|
|
461
|
-
},
|
|
462
|
-
disabled: isOptionDisabled,
|
|
463
|
-
};
|
|
464
|
-
}
|
|
465
|
-
)}
|
|
466
|
-
classNames={{
|
|
467
|
-
menu: 'cleen-min-w-max',
|
|
468
|
-
}}
|
|
469
|
-
className="cleen-flex cleen-items-center cleen-justify-center cleen-w-5 cleen-h-5 cleen-bg-white cleen-rounded-md"
|
|
470
|
-
>
|
|
471
|
-
<IconDotsVertical className="cleen-w-4 cleen-h-4 cleen-text-gray/70 cleen-cursor-pointer hover:cleen-text-primary" />
|
|
472
|
-
</Menu>
|
|
473
|
-
</div>
|
|
474
|
-
)}
|
|
475
|
-
</div>
|
|
476
|
-
);
|
|
477
|
-
})
|
|
478
|
-
)}
|
|
479
|
-
</div>
|
|
480
|
-
<Divider isHorizontal />
|
|
481
|
-
{isAbleToCreateNewGroup ? (
|
|
482
|
-
<div className="cleen-flex cleen-items-center cleen-justify-between cleen-w-full cleen-h-10">
|
|
483
|
-
<Input
|
|
484
|
-
leftIcon={
|
|
485
|
-
<IconPlusCircle className="cleen-w-4 cleen-h-4 cleen-text-gray/30" />
|
|
486
|
-
}
|
|
487
|
-
placeholder={labels?.newGroupPlaceholder}
|
|
488
|
-
value={newGroupTitle}
|
|
489
|
-
onChange={e => setNewGroupTitle(e.target.value)}
|
|
490
|
-
classNames={{
|
|
491
|
-
inputContainer: 'cleen-border-none',
|
|
492
|
-
input: 'cleen-w-full',
|
|
493
|
-
}}
|
|
494
|
-
className="cleen-w-[170px]"
|
|
495
|
-
autoFocus
|
|
496
|
-
/>
|
|
497
|
-
<div className="cleen-flex cleen-items-center cleen-justify-center cleen-w-[80px] cleen-h-full">
|
|
498
|
-
{onGroupSave ? (
|
|
499
|
-
isGroupSaving ? (
|
|
500
|
-
<Loader />
|
|
501
|
-
) : newGroupTitle?.length > newValueMinLength ? (
|
|
502
|
-
<Button
|
|
503
|
-
variant="primary"
|
|
504
|
-
label={labels?.saveButtonLabel}
|
|
505
|
-
onClick={() => {
|
|
506
|
-
void handleNewGroup();
|
|
507
|
-
}}
|
|
508
|
-
classNames={{
|
|
509
|
-
container: 'cleen-w-max cleen-h-7',
|
|
510
|
-
}}
|
|
511
|
-
/>
|
|
512
|
-
) : (
|
|
513
|
-
<div />
|
|
514
|
-
)
|
|
515
|
-
) : (
|
|
516
|
-
<div />
|
|
517
|
-
)}
|
|
518
|
-
</div>
|
|
519
|
-
</div>
|
|
520
|
-
) : (
|
|
521
|
-
<div
|
|
522
|
-
className={cn(
|
|
523
|
-
'cleen-flex cleen-items-center cleen-justify-start cleen-gap-2 cleen-w-full cleen-px-2 cleen-h-10 cleen-cursor-pointer hover:cleen-bg-primary/10',
|
|
524
|
-
classNames?.newGroupButton
|
|
525
|
-
)}
|
|
526
|
-
style={styles?.newGroupButton}
|
|
527
|
-
onClick={() => setIsAbleToCreateNewGroup(true)}
|
|
528
|
-
>
|
|
529
|
-
<IconPlusCircle className="cleen-w-4 cleen-h-4 cleen-text-gray/30" />
|
|
530
|
-
<span className="cleen-text-normal cleen-text-[14px] cleen-text-gray/50">
|
|
531
|
-
{labels?.newGroupPlaceholder}
|
|
532
|
-
</span>
|
|
533
|
-
</div>
|
|
534
|
-
)}
|
|
535
|
-
</div>
|
|
536
|
-
<Divider className="cleen-absolute cleen-top-0 cleen-left-1/2 cleen-min-w-[1px] cleen-h-full cleen-bg-gray/10 cleen-z-[1]" />
|
|
537
|
-
<div className="cleen-w-1/2 cleen-h-full">
|
|
538
|
-
<div
|
|
539
|
-
className={cn(
|
|
540
|
-
'cleen-overflow-scroll cleen-no-scrollbar cleen-flex cleen-flex-col cleen-items-start cleen-justify-start cleen-w-full cleen-h-[300px]',
|
|
541
|
-
classNames?.rightColumn
|
|
542
|
-
)}
|
|
543
|
-
style={styles?.rightColumn}
|
|
544
|
-
>
|
|
545
|
-
{isLoading ? (
|
|
546
|
-
<div className="cleen-flex cleen-items-center cleen-justify-center cleen-w-full cleen-h-full">
|
|
547
|
-
<Loader size="sm" />
|
|
548
|
-
</div>
|
|
549
|
-
) : (
|
|
550
|
-
items?.map((item, idx) => {
|
|
551
|
-
const tid = getProp(item, itemIDKey);
|
|
552
|
-
const isSelected =
|
|
553
|
-
selectedItem &&
|
|
554
|
-
getProp(selectedItem, itemIDKey) === tid;
|
|
555
|
-
const title = String(getProp(item, itemTitleKey) ?? '');
|
|
556
|
-
const subtitle = itemSubtitleKey
|
|
557
|
-
? String(getProp(item, itemSubtitleKey) ?? '')
|
|
558
|
-
: '';
|
|
559
|
-
|
|
560
|
-
return (
|
|
561
|
-
<div
|
|
562
|
-
key={`item-${idx}-${String(tid ?? idx)}`}
|
|
563
|
-
className={cn(
|
|
564
|
-
'cleen-group cleen-flex cleen-items-center cleen-justify-between cleen-gap-2 cleen-px-3 cleen-w-full cleen-min-h-[60px] cleen-cursor-pointer hover:cleen-bg-primary/10',
|
|
565
|
-
classNames?.item
|
|
566
|
-
)}
|
|
567
|
-
style={{
|
|
568
|
-
...(styles?.item || {}),
|
|
569
|
-
...(isSelected
|
|
570
|
-
? { backgroundColor: selectedColor }
|
|
571
|
-
: {}),
|
|
572
|
-
}}
|
|
573
|
-
onClick={e => {
|
|
574
|
-
e.stopPropagation();
|
|
575
|
-
e.preventDefault();
|
|
576
|
-
handleItemClick(item);
|
|
577
|
-
}}
|
|
578
|
-
>
|
|
579
|
-
<div
|
|
580
|
-
className={cn(
|
|
581
|
-
'cleen-flex cleen-flex-col cleen-items-start cleen-justify-center',
|
|
582
|
-
itemThreeDotMenuOptions?.length > 0
|
|
583
|
-
? 'cleen-w-[calc(100%-30px)]'
|
|
584
|
-
: 'cleen-w-full'
|
|
585
|
-
)}
|
|
586
|
-
>
|
|
587
|
-
<span
|
|
588
|
-
className={cn(
|
|
589
|
-
'cleen-truncate cleen-w-full cleen-font-semibold cleen-text-[14px] cleen-text-gray/90',
|
|
590
|
-
classNames?.itemTitle
|
|
591
|
-
)}
|
|
592
|
-
style={styles?.itemTitle}
|
|
593
|
-
>
|
|
594
|
-
{title}
|
|
595
|
-
</span>
|
|
596
|
-
<span
|
|
597
|
-
className={cn(
|
|
598
|
-
'cleen-truncate cleen-w-full cleen-font-semibold cleen-text-[12px] cleen-text-gray/50',
|
|
599
|
-
classNames?.itemSubtitle
|
|
600
|
-
)}
|
|
601
|
-
style={styles?.itemSubtitle}
|
|
602
|
-
>
|
|
603
|
-
{subtitle}
|
|
604
|
-
</span>
|
|
605
|
-
</div>
|
|
606
|
-
{itemThreeDotMenuOptions?.length > 0 && (
|
|
607
|
-
<div
|
|
608
|
-
className="cleen-opacity-0 group-hover:cleen-opacity-100"
|
|
609
|
-
onClick={e => {
|
|
610
|
-
e.stopPropagation();
|
|
611
|
-
onItemThreeDotMenuClick?.(item);
|
|
612
|
-
}}
|
|
613
|
-
>
|
|
614
|
-
<Menu
|
|
615
|
-
position="bottom-right"
|
|
616
|
-
keepOpenOnClick={false}
|
|
617
|
-
items={itemThreeDotMenuOptions?.map(
|
|
618
|
-
option => {
|
|
619
|
-
const isOptionDisabled =
|
|
620
|
-
option?.disabledOptionCallback?.(item);
|
|
621
|
-
|
|
622
|
-
return {
|
|
623
|
-
...option,
|
|
624
|
-
type: 'button' as const,
|
|
625
|
-
label: (
|
|
626
|
-
<span className="cleen-font-semibold cleen-text-[14px] cleen-text-gray/70">
|
|
627
|
-
{option?.label}
|
|
628
|
-
</span>
|
|
629
|
-
),
|
|
630
|
-
onClick: () => {
|
|
631
|
-
if (!isOptionDisabled) {
|
|
632
|
-
option?.onClick(item);
|
|
633
|
-
}
|
|
634
|
-
},
|
|
635
|
-
disabled: isOptionDisabled,
|
|
636
|
-
};
|
|
637
|
-
}
|
|
638
|
-
)}
|
|
639
|
-
classNames={{
|
|
640
|
-
menu: 'cleen-min-w-max',
|
|
641
|
-
}}
|
|
642
|
-
className="cleen-flex cleen-items-center cleen-justify-center cleen-w-5 cleen-h-5 cleen-bg-white cleen-rounded-md"
|
|
643
|
-
>
|
|
644
|
-
<IconDotsVertical className="cleen-w-4 cleen-h-4 cleen-text-gray/70 cleen-cursor-pointer hover:cleen-text-primary" />
|
|
645
|
-
</Menu>
|
|
646
|
-
</div>
|
|
647
|
-
)}
|
|
648
|
-
</div>
|
|
649
|
-
);
|
|
650
|
-
})
|
|
651
|
-
)}
|
|
652
|
-
</div>
|
|
653
|
-
<Divider isHorizontal />
|
|
654
|
-
{isAbleToCreateNewItem ? (
|
|
655
|
-
<div className="cleen-flex cleen-items-center cleen-justify-between cleen-w-full cleen-h-10">
|
|
656
|
-
<Input
|
|
657
|
-
leftIcon={
|
|
658
|
-
<IconPlusCircle className="cleen-w-4 cleen-h-4 cleen-text-gray/30" />
|
|
659
|
-
}
|
|
660
|
-
placeholder={labels?.newItemPlaceholder}
|
|
661
|
-
value={newItemTitle}
|
|
662
|
-
onChange={e => setNewItemTitle(e.target.value)}
|
|
663
|
-
classNames={{
|
|
664
|
-
inputContainer: 'cleen-border-none',
|
|
665
|
-
input: 'cleen-w-full',
|
|
666
|
-
}}
|
|
667
|
-
className="cleen-w-[170px]"
|
|
668
|
-
autoFocus
|
|
669
|
-
/>
|
|
670
|
-
<div className="cleen-flex cleen-items-center cleen-justify-center cleen-w-[80px] cleen-h-full">
|
|
671
|
-
{onItemSave ? (
|
|
672
|
-
isItemSaving ? (
|
|
673
|
-
<Loader />
|
|
674
|
-
) : newItemTitle?.length > newValueMinLength ? (
|
|
675
|
-
<Button
|
|
676
|
-
variant="primary"
|
|
677
|
-
label={labels?.saveButtonLabel}
|
|
678
|
-
onClick={() => {
|
|
679
|
-
void handleNewItem();
|
|
680
|
-
}}
|
|
681
|
-
classNames={{
|
|
682
|
-
container: 'cleen-w-max cleen-h-7',
|
|
683
|
-
}}
|
|
684
|
-
/>
|
|
685
|
-
) : (
|
|
686
|
-
<div />
|
|
687
|
-
)
|
|
688
|
-
) : (
|
|
689
|
-
<div />
|
|
690
|
-
)}
|
|
691
|
-
</div>
|
|
692
|
-
</div>
|
|
693
|
-
) : (
|
|
694
|
-
<div
|
|
695
|
-
className={cn(
|
|
696
|
-
'cleen-flex cleen-items-center cleen-justify-start cleen-gap-2 cleen-w-full cleen-px-2 cleen-h-10 cleen-cursor-pointer hover:cleen-bg-primary/10',
|
|
697
|
-
classNames?.newItemButton
|
|
698
|
-
)}
|
|
699
|
-
style={styles?.newItemButton}
|
|
700
|
-
onClick={() => setIsAbleToCreateNewItem(true)}
|
|
701
|
-
>
|
|
702
|
-
<IconPlusCircle className="cleen-w-4 cleen-h-4 cleen-text-gray/30" />
|
|
703
|
-
<span className="cleen-text-normal cleen-text-[14px] cleen-text-gray/50">
|
|
704
|
-
{labels?.newItemPlaceholder}
|
|
705
|
-
</span>
|
|
706
|
-
</div>
|
|
707
|
-
)}
|
|
708
|
-
</div>
|
|
709
|
-
</div>
|
|
710
|
-
</div>,
|
|
711
|
-
document.body
|
|
712
|
-
)}
|
|
713
|
-
|
|
714
|
-
{!isOpen && selectedItem && (
|
|
715
|
-
<div
|
|
716
|
-
className="cleen-absolute cleen-top-1.5 cleen-left-1 cleen-flex cleen-items-center cleen-justify-start cleen-pl-2.5 cleen-w-[calc(100%-40px)] cleen-h-8 cleen-bg-white"
|
|
717
|
-
onClick={() => setIsOpen(true)}
|
|
718
|
-
>
|
|
719
|
-
<span className="cleen-truncate cleen-font-semibold cleen-text-[14px] cleen-text-gray/70">
|
|
720
|
-
{String(getProp<unknown>(selectedItem, itemTitleKey) ?? '')}
|
|
721
|
-
</span>
|
|
722
|
-
</div>
|
|
723
|
-
)}
|
|
724
|
-
</div>
|
|
725
|
-
</div>
|
|
726
|
-
);
|
|
727
|
-
};
|
|
728
|
-
|
|
729
|
-
export default GroupSelector;
|