@skiddph/prui 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pages.js CHANGED
@@ -1,24 +1,40 @@
1
- import { jsx as e, jsxs as a, Fragment as $ } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as r, Fragment as H } from "react/jsx-runtime";
2
2
  import * as v from "react";
3
3
  import { Button as S } from "./core/button.js";
4
- import { Input as P, Textarea as G } from "./core/input.js";
4
+ import { Input as P, Textarea as U } from "./core/input.js";
5
5
  import { Label as C } from "./core/label.js";
6
- import { Loader2 as Y, LogOut as H, Inbox as K, AlertTriangle as U, FileQuestion as W } from "lucide-react";
7
- import { cn as z } from "./core/cn.js";
8
- import { Card as Q, CardHeader as J, CardTitle as X, CardDescription as Z, CardContent as _, CardFooter as k, Avatar as ee } from "./core/card.js";
9
- import { Switch as te } from "./core/switch.js";
10
- function j({ title: t, description: r, brand: o, width: n = "max-w-sm", children: d, footer: i }) {
11
- return /* @__PURE__ */ e("div", { className: "prui-page flex min-h-[100dvh] items-center justify-center bg-[var(--prui-background)] p-4", children: /* @__PURE__ */ a("div", { className: z("w-full", n), children: [
12
- o ? /* @__PURE__ */ a("div", { className: "mb-6 flex items-center justify-center gap-2", "data-testid": "page-brand", children: [
6
+ import { Loader2 as Y, LogOut as z, Inbox as K, AlertTriangle as W, FileQuestion as Q } from "lucide-react";
7
+ import { cn as _ } from "./core/cn.js";
8
+ import { Card as J, CardHeader as X, CardTitle as Z, CardDescription as k, CardContent as ee, CardFooter as te, Avatar as ae } from "./core/card.js";
9
+ import { Switch as re } from "./core/switch.js";
10
+ const ne = {
11
+ google: { id: "google", label: "Google" },
12
+ github: { id: "github", label: "GitHub" },
13
+ microsoft: { id: "microsoft", label: "Microsoft" }
14
+ };
15
+ function le(t) {
16
+ return t != null && t.length ? t.map(
17
+ (a) => typeof a == "string" ? ne[a] ?? { id: a, label: a.charAt(0).toUpperCase() + a.slice(1) } : a
18
+ ) : [];
19
+ }
20
+ function R(t) {
21
+ return typeof t == "string" ? t : t.href;
22
+ }
23
+ function q(t, a) {
24
+ return (typeof t == "string" ? a : t.label) ?? a;
25
+ }
26
+ function j({ title: t, description: a, brand: o, width: n = "max-w-sm", children: c, footer: i }) {
27
+ return /* @__PURE__ */ e("div", { className: "prui-page flex min-h-[100dvh] items-center justify-center bg-[var(--prui-background)] p-4", children: /* @__PURE__ */ r("div", { className: _("w-full", n), children: [
28
+ o ? /* @__PURE__ */ r("div", { className: "mb-6 flex items-center justify-center gap-2", "data-testid": "page-brand", children: [
13
29
  o.mark ? /* @__PURE__ */ e("img", { src: o.mark, alt: "", className: "h-8 w-8 rounded-[var(--prui-radius-1)] object-cover" }) : null,
14
30
  /* @__PURE__ */ e("span", { className: "text-lg font-semibold text-[var(--prui-fg)]", children: o.name })
15
31
  ] }) : null,
16
- /* @__PURE__ */ a("div", { className: "rounded-[var(--prui-radius)] border border-[var(--prui-line)] bg-[var(--prui-surface)] p-6", children: [
17
- /* @__PURE__ */ a("div", { className: "mb-4 flex flex-col gap-1 text-center", children: [
32
+ /* @__PURE__ */ r("div", { className: "rounded-[var(--prui-radius)] border border-[var(--prui-line)] bg-[var(--prui-surface)] p-6", children: [
33
+ /* @__PURE__ */ r("div", { className: "mb-4 flex flex-col gap-1 text-center", children: [
18
34
  /* @__PURE__ */ e("h1", { className: "text-lg font-semibold text-[var(--prui-fg)]", children: t }),
19
- r ? /* @__PURE__ */ e("p", { className: "text-sm text-[var(--prui-dim)]", children: r }) : null
35
+ a ? /* @__PURE__ */ e("p", { className: "text-sm text-[var(--prui-dim)]", children: a }) : null
20
36
  ] }),
21
- d,
37
+ c,
22
38
  i ? /* @__PURE__ */ e("div", { className: "mt-4 text-center text-sm text-[var(--prui-dim)]", children: i }) : null
23
39
  ] })
24
40
  ] }) });
@@ -34,68 +50,75 @@ function F({ error: t }) {
34
50
  }
35
51
  ) : null;
36
52
  }
37
- function ae({ loading: t, children: r }) {
38
- return /* @__PURE__ */ a($, { children: [
53
+ function oe({ loading: t, children: a }) {
54
+ return /* @__PURE__ */ r(H, { children: [
39
55
  t ? /* @__PURE__ */ e(Y, { className: "h-4 w-4 animate-spin", "aria-hidden": !0 }) : null,
40
- r
56
+ a
41
57
  ] });
42
58
  }
43
- function T({ providers: t }) {
44
- return !t || t.length === 0 ? null : /* @__PURE__ */ a("div", { className: "mt-4", "data-testid": "oauth-providers", children: [
45
- /* @__PURE__ */ a("div", { className: "relative my-3", children: [
59
+ function V({ providers: t }) {
60
+ const a = le(t);
61
+ return a.length === 0 ? null : /* @__PURE__ */ r("div", { className: "mt-4", "data-testid": "oauth-providers", children: [
62
+ /* @__PURE__ */ r("div", { className: "relative my-3", children: [
46
63
  /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ e("span", { className: "w-full border-t border-[var(--prui-line)]" }) }),
47
64
  /* @__PURE__ */ e("div", { className: "relative flex justify-center text-xs", children: /* @__PURE__ */ e("span", { className: "bg-[var(--prui-surface)] px-2 text-[var(--prui-dim)]", children: "or continue with" }) })
48
65
  ] }),
49
- /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-2", children: t.map((r) => {
50
- const o = r.icon;
51
- return /* @__PURE__ */ a(
66
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-2", children: a.map((o) => {
67
+ const n = o.icon;
68
+ return /* @__PURE__ */ r(
52
69
  "button",
53
70
  {
54
71
  type: "button",
55
- onClick: (n) => {
56
- var i;
57
- const d = (i = t.find((p) => p.id === r.id)) == null ? void 0 : i.onClick;
58
- d == null || d(), n.preventDefault();
72
+ onClick: (c) => {
73
+ var p;
74
+ const i = (p = a.find((d) => d.id === o.id)) == null ? void 0 : p.onClick;
75
+ i == null || i(), c.preventDefault();
59
76
  },
60
77
  className: "inline-flex h-9 items-center justify-center gap-2 rounded-[var(--prui-radius)] border border-[var(--prui-line)] bg-[var(--prui-background)] text-sm text-[var(--prui-fg)] hover:border-[var(--prui-dim)] cursor-pointer",
61
78
  children: [
62
- o ? /* @__PURE__ */ e(o, { className: "h-4 w-4", "aria-hidden": !0 }) : null,
63
- r.label
79
+ n ? /* @__PURE__ */ e(n, { className: "h-4 w-4", "aria-hidden": !0 }) : null,
80
+ o.label
64
81
  ]
65
82
  },
66
- r.id
83
+ o.id
67
84
  );
68
85
  }) })
69
86
  ] });
70
87
  }
71
- const A = [
88
+ const T = [
72
89
  { name: "email", label: "Email", type: "email", required: !0, autoComplete: "email" },
73
90
  { name: "password", label: "Password", type: "password", required: !0, autoComplete: "current-password" }
74
- ], re = [
91
+ ], ie = [
75
92
  { name: "name", label: "Name", type: "text", required: !0, autoComplete: "name" },
76
93
  { name: "email", label: "Email", type: "email", required: !0, autoComplete: "email" },
77
94
  { name: "password", label: "Password", type: "password", required: !0, autoComplete: "new-password" }
78
95
  ];
79
- function ne({
96
+ function se({
80
97
  onSubmit: t,
81
- fields: r,
98
+ fields: a,
82
99
  extraFields: o,
83
100
  links: n,
84
- oauth: d,
101
+ oauth: c,
85
102
  brand: i,
86
103
  submitLabel: p = "Sign in",
87
- loading: c = !1,
104
+ loading: d = !1,
88
105
  error: x,
89
106
  className: g
90
107
  }) {
91
- const s = { email: !0, password: !0, remember: !1, ...r }, m = [
92
- ...s.email !== !1 ? [A[0]] : [],
93
- ...s.password !== !1 ? [A[1]] : [],
108
+ const s = {
109
+ email: !0,
110
+ password: !0,
111
+ remember: !1,
112
+ ...a,
113
+ ...(a == null ? void 0 : a.username) !== void 0 && (a == null ? void 0 : a.email) === void 0 ? { email: a.username } : {}
114
+ }, m = [
115
+ ...s.email !== !1 ? [T[0]] : [],
116
+ ...s.password !== !1 ? [T[1]] : [],
94
117
  ...o ?? []
95
118
  ], [f, y] = v.useState({}), [w, N] = v.useState(!1), [h, B] = v.useState(!1);
96
- return /* @__PURE__ */ a(j, { title: "Welcome back", description: "Sign in to your account", brand: i, className: g, children: [
119
+ return /* @__PURE__ */ r(j, { title: "Welcome back", description: "Sign in to your account", brand: i, className: g, children: [
97
120
  /* @__PURE__ */ e(F, { error: x }),
98
- /* @__PURE__ */ a("form", { onSubmit: async (l) => {
121
+ /* @__PURE__ */ r("form", { onSubmit: async (l) => {
99
122
  l.preventDefault();
100
123
  try {
101
124
  const u = t == null ? void 0 : t({ ...f, remember: String(w) });
@@ -104,8 +127,8 @@ function ne({
104
127
  B(!1);
105
128
  }
106
129
  }, className: "flex flex-col gap-3", "data-testid": "login-form", children: [
107
- m.map((l) => /* @__PURE__ */ a("div", { className: "flex flex-col gap-1.5", children: [
108
- /* @__PURE__ */ a(C, { htmlFor: `login-${l.name}`, children: [
130
+ m.map((l) => /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5", children: [
131
+ /* @__PURE__ */ r(C, { htmlFor: `login-${l.name}`, children: [
109
132
  l.label,
110
133
  l.required ? /* @__PURE__ */ e("span", { className: "ml-0.5 text-[var(--prui-danger)]", children: "*" }) : null
111
134
  ] }),
@@ -117,13 +140,13 @@ function ne({
117
140
  placeholder: l.placeholder,
118
141
  autoComplete: l.autoComplete,
119
142
  required: l.required,
120
- disabled: c || h,
143
+ disabled: d || h,
121
144
  value: f[l.name] ?? "",
122
145
  onChange: (u) => y((b) => ({ ...b, [l.name]: u.target.value }))
123
146
  }
124
147
  )
125
148
  ] }, l.name)),
126
- s.remember ? /* @__PURE__ */ a("label", { className: "flex items-center gap-2 text-sm text-[var(--prui-dim)]", "data-testid": "login-remember", children: [
149
+ s.remember ? /* @__PURE__ */ r("label", { className: "flex items-center gap-2 text-sm text-[var(--prui-dim)]", "data-testid": "login-remember", children: [
127
150
  /* @__PURE__ */ e(
128
151
  "input",
129
152
  {
@@ -135,18 +158,18 @@ function ne({
135
158
  ),
136
159
  "Remember me"
137
160
  ] }) : null,
138
- /* @__PURE__ */ e(S, { type: "submit", variant: "primary", loading: c || h, "data-testid": "login-submit", children: /* @__PURE__ */ e(ae, { loading: c || h, children: p }) })
161
+ /* @__PURE__ */ e(S, { type: "submit", variant: "primary", loading: d || h, "data-testid": "login-submit", children: /* @__PURE__ */ e(oe, { loading: d || h, children: p }) })
139
162
  ] }),
140
- /* @__PURE__ */ e(T, { providers: d }),
141
- (n == null ? void 0 : n.forgot) !== !1 && (n != null && n.forgot) ? /* @__PURE__ */ e("div", { className: "mt-3 text-center", children: /* @__PURE__ */ e("a", { href: n.forgot.href, className: "text-sm text-[var(--prui-brand)] hover:underline", children: n.forgot.label ?? "Forgot password?" }) }) : null,
142
- (n == null ? void 0 : n.register) !== !1 && (n != null && n.register) ? /* @__PURE__ */ a("div", { className: "mt-1 text-center text-sm text-[var(--prui-dim)]", children: [
163
+ /* @__PURE__ */ e(V, { providers: c }),
164
+ (n == null ? void 0 : n.forgot) !== !1 && (n != null && n.forgot) ? /* @__PURE__ */ e("div", { className: "mt-3 text-center", children: /* @__PURE__ */ e("a", { href: R(n.forgot), className: "text-sm text-[var(--prui-brand)] hover:underline", children: q(n.forgot, "Forgot password?") }) }) : null,
165
+ (n == null ? void 0 : n.register) !== !1 && (n != null && n.register) ? /* @__PURE__ */ r("div", { className: "mt-1 text-center text-sm text-[var(--prui-dim)]", children: [
143
166
  "No account?",
144
167
  " ",
145
- /* @__PURE__ */ e("a", { href: n.register.href, className: "text-[var(--prui-brand)] hover:underline", children: n.register.label ?? "Register" })
168
+ /* @__PURE__ */ e("a", { href: R(n.register), className: "text-[var(--prui-brand)] hover:underline", children: q(n.register, "Register") })
146
169
  ] }) : null
147
170
  ] });
148
171
  }
149
- const Ce = {
172
+ const Fe = {
150
173
  name: "LoginPage",
151
174
  props: [
152
175
  { name: "onSubmit", type: "(values) => void | Promise<void>", default: null, control: "none" },
@@ -158,23 +181,23 @@ const Ce = {
158
181
  { name: "error", type: "string | null", default: "null", control: "text" }
159
182
  ]
160
183
  };
161
- function le({
184
+ function de({
162
185
  onSubmit: t,
163
- fields: r,
186
+ fields: a,
164
187
  extraFields: o,
165
188
  links: n,
166
- oauth: d,
189
+ oauth: c,
167
190
  brand: i,
168
191
  submitLabel: p = "Create account",
169
- loading: c = !1,
192
+ loading: d = !1,
170
193
  error: x
171
194
  }) {
172
- const g = { name: !0, email: !0, password: !0, confirm: !1, ...r }, m = [...re.filter(
195
+ const g = { name: !0, email: !0, password: !0, confirm: !1, ...a }, m = [...ie.filter(
173
196
  (l) => l.name === "name" ? g.name !== !1 : l.name === "email" ? g.email !== !1 : g.password !== !1
174
197
  ), ...o ?? []], [f, y] = v.useState({}), [w, N] = v.useState(""), [h, B] = v.useState(!1);
175
- return /* @__PURE__ */ a(j, { title: "Create your account", description: "Get started in minutes", brand: i, width: "max-w-md", children: [
198
+ return /* @__PURE__ */ r(j, { title: "Create your account", description: "Get started in minutes", brand: i, width: "max-w-md", children: [
176
199
  /* @__PURE__ */ e(F, { error: x }),
177
- /* @__PURE__ */ a("form", { onSubmit: async (l) => {
200
+ /* @__PURE__ */ r("form", { onSubmit: async (l) => {
178
201
  l.preventDefault();
179
202
  try {
180
203
  const u = t == null ? void 0 : t({ ...f, confirm: w });
@@ -183,8 +206,8 @@ function le({
183
206
  B(!1);
184
207
  }
185
208
  }, className: "flex flex-col gap-3", "data-testid": "register-form", children: [
186
- m.map((l) => /* @__PURE__ */ a("div", { className: "flex flex-col gap-1.5", children: [
187
- /* @__PURE__ */ a(C, { htmlFor: `register-${l.name}`, children: [
209
+ m.map((l) => /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5", children: [
210
+ /* @__PURE__ */ r(C, { htmlFor: `register-${l.name}`, children: [
188
211
  l.label,
189
212
  l.required ? /* @__PURE__ */ e("span", { className: "ml-0.5 text-[var(--prui-danger)]", children: "*" }) : null
190
213
  ] }),
@@ -196,14 +219,14 @@ function le({
196
219
  placeholder: l.placeholder,
197
220
  autoComplete: l.autoComplete,
198
221
  required: l.required,
199
- disabled: c || h,
222
+ disabled: d || h,
200
223
  value: f[l.name] ?? "",
201
224
  onChange: (u) => y((b) => ({ ...b, [l.name]: u.target.value }))
202
225
  }
203
226
  )
204
227
  ] }, l.name)),
205
- g.confirm ? /* @__PURE__ */ a("div", { className: "flex flex-col gap-1.5", "data-testid": "register-confirm", children: [
206
- /* @__PURE__ */ a(C, { htmlFor: "register-confirm-password", children: [
228
+ g.confirm ? /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5", "data-testid": "register-confirm", children: [
229
+ /* @__PURE__ */ r(C, { htmlFor: "register-confirm-password", children: [
207
230
  "Confirm password",
208
231
  /* @__PURE__ */ e("span", { className: "ml-0.5 text-[var(--prui-danger)]", children: "*" })
209
232
  ] }),
@@ -214,23 +237,23 @@ function le({
214
237
  type: "password",
215
238
  autoComplete: "new-password",
216
239
  required: !0,
217
- disabled: c || h,
240
+ disabled: d || h,
218
241
  value: w,
219
242
  onChange: (l) => N(l.target.value)
220
243
  }
221
244
  )
222
245
  ] }) : null,
223
- /* @__PURE__ */ e(S, { type: "submit", variant: "primary", loading: c || h, "data-testid": "register-submit", children: p })
246
+ /* @__PURE__ */ e(S, { type: "submit", variant: "primary", loading: d || h, "data-testid": "register-submit", children: p })
224
247
  ] }),
225
- /* @__PURE__ */ e(T, { providers: d }),
226
- n != null && n.login ? /* @__PURE__ */ a("div", { className: "mt-3 text-center text-sm text-[var(--prui-dim)]", "data-testid": "register-login-link", children: [
248
+ /* @__PURE__ */ e(V, { providers: c }),
249
+ n != null && n.login ? /* @__PURE__ */ r("div", { className: "mt-3 text-center text-sm text-[var(--prui-dim)]", "data-testid": "register-login-link", children: [
227
250
  "Already have an account?",
228
251
  " ",
229
- /* @__PURE__ */ e("a", { href: n.login.href, className: "text-[var(--prui-brand)] hover:underline", children: n.login.label ?? "Sign in" })
252
+ /* @__PURE__ */ e("a", { href: R(n.login), className: "text-[var(--prui-brand)] hover:underline", children: q(n.login, "Sign in") })
230
253
  ] }) : null
231
254
  ] });
232
255
  }
233
- const Se = {
256
+ const Re = {
234
257
  name: "RegisterPage",
235
258
  props: [
236
259
  { name: "onSubmit", type: "(values) => void | Promise<void>", default: null, control: "none" },
@@ -242,29 +265,29 @@ const Se = {
242
265
  { name: "error", type: "string | null", default: "null", control: "text" }
243
266
  ]
244
267
  };
245
- function oe({
268
+ function ce({
246
269
  onSubmit: t,
247
- links: r,
270
+ links: a,
248
271
  brand: o,
249
272
  submitLabel: n = "Send reset link",
250
- loading: d = !1,
273
+ loading: c = !1,
251
274
  error: i,
252
275
  sent: p = !1
253
276
  }) {
254
- const [c, x] = v.useState(""), [g, s] = v.useState(!1);
255
- return /* @__PURE__ */ a(j, { title: "Forgot your password?", description: "Enter your email and we send you a reset link", brand: o, children: [
277
+ const [d, x] = v.useState(""), [g, s] = v.useState(!1);
278
+ return /* @__PURE__ */ r(j, { title: "Forgot your password?", description: "Enter your email and we send you a reset link", brand: o, children: [
256
279
  /* @__PURE__ */ e(F, { error: i }),
257
- p ? /* @__PURE__ */ e("p", { "data-testid": "forgot-sent", className: "rounded-[var(--prui-radius)] border border-[var(--prui-ok)]/40 bg-[var(--prui-ok)]/10 px-3 py-3 text-center text-sm text-[var(--prui-ok)]", children: "Check your email for the reset link." }) : /* @__PURE__ */ a("form", { onSubmit: async (f) => {
280
+ p ? /* @__PURE__ */ e("p", { "data-testid": "forgot-sent", className: "rounded-[var(--prui-radius)] border border-[var(--prui-ok)]/40 bg-[var(--prui-ok)]/10 px-3 py-3 text-center text-sm text-[var(--prui-ok)]", children: "Check your email for the reset link." }) : /* @__PURE__ */ r("form", { onSubmit: async (f) => {
258
281
  f.preventDefault();
259
282
  try {
260
- const y = t == null ? void 0 : t({ email: c });
283
+ const y = t == null ? void 0 : t({ email: d });
261
284
  y && typeof y.then == "function" && (s(!0), await y);
262
285
  } finally {
263
286
  s(!1);
264
287
  }
265
288
  }, className: "flex flex-col gap-3", "data-testid": "forgot-form", children: [
266
- /* @__PURE__ */ a("div", { className: "flex flex-col gap-1.5", children: [
267
- /* @__PURE__ */ a(C, { htmlFor: "forgot-email", children: [
289
+ /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5", children: [
290
+ /* @__PURE__ */ r(C, { htmlFor: "forgot-email", children: [
268
291
  "Email",
269
292
  /* @__PURE__ */ e("span", { className: "ml-0.5 text-[var(--prui-danger)]", children: "*" })
270
293
  ] }),
@@ -276,18 +299,18 @@ function oe({
276
299
  autoComplete: "email",
277
300
  required: !0,
278
301
  placeholder: "you@example.com",
279
- disabled: d || g,
280
- value: c,
302
+ disabled: c || g,
303
+ value: d,
281
304
  onChange: (f) => x(f.target.value)
282
305
  }
283
306
  )
284
307
  ] }),
285
- /* @__PURE__ */ e(S, { type: "submit", variant: "primary", loading: d || g, "data-testid": "forgot-submit", children: n })
308
+ /* @__PURE__ */ e(S, { type: "submit", variant: "primary", loading: c || g, "data-testid": "forgot-submit", children: n })
286
309
  ] }),
287
- (r == null ? void 0 : r.login) !== !1 && (r != null && r.login) ? /* @__PURE__ */ e("div", { className: "mt-3 text-center text-sm", children: /* @__PURE__ */ e("a", { href: r.login.href, className: "text-[var(--prui-brand)] hover:underline", children: r.login.label ?? "Back to sign in" }) }) : null
310
+ (a == null ? void 0 : a.login) !== !1 && (a != null && a.login) ? /* @__PURE__ */ e("div", { className: "mt-3 text-center text-sm", children: /* @__PURE__ */ e("a", { href: R(a.login), className: "text-[var(--prui-brand)] hover:underline", children: q(a.login, "Back to sign in") }) }) : null
288
311
  ] });
289
312
  }
290
- const je = {
313
+ const qe = {
291
314
  name: "ForgotPasswordPage",
292
315
  props: [
293
316
  { name: "onSubmit", type: "({ email }) => void | Promise<void>", default: null, control: "none" },
@@ -298,19 +321,19 @@ const je = {
298
321
  { name: "sent", type: "boolean", default: "false", control: "boolean" }
299
322
  ]
300
323
  };
301
- function ie({
324
+ function ue({
302
325
  onSubmit: t,
303
- fields: r,
326
+ fields: a,
304
327
  links: o,
305
328
  brand: n,
306
- submitLabel: d = "Reset password",
329
+ submitLabel: c = "Reset password",
307
330
  loading: i = !1,
308
331
  error: p
309
332
  }) {
310
- const c = { password: !0, confirm: !0, ...r }, [x, g] = v.useState({ password: "", confirm: "" }), [s, m] = v.useState(!1);
311
- return /* @__PURE__ */ a(j, { title: "Choose a new password", description: "Your new password must be different from previous ones", brand: n, children: [
333
+ const d = { password: !0, confirm: !0, ...a }, [x, g] = v.useState({ password: "", confirm: "" }), [s, m] = v.useState(!1);
334
+ return /* @__PURE__ */ r(j, { title: "Choose a new password", description: "Your new password must be different from previous ones", brand: n, children: [
312
335
  /* @__PURE__ */ e(F, { error: p }),
313
- /* @__PURE__ */ a("form", { onSubmit: async (y) => {
336
+ /* @__PURE__ */ r("form", { onSubmit: async (y) => {
314
337
  y.preventDefault();
315
338
  try {
316
339
  const w = t == null ? void 0 : t({ ...x });
@@ -319,8 +342,8 @@ function ie({
319
342
  m(!1);
320
343
  }
321
344
  }, className: "flex flex-col gap-3", "data-testid": "reset-form", children: [
322
- c.password !== !1 ? /* @__PURE__ */ a("div", { className: "flex flex-col gap-1.5", children: [
323
- /* @__PURE__ */ a(C, { htmlFor: "reset-password", children: [
345
+ d.password !== !1 ? /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5", children: [
346
+ /* @__PURE__ */ r(C, { htmlFor: "reset-password", children: [
324
347
  "New password",
325
348
  /* @__PURE__ */ e("span", { className: "ml-0.5 text-[var(--prui-danger)]", children: "*" })
326
349
  ] }),
@@ -337,8 +360,8 @@ function ie({
337
360
  }
338
361
  )
339
362
  ] }) : null,
340
- c.confirm !== !1 ? /* @__PURE__ */ a("div", { className: "flex flex-col gap-1.5", "data-testid": "reset-confirm", children: [
341
- /* @__PURE__ */ a(C, { htmlFor: "reset-confirm", children: [
363
+ d.confirm !== !1 ? /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5", "data-testid": "reset-confirm", children: [
364
+ /* @__PURE__ */ r(C, { htmlFor: "reset-confirm", children: [
342
365
  "Confirm password",
343
366
  /* @__PURE__ */ e("span", { className: "ml-0.5 text-[var(--prui-danger)]", children: "*" })
344
367
  ] }),
@@ -355,12 +378,12 @@ function ie({
355
378
  }
356
379
  )
357
380
  ] }) : null,
358
- /* @__PURE__ */ e(S, { type: "submit", variant: "primary", loading: i || s, "data-testid": "reset-submit", children: d })
381
+ /* @__PURE__ */ e(S, { type: "submit", variant: "primary", loading: i || s, "data-testid": "reset-submit", children: c })
359
382
  ] }),
360
- (o == null ? void 0 : o.login) !== !1 && (o != null && o.login) ? /* @__PURE__ */ e("div", { className: "mt-3 text-center text-sm", children: /* @__PURE__ */ e("a", { href: o.login.href, className: "text-[var(--prui-brand)] hover:underline", children: o.login.label ?? "Back to sign in" }) }) : null
383
+ (o == null ? void 0 : o.login) !== !1 && (o != null && o.login) ? /* @__PURE__ */ e("div", { className: "mt-3 text-center text-sm", children: /* @__PURE__ */ e("a", { href: R(o.login), className: "text-[var(--prui-brand)] hover:underline", children: q(o.login, "Back to sign in") }) }) : null
361
384
  ] });
362
385
  }
363
- const Be = {
386
+ const Ee = {
364
387
  name: "ResetPasswordPage",
365
388
  props: [
366
389
  { name: "onSubmit", type: "({ password, confirm }) => void | Promise<void>", default: null, control: "none" },
@@ -371,44 +394,44 @@ const Be = {
371
394
  { name: "error", type: "string | null", default: "null", control: "text" }
372
395
  ]
373
396
  };
374
- function se({
397
+ function me({
375
398
  onSubmit: t,
376
- length: r = 6,
399
+ length: a = 6,
377
400
  title: o = "Enter verification code",
378
401
  description: n = "We sent a code to your email",
379
- brand: d,
402
+ brand: c,
380
403
  submitLabel: i = "Verify",
381
404
  loading: p = !1,
382
- error: c,
405
+ error: d,
383
406
  onResend: x,
384
407
  resendLabel: g = "Resend code"
385
408
  }) {
386
- const [s, m] = v.useState(() => Array.from({ length: r }, () => "")), f = v.useRef([]), y = s.join(""), w = (l, u) => {
387
- var D, M;
409
+ const [s, m] = v.useState(() => Array.from({ length: a }, () => "")), f = v.useRef([]), y = s.join(""), w = (l, u) => {
410
+ var L, A;
388
411
  const b = u.replace(/\D/g, "");
389
412
  if (b.length > 1) {
390
- const R = b.slice(0, r - l).split("");
391
- m((V) => {
392
- const L = [...V];
393
- return R.forEach((I, O) => {
394
- L[l + O] = I;
395
- }), L;
413
+ const E = b.slice(0, a - l).split("");
414
+ m((O) => {
415
+ const I = [...O];
416
+ return E.forEach((G, $) => {
417
+ I[l + $] = G;
418
+ }), I;
396
419
  });
397
- const q = Math.min(l + R.length, r - 1);
398
- (D = f.current[q]) == null || D.focus();
420
+ const D = Math.min(l + E.length, a - 1);
421
+ (L = f.current[D]) == null || L.focus();
399
422
  return;
400
423
  }
401
- m((R) => {
402
- const q = [...R];
403
- return q[l] = b, q;
404
- }), b && l < r - 1 && ((M = f.current[l + 1]) == null || M.focus());
424
+ m((E) => {
425
+ const D = [...E];
426
+ return D[l] = b, D;
427
+ }), b && l < a - 1 && ((A = f.current[l + 1]) == null || A.focus());
405
428
  }, N = (l, u) => {
406
429
  var b;
407
430
  u.key === "Backspace" && !s[l] && l > 0 && ((b = f.current[l - 1]) == null || b.focus());
408
431
  }, [h, B] = v.useState(!1);
409
- return /* @__PURE__ */ a(j, { title: o, description: n, brand: d, children: [
410
- /* @__PURE__ */ e(F, { error: c }),
411
- /* @__PURE__ */ a("form", { onSubmit: async (l) => {
432
+ return /* @__PURE__ */ r(j, { title: o, description: n, brand: c, children: [
433
+ /* @__PURE__ */ e(F, { error: d }),
434
+ /* @__PURE__ */ r("form", { onSubmit: async (l) => {
412
435
  l.preventDefault();
413
436
  try {
414
437
  const u = t == null ? void 0 : t(y);
@@ -426,7 +449,7 @@ function se({
426
449
  type: "text",
427
450
  inputMode: "numeric",
428
451
  autoComplete: "one-time-code",
429
- maxLength: r,
452
+ maxLength: a,
430
453
  "aria-label": `Digit ${u + 1}`,
431
454
  className: "h-11 w-10 text-center text-lg",
432
455
  disabled: p || h,
@@ -449,7 +472,7 @@ function se({
449
472
  ) }) : null
450
473
  ] });
451
474
  }
452
- const Fe = {
475
+ const De = {
453
476
  name: "OtpPage",
454
477
  props: [
455
478
  { name: "onSubmit", type: "(code: string) => void | Promise<void>", default: null, control: "none" },
@@ -460,15 +483,15 @@ const Fe = {
460
483
  { name: "onResend", type: "() => void | Promise<void>", default: null, control: "none" }
461
484
  ]
462
485
  };
463
- function de({ onLogout: t, brand: r, message: o, loading: n = !1 }) {
486
+ function pe({ onLogout: t, brand: a, message: o, loading: n = !1 }) {
464
487
  return v.useEffect(() => {
465
488
  t && t();
466
- }, [t]), /* @__PURE__ */ e(j, { title: "Signing out", brand: r, width: "max-w-xs", children: /* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-3 py-4 text-[var(--prui-dim)]", "data-testid": "logout-page", children: [
467
- /* @__PURE__ */ e(H, { className: "h-6 w-6", "aria-hidden": !0 }),
489
+ }, [t]), /* @__PURE__ */ e(j, { title: "Signing out", brand: a, width: "max-w-xs", children: /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-3 py-4 text-[var(--prui-dim)]", "data-testid": "logout-page", children: [
490
+ /* @__PURE__ */ e(z, { className: "h-6 w-6", "aria-hidden": !0 }),
468
491
  /* @__PURE__ */ e("p", { className: "text-sm text-center", children: o ?? (n ? "Signing you out..." : "You have been signed out.") })
469
492
  ] }) });
470
493
  }
471
- const Re = {
494
+ const Me = {
472
495
  name: "LogoutPage",
473
496
  props: [
474
497
  { name: "onLogout", type: "() => void | Promise<void>", default: null, control: "none" },
@@ -477,20 +500,20 @@ const Re = {
477
500
  { name: "loading", type: "boolean", default: "false", control: "boolean" }
478
501
  ]
479
502
  };
480
- function ce({
503
+ function fe({
481
504
  title: t = "Page not found",
482
- description: r = "The page you are looking for does not exist or has been moved.",
505
+ description: a = "The page you are looking for does not exist or has been moved.",
483
506
  homeHref: o = "/",
484
507
  onGoHome: n,
485
- brand: d
508
+ brand: c
486
509
  }) {
487
- return /* @__PURE__ */ e(j, { title: t, description: r, brand: d, width: "max-w-md", children: /* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-4 py-4", "data-testid": "notfound-page", children: [
488
- /* @__PURE__ */ e(W, { className: "h-10 w-10 text-[var(--prui-dim)]", "aria-hidden": !0 }),
510
+ return /* @__PURE__ */ e(j, { title: t, description: a, brand: c, width: "max-w-md", children: /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-4 py-4", "data-testid": "notfound-page", children: [
511
+ /* @__PURE__ */ e(Q, { className: "h-10 w-10 text-[var(--prui-dim)]", "aria-hidden": !0 }),
489
512
  /* @__PURE__ */ e("code", { className: "text-3xl font-bold text-[var(--prui-fg)]", children: "404" }),
490
513
  n ? /* @__PURE__ */ e(S, { variant: "primary", onClick: n, "data-testid": "notfound-home", children: "Go home" }) : /* @__PURE__ */ e(S, { variant: "primary", asChild: !0, "data-testid": "notfound-home", children: /* @__PURE__ */ e("a", { href: o, children: "Go home" }) })
491
514
  ] }) });
492
515
  }
493
- const qe = {
516
+ const Le = {
494
517
  name: "NotFoundPage",
495
518
  props: [
496
519
  { name: "title", type: "string", default: "'Page not found'", control: "text" },
@@ -500,21 +523,21 @@ const qe = {
500
523
  { name: "brand", type: "BrandConfig", default: "undefined", control: "object" }
501
524
  ]
502
525
  };
503
- function ue({
526
+ function he({
504
527
  title: t = "Something went wrong",
505
- error: r,
528
+ error: a,
506
529
  onRetry: o,
507
530
  retryLabel: n = "Try again",
508
- brand: d
531
+ brand: c
509
532
  }) {
510
- const i = r instanceof Error ? r.message : typeof r == "string" ? r : void 0;
511
- return /* @__PURE__ */ e(j, { title: t, brand: d, width: "max-w-md", children: /* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-4 py-4", "data-testid": "error-page", children: [
512
- /* @__PURE__ */ e(U, { className: "h-10 w-10 text-[var(--prui-warn)]", "aria-hidden": !0 }),
533
+ const i = a instanceof Error ? a.message : typeof a == "string" ? a : void 0;
534
+ return /* @__PURE__ */ e(j, { title: t, brand: c, width: "max-w-md", children: /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-4 py-4", "data-testid": "error-page", children: [
535
+ /* @__PURE__ */ e(W, { className: "h-10 w-10 text-[var(--prui-warn)]", "aria-hidden": !0 }),
513
536
  i ? /* @__PURE__ */ e("p", { role: "alert", className: "rounded-[var(--prui-radius)] border border-[var(--prui-warn)]/40 bg-[var(--prui-warn)]/10 px-3 py-2 text-sm text-[var(--prui-warn)]", children: i }) : /* @__PURE__ */ e("p", { className: "text-sm text-[var(--prui-dim)]", children: "An unexpected error occurred." }),
514
537
  o ? /* @__PURE__ */ e(S, { variant: "primary", onClick: o, "data-testid": "error-retry", children: n }) : null
515
538
  ] }) });
516
539
  }
517
- const Ee = {
540
+ const Ae = {
518
541
  name: "ErrorPage",
519
542
  props: [
520
543
  { name: "title", type: "string", default: "'Something went wrong'", control: "text" },
@@ -524,23 +547,23 @@ const Ee = {
524
547
  { name: "brand", type: "BrandConfig", default: "undefined", control: "object" }
525
548
  ]
526
549
  };
527
- function De({
550
+ function Ie({
528
551
  title: t = "Nothing here yet",
529
- description: r,
552
+ description: a,
530
553
  icon: o = K,
531
554
  action: n,
532
- className: d
555
+ className: c
533
556
  }) {
534
- return /* @__PURE__ */ a("div", { className: d ?? "flex flex-col items-center justify-center gap-3 rounded-[var(--prui-radius)] border border-dashed border-[var(--prui-line)] px-6 py-12 text-center", "data-testid": "empty-state", children: [
557
+ return /* @__PURE__ */ r("div", { className: c ?? "flex flex-col items-center justify-center gap-3 rounded-[var(--prui-radius)] border border-dashed border-[var(--prui-line)] px-6 py-12 text-center", "data-testid": "empty-state", children: [
535
558
  /* @__PURE__ */ e(o, { className: "h-8 w-8 text-[var(--prui-dim)]", "aria-hidden": !0 }),
536
- /* @__PURE__ */ a("div", { children: [
559
+ /* @__PURE__ */ r("div", { children: [
537
560
  /* @__PURE__ */ e("p", { className: "text-sm font-medium text-[var(--prui-fg)]", children: t }),
538
- r ? /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-[var(--prui-dim)]", children: r }) : null
561
+ a ? /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-[var(--prui-dim)]", children: a }) : null
539
562
  ] }),
540
563
  n
541
564
  ] });
542
565
  }
543
- const Me = {
566
+ const Te = {
544
567
  name: "EmptyState",
545
568
  props: [
546
569
  { name: "title", type: "string", default: "'Nothing here yet'", control: "text" },
@@ -549,15 +572,15 @@ const Me = {
549
572
  { name: "action", type: "ReactNode", default: null, control: "none" }
550
573
  ]
551
574
  };
552
- function me({
575
+ function ge({
553
576
  profile: t = {},
554
- onSubmit: r,
577
+ onSubmit: a,
555
578
  fields: o,
556
579
  onSignOut: n,
557
- signOutLabel: d = "Sign out",
580
+ signOutLabel: c = "Sign out",
558
581
  brand: i,
559
582
  submitLabel: p = "Save profile",
560
- loading: c = !1,
583
+ loading: d = !1,
561
584
  error: x
562
585
  }) {
563
586
  const g = { name: !0, email: !0, bio: !0, ...o }, [s, m] = v.useState({
@@ -565,67 +588,67 @@ function me({
565
588
  email: t.email ?? "",
566
589
  bio: t.bio ?? ""
567
590
  }), [f, y] = v.useState(!1);
568
- return /* @__PURE__ */ a(j, { title: "Your profile", brand: i, width: "max-w-lg", children: [
591
+ return /* @__PURE__ */ r(j, { title: "Your profile", brand: i, width: "max-w-lg", children: [
569
592
  /* @__PURE__ */ e(F, { error: x }),
570
- /* @__PURE__ */ a("form", { onSubmit: async (N) => {
593
+ /* @__PURE__ */ r("form", { onSubmit: async (N) => {
571
594
  N.preventDefault();
572
595
  try {
573
- const h = r == null ? void 0 : r({ ...s });
596
+ const h = a == null ? void 0 : a({ ...s });
574
597
  h && typeof h.then == "function" && (y(!0), await h);
575
598
  } finally {
576
599
  y(!1);
577
600
  }
578
601
  }, className: "flex flex-col gap-4", "data-testid": "profile-form", children: [
579
- /* @__PURE__ */ a("div", { className: "flex items-center gap-3", "data-testid": "profile-avatar", children: [
580
- /* @__PURE__ */ e(ee, { src: t.avatar, alt: s.name || "User", size: "lg" }),
602
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-3", "data-testid": "profile-avatar", children: [
603
+ /* @__PURE__ */ e(ae, { src: t.avatar, alt: s.name || "User", size: "lg" }),
581
604
  /* @__PURE__ */ e("div", { className: "text-sm text-[var(--prui-dim)]", children: s.email || "No email" })
582
605
  ] }),
583
- g.name !== !1 ? /* @__PURE__ */ a("div", { className: "flex flex-col gap-1.5", children: [
606
+ g.name !== !1 ? /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5", children: [
584
607
  /* @__PURE__ */ e(C, { htmlFor: "profile-name", children: "Name" }),
585
608
  /* @__PURE__ */ e(
586
609
  P,
587
610
  {
588
611
  id: "profile-name",
589
- disabled: c || f,
612
+ disabled: d || f,
590
613
  value: s.name,
591
614
  onChange: (N) => m((h) => ({ ...h, name: N.target.value }))
592
615
  }
593
616
  )
594
617
  ] }) : null,
595
- g.email !== !1 ? /* @__PURE__ */ a("div", { className: "flex flex-col gap-1.5", children: [
618
+ g.email !== !1 ? /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5", children: [
596
619
  /* @__PURE__ */ e(C, { htmlFor: "profile-email", children: "Email" }),
597
620
  /* @__PURE__ */ e(
598
621
  P,
599
622
  {
600
623
  id: "profile-email",
601
624
  type: "email",
602
- disabled: c || f,
625
+ disabled: d || f,
603
626
  value: s.email,
604
627
  onChange: (N) => m((h) => ({ ...h, email: N.target.value }))
605
628
  }
606
629
  )
607
630
  ] }) : null,
608
- g.bio !== !1 ? /* @__PURE__ */ a("div", { className: "flex flex-col gap-1.5", children: [
631
+ g.bio !== !1 ? /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5", children: [
609
632
  /* @__PURE__ */ e(C, { htmlFor: "profile-bio", children: "Bio" }),
610
633
  /* @__PURE__ */ e(
611
- G,
634
+ U,
612
635
  {
613
636
  id: "profile-bio",
614
637
  rows: 3,
615
- disabled: c || f,
638
+ disabled: d || f,
616
639
  value: s.bio,
617
640
  onChange: (N) => m((h) => ({ ...h, bio: N.target.value }))
618
641
  }
619
642
  )
620
643
  ] }) : null,
621
- /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
622
- n ? /* @__PURE__ */ e(S, { type: "button", variant: "ghost", onClick: n, children: d }) : /* @__PURE__ */ e("span", {}),
623
- /* @__PURE__ */ e(S, { type: "submit", variant: "primary", loading: c || f, "data-testid": "profile-submit", children: p })
644
+ /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
645
+ n ? /* @__PURE__ */ e(S, { type: "button", variant: "ghost", onClick: n, children: c }) : /* @__PURE__ */ e("span", {}),
646
+ /* @__PURE__ */ e(S, { type: "submit", variant: "primary", loading: d || f, "data-testid": "profile-submit", children: p })
624
647
  ] })
625
648
  ] })
626
649
  ] });
627
650
  }
628
- const Le = {
651
+ const Ve = {
629
652
  name: "ProfilePage",
630
653
  props: [
631
654
  { name: "profile", type: "{ name?, email?, avatar?, bio? }", default: "{}", control: "object" },
@@ -637,32 +660,32 @@ const Le = {
637
660
  { name: "error", type: "string | null", default: "null", control: "text" }
638
661
  ]
639
662
  };
640
- function pe({ title: t = "Settings", toggles: r = [], brand: o }) {
641
- return /* @__PURE__ */ e(j, { title: t, brand: o, width: "max-w-lg", children: /* @__PURE__ */ a(Q, { children: [
642
- /* @__PURE__ */ a(J, { children: [
643
- /* @__PURE__ */ e(X, { children: "Preferences" }),
644
- /* @__PURE__ */ e(Z, { children: "Changes apply immediately." })
663
+ function ve({ title: t = "Settings", toggles: a = [], brand: o }) {
664
+ return /* @__PURE__ */ e(j, { title: t, brand: o, width: "max-w-lg", children: /* @__PURE__ */ r(J, { children: [
665
+ /* @__PURE__ */ r(X, { children: [
666
+ /* @__PURE__ */ e(Z, { children: "Preferences" }),
667
+ /* @__PURE__ */ e(k, { children: "Changes apply immediately." })
645
668
  ] }),
646
- /* @__PURE__ */ e(_, { className: "flex flex-col divide-y divide-[var(--prui-line)]", children: r.length === 0 ? /* @__PURE__ */ e("p", { className: "py-3 text-sm text-[var(--prui-dim)]", children: "No settings available." }) : r.map((n) => /* @__PURE__ */ e(fe, { toggle: n }, n.id)) }),
647
- /* @__PURE__ */ e(k, { className: "justify-end", children: /* @__PURE__ */ a("span", { className: "text-xs text-[var(--prui-dim)]", "data-testid": "settings-page", children: [
648
- r.length,
669
+ /* @__PURE__ */ e(ee, { className: "flex flex-col divide-y divide-[var(--prui-line)]", children: a.length === 0 ? /* @__PURE__ */ e("p", { className: "py-3 text-sm text-[var(--prui-dim)]", children: "No settings available." }) : a.map((n) => /* @__PURE__ */ e(ye, { toggle: n }, n.id)) }),
670
+ /* @__PURE__ */ e(te, { className: "justify-end", children: /* @__PURE__ */ r("span", { className: "text-xs text-[var(--prui-dim)]", "data-testid": "settings-page", children: [
671
+ a.length,
649
672
  " setting",
650
- r.length === 1 ? "" : "s"
673
+ a.length === 1 ? "" : "s"
651
674
  ] }) })
652
675
  ] }) });
653
676
  }
654
- function fe({ toggle: t }) {
655
- const [r, o] = v.useState(t.defaultChecked ?? !1), n = t.checked !== void 0, d = n ? t.checked : r;
656
- return /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-4 py-3 first:pt-0 last:pb-0", children: [
657
- /* @__PURE__ */ a("div", { className: "min-w-0", children: [
677
+ function ye({ toggle: t }) {
678
+ const [a, o] = v.useState(t.defaultChecked ?? !1), n = t.checked !== void 0, c = n ? t.checked : a;
679
+ return /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-4 py-3 first:pt-0 last:pb-0", children: [
680
+ /* @__PURE__ */ r("div", { className: "min-w-0", children: [
658
681
  /* @__PURE__ */ e("p", { className: "text-sm font-medium text-[var(--prui-fg)]", children: t.label }),
659
682
  t.description ? /* @__PURE__ */ e("p", { className: "text-xs text-[var(--prui-dim)]", children: t.description }) : null
660
683
  ] }),
661
684
  /* @__PURE__ */ e(
662
- te,
685
+ re,
663
686
  {
664
687
  "aria-label": t.label,
665
- checked: d,
688
+ checked: c,
666
689
  onChange: (i) => {
667
690
  var p;
668
691
  n || o(i), (p = t.onChange) == null || p.call(t, i);
@@ -671,7 +694,7 @@ function fe({ toggle: t }) {
671
694
  )
672
695
  ] });
673
696
  }
674
- const Ae = {
697
+ const Oe = {
675
698
  name: "SettingsPage",
676
699
  props: [
677
700
  { name: "title", type: "string", default: "'Settings'", control: "text" },
@@ -679,17 +702,17 @@ const Ae = {
679
702
  { name: "brand", type: "BrandConfig", default: "undefined", control: "object" }
680
703
  ]
681
704
  };
682
- function he({
705
+ function xe({
683
706
  onSubmit: t,
684
- brand: r,
707
+ brand: a,
685
708
  description: o = "Create the first administrator account for this instance.",
686
709
  loading: n = !1,
687
- error: d
710
+ error: c
688
711
  }) {
689
- const [i, p] = v.useState({ name: "", email: "", password: "" }), [c, x] = v.useState(!1);
690
- return /* @__PURE__ */ a(j, { title: "Set up admin", description: o, brand: r, width: "max-w-md", children: [
691
- /* @__PURE__ */ e(F, { error: d }),
692
- /* @__PURE__ */ a("form", { onSubmit: async (s) => {
712
+ const [i, p] = v.useState({ name: "", email: "", password: "" }), [d, x] = v.useState(!1);
713
+ return /* @__PURE__ */ r(j, { title: "Set up admin", description: o, brand: a, width: "max-w-md", children: [
714
+ /* @__PURE__ */ e(F, { error: c }),
715
+ /* @__PURE__ */ r("form", { onSubmit: async (s) => {
693
716
  s.preventDefault();
694
717
  try {
695
718
  const m = t == null ? void 0 : t({ ...i });
@@ -698,8 +721,8 @@ function he({
698
721
  x(!1);
699
722
  }
700
723
  }, className: "flex flex-col gap-3", "data-testid": "adminsetup-form", children: [
701
- /* @__PURE__ */ a("div", { className: "flex flex-col gap-1.5", children: [
702
- /* @__PURE__ */ a(C, { htmlFor: "admin-name", children: [
724
+ /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5", children: [
725
+ /* @__PURE__ */ r(C, { htmlFor: "admin-name", children: [
703
726
  "Name",
704
727
  /* @__PURE__ */ e("span", { className: "ml-0.5 text-[var(--prui-danger)]", children: "*" })
705
728
  ] }),
@@ -709,14 +732,14 @@ function he({
709
732
  id: "admin-name",
710
733
  required: !0,
711
734
  autoComplete: "name",
712
- disabled: n || c,
735
+ disabled: n || d,
713
736
  value: i.name,
714
737
  onChange: (s) => p((m) => ({ ...m, name: s.target.value }))
715
738
  }
716
739
  )
717
740
  ] }),
718
- /* @__PURE__ */ a("div", { className: "flex flex-col gap-1.5", children: [
719
- /* @__PURE__ */ a(C, { htmlFor: "admin-email", children: [
741
+ /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5", children: [
742
+ /* @__PURE__ */ r(C, { htmlFor: "admin-email", children: [
720
743
  "Email",
721
744
  /* @__PURE__ */ e("span", { className: "ml-0.5 text-[var(--prui-danger)]", children: "*" })
722
745
  ] }),
@@ -727,14 +750,14 @@ function he({
727
750
  type: "email",
728
751
  required: !0,
729
752
  autoComplete: "email",
730
- disabled: n || c,
753
+ disabled: n || d,
731
754
  value: i.email,
732
755
  onChange: (s) => p((m) => ({ ...m, email: s.target.value }))
733
756
  }
734
757
  )
735
758
  ] }),
736
- /* @__PURE__ */ a("div", { className: "flex flex-col gap-1.5", children: [
737
- /* @__PURE__ */ a(C, { htmlFor: "admin-password", children: [
759
+ /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5", children: [
760
+ /* @__PURE__ */ r(C, { htmlFor: "admin-password", children: [
738
761
  "Password",
739
762
  /* @__PURE__ */ e("span", { className: "ml-0.5 text-[var(--prui-danger)]", children: "*" })
740
763
  ] }),
@@ -745,17 +768,17 @@ function he({
745
768
  type: "password",
746
769
  required: !0,
747
770
  autoComplete: "new-password",
748
- disabled: n || c,
771
+ disabled: n || d,
749
772
  value: i.password,
750
773
  onChange: (s) => p((m) => ({ ...m, password: s.target.value }))
751
774
  }
752
775
  )
753
776
  ] }),
754
- /* @__PURE__ */ e(S, { type: "submit", variant: "primary", loading: n || c, "data-testid": "adminsetup-submit", children: "Create admin" })
777
+ /* @__PURE__ */ e(S, { type: "submit", variant: "primary", loading: n || d, "data-testid": "adminsetup-submit", children: "Create admin" })
755
778
  ] })
756
779
  ] });
757
780
  }
758
- const Te = {
781
+ const Ge = {
759
782
  name: "AdminSetup",
760
783
  props: [
761
784
  { name: "onSubmit", type: "(values) => void | Promise<void>", default: null, control: "none" },
@@ -764,43 +787,43 @@ const Te = {
764
787
  { name: "loading", type: "boolean", default: "false", control: "boolean" },
765
788
  { name: "error", type: "string | null", default: "null", control: "text" }
766
789
  ]
767
- }, Ve = {
768
- login: ne,
769
- register: le,
770
- forgotPassword: oe,
771
- resetPassword: ie,
772
- otp: se,
773
- logout: de,
774
- notFound: ce,
775
- error: ue,
776
- profile: me,
777
- settings: pe,
778
- adminSetup: he
790
+ }, $e = {
791
+ login: se,
792
+ register: de,
793
+ forgotPassword: ce,
794
+ resetPassword: ue,
795
+ otp: me,
796
+ logout: pe,
797
+ notFound: fe,
798
+ error: he,
799
+ profile: ge,
800
+ settings: ve,
801
+ adminSetup: xe
779
802
  };
780
803
  export {
781
- he as AdminSetup,
782
- De as EmptyState,
783
- ue as ErrorPage,
784
- oe as ForgotPasswordPage,
785
- ne as LoginPage,
786
- de as LogoutPage,
787
- ce as NotFoundPage,
788
- se as OtpPage,
789
- Ve as PagesRegistry,
790
- me as ProfilePage,
791
- le as RegisterPage,
792
- ie as ResetPasswordPage,
793
- pe as SettingsPage,
794
- Te as adminSetupPropsMeta,
795
- Me as emptyStatePropsMeta,
796
- Ee as errorPagePropsMeta,
797
- je as forgotPasswordPagePropsMeta,
798
- Ce as loginPagePropsMeta,
799
- Re as logoutPagePropsMeta,
800
- qe as notFoundPagePropsMeta,
801
- Fe as otpPagePropsMeta,
802
- Le as profilePagePropsMeta,
803
- Se as registerPagePropsMeta,
804
- Be as resetPasswordPagePropsMeta,
805
- Ae as settingsPagePropsMeta
804
+ xe as AdminSetup,
805
+ Ie as EmptyState,
806
+ he as ErrorPage,
807
+ ce as ForgotPasswordPage,
808
+ se as LoginPage,
809
+ pe as LogoutPage,
810
+ fe as NotFoundPage,
811
+ me as OtpPage,
812
+ $e as PagesRegistry,
813
+ ge as ProfilePage,
814
+ de as RegisterPage,
815
+ ue as ResetPasswordPage,
816
+ ve as SettingsPage,
817
+ Ge as adminSetupPropsMeta,
818
+ Te as emptyStatePropsMeta,
819
+ Ae as errorPagePropsMeta,
820
+ qe as forgotPasswordPagePropsMeta,
821
+ Fe as loginPagePropsMeta,
822
+ Me as logoutPagePropsMeta,
823
+ Le as notFoundPagePropsMeta,
824
+ De as otpPagePropsMeta,
825
+ Ve as profilePagePropsMeta,
826
+ Re as registerPagePropsMeta,
827
+ Ee as resetPasswordPagePropsMeta,
828
+ Oe as settingsPagePropsMeta
806
829
  };