@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,246 @@
|
|
|
1
|
+
import { IconCheck } from '@/components/cleenIcon';
|
|
2
|
+
import { InfoLabels } from '@/components/infoLabels';
|
|
3
|
+
import type { InfoLabelsProps } from '@/components/infoLabels/InfoLabels';
|
|
4
|
+
import { cn } from '@cleen/ui-core';
|
|
5
|
+
import {
|
|
6
|
+
forwardRef,
|
|
7
|
+
useEffect,
|
|
8
|
+
useRef,
|
|
9
|
+
useState,
|
|
10
|
+
type ChangeEvent,
|
|
11
|
+
type ComponentProps,
|
|
12
|
+
type CSSProperties,
|
|
13
|
+
type ReactNode,
|
|
14
|
+
type RefObject,
|
|
15
|
+
} from 'react';
|
|
16
|
+
import { checkedVariants, indeterminateVariants } from './variants';
|
|
17
|
+
|
|
18
|
+
export type CheckboxProps = Omit<ComponentProps<'input'>, 'title'> & {
|
|
19
|
+
checked?: boolean | null;
|
|
20
|
+
defaultChecked?: boolean;
|
|
21
|
+
title?: ReactNode;
|
|
22
|
+
label?: ReactNode;
|
|
23
|
+
sublabel?: ReactNode;
|
|
24
|
+
variant?: keyof typeof checkedVariants;
|
|
25
|
+
allowIndeterminate?: boolean;
|
|
26
|
+
fullTriggerArea?: boolean;
|
|
27
|
+
classNames?: {
|
|
28
|
+
container?: string;
|
|
29
|
+
title?: string;
|
|
30
|
+
checkboxContainer?: string;
|
|
31
|
+
checkbox?: string;
|
|
32
|
+
label?: string;
|
|
33
|
+
sublabel?: string;
|
|
34
|
+
};
|
|
35
|
+
styles?: {
|
|
36
|
+
container?: CSSProperties;
|
|
37
|
+
title?: CSSProperties;
|
|
38
|
+
checkboxContainer?: CSSProperties;
|
|
39
|
+
checkbox?: CSSProperties;
|
|
40
|
+
label?: CSSProperties;
|
|
41
|
+
sublabel?: CSSProperties;
|
|
42
|
+
};
|
|
43
|
+
infoLabels?: InfoLabelsProps;
|
|
44
|
+
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The `Checkbox` component is a controlled or uncontrolled input that supports checked, unchecked, and optional indeterminate states.
|
|
49
|
+
*
|
|
50
|
+
* - Pass `checked` (boolean or `null` for indeterminate) to use as a controlled input, or use `defaultChecked` for uncontrolled mode.
|
|
51
|
+
* - Set `allowIndeterminate` to cycle through checked → indeterminate → unchecked on each change.
|
|
52
|
+
* - Supports `label`, `sublabel`, and `title` for rich labelling above and beside the input.
|
|
53
|
+
* - Use `infoLabels` to show an error, info, or subtitle message below the checkbox.
|
|
54
|
+
* - Set `fullTriggerArea` to make the entire label row clickable instead of just the checkbox box.
|
|
55
|
+
* - Accepts `classNames` and `styles` to customize: `container`, `title`, `checkboxContainer`, `checkbox`, `label`, `sublabel`.
|
|
56
|
+
*/
|
|
57
|
+
export const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
|
|
58
|
+
function Checkbox(
|
|
59
|
+
{
|
|
60
|
+
checked,
|
|
61
|
+
defaultChecked = false,
|
|
62
|
+
className,
|
|
63
|
+
classNames,
|
|
64
|
+
style,
|
|
65
|
+
styles,
|
|
66
|
+
onChange,
|
|
67
|
+
disabled,
|
|
68
|
+
id,
|
|
69
|
+
title,
|
|
70
|
+
label,
|
|
71
|
+
sublabel,
|
|
72
|
+
variant = 'primary',
|
|
73
|
+
allowIndeterminate = false,
|
|
74
|
+
fullTriggerArea = false,
|
|
75
|
+
infoLabels,
|
|
76
|
+
...props
|
|
77
|
+
},
|
|
78
|
+
ref
|
|
79
|
+
) {
|
|
80
|
+
const isControlled = typeof checked === 'boolean' || checked === null;
|
|
81
|
+
const [internalChecked, setInternalChecked] = useState<boolean | null>(
|
|
82
|
+
defaultChecked
|
|
83
|
+
);
|
|
84
|
+
const inputRef = useRef<HTMLInputElement | null>(null);
|
|
85
|
+
|
|
86
|
+
// Keep both internal ref and forwarded ref in sync
|
|
87
|
+
const setInputRef = (el: HTMLInputElement | null) => {
|
|
88
|
+
inputRef.current = el;
|
|
89
|
+
if (!ref) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (typeof ref === 'function') {
|
|
94
|
+
ref(el);
|
|
95
|
+
} else {
|
|
96
|
+
(ref as RefObject<HTMLInputElement | null>).current = el;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
if (!isControlled) {
|
|
102
|
+
setInternalChecked(defaultChecked);
|
|
103
|
+
}
|
|
104
|
+
}, [defaultChecked, isControlled]);
|
|
105
|
+
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
if (inputRef.current) {
|
|
108
|
+
inputRef.current.indeterminate = allowIndeterminate && checked === null;
|
|
109
|
+
}
|
|
110
|
+
}, [checked, allowIndeterminate]);
|
|
111
|
+
|
|
112
|
+
const currentChecked = isControlled ? checked : internalChecked;
|
|
113
|
+
|
|
114
|
+
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
|
|
115
|
+
let newValue;
|
|
116
|
+
|
|
117
|
+
if (allowIndeterminate) {
|
|
118
|
+
switch (currentChecked) {
|
|
119
|
+
case true:
|
|
120
|
+
newValue = null;
|
|
121
|
+
break;
|
|
122
|
+
|
|
123
|
+
case false:
|
|
124
|
+
newValue = true;
|
|
125
|
+
break;
|
|
126
|
+
|
|
127
|
+
case null:
|
|
128
|
+
default:
|
|
129
|
+
newValue = false;
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
} else {
|
|
133
|
+
newValue = !currentChecked;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (!isControlled) {
|
|
137
|
+
setInternalChecked(newValue);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
onChange?.({
|
|
141
|
+
...e,
|
|
142
|
+
target: {
|
|
143
|
+
...e.target,
|
|
144
|
+
checked: newValue as boolean,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
const checkboxContent = (
|
|
150
|
+
<>
|
|
151
|
+
<label
|
|
152
|
+
className={cn(
|
|
153
|
+
'cleen-bg-white cleen-transition-all cleen-duration-200 hover:cleen-bg-gray/10 hover:cleen-shadow-[0px_0px_0px_4px_rgba(var(--cleen-gray),0.1)] cleen-border cleen-border-gray/30 cleen-rounded cleen-ring-primary cleen-size-5 cleen-cursor-pointer',
|
|
154
|
+
{
|
|
155
|
+
[checkedVariants[variant]]: currentChecked,
|
|
156
|
+
[indeterminateVariants[variant]]: currentChecked === null,
|
|
157
|
+
},
|
|
158
|
+
disabled && 'cleen-cursor-not-allowed cleen-pointer-events-none',
|
|
159
|
+
'cleen-flex cleen-items-center cleen-justify-center',
|
|
160
|
+
classNames?.checkbox
|
|
161
|
+
)}
|
|
162
|
+
style={styles?.checkbox}
|
|
163
|
+
>
|
|
164
|
+
<input
|
|
165
|
+
ref={setInputRef}
|
|
166
|
+
type="checkbox"
|
|
167
|
+
disabled={disabled}
|
|
168
|
+
className="cleen-hidden"
|
|
169
|
+
checked={currentChecked === true}
|
|
170
|
+
onChange={handleChange}
|
|
171
|
+
id={id}
|
|
172
|
+
{...props}
|
|
173
|
+
/>
|
|
174
|
+
|
|
175
|
+
{currentChecked === null ? (
|
|
176
|
+
<span className="cleen-block cleen-m-auto cleen-border cleen-border-white cleen-rounded-sm cleen-w-2.5 cleen-h-0.5 cleen-size-3" />
|
|
177
|
+
) : currentChecked ? (
|
|
178
|
+
<IconCheck className="cleen-stroke-[3px] cleen-size-3 cleen-text-white" />
|
|
179
|
+
) : null}
|
|
180
|
+
</label>
|
|
181
|
+
|
|
182
|
+
{(label || sublabel) && (
|
|
183
|
+
<div className="cleen-text-gray/80">
|
|
184
|
+
<label
|
|
185
|
+
htmlFor={id}
|
|
186
|
+
className={cn('cleen-flex', classNames?.label)}
|
|
187
|
+
style={styles?.label}
|
|
188
|
+
>
|
|
189
|
+
{label}
|
|
190
|
+
</label>
|
|
191
|
+
|
|
192
|
+
<label
|
|
193
|
+
htmlFor={id}
|
|
194
|
+
className={cn(
|
|
195
|
+
'cleen-font-normal cleen-text-gray/60 cleen-text-sm cleen-leading-5',
|
|
196
|
+
classNames?.sublabel
|
|
197
|
+
)}
|
|
198
|
+
style={styles?.sublabel}
|
|
199
|
+
>
|
|
200
|
+
{sublabel}
|
|
201
|
+
</label>
|
|
202
|
+
</div>
|
|
203
|
+
)}
|
|
204
|
+
</>
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
const checkboxContainerProps = {
|
|
208
|
+
className: cn(
|
|
209
|
+
'cleen-flex cleen-items-start cleen-gap-2 cleen-ml-1',
|
|
210
|
+
{
|
|
211
|
+
'cleen-opacity-50': disabled,
|
|
212
|
+
},
|
|
213
|
+
classNames?.checkboxContainer
|
|
214
|
+
),
|
|
215
|
+
style: styles?.checkboxContainer,
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
return (
|
|
219
|
+
<div className={cn('cleen', className)} style={style}>
|
|
220
|
+
<div className={cn(classNames?.container)} style={styles?.container}>
|
|
221
|
+
{title && (
|
|
222
|
+
<label
|
|
223
|
+
className={cn(
|
|
224
|
+
'cleen-block cleen-mb-1.5 cleen-font-medium cleen-text-gray/90 cleen-text-sm cleen-leading-6',
|
|
225
|
+
classNames?.title
|
|
226
|
+
)}
|
|
227
|
+
style={styles?.title}
|
|
228
|
+
>
|
|
229
|
+
{title}
|
|
230
|
+
</label>
|
|
231
|
+
)}
|
|
232
|
+
|
|
233
|
+
{fullTriggerArea ? (
|
|
234
|
+
<label {...checkboxContainerProps}>{checkboxContent}</label>
|
|
235
|
+
) : (
|
|
236
|
+
<div {...checkboxContainerProps}>{checkboxContent}</div>
|
|
237
|
+
)}
|
|
238
|
+
|
|
239
|
+
{(infoLabels?.errorMessage ||
|
|
240
|
+
infoLabels?.infoMessage ||
|
|
241
|
+
infoLabels?.subtitle) && <InfoLabels {...infoLabels} />}
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Checkbox, type CheckboxProps } from './Checkbox';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const checkedVariants = {
|
|
2
|
+
primary:
|
|
3
|
+
'cleen-bg-primary cleen-transition-all cleen-duration-200 hover:cleen-bg-primary hover:cleen-shadow-[0px_0px_0px_4px_rgba(var(--cleen-primary),0.25)]',
|
|
4
|
+
error:
|
|
5
|
+
'cleen-bg-error cleen-transition-all cleen-duration-200 hover:cleen-bg-error hover:cleen-shadow-[0px_0px_0px_4px_rgba(var(--cleen-error),0.25)]',
|
|
6
|
+
} as const;
|
|
7
|
+
|
|
8
|
+
export const indeterminateVariants = {
|
|
9
|
+
primary:
|
|
10
|
+
'cleen-bg-primary/60 cleen-transition-all cleen-duration-200 hover:cleen-bg-primary/60 hover:cleen-shadow-[0px_0px_0px_4px_rgba(var(--cleen-primary),0.25)]',
|
|
11
|
+
error:
|
|
12
|
+
'cleen-bg-error/60 cleen-transition-all cleen-duration-200 hover:cleen-bg-error/60 hover:cleen-shadow-[0px_0px_0px_4px_rgba(var(--cleen-error),0.25)]',
|
|
13
|
+
} as const;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { InfoLabels } from '@/components/infoLabels';
|
|
2
|
+
import type { InfoLabelsProps } from '@/components/infoLabels/InfoLabels';
|
|
3
|
+
import {
|
|
4
|
+
useMemo,
|
|
5
|
+
useState,
|
|
6
|
+
type ChangeEvent,
|
|
7
|
+
type ComponentProps,
|
|
8
|
+
type CSSProperties,
|
|
9
|
+
type ReactNode,
|
|
10
|
+
} from 'react';
|
|
11
|
+
import { cn } from '@cleen/ui-core';
|
|
12
|
+
import { Checkbox, type CheckboxProps } from '@/components/checkbox/Checkbox';
|
|
13
|
+
|
|
14
|
+
export interface CheckboxGroupProps extends Omit<
|
|
15
|
+
ComponentProps<'div'>,
|
|
16
|
+
'onChange'
|
|
17
|
+
> {
|
|
18
|
+
label?: ReactNode;
|
|
19
|
+
checkboxes?: CheckboxProps[];
|
|
20
|
+
onChange?: (checkbox: CheckboxProps, checkboxArray?: CheckboxProps[]) => void;
|
|
21
|
+
allowIndeterminate?: boolean;
|
|
22
|
+
infoLabels?: InfoLabelsProps;
|
|
23
|
+
requiresAtLeastOneOptions?: {
|
|
24
|
+
title?: ReactNode;
|
|
25
|
+
subtitle?: ReactNode;
|
|
26
|
+
};
|
|
27
|
+
classNames?: {
|
|
28
|
+
container?: string;
|
|
29
|
+
label?: string;
|
|
30
|
+
checkboxes?: string;
|
|
31
|
+
checkboxContainer?: string;
|
|
32
|
+
requiresAtLeastOne?: {
|
|
33
|
+
container?: string;
|
|
34
|
+
title?: string;
|
|
35
|
+
subtitle?: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
styles?: {
|
|
39
|
+
container?: CSSProperties;
|
|
40
|
+
label?: CSSProperties;
|
|
41
|
+
checkboxes?: CSSProperties;
|
|
42
|
+
checkboxContainer?: CSSProperties;
|
|
43
|
+
requiresAtLeastOne?: {
|
|
44
|
+
container?: CSSProperties;
|
|
45
|
+
title?: CSSProperties;
|
|
46
|
+
subtitle?: CSSProperties;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The `CheckboxGroup` component renders a labelled list of `Checkbox` items and manages their collective state.
|
|
53
|
+
*
|
|
54
|
+
* - Pass an array of `checkboxes` (each with an `id` for accurate tracking) to populate the group.
|
|
55
|
+
* - The `onChange` callback receives the changed checkbox and the full updated array when all items have an `id`.
|
|
56
|
+
* - Set `allowIndeterminate` to propagate indeterminate support to each checkbox in the group.
|
|
57
|
+
* - Use `requiresAtLeastOneOptions` to display a validation error when all checkboxes are unchecked.
|
|
58
|
+
* - Use `infoLabels` for static error, info, or subtitle messages below the group.
|
|
59
|
+
* - Accepts `classNames` and `styles` to customize: `container`, `label`, `checkboxes`, `checkboxContainer`, `requiresAtLeastOne`.
|
|
60
|
+
*/
|
|
61
|
+
export const CheckboxGroup = ({
|
|
62
|
+
label,
|
|
63
|
+
checkboxes,
|
|
64
|
+
allowIndeterminate,
|
|
65
|
+
infoLabels,
|
|
66
|
+
requiresAtLeastOneOptions,
|
|
67
|
+
classNames,
|
|
68
|
+
styles,
|
|
69
|
+
onChange,
|
|
70
|
+
...props
|
|
71
|
+
}: CheckboxGroupProps) => {
|
|
72
|
+
const [hasChangedOnce, setHasChangedOnce] = useState(false);
|
|
73
|
+
|
|
74
|
+
const errorMessage = useMemo(() => {
|
|
75
|
+
if (
|
|
76
|
+
requiresAtLeastOneOptions &&
|
|
77
|
+
hasChangedOnce &&
|
|
78
|
+
checkboxes?.every(checkbox => checkbox.checked === false)
|
|
79
|
+
) {
|
|
80
|
+
return requiresAtLeastOneOptions.title;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return infoLabels?.errorMessage;
|
|
84
|
+
}, [
|
|
85
|
+
requiresAtLeastOneOptions,
|
|
86
|
+
infoLabels?.errorMessage,
|
|
87
|
+
checkboxes,
|
|
88
|
+
hasChangedOnce,
|
|
89
|
+
]);
|
|
90
|
+
|
|
91
|
+
const handleChange = (
|
|
92
|
+
e: ChangeEvent<HTMLInputElement>,
|
|
93
|
+
checkbox: CheckboxProps
|
|
94
|
+
) => {
|
|
95
|
+
const newCheckbox = {
|
|
96
|
+
...checkbox,
|
|
97
|
+
checked: e.target.checked,
|
|
98
|
+
};
|
|
99
|
+
let newArr: CheckboxProps[] | undefined = undefined;
|
|
100
|
+
|
|
101
|
+
if (checkboxes && checkbox?.id) {
|
|
102
|
+
newArr = [...checkboxes]?.map(cb =>
|
|
103
|
+
cb.id === checkbox.id ? newCheckbox : cb
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
onChange?.(newCheckbox, newArr);
|
|
108
|
+
setHasChangedOnce(true);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<div className={cn('cleen')} {...props}>
|
|
113
|
+
<div
|
|
114
|
+
className={cn(
|
|
115
|
+
'cleen-flex cleen-flex-col cleen-gap-2',
|
|
116
|
+
classNames?.container
|
|
117
|
+
)}
|
|
118
|
+
style={styles?.container}
|
|
119
|
+
>
|
|
120
|
+
{label && (
|
|
121
|
+
<label
|
|
122
|
+
className={cn(
|
|
123
|
+
'cleen-block cleen-mb-1.5 cleen-font-medium cleen-text-gray/90 cleen-text-sm cleen-leading-6',
|
|
124
|
+
classNames?.label
|
|
125
|
+
)}
|
|
126
|
+
style={styles?.label}
|
|
127
|
+
>
|
|
128
|
+
{label}
|
|
129
|
+
</label>
|
|
130
|
+
)}
|
|
131
|
+
|
|
132
|
+
<div
|
|
133
|
+
className={cn(
|
|
134
|
+
'cleen-flex cleen-flex-col cleen-gap-3 cleen-pl-2',
|
|
135
|
+
classNames?.checkboxes
|
|
136
|
+
)}
|
|
137
|
+
style={styles?.checkboxes}
|
|
138
|
+
>
|
|
139
|
+
{checkboxes?.map(checkbox => (
|
|
140
|
+
<div
|
|
141
|
+
key={checkbox.id}
|
|
142
|
+
className={cn('cleen-flex', classNames?.checkboxContainer)}
|
|
143
|
+
style={styles?.checkboxContainer}
|
|
144
|
+
>
|
|
145
|
+
<Checkbox
|
|
146
|
+
allowIndeterminate={allowIndeterminate}
|
|
147
|
+
{...checkbox}
|
|
148
|
+
fullTriggerArea
|
|
149
|
+
onChange={e => handleChange(e, checkbox)}
|
|
150
|
+
/>
|
|
151
|
+
</div>
|
|
152
|
+
))}
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
{(errorMessage || infoLabels?.infoMessage || infoLabels?.subtitle) && (
|
|
156
|
+
<InfoLabels {...infoLabels} errorMessage={errorMessage} />
|
|
157
|
+
)}
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export default CheckboxGroup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CheckboxGroup, type CheckboxGroupProps } from './CheckboxGroup';
|