@hanzo/ui 8.27.10 → 8.27.12

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 (299) hide show
  1. package/dist/backends/gui/comparison.cjs +17 -21
  2. package/dist/backends/gui/comparison.d.ts +4 -5
  3. package/dist/backends/gui/comparison.d.ts.map +1 -1
  4. package/dist/backends/gui/comparison.js +18 -22
  5. package/dist/backends/gui/comparison.js.map +1 -1
  6. package/dist/backends/gui/crypto-screener.cjs +21 -31
  7. package/dist/backends/gui/crypto-screener.d.ts +20 -24
  8. package/dist/backends/gui/crypto-screener.d.ts.map +1 -1
  9. package/dist/backends/gui/crypto-screener.js +21 -31
  10. package/dist/backends/gui/crypto-screener.js.map +1 -1
  11. package/dist/backends/gui/cursor.cjs +15 -18
  12. package/dist/backends/gui/cursor.d.ts +4 -3
  13. package/dist/backends/gui/cursor.d.ts.map +1 -1
  14. package/dist/backends/gui/cursor.js +15 -18
  15. package/dist/backends/gui/cursor.js.map +1 -1
  16. package/dist/backends/gui/data-table.cjs +144 -184
  17. package/dist/backends/gui/data-table.d.ts +64 -44
  18. package/dist/backends/gui/data-table.d.ts.map +1 -1
  19. package/dist/backends/gui/data-table.js +146 -152
  20. package/dist/backends/gui/data-table.js.map +1 -1
  21. package/dist/backends/gui/dock.cjs +1 -1
  22. package/dist/backends/gui/dock.d.ts.map +1 -1
  23. package/dist/backends/gui/dock.js +1 -1
  24. package/dist/backends/gui/dock.js.map +1 -1
  25. package/dist/backends/gui/editor.cjs +35 -31
  26. package/dist/backends/gui/editor.d.ts +11 -11
  27. package/dist/backends/gui/editor.d.ts.map +1 -1
  28. package/dist/backends/gui/editor.js +35 -31
  29. package/dist/backends/gui/editor.js.map +1 -1
  30. package/dist/backends/gui/field.cjs +132 -0
  31. package/dist/backends/gui/field.d.ts +74 -0
  32. package/dist/backends/gui/field.d.ts.map +1 -0
  33. package/dist/backends/gui/field.js +121 -0
  34. package/dist/backends/gui/field.js.map +1 -0
  35. package/dist/backends/gui/gantt.cjs +17 -19
  36. package/dist/backends/gui/gantt.d.ts +4 -5
  37. package/dist/backends/gui/gantt.d.ts.map +1 -1
  38. package/dist/backends/gui/gantt.js +18 -21
  39. package/dist/backends/gui/gantt.js.map +1 -1
  40. package/dist/backends/gui/glimpse.cjs +88 -0
  41. package/dist/backends/gui/glimpse.d.ts +57 -0
  42. package/dist/backends/gui/glimpse.d.ts.map +1 -0
  43. package/dist/backends/gui/glimpse.js +81 -0
  44. package/dist/backends/gui/glimpse.js.map +1 -0
  45. package/dist/backends/gui/grid-pattern.cjs +119 -0
  46. package/dist/backends/gui/grid-pattern.d.ts +96 -0
  47. package/dist/backends/gui/grid-pattern.d.ts.map +1 -0
  48. package/dist/backends/gui/grid-pattern.js +84 -0
  49. package/dist/backends/gui/grid-pattern.js.map +1 -0
  50. package/dist/backends/gui/image-crop.cjs +35 -0
  51. package/dist/backends/gui/image-crop.d.ts +20 -0
  52. package/dist/backends/gui/image-crop.d.ts.map +1 -0
  53. package/dist/backends/gui/image-crop.js +33 -0
  54. package/dist/backends/gui/image-crop.js.map +1 -0
  55. package/dist/backends/gui/image-zoom.cjs +58 -0
  56. package/dist/backends/gui/image-zoom.d.ts +16 -0
  57. package/dist/backends/gui/image-zoom.d.ts.map +1 -0
  58. package/dist/backends/gui/image-zoom.js +56 -0
  59. package/dist/backends/gui/image-zoom.js.map +1 -0
  60. package/dist/backends/gui/index.cjs +159 -1
  61. package/dist/backends/gui/index.d.ts +49 -0
  62. package/dist/backends/gui/index.d.ts.map +1 -1
  63. package/dist/backends/gui/index.js +49 -0
  64. package/dist/backends/gui/index.js.map +1 -1
  65. package/dist/backends/gui/interactive-grid-pattern.cjs +61 -0
  66. package/dist/backends/gui/interactive-grid-pattern.d.ts +28 -0
  67. package/dist/backends/gui/interactive-grid-pattern.d.ts.map +1 -0
  68. package/dist/backends/gui/interactive-grid-pattern.js +26 -0
  69. package/dist/backends/gui/interactive-grid-pattern.js.map +1 -0
  70. package/dist/backends/gui/iphone-15-pro.cjs +83 -0
  71. package/dist/backends/gui/iphone-15-pro.d.ts +16 -0
  72. package/dist/backends/gui/iphone-15-pro.d.ts.map +1 -0
  73. package/dist/backends/gui/iphone-15-pro.js +81 -0
  74. package/dist/backends/gui/iphone-15-pro.js.map +1 -0
  75. package/dist/backends/gui/item.cjs +154 -0
  76. package/dist/backends/gui/item.d.ts +72 -0
  77. package/dist/backends/gui/item.d.ts.map +1 -0
  78. package/dist/backends/gui/item.js +143 -0
  79. package/dist/backends/gui/item.js.map +1 -0
  80. package/dist/backends/gui/kanban.cjs +247 -0
  81. package/dist/backends/gui/kanban.d.ts +37 -0
  82. package/dist/backends/gui/kanban.d.ts.map +1 -0
  83. package/dist/backends/gui/kanban.js +212 -0
  84. package/dist/backends/gui/kanban.js.map +1 -0
  85. package/dist/backends/gui/kbd.cjs +45 -0
  86. package/dist/backends/gui/kbd.d.ts +8 -0
  87. package/dist/backends/gui/kbd.d.ts.map +1 -0
  88. package/dist/backends/gui/kbd.js +42 -0
  89. package/dist/backends/gui/kbd.js.map +1 -0
  90. package/dist/backends/gui/limelight-nav.cjs +201 -0
  91. package/dist/backends/gui/limelight-nav.d.ts +20 -0
  92. package/dist/backends/gui/limelight-nav.d.ts.map +1 -0
  93. package/dist/backends/gui/limelight-nav.js +166 -0
  94. package/dist/backends/gui/limelight-nav.js.map +1 -0
  95. package/dist/backends/gui/list.cjs +26 -0
  96. package/dist/backends/gui/list.d.ts +15 -0
  97. package/dist/backends/gui/list.d.ts.map +1 -0
  98. package/dist/backends/gui/list.js +23 -0
  99. package/dist/backends/gui/list.js.map +1 -0
  100. package/dist/backends/gui/macos-dock.cjs +84 -0
  101. package/dist/backends/gui/macos-dock.d.ts +30 -0
  102. package/dist/backends/gui/macos-dock.d.ts.map +1 -0
  103. package/dist/backends/gui/macos-dock.js +82 -0
  104. package/dist/backends/gui/macos-dock.js.map +1 -0
  105. package/dist/backends/gui/magnetic.cjs +40 -0
  106. package/dist/backends/gui/magnetic.d.ts +12 -0
  107. package/dist/backends/gui/magnetic.d.ts.map +1 -0
  108. package/dist/backends/gui/magnetic.js +38 -0
  109. package/dist/backends/gui/magnetic.js.map +1 -0
  110. package/dist/backends/gui/marquee.cjs +110 -0
  111. package/dist/backends/gui/marquee.d.ts +44 -0
  112. package/dist/backends/gui/marquee.d.ts.map +1 -0
  113. package/dist/backends/gui/marquee.js +75 -0
  114. package/dist/backends/gui/marquee.js.map +1 -0
  115. package/dist/backends/gui/menu-dock.cjs +64 -0
  116. package/dist/backends/gui/menu-dock.d.ts +21 -0
  117. package/dist/backends/gui/menu-dock.d.ts.map +1 -0
  118. package/dist/backends/gui/menu-dock.js +62 -0
  119. package/dist/backends/gui/menu-dock.js.map +1 -0
  120. package/dist/backends/gui/menubar.cjs +227 -0
  121. package/dist/backends/gui/menubar.d.ts +106 -0
  122. package/dist/backends/gui/menubar.d.ts.map +1 -0
  123. package/dist/backends/gui/menubar.js +177 -0
  124. package/dist/backends/gui/menubar.js.map +1 -0
  125. package/dist/backends/gui/message-dock.cjs +111 -0
  126. package/dist/backends/gui/message-dock.d.ts +22 -0
  127. package/dist/backends/gui/message-dock.d.ts.map +1 -0
  128. package/dist/backends/gui/message-dock.js +110 -0
  129. package/dist/backends/gui/message-dock.js.map +1 -0
  130. package/dist/backends/gui/mini-calendar.cjs +25 -0
  131. package/dist/backends/gui/mini-calendar.d.ts +22 -0
  132. package/dist/backends/gui/mini-calendar.d.ts.map +1 -0
  133. package/dist/backends/gui/mini-calendar.js +24 -0
  134. package/dist/backends/gui/mini-calendar.js.map +1 -0
  135. package/dist/backends/gui/minimal-tiptap.cjs +56 -0
  136. package/dist/backends/gui/minimal-tiptap.d.ts +20 -0
  137. package/dist/backends/gui/minimal-tiptap.d.ts.map +1 -0
  138. package/dist/backends/gui/minimal-tiptap.js +21 -0
  139. package/dist/backends/gui/minimal-tiptap.js.map +1 -0
  140. package/dist/backends/gui/motion-highlight.cjs +83 -0
  141. package/dist/backends/gui/motion-highlight.d.ts +27 -0
  142. package/dist/backends/gui/motion-highlight.d.ts.map +1 -0
  143. package/dist/backends/gui/motion-highlight.js +48 -0
  144. package/dist/backends/gui/motion-highlight.js.map +1 -0
  145. package/dist/backends/gui/navigation-bar.cjs +47 -0
  146. package/dist/backends/gui/navigation-bar.d.ts +48 -0
  147. package/dist/backends/gui/navigation-bar.d.ts.map +1 -0
  148. package/dist/backends/gui/navigation-bar.js +45 -0
  149. package/dist/backends/gui/navigation-bar.js.map +1 -0
  150. package/dist/backends/gui/news-timeline.cjs +47 -0
  151. package/dist/backends/gui/news-timeline.d.ts +39 -0
  152. package/dist/backends/gui/news-timeline.d.ts.map +1 -0
  153. package/dist/backends/gui/news-timeline.js +45 -0
  154. package/dist/backends/gui/news-timeline.js.map +1 -0
  155. package/dist/backends/gui/order-entry.cjs +53 -0
  156. package/dist/backends/gui/order-entry.d.ts +21 -0
  157. package/dist/backends/gui/order-entry.d.ts.map +1 -0
  158. package/dist/backends/gui/order-entry.js +52 -0
  159. package/dist/backends/gui/order-entry.js.map +1 -0
  160. package/dist/backends/gui/orders-history.cjs +102 -0
  161. package/dist/backends/gui/orders-history.d.ts +24 -0
  162. package/dist/backends/gui/orders-history.d.ts.map +1 -0
  163. package/dist/backends/gui/orders-history.js +67 -0
  164. package/dist/backends/gui/orders-history.js.map +1 -0
  165. package/dist/backends/gui/pagination.cjs +51 -0
  166. package/dist/backends/gui/pagination.d.ts +52 -0
  167. package/dist/backends/gui/pagination.d.ts.map +1 -0
  168. package/dist/backends/gui/pagination.js +42 -0
  169. package/dist/backends/gui/pagination.js.map +1 -0
  170. package/dist/backends/gui/particles-background.cjs +135 -0
  171. package/dist/backends/gui/particles-background.d.ts +24 -0
  172. package/dist/backends/gui/particles-background.d.ts.map +1 -0
  173. package/dist/backends/gui/particles-background.js +133 -0
  174. package/dist/backends/gui/particles-background.js.map +1 -0
  175. package/dist/backends/gui/particles.cjs +145 -0
  176. package/dist/backends/gui/particles.d.ts +25 -0
  177. package/dist/backends/gui/particles.d.ts.map +1 -0
  178. package/dist/backends/gui/particles.js +143 -0
  179. package/dist/backends/gui/particles.js.map +1 -0
  180. package/dist/backends/gui/pill.cjs +82 -0
  181. package/dist/backends/gui/pill.d.ts +12 -0
  182. package/dist/backends/gui/pill.d.ts.map +1 -0
  183. package/dist/backends/gui/pill.js +78 -0
  184. package/dist/backends/gui/pill.js.map +1 -0
  185. package/dist/backends/gui/pin-list.cjs +82 -0
  186. package/dist/backends/gui/pin-list.d.ts +42 -0
  187. package/dist/backends/gui/pin-list.d.ts.map +1 -0
  188. package/dist/backends/gui/pin-list.js +80 -0
  189. package/dist/backends/gui/pin-list.js.map +1 -0
  190. package/dist/backends/gui/pixel-image.cjs +63 -0
  191. package/dist/backends/gui/pixel-image.d.ts +21 -0
  192. package/dist/backends/gui/pixel-image.d.ts.map +1 -0
  193. package/dist/backends/gui/pixel-image.js +61 -0
  194. package/dist/backends/gui/pixel-image.js.map +1 -0
  195. package/dist/backends/gui/positions-list.cjs +60 -0
  196. package/dist/backends/gui/positions-list.d.ts +14 -0
  197. package/dist/backends/gui/positions-list.d.ts.map +1 -0
  198. package/dist/backends/gui/positions-list.js +58 -0
  199. package/dist/backends/gui/positions-list.js.map +1 -0
  200. package/dist/backends/gui/qr-code.cjs +438 -0
  201. package/dist/backends/gui/qr-code.d.ts +42 -0
  202. package/dist/backends/gui/qr-code.d.ts.map +1 -0
  203. package/dist/backends/gui/qr-code.js +402 -0
  204. package/dist/backends/gui/qr-code.js.map +1 -0
  205. package/dist/backends/gui/relative-time.cjs +167 -0
  206. package/dist/backends/gui/relative-time.d.ts +10 -0
  207. package/dist/backends/gui/relative-time.d.ts.map +1 -0
  208. package/dist/backends/gui/relative-time.js +132 -0
  209. package/dist/backends/gui/relative-time.js.map +1 -0
  210. package/dist/backends/gui/safari.cjs +65 -0
  211. package/dist/backends/gui/safari.d.ts +23 -0
  212. package/dist/backends/gui/safari.d.ts.map +1 -0
  213. package/dist/backends/gui/safari.js +63 -0
  214. package/dist/backends/gui/safari.js.map +1 -0
  215. package/dist/backends/gui/snippet.cjs +144 -0
  216. package/dist/backends/gui/snippet.d.ts +38 -0
  217. package/dist/backends/gui/snippet.d.ts.map +1 -0
  218. package/dist/backends/gui/snippet.js +141 -0
  219. package/dist/backends/gui/snippet.js.map +1 -0
  220. package/dist/backends/gui/stars-scrolling-wheel.cjs +106 -0
  221. package/dist/backends/gui/stars-scrolling-wheel.d.ts +24 -0
  222. package/dist/backends/gui/stars-scrolling-wheel.d.ts.map +1 -0
  223. package/dist/backends/gui/stars-scrolling-wheel.js +104 -0
  224. package/dist/backends/gui/stars-scrolling-wheel.js.map +1 -0
  225. package/dist/backends/gui/status.cjs +79 -0
  226. package/dist/backends/gui/status.d.ts +15 -0
  227. package/dist/backends/gui/status.d.ts.map +1 -0
  228. package/dist/backends/gui/status.js +77 -0
  229. package/dist/backends/gui/status.js.map +1 -0
  230. package/dist/backends/gui/stock-market.cjs +21 -0
  231. package/dist/backends/gui/stock-market.d.ts +17 -0
  232. package/dist/backends/gui/stock-market.d.ts.map +1 -0
  233. package/dist/backends/gui/stock-market.js +19 -0
  234. package/dist/backends/gui/stock-market.js.map +1 -0
  235. package/dist/backends/gui/stock-screener.cjs +55 -0
  236. package/dist/backends/gui/stock-screener.d.ts +41 -0
  237. package/dist/backends/gui/stock-screener.d.ts.map +1 -0
  238. package/dist/backends/gui/stock-screener.js +53 -0
  239. package/dist/backends/gui/stock-screener.js.map +1 -0
  240. package/dist/backends/gui/symbol-info.cjs +46 -0
  241. package/dist/backends/gui/symbol-info.d.ts +36 -0
  242. package/dist/backends/gui/symbol-info.d.ts.map +1 -0
  243. package/dist/backends/gui/symbol-info.js +44 -0
  244. package/dist/backends/gui/symbol-info.js.map +1 -0
  245. package/dist/backends/gui/table.cjs +104 -0
  246. package/dist/backends/gui/table.d.ts +57 -0
  247. package/dist/backends/gui/table.d.ts.map +1 -0
  248. package/dist/backends/gui/table.js +95 -0
  249. package/dist/backends/gui/table.js.map +1 -0
  250. package/dist/backends/gui/tags.cjs +22 -0
  251. package/dist/backends/gui/tags.d.ts +22 -0
  252. package/dist/backends/gui/tags.d.ts.map +1 -0
  253. package/dist/backends/gui/tags.js +20 -0
  254. package/dist/backends/gui/tags.js.map +1 -0
  255. package/dist/backends/gui/technical-analysis.cjs +58 -0
  256. package/dist/backends/gui/technical-analysis.d.ts +41 -0
  257. package/dist/backends/gui/technical-analysis.d.ts.map +1 -0
  258. package/dist/backends/gui/technical-analysis.js +56 -0
  259. package/dist/backends/gui/technical-analysis.js.map +1 -0
  260. package/dist/backends/gui/terminal.cjs +266 -0
  261. package/dist/backends/gui/terminal.d.ts +38 -0
  262. package/dist/backends/gui/terminal.d.ts.map +1 -0
  263. package/dist/backends/gui/terminal.js +231 -0
  264. package/dist/backends/gui/terminal.js.map +1 -0
  265. package/dist/backends/gui/ticker.cjs +79 -0
  266. package/dist/backends/gui/ticker.d.ts +19 -0
  267. package/dist/backends/gui/ticker.d.ts.map +1 -0
  268. package/dist/backends/gui/ticker.js +44 -0
  269. package/dist/backends/gui/ticker.js.map +1 -0
  270. package/dist/backends/gui/timeline.cjs +154 -0
  271. package/dist/backends/gui/timeline.d.ts +42 -0
  272. package/dist/backends/gui/timeline.d.ts.map +1 -0
  273. package/dist/backends/gui/timeline.js +118 -0
  274. package/dist/backends/gui/timeline.js.map +1 -0
  275. package/dist/backends/gui/toggle.cjs +96 -0
  276. package/dist/backends/gui/toggle.d.ts +29 -0
  277. package/dist/backends/gui/toggle.d.ts.map +1 -0
  278. package/dist/backends/gui/toggle.js +95 -0
  279. package/dist/backends/gui/toggle.js.map +1 -0
  280. package/dist/backends/gui/video-player.cjs +383 -0
  281. package/dist/backends/gui/video-player.d.ts +54 -0
  282. package/dist/backends/gui/video-player.d.ts.map +1 -0
  283. package/dist/backends/gui/video-player.js +348 -0
  284. package/dist/backends/gui/video-player.js.map +1 -0
  285. package/dist/gallery.html +249 -249
  286. package/dist/gui-config.cjs +5 -0
  287. package/dist/gui-config.d.ts +18 -3
  288. package/dist/gui-config.d.ts.map +1 -1
  289. package/dist/gui-config.js +5 -0
  290. package/dist/gui-config.js.map +1 -1
  291. package/dist/index.cjs +110 -1
  292. package/dist/index.d.ts +1 -1
  293. package/dist/index.d.ts.map +1 -1
  294. package/dist/index.js +1 -1
  295. package/dist/index.js.map +1 -1
  296. package/dist/index.node.cjs +110 -1
  297. package/dist/index.node.js +1 -1
  298. package/dist/styles.css +124 -124
  299. package/package.json +1 -1
