ref0-git 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (385) hide show
  1. package/app/apps/github/.dev.vars.example +6 -0
  2. package/app/apps/github/README.md +70 -0
  3. package/app/apps/github/THIRD_PARTY_NOTICES.md +214 -0
  4. package/app/apps/github/components.json +25 -0
  5. package/app/apps/github/generated/git-rest.ts +10444 -0
  6. package/app/apps/github/generated/routeTree.gen.ts +1242 -0
  7. package/app/apps/github/migrations/postgres/0001_auth.sql +46 -0
  8. package/app/apps/github/migrations/sql/0001_auth.sql +19 -0
  9. package/app/apps/github/migrations/sql/0002_passkeys.sql +9 -0
  10. package/app/apps/github/migrations/sql/0003_orgs.sql +22 -0
  11. package/app/apps/github/migrations/sql/0004_avatars.sql +6 -0
  12. package/app/apps/github/package.json +80 -0
  13. package/app/apps/github/src/branches/branch-list.tsx +385 -0
  14. package/app/apps/github/src/branches/branches.ts +55 -0
  15. package/app/apps/github/src/clients/allowed.ts +213 -0
  16. package/app/apps/github/src/clients/at-most.ts +17 -0
  17. package/app/apps/github/src/clients/avatars.ts +410 -0
  18. package/app/apps/github/src/clients/cached.ts +65 -0
  19. package/app/apps/github/src/clients/calls.ts +160 -0
  20. package/app/apps/github/src/clients/clients.ts +82 -0
  21. package/app/apps/github/src/clients/graphql.ts +50 -0
  22. package/app/apps/github/src/clients/host-answer.ts +28 -0
  23. package/app/apps/github/src/clients/host-calls.ts +382 -0
  24. package/app/apps/github/src/clients/icon-bytes.ts +203 -0
  25. package/app/apps/github/src/clients/proxy.ts +59 -0
  26. package/app/apps/github/src/clients/session-ended.ts +18 -0
  27. package/app/apps/github/src/clients/transfers.ts +212 -0
  28. package/app/apps/github/src/code/breadcrumbs.tsx +50 -0
  29. package/app/apps/github/src/code/code-page.tsx +147 -0
  30. package/app/apps/github/src/code/code-tree.tsx +338 -0
  31. package/app/apps/github/src/code/controls.tsx +230 -0
  32. package/app/apps/github/src/code/file-view.tsx +450 -0
  33. package/app/apps/github/src/code/files.ts +332 -0
  34. package/app/apps/github/src/code/folder-list.tsx +122 -0
  35. package/app/apps/github/src/code/go-to-file.tsx +131 -0
  36. package/app/apps/github/src/code/highlighted.tsx +58 -0
  37. package/app/apps/github/src/code/lines.ts +46 -0
  38. package/app/apps/github/src/code/load.ts +147 -0
  39. package/app/apps/github/src/code/markdown-files.ts +58 -0
  40. package/app/apps/github/src/code/places.ts +88 -0
  41. package/app/apps/github/src/code/ref-pages.ts +179 -0
  42. package/app/apps/github/src/code/ref-switcher.tsx +203 -0
  43. package/app/apps/github/src/code/refs.ts +142 -0
  44. package/app/apps/github/src/code/repo-home.tsx +240 -0
  45. package/app/apps/github/src/code/repo.ts +105 -0
  46. package/app/apps/github/src/code/saved-reads.ts +199 -0
  47. package/app/apps/github/src/code/saved.ts +110 -0
  48. package/app/apps/github/src/code/tree-fold.ts +186 -0
  49. package/app/apps/github/src/code/trees.ts +136 -0
  50. package/app/apps/github/src/components/avatar-picture.ts +53 -0
  51. package/app/apps/github/src/components/avatar-url.ts +16 -0
  52. package/app/apps/github/src/components/confirm-action.tsx +100 -0
  53. package/app/apps/github/src/components/count.tsx +24 -0
  54. package/app/apps/github/src/components/create-button.tsx +38 -0
  55. package/app/apps/github/src/components/file-icons/file-icons.css +225 -0
  56. package/app/apps/github/src/components/file-icons/file-icons.tsx +138 -0
  57. package/app/apps/github/src/components/filter.tsx +35 -0
  58. package/app/apps/github/src/components/hotkeys/hotkeys.tsx +255 -0
  59. package/app/apps/github/src/components/item-list.tsx +65 -0
  60. package/app/apps/github/src/components/language-dot.tsx +29 -0
  61. package/app/apps/github/src/components/list-toolbar.tsx +82 -0
  62. package/app/apps/github/src/components/markdown/editor.tsx +57 -0
  63. package/app/apps/github/src/components/markdown/markdown.css +177 -0
  64. package/app/apps/github/src/components/markdown/markdown.tsx +82 -0
  65. package/app/apps/github/src/components/owner-card.tsx +196 -0
  66. package/app/apps/github/src/components/pull-status.tsx +34 -0
  67. package/app/apps/github/src/components/recent.ts +41 -0
  68. package/app/apps/github/src/components/relative-time.tsx +78 -0
  69. package/app/apps/github/src/components/repos/icon-hashes.ts +91 -0
  70. package/app/apps/github/src/components/repos/new-repo-form.tsx +196 -0
  71. package/app/apps/github/src/components/repos/repo-icon.tsx +47 -0
  72. package/app/apps/github/src/components/repos/repo-list.tsx +528 -0
  73. package/app/apps/github/src/components/repos/your-repos.tsx +124 -0
  74. package/app/apps/github/src/components/review-state.tsx +75 -0
  75. package/app/apps/github/src/components/route-dialog.tsx +137 -0
  76. package/app/apps/github/src/components/save-button.tsx +58 -0
  77. package/app/apps/github/src/components/shell/app-shell.tsx +164 -0
  78. package/app/apps/github/src/components/shell/create-org-dialog.tsx +118 -0
  79. package/app/apps/github/src/components/shell/create-row.tsx +49 -0
  80. package/app/apps/github/src/components/shell/link-menu.tsx +94 -0
  81. package/app/apps/github/src/components/shell/nav-user.tsx +97 -0
  82. package/app/apps/github/src/components/shell/owner-repos.tsx +247 -0
  83. package/app/apps/github/src/components/shell/owner-switcher.tsx +104 -0
  84. package/app/apps/github/src/components/shell/repo-switcher.tsx +179 -0
  85. package/app/apps/github/src/components/shell/sections.ts +31 -0
  86. package/app/apps/github/src/components/shell/submenu-chevron.ts +147 -0
  87. package/app/apps/github/src/components/signin/device-card.tsx +139 -0
  88. package/app/apps/github/src/components/signin/login-form.tsx +88 -0
  89. package/app/apps/github/src/components/signin/signin-page.tsx +33 -0
  90. package/app/apps/github/src/components/signin/signup-form.tsx +106 -0
  91. package/app/apps/github/src/components/states/live-status.tsx +42 -0
  92. package/app/apps/github/src/components/states/states.tsx +126 -0
  93. package/app/apps/github/src/components/tab-indicator.tsx +143 -0
  94. package/app/apps/github/src/components/theme-choice.tsx +108 -0
  95. package/app/apps/github/src/components/theme-provider.tsx +126 -0
  96. package/app/apps/github/src/components/tones.ts +23 -0
  97. package/app/apps/github/src/components/ui/alert-dialog.tsx +187 -0
  98. package/app/apps/github/src/components/ui/alert.tsx +78 -0
  99. package/app/apps/github/src/components/ui/avatar.tsx +106 -0
  100. package/app/apps/github/src/components/ui/badge.tsx +51 -0
  101. package/app/apps/github/src/components/ui/breadcrumb.tsx +124 -0
  102. package/app/apps/github/src/components/ui/button-group.tsx +87 -0
  103. package/app/apps/github/src/components/ui/button.tsx +61 -0
  104. package/app/apps/github/src/components/ui/calendar.tsx +221 -0
  105. package/app/apps/github/src/components/ui/card.tsx +102 -0
  106. package/app/apps/github/src/components/ui/checkbox.tsx +26 -0
  107. package/app/apps/github/src/components/ui/collapsible.tsx +19 -0
  108. package/app/apps/github/src/components/ui/combobox.tsx +304 -0
  109. package/app/apps/github/src/components/ui/command.tsx +208 -0
  110. package/app/apps/github/src/components/ui/dialog.tsx +156 -0
  111. package/app/apps/github/src/components/ui/dropdown-menu.tsx +290 -0
  112. package/app/apps/github/src/components/ui/empty.tsx +100 -0
  113. package/app/apps/github/src/components/ui/field.tsx +236 -0
  114. package/app/apps/github/src/components/ui/hover-card.tsx +48 -0
  115. package/app/apps/github/src/components/ui/input-group.tsx +163 -0
  116. package/app/apps/github/src/components/ui/input.tsx +19 -0
  117. package/app/apps/github/src/components/ui/item.tsx +201 -0
  118. package/app/apps/github/src/components/ui/kbd.tsx +27 -0
  119. package/app/apps/github/src/components/ui/label.tsx +33 -0
  120. package/app/apps/github/src/components/ui/popover.tsx +87 -0
  121. package/app/apps/github/src/components/ui/radio-group.tsx +35 -0
  122. package/app/apps/github/src/components/ui/select.tsx +198 -0
  123. package/app/apps/github/src/components/ui/separator.tsx +22 -0
  124. package/app/apps/github/src/components/ui/sheet.tsx +138 -0
  125. package/app/apps/github/src/components/ui/sidebar.tsx +724 -0
  126. package/app/apps/github/src/components/ui/skeleton.tsx +13 -0
  127. package/app/apps/github/src/components/ui/sonner.tsx +47 -0
  128. package/app/apps/github/src/components/ui/styles.css +242 -0
  129. package/app/apps/github/src/components/ui/table.tsx +113 -0
  130. package/app/apps/github/src/components/ui/tabs.tsx +79 -0
  131. package/app/apps/github/src/components/ui/textarea.tsx +17 -0
  132. package/app/apps/github/src/components/ui/title.ts +6 -0
  133. package/app/apps/github/src/components/ui/toggle-group.tsx +89 -0
  134. package/app/apps/github/src/components/ui/toggle.tsx +42 -0
  135. package/app/apps/github/src/components/ui/tooltip.tsx +63 -0
  136. package/app/apps/github/src/components/user-avatar.tsx +145 -0
  137. package/app/apps/github/src/components/view-tabs.tsx +42 -0
  138. package/app/apps/github/src/context/context.ts +133 -0
  139. package/app/apps/github/src/diffs/blobs.ts +94 -0
  140. package/app/apps/github/src/diffs/diff-view.tsx +155 -0
  141. package/app/apps/github/src/diffs/files.ts +121 -0
  142. package/app/apps/github/src/diffs/hunks.tsx +454 -0
  143. package/app/apps/github/src/diffs/patch.ts +131 -0
  144. package/app/apps/github/src/diffs/rows.ts +137 -0
  145. package/app/apps/github/src/history/commit-diff.ts +54 -0
  146. package/app/apps/github/src/history/commit-list.tsx +207 -0
  147. package/app/apps/github/src/history/commit-page.tsx +147 -0
  148. package/app/apps/github/src/history/history.ts +129 -0
  149. package/app/apps/github/src/hooks/allowed.ts +31 -0
  150. package/app/apps/github/src/hooks/answers.ts +65 -0
  151. package/app/apps/github/src/hooks/avatars.ts +54 -0
  152. package/app/apps/github/src/hooks/draft.ts +38 -0
  153. package/app/apps/github/src/hooks/open-counts.ts +127 -0
  154. package/app/apps/github/src/hooks/profiles.ts +120 -0
  155. package/app/apps/github/src/hooks/repos.ts +440 -0
  156. package/app/apps/github/src/hooks/use-mobile.ts +19 -0
  157. package/app/apps/github/src/hooks/viewer.ts +39 -0
  158. package/app/apps/github/src/inbox/count.ts +70 -0
  159. package/app/apps/github/src/inbox/inbox-item.tsx +66 -0
  160. package/app/apps/github/src/inbox/inbox-page.tsx +572 -0
  161. package/app/apps/github/src/inbox/marks.ts +130 -0
  162. package/app/apps/github/src/inbox/release-tags.ts +65 -0
  163. package/app/apps/github/src/inbox/search.ts +97 -0
  164. package/app/apps/github/src/inbox/subjects.ts +184 -0
  165. package/app/apps/github/src/inbox/subscription-controls.tsx +184 -0
  166. package/app/apps/github/src/inbox/subscriptions.ts +189 -0
  167. package/app/apps/github/src/inbox/threads.ts +198 -0
  168. package/app/apps/github/src/issues/changes.ts +332 -0
  169. package/app/apps/github/src/issues/counts.ts +62 -0
  170. package/app/apps/github/src/issues/issue-list.tsx +682 -0
  171. package/app/apps/github/src/issues/issue-page.tsx +533 -0
  172. package/app/apps/github/src/issues/issues.ts +566 -0
  173. package/app/apps/github/src/issues/label-dialog.tsx +310 -0
  174. package/app/apps/github/src/issues/labels-page.tsx +119 -0
  175. package/app/apps/github/src/issues/new-issue.tsx +79 -0
  176. package/app/apps/github/src/issues/parts.tsx +71 -0
  177. package/app/apps/github/src/issues/picker.tsx +298 -0
  178. package/app/apps/github/src/issues/search.ts +238 -0
  179. package/app/apps/github/src/issues/sidebar.tsx +236 -0
  180. package/app/apps/github/src/lib/cn.ts +8 -0
  181. package/app/apps/github/src/lib/highlighting.ts +13 -0
  182. package/app/apps/github/src/live/follow.ts +129 -0
  183. package/app/apps/github/src/live/sse.ts +74 -0
  184. package/app/apps/github/src/live/use-follow.ts +37 -0
  185. package/app/apps/github/src/markdown/README.md +53 -0
  186. package/app/apps/github/src/markdown/allowed-html.ts +69 -0
  187. package/app/apps/github/src/markdown/context.ts +206 -0
  188. package/app/apps/github/src/markdown/images.ts +81 -0
  189. package/app/apps/github/src/markdown/lookup.ts +122 -0
  190. package/app/apps/github/src/markdown/patches.ts +299 -0
  191. package/app/apps/github/src/markdown/query.ts +25 -0
  192. package/app/apps/github/src/markdown/references.ts +158 -0
  193. package/app/apps/github/src/markdown/render.ts +103 -0
  194. package/app/apps/github/src/names/owners.ts +51 -0
  195. package/app/apps/github/src/names/repos.ts +24 -0
  196. package/app/apps/github/src/palette/palette.tsx +547 -0
  197. package/app/apps/github/src/palette/recent.ts +116 -0
  198. package/app/apps/github/src/palette/rows.tsx +455 -0
  199. package/app/apps/github/src/palette/server.ts +104 -0
  200. package/app/apps/github/src/palette/targets.ts +306 -0
  201. package/app/apps/github/src/policy.ts +600 -0
  202. package/app/apps/github/src/private-repos.ts +47 -0
  203. package/app/apps/github/src/pulls/compare-page.tsx +342 -0
  204. package/app/apps/github/src/pulls/files-tab.tsx +776 -0
  205. package/app/apps/github/src/pulls/live.ts +124 -0
  206. package/app/apps/github/src/pulls/merge-box.tsx +367 -0
  207. package/app/apps/github/src/pulls/merge-button.ts +86 -0
  208. package/app/apps/github/src/pulls/pull-list.tsx +235 -0
  209. package/app/apps/github/src/pulls/pull-page.tsx +474 -0
  210. package/app/apps/github/src/pulls/pull.ts +468 -0
  211. package/app/apps/github/src/pulls/pulls.ts +318 -0
  212. package/app/apps/github/src/pulls/review.ts +350 -0
  213. package/app/apps/github/src/pulls/search.ts +130 -0
  214. package/app/apps/github/src/queue/queue-page.tsx +405 -0
  215. package/app/apps/github/src/queue/queue.ts +231 -0
  216. package/app/apps/github/src/releases/latest-release.tsx +55 -0
  217. package/app/apps/github/src/releases/overview.tsx +30 -0
  218. package/app/apps/github/src/releases/release-form.tsx +353 -0
  219. package/app/apps/github/src/releases/release-list.tsx +173 -0
  220. package/app/apps/github/src/releases/release-view.tsx +183 -0
  221. package/app/apps/github/src/releases/releases.ts +308 -0
  222. package/app/apps/github/src/releases/tag-list.tsx +134 -0
  223. package/app/apps/github/src/router.tsx +46 -0
  224. package/app/apps/github/src/routes/$owner/$repo/_code/blob/$.tsx +33 -0
  225. package/app/apps/github/src/routes/$owner/$repo/_code/tree/$.tsx +28 -0
  226. package/app/apps/github/src/routes/$owner/$repo/_code.tsx +11 -0
  227. package/app/apps/github/src/routes/$owner/$repo/_releases/releases/index.tsx +19 -0
  228. package/app/apps/github/src/routes/$owner/$repo/_releases/tags.tsx +19 -0
  229. package/app/apps/github/src/routes/$owner/$repo/_releases.tsx +23 -0
  230. package/app/apps/github/src/routes/$owner/$repo/branches.tsx +39 -0
  231. package/app/apps/github/src/routes/$owner/$repo/commit/$sha.tsx +34 -0
  232. package/app/apps/github/src/routes/$owner/$repo/commits/$.tsx +42 -0
  233. package/app/apps/github/src/routes/$owner/$repo/compare/$.tsx +19 -0
  234. package/app/apps/github/src/routes/$owner/$repo/index.tsx +24 -0
  235. package/app/apps/github/src/routes/$owner/$repo/issues/$number.tsx +50 -0
  236. package/app/apps/github/src/routes/$owner/$repo/issues/index.tsx +53 -0
  237. package/app/apps/github/src/routes/$owner/$repo/issues/new.tsx +43 -0
  238. package/app/apps/github/src/routes/$owner/$repo/labels.tsx +22 -0
  239. package/app/apps/github/src/routes/$owner/$repo/pull/$number/checks.tsx +15 -0
  240. package/app/apps/github/src/routes/$owner/$repo/pull/$number/commits.tsx +15 -0
  241. package/app/apps/github/src/routes/$owner/$repo/pull/$number/files.tsx +15 -0
  242. package/app/apps/github/src/routes/$owner/$repo/pull/$number/index.tsx +19 -0
  243. package/app/apps/github/src/routes/$owner/$repo/pull/$number/route.tsx +52 -0
  244. package/app/apps/github/src/routes/$owner/$repo/pulls/index.tsx +48 -0
  245. package/app/apps/github/src/routes/$owner/$repo/queue.tsx +22 -0
  246. package/app/apps/github/src/routes/$owner/$repo/releases/edit/$.tsx +58 -0
  247. package/app/apps/github/src/routes/$owner/$repo/releases/new.tsx +40 -0
  248. package/app/apps/github/src/routes/$owner/$repo/releases/tag/$.tsx +35 -0
  249. package/app/apps/github/src/routes/$owner/$repo/route.tsx +102 -0
  250. package/app/apps/github/src/routes/$owner/$repo/settings/access.tsx +9 -0
  251. package/app/apps/github/src/routes/$owner/$repo/settings/hooks/index.tsx +16 -0
  252. package/app/apps/github/src/routes/$owner/$repo/settings/hooks/new.tsx +25 -0
  253. package/app/apps/github/src/routes/$owner/$repo/settings/index.tsx +17 -0
  254. package/app/apps/github/src/routes/$owner/$repo/settings/route.tsx +28 -0
  255. package/app/apps/github/src/routes/$owner/$repo/settings/rules.tsx +12 -0
  256. package/app/apps/github/src/routes/$owner/$repo/tokens.tsx +16 -0
  257. package/app/apps/github/src/routes/$owner/index.tsx +45 -0
  258. package/app/apps/github/src/routes/-nav.tsx +293 -0
  259. package/app/apps/github/src/routes/-root-testing.ts +107 -0
  260. package/app/apps/github/src/routes/__root.tsx +225 -0
  261. package/app/apps/github/src/routes/api.auth.$.ts +18 -0
  262. package/app/apps/github/src/routes/downloads/$owner/$repo/$asset.tsx +10 -0
  263. package/app/apps/github/src/routes/file-icons[.]svg.ts +21 -0
  264. package/app/apps/github/src/routes/icons/$owner/$repo.tsx +14 -0
  265. package/app/apps/github/src/routes/icons/$owner/index.tsx +14 -0
  266. package/app/apps/github/src/routes/icons/index.tsx +12 -0
  267. package/app/apps/github/src/routes/index.tsx +48 -0
  268. package/app/apps/github/src/routes/login.tsx +24 -0
  269. package/app/apps/github/src/routes/login_.code.tsx +31 -0
  270. package/app/apps/github/src/routes/new.tsx +91 -0
  271. package/app/apps/github/src/routes/notifications.tsx +20 -0
  272. package/app/apps/github/src/routes/orgs/$owner/issues.tsx +8 -0
  273. package/app/apps/github/src/routes/orgs/$owner/pulls.tsx +8 -0
  274. package/app/apps/github/src/routes/orgs/$owner/releases.tsx +8 -0
  275. package/app/apps/github/src/routes/orgs/$owner/route.tsx +25 -0
  276. package/app/apps/github/src/routes/orgs/$owner/settings.tsx +30 -0
  277. package/app/apps/github/src/routes/orgs/$owner/tokens.tsx +15 -0
  278. package/app/apps/github/src/routes/settings.tsx +54 -0
  279. package/app/apps/github/src/routes/signup.tsx +24 -0
  280. package/app/apps/github/src/routes/uploads/$owner/$repo/$release.tsx +10 -0
  281. package/app/apps/github/src/seed/acme.ts +498 -0
  282. package/app/apps/github/src/seed/licenses.ts +114 -0
  283. package/app/apps/github/src/seed/seed.ts +538 -0
  284. package/app/apps/github/src/server.ts +97 -0
  285. package/app/apps/github/src/settings/account-avatar.tsx +43 -0
  286. package/app/apps/github/src/settings/avatar-section.tsx +140 -0
  287. package/app/apps/github/src/settings/avatar.ts +58 -0
  288. package/app/apps/github/src/settings/general-settings.tsx +439 -0
  289. package/app/apps/github/src/settings/general.ts +73 -0
  290. package/app/apps/github/src/settings/hook-form.tsx +195 -0
  291. package/app/apps/github/src/settings/hook-list.tsx +166 -0
  292. package/app/apps/github/src/settings/hooks.ts +87 -0
  293. package/app/apps/github/src/settings/org-settings.tsx +228 -0
  294. package/app/apps/github/src/settings/orgs.ts +116 -0
  295. package/app/apps/github/src/settings/rule-list.tsx +72 -0
  296. package/app/apps/github/src/settings/rules.ts +27 -0
  297. package/app/apps/github/src/settings/settings-layout.tsx +114 -0
  298. package/app/apps/github/src/signin/approval.ts +186 -0
  299. package/app/apps/github/src/signin/auth-client.ts +127 -0
  300. package/app/apps/github/src/signin/auth.ts +753 -0
  301. package/app/apps/github/src/signin/avatars.ts +126 -0
  302. package/app/apps/github/src/signin/client-ip.ts +39 -0
  303. package/app/apps/github/src/signin/credentials.ts +26 -0
  304. package/app/apps/github/src/signin/device-code.ts +95 -0
  305. package/app/apps/github/src/signin/device-prompt.ts +125 -0
  306. package/app/apps/github/src/signin/errors.ts +135 -0
  307. package/app/apps/github/src/signin/host-session.ts +68 -0
  308. package/app/apps/github/src/signin/orgs.ts +283 -0
  309. package/app/apps/github/src/signin/owner-names.ts +183 -0
  310. package/app/apps/github/src/signin/person-lock.ts +104 -0
  311. package/app/apps/github/src/signin/seal.ts +88 -0
  312. package/app/apps/github/src/signin/seed-people.ts +92 -0
  313. package/app/apps/github/src/signin/session.ts +48 -0
  314. package/app/apps/github/src/signin/unborn.ts +110 -0
  315. package/app/apps/github/src/signin/viewer-orgs.ts +47 -0
  316. package/app/apps/github/src/signin/viewer.ts +74 -0
  317. package/app/apps/github/src/signin/with-headers.ts +14 -0
  318. package/app/apps/github/src/tokens/tokens-page.tsx +529 -0
  319. package/app/apps/github/src/tokens/tokens.ts +54 -0
  320. package/app/apps/github/tsconfig.json +25 -0
  321. package/app/apps/github/tsconfig.worker.json +24 -0
  322. package/app/apps/github/vite.config.ts +21 -0
  323. package/app/pnpm-workspace.yaml +216 -0
  324. package/app/tsconfig.base.json +127 -0
  325. package/dist/LICENSE +202 -0
  326. package/dist/cli/child.mjs +42 -0
  327. package/dist/cli/commands.mjs +23 -0
  328. package/dist/cli/credentials.mjs +84 -0
  329. package/dist/cli/documents.mjs +214 -0
  330. package/dist/cli/events.mjs +55 -0
  331. package/dist/cli/failure.mjs +105 -0
  332. package/dist/cli/folders.mjs +32 -0
  333. package/dist/cli/git-remote-ref0.d.mts +1 -0
  334. package/dist/cli/git-remote-ref0.mjs +29 -0
  335. package/dist/cli/git.mjs +48 -0
  336. package/dist/cli/helpers.mjs +51 -0
  337. package/dist/cli/hosts.mjs +127 -0
  338. package/dist/cli/node.mjs +15 -0
  339. package/dist/cli/output.mjs +135 -0
  340. package/dist/cli/prompt.mjs +35 -0
  341. package/dist/cli/queue.mjs +215 -0
  342. package/dist/cli/ref0-git.d.mts +1 -0
  343. package/dist/cli/ref0-git.mjs +144 -0
  344. package/dist/cli/repos.mjs +162 -0
  345. package/dist/cli/resources.mjs +131 -0
  346. package/dist/cli/run-end.mjs +57 -0
  347. package/dist/cli/runtime.mjs +50 -0
  348. package/dist/cli/setup.mjs +1410 -0
  349. package/dist/cli/sign-in.mjs +162 -0
  350. package/dist/cli/sign-ins.mjs +79 -0
  351. package/dist/cli/sqlite.mjs +28 -0
  352. package/dist/cli/tokens.mjs +141 -0
  353. package/dist/cli/vendor.mjs +123 -0
  354. package/dist/init/app.mjs +231 -0
  355. package/dist/init/astro.mjs +49 -0
  356. package/dist/init/choices.mjs +497 -0
  357. package/dist/init/cloudflare.mjs +324 -0
  358. package/dist/init/create.mjs +151 -0
  359. package/dist/init/detect.mjs +297 -0
  360. package/dist/init/files.mjs +75 -0
  361. package/dist/init/frameworks.mjs +248 -0
  362. package/dist/init/git-module.mjs +49 -0
  363. package/dist/init/github-routes.mjs +66 -0
  364. package/dist/init/jsonc.mjs +143 -0
  365. package/dist/init/metadata.mjs +48 -0
  366. package/dist/init/mounts.mjs +109 -0
  367. package/dist/init/next.mjs +205 -0
  368. package/dist/init/node-app.mjs +189 -0
  369. package/dist/init/node.mjs +458 -0
  370. package/dist/init/nuxt.mjs +115 -0
  371. package/dist/init/output.mjs +21 -0
  372. package/dist/init/plan.mjs +82 -0
  373. package/dist/init/range-major.mjs +257 -0
  374. package/dist/init/react-router.mjs +59 -0
  375. package/dist/init/routes.mjs +148 -0
  376. package/dist/init/shell.mjs +4 -0
  377. package/dist/init/stores.mjs +51 -0
  378. package/dist/init/sveltekit.mjs +139 -0
  379. package/dist/init/template.mjs +142 -0
  380. package/dist/init/templates.mjs +343 -0
  381. package/dist/init/vercel.mjs +383 -0
  382. package/dist/init/versions.mjs +32 -0
  383. package/dist/init/workspace.mjs +20 -0
  384. package/package.json +52 -3
  385. package/README.md +0 -3
