@alfadocs/ui-kit 1.70.0 → 1.71.1

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 (73) hide show
  1. package/dist/_chunks/auth-form-parts-DHv6LVV2.js +98 -0
  2. package/dist/_chunks/{forgot-password-form-Dqi7R-NL.js → forgot-password-form-BGPc8TGr.js} +2 -2
  3. package/dist/_chunks/header-settings-CAC0Yl0t.js +516 -0
  4. package/dist/_chunks/login-dev-card-CWpoTuVY.js +332 -0
  5. package/dist/_chunks/{marketplace-app-shell-CcLQ0Dn-.js → marketplace-app-shell-BeWm-Efp.js} +2 -2
  6. package/dist/agent-catalog.json +9 -1
  7. package/dist/agent-i18n/en.json +1 -0
  8. package/dist/components/header-settings/index.js +1 -1
  9. package/dist/i18n/locales/ar.d.ts +1 -0
  10. package/dist/i18n/locales/ar.js +1 -0
  11. package/dist/i18n/locales/de.d.ts +1 -0
  12. package/dist/i18n/locales/de.js +1 -0
  13. package/dist/i18n/locales/el.d.ts +1 -0
  14. package/dist/i18n/locales/el.js +1 -0
  15. package/dist/i18n/locales/en.d.ts +1 -0
  16. package/dist/i18n/locales/en.js +1 -0
  17. package/dist/i18n/locales/es.d.ts +1 -0
  18. package/dist/i18n/locales/es.js +1 -0
  19. package/dist/i18n/locales/fr.d.ts +1 -0
  20. package/dist/i18n/locales/fr.js +1 -0
  21. package/dist/i18n/locales/hi.d.ts +1 -0
  22. package/dist/i18n/locales/hi.js +1 -0
  23. package/dist/i18n/locales/it.d.ts +1 -0
  24. package/dist/i18n/locales/it.js +1 -0
  25. package/dist/i18n/locales/ja.d.ts +1 -0
  26. package/dist/i18n/locales/ja.js +1 -0
  27. package/dist/i18n/locales/nl.d.ts +1 -0
  28. package/dist/i18n/locales/nl.js +1 -0
  29. package/dist/i18n/locales/pl.d.ts +1 -0
  30. package/dist/i18n/locales/pl.js +1 -0
  31. package/dist/i18n/locales/pt.d.ts +1 -0
  32. package/dist/i18n/locales/pt.js +1 -0
  33. package/dist/i18n/locales/ro.d.ts +1 -0
  34. package/dist/i18n/locales/ro.js +1 -0
  35. package/dist/i18n/locales/ru.d.ts +1 -0
  36. package/dist/i18n/locales/ru.js +1 -0
  37. package/dist/i18n/locales/sq.d.ts +1 -0
  38. package/dist/i18n/locales/sq.js +1 -0
  39. package/dist/i18n/locales/sv.d.ts +1 -0
  40. package/dist/i18n/locales/sv.js +1 -0
  41. package/dist/i18n/locales/tr.d.ts +1 -0
  42. package/dist/i18n/locales/tr.js +1 -0
  43. package/dist/i18n/locales/zh.d.ts +1 -0
  44. package/dist/i18n/locales/zh.js +1 -0
  45. package/dist/index.js +3 -3
  46. package/dist/locales/ar.json +1 -0
  47. package/dist/locales/de.json +1 -0
  48. package/dist/locales/el.json +1 -0
  49. package/dist/locales/en.json +1 -0
  50. package/dist/locales/es.json +1 -0
  51. package/dist/locales/fr.json +1 -0
  52. package/dist/locales/hi.json +1 -0
  53. package/dist/locales/it.json +1 -0
  54. package/dist/locales/ja.json +1 -0
  55. package/dist/locales/nl.json +1 -0
  56. package/dist/locales/pl.json +1 -0
  57. package/dist/locales/pt.json +1 -0
  58. package/dist/locales/ro.json +1 -0
  59. package/dist/locales/ru.json +1 -0
  60. package/dist/locales/sq.json +1 -0
  61. package/dist/locales/sv.json +1 -0
  62. package/dist/locales/tr.json +1 -0
  63. package/dist/locales/zh.json +1 -0
  64. package/dist/patterns/_shared/auth-form-parts.d.ts +4 -3
  65. package/dist/patterns/forgot-password-form/index.js +1 -1
  66. package/dist/patterns/login-form/index.js +1 -1
  67. package/dist/patterns/login-form/login-form.d.ts +6 -2
  68. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  69. package/dist/tokens.css +1 -1
  70. package/package.json +1 -1
  71. package/dist/_chunks/auth-form-parts-B40zvD-a.js +0 -86
  72. package/dist/_chunks/header-settings-DlUbvAUx.js +0 -306
  73. package/dist/_chunks/login-dev-card-vEL-o5wq.js +0 -309
