@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,76 +1,68 @@
1
- 'use client';
2
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { useStore } from '@nanostores/react';
4
- import { createElement, useMemo } from 'react';
5
- import { getControlAtom } from '../../hooks/use-smooth-controls';
6
- import { cn, polyRef } from '../../utils';
7
- import { colorDodge, colorMix } from '../../utils/color';
8
- const LAYER_KEYS = { bg: 'bgColor', fg: 'fgColor', mg: 'mgColor' };
1
+ "use client";
2
+ import { Fragment, jsx } from "react/jsx-runtime";
3
+ import { useStore } from "@nanostores/react";
4
+ import { createElement, useMemo } from "react";
5
+ import { getControlAtom } from "../../hooks/use-smooth-controls.js";
6
+ import { cn, polyRef } from "../../utils/index.js";
7
+ import { colorDodge, colorMix } from "../../utils/color.js";
8
+ const LAYER_KEYS = { bg: "bgColor", fg: "fgColor", mg: "mgColor" };
9
9
  const parseSpec = (spec) => {
10
- const [layer, alpha] = spec.split('/');
11
- return [layer, alpha ? parseFloat(alpha) : undefined];
10
+ const [layer, alpha] = spec.split("/");
11
+ return [layer, alpha ? parseFloat(alpha) : void 0];
12
12
  };
13
13
  const useControlColor = (key, fallback) => {
14
- const atom = getControlAtom('Lens', key);
15
- // eslint-disable-next-line react-hooks/rules-of-hooks
16
- return (atom ? useStore(atom) : undefined) ?? fallback;
14
+ const atom = getControlAtom("Lens", key);
15
+ return (atom ? useStore(atom) : void 0) ?? fallback;
17
16
  };
18
17
  const useBlend = (against, spec) => {
19
- const layerKey = spec?.split('/')[0];
20
- const isLayerSpec = layerKey && layerKey in LAYER_KEYS;
21
- const [target, alpha] = isLayerSpec
22
- ? parseSpec(spec)
23
- : [undefined, undefined];
24
- const againstColor = useControlColor(LAYER_KEYS[against], '#041c1c');
25
- const fgColor = useControlColor(LAYER_KEYS.fg, '#ffe6cb');
26
- const mgColor = useControlColor(LAYER_KEYS.mg, '#ffe6cb');
27
- const bgColor = useControlColor(LAYER_KEYS.bg, '#ffe6cb');
28
- const targetColor = target
29
- ? target === 'fg'
30
- ? fgColor
31
- : target === 'mg'
32
- ? mgColor
33
- : bgColor
34
- : spec;
35
- return useMemo(() => {
36
- if (!spec || !targetColor) {
37
- return undefined;
38
- }
39
- const result = colorDodge(againstColor, targetColor);
40
- return alpha != null ? colorMix(result, alpha) : result;
41
- }, [spec, againstColor, targetColor, alpha]);
18
+ const layerKey = spec?.split("/")[0];
19
+ const isLayerSpec = layerKey && layerKey in LAYER_KEYS;
20
+ const [target, alpha] = isLayerSpec ? parseSpec(spec) : [void 0, void 0];
21
+ const againstColor = useControlColor(LAYER_KEYS[against], "#041c1c");
22
+ const fgColor = useControlColor(LAYER_KEYS.fg, "#ffe6cb");
23
+ const mgColor = useControlColor(LAYER_KEYS.mg, "#ffe6cb");
24
+ const bgColor = useControlColor(LAYER_KEYS.bg, "#ffe6cb");
25
+ const targetColor = target ? target === "fg" ? fgColor : target === "mg" ? mgColor : bgColor : spec;
26
+ return useMemo(() => {
27
+ if (!spec || !targetColor) {
28
+ return void 0;
29
+ }
30
+ const result = colorDodge(againstColor, targetColor);
31
+ return alpha != null ? colorMix(result, alpha) : result;
32
+ }, [spec, againstColor, targetColor, alpha]);
42
33
  };
