@questpie/admin 3.2.4 → 3.2.5

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 (248) hide show
  1. package/dist/client/blocks/block-renderer.d.mts +2 -2
  2. package/dist/client/blocks/block-renderer.mjs +164 -339
  3. package/dist/client/components/actions/action-button.mjs +9 -9
  4. package/dist/client/components/actions/action-dialog.mjs +195 -493
  5. package/dist/client/components/actions/confirmation-dialog.mjs +44 -159
  6. package/dist/client/components/actions/header-actions.mjs +73 -165
  7. package/dist/client/components/admin-link.mjs +40 -126
  8. package/dist/client/components/auth/auth-loading.mjs +9 -44
  9. package/dist/client/components/blocks/block-canvas.mjs +31 -95
  10. package/dist/client/components/blocks/block-editor-context.mjs +13 -57
  11. package/dist/client/components/blocks/block-editor-layout.mjs +72 -166
  12. package/dist/client/components/blocks/block-editor-provider.mjs +184 -245
  13. package/dist/client/components/blocks/block-fields-renderer.mjs +54 -229
  14. package/dist/client/components/blocks/block-insert-button.mjs +49 -165
  15. package/dist/client/components/blocks/block-item-menu.mjs +102 -301
  16. package/dist/client/components/blocks/block-item.mjs +136 -370
  17. package/dist/client/components/blocks/block-library-sidebar.mjs +103 -230
  18. package/dist/client/components/blocks/block-tree.mjs +12 -68
  19. package/dist/client/components/blocks/block-type-icon.mjs +14 -56
  20. package/dist/client/components/brand-logo.mjs +35 -149
  21. package/dist/client/components/component-renderer.mjs +42 -118
  22. package/dist/client/components/error-boundary.mjs +14 -58
  23. package/dist/client/components/fields/array-field.mjs +209 -521
  24. package/dist/client/components/fields/asset-preview-field.mjs +41 -141
  25. package/dist/client/components/fields/blocks-field/blocks-field.mjs +60 -156
  26. package/dist/client/components/fields/boolean-field.mjs +29 -59
  27. package/dist/client/components/fields/date-field.mjs +7 -37
  28. package/dist/client/components/fields/datetime-field.mjs +7 -38
  29. package/dist/client/components/fields/email-field.mjs +25 -54
  30. package/dist/client/components/fields/field-wrapper.mjs +30 -105
  31. package/dist/client/components/fields/json-field.mjs +94 -296
  32. package/dist/client/components/fields/locale-badge.mjs +6 -15
  33. package/dist/client/components/fields/number-field.mjs +27 -60
  34. package/dist/client/components/fields/object-array-field.mjs +283 -659
  35. package/dist/client/components/fields/object-field.mjs +165 -633
  36. package/dist/client/components/fields/relation/displays/cards-display.mjs +106 -220
  37. package/dist/client/components/fields/relation/displays/chips-display.mjs +78 -150
  38. package/dist/client/components/fields/relation/displays/grid-display.mjs +92 -186
  39. package/dist/client/components/fields/relation/displays/list-display.mjs +122 -239
  40. package/dist/client/components/fields/relation/displays/table-display.mjs +70 -244
  41. package/dist/client/components/fields/relation/relation-items-display.mjs +30 -126
  42. package/dist/client/components/fields/relation-field.mjs +10 -66
  43. package/dist/client/components/fields/relation-picker.mjs +18 -18
  44. package/dist/client/components/fields/relation-select.mjs +12 -12
  45. package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +80 -180
  46. package/dist/client/components/fields/rich-text-editor/image-popover.mjs +2 -2
  47. package/dist/client/components/fields/rich-text-editor/image-upload.mjs +13 -29
  48. package/dist/client/components/fields/rich-text-editor/index.mjs +195 -513
  49. package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +61 -111
  50. package/dist/client/components/fields/rich-text-editor/table-controls.mjs +105 -415
  51. package/dist/client/components/fields/rich-text-editor/toolbar.mjs +256 -511
  52. package/dist/client/components/fields/rich-text-field.mjs +14 -53
  53. package/dist/client/components/fields/select-field.mjs +39 -74
  54. package/dist/client/components/fields/text-field.mjs +26 -59
  55. package/dist/client/components/fields/textarea-field.mjs +26 -58
  56. package/dist/client/components/fields/time-field.mjs +7 -35
  57. package/dist/client/components/fields/upload-field.mjs +47 -165
  58. package/dist/client/components/filter-builder/columns-tab.mjs +80 -280
  59. package/dist/client/components/filter-builder/filter-builder-sheet.mjs +197 -540
  60. package/dist/client/components/filter-builder/filters-tab.mjs +96 -386
  61. package/dist/client/components/filter-builder/saved-views-tab.mjs +133 -351
  62. package/dist/client/components/history-sidebar.mjs +285 -605
  63. package/dist/client/components/layout/field-layout-renderer.mjs +106 -254
  64. package/dist/client/components/locale-switcher.mjs +106 -228
  65. package/dist/client/components/media/media-grid.mjs +84 -273
  66. package/dist/client/components/media/media-picker-dialog.mjs +176 -476
  67. package/dist/client/components/preview/live-preview-mode.mjs +233 -458
  68. package/dist/client/components/preview/preview-pane.mjs +22 -22
  69. package/dist/client/components/primitives/asset-preview.mjs +290 -666
  70. package/dist/client/components/primitives/checkbox-input.mjs +9 -35
  71. package/dist/client/components/primitives/date-input.mjs +109 -327
  72. package/dist/client/components/primitives/dropzone.mjs +209 -336
  73. package/dist/client/components/primitives/field-select-control.mjs +12 -80
  74. package/dist/client/components/primitives/number-input.mjs +4 -4
  75. package/dist/client/components/primitives/select-multi.mjs +200 -559
  76. package/dist/client/components/primitives/select-single.mjs +165 -499
  77. package/dist/client/components/primitives/time-input.mjs +43 -117
  78. package/dist/client/components/primitives/toggle-input.mjs +9 -29
  79. package/dist/client/components/sheets/resource-sheet.mjs +61 -70
  80. package/dist/client/components/ui/accordion.mjs +35 -155
  81. package/dist/client/components/ui/alert.mjs +13 -68
  82. package/dist/client/components/ui/badge.mjs +9 -51
  83. package/dist/client/components/ui/button.mjs +8 -54
  84. package/dist/client/components/ui/card.mjs +37 -193
  85. package/dist/client/components/ui/checkbox.mjs +12 -68
  86. package/dist/client/components/ui/command.mjs +48 -219
  87. package/dist/client/components/ui/dialog.mjs +50 -262
  88. package/dist/client/components/ui/drawer.mjs +55 -259
  89. package/dist/client/components/ui/dropdown-menu.mjs +86 -427
  90. package/dist/client/components/ui/empty-state.mjs +28 -98
  91. package/dist/client/components/ui/field.mjs +73 -309
  92. package/dist/client/components/ui/input-group.mjs +42 -167
  93. package/dist/client/components/ui/input.mjs +7 -37
  94. package/dist/client/components/ui/kbd.mjs +6 -36
  95. package/dist/client/components/ui/label.mjs +7 -37
  96. package/dist/client/components/ui/popover.mjs +34 -169
  97. package/dist/client/components/ui/responsive-dialog.mjs +67 -273
  98. package/dist/client/components/ui/scroll-fade.mjs +63 -158
  99. package/dist/client/components/ui/search-input.mjs +33 -100
  100. package/dist/client/components/ui/select.mjs +72 -393
  101. package/dist/client/components/ui/separator.mjs +7 -38
  102. package/dist/client/components/ui/sheet.mjs +49 -269
  103. package/dist/client/components/ui/sidebar.mjs +171 -690
  104. package/dist/client/components/ui/skeleton.mjs +7 -38
  105. package/dist/client/components/ui/sonner.mjs +11 -42
  106. package/dist/client/components/ui/switch.mjs +9 -45
  107. package/dist/client/components/ui/table.mjs +48 -266
  108. package/dist/client/components/ui/tabs.mjs +26 -139
  109. package/dist/client/components/ui/textarea.mjs +6 -32
  110. package/dist/client/components/ui/tooltip.mjs +27 -129
  111. package/dist/client/components/widgets/chart-widget.mjs +174 -522
  112. package/dist/client/components/widgets/progress-widget.mjs +66 -172
  113. package/dist/client/components/widgets/quick-actions-widget.mjs +102 -261
  114. package/dist/client/components/widgets/recent-items-widget.mjs +69 -195
  115. package/dist/client/components/widgets/stats-widget.mjs +41 -175
  116. package/dist/client/components/widgets/table-widget.mjs +9 -9
  117. package/dist/client/components/widgets/timeline-widget.mjs +86 -226
  118. package/dist/client/components/widgets/value-widget.mjs +74 -381
  119. package/dist/client/components/widgets/widget-empty-state.mjs +26 -76
  120. package/dist/client/components/widgets/widget-skeletons.mjs +138 -421
  121. package/dist/client/contexts/focus-context.mjs +63 -146
  122. package/dist/client/hooks/typed-hooks.mjs +241 -701
  123. package/dist/client/hooks/use-action.mjs +62 -198
  124. package/dist/client/hooks/use-admin-config.mjs +5 -35
  125. package/dist/client/hooks/use-admin-preferences.mjs +16 -88
  126. package/dist/client/hooks/use-admin-routes.mjs +22 -56
  127. package/dist/client/hooks/use-audit-history.mjs +21 -69
  128. package/dist/client/hooks/use-brand.mjs +1 -9
  129. package/dist/client/hooks/use-collection-fields.mjs +17 -57
  130. package/dist/client/hooks/use-collection-meta.mjs +12 -44
  131. package/dist/client/hooks/use-collection-schema.mjs +10 -33
  132. package/dist/client/hooks/use-collection-validation.mjs +23 -53
  133. package/dist/client/hooks/use-collection.mjs +194 -614
  134. package/dist/client/hooks/use-current-user.mjs +0 -1
  135. package/dist/client/hooks/use-field-hooks.mjs +10 -10
  136. package/dist/client/hooks/use-field-options.mjs +61 -202
  137. package/dist/client/hooks/use-global-fields.mjs +14 -46
  138. package/dist/client/hooks/use-global-meta.mjs +9 -30
  139. package/dist/client/hooks/use-global-schema.mjs +9 -30
  140. package/dist/client/hooks/use-global.mjs +63 -219
  141. package/dist/client/hooks/use-locks.mjs +117 -325
  142. package/dist/client/hooks/use-media-query.mjs +16 -36
  143. package/dist/client/hooks/use-prefill-params.mjs +0 -1
  144. package/dist/client/hooks/use-questpie-query-options.mjs +12 -29
  145. package/dist/client/hooks/use-reactive-fields.mjs +1 -1
  146. package/dist/client/hooks/use-reactive-prop.mjs +65 -223
  147. package/dist/client/hooks/use-realtime-highlight.mjs +51 -114
  148. package/dist/client/hooks/use-saved-views.mjs +22 -103
  149. package/dist/client/hooks/use-search-param-toggle.mjs +28 -79
  150. package/dist/client/hooks/use-search.mjs +31 -143
  151. package/dist/client/hooks/use-server-actions.mjs +18 -50
  152. package/dist/client/hooks/use-server-validation.mjs +72 -166
  153. package/dist/client/hooks/use-server-widget-data.mjs +7 -33
  154. package/dist/client/hooks/use-setup-status.mjs +12 -25
  155. package/dist/client/hooks/use-sidebar-search-param.mjs +33 -78
  156. package/dist/client/hooks/use-transition-stage.mjs +8 -38
  157. package/dist/client/hooks/use-upload.mjs +54 -152
  158. package/dist/client/hooks/use-validation-error-map.mjs +6 -26
  159. package/dist/client/hooks/use-view-state.mjs +187 -437
  160. package/dist/client/i18n/hooks.mjs +65 -197
  161. package/dist/client/lib/render-profiler.mjs +14 -41
  162. package/dist/client/preview/block-scope-context.d.mts +2 -2
  163. package/dist/client/preview/block-scope-context.mjs +14 -36
  164. package/dist/client/preview/preview-banner.d.mts +2 -2
  165. package/dist/client/preview/preview-banner.mjs +42 -108
  166. package/dist/client/preview/preview-field.d.mts +4 -4
  167. package/dist/client/preview/preview-field.mjs +167 -348
  168. package/dist/client/preview/use-collection-preview.mjs +121 -215
  169. package/dist/client/runtime/content-locales-provider.mjs +31 -83
  170. package/dist/client/runtime/locale-scope.mjs +22 -63
  171. package/dist/client/runtime/provider.mjs +100 -255
  172. package/dist/client/runtime/translations-provider.mjs +41 -107
  173. package/dist/client/scope/picker.d.mts +2 -2
  174. package/dist/client/scope/picker.mjs +86 -321
  175. package/dist/client/scope/provider.d.mts +2 -2
  176. package/dist/client/scope/provider.mjs +8 -17
  177. package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
  178. package/dist/client/views/auth/accept-invite-form.mjs +121 -412
  179. package/dist/client/views/auth/auth-layout.d.mts +3 -3
  180. package/dist/client/views/auth/auth-layout.mjs +104 -284
  181. package/dist/client/views/auth/forgot-password-form.mjs +94 -325
  182. package/dist/client/views/auth/invite-form.mjs +107 -442
  183. package/dist/client/views/auth/login-form.d.mts +2 -2
  184. package/dist/client/views/auth/login-form.mjs +116 -337
  185. package/dist/client/views/auth/reset-password-form.d.mts +2 -2
  186. package/dist/client/views/auth/reset-password-form.mjs +128 -453
  187. package/dist/client/views/auth/setup-form.d.mts +2 -2
  188. package/dist/client/views/auth/setup-form.mjs +140 -478
  189. package/dist/client/views/collection/auto-form-fields.mjs +243 -615
  190. package/dist/client/views/collection/bulk-action-toolbar.mjs +212 -379
  191. package/dist/client/views/collection/cells/complex-cells.mjs +183 -611
  192. package/dist/client/views/collection/cells/primitive-cells.mjs +109 -363
  193. package/dist/client/views/collection/cells/relation-cells.mjs +86 -233
  194. package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +142 -371
  195. package/dist/client/views/collection/cells/shared/relation-chip.mjs +35 -131
  196. package/dist/client/views/collection/cells/upload-cells.mjs +60 -177
  197. package/dist/client/views/collection/columns/build-columns.mjs +8 -48
  198. package/dist/client/views/collection/field-renderer.mjs +58 -182
  199. package/dist/client/views/collection/form-view.mjs +284 -518
  200. package/dist/client/views/collection/table-view.mjs +231 -463
  201. package/dist/client/views/collection/view-skeletons.mjs +112 -237
  202. package/dist/client/views/common/global-search.mjs +241 -560
  203. package/dist/client/views/dashboard/dashboard-grid.mjs +256 -775
  204. package/dist/client/views/dashboard/dashboard-widget.mjs +38 -126
  205. package/dist/client/views/dashboard/widget-card.mjs +61 -269
  206. package/dist/client/views/globals/global-form-view.mjs +477 -1301
  207. package/dist/client/views/layout/admin-layout-provider.mjs +28 -88
  208. package/dist/client/views/layout/admin-layout.mjs +83 -246
  209. package/dist/client/views/layout/admin-router.mjs +458 -1274
  210. package/dist/client/views/layout/admin-sidebar.mjs +510 -1292
  211. package/dist/client/views/layout/admin-theme.mjs +30 -64
  212. package/dist/client/views/layout/admin-view-layout.mjs +40 -144
  213. package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
  214. package/dist/client/views/pages/accept-invite-page.mjs +95 -290
  215. package/dist/client/views/pages/dashboard-page.d.mts +2 -2
  216. package/dist/client/views/pages/dashboard-page.mjs +11 -57
  217. package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
  218. package/dist/client/views/pages/forgot-password-page.mjs +31 -83
  219. package/dist/client/views/pages/invite-page.d.mts +2 -2
  220. package/dist/client/views/pages/invite-page.mjs +35 -90
  221. package/dist/client/views/pages/login-page.mjs +41 -121
  222. package/dist/client/views/pages/reset-password-page.mjs +46 -173
  223. package/dist/client/views/pages/setup-page.mjs +33 -95
  224. package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
  225. package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
  226. package/dist/server/modules/admin/collections/account.d.mts +46 -46
  227. package/dist/server/modules/admin/collections/admin-locks.d.mts +50 -50
  228. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  229. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  230. package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
  231. package/dist/server/modules/admin/collections/assets.d.mts +39 -39
  232. package/dist/server/modules/admin/collections/session.d.mts +41 -41
  233. package/dist/server/modules/admin/collections/user.d.mts +63 -63
  234. package/dist/server/modules/admin/collections/verification.d.mts +36 -36
  235. package/dist/server/modules/admin/index.d.mts +20 -19
  236. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  237. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  238. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  239. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  240. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  241. package/dist/server/modules/admin/routes/setup.d.mts +7 -7
  242. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  243. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  244. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +45 -45
  245. package/dist/server/modules/audit/.generated/module.d.mts +6 -6
  246. package/dist/server/modules/audit/collections/audit-log.d.mts +78 -78
  247. package/dist/server/modules/audit/jobs/audit-cleanup.d.mts +2 -2
  248. package/package.json +3 -5
