@nastechai-research/ui 0.18.2

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 (352) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +21 -0
  3. package/dist/assets/filler-bg0.webp +0 -0
  4. package/dist/assets.d.ts +38 -0
  5. package/dist/fonts/Collapse-Bold.woff2 +0 -0
  6. package/dist/fonts/Collapse-BoldItalic.woff2 +0 -0
  7. package/dist/fonts/Collapse-Italic.woff2 +0 -0
  8. package/dist/fonts/Collapse-Light.woff2 +0 -0
  9. package/dist/fonts/Collapse-LightItalic.woff2 +0 -0
  10. package/dist/fonts/Collapse-Regular.woff2 +0 -0
  11. package/dist/fonts/Collapse-Thin.woff2 +0 -0
  12. package/dist/fonts/Collapse-ThinItalic.woff2 +0 -0
  13. package/dist/fonts/Mondwest-Regular.woff2 +0 -0
  14. package/dist/fonts/Neuebit-Bold.woff2 +0 -0
  15. package/dist/fonts/RulesCompressed-Medium.woff2 +0 -0
  16. package/dist/fonts/RulesCompressed-Regular.woff2 +0 -0
  17. package/dist/fonts/RulesExpanded-Bold.woff2 +0 -0
  18. package/dist/fonts/RulesExpanded-Regular.woff2 +0 -0
  19. package/dist/fonts.d.ts +6 -0
  20. package/dist/fonts.js +6 -0
  21. package/dist/hooks/use-below-breakpoint.d.ts +2 -0
  22. package/dist/hooks/use-below-breakpoint.js +17 -0
  23. package/dist/hooks/use-capped-frame.d.ts +2 -0
  24. package/dist/hooks/use-capped-frame.js +15 -0
  25. package/dist/hooks/use-confirm-delete.d.ts +10 -0
  26. package/dist/hooks/use-confirm-delete.js +35 -0
  27. package/dist/hooks/use-css-var-dims.d.ts +1 -0
  28. package/dist/hooks/use-css-var-dims.js +29 -0
  29. package/dist/hooks/use-gpu-tier.d.ts +34 -0
  30. package/dist/hooks/use-gpu-tier.js +111 -0
  31. package/dist/hooks/use-render-loop.d.ts +41 -0
  32. package/dist/hooks/use-render-loop.js +63 -0
  33. package/dist/hooks/use-smooth-controls.d.ts +16 -0
  34. package/dist/hooks/use-smooth-controls.js +217 -0
  35. package/dist/hooks/use-toast.d.ts +7 -0
  36. package/dist/hooks/use-toast.js +21 -0
  37. package/dist/index.d.ts +79 -0
  38. package/dist/index.js +107 -0
  39. package/dist/ui/basic-page.d.ts +7 -0
  40. package/dist/ui/basic-page.js +18 -0
  41. package/dist/ui/build.css +4 -0
  42. package/dist/ui/components/animated-count.d.ts +10 -0
  43. package/dist/ui/components/animated-count.js +113 -0
  44. package/dist/ui/components/ascii.d.ts +10 -0
  45. package/dist/ui/components/ascii.js +79 -0
  46. package/dist/ui/components/badge.d.ts +6 -0
  47. package/dist/ui/components/badge.js +40 -0
  48. package/dist/ui/components/badges/nous-girl.d.ts +2 -0
  49. package/dist/ui/components/badges/nous-girl.js +83 -0
  50. package/dist/ui/components/blend-mode.d.ts +28 -0
  51. package/dist/ui/components/blend-mode.js +69 -0
  52. package/dist/ui/components/blink.d.ts +6 -0
  53. package/dist/ui/components/blink.js +17 -0
  54. package/dist/ui/components/bottom-sheet.d.ts +15 -0
  55. package/dist/ui/components/bottom-sheet.js +192 -0
  56. package/dist/ui/components/button.d.ts +14 -0
  57. package/dist/ui/components/button.js +147 -0
  58. package/dist/ui/components/card.d.ts +5 -0
  59. package/dist/ui/components/card.js +74 -0
  60. package/dist/ui/components/checkbox.d.ts +2 -0
  61. package/dist/ui/components/checkbox.js +27 -0
  62. package/dist/ui/components/command-block.d.ts +24 -0
  63. package/dist/ui/components/command-block.js +56 -0
  64. package/dist/ui/components/confirm-dialog.d.ts +13 -0
  65. package/dist/ui/components/confirm-dialog.js +113 -0
  66. package/dist/ui/components/cursor.d.ts +3 -0
  67. package/dist/ui/components/cursor.js +97 -0
  68. package/dist/ui/components/dialog.d.ts +15 -0
  69. package/dist/ui/components/dialog.js +171 -0
  70. package/dist/ui/components/dropdown-menu.d.ts +12 -0
  71. package/dist/ui/components/dropdown-menu.js +102 -0
  72. package/dist/ui/components/fit-text/fit-text.css +42 -0
  73. package/dist/ui/components/fit-text/index.d.ts +9 -0
  74. package/dist/ui/components/fit-text/index.js +25 -0
  75. package/dist/ui/components/graphs/bar-chart.d.ts +12 -0
  76. package/dist/ui/components/graphs/bar-chart.js +129 -0
  77. package/dist/ui/components/graphs/index.d.ts +3 -0
  78. package/dist/ui/components/graphs/index.js +4 -0
  79. package/dist/ui/components/graphs/line-chart.d.ts +14 -0
  80. package/dist/ui/components/graphs/line-chart.js +175 -0
  81. package/dist/ui/components/graphs/utils.d.ts +52 -0
  82. package/dist/ui/components/graphs/utils.js +162 -0
  83. package/dist/ui/components/grid/grid.css +79 -0
  84. package/dist/ui/components/grid/index.d.ts +2 -0
  85. package/dist/ui/components/grid/index.js +17 -0
  86. package/dist/ui/components/hover-bg.d.ts +1 -0
  87. package/dist/ui/components/hover-bg.js +14 -0
  88. package/dist/ui/components/icons/arrow.d.ts +6 -0
  89. package/dist/ui/components/icons/arrow.js +44 -0
  90. package/dist/ui/components/icons/check.d.ts +2 -0
  91. package/dist/ui/components/icons/check.js +13 -0
  92. package/dist/ui/components/icons/chevron.d.ts +6 -0
  93. package/dist/ui/components/icons/chevron.js +51 -0
  94. package/dist/ui/components/icons/discord.d.ts +2 -0
  95. package/dist/ui/components/icons/discord.js +15 -0
  96. package/dist/ui/components/icons/eye.d.ts +2 -0
  97. package/dist/ui/components/icons/eye.js +8 -0
  98. package/dist/ui/components/icons/gear.d.ts +6 -0
  99. package/dist/ui/components/icons/gear.js +30 -0
  100. package/dist/ui/components/icons/github.d.ts +2 -0
  101. package/dist/ui/components/icons/github.js +15 -0
  102. package/dist/ui/components/icons/hamburger.d.ts +6 -0
  103. package/dist/ui/components/icons/hamburger.js +56 -0
  104. package/dist/ui/components/icons/heart.d.ts +2 -0
  105. package/dist/ui/components/icons/heart.js +11 -0
  106. package/dist/ui/components/icons/index.d.ts +12 -0
  107. package/dist/ui/components/icons/index.js +13 -0
  108. package/dist/ui/components/icons/link.d.ts +2 -0
  109. package/dist/ui/components/icons/link.js +13 -0
  110. package/dist/ui/components/icons/minus.d.ts +2 -0
  111. package/dist/ui/components/icons/minus.js +13 -0
  112. package/dist/ui/components/icons/search.d.ts +2 -0
  113. package/dist/ui/components/icons/search.js +33 -0
  114. package/dist/ui/components/image-distortion.d.ts +21 -0
  115. package/dist/ui/components/image-distortion.js +398 -0
  116. package/dist/ui/components/input.d.ts +1 -0
  117. package/dist/ui/components/input.js +21 -0
  118. package/dist/ui/components/label.d.ts +1 -0
  119. package/dist/ui/components/label.js +18 -0
  120. package/dist/ui/components/leva-client.d.ts +1 -0
  121. package/dist/ui/components/leva-client.js +12 -0
  122. package/dist/ui/components/list-item.d.ts +6 -0
  123. package/dist/ui/components/list-item.js +27 -0
  124. package/dist/ui/components/overlays/blend-modes.d.ts +1 -0
  125. package/dist/ui/components/overlays/blend-modes.js +14 -0
  126. package/dist/ui/components/overlays/glitch.d.ts +6 -0
  127. package/dist/ui/components/overlays/glitch.js +209 -0
  128. package/dist/ui/components/overlays/greys.d.ts +6 -0
  129. package/dist/ui/components/overlays/greys.js +339 -0
  130. package/dist/ui/components/overlays/index.d.ts +14 -0
  131. package/dist/ui/components/overlays/index.js +34 -0
  132. package/dist/ui/components/overlays/lens-layers.d.ts +14 -0
  133. package/dist/ui/components/overlays/lens-layers.js +95 -0
  134. package/dist/ui/components/overlays/lens.d.ts +44 -0
  135. package/dist/ui/components/overlays/lens.js +60 -0
  136. package/dist/ui/components/overlays/noise.d.ts +6 -0
  137. package/dist/ui/components/overlays/noise.js +136 -0
  138. package/dist/ui/components/overlays/vignette.d.ts +6 -0
  139. package/dist/ui/components/overlays/vignette.js +47 -0
  140. package/dist/ui/components/poster.d.ts +62 -0
  141. package/dist/ui/components/poster.js +256 -0
  142. package/dist/ui/components/progress.d.ts +9 -0
  143. package/dist/ui/components/progress.js +53 -0
  144. package/dist/ui/components/scene-canvas.d.ts +23 -0
  145. package/dist/ui/components/scene-canvas.js +179 -0
  146. package/dist/ui/components/scramble.d.ts +9 -0
  147. package/dist/ui/components/scramble.js +63 -0
  148. package/dist/ui/components/segmented.d.ts +20 -0
  149. package/dist/ui/components/segmented.js +51 -0
  150. package/dist/ui/components/select.d.ts +18 -0
  151. package/dist/ui/components/select.js +215 -0
  152. package/dist/ui/components/selection-switcher.d.ts +1 -0
  153. package/dist/ui/components/selection-switcher.js +34 -0
  154. package/dist/ui/components/separator.d.ts +5 -0
  155. package/dist/ui/components/separator.js +22 -0
  156. package/dist/ui/components/shader.d.ts +7 -0
  157. package/dist/ui/components/shader.js +60 -0
  158. package/dist/ui/components/socials.d.ts +20 -0
  159. package/dist/ui/components/socials.js +21 -0
  160. package/dist/ui/components/spinner.d.ts +20 -0
  161. package/dist/ui/components/spinner.js +38 -0
  162. package/dist/ui/components/stats.d.ts +16 -0
  163. package/dist/ui/components/stats.js +36 -0
  164. package/dist/ui/components/switch.d.ts +7 -0
  165. package/dist/ui/components/switch.js +37 -0
  166. package/dist/ui/components/tabs.d.ts +14 -0
  167. package/dist/ui/components/tabs.js +44 -0
  168. package/dist/ui/components/terminal-demo.d.ts +32 -0
  169. package/dist/ui/components/terminal-demo.js +125 -0
  170. package/dist/ui/components/theme-toggle.d.ts +6 -0
  171. package/dist/ui/components/theme-toggle.js +66 -0
  172. package/dist/ui/components/tier-card.d.ts +53 -0
  173. package/dist/ui/components/tier-card.js +146 -0
  174. package/dist/ui/components/toast.d.ts +8 -0
  175. package/dist/ui/components/toast.js +39 -0
  176. package/dist/ui/components/tv.d.ts +3 -0
  177. package/dist/ui/components/tv.js +239 -0
  178. package/dist/ui/components/typography/h1.d.ts +11 -0
  179. package/dist/ui/components/typography/h1.js +18 -0
  180. package/dist/ui/components/typography/h2.d.ts +11 -0
  181. package/dist/ui/components/typography/h2.js +18 -0
  182. package/dist/ui/components/typography/index.d.ts +15 -0
  183. package/dist/ui/components/typography/index.js +41 -0
  184. package/dist/ui/components/typography/legend.d.ts +6 -0
  185. package/dist/ui/components/typography/legend.js +20 -0
  186. package/dist/ui/components/typography/small.d.ts +2 -0
  187. package/dist/ui/components/typography/small.js +9 -0
  188. package/dist/ui/components/watchlist.d.ts +11 -0
  189. package/dist/ui/components/watchlist.js +80 -0
  190. package/dist/ui/fonts.css +63 -0
  191. package/dist/ui/footer.d.ts +20 -0
  192. package/dist/ui/footer.js +65 -0
  193. package/dist/ui/globals.css +395 -0
  194. package/dist/ui/header.d.ts +41 -0
  195. package/dist/ui/header.js +270 -0
  196. package/dist/ui/layout-wrapper.d.ts +1 -0
  197. package/dist/ui/layout-wrapper.js +7 -0
  198. package/dist/utils/color.d.ts +4 -0
  199. package/dist/utils/color.js +14 -0
  200. package/dist/utils/index.d.ts +15 -0
  201. package/dist/utils/index.js +48 -0
  202. package/dist/utils/poly.d.ts +8 -0
  203. package/dist/utils/poly.js +3 -0
  204. package/package.json +120 -0
  205. package/src/assets/filler-bg0.webp +0 -0
  206. package/src/assets.d.ts +38 -0
  207. package/src/fonts/Collapse-Bold.woff2 +0 -0
  208. package/src/fonts/Collapse-BoldItalic.woff2 +0 -0
  209. package/src/fonts/Collapse-Italic.woff2 +0 -0
  210. package/src/fonts/Collapse-Light.woff2 +0 -0
  211. package/src/fonts/Collapse-LightItalic.woff2 +0 -0
  212. package/src/fonts/Collapse-Regular.woff2 +0 -0
  213. package/src/fonts/Collapse-Thin.woff2 +0 -0
  214. package/src/fonts/Collapse-ThinItalic.woff2 +0 -0
  215. package/src/fonts/Mondwest-Regular.woff2 +0 -0
  216. package/src/fonts/Neuebit-Bold.woff2 +0 -0
  217. package/src/fonts/RulesCompressed-Medium.woff2 +0 -0
  218. package/src/fonts/RulesCompressed-Regular.woff2 +0 -0
  219. package/src/fonts/RulesExpanded-Bold.woff2 +0 -0
  220. package/src/fonts/RulesExpanded-Regular.woff2 +0 -0
  221. package/src/fonts.ts +6 -0
  222. package/src/hooks/use-below-breakpoint.ts +21 -0
  223. package/src/hooks/use-capped-frame.ts +18 -0
  224. package/src/hooks/use-confirm-delete.ts +43 -0
  225. package/src/hooks/use-css-var-dims.ts +39 -0
  226. package/src/hooks/use-gpu-tier.ts +190 -0
  227. package/src/hooks/use-render-loop.ts +121 -0
  228. package/src/hooks/use-smooth-controls.ts +318 -0
  229. package/src/hooks/use-toast.ts +29 -0
  230. package/src/index.ts +130 -0
  231. package/src/ui/basic-page.tsx +34 -0
  232. package/src/ui/build.css +4 -0
  233. package/src/ui/components/animated-count.stories.tsx +67 -0
  234. package/src/ui/components/animated-count.tsx +168 -0
  235. package/src/ui/components/ascii.stories.tsx +30 -0
  236. package/src/ui/components/ascii.tsx +110 -0
  237. package/src/ui/components/badge.stories.tsx +31 -0
  238. package/src/ui/components/badge.tsx +60 -0
  239. package/src/ui/components/badges/nous-girl.tsx +52 -0
  240. package/src/ui/components/blend-mode.stories.tsx +33 -0
  241. package/src/ui/components/blend-mode.tsx +129 -0
  242. package/src/ui/components/blink.stories.tsx +32 -0
  243. package/src/ui/components/blink.tsx +21 -0
  244. package/src/ui/components/bottom-sheet.stories.tsx +43 -0
  245. package/src/ui/components/bottom-sheet.tsx +227 -0
  246. package/src/ui/components/button.stories.tsx +68 -0
  247. package/src/ui/components/button.tsx +170 -0
  248. package/src/ui/components/card.stories.tsx +63 -0
  249. package/src/ui/components/card.tsx +85 -0
  250. package/src/ui/components/checkbox.stories.tsx +113 -0
  251. package/src/ui/components/checkbox.tsx +36 -0
  252. package/src/ui/components/command-block.stories.tsx +52 -0
  253. package/src/ui/components/command-block.tsx +86 -0
  254. package/src/ui/components/confirm-dialog.stories.tsx +91 -0
  255. package/src/ui/components/confirm-dialog.tsx +130 -0
  256. package/src/ui/components/cursor.tsx +115 -0
  257. package/src/ui/components/dialog.stories.tsx +169 -0
  258. package/src/ui/components/dialog.tsx +177 -0
  259. package/src/ui/components/dropdown-menu.stories.tsx +52 -0
  260. package/src/ui/components/dropdown-menu.tsx +117 -0
  261. package/src/ui/components/fit-text/fit-text.css +42 -0
  262. package/src/ui/components/fit-text/index.stories.tsx +33 -0
  263. package/src/ui/components/fit-text/index.tsx +45 -0
  264. package/src/ui/components/forms.stories.tsx +173 -0
  265. package/src/ui/components/graphs/bar-chart.tsx +153 -0
  266. package/src/ui/components/graphs/index.stories.tsx +64 -0
  267. package/src/ui/components/graphs/index.tsx +4 -0
  268. package/src/ui/components/graphs/line-chart.tsx +213 -0
  269. package/src/ui/components/graphs/utils.tsx +265 -0
  270. package/src/ui/components/grid/grid.css +79 -0
  271. package/src/ui/components/grid/index.tsx +19 -0
  272. package/src/ui/components/hover-bg.stories.tsx +29 -0
  273. package/src/ui/components/hover-bg.tsx +15 -0
  274. package/src/ui/components/icons/arrow.tsx +42 -0
  275. package/src/ui/components/icons/check.tsx +14 -0
  276. package/src/ui/components/icons/chevron.tsx +45 -0
  277. package/src/ui/components/icons/discord.tsx +16 -0
  278. package/src/ui/components/icons/eye.tsx +12 -0
  279. package/src/ui/components/icons/gear.tsx +51 -0
  280. package/src/ui/components/icons/github.tsx +16 -0
  281. package/src/ui/components/icons/hamburger.tsx +52 -0
  282. package/src/ui/components/icons/heart.tsx +12 -0
  283. package/src/ui/components/icons/index.ts +12 -0
  284. package/src/ui/components/icons/link.tsx +14 -0
  285. package/src/ui/components/icons/minus.tsx +14 -0
  286. package/src/ui/components/icons/search.tsx +28 -0
  287. package/src/ui/components/image-distortion.stories.tsx +120 -0
  288. package/src/ui/components/image-distortion.tsx +499 -0
  289. package/src/ui/components/input.stories.tsx +39 -0
  290. package/src/ui/components/input.tsx +20 -0
  291. package/src/ui/components/label.stories.tsx +26 -0
  292. package/src/ui/components/label.tsx +16 -0
  293. package/src/ui/components/leva-client.tsx +14 -0
  294. package/src/ui/components/list-item.stories.tsx +83 -0
  295. package/src/ui/components/list-item.tsx +37 -0
  296. package/src/ui/components/overlays/blend-modes.ts +13 -0
  297. package/src/ui/components/overlays/glitch.tsx +243 -0
  298. package/src/ui/components/overlays/greys.tsx +386 -0
  299. package/src/ui/components/overlays/index.tsx +47 -0
  300. package/src/ui/components/overlays/lens-layers.tsx +121 -0
  301. package/src/ui/components/overlays/lens.ts +91 -0
  302. package/src/ui/components/overlays/noise.tsx +174 -0
  303. package/src/ui/components/overlays/vignette.tsx +60 -0
  304. package/src/ui/components/poster.stories.tsx +513 -0
  305. package/src/ui/components/poster.tsx +411 -0
  306. package/src/ui/components/progress.stories.tsx +48 -0
  307. package/src/ui/components/progress.tsx +56 -0
  308. package/src/ui/components/scene-canvas.tsx +254 -0
  309. package/src/ui/components/scramble.stories.tsx +49 -0
  310. package/src/ui/components/scramble.tsx +95 -0
  311. package/src/ui/components/segmented.stories.tsx +101 -0
  312. package/src/ui/components/segmented.tsx +81 -0
  313. package/src/ui/components/select.stories.tsx +88 -0
  314. package/src/ui/components/select.tsx +267 -0
  315. package/src/ui/components/selection-switcher.tsx +44 -0
  316. package/src/ui/components/separator.stories.tsx +33 -0
  317. package/src/ui/components/separator.tsx +24 -0
  318. package/src/ui/components/shader.tsx +83 -0
  319. package/src/ui/components/socials.tsx +42 -0
  320. package/src/ui/components/spinner.stories.tsx +101 -0
  321. package/src/ui/components/spinner.tsx +60 -0
  322. package/src/ui/components/stats.stories.tsx +24 -0
  323. package/src/ui/components/stats.tsx +53 -0
  324. package/src/ui/components/switch.stories.tsx +77 -0
  325. package/src/ui/components/switch.tsx +48 -0
  326. package/src/ui/components/tabs.stories.tsx +101 -0
  327. package/src/ui/components/tabs.tsx +66 -0
  328. package/src/ui/components/terminal-demo.stories.tsx +67 -0
  329. package/src/ui/components/terminal-demo.tsx +189 -0
  330. package/src/ui/components/theme-toggle.stories.tsx +47 -0
  331. package/src/ui/components/theme-toggle.tsx +66 -0
  332. package/src/ui/components/tier-card.stories.tsx +217 -0
  333. package/src/ui/components/tier-card.tsx +190 -0
  334. package/src/ui/components/toast.stories.tsx +55 -0
  335. package/src/ui/components/toast.tsx +49 -0
  336. package/src/ui/components/tv.stories.tsx +37 -0
  337. package/src/ui/components/tv.tsx +257 -0
  338. package/src/ui/components/typography/h1.tsx +18 -0
  339. package/src/ui/components/typography/h2.tsx +18 -0
  340. package/src/ui/components/typography/index.tsx +54 -0
  341. package/src/ui/components/typography/legend.tsx +24 -0
  342. package/src/ui/components/typography/small.tsx +11 -0
  343. package/src/ui/components/watchlist.stories.tsx +33 -0
  344. package/src/ui/components/watchlist.tsx +105 -0
  345. package/src/ui/fonts.css +63 -0
  346. package/src/ui/footer.tsx +111 -0
  347. package/src/ui/globals.css +395 -0
  348. package/src/ui/header.tsx +398 -0
  349. package/src/ui/layout-wrapper.tsx +11 -0
  350. package/src/utils/color.ts +21 -0
  351. package/src/utils/index.ts +62 -0
  352. package/src/utils/poly.ts +26 -0
