@alfadocs/ui-kit 1.69.0 → 1.71.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.
Files changed (72) 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/login-dev-card-CWpoTuVY.js +332 -0
  4. package/dist/_chunks/workflow-webhook-action-D6K7Jgc2.js +832 -0
  5. package/dist/agent-catalog.json +20 -2
  6. package/dist/agent-i18n/en.json +3 -1
  7. package/dist/i18n/locales/ar.d.ts +13 -1
  8. package/dist/i18n/locales/ar.js +13 -1
  9. package/dist/i18n/locales/de.d.ts +13 -1
  10. package/dist/i18n/locales/de.js +13 -1
  11. package/dist/i18n/locales/el.d.ts +13 -1
  12. package/dist/i18n/locales/el.js +13 -1
  13. package/dist/i18n/locales/en.d.ts +13 -1
  14. package/dist/i18n/locales/en.js +13 -1
  15. package/dist/i18n/locales/es.d.ts +13 -1
  16. package/dist/i18n/locales/es.js +13 -1
  17. package/dist/i18n/locales/fr.d.ts +13 -1
  18. package/dist/i18n/locales/fr.js +13 -1
  19. package/dist/i18n/locales/hi.d.ts +13 -1
  20. package/dist/i18n/locales/hi.js +13 -1
  21. package/dist/i18n/locales/it.d.ts +13 -1
  22. package/dist/i18n/locales/it.js +13 -1
  23. package/dist/i18n/locales/ja.d.ts +13 -1
  24. package/dist/i18n/locales/ja.js +13 -1
  25. package/dist/i18n/locales/nl.d.ts +13 -1
  26. package/dist/i18n/locales/nl.js +13 -1
  27. package/dist/i18n/locales/pl.d.ts +13 -1
  28. package/dist/i18n/locales/pl.js +13 -1
  29. package/dist/i18n/locales/pt.d.ts +13 -1
  30. package/dist/i18n/locales/pt.js +13 -1
  31. package/dist/i18n/locales/ro.d.ts +13 -1
  32. package/dist/i18n/locales/ro.js +13 -1
  33. package/dist/i18n/locales/ru.d.ts +13 -1
  34. package/dist/i18n/locales/ru.js +13 -1
  35. package/dist/i18n/locales/sq.d.ts +13 -1
  36. package/dist/i18n/locales/sq.js +13 -1
  37. package/dist/i18n/locales/sv.d.ts +13 -1
  38. package/dist/i18n/locales/sv.js +13 -1
  39. package/dist/i18n/locales/tr.d.ts +13 -1
  40. package/dist/i18n/locales/tr.js +13 -1
  41. package/dist/i18n/locales/zh.d.ts +13 -1
  42. package/dist/i18n/locales/zh.js +13 -1
  43. package/dist/index.js +3 -3
  44. package/dist/locales/ar.json +13 -1
  45. package/dist/locales/de.json +13 -1
  46. package/dist/locales/el.json +13 -1
  47. package/dist/locales/en.json +13 -1
  48. package/dist/locales/es.json +13 -1
  49. package/dist/locales/fr.json +13 -1
  50. package/dist/locales/hi.json +13 -1
  51. package/dist/locales/it.json +13 -1
  52. package/dist/locales/ja.json +13 -1
  53. package/dist/locales/nl.json +13 -1
  54. package/dist/locales/pl.json +13 -1
  55. package/dist/locales/pt.json +13 -1
  56. package/dist/locales/ro.json +13 -1
  57. package/dist/locales/ru.json +13 -1
  58. package/dist/locales/sq.json +13 -1
  59. package/dist/locales/sv.json +13 -1
  60. package/dist/locales/tr.json +13 -1
  61. package/dist/locales/zh.json +13 -1
  62. package/dist/patterns/_shared/auth-form-parts.d.ts +4 -3
  63. package/dist/patterns/forgot-password-form/index.js +1 -1
  64. package/dist/patterns/login-form/index.js +1 -1
  65. package/dist/patterns/login-form/login-form.d.ts +6 -2
  66. package/dist/patterns/workflow-webhook-action/index.d.ts +1 -1
  67. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  68. package/dist/patterns/workflow-webhook-action/workflow-webhook-action.d.ts +29 -3
  69. package/package.json +1 -1
  70. package/dist/_chunks/auth-form-parts-B40zvD-a.js +0 -86
  71. package/dist/_chunks/login-dev-card-vEL-o5wq.js +0 -309
  72. package/dist/_chunks/workflow-webhook-action-Ct8tFYi7.js +0 -691