43
34
  export const useBlendMode = (opts = {}) => {
44
- const { against = 'bg', background, color } = opts;
45
- return {
46
- backgroundColor: useBlend(against, background),
47
- color: useBlend(against, color)
48
- };
35
+ const { against = "bg", background, color } = opts;
36
+ return {
37
+ backgroundColor: useBlend(against, background),
38
+ color: useBlend(against, color)
39
+ };
49
40
  };
50
41
  export const withBlendMode = (Component, opts) => {
51
- const Wrapped = (props) => {
52
- const { against, background, color, ...rest } = props;
53
- const colors = useBlendMode({
54
- against: against ?? opts?.against,
55
- background: background ?? opts?.background,
56
- color: color ?? opts?.color
57
- });
58
- return _jsx(Component, { ...rest, ...colors });
59
- };
60
- Wrapped.displayName = `withBlendMode(${Component.displayName ?? Component.name ?? 'Component'})`;
61
- return Wrapped;
42
+ const Wrapped = (props) => {
43
+ const { against, background, color, ...rest } = props;
44
+ const colors = useBlendMode({
45
+ against: against ?? opts?.against,
46
+ background: background ?? opts?.background,
47
+ color: color ?? opts?.color
48
+ });
49
+ return /* @__PURE__ */ jsx(Component, { ...rest, ...colors });
50
+ };
51
+ Wrapped.displayName = `withBlendMode(${Component.displayName ?? Component.name ?? "Component"})`;
52
+ return Wrapped;
62
53
  };