@@ -0,0 +1,65 @@
1
+ import { type ComponentProps, Fragment, type ReactNode } from 'react';
2
+
3
+ import { cn } from '#/lib/cn';
4
+
5
+ import { Button } from './ui/button.tsx';
6
+ import { ItemGroup, ItemSeparator } from './ui/item.tsx';
7
+
8
+ /**
9
+ * A list's rows, each an `Item` with `role="listitem"`, one under the next, with a separator between
10
+ * each pair, as shadcn's `item-group` example draws them. A screen reader hears the rows alone,
11
+ * since each separator is hidden from it. The rows sit flush against each separator at every Item
12
+ * size, overriding the wider gap `ItemGroup` gives small Items.
13
+ */
14
+ export function ItemList<Row>({
15
+ rows,
16
+ keyOf,
17
+ row,
18
+ className,
19
+ ...props
20
+ }: {
21
+ readonly rows: readonly Row[];
22
+ readonly keyOf: (row: Row, index: number) => string;
23
+ readonly row: (row: Row, index: number) => ReactNode;
24
+ } & Omit<ComponentProps<typeof ItemGroup>, 'children'>) {
25
+ return (
26
+ <ItemGroup
27
+ className={cn('gap-0 has-data-[size=sm]:gap-0 has-data-[size=xs]:gap-0', className)}
28
+ {...props}
29
+ >
30
+ {rows.map((one, index) => (
31
+ <Fragment key={keyOf(one, index)}>
32
+ {index > 0 && <ItemSeparator aria-hidden className="my-0" />}
33
+ {row(one, index)}
34
+ </Fragment>
35
+ ))}
36
+ </ItemGroup>
37
+ );
38
+ }
39
+
40
+ /** The next page's button, while a list has one, as the reader asks for more. */
41
+ export function More({
42
+ pages,
43
+ label,
44
+ }: {
45
+ readonly pages: {
46
+ readonly hasNextPage: boolean;
47
+ readonly isFetchingNextPage: boolean;
48
+ readonly fetchNextPage: () => Promise<object>;
49
+ };
50
+ readonly label: string;
51
+ }) {
52
+ if (!pages.hasNextPage) return null;
53
+
54
+ return (
55
+ <div className="flex justify-center border-t p-2">
56
+ <Button
57
+ variant="outline"
58
+ disabled={pages.isFetchingNextPage}
59
+ onClick={() => void pages.fetchNextPage()}
60
+ >
61
+ {pages.isFetchingNextPage ? 'Loading…' : label}
62
+ </Button>
63
+ </div>
64
+ );
65
+ }
@@ -0,0 +1,29 @@
1
+ import { languageColor } from '@ref0/github/languages';
2
+
3
+ /**
4
+ * A language's mark: its dot in linguist's colour, as GitHub shows it, or a muted dot for a
5
+ * language linguist gives no colour. A repo's row and the Language menu both draw it, so the menu's
6
+ * marks match the rows'.
7
+ */
8
+ export function LanguageMark({ name }: { readonly name: string }) {
9
+ return (
10
+ <span
11
+ aria-hidden
12
+ data-slot="language-mark"
13
+ className="size-2.5 shrink-0 rounded-full bg-muted-foreground"
14
+ style={{ backgroundColor: languageColor(name) }}
15
+ />
16
+ );
17
+ }
18
+
19
+ /** A repo's main language, its mark then its name. A repo with no language shows nothing. */
20
+ export function LanguageDot({ name }: { readonly name: string | null }) {
21
+ if (name === null) return null;
22
+
23
+ return (
24
+ <span className="inline-flex items-center gap-1.5">
25
+ <LanguageMark name={name} />
26
+ {name}
27
+ </span>
28
+ );
29
+ }
@@ -0,0 +1,82 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ import { cn } from '#/lib/cn';
4
+
5
+ /**
6
+ * The class a toolbar's link takes to show its icon alone, square, under 28rem, beside a label
7
+ * that says `@max-md:sr-only`, so a screen reader still hears it.
8
+ */
9
+ export const iconOnPhone = '@max-md:w-10 @max-md:px-0';
10
+
11
+ /**
12
+ * A list page's toolbar, laid out the same way on every list page, so no control sits alone on a
13
+ * wrapped line and no label wraps inside its button. Its lead is one of three:
14
+ *
15
+ * - `search`, which takes what the buttons leave of the first row. Below 8rem it gives way: it
16
+ * takes the first row whole, and the buttons take the second.
17
+ * - `heading`, such as the labels page's count, which keeps its width before the buttons.
18
+ * - `tabs`, such as Releases and Tags, which keep their width on the toolbar's bottom border. When
19
+ * the buttons can't fit beside them, the buttons go above, so the tabs stay on their line.
20
+ *
21
+ * `buttons` are the page's links, such as Labels, then its CreateButton, last. Beside the lead
22
+ * they keep their width; on a row of their own the last stretches to fill it. A link with a label
23
+ * and an icon shows its icon alone under 28rem, with `iconOnPhone`, since the toolbar is its
24
+ * container.
25
+ *
26
+ * `filters` are the menus that narrow the list. From 48rem they sit between the lead and the
27
+ * buttons; narrower, they take the last row, on one line that scrolls sideways when they don't fit.
28
+ */
29
+ export function ListToolbar({
30
+ search,
31
+ heading,
32
+ tabs,
33
+ filters,
34
+ buttons,
35
+ className,
36
+ }: {
37
+ readonly search?: ReactNode;
38
+ readonly heading?: ReactNode;
39
+ readonly tabs?: ReactNode;
40
+ readonly filters?: ReactNode;
41
+ readonly buttons?: ReactNode;
42
+ readonly className?: string;
43
+ }) {
44
+ const lead = search ?? heading ?? tabs;
45
+
46
+ return (
47
+ <div data-slot="list-toolbar" className={cn('@container', className)}>
48
+ <div
49
+ className={cn(
50
+ 'flex gap-2',
51
+ tabs === undefined ? 'flex-wrap items-center' : 'flex-wrap-reverse items-end',
52
+ )}
53
+ >
54
+ {lead !== undefined && (
55
+ <div
56
+ className={cn(
57
+ 'flex min-w-0 grow-[999] items-center',
58
+ search === undefined ? 'shrink-0 basis-auto' : 'basis-32 *:w-full',
59
+ )}
60
+ >
61
+ {lead}
62
+ </div>
63
+ )}
64
+ {filters !== undefined && (
65
+ <div className="order-last -m-[3px] flex basis-full gap-2 overflow-x-auto p-[3px] *:shrink-0 @3xl:order-none @3xl:m-0 @3xl:basis-auto @3xl:overflow-visible @3xl:p-0">
66
+ {filters}
67
+ </div>
68
+ )}
69
+ {buttons !== undefined && (
70
+ <div
71
+ className={cn(
72
+ 'flex items-center gap-2 *:shrink-0 [&>:last-child]:grow',
73
+ lead === undefined ? 'ml-auto' : 'grow',
74
+ )}
75
+ >
76
+ {buttons}
77
+ </div>
78
+ )}
79
+ </div>
80
+ </div>
81
+ );
82
+ }
@@ -0,0 +1,57 @@
1
+ import { useState } from 'react';
2
+
3
+ import { Tabs, TabsContent } from '../ui/tabs.tsx';
4
+ import { Textarea } from '../ui/textarea.tsx';
5
+ import { ViewTabs } from '../view-tabs.tsx';
6
+ import { Markdown } from './markdown.tsx';
7
+
8
+ /** A comment's two views: the text box, and what it posts. */
9
+ const editorViews = [
10
+ { value: 'write', label: 'Write' },
11
+ { value: 'preview', label: 'Preview' },
12
+ ] as const;
13
+
14
+ /**
15
+ * A text box for Markdown, and its preview through the renderer a saved comment shows through,
16
+ * so what's previewed is what's posted.
17
+ */
18
+ export function MarkdownEditor({
19
+ repo,
20
+ label,
21
+ value,
22
+ onChange,
23
+ placeholder,
24
+ autoFocus = false,
25
+ }: {
26
+ readonly repo: string;
27
+ readonly label: string;
28
+ readonly value: string;
29
+ readonly onChange: (value: string) => void;
30
+ readonly placeholder?: string;
31
+ /** Whether its box takes the focus as it opens, as a comment on lines picked does. */
32
+ readonly autoFocus?: boolean;
33
+ }) {
34
+ const [tab, setTab] = useState<string>('write');
35
+
36
+ return (
37
+ <Tabs value={tab} onValueChange={(next) => setTab(String(next))}>
38
+ <ViewTabs views={editorViews} />
39
+ <TabsContent value="write">
40
+ <Textarea
41
+ aria-label={label}
42
+ autoFocus={autoFocus}
43
+ value={value}
44
+ placeholder={placeholder}
45
+ onChange={(event) => onChange(event.target.value)}
46
+ />
47
+ </TabsContent>
48
+ <TabsContent value="preview" className="min-h-24 rounded-md border px-3 py-2">
49
+ {value.trim() === '' ? (
50
+ <p className="text-sm text-muted-foreground">Nothing to preview</p>
51
+ ) : (
52
+ <Markdown text={value} context={{ kind: 'comment', repo }} />
53
+ )}
54
+ </TabsContent>
55
+ </Tabs>
56
+ );
57
+ }
@@ -0,0 +1,177 @@
1
+ /*
2
+ * Rendered Markdown, as GitHub's page lays it out, in the app's theme: the elements words draws
3
+ * and its `data-markdown` parts, the alerts' classes and the footnotes'. The root links it beside
4
+ * shadcn's styles.
5
+ */
6
+ .markdown-body {
7
+ /* The type scale's 14px, wherever the Markdown sits. */
8
+ font-size: var(--text-sm);
9
+ line-height: 1.6;
10
+ overflow-wrap: break-word;
11
+ }
12
+
13
+ .markdown-body > * + * {
14
+ margin-top: 1rem;
15
+ }
16
+
17
+ .markdown-body :is(h1, h2, h3, h4, h5, h6) {
18
+ font-weight: 600;
19
+ line-height: 1.25;
20
+ margin-top: 1.5rem;
21
+ }
22
+
23
+ .markdown-body h1 {
24
+ font-size: 2em;
25
+ }
26
+
27
+ .markdown-body h2 {
28
+ font-size: 1.5em;
29
+ }
30
+
31
+ .markdown-body h3 {
32
+ font-size: 1.25em;
33
+ }
34
+
35
+ .markdown-body :is(h1, h2) {
36
+ border-bottom: 1px solid var(--border);
37
+ padding-bottom: 0.3em;
38
+ }
39
+
40
+ .markdown-body a {
41
+ color: var(--link);
42
+ text-decoration: underline;
43
+ text-underline-offset: 2px;
44
+ }
45
+
46
+ .markdown-body :is(ul, ol) {
47
+ padding-left: 2em;
48
+ }
49
+
50
+ .markdown-body ul {
51
+ list-style: disc;
52
+ }
53
+
54
+ .markdown-body ol {
55
+ list-style: decimal;
56
+ }
57
+
58
+ .markdown-body li + li {
59
+ margin-top: 0.25em;
60
+ }
61
+
62
+ /* A task list: words marks its items by their checkbox alone. */
63
+ .markdown-body ul:has(> li > input[type='checkbox']:first-child) {
64
+ list-style: none;
65
+ padding-left: 1em;
66
+ }
67
+
68
+ .markdown-body li > input[type='checkbox']:first-child {
69
+ margin-right: 0.5em;
70
+ }
71
+
72
+ .markdown-body :is(code, tt) {
73
+ background: var(--muted);
74
+ border-radius: 6px;
75
+ font-family: ui-monospace, monospace;
76
+ font-size: 85%;
77
+ padding: 0.2em 0.4em;
78
+ }
79
+
80
+ /* The language label words draws over a code block, which GitHub doesn't. */
81
+ .markdown-body [data-markdown='code-header'] {
82
+ display: none;
83
+ }
84
+
85
+ .markdown-body pre {
86
+ background: var(--muted);
87
+ border-radius: 6px;
88
+ overflow: auto;
89
+ padding: 1rem;
90
+ }
91
+
92
+ .markdown-body pre code {
93
+ background: none;
94
+ font-size: 85%;
95
+ padding: 0;
96
+ }
97
+
98
+ .markdown-body blockquote {
99
+ border-left: 0.25em solid var(--border);
100
+ color: var(--muted-foreground);
101
+ padding: 0 1em;
102
+ }
103
+
104
+ .markdown-body table {
105
+ border-collapse: collapse;
106
+ display: block;
107
+ overflow: auto;
108
+ }
109
+
110
+ .markdown-body :is(th, td) {
111
+ border: 1px solid var(--border);
112
+ padding: 6px 13px;
113
+ }
114
+
115
+ .markdown-body img {
116
+ display: inline-block;
117
+ max-width: 100%;
118
+ }
119
+
120
+ .markdown-body hr {
121
+ border-top: 4px solid var(--border);
122
+ }
123
+
124
+ .markdown-body mark {
125
+ background: color-mix(in oklab, yellow 40%, transparent);
126
+ color: inherit;
127
+ }
128
+
129
+ .markdown-body .markdown-alert {
130
+ border-left: 0.25em solid var(--alert, var(--border));
131
+ padding: 0.5rem 1rem;
132
+ }
133
+
134
+ .markdown-body .markdown-alert-title {
135
+ align-items: center;
136
+ color: var(--alert);
137
+ display: flex;
138
+ font-weight: 500;
139
+ }
140
+
141
+ /* The alert's icon, in its title's colour beside its name, as GitHub's. */
142
+ .markdown-body .markdown-alert-title .octicon {
143
+ fill: currentColor;
144
+ }
145
+
146
+ .markdown-body .markdown-alert-note {
147
+ --alert: #4493f8;
148
+ }
149
+
150
+ .markdown-body .markdown-alert-tip {
151
+ --alert: #3fb950;
152
+ }
153
+
154
+ .markdown-body .markdown-alert-important {
155
+ --alert: #ab7df8;
156
+ }
157
+
158
+ .markdown-body .markdown-alert-warning {
159
+ --alert: #d29922;
160
+ }
161
+
162
+ .markdown-body .markdown-alert-caution {
163
+ --alert: #f85149;
164
+ }
165
+
166
+ .markdown-body .footnotes {
167
+ border-top: 1px solid var(--border);
168
+ color: var(--muted-foreground);
169
+ font-size: 0.875em;
170
+ padding-top: 1rem;
171
+ }
172
+
173
+ /* Display math, words' SVG sized in ems, shrinks to fit rather than running off the page. */
174
+ .markdown-body svg[data-markdown='math-display'] {
175
+ height: auto;
176
+ max-width: 100%;
177
+ }
@@ -0,0 +1,82 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { useEffect, useMemo, useRef, type RefObject } from 'react';
3
+
4
+ import { fragmentTargets, nothingFound, type MarkdownContext } from '../../markdown/context.ts';
5
+ import { drawnImage, repoImageBlob, repoImageOf } from '../../markdown/images.ts';
6
+ import { markdownQuery } from '../../markdown/query.ts';
7
+ import { renderMarkdown } from '../../markdown/render.ts';
8
+
9
+ /**
10
+ * Each repo image in `html`, once it's in `container`, drawn from its blob, whose URL is let go
11
+ * when the HTML changes or the text goes.
12
+ */
13
+ const useRepoImages = (container: RefObject<HTMLDivElement | null>, html: string) => {
14
+ useEffect(() => {
15
+ const images = [...(container.current?.querySelectorAll('img') ?? [])];
16
+ const stop = new AbortController();
17
+ const drawn: (() => void)[] = [];
18
+
19
+ for (const image of images) {
20
+ const named = repoImageOf(image);
21
+ if (named === undefined) continue;
22
+
23
+ void repoImageBlob(named, stop.signal)
24
+ .then(async (blob) => {
25
+ if (blob === undefined || stop.signal.aborted) return;
26
+ const { src, release } = await drawnImage(blob);
27
+ if (stop.signal.aborted) return release();
28
+ drawn.push(release);
29
+ image.src = src;
30
+ })
31
+ .catch(() => undefined);
32
+ }
33
+
34
+ return () => {
35
+ stop.abort();
36
+
37
+ for (const release of drawn) release();
38
+ };
39
+ }, [container, html]);
40
+ };
41
+
42
+ /**
43
+ * The page's fragment, `#setup`, scrolled to as the id or anchor name the text gave it,
44
+ * `user-content-setup`, which the sanitizer prefixed, as GitHub's page script does. Once, when
45
+ * the text first draws.
46
+ */
47
+ const useFragment = (container: RefObject<HTMLDivElement | null>) => {
48
+ useEffect(() => {
49
+ const fragment = location.hash.slice(1);
50
+ if (fragment === '') return;
51
+
52
+ const targets = [...(container.current?.querySelectorAll('[id], a[name]') ?? [])];
53
+ const named = (id: string) =>
54
+ targets.find((at) => at.id === id || at.getAttribute('name') === id);
55
+ const target = fragmentTargets(fragment)
56
+ .map(named)
57
+ .find((at) => at !== undefined);
58
+ target?.scrollIntoView();
59
+ }, [container]);
60
+ };
61
+
62
+ /**
63
+ * Markdown as GitHub shows it in `context`, one renderer for previews and saved text: sanitized
64
+ * HTML, with references linked once the drop-in says they exist, and until then the same text
65
+ * unlinked, which the server's page and the browser's first render share.
66
+ */
67
+ export const Markdown = ({ text, context }: { text: string; context: MarkdownContext }) => {
68
+ const query = useQuery(markdownQuery(text, context));
69
+ const linked = query.data;
70
+ const unlinked = useMemo(
71
+ () => (linked === undefined ? renderMarkdown(text, context, nothingFound) : undefined),
72
+ [linked, text, context],
73
+ );
74
+ const html = linked ?? unlinked ?? '';
75
+ const container = useRef<HTMLDivElement>(null);
76
+ useRepoImages(container, html);
77
+ useFragment(container);
78
+
79
+ return (
80
+ <div ref={container} className="markdown-body" dangerouslySetInnerHTML={{ __html: html }} />
81
+ );
82
+ };
@@ -0,0 +1,196 @@
1
+ import { cn } from '#/lib/cn';
2
+ import { useQuery } from '@tanstack/react-query';
3
+ import { Link } from '@tanstack/react-router';
4
+ import {
5
+ BookMarkedIcon,
6
+ BuildingIcon,
7
+ CalendarIcon,
8
+ LinkIcon,
9
+ MapPinIcon,
10
+ UsersIcon,
11
+ type LucideIcon,
12
+ } from 'lucide-react';
13
+ import type { ReactNode } from 'react';
14
+
15
+ import { profileAt, type Profile } from '../hooks/profiles.ts';
16
+ import { HoverCard, HoverCardContent, HoverCardTrigger } from './ui/hover-card.tsx';
17
+ import { Skeleton } from './ui/skeleton.tsx';
18
+ import { UserAvatar, type Account } from './user-avatar.tsx';
19
+
20
+ /** A joined date, as a month and a year, as GitHub's card shows one. */
21
+ const joinedAt = new Intl.DateTimeFormat('en', { month: 'long', year: 'numeric', timeZone: 'UTC' });
22
+
23
+ /** A count with its noun, one or many: "1 follower", "12 followers". */
24
+ const counted = (count: number, one: string, many: string) =>
25
+ `${count.toLocaleString('en')} ${count === 1 ? one : many}`;
26
+
27
+ /** A URL's scheme, as the URL standard reads one: a letter, then letters, digits, `+`, `-` or `.`. */
28
+ const scheme = /^[a-z][a-z\d+.-]*:/i;
29
+
30
+ /** The only schemes a blog links by: anything else, such as `javascript:` or `data:`, is text. */
31
+ const linked: ReadonlySet<string> = new Set(['http:', 'https:']);
32
+
33
+ /**
34
+ * A blog's address as a link's `href`, or `undefined` to show it as text. The blog is the account's
35
+ * own text, so it's parsed, never matched by its start: read as the URL parser reads it, without
36
+ * tabs or newlines and trimmed, one with no scheme is taken as `https://`, and only an address the
37
+ * parser reads as `http:` or `https:` is linked, by the `href` the parser writes.
38
+ */
39
+ export const blogHref = (blog: string): string | undefined => {
40
+ const text = blog.replaceAll(/[\t\n\r]/g, '').trim();
41
+ const address = scheme.test(text) ? text : `https://${text}`;
42
+
43
+ try {
44
+ const url = new URL(address);
45
+
46
+ return linked.has(url.protocol) ? url.href : undefined;
47
+ } catch {
48
+ return undefined;
49
+ }
50
+ };
51
+
52
+ /** One of a card's details: its icon, then its text. */
53
+ function Detail({
54
+ icon: Icon,
55
+ children,
56
+ }: {
57
+ readonly icon: LucideIcon;
58
+ readonly children: ReactNode;
59
+ }) {
60
+ return (
61
+ <li className="flex min-w-0 items-center gap-1.5">
62
+ <Icon aria-hidden className="size-3.5 shrink-0" />
63
+ <span className="min-w-0 truncate">{children}</span>
64
+ </li>
65
+ );
66
+ }
67
+
68
+ /** A card's shape while its profile reads: the avatar, the name's and login's lines, and a detail. */
69
+ function ProfileSkeleton({ account }: { readonly account: Account }) {
70
+ return (
71
+ <div data-slot="owner-card-skeleton" className="flex flex-col gap-3">
72
+ <div className="flex items-center gap-3">
73
+ <Skeleton className={cn('size-10 shrink-0', account === 'user' && 'rounded-full')} />
74
+ <div className="flex flex-1 flex-col gap-1.5">
75
+ <Skeleton className="h-4 w-32" />
76
+ <Skeleton className="h-3 w-20" />
77
+ </div>
78
+ </div>
79
+ <Skeleton className="h-3 w-full" />
80
+ </div>
81
+ );
82
+ }
83
+
84
+ /**
85
+ * A profile, as its card shows it: the avatar and name, each leading to the owner's page, the
86
+ * login, then what it says of itself and its details, each left out when it's empty.
87
+ */
88
+ function ProfileShown({ profile }: { readonly profile: Profile }) {
89
+ const blog = profile.blog === null ? undefined : blogHref(profile.blog);
90
+ const counts = [
91
+ profile.publicRepos !== null && counted(profile.publicRepos, 'repository', 'repositories'),
92
+ profile.followers !== null && counted(profile.followers, 'follower', 'followers'),
93
+ ].filter((count) => count !== false);
94
+
95
+ return (
96
+ <div className="flex flex-col gap-3">
97
+ <div className="flex min-w-0 items-center gap-3">
98
+ <Link to="/$owner" params={{ owner: profile.login }} tabIndex={-1} aria-hidden>
99
+ <UserAvatar login={profile.login} account={profile.kind} size="lg" />
100
+ </Link>
101
+ <div className="flex min-w-0 flex-col">
102
+ <Link
103
+ to="/$owner"
104
+ params={{ owner: profile.login }}
105
+ className="truncate font-semibold hover:underline"
106
+ >
107
+ {profile.name ?? profile.login}
108
+ </Link>
109
+ {profile.name !== null && (
110
+ <span className="truncate text-meta text-muted-foreground">{profile.login}</span>
111
+ )}
112
+ </div>
113
+ </div>
114
+ {profile.about !== null && <p className="wrap-anywhere">{profile.about}</p>}
115
+ <ul className="flex flex-col gap-1 text-meta text-muted-foreground empty:hidden">
116
+ {profile.company !== null && <Detail icon={BuildingIcon}>{profile.company}</Detail>}
117
+ {profile.location !== null && <Detail icon={MapPinIcon}>{profile.location}</Detail>}
118
+ {profile.blog !== null && (
119
+ <Detail icon={LinkIcon}>
120
+ {blog === undefined ? (
121
+ profile.blog
122
+ ) : (
123
+ <a href={blog} rel="noopener noreferrer nofollow" className="hover:underline">
124
+ {profile.blog}
125
+ </a>
126
+ )}
127
+ </Detail>
128
+ )}
129
+ {profile.joined !== null && (
130
+ <Detail icon={CalendarIcon}>Joined {joinedAt.format(new Date(profile.joined))}</Detail>
131
+ )}
132
+ {counts.length > 0 && (
133
+ <Detail icon={profile.followers === null ? BookMarkedIcon : UsersIcon}>
134
+ {counts.join(' · ')}
135
+ </Detail>
136
+ )}
137
+ </ul>
138
+ </div>
139
+ );
140
+ }
141
+
142
+ /**
143
+ * What an open card holds: its owner's profile, read the first time any card for that login opens
144
+ * and kept for the session, a skeleton while it reads, or a line saying it couldn't load.
145
+ */
146
+ function ProfileCard({ login, account }: { readonly login: string; readonly account: Account }) {
147
+ const profile = useQuery(profileAt(login, account));
148
+ if (profile.isError) return <p className="text-muted-foreground">Couldn't load this profile</p>;
149
+
150
+ if (profile.data === undefined) return <ProfileSkeleton account={account} />;
151
+
152
+ return <ProfileShown profile={profile.data} />;
153
+ }
154
+
155
+ /**
156
+ * An owner's name or avatar wherever the app draws one, as a link to the owner's page whose hover
157
+ * card shows their profile, as GitHub's does: a pointer resting on it, or focus, opens the card,
158
+ * and a tap on a phone follows the link. The profile is read only once a card opens. `account` is
159
+ * whose the login is, where the page knows; a person's otherwise, which reads an org's too.
160
+ */
161
+ export function OwnerCard({
162
+ login,
163
+ account = 'user',
164
+ label,
165
+ beside = false,
166
+ className,
167
+ children,
168
+ }: {
169
+ readonly login: string;
170
+ readonly account?: Account;
171
+ /** The link's name, where it draws only an avatar, whose picture is decorative. */
172
+ readonly label?: string;
173
+ /**
174
+ * An avatar beside the owner's name, which is its own `OwnerCard`: a link for the pointer alone,
175
+ * out of the tab order and hidden from a screen reader, so each meets the owner once, by name.
176
+ */
177
+ readonly beside?: boolean;
178
+ readonly className?: string;
179
+ readonly children: ReactNode;
180
+ }) {
181
+ return (
182
+ <HoverCard>
183
+ <HoverCardTrigger
184
+ render={<Link to="/$owner" params={{ owner: login }} />}
185
+ aria-label={beside ? undefined : label}
186
+ {...(beside && { tabIndex: -1, 'aria-hidden': true })}
187
+ className={cn('hover:underline', className)}
188
+ >
189
+ {children}
190
+ </HoverCardTrigger>
191
+ <HoverCardContent>
192
+ <ProfileCard login={login} account={account} />
193
+ </HoverCardContent>
194
+ </HoverCard>
195
+ );
196
+ }