@nous-research/ui 0.13.2 → 0.14.1

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 (320) hide show
  1. package/README.md +16 -0
  2. package/dist/assets/filler-bg0.webp +0 -0
  3. package/dist/assets.d.ts +38 -0
  4. package/dist/fonts.d.ts +0 -1
  5. package/dist/fonts.js +5 -7
  6. package/dist/hooks/use-capped-frame.d.ts +0 -1
  7. package/dist/hooks/use-capped-frame.js +12 -13
  8. package/dist/hooks/use-css-var-dims.d.ts +0 -1
  9. package/dist/hooks/use-css-var-dims.js +26 -21
  10. package/dist/hooks/use-gpu-tier.d.ts +0 -1
  11. package/dist/hooks/use-gpu-tier.js +90 -110
  12. package/dist/hooks/use-render-loop.d.ts +0 -1
  13. package/dist/hooks/use-render-loop.js +58 -58
  14. package/dist/hooks/use-smooth-controls.d.ts +0 -1
  15. package/dist/hooks/use-smooth-controls.js +204 -206
  16. package/dist/index.d.ts +0 -1
  17. package/dist/index.js +84 -58
  18. package/dist/ui/basic-page.d.ts +1 -2
  19. package/dist/ui/basic-page.js +15 -7
  20. package/dist/ui/build.css +1 -0
  21. package/dist/ui/components/animated-count.d.ts +1 -2
  22. package/dist/ui/components/animated-count.js +109 -85
  23. package/dist/ui/components/ascii.d.ts +2 -3
  24. package/dist/ui/components/ascii.js +75 -59
  25. package/dist/ui/components/badge.d.ts +1 -2
  26. package/dist/ui/components/badge.js +35 -18
  27. package/dist/ui/components/badges/nous-girl.d.ts +1 -2
  28. package/dist/ui/components/badges/nous-girl.js +80 -3
  29. package/dist/ui/components/blend-mode.d.ts +1 -2
  30. package/dist/ui/components/blend-mode.js +55 -63
  31. package/dist/ui/components/blink.d.ts +1 -2
  32. package/dist/ui/components/blink.js +15 -6
  33. package/dist/ui/components/button.d.ts +2 -3
  34. package/dist/ui/components/button.js +139 -90
  35. package/dist/ui/components/command-block.d.ts +2 -3
  36. package/dist/ui/components/command-block.js +52 -24
  37. package/dist/ui/components/cursor.d.ts +1 -2
  38. package/dist/ui/components/cursor.js +93 -54
  39. package/dist/ui/components/dropdown-menu.d.ts +1 -2
  40. package/dist/ui/components/dropdown-menu.js +99 -51
  41. package/dist/ui/components/fit-text/index.d.ts +0 -1
  42. package/dist/ui/components/fit-text/index.js +21 -13
  43. package/dist/ui/components/graphs/bar-chart.d.ts +1 -2
  44. package/dist/ui/components/graphs/bar-chart.js +116 -63
  45. package/dist/ui/components/graphs/index.d.ts +0 -1
  46. package/dist/ui/components/graphs/index.js +3 -4
  47. package/dist/ui/components/graphs/line-chart.d.ts +1 -2
  48. package/dist/ui/components/graphs/line-chart.js +159 -102
  49. package/dist/ui/components/graphs/utils.d.ts +2 -3
  50. package/dist/ui/components/graphs/utils.js +147 -114
  51. package/dist/ui/components/grid/index.d.ts +0 -1
  52. package/dist/ui/components/grid/index.js +12 -9
  53. package/dist/ui/components/hover-bg.d.ts +0 -1
  54. package/dist/ui/components/hover-bg.js +11 -6
  55. package/dist/ui/components/icons/arrow.d.ts +1 -2
  56. package/dist/ui/components/icons/arrow.js +42 -5
  57. package/dist/ui/components/icons/chevron.d.ts +1 -2
  58. package/dist/ui/components/icons/chevron.js +49 -5
  59. package/dist/ui/components/icons/discord.d.ts +1 -2
  60. package/dist/ui/components/icons/discord.js +12 -4
  61. package/dist/ui/components/icons/eye.d.ts +1 -2
  62. package/dist/ui/components/icons/eye.js +5 -3
  63. package/dist/ui/components/icons/gear.d.ts +1 -2
  64. package/dist/ui/components/icons/gear.js +28 -14
  65. package/dist/ui/components/icons/github.d.ts +1 -2
  66. package/dist/ui/components/icons/github.js +12 -4
  67. package/dist/ui/components/icons/hamburger.d.ts +1 -2
  68. package/dist/ui/components/icons/hamburger.js +54 -5
  69. package/dist/ui/components/icons/heart.d.ts +1 -2
  70. package/dist/ui/components/icons/heart.js +8 -3
  71. package/dist/ui/components/icons/index.d.ts +0 -1
  72. package/dist/ui/components/icons/index.js +11 -12
  73. package/dist/ui/components/icons/link.d.ts +1 -2
  74. package/dist/ui/components/icons/link.js +10 -3
  75. package/dist/ui/components/icons/minus.d.ts +1 -2
  76. package/dist/ui/components/icons/minus.js +10 -3
  77. package/dist/ui/components/icons/search.d.ts +1 -2
  78. package/dist/ui/components/icons/search.js +30 -3
  79. package/dist/ui/components/image-distortion.d.ts +1 -2
  80. package/dist/ui/components/image-distortion.js +300 -265
  81. package/dist/ui/components/leva-client.d.ts +1 -2
  82. package/dist/ui/components/leva-client.js +9 -10
  83. package/dist/ui/components/list-item.d.ts +0 -1
  84. package/dist/ui/components/list-item.js +26 -10
  85. package/dist/ui/components/modal/index.d.ts +1 -2
  86. package/dist/ui/components/modal/index.js +33 -14
  87. package/dist/ui/components/overlays/blend-modes.d.ts +0 -1
  88. package/dist/ui/components/overlays/blend-modes.js +11 -12
  89. package/dist/ui/components/overlays/glitch.d.ts +1 -2
  90. package/dist/ui/components/overlays/glitch.js +115 -110
  91. package/dist/ui/components/overlays/greys.d.ts +1 -2
  92. package/dist/ui/components/overlays/greys.js +200 -179
  93. package/dist/ui/components/overlays/index.d.ts +1 -2
  94. package/dist/ui/components/overlays/index.js +31 -17
  95. package/dist/ui/components/overlays/lens-layers.d.ts +1 -2
  96. package/dist/ui/components/overlays/lens-layers.js +89 -65
  97. package/dist/ui/components/overlays/lens.d.ts +0 -1
  98. package/dist/ui/components/overlays/lens.js +46 -52
  99. package/dist/ui/components/overlays/noise.d.ts +1 -2
  100. package/dist/ui/components/overlays/noise.js +112 -113
  101. package/dist/ui/components/overlays/vignette.d.ts +1 -2
  102. package/dist/ui/components/overlays/vignette.js +44 -38
  103. package/dist/ui/components/poster.d.ts +1 -2
  104. package/dist/ui/components/poster.js +240 -87
  105. package/dist/ui/components/progress.d.ts +1 -2
  106. package/dist/ui/components/progress.js +52 -12
  107. package/dist/ui/components/scene-canvas.d.ts +1 -2
  108. package/dist/ui/components/scene-canvas.js +169 -119
  109. package/dist/ui/components/scramble.d.ts +1 -2
  110. package/dist/ui/components/scramble.js +60 -59
  111. package/dist/ui/components/segmented.d.ts +2 -3
  112. package/dist/ui/components/segmented.js +47 -12
  113. package/dist/ui/components/select.d.ts +1 -2
  114. package/dist/ui/components/select.js +207 -120
  115. package/dist/ui/components/selection-switcher.d.ts +0 -1
  116. package/dist/ui/components/selection-switcher.js +29 -25
  117. package/dist/ui/components/shader.d.ts +1 -2
  118. package/dist/ui/components/shader.js +56 -38
  119. package/dist/ui/components/socials.d.ts +1 -2
  120. package/dist/ui/components/socials.js +18 -7
  121. package/dist/ui/components/spinner.d.ts +1 -2
  122. package/dist/ui/components/spinner.js +36 -25
  123. package/dist/ui/components/stats.d.ts +1 -2
  124. package/dist/ui/components/stats.js +33 -9
  125. package/dist/ui/components/switch.d.ts +0 -1
  126. package/dist/ui/components/switch.js +35 -11
  127. package/dist/ui/components/tabs.d.ts +3 -4
  128. package/dist/ui/components/tabs.js +38 -12
  129. package/dist/ui/components/terminal-demo.d.ts +1 -2
  130. package/dist/ui/components/terminal-demo.js +119 -74
  131. package/dist/ui/components/theme-toggle.d.ts +1 -2
  132. package/dist/ui/components/theme-toggle.js +63 -8
  133. package/dist/ui/components/tier-card.d.ts +1 -2
  134. package/dist/ui/components/tier-card.js +144 -24
  135. package/dist/ui/components/tv.d.ts +1 -2
  136. package/dist/ui/components/tv.js +138 -90
  137. package/dist/ui/components/typography/h1.d.ts +0 -1
  138. package/dist/ui/components/typography/h1.js +17 -8
  139. package/dist/ui/components/typography/h2.d.ts +0 -1
  140. package/dist/ui/components/typography/h2.js +17 -8
  141. package/dist/ui/components/typography/index.d.ts +0 -1
  142. package/dist/ui/components/typography/index.js +35 -24
  143. package/dist/ui/components/typography/legend.d.ts +1 -2
  144. package/dist/ui/components/typography/legend.js +18 -6
  145. package/dist/ui/components/typography/small.d.ts +0 -1
  146. package/dist/ui/components/typography/small.js +8 -7
  147. package/dist/ui/components/watchlist.d.ts +1 -2
  148. package/dist/ui/components/watchlist.js +77 -25
  149. package/dist/ui/fonts.css +7 -7
  150. package/dist/ui/footer.d.ts +1 -2
  151. package/dist/ui/footer.js +61 -25
  152. package/dist/ui/globals.css +5 -1
  153. package/dist/ui/header.d.ts +1 -2
  154. package/dist/ui/header.js +255 -60
  155. package/dist/ui/layout-wrapper.d.ts +1 -2
  156. package/dist/ui/layout-wrapper.js +5 -4
  157. package/dist/utils/color.d.ts +0 -1
  158. package/dist/utils/color.js +8 -9
  159. package/dist/utils/index.d.ts +0 -1
  160. package/dist/utils/index.js +37 -38
  161. package/dist/utils/poly.d.ts +0 -1
  162. package/dist/utils/poly.js +1 -2
  163. package/package.json +42 -24
  164. package/dist/assets/filler-bg0.jpg +0 -0
  165. package/dist/fonts.d.ts.map +0 -1
  166. package/dist/fonts.js.map +0 -1
  167. package/dist/hooks/use-capped-frame.d.ts.map +0 -1
  168. package/dist/hooks/use-capped-frame.js.map +0 -1
  169. package/dist/hooks/use-css-var-dims.d.ts.map +0 -1
  170. package/dist/hooks/use-css-var-dims.js.map +0 -1
  171. package/dist/hooks/use-gpu-tier.d.ts.map +0 -1
  172. package/dist/hooks/use-gpu-tier.js.map +0 -1
  173. package/dist/hooks/use-render-loop.d.ts.map +0 -1
  174. package/dist/hooks/use-render-loop.js.map +0 -1
  175. package/dist/hooks/use-smooth-controls.d.ts.map +0 -1
  176. package/dist/hooks/use-smooth-controls.js.map +0 -1
  177. package/dist/index.d.ts.map +0 -1
  178. package/dist/index.js.map +0 -1
  179. package/dist/ui/basic-page.d.ts.map +0 -1
  180. package/dist/ui/basic-page.js.map +0 -1
  181. package/dist/ui/components/animated-count.d.ts.map +0 -1
  182. package/dist/ui/components/animated-count.js.map +0 -1
  183. package/dist/ui/components/ascii.d.ts.map +0 -1
  184. package/dist/ui/components/ascii.js.map +0 -1
  185. package/dist/ui/components/badge.d.ts.map +0 -1
  186. package/dist/ui/components/badge.js.map +0 -1
  187. package/dist/ui/components/badges/nous-girl.d.ts.map +0 -1
  188. package/dist/ui/components/badges/nous-girl.js.map +0 -1
  189. package/dist/ui/components/blend-mode.d.ts.map +0 -1
  190. package/dist/ui/components/blend-mode.js.map +0 -1
  191. package/dist/ui/components/blink.d.ts.map +0 -1
  192. package/dist/ui/components/blink.js.map +0 -1
  193. package/dist/ui/components/button.d.ts.map +0 -1
  194. package/dist/ui/components/button.js.map +0 -1
  195. package/dist/ui/components/command-block.d.ts.map +0 -1
  196. package/dist/ui/components/command-block.js.map +0 -1
  197. package/dist/ui/components/cursor.d.ts.map +0 -1
  198. package/dist/ui/components/cursor.js.map +0 -1
  199. package/dist/ui/components/dropdown-menu.d.ts.map +0 -1
  200. package/dist/ui/components/dropdown-menu.js.map +0 -1
  201. package/dist/ui/components/fit-text/index.d.ts.map +0 -1
  202. package/dist/ui/components/fit-text/index.js.map +0 -1
  203. package/dist/ui/components/graphs/bar-chart.d.ts.map +0 -1
  204. package/dist/ui/components/graphs/bar-chart.js.map +0 -1
  205. package/dist/ui/components/graphs/index.d.ts.map +0 -1
  206. package/dist/ui/components/graphs/index.js.map +0 -1
  207. package/dist/ui/components/graphs/line-chart.d.ts.map +0 -1
  208. package/dist/ui/components/graphs/line-chart.js.map +0 -1
  209. package/dist/ui/components/graphs/utils.d.ts.map +0 -1
  210. package/dist/ui/components/graphs/utils.js.map +0 -1
  211. package/dist/ui/components/grid/index.d.ts.map +0 -1
  212. package/dist/ui/components/grid/index.js.map +0 -1
  213. package/dist/ui/components/hover-bg.d.ts.map +0 -1
  214. package/dist/ui/components/hover-bg.js.map +0 -1
  215. package/dist/ui/components/icons/arrow.d.ts.map +0 -1
  216. package/dist/ui/components/icons/arrow.js.map +0 -1
  217. package/dist/ui/components/icons/chevron.d.ts.map +0 -1
  218. package/dist/ui/components/icons/chevron.js.map +0 -1
  219. package/dist/ui/components/icons/discord.d.ts.map +0 -1
  220. package/dist/ui/components/icons/discord.js.map +0 -1
  221. package/dist/ui/components/icons/eye.d.ts.map +0 -1
  222. package/dist/ui/components/icons/eye.js.map +0 -1
  223. package/dist/ui/components/icons/gear.d.ts.map +0 -1
  224. package/dist/ui/components/icons/gear.js.map +0 -1
  225. package/dist/ui/components/icons/github.d.ts.map +0 -1
  226. package/dist/ui/components/icons/github.js.map +0 -1
  227. package/dist/ui/components/icons/hamburger.d.ts.map +0 -1
  228. package/dist/ui/components/icons/hamburger.js.map +0 -1
  229. package/dist/ui/components/icons/heart.d.ts.map +0 -1
  230. package/dist/ui/components/icons/heart.js.map +0 -1
  231. package/dist/ui/components/icons/index.d.ts.map +0 -1
  232. package/dist/ui/components/icons/index.js.map +0 -1
  233. package/dist/ui/components/icons/link.d.ts.map +0 -1
  234. package/dist/ui/components/icons/link.js.map +0 -1
  235. package/dist/ui/components/icons/minus.d.ts.map +0 -1
  236. package/dist/ui/components/icons/minus.js.map +0 -1
  237. package/dist/ui/components/icons/search.d.ts.map +0 -1
  238. package/dist/ui/components/icons/search.js.map +0 -1
  239. package/dist/ui/components/image-distortion.d.ts.map +0 -1
  240. package/dist/ui/components/image-distortion.js.map +0 -1
  241. package/dist/ui/components/leva-client.d.ts.map +0 -1
  242. package/dist/ui/components/leva-client.js.map +0 -1
  243. package/dist/ui/components/list-item.d.ts.map +0 -1
  244. package/dist/ui/components/list-item.js.map +0 -1
  245. package/dist/ui/components/modal/index.d.ts.map +0 -1
  246. package/dist/ui/components/modal/index.js.map +0 -1
  247. package/dist/ui/components/overlays/blend-modes.d.ts.map +0 -1
  248. package/dist/ui/components/overlays/blend-modes.js.map +0 -1
  249. package/dist/ui/components/overlays/glitch.d.ts.map +0 -1
  250. package/dist/ui/components/overlays/glitch.js.map +0 -1
  251. package/dist/ui/components/overlays/greys.d.ts.map +0 -1
  252. package/dist/ui/components/overlays/greys.js.map +0 -1
  253. package/dist/ui/components/overlays/index.d.ts.map +0 -1
  254. package/dist/ui/components/overlays/index.js.map +0 -1
  255. package/dist/ui/components/overlays/lens-layers.d.ts.map +0 -1
  256. package/dist/ui/components/overlays/lens-layers.js.map +0 -1
  257. package/dist/ui/components/overlays/lens.d.ts.map +0 -1
  258. package/dist/ui/components/overlays/lens.js.map +0 -1
  259. package/dist/ui/components/overlays/noise.d.ts.map +0 -1
  260. package/dist/ui/components/overlays/noise.js.map +0 -1
  261. package/dist/ui/components/overlays/vignette.d.ts.map +0 -1
  262. package/dist/ui/components/overlays/vignette.js.map +0 -1
  263. package/dist/ui/components/poster.d.ts.map +0 -1
  264. package/dist/ui/components/poster.js.map +0 -1
  265. package/dist/ui/components/progress.d.ts.map +0 -1
  266. package/dist/ui/components/progress.js.map +0 -1
  267. package/dist/ui/components/scene-canvas.d.ts.map +0 -1
  268. package/dist/ui/components/scene-canvas.js.map +0 -1
  269. package/dist/ui/components/scramble.d.ts.map +0 -1
  270. package/dist/ui/components/scramble.js.map +0 -1
  271. package/dist/ui/components/segmented.d.ts.map +0 -1
  272. package/dist/ui/components/segmented.js.map +0 -1
  273. package/dist/ui/components/select.d.ts.map +0 -1
  274. package/dist/ui/components/select.js.map +0 -1
  275. package/dist/ui/components/selection-switcher.d.ts.map +0 -1
  276. package/dist/ui/components/selection-switcher.js.map +0 -1
  277. package/dist/ui/components/shader.d.ts.map +0 -1
  278. package/dist/ui/components/shader.js.map +0 -1
  279. package/dist/ui/components/socials.d.ts.map +0 -1
  280. package/dist/ui/components/socials.js.map +0 -1
  281. package/dist/ui/components/spinner.d.ts.map +0 -1
  282. package/dist/ui/components/spinner.js.map +0 -1
  283. package/dist/ui/components/stats.d.ts.map +0 -1
  284. package/dist/ui/components/stats.js.map +0 -1
  285. package/dist/ui/components/switch.d.ts.map +0 -1
  286. package/dist/ui/components/switch.js.map +0 -1
  287. package/dist/ui/components/tabs.d.ts.map +0 -1
  288. package/dist/ui/components/tabs.js.map +0 -1
  289. package/dist/ui/components/terminal-demo.d.ts.map +0 -1
  290. package/dist/ui/components/terminal-demo.js.map +0 -1
  291. package/dist/ui/components/theme-toggle.d.ts.map +0 -1
  292. package/dist/ui/components/theme-toggle.js.map +0 -1
  293. package/dist/ui/components/tier-card.d.ts.map +0 -1
  294. package/dist/ui/components/tier-card.js.map +0 -1
  295. package/dist/ui/components/tv.d.ts.map +0 -1
  296. package/dist/ui/components/tv.js.map +0 -1
  297. package/dist/ui/components/typography/h1.d.ts.map +0 -1
  298. package/dist/ui/components/typography/h1.js.map +0 -1
  299. package/dist/ui/components/typography/h2.d.ts.map +0 -1
  300. package/dist/ui/components/typography/h2.js.map +0 -1
  301. package/dist/ui/components/typography/index.d.ts.map +0 -1
  302. package/dist/ui/components/typography/index.js.map +0 -1
  303. package/dist/ui/components/typography/legend.d.ts.map +0 -1
  304. package/dist/ui/components/typography/legend.js.map +0 -1
  305. package/dist/ui/components/typography/small.d.ts.map +0 -1
  306. package/dist/ui/components/typography/small.js.map +0 -1
  307. package/dist/ui/components/watchlist.d.ts.map +0 -1
  308. package/dist/ui/components/watchlist.js.map +0 -1
  309. package/dist/ui/footer.d.ts.map +0 -1
  310. package/dist/ui/footer.js.map +0 -1
  311. package/dist/ui/header.d.ts.map +0 -1
  312. package/dist/ui/header.js.map +0 -1
  313. package/dist/ui/layout-wrapper.d.ts.map +0 -1
  314. package/dist/ui/layout-wrapper.js.map +0 -1
  315. package/dist/utils/color.d.ts.map +0 -1
  316. package/dist/utils/color.js.map +0 -1
  317. package/dist/utils/index.d.ts.map +0 -1
  318. package/dist/utils/index.js.map +0 -1
  319. package/dist/utils/poly.d.ts.map +0 -1
  320. package/dist/utils/poly.js.map +0 -1
