@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,226 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export type IconProps = SVGProps<SVGSVGElement> & {
|
|
4
|
+
color1?: string;
|
|
5
|
+
color2?: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export enum IconName {
|
|
9
|
+
AlertCircle = 'AlertCircle',
|
|
10
|
+
AlertFeatured = 'AlertFeatured',
|
|
11
|
+
AlertOctagon = 'AlertOctagon',
|
|
12
|
+
AlertTriangle = 'AlertTriangle',
|
|
13
|
+
AlignRight = 'AlignRight',
|
|
14
|
+
ArrowDown = 'ArrowDown',
|
|
15
|
+
ArrowLeft = 'ArrowLeft',
|
|
16
|
+
ArrowLeft2 = 'ArrowLeft2',
|
|
17
|
+
ArrowRight = 'ArrowRight',
|
|
18
|
+
ArrowToTop = 'ArrowToTop',
|
|
19
|
+
ArrowUp = 'ArrowUp',
|
|
20
|
+
ArrowUpRight = 'ArrowUpRight',
|
|
21
|
+
ArrowUpRightNarrow = 'ArrowUpRightNarrow',
|
|
22
|
+
ArrowUpRightSquare = 'ArrowUpRightSquare',
|
|
23
|
+
Attachment = 'Attachment',
|
|
24
|
+
BarChartSquare = 'BarChartSquare',
|
|
25
|
+
Bold = 'Bold',
|
|
26
|
+
BookmarkCheck = 'BookmarkCheck',
|
|
27
|
+
BookmarkCheckFill = 'BookmarkCheckFill',
|
|
28
|
+
BookmarkPlus = 'BookmarkPlus',
|
|
29
|
+
BookmarkX = 'BookmarkX',
|
|
30
|
+
BoxLines = 'BoxLines',
|
|
31
|
+
BoxText = 'BoxText',
|
|
32
|
+
BracketsCheck = 'BracketsCheck',
|
|
33
|
+
BracketsEllipses = 'BracketsEllipses',
|
|
34
|
+
Building = 'Building',
|
|
35
|
+
Calendar = 'Calendar',
|
|
36
|
+
CertificateHeart = 'CertificateHeart',
|
|
37
|
+
Check = 'Check',
|
|
38
|
+
CheckCircle = 'CheckCircle',
|
|
39
|
+
CheckCircleBroken = 'CheckCircleBroken',
|
|
40
|
+
CheckFill = 'CheckFill',
|
|
41
|
+
CheckVerified = 'CheckVerified',
|
|
42
|
+
ChevronDown = 'ChevronDown',
|
|
43
|
+
ChevronLeft = 'ChevronLeft',
|
|
44
|
+
ChevronLeftDouble = 'ChevronLeftDouble',
|
|
45
|
+
ChevronRight = 'ChevronRight',
|
|
46
|
+
ChevronRightDouble = 'ChevronRightDouble',
|
|
47
|
+
ChevronSelectorVertical = 'ChevronSelectorVertical',
|
|
48
|
+
ChevronUp = 'ChevronUp',
|
|
49
|
+
CircleSwap = 'CircleSwap',
|
|
50
|
+
ClockFastForward = 'ClockFastForward',
|
|
51
|
+
ClockRewind = 'ClockRewind',
|
|
52
|
+
ClockRewind2 = 'ClockRewind2',
|
|
53
|
+
CodeBrowser = 'CodeBrowser',
|
|
54
|
+
CodeCircle = 'CodeCircle',
|
|
55
|
+
Colors = 'Colors',
|
|
56
|
+
ColumnEdit = 'ColumnEdit',
|
|
57
|
+
Copy = 'Copy',
|
|
58
|
+
Copy2 = 'Copy2',
|
|
59
|
+
Copy3 = 'Copy3',
|
|
60
|
+
Copy4 = 'Copy4',
|
|
61
|
+
Copy5 = 'Copy5',
|
|
62
|
+
CopyCheck = 'CopyCheck',
|
|
63
|
+
Cube = 'Cube',
|
|
64
|
+
CubeOutline = 'CubeOutline',
|
|
65
|
+
CursorBox = 'CursorBox',
|
|
66
|
+
Dataflow = 'Dataflow',
|
|
67
|
+
Dataflow2 = 'Dataflow2',
|
|
68
|
+
Dataflow3 = 'Dataflow3',
|
|
69
|
+
Delete = 'Delete',
|
|
70
|
+
DollarCircle = 'DollarCircle',
|
|
71
|
+
DotsGrid = 'DotsGrid',
|
|
72
|
+
DotsHorizontal = 'DotsHorizontal',
|
|
73
|
+
DotsVertical = 'DotsVertical',
|
|
74
|
+
Edit = 'Edit',
|
|
75
|
+
Editable = 'Editable',
|
|
76
|
+
Expand = 'Expand',
|
|
77
|
+
Eye = 'Eye',
|
|
78
|
+
EyeHidden = 'EyeHidden',
|
|
79
|
+
EyeHidden2 = 'EyeHidden2',
|
|
80
|
+
FaceSmile = 'FaceSmile',
|
|
81
|
+
Filter = 'Filter',
|
|
82
|
+
Filter2 = 'Filter2',
|
|
83
|
+
Flag = 'Flag',
|
|
84
|
+
Flag2 = 'Flag2',
|
|
85
|
+
Flag3 = 'Flag3',
|
|
86
|
+
HandShield = 'HandShield',
|
|
87
|
+
Hash = 'Hash',
|
|
88
|
+
HeadsetMic = 'HeadsetMic',
|
|
89
|
+
Heart = 'Heart',
|
|
90
|
+
HouseLine = 'HouseLine',
|
|
91
|
+
Image = 'Image',
|
|
92
|
+
Image2 = 'Image2',
|
|
93
|
+
Image3 = 'Image3',
|
|
94
|
+
Image4 = 'Image4',
|
|
95
|
+
ImageCheck = 'ImageCheck',
|
|
96
|
+
InfoCircle = 'InfoCircle',
|
|
97
|
+
InfoHexagon = 'InfoHexagon',
|
|
98
|
+
Italic = 'Italic',
|
|
99
|
+
LayersMultiple = 'LayersMultiple',
|
|
100
|
+
LayersSingle = 'LayersSingle',
|
|
101
|
+
Layout = 'Layout',
|
|
102
|
+
Layout2 = 'Layout2',
|
|
103
|
+
LayoutColumns = 'LayoutColumns',
|
|
104
|
+
LayoutCustom = 'LayoutCustom',
|
|
105
|
+
LayoutSequential = 'LayoutSequential',
|
|
106
|
+
LayoutStuffed = 'LayoutStuffed',
|
|
107
|
+
LayoutTile = 'LayoutTile',
|
|
108
|
+
LifeBuoy = 'LifeBuoy',
|
|
109
|
+
Lightbulb = 'Lightbulb',
|
|
110
|
+
Lightning = 'Lightning',
|
|
111
|
+
Lightning2 = 'Lightning2',
|
|
112
|
+
LightningFast = 'LightningFast',
|
|
113
|
+
LineChartBar = 'LineChartBar',
|
|
114
|
+
LineChartBreakoutSquare = 'LineChartBreakoutSquare',
|
|
115
|
+
LineChartUp = 'LineChartUp',
|
|
116
|
+
LineChartUp2 = 'LineChartUp2',
|
|
117
|
+
Lines = 'Lines',
|
|
118
|
+
LinesCheck = 'LinesCheck',
|
|
119
|
+
LinesPlay = 'LinesPlay',
|
|
120
|
+
Link = 'Link',
|
|
121
|
+
Link2 = 'Link2',
|
|
122
|
+
Link3 = 'Link3',
|
|
123
|
+
Link4 = 'Link4',
|
|
124
|
+
Link5 = 'Link5',
|
|
125
|
+
ListBullet = 'ListBullet',
|
|
126
|
+
ListOrder = 'ListOrder',
|
|
127
|
+
ListOrder2 = 'ListOrder2',
|
|
128
|
+
Lock = 'Lock',
|
|
129
|
+
Lock2 = 'Lock2',
|
|
130
|
+
LogIn = 'LogIn',
|
|
131
|
+
LogOut = 'LogOut',
|
|
132
|
+
LogOut2 = 'LogOut2',
|
|
133
|
+
MagicWand = 'MagicWand',
|
|
134
|
+
MagicWand2 = 'MagicWand2',
|
|
135
|
+
Mail = 'Mail',
|
|
136
|
+
MessageSquare = 'MessageSquare',
|
|
137
|
+
MessageSquare2 = 'MessageSquare2',
|
|
138
|
+
MessageXSquare = 'MessageXSquare',
|
|
139
|
+
MinusCircle = 'MinusCircle',
|
|
140
|
+
Mobile = 'Mobile',
|
|
141
|
+
Monitor = 'Monitor',
|
|
142
|
+
Monitor2 = 'Monitor2',
|
|
143
|
+
Monitor3 = 'Monitor3',
|
|
144
|
+
MoonCircle = 'MoonCircle',
|
|
145
|
+
NavigationPointer = 'NavigationPointer',
|
|
146
|
+
NotificationBox = 'NotificationBox',
|
|
147
|
+
Palette = 'Palette',
|
|
148
|
+
PasscodeLock = 'PasscodeLock',
|
|
149
|
+
PCSetup = 'PCSetup',
|
|
150
|
+
Pencil = 'Pencil',
|
|
151
|
+
PercentageCircle = 'PercentageCircle',
|
|
152
|
+
Perspective = 'Perspective',
|
|
153
|
+
PhoneCall = 'PhoneCall',
|
|
154
|
+
Pin = 'Pin',
|
|
155
|
+
PlayCircle = 'PlayCircle',
|
|
156
|
+
Plus = 'Plus',
|
|
157
|
+
PlusCircle = 'PlusCircle',
|
|
158
|
+
Pulse = 'Pulse',
|
|
159
|
+
QuestionCircle = 'QuestionCircle',
|
|
160
|
+
RadioButton = 'RadioButton',
|
|
161
|
+
RadioButtonActive = 'RadioButtonActive',
|
|
162
|
+
ReceiptCheck = 'ReceiptCheck',
|
|
163
|
+
Redo = 'Redo',
|
|
164
|
+
Refresh = 'Refresh',
|
|
165
|
+
Refresh2 = 'Refresh2',
|
|
166
|
+
Refresh3 = 'Refresh3',
|
|
167
|
+
Repeat = 'Repeat',
|
|
168
|
+
Repeat2 = 'Repeat2',
|
|
169
|
+
Retweet = 'Retweet',
|
|
170
|
+
RoundChart = 'RoundChart',
|
|
171
|
+
RoundChart2 = 'RoundChart2',
|
|
172
|
+
Route = 'Route',
|
|
173
|
+
Save = 'Save',
|
|
174
|
+
Save2 = 'Save2',
|
|
175
|
+
ScanDots = 'ScanDots',
|
|
176
|
+
Search = 'Search',
|
|
177
|
+
Send = 'Send',
|
|
178
|
+
Settings = 'Settings',
|
|
179
|
+
Settings2 = 'Settings2',
|
|
180
|
+
Settings3 = 'Settings3',
|
|
181
|
+
ShieldLightning = 'ShieldLightning',
|
|
182
|
+
ShieldPlus = 'ShieldPlus',
|
|
183
|
+
ShieldRemove = 'ShieldRemove',
|
|
184
|
+
Shuffle = 'Shuffle',
|
|
185
|
+
SlashCircle = 'SlashCircle',
|
|
186
|
+
SlashOctagon = 'SlashOctagon',
|
|
187
|
+
SocialGlobe = 'SocialGlobe',
|
|
188
|
+
SocialLinkedin = 'SocialLinkedin',
|
|
189
|
+
SocialX = 'SocialX',
|
|
190
|
+
Speedometer = 'Speedometer',
|
|
191
|
+
StairsRound = 'StairsRound',
|
|
192
|
+
Star = 'Star',
|
|
193
|
+
StarHalf = 'StarHalf',
|
|
194
|
+
Stars = 'Stars',
|
|
195
|
+
Stars2 = 'Stars2',
|
|
196
|
+
Strikethrough = 'Strikethrough',
|
|
197
|
+
SuccessFeatured = 'SuccessFeatured',
|
|
198
|
+
Sun = 'Sun',
|
|
199
|
+
SwitchHorizontal = 'SwitchHorizontal',
|
|
200
|
+
Tag = 'Tag',
|
|
201
|
+
Target = 'Target',
|
|
202
|
+
Target2 = 'Target2',
|
|
203
|
+
TextFormat = 'TextFormat',
|
|
204
|
+
TextFormat2 = 'TextFormat2',
|
|
205
|
+
TextHighlight = 'TextHighlight',
|
|
206
|
+
Translate = 'Translate',
|
|
207
|
+
Trash = 'Trash',
|
|
208
|
+
Trending = 'Trending',
|
|
209
|
+
Underline = 'Underline',
|
|
210
|
+
Undo = 'Undo',
|
|
211
|
+
Undo2 = 'Undo2',
|
|
212
|
+
UploadCloud = 'UploadCloud',
|
|
213
|
+
User = 'User',
|
|
214
|
+
UserEdit = 'UserEdit',
|
|
215
|
+
UserRight = 'UserRight',
|
|
216
|
+
UserSquare = 'UserSquare',
|
|
217
|
+
Users = 'Users',
|
|
218
|
+
UsersUp = 'UsersUp',
|
|
219
|
+
Volume = 'Volume',
|
|
220
|
+
Wrench = 'Wrench',
|
|
221
|
+
X = 'X',
|
|
222
|
+
XCircle = 'XCircle',
|
|
223
|
+
XCircle2 = 'XCircle2',
|
|
224
|
+
XClose = 'XClose',
|
|
225
|
+
XSquare = 'XSquare',
|
|
226
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { IconChevronDown, IconChevronUp } from '@/components/cleenIcon';
|
|
2
|
+
import { cn } from '@cleen/ui-core';
|
|
3
|
+
import type {
|
|
4
|
+
CSSProperties,
|
|
5
|
+
ComponentProps,
|
|
6
|
+
ForwardedRef,
|
|
7
|
+
ReactNode,
|
|
8
|
+
} from 'react';
|
|
9
|
+
import { forwardRef, useState } from 'react';
|
|
10
|
+
|
|
11
|
+
export interface CollapsibleItem {
|
|
12
|
+
content: ReactNode;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
key?: string | number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface CollapsibleSection {
|
|
18
|
+
title: ReactNode;
|
|
19
|
+
items?: CollapsibleItem[];
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
key?: string | number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface CollapsibleProps extends ComponentProps<'div'> {
|
|
25
|
+
sections: CollapsibleSection[];
|
|
26
|
+
defaultOpenIndex?: number | null;
|
|
27
|
+
classNames?: {
|
|
28
|
+
container?: string;
|
|
29
|
+
section?: string;
|
|
30
|
+
sectionHeader?: string;
|
|
31
|
+
sectionBody?: string;
|
|
32
|
+
item?: string;
|
|
33
|
+
};
|
|
34
|
+
styles?: {
|
|
35
|
+
container?: CSSProperties;
|
|
36
|
+
section?: CSSProperties;
|
|
37
|
+
sectionHeader?: CSSProperties;
|
|
38
|
+
sectionBody?: CSSProperties;
|
|
39
|
+
item?: CSSProperties;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The `Collapsible` component renders an accordion-style list of sections, each of which can be
|
|
45
|
+
* expanded or collapsed to reveal its items.
|
|
46
|
+
*
|
|
47
|
+
* - Pass an array of `sections`, each with a `title` and optional `items` array.
|
|
48
|
+
* - Each `CollapsibleItem` accepts a `content` node and an optional `onClick` callback.
|
|
49
|
+
* - Use `defaultOpenIndex` to pre-open a specific section on mount; pass `null` (default) to start
|
|
50
|
+
* fully collapsed.
|
|
51
|
+
* - Only one section can be open at a time; clicking an open section closes it.
|
|
52
|
+
* - Sections without `items` act as plain clickable rows and do not show a chevron.
|
|
53
|
+
* - Accepts `classNames` and `styles` to customize: `container`, `section`, `sectionHeader`,
|
|
54
|
+
* `sectionBody`, `item`.
|
|
55
|
+
*/
|
|
56
|
+
export const Collapsible = forwardRef<HTMLDivElement, CollapsibleProps>(
|
|
57
|
+
(
|
|
58
|
+
{
|
|
59
|
+
sections,
|
|
60
|
+
defaultOpenIndex,
|
|
61
|
+
className,
|
|
62
|
+
classNames,
|
|
63
|
+
style,
|
|
64
|
+
styles,
|
|
65
|
+
...props
|
|
66
|
+
},
|
|
67
|
+
ref: ForwardedRef<HTMLDivElement>
|
|
68
|
+
) => {
|
|
69
|
+
const [openIndex, setOpenIndex] = useState<number | null>(
|
|
70
|
+
defaultOpenIndex ?? null
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
const handleSectionClick = (index: number, section: CollapsibleSection) => {
|
|
74
|
+
section.onClick?.();
|
|
75
|
+
|
|
76
|
+
if (section.items?.length) {
|
|
77
|
+
setOpenIndex(openIndex === index ? null : index);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<div
|
|
83
|
+
ref={ref}
|
|
84
|
+
className={cn('cleen', className)}
|
|
85
|
+
style={{ ...style, width: '100%' }}
|
|
86
|
+
{...props}
|
|
87
|
+
>
|
|
88
|
+
<div
|
|
89
|
+
className={cn('cleen-w-full', classNames?.container)}
|
|
90
|
+
style={styles?.container}
|
|
91
|
+
>
|
|
92
|
+
{sections.map((section, i) => (
|
|
93
|
+
<div
|
|
94
|
+
key={section?.key ?? i}
|
|
95
|
+
className={cn('cleen-mb-3', classNames?.section)}
|
|
96
|
+
style={styles?.section}
|
|
97
|
+
>
|
|
98
|
+
<div
|
|
99
|
+
onClick={() => handleSectionClick(i, section)}
|
|
100
|
+
className={cn(
|
|
101
|
+
'cleen-flex cleen-w-full cleen-items-center cleen-justify-between cleen-font-medium cleen-text-md cleen-text-gray/90 cleen-p-2 cleen-rounded-lg cleen-cursor-pointer hover:cleen-bg-gray/5',
|
|
102
|
+
classNames?.sectionHeader
|
|
103
|
+
)}
|
|
104
|
+
style={styles?.sectionHeader}
|
|
105
|
+
>
|
|
106
|
+
<div className="cleen-flex-1 cleen-overflow-hidden cleen-whitespace-nowrap cleen-text-ellipsis">
|
|
107
|
+
{section?.title}
|
|
108
|
+
</div>
|
|
109
|
+
{section?.items?.length ? (
|
|
110
|
+
openIndex === i ? (
|
|
111
|
+
<IconChevronUp className="cleen-shrink-0 cleen-text-gray/50" />
|
|
112
|
+
) : (
|
|
113
|
+
<IconChevronDown className="cleen-shrink-0 cleen-text-gray/50" />
|
|
114
|
+
)
|
|
115
|
+
) : null}
|
|
116
|
+
</div>
|
|
117
|
+
{openIndex === i && section?.items && (
|
|
118
|
+
<div
|
|
119
|
+
className={cn(
|
|
120
|
+
'cleen-mt-1 cleen-flex cleen-flex-col cleen-w-full',
|
|
121
|
+
classNames?.sectionBody
|
|
122
|
+
)}
|
|
123
|
+
style={styles?.sectionBody}
|
|
124
|
+
>
|
|
125
|
+
{section?.items?.map((item, idx) => (
|
|
126
|
+
<div
|
|
127
|
+
key={item?.key ?? idx}
|
|
128
|
+
className={cn(
|
|
129
|
+
'cleen-overflow-hidden cleen-whitespace-nowrap cleen-text-ellipsis cleen-p-2 cleen-w-full cleen-rounded-lg cleen-font-normal cleen-text-md cleen-text-gray/90 cleen-cursor-pointer hover:cleen-bg-gray/5',
|
|
130
|
+
classNames?.item
|
|
131
|
+
)}
|
|
132
|
+
style={styles?.item}
|
|
133
|
+
onClick={item?.onClick}
|
|
134
|
+
>
|
|
135
|
+
{item?.content}
|
|
136
|
+
</div>
|
|
137
|
+
))}
|
|
138
|
+
</div>
|
|
139
|
+
)}
|
|
140
|
+
</div>
|
|
141
|
+
))}
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
Collapsible.displayName = 'Collapsible';
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { InfoLabels } from '@/components/infoLabels';
|
|
2
|
+
import { Input } from '@/components/input';
|
|
3
|
+
import { Loader } from '@/components/loader';
|
|
4
|
+
import { cn } from '@cleen/ui-core';
|
|
5
|
+
import {
|
|
6
|
+
forwardRef,
|
|
7
|
+
useMemo,
|
|
8
|
+
useState,
|
|
9
|
+
type ChangeEvent,
|
|
10
|
+
type FocusEvent,
|
|
11
|
+
} from 'react';
|
|
12
|
+
import type { CardData } from './types/card';
|
|
13
|
+
import type { CreditCardInputProps } from './types/props';
|
|
14
|
+
import {
|
|
15
|
+
formatCardNumber,
|
|
16
|
+
formatCVC,
|
|
17
|
+
formatExpirationDate,
|
|
18
|
+
getIssuer,
|
|
19
|
+
} from './util/format';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The `CreditCardInput` component provides a user interface for securely collecting credit card information.
|
|
23
|
+
* It displays a visual representation of the card and includes input fields for the cardholder's card number, expiration date and CVC. The component handles formatting and validation for each field, displays error messages, and supports loading states for asynchronous operations.
|
|
24
|
+
*/
|
|
25
|
+
export const CreditCardInput = forwardRef<HTMLDivElement, CreditCardInputProps>(
|
|
26
|
+
function CreditCardInput(
|
|
27
|
+
{
|
|
28
|
+
labels,
|
|
29
|
+
value,
|
|
30
|
+
isLoading,
|
|
31
|
+
errors,
|
|
32
|
+
className,
|
|
33
|
+
classNames,
|
|
34
|
+
style,
|
|
35
|
+
styles,
|
|
36
|
+
infoLabels,
|
|
37
|
+
onChange,
|
|
38
|
+
onFieldFocus,
|
|
39
|
+
...props
|
|
40
|
+
},
|
|
41
|
+
ref
|
|
42
|
+
) {
|
|
43
|
+
const [internalCardData, setInternalCardData] = useState<CardData>({
|
|
44
|
+
number: '',
|
|
45
|
+
expiry: '',
|
|
46
|
+
cvc: '',
|
|
47
|
+
});
|
|
48
|
+
const isControlled = !!value;
|
|
49
|
+
const cardData = isControlled ? value : internalCardData;
|
|
50
|
+
|
|
51
|
+
const issuer = useMemo(() => getIssuer(cardData.number), [cardData.number]);
|
|
52
|
+
|
|
53
|
+
const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {
|
|
54
|
+
const { name } = e.target;
|
|
55
|
+
let { value: newValue } = e.target;
|
|
56
|
+
|
|
57
|
+
switch (name) {
|
|
58
|
+
case 'number':
|
|
59
|
+
newValue = formatCardNumber(newValue, issuer);
|
|
60
|
+
break;
|
|
61
|
+
|
|
62
|
+
case 'expiry':
|
|
63
|
+
newValue = formatExpirationDate(newValue);
|
|
64
|
+
break;
|
|
65
|
+
|
|
66
|
+
case 'cvc':
|
|
67
|
+
newValue = formatCVC(newValue);
|
|
68
|
+
break;
|
|
69
|
+
|
|
70
|
+
default:
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (!isControlled) {
|
|
75
|
+
setInternalCardData(prev => ({ ...prev, [name]: newValue }));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
onChange?.({
|
|
79
|
+
...value,
|
|
80
|
+
[name]: newValue,
|
|
81
|
+
} as CardData);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const handleInputFocus = (e: FocusEvent<HTMLInputElement>) => {
|
|
85
|
+
onFieldFocus?.(e.target.name as keyof CardData);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<div
|
|
90
|
+
className={cn('cleen', className)}
|
|
91
|
+
style={style}
|
|
92
|
+
ref={ref}
|
|
93
|
+
{...props}
|
|
94
|
+
>
|
|
95
|
+
<div
|
|
96
|
+
className={cn(
|
|
97
|
+
'cleen-flex cleen-flex-wrap cleen-justify-center cleen-items-start cleen-gap-8 cleen-bg-background cleen-min-w-80 cleen-w-min cleen-border cleen-border-primary/20 cleen-rounded-[10px] cleen-shadow-lg',
|
|
98
|
+
classNames?.container
|
|
99
|
+
)}
|
|
100
|
+
style={styles?.container}
|
|
101
|
+
>
|
|
102
|
+
{isLoading ? (
|
|
103
|
+
<div
|
|
104
|
+
className={cn('cleen-py-4', classNames?.loader?.container)}
|
|
105
|
+
style={styles?.loader?.container}
|
|
106
|
+
>
|
|
107
|
+
<Loader
|
|
108
|
+
{...classNames?.loader?.component}
|
|
109
|
+
{...styles?.loader?.component}
|
|
110
|
+
/>
|
|
111
|
+
</div>
|
|
112
|
+
) : (
|
|
113
|
+
<form
|
|
114
|
+
className={cn(
|
|
115
|
+
'cleen-flex cleen-flex-col cleen-items-start cleen-gap-3 cleen-p-4',
|
|
116
|
+
classNames?.form?.container
|
|
117
|
+
)}
|
|
118
|
+
style={styles?.form?.container}
|
|
119
|
+
onSubmit={e => e.preventDefault()}
|
|
120
|
+
>
|
|
121
|
+
<Input
|
|
122
|
+
label={labels?.number}
|
|
123
|
+
name="number"
|
|
124
|
+
type="tel"
|
|
125
|
+
autoComplete="cc-number"
|
|
126
|
+
className={cn(
|
|
127
|
+
'cleen-w-full',
|
|
128
|
+
classNames?.form?.cardNumber?.className
|
|
129
|
+
)}
|
|
130
|
+
classNames={{
|
|
131
|
+
...classNames?.form?.cardNumber?.classNames,
|
|
132
|
+
inputContainer: cn(
|
|
133
|
+
{
|
|
134
|
+
'cleen-border-error': errors?.number,
|
|
135
|
+
},
|
|
136
|
+
classNames?.form?.cardNumber?.classNames?.inputContainer
|
|
137
|
+
),
|
|
138
|
+
input: cn(
|
|
139
|
+
{
|
|
140
|
+
'cleen-text-error': errors?.number,
|
|
141
|
+
},
|
|
142
|
+
classNames?.form?.cardNumber?.classNames?.input
|
|
143
|
+
),
|
|
144
|
+
}}
|
|
145
|
+
{...styles?.form?.cardNumber}
|
|
146
|
+
placeholder="1111 1111 1111 1111"
|
|
147
|
+
value={cardData.number}
|
|
148
|
+
onChange={handleInputChange}
|
|
149
|
+
onFocus={handleInputFocus}
|
|
150
|
+
infoLabels={{
|
|
151
|
+
errorMessage: errors?.number,
|
|
152
|
+
}}
|
|
153
|
+
/>
|
|
154
|
+
|
|
155
|
+
<div
|
|
156
|
+
className={cn(
|
|
157
|
+
'cleen-flex cleen-justify-between cleen-items-start cleen-gap-3 cleen-w-full',
|
|
158
|
+
classNames?.form?.cvcExpiryContainer
|
|
159
|
+
)}
|
|
160
|
+
style={styles?.form?.cvcExpiryContainer}
|
|
161
|
+
>
|
|
162
|
+
<Input
|
|
163
|
+
label={labels?.expiry}
|
|
164
|
+
name="expiry"
|
|
165
|
+
type="tel"
|
|
166
|
+
autoComplete="cc-exp"
|
|
167
|
+
className={classNames?.form?.expiry?.className}
|
|
168
|
+
classNames={{
|
|
169
|
+
...classNames?.form?.expiry?.classNames,
|
|
170
|
+
inputContainer: cn(
|
|
171
|
+
{
|
|
172
|
+
'cleen-border-error': errors?.expiry,
|
|
173
|
+
},
|
|
174
|
+
classNames?.form?.expiry?.classNames?.inputContainer
|
|
175
|
+
),
|
|
176
|
+
input: cn(
|
|
177
|
+
{
|
|
178
|
+
'cleen-text-error': errors?.expiry,
|
|
179
|
+
},
|
|
180
|
+
classNames?.form?.expiry?.classNames?.input
|
|
181
|
+
),
|
|
182
|
+
}}
|
|
183
|
+
{...styles?.form?.expiry}
|
|
184
|
+
placeholder="00/00"
|
|
185
|
+
value={cardData.expiry}
|
|
186
|
+
onChange={handleInputChange}
|
|
187
|
+
onFocus={handleInputFocus}
|
|
188
|
+
infoLabels={{
|
|
189
|
+
errorMessage: errors?.expiry,
|
|
190
|
+
}}
|
|
191
|
+
/>
|
|
192
|
+
|
|
193
|
+
<Input
|
|
194
|
+
label={labels?.cvc}
|
|
195
|
+
name="cvc"
|
|
196
|
+
type="tel"
|
|
197
|
+
inputMode="numeric"
|
|
198
|
+
autoComplete="cc-csc"
|
|
199
|
+
maxLength={issuer === 'amex' ? 4 : 3}
|
|
200
|
+
className={classNames?.form?.cvc?.className}
|
|
201
|
+
classNames={{
|
|
202
|
+
...classNames?.form?.cvc?.classNames,
|
|
203
|
+
inputContainer: cn(
|
|
204
|
+
{
|
|
205
|
+
'cleen-border-error': errors?.cvc,
|
|
206
|
+
},
|
|
207
|
+
classNames?.form?.cvc?.classNames?.inputContainer
|
|
208
|
+
),
|
|
209
|
+
input: cn(
|
|
210
|
+
{
|
|
211
|
+
'cleen-text-error': errors?.cvc,
|
|
212
|
+
},
|
|
213
|
+
classNames?.form?.cvc?.classNames?.input
|
|
214
|
+
),
|
|
215
|
+
}}
|
|
216
|
+
{...styles?.form?.cvc}
|
|
217
|
+
placeholder="***"
|
|
218
|
+
value={cardData.cvc}
|
|
219
|
+
onChange={handleInputChange}
|
|
220
|
+
onFocus={handleInputFocus}
|
|
221
|
+
infoLabels={{
|
|
222
|
+
errorMessage: errors?.cvc,
|
|
223
|
+
}}
|
|
224
|
+
/>
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
{(infoLabels?.infoMessage ||
|
|
228
|
+
infoLabels?.errorMessage ||
|
|
229
|
+
infoLabels?.subtitle) && <InfoLabels {...infoLabels} />}
|
|
230
|
+
</form>
|
|
231
|
+
)}
|
|
232
|
+
</div>
|
|
233
|
+
</div>
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { InfoLabelsProps } from '@/components/infoLabels/InfoLabels';
|
|
2
|
+
import type { InputProps } from '@/components/input/Input';
|
|
3
|
+
import type { LoaderProps } from '@/components/loader/Loader';
|
|
4
|
+
import type { ComponentClassnames, ComponentStyles } from '@cleen/ui-core';
|
|
5
|
+
import type { ComponentProps, CSSProperties } from 'react';
|
|
6
|
+
import type { CardData, CardErrors, CardLabels } from './card';
|
|
7
|
+
|
|
8
|
+
export type CreditCardInputProps = Omit<ComponentProps<'div'>, 'onChange'> & {
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
value?: CardData;
|
|
11
|
+
labels?: CardLabels;
|
|
12
|
+
errors?: CardErrors;
|
|
13
|
+
classNames?: {
|
|
14
|
+
container?: string;
|
|
15
|
+
loader?: {
|
|
16
|
+
container?: string;
|
|
17
|
+
component?: ComponentClassnames<LoaderProps>;
|
|
18
|
+
};
|
|
19
|
+
form?: {
|
|
20
|
+
container?: string;
|
|
21
|
+
cvcExpiryContainer?: string;
|
|
22
|
+
cardNumber?: ComponentClassnames<InputProps>;
|
|
23
|
+
expiry?: ComponentClassnames<InputProps>;
|
|
24
|
+
cvc?: ComponentClassnames<InputProps>;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
styles?: {
|
|
28
|
+
container?: CSSProperties;
|
|
29
|
+
loader?: {
|
|
30
|
+
container?: CSSProperties;
|
|
31
|
+
component?: ComponentStyles<LoaderProps>;
|
|
32
|
+
};
|
|
33
|
+
form?: {
|
|
34
|
+
container?: CSSProperties;
|
|
35
|
+
cvcExpiryContainer?: CSSProperties;
|
|
36
|
+
cardNumber?: ComponentStyles<InputProps>;
|
|
37
|
+
expiry?: ComponentStyles<InputProps>;
|
|
38
|
+
cvc?: ComponentStyles<InputProps>;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
infoLabels?: InfoLabelsProps;
|
|
42
|
+
onChange?: (value: CardData) => void;
|
|
43
|
+
onFieldFocus?: (fieldName: keyof CardData) => void;
|
|
44
|
+
};
|