@@ -4,40 +4,36 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Comparison = Comparison;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  /**
7
- * Comparison — a pricing/feature table laid out as one column per plan.
7
+ * Comparison — a plan/feature grid: one column per plan, one row per feature.
8
8
  *
9
- * Each column lists the same rows in the same order; a row's value is either a
10
- * boolean (rendered as a check or a cross) or a string (rendered as text), so
11
- * a caller mixes "Users: 25" with "Support: yes" in one column without two
12
- * component shapes. `highlighted` marks the plan the table wants to sell.
13
- *
14
- * Layout is `../../grid`'s real CSS grid — equal tracks, one per column — with
15
- * `YStack`/`XStack` for the card and its rows.
9
+ * Columns are laid out with `Grid`/`Cell` (real CSS grid, tracks owned by the
10
+ * container) rather than a row of stacks, so every column stays the same
11
+ * width regardless of its content. A boolean item renders as a check or an
12
+ * cross; a string item renders as text.
16
13
  */
17
14
  const gui_1 = require("@hanzo/gui");
18
15
  const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
19
16
  const grid_1 = require("../../grid.cjs");
17
+ const ink_1 = require("./ink.cjs");
20
18
  const slot_1 = require("./slot.cjs");
21
- const ICON = 20;
22
- const Card = (0, gui_1.styled)(gui_1.YStack, {
19
+ const ColumnFrame = (0, gui_1.styled)(gui_1.YStack, {
23
20
  name: 'ComparisonColumn',
24
- p: '$5',
25
- rounded: '$4',
26
21
  borderWidth: 1,
27
22
  borderColor: '$borderColor',
23
+ rounded: '$4',
24
+ p: '$5',
28
25
  gap: '$4',
29
26
  variants: {
30
27
  highlighted: {
31
- true: {
32
- borderColor: '$color9',
33
- shadowColor: '$shadowColor',
34
- shadowRadius: 12,
35
- shadowOffset: { width: 0, height: 4 },
36
- },
28
+ true: { borderColor: '$color', shadowColor: '$shadowColor', shadowRadius: 12, shadowOpacity: 0.15 },
37
29
  },
38
30
  },
39
31
  });
40
- const Row = ({ item }) => ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { ...(0, slot_1.slot)('comparison-item'), items: "center", gap: "$3", children: [typeof item.value === 'boolean' ? (item.value ? ((0, jsx_runtime_1.jsx)(lucide_icons_2_1.Check, { ...(0, slot_1.slot)('comparison-item-check'), size: ICON, color: "$green9" })) : ((0, jsx_runtime_1.jsx)(lucide_icons_2_1.X, { ...(0, slot_1.slot)('comparison-item-cross'), size: ICON, color: "$red9" }))) : ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { ...(0, slot_1.slot)('comparison-item-value'), fontWeight: "600", children: item.value })), (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$3", children: item.label })] }));
41
- function Comparison({ columns }) {
42
- return ((0, jsx_runtime_1.jsx)("div", { ...(0, slot_1.slot)('comparison'), style: { overflowX: 'auto' }, children: (0, jsx_runtime_1.jsx)(grid_1.Grid, { columns: columns.length, gap: "$4", children: columns.map((column, index) => ((0, jsx_runtime_1.jsxs)(Card, { ...(0, slot_1.slot)('comparison-column'), "data-highlighted": column.highlighted ? '' : undefined, highlighted: column.highlighted, children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$6", fontWeight: "600", children: column.title }), (0, jsx_runtime_1.jsx)(gui_1.YStack, { gap: "$3", children: column.items.map((item, itemIndex) => ((0, jsx_runtime_1.jsx)(Row, { item: item }, item.label || itemIndex))) })] }, column.title || index))) }) }));
32
+ const Title = (0, gui_1.styled)(gui_1.SizableText, { name: 'ComparisonTitle', size: '$5', fontWeight: '600' });
33
+ const Label = (0, gui_1.styled)(gui_1.SizableText, { name: 'ComparisonLabel', size: '$2' });
34
+ const Value = (0, gui_1.styled)(gui_1.SizableText, { name: 'ComparisonValue', size: '$2', fontWeight: '600' });
35
+ const Row = (0, gui_1.styled)(gui_1.XStack, { name: 'ComparisonRow', items: 'center', gap: '$3' });
36
+ const mark = (value) => typeof value === 'boolean' ? (value ? ((0, jsx_runtime_1.jsx)(lucide_icons_2_1.Check, { ...(0, slot_1.slot)('comparison-item-check'), size: 18, color: "$green9" })) : ((0, jsx_runtime_1.jsx)(lucide_icons_2_1.X, { ...(0, slot_1.slot)('comparison-item-cross'), size: 18, color: "$red9" }))) : ((0, jsx_runtime_1.jsx)(Value, { children: value }));
37
+ function Comparison({ columns, gap = '$4', ...props }) {
38
+ return ((0, jsx_runtime_1.jsx)(grid_1.Grid, { ...(0, slot_1.slot)('comparison'), columns: columns.length || 1, gap: gap, ...props, children: columns.map((column, i) => ((0, jsx_runtime_1.jsx)(grid_1.Cell, { children: (0, jsx_runtime_1.jsxs)(ColumnFrame, { ...(0, slot_1.slot)('comparison-column'), "data-highlighted": column.highlighted ? '' : undefined, highlighted: column.highlighted, children: [(0, ink_1.ink)(column.title, Title), (0, jsx_runtime_1.jsx)(gui_1.YStack, { gap: "$3", children: column.items.map((item, j) => ((0, jsx_runtime_1.jsxs)(Row, { ...(0, slot_1.slot)('comparison-item'), children: [mark(item.value), (0, jsx_runtime_1.jsx)(Label, { children: item.label })] }, j))) })] }) }, i))) }));
43
39
  }
@@ -1,3 +1,4 @@
1
+ import { type GridProps } from '../../grid.js';
1
2
  export interface ComparisonItem {
2
3
  label: string;
3
4
  value: boolean | string;
@@ -5,12 +6,10 @@ export interface ComparisonItem {
5
6
  export interface ComparisonColumn {
6
7
  title: string;
7
8
  items: ComparisonItem[];
8
- /** Marks the plan the table wants to sell: a raised border and shadow. */
9
9
  highlighted?: boolean;
10
10
  }
11
- export interface ComparisonProps {
11
+ export type ComparisonProps = Omit<GridProps, 'columns' | 'children'> & {
12
12
  columns: ComparisonColumn[];
13
- children?: never;
14
- }
15
- export declare function Comparison({ columns }: ComparisonProps): import("react").JSX.Element;
13
+ };
14
+ export declare function Comparison({ columns, gap, ...props }: ComparisonProps): import("react").JSX.Element;
16
15
  //# sourceMappingURL=comparison.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/comparison.tsx"],"names":[],"mappings":"AAmBA,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,OAAO,GAAG,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB;AA6CD,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,EAAE,eAAe,+BAwBtD"}
1
+ {"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/comparison.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAIvD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,OAAO,GAAG,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAkCD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC,GAAG;IACtE,OAAO,EAAE,gBAAgB,EAAE,CAAA;CAC5B,CAAA;AAED,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,GAAU,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,+BAwB5E"}
@@ -1,41 +1,37 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  /**
4
- * Comparison — a pricing/feature table laid out as one column per plan.
4
+ * Comparison — a plan/feature grid: one column per plan, one row per feature.
5
5
  *
6
- * Each column lists the same rows in the same order; a row's value is either a
7
- * boolean (rendered as a check or a cross) or a string (rendered as text), so
8
- * a caller mixes "Users: 25" with "Support: yes" in one column without two
9
- * component shapes. `highlighted` marks the plan the table wants to sell.
10
- *
11
- * Layout is `../../grid`'s real CSS grid — equal tracks, one per column — with
12
- * `YStack`/`XStack` for the card and its rows.
6
+ * Columns are laid out with `Grid`/`Cell` (real CSS grid, tracks owned by the
7
+ * container) rather than a row of stacks, so every column stays the same
8
+ * width regardless of its content. A boolean item renders as a check or an
9
+ * cross; a string item renders as text.
13
10
  */
14
11
  import { SizableText, YStack, XStack, styled } from '@hanzo/gui';
15
12
  import { Check, X } from '@hanzogui/lucide-icons-2';
16
- import { Grid } from '../../grid.js';
13
+ import { Grid, Cell } from '../../grid.js';
14
+ import { ink } from './ink.js';
17
15
  import { slot } from './slot.js';
18
- const ICON = 20;
19
- const Card = styled(YStack, {
16
+ const ColumnFrame = styled(YStack, {
20
17
  name: 'ComparisonColumn',
21
- p: '$5',
22
- rounded: '$4',
23
18
  borderWidth: 1,
24
19
  borderColor: '$borderColor',
20
+ rounded: '$4',
21
+ p: '$5',
25
22
  gap: '$4',
26
23
  variants: {
27
24
  highlighted: {
28
- true: {
29
- borderColor: '$color9',
30
- shadowColor: '$shadowColor',
31
- shadowRadius: 12,
32
- shadowOffset: { width: 0, height: 4 },
33
- },
25
+ true: { borderColor: '$color', shadowColor: '$shadowColor', shadowRadius: 12, shadowOpacity: 0.15 },
34
26
  },
35
27
  },
36
28
  });
37
- const Row = ({ item }) => (_jsxs(XStack, { ...slot('comparison-item'), items: "center", gap: "$3", children: [typeof item.value === 'boolean' ? (item.value ? (_jsx(Check, { ...slot('comparison-item-check'), size: ICON, color: "$green9" })) : (_jsx(X, { ...slot('comparison-item-cross'), size: ICON, color: "$red9" }))) : (_jsx(SizableText, { ...slot('comparison-item-value'), fontWeight: "600", children: item.value })), _jsx(SizableText, { size: "$3", children: item.label })] }));
38
- export function Comparison({ columns }) {
39
- return (_jsx("div", { ...slot('comparison'), style: { overflowX: 'auto' }, children: _jsx(Grid, { columns: columns.length, gap: "$4", children: columns.map((column, index) => (_jsxs(Card, { ...slot('comparison-column'), "data-highlighted": column.highlighted ? '' : undefined, highlighted: column.highlighted, children: [_jsx(SizableText, { size: "$6", fontWeight: "600", children: column.title }), _jsx(YStack, { gap: "$3", children: column.items.map((item, itemIndex) => (_jsx(Row, { item: item }, item.label || itemIndex))) })] }, column.title || index))) }) }));
29
+ const Title = styled(SizableText, { name: 'ComparisonTitle', size: '$5', fontWeight: '600' });
30
+ const Label = styled(SizableText, { name: 'ComparisonLabel', size: '$2' });
31
+ const Value = styled(SizableText, { name: 'ComparisonValue', size: '$2', fontWeight: '600' });
32
+ const Row = styled(XStack, { name: 'ComparisonRow', items: 'center', gap: '$3' });
33
+ const mark = (value) => typeof value === 'boolean' ? (value ? (_jsx(Check, { ...slot('comparison-item-check'), size: 18, color: "$green9" })) : (_jsx(X, { ...slot('comparison-item-cross'), size: 18, color: "$red9" }))) : (_jsx(Value, { children: value }));
34
+ export function Comparison({ columns, gap = '$4', ...props }) {
35
+ return (_jsx(Grid, { ...slot('comparison'), columns: columns.length || 1, gap: gap, ...props, children: columns.map((column, i) => (_jsx(Cell, { children: _jsxs(ColumnFrame, { ...slot('comparison-column'), "data-highlighted": column.highlighted ? '' : undefined, highlighted: column.highlighted, children: [ink(column.title, Title), _jsx(YStack, { gap: "$3", children: column.items.map((item, j) => (_jsxs(Row, { ...slot('comparison-item'), children: [mark(item.value), _jsx(Label, { children: item.label })] }, j))) })] }) }, i))) }));
40
36
  }
41
37
  //# sourceMappingURL=com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AiB,CAAC,aACrC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EACjB,KAAC,KAAK,cAAE,IAAI,CAAC,KAAK,GAAS,KAFnB,CAAC,CAGL,CACP,CAAC,GACK,IACG,IAfL,CAAC,CAgBL,CACR,CAAC,GACG,CACR,CAAA;AACH,CAAC"}
@@ -4,30 +4,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.CryptoScreener = void 0;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  /**
7
- * CryptoScreener — a TradingView screener table, in a gui frame.
7
+ * CryptoScreener — TradingView's crypto market screener, in a gui frame.
8
8
  *
9
- * The rows are TradingView's, drawn inside TradingView's own document, so the
10
- * table is an `<iframe>` and nothing here draws a pixel of it. What this owns
11
- * is the frame around it and the settings the table opens with — which market
12
- * it screens, which column set it opens on, the display currency, the theme —
13
- * written into the iframe's address the way TradingView's own embed script
14
- * writes them: `/embed-widget/screener/?locale=…#<settings as JSON>`. Nothing
15
- * is fetched or injected at mount, so the markup is the same on the server and
16
- * in the browser, and the frame has its height before the table arrives.
9
+ * The table is TradingView's own document, so it is an `<iframe>` and nothing
10
+ * here draws a row of it. What this owns is the frame around it and the
11
+ * settings the screener opens with — the column set, the display currency,
12
+ * the theme — written into the iframe's address the way TradingView's own
13
+ * embed script writes them:
14
+ * `/embed-widget/screener/?locale=…#<settings as JSON>`. Nothing is fetched or
15
+ * injected at mount, so the markup is the same on the server and in the
16
+ * browser, and the frame has its height before the table arrives.
17
17
  *
18
- * The iframe is keyed on that address. A browser treats a `src` that differs
19
- * only in its fragment as a same-document navigation and does not reload, so
20
- * without the key a changed `market` would leave the old table on screen.
18
+ * The iframe is keyed on that address, because a browser treats a `src` that
19
+ * differs only in its fragment as a same-document navigation and does not
20
+ * reload — without the key a new `defaultColumn` would change the URL and
21
+ * leave the old table on screen.
21
22
  */
22
23
  const gui_1 = require("@hanzo/gui");
23
24
  const slot_1 = require("./slot.cjs");
24
- /** `crypto` is the one short name; every other market is its own screener_type. */
25
- const screenerType = (market) => market === 'crypto' ? 'crypto_mkt' : market;
26
- const EMBED = 'https://www.tradingview-widget.com/embed-widget/screener/?locale=';
25
+ const EMBED = 'https://www.tradingview-widget.com/embed-widget/screener/?locale=en#';
27
26
  /** The settings TradingView reads, with the documented defaults filled in. */
28
- const settings = ({ market = 'crypto', defaultColumn = 'overview', displayCurrency = 'USD', colorTheme = 'dark', isTransparent = false, locale = 'en', width = '100%', height = 550, }) => ({
27
+ const settings = ({ defaultColumn = 'overview', displayCurrency = 'USD', colorTheme = 'dark', isTransparent = false, locale = 'en', width = '100%', height = 550, }) => ({
29
28
  defaultColumn,
30
- screener_type: screenerType(market),
29
+ screener_type: 'crypto_mkt',
31
30
  displayCurrency,
32
31
  colorTheme,
33
32
  isTransparent,
@@ -35,21 +34,12 @@ const settings = ({ market = 'crypto', defaultColumn = 'overview', displayCurren
35
34
  width,
36
35
  height,
37
36
  });
38
- const CryptoScreener = ({ market, defaultColumn, displayCurrency, colorTheme, isTransparent, locale, width, height, ...props }) => {
39
- const s = settings({
40
- market,
41
- defaultColumn,
42
- displayCurrency,
43
- colorTheme,
44
- isTransparent,
45
- locale,
46
- width,
47
- height,
48
- });
49
- const src = `${EMBED}${s.locale}#${encodeURIComponent(JSON.stringify(s))}`;
50
- return ((0, jsx_runtime_1.jsx)(gui_1.YStack, { ...(0, slot_1.slot)('crypto-screener'), "data-market": market ?? 'crypto', "data-color-theme": s.colorTheme,
37
+ const CryptoScreener = ({ market: _market, defaultColumn, displayCurrency, colorTheme, isTransparent, locale, width, height, ...props }) => {
38
+ const s = settings({ defaultColumn, displayCurrency, colorTheme, isTransparent, locale, width, height });
39
+ const src = EMBED + encodeURIComponent(JSON.stringify(s));
40
+ return ((0, jsx_runtime_1.jsx)(gui_1.YStack, { ...(0, slot_1.slot)('crypto-screener'), "data-column": s.defaultColumn, "data-color-theme": s.colorTheme,
51
41
  // The documented size is TradingView's — a number or a percent string —
52
42
  // and gui declares a narrower one; on web both reach CSS as written.
53
- width: s.width, height: s.height, overflow: "hidden", position: "relative", bg: "$panel", ...props, children: gui_1.isWeb && ((0, jsx_runtime_1.jsx)("iframe", { src: src, title: `${market ?? 'crypto'} screener`, loading: "lazy", scrolling: "no", style: { display: 'block', width: '100%', height: '100%', border: 0 } }, src)) }));
43
+ width: s.width, height: s.height, overflow: "hidden", position: "relative", bg: "$panel", ...props, children: gui_1.isWeb && ((0, jsx_runtime_1.jsx)("iframe", { src: src, title: "Crypto screener", loading: "lazy", scrolling: "no", style: { display: 'block', width: '100%', height: '100%', border: 0 } }, src)) }));
54
44
  };
55
45
  exports.CryptoScreener = CryptoScreener;
@@ -1,42 +1,38 @@
1
1
  /**
2
- * CryptoScreener — a TradingView screener table, in a gui frame.
2
+ * CryptoScreener — TradingView's crypto market screener, in a gui frame.
3
3
  *
4
- * The rows are TradingView's, drawn inside TradingView's own document, so the
5
- * table is an `<iframe>` and nothing here draws a pixel of it. What this owns
6
- * is the frame around it and the settings the table opens with — which market
7
- * it screens, which column set it opens on, the display currency, the theme —
8
- * written into the iframe's address the way TradingView's own embed script
9
- * writes them: `/embed-widget/screener/?locale=…#<settings as JSON>`. Nothing
10
- * is fetched or injected at mount, so the markup is the same on the server and
11
- * in the browser, and the frame has its height before the table arrives.
4
+ * The table is TradingView's own document, so it is an `<iframe>` and nothing
5
+ * here draws a row of it. What this owns is the frame around it and the
6
+ * settings the screener opens with — the column set, the display currency,
7
+ * the theme — written into the iframe's address the way TradingView's own
8
+ * embed script writes them:
9
+ * `/embed-widget/screener/?locale=…#<settings as JSON>`. Nothing is fetched or
10
+ * injected at mount, so the markup is the same on the server and in the
11
+ * browser, and the frame has its height before the table arrives.
12
12
  *
13
- * The iframe is keyed on that address. A browser treats a `src` that differs
14
- * only in its fragment as a same-document navigation and does not reload, so
15
- * without the key a changed `market` would leave the old table on screen.
13
+ * The iframe is keyed on that address, because a browser treats a `src` that
14
+ * differs only in its fragment as a same-document navigation and does not
15
+ * reload — without the key a new `defaultColumn` would change the URL and
16
+ * leave the old table on screen.
16
17
  */
17
18
  import { type YStackProps } from '@hanzo/gui';
18
- /**
19
- * The market the table screens — TradingView's own `screener_type` values
20
- * (`america`, `india`, `forex_mkt`, `bond_mkt`, …), plus `crypto` as the
21
- * short name for `crypto_mkt` this component defaults to.
22
- */
23
- export type CryptoScreenerMarket = 'crypto' | (string & {});
24
- export type CryptoScreenerColumn = 'overview' | 'performance' | 'oscillators' | 'moving_averages' | 'valuation';
19
+ export type CryptoScreenerColumn = 'overview' | 'performance' | 'oscillators' | 'moving_averages';
25
20
  export type CryptoScreenerTheme = 'light' | 'dark';
21
+ export type CryptoScreenerMarket = 'crypto';
26
22
  export interface CryptoScreenerProps extends Omit<YStackProps, 'width' | 'height' | 'theme'> {
27
- /** Which market the table screens. */
23
+ /** The market the screener lists; TradingView's crypto table. */
28
24
  market?: CryptoScreenerMarket;
29
- /** Which column set the table opens on. */
25
+ /** Which column set opens first; the toolbar still switches it live. */
30
26
  defaultColumn?: CryptoScreenerColumn;
31
- /** The currency prices and volumes are shown in. */
27
+ /** The currency prices and market caps are shown in. */
32
28
  displayCurrency?: string;
33
- /** The table's own palette; independent of the surrounding gui theme. */
29
+ /** The screener's own palette; independent of the surrounding gui theme. */
34
30
  colorTheme?: CryptoScreenerTheme;
35
31
  isTransparent?: boolean;
36
32
  locale?: string;
37
33
  width?: string | number;
38
34
  height?: string | number;
39
35
  }
40
- declare const CryptoScreener: ({ market, defaultColumn, displayCurrency, colorTheme, isTransparent, locale, width, height, ...props }: CryptoScreenerProps) => import("react").JSX.Element;
36
+ declare const CryptoScreener: ({ market: _market, defaultColumn, displayCurrency, colorTheme, isTransparent, locale, width, height, ...props }: CryptoScreenerProps) => import("react").JSX.Element;
41
37
  export { CryptoScreener };
42
38
  //# sourceMappingURL=crypto-screener.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crypto-screener.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/crypto-screener.tsx"],"names":[],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ClD,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAA;AAE3C,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC1F,iEAAiE;IACjE,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,wEAAwE;IACxE,aAAa,CAAC,EAAE,oBAAoB,CAAA;IACpC,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,mBAAmB,CAAA;IAChC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACzB;AAwBD,QAAA,MAAM,cAAc,oHAUjB,mBAAmB,gCA6BrB,CAAA;AAED,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -1,30 +1,29 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  /**
4
- * CryptoScreener — a TradingView screener table, in a gui frame.
4
+ * CryptoScreener — TradingView's crypto market screener, in a gui frame.
5
5
  *
6
- * The rows are TradingView's, drawn inside TradingView's own document, so the
7
- * table is an `<iframe>` and nothing here draws a pixel of it. What this owns
8
- * is the frame around it and the settings the table opens with — which market
9
- * it screens, which column set it opens on, the display currency, the theme —
10
- * written into the iframe's address the way TradingView's own embed script
11
- * writes them: `/embed-widget/screener/?locale=…#<settings as JSON>`. Nothing
12
- * is fetched or injected at mount, so the markup is the same on the server and
13
- * in the browser, and the frame has its height before the table arrives.
6
+ * The table is TradingView's own document, so it is an `<iframe>` and nothing
7
+ * here draws a row of it. What this owns is the frame around it and the
8
+ * settings the screener opens with — the column set, the display currency,
9
+ * the theme — written into the iframe's address the way TradingView's own
10
+ * embed script writes them:
11
+ * `/embed-widget/screener/?locale=…#<settings as JSON>`. Nothing is fetched or
12
+ * injected at mount, so the markup is the same on the server and in the
13
+ * browser, and the frame has its height before the table arrives.
14
14
  *
15
- * The iframe is keyed on that address. A browser treats a `src` that differs
16
- * only in its fragment as a same-document navigation and does not reload, so
17
- * without the key a changed `market` would leave the old table on screen.
15
+ * The iframe is keyed on that address, because a browser treats a `src` that
16
+ * differs only in its fragment as a same-document navigation and does not
17
+ * reload — without the key a new `defaultColumn` would change the URL and
18
+ * leave the old table on screen.
18
19
  */
19
20
  import { YStack, isWeb } from '@hanzo/gui';
20
21
  import { slot } from './slot.js';
21
- /** `crypto` is the one short name; every other market is its own screener_type. */
22
- const screenerType = (market) => market === 'crypto' ? 'crypto_mkt' : market;
23
- const EMBED = 'https://www.tradingview-widget.com/embed-widget/screener/?locale=';
22
+ const EMBED = 'https://www.tradingview-widget.com/embed-widget/screener/?locale=en#';
24
23
  /** The settings TradingView reads, with the documented defaults filled in. */
25
- const settings = ({ market = 'crypto', defaultColumn = 'overview', displayCurrency = 'USD', colorTheme = 'dark', isTransparent = false, locale = 'en', width = '100%', height = 550, }) => ({
24
+ const settings = ({ defaultColumn = 'overview', displayCurrency = 'USD', colorTheme = 'dark', isTransparent = false, locale = 'en', width = '100%', height = 550, }) => ({
26
25
  defaultColumn,
27
- screener_type: screenerType(market),
26
+ screener_type: 'crypto_mkt',
28
27
  displayCurrency,
29
28
  colorTheme,
30
29
  isTransparent,
@@ -32,22 +31,13 @@ const settings = ({ market = 'crypto', defaultColumn = 'overview', displayCurren
32
31
  width,
33
32
  height,
34
33
  });
35
- const CryptoScreener = ({ market, defaultColumn, displayCurrency, colorTheme, isTransparent, locale, width, height, ...props }) => {
36
- const s = settings({
37
- market,
38
- defaultColumn,
39
- displayCurrency,
40
- colorTheme,
41
- isTransparent,
42
- locale,
43
- width,
44
- height,
45
- });
46
- const src = `${EMBED}${s.locale}#${encodeURIComponent(JSON.stringify(s))}`;
47
- return (_jsx(YStack, { ...slot('crypto-screener'), "data-market": market ?? 'crypto', "data-color-theme": s.colorTheme,
34
+ const CryptoScreener = ({ market: _market, defaultColumn, displayCurrency, colorTheme, isTransparent, locale, width, height, ...props }) => {
35
+ const s = settings({ defaultColumn, displayCurrency, colorTheme, isTransparent, locale, width, height });
36
+ const src = EMBED + encodeURIComponent(JSON.stringify(s));
37
+ return (_jsx(YStack, { ...slot('crypto-screener'), "data-column": s.defaultColumn, "data-color-theme": s.colorTheme,
48
38
  // The documented size is TradingView's — a number or a percent string —
49
39
  // and gui declares a narrower one; on web both reach CSS as written.
50
- width: s.width, height: s.height, overflow: "hidden", position: "relative", bg: "$panel", ...props, children: isWeb && (_jsx("iframe", { src: src, title: `${market ?? 'crypto'} screener`, loading: "lazy", scrolling: "no", style: { display: 'block', width: '100%', height: '100%', border: 0 } }, src)) }));
40
+ width: s.width, height: s.height, overflow: "hidden", position: "relative", bg: "$panel", ...props, children: isWeb && (_jsx("iframe", { src: src, title: "Crypto screener", loading: "lazy", scrolling: "no", style: { display: 'block', width: '100%', height: '100%', border: 0 } }, src)) }));
51
41
  };
52
42
  export { CryptoScreener };
53
43
  //# sourceMappingURL=crypto-screener.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"crypto-screener.js","sourceRoot":"","sources":["../../../src/backends/gui/crypto-screener.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAoB,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAkB7B,mFAAmF;AACnF,MAAM,YAAY,GAAG,CAAC,MAA4B,EAAE,EAAE,CACpD,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAA;AAiB7C,MAAM,KAAK,GAAG,mEAAmE,CAAA;AAEjF,8EAA8E;AAC9E,MAAM,QAAQ,GAAG,CAAC,EAChB,MAAM,GAAG,QAAQ,EACjB,aAAa,GA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,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,IALhE,GAAG,CAMR,CACH,GACM,CACV,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"crypto-screener.js","sourceRoot":"","sources":["../../../src/backends/gui/crypto-screener.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAoB,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAqB7B,MAAM,KAAK,GAAG,sEAAsE,CAAA;AAEpF,8EAA8E;AAC9E,MAAM,QAAQ,GAAG,CAAC,EAChB,aAAa,GAAG,UAAU,EAC1B,eAAe,GAAG,KAAK,EACvB,UAAU,GAAG,MAAM,EACnB,aAAa,GAAG,KAAK,EACrB,MAAM,GAAG,IAAI,EACb,KAAK,GAAG,MAAM,EACd,MAAM,GAAG,GAAG,GACQ,EAAE,EAAE,CAAC,CAAC;IAC1B,aAAa;IACb,aAAa,EAAE,YAAY;IAC3B,eAAe;IACf,UAAU;IACV,aAAa;IACb,MAAM;IACN,KAAK;IACL,MAAM;CACP,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG,CAAC,EACtB,MAAM,EAAE,OAAO,EACf,aAAa,EACb,eAAe,EACf,UAAU,EACV,aAAa,EACb,MAAM,EACN,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACY,EAAE,EAAE;IACxB,MAAM,CAAC,GAAG,QAAQ,CAAC,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA;IACxG,MAAM,GAAG,GAAG,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;IACzD,OAAO,CACL,KAAC,MAAM,OACD,IAAI,CAAC,iBAAiB,CAAC,iBACd,CAAC,CAAC,aAAa,sBACV,CAAC,CAAC,UAAU;QAC9B,wEAAwE;QACxE,qEAAqE;QACrE,KAAK,EAAE,CAAC,CAAC,KAA6B,EACtC,MAAM,EAAE,CAAC,CAAC,MAA+B,EACzC,QAAQ,EAAC,QAAQ,EACjB,QAAQ,EAAC,UAAU,EACnB,EAAE,EAAC,QAAQ,KACP,KAAK,YAER,KAAK,IAAI,CACR,iBAEE,GAAG,EAAE,GAAG,EACR,KAAK,EAAC,iBAAiB,EACvB,OAAO,EAAC,MAAM,EACd,SAAS,EAAC,IAAI,EACd,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,IALhE,GAAG,CAMR,CACH,GACM,CACV,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -4,15 +4,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Cursor = Cursor;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  /**
7
- * Cursor — a custom pointer that replaces the native one only inside its own
8
- * frame, following the mouse and optionally carrying a short label.
7
+ * Cursor — a container that replaces the pointer with a small round follower
8
+ * while the pointer sits over it.
9
9
  *
10
- * Position tracks locally off `getBoundingClientRect`, so the dot sits in the
11
- * frame's own coordinate space rather than the viewport's, and it renders
12
- * nothing until the pointer has actually entered — a plain `mouseenter`/
13
- * `mouseleave` pair, no document listener, since the effect never needs to
14
- * reach past the frame it is masking. `cursor: none` is scoped to that same
15
- * frame, so nothing outside it loses its native pointer.
10
+ * A `mousemove` on the frame turns the client point into a position relative
11
+ * to the frame's own box (`getBoundingClientRect`), so the follower is placed
12
+ * with plain `left`/`top` inside a `position: relative` parent — no fixed
13
+ * positioning, no document listener, and nothing rendered before the pointer
14
+ * has actually entered. `cursorText` draws a label inside the dot; leaving it
15
+ * unset draws a bare dot. The frame hides the native cursor for its own box
16
+ * only (`cursor: none`), so the effect is local to whatever the caller wraps,
17
+ * unlike a page-wide replacement.
16
18
  */
17
19
  const gui_1 = require("@hanzo/gui");
18
20
  const react_1 = require("react");
@@ -21,20 +23,15 @@ const slot_1 = require("./slot.cjs");
21
23
  function Cursor({ children, cursorText, cursorSize = 20, className }) {
22
24
  const [position, setPosition] = (0, react_1.useState)({ x: 0, y: 0 });
23
25
  const [isHovered, setIsHovered] = (0, react_1.useState)(false);
24
- const handleMouseMove = (e) => {
25
- const rect = e.currentTarget.getBoundingClientRect();
26
- setPosition({ x: e.clientX - rect.left, y: e.clientY - rect.top });
27
- };
28
- return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('cursor'), position: "relative", style: gui_1.isWeb ? { cursor: 'none' } : undefined, onMouseMove: handleMouseMove, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), ...(0, sx_1.sx)(className), children: [children, isHovered && ((0, jsx_runtime_1.jsx)(gui_1.YStack, { ...(0, slot_1.slot)('cursor-dot'), items: "center", justify: "center", style: {
29
- position: 'absolute',
26
+ return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('cursor'), position: "relative", style: gui_1.isWeb ? { cursor: 'none' } : undefined, ...(0, sx_1.sx)(className), onMouseMove: (e) => {
27
+ const rect = e.currentTarget.getBoundingClientRect();
28
+ setPosition({ x: e.clientX - rect.left, y: e.clientY - rect.top });
29
+ }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [children, isHovered && ((0, jsx_runtime_1.jsx)(gui_1.YStack, { ...(0, slot_1.slot)('cursor-dot'), position: "absolute", items: "center", justify: "center", rounded: 9999, bg: "$color6", pointerEvents: "none", style: {
30
30
  left: position.x,
31
31
  top: position.y,
32
32
  width: cursorSize,
33
33
  height: cursorSize,
34
- borderRadius: '50%',
35
34
  transform: 'translate(-50%, -50%)',
36
- backgroundColor: 'color-mix(in srgb, var(--color) 20%, transparent)',
37
- pointerEvents: 'none',
38
35
  zIndex: 50,
39
- }, children: cursorText && ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { ...(0, slot_1.slot)('cursor-text'), size: "$1", fontWeight: "600", color: "$color", children: cursorText })) }))] }));
36
+ }, children: cursorText && ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", fontWeight: "500", color: "$color", children: cursorText })) }))] }));
40
37
  }
@@ -4,12 +4,13 @@ export type CursorPosition = {
4
4
  y: number;
5
5
  };
6
6
  export type CursorProps = {
7
+ /** Content the cursor effect plays over. */
7
8
  children: ReactNode;
8
- /** Short label shown inside the dot. */
9
+ /** Label drawn inside the follower dot; omit for a bare dot. */
9
10
  cursorText?: string;
10
- /** Diameter of the dot, in px. */
11
+ /** Diameter of the follower dot, in px. */
11
12
  cursorSize?: number;
12
- /** Class notation for the frame. */
13
+ /** Class notation, converted to style props on the frame. */
13
14
  className?: string;
14
15
  };
15
16
  export declare function Cursor({ children, cursorText, cursorSize, className }: CursorProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/cursor.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAIhD,MAAM,MAAM,cAAc,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAErD,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,SAAS,CAAA;IACnB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAe,EAAE,SAAS,EAAE,EAAE,WAAW,+BA+CvF"}
1
+ {"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/cursor.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAIhD,MAAM,MAAM,cAAc,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAErD,MAAM,MAAM,WAAW,GAAG;IACxB,4CAA4C;IAC5C,QAAQ,EAAE,SAAS,CAAA;IACnB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAe,EAAE,SAAS,EAAE,EAAE,WAAW,+BA6CvF"}
@@ -1,15 +1,17 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  /**
4
- * Cursor — a custom pointer that replaces the native one only inside its own
5
- * frame, following the mouse and optionally carrying a short label.
4
+ * Cursor — a container that replaces the pointer with a small round follower
5
+ * while the pointer sits over it.
6
6
  *
7
- * Position tracks locally off `getBoundingClientRect`, so the dot sits in the
8
- * frame's own coordinate space rather than the viewport's, and it renders
9
- * nothing until the pointer has actually entered — a plain `mouseenter`/
10
- * `mouseleave` pair, no document listener, since the effect never needs to
11
- * reach past the frame it is masking. `cursor: none` is scoped to that same
12
- * frame, so nothing outside it loses its native pointer.
7
+ * A `mousemove` on the frame turns the client point into a position relative
8
+ * to the frame's own box (`getBoundingClientRect`), so the follower is placed
9
+ * with plain `left`/`top` inside a `position: relative` parent — no fixed
10
+ * positioning, no document listener, and nothing rendered before the pointer
11
+ * has actually entered. `cursorText` draws a label inside the dot; leaving it
12
+ * unset draws a bare dot. The frame hides the native cursor for its own box
13
+ * only (`cursor: none`), so the effect is local to whatever the caller wraps,
14
+ * unlike a page-wide replacement.
13
15
  */
14
16
  import { SizableText, YStack, isWeb } from '@hanzo/gui';
15
17
  import { useState } from 'react';
@@ -18,21 +20,16 @@ import { slot } from './slot.js';
18
20
  export function Cursor({ children, cursorText, cursorSize = 20, className }) {
19
21
  const [position, setPosition] = useState({ x: 0, y: 0 });
20
22
  const [isHovered, setIsHovered] = useState(false);
21
- const handleMouseMove = (e) => {
22
- const rect = e.currentTarget.getBoundingClientRect();
23
- setPosition({ x: e.clientX - rect.left, y: e.clientY - rect.top });
24
- };
25
- return (_jsxs(YStack, { ...slot('cursor'), position: "relative", style: isWeb ? { cursor: 'none' } : undefined, onMouseMove: handleMouseMove, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), ...sx(className), children: [children, isHovered && (_jsx(YStack, { ...slot('cursor-dot'), items: "center", justify: "center", style: {
26
- position: 'absolute',
23
+ return (_jsxs(YStack, { ...slot('cursor'), position: "relative", style: isWeb ? { cursor: 'none' } : undefined, ...sx(className), onMouseMove: (e) => {
24
+ const rect = e.currentTarget.getBoundingClientRect();
25
+ setPosition({ x: e.clientX - rect.left, y: e.clientY - rect.top });
26
+ }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [children, isHovered && (_jsx(YStack, { ...slot('cursor-dot'), position: "absolute", items: "center", justify: "center", rounded: 9999, bg: "$color6", pointerEvents: "none", style: {
27
27
  left: position.x,
28
28
  top: position.y,
29
29
  width: cursorSize,
30
30
  height: cursorSize,
31
- borderRadius: '50%',
32
31
  transform: 'translate(-50%, -50%)',
33
- backgroundColor: 'color-mix(in srgb, var(--color) 20%, transparent)',
34
- pointerEvents: 'none',
35
32
  zIndex: 50,
36
- }, children: cursorText && (_jsx(SizableText, { ...slot('cursor-text'), size: "$1", fontWeight: "600", color: "$color", children: cursorText })) }))] }));
33
+ }, children: cursorText && (_jsx(SizableText, { size: "$1", fontWeight: "500", color: "$color", children: cursorText })) }))] }));
37
34
  }
38
35
  //# sourceMappingURL=cursor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/backends/gui/cursor.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;GAUG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAc7B,MAAM,UAAU,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,GAAG,EAAE,EAAE,SAAS,EAAe;IACtF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAiB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA;IACxE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAEjD,MAAM,eAAe,GAAG,CAAC,CAAmC,EAAE,EAAE;QAC9D,MAAM,IAAI,GAAG,CAAC,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAA;QACpD,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;IACpE,CAAC,CAAA;IAED,OAAO,CACL,MAAC,MAAM,OACD,IAAI,CAAC,QAAQ,CAAC,EAClB,QAAQ,EAAC,UAAU,EACnB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,EA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