@declarion/react 0.66.1 → 0.80.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 (66) hide show
  1. package/README.md +1 -1
  2. package/dist-lib/api/auth.js +24 -14
  3. package/dist-lib/app.js +28 -23
  4. package/dist-lib/components/chrome/AssociationTabs.js +35 -38
  5. package/dist-lib/components/chrome/HighlightsStrip.js +2 -1
  6. package/dist-lib/components/chrome/RecordHeader.js +33 -38
  7. package/dist-lib/components/detail-layout/AssociatedBlock.js +10 -21
  8. package/dist-lib/components/detail-layout/ChildrenBlock.js +1 -8
  9. package/dist-lib/components/detail-layout/ChildrenCards.js +1 -8
  10. package/dist-lib/components/detail-layout/ChildrenList.js +1 -8
  11. package/dist-lib/components/detail-layout/ChildrenTable.js +1 -8
  12. package/dist-lib/components/detail-layout/ChildrenTimeline.js +1 -8
  13. package/dist-lib/components/detail-layout/DetailAuditStrip.js +33 -29
  14. package/dist-lib/components/detail-layout/DetailHighlights.js +7 -2
  15. package/dist-lib/components/detail-layout/FieldsBlock.js +12 -9
  16. package/dist-lib/components/detail-layout/LayoutRenderer.js +10 -10
  17. package/dist-lib/components/detail-layout/LayoutTabs.js +49 -48
  18. package/dist-lib/components/detail-layout/SectionBlock.js +20 -28
  19. package/dist-lib/components/detail-layout/visibility.js +28 -0
  20. package/dist-lib/components/fields/IntArrayField.js +37 -33
  21. package/dist-lib/components/fields/NumberField.js +28 -55
  22. package/dist-lib/components/fields/RichTextField.js +1 -1
  23. package/dist-lib/components/fields/TimestampField.js +50 -89
  24. package/dist-lib/components/fields/cells/factories/date.js +13 -14
  25. package/dist-lib/components/fields/cells/factories/money.js +1 -1
  26. package/dist-lib/components/fields/cells/factories/number.js +4 -4
  27. package/dist-lib/components/file-widgets/DocumentCard.js +1 -1
  28. package/dist-lib/components/file-widgets/Grid.js +153 -152
  29. package/dist-lib/components/file-widgets/ImageWidget.js +90 -91
  30. package/dist-lib/components/file-widgets/LabeledSlots.js +1 -0
  31. package/dist-lib/components/file-widgets/helpers.js +15 -19
  32. package/dist-lib/components/file-widgets/host.js +33 -32
  33. package/dist-lib/components/file-widgets/upload.js +10 -6
  34. package/dist-lib/components/layout/Layout.js +125 -123
  35. package/dist-lib/components/pages/NoScreensPage.impl.js +14 -0
  36. package/dist-lib/components/pages/NoScreensPage.js +12 -0
  37. package/dist-lib/components/pages/SmartDetailPage.impl.js +451 -451
  38. package/dist-lib/components/pages/auth/AuthShell.js +62 -61
  39. package/dist-lib/components/pages/auth/CodeInput.js +63 -0
  40. package/dist-lib/components/pages/auth/SignIn.js +12 -4
  41. package/dist-lib/components/pages/auth/SignUp.impl.js +80 -103
  42. package/dist-lib/components/pages/auth/SignUpCode.js +122 -0
  43. package/dist-lib/components/pages/auth/TwoFA.impl.js +9 -55
  44. package/dist-lib/components/pages/list/cardProjection.js +135 -122
  45. package/dist-lib/components/pages/list/columns.js +58 -43
  46. package/dist-lib/components/pages/profile/Profile.impl.js +87 -104
  47. package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +1 -1
  48. package/dist-lib/components/params/ParamsBlock.js +6 -17
  49. package/dist-lib/components/params/param-editors.js +14 -10
  50. package/dist-lib/components/primitives/Fields.js +314 -236
  51. package/dist-lib/components/shared/MarkdownRenderer.js +44 -43
  52. package/dist-lib/declarion-react.css +1 -1
  53. package/dist-lib/hooks/useActiveTabFollowsRoute.js +49 -0
  54. package/dist-lib/hooks/useAuth.js +44 -37
  55. package/dist-lib/hooks/useDocumentTitle.js +20 -0
  56. package/dist-lib/hooks/useFollowAgentOpen.js +1 -0
  57. package/dist-lib/hooks/useTabTitle.js +1 -1
  58. package/dist-lib/index.d.ts +21 -7
  59. package/dist-lib/lib/date-text.js +57 -0
  60. package/dist-lib/lib/number-text.js +9 -0
  61. package/dist-lib/lib/timestamp.js +29 -29
  62. package/dist-lib/stores/tabs.js +7 -5
  63. package/dist-lib/testing.d.ts +1 -1
  64. package/dist-lib/testing.js +1 -0
  65. package/dist-lib/{useResponsiveMode-DmrpMbZX.d.ts → useResponsiveMode-D3SKz5z4.d.ts} +20 -9
  66. package/package.json +11 -11
