@bitrise/bitkit-v2 0.3.475-beta.3014 → 0.3.476
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 +5 -6
- package/dist/atoms/DatePicker/DatePicker.js.map +1 -1
- package/dist/atoms/ImageCropper/ImageCropper.js.map +1 -1
- package/dist/components/BitkitActionMenu/BitkitActionMenu.js.map +1 -1
- package/dist/components/BitkitAvatar/BitkitAvatar.js.map +1 -1
- package/dist/components/BitkitButton/BitkitButton.js.map +1 -1
- package/dist/components/BitkitCalendar/BitkitCalendar.d.ts +0 -12
- package/dist/components/BitkitCalendar/BitkitCalendar.js +1 -7
- package/dist/components/BitkitCalendar/BitkitCalendar.js.map +1 -1
- package/dist/components/BitkitCalendar/components/CalendarContent.d.ts +1 -5
- package/dist/components/BitkitCalendar/components/CalendarContent.js +43 -60
- package/dist/components/BitkitCalendar/components/CalendarContent.js.map +1 -1
- package/dist/components/BitkitCalendar/components/CalendarMonth.d.ts +2 -4
- package/dist/components/BitkitCalendar/components/CalendarMonth.js +5 -15
- package/dist/components/BitkitCalendar/components/CalendarMonth.js.map +1 -1
- package/dist/components/BitkitCalendar/components/CalendarMonthSelect.d.ts +1 -2
- package/dist/components/BitkitCalendar/components/CalendarMonthSelect.js +2 -3
- package/dist/components/BitkitCalendar/components/CalendarMonthSelect.js.map +1 -1
- package/dist/components/BitkitCalendar/components/CalendarNextTrigger.d.ts +1 -3
- package/dist/components/BitkitCalendar/components/CalendarNextTrigger.js +3 -3
- package/dist/components/BitkitCalendar/components/CalendarNextTrigger.js.map +1 -1
- package/dist/components/BitkitCalendar/components/CalendarPrevTrigger.d.ts +1 -3
- package/dist/components/BitkitCalendar/components/CalendarPrevTrigger.js +3 -3
- package/dist/components/BitkitCalendar/components/CalendarPrevTrigger.js.map +1 -1
- package/dist/components/BitkitCalendar/components/CalendarSelect.d.ts +0 -1
- package/dist/components/BitkitCalendar/components/CalendarSelect.js +2 -4
- package/dist/components/BitkitCalendar/components/CalendarSelect.js.map +1 -1
- package/dist/components/BitkitCalendar/components/CalendarYearSelect.d.ts +1 -2
- package/dist/components/BitkitCalendar/components/CalendarYearSelect.js +2 -3
- package/dist/components/BitkitCalendar/components/CalendarYearSelect.js.map +1 -1
- package/dist/components/BitkitCollapsible/BitkitCollapsible.js.map +1 -1
- package/dist/components/BitkitColorButton/BitkitColorButton.js.map +1 -1
- package/dist/components/BitkitDatePicker/BitkitDatePicker.d.ts +0 -2
- package/dist/components/BitkitDatePicker/BitkitDatePicker.js +1 -2
- package/dist/components/BitkitDatePicker/BitkitDatePicker.js.map +1 -1
- package/dist/components/BitkitDialog/BitkitStepsDialog.js.map +1 -1
- package/dist/components/BitkitDialog/BitkitStepsDialogStep.js.map +1 -1
- package/dist/components/BitkitDialog/DialogBodyContext.js.map +1 -1
- package/dist/components/BitkitExpandableCard/BitkitExpandableCard.js.map +1 -1
- package/dist/components/BitkitFileInput/BitkitFileInput.js.map +1 -1
- package/dist/components/BitkitIconButton/BitkitIconButton.js.map +1 -1
- package/dist/components/BitkitLabeledData/BitkitLabeledData.js.map +1 -1
- package/dist/components/BitkitList/BitkitList.js.map +1 -1
- package/dist/components/BitkitMarkdown/BitkitMarkdown.js +1 -1
- package/dist/components/BitkitMarkdown/BitkitMarkdown.js.map +1 -1
- package/dist/components/BitkitMarkdownCard/BitkitMarkdownCard.js.map +1 -1
- package/dist/components/BitkitMultiselect/BitkitMultiselect.js.map +1 -1
- package/dist/components/BitkitNoteCard/BitkitNoteCard.js +1 -1
- package/dist/components/BitkitNoteCard/BitkitNoteCard.js.map +1 -1
- package/dist/components/BitkitOverflowContent/BitkitOverflowContent.js.map +1 -1
- package/dist/components/BitkitPageSidebar/BitkitPageSidebar.js.map +1 -1
- package/dist/components/BitkitPagination/BitkitPagination.js.map +1 -1
- package/dist/components/BitkitPaginationLoadMore/BitkitPaginationLoadMore.js.map +1 -1
- package/dist/components/BitkitPopover/BitkitPopover.js.map +1 -1
- package/dist/components/BitkitPromoBanner/BitkitPromoBanner.js.map +1 -1
- package/dist/components/BitkitSegmentedControl/BitkitSegmentedControl.js.map +1 -1
- package/dist/components/BitkitSelectMenu/BitkitSelectMenuAction.js.map +1 -1
- package/dist/components/BitkitSettingsCard/BitkitSettingsCard.js.map +1 -1
- package/dist/components/BitkitSplitButton/BitkitSplitButton.js.map +1 -1
- package/dist/components/BitkitStat/BitkitStat.js.map +1 -1
- package/dist/components/BitkitStepsCard/BitkitStepsCard.js.map +1 -1
- package/dist/components/BitkitTable/BitkitExpandableRow.js.map +1 -1
- package/dist/components/BitkitTable/BitkitRowActionsCell.js.map +1 -1
- package/dist/components/BitkitTable/BitkitSortableColumnHeader.js.map +1 -1
- package/dist/components/BitkitTabs/BitkitTabs.js.map +1 -1
- package/dist/components/BitkitToggletip/BitkitToggletip.js.map +1 -1
- package/dist/components/BitkitTour/BitkitTour.js.map +1 -1
- package/dist/components/BitkitTreeView/BitkitTreeView.js.map +1 -1
- package/dist/components/BitkitUISideNav/UISideNavLink.js.map +1 -1
- package/dist/components/common/NotificationContent.js.map +1 -1
- package/dist/components/index.d.ts +0 -6
- package/dist/icons/IconAbortCircle.js.map +1 -1
- package/dist/icons/IconAbortCircleFilled.js.map +1 -1
- package/dist/icons/IconAddons.js.map +1 -1
- package/dist/icons/IconAgent.js.map +1 -1
- package/dist/icons/IconAnchor.js.map +1 -1
- package/dist/icons/IconAndroid.js.map +1 -1
- package/dist/icons/IconApp.js.map +1 -1
- package/dist/icons/IconAppSettings.js.map +1 -1
- package/dist/icons/IconAppStore.js.map +1 -1
- package/dist/icons/IconAppStoreColor.js.map +1 -1
- package/dist/icons/IconApple.js.map +1 -1
- package/dist/icons/IconArchive.js.map +1 -1
- package/dist/icons/IconArchiveDelete.js.map +1 -1
- package/dist/icons/IconArchiveRestore.js.map +1 -1
- package/dist/icons/IconArrowBackAndDown.js.map +1 -1
- package/dist/icons/IconArrowBackAndUp.js.map +1 -1
- package/dist/icons/IconArrowDown.js.map +1 -1
- package/dist/icons/IconArrowForwardAndDown.js.map +1 -1
- package/dist/icons/IconArrowForwardAndUp.js.map +1 -1
- package/dist/icons/IconArrowLeft.js.map +1 -1
- package/dist/icons/IconArrowNortheast.js.map +1 -1
- package/dist/icons/IconArrowNorthwest.js.map +1 -1
- package/dist/icons/IconArrowRight.js.map +1 -1
- package/dist/icons/IconArrowUp.js.map +1 -1
- package/dist/icons/IconArrowsHorizontal.js.map +1 -1
- package/dist/icons/IconArrowsVertical.js.map +1 -1
- package/dist/icons/IconAutomation.js.map +1 -1
- package/dist/icons/IconAws.js.map +1 -1
- package/dist/icons/IconAwsColor.js.map +1 -1
- package/dist/icons/IconBadge3RdParty.js.map +1 -1
- package/dist/icons/IconBadgeBitrise.js.map +1 -1
- package/dist/icons/IconBadgeUpgrade.js.map +1 -1
- package/dist/icons/IconBadgeVersionOk.js.map +1 -1
- package/dist/icons/IconBazel.js.map +1 -1
- package/dist/icons/IconBell.js.map +1 -1
- package/dist/icons/IconBitbot.js.map +1 -1
- package/dist/icons/IconBitbotError.js.map +1 -1
- package/dist/icons/IconBitbucket.js.map +1 -1
- package/dist/icons/IconBitbucketColor.js.map +1 -1
- package/dist/icons/IconBitbucketNeutral.js.map +1 -1
- package/dist/icons/IconBitbucketWhite.js.map +1 -1
- package/dist/icons/IconBlockCircle.js.map +1 -1
- package/dist/icons/IconBook.js.map +1 -1
- package/dist/icons/IconBoxArrowDown.js.map +1 -1
- package/dist/icons/IconBoxDot.js.map +1 -1
- package/dist/icons/IconBoxLinesOverflow.js.map +1 -1
- package/dist/icons/IconBoxLinesWrap.js.map +1 -1
- package/dist/icons/IconBranch.js.map +1 -1
- package/dist/icons/IconBrowserstackColor.js.map +1 -1
- package/dist/icons/IconBug.js.map +1 -1
- package/dist/icons/IconBuild.js.map +1 -1
- package/dist/icons/IconBuildCache.js.map +1 -1
- package/dist/icons/IconBuildCacheFilled.js.map +1 -1
- package/dist/icons/IconBuildEnvSetup.js.map +1 -1
- package/dist/icons/IconBuildHub.js.map +1 -1
- package/dist/icons/IconBuildHubFilled.js.map +1 -1
- package/dist/icons/IconCalendar.js.map +1 -1
- package/dist/icons/IconChangePlan.js.map +1 -1
- package/dist/icons/IconChat.js.map +1 -1
- package/dist/icons/IconCheck.js.map +1 -1
- package/dist/icons/IconCheckCircle.js.map +1 -1
- package/dist/icons/IconCheckCircleFilled.js.map +1 -1
- package/dist/icons/IconChevronDown.js.map +1 -1
- package/dist/icons/IconChevronLeft.js.map +1 -1
- package/dist/icons/IconChevronRight.js.map +1 -1
- package/dist/icons/IconChevronUp.js.map +1 -1
- package/dist/icons/IconCi.js.map +1 -1
- package/dist/icons/IconCiFilled.js.map +1 -1
- package/dist/icons/IconCircle.js.map +1 -1
- package/dist/icons/IconCircleDashed.js.map +1 -1
- package/dist/icons/IconCircleHalfFilled.js.map +1 -1
- package/dist/icons/IconClaude.js.map +1 -1
- package/dist/icons/IconClaudeColor.js.map +1 -1
- package/dist/icons/IconClock.js.map +1 -1
- package/dist/icons/IconCode.js.map +1 -1
- package/dist/icons/IconCodePush.js.map +1 -1
- package/dist/icons/IconCodeSigning.js.map +1 -1
- package/dist/icons/IconCoffee.js.map +1 -1
- package/dist/icons/IconCommit.js.map +1 -1
- package/dist/icons/IconConfigure.js.map +1 -1
- package/dist/icons/IconConnectedAccounts.js.map +1 -1
- package/dist/icons/IconContainer.js.map +1 -1
- package/dist/icons/IconCopilot.js.map +1 -1
- package/dist/icons/IconCopy.js.map +1 -1
- package/dist/icons/IconCordova.js.map +1 -1
- package/dist/icons/IconCpu.js.map +1 -1
- package/dist/icons/IconCreditcard.js.map +1 -1
- package/dist/icons/IconCredits.js.map +1 -1
- package/dist/icons/IconCross.js.map +1 -1
- package/dist/icons/IconCrossCircle.js.map +1 -1
- package/dist/icons/IconCrossCircleFilled.js.map +1 -1
- package/dist/icons/IconCrown.js.map +1 -1
- package/dist/icons/IconCursor.js.map +1 -1
- package/dist/icons/IconCycle.js.map +1 -1
- package/dist/icons/IconDashboard.js.map +1 -1
- package/dist/icons/IconDashboardFilled.js.map +1 -1
- package/dist/icons/IconDeployment.js.map +1 -1
- package/dist/icons/IconDetails.js.map +1 -1
- package/dist/icons/IconDoc.js.map +1 -1
- package/dist/icons/IconDollar.js.map +1 -1
- package/dist/icons/IconDot.js.map +1 -1
- package/dist/icons/IconDotnet.js.map +1 -1
- package/dist/icons/IconDotnetColor.js.map +1 -1
- package/dist/icons/IconDotnetText.js.map +1 -1
- package/dist/icons/IconDotnetTextColor.js.map +1 -1
- package/dist/icons/IconDoubleCircle.js.map +1 -1
- package/dist/icons/IconDownload.js.map +1 -1
- package/dist/icons/IconDragHandle.js.map +1 -1
- package/dist/icons/IconEc2Ami.js.map +1 -1
- package/dist/icons/IconEnterprise.js.map +1 -1
- package/dist/icons/IconErrorCircle.js.map +1 -1
- package/dist/icons/IconErrorCircleFilled.js.map +1 -1
- package/dist/icons/IconExpand.js.map +1 -1
- package/dist/icons/IconExtraBuildCapacity.js.map +1 -1
- package/dist/icons/IconEye.js.map +1 -1
- package/dist/icons/IconEyeSlash.js.map +1 -1
- package/dist/icons/IconFastlane.js.map +1 -1
- package/dist/icons/IconFile.js.map +1 -1
- package/dist/icons/IconFileDoc.js.map +1 -1
- package/dist/icons/IconFilePdf.js.map +1 -1
- package/dist/icons/IconFilePlist.js.map +1 -1
- package/dist/icons/IconFileYml.js.map +1 -1
- package/dist/icons/IconFileZip.js.map +1 -1
- package/dist/icons/IconFilter.js.map +1 -1
- package/dist/icons/IconFlag.js.map +1 -1
- package/dist/icons/IconFlutter.js.map +1 -1
- package/dist/icons/IconFolder.js.map +1 -1
- package/dist/icons/IconFullscreen.js.map +1 -1
- package/dist/icons/IconFullscreenExit.js.map +1 -1
- package/dist/icons/IconGauge.js.map +1 -1
- package/dist/icons/IconGit.js.map +1 -1
- package/dist/icons/IconGithub.js.map +1 -1
- package/dist/icons/IconGitlab.js.map +1 -1
- package/dist/icons/IconGitlabColor.js.map +1 -1
- package/dist/icons/IconGitlabWhite.js.map +1 -1
- package/dist/icons/IconGlobe.js.map +1 -1
- package/dist/icons/IconGo.js.map +1 -1
- package/dist/icons/IconGoogleColor.js.map +1 -1
- package/dist/icons/IconGooglePlay.js.map +1 -1
- package/dist/icons/IconGooglePlayColor.js.map +1 -1
- package/dist/icons/IconGradle.js.map +1 -1
- package/dist/icons/IconGroup.js.map +1 -1
- package/dist/icons/IconHashtag.js.map +1 -1
- package/dist/icons/IconHeadset.js.map +1 -1
- package/dist/icons/IconHeart.js.map +1 -1
- package/dist/icons/IconHistory.js.map +1 -1
- package/dist/icons/IconHourglass.js.map +1 -1
- package/dist/icons/IconImage.js.map +1 -1
- package/dist/icons/IconInfoCircle.js.map +1 -1
- package/dist/icons/IconInfoCircleFilled.js.map +1 -1
- package/dist/icons/IconInsights.js.map +1 -1
- package/dist/icons/IconInsightsFilled.js.map +1 -1
- package/dist/icons/IconInstall.js.map +1 -1
- package/dist/icons/IconInteraction.js.map +1 -1
- package/dist/icons/IconInvoice.js.map +1 -1
- package/dist/icons/IconIonic.js.map +1 -1
- package/dist/icons/IconJapanese.js.map +1 -1
- package/dist/icons/IconJava.js.map +1 -1
- package/dist/icons/IconJavaColor.js.map +1 -1
- package/dist/icons/IconJavaDuke.js.map +1 -1
- package/dist/icons/IconJavaDukeColor.js.map +1 -1
- package/dist/icons/IconKey.js.map +1 -1
- package/dist/icons/IconKiroColor.js.map +1 -1
- package/dist/icons/IconKotlin.js.map +1 -1
- package/dist/icons/IconKotlinColor.js.map +1 -1
- package/dist/icons/IconKotlinWhite.js.map +1 -1
- package/dist/icons/IconLaptop.js.map +1 -1
- package/dist/icons/IconLaunchdarkly.js.map +1 -1
- package/dist/icons/IconLegacyApp.js.map +1 -1
- package/dist/icons/IconLightbulb.js.map +1 -1
- package/dist/icons/IconLink.js.map +1 -1
- package/dist/icons/IconLinux.js.map +1 -1
- package/dist/icons/IconLock.js.map +1 -1
- package/dist/icons/IconLockOpen.js.map +1 -1
- package/dist/icons/IconLogin.js.map +1 -1
- package/dist/icons/IconLogout.js.map +1 -1
- package/dist/icons/IconMacos.js.map +1 -1
- package/dist/icons/IconMagicWand.js.map +1 -1
- package/dist/icons/IconMagnifier.js.map +1 -1
- package/dist/icons/IconMail.js.map +1 -1
- package/dist/icons/IconMcp.js.map +1 -1
- package/dist/icons/IconMedal.js.map +1 -1
- package/dist/icons/IconMemory.js.map +1 -1
- package/dist/icons/IconMenuGrid.js.map +1 -1
- package/dist/icons/IconMenuHamburger.js.map +1 -1
- package/dist/icons/IconMessage.js.map +1 -1
- package/dist/icons/IconMessageAlert.js.map +1 -1
- package/dist/icons/IconMessageQuestion.js.map +1 -1
- package/dist/icons/IconMicrophone.js.map +1 -1
- package/dist/icons/IconMinus.js.map +1 -1
- package/dist/icons/IconMinusCircle.js.map +1 -1
- package/dist/icons/IconMinusCircleFilled.js.map +1 -1
- package/dist/icons/IconMobile.js.map +1 -1
- package/dist/icons/IconMobileLandscape.js.map +1 -1
- package/dist/icons/IconMonitorChart.js.map +1 -1
- package/dist/icons/IconMoreHorizontal.js.map +1 -1
- package/dist/icons/IconMoreVertical.js.map +1 -1
- package/dist/icons/IconNews.js.map +1 -1
- package/dist/icons/IconNextjs.js.map +1 -1
- package/dist/icons/IconNodejs.js.map +1 -1
- package/dist/icons/IconOpenInNew.js.map +1 -1
- package/dist/icons/IconOther.js.map +1 -1
- package/dist/icons/IconOutsideContributor.js.map +1 -1
- package/dist/icons/IconOverview.js.map +1 -1
- package/dist/icons/IconPause.js.map +1 -1
- package/dist/icons/IconPencil.js.map +1 -1
- package/dist/icons/IconPeople.js.map +1 -1
- package/dist/icons/IconPercent.js.map +1 -1
- package/dist/icons/IconPerson.js.map +1 -1
- package/dist/icons/IconPersonWithDesk.js.map +1 -1
- package/dist/icons/IconPin.js.map +1 -1
- package/dist/icons/IconPlay.js.map +1 -1
- package/dist/icons/IconPlus.js.map +1 -1
- package/dist/icons/IconPlusCircle.js.map +1 -1
- package/dist/icons/IconPlusCircleFilled.js.map +1 -1
- package/dist/icons/IconPower.js.map +1 -1
- package/dist/icons/IconProject.js.map +1 -1
- package/dist/icons/IconProjectSettings.js.map +1 -1
- package/dist/icons/IconPull.js.map +1 -1
- package/dist/icons/IconPush.js.map +1 -1
- package/dist/icons/IconPuzzle.js.map +1 -1
- package/dist/icons/IconPython.js.map +1 -1
- package/dist/icons/IconPythonColor.js.map +1 -1
- package/dist/icons/IconQuestionCircle.js.map +1 -1
- package/dist/icons/IconQuestionCircleFilled.js.map +1 -1
- package/dist/icons/IconReact.js.map +1 -1
- package/dist/icons/IconRefresh.js.map +1 -1
- package/dist/icons/IconRegex.js.map +1 -1
- package/dist/icons/IconRelease.js.map +1 -1
- package/dist/icons/IconReleaseFilled.js.map +1 -1
- package/dist/icons/IconRemoteAccess.js.map +1 -1
- package/dist/icons/IconReplace.js.map +1 -1
- package/dist/icons/IconResponsiveness.js.map +1 -1
- package/dist/icons/IconReviewerApproved.js.map +1 -1
- package/dist/icons/IconReviewerAssigned.js.map +1 -1
- package/dist/icons/IconReviewerRejected.js.map +1 -1
- package/dist/icons/IconRuby.js.map +1 -1
- package/dist/icons/IconRubyColor.js.map +1 -1
- package/dist/icons/IconSave.js.map +1 -1
- package/dist/icons/IconSecurityShield.js.map +1 -1
- package/dist/icons/IconSettings.js.map +1 -1
- package/dist/icons/IconSettingsFilled.js.map +1 -1
- package/dist/icons/IconShuffle.js.map +1 -1
- package/dist/icons/IconSiren.js.map +1 -1
- package/dist/icons/IconSkip.js.map +1 -1
- package/dist/icons/IconSkipCircle.js.map +1 -1
- package/dist/icons/IconSkipCircleFilled.js.map +1 -1
- package/dist/icons/IconSlack.js.map +1 -1
- package/dist/icons/IconSlackColor.js.map +1 -1
- package/dist/icons/IconSparkle.js.map +1 -1
- package/dist/icons/IconSparkleFilled.js.map +1 -1
- package/dist/icons/IconSpinnerOnDisabled.js.map +1 -1
- package/dist/icons/IconSpinnerPurple.js.map +1 -1
- package/dist/icons/IconSpinnerPurpleDouble.js.map +1 -1
- package/dist/icons/IconSpinnerWhite.js.map +1 -1
- package/dist/icons/IconStability.js.map +1 -1
- package/dist/icons/IconStack.js.map +1 -1
- package/dist/icons/IconStar.js.map +1 -1
- package/dist/icons/IconStep.js.map +1 -1
- package/dist/icons/IconStop.js.map +1 -1
- package/dist/icons/IconStopwatch.js.map +1 -1
- package/dist/icons/IconTabPlus.js.map +1 -1
- package/dist/icons/IconTag.js.map +1 -1
- package/dist/icons/IconTasks.js.map +1 -1
- package/dist/icons/IconTeams.js.map +1 -1
- package/dist/icons/IconTeamsColor.js.map +1 -1
- package/dist/icons/IconTemplateCode.js.map +1 -1
- package/dist/icons/IconTerminal.js.map +1 -1
- package/dist/icons/IconTerminalFilled.js.map +1 -1
- package/dist/icons/IconTestQuarantine.js.map +1 -1
- package/dist/icons/IconThemeDarkToggle.js.map +1 -1
- package/dist/icons/IconThumbDown.js.map +1 -1
- package/dist/icons/IconThumbUp.js.map +1 -1
- package/dist/icons/IconTools.js.map +1 -1
- package/dist/icons/IconTrash.js.map +1 -1
- package/dist/icons/IconTrigger.js.map +1 -1
- package/dist/icons/IconUbuntu.js.map +1 -1
- package/dist/icons/IconUbuntuColor.js.map +1 -1
- package/dist/icons/IconUnity3D.js.map +1 -1
- package/dist/icons/IconUnpin.js.map +1 -1
- package/dist/icons/IconUpload.js.map +1 -1
- package/dist/icons/IconValidateShield.js.map +1 -1
- package/dist/icons/IconVideo.js.map +1 -1
- package/dist/icons/IconVsCode.js.map +1 -1
- package/dist/icons/IconWarning.js.map +1 -1
- package/dist/icons/IconWarningYellow.js.map +1 -1
- package/dist/icons/IconWebUi.js.map +1 -1
- package/dist/icons/IconWebhooks.js.map +1 -1
- package/dist/icons/IconWindsurf.js.map +1 -1
- package/dist/icons/IconWorkflow.js.map +1 -1
- package/dist/icons/IconWorkflowFlow.js.map +1 -1
- package/dist/icons/IconXTwitter.js.map +1 -1
- package/dist/icons/IconXamarin.js.map +1 -1
- package/dist/icons/IconXcode.js.map +1 -1
- package/dist/main.js +7 -8
- package/dist/theme/recipes/Spinner.recipe.d.ts +4 -4
- package/dist/theme/recipes/Spinner.recipe.js +4 -4
- package/dist/theme/recipes/Spinner.recipe.js.map +1 -1
- package/dist/theme/recipes/index.d.ts +4 -4
- package/dist/theme/semantic-tokens/index.d.ts +5 -0
- package/dist/theme/semantic-tokens/semanticColors.d.ts +5 -0
- package/dist/theme/semantic-tokens/semanticColors.js +1 -0
- package/dist/theme/semantic-tokens/semanticColors.js.map +1 -1
- package/dist/theme/slot-recipes/Combobox.recipe.js.map +1 -1
- package/dist/theme/slot-recipes/DatePicker.recipe.d.ts +0 -15
- package/dist/theme/slot-recipes/DatePicker.recipe.js +22 -72
- package/dist/theme/slot-recipes/DatePicker.recipe.js.map +1 -1
- package/dist/theme/slot-recipes/DatePickerSelect.recipe.d.ts +0 -82
- package/dist/theme/slot-recipes/DatePickerSelect.recipe.js +10 -28
- package/dist/theme/slot-recipes/DatePickerSelect.recipe.js.map +1 -1
- package/dist/theme/slot-recipes/Menu.recipe.js +1 -6
- package/dist/theme/slot-recipes/Menu.recipe.js.map +1 -1
- package/dist/theme/slot-recipes/NoteCard.recipe.d.ts +1 -1
- package/dist/theme/slot-recipes/NoteCard.recipe.js +1 -1
- package/dist/theme/slot-recipes/NoteCard.recipe.js.map +1 -1
- package/dist/theme/slot-recipes/PageFooter.recipe.d.ts +5 -3
- package/dist/theme/slot-recipes/PageFooter.recipe.js +5 -3
- package/dist/theme/slot-recipes/PageFooter.recipe.js.map +1 -1
- package/dist/theme/slot-recipes/Tag.recipe.d.ts +1 -1
- package/dist/theme/slot-recipes/TextInput.recipe.js.map +1 -1
- package/dist/theme/slot-recipes/index.d.ts +7 -159
- package/dist/theme/slot-recipes/index.js +0 -4
- package/dist/theme/slot-recipes/index.js.map +1 -1
- package/dist/theme/tokens/sizes.js.map +1 -1
- package/dist/theme/tokens/spacing.js.map +1 -1
- package/dist/utilities/BitkitPortalContext.js +2 -3
- package/dist/utilities/BitkitPortalContext.js.map +1 -1
- package/docs/v1-to-v2-migration-guide.md +1 -48
- package/package.json +10 -12
- package/dist/components/BitkitFilter/BitkitFilter.context.d.ts +0 -65
- package/dist/components/BitkitFilter/BitkitFilter.context.js +0 -82
- package/dist/components/BitkitFilter/BitkitFilter.context.js.map +0 -1
- package/dist/components/BitkitFilter/BitkitFilter.d.ts +0 -55
- package/dist/components/BitkitFilter/BitkitFilter.js +0 -240
- package/dist/components/BitkitFilter/BitkitFilter.js.map +0 -1
- package/dist/components/BitkitFilter/BitkitFilter.utils.d.ts +0 -18
- package/dist/components/BitkitFilter/BitkitFilter.utils.js +0 -42
- package/dist/components/BitkitFilter/BitkitFilter.utils.js.map +0 -1
- package/dist/components/BitkitFilter/BitkitFilterAdd.d.ts +0 -18
- package/dist/components/BitkitFilter/BitkitFilterAdd.js +0 -188
- package/dist/components/BitkitFilter/BitkitFilterAdd.js.map +0 -1
- package/dist/components/BitkitFilter/BitkitFilterDateRange.d.ts +0 -26
- package/dist/components/BitkitFilter/BitkitFilterDateRange.js +0 -118
- package/dist/components/BitkitFilter/BitkitFilterDateRange.js.map +0 -1
- package/dist/components/BitkitFilter/BitkitFilterSearch.d.ts +0 -23
- package/dist/components/BitkitFilter/BitkitFilterSearch.js +0 -70
- package/dist/components/BitkitFilter/BitkitFilterSearch.js.map +0 -1
- package/dist/components/BitkitFilter/BitkitFilterSelect.d.ts +0 -61
- package/dist/components/BitkitFilter/BitkitFilterSelect.js +0 -140
- package/dist/components/BitkitFilter/BitkitFilterSelect.js.map +0 -1
- package/dist/components/BitkitFilter/BitkitFilterSwitch.d.ts +0 -28
- package/dist/components/BitkitFilter/BitkitFilterSwitch.js +0 -87
- package/dist/components/BitkitFilter/BitkitFilterSwitch.js.map +0 -1
- package/dist/components/BitkitFilter/components/FilterChip.d.ts +0 -23
- package/dist/components/BitkitFilter/components/FilterChip.js +0 -64
- package/dist/components/BitkitFilter/components/FilterChip.js.map +0 -1
- package/dist/components/BitkitFilter/components/FilterField.d.ts +0 -15
- package/dist/components/BitkitFilter/components/FilterField.js +0 -58
- package/dist/components/BitkitFilter/components/FilterField.js.map +0 -1
- package/dist/components/BitkitFilter/components/FilterPanel.d.ts +0 -42
- package/dist/components/BitkitFilter/components/FilterPanel.js +0 -126
- package/dist/components/BitkitFilter/components/FilterPanel.js.map +0 -1
- package/dist/components/BitkitFilter/components/FilterSearchInput.d.ts +0 -15
- package/dist/components/BitkitFilter/components/FilterSearchInput.js +0 -41
- package/dist/components/BitkitFilter/components/FilterSearchInput.js.map +0 -1
- package/dist/components/BitkitFilter/components/FilterSelectForm.d.ts +0 -41
- package/dist/components/BitkitFilter/components/FilterSelectForm.js +0 -307
- package/dist/components/BitkitFilter/components/FilterSelectForm.js.map +0 -1
- package/dist/theme/slot-recipes/Filter.recipe.d.ts +0 -37
- package/dist/theme/slot-recipes/Filter.recipe.js +0 -636
- package/dist/theme/slot-recipes/Filter.recipe.js.map +0 -1
- package/dist/theme/slot-recipes/Listbox.recipe.d.ts +0 -22
- package/dist/theme/slot-recipes/Listbox.recipe.js +0 -92
- package/dist/theme/slot-recipes/Listbox.recipe.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitPaginationLoadMore.js","names":[],"sources":["../../../lib/components/BitkitPaginationLoadMore/BitkitPaginationLoadMore.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { chakra, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef } from 'react';\n\nimport IconErrorCircleFilled from '../../icons/IconErrorCircleFilled';\nimport BitkitButton from '../BitkitButton/BitkitButton';\nimport BitkitInlineLoading from '../BitkitInlineLoading/BitkitInlineLoading';\nimport BitkitLinkButton from '../BitkitLinkButton/BitkitLinkButton';\n\nexport interface BitkitPaginationLoadMoreProps extends Omit<BoxProps, 'page' | 'size'> {\n loadError?: boolean;\n loadingMore?: boolean;\n onLoadMore: () => void;\n page: number;\n pageItemsCount: number;\n size?: 'md' | 'sm' | 'xs';\n totalCount: number;\n}\n\nconst BitkitPaginationLoadMore = forwardRef<HTMLDivElement, BitkitPaginationLoadMoreProps>((props, ref) => {\n const {\n css,\n loadError = false,\n loadingMore = false,\n onLoadMore,\n page,\n pageItemsCount,\n size = 'md',\n totalCount,\n ...rest\n } = props;\n\n const recipe = useSlotRecipe({ key: 'paginationLoadMore' });\n const styles = recipe({ size });\n\n const clampedPage = Math.max(1, page);\n const clampedPageItemsCount = Math.max(1, pageItemsCount);\n const shownCount = Math.min(clampedPage * clampedPageItemsCount, totalCount);\n const isComplete = shownCount >= totalCount;\n const loadMoreCount = Math.min(clampedPageItemsCount, totalCount - shownCount);\n\n // Follows the counter's textStyle, not the size name: sm uses body/md/regular too.\n const inlineLoadingSize = size === 'xs' ? 'sm' : 'md';\n\n return (\n <Box css={[styles.root, css]} ref={ref} {...rest}>\n <chakra.span css={styles.counter}>\n Showing {shownCount} of {totalCount}\n </chakra.span>\n {!isComplete && (\n <>\n {loadingMore ? (\n <BitkitInlineLoading color=\"text/tertiary\" label=\"Loading more...\" size={inlineLoadingSize} />\n ) : size === 'xs' ? (\n <BitkitLinkButton onClick={onLoadMore} size=\"sm\">\n {`Load ${loadMoreCount} more`}\n </BitkitLinkButton>\n ) : (\n <BitkitButton onClick={onLoadMore} size={size === 'md' ? 'md' : 'sm'} variant=\"tertiary\">\n {`Load ${loadMoreCount} more`}\n </BitkitButton>\n )}\n {/* A retry can report both states at once — the spinner replaces the stale error. */}\n {loadError && !loadingMore && (\n <Box css={styles.error} role=\"alert\">\n <IconErrorCircleFilled color=\"icon/negative\" size=\"16\" />\n <Text as=\"span\">Failed to load items.</Text>\n </Box>\n )}\n </>\n )}\n </Box>\n );\n});\n\nBitkitPaginationLoadMore.displayName = 'BitkitPaginationLoadMore';\n\nexport default BitkitPaginationLoadMore;\n"],"mappings":";;;;;;;;;;AAoBA,IAAM,2BAA2B,YAA2D,OAAO,QAAQ;CACzG,MAAM,EACJ,KACA,YAAY,OACZ,cAAc,OACd,YACA,MACA,gBACA,OAAO,MACP,YACA,GAAG,SACD;CAGJ,MAAM,SADS,cAAc,EAAE,KAAK,qBAAqB,CAC1C,CAAA,CAAO,EAAE,KAAK,CAAC;CAE9B,MAAM,cAAc,KAAK,IAAI,GAAG,IAAI;CACpC,MAAM,wBAAwB,KAAK,IAAI,GAAG,cAAc;CACxD,MAAM,aAAa,KAAK,IAAI,cAAc,uBAAuB,UAAU;CAC3E,MAAM,aAAa,cAAc;CACjC,MAAM,gBAAgB,KAAK,IAAI,uBAAuB,aAAa,UAAU;CAG7E,MAAM,oBAAoB,SAAS,OAAO,OAAO;CAEjD,OACE,qBAAC,KAAD;EAAK,KAAK,CAAC,OAAO,MAAM,GAAG;EAAQ;EAAK,GAAI;EAA5C,UAAA,CACE,qBAAC,OAAO,MAAR;GAAa,KAAK,OAAO;GAAzB,UAAA;IAAkC;IACvB;IAAW;IAAK;GACd;EACZ,CAAA,GAAA,CAAC,cACA,
|
|
1
|
+
{"version":3,"file":"BitkitPaginationLoadMore.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitPaginationLoadMore/BitkitPaginationLoadMore.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { chakra, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef } from 'react';\n\nimport IconErrorCircleFilled from '../../icons/IconErrorCircleFilled';\nimport BitkitButton from '../BitkitButton/BitkitButton';\nimport BitkitInlineLoading from '../BitkitInlineLoading/BitkitInlineLoading';\nimport BitkitLinkButton from '../BitkitLinkButton/BitkitLinkButton';\n\nexport interface BitkitPaginationLoadMoreProps extends Omit<BoxProps, 'page' | 'size'> {\n loadError?: boolean;\n loadingMore?: boolean;\n onLoadMore: () => void;\n page: number;\n pageItemsCount: number;\n size?: 'md' | 'sm' | 'xs';\n totalCount: number;\n}\n\nconst BitkitPaginationLoadMore = forwardRef<HTMLDivElement, BitkitPaginationLoadMoreProps>((props, ref) => {\n const {\n css,\n loadError = false,\n loadingMore = false,\n onLoadMore,\n page,\n pageItemsCount,\n size = 'md',\n totalCount,\n ...rest\n } = props;\n\n const recipe = useSlotRecipe({ key: 'paginationLoadMore' });\n const styles = recipe({ size });\n\n const clampedPage = Math.max(1, page);\n const clampedPageItemsCount = Math.max(1, pageItemsCount);\n const shownCount = Math.min(clampedPage * clampedPageItemsCount, totalCount);\n const isComplete = shownCount >= totalCount;\n const loadMoreCount = Math.min(clampedPageItemsCount, totalCount - shownCount);\n\n // Follows the counter's textStyle, not the size name: sm uses body/md/regular too.\n const inlineLoadingSize = size === 'xs' ? 'sm' : 'md';\n\n return (\n <Box css={[styles.root, css]} ref={ref} {...rest}>\n <chakra.span css={styles.counter}>\n Showing {shownCount} of {totalCount}\n </chakra.span>\n {!isComplete && (\n <>\n {loadingMore ? (\n <BitkitInlineLoading color=\"text/tertiary\" label=\"Loading more...\" size={inlineLoadingSize} />\n ) : size === 'xs' ? (\n <BitkitLinkButton onClick={onLoadMore} size=\"sm\">\n {`Load ${loadMoreCount} more`}\n </BitkitLinkButton>\n ) : (\n <BitkitButton onClick={onLoadMore} size={size === 'md' ? 'md' : 'sm'} variant=\"tertiary\">\n {`Load ${loadMoreCount} more`}\n </BitkitButton>\n )}\n {/* A retry can report both states at once — the spinner replaces the stale error. */}\n {loadError && !loadingMore && (\n <Box css={styles.error} role=\"alert\">\n <IconErrorCircleFilled color=\"icon/negative\" size=\"16\" />\n <Text as=\"span\">Failed to load items.</Text>\n </Box>\n )}\n </>\n )}\n </Box>\n );\n});\n\nBitkitPaginationLoadMore.displayName = 'BitkitPaginationLoadMore';\n\nexport default BitkitPaginationLoadMore;\n"],"mappings":";;;;;;;;;;AAoBA,IAAM,2BAA2B,YAA2D,OAAO,QAAQ;CACzG,MAAM,EACJ,KACA,YAAY,OACZ,cAAc,OACd,YACA,MACA,gBACA,OAAO,MACP,YACA,GAAG,SACD;CAGJ,MAAM,SADS,cAAc,EAAE,KAAK,qBAAqB,CAC1C,CAAA,CAAO,EAAE,KAAK,CAAC;CAE9B,MAAM,cAAc,KAAK,IAAI,GAAG,IAAI;CACpC,MAAM,wBAAwB,KAAK,IAAI,GAAG,cAAc;CACxD,MAAM,aAAa,KAAK,IAAI,cAAc,uBAAuB,UAAU;CAC3E,MAAM,aAAa,cAAc;CACjC,MAAM,gBAAgB,KAAK,IAAI,uBAAuB,aAAa,UAAU;CAG7E,MAAM,oBAAoB,SAAS,OAAO,OAAO;CAEjD,OACE,qBAAC,KAAD;EAAK,KAAK,CAAC,OAAO,MAAM,GAAG;EAAQ;EAAK,GAAI;EAA5C,UAAA,CACE,qBAAC,OAAO,MAAR;GAAa,KAAK,OAAO;GAAzB,UAAA;IAAkC;IACvB;IAAW;IAAK;GACd;EACZ,CAAA,GAAA,CAAC,cACA,qBAAAA,YAAA,EAAA,UAAA,CACG,cACC,oBAAC,qBAAD;GAAqB,OAAM;GAAgB,OAAM;GAAkB,MAAM;EAAoB,CAAA,IAC3F,SAAS,OACX,oBAAC,kBAAD;GAAkB,SAAS;GAAY,MAAK;GACzC,UAAA,QAAQ,cAAc;EACP,CAAA,IAElB,oBAAC,cAAD;GAAc,SAAS;GAAY,MAAM,SAAS,OAAO,OAAO;GAAM,SAAQ;GAC3E,UAAA,QAAQ,cAAc;EACX,CAAA,GAGf,aAAa,CAAC,eACb,qBAAC,KAAD;GAAK,KAAK,OAAO;GAAO,MAAK;GAA7B,UAAA,CACE,oBAAC,uBAAD;IAAuB,OAAM;IAAgB,MAAK;GAAM,CAAA,GACxD,oBAAC,MAAD;IAAM,IAAG;IAAO,UAAA;GAA2B,CAAA,CACxC;EAEP,CAAA,CAAA,EAAA,CAAA,CAED;;AAET,CAAC;AAED,yBAAyB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitPopover.js","names":[],"sources":["../../../lib/components/BitkitPopover/BitkitPopover.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Popover, type PopoverRootProps, usePopoverContext, usePopoverStyles } from '@chakra-ui/react/popover';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { chakra } from '@chakra-ui/react/styled-system';\nimport { type ReactNode, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { IconArrowDown } from '../../icons';\nimport BitkitCloseButton from '../BitkitCloseButton/BitkitCloseButton';\n\nexport interface BitkitPopoverProps {\n /** Body content of the panel. Scrolls within the panel when it overflows. */\n children: ReactNode;\n /** Header title, shown next to the close button. */\n title: ReactNode;\n /** Optional footer content (e.g. actions). Laid out with space between for a secondary/primary pair. */\n footer?: ReactNode;\n /**\n * Element that toggles and anchors the popover. Omit when anchoring via\n * `positioning.getAnchorElement` (e.g. a trigger that can't be wrapped) and controlling `open`.\n */\n trigger?: ReactNode;\n /**\n * Move focus into the panel when it opens (default `true`). Turn it off for a panel that opens\n * while the user is typing elsewhere, such as hints beside a focused input.\n */\n autoFocus?: PopoverRootProps['autoFocus'];\n open?: PopoverRootProps['open'];\n defaultOpen?: PopoverRootProps['defaultOpen'];\n onOpenChange?: (open: boolean) => void;\n positioning?: PopoverRootProps['positioning'];\n persistentElements?: PopoverRootProps['persistentElements'];\n}\n\n/**\n * Scrolls the body and shows a scroll-to-bottom button with a fade gradient while the content\n * isn't scrolled to the bottom — mirrors the BitkitDialog scrollable-body behaviour.\n */\nconst ScrollablePopoverBody = ({ children }: { children: ReactNode }) => {\n const styles = usePopoverStyles();\n const { open } = usePopoverContext();\n const contentRef = useRef<HTMLDivElement>(null);\n const [isScrollButtonVisible, setIsScrollButtonVisible] = useState(false);\n\n const updateScrollButtonVisibility = useCallback(() => {\n const content = contentRef.current;\n if (!content) {\n setIsScrollButtonVisible(false);\n return;\n }\n const didScrollToBottom = content.scrollTop >= content.scrollHeight - content.offsetHeight - 1;\n setIsScrollButtonVisible(!didScrollToBottom);\n }, []);\n\n useEffect(() => {\n const content = contentRef.current;\n if (!open || !content) return undefined;\n\n content.addEventListener('scroll', updateScrollButtonVisibility);\n const resizeObserver = new ResizeObserver(updateScrollButtonVisibility);\n resizeObserver.observe(content);\n\n return () => {\n content.removeEventListener('scroll', updateScrollButtonVisibility);\n resizeObserver.disconnect();\n };\n }, [open, updateScrollButtonVisibility]);\n\n return (\n <Box css={styles.scrollBody}>\n <Popover.Body ref={contentRef}>{children}</Popover.Body>\n {isScrollButtonVisible && (\n <>\n <Box css={styles.scrollGradient} />\n <chakra.button\n aria-label=\"Scroll to bottom\"\n css={styles.scrollButton}\n type=\"button\"\n onClick={() => {\n contentRef.current?.scrollTo({ top: contentRef.current.scrollHeight, behavior: 'smooth' });\n }}\n >\n <IconArrowDown color=\"icon/tertiary\" size=\"16\" />\n </chakra.button>\n </>\n )}\n </Box>\n );\n};\n\n/**\n * An anchored, non-modal floating panel built on Chakra Popover, styled as a compact dialog:\n * a header (title + close button), a scrollable body, and an optional footer. Anchor it with a\n * `trigger`, or — when the trigger can't be wrapped — control `open` and pass\n * `positioning.getAnchorElement`.\n */\nconst BitkitPopover = ({\n children,\n title,\n footer,\n trigger,\n autoFocus,\n open,\n defaultOpen,\n onOpenChange,\n positioning,\n persistentElements,\n}: BitkitPopoverProps) => (\n <Popover.Root\n autoFocus={autoFocus}\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange ? ({ open: isOpen }) => onOpenChange(isOpen) : undefined}\n positioning={{ placement: 'bottom-start', gutter: 4, ...positioning }}\n persistentElements={persistentElements}\n >\n {trigger ? <Popover.Trigger asChild>{trigger}</Popover.Trigger> : null}\n <Portal>\n {/* z-index belongs on Content, not Positioner: Zag derives the positioner's inline z-index\n from Content's computed z-index, so a value set on Positioner is ignored. */}\n <Popover.Positioner>\n <Popover.Content>\n <Popover.Header>\n <Popover.Title>{title}</Popover.Title>\n <Popover.CloseTrigger asChild>\n <BitkitCloseButton aria-label=\"Close\" />\n </Popover.CloseTrigger>\n </Popover.Header>\n <ScrollablePopoverBody>{children}</ScrollablePopoverBody>\n {footer ? <Popover.Footer>{footer}</Popover.Footer> : null}\n </Popover.Content>\n </Popover.Positioner>\n </Portal>\n </Popover.Root>\n);\n\nBitkitPopover.displayName = 'BitkitPopover';\n\nexport default BitkitPopover;\n"],"mappings":";;;;;;;;;;;;;AAqCA,IAAM,yBAAyB,EAAE,eAAwC;CACvE,MAAM,SAAS,iBAAiB;CAChC,MAAM,EAAE,SAAS,kBAAkB;CACnC,MAAM,aAAa,OAAuB,IAAI;CAC9C,MAAM,CAAC,uBAAuB,4BAA4B,SAAS,KAAK;CAExE,MAAM,+BAA+B,kBAAkB;EACrD,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;GACZ,yBAAyB,KAAK;GAC9B;EACF;EACA,MAAM,oBAAoB,QAAQ,aAAa,QAAQ,eAAe,QAAQ,eAAe;EAC7F,yBAAyB,CAAC,iBAAiB;CAC7C,GAAG,CAAC,CAAC;CAEL,gBAAgB;EACd,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,QAAQ,CAAC,SAAS,OAAO,KAAA;EAE9B,QAAQ,iBAAiB,UAAU,4BAA4B;EAC/D,MAAM,iBAAiB,IAAI,eAAe,4BAA4B;EACtE,eAAe,QAAQ,OAAO;EAE9B,aAAa;GACX,QAAQ,oBAAoB,UAAU,4BAA4B;GAClE,eAAe,WAAW;EAC5B;CACF,GAAG,CAAC,MAAM,4BAA4B,CAAC;CAEvC,OACE,qBAAC,KAAD;EAAK,KAAK,OAAO;EAAjB,UAAA,CACE,oBAAC,QAAQ,MAAT;GAAc,KAAK;GAAa;EAAuB,CAAA,GACtD,yBACC,
|
|
1
|
+
{"version":3,"file":"BitkitPopover.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitPopover/BitkitPopover.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Popover, type PopoverRootProps, usePopoverContext, usePopoverStyles } from '@chakra-ui/react/popover';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { chakra } from '@chakra-ui/react/styled-system';\nimport { type ReactNode, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { IconArrowDown } from '../../icons';\nimport BitkitCloseButton from '../BitkitCloseButton/BitkitCloseButton';\n\nexport interface BitkitPopoverProps {\n /** Body content of the panel. Scrolls within the panel when it overflows. */\n children: ReactNode;\n /** Header title, shown next to the close button. */\n title: ReactNode;\n /** Optional footer content (e.g. actions). Laid out with space between for a secondary/primary pair. */\n footer?: ReactNode;\n /**\n * Element that toggles and anchors the popover. Omit when anchoring via\n * `positioning.getAnchorElement` (e.g. a trigger that can't be wrapped) and controlling `open`.\n */\n trigger?: ReactNode;\n /**\n * Move focus into the panel when it opens (default `true`). Turn it off for a panel that opens\n * while the user is typing elsewhere, such as hints beside a focused input.\n */\n autoFocus?: PopoverRootProps['autoFocus'];\n open?: PopoverRootProps['open'];\n defaultOpen?: PopoverRootProps['defaultOpen'];\n onOpenChange?: (open: boolean) => void;\n positioning?: PopoverRootProps['positioning'];\n persistentElements?: PopoverRootProps['persistentElements'];\n}\n\n/**\n * Scrolls the body and shows a scroll-to-bottom button with a fade gradient while the content\n * isn't scrolled to the bottom — mirrors the BitkitDialog scrollable-body behaviour.\n */\nconst ScrollablePopoverBody = ({ children }: { children: ReactNode }) => {\n const styles = usePopoverStyles();\n const { open } = usePopoverContext();\n const contentRef = useRef<HTMLDivElement>(null);\n const [isScrollButtonVisible, setIsScrollButtonVisible] = useState(false);\n\n const updateScrollButtonVisibility = useCallback(() => {\n const content = contentRef.current;\n if (!content) {\n setIsScrollButtonVisible(false);\n return;\n }\n const didScrollToBottom = content.scrollTop >= content.scrollHeight - content.offsetHeight - 1;\n setIsScrollButtonVisible(!didScrollToBottom);\n }, []);\n\n useEffect(() => {\n const content = contentRef.current;\n if (!open || !content) return undefined;\n\n content.addEventListener('scroll', updateScrollButtonVisibility);\n const resizeObserver = new ResizeObserver(updateScrollButtonVisibility);\n resizeObserver.observe(content);\n\n return () => {\n content.removeEventListener('scroll', updateScrollButtonVisibility);\n resizeObserver.disconnect();\n };\n }, [open, updateScrollButtonVisibility]);\n\n return (\n <Box css={styles.scrollBody}>\n <Popover.Body ref={contentRef}>{children}</Popover.Body>\n {isScrollButtonVisible && (\n <>\n <Box css={styles.scrollGradient} />\n <chakra.button\n aria-label=\"Scroll to bottom\"\n css={styles.scrollButton}\n type=\"button\"\n onClick={() => {\n contentRef.current?.scrollTo({ top: contentRef.current.scrollHeight, behavior: 'smooth' });\n }}\n >\n <IconArrowDown color=\"icon/tertiary\" size=\"16\" />\n </chakra.button>\n </>\n )}\n </Box>\n );\n};\n\n/**\n * An anchored, non-modal floating panel built on Chakra Popover, styled as a compact dialog:\n * a header (title + close button), a scrollable body, and an optional footer. Anchor it with a\n * `trigger`, or — when the trigger can't be wrapped — control `open` and pass\n * `positioning.getAnchorElement`.\n */\nconst BitkitPopover = ({\n children,\n title,\n footer,\n trigger,\n autoFocus,\n open,\n defaultOpen,\n onOpenChange,\n positioning,\n persistentElements,\n}: BitkitPopoverProps) => (\n <Popover.Root\n autoFocus={autoFocus}\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange ? ({ open: isOpen }) => onOpenChange(isOpen) : undefined}\n positioning={{ placement: 'bottom-start', gutter: 4, ...positioning }}\n persistentElements={persistentElements}\n >\n {trigger ? <Popover.Trigger asChild>{trigger}</Popover.Trigger> : null}\n <Portal>\n {/* z-index belongs on Content, not Positioner: Zag derives the positioner's inline z-index\n from Content's computed z-index, so a value set on Positioner is ignored. */}\n <Popover.Positioner>\n <Popover.Content>\n <Popover.Header>\n <Popover.Title>{title}</Popover.Title>\n <Popover.CloseTrigger asChild>\n <BitkitCloseButton aria-label=\"Close\" />\n </Popover.CloseTrigger>\n </Popover.Header>\n <ScrollablePopoverBody>{children}</ScrollablePopoverBody>\n {footer ? <Popover.Footer>{footer}</Popover.Footer> : null}\n </Popover.Content>\n </Popover.Positioner>\n </Portal>\n </Popover.Root>\n);\n\nBitkitPopover.displayName = 'BitkitPopover';\n\nexport default BitkitPopover;\n"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ACA,WACA,MACA,aACA,cACA,aACA,yBAEA,qBAAC,QAAQ,MAAT;CACa;CACL;CACO;CACb,cAAc,gBAAgB,EAAE,MAAM,aAAa,aAAa,MAAM,IAAI,KAAA;CAC1E,aAAa;EAAE,WAAW;EAAgB,QAAQ;EAAG,GAAG;CAAY;CAChD;CANtB,UAAA,CAQG,UAAU,oBAAC,QAAQ,SAAT;EAAiB,SAAA;EAAS,UAAA;CAAyB,CAAA,IAAI,MAClE,oBAAC,QAAD,EAAA,UAGE,oBAAC,QAAQ,YAAT,EAAA,UACE,qBAAC,QAAQ,SAAT,EAAA,UAAA;EACE,qBAAC,QAAQ,QAAT,EAAA,UAAA,CACE,oBAAC,QAAQ,OAAT,EAAA,UAAgB,MAAqB,CAAA,GACrC,oBAAC,QAAQ,cAAT;GAAsB,SAAA;GACpB,UAAA,oBAAC,mBAAD,EAAmB,cAAW,QAAS,CAAA;EACnB,CAAA,CACR,EAAA,CAAA;EAChB,oBAAC,uBAAD,EAAwB,SAAgC,CAAA;EACvD,SAAS,oBAAC,QAAQ,QAAT,EAAA,UAAiB,OAAuB,CAAA,IAAI;CACvC,EAAA,CAAA,EACC,CAAA,EACd,CAAA,CACI;;AAGhB,cAAc,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitPromoBanner.js","names":[],"sources":["../../../lib/components/BitkitPromoBanner/BitkitPromoBanner.tsx"],"sourcesContent":["import { Alert, type AlertRootProps } from '@chakra-ui/react/alert';\nimport { Box } from '@chakra-ui/react/box';\nimport { Icon } from '@chakra-ui/react/icon';\nimport { type ReactNode } from 'react';\n\nimport { rem } from '../../theme/themeUtils';\nimport { NotificationContent } from '../common/NotificationContent';\nimport { BUTTON_COLORS_MAP, type NotificationAction } from '../common/notificationMaps';\nimport MascotSvg from './mascot.svg?react';\n\nexport type PromoBannerAction = NotificationAction;\n\nconst PROMO_BANNER_COLOR = BUTTON_COLORS_MAP.info;\n\nexport interface BitkitPromoBannerProps extends Omit<AlertRootProps, 'title' | 'variant'> {\n actionable?: PromoBannerAction;\n dismissible?: boolean;\n /** Custom leading illustration. Defaults to the built-in mascot. */\n illustration?: ReactNode;\n message: ReactNode;\n onClose?: () => void;\n title: ReactNode;\n}\n\nconst BitkitPromoBanner = (props: BitkitPromoBannerProps) => {\n const { actionable, css, dismissible, illustration, message, onClose, title, ...rest } = props;\n\n return (\n <Alert.Root\n {...rest}\n variant=\"info\"\n border=\"none\"\n position=\"relative\"\n flexDirection={{ base: 'column', tablet: 'row' }}\n alignItems={{ base: 'stretch', tablet: 'center' }}\n rowGap={{ base: '16', tablet: '0' }}\n paddingBlockEnd={{ base: actionable ? '20' : '16', tablet: rem(11) }}\n css={[{ '& .alert__title + *': { marginBlockStart: 0 } }, css]}\n >\n {illustration ? (\n <Box flexShrink={0} marginInlineEnd={{ base: '0', tablet: '12' }} aria-hidden>\n {illustration}\n </Box>\n ) : (\n <Icon\n asChild\n width={rem(72)}\n height={rem(68)}\n flexShrink={0}\n marginInlineEnd={{ base: '0', tablet: '12' }}\n marginBlock={{ base: '0', tablet: rem(-11) }}\n marginInlineStart={{ base: '0', tablet: rem(-12) }}\n >\n <MascotSvg />\n </Icon>\n )}\n <NotificationContent\n action={actionable}\n colorVariant={PROMO_BANNER_COLOR}\n dismissible={dismissible}\n messageText={message}\n onClose={onClose}\n stackable\n titleText={title}\n />\n </Alert.Root>\n );\n};\n\nBitkitPromoBanner.displayName = 'BitkitPromoBanner';\n\nexport default BitkitPromoBanner;\n"],"mappings":";;;;;;;;;AAYA,IAAM,qBAAqB,kBAAkB;AAY7C,IAAM,qBAAqB,UAAkC;CAC3D,MAAM,EAAE,YAAY,KAAK,aAAa,cAAc,SAAS,SAAS,OAAO,GAAG,SAAS;CAEzF,OACE,qBAAC,MAAM,MAAP;EACE,GAAI;EACJ,SAAQ;EACR,QAAO;EACP,UAAS;EACT,eAAe;GAAE,MAAM;GAAU,QAAQ;EAAM;EAC/C,YAAY;GAAE,MAAM;GAAW,QAAQ;EAAS;EAChD,QAAQ;GAAE,MAAM;GAAM,QAAQ;EAAI;EAClC,iBAAiB;GAAE,MAAM,aAAa,OAAO;GAAM,QAAQ,IAAI,EAAE;EAAE;EACnE,KAAK,CAAC,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,EAAE,GAAG,GAAG;EAT/D,UAAA,CAWG,eACC,oBAAC,KAAD;GAAK,YAAY;GAAG,iBAAiB;IAAE,MAAM;IAAK,QAAQ;GAAK;GAAG,eAAA;GAC/D,UAAA;EACE,CAAA,IAEL,oBAAC,MAAD;GACE,SAAA;GACA,OAAO,IAAI,EAAE;GACb,QAAQ,IAAI,EAAE;GACd,YAAY;GACZ,iBAAiB;IAAE,MAAM;IAAK,QAAQ;GAAK;GAC3C,aAAa;IAAE,MAAM;IAAK,QAAQ,IAAI,GAAG;GAAE;GAC3C,mBAAmB;IAAE,MAAM;IAAK,QAAQ,IAAI,GAAG;GAAE;GAEjD,UAAA,
|
|
1
|
+
{"version":3,"file":"BitkitPromoBanner.js","names":["MascotSvg"],"sources":["../../../lib/components/BitkitPromoBanner/BitkitPromoBanner.tsx"],"sourcesContent":["import { Alert, type AlertRootProps } from '@chakra-ui/react/alert';\nimport { Box } from '@chakra-ui/react/box';\nimport { Icon } from '@chakra-ui/react/icon';\nimport { type ReactNode } from 'react';\n\nimport { rem } from '../../theme/themeUtils';\nimport { NotificationContent } from '../common/NotificationContent';\nimport { BUTTON_COLORS_MAP, type NotificationAction } from '../common/notificationMaps';\nimport MascotSvg from './mascot.svg?react';\n\nexport type PromoBannerAction = NotificationAction;\n\nconst PROMO_BANNER_COLOR = BUTTON_COLORS_MAP.info;\n\nexport interface BitkitPromoBannerProps extends Omit<AlertRootProps, 'title' | 'variant'> {\n actionable?: PromoBannerAction;\n dismissible?: boolean;\n /** Custom leading illustration. Defaults to the built-in mascot. */\n illustration?: ReactNode;\n message: ReactNode;\n onClose?: () => void;\n title: ReactNode;\n}\n\nconst BitkitPromoBanner = (props: BitkitPromoBannerProps) => {\n const { actionable, css, dismissible, illustration, message, onClose, title, ...rest } = props;\n\n return (\n <Alert.Root\n {...rest}\n variant=\"info\"\n border=\"none\"\n position=\"relative\"\n flexDirection={{ base: 'column', tablet: 'row' }}\n alignItems={{ base: 'stretch', tablet: 'center' }}\n rowGap={{ base: '16', tablet: '0' }}\n paddingBlockEnd={{ base: actionable ? '20' : '16', tablet: rem(11) }}\n css={[{ '& .alert__title + *': { marginBlockStart: 0 } }, css]}\n >\n {illustration ? (\n <Box flexShrink={0} marginInlineEnd={{ base: '0', tablet: '12' }} aria-hidden>\n {illustration}\n </Box>\n ) : (\n <Icon\n asChild\n width={rem(72)}\n height={rem(68)}\n flexShrink={0}\n marginInlineEnd={{ base: '0', tablet: '12' }}\n marginBlock={{ base: '0', tablet: rem(-11) }}\n marginInlineStart={{ base: '0', tablet: rem(-12) }}\n >\n <MascotSvg />\n </Icon>\n )}\n <NotificationContent\n action={actionable}\n colorVariant={PROMO_BANNER_COLOR}\n dismissible={dismissible}\n messageText={message}\n onClose={onClose}\n stackable\n titleText={title}\n />\n </Alert.Root>\n );\n};\n\nBitkitPromoBanner.displayName = 'BitkitPromoBanner';\n\nexport default BitkitPromoBanner;\n"],"mappings":";;;;;;;;;AAYA,IAAM,qBAAqB,kBAAkB;AAY7C,IAAM,qBAAqB,UAAkC;CAC3D,MAAM,EAAE,YAAY,KAAK,aAAa,cAAc,SAAS,SAAS,OAAO,GAAG,SAAS;CAEzF,OACE,qBAAC,MAAM,MAAP;EACE,GAAI;EACJ,SAAQ;EACR,QAAO;EACP,UAAS;EACT,eAAe;GAAE,MAAM;GAAU,QAAQ;EAAM;EAC/C,YAAY;GAAE,MAAM;GAAW,QAAQ;EAAS;EAChD,QAAQ;GAAE,MAAM;GAAM,QAAQ;EAAI;EAClC,iBAAiB;GAAE,MAAM,aAAa,OAAO;GAAM,QAAQ,IAAI,EAAE;EAAE;EACnE,KAAK,CAAC,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,EAAE,GAAG,GAAG;EAT/D,UAAA,CAWG,eACC,oBAAC,KAAD;GAAK,YAAY;GAAG,iBAAiB;IAAE,MAAM;IAAK,QAAQ;GAAK;GAAG,eAAA;GAC/D,UAAA;EACE,CAAA,IAEL,oBAAC,MAAD;GACE,SAAA;GACA,OAAO,IAAI,EAAE;GACb,QAAQ,IAAI,EAAE;GACd,YAAY;GACZ,iBAAiB;IAAE,MAAM;IAAK,QAAQ;GAAK;GAC3C,aAAa;IAAE,MAAM;IAAK,QAAQ,IAAI,GAAG;GAAE;GAC3C,mBAAmB;IAAE,MAAM;IAAK,QAAQ,IAAI,GAAG;GAAE;GAEjD,UAAA,oBAACA,YAAD,CAAY,CAAA;EACR,CAAA,GAER,oBAAC,qBAAD;GACE,QAAQ;GACR,cAAc;GACD;GACb,aAAa;GACJ;GACT,WAAA;GACA,WAAW;EACZ,CAAA,CACS;;AAEhB;AAEA,kBAAkB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitSegmentedControl.js","names":[],"sources":["../../../lib/components/BitkitSegmentedControl/BitkitSegmentedControl.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { SegmentGroup } from '@chakra-ui/react/segment-group';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport { withSubComponents } from '../../utilities/withSubComponents';\n\n// --- Context ---\n\ninterface SegmentedControlContext {\n size?: BitkitSegmentedControlProps['size'];\n}\n\nconst [ContextProvider, useSegmentedControlContext] = createContext<SegmentedControlContext>({\n name: 'SegmentedControlContext',\n hookName: 'useSegmentedControlContext',\n providerName: '<BitkitSegmentedControl />',\n});\n\n// --- Root ---\n\nexport type BitkitSegmentedControlProps = Omit<SegmentGroup.RootProps, 'disabled'> & {\n children: ReactNode;\n state?: 'disabled';\n};\n\nconst BitkitSegmentedControl = forwardRef<HTMLDivElement, BitkitSegmentedControlProps>((props, ref) => {\n const { children, state, ...rest } = props;\n\n return (\n <ContextProvider value={{ size: rest.size }}>\n <SegmentGroup.Root ref={ref} disabled={state === 'disabled'} {...rest}>\n <SegmentGroup.Indicator />\n {children}\n </SegmentGroup.Root>\n </ContextProvider>\n );\n});\n\nBitkitSegmentedControl.displayName = 'BitkitSegmentedControl';\n\n// --- Item ---\n\nexport interface BitkitSegmentedControlItemProps {\n children: string;\n disabled?: boolean;\n icon?: BitkitIconComponent;\n value: string;\n}\n\nconst ICON_SIZE_MAP = {\n lg: '24',\n md: '16',\n sm: '16',\n} as const;\n\nconst BitkitSegmentedControlItem = forwardRef<HTMLLabelElement, BitkitSegmentedControlItemProps>((props, ref) => {\n const { children, disabled, icon: Icon, value } = props;\n const { size = 'sm' } = useSegmentedControlContext();\n const iconSize = ICON_SIZE_MAP[size as keyof typeof ICON_SIZE_MAP] ?? '16';\n\n return (\n <SegmentGroup.Item ref={ref} disabled={disabled} value={value}>\n {!!Icon && <Icon size={iconSize} />}\n <SegmentGroup.ItemText>{children}</SegmentGroup.ItemText>\n <SegmentGroup.ItemHiddenInput />\n </SegmentGroup.Item>\n );\n});\n\nBitkitSegmentedControlItem.displayName = 'BitkitSegmentedControlItem';\n\nexport default withSubComponents(BitkitSegmentedControl, {\n Item: BitkitSegmentedControlItem,\n});\n"],"mappings":";;;;;;AAcA,IAAM,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"BitkitSegmentedControl.js","names":["createContext"],"sources":["../../../lib/components/BitkitSegmentedControl/BitkitSegmentedControl.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { SegmentGroup } from '@chakra-ui/react/segment-group';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport { withSubComponents } from '../../utilities/withSubComponents';\n\n// --- Context ---\n\ninterface SegmentedControlContext {\n size?: BitkitSegmentedControlProps['size'];\n}\n\nconst [ContextProvider, useSegmentedControlContext] = createContext<SegmentedControlContext>({\n name: 'SegmentedControlContext',\n hookName: 'useSegmentedControlContext',\n providerName: '<BitkitSegmentedControl />',\n});\n\n// --- Root ---\n\nexport type BitkitSegmentedControlProps = Omit<SegmentGroup.RootProps, 'disabled'> & {\n children: ReactNode;\n state?: 'disabled';\n};\n\nconst BitkitSegmentedControl = forwardRef<HTMLDivElement, BitkitSegmentedControlProps>((props, ref) => {\n const { children, state, ...rest } = props;\n\n return (\n <ContextProvider value={{ size: rest.size }}>\n <SegmentGroup.Root ref={ref} disabled={state === 'disabled'} {...rest}>\n <SegmentGroup.Indicator />\n {children}\n </SegmentGroup.Root>\n </ContextProvider>\n );\n});\n\nBitkitSegmentedControl.displayName = 'BitkitSegmentedControl';\n\n// --- Item ---\n\nexport interface BitkitSegmentedControlItemProps {\n children: string;\n disabled?: boolean;\n icon?: BitkitIconComponent;\n value: string;\n}\n\nconst ICON_SIZE_MAP = {\n lg: '24',\n md: '16',\n sm: '16',\n} as const;\n\nconst BitkitSegmentedControlItem = forwardRef<HTMLLabelElement, BitkitSegmentedControlItemProps>((props, ref) => {\n const { children, disabled, icon: Icon, value } = props;\n const { size = 'sm' } = useSegmentedControlContext();\n const iconSize = ICON_SIZE_MAP[size as keyof typeof ICON_SIZE_MAP] ?? '16';\n\n return (\n <SegmentGroup.Item ref={ref} disabled={disabled} value={value}>\n {!!Icon && <Icon size={iconSize} />}\n <SegmentGroup.ItemText>{children}</SegmentGroup.ItemText>\n <SegmentGroup.ItemHiddenInput />\n </SegmentGroup.Item>\n );\n});\n\nBitkitSegmentedControlItem.displayName = 'BitkitSegmentedControlItem';\n\nexport default withSubComponents(BitkitSegmentedControl, {\n Item: BitkitSegmentedControlItem,\n});\n"],"mappings":";;;;;;AAcA,IAAM,CAAC,iBAAiB,8BAA8BA,gBAAuC;CAC3F,MAAM;CACN,UAAU;CACV,cAAc;AAChB,CAAC;AASD,IAAM,yBAAyB,YAAyD,OAAO,QAAQ;CACrG,MAAM,EAAE,UAAU,OAAO,GAAG,SAAS;CAErC,OACE,oBAAC,iBAAD;EAAiB,OAAO,EAAE,MAAM,KAAK,KAAK;EACxC,UAAA,qBAAC,aAAa,MAAd;GAAwB;GAAK,UAAU,UAAU;GAAY,GAAI;GAAjE,UAAA,CACE,oBAAC,aAAa,WAAd,CAAyB,CAAA,GACxB,QACgB;;CACJ,CAAA;AAErB,CAAC;AAED,uBAAuB,cAAc;AAWrC,IAAM,gBAAgB;CACpB,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,IAAM,6BAA6B,YAA+D,OAAO,QAAQ;CAC/G,MAAM,EAAE,UAAU,UAAU,MAAM,MAAM,UAAU;CAClD,MAAM,EAAE,OAAO,SAAS,2BAA2B;CACnD,MAAM,WAAW,cAAc,SAAuC;CAEtE,OACE,qBAAC,aAAa,MAAd;EAAwB;EAAe;EAAiB;EAAxD,UAAA;GACG,CAAC,CAAC,QAAQ,oBAAC,MAAD,EAAM,MAAM,SAAW,CAAA;GAClC,oBAAC,aAAa,UAAd,EAAwB,SAAgC,CAAA;GACxD,oBAAC,aAAa,iBAAd,CAA+B,CAAA;EACd;;AAEvB,CAAC;AAED,2BAA2B,cAAc;AAEzC,IAAA,iCAAe,kBAAkB,wBAAwB,EACvD,MAAM,2BACR,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitSelectMenuAction.js","names":[],"sources":["../../../lib/components/BitkitSelectMenu/BitkitSelectMenuAction.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { Box } from '@chakra-ui/react/box';\nimport { type ListCollection } from '@chakra-ui/react/collection';\nimport { chakra, type SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { type KeyboardEvent as ReactKeyboardEvent, type ReactElement, type ReactNode } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport BitkitTooltip from '../BitkitTooltip/BitkitTooltip';\n\ntype BitkitSelectMenuActionCommonProps = {\n icon: BitkitIconComponent;\n label: string;\n /**\n * A disabled action stays focusable and keeps taking pointer events (`aria-disabled`, not the\n * native attribute), so the `tooltip` saying why it is unavailable is still reachable. Natively\n * disabled it would be neither hoverable nor tabbable, hiding the explanation in the one state\n * that needs it.\n *\n * This is the only disabled affordance in the menus: an option a user cannot pick is left out\n * of the collection instead, never dimmed.\n */\n state?: 'disabled';\n /** Hover and focus tooltip on the row. On a disabled action, say why it is unavailable. */\n tooltip?: string;\n};\n\nexport type BitkitSelectMenuActionAsButtonProps = BitkitSelectMenuActionCommonProps & {\n href?: undefined;\n isExternal?: undefined;\n onClick: () => void;\n};\n\nexport type BitkitSelectMenuActionAsAnchorProps = BitkitSelectMenuActionCommonProps & {\n href: string;\n isExternal?: boolean;\n onClick?: () => void;\n rel?: string;\n target?: string;\n};\n\nexport type BitkitSelectMenuActionProps = BitkitSelectMenuActionAsButtonProps | BitkitSelectMenuActionAsAnchorProps;\n\nexport type BitkitSelectMenuActionChild = ReactElement<BitkitSelectMenuActionProps> | false | null;\n\nexport type SelectMenuApi = {\n clearHighlightValue: () => void;\n collection: Pick<ListCollection<{ value: string }>, 'firstValue' | 'lastValue'>;\n setHighlightValue: (value: string) => void;\n setOpen: (open: boolean) => void;\n};\n\ntype SelectMenuShellContext = {\n api: SelectMenuApi;\n iconSize: '16' | '24';\n styles: Record<string, SystemStyleObject>;\n};\n\nconst [SelectMenuShellContextProvider, useSelectMenuShellContext] = createContext<SelectMenuShellContext>({\n name: 'SelectMenuShellContext',\n hookName: 'useSelectMenuShellContext',\n providerName:\n '<BitkitSelectMenu />, <BitkitMultiselectMenu />, <BitkitSelect />, <BitkitMultiselect />, or <BitkitCombobox />',\n});\n\nexport { SelectMenuShellContextProvider };\n\nconst listEdgeKeys: Record<string, 'firstValue' | 'lastValue' | undefined> = {\n ArrowDown: 'firstValue',\n ArrowUp: 'lastValue',\n End: 'lastValue',\n Home: 'firstValue',\n};\n\nconst BitkitSelectMenuAction = (props: BitkitSelectMenuActionProps) => {\n const { href, icon: Icon, label, onClick, state, tooltip } = props;\n const { api, iconSize, styles } = useSelectMenuShellContext();\n\n const rowProps = {\n onFocus: api.clearHighlightValue,\n onKeyDown: (event: ReactKeyboardEvent) => {\n if (event.key === 'Tab' || event.key === 'Escape') return;\n event.stopPropagation();\n\n const edge = listEdgeKeys[event.key];\n const value = edge && api.collection[edge];\n if (!value) return;\n\n event.preventDefault();\n const content = event.currentTarget.closest<HTMLElement>('[data-part=\"content\"]');\n (content?.querySelector<HTMLElement>('input') ?? content)?.focus();\n api.setHighlightValue(value);\n },\n };\n\n const content = (\n <>\n <Icon size={iconSize} />\n {label}\n </>\n );\n\n const asRow = (row: ReactNode) => (\n <Box css={styles.actionContainer}>{tooltip ? <BitkitTooltip text={tooltip}>{row}</BitkitTooltip> : row}</Box>\n );\n\n if (state === 'disabled') {\n return asRow(\n // A button even for an `href` action: dropping the attribute is the only thing that stops a\n // middle click or \"open link in new tab\" from navigating anyway, and an anchor without one\n // leaves the tab order, taking the tooltip with it.\n <chakra.button\n type=\"button\"\n aria-disabled=\"true\"\n css={styles.action}\n // `_disabled` matches `[aria-disabled=true]` by itself, but `_hover`/`_active` only\n // exclude `:disabled` and `[data-disabled]`, so without this the row still lights up.\n data-disabled=\"\"\n {...rowProps}\n >\n {content}\n </chakra.button>,\n );\n }\n\n if (href !== undefined) {\n const { isExternal, rel, target } = props;\n const effectiveTarget = isExternal ? '_blank' : target;\n const effectiveRel = isExternal ? (rel ? `${rel} noreferrer noopener` : 'noreferrer noopener') : rel;\n\n return asRow(\n <chakra.a\n href={href}\n target={effectiveTarget}\n rel={effectiveRel}\n css={styles.action}\n onClick={onClick}\n {...rowProps}\n >\n {content}\n </chakra.a>,\n );\n }\n\n return asRow(\n <chakra.button type=\"button\" css={styles.action} onClick={onClick} {...rowProps}>\n {content}\n </chakra.button>,\n );\n};\n\nBitkitSelectMenuAction.displayName = 'BitkitSelectMenu.Action';\n\nexport default BitkitSelectMenuAction;\n"],"mappings":";;;;;;AA0DA,IAAM,CAAC,gCAAgC,6BAA6B,cAAsC;CACxG,MAAM;CACN,UAAU;CACV,cACE;AACJ,CAAC;AAID,IAAM,eAAuE;CAC3E,WAAW;CACX,SAAS;CACT,KAAK;CACL,MAAM;AACR;AAEA,IAAM,0BAA0B,UAAuC;CACrE,MAAM,EAAE,MAAM,MAAM,MAAM,OAAO,SAAS,OAAO,YAAY;CAC7D,MAAM,EAAE,KAAK,UAAU,WAAW,0BAA0B;CAE5D,MAAM,WAAW;EACf,SAAS,IAAI;EACb,YAAY,UAA8B;GACxC,IAAI,MAAM,QAAQ,SAAS,MAAM,QAAQ,UAAU;GACnD,MAAM,gBAAgB;GAEtB,MAAM,OAAO,aAAa,MAAM;GAChC,MAAM,QAAQ,QAAQ,IAAI,WAAW;GACrC,IAAI,CAAC,OAAO;GAEZ,MAAM,eAAe;GACrB,MAAM,UAAU,MAAM,cAAc,QAAqB,yBAAuB;GAChF,CAAC,SAAS,cAA2B,OAAO,KAAK,QAAA,EAAU,MAAM;GACjE,IAAI,kBAAkB,KAAK;EAC7B;CACF;CAEA,MAAM,UACJ,
|
|
1
|
+
{"version":3,"file":"BitkitSelectMenuAction.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitSelectMenu/BitkitSelectMenuAction.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { Box } from '@chakra-ui/react/box';\nimport { type ListCollection } from '@chakra-ui/react/collection';\nimport { chakra, type SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { type KeyboardEvent as ReactKeyboardEvent, type ReactElement, type ReactNode } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport BitkitTooltip from '../BitkitTooltip/BitkitTooltip';\n\ntype BitkitSelectMenuActionCommonProps = {\n icon: BitkitIconComponent;\n label: string;\n /**\n * A disabled action stays focusable and keeps taking pointer events (`aria-disabled`, not the\n * native attribute), so the `tooltip` saying why it is unavailable is still reachable. Natively\n * disabled it would be neither hoverable nor tabbable, hiding the explanation in the one state\n * that needs it.\n *\n * This is the only disabled affordance in the menus: an option a user cannot pick is left out\n * of the collection instead, never dimmed.\n */\n state?: 'disabled';\n /** Hover and focus tooltip on the row. On a disabled action, say why it is unavailable. */\n tooltip?: string;\n};\n\nexport type BitkitSelectMenuActionAsButtonProps = BitkitSelectMenuActionCommonProps & {\n href?: undefined;\n isExternal?: undefined;\n onClick: () => void;\n};\n\nexport type BitkitSelectMenuActionAsAnchorProps = BitkitSelectMenuActionCommonProps & {\n href: string;\n isExternal?: boolean;\n onClick?: () => void;\n rel?: string;\n target?: string;\n};\n\nexport type BitkitSelectMenuActionProps = BitkitSelectMenuActionAsButtonProps | BitkitSelectMenuActionAsAnchorProps;\n\nexport type BitkitSelectMenuActionChild = ReactElement<BitkitSelectMenuActionProps> | false | null;\n\nexport type SelectMenuApi = {\n clearHighlightValue: () => void;\n collection: Pick<ListCollection<{ value: string }>, 'firstValue' | 'lastValue'>;\n setHighlightValue: (value: string) => void;\n setOpen: (open: boolean) => void;\n};\n\ntype SelectMenuShellContext = {\n api: SelectMenuApi;\n iconSize: '16' | '24';\n styles: Record<string, SystemStyleObject>;\n};\n\nconst [SelectMenuShellContextProvider, useSelectMenuShellContext] = createContext<SelectMenuShellContext>({\n name: 'SelectMenuShellContext',\n hookName: 'useSelectMenuShellContext',\n providerName:\n '<BitkitSelectMenu />, <BitkitMultiselectMenu />, <BitkitSelect />, <BitkitMultiselect />, or <BitkitCombobox />',\n});\n\nexport { SelectMenuShellContextProvider };\n\nconst listEdgeKeys: Record<string, 'firstValue' | 'lastValue' | undefined> = {\n ArrowDown: 'firstValue',\n ArrowUp: 'lastValue',\n End: 'lastValue',\n Home: 'firstValue',\n};\n\nconst BitkitSelectMenuAction = (props: BitkitSelectMenuActionProps) => {\n const { href, icon: Icon, label, onClick, state, tooltip } = props;\n const { api, iconSize, styles } = useSelectMenuShellContext();\n\n const rowProps = {\n onFocus: api.clearHighlightValue,\n onKeyDown: (event: ReactKeyboardEvent) => {\n if (event.key === 'Tab' || event.key === 'Escape') return;\n event.stopPropagation();\n\n const edge = listEdgeKeys[event.key];\n const value = edge && api.collection[edge];\n if (!value) return;\n\n event.preventDefault();\n const content = event.currentTarget.closest<HTMLElement>('[data-part=\"content\"]');\n (content?.querySelector<HTMLElement>('input') ?? content)?.focus();\n api.setHighlightValue(value);\n },\n };\n\n const content = (\n <>\n <Icon size={iconSize} />\n {label}\n </>\n );\n\n const asRow = (row: ReactNode) => (\n <Box css={styles.actionContainer}>{tooltip ? <BitkitTooltip text={tooltip}>{row}</BitkitTooltip> : row}</Box>\n );\n\n if (state === 'disabled') {\n return asRow(\n // A button even for an `href` action: dropping the attribute is the only thing that stops a\n // middle click or \"open link in new tab\" from navigating anyway, and an anchor without one\n // leaves the tab order, taking the tooltip with it.\n <chakra.button\n type=\"button\"\n aria-disabled=\"true\"\n css={styles.action}\n // `_disabled` matches `[aria-disabled=true]` by itself, but `_hover`/`_active` only\n // exclude `:disabled` and `[data-disabled]`, so without this the row still lights up.\n data-disabled=\"\"\n {...rowProps}\n >\n {content}\n </chakra.button>,\n );\n }\n\n if (href !== undefined) {\n const { isExternal, rel, target } = props;\n const effectiveTarget = isExternal ? '_blank' : target;\n const effectiveRel = isExternal ? (rel ? `${rel} noreferrer noopener` : 'noreferrer noopener') : rel;\n\n return asRow(\n <chakra.a\n href={href}\n target={effectiveTarget}\n rel={effectiveRel}\n css={styles.action}\n onClick={onClick}\n {...rowProps}\n >\n {content}\n </chakra.a>,\n );\n }\n\n return asRow(\n <chakra.button type=\"button\" css={styles.action} onClick={onClick} {...rowProps}>\n {content}\n </chakra.button>,\n );\n};\n\nBitkitSelectMenuAction.displayName = 'BitkitSelectMenu.Action';\n\nexport default BitkitSelectMenuAction;\n"],"mappings":";;;;;;AA0DA,IAAM,CAAC,gCAAgC,6BAA6B,cAAsC;CACxG,MAAM;CACN,UAAU;CACV,cACE;AACJ,CAAC;AAID,IAAM,eAAuE;CAC3E,WAAW;CACX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;CACF;CAEA,OAAO,MACL,oBAAC,OAAO,QAAR;EAAe,MAAK;EAAS,KAAK,OAAO;EAAiB;EAAS,GAAI;EACpE,UAAA;CACY,CAAA,CACjB;AACF;AAEA,uBAAuB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitSettingsCard.js","names":[],"sources":["../../../lib/components/BitkitSettingsCard/BitkitSettingsCard.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { Card, type CardBodyProps, type CardFooterProps, type CardRootProps } from '@chakra-ui/react/card';\nimport { Skeleton } from '@chakra-ui/react/skeleton';\nimport { useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport {\n type BitkitIconComponent,\n IconCheckCircleFilled,\n IconCircleDashed,\n IconClock,\n IconCrossCircleFilled,\n IconErrorCircleFilled,\n IconWarningYellow,\n} from '../../icons';\nimport { withSubComponents } from '../../utilities/withSubComponents';\n\nexport type BitkitSettingsCardStatus = 'error' | 'failed' | 'in-progress' | 'neutral' | 'success' | 'warning';\n\nconst statusIcons: Record<BitkitSettingsCardStatus, BitkitIconComponent> = {\n error: IconErrorCircleFilled,\n failed: IconCrossCircleFilled,\n 'in-progress': IconClock,\n neutral: IconCircleDashed,\n success: IconCheckCircleFilled,\n warning: IconWarningYellow,\n};\n\n/** An error is announced assertively; every other status is a polite one. */\nconst liveRoleFor = (status: BitkitSettingsCardStatus) => (status === 'error' ? 'alert' : 'status');\n\nconst useSettingsCardStyles = (props?: { status?: BitkitSettingsCardStatus }) => {\n const recipe = useSlotRecipe({ key: 'settingsCard' });\n return recipe(props);\n};\n\n// --- Root ---\n\nexport interface BitkitSettingsCardProps extends Omit<CardRootProps, 'children' | 'elevation'> {\n children: ReactNode;\n}\n\nconst BitkitSettingsCard = forwardRef<HTMLDivElement, BitkitSettingsCardProps>((props, ref) => {\n const { children, css, ...rest } = props;\n const styles = useSettingsCardStyles();\n\n return (\n <Card.Root ref={ref} elevation={false} paddingSize=\"md\" css={[styles.root, css]} {...rest}>\n {children}\n </Card.Root>\n );\n});\n\nBitkitSettingsCard.displayName = 'BitkitSettingsCard';\n\n// --- Content ---\n\nexport interface BitkitSettingsCardContentProps extends Omit<CardBodyProps, 'children'> {\n actions?: ReactNode;\n children: ReactNode;\n}\n\nconst Content = forwardRef<HTMLDivElement, BitkitSettingsCardContentProps>((props, ref) => {\n const { actions, children, css, ...rest } = props;\n const styles = useSettingsCardStyles();\n\n return (\n <Card.Body ref={ref} css={[styles.content, css]} {...rest}>\n <Box css={styles.contentBody}>{children}</Box>\n {actions && <Box css={styles.contentActions}>{actions}</Box>}\n </Card.Body>\n );\n});\n\nContent.displayName = 'BitkitSettingsCard.Content';\n\n// --- Status ---\n\nexport interface BitkitSettingsCardStatusProps extends Omit<BoxProps, 'children' | 'colorPalette'> {\n /** Replaces the icon the `status` renders by default. */\n icon?: BitkitIconComponent;\n labelText: ReactNode;\n state?: 'default' | 'skeleton';\n status?: BitkitSettingsCardStatus;\n}\n\nconst Status = forwardRef<HTMLDivElement, BitkitSettingsCardStatusProps>((props, ref) => {\n const { css, icon, labelText, state, status = 'neutral', ...rest } = props;\n const styles = useSettingsCardStyles({ status });\n const Icon = icon ?? statusIcons[status];\n // No live region while the skeleton is up: the label replacing it counts as a change inside the\n // region, so a page of loading cards would announce every status in turn.\n const liveRole = state === 'skeleton' ? undefined : liveRoleFor(status);\n\n return (\n <Box ref={ref} role={liveRole} css={[styles.status, css]} {...rest}>\n {state === 'skeleton' ? (\n <Skeleton height=\"20\" width=\"96\" />\n ) : (\n <>\n <Icon css={styles.statusIcon} size=\"16\" />\n <Text as=\"span\" css={styles.statusLabel}>\n {labelText}\n </Text>\n </>\n )}\n </Box>\n );\n});\n\nStatus.displayName = 'BitkitSettingsCard.Status';\n\n// --- StatusMessage ---\n\nexport interface BitkitSettingsCardStatusMessageProps extends Omit<BoxProps, 'children' | 'colorPalette'> {\n helperText?: ReactNode;\n /** Replaces the icon the `status` renders by default. */\n icon?: BitkitIconComponent;\n labelText: ReactNode;\n /** The detail line under the status. This is what sets a status message apart from a plain status. */\n messageText: ReactNode;\n status?: BitkitSettingsCardStatus;\n}\n\nconst StatusMessage = forwardRef<HTMLDivElement, BitkitSettingsCardStatusMessageProps>((props, ref) => {\n const { css, helperText, icon, labelText, messageText, status = 'neutral', ...rest } = props;\n const styles = useSettingsCardStyles({ status });\n\n return (\n <Box ref={ref} css={[styles.statusMessage, css]} data-slot=\"status-message\" role={liveRoleFor(status)} {...rest}>\n <Status icon={icon} labelText={labelText} role={undefined} status={status} />\n {messageText && <Text css={styles.statusMessageText}>{messageText}</Text>}\n {helperText && <Text css={styles.statusHelperText}>{helperText}</Text>}\n </Box>\n );\n});\n\nStatusMessage.displayName = 'BitkitSettingsCard.StatusMessage';\n\n// --- Footer ---\n\nexport interface BitkitSettingsCardFooterProps extends CardFooterProps {\n /** Error of a control that lives in the footer (e.g. a switch that failed to toggle). */\n errorText?: ReactNode;\n}\n\nconst Footer = forwardRef<HTMLDivElement, BitkitSettingsCardFooterProps>((props, ref) => {\n const { children, css, errorText, ...rest } = props;\n const styles = useSettingsCardStyles();\n\n return (\n <Card.Footer ref={ref} css={[styles.footer, css]} {...rest}>\n {children}\n {errorText && <Status labelText={errorText} marginInlineStart=\"auto\" status=\"error\" />}\n </Card.Footer>\n );\n});\n\nFooter.displayName = 'BitkitSettingsCard.Footer';\n\n// --- Compound export ---\n\nexport default withSubComponents(BitkitSettingsCard, {\n Content,\n Footer,\n Status,\n StatusMessage,\n});\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,IAAM,cAAqE;CACzE,OAAO;CACP,QAAQ;CACR,eAAe;CACf,SAAS;CACT,SAAS;CACT,SAAS;AACX;;AAGA,IAAM,eAAe,WAAsC,WAAW,UAAU,UAAU;AAE1F,IAAM,yBAAyB,UAAkD;CAE/E,OADe,cAAc,EAAE,KAAK,eAAe,CAC5C,CAAA,CAAO,KAAK;AACrB;AAQA,IAAM,qBAAqB,YAAqD,OAAO,QAAQ;CAC7F,MAAM,EAAE,UAAU,KAAK,GAAG,SAAS;CACnC,MAAM,SAAS,sBAAsB;CAErC,OACE,oBAAC,KAAK,MAAN;EAAgB;EAAK,WAAW;EAAO,aAAY;EAAK,KAAK,CAAC,OAAO,MAAM,GAAG;EAAG,GAAI;EAClF;CACQ,CAAA;AAEf,CAAC;AAED,mBAAmB,cAAc;AASjC,IAAM,UAAU,YAA4D,OAAO,QAAQ;CACzF,MAAM,EAAE,SAAS,UAAU,KAAK,GAAG,SAAS;CAC5C,MAAM,SAAS,sBAAsB;CAErC,OACE,qBAAC,KAAK,MAAN;EAAgB;EAAK,KAAK,CAAC,OAAO,SAAS,GAAG;EAAG,GAAI;EAArD,UAAA,CACE,oBAAC,KAAD;GAAK,KAAK,OAAO;GAAc;EAAc,CAAA,GAC5C,WAAW,oBAAC,KAAD;GAAK,KAAK,OAAO;GAAiB,UAAA;EAAa,CAAA,CAClD;;AAEf,CAAC;AAED,QAAQ,cAAc;AAYtB,IAAM,SAAS,YAA2D,OAAO,QAAQ;CACvF,MAAM,EAAE,KAAK,MAAM,WAAW,OAAO,SAAS,WAAW,GAAG,SAAS;CACrE,MAAM,SAAS,sBAAsB,EAAE,OAAO,CAAC;CAC/C,MAAM,OAAO,QAAQ,YAAY;CAGjC,MAAM,WAAW,UAAU,aAAa,KAAA,IAAY,YAAY,MAAM;CAEtE,OACE,oBAAC,KAAD;EAAU;EAAK,MAAM;EAAU,KAAK,CAAC,OAAO,QAAQ,GAAG;EAAG,GAAI;EAC3D,UAAA,UAAU,aACT,oBAAC,UAAD;GAAU,QAAO;GAAK,OAAM;EAAM,CAAA,IAElC,
|
|
1
|
+
{"version":3,"file":"BitkitSettingsCard.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitSettingsCard/BitkitSettingsCard.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { Card, type CardBodyProps, type CardFooterProps, type CardRootProps } from '@chakra-ui/react/card';\nimport { Skeleton } from '@chakra-ui/react/skeleton';\nimport { useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport {\n type BitkitIconComponent,\n IconCheckCircleFilled,\n IconCircleDashed,\n IconClock,\n IconCrossCircleFilled,\n IconErrorCircleFilled,\n IconWarningYellow,\n} from '../../icons';\nimport { withSubComponents } from '../../utilities/withSubComponents';\n\nexport type BitkitSettingsCardStatus = 'error' | 'failed' | 'in-progress' | 'neutral' | 'success' | 'warning';\n\nconst statusIcons: Record<BitkitSettingsCardStatus, BitkitIconComponent> = {\n error: IconErrorCircleFilled,\n failed: IconCrossCircleFilled,\n 'in-progress': IconClock,\n neutral: IconCircleDashed,\n success: IconCheckCircleFilled,\n warning: IconWarningYellow,\n};\n\n/** An error is announced assertively; every other status is a polite one. */\nconst liveRoleFor = (status: BitkitSettingsCardStatus) => (status === 'error' ? 'alert' : 'status');\n\nconst useSettingsCardStyles = (props?: { status?: BitkitSettingsCardStatus }) => {\n const recipe = useSlotRecipe({ key: 'settingsCard' });\n return recipe(props);\n};\n\n// --- Root ---\n\nexport interface BitkitSettingsCardProps extends Omit<CardRootProps, 'children' | 'elevation'> {\n children: ReactNode;\n}\n\nconst BitkitSettingsCard = forwardRef<HTMLDivElement, BitkitSettingsCardProps>((props, ref) => {\n const { children, css, ...rest } = props;\n const styles = useSettingsCardStyles();\n\n return (\n <Card.Root ref={ref} elevation={false} paddingSize=\"md\" css={[styles.root, css]} {...rest}>\n {children}\n </Card.Root>\n );\n});\n\nBitkitSettingsCard.displayName = 'BitkitSettingsCard';\n\n// --- Content ---\n\nexport interface BitkitSettingsCardContentProps extends Omit<CardBodyProps, 'children'> {\n actions?: ReactNode;\n children: ReactNode;\n}\n\nconst Content = forwardRef<HTMLDivElement, BitkitSettingsCardContentProps>((props, ref) => {\n const { actions, children, css, ...rest } = props;\n const styles = useSettingsCardStyles();\n\n return (\n <Card.Body ref={ref} css={[styles.content, css]} {...rest}>\n <Box css={styles.contentBody}>{children}</Box>\n {actions && <Box css={styles.contentActions}>{actions}</Box>}\n </Card.Body>\n );\n});\n\nContent.displayName = 'BitkitSettingsCard.Content';\n\n// --- Status ---\n\nexport interface BitkitSettingsCardStatusProps extends Omit<BoxProps, 'children' | 'colorPalette'> {\n /** Replaces the icon the `status` renders by default. */\n icon?: BitkitIconComponent;\n labelText: ReactNode;\n state?: 'default' | 'skeleton';\n status?: BitkitSettingsCardStatus;\n}\n\nconst Status = forwardRef<HTMLDivElement, BitkitSettingsCardStatusProps>((props, ref) => {\n const { css, icon, labelText, state, status = 'neutral', ...rest } = props;\n const styles = useSettingsCardStyles({ status });\n const Icon = icon ?? statusIcons[status];\n // No live region while the skeleton is up: the label replacing it counts as a change inside the\n // region, so a page of loading cards would announce every status in turn.\n const liveRole = state === 'skeleton' ? undefined : liveRoleFor(status);\n\n return (\n <Box ref={ref} role={liveRole} css={[styles.status, css]} {...rest}>\n {state === 'skeleton' ? (\n <Skeleton height=\"20\" width=\"96\" />\n ) : (\n <>\n <Icon css={styles.statusIcon} size=\"16\" />\n <Text as=\"span\" css={styles.statusLabel}>\n {labelText}\n </Text>\n </>\n )}\n </Box>\n );\n});\n\nStatus.displayName = 'BitkitSettingsCard.Status';\n\n// --- StatusMessage ---\n\nexport interface BitkitSettingsCardStatusMessageProps extends Omit<BoxProps, 'children' | 'colorPalette'> {\n helperText?: ReactNode;\n /** Replaces the icon the `status` renders by default. */\n icon?: BitkitIconComponent;\n labelText: ReactNode;\n /** The detail line under the status. This is what sets a status message apart from a plain status. */\n messageText: ReactNode;\n status?: BitkitSettingsCardStatus;\n}\n\nconst StatusMessage = forwardRef<HTMLDivElement, BitkitSettingsCardStatusMessageProps>((props, ref) => {\n const { css, helperText, icon, labelText, messageText, status = 'neutral', ...rest } = props;\n const styles = useSettingsCardStyles({ status });\n\n return (\n <Box ref={ref} css={[styles.statusMessage, css]} data-slot=\"status-message\" role={liveRoleFor(status)} {...rest}>\n <Status icon={icon} labelText={labelText} role={undefined} status={status} />\n {messageText && <Text css={styles.statusMessageText}>{messageText}</Text>}\n {helperText && <Text css={styles.statusHelperText}>{helperText}</Text>}\n </Box>\n );\n});\n\nStatusMessage.displayName = 'BitkitSettingsCard.StatusMessage';\n\n// --- Footer ---\n\nexport interface BitkitSettingsCardFooterProps extends CardFooterProps {\n /** Error of a control that lives in the footer (e.g. a switch that failed to toggle). */\n errorText?: ReactNode;\n}\n\nconst Footer = forwardRef<HTMLDivElement, BitkitSettingsCardFooterProps>((props, ref) => {\n const { children, css, errorText, ...rest } = props;\n const styles = useSettingsCardStyles();\n\n return (\n <Card.Footer ref={ref} css={[styles.footer, css]} {...rest}>\n {children}\n {errorText && <Status labelText={errorText} marginInlineStart=\"auto\" status=\"error\" />}\n </Card.Footer>\n );\n});\n\nFooter.displayName = 'BitkitSettingsCard.Footer';\n\n// --- Compound export ---\n\nexport default withSubComponents(BitkitSettingsCard, {\n Content,\n Footer,\n Status,\n StatusMessage,\n});\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,IAAM,cAAqE;CACzE,OAAO;CACP,QAAQ;CACR,eAAe;CACf,SAAS;CACT,SAAS;CACT,SAAS;AACX;;AAGA,IAAM,eAAe,WAAsC,WAAW,UAAU,UAAU;AAE1F,IAAM,yBAAyB,UAAkD;CAE/E,OADe,cAAc,EAAE,KAAK,eAAe,CAC5C,CAAA,CAAO,KAAK;AACrB;AAQA,IAAM,qBAAqB,YAAqD,OAAO,QAAQ;CAC7F,MAAM,EAAE,UAAU,KAAK,GAAG,SAAS;CACnC,MAAM,SAAS,sBAAsB;CAErC,OACE,oBAAC,KAAK,MAAN;EAAgB;EAAK,WAAW;EAAO,aAAY;EAAK,KAAK,CAAC,OAAO,MAAM,GAAG;EAAG,GAAI;EAClF;CACQ,CAAA;AAEf,CAAC;AAED,mBAAmB,cAAc;AASjC,IAAM,UAAU,YA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Y,MAAM;EAAG,GAAI;EAA3G,UAAA;GACE,oBAAC,QAAD;IAAc;IAAiB;IAAW,MAAM,KAAA;IAAmB;GAAS,CAAA;GAC3E,eAAe,oBAAC,MAAD;IAAM,KAAK,OAAO;IAAoB,UAAA;GAAkB,CAAA;GACvE,cAAc,oBAAC,MAAD;IAAM,KAAK,OAAO;IAAmB,UAAA;GAAiB,CAAA;EAClE;;AAET,CAAC;AAED,cAAc,cAAc;AAS5B,IAAM,SAAS,YAA2D,OAAO,QAAQ;CACvF,MAAM,EAAE,UAAU,KAAK,WAAW,GAAG,SAAS;CAC9C,MAAM,SAAS,sBAAsB;CAErC,OACE,qBAAC,KAAK,QAAN;EAAkB;EAAK,KAAK,CAAC,OAAO,QAAQ,GAAG;EAAG,GAAI;EAAtD,UAAA,CACG,UACA,aAAa,oBAAC,QAAD;GAAQ,WAAW;GAAW,mBAAkB;GAAO,QAAO;EAAS,CAAA,CAC1E;;AAEjB,CAAC;AAED,OAAO,cAAc;AAIrB,IAAA,6BAAe,kBAAkB,oBAAoB;CACnD;CACA;CACA;CACA;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitSplitButton.js","names":[],"sources":["../../../lib/components/BitkitSplitButton/BitkitSplitButton.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { Group, type GroupProps } from '@chakra-ui/react/group';\nimport { Skeleton } from '@chakra-ui/react/skeleton';\nimport { type SystemStyleObject, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef, isValidElement, type PropsWithChildren, type ReactElement, type ReactNode } from 'react';\n\nimport { IconChevronDown } from '../../icons';\nimport { flattenChildren } from '../../utilities/flattenChildren';\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport BitkitActionMenu from '../BitkitActionMenu/BitkitActionMenu';\nimport BitkitButton, {\n type BitkitButtonAsAnchorProps,\n type BitkitButtonAsButtonProps,\n} from '../BitkitButton/BitkitButton';\nimport BitkitIconButton from '../BitkitIconButton/BitkitIconButton';\n\ntype Size = 'lg' | 'md' | 'sm';\ntype Variant = 'primary' | 'secondary';\ntype State = 'disabled' | 'loading' | 'skeleton';\n\nconst isValidActionItem = (child: ReactNode): child is ReactElement => {\n return isValidElement(child) && child.type === BitkitSplitButtonAction;\n};\n\nconst isValidMenuItem = (child: ReactNode): child is ReactElement => {\n return (\n isValidElement(child) &&\n (child.type === BitkitActionMenu.Group ||\n child.type === BitkitActionMenu.Item ||\n child.type === BitkitActionMenu.Separator)\n );\n};\n\n// --- Context ---\ninterface SplitButtonContext {\n size: Size;\n variant: Variant;\n state: State | undefined;\n styles: Record<string, SystemStyleObject>;\n}\n\nconst [SplitButtonProvider, useSplitButtonContext] = createContext<SplitButtonContext>({\n name: 'SplitButtonContext',\n hookName: 'useSplitButtonContext',\n providerName: '<BitkitSplitButton />',\n});\n\n// --- Action ---\n// Split-button action can be a button (default) or anchor (when href is set). asChild is intentionally\n// not part of the API — routing-library elements don't fit cleanly into the Group attached layout.\n// The forwarded ref is HTMLElement so it covers both <button> and <a>.\ntype BitkitSplitButtonActionProps = Omit<\n BitkitButtonAsButtonProps | BitkitButtonAsAnchorProps,\n 'size' | 'variant' | 'state'\n>;\n\nconst BitkitSplitButtonAction = forwardRef<HTMLElement, BitkitSplitButtonActionProps>((props, ref) => {\n const { size, state, styles, variant } = useSplitButtonContext();\n\n if (props.href !== undefined) {\n // Anchor branch: BitkitButton's anchor variant doesn't allow state=\"loading\". Coerce to \"disabled\"\n // so a SplitButton-wide loading state still surfaces visually on a link-mode action.\n return (\n <BitkitButton\n {...(props as BitkitButtonAsAnchorProps)}\n css={styles.action}\n ref={ref}\n size={size}\n state={state === 'loading' ? 'disabled' : state}\n variant={variant}\n />\n );\n }\n\n return (\n <BitkitButton\n {...(props as BitkitButtonAsButtonProps)}\n css={styles.action}\n ref={ref}\n size={size}\n state={state}\n variant={variant}\n />\n );\n});\n\nBitkitSplitButtonAction.displayName = 'BitkitSplitButtonAction';\n\n// --- Root ---\nexport type BitkitSplitButtonProps = PropsWithChildren<\n Omit<GroupProps, 'attached' | 'children' | 'display'> & {\n size?: Size;\n variant?: Variant;\n state?: State;\n }\n>;\n\nconst BitkitSplitButton = forwardRef<HTMLDivElement, BitkitSplitButtonProps>((props, ref) => {\n const { children, size = 'lg', state, variant = 'primary', ...rest } = props;\n\n const childArray = flattenChildren(children);\n const actionChild = childArray.find(isValidActionItem);\n const menuItems = childArray.filter(isValidMenuItem);\n\n const menuSize = size === 'lg' ? 'lg' : 'md';\n const recipe = useSlotRecipe({ key: 'splitButton' });\n const styles = recipe({ variant });\n\n return (\n <SplitButtonProvider value={{ size, state, styles, variant }}>\n <Skeleton asChild loading={state === 'skeleton'}>\n <Group ref={ref} {...rest} attached display=\"inline-flex\">\n {actionChild}\n <BitkitActionMenu\n size={menuSize}\n trigger={\n <BitkitIconButton\n css={styles.trigger}\n icon={IconChevronDown}\n label=\"Toggle menu\"\n size={size}\n state={state === 'loading' ? 'disabled' : state}\n variant={variant}\n />\n }\n positioning={{ placement: 'bottom-end' }}\n >\n {menuItems}\n </BitkitActionMenu>\n </Group>\n </Skeleton>\n </SplitButtonProvider>\n );\n});\nBitkitSplitButton.displayName = 'BitkitSplitButton';\n\nexport default withSubComponents(BitkitSplitButton, {\n Action: BitkitSplitButtonAction,\n Group: BitkitActionMenu.Group,\n Item: BitkitActionMenu.Item,\n Separator: BitkitActionMenu.Separator,\n});\n"],"mappings":";;;;;;;;;;;;;AAqBA,IAAM,qBAAqB,UAA4C;CACrE,OAAO,eAAe,KAAK,KAAK,MAAM,SAAS;AACjD;AAEA,IAAM,mBAAmB,UAA4C;CACnE,OACE,eAAe,KAAK,MACnB,MAAM,
|
|
1
|
+
{"version":3,"file":"BitkitSplitButton.js","names":["BitkitActionMenu","createContext"],"sources":["../../../lib/components/BitkitSplitButton/BitkitSplitButton.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { Group, type GroupProps } from '@chakra-ui/react/group';\nimport { Skeleton } from '@chakra-ui/react/skeleton';\nimport { type SystemStyleObject, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef, isValidElement, type PropsWithChildren, type ReactElement, type ReactNode } from 'react';\n\nimport { IconChevronDown } from '../../icons';\nimport { flattenChildren } from '../../utilities/flattenChildren';\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport BitkitActionMenu from '../BitkitActionMenu/BitkitActionMenu';\nimport BitkitButton, {\n type BitkitButtonAsAnchorProps,\n type BitkitButtonAsButtonProps,\n} from '../BitkitButton/BitkitButton';\nimport BitkitIconButton from '../BitkitIconButton/BitkitIconButton';\n\ntype Size = 'lg' | 'md' | 'sm';\ntype Variant = 'primary' | 'secondary';\ntype State = 'disabled' | 'loading' | 'skeleton';\n\nconst isValidActionItem = (child: ReactNode): child is ReactElement => {\n return isValidElement(child) && child.type === BitkitSplitButtonAction;\n};\n\nconst isValidMenuItem = (child: ReactNode): child is ReactElement => {\n return (\n isValidElement(child) &&\n (child.type === BitkitActionMenu.Group ||\n child.type === BitkitActionMenu.Item ||\n child.type === BitkitActionMenu.Separator)\n );\n};\n\n// --- Context ---\ninterface SplitButtonContext {\n size: Size;\n variant: Variant;\n state: State | undefined;\n styles: Record<string, SystemStyleObject>;\n}\n\nconst [SplitButtonProvider, useSplitButtonContext] = createContext<SplitButtonContext>({\n name: 'SplitButtonContext',\n hookName: 'useSplitButtonContext',\n providerName: '<BitkitSplitButton />',\n});\n\n// --- Action ---\n// Split-button action can be a button (default) or anchor (when href is set). asChild is intentionally\n// not part of the API — routing-library elements don't fit cleanly into the Group attached layout.\n// The forwarded ref is HTMLElement so it covers both <button> and <a>.\ntype BitkitSplitButtonActionProps = Omit<\n BitkitButtonAsButtonProps | BitkitButtonAsAnchorProps,\n 'size' | 'variant' | 'state'\n>;\n\nconst BitkitSplitButtonAction = forwardRef<HTMLElement, BitkitSplitButtonActionProps>((props, ref) => {\n const { size, state, styles, variant } = useSplitButtonContext();\n\n if (props.href !== undefined) {\n // Anchor branch: BitkitButton's anchor variant doesn't allow state=\"loading\". Coerce to \"disabled\"\n // so a SplitButton-wide loading state still surfaces visually on a link-mode action.\n return (\n <BitkitButton\n {...(props as BitkitButtonAsAnchorProps)}\n css={styles.action}\n ref={ref}\n size={size}\n state={state === 'loading' ? 'disabled' : state}\n variant={variant}\n />\n );\n }\n\n return (\n <BitkitButton\n {...(props as BitkitButtonAsButtonProps)}\n css={styles.action}\n ref={ref}\n size={size}\n state={state}\n variant={variant}\n />\n );\n});\n\nBitkitSplitButtonAction.displayName = 'BitkitSplitButtonAction';\n\n// --- Root ---\nexport type BitkitSplitButtonProps = PropsWithChildren<\n Omit<GroupProps, 'attached' | 'children' | 'display'> & {\n size?: Size;\n variant?: Variant;\n state?: State;\n }\n>;\n\nconst BitkitSplitButton = forwardRef<HTMLDivElement, BitkitSplitButtonProps>((props, ref) => {\n const { children, size = 'lg', state, variant = 'primary', ...rest } = props;\n\n const childArray = flattenChildren(children);\n const actionChild = childArray.find(isValidActionItem);\n const menuItems = childArray.filter(isValidMenuItem);\n\n const menuSize = size === 'lg' ? 'lg' : 'md';\n const recipe = useSlotRecipe({ key: 'splitButton' });\n const styles = recipe({ variant });\n\n return (\n <SplitButtonProvider value={{ size, state, styles, variant }}>\n <Skeleton asChild loading={state === 'skeleton'}>\n <Group ref={ref} {...rest} attached display=\"inline-flex\">\n {actionChild}\n <BitkitActionMenu\n size={menuSize}\n trigger={\n <BitkitIconButton\n css={styles.trigger}\n icon={IconChevronDown}\n label=\"Toggle menu\"\n size={size}\n state={state === 'loading' ? 'disabled' : state}\n variant={variant}\n />\n }\n positioning={{ placement: 'bottom-end' }}\n >\n {menuItems}\n </BitkitActionMenu>\n </Group>\n </Skeleton>\n </SplitButtonProvider>\n );\n});\nBitkitSplitButton.displayName = 'BitkitSplitButton';\n\nexport default withSubComponents(BitkitSplitButton, {\n Action: BitkitSplitButtonAction,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OAAD;IAAY;IAAK,GAAI;IAAM,UAAA;IAAS,SAAQ;IAA5C,UAAA,CACG,aACD,oBAACD,0BAAD;KACE,MAAM;KACN,SACE,oBAAC,kBAAD;MACE,KAAK,OAAO;MACZ,MAAM;MACN,OAAM;MACA;MACN,OAAO,UAAU,YAAY,aAAa;MACjC;KACV,CAAA;KAEH,aAAa,EAAE,WAAW,aAAa;KAEtC,UAAA;IACe,CAAA,CACb;;EACC,CAAA;CACS,CAAA;AAEzB,CAAC;AACD,kBAAkB,cAAc;AAEhC,IAAA,4BAAe,kBAAkB,mBAAmB;CAClD,QAAQ;CACR,OAAOA,yBAAiB;CACxB,MAAMA,yBAAiB;CACvB,WAAWA,yBAAiB;AAC9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitStat.js","names":[],"sources":["../../../lib/components/BitkitStat/BitkitStat.tsx"],"sourcesContent":["import { type BoxProps } from '@chakra-ui/react/box';\nimport { Skeleton } from '@chakra-ui/react/skeleton';\nimport { chakra, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef } from 'react';\n\nimport { IconArrowDown, IconArrowUp, IconInfoCircle } from '../../icons';\nimport BitkitTooltip from '../BitkitTooltip/BitkitTooltip';\n\n// --- Types ---\n\nexport type TrendColor = 'positive' | 'negative' | 'neutral';\nexport type TrendDirection = 'up' | 'down';\nexport type TrendTextPlacement = 'below' | 'inline';\n\nconst TREND_COLORS = {\n positive: { text: 'text/positive', icon: 'icon/positive' },\n negative: { text: 'text/negative', icon: 'icon/negative' },\n neutral: { text: 'text/secondary', icon: 'icon/tertiary' },\n} as const;\n\nconst TREND_ICONS = { up: IconArrowUp, down: IconArrowDown } as const;\nconst DEFAULT_COLORS: Record<TrendDirection, TrendColor> = { up: 'positive', down: 'negative' };\n\nconst resolveTrend = (trendColor?: TrendColor, trendDirection?: TrendDirection) => {\n const color = trendColor ?? (trendDirection ? DEFAULT_COLORS[trendDirection] : undefined);\n const colors = color ? TREND_COLORS[color] : undefined;\n return {\n textColor: colors?.text ?? 'text/secondary',\n iconColor: colors?.icon ?? 'icon/tertiary',\n Icon: trendDirection ? TREND_ICONS[trendDirection] : undefined,\n };\n};\n\nconst BELOW_ICON_SIZES = { lg: '16', '2xl': '24', '3xl': '24' } as const;\nconst INLINE_TREND_STYLES = {\n lg: { paddingBlockStart: '2' },\n '2xl': { paddingBlockStart: '6' },\n '3xl': { paddingBlockEnd: '4' },\n} as const;\nconst SKELETON_VALUE_HEIGHTS = { lg: '24', '2xl': '36px', '3xl': '40' } as const;\n\nexport interface BitkitStatProps extends Omit<BoxProps, 'colorPalette'> {\n label: string;\n placeholder?: string;\n size?: 'lg' | '2xl' | '3xl';\n state?: 'default' | 'skeleton';\n subtext?: string;\n tooltip?: string;\n trendColor?: TrendColor;\n trendDirection?: TrendDirection;\n trendText?: string;\n trendTextPlacement?: TrendTextPlacement;\n value?: string;\n variant?: 'default' | 'compact';\n}\n\n// --- Component ---\n\nconst BitkitStat = forwardRef<HTMLElement, BitkitStatProps>((props, ref) => {\n const {\n label,\n placeholder = 'N/A',\n size = 'lg',\n state = 'default',\n subtext,\n tooltip,\n trendColor,\n trendDirection,\n trendText,\n trendTextPlacement = 'below',\n value,\n variant = 'default',\n ...rest\n } = props;\n\n const styles = useSlotRecipe({ key: 'stat' })({ size, variant });\n const trend = resolveTrend(trendColor, trendDirection);\n const { Icon: TrendIcon } = trend;\n const isCompact = variant === 'compact';\n\n // --- Compact ---\n if (isCompact) {\n if (state === 'skeleton') {\n return (\n <chakra.div css={styles.root} ref={ref} {...(rest as Record<string, unknown>)}>\n <Skeleton height=\"20\" width=\"64\" />\n <Skeleton height=\"16\" width=\"48\" />\n </chakra.div>\n );\n }\n\n return (\n <chakra.div css={styles.root} ref={ref} {...(rest as Record<string, unknown>)}>\n <chakra.span css={styles.value}>\n {!value ? (\n <chakra.span color=\"text/tertiary\">{placeholder}</chakra.span>\n ) : (\n <>\n {!!TrendIcon && <TrendIcon size=\"16\" color={trend.iconColor} />}\n {value}\n </>\n )}\n </chakra.span>\n {!!value && !!trendText && (\n <chakra.span css={styles.helpText} color={trend.textColor}>\n {trendText}\n </chakra.span>\n )}\n </chakra.div>\n );\n }\n\n // --- Default ---\n\n const labelContent = (\n <chakra.dt css={styles.label}>\n {label}\n {!!tooltip && (\n <BitkitTooltip text={tooltip}>\n <IconInfoCircle size=\"16\" color=\"icon/tertiary\" />\n </BitkitTooltip>\n )}\n </chakra.dt>\n );\n\n if (state === 'skeleton') {\n return (\n <chakra.dl css={styles.root} ref={ref} {...(rest as Record<string, unknown>)}>\n {labelContent}\n <Skeleton height={SKELETON_VALUE_HEIGHTS[size]} width=\"128\" />\n <Skeleton height=\"20\" width=\"128\" />\n </chakra.dl>\n );\n }\n\n const isInline = trendTextPlacement === 'inline';\n const showTrendText = !!value && !isInline && !!trendText;\n const showHelpText = showTrendText || !!subtext;\n\n return (\n <chakra.dl css={styles.root} ref={ref} {...(rest as Record<string, unknown>)}>\n {labelContent}\n\n <chakra.dd css={styles.value} alignItems={isInline && size === '3xl' ? 'flex-end' : undefined}>\n {!value ? (\n <chakra.span color=\"text/tertiary\">{placeholder}</chakra.span>\n ) : (\n <>\n {value}\n {isInline ? (\n <chakra.span display=\"inline-flex\" gap=\"4\" alignItems=\"center\" css={INLINE_TREND_STYLES[size]}>\n {!!TrendIcon && <TrendIcon size=\"16\" color={trend.iconColor} />}\n {!!trendText && (\n <chakra.span color={trend.textColor} textStyle=\"body/md/regular\">\n {trendText}\n </chakra.span>\n )}\n </chakra.span>\n ) : (\n !!TrendIcon && <TrendIcon size={BELOW_ICON_SIZES[size]} color={trend.iconColor} />\n )}\n </>\n )}\n </chakra.dd>\n\n {showHelpText && (\n <chakra.dd css={styles.helpText}>\n {showTrendText && <chakra.span color={trend.textColor}>{trendText}</chakra.span>}\n {!!subtext && <chakra.span color=\"text/tertiary\">{subtext}</chakra.span>}\n </chakra.dd>\n )}\n </chakra.dl>\n );\n});\n\nBitkitStat.displayName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W;GAAK,GAAK;GAA7C,UAAA,CACE,oBAAC,UAAD;IAAU,QAAO;IAAK,OAAM;GAAM,CAAA,GAClC,oBAAC,UAAD;IAAU,QAAO;IAAK,OAAM;GAAM,CAAA,CACxB;;EAIhB,OACE,qBAAC,OAAO,KAAR;GAAY,KAAK,OAAO;GAAW;GAAK,GAAK;GAA7C,UAAA,CACE,oBAAC,OAAO,MAAR;IAAa,KAAK,OAAO;IACtB,UAAA,CAAC,QACA,oBAAC,OAAO,MAAR;KAAa,OAAM;KAAiB,UAAA;IAAyB,CAAA,IAE7D,
|
|
1
|
+
{"version":3,"file":"BitkitStat.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitStat/BitkitStat.tsx"],"sourcesContent":["import { type BoxProps } from '@chakra-ui/react/box';\nimport { Skeleton } from '@chakra-ui/react/skeleton';\nimport { chakra, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef } from 'react';\n\nimport { IconArrowDown, IconArrowUp, IconInfoCircle } from '../../icons';\nimport BitkitTooltip from '../BitkitTooltip/BitkitTooltip';\n\n// --- Types ---\n\nexport type TrendColor = 'positive' | 'negative' | 'neutral';\nexport type TrendDirection = 'up' | 'down';\nexport type TrendTextPlacement = 'below' | 'inline';\n\nconst TREND_COLORS = {\n positive: { text: 'text/positive', icon: 'icon/positive' },\n negative: { text: 'text/negative', icon: 'icon/negative' },\n neutral: { text: 'text/secondary', icon: 'icon/tertiary' },\n} as const;\n\nconst TREND_ICONS = { up: IconArrowUp, down: IconArrowDown } as const;\nconst DEFAULT_COLORS: Record<TrendDirection, TrendColor> = { up: 'positive', down: 'negative' };\n\nconst resolveTrend = (trendColor?: TrendColor, trendDirection?: TrendDirection) => {\n const color = trendColor ?? (trendDirection ? DEFAULT_COLORS[trendDirection] : undefined);\n const colors = color ? TREND_COLORS[color] : undefined;\n return {\n textColor: colors?.text ?? 'text/secondary',\n iconColor: colors?.icon ?? 'icon/tertiary',\n Icon: trendDirection ? TREND_ICONS[trendDirection] : undefined,\n };\n};\n\nconst BELOW_ICON_SIZES = { lg: '16', '2xl': '24', '3xl': '24' } as const;\nconst INLINE_TREND_STYLES = {\n lg: { paddingBlockStart: '2' },\n '2xl': { paddingBlockStart: '6' },\n '3xl': { paddingBlockEnd: '4' },\n} as const;\nconst SKELETON_VALUE_HEIGHTS = { lg: '24', '2xl': '36px', '3xl': '40' } as const;\n\nexport interface BitkitStatProps extends Omit<BoxProps, 'colorPalette'> {\n label: string;\n placeholder?: string;\n size?: 'lg' | '2xl' | '3xl';\n state?: 'default' | 'skeleton';\n subtext?: string;\n tooltip?: string;\n trendColor?: TrendColor;\n trendDirection?: TrendDirection;\n trendText?: string;\n trendTextPlacement?: TrendTextPlacement;\n value?: string;\n variant?: 'default' | 'compact';\n}\n\n// --- Component ---\n\nconst BitkitStat = forwardRef<HTMLElement, BitkitStatProps>((props, ref) => {\n const {\n label,\n placeholder = 'N/A',\n size = 'lg',\n state = 'default',\n subtext,\n tooltip,\n trendColor,\n trendDirection,\n trendText,\n trendTextPlacement = 'below',\n value,\n variant = 'default',\n ...rest\n } = props;\n\n const styles = useSlotRecipe({ key: 'stat' })({ size, variant });\n const trend = resolveTrend(trendColor, trendDirection);\n const { Icon: TrendIcon } = trend;\n const isCompact = variant === 'compact';\n\n // --- Compact ---\n if (isCompact) {\n if (state === 'skeleton') {\n return (\n <chakra.div css={styles.root} ref={ref} {...(rest as Record<string, unknown>)}>\n <Skeleton height=\"20\" width=\"64\" />\n <Skeleton height=\"16\" width=\"48\" />\n </chakra.div>\n );\n }\n\n return (\n <chakra.div css={styles.root} ref={ref} {...(rest as Record<string, unknown>)}>\n <chakra.span css={styles.value}>\n {!value ? (\n <chakra.span color=\"text/tertiary\">{placeholder}</chakra.span>\n ) : (\n <>\n {!!TrendIcon && <TrendIcon size=\"16\" color={trend.iconColor} />}\n {value}\n </>\n )}\n </chakra.span>\n {!!value && !!trendText && (\n <chakra.span css={styles.helpText} color={trend.textColor}>\n {trendText}\n </chakra.span>\n )}\n </chakra.div>\n );\n }\n\n // --- Default ---\n\n const labelContent = (\n <chakra.dt css={styles.label}>\n {label}\n {!!tooltip && (\n <BitkitTooltip text={tooltip}>\n <IconInfoCircle size=\"16\" color=\"icon/tertiary\" />\n </BitkitTooltip>\n )}\n </chakra.dt>\n );\n\n if (state === 'skeleton') {\n return (\n <chakra.dl css={styles.root} ref={ref} {...(rest as Record<string, unknown>)}>\n {labelContent}\n <Skeleton height={SKELETON_VALUE_HEIGHTS[size]} width=\"128\" />\n <Skeleton height=\"20\" width=\"128\" />\n </chakra.dl>\n );\n }\n\n const isInline = trendTextPlacement === 'inline';\n const showTrendText = !!value && !isInline && !!trendText;\n const showHelpText = showTrendText || !!subtext;\n\n return (\n <chakra.dl css={styles.root} ref={ref} {...(rest as Record<string, unknown>)}>\n {labelContent}\n\n <chakra.dd css={styles.value} alignItems={isInline && size === '3xl' ? 'flex-end' : undefined}>\n {!value ? (\n <chakra.span color=\"text/tertiary\">{placeholder}</chakra.span>\n ) : (\n <>\n {value}\n {isInline ? (\n <chakra.span display=\"inline-flex\" gap=\"4\" alignItems=\"center\" css={INLINE_TREND_STYLES[size]}>\n {!!TrendIcon && <TrendIcon size=\"16\" color={trend.iconColor} />}\n {!!trendText && (\n <chakra.span color={trend.textColor} textStyle=\"body/md/regular\">\n {trendText}\n </chakra.span>\n )}\n </chakra.span>\n ) : (\n !!TrendIcon && <TrendIcon size={BELOW_ICON_SIZES[size]} color={trend.iconColor} />\n )}\n </>\n )}\n </chakra.dd>\n\n {showHelpText && (\n <chakra.dd css={styles.helpText}>\n {showTrendText && <chakra.span color={trend.textColor}>{trendText}</chakra.span>}\n {!!subtext && <chakra.span color=\"text/tertiary\">{subtext}</chakra.span>}\n </chakra.dd>\n )}\n </chakra.dl>\n );\n});\n\nBitkitStat.displayName = 'BitkitStat';\n\nexport default BitkitStat;\n"],"mappings":";;;;;;;;;AAcA,IAAM,eAAe;CACnB,UAAU;EAAE,MAAM;EAAiB,MAAM;CAAgB;C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AQ,aAAa,KAAA;IACjF,UAAA,CAAC,QACA,oBAAC,OAAO,MAAR;KAAa,OAAM;KAAiB,UAAA;IAAyB,CAAA,IAE7D,qBAAAA,YAAA,EAAA,UAAA,CACG,OACA,WACC,qBAAC,OAAO,MAAR;KAAa,SAAQ;KAAc,KAAI;KAAI,YAAW;KAAS,KAAK,oBAAoB;KAAxF,UAAA,CACG,CAAC,CAAC,aAAa,oBAAC,WAAD;MAAW,MAAK;MAAK,OAAO,MAAM;KAAY,CAAA,GAC7D,CAAC,CAAC,aACD,oBAAC,OAAO,MAAR;MAAa,OAAO,MAAM;MAAW,WAAU;MAC5C,UAAA;KACU,CAAA,CAEJ;IAEb,CAAA,IAAA,CAAC,CAAC,aAAa,oBAAC,WAAD;KAAW,MAAM,iBAAiB;KAAO,OAAO,MAAM;IAAY,CAAA,CAEnF,EAAA,CAAA;GAEK,CAAA;GAEV,gBACC,qBAAC,OAAO,IAAR;IAAW,KAAK,OAAO;IAAvB,UAAA,CACG,iBAAiB,oBAAC,OAAO,MAAR;KAAa,OAAO,MAAM;KAAY,UAAA;IAAuB,CAAA,GAC9E,CAAC,CAAC,WAAW,oBAAC,OAAO,MAAR;KAAa,OAAM;KAAiB,UAAA;IAAqB,CAAA,CAC9D;;EAEJ;;AAEf,CAAC;AAED,WAAW,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitStepsCard.js","names":[],"sources":["../../../lib/components/BitkitStepsCard/BitkitStepsCard.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport {\n Card,\n type CardBodyProps,\n type CardFooterProps,\n type CardHeaderProps,\n type CardRootProps,\n} from '@chakra-ui/react/card';\nimport { useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { Children, cloneElement, forwardRef, isValidElement, type ReactElement, type ReactNode } from 'react';\n\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport { StepCardProvider, useStepCardContext } from './StepCardContext';\n\nconst useStepsCardStyles = () => {\n const recipe = useSlotRecipe({ key: 'stepsCard' });\n return recipe();\n};\n\nexport interface BitkitStepsCardProps extends Omit<CardRootProps, 'children' | 'title'> {\n children: ReactNode;\n step: number;\n}\n\nconst BitkitStepsCard = forwardRef<HTMLDivElement, BitkitStepsCardProps>((props, ref) => {\n const { children, css, step, ...rest } = props;\n const styles = useStepsCardStyles();\n\n return (\n <StepCardProvider value={{ step }}>\n <Card.Root ref={ref} css={[styles.root, css]} unstyled {...rest}>\n {children}\n </Card.Root>\n </StepCardProvider>\n );\n});\n\nBitkitStepsCard.displayName = 'BitkitStepsCard';\n\nexport interface BitkitStepsCardHeaderProps extends Omit<CardHeaderProps, 'children'> {\n children: ReactNode;\n}\n\nconst BitkitStepsCardHeader = forwardRef<HTMLDivElement, BitkitStepsCardHeaderProps>((props, ref) => {\n const { children, css, ...rest } = props;\n const styles = useStepsCardStyles();\n\n return (\n <Card.Header ref={ref} css={[styles.header, css]} {...rest}>\n {children}\n </Card.Header>\n );\n});\n\nBitkitStepsCardHeader.displayName = 'BitkitStepsCardHeader';\n\nexport interface BitkitStepsCardBodyProps extends Omit<CardBodyProps, 'children'> {\n children: ReactNode;\n}\n\nconst BitkitStepsCardBody = forwardRef<HTMLDivElement, BitkitStepsCardBodyProps>((props, ref) => {\n const { children, css, ...rest } = props;\n const styles = useStepsCardStyles();\n\n return (\n <Card.Body ref={ref} css={[styles.body, css]} {...rest}>\n {Children.map(children, (child, index) => {\n if (isValidElement(child)) {\n return cloneElement(child as ReactElement<{ _index?: number }>, { _index: index });\n }\n return child;\n })}\n </Card.Body>\n );\n});\n\nBitkitStepsCardBody.displayName = 'BitkitStepsCardBody';\n\nconst hasContent = (node: ReactNode) => node !== null && node !== undefined && node !== '';\n\nexport interface BitkitStepsCardStepProps {\n children?: ReactNode;\n description?: ReactNode;\n title?: ReactNode;\n}\n\ninterface BitkitStepsCardStepInternalProps extends BitkitStepsCardStepProps {\n _index?: number;\n}\n\nconst BitkitStepsCardStep = (props: BitkitStepsCardStepProps) => {\n const { _index = 0, children, description, title } = props as BitkitStepsCardStepInternalProps;\n const { step } = useStepCardContext() ?? { step: 0 };\n const styles = useStepsCardStyles();\n\n if (_index !== step) return null;\n\n const showTitle = hasContent(title);\n const showDescription = hasContent(description);\n\n return (\n <>\n {(showTitle || showDescription) && (\n <Box css={styles.titleGroup}>\n {showTitle && <Card.Title css={styles.title}>{title}</Card.Title>}\n {showDescription && <Card.Description css={styles.description}>{description}</Card.Description>}\n </Box>\n )}\n {children}\n </>\n );\n};\n\nBitkitStepsCardStep.displayName = 'BitkitStepsCardStep';\n\nexport interface BitkitStepsCardFooterProps extends Omit<CardFooterProps, 'children'> {\n children: ReactNode;\n}\n\nconst BitkitStepsCardFooter = forwardRef<HTMLDivElement, BitkitStepsCardFooterProps>((props, ref) => {\n const { children, css, ...rest } = props;\n const styles = useStepsCardStyles();\n\n return (\n <Card.Footer ref={ref} css={[styles.footer, css]} {...rest}>\n {children}\n </Card.Footer>\n );\n});\n\nBitkitStepsCardFooter.displayName = 'BitkitStepsCardFooter';\n\nexport default withSubComponents(BitkitStepsCard, {\n Body: BitkitStepsCardBody,\n Footer: BitkitStepsCardFooter,\n Header: BitkitStepsCardHeader,\n Step: BitkitStepsCardStep,\n});\n"],"mappings":";;;;;;;;AAcA,IAAM,2BAA2B;CAE/B,OADe,cAAc,EAAE,KAAK,YAAY,CACzC,CAAA,CAAO;AAChB;AAOA,IAAM,kBAAkB,YAAkD,OAAO,QAAQ;CACvF,MAAM,EAAE,UAAU,KAAK,MAAM,GAAG,SAAS;CACzC,MAAM,SAAS,mBAAmB;CAElC,OACE,oBAAC,kBAAD;EAAkB,OAAO,EAAE,KAAK;EAC9B,UAAA,oBAAC,KAAK,MAAN;GAAgB;GAAK,KAAK,CAAC,OAAO,MAAM,GAAG;GAAG,UAAA;GAAS,GAAI;GACxD;EACQ,CAAA;CACK,CAAA;AAEtB,CAAC;AAED,gBAAgB,cAAc;AAM9B,IAAM,wBAAwB,YAAwD,OAAO,QAAQ;CACnG,MAAM,EAAE,UAAU,KAAK,GAAG,SAAS;CACnC,MAAM,SAAS,mBAAmB;CAElC,OACE,oBAAC,KAAK,QAAN;EAAkB;EAAK,KAAK,CAAC,OAAO,QAAQ,GAAG;EAAG,GAAI;EACnD;CACU,CAAA;AAEjB,CAAC;AAED,sBAAsB,cAAc;AAMpC,IAAM,sBAAsB,YAAsD,OAAO,QAAQ;CAC/F,MAAM,EAAE,UAAU,KAAK,GAAG,SAAS;CACnC,MAAM,SAAS,mBAAmB;CAElC,OACE,oBAAC,KAAK,MAAN;EAAgB;EAAK,KAAK,CAAC,OAAO,MAAM,GAAG;EAAG,GAAI;EAC/C,UAAA,SAAS,IAAI,WAAW,OAAO,UAAU;GACxC,IAAI,eAAe,KAAK,GACtB,OAAO,aAAa,OAA4C,EAAE,QAAQ,MAAM,CAAC;GAEnF,OAAO;EACT,CAAC;CACQ,CAAA;AAEf,CAAC;AAED,oBAAoB,cAAc;AAElC,IAAM,cAAc,SAAoB,SAAS,QAAQ,SAAS,KAAA,KAAa,SAAS;AAYxF,IAAM,uBAAuB,UAAoC;CAC/D,MAAM,EAAE,SAAS,GAAG,UAAU,aAAa,UAAU;CACrD,MAAM,EAAE,SAAS,mBAAmB,KAAK,EAAE,MAAM,EAAE;CACnD,MAAM,SAAS,mBAAmB;CAElC,IAAI,WAAW,MAAM,OAAO;CAE5B,MAAM,YAAY,WAAW,KAAK;CAClC,MAAM,kBAAkB,WAAW,WAAW;CAE9C,OACE,
|
|
1
|
+
{"version":3,"file":"BitkitStepsCard.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitStepsCard/BitkitStepsCard.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport {\n Card,\n type CardBodyProps,\n type CardFooterProps,\n type CardHeaderProps,\n type CardRootProps,\n} from '@chakra-ui/react/card';\nimport { useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { Children, cloneElement, forwardRef, isValidElement, type ReactElement, type ReactNode } from 'react';\n\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport { StepCardProvider, useStepCardContext } from './StepCardContext';\n\nconst useStepsCardStyles = () => {\n const recipe = useSlotRecipe({ key: 'stepsCard' });\n return recipe();\n};\n\nexport interface BitkitStepsCardProps extends Omit<CardRootProps, 'children' | 'title'> {\n children: ReactNode;\n step: number;\n}\n\nconst BitkitStepsCard = forwardRef<HTMLDivElement, BitkitStepsCardProps>((props, ref) => {\n const { children, css, step, ...rest } = props;\n const styles = useStepsCardStyles();\n\n return (\n <StepCardProvider value={{ step }}>\n <Card.Root ref={ref} css={[styles.root, css]} unstyled {...rest}>\n {children}\n </Card.Root>\n </StepCardProvider>\n );\n});\n\nBitkitStepsCard.displayName = 'BitkitStepsCard';\n\nexport interface BitkitStepsCardHeaderProps extends Omit<CardHeaderProps, 'children'> {\n children: ReactNode;\n}\n\nconst BitkitStepsCardHeader = forwardRef<HTMLDivElement, BitkitStepsCardHeaderProps>((props, ref) => {\n const { children, css, ...rest } = props;\n const styles = useStepsCardStyles();\n\n return (\n <Card.Header ref={ref} css={[styles.header, css]} {...rest}>\n {children}\n </Card.Header>\n );\n});\n\nBitkitStepsCardHeader.displayName = 'BitkitStepsCardHeader';\n\nexport interface BitkitStepsCardBodyProps extends Omit<CardBodyProps, 'children'> {\n children: ReactNode;\n}\n\nconst BitkitStepsCardBody = forwardRef<HTMLDivElement, BitkitStepsCardBodyProps>((props, ref) => {\n const { children, css, ...rest } = props;\n const styles = useStepsCardStyles();\n\n return (\n <Card.Body ref={ref} css={[styles.body, css]} {...rest}>\n {Children.map(children, (child, index) => {\n if (isValidElement(child)) {\n return cloneElement(child as ReactElement<{ _index?: number }>, { _index: index });\n }\n return child;\n })}\n </Card.Body>\n );\n});\n\nBitkitStepsCardBody.displayName = 'BitkitStepsCardBody';\n\nconst hasContent = (node: ReactNode) => node !== null && node !== undefined && node !== '';\n\nexport interface BitkitStepsCardStepProps {\n children?: ReactNode;\n description?: ReactNode;\n title?: ReactNode;\n}\n\ninterface BitkitStepsCardStepInternalProps extends BitkitStepsCardStepProps {\n _index?: number;\n}\n\nconst BitkitStepsCardStep = (props: BitkitStepsCardStepProps) => {\n const { _index = 0, children, description, title } = props as BitkitStepsCardStepInternalProps;\n const { step } = useStepCardContext() ?? { step: 0 };\n const styles = useStepsCardStyles();\n\n if (_index !== step) return null;\n\n const showTitle = hasContent(title);\n const showDescription = hasContent(description);\n\n return (\n <>\n {(showTitle || showDescription) && (\n <Box css={styles.titleGroup}>\n {showTitle && <Card.Title css={styles.title}>{title}</Card.Title>}\n {showDescription && <Card.Description css={styles.description}>{description}</Card.Description>}\n </Box>\n )}\n {children}\n </>\n );\n};\n\nBitkitStepsCardStep.displayName = 'BitkitStepsCardStep';\n\nexport interface BitkitStepsCardFooterProps extends Omit<CardFooterProps, 'children'> {\n children: ReactNode;\n}\n\nconst BitkitStepsCardFooter = forwardRef<HTMLDivElement, BitkitStepsCardFooterProps>((props, ref) => {\n const { children, css, ...rest } = props;\n const styles = useStepsCardStyles();\n\n return (\n <Card.Footer ref={ref} css={[styles.footer, css]} {...rest}>\n {children}\n </Card.Footer>\n );\n});\n\nBitkitStepsCardFooter.displayName = 'BitkitStepsCardFooter';\n\nexport default withSubComponents(BitkitStepsCard, {\n Body: BitkitStepsCardBody,\n Footer: BitkitStepsCardFooter,\n Header: BitkitStepsCardHeader,\n Step: BitkitStepsCardStep,\n});\n"],"mappings":";;;;;;;;AAcA,IAAM,2BAA2B;CAE/B,OADe,cAAc,EAAE,KAAK,YAAY,CACzC,CAAA,CAAO;AAChB;AAOA,IAAM,kBAAkB,YAAkD,OAAO,QAAQ;CACvF,MAAM,EAAE,UAAU,KAAK,MAAM,GAAG,SAAS;CACzC,MAAM,SAAS,mBAAmB;CAElC,OACE,oBAAC,kBAAD;EAAkB,OAAO,EAAE,KAAK;EAC9B,UAAA,oBAAC,KAAK,MAAN;GAAgB;GAAK,KAAK,CAAC,OAAO,MAAM,GAAG;GAAG,UAAA;GAAS,GAA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,OAAO;GAAc,UAAA;EAA8B,CAAA,CAC3F;CAEN,CAAA,GAAA,QACD,EAAA,CAAA;AAEN;AAEA,oBAAoB,cAAc;AAMlC,IAAM,wBAAwB,YAAwD,OAAO,QAAQ;CACnG,MAAM,EAAE,UAAU,KAAK,GAAG,SAAS;CACnC,MAAM,SAAS,mBAAmB;CAElC,OACE,oBAAC,KAAK,QAAN;EAAkB;EAAK,KAAK,CAAC,OAAO,QAAQ,GAAG;EAAG,GAAI;EACnD;CACU,CAAA;AAEjB,CAAC;AAED,sBAAsB,cAAc;AAEpC,IAAA,0BAAe,kBAAkB,iBAAiB;CAChD,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,MAAM;AACR,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitExpandableRow.js","names":[],"sources":["../../../lib/components/BitkitTable/BitkitExpandableRow.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Collapsible } from '@chakra-ui/react/collapsible';\nimport { Table, useTableStyles } from '@chakra-ui/react/table';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport AssetSelectChevron from '../../utilities/AssetSelectChevron';\n\nexport interface BitkitExpandableRowProps {\n children: ReactNode;\n colSpan: number;\n defaultOpen?: boolean;\n expandedContent: ReactNode;\n}\n\nconst BitkitExpandableRow = forwardRef<HTMLTableRowElement, BitkitExpandableRowProps>(\n ({ children, colSpan, defaultOpen = false, expandedContent }, ref) => {\n const styles = useTableStyles();\n\n return (\n <Collapsible.Root asChild defaultOpen={defaultOpen}>\n <>\n <Table.Row ref={ref} css={styles.expandableRow}>\n <Table.Cell css={styles.expandCell}>\n <Collapsible.Trigger aria-label=\"Toggle row details\" css={styles.expandTrigger}>\n <Collapsible.Indicator asChild>\n <AssetSelectChevron color=\"button/secondary/text\" />\n </Collapsible.Indicator>\n </Collapsible.Trigger>\n </Table.Cell>\n {children}\n </Table.Row>\n <Table.Row css={styles.expandedRow}>\n <Table.Cell colSpan={colSpan} css={styles.expandedCell}>\n <Collapsible.Content>\n <Box css={styles.expandedContent}>{expandedContent}</Box>\n </Collapsible.Content>\n </Table.Cell>\n </Table.Row>\n </>\n </Collapsible.Root>\n );\n },\n);\n\nBitkitExpandableRow.displayName = 'BitkitTable.ExpandableRow';\n\nexport default BitkitExpandableRow;\n"],"mappings":";;;;;;;AAcA,IAAM,sBAAsB,YACzB,EAAE,UAAU,SAAS,cAAc,OAAO,mBAAmB,QAAQ;CACpE,MAAM,SAAS,eAAe;CAE9B,OACE,oBAAC,YAAY,MAAb;EAAkB,SAAA;EAAqB;EACrC,UAAA,
|
|
1
|
+
{"version":3,"file":"BitkitExpandableRow.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitTable/BitkitExpandableRow.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Collapsible } from '@chakra-ui/react/collapsible';\nimport { Table, useTableStyles } from '@chakra-ui/react/table';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport AssetSelectChevron from '../../utilities/AssetSelectChevron';\n\nexport interface BitkitExpandableRowProps {\n children: ReactNode;\n colSpan: number;\n defaultOpen?: boolean;\n expandedContent: ReactNode;\n}\n\nconst BitkitExpandableRow = forwardRef<HTMLTableRowElement, BitkitExpandableRowProps>(\n ({ children, colSpan, defaultOpen = false, expandedContent }, ref) => {\n const styles = useTableStyles();\n\n return (\n <Collapsible.Root asChild defaultOpen={defaultOpen}>\n <>\n <Table.Row ref={ref} css={styles.expandableRow}>\n <Table.Cell css={styles.expandCell}>\n <Collapsible.Trigger aria-label=\"Toggle row details\" css={styles.expandTrigger}>\n <Collapsible.Indicator asChild>\n <AssetSelectChevron color=\"button/secondary/text\" />\n </Collapsible.Indicator>\n </Collapsible.Trigger>\n </Table.Cell>\n {children}\n </Table.Row>\n <Table.Row css={styles.expandedRow}>\n <Table.Cell colSpan={colSpan} css={styles.expandedCell}>\n <Collapsible.Content>\n <Box css={styles.expandedContent}>{expandedContent}</Box>\n </Collapsible.Content>\n </Table.Cell>\n </Table.Row>\n </>\n </Collapsible.Root>\n );\n },\n);\n\nBitkitExpandableRow.displayName = 'BitkitTable.ExpandableRow';\n\nexport default BitkitExpandableRow;\n"],"mappings":";;;;;;;AAcA,IAAM,sBAAsB,YACzB,EAAE,UAAU,SAAS,cAAc,OAAO,mBAAmB,QAAQ;CACpE,MAAM,SAAS,eAAe;CAE9B,OACE,oBAAC,YAAY,MAAb;EAAkB,SAAA;EAAqB;EACrC,UAAA,qBAAAA,YAAA,EAAA,UAAA,CACE,qBAAC,MAAM,KAAP;GAAgB;GAAK,KAAK,OAAO;GAAjC,UAAA,CACE,oBAAC,MAAM,MAAP;IAAY,KAAK,OAAO;IACtB,UAAA,oBAAC,YAAY,SAAb;KAAqB,cAAW;KAAqB,KAAK,OAAO;KAC/D,UAAA,oBAAC,YAAY,WAAb;MAAuB,SAAA;MACrB,UAAA,oBAAC,oBAAD,EAAoB,OAAM,wBAAyB,CAAA;KAC9B,CAAA;IACJ,CAAA;GACX,CAAA,GACX,QACQ;EACX,CAAA,GAAA,oBAAC,MAAM,KAAP;GAAW,KAAK,OAAO;GACrB,UAAA,oBAAC,MAAM,MAAP;IAAqB;IAAS,KAAK,OAAO;IACxC,UAAA,oBAAC,YAAY,SAAb,EAAA,UACE,oBAAC,KAAD;KAAK,KAAK,OAAO;KAAkB,UAAA;IAAqB,CAAA,EACrC,CAAA;GACX,CAAA;EACH,CAAA,CACX,EAAA,CAAA;CACc,CAAA;AAEtB,CACF;AAEA,oBAAoB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitRowActionsCell.js","names":[],"sources":["../../../lib/components/BitkitTable/BitkitRowActionsCell.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Table, useTableStyles } from '@chakra-ui/react/table';\nimport { forwardRef, type MouseEvent } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport IconMoreVertical from '../../icons/IconMoreVertical';\nimport BitkitActionMenu from '../BitkitActionMenu/BitkitActionMenu';\nimport BitkitControlButton from '../BitkitControlButton/BitkitControlButton';\n\n/** One row action, rendered either as an inline control button or as an action menu item. */\nexport interface BitkitRowAction {\n /** Renders the action in the danger color set. */\n danger?: boolean;\n /** Makes the action a link instead of a button. */\n href?: string;\n icon: BitkitIconComponent;\n /** Only with `href`: opens the link in a new tab and adds the external-link affordance. */\n isExternal?: boolean;\n /** Accessible name of the inline button, and the visible text of the menu item. Must be unique\n * within `actions`, since it keys the list. */\n label: string;\n onClick?: (event: MouseEvent<HTMLElement>) => void;\n /**\n * `disabled` makes this one action inert. `skeleton` marks it as in flight: an inline action\n * shimmers in place, and in the collapsed menu the trigger shimmers instead — the state belongs\n * to the row, and the items sit behind a closed menu. Menu items are inert under either state.\n */\n state?: 'disabled' | 'skeleton';\n}\n\nexport interface BitkitRowActionsCellProps extends Omit<Table.CellProps, 'children' | 'onClick'> {\n /** Up to two actions render as inline icon buttons; three or more collapse into an action menu. */\n actions: BitkitRowAction[];\n /** Accessible name of the action menu trigger, used from the third action on. Default: `More actions` */\n menuLabel?: string;\n}\n\nconst MAX_INLINE_ACTIONS = 2;\n\nconst InlineAction = ({ action }: { action: BitkitRowAction }) => {\n if (action.href !== undefined) {\n return (\n <BitkitControlButton\n href={action.href}\n icon={action.icon}\n isDanger={action.danger}\n isExternal={action.isExternal}\n label={action.label}\n onClick={action.onClick}\n state={action.state}\n />\n );\n }\n\n return (\n <BitkitControlButton\n icon={action.icon}\n isDanger={action.danger}\n label={action.label}\n onClick={action.onClick}\n state={action.state}\n />\n );\n};\n\nconst MenuAction = ({ action }: { action: BitkitRowAction }) => {\n if (action.href !== undefined) {\n return (\n <BitkitActionMenu.Item\n disabled={action.state !== undefined}\n href={action.href}\n icon={action.icon}\n isDanger={action.danger}\n isExternal={action.isExternal}\n onClick={action.onClick}\n value={action.label}\n >\n {action.label}\n </BitkitActionMenu.Item>\n );\n }\n\n return (\n <BitkitActionMenu.Item\n disabled={action.state !== undefined}\n icon={action.icon}\n isDanger={action.danger}\n onClick={action.onClick}\n value={action.label}\n >\n {action.label}\n </BitkitActionMenu.Item>\n );\n};\n\n/**\n * The trailing cell of a table row, holding its actions. The column shrinks to fit the buttons.\n *\n * Up to two actions render as inline icon buttons; from the third on they collapse into a single\n * action menu, so the column width stays predictable. Clicks are kept inside the cell, so the\n * actions work in a `BitkitTable.LinkedRow` without triggering the row link.\n *\n * @example\n * ```tsx\n * <BitkitTable.RowActionsCell\n * actions={[\n * { icon: IconPencil, label: 'Edit', onClick: onEdit },\n * { danger: true, icon: IconMinusCircle, label: 'Remove', onClick: onRemove },\n * ]}\n * />\n * ```\n */\nconst BitkitRowActionsCell = forwardRef<HTMLTableCellElement, BitkitRowActionsCellProps>((props, ref) => {\n const { actions, css, menuLabel = 'More actions', ...rest } = props;\n const styles = useTableStyles();\n const isPending = actions.some((action) => action.state === 'skeleton');\n\n return (\n <Table.Cell ref={ref} css={[styles.actionsCell, css]} {...rest}>\n <Box css={styles.actionsGroup} onClick={(event) => event.stopPropagation()}>\n {actions.length <= MAX_INLINE_ACTIONS ? (\n actions.map((action) => <InlineAction key={action.label} action={action} />)\n ) : (\n <BitkitActionMenu\n size=\"md\"\n trigger={\n <BitkitControlButton\n icon={IconMoreVertical}\n label={menuLabel}\n state={isPending ? 'skeleton' : undefined}\n />\n }\n >\n {actions.map((action) => (\n <MenuAction key={action.label} action={action} />\n ))}\n </BitkitActionMenu>\n )}\n </Box>\n </Table.Cell>\n );\n});\n\nBitkitRowActionsCell.displayName = 'BitkitTable.RowActionsCell';\n\nexport default BitkitRowActionsCell;\n"],"mappings":";;;;;;;;AAqCA,IAAM,qBAAqB;AAE3B,IAAM,gBAAgB,EAAE,aAA0C;CAChE,IAAI,OAAO,SAAS,KAAA,GAClB,OACE,oBAAC,qBAAD;EACE,MAAM,OAAO;EACb,MAAM,OAAO;EACb,UAAU,OAAO;EACjB,YAAY,OAAO;EACnB,OAAO,OAAO;EACd,SAAS,OAAO;EAChB,OAAO,OAAO;CACf,CAAA;CAIL,OACE,oBAAC,qBAAD;EACE,MAAM,OAAO;EACb,UAAU,OAAO;EACjB,OAAO,OAAO;EACd,SAAS,OAAO;EAChB,OAAO,OAAO;CACf,CAAA;AAEL;AAEA,IAAM,cAAc,EAAE,aAA0C;CAC9D,IAAI,OAAO,SAAS,KAAA,GAClB,OACE,
|
|
1
|
+
{"version":3,"file":"BitkitRowActionsCell.js","names":["BitkitActionMenu"],"sources":["../../../lib/components/BitkitTable/BitkitRowActionsCell.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Table, useTableStyles } from '@chakra-ui/react/table';\nimport { forwardRef, type MouseEvent } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport IconMoreVertical from '../../icons/IconMoreVertical';\nimport BitkitActionMenu from '../BitkitActionMenu/BitkitActionMenu';\nimport BitkitControlButton from '../BitkitControlButton/BitkitControlButton';\n\n/** One row action, rendered either as an inline control button or as an action menu item. */\nexport interface BitkitRowAction {\n /** Renders the action in the danger color set. */\n danger?: boolean;\n /** Makes the action a link instead of a button. */\n href?: string;\n icon: BitkitIconComponent;\n /** Only with `href`: opens the link in a new tab and adds the external-link affordance. */\n isExternal?: boolean;\n /** Accessible name of the inline button, and the visible text of the menu item. Must be unique\n * within `actions`, since it keys the list. */\n label: string;\n onClick?: (event: MouseEvent<HTMLElement>) => void;\n /**\n * `disabled` makes this one action inert. `skeleton` marks it as in flight: an inline action\n * shimmers in place, and in the collapsed menu the trigger shimmers instead — the state belongs\n * to the row, and the items sit behind a closed menu. Menu items are inert under either state.\n */\n state?: 'disabled' | 'skeleton';\n}\n\nexport interface BitkitRowActionsCellProps extends Omit<Table.CellProps, 'children' | 'onClick'> {\n /** Up to two actions render as inline icon buttons; three or more collapse into an action menu. */\n actions: BitkitRowAction[];\n /** Accessible name of the action menu trigger, used from the third action on. Default: `More actions` */\n menuLabel?: string;\n}\n\nconst MAX_INLINE_ACTIONS = 2;\n\nconst InlineAction = ({ action }: { action: BitkitRowAction }) => {\n if (action.href !== undefined) {\n return (\n <BitkitControlButton\n href={action.href}\n icon={action.icon}\n isDanger={action.danger}\n isExternal={action.isExternal}\n label={action.label}\n onClick={action.onClick}\n state={action.state}\n />\n );\n }\n\n return (\n <BitkitControlButton\n icon={action.icon}\n isDanger={action.danger}\n label={action.label}\n onClick={action.onClick}\n state={action.state}\n />\n );\n};\n\nconst MenuAction = ({ action }: { action: BitkitRowAction }) => {\n if (action.href !== undefined) {\n return (\n <BitkitActionMenu.Item\n disabled={action.state !== undefined}\n href={action.href}\n icon={action.icon}\n isDanger={action.danger}\n isExternal={action.isExternal}\n onClick={action.onClick}\n value={action.label}\n >\n {action.label}\n </BitkitActionMenu.Item>\n );\n }\n\n return (\n <BitkitActionMenu.Item\n disabled={action.state !== undefined}\n icon={action.icon}\n isDanger={action.danger}\n onClick={action.onClick}\n value={action.label}\n >\n {action.label}\n </BitkitActionMenu.Item>\n );\n};\n\n/**\n * The trailing cell of a table row, holding its actions. The column shrinks to fit the buttons.\n *\n * Up to two actions render as inline icon buttons; from the third on they collapse into a single\n * action menu, so the column width stays predictable. Clicks are kept inside the cell, so the\n * actions work in a `BitkitTable.LinkedRow` without triggering the row link.\n *\n * @example\n * ```tsx\n * <BitkitTable.RowActionsCell\n * actions={[\n * { icon: IconPencil, label: 'Edit', onClick: onEdit },\n * { danger: true, icon: IconMinusCircle, label: 'Remove', onClick: onRemove },\n * ]}\n * />\n * ```\n */\nconst BitkitRowActionsCell = forwardRef<HTMLTableCellElement, BitkitRowActionsCellProps>((props, ref) => {\n const { actions, css, menuLabel = 'More actions', ...rest } = props;\n const styles = useTableStyles();\n const isPending = actions.some((action) => action.state === 'skeleton');\n\n return (\n <Table.Cell ref={ref} css={[styles.actionsCell, css]} {...rest}>\n <Box css={styles.actionsGroup} onClick={(event) => event.stopPropagation()}>\n {actions.length <= MAX_INLINE_ACTIONS ? (\n actions.map((action) => <InlineAction key={action.label} action={action} />)\n ) : (\n <BitkitActionMenu\n size=\"md\"\n trigger={\n <BitkitControlButton\n icon={IconMoreVertical}\n label={menuLabel}\n state={isPending ? 'skeleton' : undefined}\n />\n }\n >\n {actions.map((action) => (\n <MenuAction key={action.label} action={action} />\n ))}\n </BitkitActionMenu>\n )}\n </Box>\n </Table.Cell>\n );\n});\n\nBitkitRowActionsCell.displayName = 'BitkitTable.RowActionsCell';\n\nexport default BitkitRowActionsCell;\n"],"mappings":";;;;;;;;AAqCA,IAAM,qBAAqB;AAE3B,IAAM,gBAAgB,EAAE,aAA0C;CAChE,IAAI,OAAO,SAAS,KAAA,GAClB,OACE,oBAAC,qBAAD;EACE,MAAM,OAAO;EACb,MAAM,OAAO;EACb,UAAU,OAAO;EACjB,YAAY,OAAO;EACnB,OAAO,OAAO;EACd,SAAS,OAAO;EAChB,OAAO,OAAO;CACf,CAAA;CAIL,OACE,oBAAC,qBAAD;EACE,MAAM,OAAO;EACb,UAAU,OAAO;EACjB,OAAO,OAAO;EACd,SAAS,OAAO;EAChB,OAAO,OAAO;CACf,CAAA;AAEL;AAEA,IAAM,cAAc,EAAE,aAA0C;CAC9D,IAAI,OAAO,SAAS,KAAA,GAClB,OACE,oBAACA,yBAAiB,MAAlB;EACE,UAAU,OAAO,UAAU,KAAA;EAC3B,MAAM,OAAO;EACb,MAAM,OAAO;EACb,UAAU,OAAO;EACjB,YAAY,OAAO;EACnB,SAAS,OAAO;EAChB,OAAO,OAAO;EAEb,UAAA,OAAO;CACa,CAAA;CAI3B,OACE,oBAACA,yBAAiB,MAAlB;EACE,UAAU,OAAO,UAAU,KAAA;EAC3B,MAAM,OAAO;EACb,UAAU,OAAO;EACjB,SAAS,OAAO;EAChB,OAAO,OAAO;EAEb,UAAA,OAAO;CACa,CAAA;AAE3B;;;;;;;;;;;;;;;;;;AAmBA,IAAM,uBAAuB,YAA6D,OAAO,QAAQ;CACvG,MAAM,EAAE,SAAS,KAAK,YAAY,gBAAgB,GAAG,SAAS;CAC9D,MAAM,SAAS,eAAe;CAC9B,MAAM,YAAY,QAAQ,MAAM,WAAW,OAAO,UAAU,UAAU;CAEtE,OACE,oBAAC,MAAM,MAAP;EAAiB;EAAK,KAAK,CAAC,OAAO,aAAa,GAAG;EAAG,GAAI;EACxD,UAAA,oBAAC,KAAD;GAAK,KAAK,OAAO;GAAc,UAAU,UAAU,MAAM,gBAAgB;GACtE,UAAA,QAAQ,UAAU,qBACjB,QAAQ,KAAK,WAAW,oBAAC,cAAD,EAAyC,OAAS,GAA/B,OAAO,KAAwB,CAAC,IAE3E,oBAACA,0BAAD;IACE,MAAK;IACL,SACE,oBAAC,qBAAD;KACE,MAAM;KACN,OAAO;KACP,OAAO,YAAY,aAAa,KAAA;IACjC,CAAA;IAGF,UAAA,QAAQ,KAAK,WACZ,oBAAC,YAAD,EAAuC,OAAS,GAA/B,OAAO,KAAwB,CACjD;GACe,CAAA;EAEjB,CAAA;CACK,CAAA;AAEhB,CAAC;AAED,qBAAqB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitSortableColumnHeader.js","names":[],"sources":["../../../lib/components/BitkitTable/BitkitSortableColumnHeader.tsx"],"sourcesContent":["import { Icon, type IconProps } from '@chakra-ui/react/icon';\nimport { chakra } from '@chakra-ui/react/styled-system';\nimport { Table, useTableStyles } from '@chakra-ui/react/table';\nimport { forwardRef, type Ref } from 'react';\n\ntype SortDirection = 'ascending' | 'descending' | 'none';\n\nexport interface BitkitSortableColumnHeaderProps extends Omit<Table.ColumnHeaderProps, 'aria-sort' | 'onClick'> {\n direction: SortDirection;\n onSort: () => void;\n}\n\nconst SortIcon = forwardRef((props: IconProps & { direction: SortDirection }, ref: Ref<SVGSVGElement>) => {\n const { direction, ...rest } = props;\n const upFill = direction === 'ascending' ? 'currentColor' : 'var(--sort-icon-inactive)';\n const downFill = direction === 'descending' ? 'currentColor' : 'var(--sort-icon-inactive)';\n\n return (\n <Icon\n ref={ref}\n asChild\n css={{\n '--sort-icon-inactive': 'colors.icon/disabled',\n color: 'icon/primary',\n display: 'inline-block',\n verticalAlign: 'middle',\n }}\n {...rest}\n >\n <svg fill=\"none\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M11.617 4.461 7.684 9.18c-.271.326-.04.82.384.82h7.865c.424 0 .655-.494.384-.82l-3.933-4.719a.5.5 0 0 0-.767 0Z\"\n fill={upFill}\n />\n <path\n d=\"M12.384 19.539l3.933-4.719c.27-.326.04-.82-.384-.82H8.068c-.424 0-.655.494-.384.82l3.933 4.719a.5.5 0 0 0 .767 0Z\"\n fill={downFill}\n />\n </svg>\n </Icon>\n );\n});\n\nSortIcon.displayName = 'SortIcon';\n\nconst BitkitSortableColumnHeader = forwardRef<HTMLTableCellElement, BitkitSortableColumnHeaderProps>(\n ({ children, css, direction, onSort, textAlign, ...rest }, ref) => {\n const styles = useTableStyles();\n const isEndAligned = textAlign === 'end';\n const sortIcon = <SortIcon direction={direction} />;\n\n return (\n <Table.ColumnHeader\n ref={ref}\n aria-sort={direction === 'none' ? undefined : direction}\n css={[styles.sortColumnHeader, css]}\n {...rest}\n >\n {/* chakra.button: no named primitive attaches a recipe slot to a bare trigger button */}\n <chakra.button\n css={styles.sortTrigger}\n justifyContent={isEndAligned ? 'flex-end' : undefined}\n onClick={onSort}\n type=\"button\"\n >\n {isEndAligned ? (\n <>\n {sortIcon} {children}\n </>\n ) : (\n <>\n {children} {sortIcon}\n </>\n )}\n </chakra.button>\n </Table.ColumnHeader>\n );\n },\n);\n\nBitkitSortableColumnHeader.displayName = 'BitkitTable.SortableColumnHeader';\n\nexport default BitkitSortableColumnHeader;\n"],"mappings":";;;;;;AAYA,IAAM,WAAW,YAAY,OAAiD,QAA4B;CACxG,MAAM,EAAE,WAAW,GAAG,SAAS;CAC/B,MAAM,SAAS,cAAc,cAAc,iBAAiB;CAC5D,MAAM,WAAW,cAAc,eAAe,iBAAiB;CAE/D,OACE,oBAAC,MAAD;EACO;EACL,SAAA;EACA,KAAK;GACH,wBAAwB;GACxB,OAAO;GACP,SAAS;GACT,eAAe;EACjB;EACA,GAAI;EAEJ,UAAA,qBAAC,OAAD;GAAK,MAAK;GAAO,QAAO;GAAK,SAAQ;GAAY,OAAM;GAAK,OAAM;GAAlE,UAAA,CACE,oBAAC,QAAD;IACE,GAAE;IACF,MAAM;GACP,CAAA,GACD,oBAAC,QAAD;IACE,GAAE;IACF,MAAM;GACP,CAAA,CACE;;CACD,CAAA;AAEV,CAAC;AAED,SAAS,cAAc;AAEvB,IAAM,6BAA6B,YAChC,EAAE,UAAU,KAAK,WAAW,QAAQ,WAAW,GAAG,QAAQ,QAAQ;CACjE,MAAM,SAAS,eAAe;CAC9B,MAAM,eAAe,cAAc;CACnC,MAAM,WAAW,oBAAC,UAAD,EAAqB,UAAY,CAAA;CAElD,OACE,oBAAC,MAAM,cAAP;EACO;EACL,aAAW,cAAc,SAAS,KAAA,IAAY;EAC9C,KAAK,CAAC,OAAO,kBAAkB,GAAG;EAClC,GAAI;EAGJ,UAAA,oBAAC,OAAO,QAAR;GACE,KAAK,OAAO;GACZ,gBAAgB,eAAe,aAAa,KAAA;GAC5C,SAAS;GACT,MAAK;GAEJ,UAAA,eACC,
|
|
1
|
+
{"version":3,"file":"BitkitSortableColumnHeader.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitTable/BitkitSortableColumnHeader.tsx"],"sourcesContent":["import { Icon, type IconProps } from '@chakra-ui/react/icon';\nimport { chakra } from '@chakra-ui/react/styled-system';\nimport { Table, useTableStyles } from '@chakra-ui/react/table';\nimport { forwardRef, type Ref } from 'react';\n\ntype SortDirection = 'ascending' | 'descending' | 'none';\n\nexport interface BitkitSortableColumnHeaderProps extends Omit<Table.ColumnHeaderProps, 'aria-sort' | 'onClick'> {\n direction: SortDirection;\n onSort: () => void;\n}\n\nconst SortIcon = forwardRef((props: IconProps & { direction: SortDirection }, ref: Ref<SVGSVGElement>) => {\n const { direction, ...rest } = props;\n const upFill = direction === 'ascending' ? 'currentColor' : 'var(--sort-icon-inactive)';\n const downFill = direction === 'descending' ? 'currentColor' : 'var(--sort-icon-inactive)';\n\n return (\n <Icon\n ref={ref}\n asChild\n css={{\n '--sort-icon-inactive': 'colors.icon/disabled',\n color: 'icon/primary',\n display: 'inline-block',\n verticalAlign: 'middle',\n }}\n {...rest}\n >\n <svg fill=\"none\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M11.617 4.461 7.684 9.18c-.271.326-.04.82.384.82h7.865c.424 0 .655-.494.384-.82l-3.933-4.719a.5.5 0 0 0-.767 0Z\"\n fill={upFill}\n />\n <path\n d=\"M12.384 19.539l3.933-4.719c.27-.326.04-.82-.384-.82H8.068c-.424 0-.655.494-.384.82l3.933 4.719a.5.5 0 0 0 .767 0Z\"\n fill={downFill}\n />\n </svg>\n </Icon>\n );\n});\n\nSortIcon.displayName = 'SortIcon';\n\nconst BitkitSortableColumnHeader = forwardRef<HTMLTableCellElement, BitkitSortableColumnHeaderProps>(\n ({ children, css, direction, onSort, textAlign, ...rest }, ref) => {\n const styles = useTableStyles();\n const isEndAligned = textAlign === 'end';\n const sortIcon = <SortIcon direction={direction} />;\n\n return (\n <Table.ColumnHeader\n ref={ref}\n aria-sort={direction === 'none' ? undefined : direction}\n css={[styles.sortColumnHeader, css]}\n {...rest}\n >\n {/* chakra.button: no named primitive attaches a recipe slot to a bare trigger button */}\n <chakra.button\n css={styles.sortTrigger}\n justifyContent={isEndAligned ? 'flex-end' : undefined}\n onClick={onSort}\n type=\"button\"\n >\n {isEndAligned ? (\n <>\n {sortIcon} {children}\n </>\n ) : (\n <>\n {children} {sortIcon}\n </>\n )}\n </chakra.button>\n </Table.ColumnHeader>\n );\n },\n);\n\nBitkitSortableColumnHeader.displayName = 'BitkitTable.SortableColumnHeader';\n\nexport default BitkitSortableColumnHeader;\n"],"mappings":";;;;;;AAYA,IAAM,WAAW,YAAY,OAAiD,QAA4B;CACxG,MAAM,EAAE,WAAW,GAAG,SAAS;CAC/B,MAAM,SAAS,cAAc,cAAc,iBAAiB;CAC5D,MAAM,WAAW,cAAc,eAAe,iBAAiB;CAE/D,OACE,oBAAC,MAAD;EACO;EACL,SAAA;EACA,KAAK;GACH,wBAAwB;GACxB,OAAO;GACP,SAAS;GACT,eAAe;EACjB;EACA,GAAI;EAEJ,UAAA,qBAAC,OAAD;GAAK,MAAK;GAAO,QAAO;GAAK,SAAQ;GAAY,OAAM;GAAK,OAAM;GAAlE,UAAA,CACE,oBAAC,QAAD;IACE,GAAE;IACF,MAAM;GACP,CAAA,GACD,oBAAC,QAAD;IACE,GAAE;IACF,MAAM;GACP,CAAA,CACE;;CACD,CAAA;AAEV,CAAC;AAED,SAAS,cAAc;AAEvB,IAAM,6BAA6B,YAChC,EAAE,UAAU,KAAK,WAAW,QAAQ,WAAW,GAAG,QAAQ,QAAQ;CACjE,MAAM,SAAS,eAAe;CAC9B,MAAM,eAAe,cAAc;CACnC,MAAM,WAAW,oBAAC,UAAD,EAAqB,UAAY,CAAA;CAElD,OACE,oBAAC,MAAM,cAAP;EACO;EACL,aAAW,cAAc,SAAS,KAAA,IAAY;EAC9C,KAAK,CAAC,OAAO,kBAAkB,GAAG;EAClC,GAAI;EAGJ,UAAA,oBAAC,OAAO,QAAR;GACE,KAAK,OAAO;GACZ,gBAAgB,eAAe,aAAa,KAAA;GAC5C,SAAS;GACT,MAAK;GAEJ,UAAA,eACC,qBAAAA,YAAA,EAAA,UAAA;IACG;IAAS;IAAE;GACZ,EAAA,CAAA,IAEF,qBAAAA,YAAA,EAAA,UAAA;IACG;IAAS;IAAE;GACZ,EAAA,CAAA;EAES,CAAA;CACG,CAAA;AAExB,CACF;AAEA,2BAA2B,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitTabs.js","names":[],"sources":["../../../lib/components/BitkitTabs/BitkitTabs.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext, mergeRefs, useSafeLayoutEffect } from '@chakra-ui/react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Menu, useMenuStyles } from '@chakra-ui/react/menu';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { chakra, useRecipe } from '@chakra-ui/react/styled-system';\nimport { Tabs, useTabsContext, useTabsStyles } from '@chakra-ui/react/tabs';\nimport { Text } from '@chakra-ui/react/text';\nimport {\n cloneElement,\n forwardRef,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type BitkitIconComponent, IconCross, IconPlus } from '../../icons';\nimport { type BitkitColorToken } from '../../theme/themeUtils';\nimport { flattenChildren } from '../../utilities/flattenChildren';\nimport { getTextContent } from '../../utilities/getTextContent';\nimport BitkitControlButton, { type BitkitControlButtonProps } from '../BitkitControlButton/BitkitControlButton';\n\n/**\n * Root props. `onValueChange` is re-declared with a concrete `{ value }` arg so the callback\n * parameter is inferred at the call site: the base `Tabs.RootProps` intersection breaks\n * contextual typing, which otherwise leaves consumers' `({ value }) => …` flagged as an\n * implicit `any` under `noImplicitAny`.\n */\nexport type BitkitTabsRootProps = Omit<Tabs.RootProps, 'onValueChange'> & {\n onValueChange?: (details: { value: string }) => void;\n};\n\nexport const [RootPropsProvider, useRootPropsContext] = createContext<BitkitTabsRootProps>({\n name: 'RootPropsContext',\n hookName: 'useRootPropsContext',\n providerName: '<RootProps />',\n});\n\nconst Root = forwardRef<HTMLDivElement, BitkitTabsRootProps>((props, ref) => {\n return (\n <RootPropsProvider value={props}>\n <Tabs.Root ref={ref} {...props} />\n </RootPropsProvider>\n );\n});\n\n/** Status-dot colors for the `canvas` variant. */\nexport type BitkitTabsStatusColor = 'neutral' | 'purple' | 'red' | 'yellow';\n\nconst STATUS_COLOR_TOKEN: Record<BitkitTabsStatusColor, string> = {\n neutral: 'color/neutral/muted',\n purple: 'interactive/bold',\n red: 'color/red/base',\n yellow: 'color/yellow/bold',\n};\n\nexport type BitkitTabsTriggerProps = Tabs.TriggerProps & {\n badge?: ReactNode;\n children?: string;\n icon?: BitkitIconComponent;\n /**\n * `contained` variant only: an `icon/*` token for the icon when it carries meaning of its own,\n * such as a trend arrow. It wins over the hover and selected colours; a disabled tab keeps its own.\n */\n iconColor?: BitkitColorToken<'icon'>;\n /** `canvas` variant only — when provided, a close button reveals on hover and calls this handler when clicked. */\n onClose?: () => void;\n secondaryText?: ReactNode;\n /** `canvas` variant only — shows a status indicator dot. When hovered (and `onClose` is set), the close button replaces it. */\n statusColor?: BitkitTabsStatusColor;\n};\n\nRoot.displayName = 'BitkitTabs.Root';\n\n// Canvas and line md tabs are the small ones: 16px icons, and an md overflow menu to match.\nconst isCompactTabs = (variant: BitkitTabsRootProps['variant'], size: BitkitTabsRootProps['size']) =>\n variant === 'canvas' || (variant === 'line' && size === 'md');\n\nconst Trigger = forwardRef<HTMLButtonElement, BitkitTabsTriggerProps>((props, ref) => {\n const {\n badge,\n children,\n className,\n icon: Icon,\n iconColor,\n onClose,\n onKeyDown,\n secondaryText,\n statusColor,\n ...rest\n } = props;\n // Mirror the recipe's defaultVariants: an unset `variant` must take the line branch below, not\n // fall through to the contained one, and an unset `size` the lg icon size.\n const { size = 'lg', variant = 'line' } = useRootPropsContext();\n const closeButtonRecipe = useRecipe({ key: 'closeButton' });\n\n // Close button and status dot are exclusive to the canvas variant.\n const isCanvas = variant === 'canvas';\n const closable = isCanvas && !!onClose && !rest.disabled;\n const hasStatus = isCanvas && !!statusColor && !rest.disabled;\n const showTrailing = closable || hasStatus;\n const mergedClassName = showTrailing ? (className ? `group ${className}` : 'group') : className;\n // The close button is always visible when there is no status dot; when the dot is shown it is\n // revealed on hover/focus instead (replacing the dot).\n const revealCloseOnInteraction = closable && hasStatus;\n const revealOnInteraction = { opacity: 1, pointerEvents: 'auto' } as const;\n\n const handleCloseClick = (event: MouseEvent<HTMLSpanElement>) => {\n event.stopPropagation();\n event.preventDefault();\n onClose?.();\n };\n\n // The close control is not in the tab order; keyboard users close the focused tab with Delete/Backspace.\n const handleTriggerKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (closable && (event.key === 'Delete' || event.key === 'Backspace')) {\n event.preventDefault();\n // Move focus to a sibling tab before removal so keyboard navigation can continue.\n const trigger = event.currentTarget;\n // Skip overflowed (`hidden`) tabs — they aren't focusable.\n const triggers = [\n ...(trigger.closest('[role=\"tablist\"]')?.querySelectorAll<HTMLElement>('[role=\"tab\"]:not([hidden])') ?? []),\n ];\n const index = triggers.indexOf(trigger);\n (triggers[index + 1] ?? triggers[index - 1])?.focus();\n onClose?.();\n }\n onKeyDown?.(event);\n };\n\n const trailing = showTrailing ? (\n <chakra.span\n position=\"relative\"\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n boxSize=\"24\"\n flexShrink={0}\n >\n {hasStatus && statusColor && (\n <chakra.span\n position=\"absolute\"\n inset={0}\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n pointerEvents=\"none\"\n transition=\"opacity 0.1s\"\n _groupHover={closable ? { opacity: 0 } : undefined}\n _groupFocusWithin={closable ? { opacity: 0 } : undefined}\n >\n <chakra.span boxSize=\"8\" borderRadius=\"full\" backgroundColor={STATUS_COLOR_TOKEN[statusColor]} />\n </chakra.span>\n )}\n {closable && (\n <chakra.span\n aria-hidden\n tabIndex={-1}\n onClick={handleCloseClick}\n css={closeButtonRecipe({ size: 'xs' })}\n position=\"absolute\"\n inset={0}\n color=\"icon/primary\"\n opacity={revealCloseOnInteraction ? 0 : 1}\n pointerEvents={revealCloseOnInteraction ? 'none' : 'auto'}\n transition=\"opacity 0.1s\"\n _groupHover={revealCloseOnInteraction ? revealOnInteraction : undefined}\n _groupFocusWithin={revealCloseOnInteraction ? revealOnInteraction : undefined}\n >\n <IconCross size=\"16\" />\n </chakra.span>\n )}\n </chakra.span>\n ) : null;\n\n const isCompact = isCompactTabs(variant, size);\n const hasOwnIconColor = variant === 'contained' && !!iconColor && !rest.disabled;\n const icon = Icon && (\n <Icon color={hasOwnIconColor ? iconColor : 'var(--tabs-icon-color)'} size={isCompact ? '16' : '24'} />\n );\n const canvasPadding = isCanvas\n ? { paddingInlineEnd: showTrailing ? '8' : Icon ? '16' : undefined, paddingInlineStart: Icon ? '8' : undefined }\n : undefined;\n\n return (\n <Tabs.Trigger ref={ref} {...rest} {...canvasPadding} className={mergedClassName} onKeyDown={handleTriggerKeyDown}>\n {isCanvas ? (\n <>\n <Box display=\"flex\" alignItems=\"center\" gap=\"8\">\n {icon}\n {children}\n </Box>\n {trailing}\n </>\n ) : variant === 'line' ? (\n <>\n <Box display=\"flex\" alignItems=\"center\" gap=\"8\">\n {icon}\n {children}\n </Box>\n {badge}\n </>\n ) : (\n <>\n <Box display=\"flex\" flexDirection=\"column\">\n <Box display=\"flex\" alignItems=\"flex-start\" gap=\"16\">\n {children}\n {badge}\n </Box>\n {!!secondaryText && (\n <Text as=\"span\" textStyle=\"body/md/regular\" color={rest.disabled ? 'text/on-disabled' : 'text/secondary'}>\n {secondaryText}\n </Text>\n )}\n </Box>\n {icon}\n </>\n )}\n </Tabs.Trigger>\n );\n});\n\nTrigger.displayName = 'BitkitTabs.Trigger';\n\ntype TabItem = ReactElement<BitkitTabsTriggerProps>;\n\n// Returns the set of visible tab indices for the overflow, always keeping the selected tab\n// visible: if it would overflow, it takes the last visible slot.\nconst getVisibleIndices = (total: number, count: number, selectedIndex: number) => {\n const visible = new Set<number>();\n for (let i = 0; i < count; i += 1) visible.add(i);\n if (selectedIndex >= 0 && selectedIndex < total && !visible.has(selectedIndex)) {\n visible.delete(count - 1);\n visible.add(selectedIndex);\n }\n return visible;\n};\n\ntype MoreMenuItemProps = {\n isCompact: boolean;\n item: TabItem;\n onSelect: () => void;\n variant: BitkitTabsRootProps['variant'];\n};\n\nconst MoreMenuItem = ({ isCompact, item, onSelect, variant }: MoreMenuItemProps) => {\n const menuStyles = useMenuStyles();\n const { badge, children, disabled, icon: Icon, iconColor, secondaryText, statusColor, value } = item.props;\n\n const isCanvas = variant === 'canvas';\n const isContained = variant === 'contained';\n const helperText = isContained ? secondaryText : undefined;\n\n const ownIconColor = isContained ? iconColor : undefined;\n const helperStyles = disabled ? { ...menuStyles.itemHelper, color: 'text/on-disabled' } : menuStyles.itemHelper;\n\n return (\n <Menu.Item data-helper={helperText ? '' : undefined} disabled={disabled} onSelect={onSelect} value={value}>\n {Icon && <Icon color={disabled ? 'icon/on-disabled' : ownIconColor} size={isCompact ? '16' : '24'} />}\n <Box flex=\"1\">\n <Text color={disabled ? 'text/on-disabled' : undefined}>{children}</Text>\n {!!helperText && <Text css={helperStyles}>{helperText}</Text>}\n </Box>\n {!isCanvas && badge}\n {isCanvas && statusColor && (\n <chakra.span boxSize=\"8\" borderRadius=\"full\" flexShrink={0} backgroundColor={STATUS_COLOR_TOKEN[statusColor]} />\n )}\n </Menu.Item>\n );\n};\n\nexport type BitkitTabsAddButtonProps = Omit<\n Extract<BitkitControlButtonProps, { href?: undefined }>,\n 'icon' | 'label' | 'size'\n> & {\n /** Accessible label / tooltip for the add button. */\n label?: string;\n};\n\n// \"+\" button to add a tab. Place it as a child of `List`; it always renders at the end of the row\n// (after the overflow menu). A compact `xxs` control button (16px icon, 4px padding) per the design.\nconst AddButton = forwardRef<HTMLButtonElement, BitkitTabsAddButtonProps>((props, ref) => {\n const { label = 'Add tab', ...rest } = props;\n return <BitkitControlButton ref={ref} icon={IconPlus} label={label} size=\"xxs\" {...rest} />;\n});\n\nAddButton.displayName = 'BitkitTabs.AddButton';\n\n// A stretched trigger (line tabs on mobile, or a consumer's own `flex`/`width`) is as wide as\n// its share of the list, not its content, so its laid-out width would count the free space as\n// needed space. Measure it unstretched, and unrounded: two 163.5px tabs read as 164 + 164 through\n// `offsetWidth` and overflow a 327px row.\n// The whole inline style is restored, because resetting the `flex` shorthand would also wipe any\n// inline flex longhands the consumer set.\nconst measureContentWidth = (node: HTMLElement) => {\n const { cssText } = node.style;\n node.style.flex = '0 0 auto';\n node.style.width = 'max-content';\n const contentWidth = node.getBoundingClientRect().width;\n node.style.cssText = cssText;\n return contentWidth;\n};\n\n// Overflow-aware List (all variants): measures the tabs and collapses the overflowing ones into a\n// \"N more…\" menu. The more-button look comes from the variant's `moreTrigger` recipe slot.\nconst List = forwardRef<HTMLDivElement, Tabs.ListProps>((props, ref) => {\n // Semantic/labelling attributes belong on the actual tablist, not the visual wrapper.\n const { children, css, id, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, ...rest } = props;\n const { size = 'lg', variant = 'line' } = useRootPropsContext();\n const api = useTabsContext();\n const styles = useTabsStyles();\n const isCompact = isCompactTabs(variant, size);\n\n // Split children: tab triggers participate in overflow; the optional add button always renders last.\n const allChildren = flattenChildren(children);\n const addButton = allChildren.find((child) => child.type === AddButton) ?? null;\n // Only Trigger elements are measured/overflowed; anything else (fragments, stray nodes) is ignored.\n const items = allChildren.filter((child) => child.type === Trigger) as TabItem[];\n // Re-measure whenever the tab set OR any width-affecting input changes: the variant and size, each\n // tab's value/label, icon/status/close/disabled state, and the text of its badge and secondaryText,\n // so a count going from 3 to 12 invalidates the cache.\n const measureKey = [\n variant,\n size,\n ...items.map((item) => {\n const p = item.props;\n return [\n p.value,\n String(p.children),\n p.icon ? 'i' : '',\n getTextContent(p.badge),\n getTextContent(p.secondaryText),\n p.statusColor ?? '',\n p.onClose ? 'c' : '',\n p.disabled ? 'd' : '',\n ].join(':');\n }),\n ].join('|');\n const selectedIndex = items.findIndex((item) => item.props.value === api.value);\n // Width reservations for the more button, sized for a two-digit count (\"10 more…\"), and for the\n // always-visible add button. Any slack here hides a tab that would have fitted.\n const moreReserve = isCompact ? 88 : 104;\n const addReserve = addButton ? 48 : 0;\n\n const listRef = useRef<HTMLDivElement | null>(null);\n const widthsRef = useRef<number[]>([]);\n // Horizontal padding of the list, cached during the measure pass so the resize hot path doesn't\n // call getComputedStyle on every tick.\n const paddingRef = useRef(0);\n // `measuredKey` is state (not a ref) so finishing the measure pass always re-renders and flips\n // `measuring` off — even when recompute keeps the same visibleCount (which would skip a re-render).\n const [measuredKey, setMeasuredKey] = useState<string | null>(null);\n const [visibleCount, setVisibleCount] = useState(items.length);\n\n const setListRef = useMemo(() => mergeRefs(listRef, ref), [ref]);\n\n const recompute = useCallback(() => {\n const el = listRef.current;\n const widths = widthsRef.current;\n if (!el || !widths.length) return;\n const available = el.clientWidth - paddingRef.current - addReserve;\n const totalWidth = widths.reduce((sum, w) => sum + w, 0);\n if (totalWidth <= available) {\n setVisibleCount(widths.length);\n return;\n }\n let used = moreReserve;\n let count = 0;\n for (let i = 0; i < widths.length; i += 1) {\n if (used + widths[i] > available) break;\n used += widths[i];\n count += 1;\n }\n setVisibleCount(Math.max(count, 1));\n }, [addReserve, moreReserve]);\n\n // Measure once per width-affecting change (all tabs are rendered visible during this pass).\n // Isomorphic layout effect: avoids the SSR \"useLayoutEffect does nothing on the server\" warning.\n const measuring = measuredKey !== measureKey;\n useSafeLayoutEffect(() => {\n const el = listRef.current;\n if (!el) return;\n if (measuredKey !== measureKey) {\n const tabEls = el.querySelectorAll<HTMLElement>('[data-tab-trigger]');\n widthsRef.current = Array.from(tabEls, measureContentWidth);\n const cs = getComputedStyle(el);\n paddingRef.current = parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight);\n setMeasuredKey(measureKey);\n }\n recompute();\n }, [measureKey, measuredKey, recompute]);\n\n // Swapping the fallback font for the webfont changes the tabs' widths without resizing the list,\n // so no ResizeObserver fires for it: measure again once the fonts are in.\n useEffect(() => {\n let cancelled = false;\n void document.fonts?.ready.then(() => {\n if (!cancelled) setMeasuredKey(null);\n });\n return () => {\n cancelled = true;\n };\n }, []);\n\n useEffect(() => {\n const el = listRef.current;\n if (!el || typeof ResizeObserver === 'undefined') return;\n // Coalesce resize bursts into one recompute per frame to avoid a read/write layout storm.\n let raf = 0;\n const observer = new ResizeObserver(() => {\n cancelAnimationFrame(raf);\n raf = requestAnimationFrame(recompute);\n });\n observer.observe(el);\n return () => {\n cancelAnimationFrame(raf);\n observer.disconnect();\n };\n }, [recompute]);\n\n const showAll = measuring || visibleCount >= items.length;\n const visible = showAll ? null : getVisibleIndices(items.length, visibleCount, selectedIndex);\n const hiddenItems = visible ? items.filter((_, i) => !visible.has(i)) : [];\n\n return (\n // The visual row carries the list styling (background, baseline border, leading padding) and is\n // measured for overflow. The tablist itself only wraps the tabs (`display: contents` keeps the\n // flex layout intact), so the more/add controls stay outside `role=\"tablist\"` per the ARIA spec.\n <Box ref={setListRef} css={[styles.list, css]} data-overflowing={hiddenItems.length > 0 ? '' : undefined} {...rest}>\n <Tabs.List display=\"contents\" id={id} aria-label={ariaLabel} aria-labelledby={ariaLabelledby}>\n {items.map((item, i) =>\n cloneElement(item, {\n key: item.props.value,\n 'data-tab-trigger': '',\n hidden: visible ? !visible.has(i) : undefined,\n } as Partial<BitkitTabsTriggerProps>),\n )}\n </Tabs.List>\n {hiddenItems.length > 0 && (\n <Menu.Root size={isCompact ? 'md' : 'lg'} positioning={{ gutter: 0, shift: -4 }}>\n <Menu.Trigger asChild>\n <chakra.button type=\"button\" css={styles.moreTrigger}>\n {hiddenItems.length} more…\n </chakra.button>\n </Menu.Trigger>\n <Portal>\n <Menu.Positioner>\n <Menu.Content>\n {hiddenItems.map((item) => (\n <MoreMenuItem\n isCompact={isCompact}\n item={item}\n key={item.props.value}\n onSelect={() => api.setValue(item.props.value)}\n variant={variant}\n />\n ))}\n </Menu.Content>\n </Menu.Positioner>\n </Portal>\n </Menu.Root>\n )}\n {addButton && (\n <Box display=\"flex\" alignItems=\"center\" flexShrink={0} paddingInline=\"8\">\n {addButton}\n </Box>\n )}\n </Box>\n );\n});\n\nList.displayName = 'BitkitTabs.List';\n\nconst BitkitTabs: Omit<typeof Tabs, 'Root' | 'Trigger' | 'List'> & {\n AddButton: typeof AddButton;\n List: typeof List;\n Root: typeof Root;\n Trigger: typeof Trigger;\n} = {\n ...Tabs,\n AddButton,\n List,\n Root,\n Trigger,\n};\n\nBitkitTabs.Content.displayName = 'BitkitTabs.Content';\nBitkitTabs.ContentGroup.displayName = 'BitkitTabs.ContentGroup';\nBitkitTabs.Root.displayName = 'BitkitTabs.Root';\n\nexport default BitkitTabs;\n"],"mappings":";;;;;;;;;;;;;;;AAsCA,IAAa,CAAC,mBAAmB,uBAAuB,gBAAmC;CACzF,MAAM;CACN,UAAU;CACV,cAAc;AAChB,CAAC;AAED,IAAM,OAAO,YAAiD,OAAO,QAAQ;CAC3E,OACE,oBAAC,mBAAD;EAAmB,OAAO;EACxB,UAAA,oBAAC,KAAK,MAAN;GAAgB;GAAK,GAAI;EAAQ,CAAA;CAChB,CAAA;AAEvB,CAAC;AAKD,IAAM,qBAA4D;CAChE,SAAS;CACT,QAAQ;CACR,KAAK;CACL,QAAQ;AACV;AAkBA,KAAK,cAAc;AAGnB,IAAM,iBAAiB,SAAyC,SAC9D,YAAY,YAAa,YAAY,UAAU,SAAS;AAE1D,IAAM,UAAU,YAAuD,OAAO,QAAQ;CACpF,MAAM,EACJ,OACA,UACA,WACA,MAAM,MACN,WACA,SACA,WACA,eACA,aACA,GAAG,SACD;CAGJ,MAAM,EAAE,OAAO,MAAM,UAAU,WAAW,oBAAoB;CAC9D,MAAM,oBAAoB,UAAU,EAAE,KAAK,cAAc,CAAC;CAG1D,MAAM,WAAW,YAAY;CAC7B,MAAM,WAAW,YAAY,CAAC,CAAC,WAAW,CAAC,KAAK;CAChD,MAAM,YAAY,YAAY,CAAC,CAAC,eAAe,CAAC,KAAK;CACrD,MAAM,eAAe,YAAY;CACjC,MAAM,kBAAkB,eAAgB,YAAY,SAAS,cAAc,UAAW;CAGtF,MAAM,2BAA2B,YAAY;CAC7C,MAAM,sBAAsB;EAAE,SAAS;EAAG,eAAe;CAAO;CAEhE,MAAM,oBAAoB,UAAuC;EAC/D,MAAM,gBAAgB;EACtB,MAAM,eAAe;EACrB,UAAU;CACZ;CAGA,MAAM,wBAAwB,UAA4C;EACxE,IAAI,aAAa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,aACC,oBAAC,KAAD;IAAK,SAAQ;IAAO,YAAW;IAAS,YAAY;IAAG,eAAc;IAClE,UAAA;GACE,CAAA;EAEJ;;AAET,CAAC;AAED,KAAK,cAAc;AAEnB,IAAM,aAKF;CACF,GAAG;CACH;CACA;CACA;CACA;AACF;AAEA,WAAW,QAAQ,cAAc;AACjC,WAAW,aAAa,cAAc;AACtC,WAAW,KAAK,cAAc"}
|
|
1
|
+
{"version":3,"file":"BitkitTabs.js","names":["createContext","_Fragment"],"sources":["../../../lib/components/BitkitTabs/BitkitTabs.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext, mergeRefs, useSafeLayoutEffect } from '@chakra-ui/react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Menu, useMenuStyles } from '@chakra-ui/react/menu';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { chakra, useRecipe } from '@chakra-ui/react/styled-system';\nimport { Tabs, useTabsContext, useTabsStyles } from '@chakra-ui/react/tabs';\nimport { Text } from '@chakra-ui/react/text';\nimport {\n cloneElement,\n forwardRef,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type BitkitIconComponent, IconCross, IconPlus } from '../../icons';\nimport { type BitkitColorToken } from '../../theme/themeUtils';\nimport { flattenChildren } from '../../utilities/flattenChildren';\nimport { getTextContent } from '../../utilities/getTextContent';\nimport BitkitControlButton, { type BitkitControlButtonProps } from '../BitkitControlButton/BitkitControlButton';\n\n/**\n * Root props. `onValueChange` is re-declared with a concrete `{ value }` arg so the callback\n * parameter is inferred at the call site: the base `Tabs.RootProps` intersection breaks\n * contextual typing, which otherwise leaves consumers' `({ value }) => …` flagged as an\n * implicit `any` under `noImplicitAny`.\n */\nexport type BitkitTabsRootProps = Omit<Tabs.RootProps, 'onValueChange'> & {\n onValueChange?: (details: { value: string }) => void;\n};\n\nexport const [RootPropsProvider, useRootPropsContext] = createContext<BitkitTabsRootProps>({\n name: 'RootPropsContext',\n hookName: 'useRootPropsContext',\n providerName: '<RootProps />',\n});\n\nconst Root = forwardRef<HTMLDivElement, BitkitTabsRootProps>((props, ref) => {\n return (\n <RootPropsProvider value={props}>\n <Tabs.Root ref={ref} {...props} />\n </RootPropsProvider>\n );\n});\n\n/** Status-dot colors for the `canvas` variant. */\nexport type BitkitTabsStatusColor = 'neutral' | 'purple' | 'red' | 'yellow';\n\nconst STATUS_COLOR_TOKEN: Record<BitkitTabsStatusColor, string> = {\n neutral: 'color/neutral/muted',\n purple: 'interactive/bold',\n red: 'color/red/base',\n yellow: 'color/yellow/bold',\n};\n\nexport type BitkitTabsTriggerProps = Tabs.TriggerProps & {\n badge?: ReactNode;\n children?: string;\n icon?: BitkitIconComponent;\n /**\n * `contained` variant only: an `icon/*` token for the icon when it carries meaning of its own,\n * such as a trend arrow. It wins over the hover and selected colours; a disabled tab keeps its own.\n */\n iconColor?: BitkitColorToken<'icon'>;\n /** `canvas` variant only — when provided, a close button reveals on hover and calls this handler when clicked. */\n onClose?: () => void;\n secondaryText?: ReactNode;\n /** `canvas` variant only — shows a status indicator dot. When hovered (and `onClose` is set), the close button replaces it. */\n statusColor?: BitkitTabsStatusColor;\n};\n\nRoot.displayName = 'BitkitTabs.Root';\n\n// Canvas and line md tabs are the small ones: 16px icons, and an md overflow menu to match.\nconst isCompactTabs = (variant: BitkitTabsRootProps['variant'], size: BitkitTabsRootProps['size']) =>\n variant === 'canvas' || (variant === 'line' && size === 'md');\n\nconst Trigger = forwardRef<HTMLButtonElement, BitkitTabsTriggerProps>((props, ref) => {\n const {\n badge,\n children,\n className,\n icon: Icon,\n iconColor,\n onClose,\n onKeyDown,\n secondaryText,\n statusColor,\n ...rest\n } = props;\n // Mirror the recipe's defaultVariants: an unset `variant` must take the line branch below, not\n // fall through to the contained one, and an unset `size` the lg icon size.\n const { size = 'lg', variant = 'line' } = useRootPropsContext();\n const closeButtonRecipe = useRecipe({ key: 'closeButton' });\n\n // Close button and status dot are exclusive to the canvas variant.\n const isCanvas = variant === 'canvas';\n const closable = isCanvas && !!onClose && !rest.disabled;\n const hasStatus = isCanvas && !!statusColor && !rest.disabled;\n const showTrailing = closable || hasStatus;\n const mergedClassName = showTrailing ? (className ? `group ${className}` : 'group') : className;\n // The close button is always visible when there is no status dot; when the dot is shown it is\n // revealed on hover/focus instead (replacing the dot).\n const revealCloseOnInteraction = closable && hasStatus;\n const revealOnInteraction = { opacity: 1, pointerEvents: 'auto' } as const;\n\n const handleCloseClick = (event: MouseEvent<HTMLSpanElement>) => {\n event.stopPropagation();\n event.preventDefault();\n onClose?.();\n };\n\n // The close control is not in the tab order; keyboard users close the focused tab with Delete/Backspace.\n const handleTriggerKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (closable && (event.key === 'Delete' || event.key === 'Backspace')) {\n event.preventDefault();\n // Move focus to a sibling tab before removal so keyboard navigation can continue.\n const trigger = event.currentTarget;\n // Skip overflowed (`hidden`) tabs — they aren't focusable.\n const triggers = [\n ...(trigger.closest('[role=\"tablist\"]')?.querySelectorAll<HTMLElement>('[role=\"tab\"]:not([hidden])') ?? []),\n ];\n const index = triggers.indexOf(trigger);\n (triggers[index + 1] ?? triggers[index - 1])?.focus();\n onClose?.();\n }\n onKeyDown?.(event);\n };\n\n const trailing = showTrailing ? (\n <chakra.span\n position=\"relative\"\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n boxSize=\"24\"\n flexShrink={0}\n >\n {hasStatus && statusColor && (\n <chakra.span\n position=\"absolute\"\n inset={0}\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n pointerEvents=\"none\"\n transition=\"opacity 0.1s\"\n _groupHover={closable ? { opacity: 0 } : undefined}\n _groupFocusWithin={closable ? { opacity: 0 } : undefined}\n >\n <chakra.span boxSize=\"8\" borderRadius=\"full\" backgroundColor={STATUS_COLOR_TOKEN[statusColor]} />\n </chakra.span>\n )}\n {closable && (\n <chakra.span\n aria-hidden\n tabIndex={-1}\n onClick={handleCloseClick}\n css={closeButtonRecipe({ size: 'xs' })}\n position=\"absolute\"\n inset={0}\n color=\"icon/primary\"\n opacity={revealCloseOnInteraction ? 0 : 1}\n pointerEvents={revealCloseOnInteraction ? 'none' : 'auto'}\n transition=\"opacity 0.1s\"\n _groupHover={revealCloseOnInteraction ? revealOnInteraction : undefined}\n _groupFocusWithin={revealCloseOnInteraction ? revealOnInteraction : undefined}\n >\n <IconCross size=\"16\" />\n </chakra.span>\n )}\n </chakra.span>\n ) : null;\n\n const isCompact = isCompactTabs(variant, size);\n const hasOwnIconColor = variant === 'contained' && !!iconColor && !rest.disabled;\n const icon = Icon && (\n <Icon color={hasOwnIconColor ? iconColor : 'var(--tabs-icon-color)'} size={isCompact ? '16' : '24'} />\n );\n const canvasPadding = isCanvas\n ? { paddingInlineEnd: showTrailing ? '8' : Icon ? '16' : undefined, paddingInlineStart: Icon ? '8' : undefined }\n : undefined;\n\n return (\n <Tabs.Trigger ref={ref} {...rest} {...canvasPadding} className={mergedClassName} onKeyDown={handleTriggerKeyDown}>\n {isCanvas ? (\n <>\n <Box display=\"flex\" alignItems=\"center\" gap=\"8\">\n {icon}\n {children}\n </Box>\n {trailing}\n </>\n ) : variant === 'line' ? (\n <>\n <Box display=\"flex\" alignItems=\"center\" gap=\"8\">\n {icon}\n {children}\n </Box>\n {badge}\n </>\n ) : (\n <>\n <Box display=\"flex\" flexDirection=\"column\">\n <Box display=\"flex\" alignItems=\"flex-start\" gap=\"16\">\n {children}\n {badge}\n </Box>\n {!!secondaryText && (\n <Text as=\"span\" textStyle=\"body/md/regular\" color={rest.disabled ? 'text/on-disabled' : 'text/secondary'}>\n {secondaryText}\n </Text>\n )}\n </Box>\n {icon}\n </>\n )}\n </Tabs.Trigger>\n );\n});\n\nTrigger.displayName = 'BitkitTabs.Trigger';\n\ntype TabItem = ReactElement<BitkitTabsTriggerProps>;\n\n// Returns the set of visible tab indices for the overflow, always keeping the selected tab\n// visible: if it would overflow, it takes the last visible slot.\nconst getVisibleIndices = (total: number, count: number, selectedIndex: number) => {\n const visible = new Set<number>();\n for (let i = 0; i < count; i += 1) visible.add(i);\n if (selectedIndex >= 0 && selectedIndex < total && !visible.has(selectedIndex)) {\n visible.delete(count - 1);\n visible.add(selectedIndex);\n }\n return visible;\n};\n\ntype MoreMenuItemProps = {\n isCompact: boolean;\n item: TabItem;\n onSelect: () => void;\n variant: BitkitTabsRootProps['variant'];\n};\n\nconst MoreMenuItem = ({ isCompact, item, onSelect, variant }: MoreMenuItemProps) => {\n const menuStyles = useMenuStyles();\n const { badge, children, disabled, icon: Icon, iconColor, secondaryText, statusColor, value } = item.props;\n\n const isCanvas = variant === 'canvas';\n const isContained = variant === 'contained';\n const helperText = isContained ? secondaryText : undefined;\n\n const ownIconColor = isContained ? iconColor : undefined;\n const helperStyles = disabled ? { ...menuStyles.itemHelper, color: 'text/on-disabled' } : menuStyles.itemHelper;\n\n return (\n <Menu.Item data-helper={helperText ? '' : undefined} disabled={disabled} onSelect={onSelect} value={value}>\n {Icon && <Icon color={disabled ? 'icon/on-disabled' : ownIconColor} size={isCompact ? '16' : '24'} />}\n <Box flex=\"1\">\n <Text color={disabled ? 'text/on-disabled' : undefined}>{children}</Text>\n {!!helperText && <Text css={helperStyles}>{helperText}</Text>}\n </Box>\n {!isCanvas && badge}\n {isCanvas && statusColor && (\n <chakra.span boxSize=\"8\" borderRadius=\"full\" flexShrink={0} backgroundColor={STATUS_COLOR_TOKEN[statusColor]} />\n )}\n </Menu.Item>\n );\n};\n\nexport type BitkitTabsAddButtonProps = Omit<\n Extract<BitkitControlButtonProps, { href?: undefined }>,\n 'icon' | 'label' | 'size'\n> & {\n /** Accessible label / tooltip for the add button. */\n label?: string;\n};\n\n// \"+\" button to add a tab. Place it as a child of `List`; it always renders at the end of the row\n// (after the overflow menu). A compact `xxs` control button (16px icon, 4px padding) per the design.\nconst AddButton = forwardRef<HTMLButtonElement, BitkitTabsAddButtonProps>((props, ref) => {\n const { label = 'Add tab', ...rest } = props;\n return <BitkitControlButton ref={ref} icon={IconPlus} label={label} size=\"xxs\" {...rest} />;\n});\n\nAddButton.displayName = 'BitkitTabs.AddButton';\n\n// A stretched trigger (line tabs on mobile, or a consumer's own `flex`/`width`) is as wide as\n// its share of the list, not its content, so its laid-out width would count the free space as\n// needed space. Measure it unstretched, and unrounded: two 163.5px tabs read as 164 + 164 through\n// `offsetWidth` and overflow a 327px row.\n// The whole inline style is restored, because resetting the `flex` shorthand would also wipe any\n// inline flex longhands the consumer set.\nconst measureContentWidth = (node: HTMLElement) => {\n const { cssText } = node.style;\n node.style.flex = '0 0 auto';\n node.style.width = 'max-content';\n const contentWidth = node.getBoundingClientRect().width;\n node.style.cssText = cssText;\n return contentWidth;\n};\n\n// Overflow-aware List (all variants): measures the tabs and collapses the overflowing ones into a\n// \"N more…\" menu. The more-button look comes from the variant's `moreTrigger` recipe slot.\nconst List = forwardRef<HTMLDivElement, Tabs.ListProps>((props, ref) => {\n // Semantic/labelling attributes belong on the actual tablist, not the visual wrapper.\n const { children, css, id, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, ...rest } = props;\n const { size = 'lg', variant = 'line' } = useRootPropsContext();\n const api = useTabsContext();\n const styles = useTabsStyles();\n const isCompact = isCompactTabs(variant, size);\n\n // Split children: tab triggers participate in overflow; the optional add button always renders last.\n const allChildren = flattenChildren(children);\n const addButton = allChildren.find((child) => child.type === AddButton) ?? null;\n // Only Trigger elements are measured/overflowed; anything else (fragments, stray nodes) is ignored.\n const items = allChildren.filter((child) => child.type === Trigger) as TabItem[];\n // Re-measure whenever the tab set OR any width-affecting input changes: the variant and size, each\n // tab's value/label, icon/status/close/disabled state, and the text of its badge and secondaryText,\n // so a count going from 3 to 12 invalidates the cache.\n const measureKey = [\n variant,\n size,\n ...items.map((item) => {\n const p = item.props;\n return [\n p.value,\n String(p.children),\n p.icon ? 'i' : '',\n getTextContent(p.badge),\n getTextContent(p.secondaryText),\n p.statusColor ?? '',\n p.onClose ? 'c' : '',\n p.disabled ? 'd' : '',\n ].join(':');\n }),\n ].join('|');\n const selectedIndex = items.findIndex((item) => item.props.value === api.value);\n // Width reservations for the more button, sized for a two-digit count (\"10 more…\"), and for the\n // always-visible add button. Any slack here hides a tab that would have fitted.\n const moreReserve = isCompact ? 88 : 104;\n const addReserve = addButton ? 48 : 0;\n\n const listRef = useRef<HTMLDivElement | null>(null);\n const widthsRef = useRef<number[]>([]);\n // Horizontal padding of the list, cached during the measure pass so the resize hot path doesn't\n // call getComputedStyle on every tick.\n const paddingRef = useRef(0);\n // `measuredKey` is state (not a ref) so finishing the measure pass always re-renders and flips\n // `measuring` off — even when recompute keeps the same visibleCount (which would skip a re-render).\n const [measuredKey, setMeasuredKey] = useState<string | null>(null);\n const [visibleCount, setVisibleCount] = useState(items.length);\n\n const setListRef = useMemo(() => mergeRefs(listRef, ref), [ref]);\n\n const recompute = useCallback(() => {\n const el = listRef.current;\n const widths = widthsRef.current;\n if (!el || !widths.length) return;\n const available = el.clientWidth - paddingRef.current - addReserve;\n const totalWidth = widths.reduce((sum, w) => sum + w, 0);\n if (totalWidth <= available) {\n setVisibleCount(widths.length);\n return;\n }\n let used = moreReserve;\n let count = 0;\n for (let i = 0; i < widths.length; i += 1) {\n if (used + widths[i] > available) break;\n used += widths[i];\n count += 1;\n }\n setVisibleCount(Math.max(count, 1));\n }, [addReserve, moreReserve]);\n\n // Measure once per width-affecting change (all tabs are rendered visible during this pass).\n // Isomorphic layout effect: avoids the SSR \"useLayoutEffect does nothing on the server\" warning.\n const measuring = measuredKey !== measureKey;\n useSafeLayoutEffect(() => {\n const el = listRef.current;\n if (!el) return;\n if (measuredKey !== measureKey) {\n const tabEls = el.querySelectorAll<HTMLElement>('[data-tab-trigger]');\n widthsRef.current = Array.from(tabEls, measureContentWidth);\n const cs = getComputedStyle(el);\n paddingRef.current = parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight);\n setMeasuredKey(measureKey);\n }\n recompute();\n }, [measureKey, measuredKey, recompute]);\n\n // Swapping the fallback font for the webfont changes the tabs' widths without resizing the list,\n // so no ResizeObserver fires for it: measure again once the fonts are in.\n useEffect(() => {\n let cancelled = false;\n void document.fonts?.ready.then(() => {\n if (!cancelled) setMeasuredKey(null);\n });\n return () => {\n cancelled = true;\n };\n }, []);\n\n useEffect(() => {\n const el = listRef.current;\n if (!el || typeof ResizeObserver === 'undefined') return;\n // Coalesce resize bursts into one recompute per frame to avoid a read/write layout storm.\n let raf = 0;\n const observer = new ResizeObserver(() => {\n cancelAnimationFrame(raf);\n raf = requestAnimationFrame(recompute);\n });\n observer.observe(el);\n return () => {\n cancelAnimationFrame(raf);\n observer.disconnect();\n };\n }, [recompute]);\n\n const showAll = measuring || visibleCount >= items.length;\n const visible = showAll ? null : getVisibleIndices(items.length, visibleCount, selectedIndex);\n const hiddenItems = visible ? items.filter((_, i) => !visible.has(i)) : [];\n\n return (\n // The visual row carries the list styling (background, baseline border, leading padding) and is\n // measured for overflow. The tablist itself only wraps the tabs (`display: contents` keeps the\n // flex layout intact), so the more/add controls stay outside `role=\"tablist\"` per the ARIA spec.\n <Box ref={setListRef} css={[styles.list, css]} data-overflowing={hiddenItems.length > 0 ? '' : undefined} {...rest}>\n <Tabs.List display=\"contents\" id={id} aria-label={ariaLabel} aria-labelledby={ariaLabelledby}>\n {items.map((item, i) =>\n cloneElement(item, {\n key: item.props.value,\n 'data-tab-trigger': '',\n hidden: visible ? !visible.has(i) : undefined,\n } as Partial<BitkitTabsTriggerProps>),\n )}\n </Tabs.List>\n {hiddenItems.length > 0 && (\n <Menu.Root size={isCompact ? 'md' : 'lg'} positioning={{ gutter: 0, shift: -4 }}>\n <Menu.Trigger asChild>\n <chakra.button type=\"button\" css={styles.moreTrigger}>\n {hiddenItems.length} more…\n </chakra.button>\n </Menu.Trigger>\n <Portal>\n <Menu.Positioner>\n <Menu.Content>\n {hiddenItems.map((item) => (\n <MoreMenuItem\n isCompact={isCompact}\n item={item}\n key={item.props.value}\n onSelect={() => api.setValue(item.props.value)}\n variant={variant}\n />\n ))}\n </Menu.Content>\n </Menu.Positioner>\n </Portal>\n </Menu.Root>\n )}\n {addButton && (\n <Box display=\"flex\" alignItems=\"center\" flexShrink={0} paddingInline=\"8\">\n {addButton}\n </Box>\n )}\n </Box>\n );\n});\n\nList.displayName = 'BitkitTabs.List';\n\nconst BitkitTabs: Omit<typeof Tabs, 'Root' | 'Trigger' | 'List'> & {\n AddButton: typeof AddButton;\n List: typeof List;\n Root: typeof Root;\n Trigger: typeof Trigger;\n} = {\n ...Tabs,\n AddButton,\n List,\n Root,\n Trigger,\n};\n\nBitkitTabs.Content.displayName = 'BitkitTabs.Content';\nBitkitTabs.ContentGroup.displayName = 'BitkitTabs.ContentGroup';\nBitkitTabs.Root.displayName = 'BitkitTabs.Root';\n\nexport default BitkitTabs;\n"],"mappings":";;;;;;;;;;;;;;;AAsCA,IAAa,CAAC,mBAAmB,uBAAuBA,gBAAmC;CACzF,MAAM;CACN,UAAU;CACV,cAAc;AAChB,CAAC;AAED,IAAM,OAAO,YAAiD,OAAO,QAAQ;CAC3E,OACE,oBAAC,mBAAD;EAAmB,OAAO;EACxB,UAAA,oBAAC,KAAK,MAAN;GAAgB;GAAK,GAAI;EAAQ,CAAA;CAChB,CAAA;AAEvB,CAAC;AAKD,IAAM,qBAA4D;CAChE,SAAS;CACT,QAAQ;CACR,KAAK;CACL,QAAQ;AACV;AAkBA,KAAK,cAAc;AAGnB,IAAM,iBAAiB,SAAyC,SAC9D,YAAY,YAAa,YAAY,UAAU,SAAS;AAE1D,IAAM,UAAU,YAAuD,OAAO,QAAQ;CACpF,MAAM,EACJ,OACA,UACA,WACA,MAAM,MACN,WACA,SACA,WACA,eACA,aACA,GAAG,SACD;CAGJ,MAAM,EAAE,OAAO,MAAM,UAAU,WAAW,oBAAoB;CAC9D,MAAM,oBAAoB,UAAU,EAAE,KAAK,cAAc,CAAC;CAG1D,MAAM,WAAW,YAAY;CAC7B,MA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