@cleen/ui 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/dist/charts/index.d.ts +118 -0
- package/dist/charts/index.js +1 -0
- package/dist/icons/index.d.ts +35 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.d.ts +2959 -0
- package/dist/index.js +19 -0
- package/package.json +54 -54
- package/src/charts/chart/Chart.tsx +0 -82
- package/src/charts/chart/constant.ts +0 -50
- package/src/charts/chart/index.ts +0 -2
- package/src/charts/chart/types/apexcharts.ts +0 -9
- package/src/charts/chart/variants/BellCurve/BellCurve.tsx +0 -215
- package/src/charts/chart/variants/BellCurve/constant.ts +0 -112
- package/src/charts/chart/variants/BellCurve/helper.ts +0 -116
- package/src/charts/chart/variants/BellCurve/index.ts +0 -2
- package/src/charts/chart/variants/BellCurve/types/bellCurve.ts +0 -47
- package/src/charts/chart/variants/BellCurve/types/props.ts +0 -21
- package/src/charts/chart/variants/RadarChart/RadarChart.tsx +0 -22
- package/src/charts/chart/variants/RadarChart/constant.ts +0 -28
- package/src/charts/chart/variants/RadarChart/index.ts +0 -1
- package/src/charts/chart/variants/ScatterChart/ScatterChart.tsx +0 -23
- package/src/charts/chart/variants/ScatterChart/constant.ts +0 -54
- package/src/charts/chart/variants/ScatterChart/index.ts +0 -1
- package/src/charts/chart/variants/index.ts +0 -3
- package/src/charts/index.ts +0 -2
- package/src/charts/simpleChart/SimpleChart.tsx +0 -54
- package/src/charts/simpleChart/index.ts +0 -1
- package/src/components/advancedProgressBar/AdvancedProgressBar.tsx +0 -156
- package/src/components/advancedProgressBar/blocks/Bar.tsx +0 -118
- package/src/components/advancedProgressBar/blocks/BlockLabel.tsx +0 -49
- package/src/components/advancedProgressBar/blocks/Clamp.tsx +0 -85
- package/src/components/advancedProgressBar/constants.ts +0 -6
- package/src/components/advancedProgressBar/index.ts +0 -2
- package/src/components/advancedProgressBar/types/props.ts +0 -69
- package/src/components/advancedProgressBar/utils.ts +0 -17
- package/src/components/audioPlayback/AudioPlayback.tsx +0 -141
- package/src/components/audioPlayback/index.ts +0 -2
- package/src/components/audioRecorder/AudioRecorder.tsx +0 -391
- package/src/components/audioRecorder/constant/default.ts +0 -19
- package/src/components/audioRecorder/constant/labels.ts +0 -9
- package/src/components/audioRecorder/index.ts +0 -2
- package/src/components/audioRecorder/types/props.ts +0 -56
- package/src/components/avatar/Avatar.tsx +0 -132
- package/src/components/avatar/index.ts +0 -1
- package/src/components/avatar/variants.ts +0 -9
- package/src/components/avatarRow/AvatarRow.tsx +0 -127
- package/src/components/avatarRow/index.ts +0 -1
- package/src/components/breadcrumb/Breadcrumb.tsx +0 -158
- package/src/components/breadcrumb/index.ts +0 -1
- package/src/components/button/Button.tsx +0 -114
- package/src/components/button/index.ts +0 -2
- package/src/components/button/variants.ts +0 -41
- package/src/components/card/Card.tsx +0 -197
- package/src/components/card/index.ts +0 -3
- package/src/components/card/variants/CardIcon/CardIcon.tsx +0 -158
- package/src/components/card/variants/CardMedia/CardMedia.tsx +0 -127
- package/src/components/checkbox/Checkbox.tsx +0 -246
- package/src/components/checkbox/index.ts +0 -1
- package/src/components/checkbox/variants.ts +0 -13
- package/src/components/checkboxGroup/CheckboxGroup.tsx +0 -163
- package/src/components/checkboxGroup/index.ts +0 -1
- package/src/components/cleenIcon/CleenIcon.tsx +0 -674
- package/src/components/cleenIcon/icons/IconAlertCircle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconAlertFeatured.tsx +0 -30
- package/src/components/cleenIcon/icons/IconAlertOctagon.tsx +0 -21
- package/src/components/cleenIcon/icons/IconAlertTriangle.tsx +0 -25
- package/src/components/cleenIcon/icons/IconAlignRight.tsx +0 -25
- package/src/components/cleenIcon/icons/IconArrowDown.tsx +0 -25
- package/src/components/cleenIcon/icons/IconArrowLeft.tsx +0 -25
- package/src/components/cleenIcon/icons/IconArrowLeft2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconArrowRight.tsx +0 -25
- package/src/components/cleenIcon/icons/IconArrowToTop.tsx +0 -20
- package/src/components/cleenIcon/icons/IconArrowUp.tsx +0 -22
- package/src/components/cleenIcon/icons/IconArrowUpRight.tsx +0 -22
- package/src/components/cleenIcon/icons/IconArrowUpRightNarrow.tsx +0 -22
- package/src/components/cleenIcon/icons/IconArrowUpRightSquare.tsx +0 -22
- package/src/components/cleenIcon/icons/IconAttachment.tsx +0 -22
- package/src/components/cleenIcon/icons/IconBarChartSquare.tsx +0 -22
- package/src/components/cleenIcon/icons/IconBold.tsx +0 -16
- package/src/components/cleenIcon/icons/IconBookmarkCheck.tsx +0 -22
- package/src/components/cleenIcon/icons/IconBookmarkCheckFill.tsx +0 -37
- package/src/components/cleenIcon/icons/IconBookmarkPlus.tsx +0 -22
- package/src/components/cleenIcon/icons/IconBookmarkX.tsx +0 -22
- package/src/components/cleenIcon/icons/IconBoxLines.tsx +0 -16
- package/src/components/cleenIcon/icons/IconBoxText.tsx +0 -24
- package/src/components/cleenIcon/icons/IconBracketsCheck.tsx +0 -25
- package/src/components/cleenIcon/icons/IconBracketsEllipses.tsx +0 -22
- package/src/components/cleenIcon/icons/IconBuilding.tsx +0 -22
- package/src/components/cleenIcon/icons/IconCalendar.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCertificateHeart.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCheck.tsx +0 -22
- package/src/components/cleenIcon/icons/IconCheckCircle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconCheckCircleBroken.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCheckFill.tsx +0 -45
- package/src/components/cleenIcon/icons/IconCheckVerified.tsx +0 -22
- package/src/components/cleenIcon/icons/IconChevronDown.tsx +0 -22
- package/src/components/cleenIcon/icons/IconChevronLeft.tsx +0 -25
- package/src/components/cleenIcon/icons/IconChevronLeftDouble.tsx +0 -22
- package/src/components/cleenIcon/icons/IconChevronRight.tsx +0 -25
- package/src/components/cleenIcon/icons/IconChevronRightDouble.tsx +0 -22
- package/src/components/cleenIcon/icons/IconChevronSelectorVertical.tsx +0 -22
- package/src/components/cleenIcon/icons/IconChevronUp.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCircleSwap.tsx +0 -22
- package/src/components/cleenIcon/icons/IconClockFastForward.tsx +0 -25
- package/src/components/cleenIcon/icons/IconClockRewind.tsx +0 -25
- package/src/components/cleenIcon/icons/IconClockRewind2.tsx +0 -21
- package/src/components/cleenIcon/icons/IconCodeBrowser.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCodeCircle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconColors.tsx +0 -25
- package/src/components/cleenIcon/icons/IconColumnEdit.tsx +0 -19
- package/src/components/cleenIcon/icons/IconCopy.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCopy2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconCopy3.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCopy4.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCopy5.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCopyCheck.tsx +0 -22
- package/src/components/cleenIcon/icons/IconCube.tsx +0 -25
- package/src/components/cleenIcon/icons/IconCubeOutline.tsx +0 -22
- package/src/components/cleenIcon/icons/IconCursorBox.tsx +0 -25
- package/src/components/cleenIcon/icons/IconDataflow.tsx +0 -22
- package/src/components/cleenIcon/icons/IconDataflow2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconDataflow3.tsx +0 -29
- package/src/components/cleenIcon/icons/IconDelete.tsx +0 -25
- package/src/components/cleenIcon/icons/IconDollarCircle.tsx +0 -25
- package/src/components/cleenIcon/icons/IconDotsGrid.tsx +0 -74
- package/src/components/cleenIcon/icons/IconDotsHorizontal.tsx +0 -34
- package/src/components/cleenIcon/icons/IconDotsVertical.tsx +0 -38
- package/src/components/cleenIcon/icons/IconEdit.tsx +0 -25
- package/src/components/cleenIcon/icons/IconEditable.tsx +0 -25
- package/src/components/cleenIcon/icons/IconExpand.tsx +0 -22
- package/src/components/cleenIcon/icons/IconEye.tsx +0 -28
- package/src/components/cleenIcon/icons/IconEyeHidden.tsx +0 -25
- package/src/components/cleenIcon/icons/IconEyeHidden2.tsx +0 -24
- package/src/components/cleenIcon/icons/IconFaceSmile.tsx +0 -24
- package/src/components/cleenIcon/icons/IconFilter.tsx +0 -22
- package/src/components/cleenIcon/icons/IconFilter2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconFlag.tsx +0 -22
- package/src/components/cleenIcon/icons/IconFlag2.tsx +0 -25
- package/src/components/cleenIcon/icons/IconFlag3.tsx +0 -16
- package/src/components/cleenIcon/icons/IconHandShield.tsx +0 -22
- package/src/components/cleenIcon/icons/IconHash.tsx +0 -22
- package/src/components/cleenIcon/icons/IconHeadsetMic.tsx +0 -21
- package/src/components/cleenIcon/icons/IconHeart.tsx +0 -24
- package/src/components/cleenIcon/icons/IconHouseLine.tsx +0 -22
- package/src/components/cleenIcon/icons/IconImage.tsx +0 -22
- package/src/components/cleenIcon/icons/IconImage2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconImage3.tsx +0 -17
- package/src/components/cleenIcon/icons/IconImage4.tsx +0 -25
- package/src/components/cleenIcon/icons/IconImageCheck.tsx +0 -22
- package/src/components/cleenIcon/icons/IconInfoCircle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconInfoHexagon.tsx +0 -25
- package/src/components/cleenIcon/icons/IconItalic.tsx +0 -16
- package/src/components/cleenIcon/icons/IconLayersMultiple.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLayersSingle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLayout.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLayout2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLayoutColumns.tsx +0 -20
- package/src/components/cleenIcon/icons/IconLayoutCustom.tsx +0 -16
- package/src/components/cleenIcon/icons/IconLayoutSequential.tsx +0 -16
- package/src/components/cleenIcon/icons/IconLayoutStuffed.tsx +0 -20
- package/src/components/cleenIcon/icons/IconLayoutTile.tsx +0 -16
- package/src/components/cleenIcon/icons/IconLifeBuoy.tsx +0 -29
- package/src/components/cleenIcon/icons/IconLightbulb.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLightning.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLightning2.tsx +0 -25
- package/src/components/cleenIcon/icons/IconLightningFast.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLineChartBar.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLineChartBreakoutSquare.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLineChartUp.tsx +0 -25
- package/src/components/cleenIcon/icons/IconLineChartUp2.tsx +0 -34
- package/src/components/cleenIcon/icons/IconLines.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLinesCheck.tsx +0 -16
- package/src/components/cleenIcon/icons/IconLinesPlay.tsx +0 -23
- package/src/components/cleenIcon/icons/IconLink.tsx +0 -25
- package/src/components/cleenIcon/icons/IconLink2.tsx +0 -24
- package/src/components/cleenIcon/icons/IconLink3.tsx +0 -21
- package/src/components/cleenIcon/icons/IconLink4.tsx +0 -17
- package/src/components/cleenIcon/icons/IconLink5.tsx +0 -22
- package/src/components/cleenIcon/icons/IconListBullet.tsx +0 -18
- package/src/components/cleenIcon/icons/IconListOrder.tsx +0 -20
- package/src/components/cleenIcon/icons/IconListOrder2.tsx +0 -16
- package/src/components/cleenIcon/icons/IconLock.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLock2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconLogIn.tsx +0 -25
- package/src/components/cleenIcon/icons/IconLogOut.tsx +0 -25
- package/src/components/cleenIcon/icons/IconLogOut2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconMagicWand.tsx +0 -25
- package/src/components/cleenIcon/icons/IconMagicWand2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconMail.tsx +0 -25
- package/src/components/cleenIcon/icons/IconMessageSquare.tsx +0 -25
- package/src/components/cleenIcon/icons/IconMessageSquare2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconMessageXSquare.tsx +0 -25
- package/src/components/cleenIcon/icons/IconMinusCircle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconMobile.tsx +0 -25
- package/src/components/cleenIcon/icons/IconMonitor.tsx +0 -22
- package/src/components/cleenIcon/icons/IconMonitor2.tsx +0 -25
- package/src/components/cleenIcon/icons/IconMonitor3.tsx +0 -25
- package/src/components/cleenIcon/icons/IconMoonCircle.tsx +0 -28
- package/src/components/cleenIcon/icons/IconNavigationPointer.tsx +0 -22
- package/src/components/cleenIcon/icons/IconNotificationBox.tsx +0 -22
- package/src/components/cleenIcon/icons/IconPCSetup.tsx +0 -22
- package/src/components/cleenIcon/icons/IconPalette.tsx +0 -40
- package/src/components/cleenIcon/icons/IconPasscodeLock.tsx +0 -25
- package/src/components/cleenIcon/icons/IconPencil.tsx +0 -25
- package/src/components/cleenIcon/icons/IconPercentageCircle.tsx +0 -29
- package/src/components/cleenIcon/icons/IconPerspective.tsx +0 -22
- package/src/components/cleenIcon/icons/IconPhoneCall.tsx +0 -25
- package/src/components/cleenIcon/icons/IconPin.tsx +0 -22
- package/src/components/cleenIcon/icons/IconPlayCircle.tsx +0 -28
- package/src/components/cleenIcon/icons/IconPlus.tsx +0 -22
- package/src/components/cleenIcon/icons/IconPlusCircle.tsx +0 -25
- package/src/components/cleenIcon/icons/IconPulse.tsx +0 -25
- package/src/components/cleenIcon/icons/IconQuestionCircle.tsx +0 -24
- package/src/components/cleenIcon/icons/IconRadioButton.tsx +0 -27
- package/src/components/cleenIcon/icons/IconRadioButtonActive.tsx +0 -39
- package/src/components/cleenIcon/icons/IconReceiptCheck.tsx +0 -25
- package/src/components/cleenIcon/icons/IconRedo.tsx +0 -16
- package/src/components/cleenIcon/icons/IconRefresh.tsx +0 -22
- package/src/components/cleenIcon/icons/IconRefresh2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconRefresh3.tsx +0 -20
- package/src/components/cleenIcon/icons/IconRepeat.tsx +0 -22
- package/src/components/cleenIcon/icons/IconRepeat2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconRetweet.tsx +0 -33
- package/src/components/cleenIcon/icons/IconRoundChart.tsx +0 -25
- package/src/components/cleenIcon/icons/IconRoundChart2.tsx +0 -29
- package/src/components/cleenIcon/icons/IconRoute.tsx +0 -22
- package/src/components/cleenIcon/icons/IconSave.tsx +0 -25
- package/src/components/cleenIcon/icons/IconSave2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconScanDots.tsx +0 -22
- package/src/components/cleenIcon/icons/IconSearch.tsx +0 -22
- package/src/components/cleenIcon/icons/IconSend.tsx +0 -25
- package/src/components/cleenIcon/icons/IconSettings.tsx +0 -32
- package/src/components/cleenIcon/icons/IconSettings2.tsx +0 -25
- package/src/components/cleenIcon/icons/IconSettings3.tsx +0 -22
- package/src/components/cleenIcon/icons/IconShieldLightning.tsx +0 -22
- package/src/components/cleenIcon/icons/IconShieldPlus.tsx +0 -22
- package/src/components/cleenIcon/icons/IconShieldRemove.tsx +0 -16
- package/src/components/cleenIcon/icons/IconShuffle.tsx +0 -25
- package/src/components/cleenIcon/icons/IconSlashCircle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconSlashOctagon.tsx +0 -22
- package/src/components/cleenIcon/icons/IconSocialGlobe.tsx +0 -23
- package/src/components/cleenIcon/icons/IconSocialLinkedin.tsx +0 -21
- package/src/components/cleenIcon/icons/IconSocialX.tsx +0 -28
- package/src/components/cleenIcon/icons/IconSpeedometer.tsx +0 -22
- package/src/components/cleenIcon/icons/IconStairsRound.tsx +0 -21
- package/src/components/cleenIcon/icons/IconStar.tsx +0 -22
- package/src/components/cleenIcon/icons/IconStarHalf.tsx +0 -39
- package/src/components/cleenIcon/icons/IconStars.tsx +0 -28
- package/src/components/cleenIcon/icons/IconStars2.tsx +0 -29
- package/src/components/cleenIcon/icons/IconStrikethrough.tsx +0 -16
- package/src/components/cleenIcon/icons/IconSuccessFeatured.tsx +0 -30
- package/src/components/cleenIcon/icons/IconSun.tsx +0 -22
- package/src/components/cleenIcon/icons/IconSwitchHorizontal.tsx +0 -22
- package/src/components/cleenIcon/icons/IconTag.tsx +0 -22
- package/src/components/cleenIcon/icons/IconTarget.tsx +0 -21
- package/src/components/cleenIcon/icons/IconTarget2.tsx +0 -34
- package/src/components/cleenIcon/icons/IconTextFormat.tsx +0 -17
- package/src/components/cleenIcon/icons/IconTextFormat2.tsx +0 -22
- package/src/components/cleenIcon/icons/IconTextHighlight.tsx +0 -16
- package/src/components/cleenIcon/icons/IconTranslate.tsx +0 -25
- package/src/components/cleenIcon/icons/IconTrash.tsx +0 -25
- package/src/components/cleenIcon/icons/IconTrending.tsx +0 -22
- package/src/components/cleenIcon/icons/IconUnderline.tsx +0 -16
- package/src/components/cleenIcon/icons/IconUndo.tsx +0 -22
- package/src/components/cleenIcon/icons/IconUndo2.tsx +0 -16
- package/src/components/cleenIcon/icons/IconUploadCloud.tsx +0 -22
- package/src/components/cleenIcon/icons/IconUser.tsx +0 -22
- package/src/components/cleenIcon/icons/IconUserEdit.tsx +0 -25
- package/src/components/cleenIcon/icons/IconUserRight.tsx +0 -22
- package/src/components/cleenIcon/icons/IconUserSquare.tsx +0 -25
- package/src/components/cleenIcon/icons/IconUsers.tsx +0 -25
- package/src/components/cleenIcon/icons/IconUsersUp.tsx +0 -25
- package/src/components/cleenIcon/icons/IconVolume.tsx +0 -25
- package/src/components/cleenIcon/icons/IconWrench.tsx +0 -22
- package/src/components/cleenIcon/icons/IconX.tsx +0 -25
- package/src/components/cleenIcon/icons/IconXCircle.tsx +0 -22
- package/src/components/cleenIcon/icons/IconXCircle2.tsx +0 -42
- package/src/components/cleenIcon/icons/IconXClose.tsx +0 -25
- package/src/components/cleenIcon/icons/IconXSquare.tsx +0 -22
- package/src/components/cleenIcon/icons/index.ts +0 -215
- package/src/components/cleenIcon/index.ts +0 -4
- package/src/components/cleenIcon/types/icon.ts +0 -226
- package/src/components/collapsible/Collapsible.tsx +0 -148
- package/src/components/collapsible/index.ts +0 -5
- package/src/components/creditCardInput/CreditCardInput.tsx +0 -236
- package/src/components/creditCardInput/index.ts +0 -2
- package/src/components/creditCardInput/types/card.ts +0 -13
- package/src/components/creditCardInput/types/props.ts +0 -44
- package/src/components/creditCardInput/util/format.ts +0 -102
- package/src/components/datePicker/DatePicker.tsx +0 -235
- package/src/components/datePicker/index.ts +0 -2
- package/src/components/datePicker/types/props.ts +0 -47
- package/src/components/datePicker/utils/date.ts +0 -40
- package/src/components/divider/Divider.tsx +0 -43
- package/src/components/divider/index.ts +0 -1
- package/src/components/drawer/Drawer.tsx +0 -222
- package/src/components/drawer/index.ts +0 -1
- package/src/components/dropdown/Dropdown.tsx +0 -224
- package/src/components/dropdown/index.ts +0 -1
- package/src/components/filterDrawer/FilterDrawer.tsx +0 -147
- package/src/components/filterDrawer/blocks/FilterDrawerFooter.tsx +0 -119
- package/src/components/filterDrawer/blocks/SaveFilterStep.tsx +0 -56
- package/src/components/filterDrawer/blocks/SavedFilterRow.tsx +0 -166
- package/src/components/filterDrawer/blocks/SavedFiltersDropdown.tsx +0 -142
- package/src/components/filterDrawer/constants/filter.ts +0 -4
- package/src/components/filterDrawer/constants/labels.ts +0 -52
- package/src/components/filterDrawer/constants/tab.ts +0 -7
- package/src/components/filterDrawer/context/context.ts +0 -28
- package/src/components/filterDrawer/context/provider.tsx +0 -50
- package/src/components/filterDrawer/index.ts +0 -7
- package/src/components/filterDrawer/types/filters.ts +0 -28
- package/src/components/filterDrawer/types/props.ts +0 -107
- package/src/components/filterDrawer/types/validation.ts +0 -6
- package/src/components/formGroup/FormGroup.tsx +0 -165
- package/src/components/formGroup/index.ts +0 -1
- package/src/components/groupSelector/GroupSelector.tsx +0 -729
- package/src/components/groupSelector/index.ts +0 -6
- package/src/components/index.ts +0 -44
- package/src/components/infoLabels/InfoLabels.tsx +0 -88
- package/src/components/infoLabels/index.ts +0 -1
- package/src/components/input/Input.tsx +0 -269
- package/src/components/input/index.ts +0 -1
- package/src/components/loader/Loader.tsx +0 -91
- package/src/components/loader/index.ts +0 -1
- package/src/components/lookup/Lookup.tsx +0 -433
- package/src/components/lookup/blocks/LookupOptionList.tsx +0 -130
- package/src/components/lookup/index.ts +0 -2
- package/src/components/lookup/types/lookup.ts +0 -97
- package/src/components/menu/Menu.tsx +0 -103
- package/src/components/menu/blocks/MenuContent.tsx +0 -105
- package/src/components/menu/blocks/MenuItem.tsx +0 -120
- package/src/components/menu/index.ts +0 -2
- package/src/components/menu/types/menu.ts +0 -30
- package/src/components/menu/types/menuItem.ts +0 -48
- package/src/components/modal/Modal.tsx +0 -191
- package/src/components/modal/index.ts +0 -1
- package/src/components/notification/Notification.tsx +0 -79
- package/src/components/notification/constant/notification.ts +0 -30
- package/src/components/notification/index.ts +0 -2
- package/src/components/notification/wrappers/CleenNotificationContainer.tsx +0 -9
- package/src/components/pagination/Pagination.tsx +0 -294
- package/src/components/pagination/blocks/PaginationGoToPage.tsx +0 -91
- package/src/components/pagination/blocks/PaginationPageSize.tsx +0 -145
- package/src/components/pagination/constants/labels.ts +0 -15
- package/src/components/pagination/index.ts +0 -9
- package/src/components/pillBadge/PillBadge.tsx +0 -130
- package/src/components/pillBadge/helper.ts +0 -11
- package/src/components/pillBadge/index.ts +0 -1
- package/src/components/pillBadge/variants.ts +0 -47
- package/src/components/popover/Popover.tsx +0 -108
- package/src/components/popover/index.ts +0 -2
- package/src/components/popover/types/popover.ts +0 -21
- package/src/components/progressBar/ProgressBar.tsx +0 -179
- package/src/components/progressBar/index.ts +0 -1
- package/src/components/progressCircle/ProgressCircle.tsx +0 -142
- package/src/components/progressCircle/index.ts +0 -1
- package/src/components/radioBoxGroup/RadioBoxGroup.tsx +0 -207
- package/src/components/radioBoxGroup/index.ts +0 -1
- package/src/components/radioButtonGroup/RadioButtonGroup.tsx +0 -208
- package/src/components/radioButtonGroup/blocks/RadioButton.tsx +0 -22
- package/src/components/radioButtonGroup/index.ts +0 -4
- package/src/components/radioButtonGroup/types/radioButton.ts +0 -10
- package/src/components/rangeSlider/RangeSlider.tsx +0 -366
- package/src/components/rangeSlider/index.ts +0 -1
- package/src/components/select/Select.tsx +0 -349
- package/src/components/select/blocks/SelectCustomMenuList.tsx +0 -70
- package/src/components/select/blocks/SelectNoOptionsMessage.tsx +0 -22
- package/src/components/select/blocks/SelectOption.tsx +0 -19
- package/src/components/select/blocks/SelectSingleValue.tsx +0 -28
- package/src/components/select/index.ts +0 -1
- package/src/components/sidebar/Sidebar.tsx +0 -210
- package/src/components/sidebar/SidebarItem.tsx +0 -88
- package/src/components/sidebar/drawerContainer/DrawerContainer.tsx +0 -36
- package/src/components/sidebar/drawerContainer/DrawerContentTitle.tsx +0 -165
- package/src/components/sidebar/drawerContainer/index.ts +0 -2
- package/src/components/sidebar/index.ts +0 -13
- package/src/components/sidebar/types.ts +0 -157
- package/src/components/skeletons/blocks/Skeleton.tsx +0 -72
- package/src/components/skeletons/blocks/SkeletonAvatar.tsx +0 -43
- package/src/components/skeletons/blocks/SkeletonBadge.tsx +0 -30
- package/src/components/skeletons/blocks/SkeletonBanner.tsx +0 -44
- package/src/components/skeletons/blocks/SkeletonButton.tsx +0 -31
- package/src/components/skeletons/blocks/SkeletonCard.tsx +0 -39
- package/src/components/skeletons/blocks/SkeletonCard2.tsx +0 -57
- package/src/components/skeletons/blocks/SkeletonCard3.tsx +0 -89
- package/src/components/skeletons/blocks/SkeletonCardStack.tsx +0 -22
- package/src/components/skeletons/blocks/SkeletonChart.tsx +0 -114
- package/src/components/skeletons/blocks/SkeletonContentCard.tsx +0 -75
- package/src/components/skeletons/blocks/SkeletonDataGrid.tsx +0 -73
- package/src/components/skeletons/blocks/SkeletonForm.tsx +0 -50
- package/src/components/skeletons/blocks/SkeletonImage.tsx +0 -45
- package/src/components/skeletons/blocks/SkeletonInfoCard.tsx +0 -130
- package/src/components/skeletons/blocks/SkeletonInput.tsx +0 -32
- package/src/components/skeletons/blocks/SkeletonList.tsx +0 -67
- package/src/components/skeletons/blocks/SkeletonParagraph.tsx +0 -52
- package/src/components/skeletons/blocks/SkeletonText.tsx +0 -22
- package/src/components/skeletons/blocks/SkeletonVideo.tsx +0 -71
- package/src/components/skeletons/blocks/SkeletonWidgetCard.tsx +0 -56
- package/src/components/skeletons/blocks/SkeletonWrapper.tsx +0 -140
- package/src/components/skeletons/index.ts +0 -24
- package/src/components/skeletons/styles/skeleton.ts +0 -2
- package/src/components/skeletons/types/skeleton.ts +0 -8
- package/src/components/slider/Slider.tsx +0 -298
- package/src/components/slider/index.ts +0 -1
- package/src/components/stepper/Stepper.tsx +0 -185
- package/src/components/stepper/index.ts +0 -1
- package/src/components/switch/Switch.tsx +0 -152
- package/src/components/switch/index.ts +0 -1
- package/src/components/tabs/Tabs.tsx +0 -140
- package/src/components/tabs/index.ts +0 -2
- package/src/components/tabs/types/tab.ts +0 -33
- package/src/components/tabs/variants.ts +0 -49
- package/src/components/textArea/TextArea.tsx +0 -244
- package/src/components/textArea/index.ts +0 -1
- package/src/components/tooltip/Tooltip.tsx +0 -200
- package/src/components/tooltip/index.ts +0 -1
- package/src/icons/IconFromLibrary.tsx +0 -13
- package/src/icons/getIconByName.ts +0 -81
- package/src/icons/index.ts +0 -16
- package/src/index.ts +0 -1
- package/tsconfig.json +0 -27
- package/tsup.config.ts +0 -23
|
@@ -1,246 +0,0 @@
|
|
|
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
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Checkbox, type CheckboxProps } from './Checkbox';
|
|
@@ -1,13 +0,0 @@
|
|
|
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;
|
|
@@ -1,163 +0,0 @@
|
|
|
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CheckboxGroup, type CheckboxGroupProps } from './CheckboxGroup';
|