@@ -0,0 +1,39 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite'
2
+
3
+ import { Input } from './input'
4
+ import { Label } from './label'
5
+
6
+ const meta: Meta<typeof Input> = {
7
+ component: Input,
8
+ title: 'Components/Forms/Input'
9
+ }
10
+
11
+ export default meta
12
+
13
+ type Story = StoryObj<typeof Input>
14
+
15
+ export const Playground: Story = {
16
+ render: () => <Input placeholder="Enter a value…" />
17
+ }
18
+
19
+ export const Disabled: Story = {
20
+ render: () => <Input disabled placeholder="Disabled" value="locked" />
21
+ }
22
+
23
+ export const WithLabel: Story = {
24
+ render: () => (
25
+ <div className="grid w-64 gap-1.5">
26
+ <Label htmlFor="demo-input">Model name</Label>
27
+ <Input id="demo-input" placeholder="e.g. gpt-4o" />
28
+ </div>
29
+ )
30
+ }
31
+
32
+ export const NumberInput: Story = {
33
+ render: () => (
34
+ <div className="grid w-40 gap-1.5">
35
+ <Label htmlFor="demo-number">Temperature</Label>
36
+ <Input id="demo-number" type="number" step={0.1} defaultValue={0.7} />
37
+ </div>
38
+ )
39
+ }
@@ -0,0 +1,20 @@
1
+ import { cn } from '../../utils'
2
+
3
+ export function Input({
4
+ className,
5
+ ...props
6
+ }: React.InputHTMLAttributes<HTMLInputElement>) {
7
+ return (
8
+ <input
9
+ className={cn(
10
+ 'flex h-9 w-full border border-midground/15 bg-background/40 px-3 py-1 font-courier text-sm transition-colors',
11
+ 'placeholder:text-midground/50',
12
+ 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-midground/30 focus-visible:border-midground/25',
13
+ 'disabled:cursor-not-allowed disabled:opacity-50',
14
+ className
15
+ )}
16
+ {...props}
17
+ />
18
+ )
19
+ }
20
+
@@ -0,0 +1,26 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite'
2
+
3
+ import { Input } from './input'
4
+ import { Label } from './label'
5
+
6
+ const meta: Meta<typeof Label> = {
7
+ component: Label,
8
+ title: 'Components/Forms/Label'
9
+ }
10
+
11
+ export default meta
12
+
13
+ type Story = StoryObj<typeof Label>
14
+
15
+ export const Playground: Story = {
16
+ render: () => <Label>Field label</Label>
17
+ }
18
+
19
+ export const WithInput: Story = {
20
+ render: () => (
21
+ <div className="grid w-64 gap-1.5">
22
+ <Label htmlFor="label-demo">API key</Label>
23
+ <Input id="label-demo" type="password" placeholder="sk-…" />
24
+ </div>
25
+ )
26
+ }
@@ -0,0 +1,16 @@
1
+ import { cn } from '../../utils'
2
+
3
+ export function Label({
4
+ className,
5
+ ...props
6
+ }: React.LabelHTMLAttributes<HTMLLabelElement>) {
7
+ return (
8
+ <label
9
+ className={cn(
10
+ 'font-mondwest text-xs tracking-[0.1em] uppercase leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
11
+ className
12
+ )}
13
+ {...props}
14
+ />
15
+ )
16
+ }
@@ -0,0 +1,14 @@
1
+ 'use client'
2
+
3
+ import { Leva } from 'leva'
4
+ import { useEffect, useState } from 'react'
5
+
6
+ export function LevaClient() {
7
+ const [hidden, setHidden] = useState(true)
8
+
9
+ useEffect(() => {
10
+ setHidden(!new URLSearchParams(window.location.search).has('dev'))
11
+ }, [])
12
+
13
+ return <Leva {...{ hidden }} />
14
+ }
@@ -0,0 +1,83 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite'
2
+ import { useState } from 'react'
3
+
4
+ import { ListItem } from './list-item'
5
+
6
+ const PROVIDERS = [
7
+ { count: 412, name: 'OpenAI', slug: 'openai' },
8
+ { count: 38, name: 'Anthropic', slug: 'anthropic' },
9
+ { count: 124, name: 'Google', slug: 'google' },
10
+ { count: 7, name: 'Mistral', slug: 'mistral' },
11
+ { count: 4, name: 'xAI', slug: 'xai' }
12
+ ]
13
+
14
+ function Demo() {
15
+ const [active, setActive] = useState<string>('anthropic')
16
+
17
+ return (
18
+ <div className="w-72 border border-midground/15 bg-background-base">
19
+ {PROVIDERS.map(p => (
20
+ <ListItem
21
+ active={p.slug === active}
22
+ key={p.slug}
23
+ onClick={() => setActive(p.slug)}
24
+ >
25
+ <span className="flex-1 truncate">{p.name}</span>
26
+ <span className="text-[0.65rem] tabular-nums text-midground/50">
27
+ {p.count}
28
+ </span>
29
+ </ListItem>
30
+ ))}
31
+ </div>
32
+ )
33
+ }
34
+
35
+ const meta: Meta<typeof ListItem> = {
36
+ component: ListItem,
37
+ title: 'Components/Data Display/ListItem'
38
+ }
39
+
40
+ export default meta
41
+
42
+ type Story = StoryObj<typeof ListItem>
43
+
44
+ export const Playground: Story = { render: () => <Demo /> }
45
+
46
+ export const WithSubtitle: Story = {
47
+ render: () => {
48
+ function MultiLineDemo() {
49
+ const [active, setActive] = useState<string>('anthropic')
50
+
51
+ return (
52
+ <div className="w-80 border border-midground/15 bg-background-base">
53
+ {PROVIDERS.map(p => (
54
+ <ListItem
55
+ active={p.slug === active}
56
+ key={p.slug}
57
+ onClick={() => setActive(p.slug)}
58
+ >
59
+ <div className="flex-1 min-w-0">
60
+ <div className="truncate font-medium">{p.name}</div>
61
+ <div className="truncate text-[0.65rem] text-midground/60">
62
+ {p.slug} · {p.count} models
63
+ </div>
64
+ </div>
65
+ </ListItem>
66
+ ))}
67
+ </div>
68
+ )
69
+ }
70
+
71
+ return <MultiLineDemo />
72
+ }
73
+ }
74
+
75
+ export const Disabled: Story = {
76
+ render: () => (
77
+ <div className="w-72 border border-midground/15 bg-background-base">
78
+ <ListItem>Enabled item</ListItem>
79
+ <ListItem disabled>Disabled item</ListItem>
80
+ <ListItem active>Active item</ListItem>
81
+ </div>
82
+ )
83
+ }
@@ -0,0 +1,37 @@
1
+ 'use client'
2
+
3
+ import { forwardRef, type ButtonHTMLAttributes } from 'react'
4
+
5
+ import { cn } from '../../utils'
6
+
7
+ export const ListItem = forwardRef<HTMLButtonElement, ListItemProps>(
8
+ function ListItem(
9
+ { active = false, children, className, type = 'button', ...props },
10
+ ref
11
+ ) {
12
+ return (
13
+ <button
14
+ className={cn(
15
+ 'group relative flex w-full items-center gap-2 px-3 py-2 text-left',
16
+ 'font-courier text-sm transition-colors cursor-pointer',
17
+ 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-midground/30',
18
+ 'disabled:cursor-not-allowed disabled:text-text-disabled',
19
+ active
20
+ ? 'bg-midground/10 text-midground'
21
+ : 'text-text-secondary hover:text-midground hover:bg-midground/5',
22
+ className
23
+ )}
24
+ data-active={active || undefined}
25
+ ref={ref}
26
+ type={type}
27
+ {...props}
28
+ >
29
+ {children}
30
+ </button>
31
+ )
32
+ }
33
+ )
34
+
35
+ interface ListItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
36
+ active?: boolean
37
+ }
@@ -0,0 +1,13 @@
1
+ export const BLEND_MODES = [
2
+ 'overlay',
3
+ 'multiply',
4
+ 'screen',
5
+ 'difference',
6
+ 'exclusion',
7
+ 'color-dodge',
8
+ 'color-burn',
9
+ 'hard-light',
10
+ 'soft-light',
11
+ 'darken',
12
+ 'lighten'
13
+ ] as unknown as React.CSSProperties['mixBlendMode'][]
@@ -0,0 +1,243 @@
1
+ 'use client'
2
+
3
+ import { useEffect, useRef } from 'react'
4
+ import * as THREE from 'three'
5
+
6
+ import { $gpuTier, useGpuTier } from '../../../hooks/use-gpu-tier'
7
+ import { runRenderLoop } from '../../../hooks/use-render-loop'
8
+ import { useSmoothControls } from '../../../hooks/use-smooth-controls'
9
+ import { cn } from '../../../utils'
10
+
11
+ import { BLEND_MODES } from './blend-modes'
12
+
13
+ const vert = /*glsl*/ `
14
+ varying vec2 vUv;
15
+ void main() {
16
+ vUv = uv;
17
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
18
+ }
19
+ `
20
+
21
+ const frag = /*glsl*/ `
22
+ uniform float uTime, uAlpha, uIntensity, uChroma, uSpeed, uSparsity;
23
+ uniform vec3 uColor;
24
+ varying vec2 vUv;
25
+
26
+ float hash(vec2 p) { return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }
27
+
28
+ vec2 hash2(vec2 p) {
29
+ vec3 q = fract(vec3(p.xyx) * vec3(.1031, .1030, .0973));
30
+ q += dot(q, q.yzx + 33.33);
31
+ return fract((q.xx + q.yz) * q.zy);
32
+ }
33
+
34
+ float dither(vec2 p, float a) {
35
+ return step(mod(floor(p.x) + floor(p.y) * 2.0, 4.0) / 4.0, a);
36
+ }
37
+
38
+ void main() {
39
+ vec3 col = vec3(0.0);
40
+ float t = uTime * uSpeed;
41
+ float tSlow = floor(t / 3.0);
42
+ float dit = dither(gl_FragCoord.xy * 0.5, 0.7);
43
+
44
+ for (float i = 0.0; i < 6.0; i++) {
45
+ float seed = i * 137.3;
46
+ float epoch = floor((t + hash(vec2(seed, 77.7)) * 200.0) / (4.0 + hash(vec2(seed, 0.0)) * 6.0));
47
+ float life = fract((t + hash(vec2(seed, 77.7)) * 200.0) / (4.0 + hash(vec2(seed, 0.0)) * 6.0));
48
+
49
+ if (hash(vec2(epoch, seed)) > 1.0 - uSparsity * 0.7) continue;
50
+
51
+ vec2 center = vec2(hash(vec2(epoch, seed + 13.1)), hash(vec2(epoch, seed + 27.3)));
52
+ vec2 size = vec2(0.015 + hash(vec2(epoch, seed + 41.5)) * 0.08, 0.008 + hash(vec2(epoch, seed + 53.7)) * 0.04);
53
+ vec2 d = abs(vUv - center);
54
+
55
+ if (d.x < size.x && d.y < size.y) {
56
+ float fade = smoothstep(0.0, 0.05, life) * smoothstep(1.0, 0.95, life);
57
+ vec2 gUV = vUv + (hash2(vec2(epoch, seed + 200.0)) - 0.5) * 0.08 * uIntensity;
58
+ float shift = uChroma * 0.015 * (sin(t * 2.0 + hash(vec2(epoch, seed)) * 6.28) * 0.3 + 0.7);
59
+
60
+ col += uColor * vec3(
61
+ hash(gUV * 50.0 + vec2(shift, 0.0) + epoch),
62
+ hash(gUV * 50.0 + epoch),
63
+ hash(gUV * 50.0 - vec2(shift, 0.0) + epoch)
64
+ ) * dither(gl_FragCoord.xy * 0.5, fade * 0.8 + 0.2) * uIntensity * 0.7;
65
+ }
66
+ }
67
+
68
+ for (float i = 0.0; i < 12.0; i++) {
69
+ float seed = i * 211.7 + 1000.0;
70
+ float epoch = floor((t + hash(vec2(seed, 77.7)) * 150.0) / (3.0 + hash(vec2(seed, 0.0)) * 5.0));
71
+ float life = fract((t + hash(vec2(seed, 77.7)) * 150.0) / (3.0 + hash(vec2(seed, 0.0)) * 5.0));
72
+
73
+ if (hash(vec2(epoch, seed)) > 1.0 - uSparsity * 0.5) continue;
74
+
75
+ vec2 pos = vec2(hash(vec2(epoch, seed + 13.1)), hash(vec2(epoch, seed + 27.3)));
76
+ float px = 0.003 + hash(vec2(epoch, seed + 41.5)) * 0.008;
77
+
78
+ if (abs(vUv.x - pos.x) < px && abs(vUv.y - pos.y) < px) {
79
+ float fade = smoothstep(0.0, 0.1, life) * smoothstep(1.0, 0.9, life);
80
+ vec3 c = uColor;
81
+ float cs = hash(vec2(epoch, seed + 700.0));
82
+
83
+ if (cs < 0.2) c.r *= 1.8 * uChroma;
84
+ else if (cs < 0.4) c.b *= 1.8 * uChroma;
85
+
86
+ col += c * dither(gl_FragCoord.xy * 0.5, fade * 0.9) * uIntensity;
87
+ }
88
+ }
89
+
90
+ float tearSize = 25.0 + uSparsity * 10.0;
91
+ float tearThresh = 0.85 + uSparsity * 0.1;
92
+
93
+ float hY = floor(vUv.y * tearSize);
94
+ if (step(tearThresh, hash(vec2(hY, tSlow))) > 0.0) {
95
+ float shift = (hash(vec2(hY, tSlow + 50.0)) - 0.5) * 0.25 * uIntensity;
96
+ col += uColor * step(0.4, hash(vec2(vUv.x + shift, hY + tSlow))) * dit * uIntensity * 0.5;
97
+ }
98
+
99
+ float vX = floor(vUv.x * tearSize);
100
+ if (step(tearThresh, hash(vec2(vX, tSlow + 100.0))) > 0.0) {
101
+ float shift = (hash(vec2(vX, tSlow + 150.0)) - 0.5) * 0.25 * uIntensity;
102
+ col += uColor * step(0.4, hash(vec2(vX + tSlow, vUv.y + shift))) * dit * uIntensity * 0.5;
103
+ }
104
+
105
+ gl_FragColor = vec4(col * uAlpha, max(col.r, max(col.g, col.b)) * uAlpha);
106
+ }
107
+ `
108
+
109
+ export function Glitch({ className, style }: GlitchProps) {
110
+ const gpuTier = useGpuTier()
111
+
112
+ const c = useSmoothControls(
113
+ 'Effects/Glitch',
114
+ {
115
+ alpha: { max: 2, min: 0, step: 0.01, value: 0.25 },
116
+ blend: { options: BLEND_MODES, value: 'difference' },
117
+ chroma: { max: 3, min: 0, step: 0.01, value: 1.17 },
118
+ color: { value: '#ffe6cb' },
119
+ enabled: { value: true },
120
+ intensity: { max: 1, min: 0, step: 0.01, value: 0.59 },
121
+ sparsity: { max: 1, min: 0, step: 0.01, value: 0.21 },
122
+ speed: { max: 10, min: 0.1, step: 0.1, value: 1 }
123
+ },
124
+ { collapsed: true }
125
+ )
126
+
127
+ const ref = useRef<HTMLCanvasElement>(null)
128
+ const cRef = useRef(c)
129
+ cRef.current = c
130
+
131
+ const enabled = c.enabled && gpuTier > 0
132
+
133
+ useEffect(() => {
134
+ if (!ref.current || !enabled) {
135
+ return
136
+ }
137
+
138
+ let renderer: THREE.WebGLRenderer
139
+
140
+ try {
141
+ renderer = new THREE.WebGLRenderer({
142
+ alpha: true,
143
+ canvas: ref.current
144
+ })
145
+ } catch {
146
+ // See note in noise.tsx — eager gpu-tier detection should keep us
147
+ // out of here, but if the driver fails the renderer constructor
148
+ // anyway, downgrade so other overlays stop trying too.
149
+ $gpuTier.set(0)
150
+
151
+ return
152
+ }
153
+
154
+ const camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1)
155
+ const geo = new THREE.PlaneGeometry(2, 2)
156
+ const scene = new THREE.Scene()
157
+
158
+ const mat = new THREE.ShaderMaterial({
159
+ fragmentShader: frag,
160
+ transparent: true,
161
+ uniforms: {
162
+ uAlpha: { value: c.alpha },
163
+ uChroma: { value: c.chroma },
164
+ uColor: { value: new THREE.Color(c.color) },
165
+ uIntensity: { value: c.intensity },
166
+ uSparsity: { value: c.sparsity },
167
+ uSpeed: { value: c.speed },
168
+ uTime: { value: 0 }
169
+ },
170
+ vertexShader: vert
171
+ })
172
+
173
+ scene.add(new THREE.Mesh(geo, mat))
174
+
175
+ const resize = () => {
176
+ renderer.setSize(innerWidth, innerHeight)
177
+ // Cap DPR at 1.5 — at full retina (2x) the glitch shader is one
178
+ // of the heaviest fillrate consumers in the app, and the visual
179
+ // difference is tiny because it's a chromatic-noise effect.
180
+ renderer.setPixelRatio(Math.min(devicePixelRatio, 1.5))
181
+ }
182
+
183
+ resize()
184
+ window.addEventListener('resize', resize)
185
+
186
+ let time = 0
187
+
188
+ // gpu-tier 1 → ~10fps (legacy), gpu-tier 2 → ~30fps (was 60fps).
189
+ // Glitch is a background ambient effect; users won't notice 30 vs
190
+ // 60 but the GPU absolutely will.
191
+ const minIntervalMs = gpuTier === 1 ? 100 : 33
192
+
193
+ const dispose = runRenderLoop({
194
+ el: ref.current,
195
+ minIntervalMs,
196
+ onFrame: deltaSeconds => {
197
+ time += deltaSeconds
198
+
199
+ const v = cRef.current
200
+
201
+ mat.uniforms.uTime.value = time
202
+ mat.uniforms.uAlpha.value = v.alpha
203
+ mat.uniforms.uChroma.value = v.chroma
204
+ mat.uniforms.uIntensity.value = v.intensity
205
+ mat.uniforms.uSparsity.value = v.sparsity
206
+ mat.uniforms.uSpeed.value = v.speed
207
+ mat.uniforms.uColor.value.set(v.color)
208
+
209
+ renderer.render(scene, camera)
210
+ }
211
+ })
212
+
213
+ return () => {
214
+ window.removeEventListener('resize', resize)
215
+ dispose()
216
+
217
+ mat.dispose()
218
+ geo.dispose()
219
+ renderer.dispose()
220
+ }
221
+ // eslint-disable-next-line react-hooks/exhaustive-deps
222
+ }, [enabled, gpuTier])
223
+
224
+ if (!enabled) {
225
+ return null
226
+ }
227
+
228
+ return (
229
+ <canvas
230
+ className={cn('h-full w-full', className)}
231
+ ref={ref}
232
+ style={{
233
+ mixBlendMode: c.blend as React.CSSProperties['mixBlendMode'],
234
+ ...style
235
+ }}
236
+ />
237
+ )
238
+ }
239
+
240
+ interface GlitchProps {
241
+ className?: string
242
+ style?: React.CSSProperties
243
+ }