@@ -1,8 +1,8 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useEffect, useRef, useState } from 'react';
4
- import { useGpuTier } from '../../hooks/use-gpu-tier';
5
- import { cn, hexToRgb } from '../../utils';
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { useGpuTier } from "../../hooks/use-gpu-tier.js";
5
+ import { cn, hexToRgb } from "../../utils/index.js";
6
6
  const NUM_BANDS = 12;
7
7
  const VERT = `attribute vec2 a;varying vec2 vUv;void main(){vUv=vec2(a.x*.5+.5,.5-a.y*.5);gl_Position=vec4(a,0,1);}`;
8
8
  const FRAG = `precision highp float;
@@ -93,269 +93,304 @@ void main(){
93
93
 
94
94
  gl_FragColor=vec4(col,1.0);
95
95
  }`;
96
- /**
97
- * Choreographed motion patterns used when `autoPlay` is set. Each pattern
98
- * returns a synthetic pointer position in [0,1] and a hover intensity in
99
- * [0,1] for the current time (seconds). They drive the shader without
100
- * requiring a real pointer, which is what lets us record the distortion
101
- * as a GIF / screenshot / poster.
102
- */
103
96
  const AUTOPLAY_PATTERNS = {
104
- aggressive: t => {
105
- const cycle = 1.4;
106
- const phase = (t % cycle) / cycle;
107
- const stab = Math.exp(-((phase - 0.15) ** 2) * 260);
108
- const angle = Math.floor(t / cycle) * 1.37;
109
- const mx = 0.5 + Math.cos(angle) * 0.42 * (stab + 0.15);
110
- const my = 0.5 + Math.sin(angle) * 0.38 * (stab + 0.15);
111
- return { hover: 0.55 + stab * 0.45, mx, my };
112
- },
113
- gentle: t => ({
114
- hover: 0.45 + Math.sin(t * 0.9) * 0.1,
115
- mx: 0.5 + Math.sin(t * 0.5) * 0.28,
116
- my: 0.5 + Math.cos(t * 0.37) * 0.22
117
- }),
118
- slash: t => {
119
- // Long breath -> sword slash -> recoil twitch, repeating.
120
- const cycle = 3.6;
121
- const phase = (t % cycle) / cycle;
122
- const slash = Math.exp(-((phase - 0.28) ** 2) * 180);
123
- const micro = Math.exp(-((phase - 0.7) ** 2) * 340);
124
- const driftX = 0.5 + Math.sin(t * 0.7) * 0.16;
125
- const driftY = 0.55 + Math.cos(t * 0.5) * 0.14;
126
- // Slash trajectory: bottom-left up into the giant's chest (top-right).
127
- const slashX = -0.15 + phase * 1.55;
128
- const slashY = 0.95 - phase * 1.35;
129
- const mx = driftX * (1 - slash) + slashX * slash;
130
- const my = driftY * (1 - slash) + slashY * slash;
131
- return { hover: 0.5 + slash * 0.5 + micro * 0.35, mx, my };
132
- }
97
+ aggressive: (t) => {
98
+ const cycle = 1.4;
99
+ const phase = t % cycle / cycle;
100
+ const stab = Math.exp(-((phase - 0.15) ** 2) * 260);
101
+ const angle = Math.floor(t / cycle) * 1.37;
102
+ const mx = 0.5 + Math.cos(angle) * 0.42 * (stab + 0.15);
103
+ const my = 0.5 + Math.sin(angle) * 0.38 * (stab + 0.15);
104
+ return { hover: 0.55 + stab * 0.45, mx, my };
105
+ },
106
+ gentle: (t) => ({
107
+ hover: 0.45 + Math.sin(t * 0.9) * 0.1,
108
+ mx: 0.5 + Math.sin(t * 0.5) * 0.28,
109
+ my: 0.5 + Math.cos(t * 0.37) * 0.22
110
+ }),
111
+ slash: (t) => {
112
+ const cycle = 3.6;
113
+ const phase = t % cycle / cycle;
114
+ const slash = Math.exp(-((phase - 0.28) ** 2) * 180);
115
+ const micro = Math.exp(-((phase - 0.7) ** 2) * 340);
116
+ const driftX = 0.5 + Math.sin(t * 0.7) * 0.16;
117
+ const driftY = 0.55 + Math.cos(t * 0.5) * 0.14;
118
+ const slashX = -0.15 + phase * 1.55;
119
+ const slashY = 0.95 - phase * 1.35;
120
+ const mx = driftX * (1 - slash) + slashX * slash;
121
+ const my = driftY * (1 - slash) + slashY * slash;
122
+ return { hover: 0.5 + slash * 0.5 + micro * 0.35, mx, my };
123
+ }
133
124
  };