@@ -2,39 +2,40 @@ import { Icon as e } from "../../primitives/Icons.js";
2
2
  import { IconBtn as t } from "../../primitives/IconBtn.js";
3
3
  import { useText as n } from "../../../hooks/useText.js";
4
4
  import { useResponsiveMode as r } from "../../../hooks/useResponsiveMode.js";
5
- import { BrandLogo as i } from "../../primitives/BrandLogo.js";
6
- import { usePublicParams as a } from "../../../hooks/useParams.js";
7
- import { useBranding as o } from "../../../hooks/useBranding.js";
8
- import { usePreferencesStore as s } from "../../../stores/preferences.js";
9
- import { pageInsetX as c } from "../../../lib/page-inset.js";
10
- import { useEffect as l, useMemo as u } from "react";
11
- import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
5
+ import { isValidLogoUrl as i } from "../../../lib/branding.js";
6
+ import { BrandLogo as a } from "../../primitives/BrandLogo.js";
7
+ import { usePublicParams as o } from "../../../hooks/useParams.js";
8
+ import { useBranding as s } from "../../../hooks/useBranding.js";
9
+ import { usePreferencesStore as c } from "../../../stores/preferences.js";
10
+ import { pageInsetX as l } from "../../../lib/page-inset.js";
11
+ import { useEffect as u, useMemo as d } from "react";
12
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
12
13
  //#region src/components/pages/auth/AuthShell.tsx
