@luxalgo/vela 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +28 -0
  3. package/README.md +135 -0
  4. package/dist/DataProvider-DKNDHpNv.d.cts +134 -0
  5. package/dist/DataProvider-Dzd-Erlk.d.ts +134 -0
  6. package/dist/chunk-7UFX5ZIG.js +5976 -0
  7. package/dist/chunk-GYD2THPV.js +252 -0
  8. package/dist/chunk-KCCZNKH7.js +19137 -0
  9. package/dist/chunk-KM6LHB3Y.js +76 -0
  10. package/dist/chunk-OVQKKXLZ.js +3978 -0
  11. package/dist/chunk-Q3XQHLIH.js +7 -0
  12. package/dist/chunk-RHIDOUFL.js +698 -0
  13. package/dist/contributions-hX3EUyjG.d.ts +1528 -0
  14. package/dist/contributions-o1GRKPI_.d.cts +1528 -0
  15. package/dist/history-Dzxz-MQj.d.ts +298 -0
  16. package/dist/history-LJkz4-sS.d.cts +298 -0
  17. package/dist/icons-BZYbJXSV.d.cts +10 -0
  18. package/dist/icons-BZYbJXSV.d.ts +10 -0
  19. package/dist/index.cjs +25294 -0
  20. package/dist/index.d.cts +1189 -0
  21. package/dist/index.d.ts +1189 -0
  22. package/dist/index.js +5 -0
  23. package/dist/keymap-CGOz5F5f.d.cts +64 -0
  24. package/dist/keymap-CGOz5F5f.d.ts +64 -0
  25. package/dist/options-Q-576hIi.d.cts +1545 -0
  26. package/dist/options-Q-576hIi.d.ts +1545 -0
  27. package/dist/plugin-D94muTV-.d.cts +405 -0
  28. package/dist/plugin-aGUD1epn.d.ts +405 -0
  29. package/dist/plugin.cjs +5967 -0
  30. package/dist/plugin.d.cts +7 -0
  31. package/dist/plugin.d.ts +7 -0
  32. package/dist/plugin.js +3 -0
  33. package/dist/providers/binance.cjs +390 -0
  34. package/dist/providers/binance.d.cts +62 -0
  35. package/dist/providers/binance.d.ts +62 -0
  36. package/dist/providers/binance.js +388 -0
  37. package/dist/providers/coinbase.cjs +462 -0
  38. package/dist/providers/coinbase.d.cts +59 -0
  39. package/dist/providers/coinbase.d.ts +59 -0
  40. package/dist/providers/coinbase.js +460 -0
  41. package/dist/providers/hyperliquid.cjs +361 -0
  42. package/dist/providers/hyperliquid.d.cts +54 -0
  43. package/dist/providers/hyperliquid.d.ts +54 -0
  44. package/dist/providers/hyperliquid.js +359 -0
  45. package/dist/side-panel-CT9ZwIGz.d.cts +63 -0
  46. package/dist/side-panel-CT9ZwIGz.d.ts +63 -0
  47. package/dist/ui.cjs +1030 -0
  48. package/dist/ui.d.cts +188 -0
  49. package/dist/ui.d.ts +188 -0
  50. package/dist/ui.js +3 -0
  51. package/dist/vela.global.js +26509 -0
  52. package/dist/vela.global.min.js +230 -0
  53. package/dist/widget.cjs +31178 -0
  54. package/dist/widget.d.cts +799 -0
  55. package/dist/widget.d.ts +799 -0
  56. package/dist/widget.js +1060 -0
  57. package/dist/workspace.cjs +31692 -0
  58. package/dist/workspace.d.cts +579 -0
  59. package/dist/workspace.d.ts +579 -0
  60. package/dist/workspace.js +1694 -0
  61. package/package.json +95 -0
