@bitrise/bitkit-v2 0.3.475 → 0.3.477-beta.3026

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.
Files changed (380) hide show
  1. package/README.md +5 -6
  2. package/dist/atoms/DatePicker/DatePicker.js.map +1 -1
  3. package/dist/atoms/ImageCropper/ImageCropper.js.map +1 -1
  4. package/dist/components/BitkitActionMenu/BitkitActionMenu.js.map +1 -1
  5. package/dist/components/BitkitAvatar/BitkitAvatar.js.map +1 -1
  6. package/dist/components/BitkitButton/BitkitButton.js.map +1 -1
  7. package/dist/components/BitkitCollapsible/BitkitCollapsible.js.map +1 -1
  8. package/dist/components/BitkitColorButton/BitkitColorButton.js.map +1 -1
  9. package/dist/components/BitkitDialog/BitkitStepsDialog.js.map +1 -1
  10. package/dist/components/BitkitDialog/BitkitStepsDialogStep.js.map +1 -1
  11. package/dist/components/BitkitDialog/DialogBodyContext.js.map +1 -1
  12. package/dist/components/BitkitExpandableCard/BitkitExpandableCard.js.map +1 -1
  13. package/dist/components/BitkitFileInput/BitkitFileInput.js.map +1 -1
  14. package/dist/components/BitkitIconButton/BitkitIconButton.js.map +1 -1
  15. package/dist/components/BitkitLabeledData/BitkitLabeledData.js.map +1 -1
  16. package/dist/components/BitkitList/BitkitList.js.map +1 -1
  17. package/dist/components/BitkitMarkdown/BitkitMarkdown.js.map +1 -1
  18. package/dist/components/BitkitMarkdownCard/BitkitMarkdownCard.js.map +1 -1
  19. package/dist/components/BitkitMultiselect/BitkitMultiselect.js.map +1 -1
  20. package/dist/components/BitkitNoteCard/BitkitNoteCard.js.map +1 -1
  21. package/dist/components/BitkitOverflowContent/BitkitOverflowContent.js.map +1 -1
  22. package/dist/components/BitkitPageSidebar/BitkitPageSidebar.js.map +1 -1
  23. package/dist/components/BitkitPagination/BitkitPagination.js.map +1 -1
  24. package/dist/components/BitkitPaginationLoadMore/BitkitPaginationLoadMore.js.map +1 -1
  25. package/dist/components/BitkitPopover/BitkitPopover.js.map +1 -1
  26. package/dist/components/BitkitPromoBanner/BitkitPromoBanner.js.map +1 -1
  27. package/dist/components/BitkitSegmentedControl/BitkitSegmentedControl.js.map +1 -1
  28. package/dist/components/BitkitSelectMenu/BitkitSelectMenuAction.js.map +1 -1
  29. package/dist/components/BitkitSettingsCard/BitkitSettingsCard.js.map +1 -1
  30. package/dist/components/BitkitSplitButton/BitkitSplitButton.js.map +1 -1
  31. package/dist/components/BitkitStat/BitkitStat.js.map +1 -1
  32. package/dist/components/BitkitStepsCard/BitkitStepsCard.js.map +1 -1
  33. package/dist/components/BitkitTable/BitkitExpandableRow.js.map +1 -1
  34. package/dist/components/BitkitTable/BitkitRowActionsCell.js.map +1 -1
  35. package/dist/components/BitkitTable/BitkitSortableColumnHeader.js.map +1 -1
  36. package/dist/components/BitkitTabs/BitkitTabs.js.map +1 -1
  37. package/dist/components/BitkitToggletip/BitkitToggletip.js.map +1 -1
  38. package/dist/components/BitkitTour/BitkitTour.js.map +1 -1
  39. package/dist/components/BitkitTreeView/BitkitTreeView.js.map +1 -1
  40. package/dist/components/BitkitUIHeader/BitkitUIHeader.d.ts +37 -0
  41. package/dist/components/BitkitUIHeader/BitkitUIHeader.js +99 -0
  42. package/dist/components/BitkitUIHeader/BitkitUIHeader.js.map +1 -0
  43. package/dist/components/BitkitUIHeader/BitriseLogo.d.ts +10 -0
  44. package/dist/components/BitkitUIHeader/BitriseLogo.js +86 -0
  45. package/dist/components/BitkitUIHeader/BitriseLogo.js.map +1 -0
  46. package/dist/components/BitkitUIHeader/UIHeaderAccount.d.ts +22 -0
  47. package/dist/components/BitkitUIHeader/UIHeaderAccount.js +38 -0
  48. package/dist/components/BitkitUIHeader/UIHeaderAccount.js.map +1 -0
  49. package/dist/components/BitkitUIHeader/UIHeaderButton.d.ts +33 -0
  50. package/dist/components/BitkitUIHeader/UIHeaderButton.js +41 -0
  51. package/dist/components/BitkitUIHeader/UIHeaderButton.js.map +1 -0
  52. package/dist/components/BitkitUIHeader/UIHeaderContext.d.ts +13 -0
  53. package/dist/components/BitkitUIHeader/UIHeaderContext.js +11 -0
  54. package/dist/components/BitkitUIHeader/UIHeaderContext.js.map +1 -0
  55. package/dist/components/BitkitUIHeader/UIHeaderControl.d.ts +67 -0
  56. package/dist/components/BitkitUIHeader/UIHeaderControl.js +65 -0
  57. package/dist/components/BitkitUIHeader/UIHeaderControl.js.map +1 -0
  58. package/dist/components/BitkitUIHeader/UIHeaderNavButton.d.ts +20 -0
  59. package/dist/components/BitkitUIHeader/UIHeaderNavButton.js +46 -0
  60. package/dist/components/BitkitUIHeader/UIHeaderNavButton.js.map +1 -0
  61. package/dist/components/BitkitUIHeader/UIHeaderSearch.d.ts +32 -0
  62. package/dist/components/BitkitUIHeader/UIHeaderSearch.js +107 -0
  63. package/dist/components/BitkitUIHeader/UIHeaderSearch.js.map +1 -0
  64. package/dist/components/BitkitUISideNav/UISideNavLink.js.map +1 -1
  65. package/dist/components/common/NotificationContent.js.map +1 -1
  66. package/dist/components/index.d.ts +1 -0
  67. package/dist/icons/IconAbortCircle.js.map +1 -1
  68. package/dist/icons/IconAbortCircleFilled.js.map +1 -1
  69. package/dist/icons/IconAddons.js.map +1 -1
  70. package/dist/icons/IconAgent.js.map +1 -1
  71. package/dist/icons/IconAnchor.js.map +1 -1
  72. package/dist/icons/IconAndroid.js.map +1 -1
  73. package/dist/icons/IconApp.js.map +1 -1
  74. package/dist/icons/IconAppSettings.js.map +1 -1
  75. package/dist/icons/IconAppStore.js.map +1 -1
  76. package/dist/icons/IconAppStoreColor.js.map +1 -1
  77. package/dist/icons/IconApple.js.map +1 -1
  78. package/dist/icons/IconArchive.js.map +1 -1
  79. package/dist/icons/IconArchiveDelete.js.map +1 -1
  80. package/dist/icons/IconArchiveRestore.js.map +1 -1
  81. package/dist/icons/IconArrowBackAndDown.js.map +1 -1
  82. package/dist/icons/IconArrowBackAndUp.js.map +1 -1
  83. package/dist/icons/IconArrowDown.js.map +1 -1
  84. package/dist/icons/IconArrowForwardAndDown.js.map +1 -1
  85. package/dist/icons/IconArrowForwardAndUp.js.map +1 -1
  86. package/dist/icons/IconArrowLeft.js.map +1 -1
  87. package/dist/icons/IconArrowNortheast.js.map +1 -1
  88. package/dist/icons/IconArrowNorthwest.js.map +1 -1
  89. package/dist/icons/IconArrowRight.js.map +1 -1
  90. package/dist/icons/IconArrowUp.js.map +1 -1
  91. package/dist/icons/IconArrowsHorizontal.js.map +1 -1
  92. package/dist/icons/IconArrowsVertical.js.map +1 -1
  93. package/dist/icons/IconAutomation.js.map +1 -1
  94. package/dist/icons/IconAws.js.map +1 -1
  95. package/dist/icons/IconAwsColor.js.map +1 -1
  96. package/dist/icons/IconBadge3RdParty.js.map +1 -1
  97. package/dist/icons/IconBadgeBitrise.js.map +1 -1
  98. package/dist/icons/IconBadgeUpgrade.js.map +1 -1
  99. package/dist/icons/IconBadgeVersionOk.js.map +1 -1
  100. package/dist/icons/IconBazel.js.map +1 -1
  101. package/dist/icons/IconBell.js.map +1 -1
  102. package/dist/icons/IconBitbot.js.map +1 -1
  103. package/dist/icons/IconBitbotError.js.map +1 -1
  104. package/dist/icons/IconBitbucket.js.map +1 -1
  105. package/dist/icons/IconBitbucketColor.js.map +1 -1
  106. package/dist/icons/IconBitbucketNeutral.js.map +1 -1
  107. package/dist/icons/IconBitbucketWhite.js.map +1 -1
  108. package/dist/icons/IconBlockCircle.js.map +1 -1
  109. package/dist/icons/IconBook.js.map +1 -1
  110. package/dist/icons/IconBoxArrowDown.js.map +1 -1
  111. package/dist/icons/IconBoxDot.js.map +1 -1
  112. package/dist/icons/IconBoxLinesOverflow.js.map +1 -1
  113. package/dist/icons/IconBoxLinesWrap.js.map +1 -1
  114. package/dist/icons/IconBranch.js.map +1 -1
  115. package/dist/icons/IconBrowserstackColor.js.map +1 -1
  116. package/dist/icons/IconBug.js.map +1 -1
  117. package/dist/icons/IconBuild.js.map +1 -1
  118. package/dist/icons/IconBuildCache.js.map +1 -1
  119. package/dist/icons/IconBuildCacheFilled.js.map +1 -1
  120. package/dist/icons/IconBuildEnvSetup.js.map +1 -1
  121. package/dist/icons/IconBuildHub.js.map +1 -1
  122. package/dist/icons/IconBuildHubFilled.js.map +1 -1
  123. package/dist/icons/IconCalendar.js.map +1 -1
  124. package/dist/icons/IconChangePlan.js.map +1 -1
  125. package/dist/icons/IconChat.js.map +1 -1
  126. package/dist/icons/IconCheck.js.map +1 -1
  127. package/dist/icons/IconCheckCircle.js.map +1 -1
  128. package/dist/icons/IconCheckCircleFilled.js.map +1 -1
  129. package/dist/icons/IconChevronDown.js.map +1 -1
  130. package/dist/icons/IconChevronLeft.js.map +1 -1
  131. package/dist/icons/IconChevronRight.js.map +1 -1
  132. package/dist/icons/IconChevronUp.js.map +1 -1
  133. package/dist/icons/IconCi.js.map +1 -1
  134. package/dist/icons/IconCiFilled.js.map +1 -1
  135. package/dist/icons/IconCircle.js.map +1 -1
  136. package/dist/icons/IconCircleDashed.js.map +1 -1
  137. package/dist/icons/IconCircleHalfFilled.js.map +1 -1
  138. package/dist/icons/IconClaude.js.map +1 -1
  139. package/dist/icons/IconClaudeColor.js.map +1 -1
  140. package/dist/icons/IconClock.js.map +1 -1
  141. package/dist/icons/IconCode.js.map +1 -1
  142. package/dist/icons/IconCodePush.js.map +1 -1
  143. package/dist/icons/IconCodeSigning.js.map +1 -1
  144. package/dist/icons/IconCoffee.js.map +1 -1
  145. package/dist/icons/IconCommit.js.map +1 -1
  146. package/dist/icons/IconConfigure.js.map +1 -1
  147. package/dist/icons/IconConnectedAccounts.js.map +1 -1
  148. package/dist/icons/IconContainer.js.map +1 -1
  149. package/dist/icons/IconCopilot.js.map +1 -1
  150. package/dist/icons/IconCopy.js.map +1 -1
  151. package/dist/icons/IconCordova.js.map +1 -1
  152. package/dist/icons/IconCpu.js.map +1 -1
  153. package/dist/icons/IconCreditcard.js.map +1 -1
  154. package/dist/icons/IconCredits.js.map +1 -1
  155. package/dist/icons/IconCross.js.map +1 -1
  156. package/dist/icons/IconCrossCircle.js.map +1 -1
  157. package/dist/icons/IconCrossCircleFilled.js.map +1 -1
  158. package/dist/icons/IconCrown.js.map +1 -1
  159. package/dist/icons/IconCursor.js.map +1 -1
  160. package/dist/icons/IconCycle.js.map +1 -1
  161. package/dist/icons/IconDashboard.js.map +1 -1
  162. package/dist/icons/IconDashboardFilled.js.map +1 -1
  163. package/dist/icons/IconDeployment.js.map +1 -1
  164. package/dist/icons/IconDetails.js.map +1 -1
  165. package/dist/icons/IconDoc.js.map +1 -1
  166. package/dist/icons/IconDollar.js.map +1 -1
  167. package/dist/icons/IconDot.js.map +1 -1
  168. package/dist/icons/IconDotnet.js.map +1 -1
  169. package/dist/icons/IconDotnetColor.js.map +1 -1
  170. package/dist/icons/IconDotnetText.js.map +1 -1
  171. package/dist/icons/IconDotnetTextColor.js.map +1 -1
  172. package/dist/icons/IconDoubleCircle.js.map +1 -1
  173. package/dist/icons/IconDownload.js.map +1 -1
  174. package/dist/icons/IconDragHandle.js.map +1 -1
  175. package/dist/icons/IconEc2Ami.js.map +1 -1
  176. package/dist/icons/IconEnterprise.js.map +1 -1
  177. package/dist/icons/IconErrorCircle.js.map +1 -1
  178. package/dist/icons/IconErrorCircleFilled.js.map +1 -1
  179. package/dist/icons/IconExpand.js.map +1 -1
  180. package/dist/icons/IconExtraBuildCapacity.js.map +1 -1
  181. package/dist/icons/IconEye.js.map +1 -1
  182. package/dist/icons/IconEyeSlash.js.map +1 -1
  183. package/dist/icons/IconFastlane.js.map +1 -1
  184. package/dist/icons/IconFile.js.map +1 -1
  185. package/dist/icons/IconFileDoc.js.map +1 -1
  186. package/dist/icons/IconFilePdf.js.map +1 -1
  187. package/dist/icons/IconFilePlist.js.map +1 -1
  188. package/dist/icons/IconFileYml.js.map +1 -1
  189. package/dist/icons/IconFileZip.js.map +1 -1
  190. package/dist/icons/IconFilter.js.map +1 -1
  191. package/dist/icons/IconFlag.js.map +1 -1
  192. package/dist/icons/IconFlutter.js.map +1 -1
  193. package/dist/icons/IconFolder.js.map +1 -1
  194. package/dist/icons/IconFullscreen.js.map +1 -1
  195. package/dist/icons/IconFullscreenExit.js.map +1 -1
  196. package/dist/icons/IconGauge.js.map +1 -1
  197. package/dist/icons/IconGit.js.map +1 -1
  198. package/dist/icons/IconGithub.js.map +1 -1
  199. package/dist/icons/IconGitlab.js.map +1 -1
  200. package/dist/icons/IconGitlabColor.js.map +1 -1
  201. package/dist/icons/IconGitlabWhite.js.map +1 -1
  202. package/dist/icons/IconGlobe.js.map +1 -1
  203. package/dist/icons/IconGo.js.map +1 -1
  204. package/dist/icons/IconGoogleColor.js.map +1 -1
  205. package/dist/icons/IconGooglePlay.js.map +1 -1
  206. package/dist/icons/IconGooglePlayColor.js.map +1 -1
  207. package/dist/icons/IconGradle.js.map +1 -1
  208. package/dist/icons/IconGroup.js.map +1 -1
  209. package/dist/icons/IconHashtag.js.map +1 -1
  210. package/dist/icons/IconHeadset.js.map +1 -1
  211. package/dist/icons/IconHeart.js.map +1 -1
  212. package/dist/icons/IconHistory.js.map +1 -1
  213. package/dist/icons/IconHourglass.js.map +1 -1
  214. package/dist/icons/IconImage.js.map +1 -1
  215. package/dist/icons/IconInfoCircle.js.map +1 -1
  216. package/dist/icons/IconInfoCircleFilled.js.map +1 -1
  217. package/dist/icons/IconInsights.js.map +1 -1
  218. package/dist/icons/IconInsightsFilled.js.map +1 -1
  219. package/dist/icons/IconInstall.js.map +1 -1
  220. package/dist/icons/IconInteraction.js.map +1 -1
  221. package/dist/icons/IconInvoice.js.map +1 -1
  222. package/dist/icons/IconIonic.js.map +1 -1
  223. package/dist/icons/IconJapanese.js.map +1 -1
  224. package/dist/icons/IconJava.js.map +1 -1
  225. package/dist/icons/IconJavaColor.js.map +1 -1
  226. package/dist/icons/IconJavaDuke.js.map +1 -1
  227. package/dist/icons/IconJavaDukeColor.js.map +1 -1
  228. package/dist/icons/IconKey.js.map +1 -1
  229. package/dist/icons/IconKiroColor.js.map +1 -1
  230. package/dist/icons/IconKotlin.js.map +1 -1
  231. package/dist/icons/IconKotlinColor.js.map +1 -1
  232. package/dist/icons/IconKotlinWhite.js.map +1 -1
  233. package/dist/icons/IconLaptop.js.map +1 -1
  234. package/dist/icons/IconLaunchdarkly.js.map +1 -1
  235. package/dist/icons/IconLegacyApp.js.map +1 -1
  236. package/dist/icons/IconLightbulb.js.map +1 -1
  237. package/dist/icons/IconLink.js.map +1 -1
  238. package/dist/icons/IconLinux.js.map +1 -1
  239. package/dist/icons/IconLock.js.map +1 -1
  240. package/dist/icons/IconLockOpen.js.map +1 -1
  241. package/dist/icons/IconLogin.js.map +1 -1
  242. package/dist/icons/IconLogout.js.map +1 -1
  243. package/dist/icons/IconMacos.js.map +1 -1
  244. package/dist/icons/IconMagicWand.js.map +1 -1
  245. package/dist/icons/IconMagnifier.js.map +1 -1
  246. package/dist/icons/IconMail.js.map +1 -1
  247. package/dist/icons/IconMcp.js.map +1 -1
  248. package/dist/icons/IconMedal.js.map +1 -1
  249. package/dist/icons/IconMemory.js.map +1 -1
  250. package/dist/icons/IconMenuGrid.js.map +1 -1
  251. package/dist/icons/IconMenuHamburger.js.map +1 -1
  252. package/dist/icons/IconMessage.js.map +1 -1
  253. package/dist/icons/IconMessageAlert.js.map +1 -1
  254. package/dist/icons/IconMessageQuestion.js.map +1 -1
  255. package/dist/icons/IconMicrophone.js.map +1 -1
  256. package/dist/icons/IconMinus.js.map +1 -1
  257. package/dist/icons/IconMinusCircle.js.map +1 -1
  258. package/dist/icons/IconMinusCircleFilled.js.map +1 -1
  259. package/dist/icons/IconMobile.js.map +1 -1
  260. package/dist/icons/IconMobileLandscape.js.map +1 -1
  261. package/dist/icons/IconMonitorChart.js.map +1 -1
  262. package/dist/icons/IconMoreHorizontal.js.map +1 -1
  263. package/dist/icons/IconMoreVertical.js.map +1 -1
  264. package/dist/icons/IconNews.js.map +1 -1
  265. package/dist/icons/IconNextjs.js.map +1 -1
  266. package/dist/icons/IconNodejs.js.map +1 -1
  267. package/dist/icons/IconOpenInNew.js.map +1 -1
  268. package/dist/icons/IconOther.js.map +1 -1
  269. package/dist/icons/IconOutsideContributor.js.map +1 -1
  270. package/dist/icons/IconOverview.js.map +1 -1
  271. package/dist/icons/IconPause.js.map +1 -1
  272. package/dist/icons/IconPencil.js.map +1 -1
  273. package/dist/icons/IconPeople.js.map +1 -1
  274. package/dist/icons/IconPercent.js.map +1 -1
  275. package/dist/icons/IconPerson.js.map +1 -1
  276. package/dist/icons/IconPersonWithDesk.js.map +1 -1
  277. package/dist/icons/IconPin.js.map +1 -1
  278. package/dist/icons/IconPlay.js.map +1 -1
  279. package/dist/icons/IconPlus.js.map +1 -1
  280. package/dist/icons/IconPlusCircle.js.map +1 -1
  281. package/dist/icons/IconPlusCircleFilled.js.map +1 -1
  282. package/dist/icons/IconPower.js.map +1 -1
  283. package/dist/icons/IconProject.js.map +1 -1
  284. package/dist/icons/IconProjectSettings.js.map +1 -1
  285. package/dist/icons/IconPull.js.map +1 -1
  286. package/dist/icons/IconPush.js.map +1 -1
  287. package/dist/icons/IconPuzzle.js.map +1 -1
  288. package/dist/icons/IconPython.js.map +1 -1
  289. package/dist/icons/IconPythonColor.js.map +1 -1
  290. package/dist/icons/IconQuestionCircle.js.map +1 -1
  291. package/dist/icons/IconQuestionCircleFilled.js.map +1 -1
  292. package/dist/icons/IconReact.js.map +1 -1
  293. package/dist/icons/IconRefresh.js.map +1 -1
  294. package/dist/icons/IconRegex.js.map +1 -1
  295. package/dist/icons/IconRelease.js.map +1 -1
  296. package/dist/icons/IconReleaseFilled.js.map +1 -1
  297. package/dist/icons/IconRemoteAccess.js.map +1 -1
  298. package/dist/icons/IconReplace.js.map +1 -1
  299. package/dist/icons/IconResponsiveness.js.map +1 -1
  300. package/dist/icons/IconReviewerApproved.js.map +1 -1
  301. package/dist/icons/IconReviewerAssigned.js.map +1 -1
  302. package/dist/icons/IconReviewerRejected.js.map +1 -1
  303. package/dist/icons/IconRuby.js.map +1 -1
  304. package/dist/icons/IconRubyColor.js.map +1 -1
  305. package/dist/icons/IconSave.js.map +1 -1
  306. package/dist/icons/IconSecurityShield.js.map +1 -1
  307. package/dist/icons/IconSettings.js.map +1 -1
  308. package/dist/icons/IconSettingsFilled.js.map +1 -1
  309. package/dist/icons/IconShuffle.js.map +1 -1
  310. package/dist/icons/IconSiren.js.map +1 -1
  311. package/dist/icons/IconSkip.js.map +1 -1
  312. package/dist/icons/IconSkipCircle.js.map +1 -1
  313. package/dist/icons/IconSkipCircleFilled.js.map +1 -1
  314. package/dist/icons/IconSlack.js.map +1 -1
  315. package/dist/icons/IconSlackColor.js.map +1 -1
  316. package/dist/icons/IconSparkle.js.map +1 -1
  317. package/dist/icons/IconSparkleFilled.js.map +1 -1
  318. package/dist/icons/IconSpinnerOnDisabled.js.map +1 -1
  319. package/dist/icons/IconSpinnerPurple.js.map +1 -1
  320. package/dist/icons/IconSpinnerPurpleDouble.js.map +1 -1
  321. package/dist/icons/IconSpinnerWhite.js.map +1 -1
  322. package/dist/icons/IconStability.js.map +1 -1
  323. package/dist/icons/IconStack.js.map +1 -1
  324. package/dist/icons/IconStar.js.map +1 -1
  325. package/dist/icons/IconStep.js.map +1 -1
  326. package/dist/icons/IconStop.js.map +1 -1
  327. package/dist/icons/IconStopwatch.js.map +1 -1
  328. package/dist/icons/IconTabPlus.js.map +1 -1
  329. package/dist/icons/IconTag.js.map +1 -1
  330. package/dist/icons/IconTasks.js.map +1 -1
  331. package/dist/icons/IconTeams.js.map +1 -1
  332. package/dist/icons/IconTeamsColor.js.map +1 -1
  333. package/dist/icons/IconTemplateCode.js.map +1 -1
  334. package/dist/icons/IconTerminal.js.map +1 -1
  335. package/dist/icons/IconTerminalFilled.js.map +1 -1
  336. package/dist/icons/IconTestQuarantine.js.map +1 -1
  337. package/dist/icons/IconThemeDarkToggle.js.map +1 -1
  338. package/dist/icons/IconThumbDown.js.map +1 -1
  339. package/dist/icons/IconThumbUp.js.map +1 -1
  340. package/dist/icons/IconTools.js.map +1 -1
  341. package/dist/icons/IconTrash.js.map +1 -1
  342. package/dist/icons/IconTrigger.js.map +1 -1
  343. package/dist/icons/IconUbuntu.js.map +1 -1
  344. package/dist/icons/IconUbuntuColor.js.map +1 -1
  345. package/dist/icons/IconUnity3D.js.map +1 -1
  346. package/dist/icons/IconUnpin.js.map +1 -1
  347. package/dist/icons/IconUpload.js.map +1 -1
  348. package/dist/icons/IconValidateShield.js.map +1 -1
  349. package/dist/icons/IconVideo.js.map +1 -1
  350. package/dist/icons/IconVsCode.js.map +1 -1
  351. package/dist/icons/IconWarning.js.map +1 -1
  352. package/dist/icons/IconWarningYellow.js.map +1 -1
  353. package/dist/icons/IconWebUi.js.map +1 -1
  354. package/dist/icons/IconWebhooks.js.map +1 -1
  355. package/dist/icons/IconWindsurf.js.map +1 -1
  356. package/dist/icons/IconWorkflow.js.map +1 -1
  357. package/dist/icons/IconWorkflowFlow.js.map +1 -1
  358. package/dist/icons/IconXTwitter.js.map +1 -1
  359. package/dist/icons/IconXamarin.js.map +1 -1
  360. package/dist/icons/IconXcode.js.map +1 -1
  361. package/dist/main.js +3 -1
  362. package/dist/theme/recipes/UIHeaderButton.recipe.js +103 -0
  363. package/dist/theme/recipes/UIHeaderButton.recipe.js.map +1 -0
  364. package/dist/theme/recipes/index.js +3 -1
  365. package/dist/theme/recipes/index.js.map +1 -1
  366. package/dist/theme/slot-recipes/Combobox.recipe.js.map +1 -1
  367. package/dist/theme/slot-recipes/TextInput.recipe.js.map +1 -1
  368. package/dist/theme/slot-recipes/UIHeader.recipe.d.ts +3 -0
  369. package/dist/theme/slot-recipes/UIHeader.recipe.js +229 -0
  370. package/dist/theme/slot-recipes/UIHeader.recipe.js.map +1 -0
  371. package/dist/theme/slot-recipes/index.d.ts +1 -0
  372. package/dist/theme/slot-recipes/index.js +2 -0
  373. package/dist/theme/slot-recipes/index.js.map +1 -1
  374. package/dist/theme/themeUtils.d.ts +6 -0
  375. package/dist/theme/themeUtils.js +7 -1
  376. package/dist/theme/themeUtils.js.map +1 -1
  377. package/dist/theme/tokens/sizes.js.map +1 -1
  378. package/dist/theme/tokens/spacing.js.map +1 -1
  379. package/package.json +10 -12
  380. package/dist/theme/recipes/index.d.ts +0 -525
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitTour.js","names":[],"sources":["../../../lib/components/BitkitTour/BitkitTour.tsx"],"sourcesContent":["import {\n Tour as ArkTour,\n type TourStepDetails,\n useTour,\n type UseTourProps,\n type UseTourReturn,\n} from '@ark-ui/react/tour';\nimport { Box } from '@chakra-ui/react/box';\nimport { useEnvironmentContext } from '@chakra-ui/react/environment';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { chakra, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { isIos } from '@zag-js/dom-query';\nimport { preventBodyScroll } from '@zag-js/remove-scroll';\nimport { type ReactNode, useCallback, useEffect, useRef } from 'react';\n\nimport BitkitButton from '../BitkitButton/BitkitButton';\nimport BitkitCloseButton from '../BitkitCloseButton/BitkitCloseButton';\n\ntype BitkitTourStepAction = NonNullable<TourStepDetails['actions']>[number];\n\n/**\n * The link-style action in the footer, e.g. `Skip tour` or `Learn more`. It either drives the tour\n * (`action`) or leaves the page (`href`) — the union makes passing both, or neither, a type error.\n */\nexport type BitkitTourSecondaryAction =\n | {\n /**\n * A tour action — `'skip'`, `'dismiss'`, `'next'`, `'prev'`, or a function that receives the\n * action map (`{ next, prev, dismiss, skip, goto }`) to do something else first.\n */\n action: NonNullable<BitkitTourStepAction['action']>;\n href?: never;\n label: string;\n }\n | {\n action?: never;\n /** Renders the action as a link out. */\n href: string;\n /** Opens the link in a new tab, with the matching `rel`. */\n isExternal?: boolean;\n label: string;\n };\n\n/**\n * A single step of the tour. On top of Ark's step details it carries the three Bitkit slots —\n * `badge`, `content` and `secondaryAction`. Zag spreads the whole step object when it normalises\n * it, so these reach `tour.step` untouched. (Zag also offers a `meta` bag for this; flat fields\n * read better at the call site, at the cost of a name clash if Zag ever adds one of these.)\n *\n * Ark's step `type` is not part of this: every step is a card anchored to an element, so the hook\n * sets it. `target` is required for the same reason — Zag turns a step without one into a centred\n * dialog, which is a presentation this component doesn't have.\n */\nexport type BitkitTourStep = Omit<TourStepDetails, 'type'> & {\n /**\n * Rendered next to the title — a `BitkitBadge` in practice, e.g. `BETA` or `NEW`. Nothing about\n * the badge is fixed here beyond its placement: the element itself comes from the caller.\n */\n badge?: ReactNode;\n /** Rendered between the description and the footer — an image, a video, a table, anything. */\n content?: ReactNode;\n secondaryAction?: BitkitTourSecondaryAction;\n /** The element the step points at. */\n target: NonNullable<TourStepDetails['target']>;\n};\n\nexport interface BitkitTourOptions extends Omit<UseTourProps, 'closeOnInteractOutside' | 'onStepsChange' | 'steps'> {\n /**\n * Called whenever the tour ends, whichever way it ended — the close button, `Skip tour`, the last\n * step's action, or a target that never appeared. It is the counterpart to `open`: turn your own\n * value false here and the tour can be opened again, without having to know which of Zag's five\n * statuses mean \"over\". `onStatusChange` still reports which one it was, for deciding whether to\n * record the tour as seen.\n */\n onClose?: () => void;\n /** Refined so the callback reports the Bitkit slots too, like the rest of the api does. */\n onStepsChange?: (details: { steps: BitkitTourStep[] }) => void;\n /**\n * Drives the tour from a value the caller already has — it starts when this turns true and closes\n * when it turns false. This is how a tour is opened: it announces something, so it appears once\n * the user is eligible for it, never in answer to the interaction it would interrupt.\n *\n * Only the transitions count: a tour that ends on its own — `Skip tour`, a lost target, the last\n * step — stays closed while this is still true, and starts again on the next `false → true`.\n */\n open?: boolean;\n steps: BitkitTourStep[];\n}\n/** The tour api returned by `useBitkitTour` — pass it around to control the tour from anywhere. */\nexport type BitkitTourInstance = Omit<UseTourReturn, 'addStep' | 'setSteps' | 'step' | 'updateStep'> & {\n addStep: (step: BitkitTourStep) => void;\n setSteps: (steps: BitkitTourStep[]) => void;\n /** The current step, with the Bitkit slots (`badge`, `content`, `secondaryAction`) still typed on it. */\n step: BitkitTourStep | null;\n /** Closes the tour, the same way its close button does. */\n dismiss: () => void;\n updateStep: (id: string, stepOverrides: Partial<BitkitTourStep>) => void;\n};\nexport type BitkitTourProps = {\n /** The tour instance returned by `useBitkitTour`. */\n tour: BitkitTourInstance;\n};\n\n/**\n * Creates the tour instance that drives `BitkitTour`. Takes the steps plus the tour-level options\n * (`onStepChange`, `onStatusChange`, `closeOnEscape`, `preventInteraction`, `translations`, …) and\n * returns the api that reports and navigates it: `step`, `stepIndex`, `totalSteps`, `next()`,\n * `prev()`, `setStep()`. Closing on a click outside isn't among them — see below.\n *\n * A one-step tour announces a feature, and behaves the same wherever it's used:\n *\n * - it appears on its own — `open` turns true once the user is eligible, and nothing has to be\n * clicked to bring it up;\n * - dismissing it closes it, and it doesn't come back;\n * - acting on the control it points at closes it too, reported as a dismissal like any other, so\n * the target keeps doing whatever it did before;\n * - until one of those two happens, a reload or a new session brings it back — which means the\n * dismissal is recorded for the user in `onStatusChange`, not kept in page state.\n */\nexport const useBitkitTour = (options: BitkitTourOptions): BitkitTourInstance => {\n // The document the tour lives in — the global one unless a consumer renders under an\n // `EnvironmentProvider`, e.g. into an iframe. Same route Zag's own machines take.\n const { getDocument } = useEnvironmentContext();\n\n // `onClose` is ours, not Zag's, so it is kept out of what reaches the machine. The ref keeps an\n // inline callback from giving the machine a new `onStatusChange` on every render.\n const { onClose, ...tourOptions } = options;\n const onCloseRef = useRef(onClose);\n onCloseRef.current = onClose;\n // Zag reports the end of a tour more than once — a dismissal on the last step emits `dismissed`\n // and then `completed` — so the run, not the status, is what `onClose` is tied to. Guarding on the\n // status names instead would encode which pairs the machine currently emits together.\n const hasClosedRef = useRef(false);\n\n const tour = useTour({\n // The highlight sits 8 around the target, and the card 12 from the highlight — the 8 the arrow\n // takes plus the 4 gap the design asks for. Both are measured from the highlight, since Zag\n // grows the anchor rect by `spotlightOffset` before positioning. `offset.mainAxis` replaces\n // Zag's own gutter, and Popper adds half the arrow's box on top of it: 6 + 5.65 ≈ the 12.\n spotlightOffset: { x: 8, y: 8 },\n // 4 is also Zag's current default, but the design asks for it and a third-party default is not\n // ours to rely on — the z-index contract already moved under us once between two minors.\n spotlightRadius: 4,\n ...tourOptions,\n // Not part of the options, and set after the spread so it can't be turned back on: a tour is a\n // guided flow with its own ways out — the close button, `Skip tour`, `Done` — and Zag would\n // otherwise end it on any click outside the card, losing the whole thing to a stray click on\n // the dimmed page. Escape is a deliberate keystroke rather than a stray click, so it keeps\n // closing the tour by default — and unlike this one, `closeOnEscape` stays in the options for\n // callers who want it off.\n closeOnInteractOutside: false,\n // Every status other than `started` is the tour ending, and `onClose` is what saves callers from\n // knowing that. The caller's own `onStatusChange` runs first and unchanged — it reports every\n // status, including the ones `onClose` collapses.\n onStatusChange: (details) => {\n tourOptions.onStatusChange?.(details);\n\n if (details.status === 'started') {\n hasClosedRef.current = false;\n\n return;\n }\n\n if (hasClosedRef.current) {\n return;\n }\n\n hasClosedRef.current = true;\n onCloseRef.current?.();\n },\n // Same reason as the cast on `Tour.Root` below: our step type isn't a supertype of Ark's, so a\n // callback taking ours doesn't match the signature Ark declares. The payload is Ark's.\n onStepsChange: tourOptions.onStepsChange as UseTourProps['onStepsChange'],\n // Zag's default is `close tour`, and this one is visible rather than screen-reader only: the\n // close button shows its own aria-label in a tooltip. The rest of Zag's translations\n // (`nextStep`, `prevStep`, `skip`) stay as they are — those only ever reach assistive tech.\n translations: { close: 'Close tour', ...tourOptions.translations },\n // `type` last: there is one presentation, so it isn't the caller's to pick.\n steps: tourOptions.steps.map((step) => ({ offset: { mainAxis: 6 }, ...step, type: 'tooltip' as const })),\n });\n\n // Zag's api can start a tour but not stop one. Its close trigger's click handler *is* the\n // machine's dismiss, so this borrows that instead of reaching into the machine. The cast says\n // what the handler is rather than manufacturing an event for it: `actionMap.dismiss` takes none.\n const dismiss = useCallback(() => {\n const closeTriggerClick = tour.getCloseTriggerProps().onClick as (() => void) | undefined;\n\n closeTriggerClick?.();\n }, [tour]);\n\n // A single-step tour points at one control, and operating that control is the same\n // acknowledgement its close button is — there is no next step to go to, so the tour is done. Zag\n // leaves the target clickable on purpose (it excludes it from interact-outside), so without this\n // every caller has to wire the dismissal into the target's own handler, and the ones that forget\n // show the tour again on the user's next visit. Multi-step tours are left alone: there, clicking\n // the highlighted control could as easily mean \"go on\" as \"I'm done\", which isn't ours to guess.\n //\n // The listener is on the document rather than the target, resolving the target when the click\n // happens: the target can re-render while the tour is open, and capture runs even when the\n // caller's own handler stops propagation. `click` rather than `pointerdown` — a right-click or an\n // abandoned drag isn't acting on it — and it still runs before a link's navigation, so a caller\n // that records the dismissal gets its request away.\n // `dismiss` closes over `tour`, which is a new object on every render, so listing it would put the\n // effects below on every render as well — attaching and detaching the listener for nothing.\n const dismissRef = useRef(dismiss);\n dismissRef.current = dismiss;\n\n const isSingleStep = options.steps.length === 1;\n useEffect(() => {\n if (!tour.open || !isSingleStep) {\n return undefined;\n }\n\n const onDocumentClick = (event: MouseEvent) => {\n const target = tour.step?.target?.();\n\n // The event path rather than `target.contains(event.target)`: under an `EnvironmentProvider`\n // the click comes from another realm, where a node is not an instance of this one's `Node`, so\n // narrowing it that way is always false — and the path crosses shadow boundaries as well.\n if (target && event.composedPath().includes(target)) {\n dismissRef.current();\n }\n };\n\n const doc = getDocument();\n\n doc.addEventListener('click', onDocumentClick, true);\n\n return () => doc.removeEventListener('click', onDocumentClick, true);\n // `tour` is a new object on every render; the machine's own state is what matters here.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [getDocument, isSingleStep, tour.open, tour.step?.id]);\n\n // Edge-triggered, on the prop's own `false → true`: comparing it against `tour.open` instead made\n // every close the machine performs for its own reasons look like a caller who wants the tour open,\n // and started it again. Zag reports five statuses and callers reasonably handle `dismissed` only,\n // so `Skip tour` (`skipped`) and a target that goes missing (`not-found`) both closed the tour and\n // had it come straight back at step one. `undefined` as the initial value so an `open` that is\n // already true on mount still starts the tour.\n const { open } = tourOptions;\n const previousOpen = useRef<boolean | undefined>(undefined);\n useEffect(() => {\n if (open === undefined || open === previousOpen.current) {\n return;\n }\n\n previousOpen.current = open;\n\n if (open) {\n tour.start();\n } else {\n dismissRef.current();\n }\n // `tour` is a new object on every render, and reacting to the machine's own `open` is exactly\n // what this effect must not do.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n return { ...tour, dismiss, step: tour.step as BitkitTourStep | null };\n};\n\n// The Ark parts aren't Chakra components, so they're wrapped with the `chakra()` factory to accept\n// `css`. They're deliberately NOT wrapped with `asChild`: each Ark part falls back to the current\n// step's content (title, description, progress text, action label) only when it renders its own\n// children, and `asChild` would replace those children with the wrapper element.\nconst TourBackdrop = chakra(ArkTour.Backdrop);\nconst TourSpotlight = chakra(ArkTour.Spotlight);\nconst TourPositioner = chakra(ArkTour.Positioner);\nconst TourContent = chakra(ArkTour.Content);\nconst TourArrow = chakra(ArkTour.Arrow);\nconst TourArrowTip = chakra(ArkTour.ArrowTip);\nconst TourTitle = chakra(ArkTour.Title);\nconst TourDescription = chakra(ArkTour.Description);\nconst TourControl = chakra(ArkTour.Control);\nconst TourProgressText = chakra(ArkTour.ProgressText);\n\nconst SecondaryAction = ({ secondaryAction }: { secondaryAction: BitkitTourSecondaryAction }) => {\n const { action, href, label } = secondaryAction;\n\n if (href !== undefined) {\n return (\n <BitkitButton href={href} isExternal={secondaryAction.isExternal} size=\"sm\" variant=\"tertiary\">\n {label}\n </BitkitButton>\n );\n }\n\n if (!action) return null;\n\n return (\n <ArkTour.ActionTrigger asChild action={{ action, label }} aria-label={label}>\n <BitkitButton size=\"sm\" variant=\"tertiary\">\n {label}\n </BitkitButton>\n </ArkTour.ActionTrigger>\n );\n};\n\n/**\n * A guided product tour: a step card anchored to an element on the page, with a spotlight cut out\n * of the dimmed backdrop around that element.\n *\n * The steps and the tour behaviour live on the instance — create it with `useBitkitTour` and render\n * `BitkitTour` once, anywhere in the tree. Each step declares its own action buttons; the last one\n * is rendered as the primary button. A single-step tour drops the `1 of n` label, which is what\n * turns the card into the single-feature presentation.\n */\nconst BitkitTour = ({ tour }: BitkitTourProps) => {\n const recipe = useSlotRecipe({ key: 'tour' });\n const styles = recipe();\n const step = tour.step;\n const actions = step?.actions ?? [];\n\n // Zag traps focus with fixed options, so it lands on the card's first tabbable — the close button,\n // which means a screen reader opens the tour on `Close tour` instead of on what the step says. The\n // card is what should take it: Zag gives the content `role=\"alertdialog\"`, `tabIndex: -1` and the\n // `aria-labelledby`/`aria-describedby` pair exactly so it can be focused and read out. Measured\n // alternatives that don't work: making the card tabbable (the trap picks a descendant either way)\n // and a ref (it doesn't survive the `chakra()`-wrapped Ark part). This corrects the trap's choice\n // instead of trying to beat it — the trap activates asynchronously too, and racing it with a frame\n // loses whenever the first paint is slow. The listener takes the first focus that lands anywhere\n // in the card, moves it to the card itself and then steps out of the way, so everything after it\n // (Tab, the buttons, a click) behaves normally. It arms on open and not per step, so stepping on\n // keeps the focus on the button that did it, rather than pulling the next keystroke back to the\n // card. The lookup goes through the machine's own content id, so two mounted tours can't reach\n // each other's card.\n //\n // The tour machine is the one Zag component that can't be told where to put focus: `dialog` takes\n // an `initialFocusEl` and hands it to the same trap, and even defaults an `alertdialog` to its\n // close trigger deliberately. Once the tour has that prop too, this effect goes away.\n const { open } = tour;\n // Everything below reaches for the document through the environment rather than the global one:\n // under an `EnvironmentProvider` — a consumer rendering into an iframe — that is the document the\n // portal, and so the tour, actually lives in. Zag's own machines take the same route.\n const { getDocument } = useEnvironmentContext();\n\n // The tour machine has no scroll handling of its own — no `preventScroll` prop, no listener —\n // while Zag's dialog machine locks the body through this same helper. The tour needs it just as\n // much: everything it paints is positioned in document coordinates from a target it resolves once,\n // when the step opens, and never looks up again. Let the page scroll and any layout that swaps its\n // elements around — a sticky header that moves its buttons into a portal is the common one —\n // leaves the machine anchored to a node that is no longer in the document. A detached node\n // measures zero, so the card, the spotlight and the backdrop's cut-out all collapse into the\n // top-left corner of the page. Locking is the honest reading of the presentation anyway: the tour\n // dims the page and takes focus, exactly like a modal dialog.\n // Not on iOS, where the helper pins `<body>` with `position: fixed` instead of hiding the\n // overflow: from there the machine's `scrollIntoView` on step entry can't move the viewport, so a\n // target below the fold is unreachable and the tour locks the user onto a step they can't see —\n // worse than the misalignment the lock is here to prevent. (`overflow: hidden` leaves programmatic\n // scrolling alone, which is what makes the lock safe everywhere else.)\n useEffect(() => (open && !isIos() ? preventBodyScroll(getDocument()) : undefined), [getDocument, open]);\n\n const contentId = tour.getContentProps().id;\n useEffect(() => {\n if (!open || contentId === undefined) {\n return undefined;\n }\n\n const contentEl = getDocument().getElementById(contentId);\n if (!contentEl) {\n return undefined;\n }\n\n const takeFocus = () => {\n contentEl.removeEventListener('focusin', takeFocus);\n // `preventScroll`, because this runs before Popper has placed the card, and until then the\n // card is parked off-screen at `-100vh` — a plain `focus()` scrolls the page up to it and\n // leaves the user looking at the top of the page with a tour they can't see. Zag passes the\n // same option everywhere it moves focus itself.\n contentEl.focus({ preventScroll: true });\n };\n\n contentEl.addEventListener('focusin', takeFocus);\n\n return () => contentEl.removeEventListener('focusin', takeFocus);\n }, [contentId, getDocument, open]);\n\n return (\n // `unmountOnExit` so a closed tour leaves nothing behind: the card, the backdrop and the\n // spotlight are all page-level overlays, and there is no state to keep alive between two runs.\n // The cast is the price of refining `step` and the step-mutating methods on the instance: our\n // step type isn't a supertype of Ark's, so the methods no longer match its api signature. The\n // object is Ark's api — only the types are ours.\n <ArkTour.Root unmountOnExit tour={tour as UseTourReturn}>\n <Portal>\n <TourBackdrop css={styles.backdrop} />\n <TourSpotlight css={styles.spotlight} />\n <TourPositioner css={styles.positioner}>\n <TourContent css={styles.content}>\n {/* `hidden={false}` overrides Zag, which hides the arrow until the card has been\n positioned — while Popper computes that position from the arrow's `clientHeight`, so\n a hidden arrow measures 0 and the card lands 6 short of the design's 12, then drops\n by that 6 as soon as anything recomputes. Nothing shows in the meantime: until it is\n positioned the card itself sits off-screen at `-100vh`. */}\n <TourArrow css={styles.arrow} hidden={false}>\n <TourArrowTip css={styles.arrowTip} />\n </TourArrow>\n <Box css={styles.header}>\n <Box css={styles.titleGroup}>\n {tour.totalSteps > 1 ? <TourProgressText css={styles.progressText} /> : null}\n <Box css={styles.titleRow}>\n <TourTitle css={styles.title} />\n {step?.badge ? <Box css={styles.badge}>{step.badge}</Box> : null}\n </Box>\n </Box>\n <ArkTour.CloseTrigger asChild>\n <BitkitCloseButton css={styles.closeTrigger} size=\"xs\" />\n </ArkTour.CloseTrigger>\n </Box>\n <TourDescription css={styles.description} />\n {step?.content ? <Box css={styles.media}>{step.content}</Box> : null}\n <TourControl css={styles.control}>\n {step?.secondaryAction ? <SecondaryAction secondaryAction={step.secondaryAction} /> : null}\n <Box css={styles.actions}>\n {actions.map((action, index) => (\n // Zag labels the trigger from its own translations (`close tour`, `next step`),\n // which would override the visible text as the accessible name — and put two\n // `Close tour` buttons on a card whose dismiss action reads `Got it`.\n <ArkTour.ActionTrigger key={action.label} asChild action={action} aria-label={action.label}>\n <BitkitButton size=\"sm\" variant={index === actions.length - 1 ? 'primary' : 'secondary'}>\n {action.label}\n </BitkitButton>\n </ArkTour.ActionTrigger>\n ))}\n </Box>\n </TourControl>\n </TourContent>\n </TourPositioner>\n </Portal>\n </ArkTour.Root>\n );\n};\n\nBitkitTour.displayName = 'BitkitTour';\n\nexport default BitkitTour;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuHA,IAAa,iBAAiB,YAAmD;CAG/E,MAAM,EAAE,gBAAgB,sBAAsB;CAI9C,MAAM,EAAE,SAAS,GAAG,gBAAgB;CACpC,MAAM,aAAa,OAAO,OAAO;CACjC,WAAW,UAAU;CAIrB,MAAM,eAAe,OAAO,KAAK;CAEjC,MAAM,OAAO,QAAQ;EAKnB,iBAAiB;GAAE,GAAG;GAAG,GAAG;EAAE;EAG9B,iBAAiB;EACjB,GAAG;EAOH,wBAAwB;EAIxB,iBAAiB,YAAY;GAC3B,YAAY,iBAAiB,OAAO;GAEpC,IAAI,QAAQ,WAAW,WAAW;IAChC,aAAa,UAAU;IAEvB;GACF;GAEA,IAAI,aAAa,SACf;GAGF,aAAa,UAAU;GACvB,WAAW,UAAU;E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AAzB,UAAA,CACG,MAAM,kBAAkB,oBAAC,iBAAD,EAAiB,iBAAiB,KAAK,gBAAkB,CAAA,IAAI,MACtF,oBAAC,KAAD;QAAK,KAAK,OAAO;QACd,UAAA,QAAQ,KAAK,QAAQ,UAIpB,oBAAC,KAAQ,eAAT;SAA0C,SAAA;SAAgB;SAAQ,cAAY,OAAO;SACnF,UAAA,oBAAC,cAAD;UAAc,MAAK;UAAK,SAAS,UAAU,QAAQ,SAAS,IAAI,YAAY;UACzE,UAAA,OAAO;SACI,CAAA;QACO,GAJK,OAAO,KAIZ,CACxB;OACE,CAAA,CACM;;KACF;;GACC,CAAA;EACV,EAAA,CAAA;CACI,CAAA;AAElB;AAEA,WAAW,cAAc"}
1
+ {"version":3,"file":"BitkitTour.js","names":["ArkTour"],"sources":["../../../lib/components/BitkitTour/BitkitTour.tsx"],"sourcesContent":["import {\n Tour as ArkTour,\n type TourStepDetails,\n useTour,\n type UseTourProps,\n type UseTourReturn,\n} from '@ark-ui/react/tour';\nimport { Box } from '@chakra-ui/react/box';\nimport { useEnvironmentContext } from '@chakra-ui/react/environment';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { chakra, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { isIos } from '@zag-js/dom-query';\nimport { preventBodyScroll } from '@zag-js/remove-scroll';\nimport { type ReactNode, useCallback, useEffect, useRef } from 'react';\n\nimport BitkitButton from '../BitkitButton/BitkitButton';\nimport BitkitCloseButton from '../BitkitCloseButton/BitkitCloseButton';\n\ntype BitkitTourStepAction = NonNullable<TourStepDetails['actions']>[number];\n\n/**\n * The link-style action in the footer, e.g. `Skip tour` or `Learn more`. It either drives the tour\n * (`action`) or leaves the page (`href`) — the union makes passing both, or neither, a type error.\n */\nexport type BitkitTourSecondaryAction =\n | {\n /**\n * A tour action — `'skip'`, `'dismiss'`, `'next'`, `'prev'`, or a function that receives the\n * action map (`{ next, prev, dismiss, skip, goto }`) to do something else first.\n */\n action: NonNullable<BitkitTourStepAction['action']>;\n href?: never;\n label: string;\n }\n | {\n action?: never;\n /** Renders the action as a link out. */\n href: string;\n /** Opens the link in a new tab, with the matching `rel`. */\n isExternal?: boolean;\n label: string;\n };\n\n/**\n * A single step of the tour. On top of Ark's step details it carries the three Bitkit slots —\n * `badge`, `content` and `secondaryAction`. Zag spreads the whole step object when it normalises\n * it, so these reach `tour.step` untouched. (Zag also offers a `meta` bag for this; flat fields\n * read better at the call site, at the cost of a name clash if Zag ever adds one of these.)\n *\n * Ark's step `type` is not part of this: every step is a card anchored to an element, so the hook\n * sets it. `target` is required for the same reason — Zag turns a step without one into a centred\n * dialog, which is a presentation this component doesn't have.\n */\nexport type BitkitTourStep = Omit<TourStepDetails, 'type'> & {\n /**\n * Rendered next to the title — a `BitkitBadge` in practice, e.g. `BETA` or `NEW`. Nothing about\n * the badge is fixed here beyond its placement: the element itself comes from the caller.\n */\n badge?: ReactNode;\n /** Rendered between the description and the footer — an image, a video, a table, anything. */\n content?: ReactNode;\n secondaryAction?: BitkitTourSecondaryAction;\n /** The element the step points at. */\n target: NonNullable<TourStepDetails['target']>;\n};\n\nexport interface BitkitTourOptions extends Omit<UseTourProps, 'closeOnInteractOutside' | 'onStepsChange' | 'steps'> {\n /**\n * Called whenever the tour ends, whichever way it ended — the close button, `Skip tour`, the last\n * step's action, or a target that never appeared. It is the counterpart to `open`: turn your own\n * value false here and the tour can be opened again, without having to know which of Zag's five\n * statuses mean \"over\". `onStatusChange` still reports which one it was, for deciding whether to\n * record the tour as seen.\n */\n onClose?: () => void;\n /** Refined so the callback reports the Bitkit slots too, like the rest of the api does. */\n onStepsChange?: (details: { steps: BitkitTourStep[] }) => void;\n /**\n * Drives the tour from a value the caller already has — it starts when this turns true and closes\n * when it turns false. This is how a tour is opened: it announces something, so it appears once\n * the user is eligible for it, never in answer to the interaction it would interrupt.\n *\n * Only the transitions count: a tour that ends on its own — `Skip tour`, a lost target, the last\n * step — stays closed while this is still true, and starts again on the next `false → true`.\n */\n open?: boolean;\n steps: BitkitTourStep[];\n}\n/** The tour api returned by `useBitkitTour` — pass it around to control the tour from anywhere. */\nexport type BitkitTourInstance = Omit<UseTourReturn, 'addStep' | 'setSteps' | 'step' | 'updateStep'> & {\n addStep: (step: BitkitTourStep) => void;\n setSteps: (steps: BitkitTourStep[]) => void;\n /** The current step, with the Bitkit slots (`badge`, `content`, `secondaryAction`) still typed on it. */\n step: BitkitTourStep | null;\n /** Closes the tour, the same way its close button does. */\n dismiss: () => void;\n updateStep: (id: string, stepOverrides: Partial<BitkitTourStep>) => void;\n};\nexport type BitkitTourProps = {\n /** The tour instance returned by `useBitkitTour`. */\n tour: BitkitTourInstance;\n};\n\n/**\n * Creates the tour instance that drives `BitkitTour`. Takes the steps plus the tour-level options\n * (`onStepChange`, `onStatusChange`, `closeOnEscape`, `preventInteraction`, `translations`, …) and\n * returns the api that reports and navigates it: `step`, `stepIndex`, `totalSteps`, `next()`,\n * `prev()`, `setStep()`. Closing on a click outside isn't among them — see below.\n *\n * A one-step tour announces a feature, and behaves the same wherever it's used:\n *\n * - it appears on its own — `open` turns true once the user is eligible, and nothing has to be\n * clicked to bring it up;\n * - dismissing it closes it, and it doesn't come back;\n * - acting on the control it points at closes it too, reported as a dismissal like any other, so\n * the target keeps doing whatever it did before;\n * - until one of those two happens, a reload or a new session brings it back — which means the\n * dismissal is recorded for the user in `onStatusChange`, not kept in page state.\n */\nexport const useBitkitTour = (options: BitkitTourOptions): BitkitTourInstance => {\n // The document the tour lives in — the global one unless a consumer renders under an\n // `EnvironmentProvider`, e.g. into an iframe. Same route Zag's own machines take.\n const { getDocument } = useEnvironmentContext();\n\n // `onClose` is ours, not Zag's, so it is kept out of what reaches the machine. The ref keeps an\n // inline callback from giving the machine a new `onStatusChange` on every render.\n const { onClose, ...tourOptions } = options;\n const onCloseRef = useRef(onClose);\n onCloseRef.current = onClose;\n // Zag reports the end of a tour more than once — a dismissal on the last step emits `dismissed`\n // and then `completed` — so the run, not the status, is what `onClose` is tied to. Guarding on the\n // status names instead would encode which pairs the machine currently emits together.\n const hasClosedRef = useRef(false);\n\n const tour = useTour({\n // The highlight sits 8 around the target, and the card 12 from the highlight — the 8 the arrow\n // takes plus the 4 gap the design asks for. Both are measured from the highlight, since Zag\n // grows the anchor rect by `spotlightOffset` before positioning. `offset.mainAxis` replaces\n // Zag's own gutter, and Popper adds half the arrow's box on top of it: 6 + 5.65 ≈ the 12.\n spotlightOffset: { x: 8, y: 8 },\n // 4 is also Zag's current default, but the design asks for it and a third-party default is not\n // ours to rely on — the z-index contract already moved under us once between two minors.\n spotlightRadius: 4,\n ...tourOptions,\n // Not part of the options, and set after the spread so it can't be turned back on: a tour is a\n // guided flow with its own ways out — the close button, `Skip tour`, `Done` — and Zag would\n // otherwise end it on any click outside the card, losing the whole thing to a stray click on\n // the dimmed page. Escape is a deliberate keystroke rather than a stray click, so it keeps\n // closing the tour by default — and unlike this one, `closeOnEscape` stays in the options for\n // callers who want it off.\n closeOnInteractOutside: false,\n // Every status other than `started` is the tour ending, and `onClose` is what saves callers from\n // knowing that. The caller's own `onStatusChange` runs first and unchanged — it reports every\n // status, including the ones `onClose` collapses.\n onStatusChange: (details) => {\n tourOptions.onStatusChange?.(details);\n\n if (details.status === 'started') {\n hasClosedRef.current = false;\n\n return;\n }\n\n if (hasClosedRef.current) {\n return;\n }\n\n hasClosedRef.current = true;\n onCloseRef.current?.();\n },\n // Same reason as the cast on `Tour.Root` below: our step type isn't a supertype of Ark's, so a\n // callback taking ours doesn't match the signature Ark declares. The payload is Ark's.\n onStepsChange: tourOptions.onStepsChange as UseTourProps['onStepsChange'],\n // Zag's default is `close tour`, and this one is visible rather than screen-reader only: the\n // close button shows its own aria-label in a tooltip. The rest of Zag's translations\n // (`nextStep`, `prevStep`, `skip`) stay as they are — those only ever reach assistive tech.\n translations: { close: 'Close tour', ...tourOptions.translations },\n // `type` last: there is one presentation, so it isn't the caller's to pick.\n steps: tourOptions.steps.map((step) => ({ offset: { mainAxis: 6 }, ...step, type: 'tooltip' as const })),\n });\n\n // Zag's api can start a tour but not stop one. Its close trigger's click handler *is* the\n // machine's dismiss, so this borrows that instead of reaching into the machine. The cast says\n // what the handler is rather than manufacturing an event for it: `actionMap.dismiss` takes none.\n const dismiss = useCallback(() => {\n const closeTriggerClick = tour.getCloseTriggerProps().onClick as (() => void) | undefined;\n\n closeTriggerClick?.();\n }, [tour]);\n\n // A single-step tour points at one control, and operating that control is the same\n // acknowledgement its close button is — there is no next step to go to, so the tour is done. Zag\n // leaves the target clickable on purpose (it excludes it from interact-outside), so without this\n // every caller has to wire the dismissal into the target's own handler, and the ones that forget\n // show the tour again on the user's next visit. Multi-step tours are left alone: there, clicking\n // the highlighted control could as easily mean \"go on\" as \"I'm done\", which isn't ours to guess.\n //\n // The listener is on the document rather than the target, resolving the target when the click\n // happens: the target can re-render while the tour is open, and capture runs even when the\n // caller's own handler stops propagation. `click` rather than `pointerdown` — a right-click or an\n // abandoned drag isn't acting on it — and it still runs before a link's navigation, so a caller\n // that records the dismissal gets its request away.\n // `dismiss` closes over `tour`, which is a new object on every render, so listing it would put the\n // effects below on every render as well — attaching and detaching the listener for nothing.\n const dismissRef = useRef(dismiss);\n dismissRef.current = dismiss;\n\n const isSingleStep = options.steps.length === 1;\n useEffect(() => {\n if (!tour.open || !isSingleStep) {\n return undefined;\n }\n\n const onDocumentClick = (event: MouseEvent) => {\n const target = tour.step?.target?.();\n\n // The event path rather than `target.contains(event.target)`: under an `EnvironmentProvider`\n // the click comes from another realm, where a node is not an instance of this one's `Node`, so\n // narrowing it that way is always false — and the path crosses shadow boundaries as well.\n if (target && event.composedPath().includes(target)) {\n dismissRef.current();\n }\n };\n\n const doc = getDocument();\n\n doc.addEventListener('click', onDocumentClick, true);\n\n return () => doc.removeEventListener('click', onDocumentClick, true);\n // `tour` is a new object on every render; the machine's own state is what matters here.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [getDocument, isSingleStep, tour.open, tour.step?.id]);\n\n // Edge-triggered, on the prop's own `false → true`: comparing it against `tour.open` instead made\n // every close the machine performs for its own reasons look like a caller who wants the tour open,\n // and started it again. Zag reports five statuses and callers reasonably handle `dismissed` only,\n // so `Skip tour` (`skipped`) and a target that goes missing (`not-found`) both closed the tour and\n // had it come straight back at step one. `undefined` as the initial value so an `open` that is\n // already true on mount still starts the tour.\n const { open } = tourOptions;\n const previousOpen = useRef<boolean | undefined>(undefined);\n useEffect(() => {\n if (open === undefined || open === previousOpen.current) {\n return;\n }\n\n previousOpen.current = open;\n\n if (open) {\n tour.start();\n } else {\n dismissRef.current();\n }\n // `tour` is a new object on every render, and reacting to the machine's own `open` is exactly\n // what this effect must not do.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n return { ...tour, dismiss, step: tour.step as BitkitTourStep | null };\n};\n\n// The Ark parts aren't Chakra components, so they're wrapped with the `chakra()` factory to accept\n// `css`. They're deliberately NOT wrapped with `asChild`: each Ark part falls back to the current\n// step's content (title, description, progress text, action label) only when it renders its own\n// children, and `asChild` would replace those children with the wrapper element.\nconst TourBackdrop = chakra(ArkTour.Backdrop);\nconst TourSpotlight = chakra(ArkTour.Spotlight);\nconst TourPositioner = chakra(ArkTour.Positioner);\nconst TourContent = chakra(ArkTour.Content);\nconst TourArrow = chakra(ArkTour.Arrow);\nconst TourArrowTip = chakra(ArkTour.ArrowTip);\nconst TourTitle = chakra(ArkTour.Title);\nconst TourDescription = chakra(ArkTour.Description);\nconst TourControl = chakra(ArkTour.Control);\nconst TourProgressText = chakra(ArkTour.ProgressText);\n\nconst SecondaryAction = ({ secondaryAction }: { secondaryAction: BitkitTourSecondaryAction }) => {\n const { action, href, label } = secondaryAction;\n\n if (href !== undefined) {\n return (\n <BitkitButton href={href} isExternal={secondaryAction.isExternal} size=\"sm\" variant=\"tertiary\">\n {label}\n </BitkitButton>\n );\n }\n\n if (!action) return null;\n\n return (\n <ArkTour.ActionTrigger asChild action={{ action, label }} aria-label={label}>\n <BitkitButton size=\"sm\" variant=\"tertiary\">\n {label}\n </BitkitButton>\n </ArkTour.ActionTrigger>\n );\n};\n\n/**\n * A guided product tour: a step card anchored to an element on the page, with a spotlight cut out\n * of the dimmed backdrop around that element.\n *\n * The steps and the tour behaviour live on the instance — create it with `useBitkitTour` and render\n * `BitkitTour` once, anywhere in the tree. Each step declares its own action buttons; the last one\n * is rendered as the primary button. A single-step tour drops the `1 of n` label, which is what\n * turns the card into the single-feature presentation.\n */\nconst BitkitTour = ({ tour }: BitkitTourProps) => {\n const recipe = useSlotRecipe({ key: 'tour' });\n const styles = recipe();\n const step = tour.step;\n const actions = step?.actions ?? [];\n\n // Zag traps focus with fixed options, so it lands on the card's first tabbable — the close button,\n // which means a screen reader opens the tour on `Close tour` instead of on what the step says. The\n // card is what should take it: Zag gives the content `role=\"alertdialog\"`, `tabIndex: -1` and the\n // `aria-labelledby`/`aria-describedby` pair exactly so it can be focused and read out. Measured\n // alternatives that don't work: making the card tabbable (the trap picks a descendant either way)\n // and a ref (it doesn't survive the `chakra()`-wrapped Ark part). This corrects the trap's choice\n // instead of trying to beat it — the trap activates asynchronously too, and racing it with a frame\n // loses whenever the first paint is slow. The listener takes the first focus that lands anywhere\n // in the card, moves it to the card itself and then steps out of the way, so everything after it\n // (Tab, the buttons, a click) behaves normally. It arms on open and not per step, so stepping on\n // keeps the focus on the button that did it, rather than pulling the next keystroke back to the\n // card. The lookup goes through the machine's own content id, so two mounted tours can't reach\n // each other's card.\n //\n // The tour machine is the one Zag component that can't be told where to put focus: `dialog` takes\n // an `initialFocusEl` and hands it to the same trap, and even defaults an `alertdialog` to its\n // close trigger deliberately. Once the tour has that prop too, this effect goes away.\n const { open } = tour;\n // Everything below reaches for the document through the environment rather than the global one:\n // under an `EnvironmentProvider` — a consumer rendering into an iframe — that is the document the\n // portal, and so the tour, actually lives in. Zag's own machines take the same route.\n const { getDocument } = useEnvironmentContext();\n\n // The tour machine has no scroll handling of its own — no `preventScroll` prop, no listener —\n // while Zag's dialog machine locks the body through this same helper. The tour needs it just as\n // much: everything it paints is positioned in document coordinates from a target it resolves once,\n // when the step opens, and never looks up again. Let the page scroll and any layout that swaps its\n // elements around — a sticky header that moves its buttons into a portal is the common one —\n // leaves the machine anchored to a node that is no longer in the document. A detached node\n // measures zero, so the card, the spotlight and the backdrop's cut-out all collapse into the\n // top-left corner of the page. Locking is the honest reading of the presentation anyway: the tour\n // dims the page and takes focus, exactly like a modal dialog.\n // Not on iOS, where the helper pins `<body>` with `position: fixed` instead of hiding the\n // overflow: from there the machine's `scrollIntoView` on step entry can't move the viewport, so a\n // target below the fold is unreachable and the tour locks the user onto a step they can't see —\n // worse than the misalignment the lock is here to prevent. (`overflow: hidden` leaves programmatic\n // scrolling alone, which is what makes the lock safe everywhere else.)\n useEffect(() => (open && !isIos() ? preventBodyScroll(getDocument()) : undefined), [getDocument, open]);\n\n const contentId = tour.getContentProps().id;\n useEffect(() => {\n if (!open || contentId === undefined) {\n return undefined;\n }\n\n const contentEl = getDocument().getElementById(contentId);\n if (!contentEl) {\n return undefined;\n }\n\n const takeFocus = () => {\n contentEl.removeEventListener('focusin', takeFocus);\n // `preventScroll`, because this runs before Popper has placed the card, and until then the\n // card is parked off-screen at `-100vh` — a plain `focus()` scrolls the page up to it and\n // leaves the user looking at the top of the page with a tour they can't see. Zag passes the\n // same option everywhere it moves focus itself.\n contentEl.focus({ preventScroll: true });\n };\n\n contentEl.addEventListener('focusin', takeFocus);\n\n return () => contentEl.removeEventListener('focusin', takeFocus);\n }, [contentId, getDocument, open]);\n\n return (\n // `unmountOnExit` so a closed tour leaves nothing behind: the card, the backdrop and the\n // spotlight are all page-level overlays, and there is no state to keep alive between two runs.\n // The cast is the price of refining `step` and the step-mutating methods on the instance: our\n // step type isn't a supertype of Ark's, so the methods no longer match its api signature. The\n // object is Ark's api — only the types are ours.\n <ArkTour.Root unmountOnExit tour={tour as UseTourReturn}>\n <Portal>\n <TourBackdrop css={styles.backdrop} />\n <TourSpotlight css={styles.spotlight} />\n <TourPositioner css={styles.positioner}>\n <TourContent css={styles.content}>\n {/* `hidden={false}` overrides Zag, which hides the arrow until the card has been\n positioned — while Popper computes that position from the arrow's `clientHeight`, so\n a hidden arrow measures 0 and the card lands 6 short of the design's 12, then drops\n by that 6 as soon as anything recomputes. Nothing shows in the meantime: until it is\n positioned the card itself sits off-screen at `-100vh`. */}\n <TourArrow css={styles.arrow} hidden={false}>\n <TourArrowTip css={styles.arrowTip} />\n </TourArrow>\n <Box css={styles.header}>\n <Box css={styles.titleGroup}>\n {tour.totalSteps > 1 ? <TourProgressText css={styles.progressText} /> : null}\n <Box css={styles.titleRow}>\n <TourTitle css={styles.title} />\n {step?.badge ? <Box css={styles.badge}>{step.badge}</Box> : null}\n </Box>\n </Box>\n <ArkTour.CloseTrigger asChild>\n <BitkitCloseButton css={styles.closeTrigger} size=\"xs\" />\n </ArkTour.CloseTrigger>\n </Box>\n <TourDescription css={styles.description} />\n {step?.content ? <Box css={styles.media}>{step.content}</Box> : null}\n <TourControl css={styles.control}>\n {step?.secondaryAction ? <SecondaryAction secondaryAction={step.secondaryAction} /> : null}\n <Box css={styles.actions}>\n {actions.map((action, index) => (\n // Zag labels the trigger from its own translations (`close tour`, `next step`),\n // which would override the visible text as the accessible name — and put two\n // `Close tour` buttons on a card whose dismiss action reads `Got it`.\n <ArkTour.ActionTrigger key={action.label} asChild action={action} aria-label={action.label}>\n <BitkitButton size=\"sm\" variant={index === actions.length - 1 ? 'primary' : 'secondary'}>\n {action.label}\n </BitkitButton>\n </ArkTour.ActionTrigger>\n ))}\n </Box>\n </TourControl>\n </TourContent>\n </TourPositioner>\n </Portal>\n </ArkTour.Root>\n );\n};\n\nBitkitTour.displayName = 'BitkitTour';\n\nexport default BitkitTour;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuHA,IAAa,iBAAiB,YAAmD;CAG/E,MAAM,EAAE,gBAAgB,sBAAsB;CAI9C,MAAM,EAAE,SAAS,GAAG,gBAAgB;CACpC,MAAM,aAAa,OAAO,OAA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AAA,IAAI,IACzD;QACF,CAAA,CAAA;OACL,CAAA,GAAA,oBAACA,KAAQ,cAAT;QAAsB,SAAA;QACpB,UAAA,oBAAC,mBAAD;SAAmB,KAAK,OAAO;SAAc,MAAK;QAAM,CAAA;OACpC,CAAA,CACnB;;MACL,oBAAC,iBAAD,EAAiB,KAAK,OAAO,YAAc,CAAA;MAC1C,MAAM,UAAU,oBAAC,KAAD;OAAK,KAAK,OAAO;OAAQ,UAAA,KAAK;MAAa,CAAA,IAAI;MAChE,qBAAC,aAAD;OAAa,KAAK,OAAO;OAAzB,UAAA,CACG,MAAM,kBAAkB,oBAAC,iBAAD,EAAiB,iBAAiB,KAAK,gBAAkB,CAAA,IAAI,MACtF,oBAAC,KAAD;QAAK,KAAK,OAAO;QACd,UAAA,QAAQ,KAAK,QAAQ,UAIpB,oBAACA,KAAQ,eAAT;SAA0C,SAAA;SAAgB;SAAQ,cAAY,OAAO;SACnF,UAAA,oBAAC,cAAD;UAAc,MAAK;UAAK,SAAS,UAAU,QAAQ,SAAS,IAAI,YAAY;UACzE,UAAA,OAAO;SACI,CAAA;QACO,GAJK,OAAO,KAIZ,CACxB;OACE,CAAA,CACM;;KACF;;GACC,CAAA;EACV,EAAA,CAAA;CACI,CAAA;AAElB;AAEA,WAAW,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitTreeView.js","names":[],"sources":["../../../lib/components/BitkitTreeView/BitkitTreeView.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { Box } from '@chakra-ui/react/box';\nimport { useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport {\n TreeView,\n type TreeViewBranchControlProps,\n type TreeViewItemProps,\n type TreeViewNodeRenderProps,\n type TreeViewRootProps,\n useTreeViewContext,\n} from '@chakra-ui/react/tree-view';\nimport { VisuallyHidden } from '@chakra-ui/react/visually-hidden';\nimport { cloneElement, forwardRef, type ReactElement, type ReactNode } from 'react';\n\nimport { type BitkitIconComponent, IconChevronRight, IconFolder, IconWarningYellow } from '../../icons';\nimport { type BitkitColorToken } from '../../theme/themeUtils';\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport BitkitTooltip from '../BitkitTooltip/BitkitTooltip';\n\n// Re-export for consumer convenience\nexport { createTreeCollection } from '@chakra-ui/react/collection';\n\n// Re-export useful types\nexport type {\n TreeViewExpandedChangeDetails as BitkitTreeViewExpandedChangeDetails,\n TreeViewNodeRenderProps as BitkitTreeViewNodeRenderProps,\n TreeViewSelectionChangeDetails as BitkitTreeViewSelectionChangeDetails,\n} from '@chakra-ui/react/tree-view';\n\n// --- Variant context ---\n\nexport type BitkitTreeViewVariant = 'files' | 'navigation';\n\nconst [VariantProvider, useVariant] = createContext<{ variant: BitkitTreeViewVariant }>({\n name: 'BitkitTreeViewVariantContext',\n defaultValue: { variant: 'files' },\n});\n\nconst useCustomSlotStyles = (variant: BitkitTreeViewVariant) => {\n const recipe = useSlotRecipe({ key: 'treeView' });\n return recipe({ variant });\n};\n\n// --- Root ---\n\nexport interface BitkitTreeViewRootProps extends Omit<TreeViewRootProps, 'children'> {\n children?: ReactNode;\n render: (props: TreeViewNodeRenderProps) => ReactNode;\n /**\n * Content after a branch's children, indented like them: a `BitkitPaginationLoadMore` with\n * `size=\"xs\"` for a directory that loads its files in pages. Called for branch nodes only;\n * return `null` for a branch that needs nothing. Designed for the `files` variant.\n */\n renderBranchFooter?: (props: TreeViewNodeRenderProps) => ReactNode;\n variant?: BitkitTreeViewVariant;\n}\n\ninterface NodesProps extends Pick<BitkitTreeViewRootProps, 'render' | 'renderBranchFooter'> {\n indentGuide?: ReactElement;\n variant: BitkitTreeViewVariant;\n}\n\n// Chakra's TreeView.Node, which has no slot after a branch's children.\nconst Nodes = ({ indentGuide, render, renderBranchFooter, variant }: NodesProps) => {\n const tree = useTreeViewContext();\n const styles = useCustomSlotStyles(variant);\n\n const renderNode = (node: unknown, indexPath: number[]): ReactNode => (\n <TreeView.NodeProvider key={indexPath.join('.')} indexPath={indexPath} node={node}>\n <TreeView.NodeContext>\n {(nodeState) => {\n if (!nodeState.isBranch) {\n return render({ indexPath, node, nodeState });\n }\n\n const footer = renderBranchFooter?.({ indexPath, node, nodeState });\n\n return (\n <TreeView.Branch>\n {render({ indexPath, node, nodeState })}\n <TreeView.BranchContent>\n {indentGuide}\n {tree.collection.getNodeChildren(node).map((child, index) => renderNode(child, [...indexPath, index]))}\n {footer && <Box css={[styles.footer, { '--depth': indexPath.length + 1 }]}>{footer}</Box>}\n </TreeView.BranchContent>\n </TreeView.Branch>\n );\n }}\n </TreeView.NodeContext>\n </TreeView.NodeProvider>\n );\n\n return tree.collection.getNodeChildren(tree.collection.rootNode).map((node, index) => renderNode(node, [index]));\n};\n\n/**\n * A tree of collapsible branches and leaves, in a `files` or a `navigation` look. The tree is data,\n * not JSX: build `collection` with `createTreeCollection` (re-exported from here), and `render`\n * returns `BitkitTreeView.Branch` when `nodeState.isBranch` and `BitkitTreeView.Leaf` otherwise.\n *\n * Root also takes Chakra's `TreeView.Root` props: `defaultExpandedValue` / `expandedValue` /\n * `onExpandedChange`, `selectionMode`, `defaultSelectedValue` / `selectedValue` /\n * `onSelectionChange`, `lazyMount` (keeps unopened branches out of the DOM), and\n * `translations={{ treeLabel }}` for the tree's accessible name. `children` renders after the whole\n * tree, indented like the top-level nodes, and `renderBranchFooter` after one branch's children,\n * indented like them: both take a `BitkitPaginationLoadMore size=\"xs\"` for trees that load in pages.\n *\n * `BitkitTreeView.Branch` (a `TreeView.BranchControl`) and `BitkitTreeView.Leaf` (a `TreeView.Item`,\n * so it takes `onClick` and `onKeyDown`) share these props:\n *\n * | Prop | Type | Notes |\n * | --- | --- | --- |\n * | `label` | `string` | Required. |\n * | `subtext` | `ReactNode` | A second line under the label. |\n * | `suffixText` | `string` | Trailing text, e.g. a count or a duration. |\n * | `suffixIcon` | `BitkitIconComponent` | Trailing icon, before `suffixText`. |\n * | `hasWarning` | `boolean` | A warning icon at the start of the suffix. |\n * | `actions` | `ReactElement[]` | Buttons shown in place of the suffix on hover, forced to `size=\"xs\"`. Their clicks do not reach the row. |\n *\n * Leaf only:\n *\n * | Prop | Type | Notes |\n * | --- | --- | --- |\n * | `icon` | `BitkitIconComponent` | Before the label. Branches draw their own folder or chevron. |\n * | `iconColor` | `icon/*` token | For an icon that carries a status. Wins over hover and selection. |\n * | `badge` | `ReactElement` | Before the label, forced to `size=\"xs\"`. |\n * | `badgeTooltip` | `string` | Shown when the badge is hovered, and read out after the label. Pass it here rather than wrapping `badge` in a tooltip, which would take the `size` instead of the badge. |\n *\n * Behaviour worth knowing:\n * - Enter on a node selects it and does not fire a DOM click, so open things from\n * `onSelectionChange`. Activating the selected leaf again changes nothing, so a leaf that should\n * reopen needs its own `onClick` and `onKeyDown` for that case.\n * - A node with `children: []` renders as a leaf, not as an empty branch. For an empty folder, give the\n * collection a `nodeToChildrenCount` that returns `0` for it, and put `disabled: true` on the node itself:\n * Zag reads `node.disabled` and ignores the collection's `isNodeDisabled`. The folder then renders in the\n * disabled colours, cannot be opened, and keeps its actions.\n * - The `navigation` design has no badges, no actions and no subtext on leaves; those slots are drawn\n * for `files`.\n */\nconst Root = forwardRef<HTMLDivElement, BitkitTreeViewRootProps>(\n ({ children, render, renderBranchFooter, variant = 'files', ...props }, ref) => {\n const indentGuide = variant === 'files' ? <TreeView.BranchIndentGuide /> : undefined;\n const styles = useCustomSlotStyles(variant);\n\n return (\n <VariantProvider value={{ variant }}>\n <TreeView.Root ref={ref} variant={variant} {...props}>\n <TreeView.Tree>\n <Nodes\n indentGuide={indentGuide}\n render={render}\n renderBranchFooter={renderBranchFooter}\n variant={variant}\n />\n {children && <Box css={[styles.footer, { '--depth': 1 }]}>{children}</Box>}\n </TreeView.Tree>\n </TreeView.Root>\n </VariantProvider>\n );\n },\n);\nRoot.displayName = 'BitkitTreeView';\n\n// --- Actions ---\n\n// The buttons sit inside the row, so a click that bubbled up would also toggle the branch or select the leaf.\nconst Actions = ({ actions, variant }: { actions: ReactElement[]; variant: BitkitTreeViewVariant }) => {\n const styles = useCustomSlotStyles(variant);\n\n return (\n <Box css={styles.actionGroup} onClick={(event) => event.stopPropagation()}>\n {actions.map((action) => cloneElement(action, { size: 'xs' }))}\n </Box>\n );\n};\n\n// --- Branch ---\n\nexport interface BitkitTreeViewBranchProps extends Omit<TreeViewBranchControlProps, 'children'> {\n actions?: ReactElement[];\n hasWarning?: boolean;\n label: string;\n subtext?: ReactNode;\n suffixIcon?: BitkitIconComponent;\n suffixText?: string;\n}\n\nconst Branch = forwardRef<HTMLDivElement, BitkitTreeViewBranchProps>((props, ref) => {\n const { actions, hasWarning, label, subtext, suffixIcon: SuffixIcon, suffixText, ...rest } = props;\n const { variant } = useVariant();\n const styles = useCustomSlotStyles(variant);\n const hasSuffix = hasWarning || SuffixIcon || suffixText;\n const hasActions = actions && actions.length > 0;\n\n const BranchIcon = variant === 'navigation' ? IconChevronRight : IconFolder;\n\n return (\n <TreeView.BranchControl ref={ref} className={hasActions ? 'group' : undefined} {...rest}>\n <TreeView.BranchIndicator>\n <BranchIcon size=\"16\" />\n </TreeView.BranchIndicator>\n <TreeView.BranchText>\n {label}\n {subtext && <Text css={styles.secondaryText}>{subtext}</Text>}\n </TreeView.BranchText>\n {hasSuffix && (\n <Box css={styles.suffixGroup}>\n {hasWarning && <IconWarningYellow size=\"16\" />}\n {SuffixIcon && <SuffixIcon size=\"16\" />}\n {suffixText && <span>{suffixText}</span>}\n </Box>\n )}\n {hasActions && <Actions actions={actions} variant={variant} />}\n </TreeView.BranchControl>\n );\n});\nBranch.displayName = 'BitkitTreeView.Branch';\n\n// --- Leaf ---\n\nexport interface BitkitTreeViewLeafProps extends Omit<TreeViewItemProps, 'children'> {\n actions?: ReactElement[];\n badge?: ReactElement;\n /** Explains the badge on hover, e.g. what its letter stands for. */\n badgeTooltip?: string;\n hasWarning?: boolean;\n icon?: BitkitIconComponent;\n /** An `icon/*` token for the icon when it carries meaning of its own, such as a test result's status. */\n iconColor?: BitkitColorToken<'icon'>;\n label: string;\n subtext?: ReactNode;\n suffixIcon?: BitkitIconComponent;\n suffixText?: string;\n}\n\nconst Leaf = forwardRef<HTMLDivElement, BitkitTreeViewLeafProps>((props, ref) => {\n const {\n actions,\n badge,\n badgeTooltip,\n hasWarning,\n icon: Icon,\n iconColor,\n label,\n subtext,\n suffixIcon: SuffixIcon,\n suffixText,\n ...rest\n } = props;\n const { variant } = useVariant();\n const styles = useCustomSlotStyles(variant);\n const hasSuffix = hasWarning || SuffixIcon || suffixText;\n const hasActions = actions && actions.length > 0;\n const sizedBadge = badge && cloneElement(badge, { size: 'xs' });\n const badgeDescription = sizedBadge ? badgeTooltip : undefined;\n\n return (\n <TreeView.Item ref={ref} className={hasActions ? 'group' : undefined} {...rest}>\n {Icon && <Icon color={iconColor} size=\"16\" />}\n {badgeDescription ? <BitkitTooltip text={badgeDescription}>{sizedBadge}</BitkitTooltip> : sizedBadge}\n <TreeView.ItemText>\n {label}\n {/* A tree has a single Tab stop, so the badge takes no focus: its tooltip is read out with the label instead. */}\n {badgeDescription && <VisuallyHidden>{`, ${badgeDescription}`}</VisuallyHidden>}\n {subtext && <Text css={styles.secondaryText}>{subtext}</Text>}\n </TreeView.ItemText>\n {hasSuffix && (\n <Box css={styles.suffixGroup}>\n {hasWarning && <IconWarningYellow size=\"16\" />}\n {SuffixIcon && <SuffixIcon size=\"16\" />}\n {suffixText && <span>{suffixText}</span>}\n </Box>\n )}\n {hasActions && <Actions actions={actions} variant={variant} />}\n </TreeView.Item>\n );\n});\nLeaf.displayName = 'BitkitTreeView.Leaf';\n\n// --- Main export ---\n\nconst BitkitTreeView = withSubComponents(Root, {\n Branch,\n Leaf,\n});\n\nexport default BitkitTreeView;\n"],"mappings":";;;;;;;;;;;;;;;AAmCA,IAAM,CAAC,iBAAiB,cAAc,gBAAkD;CACtF,MAAM;CACN,cAAc,EAAE,SAAS,QAAQ;AACnC,CAAC;AAED,IAAM,uBA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,KAAM,CAAA;KACrC,cAAc,oBAAC,QAAD,EAAA,UAAO,WAAiB,CAAA;IACpC;;GAEN,cAAc,oBAAC,SAAD;IAAkB;IAAkB;GAAU,CAAA;EAChD;;AAEnB,CAAC;AACD,KAAK,cAAc;AAInB,IAAM,iBAAiB,kBAAkB,MAAM;CAC7C;CACA;AACF,CAAC"}
1
+ {"version":3,"file":"BitkitTreeView.js","names":["createContext"],"sources":["../../../lib/components/BitkitTreeView/BitkitTreeView.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { Box } from '@chakra-ui/react/box';\nimport { useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport {\n TreeView,\n type TreeViewBranchControlProps,\n type TreeViewItemProps,\n type TreeViewNodeRenderProps,\n type TreeViewRootProps,\n useTreeViewContext,\n} from '@chakra-ui/react/tree-view';\nimport { VisuallyHidden } from '@chakra-ui/react/visually-hidden';\nimport { cloneElement, forwardRef, type ReactElement, type ReactNode } from 'react';\n\nimport { type BitkitIconComponent, IconChevronRight, IconFolder, IconWarningYellow } from '../../icons';\nimport { type BitkitColorToken } from '../../theme/themeUtils';\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport BitkitTooltip from '../BitkitTooltip/BitkitTooltip';\n\n// Re-export for consumer convenience\nexport { createTreeCollection } from '@chakra-ui/react/collection';\n\n// Re-export useful types\nexport type {\n TreeViewExpandedChangeDetails as BitkitTreeViewExpandedChangeDetails,\n TreeViewNodeRenderProps as BitkitTreeViewNodeRenderProps,\n TreeViewSelectionChangeDetails as BitkitTreeViewSelectionChangeDetails,\n} from '@chakra-ui/react/tree-view';\n\n// --- Variant context ---\n\nexport type BitkitTreeViewVariant = 'files' | 'navigation';\n\nconst [VariantProvider, useVariant] = createContext<{ variant: BitkitTreeViewVariant }>({\n name: 'BitkitTreeViewVariantContext',\n defaultValue: { variant: 'files' },\n});\n\nconst useCustomSlotStyles = (variant: BitkitTreeViewVariant) => {\n const recipe = useSlotRecipe({ key: 'treeView' });\n return recipe({ variant });\n};\n\n// --- Root ---\n\nexport interface BitkitTreeViewRootProps extends Omit<TreeViewRootProps, 'children'> {\n children?: ReactNode;\n render: (props: TreeViewNodeRenderProps) => ReactNode;\n /**\n * Content after a branch's children, indented like them: a `BitkitPaginationLoadMore` with\n * `size=\"xs\"` for a directory that loads its files in pages. Called for branch nodes only;\n * return `null` for a branch that needs nothing. Designed for the `files` variant.\n */\n renderBranchFooter?: (props: TreeViewNodeRenderProps) => ReactNode;\n variant?: BitkitTreeViewVariant;\n}\n\ninterface NodesProps extends Pick<BitkitTreeViewRootProps, 'render' | 'renderBranchFooter'> {\n indentGuide?: ReactElement;\n variant: BitkitTreeViewVariant;\n}\n\n// Chakra's TreeView.Node, which has no slot after a branch's children.\nconst Nodes = ({ indentGuide, render, renderBranchFooter, variant }: NodesProps) => {\n const tree = useTreeViewContext();\n const styles = useCustomSlotStyles(variant);\n\n const renderNode = (node: unknown, indexPath: number[]): ReactNode => (\n <TreeView.NodeProvider key={indexPath.join('.')} indexPath={indexPath} node={node}>\n <TreeView.NodeContext>\n {(nodeState) => {\n if (!nodeState.isBranch) {\n return render({ indexPath, node, nodeState });\n }\n\n const footer = renderBranchFooter?.({ indexPath, node, nodeState });\n\n return (\n <TreeView.Branch>\n {render({ indexPath, node, nodeState })}\n <TreeView.BranchContent>\n {indentGuide}\n {tree.collection.getNodeChildren(node).map((child, index) => renderNode(child, [...indexPath, index]))}\n {footer && <Box css={[styles.footer, { '--depth': indexPath.length + 1 }]}>{footer}</Box>}\n </TreeView.BranchContent>\n </TreeView.Branch>\n );\n }}\n </TreeView.NodeContext>\n </TreeView.NodeProvider>\n );\n\n return tree.collection.getNodeChildren(tree.collection.rootNode).map((node, index) => renderNode(node, [index]));\n};\n\n/**\n * A tree of collapsible branches and leaves, in a `files` or a `navigation` look. The tree is data,\n * not JSX: build `collection` with `createTreeCollection` (re-exported from here), and `render`\n * returns `BitkitTreeView.Branch` when `nodeState.isBranch` and `BitkitTreeView.Leaf` otherwise.\n *\n * Root also takes Chakra's `TreeView.Root` props: `defaultExpandedValue` / `expandedValue` /\n * `onExpandedChange`, `selectionMode`, `defaultSelectedValue` / `selectedValue` /\n * `onSelectionChange`, `lazyMount` (keeps unopened branches out of the DOM), and\n * `translations={{ treeLabel }}` for the tree's accessible name. `children` renders after the whole\n * tree, indented like the top-level nodes, and `renderBranchFooter` after one branch's children,\n * indented like them: both take a `BitkitPaginationLoadMore size=\"xs\"` for trees that load in pages.\n *\n * `BitkitTreeView.Branch` (a `TreeView.BranchControl`) and `BitkitTreeView.Leaf` (a `TreeView.Item`,\n * so it takes `onClick` and `onKeyDown`) share these props:\n *\n * | Prop | Type | Notes |\n * | --- | --- | --- |\n * | `label` | `string` | Required. |\n * | `subtext` | `ReactNode` | A second line under the label. |\n * | `suffixText` | `string` | Trailing text, e.g. a count or a duration. |\n * | `suffixIcon` | `BitkitIconComponent` | Trailing icon, before `suffixText`. |\n * | `hasWarning` | `boolean` | A warning icon at the start of the suffix. |\n * | `actions` | `ReactElement[]` | Buttons shown in place of the suffix on hover, forced to `size=\"xs\"`. Their clicks do not reach the row. |\n *\n * Leaf only:\n *\n * | Prop | Type | Notes |\n * | --- | --- | --- |\n * | `icon` | `BitkitIconComponent` | Before the label. Branches draw their own folder or chevron. |\n * | `iconColor` | `icon/*` token | For an icon that carries a status. Wins over hover and selection. |\n * | `badge` | `ReactElement` | Before the label, forced to `size=\"xs\"`. |\n * | `badgeTooltip` | `string` | Shown when the badge is hovered, and read out after the label. Pass it here rather than wrapping `badge` in a tooltip, which would take the `size` instead of the badge. |\n *\n * Behaviour worth knowing:\n * - Enter on a node selects it and does not fire a DOM click, so open things from\n * `onSelectionChange`. Activating the selected leaf again changes nothing, so a leaf that should\n * reopen needs its own `onClick` and `onKeyDown` for that case.\n * - A node with `children: []` renders as a leaf, not as an empty branch. For an empty folder, give the\n * collection a `nodeToChildrenCount` that returns `0` for it, and put `disabled: true` on the node itself:\n * Zag reads `node.disabled` and ignores the collection's `isNodeDisabled`. The folder then renders in the\n * disabled colours, cannot be opened, and keeps its actions.\n * - The `navigation` design has no badges, no actions and no subtext on leaves; those slots are drawn\n * for `files`.\n */\nconst Root = forwardRef<HTMLDivElement, BitkitTreeViewRootProps>(\n ({ children, render, renderBranchFooter, variant = 'files', ...props }, ref) => {\n const indentGuide = variant === 'files' ? <TreeView.BranchIndentGuide /> : undefined;\n const styles = useCustomSlotStyles(variant);\n\n return (\n <VariantProvider value={{ variant }}>\n <TreeView.Root ref={ref} variant={variant} {...props}>\n <TreeView.Tree>\n <Nodes\n indentGuide={indentGuide}\n render={render}\n renderBranchFooter={renderBranchFooter}\n variant={variant}\n />\n {children && <Box css={[styles.footer, { '--depth': 1 }]}>{children}</Box>}\n </TreeView.Tree>\n </TreeView.Root>\n </VariantProvider>\n );\n },\n);\nRoot.displayName = 'BitkitTreeView';\n\n// --- Actions ---\n\n// The buttons sit inside the row, so a click that bubbled up would also toggle the branch or select the leaf.\nconst Actions = ({ actions, variant }: { actions: ReactElement[]; variant: BitkitTreeViewVariant }) => {\n const styles = useCustomSlotStyles(variant);\n\n return (\n <Box css={styles.actionGroup} onClick={(event) => event.stopPropagation()}>\n {actions.map((action) => cloneElement(action, { size: 'xs' }))}\n </Box>\n );\n};\n\n// --- Branch ---\n\nexport interface BitkitTreeViewBranchProps extends Omit<TreeViewBranchControlProps, 'children'> {\n actions?: ReactElement[];\n hasWarning?: boolean;\n label: string;\n subtext?: ReactNode;\n suffixIcon?: BitkitIconComponent;\n suffixText?: string;\n}\n\nconst Branch = forwardRef<HTMLDivElement, BitkitTreeViewBranchProps>((props, ref) => {\n const { actions, hasWarning, label, subtext, suffixIcon: SuffixIcon, suffixText, ...rest } = props;\n const { variant } = useVariant();\n const styles = useCustomSlotStyles(variant);\n const hasSuffix = hasWarning || SuffixIcon || suffixText;\n const hasActions = actions && actions.length > 0;\n\n const BranchIcon = variant === 'navigation' ? IconChevronRight : IconFolder;\n\n return (\n <TreeView.BranchControl ref={ref} className={hasActions ? 'group' : undefined} {...rest}>\n <TreeView.BranchIndicator>\n <BranchIcon size=\"16\" />\n </TreeView.BranchIndicator>\n <TreeView.BranchText>\n {label}\n {subtext && <Text css={styles.secondaryText}>{subtext}</Text>}\n </TreeView.BranchText>\n {hasSuffix && (\n <Box css={styles.suffixGroup}>\n {hasWarning && <IconWarningYellow size=\"16\" />}\n {SuffixIcon && <SuffixIcon size=\"16\" />}\n {suffixText && <span>{suffixText}</span>}\n </Box>\n )}\n {hasActions && <Actions actions={actions} variant={variant} />}\n </TreeView.BranchControl>\n );\n});\nBranch.displayName = 'BitkitTreeView.Branch';\n\n// --- Leaf ---\n\nexport interface BitkitTreeViewLeafProps extends Omit<TreeViewItemProps, 'children'> {\n actions?: ReactElement[];\n badge?: ReactElement;\n /** Explains the badge on hover, e.g. what its letter stands for. */\n badgeTooltip?: string;\n hasWarning?: boolean;\n icon?: BitkitIconComponent;\n /** An `icon/*` token for the icon when it carries meaning of its own, such as a test result's status. */\n iconColor?: BitkitColorToken<'icon'>;\n label: string;\n subtext?: ReactNode;\n suffixIcon?: BitkitIconComponent;\n suffixText?: string;\n}\n\nconst Leaf = forwardRef<HTMLDivElement, BitkitTreeViewLeafProps>((props, ref) => {\n const {\n actions,\n badge,\n badgeTooltip,\n hasWarning,\n icon: Icon,\n iconColor,\n label,\n subtext,\n suffixIcon: SuffixIcon,\n suffixText,\n ...rest\n } = props;\n const { variant } = useVariant();\n const styles = useCustomSlotStyles(variant);\n const hasSuffix = hasWarning || SuffixIcon || suffixText;\n const hasActions = actions && actions.length > 0;\n const sizedBadge = badge && cloneElement(badge, { size: 'xs' });\n const badgeDescription = sizedBadge ? badgeTooltip : undefined;\n\n return (\n <TreeView.Item ref={ref} className={hasActions ? 'group' : undefined} {...rest}>\n {Icon && <Icon color={iconColor} size=\"16\" />}\n {badgeDescription ? <BitkitTooltip text={badgeDescription}>{sizedBadge}</BitkitTooltip> : sizedBadge}\n <TreeView.ItemText>\n {label}\n {/* A tree has a single Tab stop, so the badge takes no focus: its tooltip is read out with the label instead. */}\n {badgeDescription && <VisuallyHidden>{`, ${badgeDescription}`}</VisuallyHidden>}\n {subtext && <Text css={styles.secondaryText}>{subtext}</Text>}\n </TreeView.ItemText>\n {hasSuffix && (\n <Box css={styles.suffixGroup}>\n {hasWarning && <IconWarningYellow size=\"16\" />}\n {SuffixIcon && <SuffixIcon size=\"16\" />}\n {suffixText && <span>{suffixText}</span>}\n </Box>\n )}\n {hasActions && <Actions actions={actions} variant={variant} />}\n </TreeView.Item>\n );\n});\nLeaf.displayName = 'BitkitTreeView.Leaf';\n\n// --- Main export ---\n\nconst BitkitTreeView = withSubComponents(Root, {\n Branch,\n Leaf,\n});\n\nexport default BitkitTreeView;\n"],"mappings":";;;;;;;;;;;;;;;AAmCA,IAAM,CAAC,iBAAiB,cAAcA,gBAAkD;CACtF,MAAM;CACN,cAAc,EAAE,SAAS,QAAQ;AACnC,CAAC;AAED,IAAM,uBAAuB,YAAmC;CAE9D,OADe,cAAc,EAAE,KAAK,WAAW,CACxC,CAAA,CAAO,EAAE,QAAQ,CAAC;AAC3B;AAsBA,IAAM,SAAS,EAAE,aAAa,QAAQ,oBAAoB,cAA0B;CAClF,MAAM,OAAO,mBAAmB;CAChC,MAAM,SAAS,oBAAoB,OAAO;CAE1C,MAAM,cAAc,MAAe,cACjC,oBAAC,SAAS,cAAV;EAA4D;EAAiB;EAC3E,UAAA,oBAAC,SAAS,aAAV,EAAA,WACI,cAAc;GACd,IAAI,CAAC,UAAU,UACb,OAAO,OAAO;IAAE;IAAW;IAAM;GAAU,CAAC;GAG9C,MAAM,SAAS,qBAAqB;IAAE;IAAW;IAAM;GAAU,CAAC;GAElE,OACE,qBAAC,SAAS,QAAV,EAAA,UAAA,CACG,OAAO;IAAE;IAAW;IAAM;GAAU,CAAC,GACtC,qBAAC,SAAS,eAAV,EAAA,UAAA;IACG;IACA,KAAK,WAAW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S,aAAa,OAAO,EAAE,MAAM,KAAK,CAAC;CAC9D,MAAM,mBAAmB,aAAa,eAAe,KAAA;CAErD,OACE,qBAAC,SAAS,MAAV;EAAoB;EAAK,WAAW,aAAa,UAAU,KAAA;EAAW,GAAI;EAA1E,UAAA;GACG,QAAQ,oBAAC,MAAD;IAAM,OAAO;IAAW,MAAK;GAAM,CAAA;GAC3C,mBAAmB,oBAAC,eAAD;IAAe,MAAM;IAAmB,UAAA;GAA0B,CAAA,IAAI;GAC1F,qBAAC,SAAS,UAAV,EAAA,UAAA;IACG;IAEA,oBAAoB,oBAAC,gBAAD,EAAA,UAAiB,KAAK,mBAAmC,CAAA;IAC7E,WAAW,oBAAC,MAAD;KAAM,KAAK,OAAO;KAAgB,UAAA;IAAc,CAAA;GAC3C,EAAA,CAAA;GAClB,aACC,qBAAC,KAAD;IAAK,KAAK,OAAO;IAAjB,UAAA;KACG,cAAc,oBAAC,mBAAD,EAAmB,MAAK,KAAM,CAAA;KAC5C,cAAc,oBAAC,YAAD,EAAY,MAAK,KAAM,CAAA;KACrC,cAAc,oBAAC,QAAD,EAAA,UAAO,WAAiB,CAAA;IACpC;;GAEN,cAAc,oBAAC,SAAD;IAAkB;IAAkB;GAAU,CAAA;EAChD;;AAEnB,CAAC;AACD,KAAK,cAAc;AAInB,IAAM,iBAAiB,kBAAkB,MAAM;CAC7C;CACA;AACF,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { BoxProps } from '@chakra-ui/react/box';
2
+ import { ReactNode } from 'react';
3
+ export interface BitkitUIHeaderProps extends Omit<BoxProps, 'children'> {
4
+ /**
5
+ * Content below the bar, inside the header itself — account-wide notices and the like. It is
6
+ * part of the header rather than the page, so a pinned header keeps it pinned too, and a page
7
+ * reserving room for the header has one element to measure.
8
+ */
9
+ banner?: ReactNode;
10
+ /** The trailing controls, in the order they should appear. */
11
+ children?: ReactNode;
12
+ /**
13
+ * The slot before the logo, shown only below the `tablet` breakpoint. It takes a
14
+ * `BitkitUIHeader.NavButton`, which opens the navigation drawer, or a `BitkitUIHeader.Control`
15
+ * for an account with no workspace to navigate yet.
16
+ *
17
+ * It is a slot rather than a child because the design fixes where it goes: children all land in
18
+ * the trailing cluster, on the far side of the logo.
19
+ */
20
+ leading?: ReactNode;
21
+ /** Where the logo links to. */
22
+ logoHref?: string;
23
+ }
24
+ export { uiHeaderHeight } from '../../theme/slot-recipes/UIHeader.recipe';
25
+ export { type BitkitUIHeaderAccountProps } from './UIHeaderAccount';
26
+ export { type BitkitUIHeaderButtonProps } from './UIHeaderButton';
27
+ export { type BitkitUIHeaderControlAsAnchorProps, type BitkitUIHeaderControlAsButtonProps, type BitkitUIHeaderControlProps, } from './UIHeaderControl';
28
+ export { type BitkitUIHeaderNavButtonProps } from './UIHeaderNavButton';
29
+ export { type BitkitUIHeaderSearchProps } from './UIHeaderSearch';
30
+ declare const _default: import('react').ForwardRefExoticComponent<BitkitUIHeaderProps & import('react').RefAttributes<HTMLElement>> & {
31
+ Account: import('react').ForwardRefExoticComponent<import('./UIHeaderAccount').BitkitUIHeaderAccountProps & import('react').RefAttributes<HTMLButtonElement>>;
32
+ Button: import('react').ForwardRefExoticComponent<import('./UIHeaderButton').BitkitUIHeaderButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
33
+ Control: import('react').ForwardRefExoticComponent<import('./UIHeaderControl').BitkitUIHeaderControlProps & import('react').RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
34
+ NavButton: import('react').ForwardRefExoticComponent<import('./UIHeaderNavButton').BitkitUIHeaderNavButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
35
+ Search: import('react').ForwardRefExoticComponent<import('./UIHeaderSearch').BitkitUIHeaderSearchProps & import('react').RefAttributes<HTMLDivElement>>;
36
+ };
37
+ export default _default;
@@ -0,0 +1,99 @@
1
+ import { withSubComponents } from "../../utilities/withSubComponents.js";
2
+ import BitriseLogo from "./BitriseLogo.js";
3
+ import { UIHeaderContextProvider } from "./UIHeaderContext.js";
4
+ import UIHeaderControl from "./UIHeaderControl.js";
5
+ import UIHeaderAccount from "./UIHeaderAccount.js";
6
+ import UIHeaderButton from "./UIHeaderButton.js";
7
+ import UIHeaderNavButton from "./UIHeaderNavButton.js";
8
+ import UIHeaderSearch from "./UIHeaderSearch.js";
9
+ import { uiHeaderHeight } from "../../theme/slot-recipes/UIHeader.recipe.js";
10
+ import { Box } from "@chakra-ui/react/box";
11
+ import { useSlotRecipe } from "@chakra-ui/react/styled-system";
12
+ import { forwardRef, useMemo, useRef } from "react";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ //#region lib/components/BitkitUIHeader/BitkitUIHeader.tsx
15
+ /**
16
+ * The platform's top bar: the Bitrise logo, and the controls for everything that is not navigation
17
+ * — search, changelog, help, notifications, the account.
18
+ *
19
+ * ```tsx
20
+ * <BitkitUIHeader leading={<BitkitUIHeader.NavButton name={workspace} onClick={openNav} />}>
21
+ * <BitkitUIHeader.Button icon={IconSparkle} onClick={askAI} variant="secondary">Ask AI</BitkitUIHeader.Button>
22
+ * <BitkitUIHeader.Search onOpenChange={setSearchOpen} onValueChange={setQuery} open={searchOpen} value={query} />
23
+ * <BitkitUIHeader.Control icon={IconBell} label="Notifications" onClick={toggleNotifications} selected={isOpen} />
24
+ * <BitkitUIHeader.Account name={user.name} onClick={toggleAccount} src={user.avatar} />
25
+ * </BitkitUIHeader>
26
+ * ```
27
+ *
28
+ * It does not position itself. The consumer decides whether it scrolls with the page or is pinned
29
+ * to the top of it, which is what lets a page put its own chrome above the header. Pin it with the
30
+ * style props the root forwards, and reserve `uiHeaderHeight` for it in the page below.
31
+ *
32
+ * The panels the controls open are the consumer's: a control takes a `selected` flag and paints
33
+ * itself as the open one, and nothing more. That keeps a drawer's content, placement and state
34
+ * where the product can see them.
35
+ *
36
+ * It carries its own responsive behaviour and needs no breakpoint hook. Below `tablet` the
37
+ * `leading` slot appears, the logo centres, the account button becomes an icon, and search stops
38
+ * opening a field in the bar.
39
+ */
40
+ var BitkitUIHeader = forwardRef((props, ref) => {
41
+ const { banner, children, css, leading, logoHref = "/", ...rest } = props;
42
+ const styles = useSlotRecipe({ key: "uiHeader" })();
43
+ const barRef = useRef(null);
44
+ const context = useMemo(() => ({
45
+ barRef,
46
+ styles
47
+ }), [styles]);
48
+ return /* @__PURE__ */ jsx(UIHeaderContextProvider, {
49
+ value: context,
50
+ children: /* @__PURE__ */ jsx(Box, {
51
+ ref,
52
+ asChild: true,
53
+ ...rest,
54
+ css: [styles.root, css],
55
+ children: /* @__PURE__ */ jsxs("header", { children: [/* @__PURE__ */ jsxs(Box, {
56
+ ref: barRef,
57
+ css: styles.bar,
58
+ children: [
59
+ /* @__PURE__ */ jsx(Box, {
60
+ css: styles.leading,
61
+ children: leading
62
+ }),
63
+ /* @__PURE__ */ jsx(Box, { css: styles.spacer }),
64
+ /* @__PURE__ */ jsx(Box, {
65
+ css: styles.logoBlock,
66
+ children: /* @__PURE__ */ jsx(Box, {
67
+ asChild: true,
68
+ css: styles.logoLink,
69
+ children: /* @__PURE__ */ jsx("a", {
70
+ "aria-label": "Bitrise",
71
+ href: logoHref,
72
+ children: /* @__PURE__ */ jsx(BitriseLogo, {})
73
+ })
74
+ })
75
+ }),
76
+ /* @__PURE__ */ jsx(Box, {
77
+ css: styles.actions,
78
+ children
79
+ })
80
+ ]
81
+ }), !!banner && /* @__PURE__ */ jsx(Box, {
82
+ css: styles.banner,
83
+ children: banner
84
+ })] })
85
+ })
86
+ });
87
+ });
88
+ BitkitUIHeader.displayName = "BitkitUIHeader";
89
+ var BitkitUIHeader_default = withSubComponents(BitkitUIHeader, {
90
+ Account: UIHeaderAccount,
91
+ Button: UIHeaderButton,
92
+ Control: UIHeaderControl,
93
+ NavButton: UIHeaderNavButton,
94
+ Search: UIHeaderSearch
95
+ });
96
+ //#endregion
97
+ export { BitkitUIHeader_default as default, uiHeaderHeight };
98
+
99
+ //# sourceMappingURL=BitkitUIHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BitkitUIHeader.js","names":[],"sources":["../../../lib/components/BitkitUIHeader/BitkitUIHeader.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef, type ReactNode, useMemo, useRef } from 'react';\n\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport BitriseLogo from './BitriseLogo';\nimport UIHeaderAccount from './UIHeaderAccount';\nimport UIHeaderButton from './UIHeaderButton';\nimport { UIHeaderContextProvider } from './UIHeaderContext';\nimport UIHeaderControl from './UIHeaderControl';\nimport UIHeaderNavButton from './UIHeaderNavButton';\nimport UIHeaderSearch from './UIHeaderSearch';\n\nexport interface BitkitUIHeaderProps extends Omit<BoxProps, 'children'> {\n /**\n * Content below the bar, inside the header itself — account-wide notices and the like. It is\n * part of the header rather than the page, so a pinned header keeps it pinned too, and a page\n * reserving room for the header has one element to measure.\n */\n banner?: ReactNode;\n /** The trailing controls, in the order they should appear. */\n children?: ReactNode;\n /**\n * The slot before the logo, shown only below the `tablet` breakpoint. It takes a\n * `BitkitUIHeader.NavButton`, which opens the navigation drawer, or a `BitkitUIHeader.Control`\n * for an account with no workspace to navigate yet.\n *\n * It is a slot rather than a child because the design fixes where it goes: children all land in\n * the trailing cluster, on the far side of the logo.\n */\n leading?: ReactNode;\n /** Where the logo links to. */\n logoHref?: string;\n}\n\n/**\n * The platform's top bar: the Bitrise logo, and the controls for everything that is not navigation\n * — search, changelog, help, notifications, the account.\n *\n * ```tsx\n * <BitkitUIHeader leading={<BitkitUIHeader.NavButton name={workspace} onClick={openNav} />}>\n * <BitkitUIHeader.Button icon={IconSparkle} onClick={askAI} variant=\"secondary\">Ask AI</BitkitUIHeader.Button>\n * <BitkitUIHeader.Search onOpenChange={setSearchOpen} onValueChange={setQuery} open={searchOpen} value={query} />\n * <BitkitUIHeader.Control icon={IconBell} label=\"Notifications\" onClick={toggleNotifications} selected={isOpen} />\n * <BitkitUIHeader.Account name={user.name} onClick={toggleAccount} src={user.avatar} />\n * </BitkitUIHeader>\n * ```\n *\n * It does not position itself. The consumer decides whether it scrolls with the page or is pinned\n * to the top of it, which is what lets a page put its own chrome above the header. Pin it with the\n * style props the root forwards, and reserve `uiHeaderHeight` for it in the page below.\n *\n * The panels the controls open are the consumer's: a control takes a `selected` flag and paints\n * itself as the open one, and nothing more. That keeps a drawer's content, placement and state\n * where the product can see them.\n *\n * It carries its own responsive behaviour and needs no breakpoint hook. Below `tablet` the\n * `leading` slot appears, the logo centres, the account button becomes an icon, and search stops\n * opening a field in the bar.\n */\nconst BitkitUIHeader = forwardRef<HTMLElement, BitkitUIHeaderProps>((props, ref) => {\n const { banner, children, css, leading, logoHref = '/', ...rest } = props;\n\n const recipe = useSlotRecipe({ key: 'uiHeader' });\n const styles = recipe();\n\n const barRef = useRef<HTMLDivElement>(null);\n\n const context = useMemo(() => ({ barRef, styles }), [styles]);\n\n return (\n <UIHeaderContextProvider value={context}>\n <Box ref={ref} asChild {...rest} css={[styles.root, css]}>\n <header>\n <Box ref={barRef} css={styles.bar}>\n <Box css={styles.leading}>{leading}</Box>\n <Box css={styles.spacer} />\n <Box css={styles.logoBlock}>\n <Box asChild css={styles.logoLink}>\n <a aria-label=\"Bitrise\" href={logoHref}>\n <BitriseLogo />\n </a>\n </Box>\n </Box>\n <Box css={styles.actions}>{children}</Box>\n </Box>\n {!!banner && <Box css={styles.banner}>{banner}</Box>}\n </header>\n </Box>\n </UIHeaderContextProvider>\n );\n});\n\nexport { uiHeaderHeight } from '../../theme/slot-recipes/UIHeader.recipe';\nexport { type BitkitUIHeaderAccountProps } from './UIHeaderAccount';\nexport { type BitkitUIHeaderButtonProps } from './UIHeaderButton';\nexport {\n type BitkitUIHeaderControlAsAnchorProps,\n type BitkitUIHeaderControlAsButtonProps,\n type BitkitUIHeaderControlProps,\n} from './UIHeaderControl';\nexport { type BitkitUIHeaderNavButtonProps } from './UIHeaderNavButton';\nexport { type BitkitUIHeaderSearchProps } from './UIHeaderSearch';\n\nBitkitUIHeader.displayName = 'BitkitUIHeader';\n\nexport default withSubComponents(BitkitUIHeader, {\n Account: UIHeaderAccount,\n Button: UIHeaderButton,\n Control: UIHeaderControl,\n NavButton: UIHeaderNavButton,\n Search: UIHeaderSearch,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,IAAM,iBAAiB,YAA8C,OAAO,QAAQ;CAClF,MAAM,EAAE,QAAQ,UAAU,KAAK,SAAS,WAAW,KAAK,GAAG,SAAS;CAGpE,MAAM,SADS,cAAc,EAAE,KAAK,WAAW,CAChC,CAAA,CAAO;CAEtB,MAAM,SAAS,OAAuB,IAAI;CAE1C,MAAM,UAAU,eAAe;EAAE;EAAQ;CAAO,IAAI,CAAC,MAAM,CAAC;CAE5D,OACE,oBAAC,yBAAD;EAAyB,OAAO;EAC9B,UAAA,oBAAC,KAAD;GAAU;GAAK,SAAA;GAAQ,GAAI;GAAM,KAAK,CAAC,OAAO,MAAM,GAAG;GACrD,UAAA,qBAAC,UAAD,EAAA,UAAA,CACE,qBAAC,KAAD;IAAK,KAAK;IAAQ,KAAK,OAAO;IAA9B,UAAA;KACE,oBAAC,KAAD;MAAK,KAAK,OAAO;MAAU,UAAA;KAAa,CAAA;KACxC,oBAAC,KAAD,EAAK,KAAK,OAAO,OAAS,CAAA;KAC1B,oBAAC,KAAD;MAAK,KAAK,OAAO;MACf,UAAA,oBAAC,KAAD;OAAK,SAAA;OAAQ,KAAK,OAAO;OACvB,UAAA,oBAAC,KAAD;QAAG,cAAW;QAAU,MAAM;QAC5B,UAAA,oBAAC,aAAD,CAAc,CAAA;OACb,CAAA;MACA,CAAA;KACF,CAAA;KACL,oBAAC,KAAD;MAAK,KAAK,OAAO;MAAU;KAAc,CAAA;IACtC;GACJ,CAAA,GAAA,CAAC,CAAC,UAAU,oBAAC,KAAD;IAAK,KAAK,OAAO;IAAS,UAAA;GAAY,CAAA,CAC7C,EAAA,CAAA;EACL,CAAA;CACkB,CAAA;AAE7B,CAAC;AAaD,eAAe,cAAc;AAE7B,IAAA,yBAAe,kBAAkB,gBAAgB;CAC/C,SAAS;CACT,QAAQ;CACR,SAAS;CACT,WAAW;CACX,QAAQ;AACV,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { SVGProps } from 'react';
2
+ /**
3
+ * The Bitrise wordmark, at the one size the header draws it. It is monochrome and follows the
4
+ * surrounding `color`.
5
+ *
6
+ * It is hand-maintained rather than generated: the icon pipeline only emits 16 and 24 square
7
+ * icons, and this is neither.
8
+ */
9
+ declare const BitriseLogo: (props: SVGProps<SVGSVGElement>) => import('react').JSX.Element;
10
+ export default BitriseLogo;
@@ -0,0 +1,86 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ //#region lib/components/BitkitUIHeader/BitriseLogo.tsx
3
+ /**
4
+ * The Bitrise wordmark, at the one size the header draws it. It is monochrome and follows the
5
+ * surrounding `color`.
6
+ *
7
+ * It is hand-maintained rather than generated: the icon pipeline only emits 16 and 24 square
8
+ * icons, and this is neither.
9
+ */
10
+ var BitriseLogo = (props) => /* @__PURE__ */ jsxs("svg", {
11
+ "aria-hidden": "true",
12
+ fill: "none",
13
+ height: "24",
14
+ viewBox: "0 0 84.2553 24",
15
+ width: "84.2553",
16
+ xmlns: "http://www.w3.org/2000/svg",
17
+ ...props,
18
+ children: [
19
+ /* @__PURE__ */ jsx("path", {
20
+ d: "M16.055 1.24337C16.055 1.92998 15.4915 2.4866 14.7962 2.4866C14.101 2.4866 13.5374 1.92998 13.5374 1.24337C13.5374 0.556762 14.101 0 14.7962 0C15.4915 0 16.055 0.556762 16.055 1.24337Z",
21
+ fill: "currentColor"
22
+ }),
23
+ /* @__PURE__ */ jsx("path", {
24
+ d: "M5.40952 14.0537C5.40952 12.9456 6.31909 12.0471 7.44126 12.0471C8.56343 12.0471 9.47301 12.9456 9.47301 14.0537H5.40952Z",
25
+ fill: "currentColor"
26
+ }),
27
+ /* @__PURE__ */ jsx("path", {
28
+ d: "M11.5057 16.0605C11.5057 17.8552 12.9789 19.3103 14.7963 19.3103C16.6135 19.3103 18.0868 17.8552 18.0868 16.0605H11.5057Z",
29
+ fill: "currentColor"
30
+ }),
31
+ /* @__PURE__ */ jsx("path", {
32
+ d: "M22.1651 12.0475C21.0429 12.0475 20.1333 12.946 20.1333 14.0541H24.1968C24.1968 12.946 23.2873 12.0475 22.1651 12.0475Z",
33
+ fill: "currentColor"
34
+ }),
35
+ /* @__PURE__ */ jsx("path", {
36
+ clipRule: "evenodd",
37
+ d: "M29.0271 13.7727C28.6855 11.4818 28.1742 9.16488 27.8054 7.62488C27.3658 5.7897 25.7901 4.47799 23.8847 4.36079C22.014 4.24563 18.9187 4.10822 14.7962 4.10822C10.6735 4.10822 7.57817 4.24563 5.70779 4.36079C3.80207 4.47799 2.22644 5.7897 1.78696 7.62488C1.41816 9.16415 0.906981 11.4802 0.565118 13.7727C0.33397 15.3226 0.147138 17.1531 0.00962665 19.2132C-0.0672263 20.3612 0.318069 21.4661 1.09411 22.3243C1.87132 23.1837 2.94138 23.6865 4.10742 23.7404C6.66875 23.8588 10.6022 24 14.7962 24C18.9898 24 22.9234 23.8588 25.4849 23.7404C26.651 23.6865 27.721 23.1837 28.4981 22.3243C29.2741 21.4663 29.6594 20.3613 29.5826 19.2132C29.4452 17.1531 29.2582 15.3226 29.0271 13.7727ZM26.9827 20.9878C26.572 21.4417 26.0064 21.7074 25.3899 21.736C22.85 21.8534 18.9503 21.9932 14.796 21.9932C10.6415 21.9932 6.7419 21.8534 4.20222 21.736C3.58563 21.7074 3.01998 21.4417 2.60921 20.9876C2.19962 20.5347 1.9963 19.9513 2.03679 19.3452C2.17077 17.3385 2.35186 15.5621 2.57505 14.0649C2.90632 11.8433 3.40454 9.58787 3.76407 8.08669C3.99595 7.11785 4.82794 6.42542 5.83395 6.36362C7.67562 6.25021 10.7256 6.11498 14.796 6.11498C18.8661 6.11498 21.9162 6.25021 23.7582 6.36362C24.7642 6.42542 25.5959 7.11785 25.8279 8.08669C26.1878 9.58845 26.6858 11.8447 27.0168 14.0649C27.24 15.5621 27.4212 17.3385 27.5552 19.3452C27.5956 19.9514 27.3922 20.5348 26.9827 20.9878Z",
38
+ fill: "currentColor",
39
+ fillRule: "evenodd"
40
+ }),
41
+ /* @__PURE__ */ jsx("path", {
42
+ clipRule: "evenodd",
43
+ d: "M40.174 19.5834C42.3057 19.5834 44.1815 17.7307 44.1815 15.2885C44.1815 12.8464 42.3057 10.9939 40.174 10.9939C38.554 10.9939 37.7013 12.1727 37.7013 12.1727V7.62542H35.3991V19.415H37.7013V18.4044C37.7013 18.4044 38.554 19.5834 40.174 19.5834ZM39.7479 13.0148C40.8562 13.0148 41.7942 13.9412 41.7942 15.2885C41.7942 16.636 40.8562 17.5624 39.7479 17.5624C38.6394 17.5624 37.7014 16.636 37.7014 15.2885C37.7014 13.9412 38.6394 13.0148 39.7479 13.0148Z",
44
+ fill: "currentColor",
45
+ fillRule: "evenodd"
46
+ }),
47
+ /* @__PURE__ */ jsx("path", {
48
+ d: "M45.9719 19.415H48.2741V11.1623H45.9719V19.415Z",
49
+ fill: "currentColor"
50
+ }),
51
+ /* @__PURE__ */ jsx("path", {
52
+ d: "M47.0803 10.0675C46.313 10.0675 45.8014 9.56222 45.8014 8.80421C45.8014 8.04621 46.313 7.54107 47.0803 7.54107C47.9329 7.54107 48.4447 8.04621 48.4447 8.80421C48.4447 9.56222 47.9329 10.0675 47.0803 10.0675Z",
53
+ fill: "currentColor"
54
+ }),
55
+ /* @__PURE__ */ jsx("path", {
56
+ d: "M53.646 8.72005H51.5995V10.2359C51.5995 10.9096 51.1731 11.3307 50.6615 11.3307H49.8942V13.3517H51.3438V16.7202C51.3438 18.6571 52.2816 19.5834 53.987 19.5834C54.8397 19.5834 55.5218 19.3308 55.5218 19.3308V17.3939C55.5218 17.3939 55.1807 17.5624 54.6692 17.5624C54.0722 17.5624 53.646 17.1413 53.646 16.6358V13.3517H55.3512V11.3307H53.646V8.72005Z",
57
+ fill: "currentColor"
58
+ }),
59
+ /* @__PURE__ */ jsx("path", {
60
+ d: "M62.513 13.3516C62.513 13.3516 62.2571 13.2676 61.7457 13.2676C60.5518 13.2676 59.7844 14.0255 59.7844 15.457V19.4149H57.4822V11.1622H59.7844V12.1728C59.7844 12.1728 60.6372 11.0779 62.1719 11.0779H62.513V13.3516Z",
61
+ fill: "currentColor"
62
+ }),
63
+ /* @__PURE__ */ jsx("path", {
64
+ d: "M66.1792 19.415H63.877V11.1623H66.1792V19.415Z",
65
+ fill: "currentColor"
66
+ }),
67
+ /* @__PURE__ */ jsx("path", {
68
+ d: "M63.7067 8.80421C63.7067 9.56222 64.2183 10.0675 64.9857 10.0675C65.8384 10.0675 66.35 9.56222 66.35 8.80421C66.35 8.04621 65.8384 7.54107 64.9857 7.54107C64.2183 7.54107 63.7067 8.04621 63.7067 8.80421Z",
69
+ fill: "currentColor"
70
+ }),
71
+ /* @__PURE__ */ jsx("path", {
72
+ d: "M73.086 13.6044C73.086 13.6044 72.5744 12.9307 71.7218 12.9307C71.0397 12.9307 70.6986 13.2676 70.6986 13.6044C70.6986 14.0693 71.2955 14.2592 72.0184 14.4892C73.1285 14.8423 74.5356 15.29 74.5356 16.9729C74.5356 18.4044 73.3418 19.5834 71.2102 19.5834C68.8226 19.5834 67.7995 18.0675 67.7995 18.0675L69.0785 16.8045C69.0785 16.8045 69.7607 17.7307 70.8691 17.7307C71.6366 17.7307 71.9776 17.394 71.9776 16.9729C71.9776 16.4614 71.3485 16.2592 70.5998 16.0185C69.4994 15.6648 68.1407 15.2281 68.1407 13.6044C68.1407 12.3411 69.5049 10.9939 71.3807 10.9939C73.3418 10.9939 74.2798 12.2569 74.2798 12.2569L73.086 13.6044Z",
73
+ fill: "currentColor"
74
+ }),
75
+ /* @__PURE__ */ jsx("path", {
76
+ clipRule: "evenodd",
77
+ d: "M80.333 17.6466C79.054 17.6466 78.2865 16.8887 78.1161 16.0465H84.1701C84.1701 16.0465 84.2553 15.7097 84.2553 15.1201C84.2553 12.7623 82.4647 10.9939 80.0771 10.9939C77.6897 10.9939 75.7286 12.9307 75.7286 15.2885C75.7286 17.6466 77.6897 19.5834 80.1624 19.5834C82.4647 19.5834 83.7437 18.1517 83.7437 18.1517L82.55 16.636C82.55 16.636 81.7825 17.6466 80.333 17.6466ZM81.9533 14.4464H78.1162C78.3719 13.6044 79.0542 12.9307 80.0773 12.9307C81.1005 12.9307 81.7826 13.6044 81.9533 14.4464Z",
78
+ fill: "currentColor",
79
+ fillRule: "evenodd"
80
+ })
81
+ ]
82
+ });
83
+ //#endregion
84
+ export { BitriseLogo as default };
85
+
86
+ //# sourceMappingURL=BitriseLogo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BitriseLogo.js","names":[],"sources":["../../../lib/components/BitkitUIHeader/BitriseLogo.tsx"],"sourcesContent":["import { type SVGProps } from 'react';\n\n/**\n * The Bitrise wordmark, at the one size the header draws it. It is monochrome and follows the\n * surrounding `color`.\n *\n * It is hand-maintained rather than generated: the icon pipeline only emits 16 and 24 square\n * icons, and this is neither.\n */\nconst BitriseLogo = (props: SVGProps<SVGSVGElement>) => (\n <svg\n aria-hidden=\"true\"\n fill=\"none\"\n height=\"24\"\n viewBox=\"0 0 84.2553 24\"\n width=\"84.2553\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M16.055 1.24337C16.055 1.92998 15.4915 2.4866 14.7962 2.4866C14.101 2.4866 13.5374 1.92998 13.5374 1.24337C13.5374 0.556762 14.101 0 14.7962 0C15.4915 0 16.055 0.556762 16.055 1.24337Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M5.40952 14.0537C5.40952 12.9456 6.31909 12.0471 7.44126 12.0471C8.56343 12.0471 9.47301 12.9456 9.47301 14.0537H5.40952Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M11.5057 16.0605C11.5057 17.8552 12.9789 19.3103 14.7963 19.3103C16.6135 19.3103 18.0868 17.8552 18.0868 16.0605H11.5057Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M22.1651 12.0475C21.0429 12.0475 20.1333 12.946 20.1333 14.0541H24.1968C24.1968 12.946 23.2873 12.0475 22.1651 12.0475Z\"\n fill=\"currentColor\"\n />\n <path\n clipRule=\"evenodd\"\n d=\"M29.0271 13.7727C28.6855 11.4818 28.1742 9.16488 27.8054 7.62488C27.3658 5.7897 25.7901 4.47799 23.8847 4.36079C22.014 4.24563 18.9187 4.10822 14.7962 4.10822C10.6735 4.10822 7.57817 4.24563 5.70779 4.36079C3.80207 4.47799 2.22644 5.7897 1.78696 7.62488C1.41816 9.16415 0.906981 11.4802 0.565118 13.7727C0.33397 15.3226 0.147138 17.1531 0.00962665 19.2132C-0.0672263 20.3612 0.318069 21.4661 1.09411 22.3243C1.87132 23.1837 2.94138 23.6865 4.10742 23.7404C6.66875 23.8588 10.6022 24 14.7962 24C18.9898 24 22.9234 23.8588 25.4849 23.7404C26.651 23.6865 27.721 23.1837 28.4981 22.3243C29.2741 21.4663 29.6594 20.3613 29.5826 19.2132C29.4452 17.1531 29.2582 15.3226 29.0271 13.7727ZM26.9827 20.9878C26.572 21.4417 26.0064 21.7074 25.3899 21.736C22.85 21.8534 18.9503 21.9932 14.796 21.9932C10.6415 21.9932 6.7419 21.8534 4.20222 21.736C3.58563 21.7074 3.01998 21.4417 2.60921 20.9876C2.19962 20.5347 1.9963 19.9513 2.03679 19.3452C2.17077 17.3385 2.35186 15.5621 2.57505 14.0649C2.90632 11.8433 3.40454 9.58787 3.76407 8.08669C3.99595 7.11785 4.82794 6.42542 5.83395 6.36362C7.67562 6.25021 10.7256 6.11498 14.796 6.11498C18.8661 6.11498 21.9162 6.25021 23.7582 6.36362C24.7642 6.42542 25.5959 7.11785 25.8279 8.08669C26.1878 9.58845 26.6858 11.8447 27.0168 14.0649C27.24 15.5621 27.4212 17.3385 27.5552 19.3452C27.5956 19.9514 27.3922 20.5348 26.9827 20.9878Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n <path\n clipRule=\"evenodd\"\n d=\"M40.174 19.5834C42.3057 19.5834 44.1815 17.7307 44.1815 15.2885C44.1815 12.8464 42.3057 10.9939 40.174 10.9939C38.554 10.9939 37.7013 12.1727 37.7013 12.1727V7.62542H35.3991V19.415H37.7013V18.4044C37.7013 18.4044 38.554 19.5834 40.174 19.5834ZM39.7479 13.0148C40.8562 13.0148 41.7942 13.9412 41.7942 15.2885C41.7942 16.636 40.8562 17.5624 39.7479 17.5624C38.6394 17.5624 37.7014 16.636 37.7014 15.2885C37.7014 13.9412 38.6394 13.0148 39.7479 13.0148Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n <path d=\"M45.9719 19.415H48.2741V11.1623H45.9719V19.415Z\" fill=\"currentColor\" />\n <path\n d=\"M47.0803 10.0675C46.313 10.0675 45.8014 9.56222 45.8014 8.80421C45.8014 8.04621 46.313 7.54107 47.0803 7.54107C47.9329 7.54107 48.4447 8.04621 48.4447 8.80421C48.4447 9.56222 47.9329 10.0675 47.0803 10.0675Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M53.646 8.72005H51.5995V10.2359C51.5995 10.9096 51.1731 11.3307 50.6615 11.3307H49.8942V13.3517H51.3438V16.7202C51.3438 18.6571 52.2816 19.5834 53.987 19.5834C54.8397 19.5834 55.5218 19.3308 55.5218 19.3308V17.3939C55.5218 17.3939 55.1807 17.5624 54.6692 17.5624C54.0722 17.5624 53.646 17.1413 53.646 16.6358V13.3517H55.3512V11.3307H53.646V8.72005Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M62.513 13.3516C62.513 13.3516 62.2571 13.2676 61.7457 13.2676C60.5518 13.2676 59.7844 14.0255 59.7844 15.457V19.4149H57.4822V11.1622H59.7844V12.1728C59.7844 12.1728 60.6372 11.0779 62.1719 11.0779H62.513V13.3516Z\"\n fill=\"currentColor\"\n />\n <path d=\"M66.1792 19.415H63.877V11.1623H66.1792V19.415Z\" fill=\"currentColor\" />\n <path\n d=\"M63.7067 8.80421C63.7067 9.56222 64.2183 10.0675 64.9857 10.0675C65.8384 10.0675 66.35 9.56222 66.35 8.80421C66.35 8.04621 65.8384 7.54107 64.9857 7.54107C64.2183 7.54107 63.7067 8.04621 63.7067 8.80421Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M73.086 13.6044C73.086 13.6044 72.5744 12.9307 71.7218 12.9307C71.0397 12.9307 70.6986 13.2676 70.6986 13.6044C70.6986 14.0693 71.2955 14.2592 72.0184 14.4892C73.1285 14.8423 74.5356 15.29 74.5356 16.9729C74.5356 18.4044 73.3418 19.5834 71.2102 19.5834C68.8226 19.5834 67.7995 18.0675 67.7995 18.0675L69.0785 16.8045C69.0785 16.8045 69.7607 17.7307 70.8691 17.7307C71.6366 17.7307 71.9776 17.394 71.9776 16.9729C71.9776 16.4614 71.3485 16.2592 70.5998 16.0185C69.4994 15.6648 68.1407 15.2281 68.1407 13.6044C68.1407 12.3411 69.5049 10.9939 71.3807 10.9939C73.3418 10.9939 74.2798 12.2569 74.2798 12.2569L73.086 13.6044Z\"\n fill=\"currentColor\"\n />\n <path\n clipRule=\"evenodd\"\n d=\"M80.333 17.6466C79.054 17.6466 78.2865 16.8887 78.1161 16.0465H84.1701C84.1701 16.0465 84.2553 15.7097 84.2553 15.1201C84.2553 12.7623 82.4647 10.9939 80.0771 10.9939C77.6897 10.9939 75.7286 12.9307 75.7286 15.2885C75.7286 17.6466 77.6897 19.5834 80.1624 19.5834C82.4647 19.5834 83.7437 18.1517 83.7437 18.1517L82.55 16.636C82.55 16.636 81.7825 17.6466 80.333 17.6466ZM81.9533 14.4464H78.1162C78.3719 13.6044 79.0542 12.9307 80.0773 12.9307C81.1005 12.9307 81.7826 13.6044 81.9533 14.4464Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n </svg>\n);\n\nexport default BitriseLogo;\n"],"mappings":";;;;;;;;;AASA,IAAM,eAAe,UACnB,qBAAC,OAAD;CACE,eAAY;CACZ,MAAK;CACL,QAAO;CACP,SAAQ;CACR,OAAM;CACN,OAAM;CACN,GAAI;CAPN,UAAA;EASE,oBAAC,QAAD;GACE,GAAE;GACF,MAAK;EACN,CAAA;EACD,oBAAC,QAAD;GACE,GAAE;GACF,MAAK;EACN,CAAA;EACD,oBAAC,QAAD;GACE,GAAE;GACF,MAAK;EACN,CAAA;EACD,oBAAC,QAAD;GACE,GAAE;GACF,MAAK;EACN,CAAA;EACD,oBAAC,QAAD;GACE,UAAS;GACT,GAAE;GACF,MAAK;GACL,UAAS;EACV,CAAA;EACD,oBAAC,QAAD;GACE,UAAS;GACT,GAAE;GACF,MAAK;GACL,UAAS;EACV,CAAA;EACD,oBAAC,QAAD;GAAM,GAAE;GAAkD,MAAK;EAAgB,CAAA;EAC/E,oBAAC,QAAD;GACE,GAAE;GACF,MAAK;EACN,CAAA;EACD,oBAAC,QAAD;GACE,GAAE;GACF,MAAK;EACN,CAAA;EACD,oBAAC,QAAD;GACE,GAAE;GACF,MAAK;EACN,CAAA;EACD,oBAAC,QAAD;GAAM,GAAE;GAAiD,MAAK;EAAgB,CAAA;EAC9E,oBAAC,QAAD;GACE,GAAE;GACF,MAAK;EACN,CAAA;EACD,oBAAC,QAAD;GACE,GAAE;GACF,MAAK;EACN,CAAA;EACD,oBAAC,QAAD;GACE,UAAS;GACT,GAAE;GACF,MAAK;GACL,UAAS;EACV,CAAA;CACE"}
@@ -0,0 +1,22 @@
1
+ import { HTMLChakraProps } from '@chakra-ui/react/styled-system';
2
+ export interface BitkitUIHeaderAccountProps extends Omit<HTMLChakraProps<'button'>, 'children' | 'disabled'> {
3
+ /** Marks the account as carrying something unread, like the other controls. */
4
+ badge?: boolean;
5
+ /**
6
+ * The accessible name. Defaults to `Account: ` and the signed-in person's name — the name alone
7
+ * would announce as a person rather than as what the button opens.
8
+ */
9
+ label?: string;
10
+ /** Who is signed in. Shown as the avatar's initials when there is no picture. */
11
+ name: string;
12
+ /** Marks the account panel as open. */
13
+ selected?: boolean;
14
+ /** The signed-in person's picture. Without one the avatar falls back to their initials. */
15
+ src?: string;
16
+ }
17
+ /**
18
+ * The account button at the trailing end of the bar. It shows the signed-in person's avatar on
19
+ * desktop and a plain icon on mobile, where the bar has no room for a picture.
20
+ */
21
+ declare const UIHeaderAccount: import('react').ForwardRefExoticComponent<BitkitUIHeaderAccountProps & import('react').RefAttributes<HTMLButtonElement>>;
22
+ export default UIHeaderAccount;
@@ -0,0 +1,38 @@
1
+ import IconPerson from "../../icons/IconPerson.js";
2
+ import BitkitAvatar from "../BitkitAvatar/BitkitAvatar.js";
3
+ import { useUIHeaderContext } from "./UIHeaderContext.js";
4
+ import { UIHeaderControlBase } from "./UIHeaderControl.js";
5
+ import { forwardRef } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region lib/components/BitkitUIHeader/UIHeaderAccount.tsx
8
+ /**
9
+ * The account button at the trailing end of the bar. It shows the signed-in person's avatar on
10
+ * desktop and a plain icon on mobile, where the bar has no room for a picture.
11
+ */
12
+ var UIHeaderAccount = forwardRef((props, ref) => {
13
+ const { badge, label, name, selected, src, ...rest } = props;
14
+ const { styles } = useUIHeaderContext();
15
+ const avatarProps = src ? {
16
+ src,
17
+ variant: "user"
18
+ } : { variant: "letters" };
19
+ return /* @__PURE__ */ jsxs(UIHeaderControlBase, {
20
+ ref,
21
+ badge,
22
+ footprint: "control",
23
+ label: label ?? `Account: ${name}`,
24
+ selected,
25
+ ...rest,
26
+ children: [/* @__PURE__ */ jsx(BitkitAvatar, {
27
+ css: styles.accountAvatar,
28
+ name,
29
+ size: "32",
30
+ ...avatarProps
31
+ }), /* @__PURE__ */ jsx(IconPerson, { css: styles.accountIcon })]
32
+ });
33
+ });
34
+ UIHeaderAccount.displayName = "BitkitUIHeader.Account";
35
+ //#endregion
36
+ export { UIHeaderAccount as default };
37
+
38
+ //# sourceMappingURL=UIHeaderAccount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UIHeaderAccount.js","names":[],"sources":["../../../lib/components/BitkitUIHeader/UIHeaderAccount.tsx"],"sourcesContent":["import { type HTMLChakraProps } from '@chakra-ui/react/styled-system';\nimport { forwardRef } from 'react';\n\nimport { IconPerson } from '../../icons';\nimport BitkitAvatar from '../BitkitAvatar/BitkitAvatar';\nimport { useUIHeaderContext } from './UIHeaderContext';\nimport { UIHeaderControlBase } from './UIHeaderControl';\n\nexport interface BitkitUIHeaderAccountProps extends Omit<HTMLChakraProps<'button'>, 'children' | 'disabled'> {\n /** Marks the account as carrying something unread, like the other controls. */\n badge?: boolean;\n /**\n * The accessible name. Defaults to `Account: ` and the signed-in person's name — the name alone\n * would announce as a person rather than as what the button opens.\n */\n label?: string;\n /** Who is signed in. Shown as the avatar's initials when there is no picture. */\n name: string;\n /** Marks the account panel as open. */\n selected?: boolean;\n /** The signed-in person's picture. Without one the avatar falls back to their initials. */\n src?: string;\n}\n\n/**\n * The account button at the trailing end of the bar. It shows the signed-in person's avatar on\n * desktop and a plain icon on mobile, where the bar has no room for a picture.\n */\nconst UIHeaderAccount = forwardRef<HTMLButtonElement, BitkitUIHeaderAccountProps>((props, ref) => {\n const { badge, label, name, selected, src, ...rest } = props;\n\n const { styles } = useUIHeaderContext();\n\n const avatarProps = src ? ({ src, variant: 'user' } as const) : ({ variant: 'letters' } as const);\n\n return (\n <UIHeaderControlBase\n ref={ref}\n badge={badge}\n footprint=\"control\"\n label={label ?? `Account: ${name}`}\n selected={selected}\n {...rest}\n >\n <BitkitAvatar css={styles.accountAvatar} name={name} size=\"32\" {...avatarProps} />\n <IconPerson css={styles.accountIcon} />\n </UIHeaderControlBase>\n );\n});\n\nUIHeaderAccount.displayName = 'BitkitUIHeader.Account';\n\nexport default UIHeaderAccount;\n"],"mappings":";;;;;;;;;;;AA4BA,IAAM,kBAAkB,YAA2D,OAAO,QAAQ;CAChG,MAAM,EAAE,OAAO,OAAO,MAAM,UAAU,KAAK,GAAG,SAAS;CAEvD,MAAM,EAAE,WAAW,mBAAmB;CAEtC,MAAM,cAAc,MAAO;EAAE;EAAK,SAAS;CAAO,IAAe,EAAE,SAAS,UAAU;CAEtF,OACE,qBAAC,qBAAD;EACO;EACE;EACP,WAAU;EACV,OAAO,SAAS,YAAY;EAClB;EACV,GAAI;EANN,UAAA,CAQE,oBAAC,cAAD;GAAc,KAAK,OAAO;GAAqB;GAAM,MAAK;GAAK,GAAI;EAAc,CAAA,GACjF,oBAAC,YAAD,EAAY,KAAK,OAAO,YAAc,CAAA,CACnB;;AAEzB,CAAC;AAED,gBAAgB,cAAc"}
@@ -0,0 +1,33 @@
1
+ import { HTMLChakraProps } from '@chakra-ui/react/styled-system';
2
+ import { ReactNode } from 'react';
3
+ import { BitkitIconComponent } from '../../icons';
4
+ export interface BitkitUIHeaderButtonProps extends Omit<HTMLChakraProps<'button'>, 'children' | 'disabled'> {
5
+ /**
6
+ * An unread marker on the button's trailing top corner. `pulse` animates it, for something that
7
+ * has just arrived and is worth looking at now; `idle` is the same marker at rest.
8
+ *
9
+ * Its presence is the toggle — there is no separate boolean.
10
+ */
11
+ badge?: 'idle' | 'pulse';
12
+ /** The button's label. */
13
+ children: ReactNode;
14
+ /** Leading icon. */
15
+ icon?: BitkitIconComponent;
16
+ /**
17
+ * Marks the button as the one whose panel is open, which keeps it pressed. The consumer owns the
18
+ * panel, so it owns this too.
19
+ */
20
+ selected?: boolean;
21
+ state?: 'disabled';
22
+ /** Trailing icon, for a button that opens a menu. */
23
+ suffixIcon?: BitkitIconComponent;
24
+ variant?: 'primary' | 'secondary' | 'tertiary';
25
+ }
26
+ /**
27
+ * A labelled button in the header bar, for an action that needs more than an icon — the Ask AI
28
+ * entry point is the one in the design.
29
+ *
30
+ * It comes in one size: the bar is 48px tall and leaves room for nothing else.
31
+ */
32
+ declare const UIHeaderButton: import('react').ForwardRefExoticComponent<BitkitUIHeaderButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
33
+ export default UIHeaderButton;