asta-ui 0.3.0 → 0.4.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 (179) hide show
  1. package/dist/accordion.js +1 -1
  2. package/dist/base/card-checkout.js +1 -1
  3. package/dist/base/footer-aui-025.d.ts +2 -0
  4. package/dist/base/footer-aui-025.js +9 -0
  5. package/dist/base/footer-aui-026.d.ts +2 -0
  6. package/dist/base/footer-aui-026.js +9 -0
  7. package/dist/base/footer-aui-027.d.ts +2 -0
  8. package/dist/base/footer-aui-027.js +9 -0
  9. package/dist/base/footer-aui-028.d.ts +2 -0
  10. package/dist/base/footer-aui-028.js +9 -0
  11. package/dist/base/navbar-aui-009.d.ts +2 -0
  12. package/dist/base/navbar-aui-009.js +9 -0
  13. package/dist/base/navbar-aui-010.d.ts +2 -0
  14. package/dist/base/navbar-aui-010.js +9 -0
  15. package/dist/base/navbar-aui-011.d.ts +2 -0
  16. package/dist/base/navbar-aui-011.js +9 -0
  17. package/dist/base/navbar-aui-012.d.ts +2 -0
  18. package/dist/base/navbar-aui-012.js +9 -0
  19. package/dist/base/navbar-aui-013.d.ts +2 -0
  20. package/dist/base/navbar-aui-013.js +9 -0
  21. package/dist/base/navbar-aui-014.d.ts +2 -0
  22. package/dist/base/navbar-aui-014.js +9 -0
  23. package/dist/base/now-playing.js +1 -1
  24. package/dist/base/payment-received.js +1 -1
  25. package/dist/base/pricing-aui-021.d.ts +2 -0
  26. package/dist/base/pricing-aui-021.js +9 -0
  27. package/dist/base/pricing-aui-022.d.ts +2 -0
  28. package/dist/base/pricing-aui-022.js +9 -0
  29. package/dist/base/pricing-aui-023.d.ts +2 -0
  30. package/dist/base/pricing-aui-023.js +9 -0
  31. package/dist/base/pricing-aui-024.d.ts +2 -0
  32. package/dist/base/pricing-aui-024.js +9 -0
  33. package/dist/base/sign-in-aui-015.d.ts +2 -0
  34. package/dist/base/sign-in-aui-015.js +9 -0
  35. package/dist/base/sign-in-aui-016.d.ts +2 -0
  36. package/dist/base/sign-in-aui-016.js +9 -0
  37. package/dist/base/sign-in-aui-017.d.ts +2 -0
  38. package/dist/base/sign-in-aui-017.js +9 -0
  39. package/dist/base/sign-in-aui-018.d.ts +2 -0
  40. package/dist/base/sign-in-aui-018.js +9 -0
  41. package/dist/base/sign-in-aui-019.d.ts +2 -0
  42. package/dist/base/sign-in-aui-019.js +9 -0
  43. package/dist/base/sign-in-aui-020.d.ts +2 -0
  44. package/dist/base/sign-in-aui-020.js +9 -0
  45. package/dist/base/spinner.js +1 -1
  46. package/dist/base.js +124 -4
  47. package/dist/card-checkout.js +1 -1
  48. package/dist/chunk-2SQQFICY.js +493 -0
  49. package/dist/{chunk-QJXPS55V.js → chunk-5TSQZY34.js} +1 -1
  50. package/dist/chunk-5U4H2CXC.js +308 -0
  51. package/dist/chunk-5WGDQ62P.js +122 -0
  52. package/dist/chunk-6B6NTRMC.js +293 -0
  53. package/dist/chunk-6NNHSXFD.js +539 -0
  54. package/dist/chunk-746WX2DF.js +480 -0
  55. package/dist/chunk-7GKCX4IE.js +636 -0
  56. package/dist/chunk-7SNVRPED.js +223 -0
  57. package/dist/chunk-BGVAXPHD.js +305 -0
  58. package/dist/chunk-F526V5BA.js +254 -0
  59. package/dist/chunk-LPTY5WXM.js +231 -0
  60. package/dist/chunk-MDI73RL6.js +245 -0
  61. package/dist/chunk-MUDW65ZT.js +220 -0
  62. package/dist/chunk-NZRQL3SA.js +201 -0
  63. package/dist/chunk-OFYGJUKP.js +278 -0
  64. package/dist/{chunk-NDBLIYMX.js → chunk-OKCSTMX3.js} +2 -2
  65. package/dist/chunk-P37H477M.js +236 -0
  66. package/dist/chunk-QSLS3ENY.js +469 -0
  67. package/dist/chunk-RRHQBGRO.js +327 -0
  68. package/dist/{chunk-2OGTIQVU.js → chunk-UEOEWP7L.js} +1 -1
  69. package/dist/{chunk-BP3LXM3X.js → chunk-UTGEGGSE.js} +1 -1
  70. package/dist/chunk-WNPMHOXE.js +136 -0
  71. package/dist/chunk-WTNNS7AX.js +362 -0
  72. package/dist/{chunk-AS6RA64I.js → chunk-XTP6ITUJ.js} +3 -1
  73. package/dist/footer-aui-025.d.ts +2 -0
  74. package/dist/footer-aui-025.js +9 -0
  75. package/dist/footer-aui-026.d.ts +2 -0
  76. package/dist/footer-aui-026.js +9 -0
  77. package/dist/footer-aui-027.d.ts +2 -0
  78. package/dist/footer-aui-027.js +9 -0
  79. package/dist/footer-aui-028.d.ts +2 -0
  80. package/dist/footer-aui-028.js +9 -0
  81. package/dist/index.js +125 -5
  82. package/dist/navbar-aui-009.d.ts +2 -0
  83. package/dist/navbar-aui-009.js +9 -0
  84. package/dist/navbar-aui-010.d.ts +2 -0
  85. package/dist/navbar-aui-010.js +9 -0
  86. package/dist/navbar-aui-011.d.ts +2 -0
  87. package/dist/navbar-aui-011.js +9 -0
  88. package/dist/navbar-aui-012.d.ts +2 -0
  89. package/dist/navbar-aui-012.js +9 -0
  90. package/dist/navbar-aui-013.d.ts +2 -0
  91. package/dist/navbar-aui-013.js +9 -0
  92. package/dist/navbar-aui-014.d.ts +2 -0
  93. package/dist/navbar-aui-014.js +9 -0
  94. package/dist/now-playing.js +1 -1
  95. package/dist/payment-received.js +1 -1
  96. package/dist/pricing-aui-021.d.ts +2 -0
  97. package/dist/pricing-aui-021.js +9 -0
  98. package/dist/pricing-aui-022.d.ts +2 -0
  99. package/dist/pricing-aui-022.js +9 -0
  100. package/dist/pricing-aui-023.d.ts +2 -0
  101. package/dist/pricing-aui-023.js +9 -0
  102. package/dist/pricing-aui-024.d.ts +2 -0
  103. package/dist/pricing-aui-024.js +9 -0
  104. package/dist/sign-in-aui-015.d.ts +2 -0
  105. package/dist/sign-in-aui-015.js +9 -0
  106. package/dist/sign-in-aui-016.d.ts +2 -0
  107. package/dist/sign-in-aui-016.js +9 -0
  108. package/dist/sign-in-aui-017.d.ts +2 -0
  109. package/dist/sign-in-aui-017.js +9 -0
  110. package/dist/sign-in-aui-018.d.ts +2 -0
  111. package/dist/sign-in-aui-018.js +9 -0
  112. package/dist/sign-in-aui-019.d.ts +2 -0
  113. package/dist/sign-in-aui-019.js +9 -0
  114. package/dist/sign-in-aui-020.d.ts +2 -0
  115. package/dist/sign-in-aui-020.js +9 -0
  116. package/dist/spinner.js +1 -1
  117. package/dist/types/components/kit/variants/footer-aui-025.d.ts +22 -0
  118. package/dist/types/components/kit/variants/footer-aui-026.d.ts +21 -0
  119. package/dist/types/components/kit/variants/footer-aui-027.d.ts +36 -0
  120. package/dist/types/components/kit/variants/footer-aui-028.d.ts +34 -0
  121. package/dist/types/components/kit/variants/navbar-aui-009.d.ts +62 -0
  122. package/dist/types/components/kit/variants/navbar-aui-010.d.ts +30 -0
  123. package/dist/types/components/kit/variants/navbar-aui-011.d.ts +65 -0
  124. package/dist/types/components/kit/variants/navbar-aui-012.d.ts +50 -0
  125. package/dist/types/components/kit/variants/navbar-aui-013.d.ts +70 -0
  126. package/dist/types/components/kit/variants/navbar-aui-014.d.ts +31 -0
  127. package/dist/types/components/kit/variants/pricing-aui-021.d.ts +30 -0
  128. package/dist/types/components/kit/variants/pricing-aui-022.d.ts +34 -0
  129. package/dist/types/components/kit/variants/pricing-aui-023.d.ts +26 -0
  130. package/dist/types/components/kit/variants/pricing-aui-024.d.ts +29 -0
  131. package/dist/types/components/kit/variants/sign-in-aui-015.d.ts +21 -0
  132. package/dist/types/components/kit/variants/sign-in-aui-016.d.ts +28 -0
  133. package/dist/types/components/kit/variants/sign-in-aui-017.d.ts +21 -0
  134. package/dist/types/components/kit/variants/sign-in-aui-018.d.ts +22 -0
  135. package/dist/types/components/kit/variants/sign-in-aui-019.d.ts +22 -0
  136. package/dist/types/components/kit/variants/sign-in-aui-020.d.ts +27 -0
  137. package/dist/types/packages/asta-ui/src/base/footer-aui-025.d.ts +2 -0
  138. package/dist/types/packages/asta-ui/src/base/footer-aui-026.d.ts +2 -0
  139. package/dist/types/packages/asta-ui/src/base/footer-aui-027.d.ts +2 -0
  140. package/dist/types/packages/asta-ui/src/base/footer-aui-028.d.ts +2 -0
  141. package/dist/types/packages/asta-ui/src/base/navbar-aui-009.d.ts +2 -0
  142. package/dist/types/packages/asta-ui/src/base/navbar-aui-010.d.ts +2 -0
  143. package/dist/types/packages/asta-ui/src/base/navbar-aui-011.d.ts +2 -0
  144. package/dist/types/packages/asta-ui/src/base/navbar-aui-012.d.ts +2 -0
  145. package/dist/types/packages/asta-ui/src/base/navbar-aui-013.d.ts +2 -0
  146. package/dist/types/packages/asta-ui/src/base/navbar-aui-014.d.ts +2 -0
  147. package/dist/types/packages/asta-ui/src/base/pricing-aui-021.d.ts +2 -0
  148. package/dist/types/packages/asta-ui/src/base/pricing-aui-022.d.ts +2 -0
  149. package/dist/types/packages/asta-ui/src/base/pricing-aui-023.d.ts +2 -0
  150. package/dist/types/packages/asta-ui/src/base/pricing-aui-024.d.ts +2 -0
  151. package/dist/types/packages/asta-ui/src/base/sign-in-aui-015.d.ts +2 -0
  152. package/dist/types/packages/asta-ui/src/base/sign-in-aui-016.d.ts +2 -0
  153. package/dist/types/packages/asta-ui/src/base/sign-in-aui-017.d.ts +2 -0
  154. package/dist/types/packages/asta-ui/src/base/sign-in-aui-018.d.ts +2 -0
  155. package/dist/types/packages/asta-ui/src/base/sign-in-aui-019.d.ts +2 -0
  156. package/dist/types/packages/asta-ui/src/base/sign-in-aui-020.d.ts +2 -0
  157. package/dist/types/packages/asta-ui/src/base.d.ts +40 -0
  158. package/dist/types/packages/asta-ui/src/footer-aui-025.d.ts +2 -0
  159. package/dist/types/packages/asta-ui/src/footer-aui-026.d.ts +2 -0
  160. package/dist/types/packages/asta-ui/src/footer-aui-027.d.ts +2 -0
  161. package/dist/types/packages/asta-ui/src/footer-aui-028.d.ts +2 -0
  162. package/dist/types/packages/asta-ui/src/index.d.ts +40 -0
  163. package/dist/types/packages/asta-ui/src/navbar-aui-009.d.ts +2 -0
  164. package/dist/types/packages/asta-ui/src/navbar-aui-010.d.ts +2 -0
  165. package/dist/types/packages/asta-ui/src/navbar-aui-011.d.ts +2 -0
  166. package/dist/types/packages/asta-ui/src/navbar-aui-012.d.ts +2 -0
  167. package/dist/types/packages/asta-ui/src/navbar-aui-013.d.ts +2 -0
  168. package/dist/types/packages/asta-ui/src/navbar-aui-014.d.ts +2 -0
  169. package/dist/types/packages/asta-ui/src/pricing-aui-021.d.ts +2 -0
  170. package/dist/types/packages/asta-ui/src/pricing-aui-022.d.ts +2 -0
  171. package/dist/types/packages/asta-ui/src/pricing-aui-023.d.ts +2 -0
  172. package/dist/types/packages/asta-ui/src/pricing-aui-024.d.ts +2 -0
  173. package/dist/types/packages/asta-ui/src/sign-in-aui-015.d.ts +2 -0
  174. package/dist/types/packages/asta-ui/src/sign-in-aui-016.d.ts +2 -0
  175. package/dist/types/packages/asta-ui/src/sign-in-aui-017.d.ts +2 -0
  176. package/dist/types/packages/asta-ui/src/sign-in-aui-018.d.ts +2 -0
  177. package/dist/types/packages/asta-ui/src/sign-in-aui-019.d.ts +2 -0
  178. package/dist/types/packages/asta-ui/src/sign-in-aui-020.d.ts +2 -0
  179. package/package.json +1 -1
