@coffre/ui 0.1.18 → 0.3.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 (236) hide show
  1. package/README.md +23 -3
  2. package/dist/{server/_coffre/assets/affordances-CKANXDTG.js → chunks/affordances-DAvsVz7u.js} +12 -7
  3. package/dist/chunks/affordances-DAvsVz7u.js.map +1 -0
  4. package/dist/chunks/directory-CSjWWUQ1.js +370 -0
  5. package/dist/chunks/directory-CSjWWUQ1.js.map +1 -0
  6. package/dist/{server/_coffre/assets/grants-DdKT11Ny.js → chunks/grants-saMQagmG.js} +41 -39
  7. package/dist/chunks/grants-saMQagmG.js.map +1 -0
  8. package/dist/chunks/icons-D-PfAfnH.js +203 -0
  9. package/dist/chunks/icons-D-PfAfnH.js.map +1 -0
  10. package/dist/chunks/mounted-jJmqqV_n.js +17 -0
  11. package/dist/chunks/mounted-jJmqqV_n.js.map +1 -0
  12. package/dist/{server/_coffre/assets/offboarding-CRz-K82H.js → chunks/offboarding-C6l30DZR.js} +70 -69
  13. package/dist/chunks/offboarding-C6l30DZR.js.map +1 -0
  14. package/dist/chunks/page-C5HcNqf2.js +190 -0
  15. package/dist/chunks/page-C5HcNqf2.js.map +1 -0
  16. package/dist/chunks/page-route-Drfw7lmn.js +20 -0
  17. package/dist/chunks/page-route-Drfw7lmn.js.map +1 -0
  18. package/dist/{server/_coffre/assets/principal-page-C-EFwJQw.js → chunks/principal-page-D_91OA0l.js} +105 -103
  19. package/dist/chunks/principal-page-D_91OA0l.js.map +1 -0
  20. package/dist/{server/_coffre/assets → chunks}/project-environments-lEzFHUt4.js +2 -0
  21. package/dist/chunks/project-environments-lEzFHUt4.js.map +1 -0
  22. package/dist/chunks/queries-CQ81o4so.js +376 -0
  23. package/dist/chunks/queries-CQ81o4so.js.map +1 -0
  24. package/dist/{server/_coffre/assets/row-state-C2P57xT1.js → chunks/row-state-0PsrEzOL.js} +22 -21
  25. package/dist/chunks/row-state-0PsrEzOL.js.map +1 -0
  26. package/dist/{server/_coffre/assets → chunks}/signin-errors-BEFlVDbQ.js +2 -0
  27. package/dist/chunks/signin-errors-BEFlVDbQ.js.map +1 -0
  28. package/dist/chunks/theme-B2vQolVR.js +86 -0
  29. package/dist/chunks/theme-B2vQolVR.js.map +1 -0
  30. package/dist/chunks/ui-DixXLQvQ.js +405 -0
  31. package/dist/chunks/ui-DixXLQvQ.js.map +1 -0
  32. package/dist/{server/_coffre/assets/use-action-B-xpvVRO.js → chunks/use-action-CWsg_YWU.js} +8 -6
  33. package/dist/chunks/use-action-CWsg_YWU.js.map +1 -0
  34. package/dist/{server/_coffre/assets/use-change-C8BCf3oU.js → chunks/use-change-c6CeLRin.js} +10 -474
  35. package/dist/chunks/use-change-c6CeLRin.js.map +1 -0
  36. package/dist/chunks/use-shell-jxd7Tzd-.js +26 -0
  37. package/dist/chunks/use-shell-jxd7Tzd-.js.map +1 -0
  38. package/dist/{server/_coffre/assets → chunks}/validation-BQtqPe2V.js +2 -0
  39. package/dist/chunks/validation-BQtqPe2V.js.map +1 -0
  40. package/dist/index.d.ts +386 -18
  41. package/dist/index.js +1147 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/pages/account.d.ts +9 -0
  44. package/dist/pages/account.js +334 -0
  45. package/dist/pages/account.js.map +1 -0
  46. package/dist/pages/audit.d.ts +3 -0
  47. package/dist/{server/_coffre/assets/audit-qB9G2AQJ.js → pages/audit.js} +102 -100
  48. package/dist/pages/audit.js.map +1 -0
  49. package/dist/pages/device-login.d.ts +9 -0
  50. package/dist/pages/device-login.js +211 -0
  51. package/dist/pages/device-login.js.map +1 -0
  52. package/dist/pages/environment.d.ts +3 -0
  53. package/dist/{server/_coffre/assets/projects._project._environment-C6uybzeU.js → pages/environment.js} +323 -469
  54. package/dist/pages/environment.js.map +1 -0
  55. package/dist/pages/login.d.ts +10 -0
  56. package/dist/pages/login.js +104 -0
  57. package/dist/pages/login.js.map +1 -0
  58. package/dist/pages/project.d.ts +2 -0
  59. package/dist/{server/_coffre/assets/projects._project.index-3CXwkyTh.js → pages/project.js} +223 -225
  60. package/dist/pages/project.js.map +1 -0
  61. package/dist/pages/projects.d.ts +3 -0
  62. package/dist/{server/_coffre/assets/projects.index-iSoBpRFz.js → pages/projects.js} +83 -81
  63. package/dist/pages/projects.js.map +1 -0
  64. package/dist/pages/settings.d.ts +3 -0
  65. package/dist/{server/_coffre/assets/settings-BDQTF5XW.js → pages/settings.js} +20 -18
  66. package/dist/pages/settings.js.map +1 -0
  67. package/dist/pages/token.d.ts +3 -0
  68. package/dist/{server/_coffre/assets/tokens._token-CrBMpcbN.js → pages/token.js} +198 -267
  69. package/dist/pages/token.js.map +1 -0
  70. package/dist/pages/tokens.d.ts +3 -0
  71. package/dist/pages/tokens.js +39 -0
  72. package/dist/pages/tokens.js.map +1 -0
  73. package/dist/pages/unregistered.d.ts +8 -0
  74. package/dist/pages/unregistered.js +54 -0
  75. package/dist/pages/unregistered.js.map +1 -0
  76. package/dist/pages/user.d.ts +3 -0
  77. package/dist/pages/user.js +16 -0
  78. package/dist/pages/user.js.map +1 -0
  79. package/dist/pages/users.d.ts +3 -0
  80. package/dist/pages/users.js +39 -0
  81. package/dist/pages/users.js.map +1 -0
  82. package/dist/project-BqIy8gYR.d.ts +5 -0
  83. package/dist/vite.d.ts +16 -0
  84. package/dist/vite.js +52 -0
  85. package/package.json +36 -21
  86. package/src/assets/icon.svg +1 -0
  87. package/src/components/affordances.ts +10 -4
  88. package/src/components/command-palette.tsx +229 -203
  89. package/src/components/directory.tsx +34 -38
  90. package/src/components/principal.tsx +7 -3
  91. package/src/components/service-tokens.tsx +3 -2
  92. package/src/components/shell.tsx +89 -127
  93. package/src/components/theme.tsx +14 -81
  94. package/src/components/ui.tsx +97 -68
  95. package/src/index.ts +29 -0
  96. package/src/layout.tsx +113 -0
  97. package/src/lib/coffre.ts +8 -4
  98. package/src/lib/mounted.ts +13 -0
  99. package/src/lib/page-context.ts +31 -0
  100. package/src/lib/page-route.ts +22 -0
  101. package/src/lib/preferences.tsx +46 -0
  102. package/src/options.ts +240 -0
  103. package/src/{routes → pages}/account.tsx +7 -24
  104. package/src/{routes → pages}/audit.tsx +5 -16
  105. package/src/{routes/auth.device.tsx → pages/device-login.tsx} +8 -21
  106. package/src/{routes/projects.$project.$environment.tsx → pages/environment.tsx} +43 -52
  107. package/src/{routes → pages}/login.tsx +5 -16
  108. package/src/{routes/projects.$project.index.tsx → pages/project.tsx} +38 -50
  109. package/src/{routes/projects.index.tsx → pages/projects.tsx} +2 -7
  110. package/src/{routes → pages}/settings.tsx +3 -10
  111. package/src/{routes/tokens.$token.tsx → pages/token.tsx} +6 -7
  112. package/src/{routes/tokens.index.tsx → pages/tokens.tsx} +3 -8
  113. package/src/{routes → pages}/unregistered.tsx +1 -6
  114. package/src/pages/user.tsx +10 -0
  115. package/src/{routes/users.index.tsx → pages/users.tsx} +3 -8
  116. package/src/register.ts +55 -0
  117. package/src/router.tsx +31 -62
  118. package/src/styles/globals.css +104 -46
  119. package/src/vite.ts +78 -0
  120. package/dist/client/.assetsignore +0 -2
  121. package/dist/client/_coffre/assets/account-BoLGAxbD.js +0 -2
  122. package/dist/client/_coffre/assets/account-CnnuRTDB.js +0 -1
  123. package/dist/client/_coffre/assets/affordances-CEafRJcN.js +0 -1
  124. package/dist/client/_coffre/assets/audit-CHSvKLWX.js +0 -1
  125. package/dist/client/_coffre/assets/audit-Cn4hmS4u.js +0 -2
  126. package/dist/client/_coffre/assets/auth.device-Co5vrpaA.js +0 -2
  127. package/dist/client/_coffre/assets/auth.device-DAlqWacc.js +0 -1
  128. package/dist/client/_coffre/assets/directory-H8Eh3MnS.js +0 -1
  129. package/dist/client/_coffre/assets/dist-Braunv_x.js +0 -1
  130. package/dist/client/_coffre/assets/globals-CpMrgkV6.css +0 -1
  131. package/dist/client/_coffre/assets/grants-DPDxJXU1.js +0 -1
  132. package/dist/client/_coffre/assets/icons-Dc_-t0lp.js +0 -1
  133. package/dist/client/_coffre/assets/index-sUCIXRgJ.js +0 -12
  134. package/dist/client/_coffre/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
  135. package/dist/client/_coffre/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
  136. package/dist/client/_coffre/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
  137. package/dist/client/_coffre/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
  138. package/dist/client/_coffre/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
  139. package/dist/client/_coffre/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
  140. package/dist/client/_coffre/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
  141. package/dist/client/_coffre/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
  142. package/dist/client/_coffre/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  143. package/dist/client/_coffre/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  144. package/dist/client/_coffre/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  145. package/dist/client/_coffre/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  146. package/dist/client/_coffre/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  147. package/dist/client/_coffre/assets/link-DBINMwm6.js +0 -1
  148. package/dist/client/_coffre/assets/login-BZFYfL1Y.js +0 -1
  149. package/dist/client/_coffre/assets/login-CYCKWTOD.js +0 -2
  150. package/dist/client/_coffre/assets/offboarding-Bwpftp3g.js +0 -1
  151. package/dist/client/_coffre/assets/page-C_hnzdaR.js +0 -1
  152. package/dist/client/_coffre/assets/preload-helper-CLkO85Nq.js +0 -1
  153. package/dist/client/_coffre/assets/principal-page-DLho8TSJ.js +0 -1
  154. package/dist/client/_coffre/assets/project-environments-CfIH5kFM.js +0 -1
  155. package/dist/client/_coffre/assets/projects._project._environment-DHRRvQw0.js +0 -3
  156. package/dist/client/_coffre/assets/projects._project._environment-TLI-RjBZ.js +0 -2
  157. package/dist/client/_coffre/assets/projects._project.index-BO-8FZIY.js +0 -2
  158. package/dist/client/_coffre/assets/projects._project.index-DGl921dP.js +0 -1
  159. package/dist/client/_coffre/assets/projects.index-BDn7Bhoo.js +0 -1
  160. package/dist/client/_coffre/assets/row-state-DJ-KLamZ.js +0 -1
  161. package/dist/client/_coffre/assets/settings-q9G1QvR_.js +0 -1
  162. package/dist/client/_coffre/assets/signin-errors-CroZWZgm.js +0 -1
  163. package/dist/client/_coffre/assets/suspense-O8sP0mEC.js +0 -1
  164. package/dist/client/_coffre/assets/tokens._token-B_qczpT9.js +0 -2
  165. package/dist/client/_coffre/assets/tokens._token-T-sqwMbz.js +0 -2
  166. package/dist/client/_coffre/assets/tokens.index-CcXSZnAG.js +0 -1
  167. package/dist/client/_coffre/assets/ui-BXP2IqrW.js +0 -46
  168. package/dist/client/_coffre/assets/unregistered-D2JXJ90x.js +0 -1
  169. package/dist/client/_coffre/assets/use-action-BpzKWhgg.js +0 -1
  170. package/dist/client/_coffre/assets/use-change-CKj3Inq9.js +0 -1
  171. package/dist/client/_coffre/assets/use-shell-W0SusPkz.js +0 -1
  172. package/dist/client/_coffre/assets/useQuery-B-lxFSES.js +0 -1
  173. package/dist/client/_coffre/assets/useSuspenseQuery-BZ-nzHST.js +0 -1
  174. package/dist/client/_coffre/assets/users._user-Bb3BGYHl.js +0 -1
  175. package/dist/client/_coffre/assets/users._user-DXmvKrzE.js +0 -2
  176. package/dist/client/_coffre/assets/users.index-BvzP3qwW.js +0 -1
  177. package/dist/client/_coffre/assets/validation-9Cl_XS-l.js +0 -1
  178. package/dist/server/.vite/manifest.json +0 -668
  179. package/dist/server/_coffre/assets/_tanstack-start-manifest_v-GsKnGGRy.js +0 -162
  180. package/dist/server/_coffre/assets/account-CV-a2IU2.js +0 -329
  181. package/dist/server/_coffre/assets/account-hk6wcIXU.js +0 -162
  182. package/dist/server/_coffre/assets/async-local-storage-C10uQtMM.js +0 -3108
  183. package/dist/server/_coffre/assets/audit-C1_Ej6YB.js +0 -31
  184. package/dist/server/_coffre/assets/auth.device-6JRrWbSV.js +0 -210
  185. package/dist/server/_coffre/assets/auth.device-CLoAxC2T.js +0 -29
  186. package/dist/server/_coffre/assets/directory-B-_rqsPx.js +0 -371
  187. package/dist/server/_coffre/assets/dist-CnnV3t2g.js +0 -908
  188. package/dist/server/_coffre/assets/empty-plugin-adapters-Cq4--YW-.js +0 -5
  189. package/dist/server/_coffre/assets/globals-CpMrgkV6.css +0 -1
  190. package/dist/server/_coffre/assets/icons-DOFT-eWB.js +0 -1704
  191. package/dist/server/_coffre/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
  192. package/dist/server/_coffre/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
  193. package/dist/server/_coffre/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
  194. package/dist/server/_coffre/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
  195. package/dist/server/_coffre/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
  196. package/dist/server/_coffre/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
  197. package/dist/server/_coffre/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
  198. package/dist/server/_coffre/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
  199. package/dist/server/_coffre/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  200. package/dist/server/_coffre/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  201. package/dist/server/_coffre/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  202. package/dist/server/_coffre/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  203. package/dist/server/_coffre/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  204. package/dist/server/_coffre/assets/lazyRouteComponent-CqBNCGuZ.js +0 -480
  205. package/dist/server/_coffre/assets/link-42ZWdjzZ.js +0 -422
  206. package/dist/server/_coffre/assets/login-DRKUKkaW.js +0 -22
  207. package/dist/server/_coffre/assets/login-DnwxVl4Y.js +0 -102
  208. package/dist/server/_coffre/assets/matchContext-qLfYbC6_.js +0 -56
  209. package/dist/server/_coffre/assets/page-D6n45dcK.js +0 -3561
  210. package/dist/server/_coffre/assets/projects._project._environment-CS8DdSMY.js +0 -48
  211. package/dist/server/_coffre/assets/projects._project.index-BGfcNpj0.js +0 -23
  212. package/dist/server/_coffre/assets/react-dom-bBoJXlK2.js +0 -1718
  213. package/dist/server/_coffre/assets/router-9BTgJhWG.js +0 -2322
  214. package/dist/server/_coffre/assets/start-DR3rN0St.js +0 -4
  215. package/dist/server/_coffre/assets/suspense-C-2QfDd2.js +0 -602
  216. package/dist/server/_coffre/assets/tokens._token-rY86Cjgp.js +0 -10
  217. package/dist/server/_coffre/assets/tokens.index-Bq5qDW9q.js +0 -37
  218. package/dist/server/_coffre/assets/ui-Cc0CGMtr.js +0 -14881
  219. package/dist/server/_coffre/assets/unregistered-D9ZKLOPJ.js +0 -53
  220. package/dist/server/_coffre/assets/use-shell-DwOzEi87.js +0 -462
  221. package/dist/server/_coffre/assets/useQuery-CTe86qFq.js +0 -8
  222. package/dist/server/_coffre/assets/useRouter-CaUSUNsw.js +0 -473
  223. package/dist/server/_coffre/assets/useSuspenseQuery-CSoHzrMb.js +0 -117
  224. package/dist/server/_coffre/assets/users._user-BmLKYeo_.js +0 -10
  225. package/dist/server/_coffre/assets/users._user-BmiHwQx3.js +0 -14
  226. package/dist/server/_coffre/assets/users.index-BiEax90r.js +0 -37
  227. package/dist/server/index.js +0 -13911
  228. package/src/assets/favicon-32.png +0 -0
  229. package/src/components/agentation.tsx +0 -34
  230. package/src/entry.ts +0 -19
  231. package/src/routeTree.gen.ts +0 -367
  232. package/src/routes/__root.tsx +0 -169
  233. package/src/routes/access.tsx +0 -11
  234. package/src/routes/index.tsx +0 -15
  235. package/src/routes/users.$user.tsx +0 -13
  236. package/src/types.ts +0 -21
