@protobase/ui 0.25.2 → 0.25.4

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 (271) hide show
  1. package/dist/account/account-pages.js +3 -2
  2. package/dist/account/account-section.js +1 -1
  3. package/dist/account/account-security-page.js +9 -4
  4. package/dist/account/backup-codes.js +7 -6
  5. package/dist/account/messages.js +214 -0
  6. package/dist/account/passkeys-section.js +23 -22
  7. package/dist/account/password-dialog.js +4 -3
  8. package/dist/account/sign-in-policy-form.js +14 -13
  9. package/dist/account/sign-in-policy-labels.js +30 -29
  10. package/dist/account/sign-in-policy-page.js +11 -6
  11. package/dist/account/sign-in-providers-section.js +6 -5
  12. package/dist/account/staff-sign-in-log.js +11 -10
  13. package/dist/account/totp-qr.js +2 -1
  14. package/dist/account/two-factor-section.js +24 -23
  15. package/dist/account/two-factor-setup.js +19 -18
  16. package/dist/action-card/action-card.js +2 -1
  17. package/dist/action-card/field-list.js +1 -1
  18. package/dist/action-card/messages.js +8 -0
  19. package/dist/activity-chart/activity-chart.js +3 -2
  20. package/dist/activity-chart/messages.js +14 -0
  21. package/dist/app/app.d.ts +1 -1
  22. package/dist/app/app.js +20 -21
  23. package/dist/app/assistant-shell.js +2 -1
  24. package/dist/app/batch-failure.js +2 -1
  25. package/dist/app/breadcrumb-for.js +4 -3
  26. package/dist/app/charts/chart-groups.js +3 -2
  27. package/dist/app/charts/chart-view.js +3 -2
  28. package/dist/app/charts/group-bars.js +2 -1
  29. package/dist/app/charts/messages.js +26 -0
  30. package/dist/app/charts/period-chart.js +3 -2
  31. package/dist/app/charts/split-points.js +2 -1
  32. package/dist/app/comments/comment-composer.js +19 -18
  33. package/dist/app/comments/comments-section.js +4 -3
  34. package/dist/app/comments/messages.js +26 -0
  35. package/dist/app/create/create-page.js +11 -18
  36. package/dist/app/custom-section.js +4 -6
  37. package/dist/app/displays/board-column.js +7 -6
  38. package/dist/app/displays/board-columns.js +3 -2
  39. package/dist/app/displays/board-display.js +13 -15
  40. package/dist/app/displays/calendar-controls.js +3 -2
  41. package/dist/app/displays/calendar-display.js +12 -17
  42. package/dist/app/displays/card-carousel.js +4 -3
  43. package/dist/app/displays/cards-display.js +2 -1
  44. package/dist/app/displays/custom-display.js +4 -6
  45. package/dist/app/displays/display-frame.js +3 -2
  46. package/dist/app/displays/list-cards.js +5 -8
  47. package/dist/app/displays/list-displays.js +3 -3
  48. package/dist/app/displays/map-display.js +15 -14
  49. package/dist/app/displays/messages.js +128 -2
  50. package/dist/app/displays/period-controls.js +4 -3
  51. package/dist/app/displays/record-card.js +7 -6
  52. package/dist/app/displays/timeline-display.js +17 -26
  53. package/dist/app/displays/timeline-range.js +2 -1
  54. package/dist/app/displays/timeline-row.js +1 -1
  55. package/dist/app/displays/use-board-move.js +2 -2
  56. package/dist/app/displays/use-calendar-move.js +2 -1
  57. package/dist/app/document-title.js +2 -1
  58. package/dist/app/error-banner.js +1 -1
  59. package/dist/app/export/builder-port.js +2 -1
  60. package/dist/app/export/export-dialog.js +39 -43
  61. package/dist/app/export/export-worker.js +2 -0
  62. package/dist/app/export/messages.js +78 -0
  63. package/dist/app/export/run-export.js +5 -2
  64. package/dist/app/export/sink.js +4 -3
  65. package/dist/app/export/use-export-flow.js +4 -3
  66. package/dist/app/field-editor.js +4 -3
  67. package/dist/app/field-types/messages.js +8 -0
  68. package/dist/app/field-types/widget-part.js +2 -1
  69. package/dist/app/file-field.js +11 -14
  70. package/dist/app/gallery/gallery-section.js +4 -3
  71. package/dist/app/gallery/lightbox.js +5 -4
  72. package/dist/app/gallery/messages.js +30 -0
  73. package/dist/app/gallery/photo-details.js +3 -2
  74. package/dist/app/hand-order/hand-sorted-list.js +3 -6
  75. package/dist/app/hand-order/messages.js +4 -2
  76. package/dist/app/history/describe-change.js +3 -8
  77. package/dist/app/history/messages.js +32 -0
  78. package/dist/app/import/convert.js +20 -19
  79. package/dist/app/import/failed-rows.js +3 -2
  80. package/dist/app/import/import-button.js +2 -1
  81. package/dist/app/import/import-check-step.js +21 -37
  82. package/dist/app/import/import-dialog.js +13 -17
  83. package/dist/app/import/import-file-step.js +5 -9
  84. package/dist/app/import/import-mapping-step.js +32 -35
  85. package/dist/app/import/import-result-step.js +13 -12
  86. package/dist/app/import/messages.js +200 -0
  87. package/dist/app/import/parse-worker.js +2 -0
  88. package/dist/app/import/prepare-rows.js +5 -4
  89. package/dist/app/import/sheet-cell.js +2 -1
  90. package/dist/app/import/sheet-file.js +3 -2
  91. package/dist/app/import/sheet-source.js +7 -3
  92. package/dist/app/import/xlsx-reader.js +4 -3
  93. package/dist/app/import/xlsx-xml.js +2 -1
  94. package/dist/app/import/zip-reader.js +4 -3
  95. package/dist/app/list-edit/use-list-edits.js +1 -1
  96. package/dist/app/list-group-chart.js +2 -1
  97. package/dist/app/list-page.js +1 -1
  98. package/dist/app/map/map-layer-switch.js +3 -2
  99. package/dist/app/map/messages.js +14 -0
  100. package/dist/app/messages.js +116 -2
  101. package/dist/app/meta-gate.js +1 -1
  102. package/dist/app/nav-from-meta.js +11 -10
  103. package/dist/app/pages/action-inputs/action-inputs-dialog.js +3 -2
  104. package/dist/app/pages/action-inputs/input-answers.js +6 -5
  105. package/dist/app/pages/blocks/card-row.js +3 -2
  106. package/dist/app/pages/blocks/field.js +1 -1
  107. package/dist/app/pages/blocks/modal-form.js +5 -4
  108. package/dist/app/pages/blocks/progress.js +1 -1
  109. package/dist/app/pages/blocks/record-card.js +3 -2
  110. package/dist/app/pages/blocks/stat.js +2 -1
  111. package/dist/app/pages/composed-page.js +6 -8
  112. package/dist/app/pages/confirm-action.js +2 -1
  113. package/dist/app/pages/custom-boundary.js +4 -2
  114. package/dist/app/pages/messages.js +64 -0
  115. package/dist/app/pages/render-node.js +5 -7
  116. package/dist/app/pages/use-run-action.js +11 -10
  117. package/dist/app/record-page.js +1 -1
  118. package/dist/app/record-row/messages.js +26 -0
  119. package/dist/app/record-row/record-row-body.js +12 -7
  120. package/dist/app/record-row/record-row.js +4 -3
  121. package/dist/app/record-row/saved-record-row.js +3 -2
  122. package/dist/app/related-dots/dots-summary.js +2 -1
  123. package/dist/app/related-dots/messages.js +8 -0
  124. package/dist/app/relation-picker.js +9 -8
  125. package/dist/app/router.js +5 -4
  126. package/dist/app/runtime/messages.js +58 -0
  127. package/dist/app/runtime/runtime-status.js +10 -23
  128. package/dist/app/runtime/runtime-update-dialog.js +7 -6
  129. package/dist/app/runtime/runtime-update.js +4 -3
  130. package/dist/app/saved/favorite-button.js +2 -1
  131. package/dist/app/saved/messages.js +22 -0
  132. package/dist/app/saved/saved-list.js +4 -7
  133. package/dist/app/saved/use-favorite.js +3 -2
  134. package/dist/app/search/messages.js +6 -2
  135. package/dist/app/search/navigation-hits.js +9 -7
  136. package/dist/app/searches/filter-chip-list.js +2 -1
  137. package/dist/app/searches/messages.js +96 -0
  138. package/dist/app/searches/save-search-button.js +5 -4
  139. package/dist/app/searches/saved-search-rows.js +3 -2
  140. package/dist/app/searches/saved-search-section.js +6 -5
  141. package/dist/app/searches/saved-search.js +4 -3
  142. package/dist/app/searches/saved-searches.js +15 -25
  143. package/dist/app/searches/search-controls.js +5 -4
  144. package/dist/app/searches/search-diff.js +4 -2
  145. package/dist/app/searches/search-name-dialog.js +4 -3
  146. package/dist/app/searches/update-search-dialog.js +15 -30
  147. package/dist/app/searches/use-save-search.js +8 -7
  148. package/dist/app/searches/use-search-row.js +4 -3
  149. package/dist/app/sensitive-field.js +5 -4
  150. package/dist/app/source-notice.js +13 -8
  151. package/dist/app/staff-banner.js +13 -20
  152. package/dist/app-shell/global-search.js +2 -2
  153. package/dist/app-shell/messages.js +4 -2
  154. package/dist/app-shell/sidebar-group.js +1 -1
  155. package/dist/app-shell/sidebar-item.js +1 -1
  156. package/dist/app-shell/sidebar.js +1 -1
  157. package/dist/assistant-dock/assistant-dock.js +6 -6
  158. package/dist/assistant-dock/messages.js +26 -0
  159. package/dist/assistant-dock/use-assistant.js +2 -1
  160. package/dist/assistant-dock/use-backend-data.js +2 -1
  161. package/dist/assistant-dock/widget-view.js +3 -2
  162. package/dist/auth/auth-gate.js +10 -5
  163. package/dist/auth/auth-locale.js +14 -0
  164. package/dist/auth/auth-messages.js +122 -43
  165. package/dist/auth/auth-provider.js +6 -1
  166. package/dist/auth/code-form.js +4 -3
  167. package/dist/auth/email-code-form.js +11 -13
  168. package/dist/auth/email-code-page.js +2 -1
  169. package/dist/auth/first-run-page.js +6 -5
  170. package/dist/auth/forgot-password-form.js +15 -17
  171. package/dist/auth/forgot-password-page.js +2 -1
  172. package/dist/auth/messages.js +200 -0
  173. package/dist/auth/provider-sign-in-page.js +5 -5
  174. package/dist/auth/resend-code-button.js +2 -1
  175. package/dist/auth/reset-password-form.js +12 -11
  176. package/dist/auth/reset-password-page.js +4 -3
  177. package/dist/auth/setup-required-form.js +8 -10
  178. package/dist/auth/setup-required-page.js +7 -2
  179. package/dist/auth/sign-in-form.js +18 -21
  180. package/dist/auth/sign-in-prompt.js +4 -3
  181. package/dist/auth/sign-up-code-form.js +11 -13
  182. package/dist/auth/sign-up-details-form.js +15 -22
  183. package/dist/auth/sign-up-email-form.js +9 -8
  184. package/dist/auth/sign-up-page.js +2 -1
  185. package/dist/auth/staff-sign-in-form.js +16 -19
  186. package/dist/auth/two-factor-form.js +19 -18
  187. package/dist/auth/user-to-shell.js +2 -1
  188. package/dist/chat/composer.js +8 -7
  189. package/dist/chat/messages.js +14 -0
  190. package/dist/compact-table/compact-table.js +4 -8
  191. package/dist/compact-table/messages.js +18 -0
  192. package/dist/data/meta-data.d.ts +1 -1
  193. package/dist/data/use-update-record.js +1 -1
  194. package/dist/data-grid/grid-header.js +1 -1
  195. package/dist/filter-panel/date-presets.js +1 -1
  196. package/dist/forms/public-form-page.js +1 -1
  197. package/dist/inline-child-table/inline-child-table.js +12 -12
  198. package/dist/inline-child-table/line-row.js +10 -9
  199. package/dist/inline-child-table/messages.js +52 -0
  200. package/dist/inline-child-table/totals-footer.js +5 -8
  201. package/dist/invitations/invite-form.js +3 -2
  202. package/dist/invitations/link-notice.js +6 -4
  203. package/dist/invitations/messages.js +24 -0
  204. package/dist/invitations/pending-invitation-row.js +4 -3
  205. package/dist/lists/messages.js +8 -0
  206. package/dist/lists/paged-search-list.js +2 -1
  207. package/dist/locale/slotted.js +14 -0
  208. package/dist/markdown/markdown-editor.js +6 -5
  209. package/dist/markdown/messages.js +16 -0
  210. package/dist/organizations/all-organizations.js +6 -5
  211. package/dist/organizations/app-roles-picker.js +2 -1
  212. package/dist/organizations/invitation-page.js +41 -51
  213. package/dist/organizations/invitations-page.js +11 -10
  214. package/dist/organizations/members-page.js +16 -11
  215. package/dist/organizations/messages.js +180 -0
  216. package/dist/organizations/organization-page.js +27 -26
  217. package/dist/organizations/organization-paths.js +16 -13
  218. package/dist/organizations/organization-row.js +3 -2
  219. package/dist/organizations/organizations-page.js +17 -16
  220. package/dist/organizations/use-organizations.js +2 -1
  221. package/dist/package.js +1 -1
  222. package/dist/plugins/before-sign-in.js +6 -1
  223. package/dist/plugins/load-plugin.d.ts +1 -1
  224. package/dist/plugins/load-plugin.js +3 -2
  225. package/dist/plugins/messages.js +36 -0
  226. package/dist/plugins/plugin-gate.js +6 -1
  227. package/dist/plugins/plugin-manifest.js +8 -7
  228. package/dist/plugins/plugin-notice.js +8 -12
  229. package/dist/primitives/button.js +1 -1
  230. package/dist/primitives/messages.js +16 -0
  231. package/dist/primitives/segmented.js +1 -1
  232. package/dist/primitives/sheet.js +2 -1
  233. package/dist/primitives/spinner.js +2 -1
  234. package/dist/primitives/token.js +2 -1
  235. package/dist/record-view/field.js +2 -2
  236. package/dist/record-view/messages.js +4 -2
  237. package/dist/record-view/record-tabs.js +2 -1
  238. package/dist/roles/messages.js +14 -0
  239. package/dist/roles/use-active-role.js +3 -2
  240. package/dist/shell/assets/app-yCMYvqMX.js +69 -0
  241. package/dist/shell/assets/cn-Bi0ZEjD9.js +1 -0
  242. package/dist/shell/assets/export-worker-ClACk00b.js +2 -0
  243. package/dist/shell/assets/{index-BRkDA5KD.css → index-Bkc7w8I4.css} +1 -1
  244. package/dist/shell/assets/{index-xY0Mvv6V.js → index-HkjqX_O-.js} +2 -2
  245. package/dist/shell/assets/maplibre-DUTS_eJM.js +814 -0
  246. package/dist/shell/assets/{markdown-content-ukDTCu6u.js → markdown-content-CtGUP4W6.js} +1 -1
  247. package/dist/shell/assets/parse-worker-UhbwEjS0.js +5 -0
  248. package/dist/shell/assets/preload-helper-BZ3hrQDD.js +1 -0
  249. package/dist/shell/assets/{record-map-BJmYZ7kQ.js → record-map-DFy7sJEU.js} +1 -1
  250. package/dist/shell/assets/records-map-MfQEuiFB.js +1 -0
  251. package/dist/shell/assets/shared-protobase-ui-Bfa59vx6.js +1 -0
  252. package/dist/shell/index.html +6 -4
  253. package/dist/shell/protobase.shell.json +1 -1
  254. package/dist/shell/protobase.sw.js +2 -2
  255. package/dist/side-panel/messages.js +8 -0
  256. package/dist/side-panel/side-panel.js +2 -1
  257. package/dist/toasts/messages.js +8 -0
  258. package/dist/toasts/toast.js +2 -1
  259. package/dist/users/app-invitations.js +5 -4
  260. package/dist/users/create-user-form.js +9 -8
  261. package/dist/users/messages.js +52 -0
  262. package/dist/users/use-user-roles.js +2 -1
  263. package/dist/users/user-list.js +6 -5
  264. package/dist/users/user-row.js +5 -4
  265. package/package.json +4 -4
  266. package/dist/shell/assets/app-C-OLrsRR.js +0 -69
  267. package/dist/shell/assets/export-worker-Bz57Pf5g.js +0 -2
  268. package/dist/shell/assets/maplibre-Dov6nhPX.js +0 -814
  269. package/dist/shell/assets/parse-worker-BtcY0dQw.js +0 -5
  270. package/dist/shell/assets/records-map-C1_gDKHR.js +0 -1
  271. package/dist/shell/assets/shared-protobase-ui-CFYJAbMR.js +0 -1