134
- export function ImageDistortion({ active = true, autoPlay, className, fallbackClassName, src, style, tint, tintStrength }) {
135
- const canvasRef = useRef(null);
136
- const tier = useGpuTier();
137
- const [loaded, setLoaded] = useState(false);
138
- const activeRef = useRef(active);
139
- activeRef.current = active;
140
- const tintStrengthRef = useRef(tintStrength);
141
- tintStrengthRef.current = tintStrength;
142
- const autoPlayRef = useRef(autoPlay);
143
- autoPlayRef.current = autoPlay;
144
- const state = useRef({
145
- bandTargets: new Float32Array(NUM_BANDS),
146
- bands: new Float32Array(NUM_BANDS),
147
- hoverTarget: 0,
148
- imgH: 1,
149
- imgW: 1,
150
- mx: 0.5,
151
- my: 0.5,
152
- prevMx: 0.5,
153
- prevMy: 0.5,
154
- vx: 0,
155
- vy: 0
156
- });
157
- useEffect(() => {
158
- if (tier === 0) {
159
- return;
160
- }
161
- const c = canvasRef.current;
162
- if (!c) {
163
- return;
164
- }
165
- const gl = c.getContext('webgl');
166
- if (!gl) {
167
- return;
168
- }
169
- const compile = (type, source) => {
170
- const s = gl.createShader(type);
171
- gl.shaderSource(s, source);
172
- gl.compileShader(s);
173
- return s;
174
- };
175
- const prog = gl.createProgram();
176
- gl.attachShader(prog, compile(gl.VERTEX_SHADER, VERT));
177
- gl.attachShader(prog, compile(gl.FRAGMENT_SHADER, FRAG));
178
- gl.linkProgram(prog);
179
- gl.useProgram(prog);
180
- gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
181
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), gl.STATIC_DRAW);
182
- const a = gl.getAttribLocation(prog, 'a');
183
- gl.enableVertexAttribArray(a);
184
- gl.vertexAttribPointer(a, 2, gl.FLOAT, false, 0, 0);
185
- const uT = gl.getUniformLocation(prog, 't');
186
- const uR = gl.getUniformLocation(prog, 'r');
187
- const uImgSize = gl.getUniformLocation(prog, 'imgSize');
188
- const uVel = gl.getUniformLocation(prog, 'vel');
189
- const uTex = gl.getUniformLocation(prog, 'tex');
190
- const uTint = gl.getUniformLocation(prog, 'tint');
191
- const uTintStrength = gl.getUniformLocation(prog, 'tintStrength');
192
- const uBands = [];
193
- for (let i = 0; i < NUM_BANDS; i++) {
194
- uBands.push(gl.getUniformLocation(prog, `bands[${i}]`));
195
- }
196
- const texture = gl.createTexture();
197
- gl.bindTexture(gl.TEXTURE_2D, texture);
198
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
199
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
200
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
201
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
202
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0, 0, 0, 255]));
203
- const img = new Image();
204
- img.crossOrigin = 'anonymous';
205
- img.onload = () => {
206
- state.current.imgW = img.naturalWidth;
207
- state.current.imgH = img.naturalHeight;
208
- gl.bindTexture(gl.TEXTURE_2D, texture);
209
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);
210
- setLoaded(true);
211
- };
212
- img.src = src;
213
- gl.activeTexture(gl.TEXTURE0);
214
- gl.bindTexture(gl.TEXTURE_2D, texture);
215
- gl.uniform1i(uTex, 0);
216
- const resize = () => {
217
- const rect = c.getBoundingClientRect();
218
- const dpr = Math.min(devicePixelRatio, 2);
219
- c.width = rect.width * dpr;
220
- c.height = rect.height * dpr;
221
- gl.viewport(0, 0, c.width, c.height);
222
- };
223
- resize();
224
- const ro = new ResizeObserver(resize);
225
- ro.observe(c);
226
- const onMove = (e) => {
227
- const rect = c.getBoundingClientRect();
228
- state.current.mx = (e.clientX - rect.left) / rect.width;
229
- state.current.my = (e.clientY - rect.top) / rect.height;
230
- };
231
- const onEnter = () => {
232
- state.current.hoverTarget = 1;
233
- };
234
- const onLeave = () => {
235
- state.current.hoverTarget = 0;
236
- };
237
- // When autoPlay drives the distortion we want the poster to look
238
- // alive regardless of whether a pointer is near the canvas, so we
239
- // skip the real pointer listeners entirely.
240
- if (!autoPlayRef.current) {
241
- c.addEventListener('pointermove', onMove);
242
- c.addEventListener('pointerenter', onEnter);
243
- c.addEventListener('pointerleave', onLeave);
125
+ export function ImageDistortion({
126
+ active = true,
127
+ autoPlay,
128
+ className,
129
+ fallbackClassName,
130
+ src,
131
+ style,
132
+ tint,
133
+ tintStrength
134
+ }) {
135
+ const canvasRef = useRef(null);
136
+ const tier = useGpuTier();
137
+ const [loaded, setLoaded] = useState(false);
138
+ const activeRef = useRef(active);
139
+ activeRef.current = active;
140
+ const tintStrengthRef = useRef(tintStrength);
141
+ tintStrengthRef.current = tintStrength;
142
+ const autoPlayRef = useRef(autoPlay);
143
+ autoPlayRef.current = autoPlay;
144
+ const state = useRef({
145
+ bandTargets: new Float32Array(NUM_BANDS),
146
+ bands: new Float32Array(NUM_BANDS),
147
+ hoverTarget: 0,
148
+ imgH: 1,
149
+ imgW: 1,
150
+ mx: 0.5,
151
+ my: 0.5,
152
+ prevMx: 0.5,
153
+ prevMy: 0.5,
154
+ vx: 0,
155
+ vy: 0
156
+ });
157
+ useEffect(() => {
158
+ if (tier === 0) {
159
+ return;
160
+ }
161
+ const c = canvasRef.current;
162
+ if (!c) {
163
+ return;
164
+ }
165
+ const gl = c.getContext("webgl");
166
+ if (!gl) {
167
+ return;
168
+ }
169
+ const compile = (type, source) => {
170
+ const s = gl.createShader(type);
171
+ gl.shaderSource(s, source);
172
+ gl.compileShader(s);
173
+ return s;
174
+ };
175
+ const prog = gl.createProgram();
176
+ gl.attachShader(prog, compile(gl.VERTEX_SHADER, VERT));
177
+ gl.attachShader(prog, compile(gl.FRAGMENT_SHADER, FRAG));
178
+ gl.linkProgram(prog);
179
+ gl.useProgram(prog);
180
+ gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
181
+ gl.bufferData(
182
+ gl.ARRAY_BUFFER,
183
+ new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]),
184
+ gl.STATIC_DRAW
185
+ );
186
+ const a = gl.getAttribLocation(prog, "a");
187
+ gl.enableVertexAttribArray(a);
188
+ gl.vertexAttribPointer(a, 2, gl.FLOAT, false, 0, 0);
189
+ const uT = gl.getUniformLocation(prog, "t");
190
+ const uR = gl.getUniformLocation(prog, "r");
191
+ const uImgSize = gl.getUniformLocation(prog, "imgSize");
192
+ const uVel = gl.getUniformLocation(prog, "vel");
193
+ const uTex = gl.getUniformLocation(prog, "tex");
194
+ const uTint = gl.getUniformLocation(prog, "tint");
195
+ const uTintStrength = gl.getUniformLocation(prog, "tintStrength");
196
+ const uBands = [];
197
+ for (let i = 0; i < NUM_BANDS; i++) {
198
+ uBands.push(gl.getUniformLocation(prog, `bands[${i}]`));
199
+ }
200
+ const texture = gl.createTexture();
201
+ gl.bindTexture(gl.TEXTURE_2D, texture);
202
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
203
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
204
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
205
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
206
+ gl.texImage2D(
207
+ gl.TEXTURE_2D,
208
+ 0,
209
+ gl.RGBA,
210
+ 1,
211
+ 1,
212
+ 0,
213
+ gl.RGBA,
214
+ gl.UNSIGNED_BYTE,
215
+ new Uint8Array([0, 0, 0, 255])
216
+ );
217
+ const img = new Image();
218
+ img.crossOrigin = "anonymous";
219
+ img.onload = () => {
220
+ state.current.imgW = img.naturalWidth;
221
+ state.current.imgH = img.naturalHeight;
222
+ gl.bindTexture(gl.TEXTURE_2D, texture);
223
+ gl.texImage2D(
224
+ gl.TEXTURE_2D,
225
+ 0,
226
+ gl.RGBA,
227
+ gl.RGBA,
228
+ gl.UNSIGNED_BYTE,
229
+ img
230
+ );
231
+ setLoaded(true);
232
+ };
233
+ img.src = src;
234
+ gl.activeTexture(gl.TEXTURE0);
235
+ gl.bindTexture(gl.TEXTURE_2D, texture);
236
+ gl.uniform1i(uTex, 0);
237
+ const resize = () => {
238
+ const rect = c.getBoundingClientRect();
239
+ const dpr = Math.min(devicePixelRatio, 2);
240
+ c.width = rect.width * dpr;
241
+ c.height = rect.height * dpr;
242
+ gl.viewport(0, 0, c.width, c.height);
243
+ };
244
+ resize();
245
+ const ro = new ResizeObserver(resize);
246
+ ro.observe(c);
247
+ const onMove = (e) => {
248
+ const rect = c.getBoundingClientRect();
249
+ state.current.mx = (e.clientX - rect.left) / rect.width;
250
+ state.current.my = (e.clientY - rect.top) / rect.height;
251
+ };
252
+ const onEnter = () => {
253
+ state.current.hoverTarget = 1;
254
+ };
255
+ const onLeave = () => {
256
+ state.current.hoverTarget = 0;
257
+ };
258
+ if (!autoPlayRef.current) {
259
+ c.addEventListener("pointermove", onMove);
260
+ c.addEventListener("pointerenter", onEnter);
261
+ c.addEventListener("pointerleave", onLeave);
262
+ }
263
+ const bandEaseRates = new Float32Array(NUM_BANDS);
264
+ for (let i = 0; i < NUM_BANDS; i++) {
265
+ bandEaseRates[i] = 0.02 + Math.random() * 0.06;
266
+ }
267
+ const tintVec = tint ? (() => {
268
+ const [tr, tg, tb] = hexToRgb(tint);
269
+ return [tr / 255, tg / 255, tb / 255];
270
+ })() : [1, 1, 1];
271
+ const t0 = performance.now();
272
+ let raf = 0;
273
+ let visible = !document.hidden;
274
+ let inView = true;
275
+ const loop = () => {
276
+ raf = requestAnimationFrame(loop);
277
+ const s = state.current;
278
+ const pattern = autoPlayRef.current ? AUTOPLAY_PATTERNS[autoPlayRef.current] : null;
279
+ if (pattern) {
280
+ const driven = pattern((performance.now() - t0) / 1e3);
281
+ s.mx = driven.mx;
282
+ s.my = driven.my;
283
+ s.hoverTarget = driven.hover;
284
+ }
285
+ const dvx = s.mx - s.prevMx;
286
+ const dvy = s.my - s.prevMy;
287
+ s.vx += (dvx * 8 - s.vx) * 0.1;
288
+ s.vy += (dvy * 8 - s.vy) * 0.1;
289
+ s.prevMx = s.mx;
290
+ s.prevMy = s.my;
291
+ const speed = Math.sqrt(s.vx * s.vx + s.vy * s.vy);
292
+ for (let i = 0; i < NUM_BANDS; i++) {
293
+ const bandCenter = (i + 0.5) / NUM_BANDS;
294
+ const dist = Math.abs(s.my - bandCenter);
295
+ const proximity = Math.max(0, 1 - dist / 0.3);
296
+ const activation = s.hoverTarget * proximity * (0.4 + Math.min(speed, 1) * 0.6);
297
+ s.bandTargets[i] = activation;
298
+ }
299
+ for (let i = 0; i < NUM_BANDS; i++) {
300
+ const rate = bandEaseRates[i];
301
+ const current = s.bands[i] ?? 0;
302
+ const target = s.bandTargets[i] ?? 0;
303
+ s.bands[i] = current + (target - current) * rate;
304
+ if (s.bands[i] < 1e-3) {
305
+ s.bands[i] = 0;
244
306
  }
245
- const bandEaseRates = new Float32Array(NUM_BANDS);
246
- for (let i = 0; i < NUM_BANDS; i++) {
247
- bandEaseRates[i] = 0.02 + Math.random() * 0.06;
307
+ }
308
+ gl.uniform1f(uT, (performance.now() - t0) / 1e3);
309
+ gl.uniform2f(uR, c.width, c.height);
310
+ gl.uniform2f(uImgSize, s.imgW, s.imgH);
311
+ gl.uniform2f(uVel, s.vx, s.vy);
312
+ gl.uniform3f(uTint, tintVec[0], tintVec[1], tintVec[2]);
313
+ const ts = tintStrengthRef.current;
314
+ const defaultStrength = tint ? 0.35 : 0;
315
+ const defaultInactive = tint ? 0.15 : 0;
316
+ gl.uniform1f(
317
+ uTintStrength,
318
+ activeRef.current ? ts?.active ?? defaultStrength : ts?.inactive ?? defaultInactive
319
+ );
320
+ for (let i = 0; i < NUM_BANDS; i++) {
321
+ gl.uniform1f(uBands[i], s.bands[i]);
322
+ }
323
+ gl.bindTexture(gl.TEXTURE_2D, texture);
324
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
325
+ };
326
+ const start = () => {
327
+ if (visible && inView && !raf) {
328
+ raf = requestAnimationFrame(loop);
329
+ }
330
+ };
331
+ const stop = () => {
332
+ if (raf) {
333
+ cancelAnimationFrame(raf);
334
+ raf = 0;
335
+ }
336
+ };
337
+ const onVisibility = () => {
338
+ visible = !document.hidden;
339
+ visible ? start() : stop();
340
+ };
341
+ const io = new IntersectionObserver(
342
+ (entries) => {
343
+ inView = entries.some((e) => e.isIntersecting);
344
+ inView ? start() : stop();
345
+ },
346
+ { threshold: 0 }
347
+ );
348
+ io.observe(c);
349
+ document.addEventListener("visibilitychange", onVisibility);
350
+ start();
351
+ return () => {
352
+ stop();
353
+ io.disconnect();
354
+ document.removeEventListener("visibilitychange", onVisibility);
355
+ ro.disconnect();
356
+ c.removeEventListener("pointermove", onMove);
357
+ c.removeEventListener("pointerenter", onEnter);
358
+ c.removeEventListener("pointerleave", onLeave);
359
+ gl.deleteTexture(texture);
360
+ gl.deleteProgram(prog);
361
+ setLoaded(false);
362
+ };
363
+ }, [src, tier, tint]);
364
+ if (tier === 0) {
365
+ return (
366
+ // eslint-disable-next-line @next/next/no-img-element
367
+ /* @__PURE__ */ jsx(
368
+ "img",
369
+ {
370
+ alt: "",
371
+ className: cn(
372
+ "absolute inset-0 h-full w-full object-cover",
373
+ fallbackClassName ?? className
374
+ ),
375
+ src,
376
+ style: { mixBlendMode: "overlay", ...style }
248
377
  }
249
- const tintVec = tint
250
- ? (() => {
251
- const [tr, tg, tb] = hexToRgb(tint);
252
- return [tr / 255, tg / 255, tb / 255];
253
- })()
254
- : [1, 1, 1];
255
- const t0 = performance.now();
256
- let raf = 0;
257
- let visible = !document.hidden;
258
- let inView = true;
259
- const loop = () => {
260
- raf = requestAnimationFrame(loop);
261
- const s = state.current;
262
- const pattern = autoPlayRef.current
263
- ? AUTOPLAY_PATTERNS[autoPlayRef.current]
264
- : null;
265
- if (pattern) {
266
- const driven = pattern((performance.now() - t0) / 1e3);
267
- s.mx = driven.mx;
268
- s.my = driven.my;
269
- s.hoverTarget = driven.hover;
270
- }
271
- const dvx = s.mx - s.prevMx;
272
- const dvy = s.my - s.prevMy;
273
- s.vx += (dvx * 8 - s.vx) * 0.1;
274
- s.vy += (dvy * 8 - s.vy) * 0.1;
275
- s.prevMx = s.mx;
276
- s.prevMy = s.my;
277
- const speed = Math.sqrt(s.vx * s.vx + s.vy * s.vy);
278
- for (let i = 0; i < NUM_BANDS; i++) {
279
- const bandCenter = (i + 0.5) / NUM_BANDS;
280
- const dist = Math.abs(s.my - bandCenter);
281
- const proximity = Math.max(0, 1 - dist / 0.3);
282
- const activation = s.hoverTarget * proximity * (0.4 + Math.min(speed, 1) * 0.6);
283
- s.bandTargets[i] = activation;
284
- }
285
- for (let i = 0; i < NUM_BANDS; i++) {
286
- const rate = bandEaseRates[i];
287
- const current = s.bands[i] ?? 0;
288
- const target = s.bandTargets[i] ?? 0;
289
- s.bands[i] = current + (target - current) * rate;
290
- if (s.bands[i] < 0.001) {
291
- s.bands[i] = 0;
292
- }
293
- }
294
- gl.uniform1f(uT, (performance.now() - t0) / 1e3);
295
- gl.uniform2f(uR, c.width, c.height);
296
- gl.uniform2f(uImgSize, s.imgW, s.imgH);
297
- gl.uniform2f(uVel, s.vx, s.vy);
298
- gl.uniform3f(uTint, tintVec[0], tintVec[1], tintVec[2]);
299
- const ts = tintStrengthRef.current;
300
- const defaultStrength = tint ? 0.35 : 0;
301
- const defaultInactive = tint ? 0.15 : 0;
302
- gl.uniform1f(uTintStrength, activeRef.current
303
- ? (ts?.active ?? defaultStrength)
304
- : (ts?.inactive ?? defaultInactive));
305
- for (let i = 0; i < NUM_BANDS; i++) {
306
- gl.uniform1f(uBands[i], s.bands[i]);
307
- }
308
- gl.bindTexture(gl.TEXTURE_2D, texture);
309
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
310
- };
311
- const start = () => {
312
- if (visible && inView && !raf) {
313
- raf = requestAnimationFrame(loop);
314
- }
315
- };
316
- const stop = () => {
317
- if (raf) {
318
- cancelAnimationFrame(raf);
319
- raf = 0;
320
- }
321
- };
322
- const onVisibility = () => {
323
- visible = !document.hidden;
324
- visible ? start() : stop();
325
- };
326
- const io = new IntersectionObserver(entries => {
327
- inView = entries.some(e => e.isIntersecting);
328
- inView ? start() : stop();
329
- }, { threshold: 0 });
330
- io.observe(c);
331
- document.addEventListener('visibilitychange', onVisibility);
332
- start();
333
- return () => {
334
- stop();
335
- io.disconnect();
336
- document.removeEventListener('visibilitychange', onVisibility);
337
- ro.disconnect();
338
- c.removeEventListener('pointermove', onMove);
339
- c.removeEventListener('pointerenter', onEnter);
340
- c.removeEventListener('pointerleave', onLeave);
341
- gl.deleteTexture(texture);
342
- gl.deleteProgram(prog);
343
- setLoaded(false);
344
- };
345
- // autoPlay is intentionally omitted so toggling it at runtime doesn't
346
- // tear down the shader pipeline. The ref-driven loop reads the live
347
- // value each frame, so listener attach/detach is handled once on mount.
348
- // eslint-disable-next-line react-hooks/exhaustive-deps
349
- }, [src, tier, tint]);
350
- if (tier === 0) {
351
- return (
352
- // eslint-disable-next-line @next/next/no-img-element
353
- _jsx("img", { alt: "", className: cn('absolute inset-0 h-full w-full object-cover', fallbackClassName ?? className), src: src, style: { mixBlendMode: 'overlay', ...style } }));
378
+ )
379
+ );
380
+ }
381
+ return /* @__PURE__ */ jsx(
382
+ "canvas",
383
+ {
384
+ className: cn(
385
+ "absolute inset-0 h-full w-full transition-opacity duration-500",
386
+ className
387
+ ),
388
+ ref: canvasRef,
389
+ style: {
390
+ mixBlendMode: "overlay",
391
+ opacity: loaded ? 1 : 0,
392
+ ...style
393
+ }
354
394
  }
355
- return (_jsx("canvas", { className: cn('absolute inset-0 h-full w-full transition-opacity duration-500', className), ref: canvasRef, style: {
356
- mixBlendMode: 'overlay',
357
- opacity: loaded ? 1 : 0,
358
- ...style
359
- } }));
395
+ );
360
396
  }
