@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,103 +0,0 @@
|
|
|
1
|
-
import { MenuContent } from '@/components/menu/blocks/MenuContent';
|
|
2
|
-
import {
|
|
3
|
-
cn,
|
|
4
|
-
useDisclosure,
|
|
5
|
-
useOutsideClick,
|
|
6
|
-
usePositionClose,
|
|
7
|
-
} from '@cleen/ui-core';
|
|
8
|
-
import { forwardRef, useRef, type MouseEvent as ReactMouseEvent } from 'react';
|
|
9
|
-
import { createPortal } from 'react-dom';
|
|
10
|
-
import type { MenuProps } from './types/menu';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* The `Menu` component displays a list of selectable items, typically used for navigation or actions. It appears when triggered and can be positioned relative to its trigger element, automatically adjusting to fit within the viewport.
|
|
14
|
-
*/
|
|
15
|
-
export const Menu = forwardRef<HTMLDivElement, MenuProps>(function Menu(
|
|
16
|
-
{
|
|
17
|
-
items = [],
|
|
18
|
-
position = 'bottom-left',
|
|
19
|
-
keepOpenOnClick = true,
|
|
20
|
-
children,
|
|
21
|
-
className,
|
|
22
|
-
classNames,
|
|
23
|
-
style,
|
|
24
|
-
styles,
|
|
25
|
-
...props
|
|
26
|
-
},
|
|
27
|
-
ref
|
|
28
|
-
) {
|
|
29
|
-
const { isOpen, toggle, close } = useDisclosure();
|
|
30
|
-
|
|
31
|
-
const triggerRef = useRef<HTMLDivElement>(null);
|
|
32
|
-
const menuRef = useRef<HTMLDivElement>(null);
|
|
33
|
-
|
|
34
|
-
// Calculate optimal position and handle click-outside =w=
|
|
35
|
-
const { positionStyles, isMounted } = usePositionClose({
|
|
36
|
-
triggerRef,
|
|
37
|
-
targetRef: menuRef,
|
|
38
|
-
position,
|
|
39
|
-
isOpen,
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
useOutsideClick({
|
|
43
|
-
refs: [triggerRef, menuRef],
|
|
44
|
-
handler: close,
|
|
45
|
-
enabled: isOpen,
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
const handleTriggerClick = (e: ReactMouseEvent) => {
|
|
49
|
-
e.stopPropagation();
|
|
50
|
-
toggle();
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<div className={cn('cleen', className)} style={style} ref={ref} {...props}>
|
|
55
|
-
<div
|
|
56
|
-
ref={triggerRef}
|
|
57
|
-
onClick={handleTriggerClick}
|
|
58
|
-
className={cn(
|
|
59
|
-
'cleen-size-fit',
|
|
60
|
-
classNames?.trigger,
|
|
61
|
-
isOpen && classNames?.triggerOpen
|
|
62
|
-
)}
|
|
63
|
-
style={{
|
|
64
|
-
...styles?.trigger,
|
|
65
|
-
...(isOpen ? styles?.triggerOpen : {}),
|
|
66
|
-
}}
|
|
67
|
-
>
|
|
68
|
-
{children}
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
{isOpen &&
|
|
72
|
-
createPortal(
|
|
73
|
-
<div className="cleen">
|
|
74
|
-
<div
|
|
75
|
-
ref={menuRef}
|
|
76
|
-
className={cn(
|
|
77
|
-
'cleen-bg-background cleen-shadow-lg cleen-border cleen-border-gray/20 cleen-rounded-lg cleen-w-52',
|
|
78
|
-
'cleen-absolute cleen-z-50',
|
|
79
|
-
{
|
|
80
|
-
'cleen-opacity-0': !isMounted,
|
|
81
|
-
},
|
|
82
|
-
classNames?.menu
|
|
83
|
-
)}
|
|
84
|
-
style={{
|
|
85
|
-
top: `${positionStyles.top}px`,
|
|
86
|
-
left: `${positionStyles.left}px`,
|
|
87
|
-
...styles?.menu,
|
|
88
|
-
}}
|
|
89
|
-
>
|
|
90
|
-
<MenuContent
|
|
91
|
-
items={items}
|
|
92
|
-
keepOpenOnClick={keepOpenOnClick}
|
|
93
|
-
hideMenu={close}
|
|
94
|
-
classNames={classNames}
|
|
95
|
-
styles={styles}
|
|
96
|
-
/>
|
|
97
|
-
</div>
|
|
98
|
-
</div>,
|
|
99
|
-
document.body
|
|
100
|
-
)}
|
|
101
|
-
</div>
|
|
102
|
-
);
|
|
103
|
-
});
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { IconChevronLeft } from '@/components/cleenIcon';
|
|
2
|
-
import { MenuItem } from '@/components/menu/blocks/MenuItem';
|
|
3
|
-
import type { MenuProps, MenuStack } from '@/components/menu/types/menu';
|
|
4
|
-
import type {
|
|
5
|
-
IMenuItem,
|
|
6
|
-
MenuItemButton,
|
|
7
|
-
} from '@/components/menu/types/menuItem';
|
|
8
|
-
import { cn } from '@cleen/ui-core';
|
|
9
|
-
import { useEffect, useState } from 'react';
|
|
10
|
-
|
|
11
|
-
interface MenuContentProps {
|
|
12
|
-
items: IMenuItem[];
|
|
13
|
-
keepOpenOnClick?: boolean;
|
|
14
|
-
hideMenu: () => void;
|
|
15
|
-
classNames: MenuProps['classNames'];
|
|
16
|
-
styles: MenuProps['styles'];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const MenuContent = ({
|
|
20
|
-
items,
|
|
21
|
-
keepOpenOnClick,
|
|
22
|
-
hideMenu,
|
|
23
|
-
classNames,
|
|
24
|
-
styles,
|
|
25
|
-
}: MenuContentProps) => {
|
|
26
|
-
const [menuStack, setMenuStack] = useState<MenuStack[]>([]);
|
|
27
|
-
const [activeItems, setActiveItems] = useState<IMenuItem[]>(items);
|
|
28
|
-
|
|
29
|
-
const enterSubmenu = (submenu: IMenuItem[], title?: React.ReactNode) => {
|
|
30
|
-
setMenuStack(stack => [...stack, { items: activeItems, title }]);
|
|
31
|
-
setActiveItems(submenu);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const goBack = () => {
|
|
35
|
-
const previous = menuStack[menuStack?.length - 1];
|
|
36
|
-
if (!previous) return;
|
|
37
|
-
|
|
38
|
-
setActiveItems(previous?.items);
|
|
39
|
-
setMenuStack(stack => stack?.slice(0, -1));
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
setActiveItems(items);
|
|
44
|
-
setMenuStack([]);
|
|
45
|
-
}, [items]);
|
|
46
|
-
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
const handleEscape = (e: KeyboardEvent) => {
|
|
49
|
-
if (e.key !== 'Escape') return;
|
|
50
|
-
|
|
51
|
-
if (menuStack.length > 0) {
|
|
52
|
-
const previous = menuStack?.[menuStack?.length - 1];
|
|
53
|
-
|
|
54
|
-
setActiveItems(previous?.items);
|
|
55
|
-
setMenuStack(stack => stack?.slice(0, -1));
|
|
56
|
-
} else {
|
|
57
|
-
hideMenu();
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
document.addEventListener('keydown', handleEscape);
|
|
62
|
-
|
|
63
|
-
return () => {
|
|
64
|
-
document.removeEventListener('keydown', handleEscape);
|
|
65
|
-
};
|
|
66
|
-
}, [hideMenu, menuStack]);
|
|
67
|
-
|
|
68
|
-
const handleItemClick = (item: MenuItemButton) => {
|
|
69
|
-
item?.onClick?.();
|
|
70
|
-
|
|
71
|
-
if (!keepOpenOnClick) {
|
|
72
|
-
hideMenu();
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<>
|
|
78
|
-
{menuStack?.length > 0 && (
|
|
79
|
-
<button
|
|
80
|
-
onClick={goBack}
|
|
81
|
-
className={cn(
|
|
82
|
-
'cleen-flex cleen-items-center cleen-gap-3 cleen-px-4 cleen-py-2 cleen-w-full cleen-text-sm cleen-text-gray hover:cleen-bg-gray/5',
|
|
83
|
-
classNames?.submenuButton
|
|
84
|
-
)}
|
|
85
|
-
style={styles?.submenuButton}
|
|
86
|
-
>
|
|
87
|
-
<IconChevronLeft className="cleen-size-4 cleen-text-gray/30" />
|
|
88
|
-
{menuStack?.[menuStack?.length - 1]?.title}
|
|
89
|
-
</button>
|
|
90
|
-
)}
|
|
91
|
-
|
|
92
|
-
{activeItems?.map((item, idx, arr) => (
|
|
93
|
-
<MenuItem
|
|
94
|
-
key={item?.id || idx}
|
|
95
|
-
item={item}
|
|
96
|
-
isLast={idx === arr?.length - 1}
|
|
97
|
-
handleClick={handleItemClick}
|
|
98
|
-
onEnterSubmenu={enterSubmenu}
|
|
99
|
-
classNames={classNames?.item}
|
|
100
|
-
styles={styles?.item}
|
|
101
|
-
/>
|
|
102
|
-
))}
|
|
103
|
-
</>
|
|
104
|
-
);
|
|
105
|
-
};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { IconChevronRight } from '@/components/cleenIcon';
|
|
2
|
-
import { cn } from '@cleen/ui-core';
|
|
3
|
-
import { Link } from 'react-router-dom';
|
|
4
|
-
import type {
|
|
5
|
-
MenuItemButton,
|
|
6
|
-
MenuItemLink,
|
|
7
|
-
MenuItemProps,
|
|
8
|
-
} from '../types/menuItem';
|
|
9
|
-
|
|
10
|
-
const getWrapperProps = ({
|
|
11
|
-
item,
|
|
12
|
-
classNames,
|
|
13
|
-
styles,
|
|
14
|
-
}: {
|
|
15
|
-
item: MenuItemButton | MenuItemLink;
|
|
16
|
-
handleClick?: MenuItemProps['handleClick'];
|
|
17
|
-
classNames?: MenuItemProps['classNames'];
|
|
18
|
-
styles?: MenuItemProps['styles'];
|
|
19
|
-
}) => ({
|
|
20
|
-
disabled: item?.disabled,
|
|
21
|
-
className: cn(
|
|
22
|
-
'cleen-flex cleen-items-center cleen-gap-3 cleen-px-4 cleen-py-2 cleen-w-full cleen-text-gray cleen-text-sm cleen-text-left cleen-transition-colors',
|
|
23
|
-
item?.disabled
|
|
24
|
-
? 'cleen-opacity-50 cleen-select-none cleen-cursor-not-allowed'
|
|
25
|
-
: 'hover:cleen-bg-gray/5 cleen-cursor-pointer',
|
|
26
|
-
{
|
|
27
|
-
'cleen-text-error hover:cleen-bg-error/10': item?.danger,
|
|
28
|
-
},
|
|
29
|
-
classNames?.container
|
|
30
|
-
),
|
|
31
|
-
style: styles?.container,
|
|
32
|
-
children: (
|
|
33
|
-
<>
|
|
34
|
-
{item?.icon}
|
|
35
|
-
|
|
36
|
-
<span
|
|
37
|
-
className={cn('cleen-flex-1', classNames?.label)}
|
|
38
|
-
style={styles?.label}
|
|
39
|
-
>
|
|
40
|
-
{item?.label}
|
|
41
|
-
</span>
|
|
42
|
-
</>
|
|
43
|
-
),
|
|
44
|
-
...(item?.type === 'button' ? { type: 'button' as const } : { to: item?.to }),
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
export const MenuItem = ({
|
|
48
|
-
item,
|
|
49
|
-
isLast,
|
|
50
|
-
handleClick,
|
|
51
|
-
onEnterSubmenu,
|
|
52
|
-
classNames,
|
|
53
|
-
styles,
|
|
54
|
-
}: MenuItemProps) => {
|
|
55
|
-
switch (item?.type) {
|
|
56
|
-
case 'group':
|
|
57
|
-
return (
|
|
58
|
-
<>
|
|
59
|
-
{item?.label && (
|
|
60
|
-
<p
|
|
61
|
-
className={cn(
|
|
62
|
-
'cleen-px-4 cleen-py-2 cleen-font-bold cleen-text-gray/60 cleen-text-xs',
|
|
63
|
-
classNames?.groupLabel
|
|
64
|
-
)}
|
|
65
|
-
style={styles?.groupDivider}
|
|
66
|
-
>
|
|
67
|
-
{item?.label}
|
|
68
|
-
</p>
|
|
69
|
-
)}
|
|
70
|
-
|
|
71
|
-
{item?.items?.map((i, idx, arr) => (
|
|
72
|
-
<MenuItem
|
|
73
|
-
key={i?.id || idx}
|
|
74
|
-
item={i}
|
|
75
|
-
handleClick={handleClick}
|
|
76
|
-
onEnterSubmenu={onEnterSubmenu}
|
|
77
|
-
isLast={idx === arr.length - 1}
|
|
78
|
-
/>
|
|
79
|
-
))}
|
|
80
|
-
|
|
81
|
-
{!isLast && (
|
|
82
|
-
<hr
|
|
83
|
-
className={cn('cleen-text-gray/20', classNames?.groupDivider)}
|
|
84
|
-
style={styles?.groupDivider}
|
|
85
|
-
/>
|
|
86
|
-
)}
|
|
87
|
-
</>
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
case 'button': {
|
|
91
|
-
const hasSubmenu = item?.submenu && item?.submenu?.length > 0;
|
|
92
|
-
|
|
93
|
-
return (
|
|
94
|
-
<button
|
|
95
|
-
type="button"
|
|
96
|
-
onClick={() => {
|
|
97
|
-
if (hasSubmenu) {
|
|
98
|
-
onEnterSubmenu?.(item.submenu!, item?.label);
|
|
99
|
-
} else {
|
|
100
|
-
handleClick?.(item);
|
|
101
|
-
}
|
|
102
|
-
}}
|
|
103
|
-
{...getWrapperProps({ item, classNames, styles })}
|
|
104
|
-
>
|
|
105
|
-
{item?.icon}
|
|
106
|
-
<span className="cleen-flex-1">{item?.label}</span>
|
|
107
|
-
{hasSubmenu && (
|
|
108
|
-
<IconChevronRight className="cleen-size-4 cleen-text-gray/50" />
|
|
109
|
-
)}
|
|
110
|
-
</button>
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
case 'link':
|
|
115
|
-
return <Link to="" {...getWrapperProps({ item, classNames, styles })} />;
|
|
116
|
-
|
|
117
|
-
default:
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
120
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { Position } from '@cleen/ui-core';
|
|
2
|
-
import type { ComponentProps, CSSProperties } from 'react';
|
|
3
|
-
import type { IMenuItem, MenuItemProps } from './menuItem';
|
|
4
|
-
|
|
5
|
-
export type MenuProps = ComponentProps<'div'> & {
|
|
6
|
-
items?: IMenuItem[];
|
|
7
|
-
position?: Position;
|
|
8
|
-
keepOpenOnClick?: boolean;
|
|
9
|
-
classNames?: {
|
|
10
|
-
container?: string;
|
|
11
|
-
trigger?: string;
|
|
12
|
-
triggerOpen?: string;
|
|
13
|
-
menu?: string;
|
|
14
|
-
item?: MenuItemProps['classNames'];
|
|
15
|
-
submenuButton?: string;
|
|
16
|
-
};
|
|
17
|
-
styles?: {
|
|
18
|
-
container?: CSSProperties;
|
|
19
|
-
trigger?: CSSProperties;
|
|
20
|
-
triggerOpen?: CSSProperties;
|
|
21
|
-
menu?: CSSProperties;
|
|
22
|
-
item?: MenuItemProps['styles'];
|
|
23
|
-
submenuButton?: CSSProperties;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export interface MenuStack {
|
|
28
|
-
items: IMenuItem[];
|
|
29
|
-
title?: React.ReactNode;
|
|
30
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface MenuItemProps {
|
|
4
|
-
item: IMenuItem;
|
|
5
|
-
isLast?: boolean;
|
|
6
|
-
handleClick?: (item: MenuItemButton) => void;
|
|
7
|
-
onEnterSubmenu?: (items: IMenuItem[], title?: React.ReactNode) => void;
|
|
8
|
-
classNames?: {
|
|
9
|
-
container?: string;
|
|
10
|
-
label?: string;
|
|
11
|
-
groupLabel?: string;
|
|
12
|
-
groupDivider?: string;
|
|
13
|
-
};
|
|
14
|
-
styles?: {
|
|
15
|
-
container?: CSSProperties;
|
|
16
|
-
label?: CSSProperties;
|
|
17
|
-
groupLabel?: CSSProperties;
|
|
18
|
-
groupDivider?: CSSProperties;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export type IMenuItem = MenuItemButton | MenuItemLink | MenuItemGroup;
|
|
23
|
-
|
|
24
|
-
interface MenuItemSharedProps {
|
|
25
|
-
id?: string;
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
danger?: boolean;
|
|
28
|
-
icon?: ReactNode;
|
|
29
|
-
label?: ReactNode;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface MenuItemButton extends MenuItemSharedProps {
|
|
33
|
-
type: 'button';
|
|
34
|
-
onClick?: () => void;
|
|
35
|
-
submenu?: IMenuItem[];
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface MenuItemLink extends MenuItemSharedProps {
|
|
39
|
-
type: 'link';
|
|
40
|
-
to: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface MenuItemGroup {
|
|
44
|
-
id?: string;
|
|
45
|
-
type: 'group';
|
|
46
|
-
label?: ReactNode;
|
|
47
|
-
items: IMenuItem[];
|
|
48
|
-
}
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import { Button } from '@/components/button';
|
|
2
|
-
import { Card } from '@/components/card';
|
|
3
|
-
import type { CardProps } from '@/components/card/Card';
|
|
4
|
-
import { IconX } from '@/components/cleenIcon';
|
|
5
|
-
import {
|
|
6
|
-
cn,
|
|
7
|
-
type ComponentClassnames,
|
|
8
|
-
type ComponentStyles,
|
|
9
|
-
} from '@cleen/ui-core';
|
|
10
|
-
import {
|
|
11
|
-
forwardRef,
|
|
12
|
-
useEffect,
|
|
13
|
-
useRef,
|
|
14
|
-
useState,
|
|
15
|
-
type ComponentProps,
|
|
16
|
-
type CSSProperties,
|
|
17
|
-
type ReactNode,
|
|
18
|
-
} from 'react';
|
|
19
|
-
import { createPortal } from 'react-dom';
|
|
20
|
-
|
|
21
|
-
const SIZES = {
|
|
22
|
-
xs: 320,
|
|
23
|
-
sm: 384,
|
|
24
|
-
md: 448,
|
|
25
|
-
lg: 512,
|
|
26
|
-
xl: 576,
|
|
27
|
-
'2xl': 728,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const TRANSITION_DURATION = 300;
|
|
31
|
-
|
|
32
|
-
export type ModalProps = ComponentProps<'div'> & {
|
|
33
|
-
isOpen?: boolean;
|
|
34
|
-
onClose?: () => void;
|
|
35
|
-
closeOnOverlayClick?: boolean;
|
|
36
|
-
closeButtonIcon?: ReactNode | null;
|
|
37
|
-
zIndex?: number;
|
|
38
|
-
size?: keyof typeof SIZES | number;
|
|
39
|
-
header?: CardProps['header'];
|
|
40
|
-
footer?: CardProps['header'];
|
|
41
|
-
color?: string;
|
|
42
|
-
p?: number;
|
|
43
|
-
gap?: number;
|
|
44
|
-
classNames?: {
|
|
45
|
-
overlay?: string;
|
|
46
|
-
container?: string;
|
|
47
|
-
modal?: ComponentClassnames<CardProps>;
|
|
48
|
-
};
|
|
49
|
-
styles?: {
|
|
50
|
-
overlay?: CSSProperties;
|
|
51
|
-
container?: CSSProperties;
|
|
52
|
-
modal?: ComponentStyles<CardProps>;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Modal component that displays content in a centered modal dialog.
|
|
58
|
-
*
|
|
59
|
-
* - Controlled via `isOpen` (boolean) and `onClose` (callback).
|
|
60
|
-
* - Renders a clickable overlay/backdrop that closes the modal when clicked.
|
|
61
|
-
* - Modal content is centered on the screen with smooth fade-in/fade-out animations.
|
|
62
|
-
* - Accepts `classNames` and `styles` objects to customize classes and inline styles for:
|
|
63
|
-
* `overlay` and `container`.
|
|
64
|
-
*/
|
|
65
|
-
export const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(
|
|
66
|
-
{
|
|
67
|
-
isOpen = false,
|
|
68
|
-
onClose,
|
|
69
|
-
closeOnOverlayClick = true,
|
|
70
|
-
closeButtonIcon = <IconX className="cleen-size-5" />,
|
|
71
|
-
header,
|
|
72
|
-
footer,
|
|
73
|
-
zIndex = 50,
|
|
74
|
-
size = 'md',
|
|
75
|
-
color,
|
|
76
|
-
p,
|
|
77
|
-
gap,
|
|
78
|
-
className,
|
|
79
|
-
classNames,
|
|
80
|
-
style,
|
|
81
|
-
styles,
|
|
82
|
-
children,
|
|
83
|
-
...props
|
|
84
|
-
},
|
|
85
|
-
ref
|
|
86
|
-
) {
|
|
87
|
-
const [isVisible, setIsVisible] = useState(isOpen);
|
|
88
|
-
const [shouldRender, setShouldRender] = useState(isOpen);
|
|
89
|
-
const internalRef = useRef<HTMLDivElement>(null);
|
|
90
|
-
|
|
91
|
-
const closeModal = () => {
|
|
92
|
-
setIsVisible(false);
|
|
93
|
-
setTimeout(() => onClose?.(), TRANSITION_DURATION);
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
useEffect(() => {
|
|
97
|
-
if (isOpen) {
|
|
98
|
-
setShouldRender(true);
|
|
99
|
-
const timer = setTimeout(() => setIsVisible(true), 1);
|
|
100
|
-
return () => clearTimeout(timer);
|
|
101
|
-
} else {
|
|
102
|
-
setIsVisible(false);
|
|
103
|
-
const timer = setTimeout(
|
|
104
|
-
() => setShouldRender(false),
|
|
105
|
-
TRANSITION_DURATION
|
|
106
|
-
);
|
|
107
|
-
return () => clearTimeout(timer);
|
|
108
|
-
}
|
|
109
|
-
}, [isOpen]);
|
|
110
|
-
|
|
111
|
-
if (!shouldRender) {
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return createPortal(
|
|
116
|
-
<div className={cn('cleen', className)} style={style} ref={ref} {...props}>
|
|
117
|
-
{/* Overlay */}
|
|
118
|
-
<div
|
|
119
|
-
className={cn(
|
|
120
|
-
'cleen-fixed cleen-inset-0 cleen-bg-black/50 dark:cleen-bg-white/50 cleen-transition-opacity cleen-duration-300 cleen-ease-in-out',
|
|
121
|
-
isVisible ? 'cleen-opacity-100' : 'cleen-opacity-0',
|
|
122
|
-
classNames?.overlay
|
|
123
|
-
)}
|
|
124
|
-
style={{
|
|
125
|
-
zIndex,
|
|
126
|
-
...styles?.overlay,
|
|
127
|
-
}}
|
|
128
|
-
onClick={() => {
|
|
129
|
-
if (closeOnOverlayClick) {
|
|
130
|
-
closeModal();
|
|
131
|
-
}
|
|
132
|
-
}}
|
|
133
|
-
aria-hidden="true"
|
|
134
|
-
/>
|
|
135
|
-
|
|
136
|
-
{/* Modal Container */}
|
|
137
|
-
<div
|
|
138
|
-
className={cn(
|
|
139
|
-
'cleen-fixed cleen-inset-0 cleen-flex cleen-justify-center cleen-items-center cleen-p-4 cleen-overflow-auto',
|
|
140
|
-
'cleen-transition-all cleen-duration-300 cleen-ease-in-out',
|
|
141
|
-
'cleen-pointer-events-none',
|
|
142
|
-
isVisible
|
|
143
|
-
? 'cleen-opacity-100 cleen-scale-100'
|
|
144
|
-
: 'cleen-opacity-0 cleen-scale-95',
|
|
145
|
-
classNames?.container
|
|
146
|
-
)}
|
|
147
|
-
style={{ zIndex, ...styles?.container }}
|
|
148
|
-
aria-modal="true"
|
|
149
|
-
role="dialog"
|
|
150
|
-
>
|
|
151
|
-
<Card
|
|
152
|
-
header={header}
|
|
153
|
-
footer={footer}
|
|
154
|
-
color={color}
|
|
155
|
-
p={p}
|
|
156
|
-
gap={gap}
|
|
157
|
-
className={cn(
|
|
158
|
-
'cleen-relative cleen-shadow-xl cleen-w-full cleen-max-w-lg cleen-max-h-[90vh] cleen-rounded-lg',
|
|
159
|
-
'cleen-pointer-events-auto',
|
|
160
|
-
classNames?.modal?.className
|
|
161
|
-
)}
|
|
162
|
-
style={{
|
|
163
|
-
maxWidth: typeof size === 'number' ? size : SIZES[size],
|
|
164
|
-
...styles?.modal?.style,
|
|
165
|
-
}}
|
|
166
|
-
classNames={classNames?.modal?.classNames}
|
|
167
|
-
styles={styles?.modal?.styles}
|
|
168
|
-
ref={internalRef}
|
|
169
|
-
>
|
|
170
|
-
{children}
|
|
171
|
-
|
|
172
|
-
{closeButtonIcon && (
|
|
173
|
-
<div className={cn('cleen-top-3 cleen-right-3 cleen-absolute')}>
|
|
174
|
-
<Button
|
|
175
|
-
variant="borderless"
|
|
176
|
-
onClick={closeModal}
|
|
177
|
-
aria-label="Close modal"
|
|
178
|
-
classNames={{
|
|
179
|
-
container: 'cleen-p-1.5 cleen-rounded-full',
|
|
180
|
-
}}
|
|
181
|
-
>
|
|
182
|
-
{closeButtonIcon}
|
|
183
|
-
</Button>
|
|
184
|
-
</div>
|
|
185
|
-
)}
|
|
186
|
-
</Card>
|
|
187
|
-
</div>
|
|
188
|
-
</div>,
|
|
189
|
-
document.body
|
|
190
|
-
);
|
|
191
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Modal, type ModalProps } from './Modal';
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { NOTIFICATION_VARIANT_CONFIG } from '@/components/notification/constant/notification';
|
|
2
|
-
import { cn } from '@cleen/ui-core';
|
|
3
|
-
import type { ReactNode } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
Bounce,
|
|
6
|
-
Flip,
|
|
7
|
-
toast as notification,
|
|
8
|
-
Slide,
|
|
9
|
-
Zoom,
|
|
10
|
-
type ToastOptions as NotificationOptions,
|
|
11
|
-
} from 'react-toastify';
|
|
12
|
-
|
|
13
|
-
export type NotificationVariant =
|
|
14
|
-
| 'success'
|
|
15
|
-
| 'error'
|
|
16
|
-
| 'info'
|
|
17
|
-
| 'warning'
|
|
18
|
-
| 'default';
|
|
19
|
-
|
|
20
|
-
export interface NotificationProps extends Omit<
|
|
21
|
-
NotificationOptions,
|
|
22
|
-
'type' | 'transition'
|
|
23
|
-
> {
|
|
24
|
-
message: ReactNode;
|
|
25
|
-
variant?: NotificationVariant;
|
|
26
|
-
animationType?: 'bounce' | 'zoom' | 'slide' | 'flip';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* The `Notification` component provides a way to display brief notifications to users.
|
|
31
|
-
* It uses react-toastify library for toast notifications.
|
|
32
|
-
*/
|
|
33
|
-
export const showNotification = ({
|
|
34
|
-
message,
|
|
35
|
-
variant = 'default',
|
|
36
|
-
animationType = 'slide',
|
|
37
|
-
className,
|
|
38
|
-
...options
|
|
39
|
-
}: NotificationProps) => {
|
|
40
|
-
const getAnimationType = () => {
|
|
41
|
-
switch (animationType) {
|
|
42
|
-
case 'bounce':
|
|
43
|
-
return Bounce;
|
|
44
|
-
|
|
45
|
-
case 'flip':
|
|
46
|
-
return Flip;
|
|
47
|
-
|
|
48
|
-
case 'zoom':
|
|
49
|
-
return Zoom;
|
|
50
|
-
|
|
51
|
-
case 'slide':
|
|
52
|
-
default:
|
|
53
|
-
return Slide;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const notificationOptions: NotificationOptions = {
|
|
58
|
-
...NOTIFICATION_VARIANT_CONFIG.default,
|
|
59
|
-
...(variant !== 'default' && NOTIFICATION_VARIANT_CONFIG[variant]),
|
|
60
|
-
transition: getAnimationType(),
|
|
61
|
-
className: cn('cleen-text-sm', className),
|
|
62
|
-
...options,
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
switch (variant) {
|
|
66
|
-
case 'success':
|
|
67
|
-
return notification.success(message, notificationOptions);
|
|
68
|
-
case 'error':
|
|
69
|
-
return notification.error(message, notificationOptions);
|
|
70
|
-
case 'info':
|
|
71
|
-
return notification.info(message, notificationOptions);
|
|
72
|
-
case 'warning':
|
|
73
|
-
return notification.warning(message, notificationOptions);
|
|
74
|
-
|
|
75
|
-
case 'default':
|
|
76
|
-
default:
|
|
77
|
-
return notification(message, notificationOptions);
|
|
78
|
-
}
|
|
79
|
-
};
|