@cleen/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +54 -0
- package/src/charts/chart/Chart.tsx +82 -0
- package/src/charts/chart/constant.ts +50 -0
- package/src/charts/chart/index.ts +2 -0
- package/src/charts/chart/types/apexcharts.ts +9 -0
- package/src/charts/chart/variants/BellCurve/BellCurve.tsx +215 -0
- package/src/charts/chart/variants/BellCurve/constant.ts +112 -0
- package/src/charts/chart/variants/BellCurve/helper.ts +116 -0
- package/src/charts/chart/variants/BellCurve/index.ts +2 -0
- package/src/charts/chart/variants/BellCurve/types/bellCurve.ts +47 -0
- package/src/charts/chart/variants/BellCurve/types/props.ts +21 -0
- package/src/charts/chart/variants/RadarChart/RadarChart.tsx +22 -0
- package/src/charts/chart/variants/RadarChart/constant.ts +28 -0
- package/src/charts/chart/variants/RadarChart/index.ts +1 -0
- package/src/charts/chart/variants/ScatterChart/ScatterChart.tsx +23 -0
- package/src/charts/chart/variants/ScatterChart/constant.ts +54 -0
- package/src/charts/chart/variants/ScatterChart/index.ts +1 -0
- package/src/charts/chart/variants/index.ts +3 -0
- package/src/charts/index.ts +2 -0
- package/src/charts/simpleChart/SimpleChart.tsx +54 -0
- package/src/charts/simpleChart/index.ts +1 -0
- package/src/components/advancedProgressBar/AdvancedProgressBar.tsx +156 -0
- package/src/components/advancedProgressBar/blocks/Bar.tsx +118 -0
- package/src/components/advancedProgressBar/blocks/BlockLabel.tsx +49 -0
- package/src/components/advancedProgressBar/blocks/Clamp.tsx +85 -0
- package/src/components/advancedProgressBar/constants.ts +6 -0
- package/src/components/advancedProgressBar/index.ts +2 -0
- package/src/components/advancedProgressBar/types/props.ts +69 -0
- package/src/components/advancedProgressBar/utils.ts +17 -0
- package/src/components/audioPlayback/AudioPlayback.tsx +141 -0
- package/src/components/audioPlayback/index.ts +2 -0
- package/src/components/audioRecorder/AudioRecorder.tsx +391 -0
- package/src/components/audioRecorder/constant/default.ts +19 -0
- package/src/components/audioRecorder/constant/labels.ts +9 -0
- package/src/components/audioRecorder/index.ts +2 -0
- package/src/components/audioRecorder/types/props.ts +56 -0
- package/src/components/avatar/Avatar.tsx +132 -0
- package/src/components/avatar/index.ts +1 -0
- package/src/components/avatar/variants.ts +9 -0
- package/src/components/avatarRow/AvatarRow.tsx +127 -0
- package/src/components/avatarRow/index.ts +1 -0
- package/src/components/breadcrumb/Breadcrumb.tsx +158 -0
- package/src/components/breadcrumb/index.ts +1 -0
- package/src/components/button/Button.tsx +114 -0
- package/src/components/button/index.ts +2 -0
- package/src/components/button/variants.ts +41 -0
- package/src/components/card/Card.tsx +197 -0
- package/src/components/card/index.ts +3 -0
- package/src/components/card/variants/CardIcon/CardIcon.tsx +158 -0
- package/src/components/card/variants/CardMedia/CardMedia.tsx +127 -0
- package/src/components/checkbox/Checkbox.tsx +246 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/checkbox/variants.ts +13 -0
- package/src/components/checkboxGroup/CheckboxGroup.tsx +163 -0
- package/src/components/checkboxGroup/index.ts +1 -0
- package/src/components/cleenIcon/CleenIcon.tsx +674 -0
- package/src/components/cleenIcon/icons/IconAlertCircle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconAlertFeatured.tsx +30 -0
- package/src/components/cleenIcon/icons/IconAlertOctagon.tsx +21 -0
- package/src/components/cleenIcon/icons/IconAlertTriangle.tsx +25 -0
- package/src/components/cleenIcon/icons/IconAlignRight.tsx +25 -0
- package/src/components/cleenIcon/icons/IconArrowDown.tsx +25 -0
- package/src/components/cleenIcon/icons/IconArrowLeft.tsx +25 -0
- package/src/components/cleenIcon/icons/IconArrowLeft2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconArrowRight.tsx +25 -0
- package/src/components/cleenIcon/icons/IconArrowToTop.tsx +20 -0
- package/src/components/cleenIcon/icons/IconArrowUp.tsx +22 -0
- package/src/components/cleenIcon/icons/IconArrowUpRight.tsx +22 -0
- package/src/components/cleenIcon/icons/IconArrowUpRightNarrow.tsx +22 -0
- package/src/components/cleenIcon/icons/IconArrowUpRightSquare.tsx +22 -0
- package/src/components/cleenIcon/icons/IconAttachment.tsx +22 -0
- package/src/components/cleenIcon/icons/IconBarChartSquare.tsx +22 -0
- package/src/components/cleenIcon/icons/IconBold.tsx +16 -0
- package/src/components/cleenIcon/icons/IconBookmarkCheck.tsx +22 -0
- package/src/components/cleenIcon/icons/IconBookmarkCheckFill.tsx +37 -0
- package/src/components/cleenIcon/icons/IconBookmarkPlus.tsx +22 -0
- package/src/components/cleenIcon/icons/IconBookmarkX.tsx +22 -0
- package/src/components/cleenIcon/icons/IconBoxLines.tsx +16 -0
- package/src/components/cleenIcon/icons/IconBoxText.tsx +24 -0
- package/src/components/cleenIcon/icons/IconBracketsCheck.tsx +25 -0
- package/src/components/cleenIcon/icons/IconBracketsEllipses.tsx +22 -0
- package/src/components/cleenIcon/icons/IconBuilding.tsx +22 -0
- package/src/components/cleenIcon/icons/IconCalendar.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCertificateHeart.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCheck.tsx +22 -0
- package/src/components/cleenIcon/icons/IconCheckCircle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconCheckCircleBroken.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCheckFill.tsx +45 -0
- package/src/components/cleenIcon/icons/IconCheckVerified.tsx +22 -0
- package/src/components/cleenIcon/icons/IconChevronDown.tsx +22 -0
- package/src/components/cleenIcon/icons/IconChevronLeft.tsx +25 -0
- package/src/components/cleenIcon/icons/IconChevronLeftDouble.tsx +22 -0
- package/src/components/cleenIcon/icons/IconChevronRight.tsx +25 -0
- package/src/components/cleenIcon/icons/IconChevronRightDouble.tsx +22 -0
- package/src/components/cleenIcon/icons/IconChevronSelectorVertical.tsx +22 -0
- package/src/components/cleenIcon/icons/IconChevronUp.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCircleSwap.tsx +22 -0
- package/src/components/cleenIcon/icons/IconClockFastForward.tsx +25 -0
- package/src/components/cleenIcon/icons/IconClockRewind.tsx +25 -0
- package/src/components/cleenIcon/icons/IconClockRewind2.tsx +21 -0
- package/src/components/cleenIcon/icons/IconCodeBrowser.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCodeCircle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconColors.tsx +25 -0
- package/src/components/cleenIcon/icons/IconColumnEdit.tsx +19 -0
- package/src/components/cleenIcon/icons/IconCopy.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCopy2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconCopy3.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCopy4.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCopy5.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCopyCheck.tsx +22 -0
- package/src/components/cleenIcon/icons/IconCube.tsx +25 -0
- package/src/components/cleenIcon/icons/IconCubeOutline.tsx +22 -0
- package/src/components/cleenIcon/icons/IconCursorBox.tsx +25 -0
- package/src/components/cleenIcon/icons/IconDataflow.tsx +22 -0
- package/src/components/cleenIcon/icons/IconDataflow2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconDataflow3.tsx +29 -0
- package/src/components/cleenIcon/icons/IconDelete.tsx +25 -0
- package/src/components/cleenIcon/icons/IconDollarCircle.tsx +25 -0
- package/src/components/cleenIcon/icons/IconDotsGrid.tsx +74 -0
- package/src/components/cleenIcon/icons/IconDotsHorizontal.tsx +34 -0
- package/src/components/cleenIcon/icons/IconDotsVertical.tsx +38 -0
- package/src/components/cleenIcon/icons/IconEdit.tsx +25 -0
- package/src/components/cleenIcon/icons/IconEditable.tsx +25 -0
- package/src/components/cleenIcon/icons/IconExpand.tsx +22 -0
- package/src/components/cleenIcon/icons/IconEye.tsx +28 -0
- package/src/components/cleenIcon/icons/IconEyeHidden.tsx +25 -0
- package/src/components/cleenIcon/icons/IconEyeHidden2.tsx +24 -0
- package/src/components/cleenIcon/icons/IconFaceSmile.tsx +24 -0
- package/src/components/cleenIcon/icons/IconFilter.tsx +22 -0
- package/src/components/cleenIcon/icons/IconFilter2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconFlag.tsx +22 -0
- package/src/components/cleenIcon/icons/IconFlag2.tsx +25 -0
- package/src/components/cleenIcon/icons/IconFlag3.tsx +16 -0
- package/src/components/cleenIcon/icons/IconHandShield.tsx +22 -0
- package/src/components/cleenIcon/icons/IconHash.tsx +22 -0
- package/src/components/cleenIcon/icons/IconHeadsetMic.tsx +21 -0
- package/src/components/cleenIcon/icons/IconHeart.tsx +24 -0
- package/src/components/cleenIcon/icons/IconHouseLine.tsx +22 -0
- package/src/components/cleenIcon/icons/IconImage.tsx +22 -0
- package/src/components/cleenIcon/icons/IconImage2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconImage3.tsx +17 -0
- package/src/components/cleenIcon/icons/IconImage4.tsx +25 -0
- package/src/components/cleenIcon/icons/IconImageCheck.tsx +22 -0
- package/src/components/cleenIcon/icons/IconInfoCircle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconInfoHexagon.tsx +25 -0
- package/src/components/cleenIcon/icons/IconItalic.tsx +16 -0
- package/src/components/cleenIcon/icons/IconLayersMultiple.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLayersSingle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLayout.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLayout2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLayoutColumns.tsx +20 -0
- package/src/components/cleenIcon/icons/IconLayoutCustom.tsx +16 -0
- package/src/components/cleenIcon/icons/IconLayoutSequential.tsx +16 -0
- package/src/components/cleenIcon/icons/IconLayoutStuffed.tsx +20 -0
- package/src/components/cleenIcon/icons/IconLayoutTile.tsx +16 -0
- package/src/components/cleenIcon/icons/IconLifeBuoy.tsx +29 -0
- package/src/components/cleenIcon/icons/IconLightbulb.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLightning.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLightning2.tsx +25 -0
- package/src/components/cleenIcon/icons/IconLightningFast.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLineChartBar.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLineChartBreakoutSquare.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLineChartUp.tsx +25 -0
- package/src/components/cleenIcon/icons/IconLineChartUp2.tsx +34 -0
- package/src/components/cleenIcon/icons/IconLines.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLinesCheck.tsx +16 -0
- package/src/components/cleenIcon/icons/IconLinesPlay.tsx +23 -0
- package/src/components/cleenIcon/icons/IconLink.tsx +25 -0
- package/src/components/cleenIcon/icons/IconLink2.tsx +24 -0
- package/src/components/cleenIcon/icons/IconLink3.tsx +21 -0
- package/src/components/cleenIcon/icons/IconLink4.tsx +17 -0
- package/src/components/cleenIcon/icons/IconLink5.tsx +22 -0
- package/src/components/cleenIcon/icons/IconListBullet.tsx +18 -0
- package/src/components/cleenIcon/icons/IconListOrder.tsx +20 -0
- package/src/components/cleenIcon/icons/IconListOrder2.tsx +16 -0
- package/src/components/cleenIcon/icons/IconLock.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLock2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconLogIn.tsx +25 -0
- package/src/components/cleenIcon/icons/IconLogOut.tsx +25 -0
- package/src/components/cleenIcon/icons/IconLogOut2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconMagicWand.tsx +25 -0
- package/src/components/cleenIcon/icons/IconMagicWand2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconMail.tsx +25 -0
- package/src/components/cleenIcon/icons/IconMessageSquare.tsx +25 -0
- package/src/components/cleenIcon/icons/IconMessageSquare2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconMessageXSquare.tsx +25 -0
- package/src/components/cleenIcon/icons/IconMinusCircle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconMobile.tsx +25 -0
- package/src/components/cleenIcon/icons/IconMonitor.tsx +22 -0
- package/src/components/cleenIcon/icons/IconMonitor2.tsx +25 -0
- package/src/components/cleenIcon/icons/IconMonitor3.tsx +25 -0
- package/src/components/cleenIcon/icons/IconMoonCircle.tsx +28 -0
- package/src/components/cleenIcon/icons/IconNavigationPointer.tsx +22 -0
- package/src/components/cleenIcon/icons/IconNotificationBox.tsx +22 -0
- package/src/components/cleenIcon/icons/IconPCSetup.tsx +22 -0
- package/src/components/cleenIcon/icons/IconPalette.tsx +40 -0
- package/src/components/cleenIcon/icons/IconPasscodeLock.tsx +25 -0
- package/src/components/cleenIcon/icons/IconPencil.tsx +25 -0
- package/src/components/cleenIcon/icons/IconPercentageCircle.tsx +29 -0
- package/src/components/cleenIcon/icons/IconPerspective.tsx +22 -0
- package/src/components/cleenIcon/icons/IconPhoneCall.tsx +25 -0
- package/src/components/cleenIcon/icons/IconPin.tsx +22 -0
- package/src/components/cleenIcon/icons/IconPlayCircle.tsx +28 -0
- package/src/components/cleenIcon/icons/IconPlus.tsx +22 -0
- package/src/components/cleenIcon/icons/IconPlusCircle.tsx +25 -0
- package/src/components/cleenIcon/icons/IconPulse.tsx +25 -0
- package/src/components/cleenIcon/icons/IconQuestionCircle.tsx +24 -0
- package/src/components/cleenIcon/icons/IconRadioButton.tsx +27 -0
- package/src/components/cleenIcon/icons/IconRadioButtonActive.tsx +39 -0
- package/src/components/cleenIcon/icons/IconReceiptCheck.tsx +25 -0
- package/src/components/cleenIcon/icons/IconRedo.tsx +16 -0
- package/src/components/cleenIcon/icons/IconRefresh.tsx +22 -0
- package/src/components/cleenIcon/icons/IconRefresh2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconRefresh3.tsx +20 -0
- package/src/components/cleenIcon/icons/IconRepeat.tsx +22 -0
- package/src/components/cleenIcon/icons/IconRepeat2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconRetweet.tsx +33 -0
- package/src/components/cleenIcon/icons/IconRoundChart.tsx +25 -0
- package/src/components/cleenIcon/icons/IconRoundChart2.tsx +29 -0
- package/src/components/cleenIcon/icons/IconRoute.tsx +22 -0
- package/src/components/cleenIcon/icons/IconSave.tsx +25 -0
- package/src/components/cleenIcon/icons/IconSave2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconScanDots.tsx +22 -0
- package/src/components/cleenIcon/icons/IconSearch.tsx +22 -0
- package/src/components/cleenIcon/icons/IconSend.tsx +25 -0
- package/src/components/cleenIcon/icons/IconSettings.tsx +32 -0
- package/src/components/cleenIcon/icons/IconSettings2.tsx +25 -0
- package/src/components/cleenIcon/icons/IconSettings3.tsx +22 -0
- package/src/components/cleenIcon/icons/IconShieldLightning.tsx +22 -0
- package/src/components/cleenIcon/icons/IconShieldPlus.tsx +22 -0
- package/src/components/cleenIcon/icons/IconShieldRemove.tsx +16 -0
- package/src/components/cleenIcon/icons/IconShuffle.tsx +25 -0
- package/src/components/cleenIcon/icons/IconSlashCircle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconSlashOctagon.tsx +22 -0
- package/src/components/cleenIcon/icons/IconSocialGlobe.tsx +23 -0
- package/src/components/cleenIcon/icons/IconSocialLinkedin.tsx +21 -0
- package/src/components/cleenIcon/icons/IconSocialX.tsx +28 -0
- package/src/components/cleenIcon/icons/IconSpeedometer.tsx +22 -0
- package/src/components/cleenIcon/icons/IconStairsRound.tsx +21 -0
- package/src/components/cleenIcon/icons/IconStar.tsx +22 -0
- package/src/components/cleenIcon/icons/IconStarHalf.tsx +39 -0
- package/src/components/cleenIcon/icons/IconStars.tsx +28 -0
- package/src/components/cleenIcon/icons/IconStars2.tsx +29 -0
- package/src/components/cleenIcon/icons/IconStrikethrough.tsx +16 -0
- package/src/components/cleenIcon/icons/IconSuccessFeatured.tsx +30 -0
- package/src/components/cleenIcon/icons/IconSun.tsx +22 -0
- package/src/components/cleenIcon/icons/IconSwitchHorizontal.tsx +22 -0
- package/src/components/cleenIcon/icons/IconTag.tsx +22 -0
- package/src/components/cleenIcon/icons/IconTarget.tsx +21 -0
- package/src/components/cleenIcon/icons/IconTarget2.tsx +34 -0
- package/src/components/cleenIcon/icons/IconTextFormat.tsx +17 -0
- package/src/components/cleenIcon/icons/IconTextFormat2.tsx +22 -0
- package/src/components/cleenIcon/icons/IconTextHighlight.tsx +16 -0
- package/src/components/cleenIcon/icons/IconTranslate.tsx +25 -0
- package/src/components/cleenIcon/icons/IconTrash.tsx +25 -0
- package/src/components/cleenIcon/icons/IconTrending.tsx +22 -0
- package/src/components/cleenIcon/icons/IconUnderline.tsx +16 -0
- package/src/components/cleenIcon/icons/IconUndo.tsx +22 -0
- package/src/components/cleenIcon/icons/IconUndo2.tsx +16 -0
- package/src/components/cleenIcon/icons/IconUploadCloud.tsx +22 -0
- package/src/components/cleenIcon/icons/IconUser.tsx +22 -0
- package/src/components/cleenIcon/icons/IconUserEdit.tsx +25 -0
- package/src/components/cleenIcon/icons/IconUserRight.tsx +22 -0
- package/src/components/cleenIcon/icons/IconUserSquare.tsx +25 -0
- package/src/components/cleenIcon/icons/IconUsers.tsx +25 -0
- package/src/components/cleenIcon/icons/IconUsersUp.tsx +25 -0
- package/src/components/cleenIcon/icons/IconVolume.tsx +25 -0
- package/src/components/cleenIcon/icons/IconWrench.tsx +22 -0
- package/src/components/cleenIcon/icons/IconX.tsx +25 -0
- package/src/components/cleenIcon/icons/IconXCircle.tsx +22 -0
- package/src/components/cleenIcon/icons/IconXCircle2.tsx +42 -0
- package/src/components/cleenIcon/icons/IconXClose.tsx +25 -0
- package/src/components/cleenIcon/icons/IconXSquare.tsx +22 -0
- package/src/components/cleenIcon/icons/index.ts +215 -0
- package/src/components/cleenIcon/index.ts +4 -0
- package/src/components/cleenIcon/types/icon.ts +226 -0
- package/src/components/collapsible/Collapsible.tsx +148 -0
- package/src/components/collapsible/index.ts +5 -0
- package/src/components/creditCardInput/CreditCardInput.tsx +236 -0
- package/src/components/creditCardInput/index.ts +2 -0
- package/src/components/creditCardInput/types/card.ts +13 -0
- package/src/components/creditCardInput/types/props.ts +44 -0
- package/src/components/creditCardInput/util/format.ts +102 -0
- package/src/components/datePicker/DatePicker.tsx +235 -0
- package/src/components/datePicker/index.ts +2 -0
- package/src/components/datePicker/types/props.ts +47 -0
- package/src/components/datePicker/utils/date.ts +40 -0
- package/src/components/divider/Divider.tsx +43 -0
- package/src/components/divider/index.ts +1 -0
- package/src/components/drawer/Drawer.tsx +222 -0
- package/src/components/drawer/index.ts +1 -0
- package/src/components/dropdown/Dropdown.tsx +224 -0
- package/src/components/dropdown/index.ts +1 -0
- package/src/components/filterDrawer/FilterDrawer.tsx +147 -0
- package/src/components/filterDrawer/blocks/FilterDrawerFooter.tsx +119 -0
- package/src/components/filterDrawer/blocks/SaveFilterStep.tsx +56 -0
- package/src/components/filterDrawer/blocks/SavedFilterRow.tsx +166 -0
- package/src/components/filterDrawer/blocks/SavedFiltersDropdown.tsx +142 -0
- package/src/components/filterDrawer/constants/filter.ts +4 -0
- package/src/components/filterDrawer/constants/labels.ts +52 -0
- package/src/components/filterDrawer/constants/tab.ts +7 -0
- package/src/components/filterDrawer/context/context.ts +28 -0
- package/src/components/filterDrawer/context/provider.tsx +50 -0
- package/src/components/filterDrawer/index.ts +7 -0
- package/src/components/filterDrawer/types/filters.ts +28 -0
- package/src/components/filterDrawer/types/props.ts +107 -0
- package/src/components/filterDrawer/types/validation.ts +6 -0
- package/src/components/formGroup/FormGroup.tsx +165 -0
- package/src/components/formGroup/index.ts +1 -0
- package/src/components/groupSelector/GroupSelector.tsx +729 -0
- package/src/components/groupSelector/index.ts +6 -0
- package/src/components/index.ts +44 -0
- package/src/components/infoLabels/InfoLabels.tsx +88 -0
- package/src/components/infoLabels/index.ts +1 -0
- package/src/components/input/Input.tsx +269 -0
- package/src/components/input/index.ts +1 -0
- package/src/components/loader/Loader.tsx +91 -0
- package/src/components/loader/index.ts +1 -0
- package/src/components/lookup/Lookup.tsx +433 -0
- package/src/components/lookup/blocks/LookupOptionList.tsx +130 -0
- package/src/components/lookup/index.ts +2 -0
- package/src/components/lookup/types/lookup.ts +97 -0
- package/src/components/menu/Menu.tsx +103 -0
- package/src/components/menu/blocks/MenuContent.tsx +105 -0
- package/src/components/menu/blocks/MenuItem.tsx +120 -0
- package/src/components/menu/index.ts +2 -0
- package/src/components/menu/types/menu.ts +30 -0
- package/src/components/menu/types/menuItem.ts +48 -0
- package/src/components/modal/Modal.tsx +191 -0
- package/src/components/modal/index.ts +1 -0
- package/src/components/notification/Notification.tsx +79 -0
- package/src/components/notification/constant/notification.ts +30 -0
- package/src/components/notification/index.ts +2 -0
- package/src/components/notification/wrappers/CleenNotificationContainer.tsx +9 -0
- package/src/components/pagination/Pagination.tsx +294 -0
- package/src/components/pagination/blocks/PaginationGoToPage.tsx +91 -0
- package/src/components/pagination/blocks/PaginationPageSize.tsx +145 -0
- package/src/components/pagination/constants/labels.ts +15 -0
- package/src/components/pagination/index.ts +9 -0
- package/src/components/pillBadge/PillBadge.tsx +130 -0
- package/src/components/pillBadge/helper.ts +11 -0
- package/src/components/pillBadge/index.ts +1 -0
- package/src/components/pillBadge/variants.ts +47 -0
- package/src/components/popover/Popover.tsx +108 -0
- package/src/components/popover/index.ts +2 -0
- package/src/components/popover/types/popover.ts +21 -0
- package/src/components/progressBar/ProgressBar.tsx +179 -0
- package/src/components/progressBar/index.ts +1 -0
- package/src/components/progressCircle/ProgressCircle.tsx +142 -0
- package/src/components/progressCircle/index.ts +1 -0
- package/src/components/radioBoxGroup/RadioBoxGroup.tsx +207 -0
- package/src/components/radioBoxGroup/index.ts +1 -0
- package/src/components/radioButtonGroup/RadioButtonGroup.tsx +208 -0
- package/src/components/radioButtonGroup/blocks/RadioButton.tsx +22 -0
- package/src/components/radioButtonGroup/index.ts +4 -0
- package/src/components/radioButtonGroup/types/radioButton.ts +10 -0
- package/src/components/rangeSlider/RangeSlider.tsx +366 -0
- package/src/components/rangeSlider/index.ts +1 -0
- package/src/components/select/Select.tsx +349 -0
- package/src/components/select/blocks/SelectCustomMenuList.tsx +70 -0
- package/src/components/select/blocks/SelectNoOptionsMessage.tsx +22 -0
- package/src/components/select/blocks/SelectOption.tsx +19 -0
- package/src/components/select/blocks/SelectSingleValue.tsx +28 -0
- package/src/components/select/index.ts +1 -0
- package/src/components/sidebar/Sidebar.tsx +210 -0
- package/src/components/sidebar/SidebarItem.tsx +88 -0
- package/src/components/sidebar/drawerContainer/DrawerContainer.tsx +36 -0
- package/src/components/sidebar/drawerContainer/DrawerContentTitle.tsx +165 -0
- package/src/components/sidebar/drawerContainer/index.ts +2 -0
- package/src/components/sidebar/index.ts +13 -0
- package/src/components/sidebar/types.ts +157 -0
- package/src/components/skeletons/blocks/Skeleton.tsx +72 -0
- package/src/components/skeletons/blocks/SkeletonAvatar.tsx +43 -0
- package/src/components/skeletons/blocks/SkeletonBadge.tsx +30 -0
- package/src/components/skeletons/blocks/SkeletonBanner.tsx +44 -0
- package/src/components/skeletons/blocks/SkeletonButton.tsx +31 -0
- package/src/components/skeletons/blocks/SkeletonCard.tsx +39 -0
- package/src/components/skeletons/blocks/SkeletonCard2.tsx +57 -0
- package/src/components/skeletons/blocks/SkeletonCard3.tsx +89 -0
- package/src/components/skeletons/blocks/SkeletonCardStack.tsx +22 -0
- package/src/components/skeletons/blocks/SkeletonChart.tsx +114 -0
- package/src/components/skeletons/blocks/SkeletonContentCard.tsx +75 -0
- package/src/components/skeletons/blocks/SkeletonDataGrid.tsx +73 -0
- package/src/components/skeletons/blocks/SkeletonForm.tsx +50 -0
- package/src/components/skeletons/blocks/SkeletonImage.tsx +45 -0
- package/src/components/skeletons/blocks/SkeletonInfoCard.tsx +130 -0
- package/src/components/skeletons/blocks/SkeletonInput.tsx +32 -0
- package/src/components/skeletons/blocks/SkeletonList.tsx +67 -0
- package/src/components/skeletons/blocks/SkeletonParagraph.tsx +52 -0
- package/src/components/skeletons/blocks/SkeletonText.tsx +22 -0
- package/src/components/skeletons/blocks/SkeletonVideo.tsx +71 -0
- package/src/components/skeletons/blocks/SkeletonWidgetCard.tsx +56 -0
- package/src/components/skeletons/blocks/SkeletonWrapper.tsx +140 -0
- package/src/components/skeletons/index.ts +24 -0
- package/src/components/skeletons/styles/skeleton.ts +2 -0
- package/src/components/skeletons/types/skeleton.ts +8 -0
- package/src/components/slider/Slider.tsx +298 -0
- package/src/components/slider/index.ts +1 -0
- package/src/components/stepper/Stepper.tsx +185 -0
- package/src/components/stepper/index.ts +1 -0
- package/src/components/switch/Switch.tsx +152 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/tabs/Tabs.tsx +140 -0
- package/src/components/tabs/index.ts +2 -0
- package/src/components/tabs/types/tab.ts +33 -0
- package/src/components/tabs/variants.ts +49 -0
- package/src/components/textArea/TextArea.tsx +244 -0
- package/src/components/textArea/index.ts +1 -0
- package/src/components/tooltip/Tooltip.tsx +200 -0
- package/src/components/tooltip/index.ts +1 -0
- package/src/icons/IconFromLibrary.tsx +13 -0
- package/src/icons/getIconByName.ts +81 -0
- package/src/icons/index.ts +16 -0
- package/src/index.ts +1 -0
- package/tsconfig.json +27 -0
- package/tsup.config.ts +23 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { AudioRecorderLabels } from '@/components/audioRecorder/constant/labels';
|
|
2
|
+
import type { ButtonProps } from '@/components/button/Button';
|
|
3
|
+
import type { ComponentClassnames, ComponentStyles } from '@cleen/ui-core';
|
|
4
|
+
import type { ComponentProps, CSSProperties } from 'react';
|
|
5
|
+
import type { RecordPluginOptions } from 'wavesurfer.js/dist/plugins/record.js';
|
|
6
|
+
import type { WaveSurferOptions } from 'wavesurfer.js/dist/types.js';
|
|
7
|
+
|
|
8
|
+
export type WaveSurferHookOptions = Omit<
|
|
9
|
+
WaveSurferOptions,
|
|
10
|
+
'container' | 'plugins' | 'splitChannels'
|
|
11
|
+
> & {
|
|
12
|
+
regionColor?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export interface AudioRecorderProps extends Omit<
|
|
16
|
+
ComponentProps<'div'>,
|
|
17
|
+
'children'
|
|
18
|
+
> {
|
|
19
|
+
/** Fired when a recording is finalized; receives the raw Blob and a transient blob-URL */
|
|
20
|
+
onFinalize?: (blob: Blob, url: string) => void;
|
|
21
|
+
/** Options forwarded to the WaveSurfer RecordPlugin */
|
|
22
|
+
recordOptions?: RecordPluginOptions;
|
|
23
|
+
/** Options forwarded to the WaveSurfer hook */
|
|
24
|
+
options?: WaveSurferHookOptions;
|
|
25
|
+
labels?: Partial<AudioRecorderLabels>;
|
|
26
|
+
classNames?: {
|
|
27
|
+
container?: string;
|
|
28
|
+
startButton?: string;
|
|
29
|
+
startLabel?: string;
|
|
30
|
+
stopButton?: string;
|
|
31
|
+
waveform?: string;
|
|
32
|
+
|
|
33
|
+
recordedContainer?: string;
|
|
34
|
+
timestamp?: string;
|
|
35
|
+
trimmedTimestamp?: string;
|
|
36
|
+
playPauseButton?: ComponentClassnames<ButtonProps>;
|
|
37
|
+
discardButton?: ComponentClassnames<ButtonProps>;
|
|
38
|
+
trimButton?: ComponentClassnames<ButtonProps>;
|
|
39
|
+
finalizeButton?: ComponentClassnames<ButtonProps>;
|
|
40
|
+
};
|
|
41
|
+
styles?: {
|
|
42
|
+
container?: CSSProperties;
|
|
43
|
+
startButton?: CSSProperties;
|
|
44
|
+
startLabel?: CSSProperties;
|
|
45
|
+
stopButton?: CSSProperties;
|
|
46
|
+
waveform?: CSSProperties;
|
|
47
|
+
|
|
48
|
+
recordedContainer?: CSSProperties;
|
|
49
|
+
timestamp?: CSSProperties;
|
|
50
|
+
trimmedTimestamp?: CSSProperties;
|
|
51
|
+
playPauseButton?: ComponentStyles<ButtonProps>;
|
|
52
|
+
discardButton?: ComponentStyles<ButtonProps>;
|
|
53
|
+
trimButton?: ComponentStyles<ButtonProps>;
|
|
54
|
+
finalizeButton?: ComponentStyles<ButtonProps>;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { IconUser } from '@/components/cleenIcon';
|
|
2
|
+
import { cn } from '@cleen/ui-core';
|
|
3
|
+
import {
|
|
4
|
+
forwardRef,
|
|
5
|
+
useMemo,
|
|
6
|
+
type ComponentProps,
|
|
7
|
+
type CSSProperties,
|
|
8
|
+
type ReactNode,
|
|
9
|
+
} from 'react';
|
|
10
|
+
import { sizeVariants, type AvatarSize } from './variants';
|
|
11
|
+
|
|
12
|
+
export type AvatarProps = Omit<ComponentProps<'div'>, 'children'> & {
|
|
13
|
+
name?: string;
|
|
14
|
+
src?: string;
|
|
15
|
+
alt?: string;
|
|
16
|
+
size?: AvatarSize | number;
|
|
17
|
+
initialsLength?: 1 | 2;
|
|
18
|
+
isSelected?: boolean;
|
|
19
|
+
showBorder?: boolean;
|
|
20
|
+
fallback?: ReactNode;
|
|
21
|
+
classNames?: {
|
|
22
|
+
container?: string;
|
|
23
|
+
avatar?: string;
|
|
24
|
+
avatarSelected?: string;
|
|
25
|
+
image?: string;
|
|
26
|
+
fallback?: string;
|
|
27
|
+
};
|
|
28
|
+
styles?: {
|
|
29
|
+
container?: CSSProperties;
|
|
30
|
+
avatar?: CSSProperties;
|
|
31
|
+
avatarSelected?: CSSProperties;
|
|
32
|
+
image?: CSSProperties;
|
|
33
|
+
fallback?: CSSProperties;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Avatar component displays a user's profile picture or initials.
|
|
39
|
+
*
|
|
40
|
+
* - Supports image source via `src` prop or displays first letter of `name` as fallback.
|
|
41
|
+
* - Configurable `size` variants: xs, sm, md, lg, xl.
|
|
42
|
+
* - Optional `isSelected` state changes border color to primary.
|
|
43
|
+
* - Accepts `classNames` and `styles` objects to customize:
|
|
44
|
+
* `container`, `avatar`, `image`, and `fallback`.
|
|
45
|
+
* - Forwards remaining div props and ref to the root element.
|
|
46
|
+
*/
|
|
47
|
+
export const Avatar = forwardRef<HTMLDivElement, AvatarProps>(function Avatar(
|
|
48
|
+
{
|
|
49
|
+
title,
|
|
50
|
+
name,
|
|
51
|
+
src,
|
|
52
|
+
alt,
|
|
53
|
+
size = 'md',
|
|
54
|
+
initialsLength = 2,
|
|
55
|
+
isSelected = false,
|
|
56
|
+
showBorder = false,
|
|
57
|
+
fallback = <IconUser />,
|
|
58
|
+
className,
|
|
59
|
+
classNames,
|
|
60
|
+
style,
|
|
61
|
+
styles,
|
|
62
|
+
onClick,
|
|
63
|
+
...props
|
|
64
|
+
},
|
|
65
|
+
ref
|
|
66
|
+
) {
|
|
67
|
+
const initials = useMemo(
|
|
68
|
+
() =>
|
|
69
|
+
(initialsLength === 2
|
|
70
|
+
? name
|
|
71
|
+
?.split(' ')
|
|
72
|
+
.map(n => n.charAt(0).toUpperCase())
|
|
73
|
+
.join('')
|
|
74
|
+
.slice(0, initialsLength)
|
|
75
|
+
: name?.charAt(0).toUpperCase()) || fallback,
|
|
76
|
+
[name, initialsLength, fallback]
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<div className={cn('cleen', className)} style={style} ref={ref} {...props}>
|
|
81
|
+
<div
|
|
82
|
+
onClick={onClick}
|
|
83
|
+
className={cn(
|
|
84
|
+
'cleen-flex cleen-justify-center cleen-items-center cleen-bg-gray/20 cleen-rounded-full cleen-font-medium cleen-transition-all',
|
|
85
|
+
typeof size === 'string' && sizeVariants[size],
|
|
86
|
+
{
|
|
87
|
+
'cleen-border-2 cleen-border-white': showBorder,
|
|
88
|
+
'cleen-cursor-pointer': !!onClick,
|
|
89
|
+
},
|
|
90
|
+
classNames?.avatar,
|
|
91
|
+
{
|
|
92
|
+
[`cleen-border-primary ${classNames?.avatarSelected}`]:
|
|
93
|
+
showBorder && isSelected,
|
|
94
|
+
}
|
|
95
|
+
)}
|
|
96
|
+
style={{
|
|
97
|
+
...(typeof size === 'number' && {
|
|
98
|
+
width: size,
|
|
99
|
+
height: size,
|
|
100
|
+
fontSize: size * 0.4,
|
|
101
|
+
lineHeight: `${size}px`,
|
|
102
|
+
}),
|
|
103
|
+
...styles?.avatar,
|
|
104
|
+
...(showBorder && isSelected && styles?.avatarSelected),
|
|
105
|
+
}}
|
|
106
|
+
title={title || name}
|
|
107
|
+
>
|
|
108
|
+
{src ? (
|
|
109
|
+
<img
|
|
110
|
+
src={src}
|
|
111
|
+
alt={alt || name}
|
|
112
|
+
className={cn(
|
|
113
|
+
'cleen-rounded-full cleen-w-full cleen-h-full cleen-object-cover',
|
|
114
|
+
classNames?.image
|
|
115
|
+
)}
|
|
116
|
+
style={styles?.image}
|
|
117
|
+
/>
|
|
118
|
+
) : (
|
|
119
|
+
<span
|
|
120
|
+
className={cn(
|
|
121
|
+
'cleen-select-none cleen-text-gray/70',
|
|
122
|
+
classNames?.fallback
|
|
123
|
+
)}
|
|
124
|
+
style={styles?.fallback}
|
|
125
|
+
>
|
|
126
|
+
{initials}
|
|
127
|
+
</span>
|
|
128
|
+
)}
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
);
|
|
132
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Avatar, type AvatarProps } from './Avatar';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2
|
+
|
|
3
|
+
export const sizeVariants: Record<AvatarSize, string> = {
|
|
4
|
+
xs: 'cleen-size-6 cleen-text-[10px]',
|
|
5
|
+
sm: 'cleen-size-7 cleen-text-xs',
|
|
6
|
+
md: 'cleen-size-9 cleen-text-sm',
|
|
7
|
+
lg: 'cleen-size-11 cleen-text-base',
|
|
8
|
+
xl: 'cleen-size-14 cleen-text-lg',
|
|
9
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Avatar, type AvatarProps } from '@/components/avatar';
|
|
2
|
+
import { type AvatarSize } from '@/components/avatar/variants';
|
|
3
|
+
import {
|
|
4
|
+
cn,
|
|
5
|
+
type ComponentClassnames,
|
|
6
|
+
type ComponentStyles,
|
|
7
|
+
} from '@cleen/ui-core';
|
|
8
|
+
import {
|
|
9
|
+
forwardRef,
|
|
10
|
+
type ComponentProps,
|
|
11
|
+
type CSSProperties,
|
|
12
|
+
type ReactNode,
|
|
13
|
+
} from 'react';
|
|
14
|
+
|
|
15
|
+
export type AvatarRowProps = Omit<ComponentProps<'div'>, 'children'> & {
|
|
16
|
+
avatars?: AvatarProps[];
|
|
17
|
+
size?: AvatarSize;
|
|
18
|
+
selectedAvatars?: string[];
|
|
19
|
+
onAvatarToggle?: (id: string) => void;
|
|
20
|
+
gap?: number;
|
|
21
|
+
maxVisible?: number;
|
|
22
|
+
maxExtra?: number;
|
|
23
|
+
showBorder?: boolean;
|
|
24
|
+
initialsLength?: 1 | 2;
|
|
25
|
+
fallback?: ReactNode;
|
|
26
|
+
classNames?: {
|
|
27
|
+
container?: string;
|
|
28
|
+
row?: string;
|
|
29
|
+
avatar?: ComponentClassnames<AvatarProps>;
|
|
30
|
+
extra?: ComponentClassnames<AvatarProps>;
|
|
31
|
+
};
|
|
32
|
+
styles?: {
|
|
33
|
+
container?: CSSProperties;
|
|
34
|
+
row?: CSSProperties;
|
|
35
|
+
avatar?: ComponentStyles<AvatarProps>;
|
|
36
|
+
extra?: ComponentStyles<AvatarProps>;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* AvatarRow displays multiple user avatars in a horizontal row.
|
|
42
|
+
*
|
|
43
|
+
* - Renders a list of `avatars` with Avatar components.
|
|
44
|
+
* - Supports `selectedAvatars` array to highlight selected avatars using their `id`.
|
|
45
|
+
* - Optional `onAvatarToggle` callback fired when an avatar is clicked.
|
|
46
|
+
* - Configurable `size`, `gap`, `maxVisible` (shows +N for overflow), and `showBorder`.
|
|
47
|
+
* - Accepts `classNames` and `styles` objects to customize:
|
|
48
|
+
* `container`, `row`, `avatar`, and `extra`.
|
|
49
|
+
* - Forwards remaining div props and ref to the root element.
|
|
50
|
+
* - By default each avatar has a zIndex based on its position from the left to create a stacking effect.
|
|
51
|
+
*/
|
|
52
|
+
export const AvatarRow = forwardRef<HTMLDivElement, AvatarRowProps>(
|
|
53
|
+
function AvatarRow(
|
|
54
|
+
{
|
|
55
|
+
avatars,
|
|
56
|
+
size = 'md',
|
|
57
|
+
selectedAvatars = [],
|
|
58
|
+
onAvatarToggle,
|
|
59
|
+
gap = 4,
|
|
60
|
+
maxVisible,
|
|
61
|
+
maxExtra = 99,
|
|
62
|
+
showBorder = true,
|
|
63
|
+
initialsLength,
|
|
64
|
+
fallback,
|
|
65
|
+
className,
|
|
66
|
+
classNames,
|
|
67
|
+
style,
|
|
68
|
+
styles,
|
|
69
|
+
...props
|
|
70
|
+
},
|
|
71
|
+
ref
|
|
72
|
+
) {
|
|
73
|
+
const visibleAvatars = maxVisible ? avatars?.slice(0, maxVisible) : avatars;
|
|
74
|
+
const extraCount =
|
|
75
|
+
maxVisible && avatars && avatars.length > maxVisible
|
|
76
|
+
? Math.min(avatars.length - maxVisible, maxExtra)
|
|
77
|
+
: 0;
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<div
|
|
81
|
+
className={cn('cleen', className)}
|
|
82
|
+
style={style}
|
|
83
|
+
ref={ref}
|
|
84
|
+
{...props}
|
|
85
|
+
>
|
|
86
|
+
<div
|
|
87
|
+
className={cn('cleen-flex cleen-items-center', classNames?.row)}
|
|
88
|
+
style={{ gap, ...styles?.row }}
|
|
89
|
+
>
|
|
90
|
+
{visibleAvatars?.map((avatar, index) => {
|
|
91
|
+
const isSelected = selectedAvatars.includes(avatar?.id ?? '');
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<Avatar
|
|
95
|
+
key={avatar.id || index}
|
|
96
|
+
name={avatar.name}
|
|
97
|
+
src={avatar.src}
|
|
98
|
+
size={size}
|
|
99
|
+
isSelected={isSelected}
|
|
100
|
+
showBorder={showBorder}
|
|
101
|
+
initialsLength={initialsLength}
|
|
102
|
+
fallback={fallback}
|
|
103
|
+
onClick={() => onAvatarToggle?.(avatar.id ?? '')}
|
|
104
|
+
{...classNames?.avatar}
|
|
105
|
+
style={{
|
|
106
|
+
zIndex: visibleAvatars.length - index,
|
|
107
|
+
...styles?.avatar?.style,
|
|
108
|
+
}}
|
|
109
|
+
styles={styles?.avatar?.styles}
|
|
110
|
+
{...avatar}
|
|
111
|
+
/>
|
|
112
|
+
);
|
|
113
|
+
})}
|
|
114
|
+
|
|
115
|
+
{extraCount > 0 && (
|
|
116
|
+
<Avatar
|
|
117
|
+
size={size}
|
|
118
|
+
fallback={`+${extraCount}`}
|
|
119
|
+
{...classNames?.extra}
|
|
120
|
+
{...styles?.extra}
|
|
121
|
+
/>
|
|
122
|
+
)}
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AvatarRow, type AvatarRowProps } from './AvatarRow';
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { IconChevronRight, IconHouseLine } from '@/components/cleenIcon';
|
|
2
|
+
import { cn } from '@cleen/ui-core';
|
|
3
|
+
import {
|
|
4
|
+
forwardRef,
|
|
5
|
+
type ComponentProps,
|
|
6
|
+
type CSSProperties,
|
|
7
|
+
type ReactNode,
|
|
8
|
+
} from 'react';
|
|
9
|
+
import { Link } from 'react-router-dom';
|
|
10
|
+
|
|
11
|
+
export interface BreadcrumbSegment {
|
|
12
|
+
path: string;
|
|
13
|
+
icon?: ReactNode;
|
|
14
|
+
label?: ReactNode;
|
|
15
|
+
id?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type BreadcrumbProps = ComponentProps<'div'> & {
|
|
19
|
+
root?: BreadcrumbSegment | null;
|
|
20
|
+
segments?: BreadcrumbSegment[];
|
|
21
|
+
classNames?: {
|
|
22
|
+
container?: string;
|
|
23
|
+
list?: string;
|
|
24
|
+
item?: string;
|
|
25
|
+
link?: string;
|
|
26
|
+
chevron?: string;
|
|
27
|
+
rootItem?: string;
|
|
28
|
+
rootLink?: string;
|
|
29
|
+
};
|
|
30
|
+
styles?: {
|
|
31
|
+
container?: CSSProperties;
|
|
32
|
+
list?: CSSProperties;
|
|
33
|
+
item?: CSSProperties;
|
|
34
|
+
link?: CSSProperties;
|
|
35
|
+
chevron?: CSSProperties;
|
|
36
|
+
rootItem?: CSSProperties;
|
|
37
|
+
rootLink?: CSSProperties;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The `Breadcrumb` component displays the navigation path to the current page, helping users understand their location within the application's hierarchy. It supports custom segments, icons, and styling for flexible integration.
|
|
43
|
+
*/
|
|
44
|
+
export const Breadcrumb = forwardRef<HTMLDivElement, BreadcrumbProps>(
|
|
45
|
+
function Breadcrumb(
|
|
46
|
+
{
|
|
47
|
+
root = {
|
|
48
|
+
path: '/',
|
|
49
|
+
icon: (
|
|
50
|
+
<IconHouseLine aria-hidden="true" className="cleen-h-5 cleen-w-5" />
|
|
51
|
+
),
|
|
52
|
+
},
|
|
53
|
+
segments,
|
|
54
|
+
className,
|
|
55
|
+
classNames,
|
|
56
|
+
style,
|
|
57
|
+
styles,
|
|
58
|
+
...props
|
|
59
|
+
},
|
|
60
|
+
ref
|
|
61
|
+
) {
|
|
62
|
+
// If no segments are being passed, render nothing
|
|
63
|
+
if (!segments || segments.length === 0) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<div
|
|
69
|
+
className={cn('cleen', className)}
|
|
70
|
+
style={style}
|
|
71
|
+
ref={ref}
|
|
72
|
+
{...props}
|
|
73
|
+
>
|
|
74
|
+
<nav
|
|
75
|
+
className={cn('cleen-hidden sm:cleen-flex', classNames?.container)}
|
|
76
|
+
style={styles?.container}
|
|
77
|
+
aria-label="Breadcrumb"
|
|
78
|
+
>
|
|
79
|
+
<ol
|
|
80
|
+
role="list"
|
|
81
|
+
className={cn(
|
|
82
|
+
'cleen-flex cleen-items-center cleen-gap-4',
|
|
83
|
+
classNames?.list
|
|
84
|
+
)}
|
|
85
|
+
style={styles?.list}
|
|
86
|
+
>
|
|
87
|
+
{root && (
|
|
88
|
+
<li
|
|
89
|
+
className={cn(
|
|
90
|
+
'cleen-flex cleen-items-center',
|
|
91
|
+
classNames?.rootItem
|
|
92
|
+
)}
|
|
93
|
+
style={styles?.rootItem}
|
|
94
|
+
>
|
|
95
|
+
<Link
|
|
96
|
+
to={root?.path}
|
|
97
|
+
className={cn(
|
|
98
|
+
'cleen-text-sm cleen-text-gray/60 cleen-flex cleen-items-center cleen-gap-2 cleen-transition-colors cleen-duration-200 hover:cleen-text-gray/80',
|
|
99
|
+
classNames?.rootLink
|
|
100
|
+
)}
|
|
101
|
+
style={styles?.rootLink}
|
|
102
|
+
aria-current="page"
|
|
103
|
+
>
|
|
104
|
+
{root?.icon}
|
|
105
|
+
{root?.label}
|
|
106
|
+
</Link>
|
|
107
|
+
</li>
|
|
108
|
+
)}
|
|
109
|
+
|
|
110
|
+
{segments.map(({ path, icon, label, id }, index) => {
|
|
111
|
+
const isLast = index === segments.length - 1;
|
|
112
|
+
const displayName =
|
|
113
|
+
label || path.charAt(0).toUpperCase() + path.slice(1);
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<li
|
|
117
|
+
key={id || path}
|
|
118
|
+
className={cn(
|
|
119
|
+
'cleen-flex cleen-items-center cleen-gap-4',
|
|
120
|
+
classNames?.item
|
|
121
|
+
)}
|
|
122
|
+
style={styles?.item}
|
|
123
|
+
>
|
|
124
|
+
{(root || (!root && index !== 0)) && (
|
|
125
|
+
<IconChevronRight
|
|
126
|
+
className={cn(
|
|
127
|
+
'cleen-h-5 cleen-w-5 cleen-text-gray/50',
|
|
128
|
+
classNames?.chevron
|
|
129
|
+
)}
|
|
130
|
+
style={styles?.chevron}
|
|
131
|
+
aria-hidden="true"
|
|
132
|
+
/>
|
|
133
|
+
)}
|
|
134
|
+
|
|
135
|
+
<Link
|
|
136
|
+
to={path}
|
|
137
|
+
className={cn(
|
|
138
|
+
'cleen-transition-colors cleen-duration-200 hover:cleen-text-primary cleen-text-sm cleen-flex cleen-items-center cleen-gap-2',
|
|
139
|
+
isLast
|
|
140
|
+
? 'cleen-rounded-md cleen-bg-gray/5 cleen-py-1 cleen-px-2 cleen-text-gray/80 cleen-font-semibold'
|
|
141
|
+
: 'cleen-text-gray/80 cleen-font-medium',
|
|
142
|
+
classNames?.link
|
|
143
|
+
)}
|
|
144
|
+
style={styles?.link}
|
|
145
|
+
aria-current={isLast ? 'page' : undefined}
|
|
146
|
+
>
|
|
147
|
+
{icon}
|
|
148
|
+
{displayName}
|
|
149
|
+
</Link>
|
|
150
|
+
</li>
|
|
151
|
+
);
|
|
152
|
+
})}
|
|
153
|
+
</ol>
|
|
154
|
+
</nav>
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Breadcrumb, type BreadcrumbProps } from './Breadcrumb';
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Loader } from '@/components/loader';
|
|
2
|
+
import { cn, useWidthDynamicResize } from '@cleen/ui-core';
|
|
3
|
+
import {
|
|
4
|
+
forwardRef,
|
|
5
|
+
useImperativeHandle,
|
|
6
|
+
useRef,
|
|
7
|
+
type ComponentProps,
|
|
8
|
+
type CSSProperties,
|
|
9
|
+
type ReactNode,
|
|
10
|
+
} from 'react';
|
|
11
|
+
import { loaderColorVariants, variants, type ButtonVariant } from './variants';
|
|
12
|
+
|
|
13
|
+
export type ButtonProps = ComponentProps<'button'> & {
|
|
14
|
+
variant?: ButtonVariant;
|
|
15
|
+
label?: ReactNode;
|
|
16
|
+
fullWidth?: boolean;
|
|
17
|
+
isLoading?: boolean;
|
|
18
|
+
leftIcon?: ReactNode;
|
|
19
|
+
rightIcon?: ReactNode;
|
|
20
|
+
loaderColor?: string;
|
|
21
|
+
dataModalTarget?: string;
|
|
22
|
+
'data-testid'?: string;
|
|
23
|
+
classNames?: {
|
|
24
|
+
container?: string;
|
|
25
|
+
loaderContainer?: string;
|
|
26
|
+
loader?: string;
|
|
27
|
+
};
|
|
28
|
+
styles?: {
|
|
29
|
+
container?: CSSProperties;
|
|
30
|
+
loaderContainer?: CSSProperties;
|
|
31
|
+
loader?: CSSProperties;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The `Button` component is used to trigger an action or event, such as submitting a form, opening a dialog, or performing a specific task. It is a fundamental UI element that users interact with to initiate various operations within an application.
|
|
37
|
+
*/
|
|
38
|
+
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
39
|
+
function Button(
|
|
40
|
+
{
|
|
41
|
+
type = 'button',
|
|
42
|
+
label,
|
|
43
|
+
onClick,
|
|
44
|
+
className,
|
|
45
|
+
classNames,
|
|
46
|
+
style,
|
|
47
|
+
styles,
|
|
48
|
+
disabled = false,
|
|
49
|
+
leftIcon,
|
|
50
|
+
rightIcon,
|
|
51
|
+
loaderColor,
|
|
52
|
+
isLoading = false,
|
|
53
|
+
variant = 'primary',
|
|
54
|
+
fullWidth = false,
|
|
55
|
+
dataModalTarget,
|
|
56
|
+
'data-testid': testId,
|
|
57
|
+
children,
|
|
58
|
+
...props
|
|
59
|
+
},
|
|
60
|
+
ref
|
|
61
|
+
) {
|
|
62
|
+
const internalRef = useRef<HTMLButtonElement>(null);
|
|
63
|
+
|
|
64
|
+
useImperativeHandle(ref, () => internalRef.current!);
|
|
65
|
+
useWidthDynamicResize({ ref: internalRef, skip: fullWidth }, [
|
|
66
|
+
isLoading,
|
|
67
|
+
leftIcon,
|
|
68
|
+
rightIcon,
|
|
69
|
+
fullWidth,
|
|
70
|
+
]);
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<div className={cn('cleen', className)} style={style}>
|
|
74
|
+
<button
|
|
75
|
+
type={type}
|
|
76
|
+
ref={internalRef}
|
|
77
|
+
className={cn(
|
|
78
|
+
'cleen-flex cleen-justify-center cleen-items-center cleen-gap-1 cleen-text-sm cleen-text-nowrap cleen-transition-[width] cleen-duration-150 cleen-ease-in-out cleen-cursor-pointer',
|
|
79
|
+
variants[variant],
|
|
80
|
+
{
|
|
81
|
+
'cleen-w-full cleen-flex-1': fullWidth,
|
|
82
|
+
'cleen-opacity-50 cleen-cursor-not-allowed cleen-pointer-events-none':
|
|
83
|
+
disabled || isLoading,
|
|
84
|
+
},
|
|
85
|
+
classNames?.container
|
|
86
|
+
)}
|
|
87
|
+
style={styles?.container}
|
|
88
|
+
disabled={isLoading || disabled}
|
|
89
|
+
onClick={onClick}
|
|
90
|
+
data-testid={testId}
|
|
91
|
+
data-modal-target={dataModalTarget}
|
|
92
|
+
{...props}
|
|
93
|
+
>
|
|
94
|
+
{isLoading && (
|
|
95
|
+
<Loader
|
|
96
|
+
size="xs"
|
|
97
|
+
color={loaderColor || loaderColorVariants[variant]}
|
|
98
|
+
className={cn(
|
|
99
|
+
'cleen-mr-1.5 cleen-w-fit',
|
|
100
|
+
classNames?.loaderContainer
|
|
101
|
+
)}
|
|
102
|
+
style={styles?.loaderContainer}
|
|
103
|
+
classNames={{ loader: classNames?.loader }}
|
|
104
|
+
styles={{ loader: styles?.loader }}
|
|
105
|
+
/>
|
|
106
|
+
)}
|
|
107
|
+
{leftIcon || null}
|
|
108
|
+
{label || children}
|
|
109
|
+
{rightIcon || null}
|
|
110
|
+
</button>
|
|
111
|
+
</div>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type ButtonVariant =
|
|
2
|
+
| 'borderless'
|
|
3
|
+
| 'borderless-blue'
|
|
4
|
+
| 'borderless-success'
|
|
5
|
+
| 'group'
|
|
6
|
+
| 'secondary'
|
|
7
|
+
| 'secondary-blue'
|
|
8
|
+
| 'primary'
|
|
9
|
+
| 'disable'
|
|
10
|
+
| 'error'
|
|
11
|
+
| 'warning';
|
|
12
|
+
|
|
13
|
+
export const variants: Record<ButtonVariant, string> = {
|
|
14
|
+
borderless:
|
|
15
|
+
'cleen-flex cleen-py-2 cleen-px-5 cleen-gap-1 cleen-rounded-lg cleen-font-semibold cleen-items-center cleen-text-gray/90 cleen-transition-colors cleen-duration-200 hover:cleen-bg-gray/10',
|
|
16
|
+
'borderless-blue':
|
|
17
|
+
'cleen-flex cleen-py-2 cleen-px-5 cleen-gap-1 cleen-rounded-lg cleen-font-semibold cleen-items-center cleen-text-primary/70 cleen-transition-colors cleen-duration-200 hover:cleen-bg-primary/10',
|
|
18
|
+
'borderless-success':
|
|
19
|
+
'cleen-flex cleen-py-2 cleen-px-5 cleen-gap-1 cleen-rounded-lg cleen-font-semibold cleen-items-center cleen-text-success cleen-transition-colors cleen-duration-200 hover:cleen-bg-success/10',
|
|
20
|
+
group:
|
|
21
|
+
'cleen-flex cleen-border cleen-border-gray/30 cleen-py-2 cleen-px-4 cleen-gap-1 cleen-font-semibold cleen-items-center cleen-text-black cleen-transition-colors cleen-duration-200 focus:cleen-bg-gray/5 focus-visible:cleen-outline-none hover:cleen-bg-gray/10',
|
|
22
|
+
secondary:
|
|
23
|
+
'cleen-flex cleen-border cleen-border-gray/20 cleen-text-gray/90 cleen-bg-white cleen-py-2 cleen-px-4 cleen-gap-1 cleen-rounded-lg cleen-font-semibold cleen-items-center cleen-transition-colors cleen-duration-200 hover:cleen-bg-gray/5 focus-visible:cleen-outline-none',
|
|
24
|
+
'secondary-blue':
|
|
25
|
+
'cleen-flex cleen-border cleen-border-primary/60 cleen-text-primary cleen-bg-white cleen-py-2 cleen-px-4 cleen-gap-1 cleen-rounded-lg cleen-font-semibold cleen-items-center cleen-transition-colors cleen-duration-200 focus-visible:cleen-outline-none hover:cleen-bg-primary/10',
|
|
26
|
+
primary:
|
|
27
|
+
'cleen-flex cleen-justify-center cleen-rounded-md cleen-py-2 cleen-px-4 cleen-font-semibold cleen-leading-6 cleen-text-white cleen-shadow-sm cleen-bg-primary/80 cleen-transition-colors cleen-duration-200 hover:cleen-bg-primary focus-visible:cleen-outline focus-visible:cleen-outline-2 focus-visible:cleen-outline-offset-2 focus-visible:cleen-outline-indigo/60',
|
|
28
|
+
disable:
|
|
29
|
+
'cleen-flex cleen-justify-center cleen-rounded-md cleen-bg-gray/10 cleen-py-2 cleen-px-4 cleen-font-semibold cleen-leading-6 cleen-border cleen-border-gray/30 cleen-text-gray/40 cleen-shadow-sm cleen-cursor-default',
|
|
30
|
+
error:
|
|
31
|
+
'cleen-flex cleen-justify-center cleen-rounded-md cleen-py-2 cleen-px-4 cleen-font-semibold cleen-leading-6 cleen-text-white cleen-shadow-sm cleen-bg-error/80 cleen-transition-colors cleen-duration-200 hover:cleen-bg-error focus-visible:cleen-outline focus-visible:cleen-outline-2 focus-visible:cleen-outline-offset-2 focus-visible:cleen-outline-indigo/60',
|
|
32
|
+
warning:
|
|
33
|
+
'cleen-flex cleen-justify-center cleen-rounded-md cleen-py-2 cleen-px-4 cleen-font-semibold cleen-leading-6 cleen-text-white cleen-shadow-sm cleen-bg-warning/80 cleen-transition-colors cleen-duration-200 hover:cleen-bg-warning focus-visible:cleen-outline focus-visible:cleen-outline-2 focus-visible:cleen-outline-offset-2 focus-visible:cleen-outline-indigo/60',
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const loaderColorVariants: Partial<Record<ButtonVariant, string>> = {
|
|
37
|
+
primary: 'rgb(var(--cleen-white))',
|
|
38
|
+
'borderless-success': 'rgb(var(--cleen-success))',
|
|
39
|
+
error: 'rgb(var(--cleen-white))',
|
|
40
|
+
warning: 'rgb(var(--cleen-white))',
|
|
41
|
+
};
|