@@ -1,6 +1,7 @@
1
1
  import { Spinner } from "../primitives/spinner.js";
2
2
  import { signInMessage } from "./auth-messages.js";
3
3
  import { providerName } from "./provider-link.js";
4
+ import { text } from "./messages.js";
4
5
  import { useAuth } from "./auth-provider.js";
5
6
  import { AuthLayout } from "./auth-layout.js";
6
7
  import { useEffect, useRef } from "react";
@@ -9,16 +10,15 @@ import { jsx, jsxs } from "react/jsx-runtime";
9
10
  //#region src/auth/provider-sign-in-page.tsx
10
11
  /** What the page shows while the browser leaves for the provider `name`. */
11
12
  const ProviderRedirect = ({ name, workspace }) => /* @__PURE__ */ jsx(AuthLayout, {
12
- title: `Signing in with ${name}`,
13
+ title: text("signingInWith", name),
13
14
  description: workspace,
14
15
  children: /* @__PURE__ */ jsxs("p", {
15
16
  role: "status",
16
17
  className: "flex items-center justify-center gap-2 text-muted-foreground",
17
18
  children: [
18
19
  /* @__PURE__ */ jsx(Spinner, {}),
19
- " Taking you to ",
20
- name,
21
- "…"
20
+ " ",
21
+ text("takingYouTo", name)
22
22
  ]
23
23
  })
24
24
  });