63
- export const BlendMode = polyRef(({ against, as, background, children, className, color, style, ...rest }, ref) => {
54
+ export const BlendMode = polyRef(
55
+ ({ against, as, background, children, className, color, style, ...rest }, ref) => {
64
56
  const colors = useBlendMode({ against, background, color });
65
- if (typeof children === 'function') {
66
- return _jsx(_Fragment, { children: children(colors) });
57
+ if (typeof children === "function") {
58
+ return /* @__PURE__ */ jsx(Fragment, { children: children(colors) });
67
59
  }
68
- return createElement((as ?? 'div'), {
69
- ...rest,
70
- children,
71
- className: cn(className),
72
- ref,
73
- style: { ...colors, ...style }
60
+ return createElement(as ?? "div", {
61
+ ...rest,
62
+ children,
63
+ className: cn(className),
64
+ ref,
65
+ style: { ...colors, ...style }
74
66
  });
75
- });
76
- //# sourceMappingURL=blend-mode.js.map
67
+ }
68
+ );
@@ -1,7 +1,6 @@
1
- export declare function Blink({ className, cursor }: BlinkProps): import("react/jsx-runtime").JSX.Element;
1
+ export declare function Blink({ className, cursor }: BlinkProps): import("react").JSX.Element;
2
2
  interface BlinkProps {
3
3
  className?: string;
4
4
  cursor?: 'block' | 'line';
5
5
  }
6
6
  export {};
7
- //# sourceMappingURL=blink.d.ts.map
@@ -1,7 +1,16 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cn } from '../../utils';
4
- export function Blink({ className, cursor = 'block' }) {
5
- return (_jsx("span", { className: cn('blink hidden group-hover:inline-block', 'dither ml-1 w-[1.2ch]', cursor === 'block' ? '-mb-[0.15em] h-[1.1em]' : '-mb-[0.1em] h-[2px]', className) }));
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { cn } from "../../utils/index.js";
4
+ export function Blink({ className, cursor = "block" }) {
5
+ return /* @__PURE__ */ jsx(
6
+ "span",
7
+ {
8
+ className: cn(
9
+ "blink hidden group-hover:inline-block",
10
+ "dither ml-1 w-[1.2ch]",
11
+ cursor === "block" ? "-mb-[0.15em] h-[1.1em]" : "-mb-[0.1em] h-[2px]",
12
+ className
13
+ )
14
+ }
15
+ );
6
16
  }
7
- //# sourceMappingURL=blink.js.map
@@ -4,12 +4,11 @@ declare const buttonVariants: (props?: ({
4
4
  ghost?: boolean | null | undefined;
5
5
  invert?: boolean | null | undefined;
6
6
  outlined?: boolean | null | undefined;
7
- size?: "default" | "icon" | "sm" | "xs" | null | undefined;
7
+ size?: "sm" | "default" | "icon" | "xs" | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
- export declare const Button: ({ children, className, destructive, ghost, invert, outlined, prefix, size, suffix, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const Button: ({ children, className, destructive, ghost, invert, outlined, prefix, size, suffix, ...props }: ButtonProps) => import("react").JSX.Element;
10
10
  interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'prefix' | 'suffix'>, VariantProps<typeof buttonVariants> {
11
11
  prefix?: React.ReactNode;
12
12
  suffix?: React.ReactNode;
13
13
  }
14
14
  export {};
15
- //# sourceMappingURL=button.d.ts.map
@@ -1,97 +1,146 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cva } from 'class-variance-authority';
3
- import { cloneElement } from 'react';
4
- import { cn } from '../../utils';
5
- import { Typography } from './typography';
6
- const SHADOW_DEFAULT = 'shadow-[inset_-1px_-1px_0_0_#00000080,inset_1px_1px_0_0_#ffffff80]';
7
- const SHADOW_INVERT = 'shadow-[inset_-1px_-1px_0_0_#00000080,inset_1px_1px_0_0_#ffffff29]';
8
- const SHADOW_INVERT_OUTLINED = 'shadow-[inset_-1px_-1px_0_0_#ffffff12,inset_1px_1px_0_0_#ffffff29]';
9
- const ACTIVE_FILTER = 'active:[filter:invert(1)_brightness(calc(100-99*var(--foreground-alpha,0)))]';
10
- const buttonVariants = cva([
11
- 'group relative grid cursor-pointer grid-cols-[auto_1fr_auto] items-center',
12
- 'leading-0 font-bold tracking-[0.2em] uppercase',
13
- 'disabled:pointer-events-none disabled:bg-midground/15 disabled:text-midground disabled:shadow-none'
14
- ], {
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import { cloneElement } from "react";
4
+ import { cn } from "../../utils/index.js";
5
+ import { Typography } from "./typography/index.js";
6
+ const SHADOW_DEFAULT = "shadow-[inset_-1px_-1px_0_0_#00000080,inset_1px_1px_0_0_#ffffff80]";
7
+ const SHADOW_INVERT = "shadow-[inset_-1px_-1px_0_0_#00000080,inset_1px_1px_0_0_#ffffff29]";
8
+ const SHADOW_INVERT_OUTLINED = "shadow-[inset_-1px_-1px_0_0_#ffffff12,inset_1px_1px_0_0_#ffffff29]";
9
+ const ACTIVE_FILTER = "active:[filter:invert(1)_brightness(calc(100-99*var(--foreground-alpha,0)))]";
10
+ const buttonVariants = cva(
11
+ [
12
+ "group relative grid cursor-pointer grid-cols-[auto_1fr_auto] items-center",
13
+ "leading-0 font-bold tracking-[0.2em] uppercase",
14
+ "disabled:pointer-events-none disabled:bg-midground/15 disabled:text-midground disabled:shadow-none"
15
+ ],
16
+ {
15
17
  compoundVariants: [
16
- // ── invert × outlined matrix (default surface, no ghost/destructive) ──
17
- {
18
- class: `bg-midground text-background-base active:invert ${SHADOW_DEFAULT}`,
19
- destructive: false,
20
- ghost: false,
21
- invert: false,
22
- outlined: false
23
- },
24
- {
25
- class: `bg-midground/15 text-midground ${SHADOW_INVERT} ${ACTIVE_FILTER}`,
26
- destructive: false,
27
- ghost: false,
28
- invert: true,
29
- outlined: false
30
- },
31
- {
32
- class: `shadow-midground ${SHADOW_DEFAULT} ${ACTIVE_FILTER}`,
33
- destructive: false,
34
- ghost: false,
35
- invert: false,
36
- outlined: true
37
- },
38
- {
39
- class: `${SHADOW_INVERT_OUTLINED} ${ACTIVE_FILTER}`,
40
- destructive: false,
41
- ghost: false,
42
- invert: true,
43
- outlined: true
44
- },
45
- // ── ghost: no chrome, hover bg only ──
46
- {
47
- class: 'bg-transparent text-current hover:bg-midground/10 shadow-none',
48
- destructive: false,
49
- ghost: true
50
- },
51
- {
52
- class: 'bg-transparent text-destructive hover:bg-destructive/10 shadow-none',
53
- destructive: true,
54
- ghost: true
55
- },
56
- // ── solid destructive ──
57
- {
58
- class: `bg-destructive text-destructive-foreground hover:bg-destructive/90 ${SHADOW_INVERT}`,
59
- destructive: true,
60
- ghost: false,
61
- outlined: false
62
- },
63
- // ── outlined destructive ──
64
- {
65
- class: 'border border-destructive/40 bg-transparent text-destructive hover:bg-destructive/10 shadow-none',
66
- destructive: true,
67
- ghost: false,
68
- outlined: true
69
- }
70
- ],
71
- defaultVariants: {
18
+ // ── invert × outlined matrix (default surface, no ghost/destructive) ──
19
+ {
20
+ class: `bg-midground text-background-base active:invert ${SHADOW_DEFAULT}`,
72
21
  destructive: false,
73
22
  ghost: false,
74
23
  invert: false,
75
- outlined: false,
76
- size: 'default'
24
+ outlined: false
25
+ },
26
+ {
27
+ class: `bg-midground/15 text-midground ${SHADOW_INVERT} ${ACTIVE_FILTER}`,
28
+ destructive: false,
29
+ ghost: false,
30
+ invert: true,
31
+ outlined: false
32
+ },
33
+ {
34
+ class: `shadow-midground ${SHADOW_DEFAULT} ${ACTIVE_FILTER}`,
35
+ destructive: false,
36
+ ghost: false,
37
+ invert: false,
38
+ outlined: true
39
+ },
40
+ {
41
+ class: `${SHADOW_INVERT_OUTLINED} ${ACTIVE_FILTER}`,
42
+ destructive: false,
43
+ ghost: false,
44
+ invert: true,
45
+ outlined: true
46
+ },
47
+ // ── ghost: no chrome, hover bg only ──
48
+ {
49
+ class: "bg-transparent text-current hover:bg-midground/10 shadow-none",
50
+ destructive: false,
51
+ ghost: true
52
+ },
53
+ {
54
+ class: "bg-transparent text-destructive hover:bg-destructive/10 shadow-none",
55
+ destructive: true,
56
+ ghost: true
57
+ },
58
+ // ── solid destructive ──
59
+ {
60
+ class: `bg-destructive text-destructive-foreground hover:bg-destructive/90 ${SHADOW_INVERT}`,
61
+ destructive: true,
62
+ ghost: false,
63
+ outlined: false
64
+ },
65
+ // ── outlined destructive ──
66
+ {
67
+ class: "border border-destructive/40 bg-transparent text-destructive hover:bg-destructive/10 shadow-none",
68
+ destructive: true,
69
+ ghost: false,
70
+ outlined: true
71
+ }
72
+ ],
73
+ defaultVariants: {
74
+ destructive: false,
75
+ ghost: false,
76
+ invert: false,
77
+ outlined: false,
78
+ size: "default"
77
79
  },
78
80
  variants: {
79
- destructive: { true: '' },
80
- ghost: { true: '' },
81
- invert: { true: '' },
82
- outlined: { true: 'text-midground bg-transparent' },
83
- size: {
84
- default: 'px-[.9em_.75em] py-[1.25em]',
85
- icon: 'p-2 aspect-square grid-cols-1 place-items-center [&>svg]:size-3.5',
86
- sm: 'px-3 py-1.5 text-[0.7rem] tracking-[0.15em] [&>svg]:size-3',
87
- xs: 'p-1 aspect-square grid-cols-1 place-items-center [&>svg]:size-3'
88
- }
81
+ destructive: { true: "" },
82
+ ghost: { true: "" },
83
+ invert: { true: "" },
84
+ outlined: { true: "text-midground bg-transparent" },
85
+ size: {
86
+ default: "px-[.9em_.75em] py-[1.25em]",
87
+ icon: "p-2 aspect-square grid-cols-1 place-items-center [&>svg]:size-3.5",
88
+ sm: "px-3 py-1.5 text-[0.7rem] tracking-[0.15em] [&>svg]:size-3",
89
+ xs: "p-1 aspect-square grid-cols-1 place-items-center [&>svg]:size-3"
90
+ }
89
91
  }
90
- });
91
- const IconSlot = ({ icon, side }) => (_jsxs(_Fragment, { children: [_jsx("span", { className: "w-5" }), _jsx("span", { className: cn('absolute top-1/2 -translate-y-1/2', side === 'left' ? 'left-3' : 'right-3'), children: typeof icon === 'object'
92
- ? cloneElement(icon, {
93
- className: 'size-3.5'
94
- })
95
- : icon })] }));
96
- export const Button = ({ children, className, destructive, ghost, invert, outlined, prefix, size, suffix, ...props }) => (_jsxs(Typography, { as: "button", className: cn(buttonVariants({ destructive, ghost, invert, outlined, size }), className), mono: true, ...props, children: [!ghost && (_jsx("span", { "aria-hidden": true, className: "arc-border opacity-0 transition-opacity duration-200 group-hover:opacity-100 group-focus-visible:opacity-100 group-active:opacity-100" })), prefix && _jsx(IconSlot, { icon: prefix, side: "left" }), children, suffix && _jsx(IconSlot, { icon: suffix, side: "right" })] }));
97
- //# sourceMappingURL=button.js.map
92
+ }
93
+ );
94
+ const IconSlot = ({
95
+ icon,
96
+ side
97
+ }) => /* @__PURE__ */ jsxs(Fragment, { children: [
98
+ /* @__PURE__ */ jsx("span", { className: "w-5" }),
99
+ /* @__PURE__ */ jsx(
100
+ "span",
101
+ {
102
+ className: cn(
103
+ "absolute top-1/2 -translate-y-1/2",
104
+ side === "left" ? "left-3" : "right-3"
105
+ ),
106
+ children: typeof icon === "object" ? cloneElement(icon, {
107
+ className: "size-3.5"
108
+ }) : icon
109
+ }
110
+ )
111
+ ] });
112
+ export const Button = ({
113
+ children,
114
+ className,
115
+ destructive,
116
+ ghost,
117
+ invert,
118
+ outlined,
119
+ prefix,
120
+ size,
121
+ suffix,
122
+ ...props
123
+ }) => /* @__PURE__ */ jsxs(
124
+ Typography,
125
+ {
126
+ as: "button",
127
+ className: cn(
128
+ buttonVariants({ destructive, ghost, invert, outlined, size }),
129
+ className
130
+ ),
131
+ mono: true,
132
+ ...props,
133
+ children: [
134
+ !ghost && /* @__PURE__ */ jsx(
135
+ "span",
136
+ {
137
+ "aria-hidden": true,
138
+ className: "arc-border opacity-0 transition-opacity duration-200 group-hover:opacity-100 group-focus-visible:opacity-100 group-active:opacity-100"
139
+ }
140
+ ),
141
+ prefix && /* @__PURE__ */ jsx(IconSlot, { icon: prefix, side: "left" }),
142
+ children,
143
+ suffix && /* @__PURE__ */ jsx(IconSlot, { icon: suffix, side: "right" })
144
+ ]
145
+ }
146
+ );
@@ -2,12 +2,12 @@
2
2
  * A "copy to clipboard" button that briefly shows a "Copied!" confirmation.
3
3
  * Designed to sit alongside a short command string, not as a general button.
4
4
  */
5
- export declare function CopyButton({ children, className, copiedLabel, label, resetDelayMs, text }: CopyButtonProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function CopyButton({ children, className, copiedLabel, label, resetDelayMs, text }: CopyButtonProps): import("react").JSX.Element;
6
6
  /**
7
7
  * A labeled, copy-able command (or code) display. Pairs `<CopyButton>` with
8
8
  * a monospace code block. Used for install/setup instructions.
9
9
  */
10
- export declare function CommandBlock({ className, code, label }: CommandBlockProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function CommandBlock({ className, code, label }: CommandBlockProps): import("react").JSX.Element;
11
11
  interface CommandBlockProps {
12
12
  className?: string;
13
13
  code: string;
@@ -22,4 +22,3 @@ interface CopyButtonProps {
22
22
  text: string;
23
23
  }
24
24
  export {};
25
- //# sourceMappingURL=command-block.d.ts.map
@@ -1,27 +1,55 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useCallback, useState } from 'react';
4
- import { cn } from '../../utils';
5
- import { Small } from './typography/small';
6
- /**
7
- * A "copy to clipboard" button that briefly shows a "Copied!" confirmation.
8
- * Designed to sit alongside a short command string, not as a general button.
9
- */
10
- export function CopyButton({ children, className, copiedLabel = 'Copied!', label = 'Copy', resetDelayMs = 2000, text }) {
11
- const [copied, setCopied] = useState(false);
12
- const handleCopy = useCallback(() => {
13
- void navigator.clipboard.writeText(text).then(() => {
14
- setCopied(true);
15
- setTimeout(() => setCopied(false), resetDelayMs);
16
- });
17
- }, [resetDelayMs, text]);
18
- return (_jsx("button", { className: cn('font-courier cursor-pointer border-none bg-transparent text-[0.6875rem]', 'tracking-widest uppercase', 'hover:text-midground tap-highlight-transparent transition-colors', 'flex items-center justify-center', copied ? 'text-midground' : 'text-current opacity-60', className), onClick: handleCopy, type: "button", children: children ?? (copied ? copiedLabel : label) }));
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useState } from "react";
4
+ import { cn } from "../../utils/index.js";
5
+ import { Small } from "./typography/small.js";
6
+ export function CopyButton({
7
+ children,
8
+ className,
9
+ copiedLabel = "Copied!",
10
+ label = "Copy",
11
+ resetDelayMs = 2e3,
12
+ text
13
+ }) {
14
+ const [copied, setCopied] = useState(false);
15
+ const handleCopy = useCallback(() => {
16
+ void navigator.clipboard.writeText(text).then(() => {
17
+ setCopied(true);
18
+ setTimeout(() => setCopied(false), resetDelayMs);
19
+ });
20
+ }, [resetDelayMs, text]);
21
+ return /* @__PURE__ */ jsx(
22
+ "button",
23
+ {
24
+ className: cn(
25
+ "font-courier cursor-pointer border-none bg-transparent text-[0.6875rem]",
26
+ "tracking-widest uppercase",
27
+ "hover:text-midground tap-highlight-transparent transition-colors",
28
+ "flex items-center justify-center",
29
+ copied ? "text-midground" : "text-current opacity-60",
30
+ className
31
+ ),
32
+ onClick: handleCopy,
33
+ type: "button",
34
+ children: children ?? (copied ? copiedLabel : label)
35
+ }
36
+ );
19
37
  }
20
- /**
21
- * A labeled, copy-able command (or code) display. Pairs `<CopyButton>` with
22
- * a monospace code block. Used for install/setup instructions.
23
- */
24
38
  export function CommandBlock({ className, code, label }) {
25
- return (_jsxs("div", { className: cn('flex flex-col gap-1', className), children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx(Small, { className: "opacity-50", children: label }), _jsx(CopyButton, { text: code })] }), _jsx("div", { className: cn('bg-background/40 font-courier border border-current/20', 'px-3 py-2 text-[0.6875rem] leading-relaxed lowercase'), children: _jsx("code", { className: "break-all", children: code }) })] }));
39
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
40
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
41
+ /* @__PURE__ */ jsx(Small, { className: "opacity-50", children: label }),
42
+ /* @__PURE__ */ jsx(CopyButton, { text: code })
43
+ ] }),
44
+ /* @__PURE__ */ jsx(
45
+ "div",
46
+ {
47
+ className: cn(
48
+ "bg-background/40 font-courier border border-current/20",
49
+ "px-3 py-2 text-[0.6875rem] leading-relaxed lowercase"
50
+ ),
51
+ children: /* @__PURE__ */ jsx("code", { className: "break-all", children: code })
52
+ }
53
+ )
54
+ ] });
26
55
  }
27
- //# sourceMappingURL=command-block.js.map
@@ -1,4 +1,3 @@
1
1
  export declare function Cursor({ scale }: {
2
2
  scale?: number;
3
- }): import("react/jsx-runtime").JSX.Element;
4
- //# sourceMappingURL=cursor.d.ts.map
3
+ }): import("react").JSX.Element;