@eifi1/ui-kit 0.29.0 → 0.31.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 (307) hide show
  1. package/README.md +65 -6
  2. package/dist/account/account-parts.d.ts +21 -0
  3. package/dist/account/account-parts.js +40 -0
  4. package/dist/account/account-parts.js.map +1 -0
  5. package/dist/account/data-export-setting.d.ts +73 -0
  6. package/dist/account/data-export-setting.js +114 -0
  7. package/dist/account/data-export-setting.js.map +1 -0
  8. package/dist/account/delete-account-setting.d.ts +95 -0
  9. package/dist/account/delete-account-setting.js +200 -0
  10. package/dist/account/delete-account-setting.js.map +1 -0
  11. package/dist/account/email-change-setting.d.ts +136 -0
  12. package/dist/account/email-change-setting.js +278 -0
  13. package/dist/account/email-change-setting.js.map +1 -0
  14. package/dist/account/sessions-setting.d.ts +110 -0
  15. package/dist/account/sessions-setting.js +147 -0
  16. package/dist/account/sessions-setting.js.map +1 -0
  17. package/dist/admin/admin-action-confirm.d.ts +95 -0
  18. package/dist/admin/admin-action-confirm.js +276 -0
  19. package/dist/admin/admin-action-confirm.js.map +1 -0
  20. package/dist/admin/admin-action-log.d.ts +105 -0
  21. package/dist/admin/admin-action-log.js +153 -0
  22. package/dist/admin/admin-action-log.js.map +1 -0
  23. package/dist/admin/admin-parts.d.ts +40 -0
  24. package/dist/admin/admin-parts.js +45 -0
  25. package/dist/admin/admin-parts.js.map +1 -0
  26. package/dist/admin/invitations-panel.d.ts +95 -0
  27. package/dist/admin/invitations-panel.js +290 -0
  28. package/dist/admin/invitations-panel.js.map +1 -0
  29. package/dist/admin/reviewer-scope-editor.d.ts +95 -0
  30. package/dist/admin/reviewer-scope-editor.js +134 -0
  31. package/dist/admin/reviewer-scope-editor.js.map +1 -0
  32. package/dist/admin/role-select.d.ts +95 -0
  33. package/dist/admin/role-select.js +128 -0
  34. package/dist/admin/role-select.js.map +1 -0
  35. package/dist/admin/transfer-ownership-dialog.d.ts +95 -0
  36. package/dist/admin/transfer-ownership-dialog.js +83 -0
  37. package/dist/admin/transfer-ownership-dialog.js.map +1 -0
  38. package/dist/admin/user-roster.d.ts +95 -0
  39. package/dist/admin/user-roster.js +285 -0
  40. package/dist/admin/user-roster.js.map +1 -0
  41. package/dist/auth/auth-errors.d.ts +103 -6
  42. package/dist/auth/auth-errors.js +68 -2
  43. package/dist/auth/auth-errors.js.map +1 -1
  44. package/dist/auth/forgot-password-form.d.ts +10 -3
  45. package/dist/auth/forgot-password-form.js +6 -3
  46. package/dist/auth/forgot-password-form.js.map +1 -1
  47. package/dist/auth/register-form.d.ts +21 -12
  48. package/dist/auth/register-form.js +6 -4
  49. package/dist/auth/register-form.js.map +1 -1
  50. package/dist/auth/reset-password-form.d.ts +10 -3
  51. package/dist/auth/reset-password-form.js +6 -3
  52. package/dist/auth/reset-password-form.js.map +1 -1
  53. package/dist/auth/sign-in-form.d.ts +75 -9
  54. package/dist/auth/sign-in-form.js +105 -15
  55. package/dist/auth/sign-in-form.js.map +1 -1
  56. package/dist/auth/verify-email.d.ts +7 -2
  57. package/dist/auth/verify-email.js +44 -8
  58. package/dist/auth/verify-email.js.map +1 -1
  59. package/dist/chart.d.ts +20 -11
  60. package/dist/components/account-chips.d.ts +47 -7
  61. package/dist/components/account-chips.js +19 -3
  62. package/dist/components/account-chips.js.map +1 -1
  63. package/dist/components/account-settings-labels.d.ts +24 -1
  64. package/dist/components/account-settings-labels.js +6 -2
  65. package/dist/components/account-settings-labels.js.map +1 -1
  66. package/dist/components/account-settings.d.ts +69 -8
  67. package/dist/components/account-settings.js +133 -25
  68. package/dist/components/account-settings.js.map +1 -1
  69. package/dist/components/amount-input.d.ts +21 -12
  70. package/dist/components/button-group.d.ts +21 -12
  71. package/dist/components/calculator.d.ts +21 -12
  72. package/dist/components/confirm-dialog.d.ts +21 -12
  73. package/dist/components/copy-button.d.ts +18 -9
  74. package/dist/components/danger-confirm.d.ts +21 -12
  75. package/dist/components/data-table.js +8 -1
  76. package/dist/components/data-table.js.map +1 -1
  77. package/dist/components/date-picker.js +9 -4
  78. package/dist/components/date-picker.js.map +1 -1
  79. package/dist/components/facing-pair.d.ts +21 -12
  80. package/dist/components/file-button.d.ts +21 -12
  81. package/dist/components/file-dropzone.d.ts +21 -12
  82. package/dist/components/form-actions.d.ts +21 -12
  83. package/dist/components/iban-input.d.ts +21 -12
  84. package/dist/components/language-select.d.ts +21 -12
  85. package/dist/components/legal-page.d.ts +21 -12
  86. package/dist/components/legal.d.ts +21 -12
  87. package/dist/components/money-field.d.ts +21 -12
  88. package/dist/components/number-field.d.ts +21 -12
  89. package/dist/components/number-input.d.ts +21 -12
  90. package/dist/components/numpad-sheet.d.ts +21 -12
  91. package/dist/components/passkeys-setting.js +2 -1
  92. package/dist/components/passkeys-setting.js.map +1 -1
  93. package/dist/components/phone-input.d.ts +21 -12
  94. package/dist/components/series-chart.d.ts +21 -12
  95. package/dist/components/settings-fields.d.ts +55 -13
  96. package/dist/components/settings-fields.js +20 -1
  97. package/dist/components/settings-fields.js.map +1 -1
  98. package/dist/components/share-card.d.ts +20 -11
  99. package/dist/components/text-link.d.ts +21 -12
  100. package/dist/components/time-input.d.ts +21 -12
  101. package/dist/components/ui.d.ts +17 -8
  102. package/dist/{register-form-V1OeNlMr.d.ts → delete-account-setting-DCFS5Vof.d.ts} +6612 -5612
  103. package/dist/demo/demo-banner.d.ts +51 -0
  104. package/dist/demo/demo-banner.js +97 -0
  105. package/dist/demo/demo-banner.js.map +1 -0
  106. package/dist/demo/demo-countdown.d.ts +58 -0
  107. package/dist/demo/demo-countdown.js +79 -0
  108. package/dist/demo/demo-countdown.js.map +1 -0
  109. package/dist/demo/demo-ended.d.ts +45 -0
  110. package/dist/demo/demo-ended.js +42 -0
  111. package/dist/demo/demo-ended.js.map +1 -0
  112. package/dist/demo/demo-labels.d.ts +53 -0
  113. package/dist/demo/demo-labels.js +29 -0
  114. package/dist/demo/demo-labels.js.map +1 -0
  115. package/dist/demo/demo-session.d.ts +30 -0
  116. package/dist/demo/demo-session.js +8 -0
  117. package/dist/demo/demo-session.js.map +1 -0
  118. package/dist/demo/demo-start.d.ts +54 -0
  119. package/dist/demo/demo-start.js +68 -0
  120. package/dist/demo/demo-start.js.map +1 -0
  121. package/dist/feedback/feedback-attachment.d.ts +21 -12
  122. package/dist/feedback/feedback-context.d.ts +21 -12
  123. package/dist/feedback/feedback-crash.d.ts +21 -12
  124. package/dist/feedback/feedback-dialog.d.ts +21 -12
  125. package/dist/feedback/feedback-inbox.d.ts +21 -12
  126. package/dist/feedback/feedback-inbox.js +12 -2
  127. package/dist/feedback/feedback-inbox.js.map +1 -1
  128. package/dist/feedback/feedback-labels.d.ts +21 -12
  129. package/dist/feedback/feedback-labels.js +1 -0
  130. package/dist/feedback/feedback-labels.js.map +1 -1
  131. package/dist/feedback/feedback-menu.d.ts +21 -12
  132. package/dist/feedback/feedback-record.d.ts +21 -12
  133. package/dist/feedback/feedback-record.js +2 -0
  134. package/dist/feedback/feedback-record.js.map +1 -1
  135. package/dist/feedback/feedback-row-detail.d.ts +21 -12
  136. package/dist/feedback/feedback-row-detail.js +7 -0
  137. package/dist/feedback/feedback-row-detail.js.map +1 -1
  138. package/dist/feedback/feedback-status-undo.d.ts +21 -12
  139. package/dist/feedback/feedback-submit.d.ts +21 -12
  140. package/dist/feedback/feedback-swipe.d.ts +22 -13
  141. package/dist/feedback/feedback-swipe.js.map +1 -1
  142. package/dist/feedback/feedback-table.d.ts +18 -9
  143. package/dist/feedback/feedback-thread.d.ts +21 -12
  144. package/dist/feedback.d.ts +21 -12
  145. package/dist/hooks/use-anchored-panel.d.ts +6 -2
  146. package/dist/hooks/use-anchored-panel.js +2 -1
  147. package/dist/hooks/use-anchored-panel.js.map +1 -1
  148. package/dist/hooks/use-file-drop.d.ts +21 -12
  149. package/dist/i18n/defaults.d.ts +21 -12
  150. package/dist/i18n/defaults.js +28 -0
  151. package/dist/i18n/defaults.js.map +1 -1
  152. package/dist/i18n/german.d.ts +21 -12
  153. package/dist/i18n/german.js +298 -12
  154. package/dist/i18n/german.js.map +1 -1
  155. package/dist/i18n/kit-labels.d.ts +14 -5
  156. package/dist/i18n/kit-labels.js.map +1 -1
  157. package/dist/i18n/languages.d.ts +15 -6
  158. package/dist/i18n/locales/de-CH.d.ts +21 -12
  159. package/dist/i18n/locales/en.d.ts +21 -12
  160. package/dist/i18n/locales/es.d.ts +21 -12
  161. package/dist/i18n/locales/es.js +287 -10
  162. package/dist/i18n/locales/es.js.map +1 -1
  163. package/dist/i18n/locales/fr.d.ts +21 -12
  164. package/dist/i18n/locales/fr.js +290 -7
  165. package/dist/i18n/locales/fr.js.map +1 -1
  166. package/dist/i18n/locales/hu.d.ts +21 -12
  167. package/dist/i18n/locales/hu.js +288 -12
  168. package/dist/i18n/locales/hu.js.map +1 -1
  169. package/dist/i18n/locales/it.d.ts +21 -12
  170. package/dist/i18n/locales/it.js +289 -7
  171. package/dist/i18n/locales/it.js.map +1 -1
  172. package/dist/i18n/locales/zh.d.ts +21 -12
  173. package/dist/i18n/locales/zh.js +279 -7
  174. package/dist/i18n/locales/zh.js.map +1 -1
  175. package/dist/i18n/review.d.ts +21 -12
  176. package/dist/i18n/review.js +50 -1
  177. package/dist/i18n/review.js.map +1 -1
  178. package/dist/index.d.ts +31 -4
  179. package/dist/index.js +148 -0
  180. package/dist/index.js.map +1 -1
  181. package/dist/landing/access.d.ts +48 -0
  182. package/dist/landing/access.js +38 -0
  183. package/dist/landing/access.js.map +1 -0
  184. package/dist/landing/landing-actions.d.ts +138 -0
  185. package/dist/landing/landing-actions.js +39 -0
  186. package/dist/landing/landing-actions.js.map +1 -0
  187. package/dist/landing/landing-labels.d.ts +43 -0
  188. package/dist/landing/landing-labels.js +23 -0
  189. package/dist/landing/landing-labels.js.map +1 -0
  190. package/dist/landing/landing-sections.d.ts +218 -0
  191. package/dist/landing/landing-sections.js +167 -0
  192. package/dist/landing/landing-sections.js.map +1 -0
  193. package/dist/landing/page-seo.d.ts +99 -0
  194. package/dist/landing/page-seo.js +121 -0
  195. package/dist/landing/page-seo.js.map +1 -0
  196. package/dist/landing/public-header.d.ts +148 -0
  197. package/dist/landing/public-header.js +49 -0
  198. package/dist/landing/public-header.js.map +1 -0
  199. package/dist/landing/routing.d.ts +218 -0
  200. package/dist/landing/routing.js +81 -0
  201. package/dist/landing/routing.js.map +1 -0
  202. package/dist/rhf/fields.d.ts +21 -12
  203. package/dist/rhf/form.d.ts +21 -12
  204. package/dist/rhf.d.ts +21 -12
  205. package/dist/settings/settings-catalogue.d.ts +84 -0
  206. package/dist/settings/settings-catalogue.js +47 -0
  207. package/dist/settings/settings-catalogue.js.map +1 -0
  208. package/dist/settings/settings-context.d.ts +31 -0
  209. package/dist/settings/settings-context.js +11 -0
  210. package/dist/settings/settings-context.js.map +1 -0
  211. package/dist/settings/settings-heading.d.ts +50 -0
  212. package/dist/settings/settings-heading.js +27 -0
  213. package/dist/settings/settings-heading.js.map +1 -0
  214. package/dist/settings/settings-labels.d.ts +41 -0
  215. package/dist/settings/settings-labels.js +38 -0
  216. package/dist/settings/settings-labels.js.map +1 -0
  217. package/dist/settings/settings-layout.d.ts +77 -0
  218. package/dist/settings/settings-layout.js +242 -0
  219. package/dist/settings/settings-layout.js.map +1 -0
  220. package/dist/settings/settings-section.d.ts +133 -0
  221. package/dist/settings/settings-section.js +63 -0
  222. package/dist/settings/settings-section.js.map +1 -0
  223. package/dist/settings/use-account-language.d.ts +83 -0
  224. package/dist/settings/use-account-language.js +62 -0
  225. package/dist/settings/use-account-language.js.map +1 -0
  226. package/dist/settings/use-settings-focus.d.ts +34 -0
  227. package/dist/settings/use-settings-focus.js +77 -0
  228. package/dist/settings/use-settings-focus.js.map +1 -0
  229. package/dist/settings/use-settings-route.d.ts +118 -0
  230. package/dist/settings/use-settings-route.js +120 -0
  231. package/dist/settings/use-settings-route.js.map +1 -0
  232. package/dist/shell/app-shell.d.ts +27 -12
  233. package/dist/shell/app-shell.js +3 -2
  234. package/dist/shell/app-shell.js.map +1 -1
  235. package/dist/shell/top-bar-brand.d.ts +21 -12
  236. package/dist/shell.d.ts +25 -6
  237. package/dist/shell.js +56 -0
  238. package/dist/shell.js.map +1 -1
  239. package/dist/wizard/stepper-nav.d.ts +21 -12
  240. package/dist/wizard.d.ts +21 -12
  241. package/package.json +2 -1
  242. package/src/account/account-parts.ts +67 -0
  243. package/src/account/data-export-setting.tsx +219 -0
  244. package/src/account/delete-account-setting.tsx +363 -0
  245. package/src/account/email-change-setting.tsx +454 -0
  246. package/src/account/sessions-setting.tsx +284 -0
  247. package/src/admin/admin-action-confirm.tsx +495 -0
  248. package/src/admin/admin-action-log.tsx +297 -0
  249. package/src/admin/admin-parts.ts +82 -0
  250. package/src/admin/invitations-panel.tsx +523 -0
  251. package/src/admin/reviewer-scope-editor.tsx +234 -0
  252. package/src/admin/role-select.tsx +286 -0
  253. package/src/admin/transfer-ownership-dialog.tsx +172 -0
  254. package/src/admin/user-roster.tsx +573 -0
  255. package/src/auth/auth-errors.ts +196 -8
  256. package/src/auth/forgot-password-form.tsx +21 -5
  257. package/src/auth/register-form.tsx +24 -6
  258. package/src/auth/reset-password-form.tsx +19 -5
  259. package/src/auth/sign-in-form.tsx +241 -38
  260. package/src/auth/verify-email.tsx +59 -8
  261. package/src/components/account-chips.tsx +64 -7
  262. package/src/components/account-settings-labels.ts +28 -1
  263. package/src/components/account-settings.tsx +231 -34
  264. package/src/components/data-table.tsx +8 -0
  265. package/src/components/date-picker.tsx +9 -4
  266. package/src/components/passkeys-setting.tsx +2 -1
  267. package/src/components/settings-fields.tsx +50 -1
  268. package/src/demo/demo-banner.tsx +159 -0
  269. package/src/demo/demo-countdown.ts +141 -0
  270. package/src/demo/demo-ended.tsx +89 -0
  271. package/src/demo/demo-labels.ts +78 -0
  272. package/src/demo/demo-session.ts +32 -0
  273. package/src/demo/demo-start.tsx +150 -0
  274. package/src/feedback/feedback-inbox.tsx +21 -8
  275. package/src/feedback/feedback-labels.ts +2 -1
  276. package/src/feedback/feedback-record.ts +10 -7
  277. package/src/feedback/feedback-row-detail.tsx +28 -4
  278. package/src/feedback/feedback-swipe.tsx +1 -1
  279. package/src/hooks/use-anchored-panel.ts +14 -3
  280. package/src/i18n/defaults.ts +28 -0
  281. package/src/i18n/german.ts +327 -5
  282. package/src/i18n/kit-labels.tsx +42 -0
  283. package/src/i18n/locales/es.ts +313 -3
  284. package/src/i18n/locales/fr.ts +316 -0
  285. package/src/i18n/locales/hu.ts +308 -5
  286. package/src/i18n/locales/it.ts +313 -0
  287. package/src/i18n/locales/zh.ts +286 -0
  288. package/src/i18n/review.ts +49 -0
  289. package/src/index.ts +184 -0
  290. package/src/landing/access.ts +97 -0
  291. package/src/landing/landing-actions.tsx +92 -0
  292. package/src/landing/landing-labels.ts +59 -0
  293. package/src/landing/landing-sections.tsx +337 -0
  294. package/src/landing/page-seo.ts +251 -0
  295. package/src/landing/public-header.tsx +120 -0
  296. package/src/landing/routing.tsx +209 -0
  297. package/src/settings/settings-catalogue.ts +132 -0
  298. package/src/settings/settings-context.ts +33 -0
  299. package/src/settings/settings-heading.tsx +65 -0
  300. package/src/settings/settings-labels.ts +75 -0
  301. package/src/settings/settings-layout.tsx +379 -0
  302. package/src/settings/settings-section.tsx +108 -0
  303. package/src/settings/use-account-language.ts +146 -0
  304. package/src/settings/use-settings-focus.ts +120 -0
  305. package/src/settings/use-settings-route.ts +258 -0
  306. package/src/shell/app-shell.tsx +10 -2
  307. package/src/shell.ts +45 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/account/email-change-setting.tsx"],"sourcesContent":["import { useEffect, useId, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, FormEvent, ReactNode } from \"react\";\nimport { MailCheck } from \"lucide-react\";\n\nimport { DEFAULT_COMMON_LABELS, useKitLabels } from \"../i18n/kit-labels\";\nimport { cn } from \"../lib/cn\";\nimport { AlertBanner } from \"../components/alert-banner\";\nimport { hasMessage } from \"../components/choice-parts\";\nimport { CurrentPasswordInput } from \"../components/danger-confirm\";\nimport { Button, Card, Input } from \"../components/ui\";\nimport { authErrorCode, englishRateLimited, isRateLimited, retryAfterSeconds } from \"../auth/auth-errors\";\nimport { emailParts, taggedEmail } from \"../auth/email-tag\";\nimport { CARD_DESCRIPTION_CLASS, settle, useMounted } from \"./account-parts\";\nimport { SettingsCardTitle } from \"../settings/settings-heading\";\n\n/* ── Labels ──────────────────────────────────────────────────────────────── */\n\n/** Every string {@link EmailChangeSetting} renders — the `emailChange` namespace of\n * `<UiKitProvider labels>`, overridable per instance through `labels`. */\nexport interface EmailChangeLabels {\n /** The card's title. */\n title: string;\n /** Names the address the account has now: \"Current address: ada@example.com\". */\n current: string;\n /** The new address's field. */\n newEmail: string;\n /** The password field. */\n password: string;\n /** Under the password field: why it is asked again. */\n passwordHint: string;\n /** The address-tag button (auth §4.5), given the exact address it would use. */\n emailTagUse: (address: string) => string;\n /** The line after the address-tag button. */\n emailTagHint: string;\n /** The submit button. */\n submit: string;\n /** Under the new address while it is the current one. */\n sameAsCurrent: string;\n /** `email_taken`, under the new address. */\n emailTaken: string;\n /** `password_incorrect`, under the password. */\n wrongPassword: string;\n /** The pending state, given the new address the link went to. */\n pending: (newEmail: string) => string;\n /** Under it, given the current address — which still signs in until the link is\n * confirmed. */\n pendingHint: (currentEmail: string) => string;\n /** Mails the link again. */\n resend: string;\n /** Said once it went. */\n resent: string;\n /** Drops the change; the current address stays. */\n cancel: string;\n /** The done state (`confirmed`), given the address the account has now. */\n confirmed: (email: string) => string;\n /** Under it (`passkeyNote`): a passkey's label in the authenticator keeps the old\n * address (§6.2). */\n passkeyNote: string;\n /** A request was throttled — HTTP 429 — given its `Retry-After` wait in seconds, or\n * `undefined` without one. */\n rateLimited: (seconds?: number) => string;\n /** Any other failure, of any of the three requests. */\n failed: string;\n}\n\nexport const DEFAULT_EMAIL_CHANGE_LABELS: EmailChangeLabels = {\n title: \"Email address\",\n current: \"Current address\",\n newEmail: \"New email address\",\n password: \"Current password\",\n passwordHint: \"Your address is how you sign in, so changing it takes your password.\",\n emailTagUse: (address) => `Use ${address}`,\n emailTagHint:\n \"Many providers deliver name+tag@… to the same inbox, so mail from this app is easy to filter and trace. Check yours does before you rely on it: you would sign in with the tagged address.\",\n submit: \"Change email address\",\n sameAsCurrent: \"This is already your address.\",\n emailTaken: \"An account with this email address already exists.\",\n wrongPassword: \"The password is incorrect.\",\n pending: (newEmail) => `Confirm the link we sent to ${newEmail}.`,\n pendingHint: (currentEmail) =>\n `Until you do, you keep signing in with ${currentEmail}. Check your spam folder too.`,\n resend: \"Send the link again\",\n resent: \"We sent the link again.\",\n cancel: \"Cancel the change\",\n confirmed: (email) => `Your email address is now ${email}.`,\n passkeyNote: \"Your passkeys keep working. Your device may still list them under your old address.\",\n rateLimited: englishRateLimited,\n failed: \"That didn’t work. Please try again.\",\n};\n\n/* ── Props ───────────────────────────────────────────────────────────────── */\n\n/** What {@link EmailChangeSettingProps.onRequest} gets: the `POST /auth/me/email` body. */\nexport interface EmailChangeValues {\n /** Trimmed. A `+tag` stays (auth §4.5); lower-casing is the server's. */\n newEmail: string;\n /** As typed. */\n password: string;\n}\n\n/** Which request failed — {@link EmailChangeSettingProps.describeError}'s second\n * argument. */\nexport type EmailChangeAction = \"request\" | \"resend\" | \"cancel\";\n\nexport interface EmailChangeSettingProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\" | \"onSubmit\"> {\n /** The account's address now. */\n currentEmail: string;\n /**\n * The address a change waits on, from the app's server state — so a reload, or\n * another tab, shows the pending state. `null`: none, whatever the card did. Left out\n * (`undefined`), the card keeps its own: pending from a resolved `onRequest` until a\n * resolved `onCancel`.\n */\n pendingEmail?: string | null;\n /**\n * The form was submitted: send `POST /auth/me/email {new_email, password}` (§6.2).\n * Resolve once the link is mailed — refresh `pendingEmail` first if the app passes\n * it — and the card shows \"Confirm the link we sent to …\". Reject with the client's\n * error: `email_taken` shows under the new address, `password_incorrect` (server-kit's\n * `400` for a wrong current password; an older `invalid_credentials` too) under the\n * password, a 429 as `rateLimited`, anything else as `failed` unless `describeError`\n * has the app's words.\n */\n onRequest: (values: EmailChangeValues) => Promise<unknown> | void;\n /** Mail the link again. Left out, no button. */\n onResend?: () => Promise<unknown> | void;\n /** Drop the pending change. Left out, no button. */\n onCancel?: () => Promise<unknown> | void;\n /**\n * The change was just confirmed — the app's confirm route (`POST /auth/me/email/confirm`)\n * came back here. Says \"Your email address is now …\" over the form, with\n * `passkeyNote`.\n */\n confirmed?: boolean;\n /** With `confirmed`: say that a passkey's label keeps the old address (§6.2). Default\n * `true`; `false` for an account without passkeys. */\n passkeyNote?: boolean;\n /**\n * The app's address tag (`\"kastlan\"`, auth §4.5): once the new address is plausible a\n * button under it offers the tagged form — the rule of `RegisterForm`, since this is\n * the person's own address. Never applied on its own. Left out, no offer.\n */\n emailTag?: string;\n /** The app's own words for a failure, or `undefined` for the kit's. Asked first, for\n * every failure (a demo account's 403, the device offline). */\n describeError?: (error: unknown, action: EmailChangeAction) => ReactNode | undefined;\n labels?: Partial<EmailChangeLabels>;\n}\n\ninterface Failure {\n action: EmailChangeAction;\n message: ReactNode;\n}\n\n/**\n * Changing the account's email address (docs/user-admin-harmonization.md §6.2, §2.5):\n * the current address, the new one, the password — then a pending state until the new\n * address confirms its link.\n *\n * **The new address must confirm before it takes effect.** The server mails a one-time\n * link to the NEW address (and a notice to the old one); until it is opened, the account\n * keeps the old address and signs in with it. So the card's answer to a request is not\n * \"changed\" but \"Confirm the link we sent to …\", with \"Send the link again\" and \"Cancel\n * the change\". The state is the server's: pass `pendingEmail` and a reload shows it too.\n *\n * **The password is asked again** because the address is the identity: whoever holds the\n * session must not move the account to a mailbox of their own. It is a\n * {@link CurrentPasswordInput}, so a password manager fills it and offers no new one.\n *\n * **The `+tag` offer** (`emailTag`) is RegisterForm's: the address is the person's own,\n * so `you+kastlan@…` is offered under the field, applied only on a click.\n *\n * **It never sends a request** (auth §8): `onRequest`, `onResend` and `onCancel` are the\n * app's, and their refusals are read by code — `email_taken` and `password_incorrect`\n * under their fields, which take the focus; a 429 as \"Too many attempts\". A wrong\n * password is a `400 password_incorrect`, never a 401: an app's client reads a 401 on a\n * signed-in route as an ended session, and would sign the person out for a typo.\n *\n * **Done** (`confirmed`): \"Your email address is now …\" and, unless `passkeyNote` is\n * off, that a passkey keeps its old label in the device's list — the authenticator\n * stored the name it was given, and only a new passkey carries the new one.\n */\nexport function EmailChangeSetting({\n currentEmail,\n pendingEmail,\n onRequest,\n onResend,\n onCancel,\n confirmed,\n passkeyNote = true,\n emailTag,\n describeError,\n labels: labelsProp,\n className,\n ...rest\n}: EmailChangeSettingProps) {\n const labels = useKitLabels(\"emailChange\", DEFAULT_EMAIL_CHANGE_LABELS, labelsProp);\n const common = useKitLabels(\"common\", DEFAULT_COMMON_LABELS);\n const [newEmail, setNewEmail] = useState(\"\");\n const [password, setPassword] = useState(\"\");\n const [ownPending, setOwnPending] = useState<string | null>(null);\n const [busy, setBusy] = useState<EmailChangeAction | null>(null);\n const [failure, setFailure] = useState<Failure | null>(null);\n // `email_taken` belongs to the address it was answered for; another one clears it.\n const [taken, setTaken] = useState<string | null>(null);\n const [wrongPassword, setWrongPassword] = useState(false);\n const [resent, setResent] = useState(false);\n const mounted = useMounted();\n const titleId = useId();\n const tagHintId = useId();\n const emailRef = useRef<HTMLInputElement>(null);\n const passwordRef = useRef<HTMLInputElement>(null);\n const pendingRef = useRef<HTMLDivElement>(null);\n\n const pending = pendingEmail !== undefined ? pendingEmail : ownPending;\n const isPending = pending !== null && pending !== \"\";\n\n // The state swapped under the button that was pressed (the form for the pending\n // message, or back): the focus goes to what came in, never down to <body>. Only after\n // the person's own request — a pending state that arrives with the page takes nothing.\n const focusNext = useRef<\"pending\" | \"form\" | null>(null);\n useEffect(() => {\n const target = focusNext.current;\n if (target === \"pending\" && isPending) {\n focusNext.current = null;\n pendingRef.current?.focus();\n } else if (target === \"form\" && !isPending) {\n focusNext.current = null;\n emailRef.current?.focus();\n }\n }, [isPending]);\n\n const messageFor = (error: unknown, action: EmailChangeAction): ReactNode => {\n const own = describeError?.(error, action);\n if (hasMessage(own)) return own;\n return isRateLimited(error) ? labels.rateLimited(retryAfterSeconds(error)) : labels.failed;\n };\n\n /* ── The pending state ── */\n if (isPending) {\n const run = (action: \"resend\" | \"cancel\", call: () => unknown) => {\n if (busy) return;\n setBusy(action);\n setFailure(null);\n setResent(false);\n settle(call).then(\n () => {\n if (!mounted.current) return;\n setBusy(null);\n if (action === \"resend\") {\n setResent(true);\n return;\n }\n focusNext.current = \"form\";\n setOwnPending(null);\n },\n (error: unknown) => {\n if (!mounted.current) return;\n setBusy(null);\n setFailure({ action, message: messageFor(error, action) });\n },\n );\n };\n return (\n <Card {...rest} data-state=\"pending\" className={cn(\"p-4 space-y-3\", className)}>\n <div>\n <SettingsCardTitle id={titleId}>{labels.title}</SettingsCardTitle>\n <div className={cn(CARD_DESCRIPTION_CLASS, \"break-all\")}>{common.fieldValue(labels.current, currentEmail)}</div>\n </div>\n {/* Focusable, not a control: the request's answer is read out when it takes the\n focus from the submit that went with the form. */}\n <div ref={pendingRef} tabIndex={-1} className=\"flex gap-2 outline-none\">\n <MailCheck aria-hidden className=\"mt-0.5 size-4 shrink-0 text-[var(--success)]\" />\n <div className=\"min-w-0 space-y-1\">\n <p className=\"break-words text-sm\">{labels.pending(pending)}</p>\n <p className={CARD_DESCRIPTION_CLASS}>{labels.pendingHint(currentEmail)}</p>\n </div>\n </div>\n {(onResend || onCancel) && (\n <div className=\"flex flex-wrap items-center gap-2\">\n {onResend && (\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n commit\n pending={busy === \"resend\"}\n disabled={busy === \"cancel\"}\n onClick={() => run(\"resend\", onResend)}\n >\n {labels.resend}\n </Button>\n )}\n {onCancel && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n commit\n pending={busy === \"cancel\"}\n disabled={busy === \"resend\"}\n onClick={() => run(\"cancel\", onCancel)}\n >\n {labels.cancel}\n </Button>\n )}\n {/* Always in the tree, so the \"sent again\" that appears in it is announced\n (VerifyEmailStatus's resend line). */}\n <span role=\"status\" className=\"text-xs text-[var(--success)]\">\n {resent ? labels.resent : null}\n </span>\n </div>\n )}\n {failure && (\n <AlertBanner tone=\"danger\" size=\"sm\" role=\"alert\">\n {failure.message}\n </AlertBanner>\n )}\n </Card>\n );\n }\n\n /* ── The form ── */\n const typed = newEmail.trim();\n const same = typed !== \"\" && typed.toLowerCase() === currentEmail.trim().toLowerCase();\n const working = busy !== null;\n const canSubmit = emailParts(newEmail) !== null && !same && password !== \"\";\n const suggestion = emailTag ? taggedEmail(newEmail, emailTag) : null;\n const emailError = same ? labels.sameAsCurrent : taken !== null && taken === typed ? labels.emailTaken : undefined;\n\n const submit = (e: FormEvent) => {\n e.preventDefault();\n if (!canSubmit || working) return;\n const values: EmailChangeValues = { newEmail: typed, password };\n setBusy(\"request\");\n setFailure(null);\n setTaken(null);\n setWrongPassword(false);\n settle(() => onRequest(values)).then(\n () => {\n if (!mounted.current) return;\n setBusy(null);\n // The password has done its work; nothing of the form stays in state.\n setNewEmail(\"\");\n setPassword(\"\");\n setResent(false);\n focusNext.current = \"pending\";\n setOwnPending(values.newEmail);\n },\n (error: unknown) => {\n if (!mounted.current) return;\n setBusy(null);\n const own = describeError?.(error, \"request\");\n if (hasMessage(own)) {\n setFailure({ action: \"request\", message: own });\n return;\n }\n if (isRateLimited(error)) {\n setFailure({ action: \"request\", message: labels.rateLimited(retryAfterSeconds(error)) });\n return;\n }\n const code = authErrorCode(error);\n if (code === \"email_taken\") {\n setTaken(values.newEmail);\n emailRef.current?.focus();\n return;\n }\n // `invalid_credentials` too, for a server that answered a wrong password so\n // before server-kit 0.4.0 named `password_incorrect`.\n if (code === \"password_incorrect\" || code === \"invalid_credentials\") {\n setWrongPassword(true);\n passwordRef.current?.focus();\n return;\n }\n setFailure({ action: \"request\", message: labels.failed });\n },\n );\n };\n\n return (\n <Card {...rest} data-state={confirmed ? \"confirmed\" : \"form\"} className={cn(\"p-4 space-y-3\", className)}>\n <div>\n <SettingsCardTitle id={titleId}>{labels.title}</SettingsCardTitle>\n <div className={cn(CARD_DESCRIPTION_CLASS, \"break-all\")}>{common.fieldValue(labels.current, currentEmail)}</div>\n </div>\n {confirmed && (\n <AlertBanner tone=\"success\" size=\"sm\">\n <span className=\"block\">{labels.confirmed(currentEmail)}</span>\n {passkeyNote && <span className=\"mt-1 block\">{labels.passkeyNote}</span>}\n </AlertBanner>\n )}\n <form className=\"space-y-3\" aria-labelledby={titleId} onSubmit={submit} noValidate>\n <div>\n <Input\n ref={emailRef}\n type=\"email\"\n name=\"email\"\n autoComplete=\"email\"\n label={labels.newEmail}\n value={newEmail}\n onChange={(e) => {\n setNewEmail(e.target.value);\n if (failure) setFailure(null);\n }}\n readOnly={working}\n error={emailError}\n required\n />\n {/* RegisterForm's offer (auth §4.5): one click, the exact address on the\n button, reversible by typing. */}\n {suggestion && (\n <p className=\"mt-1 text-xs text-[var(--text-muted)]\">\n <Button\n type=\"button\"\n variant=\"link\"\n size=\"sm\"\n className=\"h-auto p-0 align-baseline\"\n disabled={working}\n aria-describedby={tagHintId}\n onClick={() => setNewEmail(suggestion)}\n >\n {labels.emailTagUse(suggestion)}\n </Button>{\" \"}\n <span id={tagHintId}>{labels.emailTagHint}</span>\n </p>\n )}\n </div>\n <CurrentPasswordInput\n ref={passwordRef}\n name=\"password\"\n label={labels.password}\n value={password}\n onValueChange={(next) => {\n setPassword(next);\n setWrongPassword(false);\n if (failure) setFailure(null);\n }}\n hint={labels.passwordHint}\n error={wrongPassword ? labels.wrongPassword : undefined}\n busy={working}\n required\n />\n {failure && (\n <AlertBanner tone=\"danger\" size=\"sm\" role=\"alert\">\n {failure.message}\n </AlertBanner>\n )}\n <Button type=\"submit\" commit disabled={!working && !canSubmit} pending={working}>\n {labels.submit}\n </Button>\n </form>\n </Card>\n );\n}\n"],"mappings":";AAyQQ,SACE,KADF;AAzQR,SAAS,WAAW,OAAO,QAAQ,gBAAgB;AAE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Q;AAAA;AAAA,QACV;AAAA,QAGC,cACC,qBAAC,OAAE,WAAU,yCACX;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,WAAU;AAAA,cACV,UAAU;AAAA,cACV,oBAAkB;AAAA,cAClB,SAAS,MAAM,YAAY,UAAU;AAAA,cAEpC,iBAAO,YAAY,UAAU;AAAA;AAAA,UAChC;AAAA,UAAU;AAAA,UACV,oBAAC,UAAK,IAAI,WAAY,iBAAO,cAAa;AAAA,WAC5C;AAAA,SAEJ;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,KAAK;AAAA,UACL,MAAK;AAAA,UACL,OAAO,OAAO;AAAA,UACd,OAAO;AAAA,UACP,eAAe,CAAC,SAAS;AACvB,wBAAY,IAAI;AAChB,6BAAiB,KAAK;AACtB,gBAAI,QAAS,YAAW,IAAI;AAAA,UAC9B;AAAA,UACA,MAAM,OAAO;AAAA,UACb,OAAO,gBAAgB,OAAO,gBAAgB;AAAA,UAC9C,MAAM;AAAA,UACN,UAAQ;AAAA;AAAA,MACV;AAAA,MACC,WACC,oBAAC,eAAY,MAAK,UAAS,MAAK,MAAK,MAAK,SACvC,kBAAQ,SACX;AAAA,MAEF,oBAAC,UAAO,MAAK,UAAS,QAAM,MAAC,UAAU,CAAC,WAAW,CAAC,WAAW,SAAS,SACrE,iBAAO,QACV;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,110 @@
