@cleen/ui 0.1.0 → 0.1.1
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 +611 -0
- package/dist/icons/index.d.ts +35 -0
- package/dist/icons/index.js +77 -0
- package/dist/index.d.ts +2959 -0
- package/dist/index.js +16710 -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,185 +0,0 @@
|
|
|
1
|
-
import { cn } from '@cleen/ui-core';
|
|
2
|
-
import type {
|
|
3
|
-
ComponentProps,
|
|
4
|
-
CSSProperties,
|
|
5
|
-
ForwardedRef,
|
|
6
|
-
ReactNode,
|
|
7
|
-
} from 'react';
|
|
8
|
-
import { forwardRef } from 'react';
|
|
9
|
-
|
|
10
|
-
export interface Step {
|
|
11
|
-
title?: ReactNode;
|
|
12
|
-
subtitle?: ReactNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface StepperProps extends ComponentProps<'div'> {
|
|
16
|
-
steps?: Step[];
|
|
17
|
-
activeStep?: number;
|
|
18
|
-
orientation?: 'horizontal' | 'vertical';
|
|
19
|
-
color?: string;
|
|
20
|
-
classNames?: {
|
|
21
|
-
container?: string;
|
|
22
|
-
step?: string;
|
|
23
|
-
circle?: string;
|
|
24
|
-
connector?: string;
|
|
25
|
-
title?: string;
|
|
26
|
-
subtitle?: string;
|
|
27
|
-
};
|
|
28
|
-
styles?: {
|
|
29
|
-
container?: CSSProperties;
|
|
30
|
-
step?: CSSProperties;
|
|
31
|
-
circle?: CSSProperties;
|
|
32
|
-
connector?: CSSProperties;
|
|
33
|
-
title?: CSSProperties;
|
|
34
|
-
subtitle?: CSSProperties;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Step-progress indicator rendered horizontally or vertically.
|
|
40
|
-
*
|
|
41
|
-
* - Pass `steps` as an array of `{ title?, subtitle? }` objects.
|
|
42
|
-
* - Control the active step with `activeStep` (1-based index).
|
|
43
|
-
* - Toggle layout with `orientation` (`horizontal` | `vertical`).
|
|
44
|
-
* - Override the accent color with `color`.
|
|
45
|
-
* - Accepts `classNames` and `styles` for keys: `container`, `step`, `circle`, `connector`, `title`, `subtitle`.
|
|
46
|
-
*/
|
|
47
|
-
export const Stepper = forwardRef<HTMLDivElement, StepperProps>(
|
|
48
|
-
(
|
|
49
|
-
{
|
|
50
|
-
steps,
|
|
51
|
-
activeStep = 0,
|
|
52
|
-
orientation = 'horizontal',
|
|
53
|
-
color = 'rgb(var(--cleen-primary))',
|
|
54
|
-
className,
|
|
55
|
-
classNames,
|
|
56
|
-
style,
|
|
57
|
-
styles,
|
|
58
|
-
...props
|
|
59
|
-
},
|
|
60
|
-
ref: ForwardedRef<HTMLDivElement>
|
|
61
|
-
) => {
|
|
62
|
-
const isVertical = orientation === 'vertical';
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<div
|
|
66
|
-
ref={ref}
|
|
67
|
-
className={cn('cleen', className)}
|
|
68
|
-
style={{ ...style, width: '100%' }}
|
|
69
|
-
{...props}
|
|
70
|
-
>
|
|
71
|
-
<div
|
|
72
|
-
className={cn(
|
|
73
|
-
'cleen-flex cleen-w-full',
|
|
74
|
-
isVertical
|
|
75
|
-
? 'cleen-flex-col cleen-gap-6'
|
|
76
|
-
: 'cleen-flex-row cleen-items-start cleen-gap-8 cleen-justify-between',
|
|
77
|
-
classNames?.container
|
|
78
|
-
)}
|
|
79
|
-
style={{ width: '100%', ...styles?.container }}
|
|
80
|
-
>
|
|
81
|
-
{steps?.map((step, index) => {
|
|
82
|
-
const isCompleted = index + 1 < activeStep;
|
|
83
|
-
const isActive = index + 1 === activeStep;
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<div
|
|
87
|
-
key={index}
|
|
88
|
-
className={cn(
|
|
89
|
-
'cleen-relative cleen-flex cleen-flex-1',
|
|
90
|
-
isVertical
|
|
91
|
-
? 'cleen-flex-row cleen-items-start'
|
|
92
|
-
: 'cleen-flex-col cleen-items-center cleen-text-center',
|
|
93
|
-
classNames?.step
|
|
94
|
-
)}
|
|
95
|
-
style={styles?.step}
|
|
96
|
-
>
|
|
97
|
-
{index < steps?.length - 1 && (
|
|
98
|
-
<div
|
|
99
|
-
className={cn(
|
|
100
|
-
'cleen-absolute cleen-bg-gray/10 cleen-transition-all cleen-duration-300',
|
|
101
|
-
isVertical
|
|
102
|
-
? 'cleen-left-3 cleen-top-7 cleen-w-[2px] cleen-h-[calc(100%-4px)]'
|
|
103
|
-
: 'cleen-top-3 cleen-left-[calc(50%+14px)] cleen-h-[2px] cleen-w-[calc(100%+4px)]',
|
|
104
|
-
isCompleted && 'cleen-bg-primary',
|
|
105
|
-
classNames?.connector
|
|
106
|
-
)}
|
|
107
|
-
style={{
|
|
108
|
-
backgroundColor: isCompleted ? color : undefined,
|
|
109
|
-
...styles?.connector,
|
|
110
|
-
}}
|
|
111
|
-
/>
|
|
112
|
-
)}
|
|
113
|
-
<div
|
|
114
|
-
className={cn(
|
|
115
|
-
'cleen-relative cleen-z-10 cleen-flex cleen-items-center cleen-justify-center cleen-rounded-full cleen-border cleen-transition-all cleen-duration-300',
|
|
116
|
-
'cleen-size-7',
|
|
117
|
-
isCompleted || isActive
|
|
118
|
-
? 'cleen-border-[2px]'
|
|
119
|
-
: 'cleen-border-gray/30',
|
|
120
|
-
classNames?.circle
|
|
121
|
-
)}
|
|
122
|
-
style={{
|
|
123
|
-
borderColor: isActive || isCompleted ? color : undefined,
|
|
124
|
-
backgroundColor: isCompleted ? color : 'transparent',
|
|
125
|
-
...styles?.circle,
|
|
126
|
-
}}
|
|
127
|
-
>
|
|
128
|
-
{isCompleted ? (
|
|
129
|
-
<span className="cleen-text-white cleen-text-sm">✓</span>
|
|
130
|
-
) : (
|
|
131
|
-
<span
|
|
132
|
-
className={cn(
|
|
133
|
-
'cleen-w-2 cleen-h-2 cleen-rounded-full',
|
|
134
|
-
isActive ? 'cleen-bg-white' : 'cleen-bg-gray/30'
|
|
135
|
-
)}
|
|
136
|
-
style={{ backgroundColor: isActive ? color : undefined }}
|
|
137
|
-
/>
|
|
138
|
-
)}
|
|
139
|
-
</div>
|
|
140
|
-
<div
|
|
141
|
-
className={cn(
|
|
142
|
-
'cleen-flex cleen-flex-col',
|
|
143
|
-
isVertical ? 'cleen-ml-3' : 'cleen-mt-3 cleen-items-center'
|
|
144
|
-
)}
|
|
145
|
-
>
|
|
146
|
-
{step.title && (
|
|
147
|
-
<div
|
|
148
|
-
className={cn(
|
|
149
|
-
'cleen-font-medium cleen-text-sm',
|
|
150
|
-
isActive ? 'cleen-text-primary' : 'cleen-text-gray',
|
|
151
|
-
classNames?.title
|
|
152
|
-
)}
|
|
153
|
-
style={{
|
|
154
|
-
color: isActive ? color : undefined,
|
|
155
|
-
...styles?.title,
|
|
156
|
-
}}
|
|
157
|
-
>
|
|
158
|
-
{step.title}
|
|
159
|
-
</div>
|
|
160
|
-
)}
|
|
161
|
-
{step.subtitle && (
|
|
162
|
-
<div
|
|
163
|
-
className={cn(
|
|
164
|
-
'cleen-text-xs cleen-text-gray/70',
|
|
165
|
-
classNames?.subtitle
|
|
166
|
-
)}
|
|
167
|
-
style={{
|
|
168
|
-
color: isActive ? color : undefined,
|
|
169
|
-
...styles?.subtitle,
|
|
170
|
-
}}
|
|
171
|
-
>
|
|
172
|
-
{step.subtitle}
|
|
173
|
-
</div>
|
|
174
|
-
)}
|
|
175
|
-
</div>
|
|
176
|
-
</div>
|
|
177
|
-
);
|
|
178
|
-
})}
|
|
179
|
-
</div>
|
|
180
|
-
</div>
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
|
-
|
|
185
|
-
Stepper.displayName = 'Stepper';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Stepper, type StepperProps } from './Stepper';
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
InfoLabels,
|
|
3
|
-
type InfoLabelsProps,
|
|
4
|
-
} from '@/components/infoLabels/InfoLabels';
|
|
5
|
-
import { cn } from '@cleen/ui-core';
|
|
6
|
-
import {
|
|
7
|
-
useEffect,
|
|
8
|
-
useState,
|
|
9
|
-
type ComponentProps,
|
|
10
|
-
type CSSProperties,
|
|
11
|
-
type ReactNode,
|
|
12
|
-
} from 'react';
|
|
13
|
-
|
|
14
|
-
export type SwitchProps = Omit<
|
|
15
|
-
ComponentProps<'button'>,
|
|
16
|
-
'onChange' | 'title'
|
|
17
|
-
> & {
|
|
18
|
-
checked?: boolean;
|
|
19
|
-
defaultChecked?: boolean;
|
|
20
|
-
title?: ReactNode;
|
|
21
|
-
label?: ReactNode;
|
|
22
|
-
sublabel?: ReactNode;
|
|
23
|
-
onChange?: (value: boolean) => void;
|
|
24
|
-
infoLabels?: InfoLabelsProps;
|
|
25
|
-
classNames?: {
|
|
26
|
-
container?: string;
|
|
27
|
-
title?: string;
|
|
28
|
-
switch?: string;
|
|
29
|
-
check?: string;
|
|
30
|
-
};
|
|
31
|
-
styles?: {
|
|
32
|
-
container?: CSSProperties;
|
|
33
|
-
title?: CSSProperties;
|
|
34
|
-
switch?: CSSProperties;
|
|
35
|
-
check?: CSSProperties;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Toggle switch for boolean on/off input with optional title, label, sub-label, and info messages.
|
|
41
|
-
*
|
|
42
|
-
* - Supports controlled mode via `checked` + `onChange`, and uncontrolled via `defaultChecked`.
|
|
43
|
-
* - Pass `title` for a heading row above the switch, `label` for primary text, and `sublabel` for secondary text beside it.
|
|
44
|
-
* - Accepts `classNames` and `styles` for keys: `container`, `title`, `switch`, `check`.
|
|
45
|
-
*/
|
|
46
|
-
export const Switch = ({
|
|
47
|
-
checked,
|
|
48
|
-
defaultChecked = false,
|
|
49
|
-
onChange,
|
|
50
|
-
title,
|
|
51
|
-
label,
|
|
52
|
-
sublabel,
|
|
53
|
-
disabled,
|
|
54
|
-
classNames,
|
|
55
|
-
className,
|
|
56
|
-
style,
|
|
57
|
-
styles,
|
|
58
|
-
infoLabels,
|
|
59
|
-
...props
|
|
60
|
-
}: SwitchProps) => {
|
|
61
|
-
const isControlled = typeof checked === 'boolean';
|
|
62
|
-
const [internalChecked, setInternalChecked] = useState(defaultChecked);
|
|
63
|
-
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
if (!isControlled) {
|
|
66
|
-
setInternalChecked(defaultChecked);
|
|
67
|
-
}
|
|
68
|
-
}, [defaultChecked, isControlled]);
|
|
69
|
-
|
|
70
|
-
const currentChecked = isControlled ? checked! : internalChecked;
|
|
71
|
-
|
|
72
|
-
const handleClick = () => {
|
|
73
|
-
if (!disabled) {
|
|
74
|
-
if (!isControlled) {
|
|
75
|
-
setInternalChecked(!internalChecked);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
onChange?.(!currentChecked);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
<div className={cn('cleen', className)} style={style}>
|
|
84
|
-
<div
|
|
85
|
-
className={cn(
|
|
86
|
-
'cleen-flex cleen-flex-col cleen-gap-2.5',
|
|
87
|
-
classNames?.container
|
|
88
|
-
)}
|
|
89
|
-
style={styles?.container}
|
|
90
|
-
>
|
|
91
|
-
{title && (
|
|
92
|
-
<label
|
|
93
|
-
className={cn(
|
|
94
|
-
'cleen-block cleen-mb-1.5 cleen-font-medium cleen-text-gray/90 cleen-text-sm cleen-leading-6',
|
|
95
|
-
classNames?.title
|
|
96
|
-
)}
|
|
97
|
-
style={styles?.title}
|
|
98
|
-
>
|
|
99
|
-
{title}
|
|
100
|
-
</label>
|
|
101
|
-
)}
|
|
102
|
-
|
|
103
|
-
<div className="cleen-flex cleen-items-center cleen-gap-2 cleen-w-full">
|
|
104
|
-
<button
|
|
105
|
-
type="button"
|
|
106
|
-
disabled={disabled}
|
|
107
|
-
onClick={handleClick}
|
|
108
|
-
className={cn(
|
|
109
|
-
'cleen-inline-flex cleen-relative cleen-flex-shrink-0 cleen-my-auto cleen-mb-auto cleen-border-2 cleen-border-transparent cleen-rounded-full cleen-w-11 cleen-h-6 cleen-transition-colors cleen-duration-200 cleen-ease-in-out cleen-cursor-pointer',
|
|
110
|
-
currentChecked
|
|
111
|
-
? 'cleen-bg-primary hover:cleen-bg-primary/90'
|
|
112
|
-
: 'cleen-bg-gray/20 hover:cleen-bg-gray/30',
|
|
113
|
-
classNames?.switch
|
|
114
|
-
)}
|
|
115
|
-
style={styles?.switch}
|
|
116
|
-
{...props}
|
|
117
|
-
>
|
|
118
|
-
<span
|
|
119
|
-
aria-hidden="true"
|
|
120
|
-
className={cn(
|
|
121
|
-
'cleen-inline-block cleen-bg-white cleen-shadow cleen-rounded-full cleen-ring-0 cleen-w-5 cleen-h-5 cleen-transition cleen-duration-200 cleen-ease-in-out cleen-pointer-events-none cleen-transform',
|
|
122
|
-
currentChecked ? 'cleen-translate-x-5' : 'cleen-translate-x-0',
|
|
123
|
-
classNames?.check
|
|
124
|
-
)}
|
|
125
|
-
style={styles?.check}
|
|
126
|
-
/>
|
|
127
|
-
</button>
|
|
128
|
-
|
|
129
|
-
{(label || sublabel) && (
|
|
130
|
-
<div className="cleen-flex cleen-flex-col cleen-text-sm">
|
|
131
|
-
{label && (
|
|
132
|
-
<span className="cleen-font-semibold cleen-text-gray/90">
|
|
133
|
-
{label}
|
|
134
|
-
</span>
|
|
135
|
-
)}
|
|
136
|
-
|
|
137
|
-
{sublabel && (
|
|
138
|
-
<span className="cleen-font-normal cleen-text-gray/80">
|
|
139
|
-
{sublabel}
|
|
140
|
-
</span>
|
|
141
|
-
)}
|
|
142
|
-
</div>
|
|
143
|
-
)}
|
|
144
|
-
</div>
|
|
145
|
-
|
|
146
|
-
{(infoLabels?.errorMessage ||
|
|
147
|
-
infoLabels?.infoMessage ||
|
|
148
|
-
infoLabels?.subtitle) && <InfoLabels {...infoLabels} />}
|
|
149
|
-
</div>
|
|
150
|
-
</div>
|
|
151
|
-
);
|
|
152
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Switch, type SwitchProps } from './Switch';
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { PillBadge } from '@/components/pillBadge';
|
|
2
|
-
import { cn } from '@cleen/ui-core';
|
|
3
|
-
import { forwardRef, useMemo, useState, type ComponentProps } from 'react';
|
|
4
|
-
import type { Tab, TabsClassNames, TabsStyles } from './types/tab';
|
|
5
|
-
import { directions, variants, type Direction, type Variant } from './variants';
|
|
6
|
-
|
|
7
|
-
export type TabsProps = ComponentProps<'div'> & {
|
|
8
|
-
tabs?: Tab[];
|
|
9
|
-
currentTabIndex?: number;
|
|
10
|
-
onTabChange?: (index: number, tab?: Tab) => void;
|
|
11
|
-
variant?: Variant;
|
|
12
|
-
direction?: Direction;
|
|
13
|
-
classNames?: TabsClassNames;
|
|
14
|
-
styles?: TabsStyles;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The `Tabs` component displays a set of selectable tabs, allowing users to switch between different views or content sections within an application.
|
|
19
|
-
* It supports controlled and uncontrolled modes, custom styling, and optional tab counts.
|
|
20
|
-
*/
|
|
21
|
-
export const Tabs = forwardRef<HTMLDivElement, TabsProps>(function Tabs(
|
|
22
|
-
{
|
|
23
|
-
tabs,
|
|
24
|
-
variant = 'underlined',
|
|
25
|
-
direction = 'horizontal',
|
|
26
|
-
currentTabIndex,
|
|
27
|
-
onTabChange,
|
|
28
|
-
className,
|
|
29
|
-
classNames,
|
|
30
|
-
style,
|
|
31
|
-
styles,
|
|
32
|
-
...props
|
|
33
|
-
},
|
|
34
|
-
ref
|
|
35
|
-
) {
|
|
36
|
-
const [internalCurrentTabIndex, setInternalCurrentTabIndex] = useState(0);
|
|
37
|
-
const isControlled = currentTabIndex !== undefined;
|
|
38
|
-
const finalTabIndex = isControlled
|
|
39
|
-
? currentTabIndex
|
|
40
|
-
: internalCurrentTabIndex;
|
|
41
|
-
|
|
42
|
-
const currentTab = useMemo(
|
|
43
|
-
() => tabs?.[finalTabIndex],
|
|
44
|
-
[tabs, finalTabIndex]
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
const handleTabClick = (index: number, tab: Tab) => {
|
|
48
|
-
setInternalCurrentTabIndex(index);
|
|
49
|
-
|
|
50
|
-
onTabChange?.(index, tab);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const variantClasses = useMemo(() => variants(direction), [direction]);
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<div className={cn('cleen', className)} style={style} ref={ref} {...props}>
|
|
57
|
-
<div
|
|
58
|
-
className={cn(directions[direction].container, classNames?.container)}
|
|
59
|
-
style={styles?.container}
|
|
60
|
-
>
|
|
61
|
-
<nav
|
|
62
|
-
className={cn(
|
|
63
|
-
variantClasses[variant].list,
|
|
64
|
-
directions[direction].list,
|
|
65
|
-
classNames?.list
|
|
66
|
-
)}
|
|
67
|
-
aria-label="Tabs"
|
|
68
|
-
style={styles?.list}
|
|
69
|
-
>
|
|
70
|
-
{tabs?.map((tab, index) => {
|
|
71
|
-
const isSelected = finalTabIndex === index;
|
|
72
|
-
const isDisabled = tab?.isDisabled;
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<span
|
|
76
|
-
key={tab?.id || index}
|
|
77
|
-
onClick={() => !isDisabled && handleTabClick(index, tab)}
|
|
78
|
-
className={cn(
|
|
79
|
-
'cleen-flex cleen-items-center cleen-gap-2 cleen-whitespace-nowrap',
|
|
80
|
-
!isDisabled && 'cleen-cursor-pointer',
|
|
81
|
-
variantClasses[variant].tab,
|
|
82
|
-
directions[direction].tab,
|
|
83
|
-
classNames?.tab,
|
|
84
|
-
isDisabled
|
|
85
|
-
? cn(
|
|
86
|
-
variantClasses[variant].tabDisabled,
|
|
87
|
-
classNames?.tabDisabled
|
|
88
|
-
)
|
|
89
|
-
: isSelected
|
|
90
|
-
? cn(
|
|
91
|
-
variantClasses[variant].tabActive,
|
|
92
|
-
classNames?.tabActive
|
|
93
|
-
)
|
|
94
|
-
: cn(
|
|
95
|
-
variantClasses[variant].tabInactive,
|
|
96
|
-
classNames?.tabInactive
|
|
97
|
-
)
|
|
98
|
-
)}
|
|
99
|
-
style={{
|
|
100
|
-
...styles?.tab,
|
|
101
|
-
...(isDisabled
|
|
102
|
-
? styles?.tabDisabled
|
|
103
|
-
: isSelected
|
|
104
|
-
? styles?.tabActive
|
|
105
|
-
: styles?.tabInactive),
|
|
106
|
-
}}
|
|
107
|
-
aria-current={isSelected ? 'page' : undefined}
|
|
108
|
-
aria-disabled={isDisabled}
|
|
109
|
-
>
|
|
110
|
-
{tab?.label}
|
|
111
|
-
{!!tab?.badge?.label && (
|
|
112
|
-
<PillBadge
|
|
113
|
-
variant="rounded"
|
|
114
|
-
color={isSelected ? 'blue' : 'gray'}
|
|
115
|
-
{...classNames?.count}
|
|
116
|
-
{...styles?.count}
|
|
117
|
-
{...tab.badge}
|
|
118
|
-
/>
|
|
119
|
-
)}
|
|
120
|
-
</span>
|
|
121
|
-
);
|
|
122
|
-
})}
|
|
123
|
-
</nav>
|
|
124
|
-
|
|
125
|
-
{!!currentTab?.content && (
|
|
126
|
-
<div
|
|
127
|
-
className={cn(
|
|
128
|
-
'h-full',
|
|
129
|
-
directions[direction].content,
|
|
130
|
-
classNames?.content
|
|
131
|
-
)}
|
|
132
|
-
style={styles?.content}
|
|
133
|
-
>
|
|
134
|
-
{currentTab?.content}
|
|
135
|
-
</div>
|
|
136
|
-
)}
|
|
137
|
-
</div>
|
|
138
|
-
</div>
|
|
139
|
-
);
|
|
140
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { PillBadgeProps } from '@/components/pillBadge/PillBadge';
|
|
2
|
-
import type { ComponentClassnames, ComponentStyles } from '@cleen/ui-core';
|
|
3
|
-
import type { CSSProperties, ReactNode } from 'react';
|
|
4
|
-
|
|
5
|
-
export interface Tab {
|
|
6
|
-
id?: string;
|
|
7
|
-
label?: ReactNode;
|
|
8
|
-
badge?: PillBadgeProps;
|
|
9
|
-
content?: ReactNode;
|
|
10
|
-
isDisabled?: boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface TabsClassNames {
|
|
14
|
-
container?: string;
|
|
15
|
-
list?: string;
|
|
16
|
-
tab?: string;
|
|
17
|
-
tabActive?: string;
|
|
18
|
-
tabInactive?: string;
|
|
19
|
-
tabDisabled?: string;
|
|
20
|
-
count?: ComponentClassnames<PillBadgeProps>;
|
|
21
|
-
content?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface TabsStyles {
|
|
25
|
-
container?: CSSProperties;
|
|
26
|
-
list?: CSSProperties;
|
|
27
|
-
tab?: CSSProperties;
|
|
28
|
-
tabActive?: CSSProperties;
|
|
29
|
-
tabInactive?: CSSProperties;
|
|
30
|
-
tabDisabled?: CSSProperties;
|
|
31
|
-
count?: ComponentStyles<PillBadgeProps>;
|
|
32
|
-
content?: CSSProperties;
|
|
33
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { TabsClassNames } from '@/components/tabs/types/tab';
|
|
2
|
-
import { cn } from '@cleen/ui-core';
|
|
3
|
-
|
|
4
|
-
export type Direction = 'horizontal' | 'vertical';
|
|
5
|
-
export type Variant = 'underlined' | 'padded';
|
|
6
|
-
|
|
7
|
-
export const directions: Record<Direction, TabsClassNames> = {
|
|
8
|
-
horizontal: {
|
|
9
|
-
list: 'cleen-flex cleen-flex-wrap cleen-mb-4',
|
|
10
|
-
},
|
|
11
|
-
vertical: {
|
|
12
|
-
container: 'cleen-flex cleen-gap-4',
|
|
13
|
-
list: 'cleen-flex cleen-flex-col',
|
|
14
|
-
content: 'cleen-flex-1',
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const variants: (
|
|
19
|
-
direction: keyof typeof directions
|
|
20
|
-
) => Record<Variant, TabsClassNames> = direction => {
|
|
21
|
-
const isVertical = direction === 'vertical';
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
underlined: {
|
|
25
|
-
list: cn(
|
|
26
|
-
'cleen-gap-2 cleen-border-gray/10',
|
|
27
|
-
!isVertical && 'cleen-border-b'
|
|
28
|
-
),
|
|
29
|
-
tab: cn(
|
|
30
|
-
'cleen-px-1 cleen-font-semibold cleen-text-sm cleen-transition-all cleen-duration-200',
|
|
31
|
-
isVertical
|
|
32
|
-
? 'cleen-border-l-2 cleen-pl-3 cleen-py-1.5'
|
|
33
|
-
: 'cleen-border-b-2 cleen-pb-3'
|
|
34
|
-
),
|
|
35
|
-
tabActive: 'cleen-border-primary cleen-text-primary',
|
|
36
|
-
tabInactive:
|
|
37
|
-
'cleen-border-transparent cleen-text-gray/70 hover:cleen-border-gray/10',
|
|
38
|
-
tabDisabled:
|
|
39
|
-
'cleen-border-transparent cleen-text-gray/40 cleen-cursor-not-allowed',
|
|
40
|
-
},
|
|
41
|
-
padded: {
|
|
42
|
-
list: 'cleen-gap-1',
|
|
43
|
-
tab: 'cleen-px-3 cleen-py-2.5 cleen-rounded-md cleen-font-semibold cleen-text-sm cleen-transition-all cleen-duration-200',
|
|
44
|
-
tabActive: 'cleen-bg-primary/10 cleen-text-primary',
|
|
45
|
-
tabInactive: 'cleen-text-gray/70 hover:cleen-bg-gray/10',
|
|
46
|
-
tabDisabled: 'cleen-text-gray/40 cleen-cursor-not-allowed',
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
};
|