@questpie/admin 3.2.3 → 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.
- package/dist/client/blocks/block-renderer.d.mts +2 -2
- package/dist/client/blocks/block-renderer.mjs +164 -339
- package/dist/client/components/actions/action-button.mjs +9 -9
- package/dist/client/components/actions/action-dialog.mjs +195 -493
- package/dist/client/components/actions/confirmation-dialog.mjs +44 -159
- package/dist/client/components/actions/header-actions.mjs +73 -165
- package/dist/client/components/admin-link.d.mts +2 -2
- package/dist/client/components/admin-link.mjs +40 -126
- package/dist/client/components/auth/auth-loading.mjs +9 -44
- package/dist/client/components/blocks/block-canvas.mjs +31 -95
- package/dist/client/components/blocks/block-editor-context.mjs +13 -57
- package/dist/client/components/blocks/block-editor-layout.mjs +72 -166
- package/dist/client/components/blocks/block-editor-provider.mjs +184 -245
- package/dist/client/components/blocks/block-fields-renderer.mjs +54 -229
- package/dist/client/components/blocks/block-insert-button.mjs +49 -165
- package/dist/client/components/blocks/block-item-menu.mjs +102 -301
- package/dist/client/components/blocks/block-item.mjs +136 -370
- package/dist/client/components/blocks/block-library-sidebar.mjs +106 -220
- package/dist/client/components/blocks/block-tree.mjs +12 -68
- package/dist/client/components/blocks/block-type-icon.mjs +14 -56
- package/dist/client/components/brand-logo.mjs +35 -149
- package/dist/client/components/component-renderer.mjs +42 -118
- package/dist/client/components/error-boundary.mjs +14 -58
- package/dist/client/components/fields/array-field.mjs +209 -521
- package/dist/client/components/fields/asset-preview-field.mjs +41 -141
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +60 -156
- package/dist/client/components/fields/boolean-field.mjs +29 -59
- package/dist/client/components/fields/date-field.mjs +7 -37
- package/dist/client/components/fields/datetime-field.mjs +7 -38
- package/dist/client/components/fields/email-field.mjs +25 -54
- package/dist/client/components/fields/field-wrapper.mjs +30 -105
- package/dist/client/components/fields/json-field.mjs +107 -313
- package/dist/client/components/fields/locale-badge.mjs +6 -15
- package/dist/client/components/fields/number-field.mjs +27 -60
- package/dist/client/components/fields/object-array-field.mjs +283 -659
- package/dist/client/components/fields/object-field.mjs +165 -633
- package/dist/client/components/fields/relation/displays/cards-display.mjs +106 -220
- package/dist/client/components/fields/relation/displays/chips-display.mjs +78 -150
- package/dist/client/components/fields/relation/displays/grid-display.mjs +92 -186
- package/dist/client/components/fields/relation/displays/list-display.mjs +122 -239
- package/dist/client/components/fields/relation/displays/table-display.mjs +70 -244
- package/dist/client/components/fields/relation/relation-items-display.mjs +30 -126
- package/dist/client/components/fields/relation-field.mjs +10 -66
- package/dist/client/components/fields/relation-picker.mjs +18 -18
- package/dist/client/components/fields/relation-select.mjs +12 -12
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +80 -182
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +8 -19
- package/dist/client/components/fields/rich-text-editor/image-upload.mjs +13 -29
- package/dist/client/components/fields/rich-text-editor/index.mjs +196 -530
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +61 -111
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs +105 -415
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +256 -511
- package/dist/client/components/fields/rich-text-field.mjs +14 -53
- package/dist/client/components/fields/select-field.mjs +39 -74
- package/dist/client/components/fields/text-field.mjs +26 -59
- package/dist/client/components/fields/textarea-field.mjs +26 -58
- package/dist/client/components/fields/time-field.mjs +7 -35
- package/dist/client/components/fields/upload-field.mjs +47 -165
- package/dist/client/components/filter-builder/columns-tab.mjs +80 -280
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +197 -540
- package/dist/client/components/filter-builder/filters-tab.mjs +96 -386
- package/dist/client/components/filter-builder/saved-views-tab.mjs +133 -351
- package/dist/client/components/history-sidebar.mjs +306 -611
- package/dist/client/components/layout/field-layout-renderer.mjs +106 -254
- package/dist/client/components/locale-switcher.mjs +106 -228
- package/dist/client/components/media/media-grid.mjs +84 -273
- package/dist/client/components/media/media-picker-dialog.mjs +177 -494
- package/dist/client/components/preview/live-preview-mode.mjs +240 -438
- package/dist/client/components/preview/preview-pane.mjs +22 -22
- package/dist/client/components/primitives/asset-preview.mjs +290 -666
- package/dist/client/components/primitives/checkbox-input.mjs +9 -35
- package/dist/client/components/primitives/date-input.mjs +109 -327
- package/dist/client/components/primitives/dropzone.mjs +209 -336
- package/dist/client/components/primitives/field-select-control.mjs +12 -80
- package/dist/client/components/primitives/number-input.mjs +4 -4
- package/dist/client/components/primitives/select-multi.mjs +200 -559
- package/dist/client/components/primitives/select-single.mjs +165 -499
- package/dist/client/components/primitives/time-input.mjs +43 -117
- package/dist/client/components/primitives/toggle-input.mjs +9 -29
- package/dist/client/components/sheets/resource-sheet.mjs +61 -70
- package/dist/client/components/ui/accordion.mjs +35 -155
- package/dist/client/components/ui/alert.mjs +13 -68
- package/dist/client/components/ui/badge.mjs +9 -51
- package/dist/client/components/ui/button.mjs +8 -54
- package/dist/client/components/ui/card.mjs +37 -193
- package/dist/client/components/ui/checkbox.mjs +12 -68
- package/dist/client/components/ui/command.mjs +48 -219
- package/dist/client/components/ui/dialog.mjs +50 -262
- package/dist/client/components/ui/drawer.mjs +55 -259
- package/dist/client/components/ui/dropdown-menu.mjs +86 -427
- package/dist/client/components/ui/empty-state.mjs +28 -98
- package/dist/client/components/ui/field.mjs +73 -309
- package/dist/client/components/ui/input-group.mjs +42 -167
- package/dist/client/components/ui/input.mjs +7 -37
- package/dist/client/components/ui/kbd.mjs +6 -36
- package/dist/client/components/ui/label.mjs +7 -37
- package/dist/client/components/ui/popover.mjs +34 -169
- package/dist/client/components/ui/responsive-dialog.mjs +67 -273
- package/dist/client/components/ui/scroll-fade.mjs +63 -158
- package/dist/client/components/ui/search-input.mjs +33 -100
- package/dist/client/components/ui/select.mjs +72 -393
- package/dist/client/components/ui/separator.mjs +7 -38
- package/dist/client/components/ui/sheet.mjs +49 -269
- package/dist/client/components/ui/sidebar.mjs +171 -690
- package/dist/client/components/ui/skeleton.mjs +7 -38
- package/dist/client/components/ui/sonner.mjs +11 -42
- package/dist/client/components/ui/switch.mjs +9 -45
- package/dist/client/components/ui/table.mjs +48 -266
- package/dist/client/components/ui/tabs.mjs +26 -139
- package/dist/client/components/ui/textarea.mjs +6 -32
- package/dist/client/components/ui/tooltip.mjs +27 -129
- package/dist/client/components/widgets/chart-widget.mjs +174 -522
- package/dist/client/components/widgets/progress-widget.mjs +66 -172
- package/dist/client/components/widgets/quick-actions-widget.mjs +102 -261
- package/dist/client/components/widgets/recent-items-widget.mjs +69 -195
- package/dist/client/components/widgets/stats-widget.mjs +41 -175
- package/dist/client/components/widgets/table-widget.mjs +9 -9
- package/dist/client/components/widgets/timeline-widget.mjs +86 -226
- package/dist/client/components/widgets/value-widget.mjs +74 -381
- package/dist/client/components/widgets/widget-empty-state.mjs +26 -76
- package/dist/client/components/widgets/widget-skeletons.mjs +138 -421
- package/dist/client/contexts/focus-context.d.mts +4 -0
- package/dist/client/contexts/focus-context.mjs +87 -150
- package/dist/client/hooks/typed-hooks.mjs +241 -701
- package/dist/client/hooks/use-action.mjs +62 -198
- package/dist/client/hooks/use-admin-config.mjs +5 -35
- package/dist/client/hooks/use-admin-preferences.mjs +16 -88
- package/dist/client/hooks/use-admin-routes.mjs +22 -56
- package/dist/client/hooks/use-audit-history.mjs +21 -69
- package/dist/client/hooks/use-brand.mjs +1 -9
- package/dist/client/hooks/use-collection-fields.mjs +17 -57
- package/dist/client/hooks/use-collection-meta.mjs +12 -44
- package/dist/client/hooks/use-collection-schema.mjs +10 -33
- package/dist/client/hooks/use-collection-validation.mjs +23 -53
- package/dist/client/hooks/use-collection.mjs +194 -614
- package/dist/client/hooks/use-current-user.mjs +0 -1
- package/dist/client/hooks/use-field-hooks.mjs +10 -10
- package/dist/client/hooks/use-field-options.mjs +61 -202
- package/dist/client/hooks/use-global-fields.mjs +14 -46
- package/dist/client/hooks/use-global-meta.mjs +9 -30
- package/dist/client/hooks/use-global-schema.mjs +9 -30
- package/dist/client/hooks/use-global.mjs +63 -219
- package/dist/client/hooks/use-locks.mjs +117 -325
- package/dist/client/hooks/use-media-query.mjs +16 -36
- package/dist/client/hooks/use-prefill-params.mjs +0 -1
- package/dist/client/hooks/use-questpie-query-options.mjs +12 -29
- package/dist/client/hooks/use-reactive-fields.mjs +1 -1
- package/dist/client/hooks/use-reactive-prop.mjs +65 -223
- package/dist/client/hooks/use-realtime-highlight.mjs +51 -114
- package/dist/client/hooks/use-saved-views.mjs +22 -103
- package/dist/client/hooks/use-search-param-toggle.mjs +28 -79
- package/dist/client/hooks/use-search.mjs +31 -143
- package/dist/client/hooks/use-server-actions.mjs +18 -50
- package/dist/client/hooks/use-server-validation.mjs +72 -166
- package/dist/client/hooks/use-server-widget-data.mjs +7 -33
- package/dist/client/hooks/use-setup-status.mjs +12 -25
- package/dist/client/hooks/use-sidebar-search-param.mjs +33 -78
- package/dist/client/hooks/use-transition-stage.mjs +8 -38
- package/dist/client/hooks/use-upload.mjs +54 -152
- package/dist/client/hooks/use-validation-error-map.mjs +6 -26
- package/dist/client/hooks/use-view-state.mjs +187 -437
- package/dist/client/i18n/hooks.mjs +65 -197
- package/dist/client/lib/render-profiler.mjs +14 -41
- package/dist/client/preview/block-scope-context.d.mts +2 -2
- package/dist/client/preview/block-scope-context.mjs +14 -36
- package/dist/client/preview/diff.mjs +110 -0
- package/dist/client/preview/preview-banner.mjs +42 -108
- package/dist/client/preview/preview-field.d.mts +4 -4
- package/dist/client/preview/preview-field.mjs +166 -409
- package/dist/client/preview/use-collection-preview.mjs +135 -201
- package/dist/client/runtime/content-locales-provider.mjs +31 -83
- package/dist/client/runtime/locale-scope.mjs +22 -63
- package/dist/client/runtime/provider.mjs +100 -255
- package/dist/client/runtime/translations-provider.mjs +41 -107
- package/dist/client/scope/picker.d.mts +2 -2
- package/dist/client/scope/picker.mjs +86 -321
- package/dist/client/scope/provider.d.mts +2 -2
- package/dist/client/scope/provider.mjs +8 -17
- package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
- package/dist/client/views/auth/accept-invite-form.mjs +121 -412
- package/dist/client/views/auth/auth-layout.d.mts +3 -3
- package/dist/client/views/auth/auth-layout.mjs +104 -284
- package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
- package/dist/client/views/auth/forgot-password-form.mjs +94 -325
- package/dist/client/views/auth/invite-form.mjs +107 -442
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/login-form.mjs +116 -337
- package/dist/client/views/auth/reset-password-form.mjs +128 -453
- package/dist/client/views/auth/setup-form.mjs +140 -478
- package/dist/client/views/collection/auto-form-fields.mjs +243 -615
- package/dist/client/views/collection/bulk-action-toolbar.mjs +212 -400
- package/dist/client/views/collection/cells/complex-cells.mjs +183 -611
- package/dist/client/views/collection/cells/primitive-cells.mjs +109 -363
- package/dist/client/views/collection/cells/relation-cells.mjs +86 -233
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +142 -371
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +35 -131
- package/dist/client/views/collection/cells/upload-cells.mjs +60 -177
- package/dist/client/views/collection/columns/build-columns.mjs +8 -48
- package/dist/client/views/collection/field-renderer.mjs +11 -24
- package/dist/client/views/collection/form-view.mjs +288 -560
- package/dist/client/views/collection/table-view.mjs +239 -469
- package/dist/client/views/collection/view-skeletons.mjs +112 -237
- package/dist/client/views/common/global-search.mjs +241 -543
- package/dist/client/views/dashboard/dashboard-grid.mjs +256 -775
- package/dist/client/views/dashboard/dashboard-widget.mjs +38 -126
- package/dist/client/views/dashboard/widget-card.mjs +61 -269
- package/dist/client/views/globals/global-form-view.mjs +478 -1298
- package/dist/client/views/layout/admin-layout-provider.mjs +28 -88
- package/dist/client/views/layout/admin-layout.mjs +83 -246
- package/dist/client/views/layout/admin-router.mjs +457 -1289
- package/dist/client/views/layout/admin-sidebar.mjs +510 -1292
- package/dist/client/views/layout/admin-theme.mjs +30 -64
- package/dist/client/views/layout/admin-view-layout.mjs +40 -144
- package/dist/client/views/pages/accept-invite-page.mjs +95 -290
- package/dist/client/views/pages/dashboard-page.mjs +11 -57
- package/dist/client/views/pages/forgot-password-page.mjs +31 -83
- package/dist/client/views/pages/invite-page.mjs +35 -90
- package/dist/client/views/pages/login-page.mjs +41 -121
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.mjs +46 -173
- package/dist/client/views/pages/setup-page.d.mts +2 -2
- package/dist/client/views/pages/setup-page.mjs +33 -95
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
- package/dist/server/modules/admin/collections/account.d.mts +50 -50
- package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
- package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
- package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
- package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
- package/dist/server/modules/admin/collections/assets.d.mts +34 -34
- package/dist/server/modules/admin/collections/session.d.mts +42 -42
- package/dist/server/modules/admin/collections/user.d.mts +53 -53
- package/dist/server/modules/admin/collections/verification.d.mts +36 -36
- package/dist/server/modules/admin/index.d.mts +21 -20
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/locales.d.mts +2 -2
- package/dist/server/modules/admin/routes/preview.d.mts +11 -11
- package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
- package/dist/server/modules/admin/routes/setup.d.mts +7 -7
- package/dist/server/modules/admin/routes/translations.d.mts +4 -4
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
- 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(
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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
|