@@ -0,0 +1,293 @@
1
+ "use client";
2
+
3
+ // components/kit/variants/sign-in-aui-015.tsx
4
+ import { useEffect, useId, useRef, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var cx = (...c) => c.filter(Boolean).join(" ");
7
+ var EASE = "cubic-bezier(.16,1,.3,1)";
8
+ var CARD = "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_1px_2px_rgb(0_0_0/0.04),0_18px_40px_-20px_rgb(0_0_0/0.25)]";
9
+ var RING = "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_12%,transparent)]";
10
+ var FOCUS = "focus-visible:ring-2 focus-visible:ring-brand/50 focus-visible:ring-offset-2 focus-visible:ring-offset-paper";
11
+ var CSS = `
12
+ @keyframes aui015-rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
13
+ @keyframes aui015-in { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }
14
+ @keyframes aui015-drop { 0% { opacity: 0; transform: translateY(-18px) scale(.96) } 100% { opacity: 1; transform: none } }
15
+ @keyframes aui015-fly { 0% { transform: none; opacity: 1 } 35% { transform: translate(-3px, 2px) rotate(-8deg) } 100% { transform: translate(40px, -34px) rotate(12deg) scale(.6); opacity: 0 } }
16
+ @keyframes aui015-land { from { opacity: 0; transform: translate(-22px, 18px) rotate(-10deg) scale(.7) } to { opacity: 1; transform: none } }
17
+ @keyframes aui015-ping { 0% { opacity: .55; transform: scale(1) } 100% { opacity: 0; transform: scale(2.6) } }
18
+ @keyframes aui015-drain { from { transform: scaleX(1) } to { transform: scaleX(0) } }
19
+ @media (prefers-reduced-motion: reduce) { .aui015 * { animation: none !important; transition: none !important } }
20
+ `;
21
+ var rise = (i) => ({ animation: `aui015-rise .6s ${EASE} ${100 + i * 55}ms both` });
22
+ var validEmail = (v) => /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(v.trim());
23
+ var wait = (ms) => new Promise((r) => setTimeout(r, ms));
24
+ var Spinner = () => /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-r-transparent" });
25
+ function useShake(active, key) {
26
+ const ref = useRef(null);
27
+ useEffect(() => {
28
+ if (!active || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
29
+ ref.current?.animate(
30
+ [{ transform: "none" }, { transform: "translateX(-6px)" }, { transform: "translateX(5px)" }, { transform: "translateX(-3px)" }, { transform: "translateX(2px)" }, { transform: "none" }],
31
+ { duration: 420, easing: EASE }
32
+ );
33
+ }, [active, key]);
34
+ return ref;
35
+ }
36
+ var Plane = ({ className, style }) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className, style, fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M14.5 1.5 7 9M14.5 1.5 10 14.5 7 9 1.5 6l13-4.5Z" }) });
37
+ function MagicLinkSignIn({
38
+ brand = "Astabyte",
39
+ title = "Sign in with email",
40
+ subtitle = "No password. We'll send a link that signs you in.",
41
+ defaultEmail = "",
42
+ onSend,
43
+ onResend,
44
+ resendAfter = 30,
45
+ mailHref = "mailto:",
46
+ className
47
+ }) {
48
+ const id = useId();
49
+ const [email, setEmail] = useState(defaultEmail);
50
+ const [touched, setTouched] = useState(false);
51
+ const [stage, setStage] = useState("form");
52
+ const [pending, setPending] = useState(false);
53
+ const [resending, setResending] = useState(false);
54
+ const [sends, setSends] = useState(0);
55
+ const [left, setLeft] = useState(0);
56
+ const [note, setNote] = useState("");
57
+ const [formError, setFormError] = useState("");
58
+ const [shake, setShake] = useState(0);
59
+ const alive = useRef(true);
60
+ const input = useRef(null);
61
+ const heading = useRef(null);
62
+ const error = !email.trim() ? "Enter your email." : !validEmail(email) ? "That doesn't look like an email address." : "";
63
+ const shown = touched && error || formError;
64
+ const box = useShake(!!shown, shake);
65
+ useEffect(() => {
66
+ alive.current = true;
67
+ return () => {
68
+ alive.current = false;
69
+ };
70
+ }, []);
71
+ useEffect(() => {
72
+ if (left <= 0) return;
73
+ const t = setTimeout(() => setLeft((n) => n - 1), 1e3);
74
+ return () => clearTimeout(t);
75
+ }, [left]);
76
+ useEffect(() => {
77
+ if (stage !== "flying") return;
78
+ const quick = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
79
+ const t = setTimeout(() => setStage("sent"), quick ? 0 : 440);
80
+ return () => clearTimeout(t);
81
+ }, [stage]);
82
+ useEffect(() => {
83
+ if (stage === "sent") heading.current?.focus({ preventScroll: true });
84
+ }, [stage]);
85
+ const send = (to) => onSend ? onSend(to) : wait(1100);
86
+ const submit = async (e) => {
87
+ e.preventDefault();
88
+ if (pending || stage !== "form") return;
89
+ setTouched(true);
90
+ setFormError("");
91
+ if (error) {
92
+ setShake((n) => n + 1);
93
+ input.current?.focus();
94
+ return;
95
+ }
96
+ setPending(true);
97
+ try {
98
+ await send(email.trim());
99
+ if (!alive.current) return;
100
+ setStage("flying");
101
+ setLeft(resendAfter);
102
+ setSends((n) => n + 1);
103
+ setNote("");
104
+ } catch (err) {
105
+ if (!alive.current) return;
106
+ setFormError(err instanceof Error ? err.message : "We couldn't send the link. Try again.");
107
+ setShake((n) => n + 1);
108
+ } finally {
109
+ if (alive.current) setPending(false);
110
+ }
111
+ };
112
+ const resend = async () => {
113
+ if (left > 0 || resending) return;
114
+ setResending(true);
115
+ setNote("");
116
+ try {
117
+ await (onResend ? onResend(email.trim()) : send(email.trim()));
118
+ if (!alive.current) return;
119
+ setNote("Sent again. Give it a minute.");
120
+ setLeft(resendAfter);
121
+ setSends((n) => n + 1);
122
+ } catch (err) {
123
+ if (alive.current) setNote(err instanceof Error ? err.message : "We couldn't resend it. Try again.");
124
+ } finally {
125
+ if (alive.current) setResending(false);
126
+ }
127
+ };
128
+ const back = () => {
129
+ setStage("form");
130
+ setLeft(0);
131
+ setNote("");
132
+ requestAnimationFrame(() => input.current?.focus());
133
+ };
134
+ return /* @__PURE__ */ jsxs("div", { className: cx("aui015 relative w-full max-w-[400px] overflow-hidden rounded-[14px] bg-paper", CARD, className), children: [
135
+ /* @__PURE__ */ jsx("style", { href: "asta-sign-in-aui-015", precedence: "asta", children: CSS }),
136
+ stage !== "sent" ? /* @__PURE__ */ jsxs("form", { noValidate: true, onSubmit: submit, className: "flex flex-col p-6 sm:p-7", children: [
137
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", style: rise(0), children: [
138
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-[14px] font-semibold tracking-[-0.02em] text-ink", children: [
139
+ /* @__PURE__ */ jsx("span", { className: "flex h-7 w-7 items-center justify-center rounded-[7px] bg-ink text-paper", "aria-hidden": true, children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M3 13V3h2.2l5.6 6.6V3H13v10h-2.2L5.2 6.4V13H3Z" }) }) }),
140
+ brand
141
+ ] }),
142
+ /* @__PURE__ */ jsx("span", { className: "font-mono text-[10.5px] uppercase tracking-[0.08em] text-mute", children: "Passwordless" })
143
+ ] }),
144
+ /* @__PURE__ */ jsx("h3", { className: "mt-8 text-[20px] font-medium tracking-[-0.02em] text-ink", style: rise(1), children: title }),
145
+ /* @__PURE__ */ jsx("p", { className: "mt-1 text-[14px] leading-snug text-mute", style: rise(2), children: subtitle }),
146
+ /* @__PURE__ */ jsxs("div", { className: "mt-6", style: rise(3), children: [
147
+ /* @__PURE__ */ jsx("label", { htmlFor: `${id}-email`, className: "text-[13px] font-medium text-ink", children: "Work email" }),
148
+ /* @__PURE__ */ jsxs("div", { ref: box, className: "relative mt-1.5", children: [
149
+ /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-mute", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinejoin: "round", "aria-hidden": true, children: [
150
+ /* @__PURE__ */ jsx("rect", { x: "1.75", y: "3.25", width: "12.5", height: "9.5", rx: "1.75" }),
151
+ /* @__PURE__ */ jsx("path", { d: "m2.5 4.5 5.5 4 5.5-4" })
152
+ ] }),
153
+ /* @__PURE__ */ jsx(
154
+ "input",
155
+ {
156
+ ref: input,
157
+ id: `${id}-email`,
158
+ type: "email",
159
+ autoComplete: "email",
160
+ placeholder: "you@company.com",
161
+ value: email,
162
+ onChange: (e) => {
163
+ setEmail(e.target.value);
164
+ setFormError("");
165
+ },
166
+ onBlur: () => email && setTouched(true),
167
+ "aria-invalid": !!shown || void 0,
168
+ "aria-describedby": shown ? `${id}-err` : `${id}-hint`,
169
+ className: cx(
170
+ "h-11 w-full rounded-[9px] bg-paper pl-9 pr-3 text-[14.5px] text-ink outline-none transition-shadow duration-200 placeholder:text-mute focus-visible:shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_14%,transparent)]",
171
+ shown ? "shadow-[inset_0_0_0_1.5px_var(--ink)]" : RING
172
+ )
173
+ }
174
+ )
175
+ ] }),
176
+ shown ? /* @__PURE__ */ jsxs("p", { id: `${id}-err`, role: "alert", className: "mt-2 flex items-center gap-1.5 text-[12.5px] text-ink", style: { animation: `aui015-in .3s ${EASE} both` }, children: [
177
+ /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5 shrink-0", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", "aria-hidden": true, children: [
178
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "6.25" }),
179
+ /* @__PURE__ */ jsx("path", { d: "M8 4.8v3.6M8 11h.01" })
180
+ ] }),
181
+ shown
182
+ ] }) : /* @__PURE__ */ jsx("p", { id: `${id}-hint`, className: "mt-2 text-[12.5px] text-mute", children: "Use the address your team invited." })
183
+ ] }),
184
+ /* @__PURE__ */ jsx("div", { style: rise(4), children: /* @__PURE__ */ jsxs(
185
+ "button",
186
+ {
187
+ type: "submit",
188
+ disabled: pending,
189
+ "aria-busy": pending || void 0,
190
+ className: cx(
191
+ "group mt-5 inline-flex h-11 w-full items-center justify-center gap-2 overflow-hidden rounded-[9px] bg-ink px-4 text-[14px] font-medium text-paper outline-none transition-transform duration-200 active:scale-[.985] disabled:cursor-progress",
192
+ FOCUS
193
+ ),
194
+ children: [
195
+ pending ? /* @__PURE__ */ jsx(Spinner, {}) : null,
196
+ /* @__PURE__ */ jsx("span", { children: pending ? "Sending your link" : stage === "flying" ? "Sent" : "Email me a link" }),
197
+ !pending && /* @__PURE__ */ jsx(
198
+ Plane,
199
+ {
200
+ className: "h-4 w-4 transition-transform duration-300 group-hover:-translate-y-0.5 group-hover:translate-x-0.5",
201
+ style: stage === "flying" ? { animation: `aui015-fly .45s ${EASE} both` } : { transitionTimingFunction: EASE }
202
+ }
203
+ )
204
+ ]
205
+ }
206
+ ) }),
207
+ /* @__PURE__ */ jsxs("p", { className: "mt-5 flex items-center justify-center gap-1.5 text-[12px] text-mute", style: rise(5), children: [
208
+ /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5", fill: "none", stroke: "currentColor", strokeWidth: "1.4", "aria-hidden": true, children: [
209
+ /* @__PURE__ */ jsx("rect", { x: "3", y: "7", width: "10", height: "7", rx: "1.5" }),
210
+ /* @__PURE__ */ jsx("path", { d: "M5.5 7V5a2.5 2.5 0 0 1 5 0v2" })
211
+ ] }),
212
+ "Links work once and expire in 15 minutes."
213
+ ] })
214
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col p-6 sm:p-7", children: [
215
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", style: rise(0), children: [
216
+ /* @__PURE__ */ jsx("span", { className: "flex h-10 w-10 items-center justify-center rounded-[10px] bg-brand text-paper", "aria-hidden": true, children: /* @__PURE__ */ jsx(Plane, { className: "h-[18px] w-[18px]", style: { animation: `aui015-land .6s ${EASE} both` } }) }),
217
+ /* @__PURE__ */ jsx("span", { className: "font-mono text-[10.5px] uppercase tracking-[0.08em] text-mute", children: "Link sent" })
218
+ ] }),
219
+ /* @__PURE__ */ jsx("h3", { ref: heading, tabIndex: -1, className: "mt-5 text-[20px] font-medium tracking-[-0.02em] text-ink outline-none", style: rise(1), children: "Check your inbox" }),
220
+ /* @__PURE__ */ jsxs("p", { className: "mt-1 text-[14px] leading-snug text-mute", style: rise(2), children: [
221
+ "We sent a sign-in link to ",
222
+ /* @__PURE__ */ jsx("span", { className: "break-all font-medium text-ink", children: email.trim() }),
223
+ "."
224
+ ] }),
225
+ /* @__PURE__ */ jsx("div", { className: cx("relative mt-5 rounded-[11px] bg-paper p-3.5", RING), style: { animation: `aui015-drop .7s ${EASE} 260ms both` }, "aria-hidden": true, children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
226
+ /* @__PURE__ */ jsx("span", { className: "mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-ink text-[12px] font-semibold text-paper", children: brand[0] }),
227
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
228
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
229
+ /* @__PURE__ */ jsx("span", { className: "text-[13px] font-semibold text-ink", children: brand }),
230
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5 text-[11px] text-mute", children: [
231
+ "now",
232
+ /* @__PURE__ */ jsxs("span", { className: "relative flex h-2 w-2", children: [
233
+ /* @__PURE__ */ jsx("span", { className: "absolute inset-0 rounded-full bg-brand", style: { animation: `aui015-ping 1.2s ${EASE} 900ms 2 both` } }),
234
+ /* @__PURE__ */ jsx("span", { className: "relative h-2 w-2 rounded-full bg-brand" })
235
+ ] })
236
+ ] })
237
+ ] }),
238
+ /* @__PURE__ */ jsxs("p", { className: "truncate text-[13px] text-ink", children: [
239
+ "Your sign-in link for ",
240
+ brand
241
+ ] }),
242
+ /* @__PURE__ */ jsx("p", { className: "truncate text-[12.5px] text-mute", children: "Tap the button to finish signing in. It expires in 15 minutes." })
243
+ ] })
244
+ ] }) }, sends),
245
+ /* @__PURE__ */ jsxs("div", { className: "mt-5 grid grid-cols-[1fr_auto] gap-2", style: rise(4), children: [
246
+ /* @__PURE__ */ jsxs(
247
+ "a",
248
+ {
249
+ href: mailHref,
250
+ className: cx(
251
+ "group inline-flex h-11 items-center justify-center gap-2 rounded-[9px] bg-ink px-4 text-[14px] font-medium text-paper outline-none transition-transform duration-200 active:scale-[.985]",
252
+ FOCUS
253
+ ),
254
+ children: [
255
+ "Open mail",
256
+ /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5 transition-transform duration-300 group-hover:-translate-y-px group-hover:translate-x-px", style: { transitionTimingFunction: EASE }, fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M5 11 11 5M6 5h5v5" }) })
257
+ ]
258
+ }
259
+ ),
260
+ /* @__PURE__ */ jsxs(
261
+ "button",
262
+ {
263
+ type: "button",
264
+ onClick: resend,
265
+ disabled: left > 0 || resending,
266
+ "aria-busy": resending || void 0,
267
+ className: cx(
268
+ "relative inline-flex h-11 min-w-[116px] items-center justify-center gap-2 overflow-hidden rounded-[9px] bg-paper px-4 text-[13.5px] font-medium text-ink outline-none transition-[background-color,transform] duration-200 hover:bg-paper-2 active:scale-[.985] disabled:cursor-not-allowed disabled:hover:bg-paper",
269
+ RING,
270
+ FOCUS
271
+ ),
272
+ children: [
273
+ resending ? /* @__PURE__ */ jsx(Spinner, {}) : null,
274
+ /* @__PURE__ */ jsx("span", { className: cx("tabular-nums", left > 0 && "text-mute"), children: resending ? "Sending" : left > 0 ? `Resend in ${left}s` : "Resend" }),
275
+ left > 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute inset-x-0 bottom-0 h-[2px] origin-left bg-brand", style: { animation: `aui015-drain ${resendAfter}s linear both` } }, sends)
276
+ ]
277
+ }
278
+ )
279
+ ] }),
280
+ /* @__PURE__ */ jsx("p", { role: "status", className: "mt-3 min-h-[18px] text-center text-[12.5px] text-ink", children: note && /* @__PURE__ */ jsx("span", { className: "inline-block", style: { animation: `aui015-in .3s ${EASE} both` }, children: note }, note) }),
281
+ /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center justify-center gap-1 text-[13px] text-mute", style: rise(5), children: [
282
+ "Wrong address?",
283
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: back, className: "rounded font-medium text-brand outline-none hover:underline focus-visible:ring-2 focus-visible:ring-brand/50", children: "Change it" })
284
+ ] })
285
+ ] })
286
+ ] });
287
+ }
288
+ var sign_in_aui_015_default = MagicLinkSignIn;
289
+
290
+ export {
291
+ MagicLinkSignIn,
292
+ sign_in_aui_015_default
293
+ };