@questpie/admin 3.0.4 → 3.0.6

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 (90) hide show
  1. package/README.md +99 -1
  2. package/dist/client/builder/types/field-types.d.mts +11 -0
  3. package/dist/client/components/blocks/block-editor-layout.mjs +2 -2
  4. package/dist/client/components/blocks/block-library-sidebar.mjs +89 -61
  5. package/dist/client/components/brand-logo.d.mts +25 -0
  6. package/dist/client/components/brand-logo.mjs +174 -0
  7. package/dist/client/components/media/media-grid.mjs +95 -78
  8. package/dist/client/components/primitives/select-multi.mjs +388 -368
  9. package/dist/client/components/primitives/select-single.mjs +344 -331
  10. package/dist/client/components/widgets/chart-widget.mjs +78 -62
  11. package/dist/client/components/widgets/progress-widget.mjs +39 -37
  12. package/dist/client/components/widgets/quick-actions-widget.mjs +111 -90
  13. package/dist/client/components/widgets/recent-items-widget.mjs +40 -38
  14. package/dist/client/components/widgets/table-widget.mjs +4 -3
  15. package/dist/client/components/widgets/timeline-widget.mjs +92 -74
  16. package/dist/client/components/widgets/value-widget.mjs +164 -144
  17. package/dist/client/create-admin-client.d.mts +7 -0
  18. package/dist/client/create-admin-client.mjs +25 -0
  19. package/dist/client/hooks/use-brand.d.mts +22 -0
  20. package/dist/client/hooks/use-brand.mjs +52 -0
  21. package/dist/client/hooks/use-server-actions.mjs +21 -16
  22. package/dist/client/preview/block-scope-context.d.mts +2 -2
  23. package/dist/client/preview/preview-banner.d.mts +2 -2
  24. package/dist/client/preview/preview-banner.mjs +75 -46
  25. package/dist/client/runtime/index.mjs +1 -1
  26. package/dist/client/runtime/provider.d.mts +4 -0
  27. package/dist/client/runtime/provider.mjs +38 -8
  28. package/dist/client/styles/base.css +4 -0
  29. package/dist/client/types/admin-config.d.mts +24 -0
  30. package/dist/client/views/auth/auth-layout.d.mts +6 -1
  31. package/dist/client/views/auth/auth-layout.mjs +116 -102
  32. package/dist/client/views/collection/auto-form-fields.mjs +2 -0
  33. package/dist/client/views/collection/field-renderer.mjs +3 -2
  34. package/dist/client/views/collection/table-view.mjs +26 -26
  35. package/dist/client/views/globals/global-form-view.mjs +908 -863
  36. package/dist/client/views/layout/admin-layout.mjs +151 -131
  37. package/dist/client/views/layout/admin-router.mjs +297 -180
  38. package/dist/client/views/layout/admin-sidebar.mjs +178 -156
  39. package/dist/client/views/pages/accept-invite-page.mjs +122 -144
  40. package/dist/client/views/pages/forgot-password-page.mjs +22 -30
  41. package/dist/client/views/pages/invite-page.mjs +24 -33
  42. package/dist/client/views/pages/login-page.mjs +24 -32
  43. package/dist/client/views/pages/reset-password-page.mjs +77 -92
  44. package/dist/client/views/pages/setup-page.mjs +73 -65
  45. package/dist/client.d.mts +6 -2
  46. package/dist/client.mjs +5 -2
  47. package/dist/index.d.mts +6 -2
  48. package/dist/index.mjs +5 -2
  49. package/dist/server/augmentation/dashboard.d.mts +23 -5
  50. package/dist/server/augmentation/form-layout.d.mts +10 -0
  51. package/dist/server/augmentation/index.d.mts +1 -1
  52. package/dist/server/augmentation.d.mts +1 -1
  53. package/dist/server/i18n/index.mjs +13 -7
  54. package/dist/server/i18n/messages/cs.mjs +391 -1
  55. package/dist/server/i18n/messages/de.mjs +389 -1
  56. package/dist/server/i18n/messages/en.mjs +102 -0
  57. package/dist/server/i18n/messages/es.mjs +389 -1
  58. package/dist/server/i18n/messages/fr.mjs +389 -1
  59. package/dist/server/i18n/messages/pl.mjs +393 -1
  60. package/dist/server/i18n/messages/pt.mjs +386 -1
  61. package/dist/server/i18n/messages/sk.mjs +133 -1
  62. package/dist/server/modules/admin/collections/account.d.mts +50 -50
  63. package/dist/server/modules/admin/collections/admin-locks.d.mts +53 -53
  64. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  65. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  66. package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
  67. package/dist/server/modules/admin/collections/assets.d.mts +20 -20
  68. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  69. package/dist/server/modules/admin/collections/user.d.mts +32 -32
  70. package/dist/server/modules/admin/collections/verification.d.mts +36 -36
  71. package/dist/server/modules/admin/dto/admin-config.dto.mjs +19 -1
  72. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  73. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  74. package/dist/server/modules/admin/routes/execute-action.mjs +34 -28
  75. package/dist/server/modules/admin/routes/i18n-helpers.mjs +34 -0
  76. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  77. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  78. package/dist/server/modules/admin/routes/preview.mjs +25 -17
  79. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  80. package/dist/server/modules/admin/routes/route-helpers.mjs +1 -1
  81. package/dist/server/modules/admin/routes/setup.mjs +10 -7
  82. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  83. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  84. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +23 -23
  85. package/dist/server.d.mts +4 -4
  86. package/dist/shared/preview-utils.d.mts +34 -1
  87. package/dist/shared/preview-utils.mjs +79 -1
  88. package/dist/shared.d.mts +2 -2
  89. package/dist/shared.mjs +2 -2
  90. package/package.json +3 -3
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
 