@@ -1,309 +0,0 @@
1
- import { jsxs as v, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as ls, useId as N, useState as n, useRef as es, useEffect as bs } from "react";
3
- import { useTranslation as ys } from "react-i18next";
4
- import { c as j } from "./index-D2ZczOXr.js";
5
- import { i as as, E as Es } from "./email-input-C7THAwh2.js";
6
- import { B as ds } from "./button-D-MQxsA_.js";
7
- import { C as h } from "./card-BA4Ig_kn.js";
8
- import { E as Ns } from "./error-summary-mGxIyDAY.js";
9
- import { F as rs } from "./form-field-Ani72sVY.js";
10
- import { P as Is } from "./password-input-BokZ_rnT.js";
11
- import { i as is } from "./safe-href-5dbsfbQn.js";
12
- import { u as Bs } from "./use-state-backed-input-DhRQo6gM.js";
13
- import { u as Rs, a as Ls, A as As, b as Cs, E as Ms, d as Ss, c as ks } from "./auth-form-parts-B40zvD-a.js";
14
- import { u as qs, b as zs, a as js } from "./use-registration-submit-eWAECgUC.js";
15
- import { M as $s } from "./matrix-rain-sDOUUwZp.js";
16
- import { a as Ds } from "./error-page-illustration-BdJLuMdV.js";
17
- const $ = ["email", "password"], Ps = j(
18
- "ds:flex ds:w-full ds:flex-col ds:items-center ds:justify-center ds:gap-[var(--spacing-lg)] ds:text-start ds:text-[var(--foreground)] ds:lg:flex-row ds:lg:items-stretch"
19
- ), os = j("ds:w-full ds:max-w-[400px]"), Ts = (r) => Object.values(r).some(Boolean), Os = (r) => $.some((d) => !!r[d]), ts = (r) => $.find((d) => r[d]) ?? (r.form ? "password" : void 0), Hs = ls(
20
- ({
21
- title: r,
22
- description: d,
23
- headingLevel: w = 1,
24
- showLogo: I = !0,
25
- logoMotion: B = "assemble",
26
- children: x,
27
- initialValues: o,
28
- errors: c,
29
- forgotPasswordHref: m,
30
- submitLabel: t,
31
- submitting: R = !1,
32
- onSubmit: L,
33
- fieldNames: F,
34
- action: ns,
35
- hiddenFields: cs,
36
- devCard: D,
37
- className: ms,
38
- ...us
39
- }, fs) => {
40
- const { t: l } = ys("ui"), P = N(), A = N(), ps = N(), C = (s) => `${ps}-${s}`, u = F !== void 0, [f, M] = n(() => (o == null ? void 0 : o.email) ?? ""), [b, y] = n(""), [gs, T] = n(() => ({ email: !!(o != null && o.email) })), [vs, O] = n(!1), [H, _] = n(
41
- () => c ?? {}
42
- ), G = (s) => T(
43
- (a) => a[s] ? a : { ...a, [s]: !0 }
44
- ), W = (s) => _(
45
- (a) => a[s] ? { ...a, [s]: void 0 } : a
46
- ), S = es(null), k = es(null), J = Bs(f, S), K = () => {
47
- y(""), T((s) => ({ ...s, password: !1 }));
48
- }, Q = () => {
49
- var a, g;
50
- const s = {
51
- email: ((a = S.current) == null ? void 0 : a.value) ?? f,
52
- password: ((g = k.current) == null ? void 0 : g.value) ?? b
53
- };
54
- return s.email !== f && M(s.email), s.password !== b && y(s.password), s;
55
- }, U = {
56
- email: !as(f),
57
- password: b === ""
58
- }, X = (s) => vs || gs[s] === !0, hs = {
59
- email: X("email") && U.email ? l(f === "" ? "loginForm.emailRequired" : "inputs.email.invalid") : void 0,
60
- password: X("password") && U.password ? l("loginForm.passwordRequired") : void 0
61
- }, E = (s) => H[s] ?? hs[s], [Y] = n(
62
- () => Os(c ?? {})
63
- ), i = qs(
64
- $,
65
- E,
66
- Y
67
- ), [q, Z] = n(() => {
68
- const s = Y ? void 0 : ts(c ?? {});
69
- return s ? { target: s } : null;
70
- });
71
- bs(() => {
72
- var s;
73
- q && ((s = (q.target === "email" ? S : k).current) == null || s.focus());
74
- }, [q]);
75
- const V = zs({
76
- errors: c,
77
- submitting: R,
78
- native: u,
79
- captcha: !1,
80
- firstProblem: () => {
81
- const s = Q();
82
- return as(s.email) ? s.password === "" ? "password" : void 0 : "email";
83
- },
84
- onRefused: (s) => {
85
- O(!0), i.open(() => Z({ target: s }));
86
- },
87
- // Only a React host gets here: a native post is the browser's own.
88
- deliver: () => L == null ? void 0 : L(Q()),
89
- onAnswer: (s) => {
90
- const a = s;
91
- _(a), Ts(a) && (K(), O(!1), i.open(() => {
92
- const g = ts(a);
93
- g && Z({ target: g });
94
- }));
95
- },
96
- // The page came back from the browser's cache as it was left: the
97
- // password must not come back with it.
98
- onRestore: K
99
- }), { busy: z } = V, ws = Rs("LoginForm", u, ns), ss = m && is(m) ? m : void 0, xs = Ls(
100
- "LoginForm",
101
- u,
102
- F,
103
- cs
104
- ), p = H.form, Fs = js(
105
- p,
106
- i.listed.length > 0
107
- );
108
- return /* @__PURE__ */ v(
109
- "div",
110
- {
111
- ref: fs,
112
- ...us,
113
- "data-component": "login-form",
114
- className: Ps({ className: ms }),
115
- children: [
116
- /* @__PURE__ */ e("div", { className: os(), children: /* @__PURE__ */ e(h, { variant: "elevated", className: "ds:h-full", children: /* @__PURE__ */ v(h.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
117
- /* @__PURE__ */ e(
118
- As,
119
- {
120
- id: P,
121
- title: r ?? l("loginForm.title"),
122
- description: d,
123
- level: w,
124
- showLogo: I,
125
- logoMotion: B
126
- }
127
- ),
128
- x ? /* @__PURE__ */ e(
129
- "div",
130
- {
131
- "data-slot": "host-content",
132
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
133
- children: x
134
- }
135
- ) : null,
136
- /* @__PURE__ */ v(
137
- "form",
138
- {
139
- noValidate: !0,
140
- method: "post",
141
- action: ws,
142
- "aria-labelledby": P,
143
- "aria-busy": z || void 0,
144
- onSubmit: V.handleSubmit,
145
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
146
- children: [
147
- /* @__PURE__ */ e(
148
- Ns,
149
- {
150
- ref: i.ref,
151
- headingLevel: w + 1,
152
- "aria-describedby": p ? A : void 0,
153
- errors: i.listed.map((s) => ({
154
- field: s,
155
- message: E(s) ?? "",
156
- targetId: C(s)
157
- }))
158
- }
159
- ),
160
- p && /* @__PURE__ */ e(
161
- Cs,
162
- {
163
- id: A,
164
- announce: Fs,
165
- children: p
166
- }
167
- ),
168
- /* @__PURE__ */ e(
169
- rs,
170
- {
171
- id: C("email"),
172
- label: l("loginForm.email"),
173
- required: !0,
174
- error: E("email"),
175
- announceError: !i.lists("email"),
176
- "data-field": "email",
177
- children: /* @__PURE__ */ e(
178
- Es,
179
- {
180
- ref: J.ref,
181
- name: u ? F.email : "email",
182
- autoComplete: "username",
183
- disableBuiltInValidation: !0,
184
- onChange: J.quiet((s) => {
185
- M(s.target.value), W("email");
186
- }),
187
- onBlur: (s) => {
188
- M(s.target.value), s.target.value !== "" && G("email");
189
- }
190
- }
191
- )
192
- }
193
- ),
194
- /* @__PURE__ */ e(
195
- rs,
196
- {
197
- id: C("password"),
198
- label: l("loginForm.password"),
199
- required: !0,
200
- error: E("password"),
201
- announceError: !i.lists("password"),
202
- "data-field": "password",
203
- children: /* @__PURE__ */ e(
204
- Is,
205
- {
206
- ref: k,
207
- name: u ? F.password : "password",
208
- autoComplete: "current-password",
209
- "aria-describedby": p ? A : void 0,
210
- value: b,
211
- onChange: (s) => {
212
- y(s.target.value), W("password");
213
- },
214
- onBlur: (s) => {
215
- y(s.target.value), s.target.value !== "" && G("password");
216
- }
217
- }
218
- )
219
- }
220
- ),
221
- /* @__PURE__ */ e(Ms, { fields: xs }),
222
- /* @__PURE__ */ e(
223
- ds,
224
- {
225
- type: "submit",
226
- intent: "primary",
227
- size: "lg",
228
- loading: z,
229
- className: "ds:w-full",
230
- "data-action": "submit",
231
- children: t ?? l("loginForm.submit")
232
- }
233
- ),
234
- ss && /* @__PURE__ */ e(Ss, { href: ss, action: "forgot-password", children: l("loginForm.forgot") })
235
- ]
236
- }
237
- ),
238
- /* @__PURE__ */ e(ks, { busy: z })
239
- ] }) }) }),
240
- D ? /* @__PURE__ */ e("div", { className: os(), children: D }) : null
241
- ]
242
- }
243
- );
244
- }
245
- );
246
- Hs.displayName = "LoginForm";
247
- const _s = j("ds:h-full ds:w-full"), Gs = ls(
248
- ({ title: r, options: d, headingLevel: w = 2, className: I, ...B }, x) => {
249
- const o = N(), c = `h${w}`, m = d.filter((t) => is(t.href));
250
- return /* @__PURE__ */ e(
251
- "div",
252
- {
253
- ref: x,
254
- ...B,
255
- "data-component": "login-dev-card",
256
- className: _s({ className: I }),
257
- children: /* @__PURE__ */ v(
258
- h,
259
- {
260
- variant: "elevated",
261
- "aria-labelledby": o,
262
- className: "ds:relative ds:isolate ds:flex ds:h-full ds:flex-col ds:overflow-hidden",
263
- children: [
264
- /* @__PURE__ */ e("div", { className: "ds:absolute ds:inset-0 ds:z-0 ds:[display:var(--accessible-off,block)]", children: /* @__PURE__ */ e(
265
- $s,
266
- {
267
- glyphs: "hex",
268
- decay: "fast",
269
- mask: "center",
270
- maskRadius: "xl",
271
- className: "ds:size-full"
272
- }
273
- ) }),
274
- /* @__PURE__ */ e(h.Header, { className: "ds:relative ds:z-[1]", children: /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)] ds:text-center", children: [
275
- /* @__PURE__ */ e("div", { className: "ds:[&>div]:w-24", children: /* @__PURE__ */ e(Ds, { mood: "melt" }) }),
276
- /* @__PURE__ */ e(
277
- c,
278
- {
279
- id: o,
280
- className: "type-title-card ds:text-[var(--foreground)]",
281
- children: r
282
- }
283
- )
284
- ] }) }),
285
- /* @__PURE__ */ e(h.Body, { className: "ds:relative ds:z-[1] ds:flex ds:flex-1 ds:flex-col ds:justify-center", children: /* @__PURE__ */ e("div", { className: "ds:mt-[var(--spacing-md)] ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: m.map((t, R) => /* @__PURE__ */ e(
286
- ds,
287
- {
288
- asChild: !0,
289
- intent: "primary",
290
- startIcon: t.icon,
291
- className: "ds:min-h-[var(--min-target-size)] ds:w-full",
292
- children: /* @__PURE__ */ e("a", { href: t.href, "data-action": "dev-login", children: t.label })
293
- },
294
- `${R}:${t.href}`
295
- )) }) })
296
- ]
297
- }
298
- )
299
- }
300
- );
301
- }
302
- );
303
- Gs.displayName = "LoginDevCard";
304
- export {
305
- $ as L,
306
- Gs as a,
307
- Hs as b
308
- };
309
- //# sourceMappingURL=login-dev-card-vEL-o5wq.js.map