@@ -34,7 +34,7 @@ const ProviderSignInPage = ({ provider, workspace, onFailed }) => {
34
34
  useEffect(() => {
35
35
  if (started.current) return;
36
36
  started.current = true;
37
- if (!offered) return onFailed(`Signing in with ${name} is not offered here. Sign in another way.`);
37
+ if (!offered) return onFailed(text("providerNotOffered", name));
38
38
  signInSocial(provider).catch((failure) => {
39
39
  if (!(failure instanceof AuthError)) throw failure;
40
40
  onFailed(signInMessage(failure));
@@ -1,3 +1,4 @@
1
+ import { text } from "./messages.js";
1
2
  import { Button } from "../primitives/button.js";
2
3
  import { useEffect, useState } from "react";
3
4
  import { jsx } from "react/jsx-runtime";
@@ -22,7 +23,7 @@ const ResendCodeButton = ({ onResend, cooldown = 30, disabled }) => {
22
23
  onResend();
23
24
  },
24
25
  className: "min-h-10",
25
- children: left > 0 ? `Send a new code in ${left}s` : "Send a new code"
26
+ children: left > 0 ? text("sendNewCodeIn", left) : text("sendNewCode")
26
27
  });
27
28
  };
28
29
  //#endregion
@@ -1,4 +1,5 @@
1
1
  import { Input } from "../primitives/input.js";
2
+ import { text } from "./messages.js";
2
3
  import { Button } from "../primitives/button.js";
3
4
  import { AuthLayout } from "./auth-layout.js";
4
5
  import { useState } from "react";
@@ -8,29 +9,29 @@ const ResetPasswordForm = ({ onSubmit, invalidLink, onRequestNewLink, onBack, bu
8
9
  const [repeat, setRepeat] = useState("");
9
10
  const [mismatch, setMismatch] = useState(false);
10
11
  if (invalidLink) return /* @__PURE__ */ jsxs(AuthLayout, {
11
- title: "This link no longer works",
12
+ title: text("linkExpiredTitle"),
12
13
  children: [/* @__PURE__ */ jsx("p", {
13
14
  className: "text-muted-foreground",
14
- children: "A reset link works once, for a limited time. Ask for a new one to choose your password."
15
+ children: text("linkExpiredExplanation")
15
16
  }), /* @__PURE__ */ jsxs("div", {
16
17
  className: "mt-4 flex flex-col gap-2",
17
18
  children: [onRequestNewLink && /* @__PURE__ */ jsx(Button, {
18
19
  variant: "primary",
19
20
  className: "min-h-10",
20
21
  onClick: onRequestNewLink,
21
- children: "Send a new link"
22
+ children: text("sendNewLink")
22
23
  }), /* @__PURE__ */ jsx(Button, {
23
24
  variant: onRequestNewLink ? "ghost" : "primary",
24
25
  className: "min-h-10",
25
26
  onClick: onBack,
26
- children: "Back to sign in"
27
+ children: text("backToSignIn")
27
28
  })]
28
29
  })]
29
30
  });
30
- const shown = mismatch ? "The passwords are not the same." : error;
31
+ const shown = mismatch ? text("passwordsDiffer") : error;
31
32
  return /* @__PURE__ */ jsx(AuthLayout, {
32
- title: "Choose a new password",
33
- description: `At least 12 characters.`,
33
+ title: text("choosePassword"),
34
+ description: text("atLeast", 12),
34
35
  children: /* @__PURE__ */ jsxs("form", {
35
36
  className: "flex flex-col gap-4",
36
37
  onSubmit: (event) => {
@@ -41,7 +42,7 @@ const ResetPasswordForm = ({ onSubmit, invalidLink, onRequestNewLink, onBack, bu
41
42
  children: [
42
43
  /* @__PURE__ */ jsxs("label", {
43
44
  className: "flex flex-col gap-1.5 font-medium",
44
- children: ["New password", /* @__PURE__ */ jsx(Input, {
45
+ children: [text("newPassword"), /* @__PURE__ */ jsx(Input, {
45
46
  type: "password",
46
47
  name: "new-password",
47
48
  autoComplete: "new-password",
@@ -56,7 +57,7 @@ const ResetPasswordForm = ({ onSubmit, invalidLink, onRequestNewLink, onBack, bu
56
57
  }),
57
58
  /* @__PURE__ */ jsxs("label", {
58
59
  className: "flex flex-col gap-1.5 font-medium",
59
- children: ["Repeat new password", /* @__PURE__ */ jsx(Input, {
60
+ children: [text("repeatPassword"), /* @__PURE__ */ jsx(Input, {
60
61
  type: "password",
61
62
  name: "repeat-password",
62
63
  autoComplete: "new-password",
@@ -70,7 +71,7 @@ const ResetPasswordForm = ({ onSubmit, invalidLink, onRequestNewLink, onBack, bu
70
71
  }),
71
72
  shown && /* @__PURE__ */ jsx("p", {
72
73
  role: "alert",
73
- className: "text-xs font-medium text-danger-text",
74
+ className: "text-body font-medium text-danger-text",
74
75
  children: shown
75
76
  }),
76
77
  /* @__PURE__ */ jsx(Button, {
@@ -78,7 +79,7 @@ const ResetPasswordForm = ({ onSubmit, invalidLink, onRequestNewLink, onBack, bu
78
79
  type: "submit",
79
80
  loading: busy,
80
81
  className: "min-h-10",
81
- children: "Set new password"
82
+ children: text("setPassword")
82
83
  })
83
84
  ]
84
85
  })
@@ -1,3 +1,4 @@
1
+ import { text } from "./messages.js";
1
2
  import { useAuth } from "./auth-provider.js";
2
3
  import { ResetPasswordForm } from "./reset-password-form.js";
3
4
  import { useState } from "react";
@@ -6,9 +7,9 @@ import { jsx } from "react/jsx-runtime";
6
7
  //#region src/auth/reset-password-page.tsx
7
8
  /** Better Auth's answers to a new password, in words for the person at the keyboard. */
8
9
  const resetPasswordMessage = (error) => {
9
- if (error.status === 429) return "Too many attempts. Wait a minute and try again.";
10
- if (error.code === "PASSWORD_TOO_SHORT") return `Use at least 12 characters.`;
11
- if (error.code === "PASSWORD_TOO_LONG") return "That password is too long.";
10
+ if (error.status === 429) return text("tooManyAttempts");
11
+ if (error.code === "PASSWORD_TOO_SHORT") return text("useAtLeast", 12);
12
+ if (error.code === "PASSWORD_TOO_LONG") return text("passwordTooLong");
12
13
  return error.message;
13
14
  };
14
15
  /** Sets a new password with the token of an emailed reset link. */
@@ -1,27 +1,25 @@
1
+ import { text } from "./messages.js";
1
2
  import { Button } from "../primitives/button.js";
2
3
  import { TwoFactorSetup } from "../account/two-factor-setup.js";
3
4
  import { AuthLayout } from "./auth-layout.js";
4
5
  import { KeyRound } from "lucide-react";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  //#region src/auth/setup-required-form.tsx
7
- const titles = {
8
- twoFactor: "Turn on two-factor authentication",
9
- passkey: "Add a passkey"
10
- };
8
+ const title = (step) => step === "twoFactor" ? text("turnOnTwoFactor") : text("addPasskey");
11
9
  /** Shown after signing in while the account lacks something the sign-in policy requires; the app opens once it is set up. */
12
10
  const SetupRequiredForm = ({ step, twoFactor, onAddPasskey, busy, error, onSignOut }) => /* @__PURE__ */ jsxs(AuthLayout, {
13
- title: titles[step],
14
- description: "This app requires it for every account.",
11
+ title: title(step),
12
+ description: text("requiredForEveryAccount"),
15
13
  children: [step === "twoFactor" ? /* @__PURE__ */ jsx(TwoFactorSetup, { ...twoFactor }) : /* @__PURE__ */ jsxs("div", {
16
14
  className: "flex flex-col gap-4",
17
15
  children: [
18
16
  /* @__PURE__ */ jsx("p", {
19
17
  className: "text-muted-foreground",
20
- children: "A passkey signs you in with Face ID, Touch ID, Windows Hello, your phone or a security key. Your browser asks which one to use."
18
+ children: text("passkeyExplanation")
21
19
  }),
22
20
  error && /* @__PURE__ */ jsx("p", {
23
21
  role: "alert",
24
- className: "text-xs font-medium text-danger-text",
22
+ className: "text-body font-medium text-danger-text",
25
23
  children: error
26
24
  }),
27
25
  /* @__PURE__ */ jsxs(Button, {
@@ -29,14 +27,14 @@ const SetupRequiredForm = ({ step, twoFactor, onAddPasskey, busy, error, onSignO
29
27
  loading: busy,
30
28
  onClick: onAddPasskey,
31
29
  className: "min-h-10",
32
- children: [/* @__PURE__ */ jsx(KeyRound, { className: "size-4" }), "Add a passkey"]
30
+ children: [/* @__PURE__ */ jsx(KeyRound, { className: "size-4" }), text("addPasskey")]
33
31
  })
34
32
  ]
35
33
  }), /* @__PURE__ */ jsx("button", {
36
34
  type: "button",
37
35
  onClick: onSignOut,
38
36
  className: "mt-4 w-full text-center font-medium text-muted-foreground hover:underline",
39
- children: "Sign out"
37
+ children: text("signOut")
40
38
  })]
41
39
  });
42
40
  //#endregion
@@ -1,5 +1,6 @@
1
1
  import { Spinner } from "../primitives/spinner.js";
2
2
  import { authMessage } from "./auth-messages.js";
3
+ import { text } from "./messages.js";
3
4
  import { useAuth } from "./auth-provider.js";
4
5
  import { SetupRequiredForm } from "./setup-required-form.js";
5
6
  import { useEffect, useState } from "react";
@@ -13,7 +14,7 @@ const SetupRequiredPage = ({ missing }) => {
13
14
  const [busy, setBusy] = useState(false);
14
15
  const [error, setError] = useState();
15
16
  useEffect(() => {
16
- session.account.signInMethods().then(setMethods, (failure) => setError(failure instanceof AuthError ? authMessage(failure) : "Could not read your account"));
17
+ session.account.signInMethods().then(setMethods, (failure) => setError(failure instanceof AuthError ? authMessage(failure) : text("couldNotReadAccount")));
17
18
  }, [session]);
18
19
  const addPasskey = async () => {
19
20
  setBusy(true);
@@ -29,7 +30,11 @@ const SetupRequiredPage = ({ missing }) => {
29
30
  };
30
31
  if (!methods && !error) return /* @__PURE__ */ jsxs("div", {
31
32
  className: "flex h-full min-h-48 items-center justify-center gap-2 text-muted-foreground",
32
- children: [/* @__PURE__ */ jsx(Spinner, {}), " Loading"]
33
+ children: [
34
+ /* @__PURE__ */ jsx(Spinner, {}),
35
+ " ",
36
+ text("loading")
37
+ ]
33
38
  });
34
39
  return /* @__PURE__ */ jsx(SetupRequiredForm, {
35
40
  step: missing[0],
@@ -1,5 +1,6 @@
1
1
  import { RouteLink } from "../primitives/route-link.js";
2
2
  import { Input } from "../primitives/input.js";
3
+ import { text } from "./messages.js";
3
4
  import { Button } from "../primitives/button.js";
4
5
  import { AuthLayout } from "./auth-layout.js";
5
6
  import { ProviderIcon } from "./provider-icon.js";
@@ -11,7 +12,7 @@ const Divider = () => /* @__PURE__ */ jsxs("div", {
11
12
  className: "my-4 flex items-center gap-3 text-xs text-muted-foreground",
12
13
  children: [
13
14
  /* @__PURE__ */ jsx("span", { className: "h-px flex-1 bg-border" }),
14
- "or",
15
+ text("or"),
15
16
  /* @__PURE__ */ jsx("span", { className: "h-px flex-1 bg-border" })
16
17
  ]
17
18
  });
@@ -28,12 +29,12 @@ const SignInForm = ({ onSubmit, busy, error, workspace, notice, methods = ["pass
28
29
  onSendCode?.(email.trim());
29
30
  };
30
31
  return /* @__PURE__ */ jsxs(AuthLayout, {
31
- title: "Sign in to Protobase",
32
+ title: text("signInTitle"),
32
33
  description: workspace,
33
34
  children: [
34
35
  notice && /* @__PURE__ */ jsx("p", {
35
36
  role: "status",
36
- className: "mb-4 rounded-md bg-success-soft px-3 py-2 text-xs font-medium text-success-text",
37
+ className: "mb-4 rounded-md bg-success-soft px-3 py-2 text-body font-medium text-success-text",
37
38
  children: notice
38
39
  }),
39
40
  (offered.length > 0 || withPasskey) && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
@@ -43,30 +44,26 @@ const SignInForm = ({ onSubmit, busy, error, workspace, notice, methods = ["pass
43
44
  onClick: () => onContinueWith?.(provider.id),
44
45
  disabled: busy,
45
46
  className: "min-h-10 w-full",
46
- children: [
47
- /* @__PURE__ */ jsx(ProviderIcon, { id: provider.id }),
48
- "Continue with ",
49
- provider.name
50
- ]
47
+ children: [/* @__PURE__ */ jsx(ProviderIcon, { id: provider.id }), text("continueWith", provider.name)]
51
48
  }, provider.id)),
52
49
  withPasskey && /* @__PURE__ */ jsxs(Button, {
53
50
  onClick: () => onPasskey?.(),
54
51
  disabled: busy,
55
52
  className: "min-h-10 w-full",
56
- children: [/* @__PURE__ */ jsx(KeyRound, { className: "size-4" }), "Sign in with a passkey"]
53
+ children: [/* @__PURE__ */ jsx(KeyRound, { className: "size-4" }), text("signInWithPasskey")]
57
54
  }),
58
- withPasskey && passkeyDomains.slice(1).map((domain) => /* @__PURE__ */ jsxs(Button, {
55
+ withPasskey && passkeyDomains.slice(1).map((domain) => /* @__PURE__ */ jsx(Button, {
59
56
  variant: "ghost",
60
57
  size: "sm",
61
58
  onClick: () => onPasskey?.(domain),
62
59
  disabled: busy,
63
60
  className: "w-full",
64
- children: ["Use a passkey made for ", domain]
61
+ children: text("passkeyFor", domain)
65
62
  }, domain))
66
63
  ]
67
64
  }), withPassword || withCode ? /* @__PURE__ */ jsx(Divider, {}) : error && /* @__PURE__ */ jsx("p", {
68
65
  role: "alert",
69
- className: "mt-4 text-xs font-medium text-danger-text",
66
+ className: "mt-4 text-body font-medium text-danger-text",
70
67
  children: error
71
68
  })] }),
72
69
  (withPassword || withCode) && /* @__PURE__ */ jsxs("form", {
@@ -79,7 +76,7 @@ const SignInForm = ({ onSubmit, busy, error, workspace, notice, methods = ["pass
79
76
  children: [
80
77
  /* @__PURE__ */ jsxs("label", {
81
78
  className: "flex flex-col gap-1.5 font-medium",
82
- children: ["Email", /* @__PURE__ */ jsx(Input, {
79
+ children: [text("email"), /* @__PURE__ */ jsx(Input, {
83
80
  ref: emailInput,
84
81
  type: "email",
85
82
  name: "email",
@@ -94,7 +91,7 @@ const SignInForm = ({ onSubmit, busy, error, workspace, notice, methods = ["pass
94
91
  }),
95
92
  withPassword && /* @__PURE__ */ jsxs("label", {
96
93
  className: "flex flex-col gap-1.5 font-medium",
97
- children: ["Password", /* @__PURE__ */ jsx(Input, {
94
+ children: [text("password"), /* @__PURE__ */ jsx(Input, {
98
95
  type: "password",
99
96
  name: "password",
100
97
  autoComplete: "current-password",
@@ -107,7 +104,7 @@ const SignInForm = ({ onSubmit, busy, error, workspace, notice, methods = ["pass
107
104
  }),
108
105
  error && /* @__PURE__ */ jsx("p", {
109
106
  role: "alert",
110
- className: "text-xs font-medium text-danger-text",
107
+ className: "text-body font-medium text-danger-text",
111
108
  children: error
112
109
  }),
113
110
  withPassword && /* @__PURE__ */ jsx(Button, {
@@ -115,7 +112,7 @@ const SignInForm = ({ onSubmit, busy, error, workspace, notice, methods = ["pass
115
112
  type: "submit",
116
113
  loading: busy,
117
114
  className: "min-h-10",
118
- children: "Sign in"
115
+ children: text("signIn")
119
116
  }),
120
117
  withCode && /* @__PURE__ */ jsxs(Button, {
121
118
  variant: withPassword ? "secondary" : "primary",
@@ -124,24 +121,24 @@ const SignInForm = ({ onSubmit, busy, error, workspace, notice, methods = ["pass
124
121
  loading: busy && !withPassword,
125
122
  disabled: busy,
126
123
  className: "min-h-10",
127
- children: [/* @__PURE__ */ jsx(Mail, { className: "size-4" }), "Email me a sign-in code"]
124
+ children: [/* @__PURE__ */ jsx(Mail, { className: "size-4" }), text("emailSignInCode")]
128
125
  }),
129
126
  withPassword && forgotPassword && /* @__PURE__ */ jsx(RouteLink, {
130
127
  to: forgotPassword,
131
128
  className: "self-center font-medium text-primary-text hover:underline",
132
- children: "Forgot password?"
129
+ children: text("forgotPassword")
133
130
  })
134
131
  ]
135
132
  }),
136
133
  signUp && /* @__PURE__ */ jsxs("p", {
137
134
  className: "mt-4 text-center text-muted-foreground",
138
135
  children: [
139
- "New here?",
136
+ text("newHere"),
140
137
  " ",
141
138
  /* @__PURE__ */ jsx(RouteLink, {
142
139
  to: signUp,
143
140
  className: "font-medium text-primary-text hover:underline",
144
- children: "Create an account"
141
+ children: text("createAnAccount")
145
142
  })
146
143
  ]
147
144
  }),
@@ -149,7 +146,7 @@ const SignInForm = ({ onSubmit, busy, error, workspace, notice, methods = ["pass
149
146
  type: "button",
150
147
  onClick: onBrowse,
151
148
  className: "mt-4 w-full text-center font-medium text-muted-foreground hover:text-foreground hover:underline",
152
- children: "Continue without signing in"
149
+ children: text("browse")
153
150
  })
154
151
  ]
155
152
  });
@@ -1,4 +1,5 @@
1
1
  import { RouteLink } from "../primitives/route-link.js";
2
+ import { text } from "./messages.js";
2
3
  import { useAuth } from "./auth-provider.js";
3
4
  import { Button, buttonClass } from "../primitives/button.js";
4
5
  import { useSignInAddress } from "./use-sign-in-address.js";
@@ -31,12 +32,12 @@ const Actions = ({ prompt }) => {
31
32
  }) : canSignUp && /* @__PURE__ */ jsx(RouteLink, {
32
33
  to: link("sign-up"),
33
34
  className: primary,
34
- children: "Create an account"
35
+ children: text("createAnAccount")
35
36
  });
36
37
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(RouteLink, {
37
38
  to: link(),
38
39
  className: signUp ? buttonClass() : primary,
39
- children: "Sign in"
40
+ children: text("signIn")
40
41
  }), signUp] });
41
42
  };
42
43
  /**
@@ -55,7 +56,7 @@ const SignInPrompt = (props) => {
55
56
  onClose: props.onClose,
56
57
  actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
57
58
  onClick: props.onClose,
58
- children: "Not now"
59
+ children: text("notNow")
59
60
  }), /* @__PURE__ */ jsx(Actions, { prompt })] }),
60
61
  children: /* @__PURE__ */ jsx(Benefits, { benefits: prompt.benefits })
61
62
  });
@@ -1,21 +1,19 @@
1
+ import { text } from "./messages.js";
1
2
  import { CodeForm } from "./code-form.js";
2
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { slotted } from "../locale/slotted.js";
4
+ import { Fragment, jsx } from "react/jsx-runtime";
3
5
  //#region src/auth/sign-up-code-form.tsx
4
6
  /** The second step of making an account: the emailed code on its own, before the name and password. */
5
7
  const SignUpCodeForm = ({ email, onBack, ...rest }) => /* @__PURE__ */ jsx(CodeForm, {
6
- title: "Check your email",
7
- description: "Enter the code we sent to create your account.",
8
- explanation: /* @__PURE__ */ jsxs(Fragment, { children: [
9
- "A 6-digit code is on its way to ",
10
- /* @__PURE__ */ jsx("span", {
11
- className: "font-medium text-foreground",
12
- children: email
13
- }),
14
- ". It works for 5 minutes, once. If the address has an account already, the email says so instead."
15
- ] }),
16
- submitLabel: "Continue",
8
+ title: text("checkEmail"),
9
+ description: text("signUpCodeDescription"),
10
+ explanation: /* @__PURE__ */ jsx(Fragment, { children: slotted(text("signUpCodeSent"), /* @__PURE__ */ jsx("span", {
11
+ className: "font-medium text-foreground",
12
+ children: email
13
+ })) }),
14
+ submitLabel: text("continue"),
17
15
  onChangeAddress: onBack,
18
- changeAddressLabel: "Use another address",
16
+ changeAddressLabel: text("useAnotherAddress"),
19
17
  ...rest
20
18
  });
21
19
  //#endregion
@@ -1,6 +1,8 @@
1
1
  import { Input } from "../primitives/input.js";
2
+ import { text } from "./messages.js";
2
3
  import { Button } from "../primitives/button.js";
3
4
  import { AuthLayout } from "./auth-layout.js";
5
+ import { slotted } from "../locale/slotted.js";
4
6
  import { useId, useState } from "react";
5
7
  import { jsx, jsxs } from "react/jsx-runtime";
6
8
  //#region src/auth/sign-up-details-form.tsx
@@ -12,18 +14,14 @@ const SignUpDetailsForm = ({ email, onSubmit, onBack, methods, busy, error }) =>
12
14
  const withPassword = methods.includes("password");
13
15
  const passwordOptional = methods.includes("emailCode");
14
16
  return /* @__PURE__ */ jsxs(AuthLayout, {
15
- title: "Your details",
16
- description: "One last step to create your account.",
17
- children: [/* @__PURE__ */ jsxs("p", {
17
+ title: text("detailsTitle"),
18
+ description: text("detailsDescription"),
19
+ children: [/* @__PURE__ */ jsx("p", {
18
20
  className: "mb-4 text-muted-foreground",
19
- children: [
20
- "The code was right: the account is for ",
21
- /* @__PURE__ */ jsx("span", {
22
- className: "font-medium text-foreground",
23
- children: email
24
- }),
25
- "."
26
- ]
21
+ children: slotted(text("codeWasRight"), /* @__PURE__ */ jsx("span", {
22
+ className: "font-medium text-foreground",
23
+ children: email
24
+ }))
27
25
  }), /* @__PURE__ */ jsxs("form", {
28
26
  className: "flex flex-col gap-4",
29
27
  onSubmit: (event) => {
@@ -36,7 +34,7 @@ const SignUpDetailsForm = ({ email, onSubmit, onBack, methods, busy, error }) =>
36
34
  children: [
37
35
  /* @__PURE__ */ jsxs("label", {
38
36
  className: "flex flex-col gap-1.5 font-medium",
39
- children: ["Your name", /* @__PURE__ */ jsx(Input, {
37
+ children: [text("yourName"), /* @__PURE__ */ jsx(Input, {
40
38
  name: "name",
41
39
  autoComplete: "name",
42
40
  required: true,
@@ -51,7 +49,7 @@ const SignUpDetailsForm = ({ email, onSubmit, onBack, methods, busy, error }) =>
51
49
  className: "flex flex-col gap-1.5",
52
50
  children: [/* @__PURE__ */ jsxs("label", {
53
51
  className: "flex flex-col gap-1.5 font-medium",
54
- children: [passwordOptional ? "Password (optional)" : "Password", /* @__PURE__ */ jsx(Input, {
52
+ children: [passwordOptional ? text("passwordOptional") : text("password"), /* @__PURE__ */ jsx(Input, {
55
53
  type: "password",
56
54
  name: "password",
57
55
  autoComplete: "new-password",
@@ -66,17 +64,12 @@ const SignUpDetailsForm = ({ email, onSubmit, onBack, methods, busy, error }) =>
66
64
  }), /* @__PURE__ */ jsxs("p", {
67
65
  id: passwordHint,
68
66
  className: "text-xs text-muted-foreground",
69
- children: [
70
- "At least ",
71
- 12,
72
- " characters.",
73
- passwordOptional && " Without one, you sign in with a code we email you."
74
- ]
67
+ children: [text("atLeast", 12), passwordOptional && text("withoutPassword")]
75
68
  })]
76
69
  }),
77
70
  error && /* @__PURE__ */ jsx("p", {
78
71
  role: "alert",
79
- className: "text-xs font-medium text-danger-text",
72
+ className: "text-body font-medium text-danger-text",
80
73
  children: error
81
74
  }),
82
75
  /* @__PURE__ */ jsx(Button, {
@@ -84,13 +77,13 @@ const SignUpDetailsForm = ({ email, onSubmit, onBack, methods, busy, error }) =>
84
77
  type: "submit",
85
78
  loading: busy,
86
79
  className: "min-h-10",
87
- children: "Create account"
80
+ children: text("createAccount")
88
81
  }),
89
82
  /* @__PURE__ */ jsx(Button, {
90
83
  variant: "ghost",
91
84
  onClick: onBack,
92
85
  className: "min-h-10",
93
- children: "Use another address"
86
+ children: text("useAnotherAddress")
94
87
  })
95
88
  ]
96
89
  })]
@@ -1,4 +1,5 @@
1
1
  import { Input } from "../primitives/input.js";
2
+ import { text } from "./messages.js";
2
3
  import { Button } from "../primitives/button.js";
3
4
  import { AuthLayout } from "./auth-layout.js";
4
5
  import { useState } from "react";
@@ -9,7 +10,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
9
10
  const SignUpEmailForm = ({ onSubmit, onSignIn, onBrowse, busy, error, workspace }) => {
10
11
  const [email, setEmail] = useState("");
11
12
  return /* @__PURE__ */ jsxs(AuthLayout, {
12
- title: "Create an account",
13
+ title: text("createAnAccount"),
13
14
  description: workspace,
14
15
  children: [/* @__PURE__ */ jsxs("form", {
15
16
  className: "flex flex-col gap-4",
@@ -20,7 +21,7 @@ const SignUpEmailForm = ({ onSubmit, onSignIn, onBrowse, busy, error, workspace
20
21
  children: [
21
22
  /* @__PURE__ */ jsxs("label", {
22
23
  className: "flex flex-col gap-1.5 font-medium",
23
- children: ["Email", /* @__PURE__ */ jsx(Input, {
24
+ children: [text("email"), /* @__PURE__ */ jsx(Input, {
24
25
  type: "email",
25
26
  name: "email",
26
27
  autoComplete: "email",
@@ -34,11 +35,11 @@ const SignUpEmailForm = ({ onSubmit, onSignIn, onBrowse, busy, error, workspace
34
35
  }),
35
36
  /* @__PURE__ */ jsx("p", {
36
37
  className: "text-muted-foreground",
37
- children: "We email you a code to make sure the address is yours."
38
+ children: text("codeToConfirm")
38
39
  }),
39
40
  error && /* @__PURE__ */ jsx("p", {
40
41
  role: "alert",
41
- className: "text-xs font-medium text-danger-text",
42
+ className: "text-body font-medium text-danger-text",
42
43
  children: error
43
44
  }),
44
45
  /* @__PURE__ */ jsxs(Button, {
@@ -46,18 +47,18 @@ const SignUpEmailForm = ({ onSubmit, onSignIn, onBrowse, busy, error, workspace
46
47
  type: "submit",
47
48
  loading: busy,
48
49
  className: "min-h-10",
49
- children: [/* @__PURE__ */ jsx(Mail, { className: "size-4" }), "Email me a code"]
50
+ children: [/* @__PURE__ */ jsx(Mail, { className: "size-4" }), text("emailCode")]
50
51
  }),
51
52
  /* @__PURE__ */ jsxs("p", {
52
53
  className: "text-center text-muted-foreground",
53
54
  children: [
54
- "Have an account?",
55
+ text("haveAccount"),
55
56
  " ",
56
57
  /* @__PURE__ */ jsx("button", {
57
58
  type: "button",
58
59
  onClick: onSignIn,
59
60
  className: "font-medium text-primary-text hover:underline",
60
- children: "Sign in"
61
+ children: text("signIn")
61
62
  })
62
63
  ]
63
64
  })
@@ -66,7 +67,7 @@ const SignUpEmailForm = ({ onSubmit, onSignIn, onBrowse, busy, error, workspace
66
67
  type: "button",
67
68
  onClick: onBrowse,
68
69
  className: "mt-4 w-full text-center font-medium text-muted-foreground hover:text-foreground hover:underline",
69
- children: "Continue without an account"
70
+ children: text("browseWithoutAccount")
70
71
  })]
71
72
  });
72
73
  };
@@ -1,4 +1,5 @@
1
1
  import { authMessage } from "./auth-messages.js";
2
+ import { text } from "./messages.js";
2
3
  import { useAuth } from "./auth-provider.js";
3
4
  import { SignUpCodeForm } from "./sign-up-code-form.js";
4
5
  import { SignUpDetailsForm } from "./sign-up-details-form.js";
@@ -49,7 +50,7 @@ const SignUpPage = ({ workspace, email, ticket, onCodeSent, onVerified, onBack,
49
50
  onSubmit: (code) => void attempt(async () => onVerified(await verifySignUpCode(email, code))),
50
51
  onResend: () => void attempt(async () => {
51
52
  await sendSignUpCode(email);
52
- setNotice("A new code is on its way. Only the newest one works.");
53
+ setNotice(text("newCodeSent"));
53
54
  })
54
55
  });
55
56
  return /* @__PURE__ */ jsx(SignUpDetailsForm, {