361
- //# sourceMappingURL=image-distortion.js.map
@@ -1,2 +1 @@
1
- export declare function LevaClient(): import("react/jsx-runtime").JSX.Element;
2
- //# sourceMappingURL=leva-client.d.ts.map
1
+ export declare function LevaClient(): import("react").JSX.Element;
@@ -1,12 +1,11 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Leva } from 'leva';
4
- import { useEffect, useState } from 'react';
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Leva } from "leva";
4
+ import { useEffect, useState } from "react";
5
5
  export function LevaClient() {
6
- const [hidden, setHidden] = useState(true);
7
- useEffect(() => {
8
- setHidden(!new URLSearchParams(window.location.search).has('dev'));
9
- }, []);
10
- return _jsx(Leva, { hidden });
6
+ const [hidden, setHidden] = useState(true);
7
+ useEffect(() => {
8
+ setHidden(!new URLSearchParams(window.location.search).has("dev"));
9
+ }, []);
10
+ return /* @__PURE__ */ jsx(Leva, { ...{ hidden } });
11
11
  }
12
- //# sourceMappingURL=leva-client.js.map
@@ -4,4 +4,3 @@ interface ListItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
4
4
  active?: boolean;
5
5
  }
6
6
  export {};
7
- //# sourceMappingURL=list-item.d.ts.map
@@ -1,10 +1,26 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { forwardRef } from 'react';
4
- import { cn } from '../../utils';
5
- export const ListItem = forwardRef(function ListItem({ active = false, children, className, type = 'button', ...props }, ref) {
6
- return (_jsx("button", { className: cn('group relative flex w-full items-center gap-2 px-3 py-2 text-left', 'font-courier text-sm transition-colors cursor-pointer', 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-midground/30', 'disabled:cursor-not-allowed disabled:opacity-50', active
7
- ? 'bg-midground/10 text-midground'
8
- : 'text-midground/70 hover:text-midground hover:bg-midground/5', className), "data-active": active || undefined, ref: ref, type: type, ...props, children: children }));
9
- });
10
- //# sourceMappingURL=list-item.js.map
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { forwardRef } from "react";
4
+ import { cn } from "../../utils/index.js";
5
+ export const ListItem = forwardRef(
6
+ function ListItem2({ active = false, children, className, type = "button", ...props }, ref) {
7
+ return /* @__PURE__ */ jsx(
8
+ "button",
9
+ {
10
+ className: cn(
11
+ "group relative flex w-full items-center gap-2 px-3 py-2 text-left",
12
+ "font-courier text-sm transition-colors cursor-pointer",
13
+ "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-midground/30",
14
+ "disabled:cursor-not-allowed disabled:opacity-50",
15
+ active ? "bg-midground/10 text-midground" : "text-midground/70 hover:text-midground hover:bg-midground/5",
16
+ className
17
+ ),
18
+ "data-active": active || void 0,
19
+ ref,
20
+ type,
21
+ ...props,
22
+ children
23
+ }
24
+ );
25
+ }
26
+ );