@@ -1,162 +0,0 @@
1
- //#region \0tanstack-start-manifest:v
2
- var tsrStartManifest = () => ({ routes: {
3
- __root__: {
4
- filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/__root.tsx",
5
- children: [
6
- "/",
7
- "/access",
8
- "/account",
9
- "/audit",
10
- "/login",
11
- "/settings",
12
- "/unregistered",
13
- "/auth/device",
14
- "/tokens/$token",
15
- "/users/$user",
16
- "/projects/",
17
- "/tokens/",
18
- "/users/",
19
- "/projects/$project/$environment",
20
- "/projects/$project/"
21
- ],
22
- preloads: [
23
- "/_coffre/assets/index-sUCIXRgJ.js",
24
- "/_coffre/assets/page-C_hnzdaR.js",
25
- "/_coffre/assets/link-DBINMwm6.js",
26
- "/_coffre/assets/preload-helper-CLkO85Nq.js",
27
- "/_coffre/assets/suspense-O8sP0mEC.js",
28
- "/_coffre/assets/use-shell-W0SusPkz.js",
29
- "/_coffre/assets/dist-Braunv_x.js",
30
- "/_coffre/assets/ui-BXP2IqrW.js",
31
- "/_coffre/assets/project-environments-CfIH5kFM.js",
32
- "/_coffre/assets/affordances-CEafRJcN.js",
33
- "/_coffre/assets/icons-Dc_-t0lp.js",
34
- "/_coffre/assets/account-BoLGAxbD.js",
35
- "/_coffre/assets/row-state-DJ-KLamZ.js",
36
- "/_coffre/assets/audit-Cn4hmS4u.js",
37
- "/_coffre/assets/login-CYCKWTOD.js",
38
- "/_coffre/assets/auth.device-Co5vrpaA.js",
39
- "/_coffre/assets/tokens._token-B_qczpT9.js",
40
- "/_coffre/assets/users._user-DXmvKrzE.js",
41
- "/_coffre/assets/projects._project.index-BO-8FZIY.js",
42
- "/_coffre/assets/projects._project._environment-TLI-RjBZ.js"
43
- ],
44
- scripts: [{ attrs: {
45
- type: "module",
46
- async: !0,
47
- src: "/_coffre/assets/index-sUCIXRgJ.js"
48
- } }]
49
- },
50
- "/account": {
51
- filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/account.tsx",
52
- children: void 0,
53
- preloads: [
54
- "/_coffre/assets/account-CnnuRTDB.js",
55
- "/_coffre/assets/use-change-CKj3Inq9.js",
56
- "/_coffre/assets/directory-H8Eh3MnS.js",
57
- "/_coffre/assets/signin-errors-CroZWZgm.js"
58
- ]
59
- },
60
- "/audit": {
61
- filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/audit.tsx",
62
- children: void 0,
63
- preloads: [
64
- "/_coffre/assets/audit-CHSvKLWX.js",
65
- "/_coffre/assets/useSuspenseQuery-BZ-nzHST.js",
66
- "/_coffre/assets/useQuery-B-lxFSES.js"
67
- ]
68
- },
69
- "/login": {
70
- filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/login.tsx",
71
- children: void 0,
72
- preloads: ["/_coffre/assets/login-BZFYfL1Y.js", "/_coffre/assets/signin-errors-CroZWZgm.js"]
73
- },
74
- "/settings": {
75
- filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/settings.tsx",
76
- children: void 0,
77
- preloads: ["/_coffre/assets/settings-q9G1QvR_.js", "/_coffre/assets/useSuspenseQuery-BZ-nzHST.js"]
78
- },
79
- "/unregistered": {
80
- filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/unregistered.tsx",
81
- children: void 0,
82
- preloads: ["/_coffre/assets/unregistered-D2JXJ90x.js"]
83
- },
84
- "/auth/device": {
85
- filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/auth.device.tsx",
86
- children: void 0,
87
- preloads: ["/_coffre/assets/auth.device-DAlqWacc.js"]
88
- },
89
- "/tokens/$token": {
90
- filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/tokens.$token.tsx",
91
- children: void 0,
92
- preloads: [
93
- "/_coffre/assets/tokens._token-T-sqwMbz.js",
94
- "/_coffre/assets/use-change-CKj3Inq9.js",
95
- "/_coffre/assets/useSuspenseQuery-BZ-nzHST.js",
96
- "/_coffre/assets/use-action-BpzKWhgg.js",
97
- "/_coffre/assets/principal-page-DLho8TSJ.js"
98
- ]
99
- },
100
- "/users/$user": {
101
- filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/users.$user.tsx",
102
- children: void 0,
103
- preloads: ["/_coffre/assets/users._user-Bb3BGYHl.js", "/_coffre/assets/principal-page-DLho8TSJ.js"]
104
- },
105
- "/projects/": {
106
- filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/projects.index.tsx",
107
- children: void 0,
108
- preloads: [
109
- "/_coffre/assets/projects.index-BDn7Bhoo.js",
110
- "/_coffre/assets/use-change-CKj3Inq9.js",
111
- "/_coffre/assets/useSuspenseQuery-BZ-nzHST.js",
112
- "/_coffre/assets/validation-9Cl_XS-l.js"
113
- ]
114
- },
115
- "/tokens/": {
116
- filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/tokens.index.tsx",
117
- children: void 0,
118
- preloads: [
119
- "/_coffre/assets/tokens.index-CcXSZnAG.js",
120
- "/_coffre/assets/useSuspenseQuery-BZ-nzHST.js",
121
- "/_coffre/assets/directory-H8Eh3MnS.js",
122
- "/_coffre/assets/offboarding-Bwpftp3g.js"
123
- ]
124
- },
125
- "/users/": {
126
- filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/users.index.tsx",
127
- children: void 0,
128
- preloads: [
129
- "/_coffre/assets/users.index-BvzP3qwW.js",
130
- "/_coffre/assets/useSuspenseQuery-BZ-nzHST.js",
131
- "/_coffre/assets/directory-H8Eh3MnS.js",
132
- "/_coffre/assets/offboarding-Bwpftp3g.js"
133
- ]
134
- },
135
- "/projects/$project/$environment": {
136
- filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/projects.$project.$environment.tsx",
137
- children: void 0,
138
- preloads: [
139
- "/_coffre/assets/projects._project._environment-DHRRvQw0.js",
140
- "/_coffre/assets/use-change-CKj3Inq9.js",
141
- "/_coffre/assets/useSuspenseQuery-BZ-nzHST.js",
142
- "/_coffre/assets/use-action-BpzKWhgg.js",
143
- "/_coffre/assets/validation-9Cl_XS-l.js"
144
- ]
145
- },
146
- "/projects/$project/": {
147
- filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/projects.$project.index.tsx",
148
- children: void 0,
149
- preloads: [
150
- "/_coffre/assets/projects._project.index-DGl921dP.js",
151
- "/_coffre/assets/use-change-CKj3Inq9.js",
152
- "/_coffre/assets/useSuspenseQuery-BZ-nzHST.js",
153
- "/_coffre/assets/useQuery-B-lxFSES.js",
154
- "/_coffre/assets/directory-H8Eh3MnS.js",
155
- "/_coffre/assets/use-action-BpzKWhgg.js",
156
- "/_coffre/assets/validation-9Cl_XS-l.js",
157
- "/_coffre/assets/grants-DPDxJXU1.js"
158
- ]
159
- }
160
- } });
161
- //#endregion
162
- export { tsrStartManifest };
@@ -1,329 +0,0 @@
1
- import { i as require_react, r as require_jsx_runtime, s as __toESM } from "./useRouter-CaUSUNsw.js";
2
- import { C as useCoffre, h as queries, i as PageHeader, r as Fact, t as Card } from "./page-D6n45dcK.js";
3
- import { C as unlinkIdentity, n as useChangeStatus, t as useChange, u as endSession } from "./use-change-C8BCf3oU.js";
4
- import { n as useSuspenseQueries, t as useShell } from "./use-shell-DwOzEi87.js";
5
- import { a as ErrorLine, i as EmptyState, l as Timestamp, s as Notice, t as ConfirmButton } from "./ui-Cc0CGMtr.js";
6
- import { B as Terminal, E as Monitor, G as X, L as SignOut, M as ProviderMark } from "./icons-DOFT-eWB.js";
7
- import { n as ThemeCards, t as Route } from "./account-hk6wcIXU.js";
8
- import { a as rowClass, i as RowPending, r as RowFailure } from "./row-state-C2P57xT1.js";
9
- import { r as InstanceRole } from "./directory-B-_rqsPx.js";
10
- import { t as signinErrorMessage } from "./signin-errors-BEFlVDbQ.js";
11
- //#region src/routes/account.tsx?tsr-split=component
12
- /**
13
- * Your own settings: how coffre looks here, who it takes you for and, when
14
- * coffre runs its own sign-in, which accounts you sign in with and where you
15
- * are signed in. The sidebar's Settings is the instance's; this page is
16
- * reached from your account at the sidebar's foot.
17
- */
18
- var import_react = /* @__PURE__ */ __toESM(require_react());
19
- var import_jsx_runtime = require_jsx_runtime();
20
- function AccountPage() {
21
- const { principal, instanceRole, auth } = useShell();
22
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
23
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PageHeader, {
24
- title: "Account",
25
- actions: principal !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SignOutButton, {})
26
- }),
27
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Card, {
28
- labelledBy: "appearance",
29
- title: "Appearance",
30
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
31
- className: "card-body",
32
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeCards, {})
33
- })
34
- }),
35
- principal !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Card, {
36
- labelledBy: "identity",
37
- title: "Identity",
38
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", {
39
- className: "facts",
40
- children: [
41
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fact, {
42
- label: principal.type === "user" ? "Email" : "Name",
43
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
44
- className: "mono",
45
- children: principal.id
46
- })
47
- }),
48
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fact, {
49
- label: "Kind",
50
- children: principal.type === "user" ? "User" : "Token"
51
- }),
52
- principal.type === "user" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fact, {
53
- label: "Instance role",
54
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InstanceRole, { principal: {
55
- principalType: "user",
56
- principalId: principal.id,
57
- instanceRole: instanceRole ?? "user",
58
- isRootAdmin: instanceRole === "root-admin"
59
- } })
60
- })
61
- ]
62
- })
63
- }),
64
- auth.signin !== null && principal?.type === "user" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SignIn, {
65
- email: principal.id,
66
- providers: auth.signin.providers
67
- })
68
- ] });
69
- }
70
- /** Which accounts you sign in with, and where you are signed in. */
71
- function SignIn({ email, providers }) {
72
- const client = useCoffre();
73
- const [{ data: identities }, { data: sessions }] = useSuspenseQueries({ queries: [queries.identities(client), queries.sessions(client)] });
74
- if (!identities.ok) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorLine, { error: identities.error });
75
- if (!sessions.ok) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorLine, { error: sessions.error });
76
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SigninAccounts, {
77
- email,
78
- providers,
79
- identities: identities.identities
80
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Sessions, {
81
- sessions: sessions.sessions,
82
- providers
83
- })] });
84
- }
85
- /**
86
- * Sign-out is a form post: a GET could be triggered by any image tag on any
87
- * page, and the server's origin check covers form posts.
88
- */
89
- function SignOutButton() {
90
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("form", {
91
- method: "post",
92
- action: "/auth/signout",
93
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
94
- className: "btn",
95
- type: "submit",
96
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SignOut, { size: 14 }), "Sign out"]
97
- })
98
- });
99
- }
100
- function providerLabel(providers, id) {
101
- return providers.find((provider) => provider.id === id)?.label ?? id ?? "unknown";
102
- }
103
- function SigninAccounts({ email, providers, identities }) {
104
- const { linked, error } = Route.useSearch();
105
- const message = signinErrorMessage(error);
106
- const change = unlinkIdentity(useCoffre());
107
- const unlink = useChange(change);
108
- const { status, dismiss } = useChangeStatus(change.list.queryKey);
109
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Card, {
110
- labelledBy: "signin-accounts",
111
- title: "Sign-in accounts",
112
- description: "coffre recognises you by these accounts, never by an email address alone. A new account is linked here, while you are signed in.",
113
- children: [
114
- (linked !== void 0 || message !== null) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
115
- className: "card-body",
116
- children: [linked !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Notice, {
117
- tone: "good",
118
- children: [providerLabel(providers, linked), " account linked."]
119
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorLine, { error: message })]
120
- }),
121
- identities.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(EmptyState, {
122
- title: "No account linked",
123
- children: [
124
- "Your next sign-in with a verified ",
125
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
126
- className: "mono",
127
- children: email
128
- }),
129
- " links that account."
130
- ]
131
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
132
- className: "dt-wrap",
133
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("table", {
134
- className: "dt",
135
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", { children: [
136
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { children: "Account" }),
137
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
138
- className: "col-shrink",
139
- children: "Linked (UTC)"
140
- }),
141
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
142
- className: "col-shrink",
143
- children: "Last sign-in"
144
- }),
145
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
146
- className: "col-actions",
147
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
148
- className: "visually-hidden",
149
- children: "Actions"
150
- })
151
- })
152
- ] }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: identities.map((identity) => {
153
- const label = providerLabel(providers, identity.provider);
154
- const brand = providers.find((p) => p.id === identity.provider)?.brand ?? "oidc";
155
- const state = status(identity.id);
156
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", {
157
- className: rowClass(state),
158
- children: [
159
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
160
- className: "cell-account",
161
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProviderMark, { brand }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
162
- className: "cell-stack",
163
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: label }), identity.email !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", {
164
- className: "mono",
165
- children: identity.email
166
- })]
167
- })]
168
- }) }),
169
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
170
- className: "nowrap",
171
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Timestamp, { iso: identity.createdAt })
172
- }),
173
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
174
- className: "nowrap cell-muted",
175
- children: identity.lastSignInAt === null ? "Never" : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Timestamp, {
176
- iso: identity.lastSignInAt,
177
- display: "relative"
178
- })
179
- }),
180
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
181
- className: "col-actions",
182
- children: state.state === "pending" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RowPending, { status: state }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConfirmButton, {
183
- trigger: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
184
- className: "act",
185
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(X, { size: 13 }), "Unlink"]
186
- }),
187
- title: `Unlink this ${label} account?`,
188
- body: identities.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
189
- "It stops signing you in, and every session it opened ends now, this one included if you signed in with it. Your next sign-in with any account whose verified email is",
190
- " ",
191
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
192
- className: "mono",
193
- children: email
194
- }),
195
- " links that account instead."
196
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: "It stops signing you in, and every session it opened ends now, this one included if you signed in with it." }),
197
- confirmLabel: "Unlink",
198
- onConfirm: () => unlink({
199
- ...identity,
200
- label
201
- })
202
- })
203
- })
204
- ]
205
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RowFailure, {
206
- status: state,
207
- columns: 4,
208
- onDismiss: () => state.state === "failed" && dismiss(state.mutationId)
209
- })] }, identity.id);
210
- }) })]
211
- })
212
- }),
213
- providers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
214
- className: "card-foot",
215
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
216
- className: "hint",
217
- children: "Link another account"
218
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
219
- className: "link-providers",
220
- children: providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("a", {
221
- className: "btn btn-sm",
222
- href: `/auth/signin/${encodeURIComponent(provider.id)}?link=1`,
223
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProviderMark, {
224
- brand: provider.brand,
225
- size: 14
226
- }), provider.label]
227
- }, provider.id))
228
- })]
229
- })
230
- ]
231
- });
232
- }
233
- function Sessions({ sessions, providers }) {
234
- const change = endSession(useCoffre());
235
- const end = useChange(change);
236
- const { status, dismiss } = useChangeStatus(change.list.queryKey);
237
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Card, {
238
- labelledBy: "sessions",
239
- title: "Sessions",
240
- description: "Browsers and command lines signed in as you. Ending one signs it out at its next request.",
241
- children: sessions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EmptyState, {
242
- title: "No sessions",
243
- children: "Nothing is signed in as you right now."
244
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
245
- className: "dt-wrap",
246
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("table", {
247
- className: "dt",
248
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", { children: [
249
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { children: "Where" }),
250
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
251
- className: "col-shrink",
252
- children: "Last active"
253
- }),
254
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
255
- className: "col-shrink",
256
- children: "Expires"
257
- }),
258
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
259
- className: "col-actions",
260
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
261
- className: "visually-hidden",
262
- children: "Actions"
263
- })
264
- })
265
- ] }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: sessions.map((session) => {
266
- const state = status(session.id);
267
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", {
268
- className: rowClass(state),
269
- children: [
270
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
271
- className: "cell-account",
272
- children: [session.kind === "cli" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Terminal, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Monitor, { size: 15 }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
273
- className: "cell-stack",
274
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
275
- session.label ?? (session.kind === "cli" ? "Command line" : "Browser"),
276
- " ",
277
- session.current && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
278
- className: "tag tag-blue",
279
- children: "this browser"
280
- })
281
- ] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("small", { children: [session.kind === "cli" ? "coffre login" : `via ${providerLabel(providers, session.provider)}`, session.lastUsedIp !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [" · ", /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
282
- className: "mono",
283
- children: session.lastUsedIp
284
- })] })] })]
285
- })]
286
- }) }),
287
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
288
- className: "nowrap cell-muted",
289
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Timestamp, {
290
- iso: session.lastUsedAt ?? session.createdAt,
291
- display: "relative"
292
- })
293
- }),
294
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
295
- className: "nowrap cell-muted",
296
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Timestamp, {
297
- iso: session.expiresAt,
298
- display: "relative"
299
- })
300
- }),
301
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
302
- className: "col-actions",
303
- children: session.current ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("form", {
304
- method: "post",
305
- action: "/auth/signout",
306
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
307
- className: "act",
308
- type: "submit",
309
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SignOut, { size: 13 }), "Sign out"]
310
- })
311
- }) : state.state === "pending" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RowPending, { status: state }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
312
- className: "act",
313
- onClick: () => end(session),
314
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(X, { size: 13 }), "End"]
315
- })
316
- })
317
- ]
318
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RowFailure, {
319
- status: state,
320
- columns: 4,
321
- onDismiss: () => state.state === "failed" && dismiss(state.mutationId)
322
- })] }, session.id);
323
- }) })]
324
- })
325
- })
326
- });
327
- }
328
- //#endregion
329
- export { AccountPage as component };
@@ -1,162 +0,0 @@
1
- import { i as require_react, r as require_jsx_runtime, s as __toESM } from "./useRouter-CaUSUNsw.js";
2
- import { n as createFileRoute, t as lazyRouteComponent } from "./lazyRouteComponent-CqBNCGuZ.js";
3
- import { f as loadShell, h as queries } from "./page-D6n45dcK.js";
4
- import { h as dropdown_menu_exports } from "./ui-Cc0CGMtr.js";
5
- import { D as Moon, E as Monitor, a as Check, z as Sun } from "./icons-DOFT-eWB.js";
6
- //#region src/components/theme.tsx
7
- var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
8
- var import_jsx_runtime = require_jsx_runtime();
9
- var STORAGE_KEY = "coffre-theme";
10
- var CHANGE_EVENT = "coffre-theme-change";
11
- /**
12
- * Applied before first paint, inlined in <head>.
13
- *
14
- * Without this the page renders in the system palette and then snaps to the
15
- * stored choice once React hydrates -- a full-screen flash on every load for
16
- * anyone who overrode it. Kept as a string so it runs synchronously; there is
17
- * no way to do this correctly from a component.
18
- */
19
- var themeBootScript = `(function(){try{var t=localStorage.getItem(${JSON.stringify(STORAGE_KEY)});if(t==="light"||t==="dark"){document.documentElement.setAttribute("data-theme",t)}}catch(e){}})()`;
20
- function stored() {
21
- try {
22
- const value = localStorage.getItem(STORAGE_KEY);
23
- return value === "light" || value === "dark" ? value : "system";
24
- } catch {
25
- return "system";
26
- }
27
- }
28
- function apply(theme) {
29
- const root = document.documentElement;
30
- try {
31
- if (theme === "system") localStorage.removeItem(STORAGE_KEY);
32
- else localStorage.setItem(STORAGE_KEY, theme);
33
- } catch {}
34
- if (theme === "system") root.removeAttribute("data-theme");
35
- else root.setAttribute("data-theme", theme);
36
- window.dispatchEvent(new CustomEvent(CHANGE_EVENT));
37
- }
38
- var OPTIONS = [
39
- {
40
- value: "system",
41
- label: "Match system",
42
- Icon: Monitor
43
- },
44
- {
45
- value: "light",
46
- label: "Light",
47
- Icon: Sun
48
- },
49
- {
50
- value: "dark",
51
- label: "Dark",
52
- Icon: Moon
53
- }
54
- ];
55
- /**
56
- * The stored choice, kept in step with changes made elsewhere (the command
57
- * palette, another tab).
58
- *
59
- * Server-rendered markup cannot know the stored preference, so it starts on
60
- * "system" and corrects itself on mount. Any other approach hydration-mismatches.
61
- */
62
- function useTheme() {
63
- const [theme, setThemeState] = (0, import_react.useState)("system");
64
- (0, import_react.useEffect)(() => {
65
- const sync = () => setThemeState(stored());
66
- sync();
67
- window.addEventListener(CHANGE_EVENT, sync);
68
- window.addEventListener("storage", sync);
69
- return () => {
70
- window.removeEventListener(CHANGE_EVENT, sync);
71
- window.removeEventListener("storage", sync);
72
- };
73
- }, []);
74
- return theme;
75
- }
76
- /** The theme as a radio group inside a dropdown menu (the account menu). */
77
- function ThemeMenuItems() {
78
- const theme = useTheme();
79
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(dropdown_menu_exports.RadioGroup, {
80
- value: theme,
81
- onValueChange: (value) => apply(value),
82
- children: OPTIONS.map(({ value, label, Icon }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(dropdown_menu_exports.RadioItem, {
83
- value,
84
- className: "menu-item",
85
- children: [
86
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { size: 15 }),
87
- label,
88
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(dropdown_menu_exports.ItemIndicator, {
89
- className: "menu-check",
90
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { size: 14 })
91
- })
92
- ]
93
- }, value))
94
- });
95
- }
96
- /**
97
- * Three glyphs, one of them pressed, for pages without the account menu.
98
- * A menu for a three-way choice costs a click to find out the current value.
99
- */
100
- function ThemeToggle() {
101
- const theme = useTheme();
102
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
103
- className: "theme-choice",
104
- role: "group",
105
- "aria-label": "Colour scheme",
106
- children: OPTIONS.map(({ value, label, Icon }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
107
- type: "button",
108
- "aria-pressed": theme === value,
109
- "aria-label": label,
110
- title: label,
111
- onClick: () => apply(value),
112
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { size: 14 })
113
- }, value))
114
- });
115
- }
116
- /** Imperative theme setter, so the command palette can offer the same options. */
117
- function setTheme(theme) {
118
- apply(theme);
119
- }
120
- /** The theme as three large choices, for the Settings page. */
121
- function ThemeCards() {
122
- const theme = useTheme();
123
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
124
- className: "choice-grid",
125
- role: "group",
126
- "aria-label": "Colour scheme",
127
- children: OPTIONS.map(({ value, label, Icon }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
128
- type: "button",
129
- className: "choice",
130
- "aria-pressed": theme === value,
131
- onClick: () => apply(value),
132
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { size: 16 }), label]
133
- }, value))
134
- });
135
- }
136
- //#endregion
137
- //#region src/routes/account.tsx
138
- var $$splitComponentImporter = () => import("./account-CV-a2IU2.js");
139
- /**
140
- * Your own settings: how coffre looks here, who it takes you for and, when
141
- * coffre runs its own sign-in, which accounts you sign in with and where you
142
- * are signed in. The sidebar's Settings is the instance's; this page is
143
- * reached from your account at the sidebar's foot.
144
- */
145
- var Route = createFileRoute("/account")({
146
- validateSearch: (search) => {
147
- const out = {};
148
- for (const name of ["linked", "error"]) {
149
- const value = search[name];
150
- if (typeof value === "string" && /^[a-z0-9_-]{1,40}$/.test(value)) out[name] = value;
151
- }
152
- return out;
153
- },
154
- loader: async ({ context: { client, queryClient } }) => {
155
- const shell = await loadShell(queryClient, client);
156
- if (shell.auth.signin === null || shell.principal?.type !== "user") return;
157
- await Promise.all([queryClient.fetchQuery(queries.identities(client)), queryClient.fetchQuery(queries.sessions(client))]);
158
- },
159
- component: lazyRouteComponent($$splitComponentImporter, "component")
160
- });
161
- //#endregion
162
- export { setTheme as a, ThemeToggle as i, ThemeCards as n, themeBootScript as o, ThemeMenuItems as r, Route as t };