@@ -4,7 +4,6 @@ import { Button } from "../../components/ui/button.mjs";
4
4
  import { Input } from "../../components/ui/input.mjs";
5
5
  import { Field, FieldContent, FieldError, FieldGroup, FieldLabel } from "../../components/ui/field.mjs";
6
6
  import { Alert, AlertDescription } from "../../components/ui/alert.mjs";
7
- import { c } from "react/compiler-runtime";
8
7
  import { Icon } from "@iconify/react";
9
8
  import "react";
10
9
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -41,485 +40,148 @@ import { useForm, useWatch } from "react-hook-form";
41
40
  * }
42
41
  * ```
43
42
  */
44
- function SetupForm(t0) {
45
- const $ = c(128);
46
- const { onSubmit, defaultValues, className, error, minPasswordLength: t1 } = t0;
47
- const minPasswordLength = t1 === void 0 ? 8 : t1;
43
+ function SetupForm({ onSubmit, defaultValues, className, error, minPasswordLength = 8 }) {
48
44
  const { t } = useTranslation();
49
- let t2;
50
- if ($[0] !== defaultValues) {
51
- t2 = { defaultValues: {
52
- name: "",
53
- email: "",
54
- password: "",
55
- confirmPassword: "",
56
- ...defaultValues
57
- } };
58
- $[0] = defaultValues;
59
- $[1] = t2;
60
- } else t2 = $[1];
61
- const { register, handleSubmit, control, formState: t3 } = useForm(t2);
62
- const { errors, isSubmitting } = t3;
63
- let t4;
64
- if ($[2] !== control) {
65
- t4 = {
66
- control,
67
- name: "password"
68
- };
69
- $[2] = control;
70
- $[3] = t4;
71
- } else t4 = $[3];
72
- const password = useWatch(t4);
73
- let t5;
74
- if ($[4] !== onSubmit) {
75
- t5 = async (values) => {
45
+ const { register, handleSubmit, control, formState: { errors, isSubmitting } } = useForm({ defaultValues: {
46
+ name: "",
47
+ email: "",
48
+ password: "",
49
+ confirmPassword: "",
50
+ ...defaultValues
51
+ } });
52
+ const password = useWatch({
53
+ control,
54
+ name: "password"
55
+ });
56
+ return /* @__PURE__ */ jsxs("form", {
57
+ onSubmit: handleSubmit(async (values) => {
76
58
  await onSubmit(values);
77
- };
78
- $[4] = onSubmit;
79
- $[5] = t5;
80
- } else t5 = $[5];
81
- let t6;
82
- if ($[6] !== handleSubmit || $[7] !== t5) {
83
- t6 = handleSubmit(t5);
84
- $[6] = handleSubmit;
85
- $[7] = t5;
86
- $[8] = t6;
87
- } else t6 = $[8];
88
- const handleFormSubmit = t6;
89
- let t7;
90
- if ($[9] !== className) {
91
- t7 = cn("qa-setup-form space-y-4", className);
92
- $[9] = className;
93
- $[10] = t7;
94
- } else t7 = $[10];
95
- const t8 = !!errors.name;
96
- let t9;
97
- if ($[11] !== t) {
98
- t9 = t("auth.name");
99
- $[11] = t;
100
- $[12] = t9;
101
- } else t9 = $[12];
102
- let t10;
103
- if ($[13] !== t9) {
104
- t10 = /* @__PURE__ */ jsx(FieldLabel, {
105
- htmlFor: "name",
106
- children: t9
107
- });
108
- $[13] = t9;
109
- $[14] = t10;
110
- } else t10 = $[14];
111
- let t11;
112
- if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
113
- t11 = /* @__PURE__ */ jsx(Icon, {
114
- icon: "ph:user-duotone",
115
- className: "text-muted-foreground absolute top-1/2 left-2 size-4 -translate-y-1/2"
116
- });
117
- $[15] = t11;
118
- } else t11 = $[15];
119
- let t12;
120
- if ($[16] !== t) {
121
- t12 = t("auth.namePlaceholder");
122
- $[16] = t;
123
- $[17] = t12;
124
- } else t12 = $[17];
125
- const t13 = !!errors.name;
126
- let t14;
127
- if ($[18] !== register || $[19] !== t) {
128
- t14 = register("name", {
129
- required: t("auth.nameRequired"),
130
- minLength: {
131
- value: 2,
132
- message: t("auth.nameMinLength", { min: 2 })
133
- }
134
- });
135
- $[18] = register;
136
- $[19] = t;
137
- $[20] = t14;
138
- } else t14 = $[20];
139
- let t15;
140
- if ($[21] !== t12 || $[22] !== t13 || $[23] !== t14) {
141
- t15 = /* @__PURE__ */ jsxs("div", {
142
- className: "relative",
143
- children: [t11, /* @__PURE__ */ jsx(Input, {
144
- id: "name",
145
- type: "text",
146
- placeholder: t12,
147
- className: "pl-8",
148
- autoComplete: "name",
149
- "aria-invalid": t13,
150
- ...t14
151
- })]
152
- });
153
- $[21] = t12;
154
- $[22] = t13;
155
- $[23] = t14;
156
- $[24] = t15;
157
- } else t15 = $[24];
158
- const t16 = errors.name?.message;
159
- let t17;
160
- if ($[25] !== t16) {
161
- t17 = /* @__PURE__ */ jsx(FieldError, { children: t16 });
162
- $[25] = t16;
163
- $[26] = t17;
164
- } else t17 = $[26];
165
- let t18;
166
- if ($[27] !== t15 || $[28] !== t17) {
167
- t18 = /* @__PURE__ */ jsxs(FieldContent, { children: [t15, t17] });
168
- $[27] = t15;
169
- $[28] = t17;
170
- $[29] = t18;
171
- } else t18 = $[29];
172
- let t19;
173
- if ($[30] !== t10 || $[31] !== t18 || $[32] !== t8) {
174
- t19 = /* @__PURE__ */ jsxs(Field, {
175
- "data-invalid": t8,
176
- children: [t10, t18]
177
- });
178
- $[30] = t10;
179
- $[31] = t18;
180
- $[32] = t8;
181
- $[33] = t19;
182
- } else t19 = $[33];
183
- const t20 = !!errors.email;
184
- let t21;
185
- if ($[34] !== t) {
186
- t21 = t("auth.email");
187
- $[34] = t;
188
- $[35] = t21;
189
- } else t21 = $[35];
190
- let t22;
191
- if ($[36] !== t21) {
192
- t22 = /* @__PURE__ */ jsx(FieldLabel, {
193
- htmlFor: "email",
194
- children: t21
195
- });
196
- $[36] = t21;
197
- $[37] = t22;
198
- } else t22 = $[37];
199
- let t23;
200
- if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
201
- t23 = /* @__PURE__ */ jsx(Icon, {
202
- icon: "ph:envelope-duotone",
203
- className: "text-muted-foreground absolute top-1/2 left-2 size-4 -translate-y-1/2"
204
- });
205
- $[38] = t23;
206
- } else t23 = $[38];
207
- let t24;
208
- if ($[39] !== t) {
209
- t24 = t("auth.emailPlaceholder");
210
- $[39] = t;
211
- $[40] = t24;
212
- } else t24 = $[40];
213
- const t25 = !!errors.email;
214
- let t26;
215
- if ($[41] !== register || $[42] !== t) {
216
- let t27$1;
217
- if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
218
- t27$1 = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
219
- $[44] = t27$1;
220
- } else t27$1 = $[44];
221
- t26 = register("email", {
222
- required: t("auth.emailRequired"),
223
- pattern: {
224
- value: t27$1,
225
- message: t("auth.invalidEmail")
226
- }
227
- });
228
- $[41] = register;
229
- $[42] = t;
230
- $[43] = t26;
231
- } else t26 = $[43];
232
- let t27;
233
- if ($[45] !== t24 || $[46] !== t25 || $[47] !== t26) {
234
- t27 = /* @__PURE__ */ jsxs("div", {
235
- className: "relative",
236
- children: [t23, /* @__PURE__ */ jsx(Input, {
237
- id: "email",
238
- type: "email",
239
- placeholder: t24,
240
- className: "pl-8",
241
- autoComplete: "email",
242
- "aria-invalid": t25,
243
- ...t26
244
- })]
245
- });
246
- $[45] = t24;
247
- $[46] = t25;
248
- $[47] = t26;
249
- $[48] = t27;
250
- } else t27 = $[48];
251
- const t28 = errors.email?.message;
252
- let t29;
253
- if ($[49] !== t28) {
254
- t29 = /* @__PURE__ */ jsx(FieldError, { children: t28 });
255
- $[49] = t28;
256
- $[50] = t29;
257
- } else t29 = $[50];
258
- let t30;
259
- if ($[51] !== t27 || $[52] !== t29) {
260
- t30 = /* @__PURE__ */ jsxs(FieldContent, { children: [t27, t29] });
261
- $[51] = t27;
262
- $[52] = t29;
263
- $[53] = t30;
264
- } else t30 = $[53];
265
- let t31;
266
- if ($[54] !== t20 || $[55] !== t22 || $[56] !== t30) {
267
- t31 = /* @__PURE__ */ jsxs(Field, {
268
- "data-invalid": t20,
269
- children: [t22, t30]
270
- });
271
- $[54] = t20;
272
- $[55] = t22;
273
- $[56] = t30;
274
- $[57] = t31;
275
- } else t31 = $[57];
276
- const t32 = !!errors.password;
277
- let t33;
278
- if ($[58] !== t) {
279
- t33 = t("auth.password");
280
- $[58] = t;
281
- $[59] = t33;
282
- } else t33 = $[59];
283
- let t34;
284
- if ($[60] !== t33) {
285
- t34 = /* @__PURE__ */ jsx(FieldLabel, {
286
- htmlFor: "password",
287
- children: t33
288
- });
289
- $[60] = t33;
290
- $[61] = t34;
291
- } else t34 = $[61];
292
- let t35;
293
- if ($[62] === Symbol.for("react.memo_cache_sentinel")) {
294
- t35 = /* @__PURE__ */ jsx(Icon, {
295
- icon: "ph:lock-duotone",
296
- className: "text-muted-foreground absolute top-1/2 left-2 size-4 -translate-y-1/2"
297
- });
298
- $[62] = t35;
299
- } else t35 = $[62];
300
- let t36;
301
- if ($[63] !== t) {
302
- t36 = t("auth.passwordPlaceholder");
303
- $[63] = t;
304
- $[64] = t36;
305
- } else t36 = $[64];
306
- const t37 = !!errors.password;
307
- let t38;
308
- if ($[65] !== minPasswordLength || $[66] !== register || $[67] !== t) {
309
- t38 = register("password", {
310
- required: t("auth.passwordRequired"),
311
- minLength: {
312
- value: minPasswordLength,
313
- message: t("auth.passwordMinLength", { min: minPasswordLength })
314
- }
315
- });
316
- $[65] = minPasswordLength;
317
- $[66] = register;
318
- $[67] = t;
319
- $[68] = t38;
320
- } else t38 = $[68];
321
- let t39;
322
- if ($[69] !== t36 || $[70] !== t37 || $[71] !== t38) {
323
- t39 = /* @__PURE__ */ jsxs("div", {
324
- className: "relative",
325
- children: [t35, /* @__PURE__ */ jsx(Input, {
326
- id: "password",
327
- type: "password",
328
- placeholder: t36,
329
- className: "pl-8",
330
- autoComplete: "new-password",
331
- "aria-invalid": t37,
332
- ...t38
333
- })]
334
- });
335
- $[69] = t36;
336
- $[70] = t37;
337
- $[71] = t38;
338
- $[72] = t39;
339
- } else t39 = $[72];
340
- const t40 = errors.password?.message;
341
- let t41;
342
- if ($[73] !== t40) {
343
- t41 = /* @__PURE__ */ jsx(FieldError, { children: t40 });
344
- $[73] = t40;
345
- $[74] = t41;
346
- } else t41 = $[74];
347
- let t42;
348
- if ($[75] !== t39 || $[76] !== t41) {
349
- t42 = /* @__PURE__ */ jsxs(FieldContent, { children: [t39, t41] });
350
- $[75] = t39;
351
- $[76] = t41;
352
- $[77] = t42;
353
- } else t42 = $[77];
354
- let t43;
355
- if ($[78] !== t32 || $[79] !== t34 || $[80] !== t42) {
356
- t43 = /* @__PURE__ */ jsxs(Field, {
357
- "data-invalid": t32,
358
- children: [t34, t42]
359
- });
360
- $[78] = t32;
361
- $[79] = t34;
362
- $[80] = t42;
363
- $[81] = t43;
364
- } else t43 = $[81];
365
- const t44 = !!errors.confirmPassword;
366
- let t45;
367
- if ($[82] !== t) {
368
- t45 = t("auth.confirmPassword");
369
- $[82] = t;
370
- $[83] = t45;
371
- } else t45 = $[83];
372
- let t46;
373
- if ($[84] !== t45) {
374
- t46 = /* @__PURE__ */ jsx(FieldLabel, {
375
- htmlFor: "confirmPassword",
376
- children: t45
377
- });
378
- $[84] = t45;
379
- $[85] = t46;
380
- } else t46 = $[85];
381
- let t47;
382
- if ($[86] === Symbol.for("react.memo_cache_sentinel")) {
383
- t47 = /* @__PURE__ */ jsx(Icon, {
384
- icon: "ph:lock-duotone",
385
- className: "text-muted-foreground absolute top-1/2 left-2 size-4 -translate-y-1/2"
386
- });
387
- $[86] = t47;
388
- } else t47 = $[86];
389
- let t48;
390
- if ($[87] !== t) {
391
- t48 = t("auth.confirmPasswordPlaceholder");
392
- $[87] = t;
393
- $[88] = t48;
394
- } else t48 = $[88];
395
- const t49 = !!errors.confirmPassword;
396
- let t50;
397
- if ($[89] !== password || $[90] !== register || $[91] !== t) {
398
- let t51$1;
399
- if ($[93] !== password || $[94] !== t) {
400
- t51$1 = (value) => value === password || t("auth.passwordMismatch");
401
- $[93] = password;
402
- $[94] = t;
403
- $[95] = t51$1;
404
- } else t51$1 = $[95];
405
- t50 = register("confirmPassword", {
406
- required: t("auth.passwordRequired"),
407
- validate: t51$1
408
- });
409
- $[89] = password;
410
- $[90] = register;
411
- $[91] = t;
412
- $[92] = t50;
413
- } else t50 = $[92];
414
- let t51;
415
- if ($[96] !== t48 || $[97] !== t49 || $[98] !== t50) {
416
- t51 = /* @__PURE__ */ jsxs("div", {
417
- className: "relative",
418
- children: [t47, /* @__PURE__ */ jsx(Input, {
419
- id: "confirmPassword",
420
- type: "password",
421
- placeholder: t48,
422
- className: "pl-8",
423
- autoComplete: "new-password",
424
- "aria-invalid": t49,
425
- ...t50
426
- })]
427
- });
428
- $[96] = t48;
429
- $[97] = t49;
430
- $[98] = t50;
431
- $[99] = t51;
432
- } else t51 = $[99];
433
- const t52 = errors.confirmPassword?.message;
434
- let t53;
435
- if ($[100] !== t52) {
436
- t53 = /* @__PURE__ */ jsx(FieldError, { children: t52 });
437
- $[100] = t52;
438
- $[101] = t53;
439
- } else t53 = $[101];
440
- let t54;
441
- if ($[102] !== t51 || $[103] !== t53) {
442
- t54 = /* @__PURE__ */ jsxs(FieldContent, { children: [t51, t53] });
443
- $[102] = t51;
444
- $[103] = t53;
445
- $[104] = t54;
446
- } else t54 = $[104];
447
- let t55;
448
- if ($[105] !== t44 || $[106] !== t46 || $[107] !== t54) {
449
- t55 = /* @__PURE__ */ jsxs(Field, {
450
- "data-invalid": t44,
451
- children: [t46, t54]
452
- });
453
- $[105] = t44;
454
- $[106] = t46;
455
- $[107] = t54;
456
- $[108] = t55;
457
- } else t55 = $[108];
458
- let t56;
459
- if ($[109] !== t19 || $[110] !== t31 || $[111] !== t43 || $[112] !== t55) {
460
- t56 = /* @__PURE__ */ jsxs(FieldGroup, { children: [
461
- t19,
462
- t31,
463
- t43,
464
- t55
465
- ] });
466
- $[109] = t19;
467
- $[110] = t31;
468
- $[111] = t43;
469
- $[112] = t55;
470
- $[113] = t56;
471
- } else t56 = $[113];
472
- let t57;
473
- if ($[114] !== error) {
474
- t57 = error && /* @__PURE__ */ jsxs(Alert, {
475
- variant: "destructive",
476
- children: [/* @__PURE__ */ jsx(Icon, { icon: "ph:warning-circle" }), /* @__PURE__ */ jsx(AlertDescription, { children: error })]
477
- });
478
- $[114] = error;
479
- $[115] = t57;
480
- } else t57 = $[115];
481
- let t58;
482
- if ($[116] !== isSubmitting || $[117] !== t) {
483
- t58 = isSubmitting ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
484
- icon: "ph:spinner-gap-bold",
485
- className: "animate-spin"
486
- }), t("auth.creatingAdmin")] }) : t("auth.createFirstAdmin");
487
- $[116] = isSubmitting;
488
- $[117] = t;
489
- $[118] = t58;
490
- } else t58 = $[118];
491
- let t59;
492
- if ($[119] !== isSubmitting || $[120] !== t58) {
493
- t59 = /* @__PURE__ */ jsx(Button, {
494
- type: "submit",
495
- className: "w-full",
496
- size: "lg",
497
- disabled: isSubmitting,
498
- children: t58
499
- });
500
- $[119] = isSubmitting;
501
- $[120] = t58;
502
- $[121] = t59;
503
- } else t59 = $[121];
504
- let t60;
505
- if ($[122] !== handleFormSubmit || $[123] !== t56 || $[124] !== t57 || $[125] !== t59 || $[126] !== t7) {
506
- t60 = /* @__PURE__ */ jsxs("form", {
507
- onSubmit: handleFormSubmit,
508
- className: t7,
509
- children: [
510
- t56,
511
- t57,
512
- t59
513
- ]
514
- });
515
- $[122] = handleFormSubmit;
516
- $[123] = t56;
517
- $[124] = t57;
518
- $[125] = t59;
519
- $[126] = t7;
520
- $[127] = t60;
521
- } else t60 = $[127];
522
- return t60;
59
+ }),
60
+ className: cn("qa-setup-form space-y-4", className),
61
+ children: [
62
+ /* @__PURE__ */ jsxs(FieldGroup, { children: [
63
+ /* @__PURE__ */ jsxs(Field, {
64
+ "data-invalid": !!errors.name,
65
+ children: [/* @__PURE__ */ jsx(FieldLabel, {
66
+ htmlFor: "name",
67
+ children: t("auth.name")
68
+ }), /* @__PURE__ */ jsxs(FieldContent, { children: [/* @__PURE__ */ jsxs("div", {
69
+ className: "relative",
70
+ children: [/* @__PURE__ */ jsx(Icon, {
71
+ icon: "ph:user-duotone",
72
+ className: "text-muted-foreground absolute top-1/2 left-2 size-4 -translate-y-1/2"
73
+ }), /* @__PURE__ */ jsx(Input, {
74
+ id: "name",
75
+ type: "text",
76
+ placeholder: t("auth.namePlaceholder"),
77
+ className: "pl-8",
78
+ autoComplete: "name",
79
+ "aria-invalid": !!errors.name,
80
+ ...register("name", {
81
+ required: t("auth.nameRequired"),
82
+ minLength: {
83
+ value: 2,
84
+ message: t("auth.nameMinLength", { min: 2 })
85
+ }
86
+ })
87
+ })]
88
+ }), /* @__PURE__ */ jsx(FieldError, { children: errors.name?.message })] })]
89
+ }),
90
+ /* @__PURE__ */ jsxs(Field, {
91
+ "data-invalid": !!errors.email,
92
+ children: [/* @__PURE__ */ jsx(FieldLabel, {
93
+ htmlFor: "email",
94
+ children: t("auth.email")
95
+ }), /* @__PURE__ */ jsxs(FieldContent, { children: [/* @__PURE__ */ jsxs("div", {
96
+ className: "relative",
97
+ children: [/* @__PURE__ */ jsx(Icon, {
98
+ icon: "ph:envelope-duotone",
99
+ className: "text-muted-foreground absolute top-1/2 left-2 size-4 -translate-y-1/2"
100
+ }), /* @__PURE__ */ jsx(Input, {
101
+ id: "email",
102
+ type: "email",
103
+ placeholder: t("auth.emailPlaceholder"),
104
+ className: "pl-8",
105
+ autoComplete: "email",
106
+ "aria-invalid": !!errors.email,
107
+ ...register("email", {
108
+ required: t("auth.emailRequired"),
109
+ pattern: {
110
+ value: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
111
+ message: t("auth.invalidEmail")
112
+ }
113
+ })
114
+ })]
115
+ }), /* @__PURE__ */ jsx(FieldError, { children: errors.email?.message })] })]
116
+ }),
117
+ /* @__PURE__ */ jsxs(Field, {
118
+ "data-invalid": !!errors.password,
119
+ children: [/* @__PURE__ */ jsx(FieldLabel, {
120
+ htmlFor: "password",
121
+ children: t("auth.password")
122
+ }), /* @__PURE__ */ jsxs(FieldContent, { children: [/* @__PURE__ */ jsxs("div", {
123
+ className: "relative",
124
+ children: [/* @__PURE__ */ jsx(Icon, {
125
+ icon: "ph:lock-duotone",
126
+ className: "text-muted-foreground absolute top-1/2 left-2 size-4 -translate-y-1/2"
127
+ }), /* @__PURE__ */ jsx(Input, {
128
+ id: "password",
129
+ type: "password",
130
+ placeholder: t("auth.passwordPlaceholder"),
131
+ className: "pl-8",
132
+ autoComplete: "new-password",
133
+ "aria-invalid": !!errors.password,
134
+ ...register("password", {
135
+ required: t("auth.passwordRequired"),
136
+ minLength: {
137
+ value: minPasswordLength,
138
+ message: t("auth.passwordMinLength", { min: minPasswordLength })
139
+ }
140
+ })
141
+ })]
142
+ }), /* @__PURE__ */ jsx(FieldError, { children: errors.password?.message })] })]
143
+ }),
144
+ /* @__PURE__ */ jsxs(Field, {
145
+ "data-invalid": !!errors.confirmPassword,
146
+ children: [/* @__PURE__ */ jsx(FieldLabel, {
147
+ htmlFor: "confirmPassword",
148
+ children: t("auth.confirmPassword")
149
+ }), /* @__PURE__ */ jsxs(FieldContent, { children: [/* @__PURE__ */ jsxs("div", {
150
+ className: "relative",
151
+ children: [/* @__PURE__ */ jsx(Icon, {
152
+ icon: "ph:lock-duotone",
153
+ className: "text-muted-foreground absolute top-1/2 left-2 size-4 -translate-y-1/2"
154
+ }), /* @__PURE__ */ jsx(Input, {
155
+ id: "confirmPassword",
156
+ type: "password",
157
+ placeholder: t("auth.confirmPasswordPlaceholder"),
158
+ className: "pl-8",
159
+ autoComplete: "new-password",
160
+ "aria-invalid": !!errors.confirmPassword,
161
+ ...register("confirmPassword", {
162
+ required: t("auth.passwordRequired"),
163
+ validate: (value) => value === password || t("auth.passwordMismatch")
164
+ })
165
+ })]
166
+ }), /* @__PURE__ */ jsx(FieldError, { children: errors.confirmPassword?.message })] })]
167
+ })
168
+ ] }),
169
+ error && /* @__PURE__ */ jsxs(Alert, {
170
+ variant: "destructive",
171
+ children: [/* @__PURE__ */ jsx(Icon, { icon: "ph:warning-circle" }), /* @__PURE__ */ jsx(AlertDescription, { children: error })]
172
+ }),
173
+ /* @__PURE__ */ jsx(Button, {
174
+ type: "submit",
175
+ className: "w-full",
176
+ size: "lg",
177
+ disabled: isSubmitting,
178
+ children: isSubmitting ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
179
+ icon: "ph:spinner-gap-bold",
180
+ className: "animate-spin"
181
+ }), t("auth.creatingAdmin")] }) : t("auth.createFirstAdmin")
182
+ })
183
+ ]
184
+ });
523
185
  }
524
186
 
525
187
  //#endregion