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,308 @@
1
+ "use client";
2
+
3
+ // components/kit/variants/sign-in-aui-018.tsx
4
+ import { useEffect, useId, useRef, useState } from "react";
5
+ import { Fragment, 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 RING = "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_12%,transparent)]";
9
+ 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)]";
10
+ var FOCUS = "focus-visible:ring-2 focus-visible:ring-brand/50 focus-visible:ring-offset-2 focus-visible:ring-offset-paper";
11
+ var PRIMARY = cx(
12
+ "group inline-flex h-11 w-full 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] disabled:cursor-progress",
13
+ FOCUS
14
+ );
15
+ var CSS = `
16
+ @keyframes aui018-rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
17
+ @keyframes aui018-in { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }
18
+ @keyframes aui018-pop { from { opacity: 0; transform: scale(.6) } 70% { transform: scale(1.06) } to { opacity: 1; transform: none } }
19
+ @keyframes aui018-halo { from { opacity: .5; transform: scale(1) } to { opacity: 0; transform: scale(1.7) } }
20
+ @keyframes aui018-draw { from { stroke-dashoffset: 24 } to { stroke-dashoffset: 0 } }
21
+ @media (prefers-reduced-motion: reduce) { .aui018 * { animation: none !important; transition: none !important } }
22
+ `;
23
+ var rise = (i, on = true) => on ? { animation: `aui018-rise .6s ${EASE} ${80 + i * 55}ms both` } : void 0;
24
+ var validEmail = (v) => /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(v.trim());
25
+ var wait = (ms) => new Promise((r) => setTimeout(r, ms));
26
+ var Spinner = () => /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-r-transparent" });
27
+ var Arrow = () => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5 transition-transform duration-300 group-hover:translate-x-0.5", style: { transitionTimingFunction: EASE }, fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M3 8h10M9 4l4 4-4 4" }) });
28
+ function Field({ label, type, value, onChange, error, shake, autoComplete, placeholder, inputRef, onKeyUp, hint, end }) {
29
+ const id = useId();
30
+ const box = useRef(null);
31
+ const hasError = !!error;
32
+ useEffect(() => {
33
+ if (!hasError || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
34
+ box.current?.animate(
35
+ [{ transform: "none" }, { transform: "translateX(-6px)" }, { transform: "translateX(5px)" }, { transform: "translateX(-3px)" }, { transform: "translateX(2px)" }, { transform: "none" }],
36
+ { duration: 420, easing: EASE }
37
+ );
38
+ }, [hasError, shake]);
39
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
40
+ /* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-2", children: [
41
+ /* @__PURE__ */ jsx("label", { htmlFor: id, className: "text-[13px] font-medium text-ink", children: label }),
42
+ hint
43
+ ] }),
44
+ /* @__PURE__ */ jsxs("div", { ref: box, className: "relative", children: [
45
+ /* @__PURE__ */ jsx(
46
+ "input",
47
+ {
48
+ ref: inputRef,
49
+ id,
50
+ type,
51
+ value,
52
+ autoComplete,
53
+ placeholder,
54
+ onChange: (e) => onChange(e.target.value),
55
+ onKeyUp,
56
+ "aria-invalid": hasError || void 0,
57
+ "aria-describedby": hasError ? `${id}-err` : void 0,
58
+ className: cx(
59
+ "h-11 w-full rounded-[9px] bg-paper px-3.5 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)]",
60
+ !!end && "pr-11",
61
+ hasError ? "shadow-[inset_0_0_0_1.5px_var(--ink)]" : RING
62
+ )
63
+ }
64
+ ),
65
+ end && /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 right-1 flex items-center", children: end })
66
+ ] }),
67
+ hasError && /* @__PURE__ */ jsxs("p", { id: `${id}-err`, role: "alert", className: "flex items-center gap-1.5 text-[12.5px] text-ink", style: { animation: `aui018-in .3s ${EASE} both` }, children: [
68
+ /* @__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: [
69
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "6.25" }),
70
+ /* @__PURE__ */ jsx("path", { d: "M8 4.8v3.6M8 11h.01" })
71
+ ] }),
72
+ error
73
+ ] })
74
+ ] });
75
+ }
76
+ var nameFrom = (email) => email.split("@")[0].split(/[._-]+/).filter(Boolean).slice(0, 2).map((p) => p[0].toUpperCase() + p.slice(1)).join(" ");
77
+ function StepSignIn({ brand = "Astabyte", title = "Sign in to Astabyte", subtitle = "Enter your work email to continue.", defaultEmail = "", onEmail, onSubmit, className }) {
78
+ const [step, setStep] = useState(0);
79
+ const [email, setEmail] = useState(defaultEmail);
80
+ const [name, setName] = useState("");
81
+ const [password, setPassword] = useState("");
82
+ const [reveal, setReveal] = useState(false);
83
+ const [caps, setCaps] = useState(false);
84
+ const [errors, setErrors] = useState({ email: "", password: "" });
85
+ const [shake, setShake] = useState(0);
86
+ const [pending, setPending] = useState(false);
87
+ const [done, setDone] = useState(false);
88
+ const alive = useRef(true);
89
+ const track = useRef(null);
90
+ const emailInput = useRef(null);
91
+ const passInput = useRef(null);
92
+ const prev = useRef(step);
93
+ useEffect(() => {
94
+ alive.current = true;
95
+ return () => {
96
+ alive.current = false;
97
+ };
98
+ }, []);
99
+ useEffect(() => {
100
+ if (prev.current === step) return;
101
+ prev.current = step;
102
+ const el = step === 0 ? emailInput.current : passInput.current;
103
+ el?.focus({ preventScroll: true });
104
+ if (track.current) track.current.scrollLeft = 0;
105
+ }, [step]);
106
+ const fail = (k, msg) => {
107
+ setErrors((e) => ({ ...e, [k]: msg }));
108
+ setShake((n) => n + 1);
109
+ };
110
+ const next = async (e) => {
111
+ e.preventDefault();
112
+ if (pending) return;
113
+ const msg = !email.trim() ? "Enter your email." : !validEmail(email) ? "That doesn't look like an email address." : "";
114
+ if (msg) return fail("email", msg);
115
+ setPending(true);
116
+ try {
117
+ const res = await (onEmail ? onEmail(email.trim()) : wait(700));
118
+ if (!alive.current) return;
119
+ setName(res && res.name || nameFrom(email.trim()));
120
+ setErrors({ email: "", password: "" });
121
+ setStep(1);
122
+ } catch (err) {
123
+ if (alive.current) fail("email", err instanceof Error ? err.message : "Something went wrong. Try again.");
124
+ } finally {
125
+ if (alive.current) setPending(false);
126
+ }
127
+ };
128
+ const submit = async (e) => {
129
+ e.preventDefault();
130
+ if (pending) return;
131
+ const msg = !password ? "Enter your password." : password.length < 8 ? "Use at least 8 characters." : "";
132
+ if (msg) return fail("password", msg);
133
+ setPending(true);
134
+ try {
135
+ await (onSubmit ? onSubmit({ email: email.trim(), password }) : wait(1200));
136
+ if (alive.current) setDone(true);
137
+ } catch (err) {
138
+ if (alive.current) fail("password", err instanceof Error ? err.message : "That password doesn't match. Try again.");
139
+ } finally {
140
+ if (alive.current) setPending(false);
141
+ }
142
+ };
143
+ const back = () => {
144
+ setStep(0);
145
+ setPassword("");
146
+ setCaps(false);
147
+ setErrors({ email: "", password: "" });
148
+ };
149
+ const reset = () => {
150
+ setDone(false);
151
+ setStep(0);
152
+ setPassword("");
153
+ };
154
+ const initials = name.split(" ").map((p) => p[0]).join("").slice(0, 2) || "?";
155
+ return /* @__PURE__ */ jsxs("div", { className: cx("aui018 relative w-full max-w-[400px] overflow-hidden rounded-[14px] bg-paper", CARD, className), children: [
156
+ /* @__PURE__ */ jsx("style", { href: "asta-sign-in-aui-018", precedence: "asta", children: CSS }),
157
+ done ? /* @__PURE__ */ jsxs("div", { className: "flex min-h-[360px] flex-col items-center justify-center p-7 text-center", role: "status", children: [
158
+ /* @__PURE__ */ jsx("span", { className: "flex h-14 w-14 items-center justify-center rounded-full bg-ink text-paper", style: { animation: `aui018-pop .55s ${EASE} both` }, children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-7 w-7", fill: "none", stroke: "currentColor", strokeWidth: "2.4", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M5 12.5l4.5 4.5L19 7.5", strokeDasharray: "24", style: { animation: `aui018-draw .5s .2s ${EASE} both` } }) }) }),
159
+ /* @__PURE__ */ jsxs("h3", { className: "mt-5 text-[20px] font-medium tracking-[-0.02em] text-ink", style: rise(1), children: [
160
+ "Welcome back, ",
161
+ name.split(" ")[0]
162
+ ] }),
163
+ /* @__PURE__ */ jsxs("p", { className: "mt-1.5 max-w-[28ch] text-[14px] leading-snug text-mute", style: rise(2), children: [
164
+ "Opening your ",
165
+ brand,
166
+ " workspace."
167
+ ] }),
168
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: reset, className: cx("mt-6 h-9 rounded-[8px] px-3.5 text-[13.5px] font-medium text-ink outline-none transition-colors hover:bg-paper-2", RING, FOCUS), style: rise(3), children: "Sign out" })
169
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
170
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 pt-6 sm:px-7 sm:pt-7", style: rise(0), children: [
171
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-[14px] font-semibold tracking-[-0.02em] text-ink", children: [
172
+ /* @__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" }) }) }),
173
+ brand
174
+ ] }),
175
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", "aria-label": `Step ${step + 1} of 2`, children: [
176
+ [0, 1].map((i) => /* @__PURE__ */ jsx("span", { className: "relative h-[3px] w-7 overflow-hidden rounded-full bg-paper-2", "aria-hidden": true, children: /* @__PURE__ */ jsx("span", { className: "absolute inset-0 origin-left rounded-full bg-brand transition-transform duration-700", style: { transform: `scaleX(${step >= i ? 1 : 0})`, transitionTimingFunction: EASE } }) }, i)),
177
+ /* @__PURE__ */ jsxs("span", { className: "ml-1 font-mono text-[10.5px] uppercase tracking-[0.08em] text-mute tabular-nums", children: [
178
+ step + 1,
179
+ "/2"
180
+ ] })
181
+ ] })
182
+ ] }),
183
+ /* @__PURE__ */ jsx("div", { ref: track, className: "overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "flex transition-transform duration-[650ms]", style: { transform: `translateX(${step * -100}%)`, transitionTimingFunction: EASE }, children: [
184
+ /* @__PURE__ */ jsxs("form", { noValidate: true, onSubmit: next, inert: step !== 0, "aria-hidden": step !== 0, className: "flex w-full shrink-0 flex-col px-6 pb-6 pt-7 sm:px-7 sm:pb-7", children: [
185
+ /* @__PURE__ */ jsx("h3", { className: "text-[20px] font-medium tracking-[-0.02em] text-ink", style: rise(1), children: title }),
186
+ /* @__PURE__ */ jsx("p", { className: "mt-1 text-[14px] leading-snug text-mute", style: rise(2), children: subtitle }),
187
+ /* @__PURE__ */ jsx("div", { className: "mt-6", style: rise(3), children: /* @__PURE__ */ jsx(
188
+ Field,
189
+ {
190
+ label: "Work email",
191
+ type: "email",
192
+ autoComplete: "username",
193
+ placeholder: "you@company.com",
194
+ value: email,
195
+ onChange: (v) => {
196
+ setEmail(v);
197
+ if (errors.email) setErrors((e) => ({ ...e, email: "" }));
198
+ },
199
+ error: errors.email,
200
+ shake,
201
+ inputRef: emailInput
202
+ }
203
+ ) }),
204
+ /* @__PURE__ */ jsx("div", { style: rise(4), children: /* @__PURE__ */ jsxs("button", { type: "submit", disabled: pending, "aria-busy": pending && step === 0 || void 0, className: cx(PRIMARY, "mt-5"), children: [
205
+ pending && step === 0 ? /* @__PURE__ */ jsx(Spinner, {}) : null,
206
+ pending && step === 0 ? "Finding your account" : "Continue",
207
+ !(pending && step === 0) && /* @__PURE__ */ jsx(Arrow, {})
208
+ ] }) }),
209
+ /* @__PURE__ */ jsxs("p", { className: "mt-5 text-center text-[13px] text-mute", style: rise(5), children: [
210
+ "New to ",
211
+ brand,
212
+ "?",
213
+ " ",
214
+ /* @__PURE__ */ jsx("a", { href: "#", onClick: (e) => e.preventDefault(), className: "rounded font-medium text-brand outline-none hover:underline focus-visible:ring-2 focus-visible:ring-brand/50", children: "Create an account" })
215
+ ] })
216
+ ] }),
217
+ /* @__PURE__ */ jsxs("form", { noValidate: true, onSubmit: submit, inert: step !== 1, "aria-hidden": step !== 1, className: "flex w-full shrink-0 flex-col px-6 pb-6 pt-7 sm:px-7 sm:pb-7", children: [
218
+ /* @__PURE__ */ jsxs(
219
+ "button",
220
+ {
221
+ type: "button",
222
+ onClick: back,
223
+ "aria-label": `Back. Signed in as ${email.trim()}, change email`,
224
+ className: cx(
225
+ "group flex items-center gap-3 rounded-[11px] p-2 pr-3 text-left outline-none transition-[background-color,transform] duration-200 hover:bg-paper-2 active:scale-[.99] focus-visible:ring-2 focus-visible:ring-brand/50",
226
+ RING
227
+ ),
228
+ children: [
229
+ /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "ml-1 h-4 w-4 shrink-0 text-mute transition-transform duration-300 group-hover:-translate-x-0.5", style: { transitionTimingFunction: EASE }, fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M10 3.5 5.5 8l4.5 4.5" }) }),
230
+ /* @__PURE__ */ jsxs("span", { className: "relative flex h-9 w-9 shrink-0", "aria-hidden": true, children: [
231
+ step === 1 && /* @__PURE__ */ jsx("span", { className: "absolute inset-0 rounded-full bg-brand", style: { animation: `aui018-halo .9s ${EASE} 350ms both` } }),
232
+ /* @__PURE__ */ jsx(
233
+ "span",
234
+ {
235
+ className: "relative flex h-9 w-9 items-center justify-center rounded-full bg-brand text-[12.5px] font-semibold text-paper",
236
+ style: step === 1 ? { animation: `aui018-pop .55s ${EASE} 250ms both` } : void 0,
237
+ children: initials
238
+ },
239
+ step
240
+ )
241
+ ] }),
242
+ /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [
243
+ /* @__PURE__ */ jsx("span", { className: "truncate text-[13.5px] font-medium text-ink", children: name }),
244
+ /* @__PURE__ */ jsx("span", { className: "truncate text-[12.5px] text-mute", children: email.trim() })
245
+ ] }),
246
+ /* @__PURE__ */ jsx("span", { className: "text-[12px] font-medium text-mute transition-colors group-hover:text-ink", children: "Change" })
247
+ ]
248
+ }
249
+ ),
250
+ /* @__PURE__ */ jsx("h3", { className: "mt-6 text-[20px] font-medium tracking-[-0.02em] text-ink", children: "Enter your password" }),
251
+ /* @__PURE__ */ jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsx(
252
+ Field,
253
+ {
254
+ label: "Password",
255
+ type: reveal ? "text" : "password",
256
+ autoComplete: "current-password",
257
+ placeholder: "At least 8 characters",
258
+ value: password,
259
+ onChange: (v) => {
260
+ setPassword(v);
261
+ if (errors.password) setErrors((e) => ({ ...e, password: "" }));
262
+ },
263
+ onKeyUp: (e) => setCaps(e.getModifierState("CapsLock")),
264
+ error: errors.password,
265
+ shake,
266
+ inputRef: passInput,
267
+ hint: caps ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 text-[11.5px] font-medium text-ink", style: { animation: `aui018-in .25s ${EASE} both` }, role: "status", children: [
268
+ /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3 w-3", fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M8 2.5 13 8h-2.5v3h-5V8H3l5-5.5ZM5.5 13.5h5" }) }),
269
+ "Caps Lock is on"
270
+ ] }) : /* @__PURE__ */ jsx("a", { href: "#", onClick: (e) => e.preventDefault(), className: "rounded text-[12.5px] text-brand outline-none hover:underline focus-visible:ring-2 focus-visible:ring-brand/50", children: "Forgot?" }),
271
+ end: /* @__PURE__ */ jsx(
272
+ "button",
273
+ {
274
+ type: "button",
275
+ onClick: () => setReveal((v) => !v),
276
+ "aria-label": reveal ? "Hide password" : "Show password",
277
+ "aria-pressed": reveal,
278
+ className: "flex h-9 w-9 items-center justify-center rounded-[8px] text-mute outline-none transition-colors hover:bg-paper-2 hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50",
279
+ children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", "aria-hidden": true, children: [
280
+ /* @__PURE__ */ jsx("path", { d: "M1.5 8S4 3.5 8 3.5 14.5 8 14.5 8 12 12.5 8 12.5 1.5 8 1.5 8Z" }),
281
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "2" }),
282
+ !reveal && /* @__PURE__ */ jsx("path", { d: "M2.5 13.5l11-11" })
283
+ ] })
284
+ }
285
+ )
286
+ }
287
+ ) }),
288
+ /* @__PURE__ */ jsxs("button", { type: "submit", disabled: pending, "aria-busy": pending && step === 1 || void 0, className: cx(PRIMARY, "mt-5"), children: [
289
+ pending && step === 1 ? /* @__PURE__ */ jsx(Spinner, {}) : null,
290
+ pending && step === 1 ? "Signing in" : "Sign in",
291
+ !(pending && step === 1) && /* @__PURE__ */ jsx(Arrow, {})
292
+ ] }),
293
+ /* @__PURE__ */ jsxs("p", { className: "mt-5 text-center text-[13px] text-mute", children: [
294
+ "Prefer a link?",
295
+ " ",
296
+ /* @__PURE__ */ jsx("a", { href: "#", onClick: (e) => e.preventDefault(), className: "rounded font-medium text-brand outline-none hover:underline focus-visible:ring-2 focus-visible:ring-brand/50", children: "Email me one" })
297
+ ] })
298
+ ] })
299
+ ] }) })
300
+ ] })
301
+ ] });
302
+ }
303
+ var sign_in_aui_018_default = StepSignIn;
304
+
305
+ export {
306
+ StepSignIn,
307
+ sign_in_aui_018_default
308
+ };
@@ -0,0 +1,122 @@
1
+ "use client";
2
+
3
+ // components/kit/variants/footer-aui-025.tsx
4
+ import { useEffect, useRef, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var cx = (...c) => c.filter(Boolean).join(" ");
7
+ var EASE = "ease-[cubic-bezier(.16,1,.3,1)]";
8
+ var ring = "outline-none focus-visible:ring-2 focus-visible:ring-brand/50 focus-visible:ring-offset-2 focus-visible:ring-offset-paper";
9
+ var step = (i) => ({ "--i": i });
10
+ var GLYPHS = {
11
+ x: /* @__PURE__ */ jsx("path", { d: "M3 3h3.6l3.1 4.3L13.4 3H15l-4.6 5.4L15.5 15h-3.6l-3.3-4.6L4.6 15H3l5-5.8L3 3Zm2.2 1.2 7.3 9.6h1.1L6.4 4.2H5.2Z", fill: "currentColor" }),
12
+ github: /* @__PURE__ */ jsx(
13
+ "path",
14
+ {
15
+ d: "M9 1.8a7.2 7.2 0 0 0-2.3 14c.4.1.5-.1.5-.3v-1.3c-2 .4-2.4-.9-2.4-.9-.3-.8-.8-1-.8-1-.7-.5 0-.5 0-.5.7 0 1.1.8 1.1.8.6 1.1 1.7.8 2.1.6 0-.5.3-.8.5-1-1.6-.2-3.3-.8-3.3-3.5 0-.8.3-1.4.7-1.9 0-.2-.3-.9.1-1.9 0 0 .6-.2 2 .7a6.8 6.8 0 0 1 3.6 0c1.4-.9 2-.7 2-.7.4 1 .1 1.7.1 1.9.5.5.7 1.1.7 1.9 0 2.8-1.7 3.4-3.3 3.5.3.2.5.7.5 1.3v2c0 .2.1.4.5.3A7.2 7.2 0 0 0 9 1.8Z",
16
+ fill: "currentColor"
17
+ }
18
+ ),
19
+ linkedin: /* @__PURE__ */ jsx("path", { d: "M3 6.5h2.6V15H3V6.5Zm1.3-4.1a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM7.2 6.5h2.5v1.2c.4-.7 1.2-1.4 2.6-1.4 2.7 0 3.2 1.8 3.2 4.1V15h-2.6v-4.1c0-1 0-2.2-1.4-2.2s-1.6 1.1-1.6 2.2V15H7.2V6.5Z", fill: "currentColor" })
20
+ };
21
+ var DEFAULT_LINKS = [
22
+ { label: "Product", href: "#" },
23
+ { label: "Pricing", href: "#" },
24
+ { label: "Journal", href: "#" },
25
+ { label: "Changelog", href: "#" }
26
+ ];
27
+ var DEFAULT_SOCIALS = [
28
+ { label: "X", href: "#", icon: "x" },
29
+ { label: "GitHub", href: "#", icon: "github" },
30
+ { label: "LinkedIn", href: "#", icon: "linkedin" }
31
+ ];
32
+ var CSS = `
33
+ @keyframes aui-f25-rise { from { opacity: 0; transform: translateY(10px) } }
34
+ .aui-f25-in { animation: aui-f25-rise .6s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--i, 0) * 55ms) }
35
+ @media (prefers-reduced-motion: reduce) { .aui-f25-in { animation: none } }
36
+ `;
37
+ function Mark() {
38
+ return /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-[15px] font-semibold tracking-[-0.03em] text-ink", children: [
39
+ /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", className: "h-[22px] w-[22px]", "aria-hidden": true, children: [
40
+ /* @__PURE__ */ jsx("rect", { width: "24", height: "24", rx: "7", className: "fill-ink" }),
41
+ /* @__PURE__ */ jsx("path", { d: "M7 17V7h2.3l5.4 6.3V7H17v10h-2.3L9.3 10.7V17H7Z", className: "fill-paper" })
42
+ ] }),
43
+ "Astabyte"
44
+ ] });
45
+ }
46
+ function MinimalFooter({ brand = /* @__PURE__ */ jsx(Mark, {}), links = DEFAULT_LINKS, socials = DEFAULT_SOCIALS, owner = "Astabyte", hint = false, className }) {
47
+ const list = useRef(null);
48
+ const [line, setLine] = useState({ x: 0, y: 0, w: 0, on: false });
49
+ const year = (/* @__PURE__ */ new Date()).getFullYear();
50
+ const point = (i) => {
51
+ const el = i === null ? null : list.current?.querySelectorAll("a[data-l]")[i];
52
+ if (!el) return setLine((l) => ({ ...l, on: false }));
53
+ setLine({ x: el.offsetLeft, y: el.offsetTop + el.offsetHeight + 3, w: el.offsetWidth, on: true });
54
+ };
55
+ useEffect(() => {
56
+ if (!hint || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
57
+ const timers = links.map((_, i) => window.setTimeout(() => point(i), 900 + i * 260));
58
+ timers.push(window.setTimeout(() => point(null), 900 + links.length * 260 + 200));
59
+ return () => timers.forEach(clearTimeout);
60
+ }, [hint, links]);
61
+ return /* @__PURE__ */ jsxs("footer", { className: cx("@container w-full bg-paper px-6 py-6", className), children: [
62
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5 @min-[640px]:flex-row @min-[640px]:items-center @min-[640px]:gap-6", children: [
63
+ /* @__PURE__ */ jsxs("div", { className: "aui-f25-in flex items-center justify-between", style: step(0), children: [
64
+ brand,
65
+ /* @__PURE__ */ jsx(Socials, { socials, className: "@min-[640px]:hidden" })
66
+ ] }),
67
+ /* @__PURE__ */ jsx("nav", { "aria-label": "Footer", className: "@min-[640px]:flex-1", children: /* @__PURE__ */ jsxs("ul", { ref: list, className: "relative flex flex-wrap gap-x-5 gap-y-3", onPointerLeave: () => point(null), children: [
68
+ links.map((l, i) => /* @__PURE__ */ jsx("li", { className: "aui-f25-in", style: step(i + 1), children: /* @__PURE__ */ jsx(
69
+ "a",
70
+ {
71
+ "data-l": true,
72
+ href: l.href,
73
+ onPointerEnter: () => point(i),
74
+ onFocus: () => point(i),
75
+ onBlur: () => point(null),
76
+ className: cx("rounded-[4px] text-[13.5px] text-mute transition-colors duration-300 hover:text-ink focus-visible:text-ink", ring),
77
+ children: l.label
78
+ }
79
+ ) }, l.label)),
80
+ /* @__PURE__ */ jsx(
81
+ "span",
82
+ {
83
+ "aria-hidden": true,
84
+ className: cx("pointer-events-none absolute left-0 top-0 h-[1.5px] w-px origin-left rounded-full bg-brand transition-[transform,opacity] duration-500 motion-reduce:transition-none", EASE),
85
+ style: { transform: `translate(${line.x}px, ${line.y}px) scaleX(${Math.max(line.w, 1)})`, opacity: line.on ? 1 : 0 }
86
+ }
87
+ )
88
+ ] }) }),
89
+ /* @__PURE__ */ jsxs("div", { className: "aui-f25-in flex items-center justify-between gap-3 @min-[640px]:justify-end", style: step(links.length + 1), children: [
90
+ /* @__PURE__ */ jsx(Socials, { socials, className: "hidden @min-[640px]:flex" }),
91
+ /* @__PURE__ */ jsxs("p", { className: "font-mono text-[11.5px] tracking-[0.02em] text-mute", children: [
92
+ "\xA9 ",
93
+ year,
94
+ " ",
95
+ owner
96
+ ] })
97
+ ] })
98
+ ] }),
99
+ /* @__PURE__ */ jsx("style", { href: "asta-footer-aui-025", precedence: "asta", children: CSS })
100
+ ] });
101
+ }
102
+ function Socials({ socials, className }) {
103
+ return /* @__PURE__ */ jsx("ul", { className: cx("flex items-center gap-1", className), children: socials.map((s) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
104
+ "a",
105
+ {
106
+ href: s.href,
107
+ "aria-label": s.label,
108
+ className: cx(
109
+ "grid h-8 w-8 place-items-center rounded-[8px] text-mute transition-[transform,color,background-color] duration-300 hover:-translate-y-px hover:bg-paper-2 hover:text-ink active:scale-90 motion-reduce:transition-colors",
110
+ EASE,
111
+ ring
112
+ ),
113
+ children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 18 18", className: "h-[15px] w-[15px]", "aria-hidden": true, children: GLYPHS[s.icon] })
114
+ }
115
+ ) }, s.label)) });
116
+ }
117
+ var footer_aui_025_default = MinimalFooter;
118
+
119
+ export {
120
+ MinimalFooter,
121
+ footer_aui_025_default
122
+ };