@@ -5627,6 +5627,13 @@
5627
5627
  "secretSavedDescription": "已保存密钥。留空即可保留现有密钥。",
5628
5628
  "secretRequired": "请输入或生成签名密钥。",
5629
5629
  "generate": "生成密钥",
5630
+ "testDescription": "发送测试,检查地址和密钥。测试使用虚构的 ID,不含任何患者数据。",
5631
+ "sendTest": "发送测试",
5632
+ "testSent": "测试已发送。应用返回了 {{status}}。",
5633
+ "testCheckSecret": "应用返回了 {{status}}。请检查密钥是否与应用中的一致。",
5634
+ "testRejected": "应用返回了 {{status}}。请检查地址和应用的设置。",
5635
+ "testUnreachable": "无法访问该地址。请检查地址是否正确且可公开访问。",
5636
+ "testFailed": "无法发送测试。请重试。",
5630
5637
  "generatedNotice": "请立即将此密钥复制到应用中。保存后,Alfadocs 将不再显示它。",
5631
5638
  "secretGenerated": "已生成新密钥。请将其复制到应用中。",
5632
5639
  "legalBasis": "我确认诊所具有向此地址共享患者数据的合法依据。",
@@ -5641,10 +5648,15 @@
5641
5648
  "parameterValueOf": "参数 {{number}} 的值",
5642
5649
  "addParameter": "添加参数",
5643
5650
  "removeParameter": "删除参数 {{number}}",
5644
- "insertDetail": "插入患者信息",
5651
+ "insertDetail": "插入变量",
5645
5652
  "placeholderInserted": "已插入:{{detail}}",
5646
5653
  "parameterNameRequired": "请为此值输入名称。",
5647
5654
  "parameterNameDuplicate": "此名称已被使用。每个名称只能使用一次。",
5655
+ "variablesHeading": "可在值中使用的变量",
5656
+ "variablesDescription": "发送时,Alfadocs 会将每个变量替换为患者的信息。",
5657
+ "variableSalutation": "称呼",
5658
+ "variableFirstName": "名字",
5659
+ "variableLastName": "姓氏",
5648
5660
  "sentHeading": "Alfadocs 发送的内容",
5649
5661
  "sentDescription": "每条消息都包含这些字段。示例中也包含您的额外参数。",