@@ -0,0 +1,76 @@
1
+ import { isDarkColor, mix, HIGHLIGHT, ACCENT_BRIGHT, ACCENT, withAlpha } from './chunk-GYD2THPV.js';
2
+
3
+ // src/core/tokens.ts
4
+ var STATIC_TOKENS = {
5
+ "--vela-space-1": "4px",
6
+ "--vela-space-2": "8px",
7
+ "--vela-space-3": "12px",
8
+ "--vela-space-4": "16px",
9
+ "--vela-radius-sm": "4px",
10
+ "--vela-radius-md": "6px",
11
+ "--vela-radius-lg": "10px",
12
+ "--vela-z-tooltip": "60",
13
+ "--vela-z-menu": "50",
14
+ "--vela-z-dialog": "40",
15
+ "--vela-ease": "cubic-bezier(0.22, 1, 0.36, 1)",
16
+ "--vela-dur-fast": "90ms",
17
+ "--vela-dur-med": "160ms",
18
+ "--vela-font-size-sm": "11px",
19
+ "--vela-font-size-md": "12px",
20
+ "--vela-font-size-lg": "14px"
21
+ };
22
+ function themeTokens(t) {
23
+ const dark = isDarkColor(t.background);
24
+ const wash = (a) => dark ? `rgba(255,255,255,${a})` : withAlpha(t.textColor, a + 0.02);
25
+ const elevated = mix(t.background, dark ? "#ffffff" : t.textColor, dark ? 0.03 : 0.05);
26
+ return {
27
+ "--vela-font": t.fontFamily,
28
+ "--vela-bg": t.background,
29
+ // Chrome text is slightly brighter than the chart's own axis text, which is
30
+ // deliberately recessive; the chart keeps using `t.textColor` directly.
31
+ "--vela-fg": dark ? "#d1d4dc" : t.textColor,
32
+ "--vela-fg-muted": dark ? "#868a96" : withAlpha(t.textColor, 0.62),
33
+ "--vela-fg-faint": withAlpha(t.textColor, 0.35),
34
+ "--vela-fg-bright": dark ? "#f0f3fa" : "#000000",
35
+ "--vela-surface": t.background,
36
+ // Panels and menus float ABOVE the chart, so their surface is the wash flattened onto
37
+ // the chart background — opaque, or candles read through the panel.
38
+ "--vela-surface-elev": elevated,
39
+ "--vela-surface-overlay": elevated,
40
+ // Recessed fields (inputs, selects) read as cut INTO their panel, so they fall back
41
+ // to the chart surface and are separated from the panel by their border alone.
42
+ "--vela-surface-sunken": t.background,
43
+ "--vela-border": t.borderColor,
44
+ "--vela-border-strong": dark ? "#34353b" : withAlpha(t.textColor, 0.28),
45
+ "--vela-border-soft": t.borderColor,
46
+ // Barely-there rules INSIDE a panel (row separators), where a full border would
47
+ // chop the list into boxes.
48
+ "--vela-border-faint": withAlpha(t.textColor, 0.08),
49
+ "--vela-hover": wash(0.06),
50
+ "--vela-active": wash(0.1),
51
+ // A deliberately stronger hover for rows inside an already-tinted surface (menu
52
+ // items in an active flyout), where the normal wash would not separate from it.
53
+ "--vela-hover-strong": wash(0.16),
54
+ "--vela-focus": withAlpha(t.textColor, 0.5),
55
+ "--vela-focus-soft": withAlpha(t.textColor, 0.12),
56
+ "--vela-scroll": withAlpha(t.textColor, 0.3),
57
+ "--vela-accent": ACCENT,
58
+ "--vela-accent-bright": ACCENT_BRIGHT,
59
+ "--vela-highlight": HIGHLIGHT,
60
+ // The inverse chip: a filled selected state (active tab, ticked checkbox). Its ink
61
+ // must contrast the fill, so the pair flips together with the theme.
62
+ "--vela-selected-bg": dark ? "#f0f3fa" : t.textColor,
63
+ "--vela-selected-fg": dark ? t.background : "#ffffff",
64
+ // Fixed ink for saturated fills (accent buttons, categorical avatars) — those fills
65
+ // are theme-independent, so their ink is too.
66
+ "--vela-fg-on-fill": "#ffffff",
67
+ "--vela-up": t.upColor,
68
+ "--vela-down": t.downColor,
69
+ "--vela-danger": t.downColor,
70
+ "--vela-shadow": "0 8px 30px rgba(0,0,0,0.5)",
71
+ "--vela-shadow-dialog": "0 20px 60px rgba(0,0,0,0.5)",
72
+ "--vela-backdrop": "rgba(0,0,0,0.45)"
73
+ };
74
+ }
75
+
76
+ export { STATIC_TOKENS, themeTokens };