13
- var m = 560;
14
- function h(e) {
14
+ var h = 560;
15
+ function g(e) {
15
16
  try {
16
17
  return new URL(e).host;
17
18
  } catch {
18
19
  return e;
19
20
  }
20
21
  }
21
- function g(e, t) {
22
+ function _(e, t) {
22
23
  if (!e) return "";
23
24
  let n = t ? t.slice(0, 7) : "";
24
25
  if (!n || !t) return e;
25
26
  let r = Math.min(e.length, t.length);
26
27
  return e.slice(0, r) === t.slice(0, r) ? e : `${e}+${n}`;
27
28
  }
28
- function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x, badges: S, brandName: C }) {
29
- let w = n(), T = s((e) => e.colorScheme), E = r(), D = s((e) => e.set), O = s((e) => e.hydrateFromBranding), k = () => D("colorScheme", T === "dark" ? "light" : "dark"), { branding: A } = o(), j = A?.chrome?.auth?.brand_panel;
30
- l(() => {
29
+ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S, badges: C, brandName: ee }) {
30
+ let w = n(), T = c((e) => e.colorScheme), E = r(), D = c((e) => e.set), O = c((e) => e.hydrateFromBranding), k = () => D("colorScheme", T === "dark" ? "light" : "dark"), { branding: A } = s(), j = A?.chrome?.auth?.brand_panel;
31
+ u(() => {
31
32
  O(A?.preferences);
32
33
  }, [A, O]);
33
- let M = A?.identity, N = C ?? M?.wordmark ?? M?.app_name ?? "", P = y ?? w(M?.auth_tagline), F = b ?? w(M?.auth_subtagline), I = x ?? M?.version_label ?? "", L = u(() => S && S.length ? S : (M?.auth_badges ?? []).map((e) => w(e)).filter(Boolean).slice(0, 8).map((e) => [e, "shield"]), [
34
- S,
34
+ let M = A?.identity, N = ee ?? M?.wordmark ?? M?.app_name ?? "", P = b ?? w(M?.auth_tagline), F = x ?? w(M?.auth_subtagline), I = S ?? M?.version_label ?? "", L = d(() => C && C.length ? C : (M?.auth_badges ?? []).map((e) => w(e)).filter(Boolean).slice(0, 8).map((e) => [e, "shield"]), [
35
+ C,
35
36
  M?.auth_badges,
36
37
  w
37
- ]), R = M?.workspace_domain ?? "", z = !!(v && R), B = M?.status_url ?? "", V = !!B, H = M?.legal_links, U = u(() => [
38
+ ]), R = M?.workspace_domain ?? "", z = !!(y && R), B = M?.status_url ?? "", V = !!B, H = M?.legal_links, U = d(() => [
38
39
  [w("auth.footer.security", "Security"), H?.security_url ?? ""],
39
40
  [w("auth.footer.privacy", "Privacy"), H?.privacy_url ?? ""],
40
41
  [w("auth.footer.terms", "Terms"), H?.terms_url ?? ""],
@@ -45,7 +46,7 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
45
46
  H?.terms_url,
46
47
  H?.docs_url,
47
48
  w
48
- ]), W = M?.legal_entity ?? "", G = `© ${(/* @__PURE__ */ new Date()).getFullYear()}${W ? ` ${W}` : ""}`, { data: K } = a(), q = K?.meta, J = g(q?.version, q?.revision), Y = [q?.region ? w("auth.meta.region", "Region: {value}", { value: q.region }) : "", J ? w("auth.meta.build", "Build {value}", { value: J }) : ""].filter(Boolean).join(" · "), X = E.isPhone || E.height < m, Z = j !== "end", Q = !X && /* @__PURE__ */ p("div", {
49
+ ]), W = M?.legal_entity ?? "", G = `© ${(/* @__PURE__ */ new Date()).getFullYear()}${W ? ` ${W}` : ""}`, { data: K } = o(), q = K?.meta, J = _(q?.version, q?.revision), Y = [q?.region ? w("auth.meta.region", "Region: {value}", { value: q.region }) : "", J ? w("auth.meta.build", "Build {value}", { value: J }) : ""].filter(Boolean).join(" · "), X = E.isPhone || E.height < h, Z = j !== "end", Q = i(M?.app_logo_on_accent) ? M?.app_logo_on_accent : M?.app_logo, $ = !X && /* @__PURE__ */ m("div", {
49
50
  "data-testid": "auth-brand-panel",
50
51
  style: {
51
52
  padding: "36px 36px 28px",
@@ -57,7 +58,7 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
57
58
  overflow: "hidden"
58
59
  },
59
60
  children: [
60
- /* @__PURE__ */ f("div", { style: {
61
+ /* @__PURE__ */ p("div", { style: {
61
62
  position: "absolute",
62
63
  top: -80,
63
64
  right: -80,
@@ -66,7 +67,7 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
66
67
  borderRadius: "50%",
67
68
  background: "radial-gradient(circle, var(--auth-panel-glow-1) 0%, transparent 70%)"
68
69
  } }),
69
- /* @__PURE__ */ f("div", { style: {
70
+ /* @__PURE__ */ p("div", { style: {
70
71
  position: "absolute",
71
72
  bottom: -60,
72
73
  left: -40,
@@ -75,7 +76,7 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
75
76
  borderRadius: "50%",
76
77
  background: "radial-gradient(circle, var(--auth-panel-glow-2) 0%, transparent 70%)"
77
78
  } }),
78
- /* @__PURE__ */ p("div", {
79
+ /* @__PURE__ */ m("div", {
79
80
  style: {
80
81
  display: "flex",
81
82
  alignItems: "center",
@@ -83,11 +84,11 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
83
84
  position: "relative"
84
85
  },
85
86
  children: [
86
- /* @__PURE__ */ f(i, {
87
- appLogo: M?.app_logo,
87
+ /* @__PURE__ */ p(a, {
88
+ appLogo: Q,
88
89
  size: 34
89
90
  }),
90
- N && /* @__PURE__ */ f("span", {
91
+ N && /* @__PURE__ */ p("span", {
91
92
  style: {
92
93
  fontSize: 18,
93
94
  fontWeight: 600,
@@ -95,7 +96,7 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
95
96
  },
96
97
  children: N
97
98
  }),
98
- I && /* @__PURE__ */ f("span", {
99
+ I && /* @__PURE__ */ p("span", {
99
100
  className: "mono",
100
101
  style: {
101
102
  fontSize: 10,
@@ -108,7 +109,7 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
108
109
  })
109
110
  ]
110
111
  }),
111
- (M?.app_logo || N) && /* @__PURE__ */ p("div", {
112
+ (Q || N) && /* @__PURE__ */ m("div", {
112
113
  style: {
113
114
  marginTop: 48,
114
115
  position: "relative",
@@ -117,11 +118,11 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
117
118
  alignItems: "center",
118
119
  gap: 16
119
120
  },
120
- children: [M?.app_logo && /* @__PURE__ */ f(i, {
121
- appLogo: M.app_logo,
121
+ children: [Q && /* @__PURE__ */ p(a, {
122
+ appLogo: Q,
122
123
  size: 96,
123
124
  radius: 0
124
- }), N && /* @__PURE__ */ f("span", {
125
+ }), N && /* @__PURE__ */ p("span", {
125
126
  style: {
126
127
  fontSize: 28,
127
128
  fontWeight: 600,
@@ -131,13 +132,13 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
131
132
  children: N
132
133
  })]
133
134
  }),
134
- /* @__PURE__ */ p("div", {
135
+ /* @__PURE__ */ m("div", {
135
136
  style: {
136
137
  marginTop: "auto",
137
138
  position: "relative"
138
139
  },
139
140
  children: [
140
- P && /* @__PURE__ */ f("h1", {
141
+ P && /* @__PURE__ */ p("h1", {
141
142
  style: {
142
143
  margin: 0,
143
144
  fontSize: 26,
@@ -147,7 +148,7 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
147
148
  },
148
149
  children: P
149
150
  }),
150
- F && /* @__PURE__ */ f("p", {
151
+ F && /* @__PURE__ */ p("p", {
151
152
  style: {
152
153
  margin: "10px 0 0",
153
154
  fontSize: 13,
@@ -156,7 +157,7 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
156
157
  },
157
158
  children: F
158
159
  }),
159
- L.length > 0 && /* @__PURE__ */ f("div", {
160
+ L.length > 0 && /* @__PURE__ */ p("div", {
160
161
  style: {
161
162
  marginTop: 22,
162
163
  display: "grid",
@@ -167,20 +168,20 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
167
168
  },
168
169
  children: L.map(([t, n]) => {
169
170
  let r = e[n];
170
- return /* @__PURE__ */ p("div", {
171
+ return /* @__PURE__ */ m("div", {
171
172
  style: {
172
173
  display: "flex",
173
174
  alignItems: "center",
174
175
  gap: 6
175
176
  },
176
- children: [r && /* @__PURE__ */ f(r, {
177
+ children: [r && /* @__PURE__ */ p(r, {
177
178
  size: 12,
178
- style: { color: "var(--accent-hover)" }
179
- }), /* @__PURE__ */ f("span", { children: t })]
179
+ style: { color: "var(--auth-panel-fg)" }
180
+ }), /* @__PURE__ */ p("span", { children: t })]
180
181
  }, t);
181
182
  })
182
183
  }),
183
- V && /* @__PURE__ */ f("a", {
184
+ V && /* @__PURE__ */ p("a", {
184
185
  href: B,
185
186
  target: "_blank",
186
187
  rel: "noopener noreferrer",
@@ -198,13 +199,13 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
198
199
  color: "var(--auth-panel-fg-muted)",
199
200
  textDecoration: "none"
200
201
  },
201
- children: h(B)
202
+ children: g(B)
202
203
  })
203
204
  ]
204
205
  })
205
206
  ]
206
207
  });
207
- return /* @__PURE__ */ p("div", {
208
+ return /* @__PURE__ */ m("div", {
208
209
  style: {
209
210
  minHeight: "var(--app-height)",
210
211
  background: "var(--background)",
@@ -214,11 +215,11 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
214
215
  overflowX: "hidden"
215
216
  },
216
217
  children: [
217
- /* @__PURE__ */ p("div", {
218
+ /* @__PURE__ */ m("div", {
218
219
  style: {
219
220
  paddingTop: X ? 12 : 16,
220
221
  paddingBottom: X ? 12 : 16,
221
- ...X ? c(14) : {
222
+ ...X ? l(14) : {
222
223
  paddingLeft: 20,
223
224
  paddingRight: 20
224
225
  },
@@ -227,11 +228,11 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
227
228
  gap: 10
228
229
  },
229
230
  children: [
230
- /* @__PURE__ */ f(i, {
231
+ /* @__PURE__ */ p(a, {
231
232
  appLogo: M?.app_logo,
232
233
  size: 26
233
234
  }),
234
- N && /* @__PURE__ */ f("span", {
235
+ N && /* @__PURE__ */ p("span", {
235
236
  style: {
236
237
  fontSize: 14,
237
238
  fontWeight: 600,
@@ -243,7 +244,7 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
243
244
  },
244
245
  children: N
245
246
  }),
246
- z && /* @__PURE__ */ p("span", {
247
+ z && /* @__PURE__ */ m("span", {
247
248
  className: "mono",
248
249
  style: {
249
250
  marginLeft: 6,
@@ -255,20 +256,20 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
255
256
  borderRadius: "var(--radius-sm)"
256
257
  },
257
258
  children: [
258
- v,
259
+ y,
259
260
  ".",
260
261
  R
261
262
  ]
262
263
  }),
263
- /* @__PURE__ */ f("div", { style: { flex: 1 } }),
264
- /* @__PURE__ */ f(t, {
265
- icon: f(T === "dark" ? e.sun : e.moon, { size: 14 }),
264
+ /* @__PURE__ */ p("div", { style: { flex: 1 } }),
265
+ /* @__PURE__ */ p(t, {
266
+ icon: p(T === "dark" ? e.sun : e.moon, { size: 14 }),
266
267
  onClick: k,
267
268
  title: w("auth.toggle_theme", "Toggle theme")
268
269
  })
269
270
  ]
270
271
  }),
271
- /* @__PURE__ */ f("div", {
272
+ /* @__PURE__ */ p("div", {
272
273
  style: {
273
274
  flex: 1,
274
275
  display: "flex",
@@ -276,20 +277,20 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
276
277
  justifyContent: "center",
277
278
  paddingTop: X ? 16 : 20,
278
279
  paddingBottom: X ? 12 : 20,
279
- ...X ? c(12) : {
280
+ ...X ? l(12) : {
280
281
  paddingLeft: 20,
281
282
  paddingRight: 20
282
283
  },
283
284
  minWidth: 0
284
285
  },
285
- children: /* @__PURE__ */ p("div", {
286
+ children: /* @__PURE__ */ m("div", {
286
287
  style: {
287
288
  display: "grid",
288
289
  gridTemplateColumns: X ? "minmax(0, 1fr)" : "1fr 1fr",
289
290
  gap: 0,
290
291
  width: X ? "100%" : 980,
291
292
  maxWidth: "100%",
292
- minHeight: X ? "auto" : m,
293
+ minHeight: X ? "auto" : h,
293
294
  background: "var(--surface)",
294
295
  border: "1px solid var(--border)",
295
296
  borderRadius: X ? "var(--radius-lg)" : "var(--radius-xl)",
@@ -297,8 +298,8 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
297
298
  boxShadow: X ? "var(--shadow-sm)" : "var(--shadow-lg)"
298
299
  },
299
300
  children: [
300
- Z && Q,
301
- /* @__PURE__ */ f("div", {
301
+ Z && $,
302
+ /* @__PURE__ */ p("div", {
302
303
  "data-testid": "auth-form-panel",
303
304
  style: {
304
305
  padding: X ? "28px 20px 24px" : "36px 40px",
@@ -307,13 +308,13 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
307
308
  justifyContent: "center",
308
309
  minWidth: 0
309
310
  },
310
- children: _
311
+ children: v
311
312
  }),
312
- !Z && Q
313
+ !Z && $
313
314
  ]
314
315
  })
315
316
  }),
316
- /* @__PURE__ */ p("div", {
317
+ /* @__PURE__ */ m("div", {
317
318
  style: {
318
319
  padding: X ? "12px 14px calc(12px + var(--safe-area-bottom))" : "14px 20px",
319
320
  display: "flex",
@@ -325,15 +326,15 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
325
326
  minWidth: 0
326
327
  },
327
328
  children: [
328
- /* @__PURE__ */ f("span", { children: G }),
329
- U.map(([e, t]) => /* @__PURE__ */ f("a", {
329
+ /* @__PURE__ */ p("span", { children: G }),
330
+ U.map(([e, t]) => /* @__PURE__ */ p("a", {
330
331
  href: t,
331
332
  target: "_blank",
332
333
  rel: "noopener noreferrer",
333
334
  style: { color: "inherit" },
334
335
  children: e
335
336
  }, e)),
336
- Y && /* @__PURE__ */ p(d, { children: [!X && /* @__PURE__ */ f("div", { style: { flex: 1 } }), /* @__PURE__ */ f("span", {
337
+ Y && /* @__PURE__ */ m(f, { children: [!X && /* @__PURE__ */ p("div", { style: { flex: 1 } }), /* @__PURE__ */ p("span", {
337
338
  className: "mono",
338
339
  style: {
339
340
  maxWidth: "100%",
@@ -347,4 +348,4 @@ function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x,
347
348
  });
348
349
  }
349
350
  //#endregion
350
- export { _ as AuthShell, g as formatBuildLabel };
351
+ export { v as AuthShell, _ as formatBuildLabel };
@@ -0,0 +1,63 @@
1
+ import { useResponsiveMode as e } from "../../../hooks/useResponsiveMode.js";
2
+ import { useRef as t } from "react";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ function r({ value: r, onChange: i, label: a }) {
5
+ let o = t([]), s = e().isPhone, c = r.padEnd(6, " ").slice(0, 6).split("");
6
+ function l(e) {
7
+ o.current[e]?.focus(), o.current[e]?.select();
8
+ }
9
+ function u(e, t) {
10
+ let n = t.replace(/\D/g, "").slice(-1);
11
+ i(c.map((t, r) => r === e ? n || " " : t).join("").trimEnd()), n && e < 5 && l(e + 1);
12
+ }
13
+ function d(e, t) {
14
+ t.key === "Backspace" && c[e] === " " && e > 0 && l(e - 1);
15
+ }
16
+ function f(e) {
17
+ let t = e.clipboardData.getData("text").replace(/\D/g, "").slice(0, 6);
18
+ t && (e.preventDefault(), i(t), l(Math.min(t.length, 5)));
19
+ }
20
+ return /* @__PURE__ */ n("div", {
21
+ role: "group",
22
+ "aria-label": a,
23
+ style: {
24
+ display: "grid",
25
+ gridTemplateColumns: "repeat(6, minmax(0, 44px))",
26
+ gap: s ? 6 : 8,
27
+ justifyContent: "center",
28
+ margin: "20px 0",
29
+ width: "100%",
30
+ maxWidth: "100%"
31
+ },
32
+ children: c.map((e, t) => /* @__PURE__ */ n("input", {
33
+ ref: (e) => {
34
+ o.current[t] = e;
35
+ },
36
+ value: e.trim(),
37
+ "aria-label": `${a} ${t + 1}`,
38
+ maxLength: 1,
39
+ inputMode: "numeric",
40
+ autoComplete: t === 0 ? "one-time-code" : "off",
41
+ autoFocus: t === 0,
42
+ onChange: (e) => u(t, e.target.value),
43
+ onKeyDown: (e) => d(t, e),
44
+ onPaste: f,
45
+ style: {
46
+ width: "100%",
47
+ minWidth: 0,
48
+ height: s ? 48 : 52,
49
+ textAlign: "center",
50
+ fontSize: s ? 20 : 22,
51
+ fontWeight: 600,
52
+ background: "var(--surface-2)",
53
+ border: "1px solid var(--border)",
54
+ borderRadius: "var(--radius-md)",
55
+ outline: "none",
56
+ color: "var(--text)",
57
+ fontFamily: "var(--font-mono)"
58
+ }
59
+ }, t))
60
+ });
61
+ }
62
+ //#endregion
63
+ export { r as CodeInput };
@@ -1,5 +1,5 @@
1
1
  import { sanitizeRedirectPath as e } from "../../../api/auth-redirect.js";
2
- import { checkSetup as t, listSSOProviders as n, ssoAuthorizeUrl as r } from "../../../api/auth.js";
2
+ import { checkSetup as t, listIdentityProviders as n, ssoAuthorizeUrl as r } from "../../../api/auth.js";
3
3
  import { useSchema as i } from "../../../hooks/useSchema.js";
4
4
  import { Icon as a } from "../../primitives/Icons.js";
5
5
  import { Btn as o } from "../../primitives/Btn.js";
@@ -29,6 +29,14 @@ var O = "sso-failure", k = {
29
29
  azure: {
30
30
  name: "Microsoft",
31
31
  icon: /* @__PURE__ */ C(_, { size: 14 })
32
+ },
33
+ github: {
34
+ name: "GitHub",
35
+ icon: /* @__PURE__ */ C(a.shield, { size: 13 })
36
+ },
37
+ apple: {
38
+ name: "Apple",
39
+ icon: /* @__PURE__ */ C(a.shield, { size: 13 })
32
40
  }
33
41
  };
34
42
  function A() {
@@ -36,7 +44,7 @@ function A() {
36
44
  queryKey: ["check-setup"],
37
45
  queryFn: t
38
46
  }), { data: q } = x({
39
- queryKey: ["sso-providers"],
47
+ queryKey: ["identity-providers"],
40
48
  queryFn: () => n(),
41
49
  staleTime: 6e4
42
50
  });
@@ -217,7 +225,7 @@ function A() {
217
225
  disabled: M,
218
226
  children: M ? F("auth.signin.submitting", "Signing in…") : F("auth.signin.submit", "Continue")
219
227
  }),
220
- /* @__PURE__ */ w("div", {
228
+ G?.signup_enabled && /* @__PURE__ */ w("div", {
221
229
  style: {
222
230
  fontSize: 12,
223
231
  color: "var(--text-3)",
@@ -234,7 +242,7 @@ function A() {
234
242
  fontWeight: 500,
235
243
  textDecoration: "none"
236
244
  },
237
- children: F("auth.signin.request_access", "Request access")
245
+ children: F("auth.signin.request_access", "Create an account")
238
246
  })
239
247
  ]
240
248
  })