3
+ import { useSafeI18n } from "../i18n/hooks.mjs";
3
4
  import { c } from "react/compiler-runtime";
4
5
  import "react";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -32,14 +33,22 @@ import { jsx, jsxs } from "react/jsx-runtime";
32
33
  * ```
33
34
  */
34
35
  function PreviewBanner(t0) {
35
- const $ = c(9);
36
+ const $ = c(19);
36
37
  const { isPreviewMode, className, exitPreviewUrl: t1 } = t0;
37
38
  const exitPreviewUrl = t1 === void 0 ? "/api/preview?disable=true" : t1;
38
- if (!isPreviewMode) return null;
39
+ const i18n = useSafeI18n();
39
40
  let t2;
41
+ if ($[0] !== i18n) {
42
+ t2 = (key, fallback) => i18n?.t(key) ?? fallback;
43
+ $[0] = i18n;
44
+ $[1] = t2;
45
+ } else t2 = $[1];
46
+ const t = t2;
47
+ if (!isPreviewMode) return null;
40
48
  let t3;
41
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
42
- t2 = {
49
+ let t4;
50
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
51
+ t3 = {
43
52
  position: "sticky",
44
53
  top: 0,
45
54
  left: 0,
@@ -56,35 +65,47 @@ function PreviewBanner(t0) {
56
65
  fontWeight: 500,
57
66
  borderBottom: "1px solid var(--border)"
58
67
  };
59
- t3 = {
68
+ t4 = {
60
69
  display: "flex",
61
70
  alignItems: "center",
62
71
  gap: "0.5rem"
63
72
  };
64
- $[0] = t2;
65
- $[1] = t3;
73
+ $[2] = t3;
74
+ $[3] = t4;
66
75
  } else {
67
- t2 = $[0];
68
- t3 = $[1];
76
+ t3 = $[2];
77
+ t4 = $[3];
69
78
  }
70
- let t4;
71
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
72
- t4 = /* @__PURE__ */ jsxs("div", {
73
- style: t3,
74
- children: [/* @__PURE__ */ jsxs("svg", {
75
- xmlns: "http://www.w3.org/2000/svg",
76
- width: "16",
77
- height: "16",
78
- viewBox: "0 0 256 256",
79
- fill: "currentColor",
80
- children: [/* @__PURE__ */ jsx("title", { children: "Eye icon" }), /* @__PURE__ */ jsx("path", { d: "M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z" })]
81
- }), /* @__PURE__ */ jsx("span", { children: "Preview Mode" })]
82
- });
83
- $[2] = t4;
84
- } else t4 = $[2];
85
79
  let t5;
86
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
87
- t5 = {
80
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
81
+ t5 = /* @__PURE__ */ jsxs("svg", {
82
+ xmlns: "http://www.w3.org/2000/svg",
83
+ width: "16",
84
+ height: "16",
85
+ viewBox: "0 0 256 256",
86
+ fill: "currentColor",
87
+ children: [/* @__PURE__ */ jsx("title", { children: "Eye icon" }), /* @__PURE__ */ jsx("path", { d: "M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z" })]
88
+ });
89
+ $[4] = t5;
90
+ } else t5 = $[4];
91
+ let t6;
92
+ if ($[5] !== t) {
93
+ t6 = t("preview.mode", "Preview Mode");
94
+ $[5] = t;
95
+ $[6] = t6;
96
+ } else t6 = $[6];
97
+ let t7;
98
+ if ($[7] !== t6) {
99
+ t7 = /* @__PURE__ */ jsxs("div", {
100
+ style: t4,
101
+ children: [t5, /* @__PURE__ */ jsx("span", { children: t6 })]
102
+ });
103
+ $[7] = t6;
104
+ $[8] = t7;
105
+ } else t7 = $[8];
106
+ let t8;
107
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
108
+ t8 = {
88
109
  padding: "0.25rem 0.75rem",
89
110
  backgroundColor: "rgba(255, 255, 255, 0.2)",
90
111
  border: "1px solid rgba(255, 255, 255, 0.3)",
@@ -96,32 +117,40 @@ function PreviewBanner(t0) {
96
117
  cursor: "pointer",
97
118
  transition: "background-color 0.2s"
98
119
  };
99
- $[3] = t5;
100
- } else t5 = $[3];
101
- let t6;
102
- if ($[4] !== exitPreviewUrl) {
103
- t6 = /* @__PURE__ */ jsx("a", {
120
+ $[9] = t8;
121
+ } else t8 = $[9];
122
+ let t9;
123
+ if ($[10] !== t) {
124
+ t9 = t("preview.exitPreview", "Exit Preview");
125
+ $[10] = t;
126
+ $[11] = t9;
127
+ } else t9 = $[11];
128
+ let t10;
129
+ if ($[12] !== exitPreviewUrl || $[13] !== t9) {
130
+ t10 = /* @__PURE__ */ jsx("a", {
104
131
  href: exitPreviewUrl,
105
- style: t5,
132
+ style: t8,
106
133
  onMouseEnter: _temp,
107
134
  onMouseLeave: _temp2,
108
- children: "Exit Preview"
135
+ children: t9
109
136
  });
110
- $[4] = exitPreviewUrl;
111
- $[5] = t6;
112
- } else t6 = $[5];
113
- let t7;
114
- if ($[6] !== className || $[7] !== t6) {
115
- t7 = /* @__PURE__ */ jsxs("div", {
137
+ $[12] = exitPreviewUrl;
138
+ $[13] = t9;
139
+ $[14] = t10;
140
+ } else t10 = $[14];
141
+ let t11;
142
+ if ($[15] !== className || $[16] !== t10 || $[17] !== t7) {
143
+ t11 = /* @__PURE__ */ jsxs("div", {
116
144
  className,
117
- style: t2,
118
- children: [t4, t6]
145
+ style: t3,
146
+ children: [t7, t10]
119
147
  });
120
- $[6] = className;
121
- $[7] = t6;
122
- $[8] = t7;
123
- } else t7 = $[8];
124
- return t7;
148
+ $[15] = className;
149
+ $[16] = t10;
150
+ $[17] = t7;
151
+ $[18] = t11;
152
+ } else t11 = $[18];
153
+ return t11;
125
154
  }
126
155
  function _temp2(e_0) {
127
156
  e_0.currentTarget.style.backgroundColor = "rgba(255, 255, 255, 0.2)";
@@ -1,4 +1,4 @@
1
- import { AdminProvider, selectAdmin, selectAuthClient, selectBasePath, selectBrandName, selectClient, selectContentLocale, selectNavigate, selectRealtime, selectSetContentLocale, useAdminStore } from "./provider.mjs";
1
+ import { AdminProvider, selectAdmin, selectAuthClient, selectBasePath, selectClient, selectContentLocale, selectNavigate, selectRealtime, selectSetContentLocale, useAdminStore } from "./provider.mjs";
2
2
  import { useSafeContentLocales } from "./content-locales-provider.mjs";
3
3
  import { LocaleScopeProvider, useScopedLocale } from "./locale-scope.mjs";
4
4
  import { useShallow } from "zustand/shallow";
@@ -2,6 +2,7 @@ import { I18nAdapter } from "../i18n/types.mjs";
2
2
  import { AdminState as AdminState$1, BlockDefinitionMap, ComponentDefinitionMap, FieldDefinitionMap, PageDefinitionMap, TranslationsMap, ViewDefinitionMap, WidgetDefinitionMap } from "../builder/admin-types.mjs";
3
3
  import { Admin, AdminInput } from "../builder/admin.mjs";
4
4
  import { AnyQuestpieClient } from "../builder/index.mjs";
5
+ import { BrandLogoConfig } from "../types/admin-config.mjs";
5
6
  import { NavigationGroup } from "./routes.mjs";
6
7
  import { ReactElement, ReactNode } from "react";
7
8
  import { QueryClient } from "@tanstack/react-query";
@@ -22,6 +23,9 @@ interface AdminState {
22
23
  setContentLocale: (locale: string) => void;
23
24
  navigation: NavigationGroup[];
24
25
  brandName: string;
26
+ brandLogo: BrandLogoConfig | null;
27
+ brandTagline: string | null;
28
+ brandFavicon: string | null;
25
29
  }
26
30
  type AdminStore = ReturnType<typeof createAdminStore>;
27
31
  interface CreateAdminStoreProps {
@@ -51,7 +51,10 @@ function createAdminStore({ admin, client, authClient, basePath, navigate, realt
51
51
  set({ contentLocale: newLocale });
52
52
  },
53
53
  navigation: buildNavigation(admin, { basePath }),
54
- brandName: "Admin"
54
+ brandName: "Admin",
55
+ brandLogo: null,
56
+ brandTagline: null,
57
+ brandFavicon: null
55
58
  }));
56
59
  }
57
60
  const AdminStoreContext = createContext(null);
@@ -317,6 +320,28 @@ function AdminProvider(t0) {
317
320
  function _temp(s) {
318
321
  return s.contentLocale;
319
322
  }
323
+ function resolveBrandText(value, fallback) {
324
+ if (typeof value === "string") return value;
325
+ if (value && typeof value === "object") {
326
+ const obj = value;
327
+ if (typeof obj.en === "string") return obj.en;
328
+ const first = Object.values(obj).find((v) => typeof v === "string");
329
+ if (typeof first === "string") return first;
330
+ }
331
+ return fallback;
332
+ }
333
+ function applyFavicon(href) {
334
+ if (typeof document === "undefined" || !href) return;
335
+ const FAVICON_ID = "qa-brand-favicon";
336
+ let link = document.getElementById(FAVICON_ID);
337
+ if (!link) {
338
+ link = document.createElement("link");
339
+ link.id = FAVICON_ID;
340
+ link.rel = "icon";
341
+ document.head.appendChild(link);
342
+ }
343
+ link.href = href;
344
+ }
320
345
  function BrandingSync() {
321
346
  const $ = c(3);
322
347
  const store = useContext(AdminStoreContext);
@@ -328,11 +353,18 @@ function BrandingSync() {
328
353
  const client = store.getState().client;
329
354
  if (!client || !client.routes?.getAdminConfig) return;
330
355
  client.routes.getAdminConfig().then((config) => {
331
- if (config?.branding?.name) {
332
- const name = config.branding.name;
333
- const resolved = typeof name === "string" ? name : typeof name === "object" && name !== null ? name.en ?? Object.values(name)[0] ?? "Admin" : "Admin";
334
- store.setState({ brandName: resolved });
356
+ const branding = config?.branding;
357
+ if (!branding) return;
358
+ const next = {};
359
+ if (branding.name !== void 0) next.brandName = resolveBrandText(branding.name, "Admin");
360
+ if (branding.logo !== void 0) next.brandLogo = branding.logo ?? null;
361
+ if (branding.tagline !== void 0) next.brandTagline = branding.tagline ? resolveBrandText(branding.tagline, "") : null;
362
+ if (branding.favicon !== void 0) {
363
+ const favicon = branding.favicon ?? null;
364
+ next.brandFavicon = favicon;
365
+ applyFavicon(favicon);
335
366
  }
367
+ if (Object.keys(next).length > 0) store.setState(next);
336
368
  }).catch(_temp2);
337
369
  };
338
370
  t1 = [store];
@@ -393,8 +425,6 @@ const selectRealtime = (s) => s.realtime;
393
425
  const selectContentLocale = (s) => s.contentLocale;
394
426
  /** Select setContentLocale function */
395
427
  const selectSetContentLocale = (s) => s.setContentLocale;
396
- /** Select brand name */
397
- const selectBrandName = (s) => s.brandName;
398
428
 
399
429
  //#endregion
400
- export { AdminProvider, selectAdmin, selectAuthClient, selectBasePath, selectBrandName, selectClient, selectContentLocale, selectNavigate, selectRealtime, selectSetContentLocale, useAdminStore, useAdminStoreRaw };
430
+ export { AdminProvider, selectAdmin, selectAuthClient, selectBasePath, selectClient, selectContentLocale, selectNavigate, selectRealtime, selectSetContentLocale, useAdminStore, useAdminStoreRaw };
@@ -58,6 +58,7 @@
58
58
  --font-sans Default for all UI body text and content
59
59
  --font-mono Technical content: code, kbd, IDs, timestamps
60
60
  --font-chrome UI chrome (buttons, labels, inputs, tabs, badges)
61
+ --font-heading Headings (h1-h6); defaults to var(--font-sans)
61
62
 
62
63
  -- Spacing ------------------------------------------------
63
64
  --spacing-card Internal card/panel padding (default: 16px)
@@ -139,6 +140,7 @@
139
140
  --font-mono:
140
141
  "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, monospace;
141
142
  --font-chrome: var(--font-sans);
143
+ --font-heading: var(--font-sans);
142
144
 
143
145
  /* Spacing Scale */
144
146
  --spacing-section: 1.5rem;
@@ -236,6 +238,7 @@
236
238
  --font-mono:
237
239
  "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, monospace;
238
240
  --font-chrome: var(--font-sans);
241
+ --font-heading: var(--font-heading);
239
242
 
240
243
  /* Radius: Autopilot neutral-soft ladder */
241
244
  --radius-xs: 4px;
@@ -744,6 +747,7 @@
744
747
  h4,
745
748
  h5,
746
749
  h6 {
750
+ font-family: var(--font-heading);
747
751
  letter-spacing: -0.02em;
748
752
  text-wrap: balance;
749
753
  }
@@ -0,0 +1,24 @@
1
+ import { I18nText } from "../i18n/types.mjs";
2
+ import "../../server/augmentation.mjs";
3
+ import "../../server/block/index.mjs";
4
+
5
+ //#region src/client/types/admin-config.d.ts
6
+
7
+ type BrandLogoConfig = string | {
8
+ src: string;
9
+ srcDark?: string;
10
+ alt?: string;
11
+ width?: number;
12
+ height?: number;
13
+ } | {
14
+ type: string;
15
+ props?: Record<string, unknown>;
16
+ };
17
+ type BrandingConfig = {
18
+ name?: I18nText;
19
+ logo?: BrandLogoConfig;
20
+ tagline?: I18nText;
21
+ favicon?: string;
22
+ };
23
+ //#endregion
24
+ export { BrandLogoConfig, BrandingConfig };
@@ -22,6 +22,11 @@ type AuthLayoutProps = {
22
22
  /** Additional class name for the card */
23
23
  className?: string;
24
24
  };
25
+ declare function AuthDefaultLogo({
26
+ brandName
27
+ }: {
28
+ brandName: string;
29
+ }): react_jsx_runtime1.JSX.Element;
25
30
  /**
26
31
  * Minimal split layout for authentication pages (login, register, forgot password, etc.)
27
32
  *
@@ -47,4 +52,4 @@ type AuthLayoutProps = {
47
52
  */
48
53
  declare function AuthLayout(props: AuthLayoutProps): react_jsx_runtime1.JSX.Element;
49
54
  //#endregion
50
- export { AuthLayout, AuthLayoutProps };
55
+ export { AuthDefaultLogo, AuthLayout, AuthLayoutProps };
@@ -2,7 +2,9 @@ import { cn } from "../../lib/utils.mjs";
2
2
  import { useAdminStoreRaw } from "../../runtime/provider.mjs";
3
3
  import { Card, CardContent } from "../../components/ui/card.mjs";
4
4
  import { useLazyComponent } from "../../utils/use-lazy-component.mjs";
5
+ import { BrandLogoMark } from "../../components/brand-logo.mjs";
5
6
  import { useHasManagedAdminTheme, useManagedAdminTheme } from "../layout/admin-theme.mjs";
7
+ import { useBrand } from "../../hooks/use-brand.mjs";
6
8
  import { c } from "react/compiler-runtime";
7
9
  import * as React from "react";
8
10
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -20,77 +22,68 @@ import { jsx, jsxs } from "react/jsx-runtime";
20
22
  * `adminAuthLayout` override can replace the built-in layout.
21
23
  */
22
24
  function AuthBrandMark(t0) {
23
- const $ = c(9);
24
- const { className, decorative: t1 } = t0;
25
- const decorative = t1 === void 0 ? false : t1;
26
- let t2;
25
+ const $ = c(7);
26
+ const { className } = t0;
27
+ let t1;
27
28
  if ($[0] !== className) {
28
- t2 = cn("text-foreground size-16 shrink-0", className);
29
+ t1 = cn("text-foreground size-16 shrink-0", className);
29
30
  $[0] = className;
30
- $[1] = t2;
31
- } else t2 = $[1];
32
- const t3 = decorative ? true : void 0;
33
- const t4 = decorative ? void 0 : "QUESTPIE";
34
- let t5;
35
- let t6;
36
- let t7;
31
+ $[1] = t1;
32
+ } else t1 = $[1];
33
+ let t2;
34
+ let t3;
35
+ let t4;
37
36
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
38
- t5 = /* @__PURE__ */ jsx("path", {
37
+ t2 = /* @__PURE__ */ jsx("path", {
39
38
  d: "M2 2H22V10",
40
39
  stroke: "currentColor",
41
40
  strokeWidth: "2",
42
41
  strokeLinecap: "square"
43
42
  });
44
- t6 = /* @__PURE__ */ jsx("path", {
43
+ t3 = /* @__PURE__ */ jsx("path", {
45
44
  d: "M2 2V22H10",
46
45
  stroke: "currentColor",
47
46
  strokeWidth: "2",
48
47
  strokeLinecap: "square"
49
48
  });
50
- t7 = /* @__PURE__ */ jsx("path", {
49
+ t4 = /* @__PURE__ */ jsx("path", {
51
50
  d: "M23 13H13V23H23V13Z",
52
51
  fill: "currentColor",
53
52
  opacity: "0.72"
54
53
  });
55
- $[2] = t5;
56
- $[3] = t6;
57
- $[4] = t7;
54
+ $[2] = t2;
55
+ $[3] = t3;
56
+ $[4] = t4;
58
57
  } else {
59
- t5 = $[2];
60
- t6 = $[3];
61
- t7 = $[4];
58
+ t2 = $[2];
59
+ t3 = $[3];
60
+ t4 = $[4];
62
61
  }
63
- let t8;
64
- if ($[5] !== t2 || $[6] !== t3 || $[7] !== t4) {
65
- t8 = /* @__PURE__ */ jsxs("svg", {
62
+ let t5;
63
+ if ($[5] !== t1) {
64
+ t5 = /* @__PURE__ */ jsxs("svg", {
66
65
  xmlns: "http://www.w3.org/2000/svg",
67
66
  viewBox: "0 0 24 24",
68
67
  fill: "none",
69
- className: t2,
70
- "aria-hidden": t3,
71
- "aria-label": t4,
68
+ className: t1,
69
+ "aria-hidden": true,
72
70
  children: [
73
- t5,
74
- t6,
75
- t7
71
+ t2,
72
+ t3,
73
+ t4
76
74
  ]
77
75
  });
78
- $[5] = t2;
79
- $[6] = t3;
80
- $[7] = t4;
81
- $[8] = t8;
82
- } else t8 = $[8];
83
- return t8;
76
+ $[5] = t1;
77
+ $[6] = t5;
78
+ } else t5 = $[6];
79
+ return t5;
84
80
  }
85
81
  function AuthDefaultLogo(t0) {
86
82
  const $ = c(3);
87
83
  const { brandName } = t0;
88
84
  let t1;
89
85
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
90
- t1 = /* @__PURE__ */ jsx(AuthBrandMark, {
91
- className: "size-9",
92
- decorative: true
93
- });
86
+ t1 = /* @__PURE__ */ jsx(AuthBrandMark, { className: "size-9" });
94
87
  $[0] = t1;
95
88
  } else t1 = $[0];
96
89
  let t2;
@@ -111,36 +104,53 @@ function AuthDefaultLogo(t0) {
111
104
  return t2;
112
105
  }
113
106
  function AuthLogo(t0) {
114
- const $ = c(7);
107
+ const $ = c(8);
115
108
  const { logo, className } = t0;
109
+ const brand = useBrand();
116
110
  let t1;
117
- if ($[0] !== className) {
118
- t1 = cn("qa-auth-layout__logo flex min-w-0 items-center justify-start text-left", className);
119
- $[0] = className;
120
- $[1] = t1;
121
- } else t1 = $[1];
111
+ if ($[0] !== brand || $[1] !== logo) {
112
+ t1 = logo ?? (brand.logo ? /* @__PURE__ */ jsxs("div", {
113
+ className: "qa-auth-layout__default-logo flex max-w-full min-w-0 items-center gap-3 text-left",
114
+ children: [/* @__PURE__ */ jsx(BrandLogoMark, {
115
+ logo: brand.logo,
116
+ alt: brand.name,
117
+ className: "size-9"
118
+ }), /* @__PURE__ */ jsx("div", {
119
+ className: "min-w-0",
120
+ children: /* @__PURE__ */ jsx("div", {
121
+ className: "text-foreground truncate text-sm font-semibold tracking-tight",
122
+ children: brand.name
123
+ })
124
+ })]
125
+ }) : /* @__PURE__ */ jsx(AuthDefaultLogo, { brandName: brand.name }));
126
+ $[0] = brand;
127
+ $[1] = logo;
128
+ $[2] = t1;
129
+ } else t1 = $[2];
130
+ const resolved = t1;
122
131
  let t2;
123
- if ($[2] !== logo) {
124
- t2 = logo ?? /* @__PURE__ */ jsx(AuthDefaultLogo, { brandName: "QUESTPIE" });
125
- $[2] = logo;
126
- $[3] = t2;
127
- } else t2 = $[3];
132
+ if ($[3] !== className) {
133
+ t2 = cn("qa-auth-layout__logo flex min-w-0 items-center justify-start text-left", className);
134
+ $[3] = className;
135
+ $[4] = t2;
136
+ } else t2 = $[4];
128
137
  let t3;
129
- if ($[4] !== t1 || $[5] !== t2) {
138
+ if ($[5] !== resolved || $[6] !== t2) {
130
139
  t3 = /* @__PURE__ */ jsx("div", {
131
- className: t1,
132
- children: t2
140
+ className: t2,
141
+ children: resolved
133
142
  });
134
- $[4] = t1;
135
- $[5] = t2;
136
- $[6] = t3;
137
- } else t3 = $[6];
143
+ $[5] = resolved;
144
+ $[6] = t2;
145
+ $[7] = t3;
146
+ } else t3 = $[7];
138
147
  return t3;
139
148
  }
140
149
  /** Built-in minimal split layout (fallback when no override is registered). */
141
150
  function AuthLayoutBuiltIn(t0) {
142
- const $ = c(21);
151
+ const $ = c(25);
143
152
  const { logo, footer, children, className } = t0;
153
+ const { tagline } = useBrand();
144
154
  let t1;
145
155
  if ($[0] !== logo) {
146
156
  t1 = /* @__PURE__ */ jsx(AuthLogo, {
@@ -151,66 +161,69 @@ function AuthLayoutBuiltIn(t0) {
151
161
  $[1] = t1;
152
162
  } else t1 = $[1];
153
163
  let t2;
154
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
155
- t2 = /* @__PURE__ */ jsx("p", {
156
- className: "text-muted-foreground hidden text-xs tracking-[0.14em] uppercase lg:block",
157
- children: "Built with QUESTPIE"
164
+ if ($[2] !== tagline) {
165
+ t2 = tagline && /* @__PURE__ */ jsx("p", {
166
+ className: "qa-auth-layout__tagline text-muted-foreground hidden text-xs tracking-[0.14em] uppercase lg:block",
167
+ children: tagline
158
168
  });
159
- $[2] = t2;
160
- } else t2 = $[2];
169
+ $[2] = tagline;
170
+ $[3] = t2;
171
+ } else t2 = $[3];
161
172
  let t3;
162
- if ($[3] !== t1) {
173
+ if ($[4] !== t1 || $[5] !== t2) {
163
174
  t3 = /* @__PURE__ */ jsxs("aside", {
164
175
  className: "qa-auth-layout__brand flex flex-col items-center justify-center gap-8",
165
176
  children: [t1, t2]
166
177
  });
167
- $[3] = t1;
168
- $[4] = t3;
169
- } else t3 = $[4];
178
+ $[4] = t1;
179
+ $[5] = t2;
180
+ $[6] = t3;
181
+ } else t3 = $[6];
170
182
  let t4;
171
- if ($[5] !== className) {
183
+ if ($[7] !== className) {
172
184
  t4 = cn("qa-auth-layout__card border-border-subtle w-full shadow-none", className);
173
- $[5] = className;
174
- $[6] = t4;
175
- } else t4 = $[6];
185
+ $[7] = className;
186
+ $[8] = t4;
187
+ } else t4 = $[8];
176
188
  let t5;
177
- if ($[7] !== children) {
189
+ if ($[9] !== children) {
178
190
  t5 = /* @__PURE__ */ jsx(CardContent, {
179
191
  className: "qa-auth-layout__card-content",
180
192
  children
181
193
  });
182
- $[7] = children;
183
- $[8] = t5;
184
- } else t5 = $[8];
194
+ $[9] = children;
195
+ $[10] = t5;
196
+ } else t5 = $[10];
185
197
  let t6;
186
- if ($[9] !== t4 || $[10] !== t5) {
198
+ if ($[11] !== t4 || $[12] !== t5) {
187
199
  t6 = /* @__PURE__ */ jsx(Card, {
188
200
  className: t4,
189
201
  children: t5
190
202
  });
191
- $[9] = t4;
192
- $[10] = t5;
193
- $[11] = t6;
194
- } else t6 = $[11];
203
+ $[11] = t4;
204
+ $[12] = t5;
205
+ $[13] = t6;
206
+ } else t6 = $[13];
195
207
  let t7;
196
- if ($[12] !== footer) {
208
+ if ($[14] !== footer) {
197
209
  t7 = footer && /* @__PURE__ */ jsx("div", {
198
210
  className: "qa-auth-layout__footer text-muted-foreground text-center text-xs",
199
211
  children: footer
200
212
  });
201
- $[12] = footer;
202
- $[13] = t7;
203
- } else t7 = $[13];
213
+ $[14] = footer;
214
+ $[15] = t7;
215
+ } else t7 = $[15];
204
216
  let t8;
205
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
206
- t8 = /* @__PURE__ */ jsx("div", {
207
- className: "text-muted-foreground text-center text-[11px] tracking-[0.14em] uppercase lg:hidden",
208
- children: "Built with QUESTPIE"
217
+ if ($[16] !== tagline) {
218
+ t8 = tagline && /* @__PURE__ */ jsx("div", {
219
+ className: "qa-auth-layout__tagline qa-auth-layout__tagline--mobile text-muted-foreground text-center text-[11px] tracking-[0.14em] uppercase lg:hidden",
220
+ children: tagline
209
221
  });
210
- $[14] = t8;
211
- } else t8 = $[14];
222
+ $[16] = tagline;
223
+ $[17] = t8;
224
+ } else t8 = $[17];
212
225
  let t9;
213
- if ($[15] !== t6 || $[16] !== t7) {
226
+ if ($[18] !== t6 || $[19] !== t7 || $[20] !== t8) {
214
227
  t9 = /* @__PURE__ */ jsx("main", {
215
228
  className: "qa-auth-layout__form-panel flex items-center justify-center",
216
229
  children: /* @__PURE__ */ jsxs("div", {
@@ -222,12 +235,13 @@ function AuthLayoutBuiltIn(t0) {
222
235
  ]
223
236
  })
224
237
  });
225
- $[15] = t6;
226
- $[16] = t7;
227
- $[17] = t9;
228
- } else t9 = $[17];
238
+ $[18] = t6;
239
+ $[19] = t7;
240
+ $[20] = t8;
241
+ $[21] = t9;
242
+ } else t9 = $[21];
229
243
  let t10;
230
- if ($[18] !== t3 || $[19] !== t9) {
244
+ if ($[22] !== t3 || $[23] !== t9) {
231
245
  t10 = /* @__PURE__ */ jsx("div", {
232
246
  className: "qa-auth-layout bg-background text-foreground relative flex min-h-screen items-center justify-center overflow-hidden px-5 py-8 sm:px-8",
233
247
  children: /* @__PURE__ */ jsxs("div", {
@@ -235,10 +249,10 @@ function AuthLayoutBuiltIn(t0) {
235
249
  children: [t3, t9]
236
250
  })
237
251
  });
238
- $[18] = t3;
239
- $[19] = t9;
240
- $[20] = t10;
241
- } else t10 = $[20];
252
+ $[22] = t3;
253
+ $[23] = t9;
254
+ $[24] = t10;
255
+ } else t10 = $[24];
242
256
  return t10;
243
257
  }
244
258
  /**