1
+ import * as react from 'react';
2
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
3
+ import { DateInput } from '../lib/format.js';
4
+
5
+ /** Every string {@link SessionsSetting} renders — the `sessions` namespace of
6
+ * `<UiKitProvider labels>`, overridable per instance through `labels`. The confirm's
7
+ * Cancel is `dangerConfirm.cancel`. */
8
+ interface SessionsLabels {
9
+ /** The card's title. */
10
+ title: string;
11
+ /** The line under it: what "sign out everywhere" is for. */
12
+ description: string;
13
+ /** The button that asks first. */
14
+ signOutEverywhere: string;
15
+ /** The question it asks: every session ends, this one too. */
16
+ signOutEverywherePrompt: string;
17
+ /** The button that answers it. */
18
+ confirmSignOutEverywhere: string;
19
+ /** The device list's accessible name. */
20
+ list: string;
21
+ /** While the list loads. */
22
+ loading: string;
23
+ /** A list with no rows. */
24
+ empty: string;
25
+ /** The chip on the session this page runs in. */
26
+ current: string;
27
+ /** A session whose device the server could not name. */
28
+ unknownDevice: string;
29
+ /** Given the last activity, formatted ("3 hours ago", "5 Oct 2026"). */
30
+ lastActive: (when: string) => string;
31
+ /** Given the address the session was last seen from. */
32
+ ip: (address: string) => string;
33
+ /** A row's button, visible text. */
34
+ revoke: string;
35
+ /** The same button's accessible name, given the device — it starts with `revoke`,
36
+ * the visible text, so voice control finds it by what it says. */
37
+ revokeItem: (device: string) => string;
38
+ /** A request failed. */
39
+ failed: string;
40
+ }
41
+ declare const DEFAULT_SESSIONS_LABELS: SessionsLabels;
42
+ /** What a session's `id` may be: the app's own key type. */
43
+ type SessionId = string | number;
44
+ /** One stored session (kastlan's `GET /auth/sessions`). */
45
+ interface SessionItem<Id extends SessionId = SessionId> {
46
+ id: Id;
47
+ /** The browser and system, as the server reads them ("Firefox on Windows"). Blank
48
+ * reads as `labels.unknownDevice`. */
49
+ device?: string | null;
50
+ /** The address it was last seen from. */
51
+ ip?: string | null;
52
+ /** A `Date`, an ISO string or epoch ms. */
53
+ lastActiveAt?: DateInput;
54
+ /** The session this page runs in: marked, and offered no "Sign out" of its own — the
55
+ * app's sign-out does that, and "Sign out everywhere" below. */
56
+ current?: boolean;
57
+ }
58
+ /** Which request failed — {@link SessionsSettingProps.describeError}'s second argument. */
59
+ type SessionsAction = "sign-out-everywhere" | "revoke";
60
+ interface SessionsSettingProps<Id extends SessionId = SessionId> extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
61
+ /**
62
+ * End every session (`POST /auth/logout`, auth §6.3) — this one included. Asked
63
+ * first; resolve once the server answered, then sign this page out: the card says
64
+ * that the device signs out too, and its own session is gone.
65
+ */
66
+ onSignOutEverywhere: () => Promise<unknown> | void;
67
+ /**
68
+ * The stored sessions, where the app keeps them (kastlan's `user_sessions`, §6.3).
69
+ * Left out, the card is "Sign out everywhere" alone — keksdose and Kurvenschmiede keep
70
+ * a cut-off (`sessions_invalid_before`), not rows. `undefined` with `loading` while the
71
+ * first load runs.
72
+ */
73
+ sessions?: readonly SessionItem<Id>[];
74
+ /** The list is loading. */
75
+ loading?: boolean;
76
+ /** End one other session (`DELETE /auth/sessions/{id}`). Left out, no row buttons.
77
+ * The row is busy until it settles; refresh `sessions` then. */
78
+ onRevoke?: (id: Id) => Promise<unknown> | void;
79
+ /** The app's own words for a failure, or `undefined` for the kit's `failed`. */
80
+ describeError?: (error: unknown, action: SessionsAction) => ReactNode | undefined;
81
+ /** The "Last active" text. Default: how long ago, in the provider's locale, and the
82
+ * date once it is more than a week back. */
83
+ formatLastActive?: (date: Date) => string;
84
+ /** Overrides the provider's locale for the default format. */
85
+ locale?: string;
86
+ labels?: Partial<SessionsLabels>;
87
+ }
88
+ /**
89
+ * Where the account is signed in, and the way out of all of it
90
+ * (docs/user-admin-harmonization.md §6.3, §2.6).
91
+ *
92
+ * **"Sign out everywhere", in every app.** It ends every session, THIS one included —
93
+ * the server stamps a cut-off (`sessions_invalid_before`) that the page's own token is
94
+ * older than — so the confirm says so before it is pressed, and the app signs out once it
95
+ * resolves. A {@link DangerConfirm} in the warning tone: nothing is lost, but the person
96
+ * has to sign in again on every device. keksdose kept its ordinary sign-out device-only
97
+ * (its offline mirror is wiped on an explicit sign-out), which is why this is an action
98
+ * of its own, not a mode of that one.
99
+ *
100
+ * **The device list, where sessions are stored** (kastlan): device, address, last
101
+ * active, and "This device" on the current one, with "Sign out" on each other row — no
102
+ * confirm, since a session ended is a sign-in away from coming back, not data lost.
103
+ * Without `sessions` there is no list: the other apps keep a cut-off, not rows.
104
+ *
105
+ * Both requests are the app's; a failure is said under the card's action, in the app's
106
+ * words if `describeError` has them.
107
+ */
108
+ declare function SessionsSetting<Id extends SessionId = SessionId>({ onSignOutEverywhere, sessions, loading, onRevoke, describeError, formatLastActive, locale: localeProp, labels: labelsProp, className, ...rest }: SessionsSettingProps<Id>): react.JSX.Element;
109
+
110
+ export { DEFAULT_SESSIONS_LABELS, type SessionId, type SessionItem, type SessionsAction, type SessionsLabels, SessionsSetting, type SessionsSettingProps };
@@ -0,0 +1,147 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { MonitorSmartphone } from "lucide-react";
5
+ import { useKitLabels, useKitLocale } from "../i18n/kit-labels.js";
6
+ import { cn } from "../lib/cn.js";
7
+ import { formatRelativeTime, toDate } from "../lib/format.js";
8
+ import { AlertBanner } from "../components/alert-banner.js";
9
+ import { Chip } from "../components/chip.js";
10
+ import { hasMessage } from "../components/choice-parts.js";
11
+ import { DangerConfirm } from "../components/danger-confirm.js";
12
+ import { Skeleton } from "../components/skeleton.js";
13
+ import { Button, Card } from "../components/ui.js";
14
+ import { CARD_DESCRIPTION_CLASS, settle, useMounted } from "./account-parts.js";
15
+ import { SettingsCardTitle } from "../settings/settings-heading.js";
16
+ const DEFAULT_SESSIONS_LABELS = {
17
+ title: "Sessions",
18
+ description: "Signed in on a device you no longer use, or don\u2019t trust? Sign out everywhere.",
19
+ signOutEverywhere: "Sign out everywhere\u2026",
20
+ signOutEverywherePrompt: "This ends every session, including this one: you will be signed out on this device too, and sign in again from here.",
21
+ confirmSignOutEverywhere: "Sign out everywhere",
22
+ list: "Where you\u2019re signed in",
23
+ loading: "Loading sessions\u2026",
24
+ empty: "No sessions to show.",
25
+ current: "This device",
26
+ unknownDevice: "Unknown device",
27
+ lastActive: (when) => `Last active ${when}`,
28
+ ip: (address) => `IP ${address}`,
29
+ revoke: "Sign out",
30
+ revokeItem: (device) => `Sign out ${device}`,
31
+ failed: "That didn\u2019t work. Please try again."
32
+ };
33
+ function SessionsSetting({
34
+ onSignOutEverywhere,
35
+ sessions,
36
+ loading,
37
+ onRevoke,
38
+ describeError,
39
+ formatLastActive,
40
+ locale: localeProp,
41
+ labels: labelsProp,
42
+ className,
43
+ ...rest
44
+ }) {
45
+ const labels = useKitLabels("sessions", DEFAULT_SESSIONS_LABELS, labelsProp);
46
+ const locale = useKitLocale(localeProp);
47
+ const [busyId, setBusyId] = useState(null);
48
+ const [failure, setFailure] = useState(null);
49
+ const mounted = useMounted();
50
+ const describe = (error, action) => {
51
+ const own = describeError?.(error, action);
52
+ return hasMessage(own) ? own : labels.failed;
53
+ };
54
+ const lastActive = (value) => {
55
+ const date = toDate(value);
56
+ if (!date) return null;
57
+ return formatLastActive ? formatLastActive(date) : formatRelativeTime(date, { locale, absoluteAfterDays: 7, absoluteStyle: "medium" });
58
+ };
59
+ const signOutEverywhere = () => {
60
+ setFailure(null);
61
+ return settle(onSignOutEverywhere).catch((error) => {
62
+ if (mounted.current) setFailure(describe(error, "sign-out-everywhere"));
63
+ throw error;
64
+ });
65
+ };
66
+ const revoke = (id) => {
67
+ if (!onRevoke || busyId !== null) return;
68
+ setBusyId(id);
69
+ setFailure(null);
70
+ settle(() => onRevoke(id)).then(
71
+ () => {
72
+ if (mounted.current) setBusyId(null);
73
+ },
74
+ (error) => {
75
+ if (!mounted.current) return;
76
+ setBusyId(null);
77
+ setFailure(describe(error, "revoke"));
78
+ }
79
+ );
80
+ };
81
+ const showList = sessions !== void 0 || loading;
82
+ return /* @__PURE__ */ jsxs(Card, { ...rest, className: cn("p-4 space-y-3", className), children: [
83
+ /* @__PURE__ */ jsxs("div", { children: [
84
+ /* @__PURE__ */ jsx(SettingsCardTitle, { children: labels.title }),
85
+ /* @__PURE__ */ jsx("div", { className: CARD_DESCRIPTION_CLASS, children: labels.description })
86
+ ] }),
87
+ showList && (loading || sessions === void 0 ? /* @__PURE__ */ jsx(Skeleton, { lines: 2, label: labels.loading }) : sessions.length === 0 ? /* @__PURE__ */ jsx("p", { className: CARD_DESCRIPTION_CLASS, children: labels.empty }) : /* @__PURE__ */ jsx("ul", { "aria-label": labels.list, className: "divide-y divide-[var(--border)]", children: sessions.map((session) => {
88
+ const device = session.device?.trim() || labels.unknownDevice;
89
+ const when = lastActive(session.lastActiveAt);
90
+ const ip = session.ip?.trim();
91
+ return /* @__PURE__ */ jsxs(
92
+ "li",
93
+ {
94
+ "data-session-id": String(session.id),
95
+ "data-current": session.current || void 0,
96
+ className: "flex items-center gap-3 py-2",
97
+ children: [
98
+ /* @__PURE__ */ jsx(MonitorSmartphone, { "aria-hidden": true, className: "size-4 shrink-0 text-[var(--text-muted)]" }),
99
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
100
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
101
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 break-words text-sm font-medium", children: device }),
102
+ session.current && /* @__PURE__ */ jsx(Chip, { size: "sm", tone: "brand", children: labels.current })
103
+ ] }),
104
+ (when || ip) && /* @__PURE__ */ jsxs("div", { className: CARD_DESCRIPTION_CLASS, children: [
105
+ when && labels.lastActive(when),
106
+ when && ip && " \xB7 ",
107
+ ip && /* @__PURE__ */ jsx("span", { dir: "ltr", children: labels.ip(ip) })
108
+ ] })
109
+ ] }),
110
+ onRevoke && !session.current && /* @__PURE__ */ jsx(
111
+ Button,
112
+ {
113
+ type: "button",
114
+ size: "sm",
115
+ variant: "ghost",
116
+ commit: true,
117
+ pending: busyId === session.id,
118
+ disabled: busyId !== null && busyId !== session.id,
119
+ "aria-label": labels.revokeItem(device),
120
+ onClick: () => revoke(session.id),
121
+ children: labels.revoke
122
+ }
123
+ )
124
+ ]
125
+ },
126
+ session.id
127
+ );
128
+ }) })),
129
+ /* @__PURE__ */ jsx(
130
+ DangerConfirm,
131
+ {
132
+ tone: "warning",
133
+ commit: true,
134
+ armLabel: labels.signOutEverywhere,
135
+ prompt: labels.signOutEverywherePrompt,
136
+ confirmLabel: labels.confirmSignOutEverywhere,
137
+ onConfirm: signOutEverywhere
138
+ }
139
+ ),
140
+ hasMessage(failure) && /* @__PURE__ */ jsx(AlertBanner, { tone: "danger", size: "sm", role: "alert", children: failure })
141
+ ] });
142
+ }
143
+ export {
144
+ DEFAULT_SESSIONS_LABELS,
145
+ SessionsSetting
146
+ };
147
+ //# sourceMappingURL=sessions-setting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/account/sessions-setting.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { MonitorSmartphone } from \"lucide-react\";\n\nimport { useKitLabels, useKitLocale } from \"../i18n/kit-labels\";\nimport { cn } from \"../lib/cn\";\nimport { formatRelativeTime, toDate } from \"../lib/format\";\nimport type { DateInput } from \"../lib/format\";\nimport { AlertBanner } from \"../components/alert-banner\";\nimport { Chip } from \"../components/chip\";\nimport { hasMessage } from \"../components/choice-parts\";\nimport { DangerConfirm } from \"../components/danger-confirm\";\nimport { Skeleton } from \"../components/skeleton\";\nimport { Button, Card } from \"../components/ui\";\nimport { CARD_DESCRIPTION_CLASS, settle, useMounted } from \"./account-parts\";\nimport { SettingsCardTitle } from \"../settings/settings-heading\";\n\n/* ── Labels ──────────────────────────────────────────────────────────────── */\n\n/** Every string {@link SessionsSetting} renders — the `sessions` namespace of\n * `<UiKitProvider labels>`, overridable per instance through `labels`. The confirm's\n * Cancel is `dangerConfirm.cancel`. */\nexport interface SessionsLabels {\n /** The card's title. */\n title: string;\n /** The line under it: what \"sign out everywhere\" is for. */\n description: string;\n /** The button that asks first. */\n signOutEverywhere: string;\n /** The question it asks: every session ends, this one too. */\n signOutEverywherePrompt: string;\n /** The button that answers it. */\n confirmSignOutEverywhere: string;\n /** The device list's accessible name. */\n list: string;\n /** While the list loads. */\n loading: string;\n /** A list with no rows. */\n empty: string;\n /** The chip on the session this page runs in. */\n current: string;\n /** A session whose device the server could not name. */\n unknownDevice: string;\n /** Given the last activity, formatted (\"3 hours ago\", \"5 Oct 2026\"). */\n lastActive: (when: string) => string;\n /** Given the address the session was last seen from. */\n ip: (address: string) => string;\n /** A row's button, visible text. */\n revoke: string;\n /** The same button's accessible name, given the device — it starts with `revoke`,\n * the visible text, so voice control finds it by what it says. */\n revokeItem: (device: string) => string;\n /** A request failed. */\n failed: string;\n}\n\nexport const DEFAULT_SESSIONS_LABELS: SessionsLabels = {\n title: \"Sessions\",\n description: \"Signed in on a device you no longer use, or don’t trust? Sign out everywhere.\",\n signOutEverywhere: \"Sign out everywhere…\",\n signOutEverywherePrompt:\n \"This ends every session, including this one: you will be signed out on this device too, and sign in again from here.\",\n confirmSignOutEverywhere: \"Sign out everywhere\",\n list: \"Where you’re signed in\",\n loading: \"Loading sessions…\",\n empty: \"No sessions to show.\",\n current: \"This device\",\n unknownDevice: \"Unknown device\",\n lastActive: (when) => `Last active ${when}`,\n ip: (address) => `IP ${address}`,\n revoke: \"Sign out\",\n revokeItem: (device) => `Sign out ${device}`,\n failed: \"That didn’t work. Please try again.\",\n};\n\n/* ── Props ───────────────────────────────────────────────────────────────── */\n\n/** What a session's `id` may be: the app's own key type. */\nexport type SessionId = string | number;\n\n/** One stored session (kastlan's `GET /auth/sessions`). */\nexport interface SessionItem<Id extends SessionId = SessionId> {\n id: Id;\n /** The browser and system, as the server reads them (\"Firefox on Windows\"). Blank\n * reads as `labels.unknownDevice`. */\n device?: string | null;\n /** The address it was last seen from. */\n ip?: string | null;\n /** A `Date`, an ISO string or epoch ms. */\n lastActiveAt?: DateInput;\n /** The session this page runs in: marked, and offered no \"Sign out\" of its own — the\n * app's sign-out does that, and \"Sign out everywhere\" below. */\n current?: boolean;\n}\n\n/** Which request failed — {@link SessionsSettingProps.describeError}'s second argument. */\nexport type SessionsAction = \"sign-out-everywhere\" | \"revoke\";\n\nexport interface SessionsSettingProps<Id extends SessionId = SessionId>\n extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n /**\n * End every session (`POST /auth/logout`, auth §6.3) — this one included. Asked\n * first; resolve once the server answered, then sign this page out: the card says\n * that the device signs out too, and its own session is gone.\n */\n onSignOutEverywhere: () => Promise<unknown> | void;\n /**\n * The stored sessions, where the app keeps them (kastlan's `user_sessions`, §6.3).\n * Left out, the card is \"Sign out everywhere\" alone — keksdose and Kurvenschmiede keep\n * a cut-off (`sessions_invalid_before`), not rows. `undefined` with `loading` while the\n * first load runs.\n */\n sessions?: readonly SessionItem<Id>[];\n /** The list is loading. */\n loading?: boolean;\n /** End one other session (`DELETE /auth/sessions/{id}`). Left out, no row buttons.\n * The row is busy until it settles; refresh `sessions` then. */\n onRevoke?: (id: Id) => Promise<unknown> | void;\n /** The app's own words for a failure, or `undefined` for the kit's `failed`. */\n describeError?: (error: unknown, action: SessionsAction) => ReactNode | undefined;\n /** The \"Last active\" text. Default: how long ago, in the provider's locale, and the\n * date once it is more than a week back. */\n formatLastActive?: (date: Date) => string;\n /** Overrides the provider's locale for the default format. */\n locale?: string;\n labels?: Partial<SessionsLabels>;\n}\n\n/**\n * Where the account is signed in, and the way out of all of it\n * (docs/user-admin-harmonization.md §6.3, §2.6).\n *\n * **\"Sign out everywhere\", in every app.** It ends every session, THIS one included —\n * the server stamps a cut-off (`sessions_invalid_before`) that the page's own token is\n * older than — so the confirm says so before it is pressed, and the app signs out once it\n * resolves. A {@link DangerConfirm} in the warning tone: nothing is lost, but the person\n * has to sign in again on every device. keksdose kept its ordinary sign-out device-only\n * (its offline mirror is wiped on an explicit sign-out), which is why this is an action\n * of its own, not a mode of that one.\n *\n * **The device list, where sessions are stored** (kastlan): device, address, last\n * active, and \"This device\" on the current one, with \"Sign out\" on each other row — no\n * confirm, since a session ended is a sign-in away from coming back, not data lost.\n * Without `sessions` there is no list: the other apps keep a cut-off, not rows.\n *\n * Both requests are the app's; a failure is said under the card's action, in the app's\n * words if `describeError` has them.\n */\nexport function SessionsSetting<Id extends SessionId = SessionId>({\n onSignOutEverywhere,\n sessions,\n loading,\n onRevoke,\n describeError,\n formatLastActive,\n locale: localeProp,\n labels: labelsProp,\n className,\n ...rest\n}: SessionsSettingProps<Id>) {\n const labels = useKitLabels(\"sessions\", DEFAULT_SESSIONS_LABELS, labelsProp);\n const locale = useKitLocale(localeProp);\n const [busyId, setBusyId] = useState<Id | null>(null);\n const [failure, setFailure] = useState<ReactNode>(null);\n const mounted = useMounted();\n\n const describe = (error: unknown, action: SessionsAction): ReactNode => {\n const own = describeError?.(error, action);\n return hasMessage(own) ? own : labels.failed;\n };\n\n const lastActive = (value: DateInput): string | null => {\n const date = toDate(value);\n if (!date) return null;\n return formatLastActive\n ? formatLastActive(date)\n : formatRelativeTime(date, { locale, absoluteAfterDays: 7, absoluteStyle: \"medium\" });\n };\n\n const signOutEverywhere = () => {\n setFailure(null);\n // Rejected again after it is said, so the tile stays armed for a retry.\n return settle(onSignOutEverywhere).catch((error: unknown) => {\n if (mounted.current) setFailure(describe(error, \"sign-out-everywhere\"));\n throw error;\n });\n };\n\n const revoke = (id: Id) => {\n if (!onRevoke || busyId !== null) return;\n setBusyId(id);\n setFailure(null);\n settle(() => onRevoke(id)).then(\n () => {\n if (mounted.current) setBusyId(null);\n },\n (error: unknown) => {\n if (!mounted.current) return;\n setBusyId(null);\n setFailure(describe(error, \"revoke\"));\n },\n );\n };\n\n const showList = sessions !== undefined || loading;\n\n return (\n <Card {...rest} className={cn(\"p-4 space-y-3\", className)}>\n <div>\n <SettingsCardTitle>{labels.title}</SettingsCardTitle>\n <div className={CARD_DESCRIPTION_CLASS}>{labels.description}</div>\n </div>\n {showList &&\n (loading || sessions === undefined ? (\n <Skeleton lines={2} label={labels.loading} />\n ) : sessions.length === 0 ? (\n <p className={CARD_DESCRIPTION_CLASS}>{labels.empty}</p>\n ) : (\n <ul aria-label={labels.list} className=\"divide-y divide-[var(--border)]\">\n {sessions.map((session) => {\n const device = session.device?.trim() || labels.unknownDevice;\n const when = lastActive(session.lastActiveAt);\n const ip = session.ip?.trim();\n return (\n <li\n key={session.id}\n data-session-id={String(session.id)}\n data-current={session.current || undefined}\n className=\"flex items-center gap-3 py-2\"\n >\n <MonitorSmartphone aria-hidden className=\"size-4 shrink-0 text-[var(--text-muted)]\" />\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-1\">\n <span className=\"min-w-0 break-words text-sm font-medium\">{device}</span>\n {session.current && (\n <Chip size=\"sm\" tone=\"brand\">\n {labels.current}\n </Chip>\n )}\n </div>\n {(when || ip) && (\n <div className={CARD_DESCRIPTION_CLASS}>\n {when && labels.lastActive(when)}\n {when && ip && \" · \"}\n {/* An address reads left to right in any page direction. */}\n {ip && <span dir=\"ltr\">{labels.ip(ip)}</span>}\n </div>\n )}\n </div>\n {onRevoke && !session.current && (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n commit\n pending={busyId === session.id}\n disabled={busyId !== null && busyId !== session.id}\n aria-label={labels.revokeItem(device)}\n onClick={() => revoke(session.id)}\n >\n {labels.revoke}\n </Button>\n )}\n </li>\n );\n })}\n </ul>\n ))}\n <DangerConfirm\n tone=\"warning\"\n commit\n armLabel={labels.signOutEverywhere}\n prompt={labels.signOutEverywherePrompt}\n confirmLabel={labels.confirmSignOutEverywhere}\n onConfirm={signOutEverywhere}\n />\n {hasMessage(failure) && (\n <AlertBanner tone=\"danger\" size=\"sm\" role=\"alert\">\n {failure}\n </AlertBanner>\n )}\n </Card>\n );\n}\n"],"mappings":";AAgNM,SACE,KADF;AAhNN,SAAS,gBAAgB;AAEzB,SAAS,yBAAyB;AAElC,SAAS,cAAc,oBAAoB;AAC3C,SAAS,UAAU;AACnB,SAAS,oBAAoB,cAAc;AAE3C,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB,SAAS,QAAQ,YAAY;AAC7B,SAAS,wBAAwB,QAAQ,kBAAkB;AAC3D,SAAS,yBAAyB;AAyC3B,MAAM,0BAA0C;AAAA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AQ,WACP,oBAAC,QAAK,MAAK,MAAK,MAAK,SAClB,iBAAO,SACV;AAAA,iBAEJ;AAAA,eACE,QAAQ,OACR,qBAAC,SAAI,WAAW,wBACb;AAAA,wBAAQ,OAAO,WAAW,IAAI;AAAA,gBAC9B,QAAQ,MAAM;AAAA,gBAEd,MAAM,oBAAC,UAAK,KAAI,OAAO,iBAAO,GAAG,EAAE,GAAE;AAAA,iBACxC;AAAA,eAEJ;AAAA,YACC,YAAY,CAAC,QAAQ,WACpB;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,MAAK;AAAA,gBACL,SAAQ;AAAA,gBACR,QAAM;AAAA,gBACN,SAAS,WAAW,QAAQ;AAAA,gBAC5B,UAAU,WAAW,QAAQ,WAAW,QAAQ;AAAA,gBAChD,cAAY,OAAO,WAAW,MAAM;AAAA,gBACpC,SAAS,MAAM,OAAO,QAAQ,EAAE;AAAA,gBAE/B,iBAAO;AAAA;AAAA,YACV;AAAA;AAAA;AAAA,QApCG,QAAQ;AAAA,MAsCf;AAAA,IAEJ,CAAC,GACH;AAAA,IAEJ;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,QAAM;AAAA,QACN,UAAU,OAAO;AAAA,QACjB,QAAQ,OAAO;AAAA,QACf,cAAc,OAAO;AAAA,QACrB,WAAW;AAAA;AAAA,IACb;AAAA,IACC,WAAW,OAAO,KACjB,oBAAC,eAAY,MAAK,UAAS,MAAK,MAAK,MAAK,SACvC,mBACH;AAAA,KAEJ;AAEJ;","names":[]}
@@ -0,0 +1,95 @@
1
+ import 'react';
2
+ export { bt as AdminActionConfirm, bu as AdminActionConfirmProps, bv as AdminActionConfirmValues, bw as AdminActionLabels, bx as AdminActionTarget, by as AdminConfirmLevel, cf as DEFAULT_ADMIN_ACTION_LABELS } from '../delete-account-setting-DCFS5Vof.js';
3
+ import './admin-parts.js';
4
+ import '../components/tooltip.js';
5
+ import '../hooks/use-anchored-rect.js';
6
+ import '../lib/clipping.js';
7
+ import '../data-table-labels-DUELeXpa.js';
8
+ import '../components/data-table-sort.js';
9
+ import '../components/swipeable-row.js';
10
+ import '../components/mini-calendar.js';
11
+ import '../components/calendar-heatmap.js';
12
+ import '../components/popover.js';
13
+ import '../components/chip.js';
14
+ import 'lucide-react';
15
+ import '../components/field-sync.js';
16
+ import '../wizard/types.js';
17
+ import '../tour/tour.js';
18
+ import '../search/command-palette.js';
19
+ import '../search/global-search.js';
20
+ import '../search/search-index.js';
21
+ import '../components/month-picker.js';
22
+ import '../components/page-contents.js';
23
+ import '../components/series-chart-labels.js';
24
+ import '../components/pie-chart-labels.js';
25
+ import '../components/sparkline.js';
26
+ import '../components/stat-tile.js';
27
+ import '../components/signature-pad.js';
28
+ import '../components/password-strength.js';
29
+ import '../components/swatch-picker.js';
30
+ import '../components/tile-radio.js';
31
+ import '../components/icon-picker.js';
32
+ import '../components/dialog-frame.js';
33
+ import '../components/modal.js';
34
+ import '../hooks/use-search-param-state.js';
35
+ import '../components/measured-grid.js';
36
+ import '../components/user-avatar.js';
37
+ import '../lib/person-name.js';
38
+ import '../components/status-dot.js';
39
+ import '../components/progress-bar.js';
40
+ import '../components/signed-amount.js';
41
+ import '../shell/topbar-action-menu.js';
42
+ import '../components/menu-item.js';
43
+ import '../components/floating-panel.js';
44
+ import '../hooks/use-authed-src.js';
45
+ import '../components/account-settings-labels.js';
46
+ import '../components/bulk-action-bar.js';
47
+ import '../components/list.js';
48
+ import '../components/breadcrumbs.js';
49
+ import '../components/toast.js';
50
+ import '../components/description-list.js';
51
+ import '../components/line-items.js';
52
+ import '../components/error-boundary.js';
53
+ import '../components/authed-image.js';
54
+ import '../components/image-grid.js';
55
+ import '../components/lightbox.js';
56
+ import '../components/write-lock.js';
57
+ import '../auth/sign-in-form.js';
58
+ import '../landing/access.js';
59
+ import '../landing/landing-labels.js';
60
+ import '../shell/topbar-controls.js';
61
+ import '../theme/palette-presets.js';
62
+ import '../theme/chart-palette.js';
63
+ import '../theme/theme-store.js';
64
+ import 'zustand/middleware';
65
+ import 'zustand';
66
+ import '../auth/complete-name-dialog.js';
67
+ import '../auth/forgot-password-form.js';
68
+ import '../auth/status-parts.js';
69
+ import '../auth/reset-password-form.js';
70
+ import '../auth/verify-email.js';
71
+ import '../auth/not-found-page.js';
72
+ import '../auth/accept-invitation.js';
73
+ import '../shell/company-switcher.js';
74
+ import '../account/email-change-setting.js';
75
+ import '../account/sessions-setting.js';
76
+ import '../lib/format.js';
77
+ import '../account/data-export-setting.js';
78
+ import '../components/account-chips.js';
79
+ import './admin-action-log.js';
80
+ import '../settings/settings-labels.js';
81
+ import '../demo/demo-labels.js';
82
+ import '../components/reauth-dialog.js';
83
+ import '../components/server-wake.js';
84
+ import '../lib/server-wake.js';
85
+ import '../components/translation-review-labels.js';
86
+ import '../lib/translation-review.js';
87
+ import '../components/country-select.js';
88
+ import '../components/inline-edit-field.js';
89
+ import '../lib/iban.js';
90
+ import '../lib/phone.js';
91
+ import '../components/sign-chip.js';
92
+ import '../components/column-mapper.js';
93
+ import '../lib/column-mapping.js';
94
+ import '../lib/table-text.js';
95
+ import '../components/field-parts.js';