5650
5662
  "sent": {
@@ -5,11 +5,12 @@ export interface AuthTextLinkProps {
5
5
  href: string;
6
6
  /** Emitted as `data-action`. */
7
7
  action: string;
8
+ /** Default `center`. */
9
+ align?: 'center' | 'end';
8
10
  children: ReactNode;
9
11
  }
10
- /** The quiet link under the card's button: "Forgot password?", "Back to
11
- * sign in". */
12
- export declare function AuthTextLink({ href, action, children }: AuthTextLinkProps): import("react/jsx-runtime").JSX.Element;
12
+ /** A quiet link in the card: "Forgot password?", "Back to sign in". */
13
+ export declare function AuthTextLink({ href, action, align, children, }: AuthTextLinkProps): import("react/jsx-runtime").JSX.Element;
13
14
  export interface AuthCardHeadingProps {
14
15
  /** The id the form is labelled by. */
15
16
  id: string;
@@ -1,4 +1,4 @@
1
- import { F as r, a } from "../../_chunks/forgot-password-form-Dqi7R-NL.js";
1
+ import { F as r, a } from "../../_chunks/forgot-password-form-BGPc8TGr.js";
2
2
  export {
3
3
  r as FORGOT_PASSWORD_FORM_FIELDS,
4
4
  a as ForgotPasswordForm
@@ -1,4 +1,4 @@
1
- import { L, a as r, b as s } from "../../_chunks/login-dev-card-vEL-o5wq.js";
1
+ import { L, a as r, b as s } from "../../_chunks/login-dev-card-CWpoTuVY.js";
2
2
  export {
3
3
  L as LOGIN_FORM_FIELDS,
4
4
  r as LoginDevCard,
@@ -68,11 +68,15 @@ export interface LoginFormProps extends Omit<HTMLAttributes<HTMLDivElement>, 'ti
68
68
  */
69
69
  errors?: LoginFormErrors;
70
70
  /**
71
- * Adds "Forgot password?" under the button. A path on the same site,
71
+ * Adds "Forgot password?" under the password. A path on the same site,
72
72
  * or an address written in full (`https://…`). Anything else shows no
73
- * link.
73
+ * link. The same rule holds for the two addresses below.
74
74
  */
75
75
  forgotPasswordHref?: string;
76
+ /** Adds "Register as a doctor" under the button. */
77
+ registerDoctorHref?: string;
78
+ /** Adds "Register as a patient" under the button. */
79
+ registerPatientHref?: string;
76
80
  /** Replaces the button's "Sign in". Pass it translated. */
77
81
  submitLabel?: string;
78
82
  /**
@@ -1,3 +1,3 @@
1
1
  export { WorkflowWebhookAction, WORKFLOW_WEBHOOK_ACTION_FIELDS, } from './workflow-webhook-action';
2
- export type { WorkflowWebhookActionProps, WorkflowWebhookActionField, WorkflowWebhookActionFieldNames, WorkflowWebhookActionValues, WorkflowWebhookActionInitialValues, WorkflowWebhookActionErrors, WorkflowWebhookActionPlaceholder, WorkflowWebhookParameterValue, } from './workflow-webhook-action';
2
+ export type { WorkflowWebhookActionProps, WorkflowWebhookActionField, WorkflowWebhookActionFieldNames, WorkflowWebhookActionValues, WorkflowWebhookActionInitialValues, WorkflowWebhookActionErrors, WorkflowWebhookActionPlaceholder, WorkflowWebhookParameterValue, WorkflowWebhookTestResult, } from './workflow-webhook-action';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { W as O, a } from "../../_chunks/workflow-webhook-action-Ct8tFYi7.js";
1
+ import { W as O, a } from "../../_chunks/workflow-webhook-action-D6K7Jgc2.js";
2
2
  export {
3
3
  O as WORKFLOW_WEBHOOK_ACTION_FIELDS,
4
4
  a as WorkflowWebhookAction
@@ -27,13 +27,28 @@ export type WorkflowWebhookActionInitialValues = Partial<Omit<WorkflowWebhookAct
27
27
  export type WorkflowWebhookActionErrors = Partial<Record<WorkflowWebhookActionField, string>>;
28
28
  /** The host's own form field names, for a native form post. */
29
29
  export type WorkflowWebhookActionFieldNames = Record<WorkflowWebhookActionField, string>;
30
- /** A patient detail the user can insert into a parameter value. */
30
+ /** A variable the user can insert into a parameter value. */
31
31
  export interface WorkflowWebhookActionPlaceholder {
32
32
  /** The code the server replaces, such as `[[NOME]]`. */
33
33
  value: string;
34
34
  /** What the user reads, translated, such as "First name". */
35
35
  label: string;
36
36
  }
37
+ /**
38
+ * What a test message got back, as the host's server saw it.
39
+ * `answered`: the app replied with this HTTP status. `unreachable`: no
40
+ * reply at all (the address does not resolve, refuses, times out or has
41
+ * no valid certificate). `message` replaces the fields' own words, already
42
+ * translated, when the server knows better.
43
+ */
44
+ export type WorkflowWebhookTestResult = {
45
+ outcome: 'answered';
46
+ status: number;
47
+ message?: string;
48
+ } | {
49
+ outcome: 'unreachable';
50
+ message?: string;
51
+ };
37
52
  export interface WorkflowWebhookActionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onChange'> {
38
53
  /**
39
54
  * Host content above the fields, such as the plan notice ("Included in
@@ -70,10 +85,21 @@ export interface WorkflowWebhookActionProps extends Omit<HTMLAttributes<HTMLDivE
70
85
  */
71
86
  fieldNames?: WorkflowWebhookActionFieldNames;
72
87
  /**
73
- * Patient details the user can insert into a parameter value. Without
74
- * them, no insert menu shows.
88
+ * The variables the user can insert into a parameter value, listed in
89
+ * Advanced with a copy button each. Default: the three the platform
90
+ * replaces in a webhook step (salutation, first name, last name), with
91
+ * the kit's own labels. An empty list hides the menu and the list.
75
92
  */
76
93
  placeholders?: ReadonlyArray<WorkflowWebhookActionPlaceholder>;
94
+ /**
95
+ * Shows "Send test". Called with the values when the user asks for a
96
+ * test, once the address and the secret pass their checks; the host's
97
+ * server sends a sample message (invented IDs, no patient data, marked
98
+ * as a test) signed with that secret, or with the saved one when
99
+ * `secret` is empty, and resolves with what came back. A rejected
100
+ * promise reads as "the test could not be sent". Without it, no button.
101
+ */
102
+ onSendTest?: (values: WorkflowWebhookActionValues) => Promise<WorkflowWebhookTestResult>;
77
103
  /** For React hosts: called with the values after each change. */
78
104
  onValueChange?: (values: WorkflowWebhookActionValues) => void;
79
105
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfadocs/ui-kit",
3
- "version": "1.69.0",
3
+ "version": "1.71.0",
4
4
  "type": "module",
5
5
  "description": "AlfaDocs shared design system — tokens, components, patterns, and translations for platform, booking, and alfascribe.",
6
6
  "license": "BUSL-1.1",
@@ -1,86 +0,0 @@
1
- import { jsxs as m, jsx as r, Fragment as v } from "react/jsx-runtime";
2
- import { useEffect as f, forwardRef as h } from "react";
3
- import { c as l } from "./index-D2ZczOXr.js";
4
- import { useTranslation as g } from "react-i18next";
5
- import { A as c } from "./alert-9kEwDza3.js";
6
- import { i as u } from "./is-development-CLUAnsU7.js";
7
- import { a as p } from "./safe-href-5dbsfbQn.js";
8
- import { B as b } from "./use-registration-submit-eWAECgUC.js";
9
- const x = "Alfadocs", w = l(
10
- "ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-xs)]",
11
- {
12
- variants: {
13
- centred: { true: "ds:items-center ds:text-center", false: "" }
14
- },
15
- defaultVariants: { centred: !0 }
16
- }
17
- ), A = l(
18
- "ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]"
19
- ), N = l(
20
- 'type-body-sm ds:relative ds:self-center ds:rounded-[var(--radius-sm)] ds:underline ds:underline-offset-4 ds:text-[var(--foreground)] ds:before:absolute ds:before:inset-x-0 ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[""] ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]'
21
- );
22
- function S({ href: s, action: e, children: t }) {
23
- return /* @__PURE__ */ r("a", { href: s, "data-action": e, className: N(), children: t });
24
- }
25
- function V({
26
- id: s,
27
- title: e,
28
- description: t,
29
- level: a,
30
- showLogo: o,
31
- logoMotion: d
32
- }) {
33
- const i = `h${a}`;
34
- return /* @__PURE__ */ m("div", { className: w({ centred: o }), children: [
35
- o && /* @__PURE__ */ r(b, { motion: d, label: x }),
36
- /* @__PURE__ */ r(i, { id: s, className: "type-title-card", children: e }),
37
- t && /* @__PURE__ */ r("p", { className: "type-body-sm ds:text-[var(--muted-foreground)]", children: t })
38
- ] });
39
- }
40
- const y = h(
41
- ({ id: s, announce: e, children: t }, a) => /* @__PURE__ */ r(
42
- c,
43
- {
44
- ref: a,
45
- id: s,
46
- variant: "error",
47
- announce: e,
48
- tabIndex: -1,
49
- "data-field": "form",
50
- className: A(),
51
- children: /* @__PURE__ */ r(c.Description, { children: t })
52
- }
53
- )
54
- );
55
- y.displayName = "AuthFormMessage";
56
- function C(s, e, t, a) {
57
- const o = new Set(Object.values(t ?? {})), d = e ? Object.entries(a ?? {}) : [], i = d.filter(([n]) => o.has(n)).map(([n]) => n).join(", ");
58
- return f(() => {
59
- i && u() && console.warn(
60
- `${s}: hiddenFields "${i}" is also named in fieldNames and was left out. The form's own field wins.`
61
- );
62
- }, [i, s]), d.filter(([n]) => !o.has(n));
63
- }
64
- function D(s, e, t) {
65
- const a = e && t && p(t) ? t : void 0, o = t ? e ? a ? void 0 : "`action` is not a path or an address on this origin and was left out. The form posts to the current address." : "`action` does nothing without `fieldNames`: only a native form post has an address." : void 0;
66
- return f(() => {
67
- o && u() && console.warn(`${s}: ${o}`);
68
- }, [s, o]), a;
69
- }
70
- function H({ fields: s }) {
71
- return /* @__PURE__ */ r(v, { children: s.map(([e, t]) => /* @__PURE__ */ r("input", { type: "hidden", name: e, value: t }, e)) });
72
- }
73
- function O({ busy: s }) {
74
- const { t: e } = g("ui");
75
- return /* @__PURE__ */ r("p", { role: "status", className: "ds:sr-only", children: s ? e("chat.message.status.sending") : "" });
76
- }
77
- export {
78
- V as A,
79
- H as E,
80
- C as a,
81
- y as b,
82
- O as c,
83
- S as d,
84
- D as u
85
- };
86
- //# sourceMappingURL=auth-form-parts-B40zvD-a.js.map
@@ -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