@conferencesuite/ui 0.0.0-stage → 0.0.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/LICENSE +202 -0
- package/NOTICE +9 -0
- package/README.md +11 -2
- package/dist/AuthButton.d.ts +8 -0
- package/dist/AuthButton.js +73 -0
- package/dist/AuthButton.js.map +1 -0
- package/dist/AuthDialog.d.ts +2 -0
- package/dist/AuthDialog.js +295 -0
- package/dist/AuthDialog.js.map +1 -0
- package/dist/AuthNotice.d.ts +2 -0
- package/dist/AuthNotice.js +32 -0
- package/dist/AuthNotice.js.map +1 -0
- package/dist/CatalogPicker.d.ts +13 -0
- package/dist/CatalogPicker.js +272 -0
- package/dist/CatalogPicker.js.map +1 -0
- package/dist/CheckoutMount.d.ts +10 -0
- package/dist/CheckoutMount.js +51 -0
- package/dist/CheckoutMount.js.map +1 -0
- package/dist/PaymentStatus.d.ts +16 -0
- package/dist/PaymentStatus.js +173 -0
- package/dist/PaymentStatus.js.map +1 -0
- package/dist/ProposalForm.d.ts +12 -0
- package/dist/ProposalForm.js +345 -0
- package/dist/ProposalForm.js.map +1 -0
- package/dist/RegistrationCta.d.ts +17 -0
- package/dist/RegistrationCta.js +39 -0
- package/dist/RegistrationCta.js.map +1 -0
- package/dist/RegistrationForm.d.ts +13 -0
- package/dist/RegistrationForm.js +523 -0
- package/dist/RegistrationForm.js.map +1 -0
- package/dist/ScheduleBadge.d.ts +5 -0
- package/dist/ScheduleBadge.js +22 -0
- package/dist/ScheduleBadge.js.map +1 -0
- package/dist/SchedulePage.d.ts +10 -0
- package/dist/SchedulePage.js +435 -0
- package/dist/SchedulePage.js.map +1 -0
- package/dist/ScheduleViews.d.ts +32 -0
- package/dist/ScheduleViews.js +294 -0
- package/dist/ScheduleViews.js.map +1 -0
- package/dist/SessionDialog.d.ts +16 -0
- package/dist/SessionDialog.js +144 -0
- package/dist/SessionDialog.js.map +1 -0
- package/dist/SuiteAuth.d.ts +6 -0
- package/dist/SuiteAuth.js +20 -0
- package/dist/SuiteAuth.js.map +1 -0
- package/dist/classes.d.ts +36 -0
- package/dist/classes.js +40 -0
- package/dist/classes.js.map +1 -0
- package/dist/fields.d.ts +10 -0
- package/dist/fields.js +250 -0
- package/dist/fields.js.map +1 -0
- package/dist/scheduleClasses.d.ts +16 -0
- package/dist/scheduleClasses.js +20 -0
- package/dist/scheduleClasses.js.map +1 -0
- package/package.json +43 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|
package/NOTICE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Conference Suite SDK
|
|
2
|
+
Copyright 2026 Tunji Productions LLC
|
|
3
|
+
|
|
4
|
+
This product includes software developed by Tunji Productions LLC
|
|
5
|
+
(https://github.com/conferencesuite).
|
|
6
|
+
|
|
7
|
+
"Conference Suite" and the Conference Suite logo are trademarks of
|
|
8
|
+
Tunji Productions LLC and are not licensed under the Apache License; see
|
|
9
|
+
TRADEMARKS.md.
|
package/README.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @conferencesuite/ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Accessible Conference Suite components (Tailwind + Ark UI), themed with `--cs-*` CSS variables.
|
|
4
|
+
|
|
5
|
+
> Pre-release (`0.x`): minor versions may contain breaking changes. See the
|
|
6
|
+
> [support policy](https://github.com/conferencesuite/sdk/blob/main/docs/support-policy.md).
|
|
7
|
+
|
|
8
|
+
Part of the [Conference Suite SDK](https://github.com/conferencesuite/sdk). Licensed under Apache-2.0.
|
|
9
|
+
Every rule (limits, pricing, paid state) lives in the Conference Suite's database; this package calls the API
|
|
10
|
+
and renders the answer.
|
|
11
|
+
|
|
12
|
+
Deep imports are supported: `import { ... } from "@conferencesuite/ui/<path>"`.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type AccountLink = {
|
|
2
|
+
label: string;
|
|
3
|
+
href: string;
|
|
4
|
+
};
|
|
5
|
+
/** "Sign in" for visitors; an account menu (links + sign out) for members. */
|
|
6
|
+
export declare function AuthButton({ accountLinks }: {
|
|
7
|
+
accountLinks?: AccountLink[];
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Menu } from "@ark-ui/react/menu";
|
|
3
|
+
import { Portal } from "@ark-ui/react/portal";
|
|
4
|
+
import { ChevronDown, CircleUser } from "lucide-react";
|
|
5
|
+
import { useAuth } from "@conferencesuite/react/AuthProvider";
|
|
6
|
+
import { ui } from "./classes.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
// src/AuthButton.tsx
|
|
9
|
+
/** "Sign in" for visitors; an account menu (links + sign out) for members. */
|
|
10
|
+
function AuthButton({ accountLinks = [] }) {
|
|
11
|
+
const auth = useAuth();
|
|
12
|
+
if (!auth.ready) return /* @__PURE__ */ jsx("span", {
|
|
13
|
+
className: "btn btn-ghost invisible",
|
|
14
|
+
"aria-hidden": true,
|
|
15
|
+
children: "Sign in"
|
|
16
|
+
});
|
|
17
|
+
if (!auth.user) return /* @__PURE__ */ jsx("button", {
|
|
18
|
+
type: "button",
|
|
19
|
+
className: "btn btn-ghost",
|
|
20
|
+
onClick: () => auth.open("signin"),
|
|
21
|
+
children: "Sign in"
|
|
22
|
+
});
|
|
23
|
+
const email = auth.user.email ?? "your account";
|
|
24
|
+
return /* @__PURE__ */ jsxs(Menu.Root, {
|
|
25
|
+
onSelect: (d) => d.value === "signout" && void auth.signOut(),
|
|
26
|
+
positioning: { placement: "bottom-end" },
|
|
27
|
+
children: [/* @__PURE__ */ jsxs(Menu.Trigger, {
|
|
28
|
+
className: "btn btn-ghost gap-1",
|
|
29
|
+
"aria-label": `Account menu for ${email}`,
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsx(CircleUser, {
|
|
32
|
+
className: "size-5",
|
|
33
|
+
"aria-hidden": true
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ jsx("span", {
|
|
36
|
+
className: "hidden max-w-32 truncate sm:inline",
|
|
37
|
+
children: email
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsx(ChevronDown, {
|
|
40
|
+
className: "size-4",
|
|
41
|
+
"aria-hidden": true
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
}), /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, { children: /* @__PURE__ */ jsxs(Menu.Content, {
|
|
45
|
+
className: ui.menuContent,
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsxs("p", {
|
|
48
|
+
className: "px-3 py-2 text-xs text-base-content/70",
|
|
49
|
+
children: ["Signed in as ", email]
|
|
50
|
+
}),
|
|
51
|
+
accountLinks.map((l) => /* @__PURE__ */ jsx(Menu.Item, {
|
|
52
|
+
value: l.href,
|
|
53
|
+
asChild: true,
|
|
54
|
+
className: ui.menuItem,
|
|
55
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
56
|
+
href: l.href,
|
|
57
|
+
target: "_blank",
|
|
58
|
+
rel: "noopener noreferrer",
|
|
59
|
+
children: l.label
|
|
60
|
+
})
|
|
61
|
+
}, l.href)),
|
|
62
|
+
/* @__PURE__ */ jsx(Menu.Item, {
|
|
63
|
+
value: "signout",
|
|
64
|
+
className: ui.menuItem,
|
|
65
|
+
children: "Sign out"
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
}) }) })]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
export { AuthButton };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=AuthButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthButton.js","names":[],"sources":["../src/AuthButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { Menu } from \"@ark-ui/react/menu\";\nimport { Portal } from \"@ark-ui/react/portal\";\nimport { ChevronDown, CircleUser } from \"lucide-react\";\nimport { useAuth } from \"@conferencesuite/react/AuthProvider\";\nimport { ui } from \"./classes\";\n\nexport type AccountLink = { label: string; href: string };\n\n/** \"Sign in\" for visitors; an account menu (links + sign out) for members. */\nexport function AuthButton({ accountLinks = [] }: { accountLinks?: AccountLink[] }) {\n const auth = useAuth();\n\n // Reserve the space until the session is read, so the navbar doesn't jump\n if (!auth.ready) {\n return (\n <span className=\"btn btn-ghost invisible\" aria-hidden>\n Sign in\n </span>\n );\n }\n\n if (!auth.user) {\n return (\n <button type=\"button\" className=\"btn btn-ghost\" onClick={() => auth.open(\"signin\")}>\n Sign in\n </button>\n );\n }\n\n const email = auth.user.email ?? \"your account\";\n return (\n <Menu.Root onSelect={(d) => d.value === \"signout\" && void auth.signOut()} positioning={{ placement: \"bottom-end\" }}>\n <Menu.Trigger className=\"btn btn-ghost gap-1\" aria-label={`Account menu for ${email}`}>\n <CircleUser className=\"size-5\" aria-hidden />\n <span className=\"hidden max-w-32 truncate sm:inline\">{email}</span>\n <ChevronDown className=\"size-4\" aria-hidden />\n </Menu.Trigger>\n <Portal>\n <Menu.Positioner>\n <Menu.Content className={ui.menuContent}>\n <p className=\"px-3 py-2 text-xs text-base-content/70\">Signed in as {email}</p>\n {accountLinks.map((l) => (\n <Menu.Item key={l.href} value={l.href} asChild className={ui.menuItem}>\n <a href={l.href} target=\"_blank\" rel=\"noopener noreferrer\">\n {l.label}\n </a>\n </Menu.Item>\n ))}\n <Menu.Item value=\"signout\" className={ui.menuItem}>\n Sign out\n </Menu.Item>\n </Men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W,GAAG;KAAU,UAAA;IAExC,CAAA;GACC;EACC,CAAA,EAAA,CAAA,EACX,CAAA,CACC;;AAEf"}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Dialog } from "@ark-ui/react/dialog";
|
|
3
|
+
import { Portal } from "@ark-ui/react/portal";
|
|
4
|
+
import { Eye, EyeOff, X } from "lucide-react";
|
|
5
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
6
|
+
import { fieldErrors, linkProfileSchema, resetSchema, signInSchema, signUpSchema } from "@conferencesuite/core/auth/schemas";
|
|
7
|
+
import { useAuth } from "@conferencesuite/react/AuthProvider";
|
|
8
|
+
import { ui } from "./classes.js";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
// src/AuthDialog.tsx
|
|
11
|
+
const TITLES = {
|
|
12
|
+
signin: "Sign in",
|
|
13
|
+
signup: "Create your account",
|
|
14
|
+
reset: "Reset your password"
|
|
15
|
+
};
|
|
16
|
+
function Field({ id, label, error, children }) {
|
|
17
|
+
const errId = `${id}-error`;
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
19
|
+
className: ui.field,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ jsx("label", {
|
|
22
|
+
htmlFor: id,
|
|
23
|
+
className: ui.label,
|
|
24
|
+
children: label
|
|
25
|
+
}),
|
|
26
|
+
children({
|
|
27
|
+
id,
|
|
28
|
+
"aria-invalid": !!error,
|
|
29
|
+
"aria-describedby": error ? errId : void 0,
|
|
30
|
+
className: `${ui.input} ${error ? ui.inputInvalid : ""}`
|
|
31
|
+
}),
|
|
32
|
+
error && /* @__PURE__ */ jsx("p", {
|
|
33
|
+
id: errId,
|
|
34
|
+
className: ui.fieldError,
|
|
35
|
+
children: error
|
|
36
|
+
})
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function PasswordField({ id, label, error, value, onChange, autoComplete }) {
|
|
41
|
+
const [shown, setShown] = useState(false);
|
|
42
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
43
|
+
id,
|
|
44
|
+
label,
|
|
45
|
+
error,
|
|
46
|
+
children: (p) => /* @__PURE__ */ jsxs("div", {
|
|
47
|
+
className: "relative",
|
|
48
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
49
|
+
...p,
|
|
50
|
+
className: `${p.className} pr-12`,
|
|
51
|
+
type: shown ? "text" : "password",
|
|
52
|
+
autoComplete,
|
|
53
|
+
value,
|
|
54
|
+
onChange: (e) => onChange(e.target.value)
|
|
55
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
56
|
+
type: "button",
|
|
57
|
+
className: "btn btn-ghost btn-sm btn-circle absolute right-1.5 top-1/2 -translate-y-1/2",
|
|
58
|
+
"aria-label": shown ? "Hide password" : "Show password",
|
|
59
|
+
"aria-pressed": shown,
|
|
60
|
+
onClick: () => setShown((s) => !s),
|
|
61
|
+
children: shown ? /* @__PURE__ */ jsx(EyeOff, {
|
|
62
|
+
className: "size-4",
|
|
63
|
+
"aria-hidden": true
|
|
64
|
+
}) : /* @__PURE__ */ jsx(Eye, {
|
|
65
|
+
className: "size-4",
|
|
66
|
+
"aria-hidden": true
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/** The form body. Mounted fresh each time the dialog opens, so it never shows the last person's details. */
|
|
73
|
+
function AuthForm() {
|
|
74
|
+
const auth = useAuth();
|
|
75
|
+
const { state } = auth;
|
|
76
|
+
const base = useId();
|
|
77
|
+
const [email, setEmail] = useState(state.email);
|
|
78
|
+
const [password, setPassword] = useState("");
|
|
79
|
+
const [fname, setFname] = useState("");
|
|
80
|
+
const [lname, setLname] = useState("");
|
|
81
|
+
const [institution, setInstitution] = useState("");
|
|
82
|
+
const [errors, setErrors] = useState({});
|
|
83
|
+
const panelRef = useRef(null);
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (!state.open) return;
|
|
86
|
+
(panelRef.current?.querySelector("input"))?.focus();
|
|
87
|
+
}, [
|
|
88
|
+
state.open,
|
|
89
|
+
state.mode,
|
|
90
|
+
state.step
|
|
91
|
+
]);
|
|
92
|
+
const busy = state.status.kind === "busy";
|
|
93
|
+
const id = (n) => `${base}-${n}`;
|
|
94
|
+
const needsProfile = state.step === 1 && state.needsProfile;
|
|
95
|
+
const status = state.status;
|
|
96
|
+
async function submit(e) {
|
|
97
|
+
e.preventDefault();
|
|
98
|
+
if (busy) return;
|
|
99
|
+
if (state.mode === "reset") {
|
|
100
|
+
const errs = fieldErrors(resetSchema, { email });
|
|
101
|
+
setErrors(errs ?? {});
|
|
102
|
+
if (!errs) await auth.reset(email.trim());
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (state.step === 0) {
|
|
106
|
+
const errs = fieldErrors(signInSchema.pick({ email: true }), { email });
|
|
107
|
+
setErrors(errs ?? {});
|
|
108
|
+
if (!errs) await auth.checkEmail(email.trim());
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (state.mode === "signin") {
|
|
112
|
+
const errs = fieldErrors(signInSchema, {
|
|
113
|
+
email,
|
|
114
|
+
password
|
|
115
|
+
});
|
|
116
|
+
setErrors(errs ?? {});
|
|
117
|
+
if (!errs) await auth.signIn({
|
|
118
|
+
email: email.trim(),
|
|
119
|
+
password
|
|
120
|
+
});
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const schema = state.linking ? signInSchema.extend(linkProfileSchema.shape) : signUpSchema;
|
|
124
|
+
const values = {
|
|
125
|
+
email,
|
|
126
|
+
password,
|
|
127
|
+
fname,
|
|
128
|
+
lname,
|
|
129
|
+
institution
|
|
130
|
+
};
|
|
131
|
+
const errs = fieldErrors(schema, values);
|
|
132
|
+
setErrors(errs ?? {});
|
|
133
|
+
if (!errs) await auth.signUp({
|
|
134
|
+
...values,
|
|
135
|
+
email: email.trim()
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
const submitLabel = state.mode === "reset" ? "Send reset link" : state.step === 0 ? "Continue" : state.mode === "signin" ? "Sign in" : state.linking ? "Link my account" : "Create account";
|
|
139
|
+
return /* @__PURE__ */ jsxs("form", {
|
|
140
|
+
ref: panelRef,
|
|
141
|
+
onSubmit: submit,
|
|
142
|
+
noValidate: true,
|
|
143
|
+
className: "mt-5 flex flex-col gap-4",
|
|
144
|
+
children: [
|
|
145
|
+
(state.mode === "reset" || state.step === 0) && /* @__PURE__ */ jsx(Field, {
|
|
146
|
+
id: id("email"),
|
|
147
|
+
label: "Email",
|
|
148
|
+
error: errors.email,
|
|
149
|
+
children: (p) => /* @__PURE__ */ jsx("input", {
|
|
150
|
+
...p,
|
|
151
|
+
type: "email",
|
|
152
|
+
inputMode: "email",
|
|
153
|
+
autoComplete: "email",
|
|
154
|
+
value: email,
|
|
155
|
+
onChange: (e) => setEmail(e.target.value)
|
|
156
|
+
})
|
|
157
|
+
}),
|
|
158
|
+
needsProfile && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
159
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
160
|
+
children: [/* @__PURE__ */ jsx(Field, {
|
|
161
|
+
id: id("fname"),
|
|
162
|
+
label: "Given name",
|
|
163
|
+
error: errors.fname,
|
|
164
|
+
children: (p) => /* @__PURE__ */ jsx("input", {
|
|
165
|
+
...p,
|
|
166
|
+
autoComplete: "given-name",
|
|
167
|
+
value: fname,
|
|
168
|
+
onChange: (e) => setFname(e.target.value)
|
|
169
|
+
})
|
|
170
|
+
}), /* @__PURE__ */ jsx(Field, {
|
|
171
|
+
id: id("lname"),
|
|
172
|
+
label: "Family name",
|
|
173
|
+
error: errors.lname,
|
|
174
|
+
children: (p) => /* @__PURE__ */ jsx("input", {
|
|
175
|
+
...p,
|
|
176
|
+
autoComplete: "family-name",
|
|
177
|
+
value: lname,
|
|
178
|
+
onChange: (e) => setLname(e.target.value)
|
|
179
|
+
})
|
|
180
|
+
})]
|
|
181
|
+
}), /* @__PURE__ */ jsx(Field, {
|
|
182
|
+
id: id("institution"),
|
|
183
|
+
label: "Institution",
|
|
184
|
+
error: errors.institution,
|
|
185
|
+
children: (p) => /* @__PURE__ */ jsx("input", {
|
|
186
|
+
...p,
|
|
187
|
+
autoComplete: "organization",
|
|
188
|
+
value: institution,
|
|
189
|
+
onChange: (e) => setInstitution(e.target.value)
|
|
190
|
+
})
|
|
191
|
+
})] }),
|
|
192
|
+
state.mode !== "reset" && state.step === 1 && /* @__PURE__ */ jsx(PasswordField, {
|
|
193
|
+
id: id("password"),
|
|
194
|
+
label: state.mode === "signup" && !state.linking ? "Choose a password" : "Password",
|
|
195
|
+
error: errors.password,
|
|
196
|
+
value: password,
|
|
197
|
+
onChange: setPassword,
|
|
198
|
+
autoComplete: state.mode === "signup" && !state.linking ? "new-password" : "current-password"
|
|
199
|
+
}),
|
|
200
|
+
/* @__PURE__ */ jsx("div", {
|
|
201
|
+
"aria-live": "polite",
|
|
202
|
+
role: "status",
|
|
203
|
+
children: status.kind === "info" && /* @__PURE__ */ jsx("p", {
|
|
204
|
+
className: ui.statusInfo,
|
|
205
|
+
children: status.message
|
|
206
|
+
})
|
|
207
|
+
}),
|
|
208
|
+
status.kind === "error" && /* @__PURE__ */ jsx("p", {
|
|
209
|
+
role: "alert",
|
|
210
|
+
className: ui.statusError,
|
|
211
|
+
children: status.message
|
|
212
|
+
}),
|
|
213
|
+
/* @__PURE__ */ jsxs("button", {
|
|
214
|
+
type: "submit",
|
|
215
|
+
className: ui.primary,
|
|
216
|
+
disabled: busy,
|
|
217
|
+
children: [busy ? /* @__PURE__ */ jsx("span", {
|
|
218
|
+
className: "loading loading-spinner loading-sm",
|
|
219
|
+
"aria-hidden": true
|
|
220
|
+
}) : null, busy ? "Working…" : submitLabel]
|
|
221
|
+
}),
|
|
222
|
+
/* @__PURE__ */ jsxs("div", {
|
|
223
|
+
className: "flex flex-col items-start gap-2",
|
|
224
|
+
children: [
|
|
225
|
+
state.mode !== "reset" && state.step === 1 && /* @__PURE__ */ jsx("button", {
|
|
226
|
+
type: "button",
|
|
227
|
+
className: ui.link,
|
|
228
|
+
onClick: auth.back,
|
|
229
|
+
children: "Use a different email"
|
|
230
|
+
}),
|
|
231
|
+
state.mode === "signin" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("button", {
|
|
232
|
+
type: "button",
|
|
233
|
+
className: ui.link,
|
|
234
|
+
onClick: () => auth.setMode("reset"),
|
|
235
|
+
children: "Forgot your password?"
|
|
236
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
237
|
+
type: "button",
|
|
238
|
+
className: ui.link,
|
|
239
|
+
onClick: () => auth.setMode("signup"),
|
|
240
|
+
children: "New here? Create an account"
|
|
241
|
+
})] }),
|
|
242
|
+
state.mode !== "signin" && /* @__PURE__ */ jsx("button", {
|
|
243
|
+
type: "button",
|
|
244
|
+
className: ui.link,
|
|
245
|
+
onClick: () => auth.setMode("signin"),
|
|
246
|
+
children: "Already have an account? Sign in"
|
|
247
|
+
})
|
|
248
|
+
]
|
|
249
|
+
})
|
|
250
|
+
]
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/** Sign in, sign up and password reset in one accessible dialog. Open it with `useAuth().open()`. */
|
|
254
|
+
function AuthDialog() {
|
|
255
|
+
const auth = useAuth();
|
|
256
|
+
const { state } = auth;
|
|
257
|
+
const contentRef = useRef(null);
|
|
258
|
+
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
259
|
+
open: state.open,
|
|
260
|
+
onOpenChange: (d) => d.open ? auth.open(state.mode) : auth.close(),
|
|
261
|
+
lazyMount: true,
|
|
262
|
+
unmountOnExit: true,
|
|
263
|
+
finalFocusEl: auth.returnFocusEl,
|
|
264
|
+
initialFocusEl: () => contentRef.current?.querySelector("input") ?? null,
|
|
265
|
+
children: /* @__PURE__ */ jsxs(Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, { className: ui.backdrop }), /* @__PURE__ */ jsx(Dialog.Positioner, {
|
|
266
|
+
className: ui.positioner,
|
|
267
|
+
children: /* @__PURE__ */ jsxs(Dialog.Content, {
|
|
268
|
+
ref: contentRef,
|
|
269
|
+
className: `${ui.panel} relative`,
|
|
270
|
+
children: [
|
|
271
|
+
/* @__PURE__ */ jsx(Dialog.CloseTrigger, {
|
|
272
|
+
className: ui.closeButton,
|
|
273
|
+
"aria-label": "Close",
|
|
274
|
+
children: /* @__PURE__ */ jsx(X, {
|
|
275
|
+
className: "size-4",
|
|
276
|
+
"aria-hidden": true
|
|
277
|
+
})
|
|
278
|
+
}),
|
|
279
|
+
/* @__PURE__ */ jsx(Dialog.Title, {
|
|
280
|
+
className: ui.title,
|
|
281
|
+
children: TITLES[state.mode]
|
|
282
|
+
}),
|
|
283
|
+
/* @__PURE__ */ jsx(Dialog.Description, {
|
|
284
|
+
className: ui.description,
|
|
285
|
+
children: state.mode === "reset" ? "Enter your email and we will send a link to choose a new password." : state.step === 0 ? "Use the email you registered or submitted with." : state.email
|
|
286
|
+
}),
|
|
287
|
+
/* @__PURE__ */ jsx(AuthForm, {})
|
|
288
|
+
]
|
|
289
|
+
})
|
|
290
|
+
})] })
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
export { AuthDialog };
|
|
294
|
+
|
|
295
|
+
//# sourceMappingURL=AuthDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthDialog.js","names":[],"sources":["../src/AuthDialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog } from \"@ark-ui/react/dialog\";\nimport { Portal } from \"@ark-ui/react/portal\";\nimport { Eye, EyeOff, X } from \"lucide-react\";\nimport { useEffect, useId, useRef, useState } from \"react\";\nimport { fieldErrors, linkProfileSchema, resetSchema, signInSchema, signUpSchema } from \"@conferencesuite/core/auth/schemas\";\nimport type { Mode } from \"@conferencesuite/core/auth/machine\";\nimport { useAuth } from \"@conferencesuite/react/AuthProvider\";\nimport { ui } from \"./classes\";\n\nconst TITLES: Record<Mode, string> = {\n signin: \"Sign in\",\n signup: \"Create your account\",\n reset: \"Reset your password\",\n};\n\nfunction Field({\n id,\n label,\n error,\n children,\n}: {\n id: string;\n label: string;\n error?: string;\n children: (p: { id: string; \"aria-invalid\": boolean; \"aria-describedby\"?: string; className: string }) => React.ReactNode;\n}) {\n const errId = `${id}-error`;\n return (\n <div className={ui.field}>\n <label htmlFor={id} className={ui.label}>\n {label}\n </label>\n {children({\n id,\n \"aria-invalid\": !!error,\n \"aria-describedby\": error ? errId : undefined,\n className: `${ui.input} ${error ? ui.inputInvalid : \"\"}`,\n })}\n {error && (\n <p id={errId} className={ui.fieldError}>\n {error}\n </p>\n )}\n </div>\n );\n}\n\nfunction PasswordField({\n id,\n label,\n error,\n value,\n onChange,\n autoComplete,\n}: {\n id: string;\n label: string;\n error?: string;\n value: string;\n onChange: (v: string) => void;\n autoComplete: \"current-password\" | \"new-password\";\n}) {\n const [shown, setShown] = useState(false);\n return (\n <Field id={id} label={label} error={error}>\n {(p) => (\n <div className=\"relative\">\n <input\n {...p}\n className={`${p.className} pr-12`}\n type={shown ? \"text\" : \"password\"}\n autoComplete={autoComplete}\n value={value}\n onChange={(e) => onChange(e.target.value)}\n />\n <button\n type=\"button\"\n className=\"btn btn-ghost btn-sm btn-circle absolute right-1.5 top-1/2 -translate-y-1/2\"\n aria-label={shown ? \"Hide password\" : \"Show password\"}\n aria-pressed={shown}\n onClick={() => setShown((s) => !s)}\n >\n {shown ? <EyeOff className=\"size-4\" aria-hidden /> : <Eye className=\"size-4\" aria-hidden />}\n </button>\n </div>\n )}\n </Field>\n );\n}\n\n/** The form body. Mounted fresh each time the dialog opens, so it never shows the last person's details. */\nfunction AuthForm() {\n const auth = useAuth();\n const { state } = auth;\n const base = useId();\n const [email, setEmail] = useState(state.email);\n const [password, setPassword] = useState(\"\");\n const [fname, setFname] = useState(\"\");\n const [lname, setLname] = useState(\"\");\n const [institution, setInstitution] = useState(\"\");\n const [errors, setErrors] = useState<Record<string, string>>({});\n const panelRef = useRef<HTMLFormElement>(null);\n\n // Move focus to the first field of the new step (the dialog itself only focuses on open)\n useEffect(() => {\n if (!state.open) return;\n const first = panelRef.current?.querySelector<HTMLElement>(\"input\");\n first?.focus();\n }, [state.open, state.mode, state.step]);\n\n const busy = state.status.kind === \"busy\";\n const id = (n: string) => `${base}-${n}`;\n const needsProfile = state.step === 1 && state.needsProfile;\n const status = state.status;\n\n async function submit(e: React.FormEvent) {\n e.preventDefault();\n if (busy) return;\n\n if (state.mode === \"reset\") {\n const errs = fieldErrors(resetSchema, { email });\n setErrors(errs ?? {});\n if (!errs) await auth.reset(email.trim());\n return;\n }\n\n if (state.step === 0) {\n const errs = fieldErrors(signInSchema.pick({ email: true }), { email });\n setErrors(errs ?? {});\n if (!errs) await auth.checkEmail(email.trim());\n return;\n }\n\n if (state.mode === \"signin\") {\n const errs = fieldErrors(signInSchema, { email, password });\n setErrors(errs ?? {});\n if (!errs) await auth.signIn({ email: email.trim(), password });\n return;\n }\n\n // Sign up: a brand-new account needs a new password; linking an existing one needs only its password\n const schema = state.linking ? signInSchema.extend(linkProfileSchema.shape) : signUpSchema;\n const values = { email, password, fname, lname, institution };\n const errs = fieldErrors(schema, values);\n setErrors(errs ?? {});\n if (!errs) await auth.signUp({ ...values, email: email.trim() });\n }\n\n const submitLabel =\n state.mode === \"reset\"\n ? \"Send reset link\"\n : state.step === 0\n ? \"Continue\"\n : state.mode === \"signin\"\n ? \"Sign in\"\n : state.linking\n ? \"Link my account\"\n : \"Create account\";\n\n return (\n <form ref={panelRef} onSubmit={submit} noValidate className=\"mt-5 flex flex-col gap-4\">\n {(state.mode === \"reset\" || state.step === 0) && (\n <Field id={id(\"email\")} label=\"Email\" error={errors.email}>\n {(p) => (\n <input\n {...p}\n type=\"email\"\n inputMode=\"email\"\n autoComplete=\"email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n />\n )}\n </Field>\n )}\n\n {needsProfile && (\n <>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <Field id={id(\"fname\")} label=\"Given name\" error={errors.fname}>\n {(p) => <input {...p} autoComplete=\"given-name\" value={fname} onChange={(e) => setFname(e.target.value)} />}\n </Field>\n <Field id={id(\"lname\")} label=\"Family name\" error={errors.lname}>\n {(p) => <input {...p} autoComplete=\"family-name\" value={lname} onChange={(e) => setLname(e.target.value)} />}\n </Field>\n </div>\n <Field id={id(\"institution\")} label=\"Institution\" error={errors.institution}>\n {(p) => <input {...p} autoComplete=\"organization\" value={institution} onChange={(e) => setInstitution(e.target.value)} />}\n </Field>\n </>\n )}\n\n {state.mode !== \"reset\" && state.step === 1 && (\n <PasswordField\n id={id(\"password\")}\n label={state.mode === \"signup\" && !state.linking ? \"Choose a password\" : \"Password\"}\n error={errors.password}\n value={password}\n onChange={setPassword}\n autoComplete={state.mode === \"signup\" && !state.linking ? \"new-password\" : \"current-password\"}\n />\n )}\n\n <div aria-live=\"polite\" role=\"status\">\n {status.kind === \"info\" && <p className={ui.statusInfo}>{status.message}</p>}\n </div>\n {status.kind === \"error\" && (\n <p role=\"alert\" className={ui.statusError}>\n {status.message}\n </p>\n )}\n\n <button type=\"submit\" className={ui.primary} disabled={busy}>\n {busy ? <span className=\"loading loading-spinner loading-sm\" aria-hidden /> : null}\n {busy ? \"Working…\" : submitLabel}\n </button>\n\n <div className=\"flex flex-col items-start gap-2\">\n {state.mode !== \"reset\" && state.step === 1 && (\n <button type=\"button\" className={ui.link} onClick={auth.back}>\n Use a different email\n </button>\n )}\n {state.mode === \"signin\" && (\n <>\n <button type=\"button\" className={ui.link} onClick={() => auth.setMode(\"reset\")}>\n Forgot your password?\n </button>\n <button type=\"button\" className={ui.link} onClick={() => auth.setMode(\"signup\")}>\n New here? Create an account\n </button>\n </>\n )}\n {state.mode !== \"signin\" && (\n <button type=\"button\" className={ui.link} onClick={() => auth.setMode(\"signin\")}>\n Already have an account? Sign in\n </button>\n )}\n </div>\n </form>\n );\n}\n\n/** Sign in, sign up and password reset in one accessible dialog. Open it with `useAuth().open()`. */\nexport function AuthDialog() {\n const auth = useAuth();\n const { state } = auth;\n const contentRef = useRef<HTMLDivElement>(null);\n\n return (\n <Dialog.Root\n open={state.open}\n onOpenChange={(d) => (d.open ? auth.open(state.mode) : auth.close())}\n lazyMount\n unmountOnExit\n finalFocusEl={auth.returnFocusEl}\n // Start in the first field (Ark's default is the dialog itself)\n initialFocusEl={() => contentRef.current?.querySelector<HTMLElement>(\"input\") ?? null}\n >\n <Portal>\n <Dialog.Backdrop className={ui.backdrop} />\n <Dialog.Positioner className={ui.positioner}>\n <Dialog.Content ref={contentRef} className={`${ui.panel} relative`}>\n <Dialog.CloseTrigger className={ui.closeButton} aria-label=\"Close\">\n <X className=\"size-4\" aria-hidden />\n </Dialog.CloseTrigger>\n\n <Dialog.Title className={ui.title}>{TITLES[state.mode]}</Dialog.Title>\n <Dialog.Description className={ui.description}>\n {state.mode === \"reset\"\n ? \"Enter your email and we will send a link to choose a new password.\"\n : state.step === 0\n ? \"Use the email you registered or submitted with.\"\n : state.email}\n </Dialog.Description>\n\n <AuthForm />\n </Dialog.Content>\n </Dialog.Positioner>\n </Portal>\n </Dialog.Root>\n );\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAM,SAA+B;CACnC,QAAQ;CACR,QAAQ;CACR,OAAO;AACT;AAEA,SAAS,MAAM,EACb,IACA,OACA,OACA,YAMC;CACD,MAAM,QAAQ,GAAG,GAAG;CACpB,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG;EAAnB,UAAA;GACE,oBAAC,SAAD;IAAO,SAAS;IAAI,WAAW,GAAG;IAC/B,UAAA;GACI,CAAA;GACN,SAAS;IACR;IACA,gBAAgB,CAAC,CAAC;IAClB,oBAAoB,QAAQ,QAAQ,KAAA;IACpC,WAAW,GAAG,GAAG,MAAM,GAAG,QAAQ,GAAG,eAAe;GACtD,CAAC;GACA,SACC,oBAAC,KAAD;IAAG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