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,254 @@
1
+ "use client";
2
+
3
+ // components/kit/variants/navbar-aui-010.tsx
4
+ import { useCallback, useEffect, useId, useLayoutEffect, 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 TW_EASE = "ease-[cubic-bezier(.16,1,.3,1)]";
9
+ var FOCUS = "outline-none focus-visible:ring-2 focus-visible:ring-brand/50";
10
+ var RING = "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent)]";
11
+ var CSS = `
12
+ @keyframes aui-010-bar { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
13
+ @keyframes aui-010-rise { from { opacity: 0; transform: translateY(6px); } }
14
+ @keyframes aui-010-drop { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
15
+ .aui-010-bar { animation: aui-010-bar .7s ${EASE} both; }
16
+ .aui-010-in { animation: aui-010-rise .6s ${EASE} both; animation-delay: calc(180ms + var(--i, 0) * 50ms); }
17
+ .aui-010-sheet { animation: aui-010-drop .4s ${EASE} both; transform-origin: top; }
18
+ @media (prefers-reduced-motion: reduce) { .aui-010-m, .aui-010-m * { animation: none !important; transition-duration: 0s !important; } .aui-010-glow { display: none; } }
19
+ `;
20
+ var resolve = (r) => r && "current" in r ? r.current : r ?? null;
21
+ var at = (n) => ({ "--i": n });
22
+ var Logo = () => /* @__PURE__ */ jsxs(Fragment, { children: [
23
+ /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 20 20", className: "h-5 w-5", "aria-hidden": true, children: [
24
+ /* @__PURE__ */ jsx("circle", { cx: "10", cy: "10", r: "8", fill: "currentColor" }),
25
+ /* @__PURE__ */ jsx("path", { d: "M5.5 12.5c1.6-3.4 3.2-5 4.5-5s2.9 1.6 4.5 5", fill: "none", stroke: "var(--paper)", strokeWidth: "1.7", strokeLinecap: "round" })
26
+ ] }),
27
+ "Astabyte"
28
+ ] });
29
+ var LINKS = [
30
+ { label: "Collections", href: "#" },
31
+ { label: "Journal", href: "#" },
32
+ { label: "Studio", href: "#" },
33
+ { label: "Visit", href: "#" }
34
+ ];
35
+ var Arrow = ({ className = "" }) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: cx("h-3.5 w-3.5", className), fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M3.5 8h9M9 4.5 12.5 8 9 11.5" }) });
36
+ function move(el, to, from) {
37
+ el.style.width = `${to.w}px`;
38
+ el.style.transition = "none";
39
+ el.style.transform = from && from.w > 0 ? `translateX(${from.x}px) scaleX(${from.w / to.w})` : `translateX(${to.x}px) scale(.92)`;
40
+ void el.getBoundingClientRect();
41
+ el.style.transition = "";
42
+ el.style.transform = `translateX(${to.x}px)`;
43
+ }
44
+ function FloatingNavbar({
45
+ brand = /* @__PURE__ */ jsx(Logo, {}),
46
+ brandHref = "/",
47
+ links = LINKS,
48
+ secondary = { label: "Sign in", href: "#" },
49
+ cta = { label: "Book a visit", href: "#" },
50
+ scrollRoot,
51
+ threshold = 24,
52
+ className
53
+ }) {
54
+ const [hover, setHover] = useState(null);
55
+ const [scrolled, setScrolled] = useState(false);
56
+ const [sheet, setSheet] = useState(false);
57
+ const root = useRef(null);
58
+ const bar = useRef(null);
59
+ const glow = useRef(null);
60
+ const list = useRef(null);
61
+ const pill = useRef(null);
62
+ const burger = useRef(null);
63
+ const last = useRef(null);
64
+ const id = useId();
65
+ useLayoutEffect(() => {
66
+ const ul = list.current;
67
+ const el = pill.current;
68
+ if (!ul || !el) return;
69
+ const a = hover === null ? void 0 : ul.querySelectorAll("[data-glide]")[hover];
70
+ if (!a) {
71
+ el.style.opacity = "0";
72
+ last.current = null;
73
+ return;
74
+ }
75
+ const box = { x: a.offsetLeft, w: a.offsetWidth };
76
+ move(el, box, last.current);
77
+ el.style.opacity = "1";
78
+ last.current = box;
79
+ }, [hover]);
80
+ useEffect(() => {
81
+ const el = resolve(scrollRoot);
82
+ const read = () => setScrolled((el ? el.scrollTop : window.scrollY) > threshold);
83
+ read();
84
+ const target = el ?? window;
85
+ target.addEventListener("scroll", read, { passive: true });
86
+ return () => target.removeEventListener("scroll", read);
87
+ }, [scrollRoot, threshold]);
88
+ const close = useCallback((focus) => {
89
+ setSheet(false);
90
+ if (focus) burger.current?.focus();
91
+ }, []);
92
+ useEffect(() => {
93
+ if (!sheet) return;
94
+ const down = (e) => !root.current?.contains(e.target) && close(false);
95
+ const key = (e) => e.key === "Escape" && close(true);
96
+ document.addEventListener("pointerdown", down);
97
+ document.addEventListener("keydown", key);
98
+ return () => {
99
+ document.removeEventListener("pointerdown", down);
100
+ document.removeEventListener("keydown", key);
101
+ };
102
+ }, [sheet, close]);
103
+ const track = (x) => {
104
+ const b = bar.current;
105
+ const g = glow.current;
106
+ if (!b || !g) return;
107
+ if (x === null) {
108
+ g.style.opacity = "0";
109
+ return;
110
+ }
111
+ g.style.opacity = "1";
112
+ g.style.transform = `translateX(${x - b.getBoundingClientRect().left - 110}px)`;
113
+ };
114
+ const shrunk = scrolled && !sheet;
115
+ return /* @__PURE__ */ jsxs("div", { ref: root, className: cx("aui-010-m @container pointer-events-none sticky top-0 z-30 flex w-full justify-center px-3 pt-3 @min-[640px]:pt-4", className), children: [
116
+ /* @__PURE__ */ jsx("style", { href: "asta-navbar-aui-010", precedence: "asta", children: CSS }),
117
+ /* @__PURE__ */ jsx("div", { className: cx("w-full max-w-[640px] origin-top transition-transform duration-700", TW_EASE, shrunk ? "scale-[.95]" : "scale-100"), children: /* @__PURE__ */ jsxs(
118
+ "header",
119
+ {
120
+ ref: bar,
121
+ onPointerMove: (e) => e.pointerType === "mouse" && track(e.clientX),
122
+ onPointerLeave: () => track(null),
123
+ className: cx("aui-010-bar pointer-events-auto relative rounded-[12px] bg-paper/72 backdrop-blur-xl backdrop-saturate-150", RING),
124
+ children: [
125
+ /* @__PURE__ */ jsx(
126
+ "span",
127
+ {
128
+ "aria-hidden": true,
129
+ className: cx(
130
+ "pointer-events-none absolute inset-0 rounded-[12px] shadow-[0_1px_2px_rgb(0_0_0/0.06),0_20px_44px_-18px_rgb(0_0_0/0.35)] transition-opacity duration-700",
131
+ TW_EASE,
132
+ shrunk ? "opacity-100" : "opacity-40"
133
+ )
134
+ }
135
+ ),
136
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute inset-0 overflow-hidden rounded-[12px]", children: /* @__PURE__ */ jsx(
137
+ "span",
138
+ {
139
+ ref: glow,
140
+ className: "aui-010-glow absolute -top-10 left-0 h-[136px] w-[220px] rounded-full bg-[radial-gradient(closest-side,color-mix(in_srgb,var(--brand)_28%,transparent),transparent)] opacity-0 transition-[opacity,transform] duration-500 ease-out"
141
+ }
142
+ ) }),
143
+ /* @__PURE__ */ jsxs("div", { className: "relative flex h-12 items-center gap-3 pl-3.5 pr-2", children: [
144
+ /* @__PURE__ */ jsx("a", { href: brandHref, style: at(0), className: cx("aui-010-in flex items-center gap-2 rounded-md text-[15px] font-semibold tracking-[-0.02em] text-ink", FOCUS), children: brand }),
145
+ /* @__PURE__ */ jsx("nav", { "aria-label": "Main", className: "mx-auto hidden @min-[640px]:block", children: /* @__PURE__ */ jsxs("ul", { ref: list, className: "relative flex items-center gap-px", onPointerLeave: () => setHover(null), children: [
146
+ /* @__PURE__ */ jsx(
147
+ "span",
148
+ {
149
+ ref: pill,
150
+ "aria-hidden": true,
151
+ style: { opacity: 0 },
152
+ className: cx("pointer-events-none absolute inset-y-0 left-0 origin-left rounded-lg bg-paper shadow-[0_1px_2px_rgb(0_0_0/0.08),inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_8%,transparent)] transition-[transform,opacity] duration-500", TW_EASE)
153
+ }
154
+ ),
155
+ links.map((l, n) => /* @__PURE__ */ jsx("li", { className: "aui-010-in", style: at(n + 1), children: /* @__PURE__ */ jsx(
156
+ "a",
157
+ {
158
+ href: l.href,
159
+ "data-glide": true,
160
+ onPointerEnter: () => setHover(n),
161
+ onFocus: () => setHover(n),
162
+ onBlur: () => setHover(null),
163
+ className: cx(
164
+ "relative flex h-8 items-center rounded-lg px-2.5 text-[14px] font-medium transition-colors duration-300",
165
+ FOCUS,
166
+ hover === n ? "text-ink" : "text-ink/70"
167
+ ),
168
+ children: l.label
169
+ }
170
+ ) }, l.label))
171
+ ] }) }),
172
+ /* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center gap-1 @min-[640px]:ml-0", children: [
173
+ secondary && /* @__PURE__ */ jsx(
174
+ "a",
175
+ {
176
+ href: secondary.href,
177
+ style: at(links.length + 1),
178
+ className: cx("aui-010-in hidden h-8 items-center rounded-lg px-2.5 text-[13px] font-medium text-ink/70 transition-colors hover:text-ink @min-[720px]:inline-flex", FOCUS),
179
+ children: secondary.label
180
+ }
181
+ ),
182
+ /* @__PURE__ */ jsxs(
183
+ "a",
184
+ {
185
+ href: cta.href,
186
+ style: at(links.length + 2),
187
+ className: cx(
188
+ "aui-010-in group/cta hidden h-8 items-center gap-1 rounded-lg bg-brand pl-3 pr-2.5 text-[13px] font-medium text-white transition-transform duration-300 hover:-translate-y-px active:translate-y-0 active:scale-[.97] @min-[640px]:inline-flex",
189
+ "shadow-[0_1px_2px_rgb(0_0_0/0.15),0_10px_24px_-10px_color-mix(in_srgb,var(--brand)_90%,transparent)] focus-visible:ring-offset-2 focus-visible:ring-offset-paper",
190
+ TW_EASE,
191
+ FOCUS
192
+ ),
193
+ children: [
194
+ cta.label,
195
+ /* @__PURE__ */ jsx(Arrow, { className: cx("transition-transform duration-300 group-hover/cta:translate-x-0.5", TW_EASE) })
196
+ ]
197
+ }
198
+ ),
199
+ /* @__PURE__ */ jsxs(
200
+ "button",
201
+ {
202
+ ref: burger,
203
+ type: "button",
204
+ "aria-label": sheet ? "Close menu" : "Open menu",
205
+ "aria-expanded": sheet,
206
+ "aria-controls": id,
207
+ onClick: () => setSheet((v) => !v),
208
+ className: cx("relative flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-paper/70 @min-[640px]:hidden", FOCUS),
209
+ children: [
210
+ /* @__PURE__ */ jsx("span", { className: cx("absolute h-[1.5px] w-[18px] rounded-full bg-ink transition-transform duration-500", TW_EASE, sheet ? "rotate-45" : "-translate-y-1") }),
211
+ /* @__PURE__ */ jsx("span", { className: cx("absolute h-[1.5px] w-[18px] rounded-full bg-ink transition-transform duration-500", TW_EASE, sheet ? "-rotate-45" : "translate-y-1") })
212
+ ]
213
+ }
214
+ )
215
+ ] })
216
+ ] }),
217
+ sheet && /* @__PURE__ */ jsxs(
218
+ "div",
219
+ {
220
+ id,
221
+ className: cx(
222
+ "aui-010-sheet absolute inset-x-0 top-[calc(100%+8px)] rounded-[14px] bg-paper/90 p-2 backdrop-blur-xl shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_24px_48px_-20px_rgb(0_0_0/0.4)] @min-[640px]:hidden"
223
+ ),
224
+ children: [
225
+ /* @__PURE__ */ jsx("ul", { className: "flex flex-col", children: links.map((l, n) => /* @__PURE__ */ jsx("li", { className: "aui-010-in", style: at(n), children: /* @__PURE__ */ jsxs(
226
+ "a",
227
+ {
228
+ href: l.href,
229
+ onClick: () => close(false),
230
+ className: cx("group/s flex h-12 items-center justify-between rounded-[10px] px-3 text-[17px] font-medium tracking-[-0.02em] text-ink hover:bg-paper-2", FOCUS),
231
+ children: [
232
+ l.label,
233
+ /* @__PURE__ */ jsx(Arrow, { className: "text-mute transition-transform duration-300 group-hover/s:translate-x-0.5" })
234
+ ]
235
+ }
236
+ ) }, l.label)) }),
237
+ /* @__PURE__ */ jsxs("div", { className: "aui-010-in mt-2 grid grid-cols-2 gap-2", style: at(links.length), children: [
238
+ secondary && /* @__PURE__ */ jsx("a", { href: secondary.href, className: cx("flex h-11 items-center justify-center rounded-[9px] bg-paper-2 text-[14px] font-medium text-ink", FOCUS), children: secondary.label }),
239
+ /* @__PURE__ */ jsx("a", { href: cta.href, className: cx("flex h-11 items-center justify-center rounded-[9px] bg-brand text-[14px] font-medium text-white", FOCUS, !secondary && "col-span-2"), children: cta.label })
240
+ ] })
241
+ ]
242
+ }
243
+ )
244
+ ]
245
+ }
246
+ ) })
247
+ ] });
248
+ }
249
+ var navbar_aui_010_default = FloatingNavbar;
250
+
251
+ export {
252
+ FloatingNavbar,
253
+ navbar_aui_010_default
254
+ };
@@ -0,0 +1,231 @@
1
+ "use client";
2
+
3
+ // components/kit/variants/pricing-aui-024.tsx
4
+ import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var cx = (...c) => c.filter(Boolean).join(" ");
7
+ var TIERS = [
8
+ { id: "hobby", name: "Hobby", description: "1 project, community support", price: 0 },
9
+ { id: "pro", name: "Pro", description: "10 projects, analytics, custom domain", price: 19, tag: "Popular" },
10
+ { id: "team", name: "Team", description: "Unlimited projects, roles, 10 seats", price: 49 },
11
+ { id: "scale", name: "Scale", description: "SSO, audit log, 99.9% uptime SLA", price: 149 }
12
+ ];
13
+ var EASE = "ease-[cubic-bezier(.16,1,.3,1)]";
14
+ var CSS = `
15
+ @keyframes aui-tiers-rise { from { opacity: 0; transform: translateY(10px) } }
16
+ .aui-tiers-rise { animation: aui-tiers-rise .6s cubic-bezier(.16,1,.3,1) both }
17
+ @media (prefers-reduced-motion: reduce) { .aui-tiers-rise { animation: none } .aui-tiers-move { transition: none !important } }
18
+ `;
19
+ function RollChar({ c, delay }) {
20
+ if (!/\d/.test(c)) return /* @__PURE__ */ jsx("span", { className: "inline-block", children: c });
21
+ return /* @__PURE__ */ jsx("span", { className: "relative inline-block h-[1em] w-[0.6em] overflow-hidden", children: /* @__PURE__ */ jsx(
22
+ "span",
23
+ {
24
+ className: cx("aui-tiers-move absolute inset-x-0 top-0 flex flex-col transition-transform duration-700", EASE),
25
+ style: { transform: `translateY(${-Number(c) * 10}%)`, transitionDelay: `${delay}ms` },
26
+ children: Array.from({ length: 10 }, (_, n) => /* @__PURE__ */ jsx("span", { className: "block h-[1em] text-center leading-[1em]", children: n }, n))
27
+ }
28
+ ) });
29
+ }
30
+ function Roll({ text }) {
31
+ const chars = text.split("");
32
+ return /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "inline-flex tabular-nums", children: chars.map((c, i) => /* @__PURE__ */ jsx(RollChar, { c, delay: (chars.length - 1 - i) * 60 }, chars.length - i)) });
33
+ }
34
+ function Level({ level, on }) {
35
+ return /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "flex h-4 items-end gap-[2px]", children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsx(
36
+ "span",
37
+ {
38
+ className: cx("block w-[3px] rounded-[1px] transition-colors duration-500", i < level ? on ? "bg-brand" : "bg-ink" : "bg-ink/15"),
39
+ style: { height: `${40 + i * 20}%`, transitionDelay: on ? `${i * 50}ms` : "0ms" }
40
+ },
41
+ i
42
+ )) });
43
+ }
44
+ function PricingTiers({
45
+ tiers = TIERS,
46
+ title = "Choose a plan",
47
+ subtitle = "Astabyte \xB7 12 members",
48
+ initials = "NS",
49
+ currency = "$",
50
+ period = "/ mo",
51
+ defaultValue,
52
+ onChange,
53
+ onContinue,
54
+ ctaLabel = "Continue",
55
+ hint = false,
56
+ className
57
+ }) {
58
+ const [value, setValue] = useState(defaultValue ?? tiers[1]?.id ?? tiers[0]?.id ?? "");
59
+ const list = useRef(null);
60
+ const rows = useRef({});
61
+ const touched = useRef(false);
62
+ const [ring, setRing] = useState({ y: 0, h: 0, ready: false });
63
+ const [armed, setArmed] = useState(false);
64
+ const measure = useCallback(() => {
65
+ const el = rows.current[value];
66
+ if (el) setRing({ y: el.offsetTop, h: el.offsetHeight, ready: true });
67
+ }, [value]);
68
+ useLayoutEffect(() => {
69
+ measure();
70
+ }, [measure]);
71
+ useLayoutEffect(() => {
72
+ const el = list.current;
73
+ if (!el || typeof ResizeObserver === "undefined") return;
74
+ const ro = new ResizeObserver(() => measure());
75
+ ro.observe(el);
76
+ return () => ro.disconnect();
77
+ }, [measure]);
78
+ useEffect(() => {
79
+ const t = setTimeout(() => setArmed(true), 50);
80
+ return () => clearTimeout(t);
81
+ }, []);
82
+ useEffect(() => {
83
+ if (!hint || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
84
+ const start = tiers.findIndex((t) => t.id === (defaultValue ?? tiers[1]?.id));
85
+ const next = tiers[(start + 1) % tiers.length]?.id;
86
+ const back = tiers[start]?.id;
87
+ if (!next || !back) return;
88
+ const a = setTimeout(() => !touched.current && setValue(next), 1300);
89
+ const b = setTimeout(() => !touched.current && setValue(back), 2300);
90
+ return () => {
91
+ clearTimeout(a);
92
+ clearTimeout(b);
93
+ };
94
+ }, [hint, tiers, defaultValue]);
95
+ function choose(id, focus = false) {
96
+ touched.current = true;
97
+ setValue(id);
98
+ onChange?.(id);
99
+ if (focus) rows.current[id]?.focus();
100
+ }
101
+ function onKey(e, i) {
102
+ const n = tiers.length;
103
+ let j = -1;
104
+ if (e.key === "ArrowDown" || e.key === "ArrowRight") j = (i + 1) % n;
105
+ else if (e.key === "ArrowUp" || e.key === "ArrowLeft") j = (i - 1 + n) % n;
106
+ else if (e.key === "Home") j = 0;
107
+ else if (e.key === "End") j = n - 1;
108
+ if (j < 0) return;
109
+ e.preventDefault();
110
+ const t = tiers[j];
111
+ if (t) choose(t.id, true);
112
+ }
113
+ const index = Math.max(0, tiers.findIndex((t) => t.id === value));
114
+ const current = tiers[index];
115
+ const rise = (n) => ({ animationDelay: `${80 + n * 55}ms` });
116
+ return /* @__PURE__ */ jsxs(
117
+ "div",
118
+ {
119
+ className: cx(
120
+ "w-full max-w-[460px] rounded-[16px] bg-paper p-2 text-ink shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_1px_2px_rgb(0_0_0/0.04),0_24px_48px_-24px_rgb(0_0_0/0.35)]",
121
+ className
122
+ ),
123
+ children: [
124
+ /* @__PURE__ */ jsxs("div", { className: "aui-tiers-rise flex items-center gap-3 px-4 pb-4 pt-4", style: rise(0), children: [
125
+ initials && /* @__PURE__ */ jsx("span", { className: "grid h-9 w-9 shrink-0 place-items-center rounded-full bg-ink text-[12px] font-semibold tracking-[0.02em] text-paper", children: initials }),
126
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
127
+ /* @__PURE__ */ jsx("h3", { className: "text-[20px] font-medium leading-tight tracking-[-0.02em]", children: title }),
128
+ subtitle && /* @__PURE__ */ jsx("p", { className: "mt-0.5 truncate text-[13px] text-mute", children: subtitle })
129
+ ] })
130
+ ] }),
131
+ /* @__PURE__ */ jsxs("div", { ref: list, role: "radiogroup", "aria-label": title, className: "relative flex flex-col gap-1", children: [
132
+ /* @__PURE__ */ jsx(
133
+ "span",
134
+ {
135
+ "aria-hidden": true,
136
+ className: cx(
137
+ "aui-tiers-move pointer-events-none absolute inset-x-0 top-0 rounded-[11px] shadow-[inset_0_0_0_1.5px_var(--brand),0_10px_24px_-14px_var(--brand)]",
138
+ armed && "transition-transform duration-[600ms]",
139
+ EASE,
140
+ ring.ready ? "opacity-100" : "opacity-0"
141
+ ),
142
+ style: { transform: `translateY(${ring.y}px)`, height: ring.h, background: "color-mix(in srgb, var(--brand) 5%, var(--paper))" }
143
+ }
144
+ ),
145
+ tiers.map((t, i) => {
146
+ const on = t.id === value;
147
+ return /* @__PURE__ */ jsxs(
148
+ "button",
149
+ {
150
+ ref: (el) => {
151
+ rows.current[t.id] = el;
152
+ },
153
+ type: "button",
154
+ role: "radio",
155
+ "aria-checked": on,
156
+ tabIndex: on ? 0 : -1,
157
+ onClick: () => choose(t.id),
158
+ onKeyDown: (e) => onKey(e, i),
159
+ className: cx(
160
+ "aui-tiers-rise group relative flex w-full items-center gap-3.5 rounded-[11px] px-4 py-3.5 text-left outline-none transition-[background-color,transform] duration-300 active:scale-[.99] focus-visible:ring-2 focus-visible:ring-brand/40 focus-visible:ring-offset-2 focus-visible:ring-offset-paper",
161
+ EASE,
162
+ !on && "hover:bg-ink/[0.03]"
163
+ ),
164
+ style: rise(1 + i),
165
+ children: [
166
+ /* @__PURE__ */ jsx(Level, { level: Math.min(4, i + 1), on }),
167
+ /* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
168
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-[14.5px] font-medium tracking-[-0.01em]", children: [
169
+ t.name,
170
+ t.tag && /* @__PURE__ */ jsx("span", { className: "rounded-[4px] bg-brand px-1.5 text-[10.5px] font-medium leading-[18px] text-white", children: t.tag })
171
+ ] }),
172
+ /* @__PURE__ */ jsx("span", { className: "mt-0.5 block truncate text-[13px] text-mute", children: t.description })
173
+ ] }),
174
+ /* @__PURE__ */ jsxs("span", { className: cx("shrink-0 text-right transition-transform duration-500", EASE, on ? "-translate-x-0.5" : "translate-x-0"), children: [
175
+ /* @__PURE__ */ jsx("span", { className: "text-[16px] font-medium tracking-[-0.03em] tabular-nums", children: t.price === 0 ? "Free" : `${currency}${t.price}` }),
176
+ t.price > 0 && /* @__PURE__ */ jsx("span", { className: "ml-1 text-[12px] text-mute", children: period })
177
+ ] })
178
+ ]
179
+ },
180
+ t.id
181
+ );
182
+ })
183
+ ] }),
184
+ /* @__PURE__ */ jsxs("div", { className: "aui-tiers-rise mt-2 flex items-center justify-between gap-4 rounded-[12px] bg-ink px-4 py-3.5 text-paper", style: rise(2 + tiers.length), children: [
185
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", "aria-live": "polite", children: [
186
+ /* @__PURE__ */ jsx("p", { className: "font-mono text-[10.5px] uppercase tracking-[0.08em] text-paper/50", children: "Due today" }),
187
+ /* @__PURE__ */ jsxs("p", { className: "mt-1 flex items-start font-medium leading-none tracking-[-0.04em]", children: [
188
+ /* @__PURE__ */ jsx("span", { className: "mr-0.5 mt-0.5 text-[14px] text-paper/70", children: currency }),
189
+ /* @__PURE__ */ jsx("span", { className: "text-[28px]", children: /* @__PURE__ */ jsx(Roll, { text: String(current?.price ?? 0) }) }),
190
+ /* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
191
+ current?.name,
192
+ ", ",
193
+ currency,
194
+ current?.price,
195
+ " ",
196
+ period
197
+ ] }),
198
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ml-2 self-end pb-0.5 text-[12px] font-normal tracking-normal text-paper/50", children: /* @__PURE__ */ jsxs("span", { className: "aui-tiers-rise inline-block", children: [
199
+ current?.name,
200
+ " ",
201
+ period
202
+ ] }, current?.id) })
203
+ ] })
204
+ ] }),
205
+ /* @__PURE__ */ jsxs(
206
+ "button",
207
+ {
208
+ type: "button",
209
+ onClick: () => current && onContinue?.(current.id),
210
+ className: cx(
211
+ "group inline-flex h-10 shrink-0 items-center justify-center gap-1.5 rounded-[8px] bg-brand px-4 text-[13.5px] font-medium text-white shadow-[0_10px_24px_-12px_var(--brand)] outline-none transition-transform duration-300 hover:-translate-y-px active:translate-y-0 active:scale-[.97] focus-visible:ring-2 focus-visible:ring-brand/60 focus-visible:ring-offset-2 focus-visible:ring-offset-ink",
212
+ EASE
213
+ ),
214
+ children: [
215
+ ctaLabel,
216
+ /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: cx("h-3.5 w-3.5 transition-transform duration-300 group-hover:translate-x-0.5", EASE), fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M3 8h10M9 4l4 4-4 4" }) })
217
+ ]
218
+ }
219
+ )
220
+ ] }),
221
+ /* @__PURE__ */ jsx("style", { href: "asta-pricing-aui-024", precedence: "asta", children: CSS })
222
+ ]
223
+ }
224
+ );
225
+ }
226
+ var pricing_aui_024_default = PricingTiers;
227
+
228
+ export {
229
+ PricingTiers,
230
+ pricing_aui_024_default
231
+ };